summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaindropsSys <raindrops@equestria.dev>2024-02-05 23:25:57 +0100
committerRaindropsSys <raindrops@equestria.dev>2024-02-05 23:25:57 +0100
commit96af97255d5032930237e4203f6333a12c921b9a (patch)
tree6285728702066c7b7820d258e13c96220e01dce3
parente5e5aa2c92ce7694449c19b94dd2af0f41e93e3f (diff)
downloadchatroom-96af97255d5032930237e4203f6333a12c921b9a.tar.gz
chatroom-96af97255d5032930237e4203f6333a12c921b9a.tar.bz2
chatroom-96af97255d5032930237e4203f6333a12c921b9a.zip
Updated 11 files and added 340 files (automated)
-rw-r--r--.gitignore3
-rw-r--r--.idea/deployment.xml11
-rw-r--r--client/home.html14
-rw-r--r--client/icons/about.svg4
-rw-r--r--client/icons/vpn-off.svg3
-rw-r--r--client/icons/vpn-on.svg3
-rw-r--r--client/index.html74
-rwxr-xr-xclient/main.js192
-rw-r--r--client/node_modules/.package-lock.json20
-rwxr-xr-xclient/node_modules/@types/cacheable-request/LICENSE21
-rwxr-xr-xclient/node_modules/@types/cacheable-request/README.md16
-rwxr-xr-xclient/node_modules/@types/cacheable-request/index.d.ts137
-rwxr-xr-xclient/node_modules/@types/cacheable-request/package.json35
-rw-r--r--client/node_modules/@types/chrome/LICENSE21
-rw-r--r--client/node_modules/@types/chrome/README.md15
-rw-r--r--client/node_modules/@types/chrome/chrome-cast/index.d.ts1154
-rw-r--r--client/node_modules/@types/chrome/har-format/index.d.ts6
-rw-r--r--client/node_modules/@types/chrome/index.d.ts12592
-rw-r--r--client/node_modules/@types/chrome/package.json98
-rw-r--r--client/node_modules/@types/filesystem/LICENSE21
-rw-r--r--client/node_modules/@types/filesystem/README.md15
-rw-r--r--client/node_modules/@types/filesystem/index.d.ts564
-rw-r--r--client/node_modules/@types/filesystem/package.json26
-rw-r--r--client/node_modules/@types/filewriter/LICENSE21
-rw-r--r--client/node_modules/@types/filewriter/README.md15
-rw-r--r--client/node_modules/@types/filewriter/index.d.ts166
-rw-r--r--client/node_modules/@types/filewriter/package.json24
-rw-r--r--client/node_modules/@types/firefox-webext-browser/LICENSE21
-rw-r--r--client/node_modules/@types/firefox-webext-browser/README.md15
-rw-r--r--client/node_modules/@types/firefox-webext-browser/index.d.ts9332
-rw-r--r--client/node_modules/@types/firefox-webext-browser/package.json26
-rw-r--r--client/node_modules/@types/har-format/LICENSE21
-rw-r--r--client/node_modules/@types/har-format/README.md15
-rw-r--r--client/node_modules/@types/har-format/index.d.ts904
-rw-r--r--client/node_modules/@types/har-format/package.json31
-rw-r--r--client/node_modules/@types/http-cache-semantics/LICENSE21
-rw-r--r--client/node_modules/@types/http-cache-semantics/README.md15
-rw-r--r--client/node_modules/@types/http-cache-semantics/index.d.ts165
-rw-r--r--client/node_modules/@types/http-cache-semantics/package.json25
-rwxr-xr-xclient/node_modules/@types/keyv/LICENSE21
-rwxr-xr-xclient/node_modules/@types/keyv/README.md16
-rwxr-xr-xclient/node_modules/@types/keyv/index.d.ts90
-rwxr-xr-xclient/node_modules/@types/keyv/package.json32
-rw-r--r--client/node_modules/@types/node/LICENSE21
-rw-r--r--client/node_modules/@types/node/README.md15
-rw-r--r--client/node_modules/@types/node/assert.d.ts985
-rw-r--r--client/node_modules/@types/node/assert/strict.d.ts8
-rw-r--r--client/node_modules/@types/node/async_hooks.d.ts522
-rw-r--r--client/node_modules/@types/node/buffer.d.ts2321
-rw-r--r--client/node_modules/@types/node/child_process.d.ts1544
-rw-r--r--client/node_modules/@types/node/cluster.d.ts432
-rw-r--r--client/node_modules/@types/node/console.d.ts412
-rw-r--r--client/node_modules/@types/node/constants.d.ts19
-rw-r--r--client/node_modules/@types/node/crypto.d.ts4451
-rw-r--r--client/node_modules/@types/node/dgram.d.ts586
-rw-r--r--client/node_modules/@types/node/diagnostics_channel.d.ts192
-rw-r--r--client/node_modules/@types/node/dns.d.ts809
-rw-r--r--client/node_modules/@types/node/dns/promises.d.ts381
-rw-r--r--client/node_modules/@types/node/dom-events.d.ts122
-rw-r--r--client/node_modules/@types/node/domain.d.ts170
-rw-r--r--client/node_modules/@types/node/events.d.ts803
-rw-r--r--client/node_modules/@types/node/fs.d.ts4211
-rw-r--r--client/node_modules/@types/node/fs/promises.d.ts1205
-rw-r--r--client/node_modules/@types/node/globals.d.ts381
-rw-r--r--client/node_modules/@types/node/globals.global.d.ts1
-rw-r--r--client/node_modules/@types/node/http.d.ts1801
-rw-r--r--client/node_modules/@types/node/http2.d.ts2386
-rw-r--r--client/node_modules/@types/node/https.d.ts544
-rw-r--r--client/node_modules/@types/node/index.d.ts88
-rw-r--r--client/node_modules/@types/node/inspector.d.ts2739
-rw-r--r--client/node_modules/@types/node/module.d.ts262
-rw-r--r--client/node_modules/@types/node/net.d.ts913
-rw-r--r--client/node_modules/@types/node/os.d.ts473
-rw-r--r--client/node_modules/@types/node/package.json235
-rw-r--r--client/node_modules/@types/node/path.d.ts191
-rw-r--r--client/node_modules/@types/node/perf_hooks.d.ts626
-rw-r--r--client/node_modules/@types/node/process.d.ts1518
-rw-r--r--client/node_modules/@types/node/punycode.d.ts117
-rw-r--r--client/node_modules/@types/node/querystring.d.ts141
-rw-r--r--client/node_modules/@types/node/readline.d.ts666
-rw-r--r--client/node_modules/@types/node/readline/promises.d.ts143
-rw-r--r--client/node_modules/@types/node/repl.d.ts430
-rw-r--r--client/node_modules/@types/node/stream.d.ts1731
-rw-r--r--client/node_modules/@types/node/stream/consumers.d.ts12
-rw-r--r--client/node_modules/@types/node/stream/promises.d.ts83
-rw-r--r--client/node_modules/@types/node/stream/web.d.ts336
-rw-r--r--client/node_modules/@types/node/string_decoder.d.ts67
-rw-r--r--client/node_modules/@types/node/test.d.ts974
-rw-r--r--client/node_modules/@types/node/timers.d.ts126
-rw-r--r--client/node_modules/@types/node/timers/promises.d.ts93
-rw-r--r--client/node_modules/@types/node/tls.d.ts1191
-rw-r--r--client/node_modules/@types/node/trace_events.d.ts171
-rw-r--r--client/node_modules/@types/node/ts4.8/assert.d.ts985
-rw-r--r--client/node_modules/@types/node/ts4.8/assert/strict.d.ts8
-rw-r--r--client/node_modules/@types/node/ts4.8/async_hooks.d.ts522
-rw-r--r--client/node_modules/@types/node/ts4.8/buffer.d.ts2321
-rw-r--r--client/node_modules/@types/node/ts4.8/child_process.d.ts1544
-rw-r--r--client/node_modules/@types/node/ts4.8/cluster.d.ts432
-rw-r--r--client/node_modules/@types/node/ts4.8/console.d.ts412
-rw-r--r--client/node_modules/@types/node/ts4.8/constants.d.ts19
-rw-r--r--client/node_modules/@types/node/ts4.8/crypto.d.ts4450
-rw-r--r--client/node_modules/@types/node/ts4.8/dgram.d.ts586
-rw-r--r--client/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts192
-rw-r--r--client/node_modules/@types/node/ts4.8/dns.d.ts809
-rw-r--r--client/node_modules/@types/node/ts4.8/dns/promises.d.ts381
-rw-r--r--client/node_modules/@types/node/ts4.8/dom-events.d.ts122
-rw-r--r--client/node_modules/@types/node/ts4.8/domain.d.ts170
-rw-r--r--client/node_modules/@types/node/ts4.8/events.d.ts754
-rw-r--r--client/node_modules/@types/node/ts4.8/fs.d.ts4211
-rw-r--r--client/node_modules/@types/node/ts4.8/fs/promises.d.ts1205
-rw-r--r--client/node_modules/@types/node/ts4.8/globals.d.ts381
-rw-r--r--client/node_modules/@types/node/ts4.8/globals.global.d.ts1
-rw-r--r--client/node_modules/@types/node/ts4.8/http.d.ts1801
-rw-r--r--client/node_modules/@types/node/ts4.8/http2.d.ts2386
-rw-r--r--client/node_modules/@types/node/ts4.8/https.d.ts544
-rw-r--r--client/node_modules/@types/node/ts4.8/index.d.ts88
-rw-r--r--client/node_modules/@types/node/ts4.8/inspector.d.ts2739
-rw-r--r--client/node_modules/@types/node/ts4.8/module.d.ts262
-rw-r--r--client/node_modules/@types/node/ts4.8/net.d.ts913
-rw-r--r--client/node_modules/@types/node/ts4.8/os.d.ts473
-rw-r--r--client/node_modules/@types/node/ts4.8/path.d.ts191
-rw-r--r--client/node_modules/@types/node/ts4.8/perf_hooks.d.ts626
-rw-r--r--client/node_modules/@types/node/ts4.8/process.d.ts1518
-rw-r--r--client/node_modules/@types/node/ts4.8/punycode.d.ts117
-rw-r--r--client/node_modules/@types/node/ts4.8/querystring.d.ts141
-rw-r--r--client/node_modules/@types/node/ts4.8/readline.d.ts666
-rw-r--r--client/node_modules/@types/node/ts4.8/readline/promises.d.ts143
-rw-r--r--client/node_modules/@types/node/ts4.8/repl.d.ts430
-rw-r--r--client/node_modules/@types/node/ts4.8/stream.d.ts1731
-rw-r--r--client/node_modules/@types/node/ts4.8/stream/consumers.d.ts12
-rw-r--r--client/node_modules/@types/node/ts4.8/stream/promises.d.ts83
-rw-r--r--client/node_modules/@types/node/ts4.8/stream/web.d.ts336
-rw-r--r--client/node_modules/@types/node/ts4.8/string_decoder.d.ts67
-rw-r--r--client/node_modules/@types/node/ts4.8/test.d.ts974
-rw-r--r--client/node_modules/@types/node/ts4.8/timers.d.ts126
-rw-r--r--client/node_modules/@types/node/ts4.8/timers/promises.d.ts93
-rw-r--r--client/node_modules/@types/node/ts4.8/tls.d.ts1191
-rw-r--r--client/node_modules/@types/node/ts4.8/trace_events.d.ts171
-rw-r--r--client/node_modules/@types/node/ts4.8/tty.d.ts206
-rw-r--r--client/node_modules/@types/node/ts4.8/url.d.ts937
-rw-r--r--client/node_modules/@types/node/ts4.8/util.d.ts2078
-rw-r--r--client/node_modules/@types/node/ts4.8/v8.d.ts541
-rw-r--r--client/node_modules/@types/node/ts4.8/vm.d.ts663
-rw-r--r--client/node_modules/@types/node/ts4.8/wasi.d.ts158
-rw-r--r--client/node_modules/@types/node/ts4.8/worker_threads.d.ts692
-rw-r--r--client/node_modules/@types/node/ts4.8/zlib.d.ts517
-rw-r--r--client/node_modules/@types/node/tty.d.ts206
-rw-r--r--client/node_modules/@types/node/url.d.ts937
-rw-r--r--client/node_modules/@types/node/util.d.ts2078
-rw-r--r--client/node_modules/@types/node/v8.d.ts541
-rw-r--r--client/node_modules/@types/node/vm.d.ts663
-rw-r--r--client/node_modules/@types/node/wasi.d.ts158
-rw-r--r--client/node_modules/@types/node/worker_threads.d.ts692
-rw-r--r--client/node_modules/@types/node/zlib.d.ts517
-rw-r--r--client/node_modules/@types/responselike/LICENSE21
-rw-r--r--client/node_modules/@types/responselike/README.md48
-rw-r--r--client/node_modules/@types/responselike/index.d.ts29
-rw-r--r--client/node_modules/@types/responselike/package.json27
-rw-r--r--client/node_modules/@types/yauzl/LICENSE21
-rw-r--r--client/node_modules/@types/yauzl/README.md15
-rw-r--r--client/node_modules/@types/yauzl/index.d.ts110
-rw-r--r--client/node_modules/@types/yauzl/package.json27
-rw-r--r--client/node_modules/ws/LICENSE20
-rw-r--r--client/node_modules/ws/README.md549
-rw-r--r--client/node_modules/ws/browser.js8
-rw-r--r--client/node_modules/ws/index.js13
-rw-r--r--client/node_modules/ws/lib/buffer-util.js131
-rw-r--r--client/node_modules/ws/lib/constants.js12
-rw-r--r--client/node_modules/ws/lib/event-target.js292
-rw-r--r--client/node_modules/ws/lib/extension.js203
-rw-r--r--client/node_modules/ws/lib/limiter.js55
-rw-r--r--client/node_modules/ws/lib/permessage-deflate.js514
-rw-r--r--client/node_modules/ws/lib/receiver.js742
-rw-r--r--client/node_modules/ws/lib/sender.js477
-rw-r--r--client/node_modules/ws/lib/stream.js159
-rw-r--r--client/node_modules/ws/lib/subprotocol.js62
-rw-r--r--client/node_modules/ws/lib/validation.js130
-rw-r--r--client/node_modules/ws/lib/websocket-server.js539
-rw-r--r--client/node_modules/ws/lib/websocket.js1336
-rw-r--r--client/node_modules/ws/package.json68
-rw-r--r--client/node_modules/ws/wrapper.mjs8
-rw-r--r--client/package-lock.json23
-rw-r--r--client/package.json3
-rw-r--r--node_modules/.package-lock.json114
-rw-r--r--node_modules/asynckit/LICENSE21
-rw-r--r--node_modules/asynckit/README.md233
-rw-r--r--node_modules/asynckit/bench.js76
-rw-r--r--node_modules/asynckit/index.js6
-rw-r--r--node_modules/asynckit/lib/abort.js29
-rw-r--r--node_modules/asynckit/lib/async.js34
-rw-r--r--node_modules/asynckit/lib/defer.js26
-rw-r--r--node_modules/asynckit/lib/iterate.js75
-rw-r--r--node_modules/asynckit/lib/readable_asynckit.js91
-rw-r--r--node_modules/asynckit/lib/readable_parallel.js25
-rw-r--r--node_modules/asynckit/lib/readable_serial.js25
-rw-r--r--node_modules/asynckit/lib/readable_serial_ordered.js29
-rw-r--r--node_modules/asynckit/lib/state.js37
-rw-r--r--node_modules/asynckit/lib/streamify.js141
-rw-r--r--node_modules/asynckit/lib/terminator.js29
-rw-r--r--node_modules/asynckit/package.json63
-rw-r--r--node_modules/asynckit/parallel.js43
-rw-r--r--node_modules/asynckit/serial.js17
-rw-r--r--node_modules/asynckit/serialOrdered.js75
-rw-r--r--node_modules/asynckit/stream.js21
-rw-r--r--node_modules/axios/CHANGELOG.md855
-rw-r--r--node_modules/axios/LICENSE7
-rw-r--r--node_modules/axios/MIGRATION_GUIDE.md3
-rw-r--r--node_modules/axios/README.md1647
-rw-r--r--node_modules/axios/SECURITY.md6
-rw-r--r--node_modules/axios/dist/axios.js3422
-rw-r--r--node_modules/axios/dist/axios.js.map1
-rw-r--r--node_modules/axios/dist/axios.min.js2
-rw-r--r--node_modules/axios/dist/axios.min.js.map1
-rw-r--r--node_modules/axios/dist/browser/axios.cjs3258
-rw-r--r--node_modules/axios/dist/browser/axios.cjs.map1
-rw-r--r--node_modules/axios/dist/esm/axios.js3281
-rw-r--r--node_modules/axios/dist/esm/axios.js.map1
-rw-r--r--node_modules/axios/dist/esm/axios.min.js2
-rw-r--r--node_modules/axios/dist/esm/axios.min.js.map1
-rw-r--r--node_modules/axios/dist/node/axios.cjs4355
-rw-r--r--node_modules/axios/dist/node/axios.cjs.map1
-rw-r--r--node_modules/axios/index.d.cts542
-rw-r--r--node_modules/axios/index.d.ts559
-rw-r--r--node_modules/axios/index.js43
-rw-r--r--node_modules/axios/lib/adapters/README.md37
-rw-r--r--node_modules/axios/lib/adapters/adapters.js77
-rwxr-xr-xnode_modules/axios/lib/adapters/http.js685
-rw-r--r--node_modules/axios/lib/adapters/xhr.js260
-rw-r--r--node_modules/axios/lib/axios.js89
-rw-r--r--node_modules/axios/lib/cancel/CancelToken.js121
-rw-r--r--node_modules/axios/lib/cancel/CanceledError.js25
-rw-r--r--node_modules/axios/lib/cancel/isCancel.js5
-rw-r--r--node_modules/axios/lib/core/Axios.js225
-rw-r--r--node_modules/axios/lib/core/AxiosError.js100
-rw-r--r--node_modules/axios/lib/core/AxiosHeaders.js298
-rw-r--r--node_modules/axios/lib/core/InterceptorManager.js71
-rw-r--r--node_modules/axios/lib/core/README.md8
-rw-r--r--node_modules/axios/lib/core/buildFullPath.js21
-rw-r--r--node_modules/axios/lib/core/dispatchRequest.js81
-rw-r--r--node_modules/axios/lib/core/mergeConfig.js106
-rw-r--r--node_modules/axios/lib/core/settle.js27
-rw-r--r--node_modules/axios/lib/core/transformData.js28
-rw-r--r--node_modules/axios/lib/defaults/index.js156
-rw-r--r--node_modules/axios/lib/defaults/transitional.js7
-rw-r--r--node_modules/axios/lib/env/README.md3
-rw-r--r--node_modules/axios/lib/env/classes/FormData.js2
-rw-r--r--node_modules/axios/lib/env/data.js1
-rw-r--r--node_modules/axios/lib/helpers/AxiosTransformStream.js191
-rw-r--r--node_modules/axios/lib/helpers/AxiosURLSearchParams.js58
-rw-r--r--node_modules/axios/lib/helpers/HttpStatusCode.js71
-rw-r--r--node_modules/axios/lib/helpers/README.md7
-rw-r--r--node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js28
-rw-r--r--node_modules/axios/lib/helpers/bind.js7
-rw-r--r--node_modules/axios/lib/helpers/buildURL.js63
-rw-r--r--node_modules/axios/lib/helpers/callbackify.js16
-rw-r--r--node_modules/axios/lib/helpers/combineURLs.js15
-rw-r--r--node_modules/axios/lib/helpers/cookies.js42
-rw-r--r--node_modules/axios/lib/helpers/deprecatedMethod.js26
-rw-r--r--node_modules/axios/lib/helpers/formDataToJSON.js95
-rw-r--r--node_modules/axios/lib/helpers/formDataToStream.js111
-rw-r--r--node_modules/axios/lib/helpers/fromDataURI.js53
-rw-r--r--node_modules/axios/lib/helpers/isAbsoluteURL.js15
-rw-r--r--node_modules/axios/lib/helpers/isAxiosError.js14
-rw-r--r--node_modules/axios/lib/helpers/isURLSameOrigin.js67
-rw-r--r--node_modules/axios/lib/helpers/null.js2
-rw-r--r--node_modules/axios/lib/helpers/parseHeaders.js55
-rw-r--r--node_modules/axios/lib/helpers/parseProtocol.js6
-rw-r--r--node_modules/axios/lib/helpers/readBlob.js15
-rw-r--r--node_modules/axios/lib/helpers/speedometer.js55
-rw-r--r--node_modules/axios/lib/helpers/spread.js28
-rw-r--r--node_modules/axios/lib/helpers/throttle.js33
-rw-r--r--node_modules/axios/lib/helpers/toFormData.js219
-rw-r--r--node_modules/axios/lib/helpers/toURLEncodedForm.js18
-rw-r--r--node_modules/axios/lib/helpers/validator.js91
-rw-r--r--node_modules/axios/lib/platform/browser/classes/Blob.js3
-rw-r--r--node_modules/axios/lib/platform/browser/classes/FormData.js3
-rw-r--r--node_modules/axios/lib/platform/browser/classes/URLSearchParams.js4
-rw-r--r--node_modules/axios/lib/platform/browser/index.js13
-rw-r--r--node_modules/axios/lib/platform/common/utils.js47
-rw-r--r--node_modules/axios/lib/platform/index.js7
-rw-r--r--node_modules/axios/lib/platform/node/classes/FormData.js3
-rw-r--r--node_modules/axios/lib/platform/node/classes/URLSearchParams.js4
-rw-r--r--node_modules/axios/lib/platform/node/index.js12
-rw-r--r--node_modules/axios/lib/utils.js723
-rw-r--r--node_modules/axios/package.json218
-rw-r--r--node_modules/combined-stream/License19
-rw-r--r--node_modules/combined-stream/Readme.md138
-rw-r--r--node_modules/combined-stream/lib/combined_stream.js208
-rw-r--r--node_modules/combined-stream/package.json25
-rw-r--r--node_modules/combined-stream/yarn.lock17
-rw-r--r--node_modules/delayed-stream/.npmignore1
-rw-r--r--node_modules/delayed-stream/License19
-rw-r--r--node_modules/delayed-stream/Makefile7
-rw-r--r--node_modules/delayed-stream/Readme.md141
-rw-r--r--node_modules/delayed-stream/lib/delayed_stream.js107
-rw-r--r--node_modules/delayed-stream/package.json27
-rw-r--r--node_modules/follow-redirects/LICENSE18
-rw-r--r--node_modules/follow-redirects/README.md155
-rw-r--r--node_modules/follow-redirects/debug.js15
-rw-r--r--node_modules/follow-redirects/http.js1
-rw-r--r--node_modules/follow-redirects/https.js1
-rw-r--r--node_modules/follow-redirects/index.js672
-rw-r--r--node_modules/follow-redirects/package.json58
-rw-r--r--node_modules/form-data/License19
-rw-r--r--node_modules/form-data/README.md.bak358
-rw-r--r--node_modules/form-data/Readme.md358
-rw-r--r--node_modules/form-data/index.d.ts62
-rw-r--r--node_modules/form-data/lib/browser.js2
-rw-r--r--node_modules/form-data/lib/form_data.js501
-rw-r--r--node_modules/form-data/lib/populate.js10
-rw-r--r--node_modules/form-data/package.json68
-rw-r--r--node_modules/mime-db/HISTORY.md507
-rw-r--r--node_modules/mime-db/LICENSE23
-rw-r--r--node_modules/mime-db/README.md100
-rw-r--r--node_modules/mime-db/db.json8519
-rw-r--r--node_modules/mime-db/index.js12
-rw-r--r--node_modules/mime-db/package.json60
-rw-r--r--node_modules/mime-types/HISTORY.md397
-rw-r--r--node_modules/mime-types/LICENSE23
-rw-r--r--node_modules/mime-types/README.md113
-rw-r--r--node_modules/mime-types/index.js188
-rw-r--r--node_modules/mime-types/package.json44
-rw-r--r--node_modules/proxy-from-env/.eslintrc29
-rw-r--r--node_modules/proxy-from-env/.travis.yml10
-rw-r--r--node_modules/proxy-from-env/LICENSE20
-rw-r--r--node_modules/proxy-from-env/README.md131
-rw-r--r--node_modules/proxy-from-env/index.js108
-rw-r--r--node_modules/proxy-from-env/package.json34
-rw-r--r--node_modules/proxy-from-env/test.js483
-rw-r--r--node_modules/ws/LICENSE20
-rw-r--r--node_modules/ws/README.md549
-rw-r--r--node_modules/ws/browser.js8
-rw-r--r--node_modules/ws/index.js13
-rw-r--r--node_modules/ws/lib/buffer-util.js131
-rw-r--r--node_modules/ws/lib/constants.js12
-rw-r--r--node_modules/ws/lib/event-target.js292
-rw-r--r--node_modules/ws/lib/extension.js203
-rw-r--r--node_modules/ws/lib/limiter.js55
-rw-r--r--node_modules/ws/lib/permessage-deflate.js514
-rw-r--r--node_modules/ws/lib/receiver.js742
-rw-r--r--node_modules/ws/lib/sender.js477
-rw-r--r--node_modules/ws/lib/stream.js159
-rw-r--r--node_modules/ws/lib/subprotocol.js62
-rw-r--r--node_modules/ws/lib/validation.js130
-rw-r--r--node_modules/ws/lib/websocket-server.js539
-rw-r--r--node_modules/ws/lib/websocket.js1336
-rw-r--r--node_modules/ws/package.json68
-rw-r--r--node_modules/ws/wrapper.mjs8
-rw-r--r--package-lock.json183
-rw-r--r--package.json4
-rw-r--r--vpn/index.js66
351 files changed, 161653 insertions, 17 deletions
diff --git a/.gitignore b/.gitignore
index 831b442..9757cff 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,4 +10,5 @@ launcher/server/remote.lctsc
launcher/server/local.lctsc
debug
build
-bot/tokens.json \ No newline at end of file
+bot/tokens.json
+vpn/keys.json \ No newline at end of file
diff --git a/.idea/deployment.xml b/.idea/deployment.xml
index 399af87..0cc023b 100644
--- a/.idea/deployment.xml
+++ b/.idea/deployment.xml
@@ -1,11 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
- <component name="PublishConfigData" autoUpload="Always" serverName="bridlewood" autoUploadExternalChanges="true">
+ <component name="PublishConfigData" autoUpload="Always" serverName="maretimebay" autoUploadExternalChanges="true">
<serverData>
<paths name="bridlewood">
<serverdata>
<mappings>
- <mapping deploy="/home/fedora/bot" local="$PROJECT_DIR$/bot" web="/" />
+ <mapping deploy="/home/fedora/vpn" local="$PROJECT_DIR$/vpn" web="/" />
+ </mappings>
+ </serverdata>
+ </paths>
+ <paths name="maretimebay">
+ <serverdata>
+ <mappings>
+ <mapping deploy="/root/vpn" local="$PROJECT_DIR$" web="/" />
</mappings>
</serverdata>
</paths>
diff --git a/client/home.html b/client/home.html
index 617a042..257a47f 100644
--- a/client/home.html
+++ b/client/home.html
@@ -30,6 +30,20 @@
<h3>What's new in Chatroom?</h3>
+ <h5>Chatroom 2.6.2</h5>
+ <ul>
+ <li>This is just an update to get a few upcoming features working, nothing to see here</li>
+ </ul>
+
+ <h5>Chatroom 2.6.1</h5>
+ <ul>
+ <li>Fixed a bug that made it impossible to quit Chatroom on non-macOS platforms</li>
+ <li>Fixed a long-lasting bug that made the chat appear slightly off after starting up</li>
+ <li>Removed the ability to have multiple instances of Chatroom open</li>
+ <li>Added an option to show the About dialog on the tab bar</li>
+ <li>Added an option to show the system emoji picker on macOS and Windows in the right click menu</li>
+ </ul>
+
<h5>Chatroom 2.6.0</h5>
<ul>
<li>Fixed a bug that was causing some buttons to be hidden below the window controls on Windows</li>
diff --git a/client/icons/about.svg b/client/icons/about.svg
new file mode 100644
index 0000000..e2b50eb
--- /dev/null
+++ b/client/icons/about.svg
@@ -0,0 +1,4 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-info-circle" viewBox="0 0 16 16">
+ <path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14m0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16"/>
+ <path d="m8.93 6.588-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275 0-.375-.193-.304-.533zM9 4.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0"/>
+</svg> \ No newline at end of file
diff --git a/client/icons/vpn-off.svg b/client/icons/vpn-off.svg
new file mode 100644
index 0000000..4dda5e9
--- /dev/null
+++ b/client/icons/vpn-off.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-unlock" viewBox="0 0 16 16">
+ <path d="M11 1a2 2 0 0 0-2 2v4a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h5V3a3 3 0 0 1 6 0v4a.5.5 0 0 1-1 0V3a2 2 0 0 0-2-2M3 8a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V9a1 1 0 0 0-1-1z"/>
+</svg> \ No newline at end of file
diff --git a/client/icons/vpn-on.svg b/client/icons/vpn-on.svg
new file mode 100644
index 0000000..9c730b7
--- /dev/null
+++ b/client/icons/vpn-on.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-lock" viewBox="0 0 16 16">
+ <path d="M8 1a2 2 0 0 1 2 2v4H6V3a2 2 0 0 1 2-2m3 6V3a3 3 0 0 0-6 0v4a2 2 0 0 0-2 2v5a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2M5 8h6a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1"/>
+</svg> \ No newline at end of file
diff --git a/client/index.html b/client/index.html
index d95083f..30c629f 100644
--- a/client/index.html
+++ b/client/index.html
@@ -130,7 +130,9 @@
window.tabs = [];
window.activeTab = -1;
window.protectionEnabled = localStorage.getItem("protection-status") !== "false";
+ window.vpnEnabled = localStorage.getItem("vpn-status") === "true";
refreshInternalProtection();
+ refreshInternalVPN();
function toggleProtection() {
window.protectionEnabled = !window.protectionEnabled;
@@ -147,6 +149,21 @@
}
}
+ function toggleVPN() {
+ window.vpnEnabled = !window.vpnEnabled;
+ localStorage.setItem("vpn-status", JSON.stringify(window.vpnEnabled));
+ refreshInternalVPN();
+ refreshTabBar();
+ }
+
+ function refreshInternalVPN() {
+ if (window.vpnEnabled) {
+ ipcRenderer.send("enable-vpn");
+ } else {
+ ipcRenderer.send("disable-vpn");
+ }
+ }
+
function refreshTabBar() {
console.log(window.activeTab);
let id = window.activeTab;
@@ -167,6 +184,10 @@
<a class="nav-link" aria-current="page" href="#" onclick="openHome();"><img alt="" src="./icons/new.svg"></a>
</li></span><span><li class="nav-item" style="width: max-content; display: inline-block;">
<a class="nav-link" aria-current="page" href="#" onclick="toggleProtection();"><img id="ad-protection-img" alt="" src="./icons/${window.protectionEnabled ? 'shield-on' : 'shield-off'}.svg"></a>
+ </li>${localStorage.getItem('vpn-trial') === "true" ? `<li class="nav-item" style="width: max-content; display: inline-block;">
+ <a class="nav-link" aria-current="page" href="#" onclick="toggleVPN();"><span style="width: 4px; display: inline-grid; grid-template-rows: 4px 4px 4px; position: relative; left: -5px; top: -7px; height: 10px; grid-gap: 2px;"><span id="vpn-tx" style="background-color: #ddd; aspect-ratio: 1; border-radius: 999px;"></span><span id="vpn-rx" style="background-color: #ddd; aspect-ratio: 1; border-radius: 999px;"></span><span id="vpn-ex" style="background-color: #ddd; aspect-ratio: 1; border-radius: 999px;"></span></span><img id="vpn-protection-img" alt="" src="./icons/${window.vpnEnabled ? 'vpn-on' : 'vpn-off'}.svg"></a>
+ </li>` : ""}<li class="nav-item" style="width: max-content; display: inline-block;">
+ <a class="nav-link" aria-current="page" href="#" onclick="openAbout();"><img alt="" src="./icons/about.svg"></a>
</li></span></div>`;
if (tabs[window.activeTab]) document.title = tabs[window.activeTab].name + " · Chatroom Workspace";
@@ -175,6 +196,10 @@
let lastTabHeightUpdateCount = tabs.length;
+ function openAbout() {
+ ipcRenderer.send("about");
+ }
+
function secureTabHeight(force) {
let first = false;
let i = 0;
@@ -268,6 +293,7 @@
icon: "./icons/placeholder.svg",
name: "New Tab",
url,
+ fixed: null,
webview: container,
id: crypto.randomUUID(),
chat: url.includes("school.equestria.dev")
@@ -371,6 +397,16 @@
console.log("<", id);
window.activeTab = id;
refreshTabBar();
+
+ if (!tabs[id].fixed && tabs[id].chat) {
+ tabs[id].webview.children[1].style.height = "0";
+
+ setTimeout(() => {
+ tabs[id].webview.children[1].style.height = "100%";
+ }, 100);
+
+ tabs[id].fixed = true;
+ }
}
function reloadTab(id) {
@@ -454,7 +490,45 @@
window.onload = () => {
openTab("https://school.equestria.dev");
openHome();
+ tabs[0].fixed = false;
}
+
+ let vpnTxTimeout = null;
+ let vpnRxTimeout = null;
+ let vpnExTimeout = null;
+
+ ipcRenderer.on('vpn-send', () => {
+ console.log("[VPN] Sent packet");
+
+ clearTimeout(vpnTxTimeout);
+ document.getElementById("vpn-tx").style.backgroundColor = "red";
+
+ vpnTxTimeout = setTimeout(() => {
+ document.getElementById("vpn-tx").style.backgroundColor = "#ddd";
+ }, 50);
+ });
+
+ ipcRenderer.on('vpn-receive', () => {
+ console.log("[VPN] Received packet");
+
+ clearTimeout(vpnRxTimeout);
+ document.getElementById("vpn-rx").style.backgroundColor = "green";
+
+ vpnRxTimeout = setTimeout(() => {
+ document.getElementById("vpn-rx").style.backgroundColor = "#ddd";
+ }, 50);
+ });
+
+ ipcRenderer.on('vpn-error', () => {
+ console.log("[VPN] Transmit error");
+
+ clearTimeout(vpnExTimeout);
+ document.getElementById("vpn-ex").style.backgroundColor = "blue";
+
+ vpnExTimeout = setTimeout(() => {
+ document.getElementById("vpn-ex").style.backgroundColor = "#ddd";
+ }, 500);
+ });
</script>
</body>
</html> \ No newline at end of file
diff --git a/client/main.js b/client/main.js
index 000d903..c991f3c 100755
--- a/client/main.js
+++ b/client/main.js
@@ -2,14 +2,27 @@
const buildNumber = "main";
// --- >FINAL< @BUILDNUMBER@ >FINAL< --- //
-const version = "2.6.0";
+const version = "2.6.2";
-const { app, BrowserWindow, webContents, globalShortcut, nativeTheme, ipcMain, session, dialog, MenuItem, Menu, desktopCapturer, clipboard, nativeImage } = require('electron');
+const { protocol, app, BrowserWindow, webContents, globalShortcut, nativeTheme, ipcMain, session, dialog, MenuItem, Menu, desktopCapturer, clipboard, nativeImage } = require('electron');
const path = require('path');
const os = require("os");
const {appendFileSync, writeFileSync, existsSync, unlinkSync} = require("fs");
const fs = require("fs");
+if (!app.requestSingleInstanceLock()) {
+ dialog.showMessageBoxSync({
+ type: "warning",
+ message: "Chatroom is already running",
+ detail: "Another instance of Chatroom is already running and might not be responding. Please wait or use your system's activity monitor or task manager to terminate the other instance.",
+ noLink: true,
+ buttons: ["Quit"]
+ });
+
+ try { loaderWindow.destroy(); } catch (e) {}
+ app.quit();
+}
+
app.setName("Chatroom");
app.setAboutPanelOptions({
applicationName: "Chatroom",
@@ -213,6 +226,7 @@ ipcMain.on('disable-protection', () => {
session.defaultSession.setUserAgent(session.defaultSession.getUserAgent().replace(/(.*)( Electron\/(.*) )/gm, "$1 ").replace(/(.*)( Chatroom\/(.*) )/gm, "$1 ") + " Chatroom/" + version);
let localchatDataRoot = (os.platform() === "win32" ? os.homedir() + "/AppData/Roaming" : (os.platform() === "darwin" ? os.homedir() + "/Library/Application Support" : os.homedir())) + (os.platform() === "darwin" ? "/ChatroomWorkspace" : "/.chatroom-workspace");
+console.log(localchatDataRoot);
if (!fs.existsSync(localchatDataRoot)) fs.mkdirSync(localchatDataRoot);
if (!fs.existsSync(localchatDataRoot + "/session")) fs.mkdirSync(localchatDataRoot + "/session");
@@ -223,6 +237,144 @@ app.setPath("userData", localchatDataRoot + "/data");
app.setPath("sessionData", localchatDataRoot + "/session");
app.setAppLogsPath(localchatDataRoot + "/logs");
+if (!fs.existsSync(localchatDataRoot + "/data/vpnKey.bin")) {
+ fs.writeFileSync(localchatDataRoot + "/data/vpnKey.bin", require('crypto').randomBytes(1024));
+}
+
+const { WebSocket } = require('ws');
+
+function vpnWS() {
+ global.ws = new WebSocket('wss://school.equestria.dev/_vpn');
+ ws['handlers'] = {};
+
+ ws.on('error', (error) => {
+ if (mainWindow) mainWindow.webContents.send("vpn-error");
+ console.error(error);
+ });
+
+ ws.on('open', () => {
+ if (mainWindow) mainWindow.webContents.send("vpn-send");
+ ws.send(JSON.stringify({
+ key: fs.readFileSync(localchatDataRoot + "/data/vpnKey.bin").toString('base64')
+ }));
+ });
+
+ ws.on('message', (_data) => {
+ if (mainWindow) mainWindow.webContents.send("vpn-receive");
+ let data = JSON.parse(_data);
+
+ if (data['_id'] && ws['handlers'][data['_id']]) {
+ ws['handlers'][data['_id']](data);
+ }
+ });
+
+ ws.on('close', () => {
+ if (mainWindow) mainWindow.webContents.send("vpn-error");
+
+ setTimeout(() => {
+ vpnWS();
+ }, 1000);
+ })
+}
+
+vpnWS();
+
+let protocolIntercept = (request, result) => {
+ try {
+ if (!global['ws'] || global['ws'].readyState !== WebSocket.OPEN) throw new Error("Proxy is not connected");
+ let id = require('crypto').randomUUID();
+
+ global['ws']['handlers'][id] = (data) => {
+ global['ws']['handlers'][id] = null;
+
+ if (data.error !== null && data.error !== undefined) {
+ console.log("Error " + data.error + " during request to " + request.url);
+ if (mainWindow) mainWindow.webContents.send("vpn-error");
+ return result({
+ statusCode: 502,
+ data: Buffer.from(`<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport"
+ content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
+ <meta http-equiv="X-UA-Compatible" content="ie=edge">
+ <title>502 Bad Gateway</title>
+</head>
+<body style="background-color: white;">
+ <h1>502 Bad Gateway</h1>
+ <p>The Chatroom VPN has encountered an error while trying to process this request and cannot proceed at this time. Please contact your administrator. Error code: ${data.error}</p>
+</body>
+</html>`)
+ });
+ } else {
+ if (data.data) {
+ data.data = Buffer.from(data.data, "base64");
+ }
+
+ result(data);
+ }
+ }
+
+ if (mainWindow) mainWindow.webContents.send("vpn-send");
+
+ if (request.url.includes("www.youtube.com")) {
+ if (!request.headers["cookie"]) {
+ request.headers["cookie"] = "SOCS=CAESEwgDEgk2MDQxNjg5NDkaAmVuIAEaBgiAyoCuBg";
+ } else {
+ request.headers["cookie"] += "; SOCS=CAESEwgDEgk2MDQxNjg5NDkaAmVuIAEaBgiAyoCuBg";
+ }
+ }
+
+ request.headers["accept-language"] = "en-US,en;q=0.5";
+
+ global['ws'].send(JSON.stringify({
+ _id: id,
+ url: request.url,
+ referrer: request.referrer,
+ method: request.method,
+ headers: request.headers,
+ uploadData: request.uploadData?.map(i => {
+ return {
+ bytes: i.bytes.toString('base64'),
+ file: i.file,
+ blobUUID: i.blobUUID
+ }
+ })
+ }));
+ } catch (e) {
+ if (mainWindow) mainWindow.webContents.send("vpn-error");
+ console.error(e);
+ return result({
+ statusCode: 407,
+ data: Buffer.from(`<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport"
+ content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
+ <meta http-equiv="X-UA-Compatible" content="ie=edge">
+ <title>407 Proxy Authentication Required</title>
+</head>
+<body style="background-color: white;">
+ <h1>407 Proxy Authentication Required</h1>
+ <p>This client is currently not connected or authenticated with the Chatroom VPN, or the server has timed out. Please contact your administrator.</p>
+</body>
+</html>`)
+ });
+ }
+}
+
+ipcMain.on('enable-vpn', () => {
+ protocol.interceptBufferProtocol('http', protocolIntercept);
+ protocol.interceptBufferProtocol('https', protocolIntercept);
+});
+
+ipcMain.on('disable-vpn', () => {
+ protocol.uninterceptProtocol("http");
+ protocol.uninterceptProtocol("https");
+});
+
if (require('os').platform() !== "darwin" && require('os').platform() !== "win32" && require('os').platform() !== "linux") return;
global.windows = [];
@@ -231,9 +383,9 @@ if (!global._localchatPath) {
global._localchatPath = __dirname;
}
-app.on('before-quit', (event) => {
- if (dialog.showMessageBoxSync({
- type: "error",
+/*app.on('before-quit', (event) => {
+ if (dialog.showMessageBoxSync(global.mainWindow ?? null, {
+ type: "warning",
message: "Quit Chatroom?",
detail: "Are you sure you want to quit Chatroom? Unsaved data will be lost.",
noLink: true,
@@ -241,7 +393,7 @@ app.on('before-quit', (event) => {
}) === 1) {
event.preventDefault();
}
-});
+});*/
const createWindow = () => {
app.setPath("userData", localchatDataRoot);
@@ -280,6 +432,18 @@ const createWindow = () => {
}
});
+ mainWindow.on('close', (event) => {
+ if (dialog.showMessageBoxSync(global.mainWindow ?? null, {
+ type: "warning",
+ message: "Quit Chatroom?",
+ detail: "Are you sure you want to quit Chatroom? Unsaved data will be lost.",
+ noLink: true,
+ buttons: ["Yes", "No"]
+ }) === 1) {
+ event.preventDefault();
+ }
+ });
+
if (global.nextGenChatroom) {
mainWindow.loadFile(global._localchatPath + "/index.html");
} else {
@@ -454,7 +618,11 @@ app.whenReady().then(() => {
});
app.on('window-all-closed', () => {
- if (process.platform !== 'darwin' || !global.nextGenChatroom) app.quit();
+ app.quit();
+});
+
+ipcMain.on('about', () => {
+ app.showAboutPanel();
});
ipcMain.on('menu', (_, params) => {
@@ -552,6 +720,16 @@ ipcMain.on('menu', (_, params) => {
}
});
+ if (process.platform === "darwin" || process.platform === "win32") {
+ items.push({
+ enabled: params.editFlags.canEditRichly || params.editFlags.canPaste || params.editFlags.canDelete || params.editFlags.canUndo || params.editFlags.canRedo,
+ label: "Open Emoji Picker",
+ click: () => {
+ app.showEmojiPanel();
+ }
+ });
+ }
+
items.push({
type: "separator"
});
diff --git a/client/node_modules/.package-lock.json b/client/node_modules/.package-lock.json
index 0d3657e..273c3bd 100644
--- a/client/node_modules/.package-lock.json
+++ b/client/node_modules/.package-lock.json
@@ -1015,6 +1015,26 @@
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==",
"peer": true
},
+ "node_modules/ws": {
+ "version": "8.16.0",
+ "resolved": "https://registry.npmjs.org/ws/-/ws-8.16.0.tgz",
+ "integrity": "sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ==",
+ "engines": {
+ "node": ">=10.0.0"
+ },
+ "peerDependencies": {
+ "bufferutil": "^4.0.1",
+ "utf-8-validate": ">=5.0.2"
+ },
+ "peerDependenciesMeta": {
+ "bufferutil": {
+ "optional": true
+ },
+ "utf-8-validate": {
+ "optional": true
+ }
+ }
+ },
"node_modules/yallist": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
diff --git a/client/node_modules/@types/cacheable-request/LICENSE b/client/node_modules/@types/cacheable-request/LICENSE
new file mode 100755
index 0000000..9e841e7
--- /dev/null
+++ b/client/node_modules/@types/cacheable-request/LICENSE
@@ -0,0 +1,21 @@
+ MIT License
+
+ Copyright (c) Microsoft Corporation.
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE
diff --git a/client/node_modules/@types/cacheable-request/README.md b/client/node_modules/@types/cacheable-request/README.md
new file mode 100755
index 0000000..e87128e
--- /dev/null
+++ b/client/node_modules/@types/cacheable-request/README.md
@@ -0,0 +1,16 @@
+# Installation
+> `npm install --save @types/cacheable-request`
+
+# Summary
+This package contains type definitions for cacheable-request (https://github.com/lukechilds/cacheable-request#readme).
+
+# Details
+Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/cacheable-request.
+
+### Additional Details
+ * Last updated: Wed, 09 Nov 2022 16:32:53 GMT
+ * Dependencies: [@types/http-cache-semantics](https://npmjs.com/package/@types/http-cache-semantics), [@types/keyv](https://npmjs.com/package/@types/keyv), [@types/node](https://npmjs.com/package/@types/node), [@types/responselike](https://npmjs.com/package/@types/responselike)
+ * Global values: none
+
+# Credits
+These definitions were written by [BendingBender](https://github.com/BendingBender), and [Paul Melnikow](https://github.com/paulmelnikow).
diff --git a/client/node_modules/@types/cacheable-request/index.d.ts b/client/node_modules/@types/cacheable-request/index.d.ts
new file mode 100755
index 0000000..832f9b9
--- /dev/null
+++ b/client/node_modules/@types/cacheable-request/index.d.ts
@@ -0,0 +1,137 @@
+// Type definitions for cacheable-request 6.0
+// Project: https://github.com/lukechilds/cacheable-request#readme
+// Definitions by: BendingBender <https://github.com/BendingBender>
+// Paul Melnikow <https://github.com/paulmelnikow>
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+// TypeScript Version: 2.3
+
+/// <reference types="node" />
+
+import { request, RequestOptions, ClientRequest, ServerResponse } from 'http';
+import { URL } from 'url';
+import { EventEmitter } from 'events';
+import { Store } from 'keyv';
+import { Options as CacheSemanticsOptions } from 'http-cache-semantics';
+import ResponseLike = require('responselike');
+
+export = CacheableRequest;
+
+declare const CacheableRequest: CacheableRequest;
+
+type RequestFn = typeof request;
+
+interface CacheableRequest {
+ new (requestFn: RequestFn, storageAdapter?: string | CacheableRequest.StorageAdapter): (
+ opts: string | URL | (RequestOptions & CacheSemanticsOptions),
+ cb?: (response: ServerResponse | ResponseLike) => void
+ ) => CacheableRequest.Emitter;
+
+ RequestError: typeof RequestErrorCls;
+ CacheError: typeof CacheErrorCls;
+}
+
+declare namespace CacheableRequest {
+ type StorageAdapter = Store<any>;
+
+ interface Options {
+ /**
+ * If the cache should be used. Setting this to `false` will completely bypass the cache for the current request.
+ * @default true
+ */
+ cache?: boolean | undefined;
+
+ /**
+ * If set to `true` once a cached resource has expired it is deleted and will have to be re-requested.
+ *
+ * If set to `false`, after a cached resource's TTL expires it is kept in the cache and will be revalidated
+ * on the next request with `If-None-Match`/`If-Modified-Since` headers.
+ * @default false
+ */
+ strictTtl?: boolean | undefined;
+
+ /**
+ * Limits TTL. The `number` represents milliseconds.
+ * @default undefined
+ */
+ maxTtl?: number | undefined;
+
+ /**
+ * When set to `true`, if the DB connection fails we will automatically fallback to a network request.
+ * DB errors will still be emitted to notify you of the problem even though the request callback may succeed.
+ * @default false
+ */
+ automaticFailover?: boolean | undefined;
+
+ /**
+ * Forces refreshing the cache. If the response could be retrieved from the cache, it will perform a
+ * new request and override the cache instead.
+ * @default false
+ */
+ forceRefresh?: boolean | undefined;
+ }
+
+ interface Emitter extends EventEmitter {
+ addListener(event: 'request', listener: (request: ClientRequest) => void): this;
+ addListener(
+ event: 'response',
+ listener: (response: ServerResponse | ResponseLike) => void
+ ): this;
+ addListener(event: 'error', listener: (error: RequestError | CacheError) => void): this;
+ on(event: 'request', listener: (request: ClientRequest) => void): this;
+ on(event: 'response', listener: (response: ServerResponse | ResponseLike) => void): this;
+ on(event: 'error', listener: (error: RequestError | CacheError) => void): this;
+ once(event: 'request', listener: (request: ClientRequest) => void): this;
+ once(event: 'response', listener: (response: ServerResponse | ResponseLike) => void): this;
+ once(event: 'error', listener: (error: RequestError | CacheError) => void): this;
+ prependListener(event: 'request', listener: (request: ClientRequest) => void): this;
+ prependListener(
+ event: 'response',
+ listener: (response: ServerResponse | ResponseLike) => void
+ ): this;
+ prependListener(event: 'error', listener: (error: RequestError | CacheError) => void): this;
+ prependOnceListener(event: 'request', listener: (request: ClientRequest) => void): this;
+ prependOnceListener(
+ event: 'response',
+ listener: (response: ServerResponse | ResponseLike) => void
+ ): this;
+ prependOnceListener(
+ event: 'error',
+ listener: (error: RequestError | CacheError) => void
+ ): this;
+ removeListener(event: 'request', listener: (request: ClientRequest) => void): this;
+ removeListener(
+ event: 'response',
+ listener: (response: ServerResponse | ResponseLike) => void
+ ): this;
+ removeListener(event: 'error', listener: (error: RequestError | CacheError) => void): this;
+ off(event: 'request', listener: (request: ClientRequest) => void): this;
+ off(event: 'response', listener: (response: ServerResponse | ResponseLike) => void): this;
+ off(event: 'error', listener: (error: RequestError | CacheError) => void): this;
+ removeAllListeners(event?: 'request' | 'response' | 'error'): this;
+ listeners(event: 'request'): Array<(request: ClientRequest) => void>;
+ listeners(event: 'response'): Array<(response: ServerResponse | ResponseLike) => void>;
+ listeners(event: 'error'): Array<(error: RequestError | CacheError) => void>;
+ rawListeners(event: 'request'): Array<(request: ClientRequest) => void>;
+ rawListeners(event: 'response'): Array<(response: ServerResponse | ResponseLike) => void>;
+ rawListeners(event: 'error'): Array<(error: RequestError | CacheError) => void>;
+ emit(event: 'request', request: ClientRequest): boolean;
+ emit(event: 'response', response: ServerResponse | ResponseLike): boolean;
+ emit(event: 'error', error: RequestError | CacheError): boolean;
+ eventNames(): Array<'request' | 'response' | 'error'>;
+ listenerCount(type: 'request' | 'response' | 'error'): number;
+ }
+
+ type RequestError = RequestErrorCls;
+ type CacheError = CacheErrorCls;
+}
+
+declare class RequestErrorCls extends Error {
+ readonly name: 'RequestError';
+
+ constructor(error: Error);
+}
+declare class CacheErrorCls extends Error {
+ readonly name: 'CacheError';
+
+ constructor(error: Error);
+}
diff --git a/client/node_modules/@types/cacheable-request/package.json b/client/node_modules/@types/cacheable-request/package.json
new file mode 100755
index 0000000..31742dd
--- /dev/null
+++ b/client/node_modules/@types/cacheable-request/package.json
@@ -0,0 +1,35 @@
+{
+ "name": "@types/cacheable-request",
+ "version": "6.0.3",
+ "description": "TypeScript definitions for cacheable-request",
+ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/cacheable-request",
+ "license": "MIT",
+ "contributors": [
+ {
+ "name": "BendingBender",
+ "url": "https://github.com/BendingBender",
+ "githubUsername": "BendingBender"
+ },
+ {
+ "name": "Paul Melnikow",
+ "url": "https://github.com/paulmelnikow",
+ "githubUsername": "paulmelnikow"
+ }
+ ],
+ "main": "",
+ "types": "index.d.ts",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
+ "directory": "types/cacheable-request"
+ },
+ "scripts": {},
+ "dependencies": {
+ "@types/http-cache-semantics": "*",
+ "@types/keyv": "^3.1.4",
+ "@types/node": "*",
+ "@types/responselike": "^1.0.0"
+ },
+ "typesPublisherContentHash": "9345f1216c9d26f9046880c34f6329b2874405d68cf13d1f1f771fbb4d96549f",
+ "typeScriptVersion": "4.1"
+} \ No newline at end of file
diff --git a/client/node_modules/@types/chrome/LICENSE b/client/node_modules/@types/chrome/LICENSE
new file mode 100644
index 0000000..9e841e7
--- /dev/null
+++ b/client/node_modules/@types/chrome/LICENSE
@@ -0,0 +1,21 @@
+ MIT License
+
+ Copyright (c) Microsoft Corporation.
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE
diff --git a/client/node_modules/@types/chrome/README.md b/client/node_modules/@types/chrome/README.md
new file mode 100644
index 0000000..c0c65ab
--- /dev/null
+++ b/client/node_modules/@types/chrome/README.md
@@ -0,0 +1,15 @@
+# Installation
+> `npm install --save @types/chrome`
+
+# Summary
+This package contains type definitions for chrome (http://developer.chrome.com/extensions/).
+
+# Details
+Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/chrome.
+
+### Additional Details
+ * Last updated: Tue, 17 Oct 2023 22:10:14 GMT
+ * Dependencies: [@types/filesystem](https://npmjs.com/package/@types/filesystem), [@types/har-format](https://npmjs.com/package/@types/har-format)
+
+# Credits
+These definitions were written by [Matthew Kimber](https://github.com/matthewkimber), [otiai10](https://github.com/otiai10), [sreimer15](https://github.com/sreimer15), [MatCarlson](https://github.com/MatCarlson), [ekinsol](https://github.com/ekinsol), [Brian Wilson](https://github.com/echoabstract), [Sebastiaan Pasma](https://github.com/spasma), [bdbai](https://github.com/bdbai), [pokutuna](https://github.com/pokutuna), [Jason Xian](https://github.com/JasonXian), [userTim](https://github.com/usertim), [Idan Zeierman](https://github.com/idan315), [Nicolas Rodriguez](https://github.com/nicolas377), [Ido Salomon](https://github.com/idosal), and [Federico Brigante](https://github.com/fregante).
diff --git a/client/node_modules/@types/chrome/chrome-cast/index.d.ts b/client/node_modules/@types/chrome/chrome-cast/index.d.ts
new file mode 100644
index 0000000..1f50e17
--- /dev/null
+++ b/client/node_modules/@types/chrome/chrome-cast/index.d.ts
@@ -0,0 +1,1154 @@
+////////////////////
+// Cast
+// @see https://code.google.com/p/chromium/codesearch#chromium/src/ui/file_manager/externs/chrome_cast.js
+////////////////////
+declare namespace chrome.cast {
+ /**
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.AutoJoinPolicy
+ */
+ export enum AutoJoinPolicy {
+ CUSTOM_CONTROLLER_SCOPED = "custom_controller_scoped",
+ TAB_AND_ORIGIN_SCOPED = "tab_and_origin_scoped",
+ ORIGIN_SCOPED = "origin_scoped",
+ PAGE_SCOPED = "page_scoped",
+ }
+
+ /**
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.DefaultActionPolicy
+ */
+ export enum DefaultActionPolicy {
+ CREATE_SESSION = "create_session",
+ CAST_THIS_TAB = "cast_this_tab",
+ }
+
+ /**
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.Capability
+ */
+ export enum Capability {
+ VIDEO_OUT = "video_out",
+ AUDIO_OUT = "audio_out",
+ VIDEO_IN = "video_in",
+ AUDIO_IN = "audio_in",
+ MULTIZONE_GROUP = "multizone_group",
+ }
+
+ /**
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.ErrorCode
+ */
+ export enum ErrorCode {
+ CANCEL = "cancel",
+ TIMEOUT = "timeout",
+ API_NOT_INITIALIZED = "api_not_initialized",
+ INVALID_PARAMETER = "invalid_parameter",
+ EXTENSION_NOT_COMPATIBLE = "extension_not_compatible",
+ EXTENSION_MISSING = "extension_missing",
+ RECEIVER_UNAVAILABLE = "receiver_unavailable",
+ SESSION_ERROR = "session_error",
+ CHANNEL_ERROR = "channel_error",
+ LOAD_MEDIA_FAILED = "load_media_failed",
+ }
+
+ /**
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.ReceiverAvailability
+ */
+ export enum ReceiverAvailability {
+ AVAILABLE = "available",
+ UNAVAILABLE = "unavailable",
+ }
+
+ /**
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.SenderPlatform
+ */
+ export enum SenderPlatform {
+ CHROME = "chrome",
+ IOS = "ios",
+ ANDROID = "android",
+ }
+
+ /**
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.ReceiverType
+ */
+ export enum ReceiverType {
+ CAST = "cast",
+ DIAL = "dial",
+ HANGOUT = "hangout",
+ CUSTOM = "custom",
+ }
+
+ /**
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.ReceiverAction
+ */
+ export enum ReceiverAction {
+ CAST = "cast",
+ STOP = "stop",
+ }
+
+ /**
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.SessionStatus
+ */
+ export enum SessionStatus {
+ CONNECTED = "connected",
+ DISCONNECTED = "disconnected",
+ STOPPED = "stopped",
+ }
+
+ /**
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.VERSION
+ */
+ export var VERSION: Array<number>;
+
+ /**
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.isAvailable
+ */
+ export var isAvailable: boolean;
+
+ /**
+ * @param apiConfig
+ * @param successCallback
+ * @param errorCallback
+ */
+ export function initialize(
+ apiConfig: chrome.cast.ApiConfig,
+ successCallback: Function,
+ errorCallback: (error: chrome.cast.Error) => void,
+ ): void;
+
+ /**
+ * @param successCallback
+ * @param errorCallback
+ * @param opt_sessionRequest
+ * @param opt_label
+ */
+ export function requestSession(
+ successCallback: (session: chrome.cast.Session) => void,
+ errorCallback: (error: chrome.cast.Error) => void,
+ sessionRequest?: chrome.cast.SessionRequest,
+ label?: string,
+ ): void;
+
+ /**
+ * @param sessionId The id of the session to join.
+ */
+ export function requestSessionById(sessionId: string): void;
+
+ /**
+ * @param listener
+ */
+ export function addReceiverActionListener(
+ listener: (receiver: chrome.cast.Receiver, receiverAction: chrome.cast.ReceiverAction) => void,
+ ): void;
+
+ /**
+ * @param listener
+ */
+ export function removeReceiverActionListener(
+ listener: (receiver: chrome.cast.Receiver, receiverAction: chrome.cast.ReceiverAction) => void,
+ ): void;
+
+ /**
+ * @param message The message to log.
+ */
+ export function logMessage(message: string): void;
+
+ /**
+ * @param receivers
+ * @param successCallback
+ * @param errorCallback
+ */
+ export function setCustomReceivers(
+ receivers: Array<chrome.cast.Receiver>,
+ successCallback: Function,
+ errorCallback: (error: chrome.cast.Error) => void,
+ ): void;
+
+ /**
+ * @param receiver
+ * @param successCallback
+ * @param errorCallback
+ */
+ export function setReceiverDisplayStatus(
+ receiver: chrome.cast.Receiver,
+ successCallback: Function,
+ errorCallback: (error: chrome.cast.Error) => void,
+ ): void;
+
+ /**
+ * @param escaped A string to unescape.
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.unescape
+ */
+ export function unescape(escaped: string): string;
+
+ export class ApiConfig {
+ /**
+ * @param sessionRequest
+ * @param sessionListener
+ * @param receiverListener
+ * @param opt_autoJoinPolicy
+ * @param opt_defaultActionPolicy
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.ApiConfig
+ */
+ constructor(
+ sessionRequest: chrome.cast.SessionRequest,
+ sessionListener: (session: chrome.cast.Session) => void,
+ receiverListener: (receiverAvailability: chrome.cast.ReceiverAvailability) => void,
+ autoJoinPolicy?: chrome.cast.AutoJoinPolicy,
+ defaultActionPolicy?: chrome.cast.DefaultActionPolicy,
+ );
+
+ sessionRequest: chrome.cast.SessionRequest;
+ sessionListener: (session: chrome.cast.Session) => void;
+ receiverListener: (receiverAvailability: chrome.cast.ReceiverAvailability) => void;
+ autoJoinPolicy: chrome.cast.AutoJoinPolicy;
+ defaultActionPolicy: chrome.cast.DefaultActionPolicy;
+ }
+
+ export class Error {
+ /**
+ * @param code
+ * @param opt_description
+ * @param opt_details
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.Error
+ */
+ constructor(code: chrome.cast.ErrorCode, description?: string, details?: Object);
+
+ code: chrome.cast.ErrorCode;
+ description: string | null;
+ details: object;
+ }
+
+ export class Image {
+ /**
+ * @param url
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.Image
+ */
+ constructor(url: string);
+
+ url: string;
+ height: number | null;
+ width: number | null;
+ }
+
+ export class SenderApplication {
+ /**
+ * @param platform
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.SenderApplication
+ */
+ constructor(platform: chrome.cast.SenderPlatform);
+
+ platform: chrome.cast.SenderPlatform;
+ url: string | null;
+ packageId: string | null;
+ }
+
+ export class SessionRequest {
+ /**
+ * @param appId
+ * @param opt_capabilities
+ * @param opt_timeout
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.SessionRequest
+ */
+ constructor(appId: string, capabilities?: Array<chrome.cast.Capability>, timeout?: number);
+
+ appId: string;
+ capabilities: Array<chrome.cast.Capability>;
+ requestSessionTimeout: number;
+ language: string | null;
+ }
+
+ export class Session {
+ /**
+ * @param sessionId
+ * @param appId
+ * @param displayName
+ * @param appImages
+ * @param receiver
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.Session
+ */
+ constructor(
+ sessionId: string,
+ appId: string,
+ displayName: string,
+ appImages: Array<chrome.cast.Image>,
+ receiver: chrome.cast.Receiver,
+ );
+
+ sessionId: string;
+ appId: string;
+ displayName: string;
+ appImages: Array<chrome.cast.Image>;
+ receiver: chrome.cast.Receiver;
+ senderApps: Array<chrome.cast.SenderApplication>;
+ namespaces: Array<{ name: string }>;
+ media: Array<chrome.cast.media.Media>;
+ status: chrome.cast.SessionStatus;
+ statusText: string | null;
+ transportId: string;
+
+ /**
+ * @param newLevel
+ * @param successCallback
+ * @param errorCallback
+ */
+ setReceiverVolumeLevel(
+ newLevel: number,
+ successCallback: Function,
+ errorCallback: (error: chrome.cast.Error) => void,
+ ): void;
+
+ /**
+ * @param muted
+ * @param successCallback
+ * @param errorCallback
+ */
+ setReceiverMuted(
+ muted: boolean,
+ successCallback: Function,
+ errorCallback: (error: chrome.cast.Error) => void,
+ ): void;
+
+ /**
+ * @param successCallback
+ * @param errorCallback
+ */
+ leave(successCallback: Function, errorCallback: (error: chrome.cast.Error) => void): void;
+
+ /**
+ * @param successCallback
+ * @param errorCallback
+ */
+ stop(successCallback: Function, errorCallback: (error: chrome.cast.Error) => void): void;
+
+ /**
+ * @param namespace
+ * @param message
+ * @param successCallback
+ * @param errorCallback
+ */
+ sendMessage(
+ namespace: string,
+ message: string | object,
+ successCallback: Function,
+ errorCallback: (error: chrome.cast.Error) => void,
+ ): void;
+
+ /**
+ * @param listener
+ */
+ addUpdateListener(listener: (isAlive: boolean) => void): void;
+
+ /**
+ * @param listener
+ */
+ removeUpdateListener(listener: (isAlive: boolean) => void): void;
+
+ /**
+ * @param namespace
+ * @param listener
+ */
+ addMessageListener(namespace: string, listener: (namespace: string, message: string) => void): void;
+
+ /**
+ * @param namespace
+ * @param listener
+ */
+ removeMessageListener(namespace: string, listener: (namespace: string, message: string) => void): void;
+
+ /**
+ * @param listener
+ */
+ addMediaListener(listener: (media: chrome.cast.media.Media) => void): void;
+
+ /**
+ * @param listener
+ */
+ removeMediaListener(listener: (media: chrome.cast.media.Media) => void): void;
+
+ /**
+ * @param loadRequest
+ * @param successCallback
+ * @param errorCallback
+ */
+ loadMedia(
+ loadRequest: chrome.cast.media.LoadRequest,
+ successCallback: (media: chrome.cast.media.Media) => void,
+ errorCallback: (error: chrome.cast.Error) => void,
+ ): void;
+
+ /**
+ * @param queueLoadRequest
+ * @param successCallback
+ * @param errorCallback
+ */
+ queueLoad(
+ queueLoadRequest: chrome.cast.media.QueueLoadRequest,
+ successCallback: (media: chrome.cast.media.Media) => void,
+ errorCallback: (error: chrome.cast.Error) => void,
+ ): void;
+ }
+
+ export class Receiver {
+ /**
+ * @param label
+ * @param friendlyName
+ * @param opt_capabilities
+ * @param opt_volume
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.Receiver
+ */
+ constructor(
+ label: string,
+ friendlyName: string,
+ capabilities?: Array<chrome.cast.Capability>,
+ volume?: chrome.cast.Volume,
+ );
+
+ label: string;
+ friendlyName: string;
+ capabilities: Array<chrome.cast.Capability>;
+ volume: chrome.cast.Volume;
+ receiverType: chrome.cast.ReceiverType;
+ displayStatus: chrome.cast.ReceiverDisplayStatus;
+ }
+
+ export class ReceiverDisplayStatus {
+ /**
+ * @param statusText
+ * @param appImages
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.ReceiverDisplayStatus
+ */
+ constructor(statusText: string, appImages: Array<chrome.cast.Image>);
+
+ statusText: string;
+ appImages: Array<chrome.cast.Image>;
+ }
+
+ export class Volume {
+ /**
+ * @param opt_level
+ * @param opt_muted
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.Volume
+ */
+ constructor(level?: number, muted?: boolean);
+
+ level: number | null;
+ muted: boolean | null;
+ }
+}
+
+declare namespace chrome.cast.media {
+ export var DEFAULT_MEDIA_RECEIVER_APP_ID: string;
+
+ /**
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.MediaCommand
+ */
+ export enum MediaCommand {
+ PAUSE = "pause",
+ SEEK = "seek",
+ STREAM_VOLUME = "stream_volume",
+ STREAM_MUTE = "stream_mute",
+ }
+
+ /**
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.MetadataType
+ */
+ export enum MetadataType {
+ GENERIC,
+ TV_SHOW,
+ MOVIE,
+ MUSIC_TRACK,
+ PHOTO,
+ }
+
+ /**
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.PlayerState
+ */
+ export enum PlayerState {
+ IDLE = "IDLE",
+ PLAYING = "PLAYING",
+ PAUSED = "PAUSED",
+ BUFFERING = "BUFFERING",
+ }
+
+ /**
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.ResumeState
+ */
+ export enum ResumeState {
+ PLAYBACK_START = "PLAYBACK_START",
+ PLAYBACK_PAUSE = "PLAYBACK_PAUSE",
+ }
+
+ /**
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.StreamType
+ */
+ export enum StreamType {
+ BUFFERED = "BUFFERED",
+ LIVE = "LIVE",
+ OTHER = "OTHER",
+ }
+
+ /**
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.IdleReason
+ */
+ export enum IdleReason {
+ CANCELLED = "CANCELLED",
+ INTERRUPTED = "INTERRUPTED",
+ FINISHED = "FINISHED",
+ ERROR = "ERROR",
+ }
+
+ /**
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.RepeatMode
+ */
+ export enum RepeatMode {
+ OFF = "REPEAT_OFF",
+ ALL = "REPEAT_ALL",
+ SINGLE = "REPEAT_SINGLE",
+ ALL_AND_SHUFFLE = "REPEAT_ALL_AND_SHUFFLE",
+ }
+
+ export class QueueItem {
+ /**
+ * @param mediaInfo
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.QueueItem
+ */
+ constructor(mediaInfo: chrome.cast.media.MediaInfo);
+
+ activeTrackIds: Array<Number>;
+ autoplay: boolean;
+ customData: Object;
+ itemId: number;
+ media: chrome.cast.media.MediaInfo;
+ preloadTime: number;
+ startTime: number;
+ }
+
+ export class QueueLoadRequest {
+ /**
+ * @param items
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.QueueLoadRequest
+ */
+ constructor(items: Array<chrome.cast.media.QueueItem>);
+
+ customData: Object;
+ items: Array<chrome.cast.media.QueueItem>;
+ repeatMode: chrome.cast.media.RepeatMode;
+ startIndex: number;
+ }
+
+ export class QueueInsertItemsRequest {
+ /**
+ * @param itemsToInsert
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.QueueInsertItemsRequest
+ */
+ constructor(itemsToInsert: Array<chrome.cast.media.QueueItem>);
+
+ customData: Object;
+ insertBefore: number;
+ items: Array<chrome.cast.media.QueueItem>;
+ }
+
+ export class QueueRemoveItemsRequest {
+ /**
+ * @param itemIdsToRemove
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.QueueRemoveItemsRequest
+ */
+ constructor(itemIdsToRemove: Array<number>);
+
+ customData: Object;
+ itemIds: Array<number>;
+ }
+
+ export class QueueReorderItemsRequest {
+ /**
+ * @param itemIdsToReorder
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.QueueReorderItemsRequest
+ */
+ constructor(itemIdsToReorder: Array<number>);
+
+ customData: Object;
+ insertBefore: number;
+ itemIds: Array<number>;
+ }
+
+ export class QueueUpdateItemsRequest {
+ /**
+ * @param itemsToUpdate
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.QueueUpdateItemsRequest
+ */
+ constructor(itemsToUpdate: Array<chrome.cast.media.QueueItem>);
+
+ customData: Object;
+ item: Array<chrome.cast.media.QueueItem>;
+ }
+
+ /**
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.TrackType
+ */
+ export enum TrackType {
+ TEXT = "TEXT",
+ AUDIO = "AUDIO",
+ VIDEO = "VIDEO",
+ }
+
+ /**
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.TextTrackType
+ */
+ export enum TextTrackType {
+ SUBTITLES = "SUBTITLES",
+ CAPTIONS = "CAPTIONS",
+ DESCRIPTIONS = "DESCRIPTIONS",
+ CHAPTERS = "CHAPTERS",
+ METADATA = "METADATA",
+ }
+
+ /**
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.TextTrackEdgeType
+ */
+ export enum TextTrackEdgeType {
+ NONE = "NONE",
+ OUTLINE = "OUTLINE",
+ DROP_SHADOW = "DROP_SHADOW",
+ RAISED = "RAISED",
+ DEPRESSED = "DEPRESSED",
+ }
+
+ /**
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.TextTrackWindowType
+ */
+ export enum TextTrackWindowType {
+ NONE = "NONE",
+ NORMAL = "NORMAL",
+ ROUNDED_CORNERS = "ROUNDED_CORNERS",
+ }
+
+ /**
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.TextTrackFontGenericFamily
+ */
+ export enum TextTrackFontGenericFamily {
+ SANS_SERIF = "SANS_SERIF",
+ MONOSPACED_SANS_SERIF = "MONOSPACED_SANS_SERIF",
+ SERIF = "SERIF",
+ MONOSPACED_SERIF = "MONOSPACED_SERIF",
+ CASUAL = "CASUAL",
+ CURSIVE = "CURSIVE",
+ SMALL_CAPITALS = "SMALL_CAPITALS",
+ }
+
+ /**
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.TextTrackFontStyle
+ */
+ export enum TextTrackFontStyle {
+ NORMAL = "NORMAL",
+ BOLD = "BOLD",
+ BOLD_ITALIC = "BOLD_ITALIC",
+ ITALIC = "ITALIC",
+ }
+
+ export class GetStatusRequest {
+ /**
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.GetStatusRequest
+ */
+ constructor();
+
+ customData: Object;
+ }
+
+ export class PauseRequest {
+ /**
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.PauseRequest
+ */
+ constructor();
+
+ customData: Object;
+ }
+
+ export class PlayRequest {
+ /**
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.PlayRequest
+ */
+ constructor();
+
+ customData: Object;
+ }
+
+ export class SeekRequest {
+ /**
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.SeekRequest
+ */
+ constructor();
+
+ currentTime: number;
+ resumeState: chrome.cast.media.ResumeState;
+ customData: Object;
+ }
+
+ export class StopRequest {
+ /**
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.StopRequest
+ */
+ constructor();
+
+ customData: Object;
+ }
+
+ export class VolumeRequest {
+ /**
+ * @param volume
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.VolumeRequest
+ */
+ constructor(volume: chrome.cast.Volume);
+
+ volume: chrome.cast.Volume;
+ customData: Object;
+ }
+
+ export class LoadRequest {
+ /**
+ * @param mediaInfo
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.LoadRequest
+ */
+ constructor(mediaInfo: chrome.cast.media.MediaInfo);
+
+ activeTrackIds: Array<number>;
+ autoplay: boolean;
+ currentTime: number;
+ customData: Object;
+ media: chrome.cast.media.MediaInfo;
+ playbackRate?: number | undefined;
+ }
+
+ export class EditTracksInfoRequest {
+ /**
+ * @param opt_activeTrackIds
+ * @param opt_textTrackStyle
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.EditTracksInfoRequest
+ */
+ constructor(activeTrackIds?: Array<number>, textTrackStyle?: chrome.cast.media.TextTrackStyle);
+
+ activeTrackIds: Array<number>;
+ textTrackStyle: chrome.cast.media.TextTrackStyle;
+ }
+
+ export class GenericMediaMetadata {
+ images: Array<chrome.cast.Image>;
+ metadataType: chrome.cast.media.MetadataType;
+ releaseDate: string;
+ /** @deprecated Use releaseDate instead. */
+ releaseYear: number;
+ subtitle: string;
+ title: string;
+ /** @deprecated Use metadataType instead. */
+ type: chrome.cast.media.MetadataType;
+ }
+
+ export class MovieMediaMetadata {
+ /**
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.MovieMediaMetadata
+ */
+ constructor();
+
+ images: Array<chrome.cast.Image>;
+ metadataType: chrome.cast.media.MetadataType;
+ releaseDate: string;
+ /** @deprecated Use releaseDate instead. */
+ releaseYear: number;
+ subtitle: string;
+ title: string;
+ studio: string;
+ /** @deprecated Use metadataType instead. */
+ type: chrome.cast.media.MetadataType;
+ }
+
+ export class TvShowMediaMetadata {
+ /**
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.TvShowMediaMetadata
+ */
+ constructor();
+
+ metadataType: chrome.cast.media.MetadataType;
+ seriesTitle: string;
+ title: string;
+ season: number;
+ episode: number;
+ images: Array<chrome.cast.Image>;
+ originalAirdate: string;
+
+ /** @deprecated Use metadataType instead. */
+ type: chrome.cast.media.MetadataType;
+ /** @deprecated Use title instead. */
+ episodeTitle: string;
+ /** @deprecated Use season instead. */
+ seasonNumber: number;
+ /** @deprecated Use episode instead. */
+ episodeNumber: number;
+ /** @deprecated Use originalAirdate instead. */
+ releaseYear: number;
+ }
+
+ export class MusicTrackMediaMetadata {
+ /**
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.MusicTrackMediaMetadata
+ */
+ constructor();
+
+ metadataType: chrome.cast.media.MetadataType;
+ albumName: string;
+ title: string;
+ albumArtist: string;
+ artist: string;
+ composer: string;
+ songName: string;
+ trackNumber: number;
+ discNumber: number;
+ images: Array<chrome.cast.Image>;
+ releaseDate: string;
+
+ /** @deprecated Use metadataType instead. */
+ type: chrome.cast.media.MetadataType;
+ /** @deprecated Use artist instead. */
+ artistName: string;
+ /** @deprecated Use releaseDate instead. */
+ releaseYear: number;
+ }
+
+ export class PhotoMediaMetadata {
+ /**
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.PhotoMediaMetadata
+ */
+ constructor();
+
+ metadataType: chrome.cast.media.MetadataType;
+ title: string;
+ artist: string;
+ location: string;
+ images: Array<chrome.cast.Image>;
+ latitude: number;
+ longitude: number;
+ width: number;
+ height: number;
+ creationDateTime: string;
+
+ /** @deprecated Use metadataType instead. */
+ type: chrome.cast.media.MetadataType;
+ }
+
+ export class MediaInfo {
+ /**
+ * @param contentId
+ * @param contentType
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.MediaInfo
+ */
+ constructor(contentId: string, contentType: string);
+
+ contentId: string;
+ streamType: chrome.cast.media.StreamType;
+ contentType: string;
+ metadata: any;
+ duration: number;
+ tracks: Array<chrome.cast.media.Track>;
+ textTrackStyle: chrome.cast.media.TextTrackStyle;
+ customData: Object;
+ }
+
+ export class Media {
+ /**
+ * @param sessionId
+ * @param mediaSessionId
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.Media
+ */
+ constructor(sessionId: string, mediaSessionId: number);
+
+ activeTrackIds: Array<number>;
+ currentItemId: number;
+ customData: Object;
+ idleReason: chrome.cast.media.IdleReason | null;
+ items: Array<chrome.cast.media.QueueItem>;
+ liveSeekableRange?: chrome.cast.media.LiveSeekableRange | undefined;
+ loadingItemId: number;
+ media: chrome.cast.media.MediaInfo;
+ mediaSessionId: number;
+ playbackRate: number;
+ playerState: chrome.cast.media.PlayerState;
+ preloadedItemId: number;
+ repeatMode: chrome.cast.media.RepeatMode;
+ sessionId: string;
+ supportedMediaCommands: Array<chrome.cast.media.MediaCommand>;
+ volume: chrome.cast.Volume;
+
+ /** @deprecated Use getEstimatedTime instead */
+ currentTime: number;
+
+ /**
+ * @param getStatusRequest
+ * @param successCallback
+ * @param errorCallback
+ */
+ getStatus(
+ getStatusRequest: chrome.cast.media.GetStatusRequest,
+ successCallback: Function,
+ errorCallback: (error: chrome.cast.Error) => void,
+ ): void;
+
+ /**
+ * @param playRequest
+ * @param successCallback
+ * @param errorCallback
+ */
+ play(
+ playRequest: chrome.cast.media.PlayRequest,
+ successCallback: Function,
+ errorCallback: (error: chrome.cast.Error) => void,
+ ): void;
+
+ /**
+ * @param pauseRequest
+ * @param successCallback
+ * @param errorCallback
+ */
+ pause(
+ pauseRequest: chrome.cast.media.PauseRequest,
+ successCallback: Function,
+ errorCallback: (error: chrome.cast.Error) => void,
+ ): void;
+
+ /**
+ * @param seekRequest
+ * @param successCallback
+ * @param errorCallback
+ */
+ seek(
+ seekRequest: chrome.cast.media.SeekRequest,
+ successCallback: Function,
+ errorCallback: (error: chrome.cast.Error) => void,
+ ): void;
+
+ /**
+ * @param stopRequest
+ * @param successCallback
+ * @param errorCallback
+ */
+ stop(
+ stopRequest: chrome.cast.media.StopRequest,
+ successCallback: Function,
+ errorCallback: (error: chrome.cast.Error) => void,
+ ): void;
+
+ /**
+ * @param volumeRequest
+ * @param successCallback
+ * @param errorCallback
+ */
+ setVolume(
+ volumeRequest: chrome.cast.media.VolumeRequest,
+ successCallback: Function,
+ errorCallback: (error: chrome.cast.Error) => void,
+ ): void;
+
+ /**
+ * @param editTracksInfoRequest
+ * @param successCallback
+ * @param errorCallback
+ */
+ editTracksInfo(
+ editTracksInfoRequest: chrome.cast.media.EditTracksInfoRequest,
+ successCallback: Function,
+ errorCallback: (error: chrome.cast.Error) => void,
+ ): void;
+
+ /**
+ * @param command
+ * @return whether or not the receiver supports the given chrome.cast.media.MediaCommand
+ */
+ supportsCommand(command: chrome.cast.media.MediaCommand): boolean;
+
+ /**
+ * @param listener
+ */
+ addUpdateListener(listener: (isAlive: boolean) => void): void;
+
+ /**
+ * @param listener
+ */
+ removeUpdateListener(listener: (isAlive: boolean) => void): void;
+
+ /**
+ * @return
+ * @suppress {deprecated} Uses currentTime member to compute estimated time.
+ */
+ getEstimatedTime(): number;
+
+ /**
+ * @param item
+ * @param successCallback
+ * @param errorCallback
+ */
+ queueAppendItem(
+ item: chrome.cast.media.QueueItem,
+ successCallback: Function,
+ errorCallback: (error: chrome.cast.Error) => void,
+ ): void;
+
+ /**
+ * @param queueInsertItemsRequest
+ * @param successCallback
+ * @param errorCallback
+ */
+ queueInsertItems(
+ queueInsertItemsRequest: chrome.cast.media.QueueInsertItemsRequest,
+ successCallback: Function,
+ errorCallback: (error: chrome.cast.Error) => void,
+ ): void;
+
+ /**
+ * @param itemId
+ * @param successCallback
+ * @param errorCallback
+ */
+ queueJumpToItem(
+ itemId: number,
+ successCallback: Function,
+ errorCallback: (error: chrome.cast.Error) => void,
+ ): void;
+
+ /**
+ * @param itemId
+ * @param newIndex
+ * @param successCallback
+ * @param errorCallback
+ */
+ queueMoveItemToNewIndex(
+ itemId: number,
+ newIndex: number,
+ successCallback: Function,
+ errorCallback: (error: chrome.cast.Error) => void,
+ ): void;
+
+ /**
+ * @param successCallback
+ * @param errorCallback
+ */
+ queueNext(successCallback: Function, errorCallback: (error: chrome.cast.Error) => void): void;
+
+ /**
+ * @param successCallback
+ * @param errorCallback
+ */
+ queuePrev(successCallback: Function, errorCallback: (error: chrome.cast.Error) => void): void;
+
+ /**
+ * @param itemId
+ * @param successCallback
+ * @param errorCallback
+ */
+ queueRemoveItem(
+ itemId: number,
+ successCallback: Function,
+ errorCallback: (error: chrome.cast.Error) => void,
+ ): void;
+
+ /**
+ * @param queueReorderItemsRequest
+ * @param successCallback
+ * @param errorCallback
+ */
+ queueReorderItems(
+ queueReorderItemsRequest: chrome.cast.media.QueueReorderItemsRequest,
+ successCallback: Function,
+ errorCallback: (error: chrome.cast.Error) => void,
+ ): void;
+
+ /**
+ * @param repeatMode
+ * @param successCallback
+ * @param errorCallback
+ */
+ queueSetRepeatMode(
+ repeatMode: chrome.cast.media.RepeatMode,
+ successCallback: Function,
+ errorCallback: (error: chrome.cast.Error) => void,
+ ): void;
+
+ /**
+ * @param queueUpdateItemsRequest
+ * @param successCallback
+ * @param errorCallback
+ */
+ queueUpdateItems(
+ queueUpdateItemsRequest: chrome.cast.media.QueueUpdateItemsRequest,
+ successCallback: Function,
+ errorCallback: (error: chrome.cast.Error) => void,
+ ): void;
+ }
+
+ export class Track {
+ /**
+ * @param trackId
+ * @param trackType
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.Track
+ */
+ constructor(trackId: number, trackType: chrome.cast.media.TrackType);
+
+ trackId: number;
+ trackContentId: string;
+ trackContentType: string;
+ type: chrome.cast.media.TrackType;
+ name: string;
+ language: string;
+ subtype: chrome.cast.media.TextTrackType;
+ customData: Object;
+ }
+
+ export class TextTrackStyle {
+ /**
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.TextTrackStyle
+ */
+ constructor();
+
+ foregroundColor: string;
+ backgroundColor: string;
+ edgeType: chrome.cast.media.TextTrackEdgeType;
+ edgeColor: string;
+ windowType: chrome.cast.media.TextTrackWindowType;
+ windowColor: string;
+ windowRoundedCornerRadius: number;
+ fontScale: number;
+ fontFamily: string;
+ fontGenericFamily: chrome.cast.media.TextTrackFontGenericFamily;
+ fontStyle: chrome.cast.media.TextTrackFontStyle;
+ customData: Object;
+ }
+
+ export class LiveSeekableRange {
+ /**
+ * @param start
+ * @param end
+ * @param isMovingWindow
+ * @param isLiveDone
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.LiveSeekableRange
+ */
+ constructor(start?: number, end?: number, isMovingWindow?: boolean, isLiveDone?: boolean);
+
+ start?: number | undefined;
+ end?: number | undefined;
+ isMovingWindow?: boolean | undefined;
+ isLiveDone?: boolean | undefined;
+ }
+}
+
+/**
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.timeout
+ */
+declare namespace chrome.cast.media.timeout {
+ export var load: number;
+ export var getStatus: number;
+ export var play: number;
+ export var pause: number;
+ export var seek: number;
+ export var stop: number;
+ export var setVolume: number;
+ export var editTracksInfo: number;
+ export var queueInsert: number;
+ export var queueLoad: number;
+ export var queueRemove: number;
+ export var queueReorder: number;
+ export var queueUpdate: number;
+}
diff --git a/client/node_modules/@types/chrome/har-format/index.d.ts b/client/node_modules/@types/chrome/har-format/index.d.ts
new file mode 100644
index 0000000..33b39ff
--- /dev/null
+++ b/client/node_modules/@types/chrome/har-format/index.d.ts
@@ -0,0 +1,6 @@
+import { Entry, Log } from "har-format";
+
+declare global {
+ export type HARFormatEntry = Entry;
+ export type HARFormatLog = Log;
+}
diff --git a/client/node_modules/@types/chrome/index.d.ts b/client/node_modules/@types/chrome/index.d.ts
new file mode 100644
index 0000000..2826aa6
--- /dev/null
+++ b/client/node_modules/@types/chrome/index.d.ts
@@ -0,0 +1,12592 @@
+/// <reference types="filesystem" />
+/// <reference path="./har-format/index.d.ts" />
+/// <reference path="./chrome-cast/index.d.ts" />
+
+////////////////////
+// Global object
+////////////////////
+interface Window {
+ chrome: typeof chrome;
+}
+
+////////////////////
+// Accessibility Features
+////////////////////
+/**
+ * Use the chrome.accessibilityFeatures API to manage Chrome's accessibility features. This API relies on the ChromeSetting prototype of the type API for getting and setting individual accessibility features. In order to get feature states the extension must request accessibilityFeatures.read permission. For modifying feature state, the extension needs accessibilityFeatures.modify permission. Note that accessibilityFeatures.modify does not imply accessibilityFeatures.read permission.
+ * Availability: Since Chrome 37.
+ * Permissions: "accessibilityFeatures.read"
+ * Important: This API works only on Chrome OS.
+ */
+declare namespace chrome.accessibilityFeatures {
+ /** **ChromeOS only.** Spoken feedback (text-to-speech). */
+ export var spokenFeedback: chrome.types.ChromeSetting;
+ /** **ChromeOS only.** Enlarged cursor. */
+ export var largeCursor: chrome.types.ChromeSetting;
+ /** **ChromeOS only.** Sticky modifier keys (like shift or alt). */
+ export var stickyKeys: chrome.types.ChromeSetting;
+ /** **ChromeOS only.** High contrast rendering mode. */
+ export var highContrast: chrome.types.ChromeSetting;
+ /** **ChromeOS only.** Full screen magnification. */
+ export var screenMagnifier: chrome.types.ChromeSetting;
+ /** **ChromeOS only.** Auto mouse click after mouse stops moving. */
+ export var autoclick: chrome.types.ChromeSetting;
+ /** **ChromeOS only.** Virtual on-screen keyboard. */
+ export var virtualKeyboard: chrome.types.ChromeSetting;
+ /**
+ * **ChromeOS only.**
+ * Caret highlighting.
+ * @since Chrome 51.
+ */
+ export var caretHighlight: chrome.types.ChromeSetting;
+ /**
+ * **ChromeOS only.**
+ * Cursor highlighting.
+ * @since Chrome 51.
+ */
+ export var cursorHighlight: chrome.types.ChromeSetting;
+ /**
+ * **ChromeOS only.**
+ * Focus highlighting.
+ * @since Chrome 51.
+ */
+ export var focusHighlight: chrome.types.ChromeSetting;
+ /**
+ * **ChromeOS only.**
+ * Select-to-speak.
+ * @since Chrome 51.
+ */
+ export var selectToSpeak: chrome.types.ChromeSetting;
+ /**
+ * **ChromeOS only.**
+ * Switch Access.
+ * @since Chrome 51.
+ */
+ export var switchAccess: chrome.types.ChromeSetting;
+ /**
+ * @since Chrome 42.
+ */
+ export var animationPolicy: chrome.types.ChromeSetting;
+}
+
+////////////////////
+// Action
+////////////////////
+/**
+ * Use the chrome.action API to control the extension's icon in the Google Chrome toolbar.
+ * Availability: Since Chrome 88. Manifest v3.
+ * Manifest: "action": {...}
+ */
+declare namespace chrome.action {
+ /** @deprecated Use BadgeColorDetails instead. */
+ export interface BadgeBackgroundColorDetails extends BadgeColorDetails {}
+
+ export interface BadgeColorDetails {
+ /** An array of four integers in the range [0,255] that make up the RGBA color of the badge. For example, opaque red is [255, 0, 0, 255]. Can also be a string with a CSS value, with opaque red being #FF0000 or #F00. */
+ color: string | ColorArray;
+ /** Optional. Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */
+ tabId?: number | undefined;
+ }
+
+ export interface BadgeTextDetails {
+ /** Any number of characters can be passed, but only about four can fit in the space. */
+ text: string;
+ /** Optional. Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */
+ tabId?: number | undefined;
+ }
+
+ export type ColorArray = [number, number, number, number];
+
+ export interface TitleDetails {
+ /** The string the action should display when moused over. */
+ title: string;
+ /** Optional. Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */
+ tabId?: number | undefined;
+ }
+
+ export interface PopupDetails {
+ /** Optional. Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */
+ tabId?: number | undefined;
+ /** The html file to show in a popup. If set to the empty string (''), no popup is shown. */
+ popup: string;
+ }
+
+ export interface BrowserClickedEvent extends chrome.events.Event<(tab: chrome.tabs.Tab) => void> {}
+
+ export interface TabIconDetails {
+ /** Optional. Either a relative image path or a dictionary {size -> relative image path} pointing to icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals scale, then image with size scale * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.path = foo' is equivalent to 'details.imageData = {'19': foo}' */
+ path?: string | { [index: number]: string } | undefined;
+ /** Optional. Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */
+ tabId?: number | undefined;
+ /** Optional. Either an ImageData object or a dictionary {size -> ImageData} representing icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals scale, then image with size scale * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.imageData = foo' is equivalent to 'details.imageData = {'19': foo}' */
+ imageData?: ImageData | { [index: number]: ImageData } | undefined;
+ }
+
+ export interface OpenPopupOptions {
+ /** Optional. The id of the window to open the action popup in. Defaults to the currently-active window if unspecified. */
+ windowId?: number | undefined;
+ }
+
+ export interface TabDetails {
+ /** Optional. The ID of the tab to query state for. If no tab is specified, the non-tab-specific state is returned. */
+ tabId?: number | undefined;
+ }
+
+ export interface UserSettings {
+ /** Whether the extension's action icon is visible on browser windows' top-level toolbar (i.e., whether the extension has been 'pinned' by the user). */
+ isOnToolbar: boolean;
+ }
+
+ /**
+ * Since Chrome 88.
+ * Disables the action for a tab.
+ * @param tabId The id of the tab for which you want to modify the action.
+ * @return The `disable` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function disable(tabId?: number): Promise<void>;
+
+ /**
+ * Since Chrome 88.
+ * Disables the action for a tab.
+ * @param tabId The id of the tab for which you want to modify the action.
+ * @param callback
+ */
+ export function disable(callback: () => void): void;
+ export function disable(tabId: number, callback: () => void): void;
+
+ /**
+ * Since Chrome 88.
+ * Enables the action for a tab. By default, actions are enabled.
+ * @param tabId The id of the tab for which you want to modify the action.
+ * @return The `enable` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function enable(tabId?: number): Promise<void>;
+
+ /**
+ * Since Chrome 88.
+ * Enables the action for a tab. By default, actions are enabled.
+ * @param tabId The id of the tab for which you want to modify the action.
+ * @param callback
+ */
+ export function enable(callback: () => void): void;
+ export function enable(tabId: number, callback: () => void): void;
+
+ /**
+ * Since Chrome 88.
+ * Gets the background color of the action.
+ */
+ export function getBadgeBackgroundColor(details: TabDetails, callback: (result: ColorArray) => void): void;
+ /**
+ * Since Chrome 88.
+ * Gets the background color of the action.
+ * @return The `getBadgeBackgroundColor` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function getBadgeBackgroundColor(details: TabDetails): Promise<ColorArray>;
+
+ /**
+ * Since Chrome 88.
+ * Gets the badge text of the action. If no tab is specified, the non-tab-specific badge text is returned.
+ * If displayActionCountAsBadgeText is enabled, a placeholder text will be returned unless the
+ * declarativeNetRequestFeedback permission is present or tab-specific badge text was provided.
+ */
+ export function getBadgeText(details: TabDetails, callback: (result: string) => void): void;
+
+ /**
+ * Since Chrome 88.
+ * Gets the badge text of the action. If no tab is specified, the non-tab-specific badge text is returned.
+ * If displayActionCountAsBadgeText is enabled, a placeholder text will be returned unless the
+ * declarativeNetRequestFeedback permission is present or tab-specific badge text was provided.
+ * @return The `getBadgeText` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function getBadgeText(details: TabDetails): Promise<string>;
+
+ /**
+ * Since Chrome 110.
+ * Gets the text color of the action.
+ */
+ export function getBadgeTextColor(details: TabDetails, callback: (result: ColorArray) => void): void;
+
+ /**
+ * Since Chrome 110.
+ * Gets the text color of the action.
+ * @return The `getBadgeTextColor` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function getBadgeTextColor(details: TabDetails): Promise<ColorArray>;
+
+ /**
+ * Since Chrome 88.
+ * Gets the html document set as the popup for this action.
+ */
+ export function getPopup(details: TabDetails, callback: (result: string) => void): void;
+
+ /**
+ * Since Chrome 88.
+ * Gets the html document set as the popup for this action.
+ * @return The `getPopup` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function getPopup(details: TabDetails): Promise<string>;
+
+ /**
+ * Since Chrome 88.
+ * Gets the title of the action.
+ */
+ export function getTitle(details: TabDetails, callback: (result: string) => void): void;
+
+ /**
+ * Since Chrome 88.
+ * Gets the title of the action.
+ * @return The `getTitle` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function getTitle(details: TabDetails): Promise<string>;
+
+ /**
+ * Since Chrome 91.
+ * Returns the user-specified settings relating to an extension's action.
+ */
+ export function getUserSettings(callback: (userSettings: UserSettings) => void): void;
+
+ /**
+ * Since Chrome 91.
+ * Returns the user-specified settings relating to an extension's action.
+ * @return The `getUserSettings` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function getUserSettings(): Promise<UserSettings>;
+
+ /**
+ * Since Chrome 110.
+ * Indicates whether the extension action is enabled for a tab (or globally if no tabId is provided). Actions enabled using only declarativeContent always return false.
+ */
+ export function isEnabled(tabId: number | undefined, callback: (isEnabled: boolean) => void): void;
+
+ /**
+ * Since Chrome 110.
+ * Indicates whether the extension action is enabled for a tab (or globally if no tabId is provided). Actions enabled using only declarativeContent always return false.
+ * @return True if the extension action is enabled.
+ */
+ export function isEnabled(tabId?: number): Promise<boolean>;
+
+ /**
+ * Since Chrome 99+.
+ * Opens the extension's popup.
+ * @param options Specifies options for opening the popup.
+ * () => {...}
+ * @return The `openPopup` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function openPopup(options?: OpenPopupOptions): Promise<void>;
+
+ /**
+ * Since Chrome 99+.
+ * Opens the extension's popup.
+ * @param options Specifies options for opening the popup.
+ */
+ export function openPopup(callback: () => void): void;
+ export function openPopup(options: OpenPopupOptions, callback: () => void): void;
+
+ /**
+ * Since Chrome 88.
+ * Sets the background color for the badge.
+ * @return The `setBadgeBackgroundColor` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function setBadgeBackgroundColor(details: BadgeColorDetails): Promise<void>;
+
+ /**
+ * Since Chrome 88.
+ * Sets the background color for the badge.
+ */
+ export function setBadgeBackgroundColor(details: BadgeColorDetails, callback: () => void): void;
+
+ /**
+ * Since Chrome 88.
+ * Sets the badge text for the action. The badge is displayed on top of the icon.
+ * @return The `setBadgeText` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function setBadgeText(details: BadgeTextDetails): Promise<void>;
+
+ /**
+ * Since Chrome 88.
+ * Sets the badge text for the action. The badge is displayed on top of the icon.
+ */
+ export function setBadgeText(details: BadgeTextDetails, callback: () => void): void;
+
+ /**
+ * Since Chrome 110.
+ * Sets the text color for the badge.
+ * @return The `setBadgeTextColor` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function setBadgeTextColor(details: BadgeColorDetails): Promise<void>;
+
+ /**
+ * Since Chrome 100.
+ * Sets the text color for the badge.
+ */
+ export function setBadgeTextColor(details: BadgeColorDetails, callback: () => void): void;
+
+ /**
+ * Since Chrome 88.
+ * Sets the icon for the action. The icon can be specified either as the path to an image file or as the pixel data from a canvas element,
+ * or as dictionary of either one of those. Either the path or the imageData property must be specified.
+ * @return The `setIcon` method provides its result via callback or returned as a `Promise` (MV3 only). Since Chrome 96.
+ */
+ export function setIcon(details: TabIconDetails): Promise<void>;
+ export function setIcon(details: TabIconDetails, callback: () => void): void;
+
+ /**
+ * Since Chrome 88.
+ * Sets the html document to be opened as a popup when the user clicks on the action's icon.
+ * @return The `setPopup` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function setPopup(details: PopupDetails): Promise<void>;
+
+ /**
+ * Since Chrome 88.
+ * Sets the html document to be opened as a popup when the user clicks on the action's icon.
+ */
+ export function setPopup(details: PopupDetails, callback: () => void): void;
+
+ /**
+ * Since Chrome 88.
+ * Sets the title of the action. This shows up in the tooltip.
+ * @return The `setTitle` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function setTitle(details: TitleDetails): Promise<void>;
+
+ /**
+ * Since Chrome 88.
+ * Sets the title of the action. This shows up in the tooltip.
+ */
+ export function setTitle(details: TitleDetails, callback: () => void): void;
+
+ /** Fired when an action icon is clicked. This event will not fire if the action has a popup. */
+ export var onClicked: BrowserClickedEvent;
+}
+
+////////////////////
+// Alarms
+////////////////////
+/**
+ * Use the chrome.alarms API to schedule code to run periodically or at a specified time in the future.
+ * Availability: Since Chrome 22.
+ * Permissions: "alarms"
+ */
+declare namespace chrome.alarms {
+ export interface AlarmCreateInfo {
+ /** Optional. Length of time in minutes after which the onAlarm event should fire. */
+ delayInMinutes?: number | undefined;
+ /** Optional. If set, the onAlarm event should fire every periodInMinutes minutes after the initial event specified by when or delayInMinutes. If not set, the alarm will only fire once. */
+ periodInMinutes?: number | undefined;
+ /** Optional. Time at which the alarm should fire, in milliseconds past the epoch (e.g. Date.now() + n). */
+ when?: number | undefined;
+ }
+
+ export interface Alarm {
+ /** Optional. If not null, the alarm is a repeating alarm and will fire again in periodInMinutes minutes. */
+ periodInMinutes?: number | undefined;
+ /** Time at which this alarm was scheduled to fire, in milliseconds past the epoch (e.g. Date.now() + n). For performance reasons, the alarm may have been delayed an arbitrary amount beyond this. */
+ scheduledTime: number;
+ /** Name of this alarm. */
+ name: string;
+ }
+
+ export interface AlarmEvent extends chrome.events.Event<(alarm: Alarm) => void> {}
+
+ /**
+ * Creates an alarm. Near the time(s) specified by alarmInfo, the onAlarm event is fired. If there is another alarm with the same name (or no name if none is specified), it will be cancelled and replaced by this alarm.
+ * In order to reduce the load on the user's machine, Chrome limits alarms to at most once every 1 minute but may delay them an arbitrary amount more. That is, setting delayInMinutes or periodInMinutes to less than 1 will not be honored and will cause a warning. when can be set to less than 1 minute after "now" without warning but won't actually cause the alarm to fire for at least 1 minute.
+ * To help you debug your app or extension, when you've loaded it unpacked, there's no limit to how often the alarm can fire.
+ * @param alarmInfo Describes when the alarm should fire. The initial time must be specified by either when or delayInMinutes (but not both). If periodInMinutes is set, the alarm will repeat every periodInMinutes minutes after the initial event. If neither when or delayInMinutes is set for a repeating alarm, periodInMinutes is used as the default for delayInMinutes.
+ * @return The `create` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function create(alarmInfo: AlarmCreateInfo): Promise<void>;
+ /**
+ * Creates an alarm. Near the time(s) specified by alarmInfo, the onAlarm event is fired. If there is another alarm with the same name (or no name if none is specified), it will be cancelled and replaced by this alarm.
+ * In order to reduce the load on the user's machine, Chrome limits alarms to at most once every 1 minute but may delay them an arbitrary amount more. That is, setting delayInMinutes or periodInMinutes to less than 1 will not be honored and will cause a warning. when can be set to less than 1 minute after "now" without warning but won't actually cause the alarm to fire for at least 1 minute.
+ * To help you debug your app or extension, when you've loaded it unpacked, there's no limit to how often the alarm can fire.
+ * @param name Optional name to identify this alarm. Defaults to the empty string.
+ * @param alarmInfo Describes when the alarm should fire. The initial time must be specified by either when or delayInMinutes (but not both). If periodInMinutes is set, the alarm will repeat every periodInMinutes minutes after the initial event. If neither when or delayInMinutes is set for a repeating alarm, periodInMinutes is used as the default for delayInMinutes.
+ * @return The `create` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function create(name: string, alarmInfo: AlarmCreateInfo): Promise<void>;
+ /**
+ * Creates an alarm. Near the time(s) specified by alarmInfo, the onAlarm event is fired. If there is another alarm with the same name (or no name if none is specified), it will be cancelled and replaced by this alarm.
+ * In order to reduce the load on the user's machine, Chrome limits alarms to at most once every 1 minute but may delay them an arbitrary amount more. That is, setting delayInMinutes or periodInMinutes to less than 1 will not be honored and will cause a warning. when can be set to less than 1 minute after "now" without warning but won't actually cause the alarm to fire for at least 1 minute.
+ * To help you debug your app or extension, when you've loaded it unpacked, there's no limit to how often the alarm can fire.
+ * @param alarmInfo Describes when the alarm should fire. The initial time must be specified by either when or delayInMinutes (but not both). If periodInMinutes is set, the alarm will repeat every periodInMinutes minutes after the initial event. If neither when or delayInMinutes is set for a repeating alarm, periodInMinutes is used as the default for delayInMinutes.
+ */
+ export function create(alarmInfo: AlarmCreateInfo, callback: () => void): void;
+ /**
+ * Creates an alarm. Near the time(s) specified by alarmInfo, the onAlarm event is fired. If there is another alarm with the same name (or no name if none is specified), it will be cancelled and replaced by this alarm.
+ * In order to reduce the load on the user's machine, Chrome limits alarms to at most once every 1 minute but may delay them an arbitrary amount more. That is, setting delayInMinutes or periodInMinutes to less than 1 will not be honored and will cause a warning. when can be set to less than 1 minute after "now" without warning but won't actually cause the alarm to fire for at least 1 minute.
+ * To help you debug your app or extension, when you've loaded it unpacked, there's no limit to how often the alarm can fire.
+ * @param name Optional name to identify this alarm. Defaults to the empty string.
+ * @param alarmInfo Describes when the alarm should fire. The initial time must be specified by either when or delayInMinutes (but not both). If periodInMinutes is set, the alarm will repeat every periodInMinutes minutes after the initial event. If neither when or delayInMinutes is set for a repeating alarm, periodInMinutes is used as the default for delayInMinutes.
+ */
+ export function create(name: string, alarmInfo: AlarmCreateInfo, callback: () => void): void;
+ /**
+ * Gets an array of all the alarms.
+ */
+ export function getAll(callback: (alarms: Alarm[]) => void): void;
+ /**
+ * Gets an array of all the alarms.
+ * @return The `getAll` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function getAll(): Promise<Alarm[]>;
+ /**
+ * Clears all alarms.
+ * function(boolean wasCleared) {...};
+ * @return The `clearAll` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function clearAll(): Promise<boolean>;
+ /**
+ * Clears all alarms.
+ */
+ export function clearAll(callback: (wasCleared: boolean) => void): void;
+ /**
+ * Clears the alarm with the given name.
+ * @param name The name of the alarm to clear. Defaults to the empty string.
+ * @return The `clear` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function clear(name?: string): Promise<boolean>;
+ /**
+ * Clears the alarm with the given name.
+ * @param name The name of the alarm to clear. Defaults to the empty string.
+ */
+ export function clear(callback: (wasCleared: boolean) => void): void;
+ export function clear(name: string, callback: (wasCleared: boolean) => void): void;
+ /**
+ * Clears the alarm without a name.
+ */
+ export function clear(callback: (wasCleared: boolean) => void): void;
+ /**
+ * Clears the alarm without a name.
+ * @return The `clear` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function clear(): Promise<void>;
+ /**
+ * Retrieves details about the specified alarm.
+ */
+ export function get(callback: (alarm: Alarm) => void): void;
+ /**
+ * Retrieves details about the specified alarm.
+ * @return The `get` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function get(): Promise<Alarm>;
+ /**
+ * Retrieves details about the specified alarm.
+ * @param name The name of the alarm to get. Defaults to the empty string.
+ */
+ export function get(name: string, callback: (alarm: Alarm) => void): void;
+ /**
+ * Retrieves details about the specified alarm.
+ * @param name The name of the alarm to get. Defaults to the empty string.
+ * @return The `get` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function get(name: string): Promise<Alarm>;
+
+ /** Fired when an alarm has elapsed. Useful for event pages. */
+ export var onAlarm: AlarmEvent;
+}
+
+////////////////////
+// Browser
+////////////////////
+/**
+ * Use the chrome.browser API to interact with the Chrome browser associated with
+ * the current application and Chrome profile.
+ */
+declare namespace chrome.browser {
+ export interface Options {
+ /** The URL to navigate to when the new tab is initially opened. */
+ url: string;
+ }
+
+ /**
+ * Opens a new tab in a browser window associated with the current application
+ * and Chrome profile. If no browser window for the Chrome profile is opened,
+ * a new one is opened prior to creating the new tab.
+ * @param options Configures how the tab should be opened.
+ * @param callback Called when the tab was successfully
+ * created, or failed to be created. If failed, runtime.lastError will be set.
+ */
+ export function openTab(options: Options, callback: () => void): void;
+
+ /**
+ * Opens a new tab in a browser window associated with the current application
+ * and Chrome profile. If no browser window for the Chrome profile is opened,
+ * a new one is opened prior to creating the new tab. Since Chrome 42 only.
+ * @param options Configures how the tab should be opened.
+ */
+ export function openTab(options: Options): void;
+}
+
+////////////////////
+// Bookmarks
+////////////////////
+/**
+ * Use the chrome.bookmarks API to create, organize, and otherwise manipulate bookmarks. Also see Override Pages, which you can use to create a custom Bookmark Manager page.
+ * Availability: Since Chrome 5.
+ * Permissions: "bookmarks"
+ */
+declare namespace chrome.bookmarks {
+ /** A node (either a bookmark or a folder) in the bookmark tree. Child nodes are ordered within their parent folder. */
+ export interface BookmarkTreeNode {
+ /** Optional. The 0-based position of this node within its parent folder. */
+ index?: number | undefined;
+ /** Optional. When this node was created, in milliseconds since the epoch (new Date(dateAdded)). */
+ dateAdded?: number | undefined;
+ /** The text displayed for the node. */
+ title: string;
+ /** Optional. The URL navigated to when a user clicks the bookmark. Omitted for folders. */
+ url?: string | undefined;
+ /** Optional. When the contents of this folder last changed, in milliseconds since the epoch. */
+ dateGroupModified?: number | undefined;
+ /** The unique identifier for the node. IDs are unique within the current profile, and they remain valid even after the browser is restarted. */
+ id: string;
+ /** Optional. The id of the parent folder. Omitted for the root node. */
+ parentId?: string | undefined;
+ /** Optional. An ordered list of children of this node. */
+ children?: BookmarkTreeNode[] | undefined;
+ /**
+ * Optional.
+ * Since Chrome 37.
+ * Indicates the reason why this node is unmodifiable. The managed value indicates that this node was configured by the system administrator or by the custodian of a supervised user. Omitted if the node can be modified by the user and the extension (default).
+ */
+ unmodifiable?: "managed" | undefined;
+ }
+
+ export interface BookmarkRemoveInfo {
+ index: number;
+ parentId: string;
+ node: BookmarkTreeNode;
+ }
+
+ export interface BookmarkMoveInfo {
+ index: number;
+ oldIndex: number;
+ parentId: string;
+ oldParentId: string;
+ }
+
+ export interface BookmarkChangeInfo {
+ url?: string | undefined;
+ title: string;
+ }
+
+ export interface BookmarkReorderInfo {
+ childIds: string[];
+ }
+
+ export interface BookmarkRemovedEvent
+ extends chrome.events.Event<(id: string, removeInfo: BookmarkRemoveInfo) => void>
+ {}
+
+ export interface BookmarkImportEndedEvent extends chrome.events.Event<() => void> {}
+
+ export interface BookmarkMovedEvent extends chrome.events.Event<(id: string, moveInfo: BookmarkMoveInfo) => void> {}
+
+ export interface BookmarkImportBeganEvent extends chrome.events.Event<() => void> {}
+
+ export interface BookmarkChangedEvent
+ extends chrome.events.Event<(id: string, changeInfo: BookmarkChangeInfo) => void>
+ {}
+
+ export interface BookmarkCreatedEvent
+ extends chrome.events.Event<(id: string, bookmark: BookmarkTreeNode) => void>
+ {}
+
+ export interface BookmarkChildrenReordered
+ extends chrome.events.Event<(id: string, reorderInfo: BookmarkReorderInfo) => void>
+ {}
+
+ export interface BookmarkSearchQuery {
+ query?: string | undefined;
+ url?: string | undefined;
+ title?: string | undefined;
+ }
+
+ export interface BookmarkCreateArg {
+ /** Optional. Defaults to the Other Bookmarks folder. */
+ parentId?: string | undefined;
+ index?: number | undefined;
+ title?: string | undefined;
+ url?: string | undefined;
+ }
+
+ export interface BookmarkDestinationArg {
+ parentId?: string | undefined;
+ index?: number | undefined;
+ }
+
+ export interface BookmarkChangesArg {
+ title?: string | undefined;
+ url?: string | undefined;
+ }
+
+ /** @deprecated since Chrome 38. Bookmark write operations are no longer limited by Chrome. */
+ export var MAX_WRITE_OPERATIONS_PER_HOUR: number;
+ /** @deprecated since Chrome 38. Bookmark write operations are no longer limited by Chrome. */
+ export var MAX_SUSTAINED_WRITE_OPERATIONS_PER_MINUTE: number;
+
+ /**
+ * Searches for BookmarkTreeNodes matching the given query. Queries specified with an object produce BookmarkTreeNodes matching all specified properties.
+ * @param query A string of words and quoted phrases that are matched against bookmark URLs and titles.
+ */
+ export function search(query: string, callback: (results: BookmarkTreeNode[]) => void): void;
+ /**
+ * Searches for BookmarkTreeNodes matching the given query. Queries specified with an object produce BookmarkTreeNodes matching all specified properties.
+ * @param query A string of words and quoted phrases that are matched against bookmark URLs and titles.
+ * @return The `search` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function search(query: string): Promise<BookmarkTreeNode[]>;
+ /**
+ * Searches for BookmarkTreeNodes matching the given query. Queries specified with an object produce BookmarkTreeNodes matching all specified properties.
+ * @param query An object with one or more of the properties query, url, and title specified. Bookmarks matching all specified properties will be produced.
+ */
+ export function search(query: BookmarkSearchQuery, callback: (results: BookmarkTreeNode[]) => void): void;
+ /**
+ * Searches for BookmarkTreeNodes matching the given query. Queries specified with an object produce BookmarkTreeNodes matching all specified properties.
+ * @param query An object with one or more of the properties query, url, and title specified. Bookmarks matching all specified properties will be produced.
+ * @return The `search` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function search(query: BookmarkSearchQuery): Promise<BookmarkTreeNode[]>;
+ /**
+ * Retrieves the entire Bookmarks hierarchy.
+ */
+ export function getTree(callback: (results: BookmarkTreeNode[]) => void): void;
+ /**
+ * Retrieves the entire Bookmarks hierarchy.
+ * @return The `getTree` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function getTree(): Promise<BookmarkTreeNode[]>;
+ /**
+ * Retrieves the recently added bookmarks.
+ * @param numberOfItems The maximum number of items to return.
+ */
+ export function getRecent(numberOfItems: number, callback: (results: BookmarkTreeNode[]) => void): void;
+ /**
+ * Retrieves the recently added bookmarks.
+ * @param numberOfItems The maximum number of items to return.
+ * @return The `getRecent` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function getRecent(numberOfItems: number): Promise<BookmarkTreeNode[]>;
+ /**
+ * Retrieves the specified BookmarkTreeNode.
+ * @param id A single string-valued id
+ */
+ export function get(id: string, callback: (results: BookmarkTreeNode[]) => void): void;
+ /**
+ * Retrieves the specified BookmarkTreeNode.
+ * @param id A single string-valued id
+ * @return The `get` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function get(id: string): Promise<BookmarkTreeNode[]>;
+ /**
+ * Retrieves the specified BookmarkTreeNode.
+ * @param idList An array of string-valued ids
+ */
+ export function get(idList: string[], callback: (results: BookmarkTreeNode[]) => void): void;
+ /**
+ * Retrieves the specified BookmarkTreeNode.
+ * @param idList An array of string-valued ids
+ * @return The `get` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function get(idList: string[]): Promise<BookmarkTreeNode[]>;
+ /**
+ * Creates a bookmark or folder under the specified parentId. If url is NULL or missing, it will be a folder.
+ * @return The `create` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function create(bookmark: BookmarkCreateArg): Promise<BookmarkTreeNode>;
+ /**
+ * Creates a bookmark or folder under the specified parentId. If url is NULL or missing, it will be a folder.
+ */
+ export function create(bookmark: BookmarkCreateArg, callback: (result: BookmarkTreeNode) => void): void;
+ /**
+ * Moves the specified BookmarkTreeNode to the provided location.
+ * @return The `move` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function move(
+ id: string,
+ destination: BookmarkDestinationArg,
+ ): Promise<BookmarkTreeNode>;
+ /**
+ * Moves the specified BookmarkTreeNode to the provided location.
+ */
+ export function move(
+ id: string,
+ destination: BookmarkDestinationArg,
+ callback: (result: BookmarkTreeNode) => void,
+ ): void;
+ /**
+ * Updates the properties of a bookmark or folder. Specify only the properties that you want to change; unspecified properties will be left unchanged. Note: Currently, only 'title' and 'url' are supported.
+ * @return The `update` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function update(
+ id: string,
+ changes: BookmarkChangesArg,
+ ): Promise<BookmarkTreeNode>;
+ /**
+ * Updates the properties of a bookmark or folder. Specify only the properties that you want to change; unspecified properties will be left unchanged. Note: Currently, only 'title' and 'url' are supported.
+ */
+ export function update(
+ id: string,
+ changes: BookmarkChangesArg,
+ callback: (result: BookmarkTreeNode) => void,
+ ): void;
+ /**
+ * Removes a bookmark or an empty bookmark folder.
+ * @return The `remove` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function remove(id: string): Promise<void>;
+ /**
+ * Removes a bookmark or an empty bookmark folder.
+ */
+ export function remove(id: string, callback: Function): void;
+ /**
+ * Retrieves the children of the specified BookmarkTreeNode id.
+ */
+ export function getChildren(id: string, callback: (results: BookmarkTreeNode[]) => void): void;
+ /**
+ * Retrieves the children of the specified BookmarkTreeNode id.
+ * @return The `getChildren` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function getChildren(id: string): Promise<BookmarkTreeNode[]>;
+ /**
+ * Since Chrome 14.
+ * Retrieves part of the Bookmarks hierarchy, starting at the specified node.
+ * @param id The ID of the root of the subtree to retrieve.
+ */
+ export function getSubTree(id: string, callback: (results: BookmarkTreeNode[]) => void): void;
+ /**
+ * Since Chrome 14.
+ * Retrieves part of the Bookmarks hierarchy, starting at the specified node.
+ * @param id The ID of the root of the subtree to retrieve.
+ * @return The `getSubTree` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function getSubTree(id: string): Promise<BookmarkTreeNode[]>;
+ /**
+ * Recursively removes a bookmark folder.
+ * @return The `removeTree` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function removeTree(id: string): Promise<void>;
+ /**
+ * Recursively removes a bookmark folder.
+ */
+ export function removeTree(id: string, callback: Function): void;
+
+ /** Fired when a bookmark or folder is removed. When a folder is removed recursively, a single notification is fired for the folder, and none for its contents. */
+ export var onRemoved: BookmarkRemovedEvent;
+ /** Fired when a bookmark import session is ended. */
+ export var onImportEnded: BookmarkImportEndedEvent;
+ /** Fired when a bookmark import session is begun. Expensive observers should ignore onCreated updates until onImportEnded is fired. Observers should still handle other notifications immediately. */
+ export var onImportBegan: BookmarkImportBeganEvent;
+ /** Fired when a bookmark or folder changes. Note: Currently, only title and url changes trigger this. */
+ export var onChanged: BookmarkChangedEvent;
+ /** Fired when a bookmark or folder is moved to a different parent folder. */
+ export var onMoved: BookmarkMovedEvent;
+ /** Fired when a bookmark or folder is created. */
+ export var onCreated: BookmarkCreatedEvent;
+ /** Fired when the children of a folder have changed their order due to the order being sorted in the UI. This is not called as a result of a move(). */
+ export var onChildrenReordered: BookmarkChildrenReordered;
+}
+
+////////////////////
+// Browser Action
+////////////////////
+/**
+ * Use browser actions to put icons in the main Google Chrome toolbar, to the right of the address bar. In addition to its icon, a browser action can also have a tooltip, a badge, and a popup.
+ * Availability: Since Chrome 5.
+ * Manifest: "browser_action": {...}
+ */
+declare namespace chrome.browserAction {
+ export interface BadgeBackgroundColorDetails {
+ /** An array of four integers in the range [0,255] that make up the RGBA color of the badge. For example, opaque red is [255, 0, 0, 255]. Can also be a string with a CSS value, with opaque red being #FF0000 or #F00. */
+ color: string | ColorArray;
+ /** Optional. Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */
+ tabId?: number | undefined;
+ }
+
+ export interface BadgeTextDetails {
+ /** Any number of characters can be passed, but only about four can fit in the space. */
+ text?: string | null | undefined;
+ /** Optional. Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */
+ tabId?: number | undefined;
+ }
+
+ export type ColorArray = [number, number, number, number];
+
+ export interface TitleDetails {
+ /** The string the browser action should display when moused over. */
+ title: string;
+ /** Optional. Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */
+ tabId?: number | null;
+ }
+
+ export interface TabDetails {
+ /** Optional. Specify the tab to get the information. If no tab is specified, the non-tab-specific information is returned. */
+ tabId?: number | null;
+ }
+
+ export interface TabIconDetails {
+ /** Optional. Either a relative image path or a dictionary {size -> relative image path} pointing to icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals scale, then image with size scale * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.path = foo' is equivalent to 'details.imageData = {'19': foo}' */
+ path?: string | { [index: string]: string } | undefined;
+ /** Optional. Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */
+ tabId?: number | undefined;
+ /** Optional. Either an ImageData object or a dictionary {size -> ImageData} representing icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals scale, then image with size scale * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.imageData = foo' is equivalent to 'details.imageData = {'19': foo}' */
+ imageData?: ImageData | { [index: number]: ImageData } | undefined;
+ }
+
+ export interface PopupDetails {
+ /** Optional. Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */
+ tabId?: number | null;
+ /** The html file to show in a popup. If set to the empty string (''), no popup is shown. */
+ popup: string;
+ }
+
+ export interface BrowserClickedEvent extends chrome.events.Event<(tab: chrome.tabs.Tab) => void> {}
+
+ /**
+ * Since Chrome 22.
+ * Enables the browser action for a tab. By default, browser actions are enabled.
+ * @param tabId The id of the tab for which you want to modify the browser action.
+ * @return The `enable` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function enable(tabId?: number | null): Promise<void>;
+ /**
+ * Since Chrome 22.
+ * Enables the browser action for a tab. By default, browser actions are enabled.
+ * @param tabId The id of the tab for which you want to modify the browser action.
+ * @param callback Supported since Chrome 67
+ */
+ export function enable(callback?: () => void): void;
+ export function enable(tabId: number | null | undefined, callback?: () => void): void;
+ /**
+ * Sets the background color for the badge.
+ * @return The `setBadgeBackgroundColor` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function setBadgeBackgroundColor(details: BadgeBackgroundColorDetails): Promise<void>;
+ /**
+ * Sets the background color for the badge.
+ * @param callback Supported since Chrome 67
+ */
+ export function setBadgeBackgroundColor(details: BadgeBackgroundColorDetails, callback?: () => void): void;
+ /**
+ * Sets the badge text for the browser action. The badge is displayed on top of the icon.
+ * @return The `setBadgeText` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function setBadgeText(details: BadgeTextDetails): Promise<void>;
+ /**
+ * Sets the badge text for the browser action. The badge is displayed on top of the icon.
+ * @param callback Supported since Chrome 67
+ */
+ export function setBadgeText(details: BadgeTextDetails, callback: () => void): void;
+ /**
+ * Sets the title of the browser action. This shows up in the tooltip.
+ * @return The `setTitle` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function setTitle(details: TitleDetails): Promise<void>;
+ /**
+ * Sets the title of the browser action. This shows up in the tooltip.
+ * @param callback Supported since Chrome 67
+ */
+ export function setTitle(details: TitleDetails, callback: () => void): void;
+ /**
+ * Since Chrome 19.
+ * Gets the badge text of the browser action. If no tab is specified, the non-tab-specific badge text is returned.
+ * @param callback Supported since Chrome 67
+ */
+ export function getBadgeText(details: TabDetails, callback: (result: string) => void): void;
+ /**
+ * Since Chrome 19.
+ * Gets the badge text of the browser action. If no tab is specified, the non-tab-specific badge text is returned.
+ * @return The `getBadgeText` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function getBadgeText(details: TabDetails): Promise<string>;
+ /**
+ * Sets the html document to be opened as a popup when the user clicks on the browser action's icon.
+ * @return The `setPopup` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function setPopup(details: PopupDetails): Promise<void>;
+ /**
+ * Sets the html document to be opened as a popup when the user clicks on the browser action's icon.
+ * @param callback Supported since Chrome 67
+ */
+ export function setPopup(details: PopupDetails, callback?: () => void): void;
+ /**
+ * Since Chrome 22.
+ * Disables the browser action for a tab.
+ * @param tabId The id of the tab for which you want to modify the browser action.
+ * @return The `disable` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function disable(tabId?: number | null): Promise<void>;
+ /**
+ * Since Chrome 22.
+ * Disables the browser action for a tab.
+ * @param tabId The id of the tab for which you want to modify the browser action.
+ * @param callback Supported since Chrome 67
+ */
+ export function disable(callback: () => void): void;
+ export function disable(tabId?: number | null, callback?: () => void): void;
+ /**
+ * Since Chrome 19.
+ * Gets the title of the browser action.
+ */
+ export function getTitle(details: TabDetails, callback: (result: string) => void): void;
+ /**
+ * Since Chrome 19.
+ * Gets the title of the browser action.
+ * @return The `getTitle` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function getTitle(details: TabDetails): Promise<string>;
+ /**
+ * Since Chrome 19.
+ * Gets the background color of the browser action.
+ */
+ export function getBadgeBackgroundColor(details: TabDetails, callback: (result: ColorArray) => void): void;
+ /**
+ * Since Chrome 19.
+ * Gets the background color of the browser action.
+ * @return The `getBadgeBackgroundColor` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function getBadgeBackgroundColor(details: TabDetails): Promise<ColorArray>;
+ /**
+ * Since Chrome 19.
+ * Gets the html document set as the popup for this browser action.
+ */
+ export function getPopup(details: TabDetails, callback: (result: string) => void): void;
+ /**
+ * Since Chrome 19.
+ * Gets the html document set as the popup for this browser action.
+ * @return The `getPopup` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function getPopup(details: TabDetails): Promise<string>;
+ /**
+ * Sets the icon for the browser action. The icon can be specified either as the path to an image file or as the pixel data from a canvas element, or as dictionary of either one of those. Either the path or the imageData property must be specified.
+ */
+ export function setIcon(details: TabIconDetails, callback?: Function): void;
+
+ /** Fired when a browser action icon is clicked. This event will not fire if the browser action has a popup. */
+ export var onClicked: BrowserClickedEvent;
+}
+
+////////////////////
+// Browsing Data
+////////////////////
+/**
+ * Use the chrome.browsingData API to remove browsing data from a user's local profile.
+ * Availability: Since Chrome 19.
+ * Permissions: "browsingData"
+ */
+declare namespace chrome.browsingData {
+ export interface OriginTypes {
+ /** Optional. Extensions and packaged applications a user has installed (be _really_ careful!). */
+ extension?: boolean | undefined;
+ /** Optional. Websites that have been installed as hosted applications (be careful!). */
+ protectedWeb?: boolean | undefined;
+ /** Optional. Normal websites. */
+ unprotectedWeb?: boolean | undefined;
+ }
+
+ /** Options that determine exactly what data will be removed. */
+ export interface RemovalOptions {
+ /**
+ * Optional.
+ * Since Chrome 74.
+ * When present, data for origins in this list is excluded from deletion. Can't be used together with origins. Only supported for cookies, storage and cache. Cookies are excluded for the whole registrable domain.
+ */
+ excludeOrigins?: string[] | undefined;
+ /**
+ * Optional.
+ * An object whose properties specify which origin types ought to be cleared. If this object isn't specified, it defaults to clearing only "unprotected" origins. Please ensure that you _really_ want to remove application data before adding 'protectedWeb' or 'extensions'.
+ */
+ originTypes?: OriginTypes | undefined;
+ /**
+ * Optional.
+ * Since Chrome 74.
+ * When present, only data for origins in this list is deleted. Only supported for cookies, storage and cache. Cookies are cleared for the whole registrable domain.
+ */
+ origins?: string[] | undefined;
+ /**
+ * Optional.
+ * Remove data accumulated on or after this date, represented in milliseconds since the epoch (accessible via the {@link Date.getTime} method). If absent, defaults to 0 (which would remove all browsing data).
+ */
+ since?: number | undefined;
+ }
+
+ /**
+ * Since Chrome 27.
+ * A set of data types. Missing data types are interpreted as false.
+ */
+ export interface DataTypeSet {
+ /** Optional. Websites' WebSQL data. */
+ webSQL?: boolean | undefined;
+ /** Optional. Websites' IndexedDB data. */
+ indexedDB?: boolean | undefined;
+ /** Optional. The browser's cookies. */
+ cookies?: boolean | undefined;
+ /** Optional. Stored passwords. */
+ passwords?: boolean | undefined;
+ /**
+ * @deprecated Deprecated since Chrome 76.
+ * Support for server-bound certificates has been removed. This data type will be ignored.
+ *
+ * Optional. Server-bound certificates.
+ */
+ serverBoundCertificates?: boolean | undefined;
+ /** Optional. The browser's download list. */
+ downloads?: boolean | undefined;
+ /** Optional. The browser's cache. Note: when removing data, this clears the entire cache: it is not limited to the range you specify. */
+ cache?: boolean | undefined;
+ /** Optional. The browser's cacheStorage. */
+ cacheStorage?: boolean | undefined;
+ /** Optional. Websites' appcaches. */
+ appcache?: boolean | undefined;
+ /** Optional. Websites' file systems. */
+ fileSystems?: boolean | undefined;
+ /**
+ * @deprecated Deprecated since Chrome 88.
+ * Support for Flash has been removed. This data type will be ignored.
+ *
+ * Optional. Plugins' data.
+ */
+ pluginData?: boolean | undefined;
+ /** Optional. Websites' local storage data. */
+ localStorage?: boolean | undefined;
+ /** Optional. The browser's stored form data. */
+ formData?: boolean | undefined;
+ /** Optional. The browser's history. */
+ history?: boolean | undefined;
+ /**
+ * Optional.
+ * Since Chrome 39.
+ * Service Workers.
+ */
+ serviceWorkers?: boolean | undefined;
+ }
+
+ export interface SettingsResult {
+ options: RemovalOptions;
+ /** All of the types will be present in the result, with values of true if they are both selected to be removed and permitted to be removed, otherwise false. */
+ dataToRemove: DataTypeSet;
+ /** All of the types will be present in the result, with values of true if they are permitted to be removed (e.g., by enterprise policy) and false if not. */
+ dataRemovalPermitted: DataTypeSet;
+ }
+
+ /**
+ * Since Chrome 26.
+ * Reports which types of data are currently selected in the 'Clear browsing data' settings UI. Note: some of the data types included in this API are not available in the settings UI, and some UI settings control more than one data type listed here.
+ * @return The `settings` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function settings(): Promise<SettingsResult>;
+ /**
+ * Since Chrome 26.
+ * Reports which types of data are currently selected in the 'Clear browsing data' settings UI. Note: some of the data types included in this API are not available in the settings UI, and some UI settings control more than one data type listed here.
+ */
+ export function settings(callback: (result: SettingsResult) => void): void;
+ /**
+ * @deprecated Deprecated since Chrome 88.
+ * Support for Flash has been removed. This function has no effect.
+ *
+ * Clears plugins' data.
+ * @return The `removePluginData` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function removePluginData(options: RemovalOptions): Promise<void>;
+ /**
+ * @deprecated Deprecated since Chrome 88.
+ * Support for Flash has been removed. This function has no effect.
+ *
+ * Clears plugins' data.
+ * @param callback Called when plugins' data has been cleared.
+ */
+ export function removePluginData(options: RemovalOptions, callback: () => void): void;
+ /**
+ * Since Chrome 72.
+ * Clears websites' service workers.
+ * @return The `removeServiceWorkers` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function removeServiceWorkers(options: RemovalOptions): Promise<void>;
+ /**
+ * Since Chrome 72.
+ * Clears websites' service workers.
+ * @param callback Called when the browser's service workers have been cleared.
+ */
+ export function removeServiceWorkers(options: RemovalOptions, callback: () => void): void;
+ /**
+ * Clears the browser's stored form data (autofill).
+ * @return The `removeFormData` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function removeFormData(options: RemovalOptions): Promise<void>;
+ /**
+ * Clears the browser's stored form data (autofill).
+ * @param callback Called when the browser's form data has been cleared.
+ */
+ export function removeFormData(options: RemovalOptions, callback: () => void): void;
+ /**
+ * Clears websites' file system data.
+ * @return The `removeFileSystems` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function removeFileSystems(options: RemovalOptions): Promise<void>;
+ /**
+ * Clears websites' file system data.
+ * @param callback Called when websites' file systems have been cleared.
+ */
+ export function removeFileSystems(options: RemovalOptions, callback: () => void): void;
+ /**
+ * Clears various types of browsing data stored in a user's profile.
+ * @param dataToRemove The set of data types to remove.
+ * @return The `remove` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function remove(options: RemovalOptions, dataToRemove: DataTypeSet): Promise<void>;
+ /**
+ * Clears various types of browsing data stored in a user's profile.
+ * @param dataToRemove The set of data types to remove.
+ * @param callback Called when deletion has completed.
+ */
+ export function remove(options: RemovalOptions, dataToRemove: DataTypeSet, callback: () => void): void;
+ /**
+ * Clears the browser's stored passwords.
+ * @return The `removePasswords` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function removePasswords(options: RemovalOptions): Promise<void>;
+ /**
+ * Clears the browser's stored passwords.
+ * @param callback Called when the browser's passwords have been cleared.
+ */
+ export function removePasswords(options: RemovalOptions, callback: () => void): void;
+ /**
+ * Clears the browser's cookies and server-bound certificates modified within a particular timeframe.
+ * @return The `removeCookies` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function removeCookies(options: RemovalOptions): Promise<void>;
+ /**
+ * Clears the browser's cookies and server-bound certificates modified within a particular timeframe.
+ * @param callback Called when the browser's cookies and server-bound certificates have been cleared.
+ */
+ export function removeCookies(options: RemovalOptions, callback: () => void): void;
+ /**
+ * Clears websites' WebSQL data.
+ * @return The `removeWebSQL` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function removeWebSQL(options: RemovalOptions): Promise<void>;
+ /**
+ * Clears websites' WebSQL data.
+ * @param callback Called when websites' WebSQL databases have been cleared.
+ */
+ export function removeWebSQL(options: RemovalOptions, callback: () => void): void;
+ /**
+ * Clears websites' appcache data.
+ * @return The `removeAppcache` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function removeAppcache(options: RemovalOptions): Promise<void>;
+ /**
+ * Clears websites' appcache data.
+ * @param callback Called when websites' appcache data has been cleared.
+ */
+ export function removeAppcache(options: RemovalOptions, callback: () => void): void;
+ /** Clears websites' cache storage data.
+ * @return The `removeCacheStorage` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function removeCacheStorage(options: RemovalOptions): Promise<void>;
+ /** Clears websites' cache storage data.
+ * @param callback Called when websites' appcache data has been cleared.
+ */
+ export function removeCacheStorage(options: RemovalOptions, callback: () => void): void;
+ /**
+ * Clears the browser's list of downloaded files (not the downloaded files themselves).
+ * @return The `removeDownloads` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function removeDownloads(options: RemovalOptions): Promise<void>;
+ /**
+ * Clears the browser's list of downloaded files (not the downloaded files themselves).
+ * @param callback Called when the browser's list of downloaded files has been cleared.
+ */
+ export function removeDownloads(options: RemovalOptions, callback: () => void): void;
+ /**
+ * Clears websites' local storage data.
+ * @return The `removeLocalStorage` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function removeLocalStorage(options: RemovalOptions): Promise<void>;
+ /**
+ * Clears websites' local storage data.
+ * @param callback Called when websites' local storage has been cleared.
+ */
+ export function removeLocalStorage(options: RemovalOptions, callback: () => void): void;
+ /**
+ * Clears the browser's cache.
+ * @return The `removeCache` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function removeCache(options: RemovalOptions): Promise<void>;
+ /**
+ * Clears the browser's cache.
+ * @param callback Called when the browser's cache has been cleared.
+ */
+ export function removeCache(options: RemovalOptions, callback: () => void): void;
+ /**
+ * Clears the browser's history.
+ * @return The `removeHistory` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function removeHistory(options: RemovalOptions): Promise<void>;
+ /**
+ * Clears the browser's history.
+ * @param callback Called when the browser's history has cleared.
+ */
+ export function removeHistory(options: RemovalOptions, callback: () => void): void;
+ /**
+ * Clears websites' IndexedDB data.
+ * @return The `removeIndexedDB` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function removeIndexedDB(options: RemovalOptions): Promise<void>;
+ /**
+ * Clears websites' IndexedDB data.
+ * @param callback Called when websites' IndexedDB data has been cleared.
+ */
+ export function removeIndexedDB(options: RemovalOptions, callback: () => void): void;
+}
+
+////////////////////
+// Commands
+////////////////////
+/**
+ * Use the commands API to add keyboard shortcuts that trigger actions in your extension, for example, an action to open the browser action or send a command to the extension.
+ * Availability: Since Chrome 25.
+ * Manifest: "commands": {...}
+ */
+declare namespace chrome.commands {
+ export interface Command {
+ /** Optional. The name of the Extension Command */
+ name?: string | undefined;
+ /** Optional. The Extension Command description */
+ description?: string | undefined;
+ /** Optional. The shortcut active for this command, or blank if not active. */
+ shortcut?: string | undefined;
+ }
+
+ export interface CommandEvent extends chrome.events.Event<(command: string, tab: chrome.tabs.Tab) => void> {}
+
+ /**
+ * Returns all the registered extension commands for this extension and their shortcut (if active).
+ * @return The `getAll` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function getAll(): Promise<Command[]>;
+ /**
+ * Returns all the registered extension commands for this extension and their shortcut (if active).
+ * @param callback Called to return the registered commands.
+ */
+ export function getAll(callback: (commands: Command[]) => void): void;
+
+ /** Fired when a registered command is activated using a keyboard shortcut. */
+ export var onCommand: CommandEvent;
+}
+
+////////////////////
+// Content Settings
+////////////////////
+/**
+ * Use the chrome.contentSettings API to change settings that control whether websites can use features such as cookies, JavaScript, and plugins. More generally speaking, content settings allow you to customize Chrome's behavior on a per-site basis instead of globally.
+ * Availability: Since Chrome 16.
+ * Permissions: "contentSettings"
+ */
+declare namespace chrome.contentSettings {
+ type ScopeEnum = "regular" | "incognito_session_only";
+
+ export interface ClearDetails {
+ /**
+ * Optional.
+ * Where to clear the setting (default: regular).
+ * The scope of the ContentSetting. One of
+ * * regular: setting for regular profile (which is inherited by the incognito profile if not overridden elsewhere),
+ * * incognito_session_only: setting for incognito profile that can only be set during an incognito session and is deleted when the incognito session ends (overrides regular settings).
+ */
+ scope?: ScopeEnum | undefined;
+ }
+
+ type DefaultContentSettingDetails = "allow" | "ask" | "block" | "detect_important_content" | "session_only";
+
+ export interface SetDetails {
+ /** Optional. The resource identifier for the content type. */
+ resourceIdentifier?: ResourceIdentifier | undefined;
+ /** The setting applied by this rule. See the description of the individual ContentSetting objects for the possible values. */
+ setting: DefaultContentSettingDetails;
+ /** Optional. The pattern for the secondary URL. Defaults to matching all URLs. For details on the format of a pattern, see Content Setting Patterns. */
+ secondaryPattern?: string | undefined;
+ /** Optional. Where to set the setting (default: regular). */
+ scope?: ScopeEnum | undefined;
+ /** The pattern for the primary URL. For details on the format of a pattern, see Content Setting Patterns. */
+ primaryPattern: string;
+ }
+
+ export interface CookieSetDetails extends SetDetails {
+ setting: "allow" | "block" | "session_only";
+ }
+
+ export interface ImagesSetDetails extends SetDetails {
+ setting: "allow" | "block";
+ }
+
+ export interface JavascriptSetDetails extends SetDetails {
+ setting: "allow" | "block";
+ }
+
+ export interface LocationSetDetails extends SetDetails {
+ setting: "allow" | "block" | "ask";
+ }
+
+ export interface PluginsSetDetails extends SetDetails {
+ setting: "allow" | "block" | "detect_important_content";
+ }
+
+ export interface PopupsSetDetails extends SetDetails {
+ setting: "allow" | "block";
+ }
+
+ export interface NotificationsSetDetails extends SetDetails {
+ setting: "allow" | "block" | "ask";
+ }
+
+ export interface FullscreenSetDetails extends SetDetails {
+ setting: "allow";
+ }
+
+ export interface MouselockSetDetails extends SetDetails {
+ setting: "allow";
+ }
+
+ export interface MicrophoneSetDetails extends SetDetails {
+ setting: "allow" | "block" | "ask";
+ }
+
+ export interface CameraSetDetails extends SetDetails {
+ setting: "allow" | "block" | "ask";
+ }
+
+ export interface PpapiBrokerSetDetails extends SetDetails {
+ setting: "allow" | "block" | "ask";
+ }
+
+ export interface MultipleAutomaticDownloadsSetDetails extends SetDetails {
+ setting: "allow" | "block" | "ask";
+ }
+
+ export interface GetDetails {
+ /** Optional. The secondary URL for which the content setting should be retrieved. Defaults to the primary URL. Note that the meaning of a secondary URL depends on the content type, and not all content types use secondary URLs. */
+ secondaryUrl?: string | undefined;
+ /** Optional. A more specific identifier of the type of content for which the settings should be retrieved. */
+ resourceIdentifier?: ResourceIdentifier | undefined;
+ /** Optional. Whether to check the content settings for an incognito session. (default false) */
+ incognito?: boolean | undefined;
+ /** The primary URL for which the content setting should be retrieved. Note that the meaning of a primary URL depends on the content type. */
+ primaryUrl: string;
+ }
+
+ export interface ReturnedDetails {
+ /** The content setting. See the description of the individual ContentSetting objects for the possible values. */
+ setting: DefaultContentSettingDetails;
+ }
+
+ export interface ContentSetting {
+ /**
+ * Clear all content setting rules set by this extension.
+ */
+ clear(details: ClearDetails, callback?: () => void): void;
+ /**
+ * Applies a new content setting rule.
+ */
+ set(details: SetDetails, callback?: () => void): void;
+ getResourceIdentifiers(
+ callback: (
+ /**
+ * A list of resource identifiers for this content type, or undefined if this content type does not use resource identifiers.
+ */
+ resourceIdentifiers?: ResourceIdentifier[],
+ ) => void,
+ ): void;
+ /**
+ * Gets the current content setting for a given pair of URLs.
+ */
+ get(details: GetDetails, callback: (details: ReturnedDetails) => void): void;
+ }
+
+ export interface CookieContentSetting extends ContentSetting {
+ set(details: CookieSetDetails, callback?: () => void): void;
+ get(details: GetDetails, callback: (details: CookieSetDetails) => void): void;
+ }
+
+ export interface PopupsContentSetting extends ContentSetting {
+ set(details: PopupsSetDetails, callback?: () => void): void;
+ get(details: GetDetails, callback: (details: PopupsSetDetails) => void): void;
+ }
+
+ export interface JavascriptContentSetting extends ContentSetting {
+ set(details: JavascriptSetDetails, callback?: () => void): void;
+ get(details: GetDetails, callback: (details: JavascriptSetDetails) => void): void;
+ }
+
+ export interface NotificationsContentSetting extends ContentSetting {
+ set(details: NotificationsSetDetails, callback?: () => void): void;
+ get(details: GetDetails, callback: (details: NotificationsSetDetails) => void): void;
+ }
+
+ export interface PluginsContentSetting extends ContentSetting {
+ set(details: PluginsSetDetails, callback?: () => void): void;
+ get(details: GetDetails, callback: (details: PluginsSetDetails) => void): void;
+ }
+
+ export interface ImagesContentSetting extends ContentSetting {
+ set(details: ImagesSetDetails, callback?: () => void): void;
+ get(details: GetDetails, callback: (details: ImagesSetDetails) => void): void;
+ }
+
+ export interface LocationContentSetting extends ContentSetting {
+ set(details: LocationSetDetails, callback?: () => void): void;
+ get(details: GetDetails, callback: (details: LocationSetDetails) => void): void;
+ }
+
+ export interface FullscreenContentSetting extends ContentSetting {
+ set(details: FullscreenSetDetails, callback?: () => void): void;
+ get(details: GetDetails, callback: (details: FullscreenSetDetails) => void): void;
+ }
+
+ export interface MouselockContentSetting extends ContentSetting {
+ set(details: MouselockSetDetails, callback?: () => void): void;
+ get(details: GetDetails, callback: (details: MouselockSetDetails) => void): void;
+ }
+
+ export interface MicrophoneContentSetting extends ContentSetting {
+ set(details: MicrophoneSetDetails, callback?: () => void): void;
+ get(details: GetDetails, callback: (details: MicrophoneSetDetails) => void): void;
+ }
+
+ export interface CameraContentSetting extends ContentSetting {
+ set(details: CameraSetDetails, callback?: () => void): void;
+ get(details: GetDetails, callback: (details: CameraSetDetails) => void): void;
+ }
+
+ export interface PpapiBrokerContentSetting extends ContentSetting {
+ set(details: PpapiBrokerSetDetails, callback?: () => void): void;
+ get(details: GetDetails, callback: (details: PpapiBrokerSetDetails) => void): void;
+ }
+
+ export interface MultipleAutomaticDownloadsContentSetting extends ContentSetting {
+ set(details: MultipleAutomaticDownloadsSetDetails, callback?: () => void): void;
+ get(details: GetDetails, callback: (details: MultipleAutomaticDownloadsSetDetails) => void): void;
+ }
+
+ /** The only content type using resource identifiers is contentSettings.plugins. For more information, see Resource Identifiers. */
+ export interface ResourceIdentifier {
+ /** The resource identifier for the given content type. */
+ id: string;
+ /** Optional. A human readable description of the resource. */
+ description?: string | undefined;
+ }
+
+ /**
+ * Whether to allow cookies and other local data to be set by websites. One of
+ * allow: Accept cookies,
+ * block: Block cookies,
+ * session_only: Accept cookies only for the current session.
+ * Default is allow.
+ * The primary URL is the URL representing the cookie origin. The secondary URL is the URL of the top-level frame.
+ */
+ export var cookies: CookieContentSetting;
+ /**
+ * Whether to allow sites to show pop-ups. One of
+ * allow: Allow sites to show pop-ups,
+ * block: Don't allow sites to show pop-ups.
+ * Default is block.
+ * The primary URL is the URL of the top-level frame. The secondary URL is not used.
+ */
+ export var popups: PopupsContentSetting;
+ /**
+ * Whether to run JavaScript. One of
+ * allow: Run JavaScript,
+ * block: Don't run JavaScript.
+ * Default is allow.
+ * The primary URL is the URL of the top-level frame. The secondary URL is not used.
+ */
+ export var javascript: JavascriptContentSetting;
+ /**
+ * Whether to allow sites to show desktop notifications. One of
+ * allow: Allow sites to show desktop notifications,
+ * block: Don't allow sites to show desktop notifications,
+ * ask: Ask when a site wants to show desktop notifications.
+ * Default is ask.
+ * The primary URL is the URL of the document which wants to show the notification. The secondary URL is not used.
+ */
+ export var notifications: NotificationsContentSetting;
+ /**
+ * Whether to run plugins. One of
+ * allow: Run plugins automatically,
+ * block: Don't run plugins automatically,
+ * detect_important_content: Only run automatically those plugins that are detected as the website's main content.
+ * Default is allow.
+ * The primary URL is the URL of the top-level frame. The secondary URL is not used.
+ */
+ export var plugins: PluginsContentSetting;
+ /**
+ * Whether to show images. One of
+ * allow: Show images,
+ * block: Don't show images.
+ * Default is allow.
+ * The primary URL is the URL of the top-level frame. The secondary URL is the URL of the image.
+ */
+ export var images: ImagesContentSetting;
+ /**
+ * Since Chrome 42.
+ * Whether to allow Geolocation. One of
+ * allow: Allow sites to track your physical location,
+ * block: Don't allow sites to track your physical location,
+ * ask: Ask before allowing sites to track your physical location.
+ * Default is ask.
+ * The primary URL is the URL of the document which requested location data. The secondary URL is the URL of the top-level frame (which may or may not differ from the requesting URL).
+ */
+ export var location: LocationContentSetting;
+ /**
+ * Since Chrome 42.
+ * Whether to allow sites to toggle the fullscreen mode. One of
+ * allow: Allow sites to toggle the fullscreen mode,
+ * ask: Ask when a site wants to toggle the fullscreen mode.
+ * Default is ask.
+ * The primary URL is the URL of the document which requested to toggle the fullscreen mode. The secondary URL is the URL of the top-level frame (which may or may not differ from the requesting URL).
+ */
+ export var fullscreen: FullscreenContentSetting;
+ /**
+ * Since Chrome 42.
+ * Whether to allow sites to disable the mouse cursor. One of
+ * allow: Allow sites to disable the mouse cursor,
+ * block: Don't allow sites to disable the mouse cursor,
+ * ask: Ask when a site wants to disable the mouse cursor.
+ * Default is ask.
+ * The primary URL is the URL of the top-level frame. The secondary URL is not used.
+ */
+ export var mouselock: MouselockContentSetting;
+ /**
+ * Since Chrome 46.
+ * Whether to allow sites to access the microphone. One of
+ * allow: Allow sites to access the microphone,
+ * block: Don't allow sites to access the microphone,
+ * ask: Ask when a site wants to access the microphone.
+ * Default is ask.
+ * The primary URL is the URL of the document which requested microphone access. The secondary URL is not used.
+ * NOTE: The 'allow' setting is not valid if both patterns are ''.
+ */
+ export var microphone: MicrophoneContentSetting;
+ /**
+ * Since Chrome 46.
+ * Whether to allow sites to access the camera. One of
+ * allow: Allow sites to access the camera,
+ * block: Don't allow sites to access the camera,
+ * ask: Ask when a site wants to access the camera.
+ * Default is ask.
+ * The primary URL is the URL of the document which requested camera access. The secondary URL is not used.
+ * NOTE: The 'allow' setting is not valid if both patterns are ''.
+ */
+ export var camera: CameraContentSetting;
+ /**
+ * Since Chrome 42.
+ * Whether to allow sites to run plugins unsandboxed. One of
+ * allow: Allow sites to run plugins unsandboxed,
+ * block: Don't allow sites to run plugins unsandboxed,
+ * ask: Ask when a site wants to run a plugin unsandboxed.
+ * Default is ask.
+ * The primary URL is the URL of the top-level frame. The secondary URL is not used.
+ */
+ export var unsandboxedPlugins: PpapiBrokerContentSetting;
+ /**
+ * Since Chrome 42.
+ * Whether to allow sites to download multiple files automatically. One of
+ * allow: Allow sites to download multiple files automatically,
+ * block: Don't allow sites to download multiple files automatically,
+ * ask: Ask when a site wants to download files automatically after the first file.
+ * Default is ask.
+ * The primary URL is the URL of the top-level frame. The secondary URL is not used.
+ */
+ export var automaticDownloads: MultipleAutomaticDownloadsContentSetting;
+}
+
+////////////////////
+// Context Menus
+////////////////////
+/**
+ * Use the chrome.contextMenus API to add items to Google Chrome's context menu. You can choose what types of objects your context menu additions apply to, such as images, hyperlinks, and pages.
+ * Availability: Since Chrome 6.
+ * Permissions: "contextMenus"
+ */
+declare namespace chrome.contextMenus {
+ export interface OnClickData {
+ /**
+ * Optional.
+ * Since Chrome 35.
+ * The text for the context selection, if any.
+ */
+ selectionText?: string | undefined;
+ /**
+ * Optional.
+ * Since Chrome 35.
+ * A flag indicating the state of a checkbox or radio item after it is clicked.
+ */
+ checked?: boolean | undefined;
+ /**
+ * Since Chrome 35.
+ * The ID of the menu item that was clicked.
+ */
+ menuItemId: number | string;
+ /**
+ * Optional.
+ * Since Chrome 35.
+ * The ID of the frame of the element where the context menu was
+ * clicked, if it was in a frame.
+ */
+ frameId?: number | undefined;
+ /**
+ * Optional.
+ * Since Chrome 35.
+ * The URL of the frame of the element where the context menu was clicked, if it was in a frame.
+ */
+ frameUrl?: string | undefined;
+ /**
+ * Since Chrome 35.
+ * A flag indicating whether the element is editable (text input, textarea, etc.).
+ */
+ editable: boolean;
+ /**
+ * Optional.
+ * Since Chrome 35.
+ * One of 'image', 'video', or 'audio' if the context menu was activated on one of these types of elements.
+ */
+ mediaType?: "image" | "video" | "audio" | undefined;
+ /**
+ * Optional.
+ * Since Chrome 35.
+ * A flag indicating the state of a checkbox or radio item before it was clicked.
+ */
+ wasChecked?: boolean | undefined;
+ /**
+ * Since Chrome 35.
+ * The URL of the page where the menu item was clicked. This property is not set if the click occurred in a context where there is no current page, such as in a launcher context menu.
+ */
+ pageUrl: string;
+ /**
+ * Optional.
+ * Since Chrome 35.
+ * If the element is a link, the URL it points to.
+ */
+ linkUrl?: string | undefined;
+ /**
+ * Optional.
+ * Since Chrome 35.
+ * The parent ID, if any, for the item clicked.
+ */
+ parentMenuItemId?: number | string;
+ /**
+ * Optional.
+ * Since Chrome 35.
+ * Will be present for elements with a 'src' URL.
+ */
+ srcUrl?: string | undefined;
+ }
+
+ type ContextType =
+ | "all"
+ | "page"
+ | "frame"
+ | "selection"
+ | "link"
+ | "editable"
+ | "image"
+ | "video"
+ | "audio"
+ | "launcher"
+ | "browser_action"
+ | "page_action"
+ | "action";
+
+ type ContextItemType = "normal" | "checkbox" | "radio" | "separator";
+
+ export interface CreateProperties {
+ /** Optional. Lets you restrict the item to apply only to documents whose URL matches one of the given patterns. (This applies to frames as well.) For details on the format of a pattern, see Match Patterns. */
+ documentUrlPatterns?: string[] | undefined;
+ /** Optional. The initial state of a checkbox or radio item: true for selected and false for unselected. Only one radio item can be selected at a time in a given group of radio items. */
+ checked?: boolean | undefined;
+ /** Optional. The text to be displayed in the item; this is required unless type is 'separator'. When the context is 'selection', you can use %s within the string to show the selected text. For example, if this parameter's value is "Translate '%s' to Pig Latin" and the user selects the word "cool", the context menu item for the selection is "Translate 'cool' to Pig Latin". */
+ title?: string | undefined;
+ /** Optional. List of contexts this menu item will appear in. Defaults to ['page'] if not specified. */
+ contexts?: ContextType | ContextType[] | undefined;
+ /**
+ * Optional.
+ * Since Chrome 20.
+ * Whether this context menu item is enabled or disabled. Defaults to true.
+ */
+ enabled?: boolean | undefined;
+ /** Optional. Similar to documentUrlPatterns, but lets you filter based on the src attribute of img/audio/video tags and the href of anchor tags. */
+ targetUrlPatterns?: string[] | undefined;
+ /**
+ * Optional.
+ * A function that will be called back when the menu item is clicked. Event pages cannot use this; instead, they should register a listener for chrome.contextMenus.onClicked.
+ * @param info Information sent when a context menu item is clicked.
+ * @param tab The details of the tab where the click took place. Note: this parameter only present for extensions.
+ */
+ onclick?: ((info: OnClickData, tab: chrome.tabs.Tab) => void) | undefined;
+ /** Optional. The ID of a parent menu item; this makes the item a child of a previously added item. */
+ parentId?: number | string | undefined;
+ /** Optional. The type of menu item. Defaults to 'normal' if not specified. */
+ type?: ContextItemType | undefined;
+ /**
+ * Optional.
+ * Since Chrome 21.
+ * The unique ID to assign to this item. Mandatory for event pages. Cannot be the same as another ID for this extension.
+ */
+ id?: string | undefined;
+ /**
+ * Optional.
+ * Since Chrome 62.
+ * Whether the item is visible in the menu.
+ */
+ visible?: boolean | undefined;
+ }
+
+ export interface UpdateProperties {
+ documentUrlPatterns?: string[] | undefined;
+ checked?: boolean | undefined;
+ title?: string | undefined;
+ contexts?: ContextType[] | undefined;
+ /** Optional. Since Chrome 20. */
+ enabled?: boolean | undefined;
+ targetUrlPatterns?: string[] | undefined;
+ onclick?: Function | undefined;
+ /** Optional. Note: You cannot change an item to be a child of one of its own descendants. */
+ parentId?: number | string;
+ type?: ContextItemType | undefined;
+ /**
+ * Optional.
+ * @since Chrome 62.
+ * Whether the item is visible in the menu.
+ */
+ visible?: boolean | undefined;
+ }
+
+ export interface MenuClickedEvent extends chrome.events.Event<(info: OnClickData, tab?: chrome.tabs.Tab) => void> {}
+
+ /**
+ * Since Chrome 38.
+ * The maximum number of top level extension items that can be added to an extension action context menu. Any items beyond this limit will be ignored.
+ */
+ export var ACTION_MENU_TOP_LEVEL_LIMIT: number;
+
+ /**
+ * Removes all context menu items added by this extension.
+ * @param callback Called when removal is complete.
+ */
+ export function removeAll(callback?: () => void): void;
+ /**
+ * Creates a new context menu item. Note that if an error occurs during creation, you may not find out until the creation callback fires (the details will be in chrome.runtime.lastError).
+ * @param callback Called when the item has been created in the browser. If there were any problems creating the item, details will be available in chrome.runtime.lastError.
+ * @return The ID of the newly created item.
+ */
+ export function create(createProperties: CreateProperties, callback?: () => void): number | string;
+ /**
+ * Updates a previously created context menu item.
+ * @param id The ID of the item to update.
+ * @param updateProperties The properties to update. Accepts the same values as the create function.
+ * @param callback Called when the context menu has been updated.
+ */
+ export function update(id: string | number, updateProperties: UpdateProperties, callback?: () => void): void;
+ /**
+ * Removes a context menu item.
+ * @param menuItemId The ID of the context menu item to remove.
+ * @param callback Called when the context menu has been removed.
+ */
+ export function remove(menuItemId: string | number, callback?: () => void): void;
+
+ /**
+ * Since Chrome 21.
+ * Fired when a context menu item is clicked.
+ */
+ export var onClicked: MenuClickedEvent;
+}
+
+////////////////////
+// Cookies
+////////////////////
+/**
+ * Use the chrome.cookies API to query and modify cookies, and to be notified when they change.
+ * Availability: Since Chrome 6.
+ * Permissions: "cookies", host permissions
+ */
+declare namespace chrome.cookies {
+ /** A cookie's 'SameSite' state (https://tools.ietf.org/html/draft-west-first-party-cookies). 'no_restriction' corresponds to a cookie set with 'SameSite=None', 'lax' to 'SameSite=Lax', and 'strict' to 'SameSite=Strict'. 'unspecified' corresponds to a cookie set without the SameSite attribute. **/
+ export type SameSiteStatus = "unspecified" | "no_restriction" | "lax" | "strict";
+
+ /** Represents information about an HTTP cookie. */
+ export interface Cookie {
+ /** The domain of the cookie (e.g. "www.google.com", "example.com"). */
+ domain: string;
+ /** The name of the cookie. */
+ name: string;
+ /** The ID of the cookie store containing this cookie, as provided in getAllCookieStores(). */
+ storeId: string;
+ /** The value of the cookie. */
+ value: string;
+ /** True if the cookie is a session cookie, as opposed to a persistent cookie with an expiration date. */
+ session: boolean;
+ /** True if the cookie is a host-only cookie (i.e. a request's host must exactly match the domain of the cookie). */
+ hostOnly: boolean;
+ /** Optional. The expiration date of the cookie as the number of seconds since the UNIX epoch. Not provided for session cookies. */
+ expirationDate?: number | undefined;
+ /** The path of the cookie. */
+ path: string;
+ /** True if the cookie is marked as HttpOnly (i.e. the cookie is inaccessible to client-side scripts). */
+ httpOnly: boolean;
+ /** True if the cookie is marked as Secure (i.e. its scope is limited to secure channels, typically HTTPS). */
+ secure: boolean;
+ /**
+ * The cookie's same-site status (i.e. whether the cookie is sent with cross-site requests).
+ * @since Chrome 51.
+ */
+ sameSite: SameSiteStatus;
+ }
+
+ /** Represents a cookie store in the browser. An incognito mode window, for instance, uses a separate cookie store from a non-incognito window. */
+ export interface CookieStore {
+ /** The unique identifier for the cookie store. */
+ id: string;
+ /** Identifiers of all the browser tabs that share this cookie store. */
+ tabIds: number[];
+ }
+
+ export interface GetAllDetails {
+ /** Optional. Restricts the retrieved cookies to those whose domains match or are subdomains of this one. */
+ domain?: string | undefined;
+ /** Optional. Filters the cookies by name. */
+ name?: string | undefined;
+ /** Optional. Restricts the retrieved cookies to those that would match the given URL. */
+ url?: string | undefined;
+ /** Optional. The cookie store to retrieve cookies from. If omitted, the current execution context's cookie store will be used. */
+ storeId?: string | undefined;
+ /** Optional. Filters out session vs. persistent cookies. */
+ session?: boolean | undefined;
+ /** Optional. Restricts the retrieved cookies to those whose path exactly matches this string. */
+ path?: string | undefined;
+ /** Optional. Filters the cookies by their Secure property. */
+ secure?: boolean | undefined;
+ }
+
+ export interface SetDetails {
+ /** Optional. The domain of the cookie. If omitted, the cookie becomes a host-only cookie. */
+ domain?: string | undefined;
+ /** Optional. The name of the cookie. Empty by default if omitted. */
+ name?: string | undefined;
+ /** The request-URI to associate with the setting of the cookie. This value can affect the default domain and path values of the created cookie. If host permissions for this URL are not specified in the manifest file, the API call will fail. */
+ url: string;
+ /** Optional. The ID of the cookie store in which to set the cookie. By default, the cookie is set in the current execution context's cookie store. */
+ storeId?: string | undefined;
+ /** Optional. The value of the cookie. Empty by default if omitted. */
+ value?: string | undefined;
+ /** Optional. The expiration date of the cookie as the number of seconds since the UNIX epoch. If omitted, the cookie becomes a session cookie. */
+ expirationDate?: number | undefined;
+ /** Optional. The path of the cookie. Defaults to the path portion of the url parameter. */
+ path?: string | undefined;
+ /** Optional. Whether the cookie should be marked as HttpOnly. Defaults to false. */
+ httpOnly?: boolean | undefined;
+ /** Optional. Whether the cookie should be marked as Secure. Defaults to false. */
+ secure?: boolean | undefined;
+ /**
+ * Optional. The cookie's same-site status. Defaults to "unspecified", i.e., if omitted, the cookie is set without specifying a SameSite attribute.
+ * @since Chrome 51.
+ */
+ sameSite?: SameSiteStatus | undefined;
+ }
+
+ export interface Details {
+ name: string;
+ url: string;
+ storeId?: string | undefined;
+ }
+
+ export interface CookieChangeInfo {
+ /** Information about the cookie that was set or removed. */
+ cookie: Cookie;
+ /** True if a cookie was removed. */
+ removed: boolean;
+ /**
+ * Since Chrome 12.
+ * The underlying reason behind the cookie's change.
+ */
+ cause: string;
+ }
+
+ export interface CookieChangedEvent extends chrome.events.Event<(changeInfo: CookieChangeInfo) => void> {}
+
+ /**
+ * Lists all existing cookie stores.
+ * Parameter cookieStores: All the existing cookie stores.
+ */
+ export function getAllCookieStores(callback: (cookieStores: CookieStore[]) => void): void;
+ /**
+ * Lists all existing cookie stores.
+ * @return The `getAllCookieStores` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function getAllCookieStores(): Promise<CookieStore[]>;
+ /**
+ * Retrieves all cookies from a single cookie store that match the given information. The cookies returned will be sorted, with those with the longest path first. If multiple cookies have the same path length, those with the earliest creation time will be first.
+ * @param details Information to filter the cookies being retrieved.
+ * Parameter cookies: All the existing, unexpired cookies that match the given cookie info.
+ */
+ export function getAll(details: GetAllDetails, callback: (cookies: Cookie[]) => void): void;
+ /**
+ * Retrieves all cookies from a single cookie store that match the given information. The cookies returned will be sorted, with those with the longest path first. If multiple cookies have the same path length, those with the earliest creation time will be first.
+ * @param details Information to filter the cookies being retrieved.
+ * @return The `getAll` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function getAll(details: GetAllDetails): Promise<Cookie[]>;
+ /**
+ * Sets a cookie with the given cookie data; may overwrite equivalent cookies if they exist.
+ * @param details Details about the cookie being set.
+ * @return The `set` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function set(details: SetDetails): Promise<Cookie | null>;
+ /**
+ * Sets a cookie with the given cookie data; may overwrite equivalent cookies if they exist.
+ * @param details Details about the cookie being set.
+ * Optional parameter cookie: Contains details about the cookie that's been set. If setting failed for any reason, this will be "null", and "chrome.runtime.lastError" will be set.
+ */
+ export function set(details: SetDetails, callback: (cookie: Cookie | null) => void): void;
+ /**
+ * Deletes a cookie by name.
+ * @param details Information to identify the cookie to remove.
+ * @return The `remove` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function remove(details: Details): Promise<Details>;
+ /**
+ * Deletes a cookie by name.
+ * @param details Information to identify the cookie to remove.
+ */
+ export function remove(details: Details, callback?: (details: Details) => void): void;
+ /**
+ * Retrieves information about a single cookie. If more than one cookie of the same name exists for the given URL, the one with the longest path will be returned. For cookies with the same path length, the cookie with the earliest creation time will be returned.
+ * @param details Details to identify the cookie being retrieved.
+ * Parameter cookie: Contains details about the cookie. This parameter is null if no such cookie was found.
+ */
+ export function get(details: Details, callback: (cookie: Cookie | null) => void): void;
+ /**
+ * Retrieves information about a single cookie. If more than one cookie of the same name exists for the given URL, the one with the longest path will be returned. For cookies with the same path length, the cookie with the earliest creation time will be returned.
+ * @param details Details to identify the cookie being retrieved.
+ * @return The `get` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function get(details: Details): Promise<Cookie | null>;
+
+ /** Fired when a cookie is set or removed. As a special case, note that updating a cookie's properties is implemented as a two step process: the cookie to be updated is first removed entirely, generating a notification with "cause" of "overwrite" . Afterwards, a new cookie is written with the updated values, generating a second notification with "cause" "explicit". */
+ export var onChanged: CookieChangedEvent;
+}
+
+////////////////////
+// Debugger
+////////////////////
+/**
+ * The chrome.debugger API serves as an alternate transport for Chrome's remote debugging protocol. Use chrome.debugger to attach to one or more tabs to instrument network interaction, debug JavaScript, mutate the DOM and CSS, etc. Use the Debuggee tabId to target tabs with sendCommand and route events by tabId from onEvent callbacks.
+ * Availability: Since Chrome 18.
+ * Permissions: "debugger"
+ */
+declare namespace chrome {
+ namespace _debugger {
+ /** Debuggee identifier. Either tabId or extensionId must be specified */
+ export interface Debuggee {
+ /** Optional. The id of the tab which you intend to debug. */
+ tabId?: number | undefined;
+ /**
+ * Optional.
+ * Since Chrome 27.
+ * The id of the extension which you intend to debug. Attaching to an extension background page is only possible when 'silent-debugger-extension-api' flag is enabled on the target browser.
+ */
+ extensionId?: string | undefined;
+ /**
+ * Optional.
+ * Since Chrome 28.
+ * The opaque id of the debug target.
+ */
+ targetId?: string | undefined;
+ }
+
+ /**
+ * Since Chrome 28.
+ * Debug target information
+ */
+ export interface TargetInfo {
+ /** Target type. */
+ type: string;
+ /** Target id. */
+ id: string;
+ /**
+ * Optional.
+ * Since Chrome 30.
+ * The tab id, defined if type == 'page'.
+ */
+ tabId?: number | undefined;
+ /**
+ * Optional.
+ * Since Chrome 30.
+ * The extension id, defined if type = 'background_page'.
+ */
+ extensionId?: string | undefined;
+ /** True if debugger is already attached. */
+ attached: boolean;
+ /** Target page title. */
+ title: string;
+ /** Target URL. */
+ url: string;
+ /** Optional. Target favicon URL. */
+ faviconUrl?: string | undefined;
+ }
+
+ export interface DebuggerDetachedEvent
+ extends chrome.events.Event<(source: Debuggee, reason: string) => void>
+ {}
+
+ export interface DebuggerEventEvent
+ extends chrome.events.Event<(source: Debuggee, method: string, params?: Object) => void>
+ {}
+
+ /**
+ * Attaches debugger to the given target.
+ * @param target Debugging target to which you want to attach.
+ * @param requiredVersion Required debugging protocol version ("0.1"). One can only attach to the debuggee with matching major version and greater or equal minor version. List of the protocol versions can be obtained in the documentation pages.
+ * @return The `attach` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function attach(target: Debuggee, requiredVersion: string): Promise<void>;
+ /**
+ * Attaches debugger to the given target.
+ * @param target Debugging target to which you want to attach.
+ * @param requiredVersion Required debugging protocol version ("0.1"). One can only attach to the debuggee with matching major version and greater or equal minor version. List of the protocol versions can be obtained in the documentation pages.
+ * @param callback Called once the attach operation succeeds or fails. If the attach fails, runtime.lastError will be set to the error message.
+ */
+ export function attach(target: Debuggee, requiredVersion: string, callback: () => void): void;
+ /**
+ * Detaches debugger from the given target.
+ * @param target Debugging target from which you want to detach.
+ * @return The `detach` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function detach(target: Debuggee): Promise<void>;
+ /**
+ * Detaches debugger from the given target.
+ * @param target Debugging target from which you want to detach.
+ * @param callback Called once the detach operation succeeds or fails. If the detach fails, runtime.lastError will be set to the error message.
+ */
+ export function detach(target: Debuggee, callback: () => void): void;
+ /**
+ * Sends given command to the debugging target.
+ * @param target Debugging target to which you want to send the command.
+ * @param method Method name. Should be one of the methods defined by the remote debugging protocol.
+ * @param commandParams Since Chrome 22.
+ * JSON object with request parameters. This object must conform to the remote debugging params scheme for given method.
+ * @return The `sendCommand` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function sendCommand(
+ target: Debuggee,
+ method: string,
+ commandParams?: Object,
+ ): Promise<Object>;
+ /**
+ * Sends given command to the debugging target.
+ * @param target Debugging target to which you want to send the command.
+ * @param method Method name. Should be one of the methods defined by the remote debugging protocol.
+ * @param commandParams Since Chrome 22.
+ * JSON object with request parameters. This object must conform to the remote debugging params scheme for given method.
+ * @param callback Response body. If an error occurs while posting the message, the callback will be called with no arguments and runtime.lastError will be set to the error message.
+ */
+ export function sendCommand(
+ target: Debuggee,
+ method: string,
+ commandParams?: Object,
+ callback?: (result?: Object) => void,
+ ): void;
+ /**
+ * Since Chrome 28.
+ * Returns the list of available debug targets.
+ * @return The `getTargets` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function getTargets(): Promise<TargetInfo[]>;
+ /**
+ * Since Chrome 28.
+ * Returns the list of available debug targets.
+ * Parameter result: Array of TargetInfo objects corresponding to the available debug targets.
+ */
+ export function getTargets(callback: (result: TargetInfo[]) => void): void;
+
+ /** Fired when browser terminates debugging session for the tab. This happens when either the tab is being closed or Chrome DevTools is being invoked for the attached tab. */
+ export var onDetach: DebuggerDetachedEvent;
+ /** Fired whenever debugging target issues instrumentation event. */
+ export var onEvent: DebuggerEventEvent;
+ }
+
+ export { _debugger as debugger };
+}
+////////////////////
+// Declarative Content
+////////////////////
+/**
+ * Use the chrome.declarativeContent API to take actions depending on the content of a page, without requiring permission to read the page's content.
+ * Availability: Since Chrome 33.
+ * Permissions: "declarativeContent"
+ */
+declare namespace chrome.declarativeContent {
+ export interface PageStateUrlDetails {
+ /** Optional. Matches if the host name of the URL contains a specified string. To test whether a host name component has a prefix 'foo', use hostContains: '.foo'. This matches 'www.foobar.com' and 'foo.com', because an implicit dot is added at the beginning of the host name. Similarly, hostContains can be used to match against component suffix ('foo.') and to exactly match against components ('.foo.'). Suffix- and exact-matching for the last components need to be done separately using hostSuffix, because no implicit dot is added at the end of the host name. */
+ hostContains?: string | undefined;
+ /** Optional. Matches if the host name of the URL is equal to a specified string. */
+ hostEquals?: string | undefined;
+ /** Optional. Matches if the host name of the URL starts with a specified string. */
+ hostPrefix?: string | undefined;
+ /** Optional. Matches if the host name of the URL ends with a specified string. */
+ hostSuffix?: string | undefined;
+ /** Optional. Matches if the path segment of the URL contains a specified string. */
+ pathContains?: string | undefined;
+ /** Optional. Matches if the path segment of the URL is equal to a specified string. */
+ pathEquals?: string | undefined;
+ /** Optional. Matches if the path segment of the URL starts with a specified string. */
+ pathPrefix?: string | undefined;
+ /** Optional. Matches if the path segment of the URL ends with a specified string. */
+ pathSuffix?: string | undefined;
+ /** Optional. Matches if the query segment of the URL contains a specified string. */
+ queryContains?: string | undefined;
+ /** Optional. Matches if the query segment of the URL is equal to a specified string. */
+ queryEquals?: string | undefined;
+ /** Optional. Matches if the query segment of the URL starts with a specified string. */
+ queryPrefix?: string | undefined;
+ /** Optional. Matches if the query segment of the URL ends with a specified string. */
+ querySuffix?: string | undefined;
+ /** Optional. Matches if the URL (without fragment identifier) contains a specified string. Port numbers are stripped from the URL if they match the default port number. */
+ urlContains?: string | undefined;
+ /** Optional. Matches if the URL (without fragment identifier) is equal to a specified string. Port numbers are stripped from the URL if they match the default port number. */
+ urlEquals?: string | undefined;
+ /** Optional. Matches if the URL (without fragment identifier) matches a specified regular expression. Port numbers are stripped from the URL if they match the default port number. The regular expressions use the RE2 syntax. */
+ urlMatches?: string | undefined;
+ /** Optional. Matches if the URL without query segment and fragment identifier matches a specified regular expression. Port numbers are stripped from the URL if they match the default port number. The regular expressions use the RE2 syntax. */
+ originAndPathMatches?: string | undefined;
+ /** Optional. Matches if the URL (without fragment identifier) starts with a specified string. Port numbers are stripped from the URL if they match the default port number. */
+ urlPrefix?: string | undefined;
+ /** Optional. Matches if the URL (without fragment identifier) ends with a specified string. Port numbers are stripped from the URL if they match the default port number. */
+ urlSuffix?: string | undefined;
+ /** Optional. Matches if the scheme of the URL is equal to any of the schemes specified in the array. */
+ schemes?: string[] | undefined;
+ /** Optional. Matches if the port of the URL is contained in any of the specified port lists. For example [80, 443, [1000, 1200]] matches all requests on port 80, 443 and in the range 1000-1200. */
+ ports?: (number | number[])[] | undefined;
+ }
+
+ export class PageStateMatcherProperties {
+ /** Optional. Filters URLs for various criteria. See event filtering. All criteria are case sensitive. */
+ pageUrl?: PageStateUrlDetails | undefined;
+ /** Optional. Matches if all of the CSS selectors in the array match displayed elements in a frame with the same origin as the page's main frame. All selectors in this array must be compound selectors to speed up matching. Note that listing hundreds of CSS selectors or CSS selectors that match hundreds of times per page can still slow down web sites. */
+ css?: string[] | undefined;
+ /**
+ * Optional.
+ * Since Chrome 45. Warning: this is the current Beta channel. More information available on the API documentation pages.
+ * Matches if the bookmarked state of the page is equal to the specified value. Requires the bookmarks permission.
+ */
+ isBookmarked?: boolean | undefined;
+ }
+
+ /** Matches the state of a web page by various criteria. */
+ export class PageStateMatcher {
+ constructor(options: PageStateMatcherProperties);
+ }
+
+ /**
+ * Declarative event action that enables the extension's action while the corresponding conditions are met.
+ * Manifest v3.
+ */
+ export class ShowAction {}
+
+ /**
+ * Declarative event action that shows the extension's page action while the corresponding conditions are met.
+ * Manifest v2.
+ */
+ export class ShowPageAction {}
+
+ /** Declarative event action that changes the icon of the page action while the corresponding conditions are met. */
+ export class SetIcon {
+ constructor(options?: { imageData?: ImageData | { [size: string]: ImageData } | undefined });
+ }
+
+ /** Provides the Declarative Event API consisting of addRules, removeRules, and getRules. */
+ export interface PageChangedEvent extends chrome.events.Event<() => void> {}
+
+ export var onPageChanged: PageChangedEvent;
+}
+
+////////////////////
+// Declarative Web Request
+////////////////////
+declare namespace chrome.declarativeWebRequest {
+ export interface HeaderFilter {
+ nameEquals?: string | undefined;
+ valueContains?: string | string[] | undefined;
+ nameSuffix?: string | undefined;
+ valueSuffix?: string | undefined;
+ valuePrefix?: string | undefined;
+ nameContains?: string | string[] | undefined;
+ valueEquals?: string | undefined;
+ namePrefix?: string | undefined;
+ }
+
+ export interface AddResponseHeader {
+ name: string;
+ value: string;
+ }
+
+ export interface RemoveResponseCookie {
+ filter: ResponseCookie;
+ }
+
+ export interface RemoveResponseHeader {
+ name: string;
+ value?: string | undefined;
+ }
+
+ export interface RequestMatcher {
+ contentType?: string[] | undefined;
+ url?: chrome.events.UrlFilter | undefined;
+ excludeContentType?: string[] | undefined;
+ excludeResponseHeader?: HeaderFilter[] | undefined;
+ resourceType?: string | undefined;
+ responseHeaders?: HeaderFilter[] | undefined;
+ }
+
+ export interface IgnoreRules {
+ lowerPriorityThan: number;
+ }
+
+ export interface RedirectToEmptyDocument {}
+
+ export interface RedirectRequest {
+ redirectUrl: string;
+ }
+
+ export interface ResponseCookie {
+ domain?: string | undefined;
+ name?: string | undefined;
+ expires?: string | undefined;
+ maxAge?: number | undefined;
+ value?: string | undefined;
+ path?: string | undefined;
+ httpOnly?: string | undefined;
+ secure?: string | undefined;
+ }
+
+ export interface AddResponseCookie {
+ cookie: ResponseCookie;
+ }
+
+ export interface EditResponseCookie {
+ filter: ResponseCookie;
+ modification: ResponseCookie;
+ }
+
+ export interface CancelRequest {}
+
+ export interface RemoveRequestHeader {
+ name: string;
+ }
+
+ export interface EditRequestCookie {
+ filter: RequestCookie;
+ modification: RequestCookie;
+ }
+
+ export interface SetRequestHeader {
+ name: string;
+ value: string;
+ }
+
+ export interface RequestCookie {
+ name?: string | undefined;
+ value?: string | undefined;
+ }
+
+ export interface RedirectByRegEx {
+ to: string;
+ from: string;
+ }
+
+ export interface RedirectToTransparentImage {}
+
+ export interface AddRequestCookie {
+ cookie: RequestCookie;
+ }
+
+ export interface RemoveRequestCookie {
+ filter: RequestCookie;
+ }
+
+ export interface RequestedEvent extends chrome.events.Event<Function> {}
+
+ export var onRequest: RequestedEvent;
+}
+
+////////////////////
+// DesktopCapture
+////////////////////
+/**
+ * Desktop Capture API that can be used to capture content of screen, individual windows or tabs.
+ * Availability: Since Chrome 34.
+ * Permissions: "desktopCapture"
+ */
+declare namespace chrome.desktopCapture {
+ /** Contains properties that describe the stream. */
+ export interface StreamOptions {
+ /** True if "audio" is included in parameter sources, and the end user does not uncheck the "Share audio" checkbox. Otherwise false, and in this case, one should not ask for audio stream through getUserMedia call. */
+ canRequestAudioTrack: boolean;
+ }
+ /**
+ * Shows desktop media picker UI with the specified set of sources.
+ * @param sources Set of sources that should be shown to the user.
+ * Parameter streamId: An opaque string that can be passed to getUserMedia() API to generate media stream that corresponds to the source selected by the user. If user didn't select any source (i.e. canceled the prompt) then the callback is called with an empty streamId. The created streamId can be used only once and expires after a few seconds when it is not used.
+ */
+ export function chooseDesktopMedia(
+ sources: string[],
+ callback: (streamId: string, options: StreamOptions) => void,
+ ): number;
+ /**
+ * Shows desktop media picker UI with the specified set of sources.
+ * @param sources Set of sources that should be shown to the user.
+ * @param targetTab Optional tab for which the stream is created. If not specified then the resulting stream can be used only by the calling extension. The stream can only be used by frames in the given tab whose security origin matches tab.url.
+ * Parameter streamId: An opaque string that can be passed to getUserMedia() API to generate media stream that corresponds to the source selected by the user. If user didn't select any source (i.e. canceled the prompt) then the callback is called with an empty streamId. The created streamId can be used only once and expires after a few seconds when it is not used.
+ */
+ export function chooseDesktopMedia(
+ sources: string[],
+ targetTab: chrome.tabs.Tab,
+ callback: (streamId: string, options: StreamOptions) => void,
+ ): number;
+ /**
+ * Hides desktop media picker dialog shown by chooseDesktopMedia().
+ * @param desktopMediaRequestId Id returned by chooseDesktopMedia()
+ */
+ export function cancelChooseDesktopMedia(desktopMediaRequestId: number): void;
+}
+
+////////////////////
+// Dev Tools - Inspected Window
+////////////////////
+/**
+ * Use the chrome.devtools.inspectedWindow API to interact with the inspected window: obtain the tab ID for the inspected page, evaluate the code in the context of the inspected window, reload the page, or obtain the list of resources within the page.
+ * Availability: Since Chrome 18.
+ */
+declare namespace chrome.devtools.inspectedWindow {
+ /** A resource within the inspected page, such as a document, a script, or an image. */
+ export interface Resource {
+ /** The URL of the resource. */
+ url: string;
+ /**
+ * Gets the content of the resource.
+ * @param callback A function that receives resource content when the request completes.
+ */
+ getContent(
+ callback: (
+ /** Content of the resource (potentially encoded) */
+ content: string,
+ /** Empty if content is not encoded, encoding name otherwise. Currently, only base64 is supported. */
+ encoding: string,
+ ) => void,
+ ): void;
+ /**
+ * Sets the content of the resource.
+ * @param content New content of the resource. Only resources with the text type are currently supported.
+ * @param commit True if the user has finished editing the resource, and the new content of the resource should be persisted; false if this is a minor change sent in progress of the user editing the resource.
+ * @param callback A function called upon request completion.
+ */
+ setContent(
+ content: string,
+ commit: boolean,
+ callback?: (
+ /**
+ * Set to undefined if the resource content was set successfully; describes error otherwise.
+ */
+ error?: Object,
+ ) => void,
+ ): void;
+ }
+
+ export interface ReloadOptions {
+ /** Optional. If specified, the string will override the value of the User-Agent HTTP header that's sent while loading the resources of the inspected page. The string will also override the value of the navigator.userAgent property that's returned to any scripts that are running within the inspected page. */
+ userAgent?: string | undefined;
+ /** Optional. When true, the loader will ignore the cache for all inspected page resources loaded before the load event is fired. The effect is similar to pressing Ctrl+Shift+R in the inspected window or within the Developer Tools window. */
+ ignoreCache?: boolean | undefined;
+ /** Optional. If specified, the script will be injected into every frame of the inspected page immediately upon load, before any of the frame's scripts. The script will not be injected after subsequent reloads—for example, if the user presses Ctrl+R. */
+ injectedScript?: string | undefined;
+ /**
+ * Optional.
+ * If specified, this script evaluates into a function that accepts three string arguments: the source to preprocess, the URL of the source, and a function name if the source is an DOM event handler. The preprocessorerScript function should return a string to be compiled by Chrome in place of the input source. In the case that the source is a DOM event handler, the returned source must compile to a single JS function.
+ * @deprecated Deprecated since Chrome 41. Please avoid using this parameter, it will be removed soon.
+ */
+ preprocessorScript?: string | undefined;
+ }
+
+ export interface EvaluationExceptionInfo {
+ /** Set if the error occurred on the DevTools side before the expression is evaluated. */
+ isError: boolean;
+ /** Set if the error occurred on the DevTools side before the expression is evaluated. */
+ code: string;
+ /** Set if the error occurred on the DevTools side before the expression is evaluated. */
+ description: string;
+ /** Set if the error occurred on the DevTools side before the expression is evaluated, contains the array of the values that may be substituted into the description string to provide more information about the cause of the error. */
+ details: any[];
+ /** Set if the evaluated code produces an unhandled exception. */
+ isException: boolean;
+ /** Set if the evaluated code produces an unhandled exception. */
+ value: string;
+ }
+
+ export interface ResourceAddedEvent extends chrome.events.Event<(resource: Resource) => void> {}
+
+ export interface ResourceContentCommittedEvent
+ extends chrome.events.Event<(resource: Resource, content: string) => void>
+ {}
+
+ /** The ID of the tab being inspected. This ID may be used with chrome.tabs.* API. */
+ export var tabId: number;
+
+ /** Reloads the inspected page. */
+ export function reload(reloadOptions?: ReloadOptions): void;
+ /**
+ * Evaluates a JavaScript expression in the context of the main frame of the inspected page. The expression must evaluate to a JSON-compliant object, otherwise an exception is thrown. The eval function can report either a DevTools-side error or a JavaScript exception that occurs during evaluation. In either case, the result parameter of the callback is undefined. In the case of a DevTools-side error, the isException parameter is non-null and has isError set to true and code set to an error code. In the case of a JavaScript error, isException is set to true and value is set to the string value of thrown object.
+ * @param expression An expression to evaluate.
+ * @param callback A function called when evaluation completes.
+ * Parameter result: The result of evaluation.
+ * Parameter exceptionInfo: An object providing details if an exception occurred while evaluating the expression.
+ */
+ export function eval<T>(
+ expression: string,
+ callback?: (result: T, exceptionInfo: EvaluationExceptionInfo) => void,
+ ): void;
+ /**
+ * Evaluates a JavaScript expression in the context of the main frame of the inspected page. The expression must evaluate to a JSON-compliant object, otherwise an exception is thrown. The eval function can report either a DevTools-side error or a JavaScript exception that occurs during evaluation. In either case, the result parameter of the callback is undefined. In the case of a DevTools-side error, the isException parameter is non-null and has isError set to true and code set to an error code. In the case of a JavaScript error, isException is set to true and value is set to the string value of thrown object.
+ * @param expression An expression to evaluate.
+ * @param options The options parameter can contain one or more options.
+ * @param callback A function called when evaluation completes.
+ * Parameter result: The result of evaluation.
+ * Parameter exceptionInfo: An object providing details if an exception occurred while evaluating the expression.
+ */
+ export function eval<T>(
+ expression: string,
+ options?: EvalOptions,
+ callback?: (result: T, exceptionInfo: EvaluationExceptionInfo) => void,
+ ): void;
+ /**
+ * Retrieves the list of resources from the inspected page.
+ * @param callback A function that receives the list of resources when the request completes.
+ */
+ export function getResources(callback: (resources: Resource[]) => void): void;
+
+ /** Fired when a new resource is added to the inspected page. */
+ export var onResourceAdded: ResourceAddedEvent;
+ /** Fired when a new revision of the resource is committed (e.g. user saves an edited version of the resource in the Developer Tools). */
+ export var onResourceContentCommitted: ResourceContentCommittedEvent;
+
+ export interface EvalOptions {
+ /** If specified, the expression is evaluated on the iframe whose URL matches the one specified. By default, the expression is evaluated in the top frame of the inspected page. */
+ frameURL?: string | undefined;
+ /** Evaluate the expression in the context of the content script of the calling extension, provided that the content script is already injected into the inspected page. If not, the expression is not evaluated and the callback is invoked with the exception parameter set to an object that has the isError field set to true and the code field set to E_NOTFOUND. */
+ useContentScriptContext?: boolean | undefined;
+ /** Evaluate the expression in the context of a content script of an extension that matches the specified origin. If given, contextSecurityOrigin overrides the 'true' setting on userContentScriptContext. */
+ contextSecurityOrigin?: string | undefined;
+ }
+}
+
+////////////////////
+// Dev Tools - Network
+////////////////////
+/**
+ * Use the chrome.devtools.network API to retrieve the information about network requests displayed by the Developer Tools in the Network panel.
+ * Availability: Since Chrome 18.
+ */
+declare namespace chrome.devtools.network {
+ /** Represents a HAR entry for a specific finished request. */
+ export interface HAREntry extends HARFormatEntry {}
+ /** Represents a HAR log that contains all known network requests. */
+ export interface HARLog extends HARFormatLog {}
+ /** Represents a network request for a document resource (script, image and so on). See HAR Specification for reference. */
+ export interface Request extends chrome.devtools.network.HAREntry {
+ /**
+ * Returns content of the response body.
+ * @param callback A function that receives the response body when the request completes.
+ */
+ getContent(
+ callback: (
+ /** Content of the response body (potentially encoded) */
+ content: string,
+ /** Empty if content is not encoded, encoding name otherwise. Currently, only base64 is supported */
+ encoding: string,
+ ) => void,
+ ): void;
+ }
+
+ export interface RequestFinishedEvent extends chrome.events.Event<(request: Request) => void> {}
+
+ export interface NavigatedEvent extends chrome.events.Event<(url: string) => void> {}
+
+ /**
+ * Returns HAR log that contains all known network requests.
+ * @param callback A function that receives the HAR log when the request completes.
+ * Parameter harLog: A HAR log. See HAR specification for details.
+ */
+ export function getHAR(callback: (harLog: HARLog) => void): void;
+
+ /** Fired when a network request is finished and all request data are available. */
+ export var onRequestFinished: RequestFinishedEvent;
+ /** Fired when the inspected window navigates to a new page. */
+ export var onNavigated: NavigatedEvent;
+}
+
+////////////////////
+// Dev Tools - Panels
+////////////////////
+/**
+ * Use the chrome.devtools.panels API to integrate your extension into Developer Tools window UI: create your own panels, access existing panels, and add sidebars.
+ * Availability: Since Chrome 18.
+ */
+declare namespace chrome.devtools.panels {
+ export interface PanelShownEvent extends chrome.events.Event<(window: Window) => void> {}
+
+ export interface PanelHiddenEvent extends chrome.events.Event<() => void> {}
+
+ export interface PanelSearchEvent extends chrome.events.Event<(action: string, queryString?: string) => void> {}
+
+ /** Represents a panel created by extension. */
+ export interface ExtensionPanel {
+ /**
+ * Appends a button to the status bar of the panel.
+ * @param iconPath Path to the icon of the button. The file should contain a 64x24-pixel image composed of two 32x24 icons. The left icon is used when the button is inactive; the right icon is displayed when the button is pressed.
+ * @param tooltipText Text shown as a tooltip when user hovers the mouse over the button.
+ * @param disabled Whether the button is disabled.
+ */
+ createStatusBarButton(iconPath: string, tooltipText: string, disabled: boolean): Button;
+ /** Fired when the user switches to the panel. */
+ onShown: PanelShownEvent;
+ /** Fired when the user switches away from the panel. */
+ onHidden: PanelHiddenEvent;
+ /** Fired upon a search action (start of a new search, search result navigation, or search being canceled). */
+ onSearch: PanelSearchEvent;
+ }
+
+ export interface ButtonClickedEvent extends chrome.events.Event<() => void> {}
+
+ /** A button created by the extension. */
+ export interface Button {
+ /**
+ * Updates the attributes of the button. If some of the arguments are omitted or null, the corresponding attributes are not updated.
+ * @param iconPath Path to the new icon of the button.
+ * @param tooltipText Text shown as a tooltip when user hovers the mouse over the button.
+ * @param disabled Whether the button is disabled.
+ */
+ update(iconPath?: string | null, tooltipText?: string | null, disabled?: boolean | null): void;
+ /** Fired when the button is clicked. */
+ onClicked: ButtonClickedEvent;
+ }
+
+ export interface SelectionChangedEvent extends chrome.events.Event<() => void> {}
+
+ /** Represents the Elements panel. */
+ export interface ElementsPanel {
+ /**
+ * Creates a pane within panel's sidebar.
+ * @param title Text that is displayed in sidebar caption.
+ * @param callback A callback invoked when the sidebar is created.
+ */
+ createSidebarPane(
+ title: string,
+ callback?: (
+ /** An ExtensionSidebarPane object for created sidebar pane */
+ result: ExtensionSidebarPane,
+ ) => void,
+ ): void;
+ /** Fired when an object is selected in the panel. */
+ onSelectionChanged: SelectionChangedEvent;
+ }
+
+ /**
+ * Since Chrome 41.
+ * Represents the Sources panel.
+ */
+ export interface SourcesPanel {
+ /**
+ * Creates a pane within panel's sidebar.
+ * @param title Text that is displayed in sidebar caption.
+ * @param callback A callback invoked when the sidebar is created.
+ */
+ createSidebarPane(
+ title: string,
+ callback?: (
+ /** An ExtensionSidebarPane object for created sidebar pane. */
+ result: ExtensionSidebarPane,
+ ) => void,
+ ): void;
+ /** Fired when an object is selected in the panel. */
+ onSelectionChanged: SelectionChangedEvent;
+ }
+
+ export interface ExtensionSidebarPaneShownEvent
+ extends chrome.events.Event<(window: chrome.windows.Window) => void>
+ {}
+
+ export interface ExtensionSidebarPaneHiddenEvent extends chrome.events.Event<() => void> {}
+
+ /** A sidebar created by the extension. */
+ export interface ExtensionSidebarPane {
+ /**
+ * Sets the height of the sidebar.
+ * @param height A CSS-like size specification, such as '100px' or '12ex'.
+ */
+ setHeight(height: string): void;
+ /**
+ * Sets an expression that is evaluated within the inspected page. The result is displayed in the sidebar pane.
+ * @param expression An expression to be evaluated in context of the inspected page. JavaScript objects and DOM nodes are displayed in an expandable tree similar to the console/watch.
+ * @param rootTitle An optional title for the root of the expression tree.
+ * @param callback A callback invoked after the sidebar pane is updated with the expression evaluation results.
+ */
+ setExpression(expression: string, rootTitle?: string, callback?: () => void): void;
+ /**
+ * Sets an expression that is evaluated within the inspected page. The result is displayed in the sidebar pane.
+ * @param expression An expression to be evaluated in context of the inspected page. JavaScript objects and DOM nodes are displayed in an expandable tree similar to the console/watch.
+ * @param callback A callback invoked after the sidebar pane is updated with the expression evaluation results.
+ */
+ setExpression(expression: string, callback?: () => void): void;
+ /**
+ * Sets a JSON-compliant object to be displayed in the sidebar pane.
+ * @param jsonObject An object to be displayed in context of the inspected page. Evaluated in the context of the caller (API client).
+ * @param rootTitle An optional title for the root of the expression tree.
+ * @param callback A callback invoked after the sidebar is updated with the object.
+ */
+ setObject(jsonObject: Object, rootTitle?: string, callback?: () => void): void;
+ /**
+ * Sets a JSON-compliant object to be displayed in the sidebar pane.
+ * @param jsonObject An object to be displayed in context of the inspected page. Evaluated in the context of the caller (API client).
+ * @param callback A callback invoked after the sidebar is updated with the object.
+ */
+ setObject(jsonObject: Object, callback?: () => void): void;
+ /**
+ * Sets an HTML page to be displayed in the sidebar pane.
+ * @param path Relative path of an extension page to display within the sidebar.
+ */
+ setPage(path: string): void;
+ /** Fired when the sidebar pane becomes visible as a result of user switching to the panel that hosts it. */
+ onShown: ExtensionSidebarPaneShownEvent;
+ /** Fired when the sidebar pane becomes hidden as a result of the user switching away from the panel that hosts the sidebar pane. */
+ onHidden: ExtensionSidebarPaneHiddenEvent;
+ }
+
+ /** Elements panel. */
+ export var elements: ElementsPanel;
+ /**
+ * Since Chrome 38.
+ * Sources panel.
+ */
+ export var sources: SourcesPanel;
+
+ /**
+ * Creates an extension panel.
+ * @param title Title that is displayed next to the extension icon in the Developer Tools toolbar.
+ * @param iconPath Path of the panel's icon relative to the extension directory.
+ * @param pagePath Path of the panel's HTML page relative to the extension directory.
+ * @param callback A function that is called when the panel is created.
+ * Parameter panel: An ExtensionPanel object representing the created panel.
+ */
+ export function create(
+ title: string,
+ iconPath: string,
+ pagePath: string,
+ callback?: (panel: ExtensionPanel) => void,
+ ): void;
+ /**
+ * Specifies the function to be called when the user clicks a resource link in the Developer Tools window. To unset the handler, either call the method with no parameters or pass null as the parameter.
+ * @param callback A function that is called when the user clicks on a valid resource link in Developer Tools window. Note that if the user clicks an invalid URL or an XHR, this function is not called.
+ * Parameter resource: A devtools.inspectedWindow.Resource object for the resource that was clicked.
+ */
+ export function setOpenResourceHandler(
+ callback?: (resource: chrome.devtools.inspectedWindow.Resource) => void,
+ ): void;
+ /**
+ * Since Chrome 38.
+ * Requests DevTools to open a URL in a Developer Tools panel.
+ * @param url The URL of the resource to open.
+ * @param lineNumber Specifies the line number to scroll to when the resource is loaded.
+ * @param callback A function that is called when the resource has been successfully loaded.
+ */
+ export function openResource(url: string, lineNumber: number, callback?: () => void): void;
+ /**
+ * Since Chrome 96.
+ * Requests DevTools to open a URL in a Developer Tools panel.
+ * @param url The URL of the resource to open.
+ * @param lineNumber Specifies the line number to scroll to when the resource is loaded.
+ * @param columnNumber Specifies the column number to scroll to when the resource is loaded.
+ * @param callback A function that is called when the resource has been successfully loaded.
+ */
+ export function openResource(
+ url: string,
+ lineNumber: number,
+ columnNumber: number,
+ callback?: (response: unknown) => unknown,
+ ): void;
+ /**
+ * @since Chrome 59.
+ * The name of the color theme set in user's DevTools settings.
+ */
+ export var themeName: "default" | "dark";
+}
+
+////////////////////
+// Document Scan
+////////////////////
+/**
+ * Use the chrome.documentScan API to discover and retrieve images from attached paper document scanners.
+ * Availability: Since Chrome 44.
+ * Permissions: "documentScan"
+ * Important: This API works only on Chrome OS.
+ */
+declare namespace chrome.documentScan {
+ export interface DocumentScanOptions {
+ /** Optional. The MIME types that are accepted by the caller. */
+ mimeTypes?: string[] | undefined;
+ /** Optional. The number of scanned images allowed (defaults to 1). */
+ maxImages?: number | undefined;
+ }
+
+ export interface DocumentScanCallbackArg {
+ /** The data image URLs in a form that can be passed as the "src" value to an image tag. */
+ dataUrls: string[];
+ /** The MIME type of dataUrls. */
+ mimeType: string;
+ }
+
+ /**
+ * Performs a document scan. On success, the PNG data will be sent to the callback.
+ * @param options Object containing scan parameters.
+ * @param callback Called with the result and data from the scan.
+ */
+ export function scan(options: DocumentScanOptions, callback: (result: DocumentScanCallbackArg) => void): void;
+}
+
+////////////////////
+// DOM
+////////////////////
+/**
+ * Use the chrome.dom API to programmatically access shadow root in an HTMLElement.
+ * Availability: Since Chrome 88+.
+ */
+declare namespace chrome.dom {
+ /**
+ * Since Chrome 88+.
+ * Requests chrome to return the open/closed shadow roots else return null.
+ * @param element reference of HTMLElement.
+ */
+ export function openOrClosedShadowRoot(element: HTMLElement): ShadowRoot;
+}
+
+////////////////////
+// Dev Tools - Downloads
+////////////////////
+/**
+ * Use the chrome.downloads API to programmatically initiate, monitor, manipulate, and search for downloads.
+ * Availability: Since Chrome 31.
+ * Permissions: "downloads"
+ */
+declare namespace chrome.downloads {
+ export interface HeaderNameValuePair {
+ /** Name of the HTTP header. */
+ name: string;
+ /** Value of the HTTP header. */
+ value: string;
+ }
+
+ export type FilenameConflictAction = "uniquify" | "overwrite" | "prompt";
+
+ export interface DownloadOptions {
+ /** Optional. Post body. */
+ body?: string | undefined;
+ /** Optional. Use a file-chooser to allow the user to select a filename regardless of whether filename is set or already exists. */
+ saveAs?: boolean | undefined;
+ /** The URL to download. */
+ url: string;
+ /** Optional. A file path relative to the Downloads directory to contain the downloaded file, possibly containing subdirectories. Absolute paths, empty paths, and paths containing back-references ".." will cause an error. onDeterminingFilename allows suggesting a filename after the file's MIME type and a tentative filename have been determined. */
+ filename?: string | undefined;
+ /** Optional. Extra HTTP headers to send with the request if the URL uses the HTTP[s] protocol. Each header is represented as a dictionary containing the keys name and either value or binaryValue, restricted to those allowed by XMLHttpRequest. */
+ headers?: HeaderNameValuePair[] | undefined;
+ /** Optional. The HTTP method to use if the URL uses the HTTP[S] protocol. */
+ method?: "GET" | "POST" | undefined;
+ /** Optional. The action to take if filename already exists. */
+ conflictAction?: FilenameConflictAction | undefined;
+ }
+
+ export interface DownloadDelta {
+ /** The id of the DownloadItem that changed. */
+ id: number;
+ /** Optional. The change in danger, if any. */
+ danger?: StringDelta | undefined;
+ /** Optional. The change in url, if any. */
+ url?: StringDelta | undefined;
+ /**
+ * Optional. The change in finalUrl, if any.
+ * @since Since Chrome 54.
+ */
+ finalUrl?: StringDelta | undefined;
+ /** Optional. The change in totalBytes, if any. */
+ totalBytes?: DoubleDelta | undefined;
+ /** Optional. The change in filename, if any. */
+ filename?: StringDelta | undefined;
+ /** Optional. The change in paused, if any. */
+ paused?: BooleanDelta | undefined;
+ /** Optional. The change in state, if any. */
+ state?: StringDelta | undefined;
+ /** Optional. The change in mime, if any. */
+ mime?: StringDelta | undefined;
+ /** Optional. The change in fileSize, if any. */
+ fileSize?: DoubleDelta | undefined;
+ /** Optional. The change in startTime, if any. */
+ startTime?: StringDelta | undefined;
+ /** Optional. The change in error, if any. */
+ error?: StringDelta | undefined;
+ /** Optional. The change in endTime, if any. */
+ endTime?: StringDelta | undefined;
+ /** Optional. The change in canResume, if any. */
+ canResume?: BooleanDelta | undefined;
+ /** Optional. The change in exists, if any. */
+ exists?: BooleanDelta | undefined;
+ }
+
+ export interface BooleanDelta {
+ current?: boolean | undefined;
+ previous?: boolean | undefined;
+ }
+
+ /** Since Chrome 34. */
+ export interface DoubleDelta {
+ current?: number | undefined;
+ previous?: number | undefined;
+ }
+
+ export interface StringDelta {
+ current?: string | undefined;
+ previous?: string | undefined;
+ }
+
+ export type DownloadInterruptReason =
+ | "FILE_FAILED"
+ | "FILE_ACCESS_DENIED"
+ | "FILE_NO_SPACE"
+ | "FILE_NAME_TOO_LONG"
+ | "FILE_TOO_LARGE"
+ | "FILE_VIRUS_INFECTED"
+ | "FILE_TRANSIENT_ERROR"
+ | "FILE_BLOCKED"
+ | "FILE_SECURITY_CHECK_FAILED"
+ | "FILE_TOO_SHORT"
+ | "FILE_HASH_MISMATCH"
+ | "FILE_SAME_AS_SOURCE"
+ | "NETWORK_FAILED"
+ | "NETWORK_TIMEOUT"
+ | "NETWORK_DISCONNECTED"
+ | "NETWORK_SERVER_DOWN"
+ | "NETWORK_INVALID_REQUEST"
+ | "SERVER_FAILED"
+ | "SERVER_NO_RANGE"
+ | "SERVER_BAD_CONTENT"
+ | "SERVER_UNAUTHORIZED"
+ | "SERVER_CERT_PROBLEM"
+ | "SERVER_FORBIDDEN"
+ | "SERVER_UNREACHABLE"
+ | "SERVER_CONTENT_LENGTH_MISMATCH"
+ | "SERVER_CROSS_ORIGIN_REDIRECT"
+ | "USER_CANCELED"
+ | "USER_SHUTDOWN"
+ | "CRASH";
+
+ export type DownloadState = "in_progress" | "interrupted" | "complete";
+
+ export type DangerType = "file" | "url" | "content" | "uncommon" | "host" | "unwanted" | "safe" | "accepted";
+
+ export interface DownloadItem {
+ /** Number of bytes received so far from the host, without considering file compression. */
+ bytesReceived: number;
+ /** Indication of whether this download is thought to be safe or known to be suspicious. */
+ danger: DangerType;
+ /** The absolute URL that this download initiated from, before any redirects. */
+ url: string;
+ /**
+ * The absolute URL that this download is being made from, after all redirects.
+ * @since Since Chrome 54.
+ */
+ finalUrl: string;
+ /** Number of bytes in the whole file, without considering file compression, or -1 if unknown. */
+ totalBytes: number;
+ /** Absolute local path. */
+ filename: string;
+ /** True if the download has stopped reading data from the host, but kept the connection open. */
+ paused: boolean;
+ /** Indicates whether the download is progressing, interrupted, or complete. */
+ state: DownloadState;
+ /** The file's MIME type. */
+ mime: string;
+ /** Number of bytes in the whole file post-decompression, or -1 if unknown. */
+ fileSize: number;
+ /** The time when the download began in ISO 8601 format. May be passed directly to the Date constructor: chrome.downloads.search({}, function(items){items.forEach(function(item){console.log(new Date(item.startTime))})}) */
+ startTime: string;
+ /** Optional. Why the download was interrupted. Several kinds of HTTP errors may be grouped under one of the errors beginning with SERVER_. Errors relating to the network begin with NETWORK_, errors relating to the process of writing the file to the file system begin with FILE_, and interruptions initiated by the user begin with USER_. */
+ error?: DownloadInterruptReason | undefined;
+ /** Optional. The time when the download ended in ISO 8601 format. May be passed directly to the Date constructor: chrome.downloads.search({}, function(items){items.forEach(function(item){if (item.endTime) console.log(new Date(item.endTime))})}) */
+ endTime?: string | undefined;
+ /** An identifier that is persistent across browser sessions. */
+ id: number;
+ /** False if this download is recorded in the history, true if it is not recorded. */
+ incognito: boolean;
+ /** Absolute URL. */
+ referrer: string;
+ /** Optional. Estimated time when the download will complete in ISO 8601 format. May be passed directly to the Date constructor: chrome.downloads.search({}, function(items){items.forEach(function(item){if (item.estimatedEndTime) console.log(new Date(item.estimatedEndTime))})}) */
+ estimatedEndTime?: string | undefined;
+ /** True if the download is in progress and paused, or else if it is interrupted and can be resumed starting from where it was interrupted. */
+ canResume: boolean;
+ /** Whether the downloaded file still exists. This information may be out of date because Chrome does not automatically watch for file removal. Call search() in order to trigger the check for file existence. When the existence check completes, if the file has been deleted, then an onChanged event will fire. Note that search() does not wait for the existence check to finish before returning, so results from search() may not accurately reflect the file system. Also, search() may be called as often as necessary, but will not check for file existence any more frequently than once every 10 seconds. */
+ exists: boolean;
+ /** Optional. The identifier for the extension that initiated this download if this download was initiated by an extension. Does not change once it is set. */
+ byExtensionId?: string | undefined;
+ /** Optional. The localized name of the extension that initiated this download if this download was initiated by an extension. May change if the extension changes its name or if the user changes their locale. */
+ byExtensionName?: string | undefined;
+ }
+
+ export interface GetFileIconOptions {
+ /** Optional. * The size of the returned icon. The icon will be square with dimensions size * size pixels. The default and largest size for the icon is 32x32 pixels. The only supported sizes are 16 and 32. It is an error to specify any other size.
+ */
+ size?: 16 | 32 | undefined;
+ }
+
+ export interface DownloadQuery {
+ /** Optional. Set elements of this array to DownloadItem properties in order to sort search results. For example, setting orderBy=['startTime'] sorts the DownloadItem by their start time in ascending order. To specify descending order, prefix with a hyphen: '-startTime'. */
+ orderBy?: string[] | undefined;
+ /** Optional. Limits results to DownloadItem whose url matches the given regular expression. */
+ urlRegex?: string | undefined;
+ /** Optional. Limits results to DownloadItem that ended before the time in ISO 8601 format. */
+ endedBefore?: string | undefined;
+ /** Optional. Limits results to DownloadItem whose totalBytes is greater than the given integer. */
+ totalBytesGreater?: number | undefined;
+ /** Optional. Indication of whether this download is thought to be safe or known to be suspicious. */
+ danger?: string | undefined;
+ /** Optional. Number of bytes in the whole file, without considering file compression, or -1 if unknown. */
+ totalBytes?: number | undefined;
+ /** Optional. True if the download has stopped reading data from the host, but kept the connection open. */
+ paused?: boolean | undefined;
+ /** Optional. Limits results to DownloadItem whose filename matches the given regular expression. */
+ filenameRegex?: string | undefined;
+ /** Optional. This array of search terms limits results to DownloadItem whose filename or url contain all of the search terms that do not begin with a dash '-' and none of the search terms that do begin with a dash. */
+ query?: string[] | undefined;
+ /** Optional. Limits results to DownloadItem whose totalBytes is less than the given integer. */
+ totalBytesLess?: number | undefined;
+ /** Optional. The id of the DownloadItem to query. */
+ id?: number | undefined;
+ /** Optional. Number of bytes received so far from the host, without considering file compression. */
+ bytesReceived?: number | undefined;
+ /** Optional. Limits results to DownloadItem that ended after the time in ISO 8601 format. */
+ endedAfter?: string | undefined;
+ /** Optional. Absolute local path. */
+ filename?: string | undefined;
+ /** Optional. Indicates whether the download is progressing, interrupted, or complete. */
+ state?: string | undefined;
+ /** Optional. Limits results to DownloadItem that started after the time in ISO 8601 format. */
+ startedAfter?: string | undefined;
+ /** Optional. The file's MIME type. */
+ mime?: string | undefined;
+ /** Optional. Number of bytes in the whole file post-decompression, or -1 if unknown. */
+ fileSize?: number | undefined;
+ /** Optional. The time when the download began in ISO 8601 format. */
+ startTime?: string | undefined;
+ /** Optional. Absolute URL. */
+ url?: string | undefined;
+ /** Optional. Limits results to DownloadItem that started before the time in ISO 8601 format. */
+ startedBefore?: string | undefined;
+ /** Optional. The maximum number of matching DownloadItem returned. Defaults to 1000. Set to 0 in order to return all matching DownloadItem. See search for how to page through results. */
+ limit?: number | undefined;
+ /** Optional. Why a download was interrupted. */
+ error?: number | undefined;
+ /** Optional. The time when the download ended in ISO 8601 format. */
+ endTime?: string | undefined;
+ /** Optional. Whether the downloaded file exists; */
+ exists?: boolean | undefined;
+ }
+
+ export interface DownloadFilenameSuggestion {
+ /** The DownloadItem's new target DownloadItem.filename, as a path relative to the user's default Downloads directory, possibly containing subdirectories. Absolute paths, empty paths, and paths containing back-references ".." will be ignored. */
+ filename: string;
+ /** Optional. The action to take if filename already exists. */
+ conflictAction?: string | undefined;
+ }
+
+ export interface UiOptions {
+ /** Enable or disable the download UI. */
+ enabled: boolean;
+ }
+
+ export interface DownloadChangedEvent extends chrome.events.Event<(downloadDelta: DownloadDelta) => void> {}
+
+ export interface DownloadCreatedEvent extends chrome.events.Event<(downloadItem: DownloadItem) => void> {}
+
+ export interface DownloadErasedEvent extends chrome.events.Event<(downloadId: number) => void> {}
+
+ export interface DownloadDeterminingFilenameEvent extends
+ chrome.events.Event<
+ (downloadItem: DownloadItem, suggest: (suggestion?: DownloadFilenameSuggestion) => void) => void
+ >
+ {}
+
+ /**
+ * Find DownloadItem. Set query to the empty object to get all DownloadItem. To get a specific DownloadItem, set only the id field. To page through a large number of items, set orderBy: ['-startTime'], set limit to the number of items per page, and set startedAfter to the startTime of the last item from the last page.
+ * @return The `search` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function search(query: DownloadQuery): Promise<DownloadItem[]>;
+ /**
+ * Find DownloadItem. Set query to the empty object to get all DownloadItem. To get a specific DownloadItem, set only the id field. To page through a large number of items, set orderBy: ['-startTime'], set limit to the number of items per page, and set startedAfter to the startTime of the last item from the last page.
+ */
+ export function search(query: DownloadQuery, callback: (results: DownloadItem[]) => void): void;
+ /**
+ * Pause the download. If the request was successful the download is in a paused state. Otherwise runtime.lastError contains an error message. The request will fail if the download is not active.
+ * @param downloadId The id of the download to pause.
+ * @return The `pause` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function pause(downloadId: number): Promise<void>;
+ /**
+ * Pause the download. If the request was successful the download is in a paused state. Otherwise runtime.lastError contains an error message. The request will fail if the download is not active.
+ * @param downloadId The id of the download to pause.
+ * @param callback Called when the pause request is completed.
+ */
+ export function pause(downloadId: number, callback: () => void): void;
+ /**
+ * Retrieve an icon for the specified download. For new downloads, file icons are available after the onCreated event has been received. The image returned by this function while a download is in progress may be different from the image returned after the download is complete. Icon retrieval is done by querying the underlying operating system or toolkit depending on the platform. The icon that is returned will therefore depend on a number of factors including state of the download, platform, registered file types and visual theme. If a file icon cannot be determined, runtime.lastError will contain an error message.
+ * @param downloadId The identifier for the download.
+ * @return The `getFileIcon` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function getFileIcon(downloadId: number, options?: GetFileIconOptions): Promise<string>;
+ /**
+ * Retrieve an icon for the specified download. For new downloads, file icons are available after the onCreated event has been received. The image returned by this function while a download is in progress may be different from the image returned after the download is complete. Icon retrieval is done by querying the underlying operating system or toolkit depending on the platform. The icon that is returned will therefore depend on a number of factors including state of the download, platform, registered file types and visual theme. If a file icon cannot be determined, runtime.lastError will contain an error message.
+ * @param downloadId The identifier for the download.
+ * @param callback A URL to an image that represents the download.
+ */
+ export function getFileIcon(downloadId: number, callback: (iconURL: string) => void): void;
+ /**
+ * Retrieve an icon for the specified download. For new downloads, file icons are available after the onCreated event has been received. The image returned by this function while a download is in progress may be different from the image returned after the download is complete. Icon retrieval is done by querying the underlying operating system or toolkit depending on the platform. The icon that is returned will therefore depend on a number of factors including state of the download, platform, registered file types and visual theme. If a file icon cannot be determined, runtime.lastError will contain an error message.
+ * @param downloadId The identifier for the download.
+ * @param callback A URL to an image that represents the download.
+ */
+ export function getFileIcon(
+ downloadId: number,
+ options: GetFileIconOptions,
+ callback: (iconURL: string) => void,
+ ): void;
+ /**
+ * Resume a paused download. If the request was successful the download is in progress and unpaused. Otherwise runtime.lastError contains an error message. The request will fail if the download is not active.
+ * @param downloadId The id of the download to resume.
+ * @return The `resume` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function resume(downloadId: number): Promise<void>;
+ /**
+ * Resume a paused download. If the request was successful the download is in progress and unpaused. Otherwise runtime.lastError contains an error message. The request will fail if the download is not active.
+ * @param downloadId The id of the download to resume.
+ * @param callback Called when the resume request is completed.
+ */
+ export function resume(downloadId: number, callback: () => void): void;
+ /**
+ * Cancel a download. When callback is run, the download is cancelled, completed, interrupted or doesn't exist anymore.
+ * @param downloadId The id of the download to cancel.
+ * @return The `cancel` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function cancel(downloadId: number): Promise<void>;
+ /**
+ * Cancel a download. When callback is run, the download is cancelled, completed, interrupted or doesn't exist anymore.
+ * @param downloadId The id of the download to cancel.
+ * @param callback Called when the cancel request is completed.
+ */
+ export function cancel(downloadId: number, callback: () => void): void;
+ /**
+ * Download a URL. If the URL uses the HTTP[S] protocol, then the request will include all cookies currently set for its hostname. If both filename and saveAs are specified, then the Save As dialog will be displayed, pre-populated with the specified filename. If the download started successfully, callback will be called with the new DownloadItem's downloadId. If there was an error starting the download, then callback will be called with downloadId=undefined and runtime.lastError will contain a descriptive string. The error strings are not guaranteed to remain backwards compatible between releases. Extensions must not parse it.
+ * @param options What to download and how.
+ * @return The `download` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function download(options: DownloadOptions): Promise<number>;
+ /**
+ * Download a URL. If the URL uses the HTTP[S] protocol, then the request will include all cookies currently set for its hostname. If both filename and saveAs are specified, then the Save As dialog will be displayed, pre-populated with the specified filename. If the download started successfully, callback will be called with the new DownloadItem's downloadId. If there was an error starting the download, then callback will be called with downloadId=undefined and runtime.lastError will contain a descriptive string. The error strings are not guaranteed to remain backwards compatible between releases. Extensions must not parse it.
+ * @param options What to download and how.
+ * @param callback Called with the id of the new DownloadItem.
+ */
+ export function download(options: DownloadOptions, callback: (downloadId: number) => void): void;
+ /**
+ * Open the downloaded file now if the DownloadItem is complete; otherwise returns an error through runtime.lastError. Requires the "downloads.open" permission in addition to the "downloads" permission. An onChanged event will fire when the item is opened for the first time.
+ * @param downloadId The identifier for the downloaded file.
+ */
+ export function open(downloadId: number): void;
+ /**
+ * Show the downloaded file in its folder in a file manager.
+ * @param downloadId The identifier for the downloaded file.
+ */
+ export function show(downloadId: number): void;
+ /** Show the default Downloads folder in a file manager. */
+ export function showDefaultFolder(): void;
+ /**
+ * Erase matching DownloadItem from history without deleting the downloaded file. An onErased event will fire for each DownloadItem that matches query, then callback will be called.
+ * @return The `erase` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function erase(query: DownloadQuery): Promise<number[]>;
+ /**
+ * Erase matching DownloadItem from history without deleting the downloaded file. An onErased event will fire for each DownloadItem that matches query, then callback will be called.
+ */
+ export function erase(query: DownloadQuery, callback: (erasedIds: number[]) => void): void;
+ /**
+ * Remove the downloaded file if it exists and the DownloadItem is complete; otherwise return an error through runtime.lastError.
+ * @return The `removeFile` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function removeFile(downloadId: number): Promise<void>;
+ /**
+ * Remove the downloaded file if it exists and the DownloadItem is complete; otherwise return an error through runtime.lastError.
+ */
+ export function removeFile(downloadId: number, callback?: () => void): void;
+ /**
+ * Prompt the user to accept a dangerous download. Can only be called from a visible context (tab, window, or page/browser action popup). Does not automatically accept dangerous downloads. If the download is accepted, then an onChanged event will fire, otherwise nothing will happen. When all the data is fetched into a temporary file and either the download is not dangerous or the danger has been accepted, then the temporary file is renamed to the target filename, the |state| changes to 'complete', and onChanged fires.
+ * @param downloadId The identifier for the DownloadItem.
+ * @return The `acceptDanger` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function acceptDanger(downloadId: number): Promise<void>;
+ /**
+ * Prompt the user to accept a dangerous download. Can only be called from a visible context (tab, window, or page/browser action popup). Does not automatically accept dangerous downloads. If the download is accepted, then an onChanged event will fire, otherwise nothing will happen. When all the data is fetched into a temporary file and either the download is not dangerous or the danger has been accepted, then the temporary file is renamed to the target filename, the |state| changes to 'complete', and onChanged fires.
+ * @param downloadId The identifier for the DownloadItem.
+ * @param callback Called when the danger prompt dialog closes.
+ */
+ export function acceptDanger(downloadId: number, callback: () => void): void;
+ /** Initiate dragging the downloaded file to another application. Call in a javascript ondragstart handler. */
+ export function drag(downloadId: number): void;
+ /** Enable or disable the gray shelf at the bottom of every window associated with the current browser profile. The shelf will be disabled as long as at least one extension has disabled it. Enabling the shelf while at least one other extension has disabled it will return an error through runtime.lastError. Requires the "downloads.shelf" permission in addition to the "downloads" permission. */
+ export function setShelfEnabled(enabled: boolean): void;
+ /**
+ * Change the download UI of every window associated with the current browser profile. As long as at least one extension has set UiOptions.enabled to false, the download UI will be hidden. Setting UiOptions.enabled to true while at least one other extension has disabled it will return an error through runtime.lastError. Requires the "downloads.ui" permission in addition to the "downloads" permission.
+ * @param options Encapsulate a change to the download UI.
+ * @since Chrome 105
+ */
+ export function setUiOptions(options: UiOptions): Promise<void>;
+ /**
+ * Change the download UI of every window associated with the current browser profile. As long as at least one extension has set UiOptions.enabled to false, the download UI will be hidden. Setting UiOptions.enabled to true while at least one other extension has disabled it will return an error through runtime.lastError. Requires the "downloads.ui" permission in addition to the "downloads" permission.
+ * @param options Encapsulate a change to the download UI.
+ * @param callback Called when the setUiOptions request is completed.
+ * @since Chrome 105
+ */
+ export function setUiOptions(options: UiOptions, callback: () => void): void;
+
+ /** When any of a DownloadItem's properties except bytesReceived and estimatedEndTime changes, this event fires with the downloadId and an object containing the properties that changed. */
+ export var onChanged: DownloadChangedEvent;
+ /** This event fires with the DownloadItem object when a download begins. */
+ export var onCreated: DownloadCreatedEvent;
+ /** Fires with the downloadId when a download is erased from history. */
+ export var onErased: DownloadErasedEvent;
+ /** During the filename determination process, extensions will be given the opportunity to override the target DownloadItem.filename. Each extension may not register more than one listener for this event. Each listener must call suggest exactly once, either synchronously or asynchronously. If the listener calls suggest asynchronously, then it must return true. If the listener neither calls suggest synchronously nor returns true, then suggest will be called automatically. The DownloadItem will not complete until all listeners have called suggest. Listeners may call suggest without any arguments in order to allow the download to use downloadItem.filename for its filename, or pass a suggestion object to suggest in order to override the target filename. If more than one extension overrides the filename, then the last extension installed whose listener passes a suggestion object to suggest wins. In order to avoid confusion regarding which extension will win, users should not install extensions that may conflict. If the download is initiated by download and the target filename is known before the MIME type and tentative filename have been determined, pass filename to download instead. */
+ export var onDeterminingFilename: DownloadDeterminingFilenameEvent;
+}
+
+////////////////////
+// Enterprise Platform Keys
+////////////////////
+/**
+ * Use the chrome.enterprise.platformKeys API to generate hardware-backed keys and to install certificates for these keys. The certificates will be managed by the platform and can be used for TLS authentication, network access or by other extension through chrome.platformKeys.
+ * Availability: Since Chrome 37.
+ * Permissions: "enterprise.platformKeys"
+ * Important: This API works only on Chrome OS.
+ * Note: This API is only for extensions pre-installed by policy.
+ */
+declare namespace chrome.enterprise.platformKeys {
+ export interface Token {
+ /**
+ * Uniquely identifies this Token.
+ * Static IDs are "user" and "system", referring to the platform's user-specific and the system-wide hardware token, respectively. Any other tokens (with other identifiers) might be returned by enterprise.platformKeys.getTokens.
+ */
+ id: string;
+ /**
+ * Implements the WebCrypto's SubtleCrypto interface. The cryptographic operations, including key generation, are hardware-backed.
+ * Only non-extractable RSASSA-PKCS1-V1_5 keys with modulusLength up to 2048 and ECDSA with namedCurve P-256 can be generated. Each key can be used for signing data at most once.
+ * Keys generated on a specific Token cannot be used with any other Tokens, nor can they be used with window.crypto.subtle. Equally, Key objects created with window.crypto.subtle cannot be used with this interface.
+ */
+ subtleCrypto: SubtleCrypto;
+ /**
+ * Implements the WebCrypto's SubtleCrypto interface. The cryptographic operations, including key generation, are software-backed.
+ * Protection of the keys, and thus implementation of the non-extractable property, is done in software, so the keys are less protected than hardware-backed keys.
+ * Only non-extractable RSASSA-PKCS1-V1_5 keys with modulusLength up to 2048 can be generated. Each key can be used for signing data at most once.
+ * Keys generated on a specific Token cannot be used with any other Tokens, nor can they be used with window.crypto.subtle. Equally, Key objects created with window.crypto.subtle cannot be used with this interface.
+ * @since Chrome 97.
+ */
+ softwareBackedSubtleCrypto: SubtleCrypto;
+ }
+
+ /**
+ * Returns the available Tokens. In a regular user's session the list will always contain the user's token with id "user". If a system-wide TPM token is available, the returned list will also contain the system-wide token with id "system". The system-wide token will be the same for all sessions on this device (device in the sense of e.g. a Chromebook).
+ * @param callback Invoked by getTokens with the list of available Tokens.
+ * Parameter tokens: The list of available tokens.
+ */
+ export function getTokens(callback: (tokens: Token[]) => void): void;
+ /**
+ * Returns the list of all client certificates available from the given token. Can be used to check for the existence and expiration of client certificates that are usable for a certain authentication.
+ * @param tokenId The id of a Token returned by getTokens.
+ * @param callback Called back with the list of the available certificates.
+ * Parameter certificates: The list of certificates, each in DER encoding of a X.509 certificate.
+ */
+ export function getCertificates(tokenId: string, callback: (certificates: ArrayBuffer[]) => void): void;
+ /**
+ * Imports certificate to the given token if the certified key is already stored in this token. After a successful certification request, this function should be used to store the obtained certificate and to make it available to the operating system and browser for authentication.
+ * @param tokenId The id of a Token returned by getTokens.
+ * @param certificate The DER encoding of a X.509 certificate.
+ * @param callback Called back when this operation is finished.
+ */
+ export function importCertificate(tokenId: string, certificate: ArrayBuffer, callback?: () => void): void;
+ /**
+ * Removes certificate from the given token if present. Should be used to remove obsolete certificates so that they are not considered during authentication and do not clutter the certificate choice. Should be used to free storage in the certificate store.
+ * @param tokenId The id of a Token returned by getTokens.
+ * @param certificate The DER encoding of a X.509 certificate.
+ * @param callback Called back when this operation is finished.
+ */
+ export function removeCertificate(tokenId: string, certificate: ArrayBuffer, callback?: () => void): void;
+ /**
+ * Challenges a hardware-backed Enterprise Machine Key and emits the response as part of a remote attestation protocol. Only useful on Chrome OS and in conjunction with the Verified Access Web API which both issues challenges and verifies responses. A successful verification by the Verified Access Web API is a strong signal of all of the following:
+ *
+ * * The current device is a legitimate Chrome OS device.
+ * * The current device is managed by the domain specified during verification.
+ * * The current signed-in user is managed by the domain specified during verification.
+ * * The current device state complies with enterprise device policy. For example, a policy may specify that the device must not be in developer mode.
+ * * Any device identity emitted by the verification is tightly bound to the hardware of the current device.
+ *
+ * This function is highly restricted and will fail if the current device is not managed, the current user is not managed, or if this operation has not explicitly been enabled for the caller by enterprise device policy. The Enterprise Machine Key does not reside in the "system" token and is not accessible by any other API.
+ * @param challenge A challenge as emitted by the Verified Access Web API.
+ * @param registerKey If set, the current Enterprise Machine Key is registered with the "system" token and relinquishes the Enterprise Machine Key role. The key can then be associated with a certificate and used like any other signing key. This key is 2048-bit RSA. Subsequent calls to this function will then generate a new Enterprise Machine Key. Since Chrome 59.
+ * @param callback Called back with the challenge response.
+ * @since Chrome 50.
+ */
+ export function challengeMachineKey(
+ challenge: ArrayBuffer,
+ registerKey: boolean,
+ callback: (response: ArrayBuffer) => void,
+ ): void;
+ export function challengeMachineKey(challenge: ArrayBuffer, callback: (response: ArrayBuffer) => void): void;
+ /**
+ * Challenges a hardware-backed Enterprise User Key and emits the response as part of a remote attestation protocol. Only useful on Chrome OS and in conjunction with the Verified Access Web API which both issues challenges and verifies responses. A successful verification by the Verified Access Web API is a strong signal of all of the following:
+ *
+ * * The current device is a legitimate Chrome OS device.
+ * * The current device is managed by the domain specified during verification.
+ * * The current signed-in user is managed by the domain specified during verification.
+ * * The current device state complies with enterprise user policy. For example, a policy may specify that the device must not be in developer mode.
+ * * The public key emitted by the verification is tightly bound to the hardware of the current device and to the current signed-in user.
+ *
+ * This function is highly restricted and will fail if the current device is not managed, the current user is not managed, or if this operation has not explicitly been enabled for the caller by enterprise user policy. The Enterprise User Key does not reside in the "user" token and is not accessible by any other API.
+ * @param challenge A challenge as emitted by the Verified Access Web API.
+ * @param registerKey If set, the current Enterprise User Key is registered with the "user" token and relinquishes the Enterprise User Key role. The key can then be associated with a certificate and used like any other signing key. This key is 2048-bit RSA. Subsequent calls to this function will then generate a new Enterprise User Key.
+ * @param callback Called back with the challenge response.
+ * @since Chrome 50.
+ */
+ export function challengeUserKey(
+ challenge: ArrayBuffer,
+ registerKey: boolean,
+ callback: (response: ArrayBuffer) => void,
+ ): void;
+}
+
+////////////////////
+// Enterprise Device Attributes
+////////////////////
+/**
+ * Use the <code>chrome.enterprise.deviceAttributes</code> API to read device attributes.
+ * Permissions: "enterprise.deviceAttributes"
+ * Since: Chrome 46
+ * Important: This API works only on Chrome OS.
+ * Note: This API is only for extensions pre-installed by policy.
+ */
+declare namespace chrome.enterprise.deviceAttributes {
+ /**
+ * @description Fetches the value of the device identifier of the directory API, that is generated by the server and identifies the cloud record of the device for querying in the cloud directory API.
+ * @param callback Called with the device identifier of the directory API when received.
+ */
+ export function getDirectoryDeviceId(callback: (deviceId: string) => void): void;
+ /**
+ * @since Chrome 66.
+ * @description
+ * Fetches the device's serial number.
+ * Please note the purpose of this API is to administrate the device
+ * (e.g. generating Certificate Sign Requests for device-wide certificates).
+ * This API may not be used for tracking devices without the consent of the device's administrator.
+ * If the current user is not affiliated, returns an empty string.
+ * @param callback Called with the serial number of the device.
+ */
+ export function getDeviceSerialNumber(callback: (serialNumber: string) => void): void;
+ /**
+ * @since Chrome 66.
+ * @description
+ * Fetches the administrator-annotated Asset Id.
+ * If the current user is not affiliated or no Asset Id has been set by the administrator, returns an empty string.
+ * @param callback Called with the Asset ID of the device.
+ */
+ export function getDeviceAssetId(callback: (assetId: string) => void): void;
+ /**
+ * @since Chrome 66.
+ * @description
+ * Fetches the administrator-annotated Location.
+ * If the current user is not affiliated or no Annotated Location has been set by the administrator, returns an empty string.
+ * @param callback Called with the Annotated Location of the device.
+ */
+ export function getDeviceAnnotatedLocation(callback: (annotatedLocation: string) => void): void;
+ /**
+ * @since Chrome 82.
+ * @description
+ * Fetches the device's hostname as set by DeviceHostnameTemplate policy.
+ * If the current user is not affiliated or no hostname has been set by the enterprise policy, returns an empty string.
+ * @param callback Called with the hostname of the device.
+ */
+ export function getDeviceHostname(callback: (hostname: string) => void): void;
+}
+
+////////////////////
+// Enterprise Networking Attributes
+////////////////////
+/**
+ * Use the <code>chrome.enterprise.networkingAttributes</code> API to read information about your current network. Note: This API is only available to extensions force-installed by enterprise policy.
+ * Important: This API works only on Chrome OS.
+ * @since Chrome 85.
+ */
+declare namespace chrome.enterprise.networkingAttributes {
+ export interface NetworkDetails {
+ /** The device's MAC address. */
+ macAddress: string;
+ /** Optional. The device's local IPv4 address (undefined if not configured). */
+ ipv4?: string | undefined;
+ /** Optional. The device's local IPv6 address (undefined if not configured). */
+ ipv6?: string | undefined;
+ }
+
+ /**
+ * Retrieves the network details of the device's default network. If the user is not affiliated or the device is not connected to a network, runtime.lastError will be set with a failure reason.
+ * @param callback Called with the device's default network's NetworkDetails.
+ */
+ export function getNetworkDetails(callback: (networkDetails: NetworkDetails) => void): void;
+}
+
+////////////////////
+// Events
+////////////////////
+/**
+ * The chrome.events namespace contains common types used by APIs dispatching events to notify you when something interesting happens.
+ * Availability: Since Chrome 21.
+ */
+declare namespace chrome.events {
+ /** Filters URLs for various criteria. See event filtering. All criteria are case sensitive. */
+ export interface UrlFilter {
+ /** Optional. Matches if the scheme of the URL is equal to any of the schemes specified in the array. */
+ schemes?: string[] | undefined;
+ /**
+ * Optional.
+ * Since Chrome 23.
+ * Matches if the URL (without fragment identifier) matches a specified regular expression. Port numbers are stripped from the URL if they match the default port number. The regular expressions use the RE2 syntax.
+ */
+ urlMatches?: string | undefined;
+ /** Optional. Matches if the path segment of the URL contains a specified string. */
+ pathContains?: string | undefined;
+ /** Optional. Matches if the host name of the URL ends with a specified string. */
+ hostSuffix?: string | undefined;
+ /** Optional. Matches if the host name of the URL starts with a specified string. */
+ hostPrefix?: string | undefined;
+ /** Optional. Matches if the host name of the URL contains a specified string. To test whether a host name component has a prefix 'foo', use hostContains: '.foo'. This matches 'www.foobar.com' and 'foo.com', because an implicit dot is added at the beginning of the host name. Similarly, hostContains can be used to match against component suffix ('foo.') and to exactly match against components ('.foo.'). Suffix- and exact-matching for the last components need to be done separately using hostSuffix, because no implicit dot is added at the end of the host name. */
+ hostContains?: string | undefined;
+ /** Optional. Matches if the URL (without fragment identifier) contains a specified string. Port numbers are stripped from the URL if they match the default port number. */
+ urlContains?: string | undefined;
+ /** Optional. Matches if the query segment of the URL ends with a specified string. */
+ querySuffix?: string | undefined;
+ /** Optional. Matches if the URL (without fragment identifier) starts with a specified string. Port numbers are stripped from the URL if they match the default port number. */
+ urlPrefix?: string | undefined;
+ /** Optional. Matches if the host name of the URL is equal to a specified string. */
+ hostEquals?: string | undefined;
+ /** Optional. Matches if the URL (without fragment identifier) is equal to a specified string. Port numbers are stripped from the URL if they match the default port number. */
+ urlEquals?: string | undefined;
+ /** Optional. Matches if the query segment of the URL contains a specified string. */
+ queryContains?: string | undefined;
+ /** Optional. Matches if the path segment of the URL starts with a specified string. */
+ pathPrefix?: string | undefined;
+ /** Optional. Matches if the path segment of the URL is equal to a specified string. */
+ pathEquals?: string | undefined;
+ /** Optional. Matches if the path segment of the URL ends with a specified string. */
+ pathSuffix?: string | undefined;
+ /** Optional. Matches if the query segment of the URL is equal to a specified string. */
+ queryEquals?: string | undefined;
+ /** Optional. Matches if the query segment of the URL starts with a specified string. */
+ queryPrefix?: string | undefined;
+ /** Optional. Matches if the URL (without fragment identifier) ends with a specified string. Port numbers are stripped from the URL if they match the default port number. */
+ urlSuffix?: string | undefined;
+ /** Optional. Matches if the port of the URL is contained in any of the specified port lists. For example [80, 443, [1000, 1200]] matches all requests on port 80, 443 and in the range 1000-1200. */
+ ports?: (number | number[])[] | undefined;
+ /**
+ * Optional.
+ * Since Chrome 28.
+ * Matches if the URL without query segment and fragment identifier matches a specified regular expression. Port numbers are stripped from the URL if they match the default port number. The regular expressions use the RE2 syntax.
+ */
+ originAndPathMatches?: string | undefined;
+ }
+
+ export interface BaseEvent<T extends Function> {
+ addListener(callback: T, filter?: webRequest.RequestFilter): void;
+ /**
+ * Returns currently registered rules.
+ * @param callback Called with registered rules.
+ */
+ getRules(
+ callback: (
+ /** Rules that were registered, the optional parameters are filled with values */
+ rules: Rule[],
+ ) => void,
+ ): void;
+ /**
+ * Returns currently registered rules.
+ * @param ruleIdentifiers If an array is passed, only rules with identifiers contained in this array are returned.
+ * @param callback Called with registered rules.
+ */
+ getRules(
+ ruleIdentifiers: string[],
+ callback: (
+ /** Rules that were registered, the optional parameters are filled with values */
+ rules: Rule[],
+ ) => void,
+ ): void;
+ /**
+ * @param callback Listener whose registration status shall be tested.
+ */
+ hasListener(callback: T): boolean;
+ /**
+ * Unregisters currently registered rules.
+ * @param ruleIdentifiers If an array is passed, only rules with identifiers contained in this array are unregistered.
+ * @param callback Called when rules were unregistered.
+ */
+ removeRules(ruleIdentifiers?: string[], callback?: () => void): void;
+ /**
+ * Unregisters currently registered rules.
+ * @param callback Called when rules were unregistered.
+ */
+ removeRules(callback?: () => void): void;
+ /**
+ * Registers rules to handle events.
+ * @param rules Rules to be registered. These do not replace previously registered rules.
+ * @param callback Called with registered rules.
+ */
+ addRules(
+ rules: Rule[],
+ callback?: (
+ /** Rules that were registered, the optional parameters are filled with values */
+ rules: Rule[],
+ ) => void,
+ ): void;
+ /**
+ * Deregisters an event listener callback from an event.
+ * @param callback Listener that shall be unregistered.
+ */
+ removeListener(callback: T): void;
+ hasListeners(): boolean;
+ }
+
+ /** An object which allows the addition and removal of listeners for a Chrome event. */
+ interface Event<T extends Function> extends BaseEvent<T> {
+ /**
+ * Registers an event listener callback to an event.
+ * @param callback Called when an event occurs. The parameters of this function depend on the type of event.
+ */
+ addListener(callback: T): void;
+ }
+ export interface EventWithRequiredFilterInAddListener<T extends Function> extends BaseEvent<T> {
+ addListener(callback: T, filter: webRequest.RequestFilter): void;
+ }
+
+ /** Description of a declarative rule for handling events. */
+ export interface Rule {
+ /** Optional. Optional priority of this rule. Defaults to 100. */
+ priority?: number | undefined;
+ /** List of conditions that can trigger the actions. */
+ conditions: any[];
+ /** Optional. Optional identifier that allows referencing this rule. */
+ id?: string | undefined;
+ /** List of actions that are triggered if one of the condtions is fulfilled. */
+ actions: any[];
+ /**
+ * Optional.
+ * Since Chrome 28.
+ * Tags can be used to annotate rules and perform operations on sets of rules.
+ */
+ tags?: string[] | undefined;
+ }
+}
+
+////////////////////
+// Extension
+////////////////////
+/**
+ * The chrome.extension API has utilities that can be used by any extension page. It includes support for exchanging messages between an extension and its content scripts or between extensions, as described in detail in Message Passing.
+ * Availability: Since Chrome 5.
+ */
+declare namespace chrome.extension {
+ export interface FetchProperties {
+ /**
+ * Optional.
+ * Chrome 54+
+ * Find a view according to a tab id. If this field is omitted, returns all views.
+ */
+ tabId?: number | undefined;
+ /** Optional. The window to restrict the search to. If omitted, returns all views. */
+ windowId?: number | undefined;
+ /** Optional. The type of view to get. If omitted, returns all views (including background pages and tabs). Valid values: 'tab', 'notification', 'popup'. */
+ type?: string | undefined;
+ }
+
+ export interface LastError {
+ /** Description of the error that has taken place. */
+ message: string;
+ }
+
+ export interface OnRequestEvent extends
+ chrome.events.Event<
+ | ((request: any, sender: runtime.MessageSender, sendResponse: (response: any) => void) => void)
+ | ((sender: runtime.MessageSender, sendResponse: (response: any) => void) => void)
+ >
+ {}
+
+ /**
+ * Since Chrome 7.
+ * True for content scripts running inside incognito tabs, and for extension pages running inside an incognito process. The latter only applies to extensions with 'split' incognito_behavior.
+ */
+ export var inIncognitoContext: boolean;
+ /** Set for the lifetime of a callback if an ansychronous extension api has resulted in an error. If no error has occurred lastError will be undefined. */
+ export var lastError: LastError;
+
+ /** Returns the JavaScript 'window' object for the background page running inside the current extension. Returns null if the extension has no background page. */
+ export function getBackgroundPage(): Window | null;
+ /**
+ * Converts a relative path within an extension install directory to a fully-qualified URL.
+ * @param path A path to a resource within an extension expressed relative to its install directory.
+ */
+ export function getURL(path: string): string;
+ /**
+ * Sets the value of the ap CGI parameter used in the extension's update URL. This value is ignored for extensions that are hosted in the Chrome Extension Gallery.
+ * Since Chrome 9.
+ */
+ export function setUpdateUrlData(data: string): void;
+ /** Returns an array of the JavaScript 'window' objects for each of the pages running inside the current extension. */
+ export function getViews(fetchProperties?: FetchProperties): Window[];
+ /**
+ * Retrieves the state of the extension's access to the 'file://' scheme (as determined by the user-controlled 'Allow access to File URLs' checkbox.
+ * Since Chrome 12.
+ * @return The `isAllowedFileSchemeAccess` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function isAllowedFileSchemeAccess(): Promise<boolean>;
+ /**
+ * Retrieves the state of the extension's access to the 'file://' scheme (as determined by the user-controlled 'Allow access to File URLs' checkbox.
+ * Since Chrome 12.
+ * Parameter isAllowedAccess: True if the extension can access the 'file://' scheme, false otherwise.
+ */
+ export function isAllowedFileSchemeAccess(callback: (isAllowedAccess: boolean) => void): void;
+ /**
+ * Retrieves the state of the extension's access to Incognito-mode (as determined by the user-controlled 'Allowed in Incognito' checkbox.
+ * Since Chrome 12.
+ * @return The `isAllowedIncognitoAccess` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function isAllowedIncognitoAccess(): Promise<boolean>;
+ /**
+ * Retrieves the state of the extension's access to Incognito-mode (as determined by the user-controlled 'Allowed in Incognito' checkbox.
+ * Since Chrome 12.
+ * Parameter isAllowedAccess: True if the extension has access to Incognito mode, false otherwise.
+ */
+ export function isAllowedIncognitoAccess(callback: (isAllowedAccess: boolean) => void): void;
+ /**
+ * Sends a single request to other listeners within the extension. Similar to runtime.connect, but only sends a single request with an optional response. The extension.onRequest event is fired in each page of the extension.
+ * @deprecated Deprecated since Chrome 33. Please use runtime.sendMessage.
+ * @param extensionId The extension ID of the extension you want to connect to. If omitted, default is your own extension.
+ * @param responseCallback If you specify the responseCallback parameter, it should be a function that looks like this:
+ * function(any response) {...};
+ * Parameter response: The JSON response object sent by the handler of the request. If an error occurs while connecting to the extension, the callback will be called with no arguments and runtime.lastError will be set to the error message.
+ */
+ export function sendRequest<Request = any, Response = any>(
+ extensionId: string,
+ request: Request,
+ responseCallback?: (response: Response) => void,
+ ): void;
+ /**
+ * Sends a single request to other listeners within the extension. Similar to runtime.connect, but only sends a single request with an optional response. The extension.onRequest event is fired in each page of the extension.
+ * @deprecated Deprecated since Chrome 33. Please use runtime.sendMessage.
+ * @param responseCallback If you specify the responseCallback parameter, it should be a function that looks like this:
+ * function(any response) {...};
+ * Parameter response: The JSON response object sent by the handler of the request. If an error occurs while connecting to the extension, the callback will be called with no arguments and runtime.lastError will be set to the error message.
+ */
+ export function sendRequest<Request = any, Response = any>(
+ request: Request,
+ responseCallback?: (response: Response) => void,
+ ): void;
+ /**
+ * Returns an array of the JavaScript 'window' objects for each of the tabs running inside the current extension. If windowId is specified, returns only the 'window' objects of tabs attached to the specified window.
+ * @deprecated Deprecated since Chrome 33. Please use extension.getViews {type: "tab"}.
+ */
+ export function getExtensionTabs(windowId?: number): Window[];
+
+ /**
+ * Fired when a request is sent from either an extension process or a content script.
+ * @deprecated Deprecated since Chrome 33. Please use runtime.onMessage.
+ */
+ export var onRequest: OnRequestEvent;
+ /**
+ * Fired when a request is sent from another extension.
+ * @deprecated Deprecated since Chrome 33. Please use runtime.onMessageExternal.
+ */
+ export var onRequestExternal: OnRequestEvent;
+}
+
+////////////////////
+// File Browser Handler
+////////////////////
+/**
+ * Use the chrome.fileBrowserHandler API to extend the Chrome OS file browser. For example, you can use this API to enable users to upload files to your website.
+ * Availability: Since Chrome 12.
+ * Permissions: "fileBrowserHandler"
+ * Important: This API works only on Chrome OS.
+ */
+declare namespace chrome.fileBrowserHandler {
+ export interface SelectionParams {
+ /**
+ * Optional.
+ * List of file extensions that the selected file can have. The list is also used to specify what files to be shown in the select file dialog. Files with the listed extensions are only shown in the dialog. Extensions should not include the leading '.'. Example: ['jpg', 'png']
+ * Since Chrome 23.
+ */
+ allowedFileExtensions?: string[] | undefined;
+ /** Suggested name for the file. */
+ suggestedName: string;
+ }
+
+ export interface SelectionResult {
+ /** Optional. Selected file entry. It will be null if a file hasn't been selected. */
+ entry?: Object | null | undefined;
+ /** Whether the file has been selected. */
+ success: boolean;
+ }
+
+ /** Event details payload for fileBrowserHandler.onExecute event. */
+ export interface FileHandlerExecuteEventDetails {
+ /** Optional. The ID of the tab that raised this event. Tab IDs are unique within a browser session. */
+ tab_id?: number | undefined;
+ /** Array of Entry instances representing files that are targets of this action (selected in ChromeOS file browser). */
+ entries: any[];
+ }
+
+ export interface FileBrowserHandlerExecuteEvent
+ extends chrome.events.Event<(id: string, details: FileHandlerExecuteEventDetails) => void>
+ {}
+
+ /**
+ * Prompts user to select file path under which file should be saved. When the file is selected, file access permission required to use the file (read, write and create) are granted to the caller. The file will not actually get created during the function call, so function caller must ensure its existence before using it. The function has to be invoked with a user gesture.
+ * Since Chrome 21.
+ * @param selectionParams Parameters that will be used while selecting the file.
+ * @param callback Function called upon completion.
+ * Parameter result: Result of the method.
+ */
+ export function selectFile(selectionParams: SelectionParams, callback: (result: SelectionResult) => void): void;
+
+ /** Fired when file system action is executed from ChromeOS file browser. */
+ export var onExecute: FileBrowserHandlerExecuteEvent;
+}
+
+////////////////////
+// File System Provider
+////////////////////
+/**
+ * Use the chrome.fileSystemProvider API to create file systems, that can be accessible from the file manager on Chrome OS.
+ * Availability: Since Chrome 40.
+ * Permissions: "fileSystemProvider"
+ * Important: This API works only on Chrome OS.
+ */
+declare namespace chrome.fileSystemProvider {
+ export interface OpenedFileInfo {
+ /** A request ID to be be used by consecutive read/write and close requests. */
+ openRequestId: number;
+ /** The path of the opened file. */
+ filePath: string;
+ /** Whether the file was opened for reading or writing. */
+ mode: string;
+ }
+
+ export interface FileWatchersInfo {
+ /** The path of the entry being observed. */
+ entryPath: string;
+ /** Whether watching should include all child entries recursively. It can be true for directories only. */
+ recursive: boolean;
+ /** Optional. Tag used by the last notification for the watcher. */
+ lastTag?: string | undefined;
+ }
+
+ export interface CloudIdentifier {
+ /** Identifier for the cloud storage provider (e.g. 'drive.google.com'). */
+ providerName: string;
+ /** The provider's identifier for the given file/directory. */
+ id: string;
+ }
+
+ export interface EntryMetadata {
+ /** True if it is a directory. Must be provided if requested in `options`. */
+ isDirectory?: boolean;
+ /** Name of this entry (not full path name). Must not contain '/'. For root it must be empty. Must be provided if requested in `options`. */
+ name?: string;
+ /** File size in bytes. Must be provided if requested in `options`. */
+ size?: number;
+ /** The last modified time of this entry. Must be provided if requested in `options`. */
+ modificationTime?: Date;
+ /** Optional. Mime type for the entry. Always optional, but should provided if requested in `options`. */
+ mimeType?: string | undefined;
+ /** Optional. Thumbnail image as a data URI in either PNG, JPEG or WEBP format, at most 32 KB in size. Optional, but can be provided only when explicitly requested by the onGetMetadataRequested event. */
+ thumbnail?: string | undefined;
+ /** Optional. Cloud storage representation of this entry. Must be provided if requested in `options` and the file is backed by cloud storage. For local files not backed by cloud storage, it should be undefined when requested. */
+ cloudIdentifier?: CloudIdentifier | undefined;
+ }
+
+ export interface FileSystemInfo {
+ /** The identifier of the file system. */
+ fileSystemId: string;
+ /** A human-readable name for the file system. */
+ displayName: string;
+ /** Whether the file system supports operations which may change contents of the file system (such as creating, deleting or writing to files). */
+ writable: boolean;
+ /**
+ * The maximum number of files that can be opened at once. If 0, then not limited.
+ * @since Since Chrome 42.
+ */
+ openedFilesLimit: number;
+ /**
+ * List of currently opened files.
+ * @since Since Chrome 42.
+ */
+ openedFiles: OpenedFileInfo[];
+ /**
+ * Optional.
+ * Whether the file system supports the tag field for observing directories.
+ * @since Since Chrome 45. Warning: this is the current Beta channel.
+ */
+ supportsNotifyTag?: boolean | undefined;
+ /**
+ * List of watchers.
+ * @since Since Chrome 45. Warning: this is the current Beta channel.
+ */
+ watchers: FileWatchersInfo[];
+ }
+
+ /** @since Since Chrome 45. Warning: this is the current Beta channel. */
+ export interface GetActionsRequestedOptions {
+ /** The identifier of the file system related to this operation. */
+ fileSystemId: string;
+ /** The unique identifier of this request. */
+ requestId: number;
+ /** List of paths of entries for the list of actions. */
+ entryPaths: string[];
+ }
+
+ /** @since Since Chrome 45. Warning: this is the current Beta channel. */
+ export interface Action {
+ /** The identifier of the action. Any string or CommonActionId for common actions. */
+ id: string;
+ /** Optional. The title of the action. It may be ignored for common actions. */
+ title?: string | undefined;
+ }
+
+ /** @since Since Chrome 45. Warning: this is the current Beta channel. */
+ export interface ExecuteActionRequestedOptions {
+ /** The identifier of the file system related to this operation. */
+ fileSystemId: string;
+ /** The unique identifier of this request. */
+ requestId: number;
+ /** The set of paths of the entries to be used for the action. */
+ entryPaths: string[];
+ /** The identifier of the action to be executed. */
+ actionId: string;
+ }
+
+ export interface MountOptions {
+ /** The string identifier of the file system. Must be unique per each extension. */
+ fileSystemId: string;
+ /** A human-readable name for the file system. */
+ displayName: string;
+ /** Optional. Whether the file system supports operations which may change contents of the file system (such as creating, deleting or writing to files). */
+ writable?: boolean | undefined;
+ /**
+ * Optional.
+ * The maximum number of files that can be opened at once. If not specified, or 0, then not limited.
+ * @since Since Chrome 41.
+ */
+ openedFilesLimit?: number | undefined;
+ /**
+ * Optional.
+ * Whether the file system supports the tag field for observed directories.
+ * @since Since Chrome 45. Warning: this is the current Beta channel.
+ */
+ supportsNotifyTag?: boolean | undefined;
+ }
+
+ export interface UnmountOptions {
+ /** The identifier of the file system to be unmounted. */
+ fileSystemId: string;
+ }
+
+ export interface NotificationChange {
+ /** The path of the changed entry. */
+ entryPath: string;
+ /** The type of the change which happened to the entry. */
+ changeType: string;
+ }
+
+ export interface NotificationOptions {
+ /** The identifier of the file system related to this change. */
+ fileSystemId: string;
+ /** The path of the observed entry. */
+ observedPath: string;
+ /** Mode of the observed entry. */
+ recursive: boolean;
+ /** The type of the change which happened to the observed entry. If it is DELETED, then the observed entry will be automatically removed from the list of observed entries. */
+ changeType: string;
+ /** Optional. List of changes to entries within the observed directory (including the entry itself) */
+ changes?: NotificationChange[] | undefined;
+ /** Optional. Tag for the notification. Required if the file system was mounted with the supportsNotifyTag option. Note, that this flag is necessary to provide notifications about changes which changed even when the system was shutdown. */
+ tag?: string | undefined;
+ }
+
+ export interface RequestedEventOptions {
+ /** The identifier of the file system related to this operation. */
+ fileSystemId: string;
+ /** The unique identifier of this request. */
+ requestId: number;
+ }
+
+ export interface EntryPathRequestedEventOptions extends RequestedEventOptions {
+ /** The path of the entry to which this operation is related to. */
+ entryPath: string;
+ }
+
+ export interface MetadataRequestedEventOptions extends EntryPathRequestedEventOptions {
+ /** Set to true if `is_directory` value is requested. */
+ isDirectory: boolean;
+ /** Set to true if `name` value is requested. */
+ name: boolean;
+ /** Set to true if `size` value is requested. */
+ size: boolean;
+ /** Set to true if `modificationTime` value is requested. */
+ modificationTime: boolean;
+ /** Set to true if `mimeType` value is requested. */
+ mimeType: boolean;
+ /** Set to true if `thumbnail` is requested. */
+ thumbnail: boolean;
+ /** Set to true if `cloudIdentifier` is requested. */
+ cloudIdentifier: boolean;
+ }
+
+ export interface DirectoryPathRequestedEventOptions extends RequestedEventOptions {
+ /** The path of the directory which is to be operated on. */
+ directoryPath: string;
+ /** Set to true if `is_directory` value is requested. */
+ isDirectory: boolean;
+ /** Set to true if `name` value is requested. */
+ name: boolean;
+ /** Set to true if `size` value is requested. */
+ size: boolean;
+ /** Set to true if `modificationTime` value is requested. */
+ modificationTime: boolean;
+ /** Set to true if `mimeType` value is requested. */
+ mimeType: boolean;
+ /** Set to true if `thumbnail` is requested. */
+ thumbnail: boolean;
+ }
+
+ export interface FilePathRequestedEventOptions extends RequestedEventOptions {
+ /** The path of the entry for the operation */
+ filePath: string;
+ }
+
+ export interface OpenFileRequestedEventOptions extends FilePathRequestedEventOptions {
+ /** Whether the file will be used for reading or writing. */
+ mode: string;
+ }
+
+ export interface OpenedFileRequestedEventOptions extends RequestedEventOptions {
+ /** A request ID used to open the file. */
+ openRequestId: number;
+ }
+
+ export interface OpenedFileOffsetRequestedEventOptions extends OpenedFileRequestedEventOptions {
+ /** Position in the file (in bytes) to start reading from. */
+ offset: number;
+ /** Number of bytes to be returned. */
+ length: number;
+ }
+
+ export interface DirectoryPathRecursiveRequestedEventOptions extends DirectoryPathRequestedEventOptions {
+ /** Whether the operation is recursive (for directories only). */
+ recursive: boolean;
+ }
+
+ export interface EntryPathRecursiveRequestedEventOptions extends EntryPathRequestedEventOptions {
+ /** Whether the operation is recursive (for directories only). */
+ recursive: boolean;
+ }
+
+ export interface SourceTargetPathRequestedEventOptions extends RequestedEventOptions {
+ /** The source path for the operation. */
+ sourcePath: string;
+ /** The destination path for the operation. */
+ targetPath: string;
+ }
+
+ export interface FilePathLengthRequestedEventOptions extends FilePathRequestedEventOptions {
+ /** Number of bytes to be retained after the operation completes. */
+ length: number;
+ }
+
+ export interface OpenedFileIoRequestedEventOptions extends OpenedFileRequestedEventOptions {
+ /** Position in the file (in bytes) to start operating from. */
+ offset: number;
+ /** Buffer of bytes to be operated on the file. */
+ data: ArrayBuffer;
+ }
+
+ export interface OperationRequestedEventOptions extends RequestedEventOptions {
+ /** An ID of the request to which this operation is related. */
+ operationRequestId: number;
+ }
+
+ export interface RequestedEvent extends
+ chrome.events.Event<
+ (options: RequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void
+ >
+ {}
+
+ export interface MetadataRequestedEvent extends
+ chrome.events.Event<
+ (
+ options: MetadataRequestedEventOptions,
+ successCallback: (metadata: EntryMetadata) => void,
+ errorCallback: (error: string) => void,
+ ) => void
+ >
+ {}
+
+ export interface DirectoryPathRequestedEvent extends
+ chrome.events.Event<
+ (
+ options: DirectoryPathRequestedEventOptions,
+ successCallback: (entries: EntryMetadata[], hasMore: boolean) => void,
+ errorCallback: (error: string) => void,
+ ) => void
+ >
+ {}
+
+ export interface OpenFileRequestedEvent extends
+ chrome.events.Event<
+ (
+ options: OpenFileRequestedEventOptions,
+ successCallback: Function,
+ errorCallback: (error: string) => void,
+ ) => void
+ >
+ {}
+
+ export interface OpenedFileRequestedEvent extends
+ chrome.events.Event<
+ (
+ options: OpenedFileRequestedEventOptions,
+ successCallback: Function,
+ errorCallback: (error: string) => void,
+ ) => void
+ >
+ {}
+
+ export interface OpenedFileOffsetRequestedEvent extends
+ chrome.events.Event<
+ (
+ options: OpenedFileOffsetRequestedEventOptions,
+ successCallback: (data: ArrayBuffer, hasMore: boolean) => void,
+ errorCallback: (error: string) => void,
+ ) => void
+ >
+ {}
+
+ export interface DirectoryPathRecursiveRequestedEvent extends
+ chrome.events.Event<
+ (
+ options: DirectoryPathRecursiveRequestedEventOptions,
+ successCallback: Function,
+ errorCallback: (error: string) => void,
+ ) => void
+ >
+ {}
+
+ export interface EntryPathRecursiveRequestedEvent extends
+ chrome.events.Event<
+ (
+ options: EntryPathRecursiveRequestedEventOptions,
+ successCallback: Function,
+ errorCallback: (error: string) => void,
+ ) => void
+ >
+ {}
+
+ export interface FilePathRequestedEvent extends
+ chrome.events.Event<
+ (
+ options: FilePathRequestedEventOptions,
+ successCallback: Function,
+ errorCallback: (error: string) => void,
+ ) => void
+ >
+ {}
+
+ export interface SourceTargetPathRequestedEvent extends
+ chrome.events.Event<
+ (
+ options: SourceTargetPathRequestedEventOptions,
+ successCallback: Function,
+ errorCallback: (error: string) => void,
+ ) => void
+ >
+ {}
+
+ export interface FilePathLengthRequestedEvent extends
+ chrome.events.Event<
+ (
+ options: FilePathLengthRequestedEventOptions,
+ successCallback: Function,
+ errorCallback: (error: string) => void,
+ ) => void
+ >
+ {}
+
+ export interface OpenedFileIoRequestedEvent extends
+ chrome.events.Event<
+ (
+ options: OpenedFileIoRequestedEventOptions,
+ successCallback: Function,
+ errorCallback: (error: string) => void,
+ ) => void
+ >
+ {}
+
+ export interface OperationRequestedEvent extends
+ chrome.events.Event<
+ (
+ options: OperationRequestedEventOptions,
+ successCallback: Function,
+ errorCallback: (error: string) => void,
+ ) => void
+ >
+ {}
+
+ export interface OptionlessRequestedEvent
+ extends chrome.events.Event<(successCallback: Function, errorCallback: (error: string) => void) => void>
+ {}
+
+ export interface GetActionsRequested extends
+ chrome.events.Event<
+ (
+ options: GetActionsRequestedOptions,
+ successCallback: (actions: Action[]) => void,
+ errorCallback: (error: string) => void,
+ ) => void
+ >
+ {}
+
+ export interface ExecuteActionRequested extends
+ chrome.events.Event<
+ (
+ options: ExecuteActionRequestedOptions,
+ successCallback: () => void,
+ errorCallback: (error: string) => void,
+ ) => void
+ >
+ {}
+
+ /**
+ * Mounts a file system with the given fileSystemId and displayName. displayName will be shown in the left panel of Files.app. displayName can contain any characters including '/', but cannot be an empty string. displayName must be descriptive but doesn't have to be unique. The fileSystemId must not be an empty string.
+ * Depending on the type of the file system being mounted, the source option must be set appropriately.
+ * In case of an error, runtime.lastError will be set with a corresponding error code.
+ * @param callback A generic result callback to indicate success or failure.
+ */
+ export function mount(options: MountOptions, callback?: () => void): void;
+ /**
+ * Unmounts a file system with the given fileSystemId. It must be called after onUnmountRequested is invoked. Also, the providing extension can decide to perform unmounting if not requested (eg. in case of lost connection, or a file error).
+ * In case of an error, runtime.lastError will be set with a corresponding error code.
+ * @param callback A generic result callback to indicate success or failure.
+ */
+ export function unmount(options: UnmountOptions, callback?: () => void): void;
+ /**
+ * Returns all file systems mounted by the extension.
+ * @param callback Callback to receive the result of getAll function.
+ */
+ export function getAll(callback: (fileSystems: FileSystemInfo[]) => void): void;
+ /**
+ * Returns information about a file system with the passed fileSystemId.
+ * @since Since Chrome 42.
+ * @param callback Callback to receive the result of get function.
+ */
+ export function get(fileSystemId: string, callback: (fileSystem: FileSystemInfo) => void): void;
+ /**
+ * Notifies about changes in the watched directory at observedPath in recursive mode. If the file system is mounted with supportsNofityTag, then tag must be provided, and all changes since the last notification always reported, even if the system was shutdown. The last tag can be obtained with getAll.
+ * To use, the file_system_provider.notify manifest option must be set to true.
+ * Value of tag can be any string which is unique per call, so it's possible to identify the last registered notification. Eg. if the providing extension starts after a reboot, and the last registered notification's tag is equal to "123", then it should call notify for all changes which happened since the change tagged as "123". It cannot be an empty string.
+ * Not all providers are able to provide a tag, but if the file system has a changelog, then the tag can be eg. a change number, or a revision number.
+ * Note that if a parent directory is removed, then all descendant entries are also removed, and if they are watched, then the API must be notified about the fact. Also, if a directory is renamed, then all descendant entries are in fact removed, as there is no entry under their original paths anymore.
+ * In case of an error, runtime.lastError will be set will a corresponding error code.
+ * @param callback A generic result callback to indicate success or failure.
+ */
+ export function notify(options: NotificationOptions, callback: () => void): void;
+
+ /** Raised when unmounting for the file system with the fileSystemId identifier is requested. In the response, the unmount API method must be called together with successCallback. If unmounting is not possible (eg. due to a pending operation), then errorCallback must be called. */
+ export var onUnmountRequested: RequestedEvent;
+ /** Raised when metadata of a file or a directory at entryPath is requested. The metadata must be returned with the successCallback call. In case of an error, errorCallback must be called. */
+ export var onGetMetadataRequested: MetadataRequestedEvent;
+ /** Raised when contents of a directory at directoryPath are requested. The results must be returned in chunks by calling the successCallback several times. In case of an error, errorCallback must be called. */
+ export var onReadDirectoryRequested: DirectoryPathRequestedEvent;
+ /** Raised when opening a file at filePath is requested. If the file does not exist, then the operation must fail. Maximum number of files opened at once can be specified with MountOptions. */
+ export var onOpenFileRequested: OpenFileRequestedEvent;
+ /** Raised when opening a file previously opened with openRequestId is requested to be closed. */
+ export var onCloseFileRequested: OpenedFileRequestedEvent;
+ /** Raised when reading contents of a file opened previously with openRequestId is requested. The results must be returned in chunks by calling successCallback several times. In case of an error, errorCallback must be called. */
+ export var onReadFileRequested: OpenedFileOffsetRequestedEvent;
+ /** Raised when creating a directory is requested. The operation must fail with the EXISTS error if the target directory already exists. If recursive is true, then all of the missing directories on the directory path must be created. */
+ export var onCreateDirectoryRequested: DirectoryPathRecursiveRequestedEvent;
+ /** Raised when deleting an entry is requested. If recursive is true, and the entry is a directory, then all of the entries inside must be recursively deleted as well. */
+ export var onDeleteEntryRequested: EntryPathRecursiveRequestedEvent;
+ /** Raised when creating a file is requested. If the file already exists, then errorCallback must be called with the "EXISTS" error code. */
+ export var onCreateFileRequested: FilePathRequestedEvent;
+ /** Raised when copying an entry (recursively if a directory) is requested. If an error occurs, then errorCallback must be called. */
+ export var onCopyEntryRequested: SourceTargetPathRequestedEvent;
+ /** Raised when moving an entry (recursively if a directory) is requested. If an error occurs, then errorCallback must be called. */
+ export var onMoveEntryRequested: SourceTargetPathRequestedEvent;
+ /** Raised when truncating a file to a desired length is requested. If an error occurs, then errorCallback must be called. */
+ export var onTruncateRequested: FilePathLengthRequestedEvent;
+ /** Raised when writing contents to a file opened previously with openRequestId is requested. */
+ export var onWriteFileRequested: OpenedFileIoRequestedEvent;
+ /** Raised when aborting an operation with operationRequestId is requested. The operation executed with operationRequestId must be immediately stopped and successCallback of this abort request executed. If aborting fails, then errorCallback must be called. Note, that callbacks of the aborted operation must not be called, as they will be ignored. Despite calling errorCallback, the request may be forcibly aborted. */
+ export var onAbortRequested: OperationRequestedEvent;
+ /**
+ * Raised when showing a configuration dialog for fileSystemId is requested. If it's handled, the file_system_provider.configurable manfiest option must be set to true.
+ * @since Since Chrome 44.
+ */
+ export var onConfigureRequested: RequestedEvent;
+ /**
+ * Raised when showing a dialog for mounting a new file system is requested. If the extension/app is a file handler, then this event shouldn't be handled. Instead app.runtime.onLaunched should be handled in order to mount new file systems when a file is opened. For multiple mounts, the file_system_provider.multiple_mounts manifest option must be set to true.
+ * @since Since Chrome 44.
+ */
+ export var onMountRequested: OptionlessRequestedEvent;
+ /**
+ * Raised when setting a new directory watcher is requested. If an error occurs, then errorCallback must be called.
+ * @since Since Chrome 45. Warning: this is the current Beta channel.
+ */
+ export var onAddWatcherRequested: EntryPathRecursiveRequestedEvent;
+ /**
+ * Raised when the watcher should be removed. If an error occurs, then errorCallback must be called.
+ * @since Since Chrome 45. Warning: this is the current Beta channel.
+ */
+ export var onRemoveWatcherRequested: EntryPathRecursiveRequestedEvent;
+
+ /**
+ * Raised when a list of actions for a set of files or directories at
+ * `entryPaths` is requested. All of the returned actions must
+ * be applicable to each entry. If there are no such actions, an empty array
+ * should be returned. The actions must be returned with the
+ * `successCallback` call. In case of an error,
+ * `errorCallback` must be called.
+ */
+ export var onGetActionsRequested: GetActionsRequested;
+
+ /**
+ * Raised when executing an action for a set of files or directories is
+ * requested. After the action is completed, `successCallback`
+ * must be called. On error, `errorCallback` must be called.
+ */
+ export var onExecuteActionRequested: ExecuteActionRequested;
+}
+
+////////////////////
+// Font Settings
+////////////////////
+/**
+ * Use the chrome.fontSettings API to manage Chrome's font settings.
+ * Availability: Since Chrome 22.
+ * Permissions: "fontSettings"
+ */
+declare namespace chrome.fontSettings {
+ /** Represents a font name. */
+ export interface FontName {
+ /** The display name of the font. */
+ displayName: string;
+ /** The font ID. */
+ fontId: string;
+ }
+
+ export interface DefaultFontSizeDetails {
+ /** The font size in pixels. */
+ pixelSize: number;
+ }
+
+ export interface FontDetails {
+ /** The generic font family for the font. */
+ genericFamily:
+ | "cursive"
+ | "fantasy"
+ | "fixed"
+ | "sansserif"
+ | "serif"
+ | "standard";
+ /** Optional. The script for the font. If omitted, the global script font setting is affected. */
+ script?: string | undefined;
+ }
+
+ export interface FullFontDetails {
+ /** The generic font family for which the font setting has changed. */
+ genericFamily: string;
+ /** The level of control this extension has over the setting. */
+ levelOfControl: string;
+ /** Optional. The script code for which the font setting has changed. */
+ script?: string | undefined;
+ /** The font ID. See the description in getFont. */
+ fontId: string;
+ }
+
+ export interface FontDetailsResult {
+ /** The level of control this extension has over the setting. */
+ levelOfControl: string;
+ /** The font ID. Rather than the literal font ID preference value, this may be the ID of the font that the system resolves the preference value to. So, fontId can differ from the font passed to setFont, if, for example, the font is not available on the system. The empty string signifies fallback to the global script font setting. */
+ fontId: string;
+ }
+
+ export interface FontSizeDetails {
+ /** The font size in pixels. */
+ pixelSize: number;
+ /** The level of control this extension has over the setting. */
+ levelOfControl: string;
+ }
+
+ export interface SetFontSizeDetails {
+ /** The font size in pixels. */
+ pixelSize: number;
+ }
+
+ export interface SetFontDetails extends FontDetails {
+ /** The font ID. The empty string means to fallback to the global script font setting. */
+ fontId: string;
+ }
+
+ export interface DefaultFixedFontSizeChangedEvent extends chrome.events.Event<(details: FontSizeDetails) => void> {}
+
+ export interface DefaultFontSizeChangedEvent extends chrome.events.Event<(details: FontSizeDetails) => void> {}
+
+ export interface MinimumFontSizeChangedEvent extends chrome.events.Event<(details: FontSizeDetails) => void> {}
+
+ export interface FontChangedEvent extends chrome.events.Event<(details: FullFontDetails) => void> {}
+
+ /**
+ * Sets the default font size.
+ * @return The `setDefaultFontSize` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function setDefaultFontSize(details: DefaultFontSizeDetails): Promise<void>;
+ /**
+ * Sets the default font size.
+ */
+ export function setDefaultFontSize(details: DefaultFontSizeDetails, callback: Function): void;
+ /**
+ * Gets the font for a given script and generic font family.
+ * @return The `getFont` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function getFont(details: FontDetails): Promise<FontDetailsResult>;
+ /**
+ * Gets the font for a given script and generic font family.
+ */
+ export function getFont(details: FontDetails, callback: (details: FontDetailsResult) => void): void;
+ /**
+ * Gets the default font size.
+ * @param details This parameter is currently unused.
+ * @return The `getDefaultFontSize` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function getDefaultFontSize(details?: Object): Promise<FontSizeDetails>;
+ /**
+ * Gets the default font size.
+ * @param details This parameter is currently unused.
+ */
+ export function getDefaultFontSize(callback: (options: FontSizeDetails) => void): void;
+ export function getDefaultFontSize(details: Object, callback: (options: FontSizeDetails) => void): void;
+ /**
+ * Gets the minimum font size.
+ * @param details This parameter is currently unused.
+ * @return The `getMinimumFontSize` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function getMinimumFontSize(details?: object): Promise<FontSizeDetails>;
+ /**
+ * Gets the minimum font size.
+ * @param details This parameter is currently unused.
+ */
+ export function getMinimumFontSize(callback: (options: FontSizeDetails) => void): void;
+ export function getMinimumFontSize(details: object, callback: (options: FontSizeDetails) => void): void;
+ /**
+ * Sets the minimum font size.
+ * @return The `setMinimumFontSize` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function setMinimumFontSize(details: SetFontSizeDetails): Promise<void>;
+ /**
+ * Sets the minimum font size.
+ */
+ export function setMinimumFontSize(details: SetFontSizeDetails, callback: Function): void;
+ /**
+ * Gets the default size for fixed width fonts.
+ * @param details This parameter is currently unused.
+ * @return The `getDefaultFixedFontSize` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function getDefaultFixedFontSize(details?: Object): Promise<FontSizeDetails>;
+ /**
+ * Gets the default size for fixed width fonts.
+ * @param details This parameter is currently unused.
+ */
+ export function getDefaultFixedFontSize(callback: (details: FontSizeDetails) => void): void;
+ export function getDefaultFixedFontSize(details: Object, callback: (details: FontSizeDetails) => void): void;
+ /**
+ * Clears the default font size set by this extension, if any.
+ * @param details This parameter is currently unused.
+ * @return The `clearDefaultFontSize` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function clearDefaultFontSize(details?: Object): Promise<void>;
+ /**
+ * Clears the default font size set by this extension, if any.
+ * @param details This parameter is currently unused.
+ */
+ export function clearDefaultFontSize(callback: Function): void;
+ export function clearDefaultFontSize(details: Object, callback: Function): void;
+ /**
+ * Sets the default size for fixed width fonts.
+ * @return The `setDefaultFixedFontSize` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function setDefaultFixedFontSize(details: SetFontSizeDetails): Promise<void>;
+ /**
+ * Sets the default size for fixed width fonts.
+ */
+ export function setDefaultFixedFontSize(details: SetFontSizeDetails, callback: Function): void;
+ /**
+ * Clears the font set by this extension, if any.
+ * @return The `clearFont` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function clearFont(details: FontDetails): Promise<void>;
+ /**
+ * Clears the font set by this extension, if any.
+ */
+ export function clearFont(details: FontDetails, callback: Function): void;
+ /**
+ * Sets the font for a given script and generic font family.
+ * @return The `setFont` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function setFont(details: SetFontDetails): Promise<void>;
+ /**
+ * Sets the font for a given script and generic font family.
+ */
+ export function setFont(details: SetFontDetails, callback: Function): void;
+ /**
+ * Clears the minimum font size set by this extension, if any.
+ * @param details This parameter is currently unused.
+ * @return The `clearMinimumFontSize` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function clearMinimumFontSize(details?: Object): Promise<void>;
+ /**
+ * Clears the minimum font size set by this extension, if any.
+ * @param details This parameter is currently unused.
+ */
+ export function clearMinimumFontSize(callback: Function): void;
+ export function clearMinimumFontSize(details: Object, callback: Function): void;
+ /**
+ * Gets a list of fonts on the system.
+ * @return The `getFontList` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function getFontList(): Promise<FontName[]>;
+ /**
+ * Gets a list of fonts on the system.
+ */
+ export function getFontList(callback: (results: FontName[]) => void): void;
+ /**
+ * Clears the default fixed font size set by this extension, if any.
+ * @param details This parameter is currently unused.
+ * @return The `clearDefaultFixedFontSize` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function clearDefaultFixedFontSize(details: Object): Promise<void>;
+ /**
+ * Clears the default fixed font size set by this extension, if any.
+ * @param details This parameter is currently unused.
+ */
+ export function clearDefaultFixedFontSize(details: Object, callback: Function): void;
+
+ /** Fired when the default fixed font size setting changes. */
+ export var onDefaultFixedFontSizeChanged: DefaultFixedFontSizeChangedEvent;
+ /** Fired when the default font size setting changes. */
+ export var onDefaultFontSizeChanged: DefaultFontSizeChangedEvent;
+ /** Fired when the minimum font size setting changes. */
+ export var onMinimumFontSizeChanged: MinimumFontSizeChangedEvent;
+ /** Fired when a font setting changes. */
+ export var onFontChanged: FontChangedEvent;
+}
+
+////////////////////
+// Google Cloud Messaging
+////////////////////
+/**
+ * Use chrome.gcm to enable apps and extensions to send and receive messages through the Google Cloud Messaging Service.
+ * Availability: Since Chrome 35.
+ * Permissions: "gcm"
+ */
+declare namespace chrome.gcm {
+ export interface OutgoingMessage {
+ /** The ID of the server to send the message to as assigned by Google API Console. */
+ destinationId: string;
+ /** The ID of the message. It must be unique for each message in scope of the applications. See the Cloud Messaging documentation for advice for picking and handling an ID. */
+ messageId: string;
+ /** Optional. Time-to-live of the message in seconds. If it is not possible to send the message within that time, an onSendError event will be raised. A time-to-live of 0 indicates that the message should be sent immediately or fail if it's not possible. The maximum and a default value of time-to-live is 86400 seconds (1 day). */
+ timeToLive?: number | undefined;
+ /** Message data to send to the server. Case-insensitive goog. and google, as well as case-sensitive collapse_key are disallowed as key prefixes. Sum of all key/value pairs should not exceed gcm.MAX_MESSAGE_SIZE. */
+ data: Object;
+ }
+
+ export interface IncomingMessage {
+ /** The message data. */
+ data: Object;
+ /**
+ * Optional.
+ * The sender who issued the message.
+ * @since Since Chrome 41.
+ */
+ from?: string | undefined;
+ /**
+ * Optional.
+ * The collapse key of a message. See Collapsible Messages section of Cloud Messaging documentation for details.
+ */
+ collapseKey?: string | undefined;
+ }
+
+ export interface GcmError {
+ /** The error message describing the problem. */
+ errorMessage: string;
+ /** Optional. The ID of the message with this error, if error is related to a specific message. */
+ messageId?: string | undefined;
+ /** Additional details related to the error, when available. */
+ detail: Object;
+ }
+
+ export interface MessageReceptionEvent extends chrome.events.Event<(message: IncomingMessage) => void> {}
+
+ export interface MessageDeletionEvent extends chrome.events.Event<() => void> {}
+
+ export interface GcmErrorEvent extends chrome.events.Event<(error: GcmError) => void> {}
+
+ /** The maximum size (in bytes) of all key/value pairs in a message. */
+ export var MAX_MESSAGE_SIZE: number;
+
+ /**
+ * Registers the application with GCM. The registration ID will be returned by the callback. If register is called again with the same list of senderIds, the same registration ID will be returned.
+ * @param senderIds A list of server IDs that are allowed to send messages to the application. It should contain at least one and no more than 100 sender IDs.
+ * @param callback Function called when registration completes. It should check runtime.lastError for error when registrationId is empty.
+ * Parameter registrationId: A registration ID assigned to the application by the GCM.
+ */
+ export function register(senderIds: string[], callback: (registrationId: string) => void): void;
+ /**
+ * Unregisters the application from GCM.
+ * @param callback A function called after the unregistration completes. Unregistration was successful if runtime.lastError is not set.
+ */
+ export function unregister(callback: () => void): void;
+ /**
+ * Sends a message according to its contents.
+ * @param message A message to send to the other party via GCM.
+ * @param callback A function called after the message is successfully queued for sending. runtime.lastError should be checked, to ensure a message was sent without problems.
+ * Parameter messageId: The ID of the message that the callback was issued for.
+ */
+ export function send(message: OutgoingMessage, callback: (messageId: string) => void): void;
+
+ /** Fired when a message is received through GCM. */
+ export var onMessage: MessageReceptionEvent;
+ /** Fired when a GCM server had to delete messages sent by an app server to the application. See Messages deleted event section of Cloud Messaging documentation for details on handling this event. */
+ export var onMessagesDeleted: MessageDeletionEvent;
+ /** Fired when it was not possible to send a message to the GCM server. */
+ export var onSendError: GcmErrorEvent;
+}
+
+////////////////////
+// History
+////////////////////
+/**
+ * Use the chrome.history API to interact with the browser's record of visited pages. You can add, remove, and query for URLs in the browser's history. To override the history page with your own version, see Override Pages.
+ * Availability: Since Chrome 5.
+ * Permissions: "history"
+ */
+declare namespace chrome.history {
+ /** An object encapsulating one visit to a URL. */
+ export interface VisitItem {
+ /** The transition type for this visit from its referrer. */
+ transition: string;
+ /** Optional. When this visit occurred, represented in milliseconds since the epoch. */
+ visitTime?: number | undefined;
+ /** The unique identifier for this visit. */
+ visitId: string;
+ /** The visit ID of the referrer. */
+ referringVisitId: string;
+ /** The unique identifier for the item. */
+ id: string;
+ }
+
+ /** An object encapsulating one result of a history query. */
+ export interface HistoryItem {
+ /** Optional. The number of times the user has navigated to this page by typing in the address. */
+ typedCount?: number | undefined;
+ /** Optional. The title of the page when it was last loaded. */
+ title?: string | undefined;
+ /** Optional. The URL navigated to by a user. */
+ url?: string | undefined;
+ /** Optional. When this page was last loaded, represented in milliseconds since the epoch. */
+ lastVisitTime?: number | undefined;
+ /** Optional. The number of times the user has navigated to this page. */
+ visitCount?: number | undefined;
+ /** The unique identifier for the item. */
+ id: string;
+ }
+
+ export interface HistoryQuery {
+ /** A free-text query to the history service. Leave empty to retrieve all pages. */
+ text: string;
+ /** Optional. The maximum number of results to retrieve. Defaults to 100. */
+ maxResults?: number | undefined;
+ /** Optional. Limit results to those visited after this date, represented in milliseconds since the epoch. */
+ startTime?: number | undefined;
+ /** Optional. Limit results to those visited before this date, represented in milliseconds since the epoch. */
+ endTime?: number | undefined;
+ }
+
+ export interface Url {
+ /** The URL for the operation. It must be in the format as returned from a call to history.search. */
+ url: string;
+ }
+
+ export interface Range {
+ /** Items added to history before this date, represented in milliseconds since the epoch. */
+ endTime: number;
+ /** Items added to history after this date, represented in milliseconds since the epoch. */
+ startTime: number;
+ }
+
+ export interface RemovedResult {
+ /** True if all history was removed. If true, then urls will be empty. */
+ allHistory: boolean;
+ /** Optional. */
+ urls?: string[] | undefined;
+ }
+
+ export interface HistoryVisitedEvent extends chrome.events.Event<(result: HistoryItem) => void> {}
+
+ export interface HistoryVisitRemovedEvent extends chrome.events.Event<(removed: RemovedResult) => void> {}
+
+ /**
+ * Searches the history for the last visit time of each page matching the query.
+ * @return The `search` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function search(query: HistoryQuery): Promise<HistoryItem[]>;
+ /**
+ * Searches the history for the last visit time of each page matching the query.
+ */
+ export function search(query: HistoryQuery, callback: (results: HistoryItem[]) => void): void;
+ /**
+ * Adds a URL to the history at the current time with a transition type of "link".
+ * @return The `addUrl` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function addUrl(details: Url): Promise<void>;
+ /**
+ * Adds a URL to the history at the current time with a transition type of "link".
+ */
+ export function addUrl(details: Url, callback: () => void): void;
+ /**
+ * Removes all items within the specified date range from the history. Pages will not be removed from the history unless all visits fall within the range.
+ * @return The `deleteRange` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function deleteRange(range: Range): Promise<void>;
+ /**
+ * Removes all items within the specified date range from the history. Pages will not be removed from the history unless all visits fall within the range.
+ */
+ export function deleteRange(range: Range, callback: () => void): void;
+ /**
+ * Deletes all items from the history.
+ * @return The `deleteAll` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function deleteAll(): Promise<void>;
+ /**
+ * Deletes all items from the history.
+ */
+ export function deleteAll(callback: () => void): void;
+ /**
+ * Retrieves information about visits to a URL.
+ * @return The `getVisits` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function getVisits(details: Url): Promise<VisitItem[]>;
+ /**
+ * Retrieves information about visits to a URL.
+ */
+ export function getVisits(details: Url, callback: (results: VisitItem[]) => void): void;
+ /**
+ * Removes all occurrences of the given URL from the history.
+ * @return The `deleteUrl` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function deleteUrl(details: Url): Promise<void>;
+ /**
+ * Removes all occurrences of the given URL from the history.
+ */
+ export function deleteUrl(details: Url, callback: () => void): void;
+
+ /** Fired when a URL is visited, providing the HistoryItem data for that URL. This event fires before the page has loaded. */
+ export var onVisited: HistoryVisitedEvent;
+ /** Fired when one or more URLs are removed from the history service. When all visits have been removed the URL is purged from history. */
+ export var onVisitRemoved: HistoryVisitRemovedEvent;
+}
+
+////////////////////
+// i18n
+////////////////////
+/**
+ * Use the chrome.i18n infrastructure to implement internationalization across your whole app or extension.
+ * @since Chrome 5.
+ */
+declare namespace chrome.i18n {
+ /** Holds detected ISO language code and its percentage in the input string */
+ export interface DetectedLanguage {
+ /** An ISO language code such as 'en' or 'fr'.
+ * For a complete list of languages supported by this method, see [kLanguageInfoTable]{@link https://src.chromium.org/viewvc/chrome/trunk/src/third_party/cld/languages/internal/languages.cc}.
+ * For an unknown language, 'und' will be returned, which means that [percentage] of the text is unknown to CLD */
+ language: string;
+
+ /** The percentage of the detected language */
+ percentage: number;
+ }
+
+ /** Holds detected language reliability and array of DetectedLanguage */
+ export interface LanguageDetectionResult {
+ /** CLD detected language reliability */
+ isReliable: boolean;
+
+ /** Array of detectedLanguage */
+ languages: DetectedLanguage[];
+ }
+
+ /**
+ * Gets the accept-languages of the browser. This is different from the locale used by the browser; to get the locale, use i18n.getUILanguage.
+ * @return The `getAcceptLanguages` method provides its result via callback or returned as a `Promise` (MV3 only).
+ * @since MV3
+ */
+ export function getAcceptLanguages(): Promise<string[]>;
+ /**
+ * Gets the accept-languages of the browser. This is different from the locale used by the browser; to get the locale, use i18n.getUILanguage.
+ * Parameter languages: Array of the accept languages of the browser, such as en-US,en,zh-CN
+ */
+ export function getAcceptLanguages(callback: (languages: string[]) => void): void;
+ /**
+ * Gets the localized string for the specified message. If the message is missing, this method returns an empty string (''). If the format of the getMessage() call is wrong — for example, messageName is not a string or the substitutions array has more than 9 elements — this method returns undefined.
+ * @param messageName The name of the message, as specified in the messages.json file.
+ * @param substitutions Optional. Up to 9 substitution strings, if the message requires any.
+ */
+ export function getMessage(messageName: string, substitutions?: string | string[]): string;
+ /**
+ * Gets the browser UI language of the browser. This is different from i18n.getAcceptLanguages which returns the preferred user languages.
+ * @since Chrome 35.
+ */
+ export function getUILanguage(): string;
+
+ /** Detects the language of the provided text using CLD.
+ * @param text User input string to be translated.
+ * @return The `detectLanguage` method provides its result via callback or returned as a `Promise` (MV3 only).
+ * @since MV3
+ */
+ export function detectLanguage(text: string): Promise<LanguageDetectionResult>;
+ /** Detects the language of the provided text using CLD.
+ * @param text User input string to be translated.
+ */
+ export function detectLanguage(text: string, callback: (result: LanguageDetectionResult) => void): void;
+}
+
+////////////////////
+// Identity
+////////////////////
+/**
+ * Use the chrome.identity API to get OAuth2 access tokens.
+ * Permissions: "identity"
+ * @since Chrome 29.
+ */
+declare namespace chrome.identity {
+ /** @since Chrome 32. */
+ export interface AccountInfo {
+ /** A unique identifier for the account. This ID will not change for the lifetime of the account. */
+ id: string;
+ }
+
+ /** @since Chrome 84. */
+ export enum AccountStatus {
+ SYNC = "SYNC",
+ ANY = "ANY",
+ }
+
+ export interface ProfileDetails {
+ /**
+ * Optional.
+ * A status of the primary account signed into a profile whose ProfileUserInfo should be returned. Defaults to SYNC account status.
+ */
+ accountStatus?: AccountStatus | undefined;
+ }
+
+ export interface TokenDetails {
+ /**
+ * Optional.
+ * Fetching a token may require the user to sign-in to Chrome, or approve the application's requested scopes. If the interactive flag is true, getAuthToken will prompt the user as necessary. When the flag is false or omitted, getAuthToken will return failure any time a prompt would be required.
+ */
+ interactive?: boolean | undefined;
+ /**
+ * Optional.
+ * The account ID whose token should be returned. If not specified, the primary account for the profile will be used.
+ * account is only supported when the "enable-new-profile-management" flag is set.
+ * @since Chrome 37.
+ */
+ account?: AccountInfo | undefined;
+ /**
+ * Optional.
+ * A list of OAuth2 scopes to request.
+ * When the scopes field is present, it overrides the list of scopes specified in manifest.json.
+ * @since Chrome 37.
+ */
+ scopes?: string[] | undefined;
+ }
+
+ export interface UserInfo {
+ /** An email address for the user account signed into the current profile. Empty if the user is not signed in or the identity.email manifest permission is not specified. */
+ email: string;
+ /** A unique identifier for the account. This ID will not change for the lifetime of the account. Empty if the user is not signed in or (in M41+) the identity.email manifest permission is not specified. */
+ id: string;
+ }
+
+ export interface TokenInformation {
+ /** The specific token that should be removed from the cache. */
+ token: string;
+ }
+
+ export interface WebAuthFlowOptions {
+ /** The URL that initiates the auth flow. */
+ url: string;
+ /**
+ * Optional.
+ * Whether to launch auth flow in interactive mode.
+ * Since some auth flows may immediately redirect to a result URL, launchWebAuthFlow hides its web view until the first navigation either redirects to the final URL, or finishes loading a page meant to be displayed.
+ * If the interactive flag is true, the window will be displayed when a page load completes. If the flag is false or omitted, launchWebAuthFlow will return with an error if the initial navigation does not complete the flow.
+ */
+ interactive?: boolean | undefined;
+ }
+
+ export interface SignInChangeEvent extends chrome.events.Event<(account: AccountInfo, signedIn: boolean) => void> {}
+
+ export interface GetAuthTokenResult {
+ /**
+ * Optional.
+ * A list of OAuth2 scopes granted to the extension.
+ */
+ grantedScopes?: string[];
+ /**
+ * Optional.
+ * The specific token associated with the request.
+ */
+ token?: string;
+ }
+
+ /**
+ * Resets the state of the Identity API:
+ *
+ * * Removes all OAuth2 access tokens from the token cache
+ * * Removes user's account preferences
+ * * De-authorizes the user from all auth flows
+ * If `callback` is not provided, the function returns a Promise when the state has been cleared.
+ * @since Chrome 87.
+ * @param callback Called when the state has been cleared.
+ */
+ export function clearAllCachedAuthTokens(): Promise<void>;
+ export function clearAllCachedAuthTokens(callback: () => void): void;
+
+ /**
+ * Retrieves a list of AccountInfo objects describing the accounts present on the profile.
+ * getAccounts is only supported on dev channel.
+ * Dev channel only.
+ */
+ export function getAccounts(): Promise<AccountInfo[]>;
+ export function getAccounts(callback: (accounts: AccountInfo[]) => void): void;
+
+ /**
+ * Gets an OAuth2 access token using the client ID and scopes specified in the oauth2 section of manifest.json.
+ * The Identity API caches access tokens in memory, so it's ok to call getAuthToken non-interactively any time a token is required. The token cache automatically handles expiration.
+ * For a good user experience it is important interactive token requests are initiated by UI in your app explaining what the authorization is for. Failing to do this will cause your users to get authorization requests, or Chrome sign in screens if they are not signed in, with with no context. In particular, do not use getAuthToken interactively when your app is first launched.
+ * If `callback` is not provided, the function returns a Promise that resolves with the token.
+ * @param details Token options.
+ * @param callback Called with an OAuth2 access token as specified by the manifest, or undefined if there was an error.
+ */
+ export function getAuthToken(details: TokenDetails): Promise<GetAuthTokenResult>;
+ export function getAuthToken(
+ details: TokenDetails,
+ callback: (token?: string, grantedScopes?: string[]) => void,
+ ): void;
+
+ /**
+ * Retrieves email address and obfuscated gaia id of the user signed into a profile.
+ * This API is different from identity.getAccounts in two ways. The information returned is available offline, and it only applies to the primary account for the profile.
+ * @since Chrome 37.
+ */
+ export function getProfileUserInfo(callback: (userInfo: UserInfo) => void): void;
+
+ /** @since Chrome 84. */
+ export function getProfileUserInfo(details: ProfileDetails, callback: (userInfo: UserInfo) => void): void;
+
+ /** @since Chrome 84. */
+ export function getProfileUserInfo(details: ProfileDetails): Promise<UserInfo>;
+
+ /**
+ * Removes an OAuth2 access token from the Identity API's token cache.
+ * If an access token is discovered to be invalid, it should be passed to removeCachedAuthToken to remove it from the cache. The app may then retrieve a fresh token with getAuthToken.
+ * If `callback` is not provided, the function returns a Promise when the state has been removed from the cache.
+ * @param details Token information.
+ * @param callback Called when the token has been removed from the cache.
+ */
+ export function removeCachedAuthToken(details: TokenInformation): Promise<void>;
+ export function removeCachedAuthToken(details: TokenInformation, callback: () => void): void;
+
+ /**
+ * Starts an auth flow at the specified URL.
+ * This method enables auth flows with non-Google identity providers by launching a web view and navigating it to the first URL in the provider's auth flow. When the provider redirects to a URL matching the pattern https://<app-id>.chromiumapp.org/*, the window will close, and the final redirect URL will be passed to the callback function.
+ * For a good user experience it is important interactive auth flows are initiated by UI in your app explaining what the authorization is for. Failing to do this will cause your users to get authorization requests with no context. In particular, do not launch an interactive auth flow when your app is first launched.
+ * @param details WebAuth flow options.
+ * @param callback Optional. Called with the URL redirected back to your application.
+ */
+ export function launchWebAuthFlow(details: WebAuthFlowOptions, callback: (responseUrl?: string) => void): void;
+ export function launchWebAuthFlow(details: WebAuthFlowOptions): Promise<string | undefined>;
+
+ /**
+ * Generates a redirect URL to be used in launchWebAuthFlow.
+ * The generated URLs match the pattern https://<app-id>.chromiumapp.org/*.
+ * @since Chrome 33.
+ * @param path Optional. The path appended to the end of the generated URL.
+ */
+ export function getRedirectURL(path?: string): string;
+
+ /**
+ * Fired when signin state changes for an account on the user's profile.
+ * @since Chrome 33.
+ */
+ export var onSignInChanged: SignInChangeEvent;
+}
+
+////////////////////
+// Idle
+////////////////////
+/**
+ * Use the chrome.idle API to detect when the machine's idle state changes.
+ * Permissions: "idle"
+ * @since Chrome 6.
+ */
+declare namespace chrome.idle {
+ export type IdleState = "active" | "idle" | "locked";
+ export interface IdleStateChangedEvent extends chrome.events.Event<(newState: IdleState) => void> {}
+
+ /**
+ * Returns "locked" if the system is locked, "idle" if the user has not generated any input for a specified number of seconds, or "active" otherwise.
+ * @param detectionIntervalInSeconds The system is considered idle if detectionIntervalInSeconds seconds have elapsed since the last user input detected.
+ * Since Chrome 25.
+ */
+ export function queryState(detectionIntervalInSeconds: number, callback: (newState: IdleState) => void): void;
+ /**
+ * Sets the interval, in seconds, used to determine when the system is in an idle state for onStateChanged events. The default interval is 60 seconds.
+ * @since Chrome 25.
+ * @param intervalInSeconds Threshold, in seconds, used to determine when the system is in an idle state.
+ */
+ export function setDetectionInterval(intervalInSeconds: number): void;
+ /**
+ * Gets the time, in seconds, it takes until the screen is locked automatically while idle. Returns a zero duration if the screen is never locked automatically. Currently supported on Chrome OS only.
+ * Parameter delay: Time, in seconds, until the screen is locked automatically while idle. This is zero if the screen never locks automatically.
+ */
+ export function getAutoLockDelay(callback: (delay: number) => void): void;
+
+ /** Fired when the system changes to an active, idle or locked state. The event fires with "locked" if the screen is locked or the screensaver activates, "idle" if the system is unlocked and the user has not generated any input for a specified number of seconds, and "active" when the user generates input on an idle system. */
+ export var onStateChanged: IdleStateChangedEvent;
+}
+
+////////////////////
+// Input - IME
+////////////////////
+/**
+ * Use the chrome.input.ime API to implement a custom IME for Chrome OS. This allows your extension to handle keystrokes, set the composition, and manage the candidate window.
+ * Permissions: "input"
+ * @since Chrome 21.
+ */
+declare namespace chrome.input.ime {
+ /** See http://www.w3.org/TR/DOM-Level-3-Events/#events-KeyboardEvent */
+ export interface KeyboardEvent {
+ /**
+ * Optional.
+ * Whether or not the SHIFT key is pressed.
+ */
+ shiftKey?: boolean | undefined;
+ /**
+ * Optional.
+ * Whether or not the ALT key is pressed.
+ */
+ altKey?: boolean | undefined;
+ /**
+ * Optional.
+ * Whether or not the ALTGR key is pressed.
+ * @since Chrome 79.
+ */
+ altgrKey?: boolean | undefined;
+ /**
+ * Optional.
+ * The ID of the request. Use the requestId param from the onKeyEvent event instead.
+ * @deprecated since Chrome 79.
+ */
+ requestId?: string | undefined;
+ /** Value of the key being pressed */
+ key: string;
+ /**
+ * Optional.
+ * Whether or not the CTRL key is pressed.
+ */
+ ctrlKey?: boolean | undefined;
+ /** One of keyup or keydown. */
+ type: string;
+ /**
+ * Optional.
+ * The extension ID of the sender of this keyevent.
+ * @since Chrome 34.
+ */
+ extensionId?: string | undefined;
+ /**
+ * Optional.
+ * Value of the physical key being pressed. The value is not affected by current keyboard layout or modifier state.
+ * @since Chrome 26.
+ */
+ code: string;
+ /**
+ * Optional.
+ * The deprecated HTML keyCode, which is system- and implementation-dependent numerical code signifying the unmodified identifier associated with the key pressed.
+ * @since Chrome 37.
+ */
+ keyCode?: number | undefined;
+ /**
+ * Optional.
+ * Whether or not the CAPS_LOCK is enabled.
+ * @since Chrome 29.
+ */
+ capsLock?: boolean | undefined;
+ }
+
+ /**
+ * The auto-capitalize type of the text field.
+ * @since Chrome 69.
+ */
+ export type AutoCapitalizeType = "characters" | "words" | "sentences";
+ /** Describes an input Context */
+ export interface InputContext {
+ /** This is used to specify targets of text field operations. This ID becomes invalid as soon as onBlur is called. */
+ contextID: number;
+ /** Type of value this text field edits, (Text, Number, URL, etc) */
+ type: string;
+ /**
+ * Whether the text field wants auto-correct.
+ * @since Chrome 40.
+ */
+ autoCorrect: boolean;
+ /**
+ * Whether the text field wants auto-complete.
+ * @since Chrome 40.
+ */
+ autoComplete: boolean;
+ /**
+ * Whether the text field wants spell-check.
+ * @since Chrome 40.
+ */
+ spellCheck: boolean;
+ /**
+ * The auto-capitalize type of the text field.
+ * @since Chrome 69.
+ */
+ autoCapitalize: AutoCapitalizeType;
+ /**
+ * Whether text entered into the text field should be used to improve typing suggestions for the user.
+ * @since Chrome 68.
+ */
+ shouldDoLearning: boolean;
+ }
+
+ /**
+ * A menu item used by an input method to interact with the user from the language menu.
+ * @since Chrome 30.
+ */
+ export interface MenuItem {
+ /** String that will be passed to callbacks referencing this MenuItem. */
+ id: string;
+ /** Optional. Text displayed in the menu for this item. */
+ label?: string | undefined;
+ /** Optional. The type of menu item. */
+ style?: string | undefined;
+ /** Optional. Indicates this item is visible. */
+ visible?: boolean | undefined;
+ /** Indicates this item should be drawn with a check. */
+ checked?: boolean | undefined;
+ /** Indicates this item is enabled. */
+ enabled?: boolean | undefined;
+ }
+
+ export interface ImeParameters {
+ /** MenuItems to use. */
+ items: MenuItem[];
+ /** ID of the engine to use */
+ engineID: string;
+ }
+
+ export interface CommitTextParameters {
+ /** The text to commit */
+ text: string;
+ /** ID of the context where the text will be committed */
+ contextID: number;
+ }
+
+ export interface CandidateUsage {
+ /** The title string of details description. */
+ title: string;
+ /** The body string of detail description. */
+ body: string;
+ }
+
+ export interface CandidateTemplate {
+ /** The candidate */
+ candidate: string;
+ /** The candidate's id */
+ id: number;
+ /**
+ * Optional.
+ * The id to add these candidates under
+ */
+ parentId?: number | undefined;
+ /**
+ * Optional.
+ * Short string displayed to next to the candidate, often the shortcut key or index
+ */
+ label?: string | undefined;
+ /**
+ * Optional.
+ * Additional text describing the candidate
+ */
+ annotation?: string | undefined;
+ /**
+ * Optional.
+ * The usage or detail description of word.
+ */
+ usage?: CandidateUsage | undefined;
+ }
+
+ export interface CandidatesParameters {
+ /** ID of the context that owns the candidate window. */
+ contextID: number;
+ /** List of candidates to show in the candidate window */
+ candidates: CandidateTemplate[];
+ }
+
+ export interface CompositionParameterSegment {
+ /** Index of the character to start this segment at */
+ start: number;
+ /** Index of the character to end this segment after. */
+ end: number;
+ /** The type of the underline to modify this segment. */
+ style: string;
+ }
+
+ export interface CompositionParameters {
+ /** ID of the context where the composition text will be set */
+ contextID: number;
+ /** Text to set */
+ text: string;
+ /** Optional. List of segments and their associated types. */
+ segments?: CompositionParameterSegment[] | undefined;
+ /** Position in the text of the cursor. */
+ cursor: number;
+ /** Optional. Position in the text that the selection starts at. */
+ selectionStart?: number | undefined;
+ /** Optional. Position in the text that the selection ends at. */
+ selectionEnd?: number | undefined;
+ }
+
+ export interface MenuItemParameters {
+ items: Object[];
+ engineId: string;
+ }
+
+ /** Type of the assistive window. */
+ export type AssistiveWindowType = "undo";
+
+ /** ID of a button in an assistive window. */
+ export type AssistiveWindowButton = "undo" | "addToDictionary";
+
+ /** Properties of an assistive window. */
+ export interface AssistiveWindowProperties {
+ type: AssistiveWindowType;
+ visible: boolean;
+ announceString?: string | undefined;
+ }
+
+ export interface CandidateWindowParameterProperties {
+ /**
+ * Optional.
+ * True to show the cursor, false to hide it.
+ */
+ cursorVisible?: boolean | undefined;
+ /**
+ * Optional.
+ * True if the candidate window should be rendered vertical, false to make it horizontal.
+ */
+ vertical?: boolean | undefined;
+ /**
+ * Optional.
+ * The number of candidates to display per page.
+ */
+ pageSize?: number | undefined;
+ /**
+ * Optional.
+ * True to display the auxiliary text, false to hide it.
+ */
+ auxiliaryTextVisible?: boolean | undefined;
+ /**
+ * Optional.
+ * Text that is shown at the bottom of the candidate window.
+ */
+ auxiliaryText?: string | undefined;
+ /**
+ * Optional.
+ * True to show the Candidate window, false to hide it.
+ */
+ visible?: boolean | undefined;
+ /**
+ * Optional.
+ * Where to display the candidate window.
+ * @since Chrome 28.
+ */
+ windowPosition?: string | undefined;
+ /**
+ * Optional.
+ * The index of the current chosen candidate out of total candidates.
+ * @since Chrome 84.
+ */
+ currentCandidateIndex?: number | undefined;
+ /**
+ * Optional.
+ * The total number of candidates for the candidate window.
+ * @since Chrome 84.
+ */
+ totalCandidates?: number | undefined;
+ }
+
+ export interface CandidateWindowParameter {
+ /** ID of the engine to set properties on. */
+ engineID: string;
+ properties: CandidateWindowParameterProperties;
+ }
+
+ export interface ClearCompositionParameters {
+ /** ID of the context where the composition will be cleared */
+ contextID: number;
+ }
+
+ export interface CursorPositionParameters {
+ /** ID of the candidate to select. */
+ candidateID: number;
+ /** ID of the context that owns the candidate window. */
+ contextID: number;
+ }
+
+ export interface SendKeyEventParameters {
+ /** ID of the context where the key events will be sent, or zero to send key events to non-input field. */
+ contextID: number;
+ /** Data on the key event. */
+ keyData: KeyboardEvent[];
+ }
+
+ export interface DeleteSurroundingTextParameters {
+ /** ID of the engine receiving the event. */
+ engineID: string;
+ /** ID of the context where the surrounding text will be deleted. */
+ contextID: number;
+ /** The offset from the caret position where deletion will start. This value can be negative. */
+ offset: number;
+ /** The number of characters to be deleted */
+ length: number;
+ }
+
+ export interface SurroundingTextInfo {
+ /** The text around cursor. */
+ text: string;
+ /** The ending position of the selection. This value indicates caret position if there is no selection. */
+ focus: number;
+ /** The beginning position of the selection. This value indicates caret position if is no selection. */
+ anchor: number;
+ }
+
+ export interface AssistiveWindowButtonClickedDetails {
+ /** The ID of the button clicked. */
+ buttonID: AssistiveWindowButton;
+ /** The type of the assistive window. */
+ windowType: AssistiveWindowType;
+ }
+
+ export interface BlurEvent extends chrome.events.Event<(contextID: number) => void> {}
+
+ export interface AssistiveWindowButtonClickedEvent
+ extends chrome.events.Event<(details: AssistiveWindowButtonClickedDetails) => void>
+ {}
+
+ export interface CandidateClickedEvent
+ extends chrome.events.Event<(engineID: string, candidateID: number, button: string) => void>
+ {}
+
+ export interface KeyEventEvent
+ extends chrome.events.Event<(engineID: string, keyData: KeyboardEvent, requestId: string) => void>
+ {}
+
+ export interface DeactivatedEvent extends chrome.events.Event<(engineID: string) => void> {}
+
+ export interface InputContextUpdateEvent extends chrome.events.Event<(context: InputContext) => void> {}
+
+ export interface ActivateEvent extends chrome.events.Event<(engineID: string, screen: string) => void> {}
+
+ export interface FocusEvent extends chrome.events.Event<(context: InputContext) => void> {}
+
+ export interface MenuItemActivatedEvent extends chrome.events.Event<(engineID: string, name: string) => void> {}
+
+ export interface SurroundingTextChangedEvent
+ extends chrome.events.Event<(engineID: string, surroundingInfo: SurroundingTextInfo) => void>
+ {}
+
+ export interface InputResetEvent extends chrome.events.Event<(engineID: string) => void> {}
+
+ /**
+ * Adds the provided menu items to the language menu when this IME is active.
+ */
+ export function setMenuItems(parameters: ImeParameters, callback?: () => void): void;
+ /**
+ * Commits the provided text to the current input.
+ * @param callback Called when the operation completes with a boolean indicating if the text was accepted or not. On failure, chrome.runtime.lastError is set.
+ */
+ export function commitText(parameters: CommitTextParameters, callback?: (success: boolean) => void): void;
+ /**
+ * Sets the current candidate list. This fails if this extension doesn't own the active IME
+ * @param callback Called when the operation completes.
+ */
+ export function setCandidates(parameters: CandidatesParameters, callback?: (success: boolean) => void): void;
+ /**
+ * Set the current composition. If this extension does not own the active IME, this fails.
+ * @param callback Called when the operation completes with a boolean indicating if the text was accepted or not. On failure, chrome.runtime.lastError is set.
+ */
+ export function setComposition(parameters: CompositionParameters, callback?: (success: boolean) => void): void;
+ /**
+ * Updates the state of the MenuItems specified
+ * @param callback Called when the operation completes
+ */
+ export function updateMenuItems(parameters: MenuItemParameters, callback?: () => void): void;
+ /**
+ * Shows/Hides an assistive window with the given properties.
+ * @param parameters
+ * @param callback Called when the operation completes.
+ */
+ export function setAssistiveWindowProperties(
+ parameters: {
+ contextID: number;
+ properties: chrome.input.ime.AssistiveWindowProperties;
+ },
+ callback?: (success: boolean) => void,
+ ): void;
+ /**
+ * Highlights/Unhighlights a button in an assistive window.
+ * @param parameters
+ * @param callback Called when the operation completes. On failure, chrome.runtime.lastError is set.
+ */
+ export function setAssistiveWindowButtonHighlighted(
+ parameters: {
+ contextID: number;
+ buttonID: chrome.input.ime.AssistiveWindowButton;
+ windowType: chrome.input.ime.AssistiveWindowType;
+ announceString?: string | undefined;
+ highlighted: boolean;
+ },
+ callback?: () => void,
+ ): void;
+ /**
+ * Sets the properties of the candidate window. This fails if the extension doesn't own the active IME
+ * @param callback Called when the operation completes.
+ */
+ export function setCandidateWindowProperties(
+ parameters: CandidateWindowParameter,
+ callback?: (success: boolean) => void,
+ ): void;
+ /**
+ * Clear the current composition. If this extension does not own the active IME, this fails.
+ * @param callback Called when the operation completes with a boolean indicating if the text was accepted or not. On failure, chrome.runtime.lastError is set.
+ */
+ export function clearComposition(
+ parameters: ClearCompositionParameters,
+ callback?: (success: boolean) => void,
+ ): void;
+ /**
+ * Set the position of the cursor in the candidate window. This is a no-op if this extension does not own the active IME.
+ * @param callback Called when the operation completes
+ */
+ export function setCursorPosition(
+ parameters: CursorPositionParameters,
+ callback?: (success: boolean) => void,
+ ): void;
+ /**
+ * Sends the key events. This function is expected to be used by virtual keyboards. When key(s) on a virtual keyboard is pressed by a user, this function is used to propagate that event to the system.
+ * @since Chrome 33.
+ * @param callback Called when the operation completes.
+ */
+ export function sendKeyEvents(parameters: SendKeyEventParameters, callback?: () => void): void;
+ /**
+ * Hides the input view window, which is popped up automatically by system. If the input view window is already hidden, this function will do nothing.
+ * @since Chrome 34.
+ */
+ export function hideInputView(): void;
+ /**
+ * Deletes the text around the caret.
+ * @since Chrome 27.
+ */
+ export function deleteSurroundingText(parameters: DeleteSurroundingTextParameters, callback?: () => void): void;
+ /**
+ * Indicates that the key event received by onKeyEvent is handled. This should only be called if the onKeyEvent listener is asynchronous.
+ * @since Chrome 25.
+ * @param requestId Request id of the event that was handled. This should come from keyEvent.requestId
+ * @param response True if the keystroke was handled, false if not
+ */
+ export function keyEventHandled(requestId: string, response: boolean): void;
+
+ /** This event is sent when focus leaves a text box. It is sent to all extensions that are listening to this event, and enabled by the user. */
+ export var onBlur: BlurEvent;
+ /** This event is sent when a button in an assistive window is clicked. */
+ export var onAssistiveWindowButtonClicked: AssistiveWindowButtonClickedEvent;
+ /** This event is sent if this extension owns the active IME. */
+ export var onCandidateClicked: CandidateClickedEvent;
+ /** This event is sent if this extension owns the active IME. */
+ export var onKeyEvent: KeyEventEvent;
+ /** This event is sent when an IME is deactivated. It signals that the IME will no longer be receiving onKeyPress events. */
+ export var onDeactivated: DeactivatedEvent;
+ /** This event is sent when the properties of the current InputContext change, such as the type. It is sent to all extensions that are listening to this event, and enabled by the user. */
+ export var onInputContextUpdate: InputContextUpdateEvent;
+ /** This event is sent when an IME is activated. It signals that the IME will be receiving onKeyPress events. */
+ export var onActivate: ActivateEvent;
+ /** This event is sent when focus enters a text box. It is sent to all extensions that are listening to this event, and enabled by the user. */
+ export var onFocus: FocusEvent;
+ /** Called when the user selects a menu item */
+ export var onMenuItemActivated: MenuItemActivatedEvent;
+ /**
+ * Called when the editable string around caret is changed or when the caret position is moved. The text length is limited to 100 characters for each back and forth direction.
+ * @since Chrome 27.
+ */
+ export var onSurroundingTextChanged: SurroundingTextChangedEvent;
+ /**
+ * This event is sent when chrome terminates ongoing text input session.
+ * @since Chrome 29.
+ */
+ export var onReset: InputResetEvent;
+}
+
+////////////////////
+// LoginState
+////////////////////
+/**
+ * Use the chrome.loginState API to read and monitor the login state.
+ * Permissions: "loginState"
+ * @since Chrome 78.
+ * Important: This API works only on Chrome OS.
+ */
+declare namespace chrome.loginState {
+ export interface SessionStateChangedEvent extends chrome.events.Event<(sessionState: SessionState) => void> {}
+
+ /** Possible profile types. */
+ export type ProfileType = "SIGNIN_PROFILE" | "USER_PROFILE";
+
+ /** Possible session states. */
+ export type SessionState = "UNKNOWN" | "IN_OOBE_SCREEN" | "IN_LOGIN_SCREEN" | "IN_SESSION" | "IN_LOCK_SCREEN";
+
+ /** Gets the type of the profile the extension is in. */
+ export function getProfileType(callback: (profileType: ProfileType) => void): void;
+
+ /** Gets the current session state. */
+ export function getSessionState(callback: (sessionState: SessionState) => void): void;
+
+ /** Dispatched when the session state changes. sessionState is the new session state.*/
+ export const onSessionStateChanged: SessionStateChangedEvent;
+}
+
+////////////////////
+// Management
+////////////////////
+/**
+ * The chrome.management API provides ways to manage the list of extensions/apps that are installed and running. It is particularly useful for extensions that override the built-in New Tab page.
+ * Permissions: "management"
+ * @since Chrome 8.
+ */
+declare namespace chrome.management {
+ /** Information about an installed extension, app, or theme. */
+ export interface ExtensionInfo {
+ /**
+ * Optional.
+ * A reason the item is disabled.
+ * @since Chrome 17.
+ */
+ disabledReason?: string | undefined;
+ /** Optional. The launch url (only present for apps). */
+ appLaunchUrl?: string | undefined;
+ /**
+ * The description of this extension, app, or theme.
+ * @since Chrome 9.
+ */
+ description: string;
+ /**
+ * Returns a list of API based permissions.
+ * @since Chrome 9.
+ */
+ permissions: string[];
+ /**
+ * Optional.
+ * A list of icon information. Note that this just reflects what was declared in the manifest, and the actual image at that url may be larger or smaller than what was declared, so you might consider using explicit width and height attributes on img tags referencing these images. See the manifest documentation on icons for more details.
+ */
+ icons?: IconInfo[] | undefined;
+ /**
+ * Returns a list of host based permissions.
+ * @since Chrome 9.
+ */
+ hostPermissions: string[];
+ /** Whether it is currently enabled or disabled. */
+ enabled: boolean;
+ /**
+ * Optional.
+ * The URL of the homepage of this extension, app, or theme.
+ * @since Chrome 11.
+ */
+ homepageUrl?: string | undefined;
+ /**
+ * Whether this extension can be disabled or uninstalled by the user.
+ * @since Chrome 12.
+ */
+ mayDisable: boolean;
+ /**
+ * How the extension was installed.
+ * @since Chrome 22.
+ */
+ installType: string;
+ /** The version of this extension, app, or theme. */
+ version: string;
+ /** The extension's unique identifier. */
+ id: string;
+ /**
+ * Whether the extension, app, or theme declares that it supports offline.
+ * @since Chrome 15.
+ */
+ offlineEnabled: boolean;
+ /**
+ * Optional.
+ * The update URL of this extension, app, or theme.
+ * @since Chrome 16.
+ */
+ updateUrl?: string | undefined;
+ /**
+ * The type of this extension, app, or theme.
+ * @since Chrome 23.
+ */
+ type: string;
+ /** The url for the item's options page, if it has one. */
+ optionsUrl: string;
+ /** The name of this extension, app, or theme. */
+ name: string;
+ /**
+ * A short version of the name of this extension, app, or theme.
+ * @since Chrome 31.
+ */
+ shortName: string;
+ /**
+ * True if this is an app.
+ * @deprecated since Chrome 33. Please use management.ExtensionInfo.type.
+ */
+ isApp: boolean;
+ /**
+ * Optional.
+ * The app launch type (only present for apps).
+ * @since Chrome 37.
+ */
+ launchType?: string | undefined;
+ /**
+ * Optional.
+ * The currently available launch types (only present for apps).
+ * @since Chrome 37.
+ */
+ availableLaunchTypes?: string[] | undefined;
+ }
+
+ /** Information about an icon belonging to an extension, app, or theme. */
+ export interface IconInfo {
+ /** The URL for this icon image. To display a grayscale version of the icon (to indicate that an extension is disabled, for example), append ?grayscale=true to the URL. */
+ url: string;
+ /** A number representing the width and height of the icon. Likely values include (but are not limited to) 128, 48, 24, and 16. */
+ size: number;
+ }
+
+ export interface UninstallOptions {
+ /**
+ * Optional.
+ * Whether or not a confirm-uninstall dialog should prompt the user. Defaults to false for self uninstalls. If an extension uninstalls another extension, this parameter is ignored and the dialog is always shown.
+ */
+ showConfirmDialog?: boolean | undefined;
+ }
+
+ export interface ManagementDisabledEvent extends chrome.events.Event<(info: ExtensionInfo) => void> {}
+
+ export interface ManagementUninstalledEvent extends chrome.events.Event<(id: string) => void> {}
+
+ export interface ManagementInstalledEvent extends chrome.events.Event<(info: ExtensionInfo) => void> {}
+
+ export interface ManagementEnabledEvent extends chrome.events.Event<(info: ExtensionInfo) => void> {}
+
+ /**
+ * Enables or disables an app or extension.
+ * @param id This should be the id from an item of management.ExtensionInfo.
+ * @param enabled Whether this item should be enabled or disabled.
+ * @return The `setEnabled` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function setEnabled(id: string, enabled: boolean): Promise<void>;
+ /**
+ * Enables or disables an app or extension.
+ * @param id This should be the id from an item of management.ExtensionInfo.
+ * @param enabled Whether this item should be enabled or disabled.
+ */
+ export function setEnabled(id: string, enabled: boolean, callback: () => void): void;
+ /**
+ * Returns a list of permission warnings for the given extension id.
+ * @since Chrome 15.
+ * @param id The ID of an already installed extension.
+ * @return The `getPermissionWarningsById` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function getPermissionWarningsById(id: string): Promise<string[]>;
+ /**
+ * Returns a list of permission warnings for the given extension id.
+ * @since Chrome 15.
+ * @param id The ID of an already installed extension.
+ */
+ export function getPermissionWarningsById(id: string, callback: (permissionWarnings: string[]) => void): void;
+ /**
+ * Returns information about the installed extension, app, or theme that has the given ID.
+ * @since Chrome 9.
+ * @param id The ID from an item of management.ExtensionInfo.
+ * @return The `get` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function get(id: string): Promise<ExtensionInfo>;
+ /**
+ * Returns information about the installed extension, app, or theme that has the given ID.
+ * @since Chrome 9.
+ * @param id The ID from an item of management.ExtensionInfo.
+ */
+ export function get(id: string, callback: (result: ExtensionInfo) => void): void;
+ /**
+ * Returns a list of information about installed extensions and apps.
+ * @return The `getAll` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function getAll(): Promise<ExtensionInfo[]>;
+ /**
+ * Returns a list of information about installed extensions and apps.
+ */
+ export function getAll(callback: (result: ExtensionInfo[]) => void): void;
+ /**
+ * Returns a list of permission warnings for the given extension manifest string. Note: This function can be used without requesting the 'management' permission in the manifest.
+ * @since Chrome 15.
+ * @param manifestStr Extension manifest JSON string.
+ * @return The `getPermissionWarningsByManifest` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function getPermissionWarningsByManifest(
+ manifestStr: string,
+ ): Promise<string[]>;
+ /**
+ * Returns a list of permission warnings for the given extension manifest string. Note: This function can be used without requesting the 'management' permission in the manifest.
+ * @since Chrome 15.
+ * @param manifestStr Extension manifest JSON string.
+ */
+ export function getPermissionWarningsByManifest(
+ manifestStr: string,
+ callback: (permissionwarnings: string[]) => void,
+ ): void;
+ /**
+ * Launches an application.
+ * @param id The extension id of the application.
+ * @return The `launchApp` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function launchApp(id: string): Promise<void>;
+ /**
+ * Launches an application.
+ * @param id The extension id of the application.
+ */
+ export function launchApp(id: string, callback: () => void): void;
+ /**
+ * Uninstalls a currently installed app or extension.
+ * @since Chrome 21.
+ * @param id This should be the id from an item of management.ExtensionInfo.
+ * @return The `uninstall` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function uninstall(id: string, options?: UninstallOptions): Promise<void>;
+ /**
+ * Uninstalls a currently installed app or extension.
+ * @since Chrome 21.
+ * @param id This should be the id from an item of management.ExtensionInfo.
+ */
+ export function uninstall(id: string, callback: () => void): void;
+ export function uninstall(id: string, options: UninstallOptions, callback: () => void): void;
+ /**
+ * Uninstalls a currently installed app or extension.
+ * @deprecated since Chrome 21. The options parameter was added to this function.
+ * @param id This should be the id from an item of management.ExtensionInfo.
+ * @return The `uninstall` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function uninstall(id: string): Promise<void>;
+ /**
+ * Uninstalls a currently installed app or extension.
+ * @deprecated since Chrome 21. The options parameter was added to this function.
+ * @param id This should be the id from an item of management.ExtensionInfo.
+ */
+ export function uninstall(id: string, callback: () => void): void;
+ /**
+ * Returns information about the calling extension, app, or theme. Note: This function can be used without requesting the 'management' permission in the manifest.
+ * @since Chrome 39.
+ * @return The `getSelf` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function getSelf(): Promise<ExtensionInfo>;
+ /**
+ * Returns information about the calling extension, app, or theme. Note: This function can be used without requesting the 'management' permission in the manifest.
+ * @since Chrome 39.
+ */
+ export function getSelf(callback: (result: ExtensionInfo) => void): void;
+ /**
+ * Uninstalls the calling extension.
+ * Note: This function can be used without requesting the 'management' permission in the manifest.
+ * @since Chrome 26.
+ * @return The `uninstallSelf` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function uninstallSelf(options?: UninstallOptions): Promise<void>;
+ /**
+ * Uninstalls the calling extension.
+ * Note: This function can be used without requesting the 'management' permission in the manifest.
+ * @since Chrome 26.
+ */
+ export function uninstallSelf(callback: () => void): void;
+ export function uninstallSelf(options: UninstallOptions, callback: () => void): void;
+ /**
+ * Uninstalls the calling extension.
+ * Note: This function can be used without requesting the 'management' permission in the manifest.
+ * @since Chrome 26.
+ * @return The `uninstallSelf` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function uninstallSelf(): Promise<void>;
+ /**
+ * Uninstalls the calling extension.
+ * Note: This function can be used without requesting the 'management' permission in the manifest.
+ * @since Chrome 26.
+ */
+ export function uninstallSelf(callback: () => void): void;
+ /**
+ * Display options to create shortcuts for an app. On Mac, only packaged app shortcuts can be created.
+ * @since Chrome 37.
+ * @return The `createAppShortcut` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function createAppShortcut(id: string): Promise<void>;
+ /**
+ * Display options to create shortcuts for an app. On Mac, only packaged app shortcuts can be created.
+ * @since Chrome 37.
+ */
+ export function createAppShortcut(id: string, callback: () => void): void;
+ /**
+ * Set the launch type of an app.
+ * @since Chrome 37.
+ * @param id This should be the id from an app item of management.ExtensionInfo.
+ * @param launchType The target launch type. Always check and make sure this launch type is in ExtensionInfo.availableLaunchTypes, because the available launch types vary on different platforms and configurations.
+ * @return The `setLaunchType` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function setLaunchType(id: string, launchType: string): Promise<void>;
+ /**
+ * Set the launch type of an app.
+ * @since Chrome 37.
+ * @param id This should be the id from an app item of management.ExtensionInfo.
+ * @param launchType The target launch type. Always check and make sure this launch type is in ExtensionInfo.availableLaunchTypes, because the available launch types vary on different platforms and configurations.
+ */
+ export function setLaunchType(id: string, launchType: string, callback: () => void): void;
+ /**
+ * Generate an app for a URL. Returns the generated bookmark app.
+ * @since Chrome 37.
+ * @param url The URL of a web page. The scheme of the URL can only be "http" or "https".
+ * @param title The title of the generated app.
+ * @return The `generateAppForLink` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function generateAppForLink(url: string, title: string): Promise<ExtensionInfo>;
+ /**
+ * Generate an app for a URL. Returns the generated bookmark app.
+ * @since Chrome 37.
+ * @param url The URL of a web page. The scheme of the URL can only be "http" or "https".
+ * @param title The title of the generated app.
+ */
+ export function generateAppForLink(url: string, title: string, callback: (result: ExtensionInfo) => void): void;
+
+ /** Fired when an app or extension has been disabled. */
+ export var onDisabled: ManagementDisabledEvent;
+ /** Fired when an app or extension has been uninstalled. */
+ export var onUninstalled: ManagementUninstalledEvent;
+ /** Fired when an app or extension has been installed. */
+ export var onInstalled: ManagementInstalledEvent;
+ /** Fired when an app or extension has been enabled. */
+ export var onEnabled: ManagementEnabledEvent;
+}
+
+////////////////////
+// Notifications
+////////////////////
+/**
+ * Use the networking.config API to authenticate to captive portals.
+ * Permissions: "networking.config"
+ * Important: This API works only on Chrome OS.
+ * @since Chrome 43.
+ */
+declare namespace chrome.networking.config {
+ export interface NetworkInfo {
+ /** Currently only WiFi supported. */
+ Type: string;
+ /** Optional. A unique identifier of the network. */
+ GUID?: string | undefined;
+ /** Optional. A hex-encoded byte sequence. */
+ HexSSID?: string | undefined;
+ /** Optional. The decoded SSID of the network (default encoding is UTF-8). To filter for non-UTF-8 SSIDs, use HexSSID instead. */
+ SSID?: string | undefined;
+ /** Optional. The basic service set identification (BSSID) uniquely identifying the basic service set. BSSID is represented as a human readable, hex-encoded string with bytes separated by colons, e.g. 45:67:89:ab:cd:ef. */
+ BSSID?: string | undefined;
+ /** Optional. Identifier indicating the security type of the network. Valid values are None, WEP-PSK, WPA-PSK and WPA-EAP. */
+ Security?: string | undefined;
+ }
+
+ export interface CaptivePorttalDetectedEvent extends chrome.events.Event<(networkInfo: NetworkInfo) => void> {}
+
+ /**
+ * Allows an extension to define network filters for the networks it can handle. A call to this function will remove all filters previously installed by the extension before setting the new list.
+ * @param networks Network filters to set. Every NetworkInfo must either have the SSID or HexSSID set. Other fields will be ignored.
+ * @param callback Called back when this operation is finished.
+ */
+ export function setNetworkFilter(networks: NetworkInfo[], callback: () => void): void;
+ /**
+ * Called by the extension to notify the network config API that it finished a captive portal authentication attempt and hand over the result of the attempt. This function must only be called with the GUID of the latest onCaptivePortalDetected event.
+ * @param GUID Unique network identifier obtained from onCaptivePortalDetected.
+ * @param result The result of the authentication attempt.
+ * unhandled: The extension does not handle this network or captive portal (e.g. server end-point not found or not compatible).
+ * succeeded: The extension handled this network and authenticated successfully.
+ * rejected: The extension handled this network, tried to authenticate, however was rejected by the server.
+ * failed: The extension handled this network, tried to authenticate, however failed due to an unspecified error.
+ * @param callback Called back when this operation is finished.
+ */
+ export function finishAuthentication(GUID: string, result: string, callback?: () => void): void;
+
+ /** This event fires everytime a captive portal is detected on a network matching any of the currently registered network filters and the user consents to use the extension for authentication. Network filters may be set using the setNetworkFilter. Upon receiving this event the extension should start its authentication attempt with the captive portal. When the extension finishes its attempt, it must call finishAuthentication with the GUID received with this event and the appropriate authentication result. */
+ export var onCaptivePortalDetected: CaptivePorttalDetectedEvent;
+}
+
+////////////////////
+// Notifications
+// https://developer.chrome.com/extensions/notifications
+////////////////////
+/**
+ * Use the chrome.notifications API to create rich notifications using templates and show these notifications to users in the system tray.
+ * Permissions: "notifications"
+ * @since Chrome 28.
+ */
+declare namespace chrome.notifications {
+ export type TemplateType = "basic" | "image" | "list" | "progress";
+
+ export interface ButtonOptions {
+ title: string;
+ iconUrl?: string | undefined;
+ }
+
+ export interface ItemOptions {
+ /** Title of one item of a list notification. */
+ title: string;
+ /** Additional details about this item. */
+ message: string;
+ }
+
+ export type NotificationOptions<T extends boolean = false> =
+ & {
+ /**
+ * Optional.
+ * Alternate notification content with a lower-weight font.
+ * @since Chrome 31.
+ */
+ contextMessage?: string | undefined;
+ /** Optional. Priority ranges from -2 to 2. -2 is lowest priority. 2 is highest. Zero is default. */
+ priority?: number | undefined;
+ /** Optional. A timestamp associated with the notification, in milliseconds past the epoch (e.g. Date.now() + n). */
+ eventTime?: number | undefined;
+ /** Optional. Text and icons for up to two notification action buttons. */
+ buttons?: ButtonOptions[] | undefined;
+ /** Optional. Items for multi-item notifications. */
+ items?: ItemOptions[] | undefined;
+ /**
+ * Optional.
+ * Current progress ranges from 0 to 100.
+ * @since Chrome 30.
+ */
+ progress?: number | undefined;
+ /**
+ * Optional.
+ * Whether to show UI indicating that the app will visibly respond to clicks on the body of a notification.
+ * @since Chrome 32.
+ */
+ isClickable?: boolean | undefined;
+ /**
+ * Optional.
+ * A URL to the app icon mask. URLs have the same restrictions as iconUrl. The app icon mask should be in alpha channel, as only the alpha channel of the image will be considered.
+ * @since Chrome 38.
+ */
+ appIconMaskUrl?: string | undefined;
+ /** Optional. A URL to the image thumbnail for image-type notifications. URLs have the same restrictions as iconUrl. */
+ imageUrl?: string | undefined;
+ /**
+ * Indicates that the notification should remain visible on screen until the user activates or dismisses the notification.
+ * This defaults to false.
+ * @since Chrome 50
+ */
+ requireInteraction?: boolean | undefined;
+ /**
+ * Optional.
+ * Indicates that no sounds or vibrations should be made when the notification is being shown. This defaults to false.
+ * @since Chrome 70
+ */
+ silent?: boolean | undefined;
+ }
+ & (T extends true ? {
+ /**
+ * A URL to the sender's avatar, app icon, or a thumbnail for image notifications.
+ * URLs can be a data URL, a blob URL, or a URL relative to a resource within this extension's .crx file. Required for notifications.create method.
+ */
+ iconUrl: string;
+ /** Main notification content. Required for notifications.create method. */
+ message: string;
+ /** Which type of notification to display. Required for notifications.create method. */
+ type: TemplateType;
+ /** Title of the notification (e.g. sender name for email). Required for notifications.create method. */
+ title: string;
+ }
+ : {
+ /**
+ * Optional.
+ * A URL to the sender's avatar, app icon, or a thumbnail for image notifications.
+ * URLs can be a data URL, a blob URL, or a URL relative to a resource within this extension's .crx file. Required for notifications.create method.
+ */
+ iconUrl?: string | undefined;
+ /** Optional. Main notification content. Required for notifications.create method. */
+ message?: string | undefined;
+ /** Optional. Which type of notification to display. Required for notifications.create method. */
+ type?: TemplateType | undefined;
+ /** Optional. Title of the notification (e.g. sender name for email). Required for notifications.create method. */
+ title?: string | undefined;
+ });
+
+ export interface NotificationClosedEvent
+ extends chrome.events.Event<(notificationId: string, byUser: boolean) => void>
+ {}
+
+ export interface NotificationClickedEvent extends chrome.events.Event<(notificationId: string) => void> {}
+
+ export interface NotificationButtonClickedEvent
+ extends chrome.events.Event<(notificationId: string, buttonIndex: number) => void>
+ {}
+
+ export interface NotificationPermissionLevelChangedEvent extends chrome.events.Event<(level: string) => void> {}
+
+ export interface NotificationShowSettingsEvent extends chrome.events.Event<() => void> {}
+
+ /** The notification closed, either by the system or by user action. */
+ export var onClosed: NotificationClosedEvent;
+ /** The user clicked in a non-button area of the notification. */
+ export var onClicked: NotificationClickedEvent;
+ /** The user pressed a button in the notification. */
+ export var onButtonClicked: NotificationButtonClickedEvent;
+ /**
+ * The user changes the permission level.
+ * @since Chrome 32.
+ */
+ export var onPermissionLevelChanged: NotificationPermissionLevelChangedEvent;
+ /**
+ * The user clicked on a link for the app's notification settings.
+ * @since Chrome 32.
+ */
+ export var onShowSettings: NotificationShowSettingsEvent;
+
+ /**
+ * Creates and displays a notification.
+ * @param notificationId Identifier of the notification. If not set or empty, an ID will automatically be generated. If it matches an existing notification, this method first clears that notification before proceeding with the create operation.
+ * The notificationId parameter is required before Chrome 42.
+ * @param options Contents of the notification.
+ * @param callback Returns the notification id (either supplied or generated) that represents the created notification.
+ * The callback is required before Chrome 42.
+ */
+ export function create(
+ notificationId: string,
+ options: NotificationOptions<true>,
+ callback?: (notificationId: string) => void,
+ ): void;
+ /**
+ * Creates and displays a notification.
+ * @param notificationId Identifier of the notification. If not set or empty, an ID will automatically be generated. If it matches an existing notification, this method first clears that notification before proceeding with the create operation.
+ * The notificationId parameter is required before Chrome 42.
+ * @param options Contents of the notification.
+ * @param callback Returns the notification id (either supplied or generated) that represents the created notification.
+ * The callback is required before Chrome 42.
+ */
+ export function create(options: NotificationOptions<true>, callback?: (notificationId: string) => void): void;
+ /**
+ * Updates an existing notification.
+ * @param notificationId The id of the notification to be updated. This is returned by notifications.create method.
+ * @param options Contents of the notification to update to.
+ * @param callback Called to indicate whether a matching notification existed.
+ * The callback is required before Chrome 42.
+ */
+ export function update(
+ notificationId: string,
+ options: NotificationOptions,
+ callback?: (wasUpdated: boolean) => void,
+ ): void;
+ /**
+ * Clears the specified notification.
+ * @param notificationId The id of the notification to be cleared. This is returned by notifications.create method.
+ * @param callback Called to indicate whether a matching notification existed.
+ * The callback is required before Chrome 42.
+ */
+ export function clear(notificationId: string, callback?: (wasCleared: boolean) => void): void;
+ /**
+ * Retrieves all the notifications.
+ * @since Chrome 29.
+ * @param callback Returns the set of notification_ids currently in the system.
+ */
+ export function getAll(callback: (notifications: Object) => void): void;
+ /**
+ * Retrieves whether the user has enabled notifications from this app or extension.
+ * @since Chrome 32.
+ * @param callback Returns the current permission level.
+ */
+ export function getPermissionLevel(callback: (level: string) => void): void;
+}
+
+////////////////////
+// Offscreen
+////////////////////
+/**
+ * Use the offscreen API to create and manage offscreen documents.
+ * Availability: @since Chrome 109. Manifest v3.
+ * Permissions: "offscreen"
+ */
+declare namespace chrome.offscreen {
+ /** The reason(s) the extension is creating the offscreen document. */
+ export enum Reason {
+ /** A reason used for testing purposes only. */
+ TESTING = "TESTING",
+ /** The offscreen document is responsible for playing audio. */
+ AUDIO_PLAYBACK = "AUDIO_PLAYBACK",
+ /** The offscreen document needs to embed and script an iframe in order to modify the iframe's content. */
+ IFRAME_SCRIPTING = "IFRAME_SCRIPTING",
+ /** The offscreen document needs to embed an iframe and scrape its DOM to extract information. */
+ DOM_SCRAPING = "DOM_SCRAPING",
+ /** The offscreen document needs to interact with Blob objects (including URL.createObjectURL()). */
+ BLOBS = "BLOBS",
+ /** The offscreen document needs to use the DOMParser API. */
+ DOM_PARSER = "DOM_PARSER",
+ /** The offscreen document needs to interact with media streams from user media (e.g. getUserMedia()). */
+ USER_MEDIA = "USER_MEDIA",
+ /** The offscreen document needs to interact with media streams from display media (e.g. getDisplayMedia()). */
+ DISPLAY_MEDIA = "DISPLAY_MEDIA",
+ /** The offscreen document needs to use WebRTC APIs. */
+ WEB_RTC = "WEB_RTC",
+ /** The offscreen document needs to interact with the clipboard APIs(e.g. Navigator.clipboard). */
+ CLIPBOARD = "CLIPBOARD",
+ /** Specifies that the offscreen document needs access to localStorage. */
+ LOCAL_STORAGE = "LOCAL_STORAGE",
+ /** Specifies that the offscreen document needs to spawn workers. */
+ WORKERS = "WORKERS",
+ /** Specifies that the offscreen document needs to use navigator.geolocation. */
+ GEOLOCATION = "GEOLOCATION",
+ }
+
+ /** The parameters describing the offscreen document to create. */
+ export interface CreateParameters {
+ /** The reason(s) the extension is creating the offscreen document. */
+ reasons: Reason[];
+ /** The (relative) URL to load in the document. */
+ url: string;
+ /** A developer-provided string that explains, in more detail, the need for the background context. The user agent _may_ use this in display to the user. */
+ justification: string;
+ }
+
+ /**
+ * Creates a new offscreen document for the extension.
+ * @param parameters The parameters describing the offscreen document to create.
+ * @return The `createDocument` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function createDocument(parameters: CreateParameters): Promise<void>;
+ /**
+ * Creates a new offscreen document for the extension.
+ * @param parameters The parameters describing the offscreen document to create.
+ * @param callback Invoked when the offscreen document is created and has completed its initial page load.
+ */
+ export function createDocument(parameters: CreateParameters, callback: () => void): void;
+
+ /**
+ * Closes the currently-open offscreen document for the extension.
+ * @return The `closeDocument` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function closeDocument(): Promise<void>;
+ /**
+ * Closes the currently-open offscreen document for the extension.
+ * @param callback Invoked when the offscreen document has been closed.
+ */
+ export function closeDocument(callback: () => void): void;
+
+ /**
+ * Determines whether the extension has an active document.
+ * @return The `hasDocument` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function hasDocument(): Promise<boolean>;
+ /**
+ * Determines whether the extension has an active document.
+ * @param callback Invoked with the result of whether the extension has an active offscreen document.
+ */
+ export function hasDocument(callback: (result: boolean) => void): void;
+}
+
+////////////////////
+// Omnibox
+////////////////////
+/**
+ * The omnibox API allows you to register a keyword with Google Chrome's address bar, which is also known as the omnibox.
+ * Manifest: "omnibox": {...}
+ * @since Chrome 9.
+ */
+declare namespace chrome.omnibox {
+ /** A suggest result. */
+ export interface SuggestResult {
+ /** The text that is put into the URL bar, and that is sent to the extension when the user chooses this entry. */
+ content: string;
+ /** The text that is displayed in the URL dropdown. Can contain XML-style markup for styling. The supported tags are 'url' (for a literal URL), 'match' (for highlighting text that matched what the user's query), and 'dim' (for dim helper text). The styles can be nested, eg. dimmed match. You must escape the five predefined entities to display them as text: stackoverflow.com/a/1091953/89484 */
+ description: string;
+ /**
+ * Whether the suggest result can be deleted by the user.
+ * @since Chrome 63.
+ */
+ deletable?: boolean | undefined;
+ }
+
+ export interface Suggestion {
+ /** The text that is displayed in the URL dropdown. Can contain XML-style markup for styling. The supported tags are 'url' (for a literal URL), 'match' (for highlighting text that matched what the user's query), and 'dim' (for dim helper text). The styles can be nested, eg. dimmed match. */
+ description: string;
+ }
+
+ /** The window disposition for the omnibox query. This is the recommended context to display results. */
+ export type OnInputEnteredDisposition = "currentTab" | "newForegroundTab" | "newBackgroundTab";
+
+ export interface OmniboxInputEnteredEvent
+ extends chrome.events.Event<(text: string, disposition: OnInputEnteredDisposition) => void>
+ {}
+
+ export interface OmniboxInputChangedEvent
+ extends chrome.events.Event<(text: string, suggest: (suggestResults: SuggestResult[]) => void) => void>
+ {}
+
+ export interface OmniboxInputStartedEvent extends chrome.events.Event<() => void> {}
+
+ export interface OmniboxInputCancelledEvent extends chrome.events.Event<() => void> {}
+
+ export interface OmniboxSuggestionDeletedEvent extends chrome.events.Event<(text: string) => void> {}
+
+ /**
+ * Sets the description and styling for the default suggestion. The default suggestion is the text that is displayed in the first suggestion row underneath the URL bar.
+ * @param suggestion A partial SuggestResult object, without the 'content' parameter.
+ */
+ export function setDefaultSuggestion(suggestion: Suggestion): void;
+
+ /** User has accepted what is typed into the omnibox. */
+ export var onInputEntered: OmniboxInputEnteredEvent;
+ /** User has changed what is typed into the omnibox. */
+ export var onInputChanged: OmniboxInputChangedEvent;
+ /** User has started a keyword input session by typing the extension's keyword. This is guaranteed to be sent exactly once per input session, and before any onInputChanged events. */
+ export var onInputStarted: OmniboxInputStartedEvent;
+ /** User has ended the keyword input session without accepting the input. */
+ export var onInputCancelled: OmniboxInputCancelledEvent;
+ /**
+ * User has deleted a suggested result
+ * @since Chrome 63.
+ */
+ export var onDeleteSuggestion: OmniboxSuggestionDeletedEvent;
+}
+
+////////////////////
+// Page Action
+////////////////////
+/**
+ * Use the chrome.pageAction API to put icons inside the address bar. Page actions represent actions that can be taken on the current page, but that aren't applicable to all pages.
+ * Manifest: "page_action": {...}
+ * @since Chrome 5.
+ */
+declare namespace chrome.pageAction {
+ export interface PageActionClickedEvent extends chrome.events.Event<(tab: chrome.tabs.Tab) => void> {}
+
+ export interface TitleDetails {
+ /** The id of the tab for which you want to modify the page action. */
+ tabId: number;
+ /** The tooltip string. */
+ title: string;
+ }
+
+ export interface GetDetails {
+ /** Specify the tab to get the title from. */
+ tabId: number;
+ }
+
+ export interface PopupDetails {
+ /** The id of the tab for which you want to modify the page action. */
+ tabId: number;
+ /** The html file to show in a popup. If set to the empty string (''), no popup is shown. */
+ popup: string;
+ }
+
+ export interface IconDetails {
+ /** The id of the tab for which you want to modify the page action. */
+ tabId: number;
+ /**
+ * Optional.
+ * @deprecated This argument is ignored.
+ */
+ iconIndex?: number | undefined;
+ /**
+ * Optional.
+ * Either an ImageData object or a dictionary {size -> ImageData} representing icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals scale, then image with size scale * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.imageData = foo' is equivalent to 'details.imageData = {'19': foo}'
+ */
+ imageData?: ImageData | { [index: number]: ImageData } | undefined;
+ /**
+ * Optional.
+ * Either a relative image path or a dictionary {size -> relative image path} pointing to icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals scale, then image with size scale * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.path = foo' is equivalent to 'details.imageData = {'19': foo}'
+ */
+ path?: string | { [index: string]: string } | undefined;
+ }
+
+ /**
+ * Shows the page action. The page action is shown whenever the tab is selected.
+ * @param tabId The id of the tab for which you want to modify the page action.
+ * @param callback Supported since Chrome 67
+ */
+ export function hide(tabId: number, callback?: () => void): void;
+ /**
+ * Shows the page action. The page action is shown whenever the tab is selected.
+ * @param tabId The id of the tab for which you want to modify the page action.
+ * @param callback Supported since Chrome 67
+ */
+ export function show(tabId: number, callback?: () => void): void;
+ /**
+ * Sets the title of the page action. This is displayed in a tooltip over the page action.
+ * @param callback Supported since Chrome 67
+ */
+ export function setTitle(details: TitleDetails, callback?: () => void): void;
+ /**
+ * Sets the html document to be opened as a popup when the user clicks on the page action's icon.
+ * @param callback Supported since Chrome 67
+ */
+ export function setPopup(details: PopupDetails, callback?: () => void): void;
+ /**
+ * Gets the title of the page action.
+ * @since Chrome 19.
+ */
+ export function getTitle(details: GetDetails, callback: (result: string) => void): void;
+ /**
+ * Gets the html document set as the popup for this page action.
+ * @since Chrome 19.
+ */
+ export function getPopup(details: GetDetails, callback: (result: string) => void): void;
+ /**
+ * Sets the icon for the page action. The icon can be specified either as the path to an image file or as the pixel data from a canvas element, or as dictionary of either one of those. Either the path or the imageData property must be specified.
+ */
+ export function setIcon(details: IconDetails, callback?: () => void): void;
+
+ /** Fired when a page action icon is clicked. This event will not fire if the page action has a popup. */
+ export var onClicked: PageActionClickedEvent;
+}
+
+////////////////////
+// Page Capture
+////////////////////
+/**
+ * Use the chrome.pageCapture API to save a tab as MHTML.
+ * Permissions: "pageCapture"
+ * @since Chrome 18.
+ */
+declare namespace chrome.pageCapture {
+ export interface SaveDetails {
+ /** The id of the tab to save as MHTML. */
+ tabId: number;
+ }
+
+ /**
+ * Saves the content of the tab with given id as MHTML.
+ * @param callback Called when the MHTML has been generated.
+ * Parameter mhtmlData: The MHTML data as a Blob.
+ */
+ export function saveAsMHTML(details: SaveDetails, callback: (mhtmlData?: Blob) => void): void;
+}
+
+////////////////////
+// Permissions
+////////////////////
+/**
+ * Use the chrome.permissions API to request declared optional permissions at run time rather than install time, so users understand why the permissions are needed and grant only those that are necessary.
+ * @since Chrome 16.
+ */
+declare namespace chrome.permissions {
+ export interface Permissions {
+ /**
+ * Optional.
+ * List of named permissions (does not include hosts or origins). Anything listed here must appear in the optional_permissions list in the manifest.
+ */
+ permissions?: string[] | undefined;
+ /**
+ * Optional.
+ * List of origin permissions. Anything listed here must be a subset of a host that appears in the optional_permissions list in the manifest. For example, if http://*.example.com/ or http://* appears in optional_permissions, you can request an origin of http://help.example.com/. Any path is ignored.
+ */
+ origins?: string[] | undefined;
+ }
+
+ export interface PermissionsRemovedEvent {
+ addListener(callback: (/** The permissions that have been removed*/ permissions: Permissions) => void): void;
+ }
+
+ export interface PermissionsAddedEvent {
+ addListener(callback: (/** The newly-acquired permissions*/ permissions: Permissions) => void): void;
+ }
+
+ /**
+ * Checks if the extension has the specified permissions.
+ * @return A Promise that resolves with boolean: True if the extension has the specified permissions.
+ */
+ export function contains(permissions: Permissions): Promise<boolean>;
+ /**
+ * Checks if the extension has the specified permissions.
+ * Parameter result: True if the extension has the specified permissions.
+ */
+ export function contains(permissions: Permissions, callback: (result: boolean) => void): void;
+ /**
+ * Gets the extension's current set of permissions.
+ * @return A Promise that resolves with Permissions object describing the extension's active permissions.
+ */
+ export function getAll(): Promise<Permissions>;
+ /**
+ * Gets the extension's current set of permissions.
+ */
+ export function getAll(callback: (permissions: Permissions) => void): void;
+ /**
+ * Requests access to the specified permissions. These permissions must be defined in the optional_permissions field of the manifest. If there are any problems requesting the permissions, runtime.lastError will be set.
+ * @return A Promise that resolves with boolean: True if the user granted the specified permissions.
+ */
+ export function request(permissions: Permissions): Promise<boolean>;
+ /**
+ * Requests access to the specified permissions. These permissions must be defined in the optional_permissions field of the manifest. If there are any problems requesting the permissions, runtime.lastError will be set.
+ * Parameter granted: True if the user granted the specified permissions.
+ */
+ export function request(permissions: Permissions, callback?: (granted: boolean) => void): void;
+ /**
+ * Removes access to the specified permissions. If there are any problems removing the permissions, runtime.lastError will be set.
+ * @return A Promise that resolves with boolean: True if the permissions were removed.
+ */
+ export function remove(permissions: Permissions): Promise<boolean>;
+ /**
+ * Removes access to the specified permissions. If there are any problems removing the permissions, runtime.lastError will be set.
+ * Parameter removed: True if the permissions were removed.
+ */
+ export function remove(permissions: Permissions, callback?: (removed: boolean) => void): void;
+
+ /** Fired when access to permissions has been removed from the extension. */
+ export var onRemoved: PermissionsRemovedEvent;
+ /** Fired when the extension acquires new permissions. */
+ export var onAdded: PermissionsAddedEvent;
+}
+
+////////////////////
+// Platform Keys
+////////////////////
+/**
+ * Use the chrome.platformKeys API to access client certificates managed by the platform. If the user or policy grants the permission, an extension can use such a certficate in its custom authentication protocol. E.g. this allows usage of platform managed certificates in third party VPNs (see chrome.vpnProvider).
+ * Permissions: "platformKeys"
+ * Important: This API works only on Chrome OS.
+ * @since Chrome 45.
+ */
+declare namespace chrome.platformKeys {
+ export interface Match {
+ /** The DER encoding of a X.509 certificate. */
+ certificate: ArrayBuffer;
+ /** The KeyAlgorithm of the certified key. This contains algorithm parameters that are inherent to the key of the certificate (e.g. the key length). Other parameters like the hash function used by the sign function are not included. */
+ keyAlgorithm: KeyAlgorithm;
+ }
+
+ export interface ClientCertificateSelectRequestDetails {
+ /** This field is a list of the types of certificates requested, sorted in order of the server's preference. Only certificates of a type contained in this list will be retrieved. If certificateTypes is the empty list, however, certificates of any type will be returned. */
+ certificateTypes: string[];
+ /** List of distinguished names of certificate authorities allowed by the server. Each entry must be a DER-encoded X.509 DistinguishedName. */
+ certificateAuthorities: ArrayBuffer[];
+ }
+
+ export interface ClientCertificateSelectDetails {
+ /** Only certificates that match this request will be returned. */
+ request: ClientCertificateSelectRequestDetails;
+ /**
+ * Optional.
+ * If given, the selectClientCertificates operates on this list. Otherwise, obtains the list of all certificates from the platform's certificate stores that are available to this extensions. Entries that the extension doesn't have permission for or which doesn't match the request, are removed.
+ */
+ clientCerts?: ArrayBuffer[] | undefined;
+ /** If true, the filtered list is presented to the user to manually select a certificate and thereby granting the extension access to the certificate(s) and key(s). Only the selected certificate(s) will be returned. If is false, the list is reduced to all certificates that the extension has been granted access to (automatically or manually). */
+ interactive: boolean;
+ }
+
+ export interface ServerCertificateVerificationDetails {
+ /** Each chain entry must be the DER encoding of a X.509 certificate, the first entry must be the server certificate and each entry must certify the entry preceding it. */
+ serverCertificateChain: ArrayBuffer[];
+ /** The hostname of the server to verify the certificate for, e.g. the server that presented the serverCertificateChain. */
+ hostname: string;
+ }
+
+ export interface ServerCertificateVerificationResult {
+ /** The result of the trust verification: true if trust for the given verification details could be established and false if trust is rejected for any reason. */
+ trusted: boolean;
+ /**
+ * If the trust verification failed, this array contains the errors reported by the underlying network layer. Otherwise, this array is empty.
+ * Note: This list is meant for debugging only and may not contain all relevant errors. The errors returned may change in future revisions of this API, and are not guaranteed to be forwards or backwards compatible.
+ */
+ debug_errors: string[];
+ }
+
+ /**
+ * This function filters from a list of client certificates the ones that are known to the platform, match request and for which the extension has permission to access the certificate and its private key. If interactive is true, the user is presented a dialog where they can select from matching certificates and grant the extension access to the certificate. The selected/filtered client certificates will be passed to callback.
+ * Parameter matches: The list of certificates that match the request, that the extension has permission for and, if interactive is true, that were selected by the user.
+ */
+ export function selectClientCertificates(
+ details: ClientCertificateSelectDetails,
+ callback: (matches: Match[]) => void,
+ ): void;
+ /**
+ * Passes the key pair of certificate for usage with platformKeys.subtleCrypto to callback.
+ * @param certificate The certificate of a Match returned by selectClientCertificates.
+ * @param parameters Determines signature/hash algorithm parameters additionally to the parameters fixed by the key itself. The same parameters are accepted as by WebCrypto's importKey function, e.g. RsaHashedImportParams for a RSASSA-PKCS1-v1_5 key. For RSASSA-PKCS1-v1_5 keys, additionally the parameters { 'hash': { 'name': 'none' } } are supported. The sign function will then apply PKCS#1 v1.5 padding and but not hash the given data.
+ * @param callback The public and private CryptoKey of a certificate which can only be used with platformKeys.subtleCrypto.
+ * Optional parameter privateKey: Might be null if this extension does not have access to it.
+ */
+ export function getKeyPair(
+ certificate: ArrayBuffer,
+ parameters: Object,
+ callback: (publicKey: CryptoKey, privateKey: CryptoKey | null) => void,
+ ): void;
+ /**
+ * Passes the key pair of publicKeySpkiDer for usage with platformKeys.subtleCrypto to callback.
+ * @param publicKeySpkiDer A DER-encoded X.509 SubjectPublicKeyInfo, obtained e.g. by calling WebCrypto's exportKey function with format="spki".
+ * @param parameters Provides signature and hash algorithm parameters, in addition to those fixed by the key itself. The same parameters are accepted as by WebCrypto's importKey function, e.g. RsaHashedImportParams for a RSASSA-PKCS1-v1_5 key. For RSASSA-PKCS1-v1_5 keys, we need to also pass a "hash" parameter { "hash": { "name": string } }. The "hash" parameter represents the name of the hashing algorithm to be used in the digest operation before a sign. It is possible to pass "none" as the hash name, in which case the sign function will apply PKCS#1 v1.5 padding and but not hash the given data.
+ * Currently, this function only supports the "RSASSA-PKCS1-v1_5" algorithm with one of the hashing algorithms "none", "SHA-1", "SHA-256", "SHA-384", and "SHA-512".
+ * @param callback The public and private CryptoKey of a certificate which can only be used with platformKeys.subtleCrypto.
+ * Optional parameter privateKey: Might be null if this extension does not have access to it.
+ * @since Chrome 85.
+ */
+ export function getKeyPairBySpki(
+ publicKeySpkiDer: ArrayBuffer,
+ parameters: Object,
+ callback: (publicKey: CryptoKey, privateKey: CryptoKey | null) => void,
+ ): void;
+ /** An implementation of WebCrypto's SubtleCrypto that allows crypto operations on keys of client certificates that are available to this extension. */
+ export function subtleCrypto(): SubtleCrypto;
+ /**
+ * Checks whether details.serverCertificateChain can be trusted for details.hostname according to the trust settings of the platform. Note: The actual behavior of the trust verification is not fully specified and might change in the future. The API implementation verifies certificate expiration, validates the certification path and checks trust by a known CA. The implementation is supposed to respect the EKU serverAuth and to support subject alternative names.
+ */
+ export function verifyTLSServerCertificate(
+ details: ServerCertificateVerificationDetails,
+ callback: (result: ServerCertificateVerificationResult) => void,
+ ): void;
+}
+
+////////////////////
+// Power
+////////////////////
+/**
+ * Use the chrome.power API to override the system's power management features.
+ * Permissions: "power"
+ * @since Chrome 27.
+ */
+declare namespace chrome.power {
+ /** Requests that power management be temporarily disabled. |level| describes the degree to which power management should be disabled. If a request previously made by the same app is still active, it will be replaced by the new request. */
+ export function requestKeepAwake(level: string): void;
+ /** Releases a request previously made via requestKeepAwake(). */
+ export function releaseKeepAwake(): void;
+}
+
+////////////////////
+// Printer Provider
+////////////////////
+/**
+ * The chrome.printerProvider API exposes events used by print manager to query printers controlled by extensions, to query their capabilities and to submit print jobs to these printers.
+ * Permissions: "printerProvider"
+ * @since Chrome 44.
+ */
+declare namespace chrome.printerProvider {
+ export interface PrinterInfo {
+ /** Unique printer ID. */
+ id: string;
+ /** Printer's human readable name. */
+ name: string;
+ /** Optional. Printer's human readable description. */
+ description?: string | undefined;
+ }
+
+ export interface PrinterCapabilities {
+ /** Device capabilities in CDD format. */
+ capabilities: any;
+ }
+
+ export interface PrintJob {
+ /** ID of the printer which should handle the job. */
+ printerId: string;
+ /** The print job title. */
+ title: string;
+ /** Print ticket in CJT format. */
+ ticket: Object;
+ /** The document content type. Supported formats are "application/pdf" and "image/pwg-raster". */
+ contentType: string;
+ /** Blob containing the document data to print. Format must match |contentType|. */
+ document: Blob;
+ }
+
+ export interface PrinterRequestedEvent
+ extends chrome.events.Event<(resultCallback: (printerInfo: PrinterInfo[]) => void) => void>
+ {}
+
+ export interface PrinterInfoRequestedEvent
+ extends chrome.events.Event<(device: any, resultCallback: (printerInfo?: PrinterInfo) => void) => void>
+ {}
+
+ export interface CapabilityRequestedEvent extends
+ chrome.events.Event<
+ (printerId: string, resultCallback: (capabilities: PrinterCapabilities) => void) => void
+ >
+ {}
+
+ export interface PrintRequestedEvent
+ extends chrome.events.Event<(printJob: PrintJob, resultCallback: (result: string) => void) => void>
+ {}
+
+ /** Event fired when print manager requests printers provided by extensions. */
+ export var onGetPrintersRequested: PrinterRequestedEvent;
+ /**
+ * Event fired when print manager requests information about a USB device that may be a printer.
+ * Note: An application should not rely on this event being fired more than once per device. If a connected device is supported it should be returned in the onGetPrintersRequested event.
+ * @since Chrome 45.
+ */
+ export var onGetUsbPrinterInfoRequested: PrinterInfoRequestedEvent;
+ /** Event fired when print manager requests printer capabilities. */
+ export var onGetCapabilityRequested: CapabilityRequestedEvent;
+ /** Event fired when print manager requests printing. */
+ export var onPrintRequested: PrintRequestedEvent;
+}
+
+////////////////////
+// Privacy
+////////////////////
+/**
+ * Use the chrome.privacy API to control usage of the features in Chrome that can affect a user's privacy. This API relies on the ChromeSetting prototype of the type API for getting and setting Chrome's configuration.
+ * Permissions: "privacy"
+ * The Chrome Privacy Whitepaper gives background detail regarding the features which this API can control.
+ * @since Chrome 18.
+ */
+declare namespace chrome.privacy {
+ export interface Services {
+ /** since Chrome 20. */
+ spellingServiceEnabled: chrome.types.ChromeSetting;
+ searchSuggestEnabled: chrome.types.ChromeSetting;
+ instantEnabled: chrome.types.ChromeSetting;
+ alternateErrorPagesEnabled: chrome.types.ChromeSetting;
+ safeBrowsingEnabled: chrome.types.ChromeSetting;
+ /** @deprecated since Chrome 70. Please use privacy.services.autofillAddressEnabled and privacy.services.autofillCreditCardEnabled. */
+ autofillEnabled: chrome.types.ChromeSetting;
+ translationServiceEnabled: chrome.types.ChromeSetting;
+ /** @since Chrome 38. */
+ passwordSavingEnabled: chrome.types.ChromeSetting;
+ /** @since Chrome 42. */
+ hotwordSearchEnabled: chrome.types.ChromeSetting;
+ /** @since Chrome 42. */
+ safeBrowsingExtendedReportingEnabled: chrome.types.ChromeSetting;
+ /** @since Chrome 70. */
+ autofillAddressEnabled: chrome.types.ChromeSetting;
+ /** @since Chrome 70. */
+ autofillCreditCardEnabled: chrome.types.ChromeSetting;
+ }
+
+ export interface Network {
+ networkPredictionEnabled: chrome.types.ChromeSetting;
+ /** @deprecated since Chrome 48. Please use privacy.network.webRTCIPHandlingPolicy. */
+ webRTCMultipleRoutesEnabled: chrome.types.ChromeSetting;
+ /** @deprecated since Chrome 48. Please use privacy.network.webRTCIPHandlingPolicy. */
+ webRTCNonProxiedUdpEnabled: chrome.types.ChromeSetting;
+ /** @since Chrome 48. */
+ webRTCIPHandlingPolicy: chrome.types.ChromeSetting;
+ }
+
+ export interface Websites {
+ thirdPartyCookiesAllowed: chrome.types.ChromeSetting;
+ referrersEnabled: chrome.types.ChromeSetting;
+ hyperlinkAuditingEnabled: chrome.types.ChromeSetting;
+ /** @since Chrome 21. Available on Windows and ChromeOS only. */
+ protectedContentEnabled: chrome.types.ChromeSetting;
+ /** @since Chrome 65. */
+ doNotTrackEnabled: chrome.types.ChromeSetting;
+ }
+
+ /** Settings that enable or disable features that require third-party network services provided by Google and your default search provider. */
+ export var services: Services;
+ /** Settings that influence Chrome's handling of network connections in general. */
+ export var network: Network;
+ /** Settings that determine what information Chrome makes available to websites. */
+ export var websites: Websites;
+}
+
+////////////////////
+// Proxy
+////////////////////
+/**
+ * Use the chrome.proxy API to manage Chrome's proxy settings. This API relies on the ChromeSetting prototype of the type API for getting and setting the proxy configuration.
+ * Permissions: "proxy"
+ * @since Chrome 13.
+ */
+declare namespace chrome.proxy {
+ /** An object holding proxy auto-config information. Exactly one of the fields should be non-empty. */
+ export interface PacScript {
+ /** Optional. URL of the PAC file to be used. */
+ url?: string | undefined;
+ /** Optional. If true, an invalid PAC script will prevent the network stack from falling back to direct connections. Defaults to false. */
+ mandatory?: boolean | undefined;
+ /** Optional. A PAC script. */
+ data?: string | undefined;
+ }
+
+ /** An object encapsulating a complete proxy configuration. */
+ export interface ProxyConfig {
+ /** Optional. The proxy rules describing this configuration. Use this for 'fixed_servers' mode. */
+ rules?: ProxyRules | undefined;
+ /** Optional. The proxy auto-config (PAC) script for this configuration. Use this for 'pac_script' mode. */
+ pacScript?: PacScript | undefined;
+ /**
+ * 'direct' = Never use a proxy
+ * 'auto_detect' = Auto detect proxy settings
+ * 'pac_script' = Use specified PAC script
+ * 'fixed_servers' = Manually specify proxy servers
+ * 'system' = Use system proxy settings
+ */
+ mode: string;
+ }
+
+ /** An object encapsulating a single proxy server's specification. */
+ export interface ProxyServer {
+ /** The URI of the proxy server. This must be an ASCII hostname (in Punycode format). IDNA is not supported, yet. */
+ host: string;
+ /** Optional. The scheme (protocol) of the proxy server itself. Defaults to 'http'. */
+ scheme?: string | undefined;
+ /** Optional. The port of the proxy server. Defaults to a port that depends on the scheme. */
+ port?: number | undefined;
+ }
+
+ /** An object encapsulating the set of proxy rules for all protocols. Use either 'singleProxy' or (a subset of) 'proxyForHttp', 'proxyForHttps', 'proxyForFtp' and 'fallbackProxy'. */
+ export interface ProxyRules {
+ /** Optional. The proxy server to be used for FTP requests. */
+ proxyForFtp?: ProxyServer | undefined;
+ /** Optional. The proxy server to be used for HTTP requests. */
+ proxyForHttp?: ProxyServer | undefined;
+ /** Optional. The proxy server to be used for everything else or if any of the specific proxyFor... is not specified. */
+ fallbackProxy?: ProxyServer | undefined;
+ /** Optional. The proxy server to be used for all per-URL requests (that is http, https, and ftp). */
+ singleProxy?: ProxyServer | undefined;
+ /** Optional. The proxy server to be used for HTTPS requests. */
+ proxyForHttps?: ProxyServer | undefined;
+ /** Optional. List of servers to connect to without a proxy server. */
+ bypassList?: string[] | undefined;
+ }
+
+ export interface ErrorDetails {
+ /** Additional details about the error such as a JavaScript runtime error. */
+ details: string;
+ /** The error description. */
+ error: string;
+ /** If true, the error was fatal and the network transaction was aborted. Otherwise, a direct connection is used instead. */
+ fatal: boolean;
+ }
+
+ export interface ProxyErrorEvent extends chrome.events.Event<(details: ErrorDetails) => void> {}
+
+ export var settings: chrome.types.ChromeSetting;
+ /** Notifies about proxy errors. */
+ export var onProxyError: ProxyErrorEvent;
+}
+
+////////////////////
+// Search
+////////////////////
+/**
+ * Use the chrome.search API to search via the default provider.
+ * Permissions: "search"
+ */
+
+declare namespace chrome.search {
+ export type Disposition = "CURRENT_TAB" | "NEW_TAB" | "NEW_WINDOW";
+
+ export interface QueryInfo {
+ /** Location where search results should be displayed. CURRENT_TAB is the default. */
+ disposition?: Disposition | undefined;
+ /** Location where search results should be displayed. tabIdcannot be used with disposition. */
+ tabId?: number | undefined;
+ /** String to query with the default search provider. */
+ text?: string | undefined;
+ }
+
+ /**
+ * Used to query the default search provider. In case of an error, runtime.lastError will be set.
+ * @param options search configuration options.
+ */
+ export function query(options: QueryInfo, callback: () => void): void;
+
+ /**
+ * Used to query the default search provider. In case of an error, runtime.lastError will be set.
+ * @param options search configuration options.
+ * @return The `query` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function query(options: QueryInfo): Promise<void>;
+}
+
+////////////////////
+// Serial
+////////////////////
+/**
+ * Use the <code>chrome.serial</code> API to read from and write to a device connected to a serial port.
+ * Permissions: "enterprise.serial"
+ * Since: Chrome 29
+ * Important: This API works only on Chrome OS.
+ */
+declare namespace chrome.serial {
+ export const DataBits: {
+ SEVEN: "seven";
+ EIGHT: "eight";
+ };
+ export const ParityBit: {
+ NO: "no";
+ ODD: "odd";
+ EVEN: "even";
+ };
+ export const StopBits: {
+ ONE: "one";
+ TWO: "two";
+ };
+
+ export interface DeviceInfo {
+ /** The device's system path. This should be passed as the path argument to chrome.serial.connect in order to connect to this device. */
+ path: string;
+ /** Optional. A PCI or USB vendor ID if one can be determined for the underlying device. */
+ vendorId?: number | undefined;
+ /** Optional. A USB product ID if one can be determined for the underlying device. */
+ productId?: number | undefined;
+ /** Optional. A human-readable display name for the underlying device if one can be queried from the host driver. */
+ displayName?: number | undefined;
+ }
+
+ export interface ConnectionInfo {
+ /** The id of the serial port connection. */
+ connectionId?: number | undefined;
+ /** Flag indicating whether the connection is blocked from firing onReceive events. */
+ paused: boolean;
+ /** See ConnectionOptions.persistent */
+ persistent: boolean;
+ /** See ConnectionOptions.name */
+ name: string;
+ /** See ConnectionOptions.bufferSize */
+ bufferSize: number;
+ /** See ConnectionOptions.receiveTimeout */
+ receiveTimeout?: number | undefined;
+ /** See ConnectionOptions.sendTimeout */
+ sendTimeout?: number | undefined;
+ /** Optional. See ConnectionOptions.bitrate.
+ * This field may be omitted or inaccurate if a non-standard bitrate is in use, or if an error occurred while querying the underlying device. */
+ bitrate?: number | undefined;
+ /** Optional. See ConnectionOptions.dataBits. This field may be omitted if an error occurred while querying the underlying device. */
+ dataBits?: typeof DataBits[keyof typeof DataBits] | undefined;
+ /** Optional. See ConnectionOptions.parityBit. This field may be omitted if an error occurred while querying the underlying device. */
+ parityBit?: typeof ParityBit[keyof typeof ParityBit] | undefined;
+ /** Optional. See ConnectionOptions.stopBits. This field may be omitted if an error occurred while querying the underlying device. */
+ stopBits?: typeof StopBits[keyof typeof StopBits] | undefined;
+ /** Optional. Flag indicating whether or not to enable RTS/CTS hardware flow control. Defaults to false. */
+ ctsFlowControl?: boolean | undefined;
+ }
+
+ export interface ConnectionOptions {
+ /** Optional. Flag indicating whether or not the connection should be left open when the application is suspended (see Manage App Lifecycle: https://developer.chrome.com/apps/app_lifecycle).
+ * The default value is "false." When the application is loaded, any serial connections previously opened with persistent=true can be fetched with getConnections. */
+ persistent?: boolean | undefined;
+ /** Optional. An application-defined string to associate with the connection. */
+ name?: string | undefined;
+ /** Optional. The size of the buffer used to receive data. The default value is 4096. */
+ bufferSize?: number | undefined;
+ /** Optional. The requested bitrate of the connection to be opened.
+ * For compatibility with the widest range of hardware, this number should match one of commonly-available bitrates,
+ * such as 110, 300, 1200, 2400, 4800, 9600, 14400, 19200, 38400, 57600, 115200.
+ * There is no guarantee, of course, that the device connected to the serial port will support the requested bitrate, even if the port itself supports that bitrate.
+ * 9600 will be passed by default. */
+ bitrate?: number | undefined;
+ /** Optional. "eight" will be passed by default. */
+ dataBits?: typeof DataBits[keyof typeof DataBits] | undefined;
+ /** Optional. "no" will be passed by default. */
+ parityBit?: typeof ParityBit[keyof typeof ParityBit] | undefined;
+ /** Optional. "one" will be passed by default. */
+ stopBits?: typeof StopBits[keyof typeof StopBits] | undefined;
+ /** Optional. Flag indicating whether or not to enable RTS/CTS hardware flow control. Defaults to false. */
+ ctsFlowControl?: boolean | undefined;
+ /** Optional. The maximum amount of time (in milliseconds) to wait for new data before raising an onReceiveError event with a "timeout" error.
+ * If zero, receive timeout errors will not be raised for the connection.
+ * Defaults to 0. */
+ receiveTimeout?: number | undefined;
+ /** Optional. The maximum amount of time (in milliseconds) to wait for a send operation to complete before calling the callback with a "timeout" error.
+ * If zero, send timeout errors will not be triggered.
+ * Defaults to 0. */
+ sendTimeout?: number | undefined;
+ }
+
+ /**
+ * @since Chrome 33.
+ * @description Returns information about available serial devices on the system. The list is regenerated each time this method is called.
+ * @param callback Called with the list of DeviceInfo objects.
+ */
+ export function getDevices(callback: (ports: DeviceInfo[]) => void): void;
+
+ /**
+ * @since Chrome 33.
+ * @description Connects to a given serial port.
+ * @param path The system path of the serial port to open.
+ * @param options Port configuration options.
+ * @param callback Called when the connection has been opened.
+ */
+ export function connect(
+ path: string,
+ options: ConnectionOptions,
+ callback: (connectionInfo: ConnectionInfo) => void,
+ ): void;
+
+ /**
+ * @since Chrome 33.
+ * @description Update the option settings on an open serial port connection.
+ * @param connectionId The id of the opened connection.
+ * @param options Port configuration options.
+ * @param callback Called when the configuration has completed.
+ */
+ export function update(connectionId: number, options: ConnectionOptions, callback: (result: boolean) => void): void;
+
+ /**
+ * @since Chrome 33.
+ * @description Disconnects from a serial port.
+ * @param connectionId The id of the opened connection.
+ * @param callback Called when the connection has been closed.
+ */
+ export function disconnect(connectionId: number, callback: (result: boolean) => void): void;
+
+ /**
+ * @since Chrome 33.
+ * @description Pauses or unpauses an open connection.
+ * @param connectionId The id of the opened connection.
+ * @param paused Flag to indicate whether to pause or unpause.
+ * @param callback Called when the connection has been successfully paused or unpaused.
+ */
+ export function setPaused(connectionId: number, paused: boolean, callback: () => void): void;
+
+ /**
+ * @since Chrome 33.
+ * @description Retrieves the state of a given connection.
+ * @param callback Called with connection state information when available.
+ */
+ export function getInfo(callback: (connectionInfos: ConnectionInfo[]) => void): void;
+
+ /**
+ * @since Chrome 33.
+ * @description Retrieves the list of currently opened serial port connections owned by the application.
+ * @param callback Called with the list of connections when available.
+ */
+ export function getConnections(callback: (connectionInfos: ConnectionInfo[]) => void): void;
+
+ /**
+ * @since Chrome 33.
+ * @description Writes data to the given connection.
+ * @param connectionId The id of the connection.
+ * @param data The data to send.
+ * @param callback Called when the operation has completed.
+ */
+ export function send(connectionId: number, data: ArrayBuffer, callback: (sendInfo: object) => void): void;
+
+ /**
+ * @description Flushes all bytes in the given connection's input and output buffers.
+ * @param connectionId The id of the connection.
+ * @param callback
+ */
+ export function flush(connectionId: number, callback: (result: boolean) => void): void;
+
+ /**
+ * @description Retrieves the state of control signals on a given connection.
+ * @param connectionId The id of the connection.
+ * @param callback Called when the control signals are available.
+ */
+ export function getControlSignals(connectionId: number, callback: (signals: object) => void): void;
+
+ /**
+ * @description Sets the state of control signals on a given connection.
+ * @param connectionId The id of the connection.
+ * @param signals The set of signal changes to send to the device:
+ * boolean: (optional) dtr - DTR (Data Terminal Ready).
+ * boolean: (optional) rts - RTS (Request To Send).
+ * @param callback Called once the control signals have been set.
+ */
+ export function setControlSignals(connectionId: number, signals: object, callback: (result: boolean) => void): void;
+
+ /**
+ * @since Chrome 45.
+ * @description Suspends character transmission on a given connection and places the transmission line in a break state until the clearBreak is called.
+ * @param connectionId The id of the connection.
+ * @param callback
+ */
+ export function setBreak(connectionId: number, callback: (result: boolean) => void): void;
+
+ /**
+ * @since Chrome 45.
+ * @description Restore character transmission on a given connection and place the transmission line in a nonbreak state.
+ * @param connectionId The id of the connection.
+ * @param callback
+ */
+ export function clearBreak(connectionId: number, callback: (result: boolean) => void): void;
+}
+
+declare namespace chrome.serial.onReceive {
+ export interface OnReceiveInfo {
+ /** The connection identifier. */
+ connectionId: number;
+ /** The data received. */
+ data: ArrayBuffer;
+ }
+
+ /**
+ * @since Chrome 33.
+ * @description Event raised when data has been read from the connection.
+ * @param callback
+ */
+ export function addListener(callback: (info: OnReceiveInfo) => void): void;
+}
+
+declare namespace chrome.serial.onReceiveError {
+ export const OnReceiveErrorEnum: {
+ /* The connection was disconnected. */
+ disconnected: "disconnected";
+ /* No data has been received for receiveTimeout milliseconds. */
+ timeout: "timeout";
+ /* The device was most likely disconnected from the host. */
+ device_lost: "device_lost";
+ /* The device detected a break condition. */
+ break: "break";
+ /* The device detected a framing error. */
+ frame_error: "frame_error";
+ /* A character-buffer overrun has occurred. The next character is lost. */
+ overrun: "overrun";
+ /* An input buffer overflow has occurred. There is either no room in the input buffer, or a character was received after the end-of-file (EOF) character. */
+ buffer_overflow: "buffer_overflow";
+ /* The device detected a parity error. */
+ parity_error: "parity_error";
+ /* A system error occurred and the connection may be unrecoverable. */
+ system_error: "system_error";
+ };
+
+ export interface OnReceiveErrorInfo {
+ /** The connection identifier. */
+ connectionId: number;
+ /** The data received. */
+ error: ArrayBuffer;
+ }
+
+ /**
+ * @since Chrome 33.
+ * @description Event raised when an error occurred while the runtime was waiting for data on the serial port.
+ * Once this event is raised, the connection may be set to paused. A "timeout" error does not pause the connection.
+ * @param callback
+ */
+ export function addListener(callback: (info: OnReceiveErrorInfo) => void): void;
+}
+
+type DocumentLifecycle = "prerender" | "active" | "cached" | "pending_deletion";
+type FrameType = "outermost_frame" | "fenced_frame" | "sub_frame";
+
+////////////////////
+// Runtime
+////////////////////
+/**
+ * Use the chrome.runtime API to retrieve the background page, return details about the manifest, and listen for and respond to events in the app or extension lifecycle. You can also use this API to convert the relative path of URLs to fully-qualified URLs.
+ * @since Chrome 22
+ */
+declare namespace chrome.runtime {
+ /** This will be defined during an API method callback if there was an error */
+ export var lastError: LastError | undefined;
+ /** The ID of the extension/app. */
+ export var id: string;
+
+ /** https://developer.chrome.com/docs/extensions/reference/runtime/#type-PlatformOs */
+ export type PlatformOs = "mac" | "win" | "android" | "cros" | "linux" | "openbsd";
+ /** https://developer.chrome.com/docs/extensions/reference/runtime/#type-PlatformArch */
+ export type PlatformArch = "arm" | "arm64" | "x86-32" | "x86-64" | "mips" | "mips64";
+ /** https://developer.chrome.com/docs/extensions/reference/runtime/#type-PlatformNaclArch */
+ export type PlatformNaclArch = "arm" | "x86-32" | "x86-64" | "mips" | "mips64";
+ /** https://developer.chrome.com/docs/extensions/reference/runtime/#type-OnInstalledReason */
+ export enum OnInstalledReason {
+ INSTALL = "install",
+ UPDATE = "update",
+ CHROME_UPDATE = "chrome_update",
+ SHARED_MODULE_UPDATE = "shared_module_update",
+ }
+
+ export interface LastError {
+ /** Optional. Details about the error which occurred. */
+ message?: string | undefined;
+ }
+
+ export interface ConnectInfo {
+ name?: string | undefined;
+ includeTlsChannelId?: boolean | undefined;
+ }
+
+ export interface InstalledDetails {
+ /**
+ * The reason that this event is being dispatched.
+ */
+ reason: OnInstalledReason;
+ /**
+ * Optional.
+ * Indicates the previous version of the extension, which has just been updated. This is present only if 'reason' is 'update'.
+ */
+ previousVersion?: string | undefined;
+ /**
+ * Optional.
+ * Indicates the ID of the imported shared module extension which updated. This is present only if 'reason' is 'shared_module_update'.
+ * @since Chrome 29.
+ */
+ id?: string | undefined;
+ }
+
+ export interface MessageOptions {
+ /** Whether the TLS channel ID will be passed into onMessageExternal for processes that are listening for the connection event. */
+ includeTlsChannelId?: boolean | undefined;
+ }
+
+ /**
+ * An object containing information about the script context that sent a message or request.
+ * @since Chrome 26.
+ */
+ export interface MessageSender {
+ /** The ID of the extension or app that opened the connection, if any. */
+ id?: string | undefined;
+ /** The tabs.Tab which opened the connection, if any. This property will only be present when the connection was opened from a tab (including content scripts), and only if the receiver is an extension, not an app. */
+ tab?: chrome.tabs.Tab | undefined;
+ /** The name of the native application that opened the connection, if any.
+ * @since Chrome 74
+ */
+ nativeApplication?: string | undefined;
+ /**
+ * The frame that opened the connection. 0 for top-level frames, positive for child frames. This will only be set when tab is set.
+ * @since Chrome 41.
+ */
+ frameId?: number | undefined;
+ /**
+ * The URL of the page or frame that opened the connection. If the sender is in an iframe, it will be iframe's URL not the URL of the page which hosts it.
+ * @since Chrome 28.
+ */
+ url?: string | undefined;
+ /**
+ * The TLS channel ID of the page or frame that opened the connection, if requested by the extension or app, and if available.
+ * @since Chrome 32.
+ */
+ tlsChannelId?: string | undefined;
+ /**
+ * The origin of the page or frame that opened the connection. It can vary from the url property (e.g., about:blank) or can be opaque (e.g., sandboxed iframes). This is useful for identifying if the origin can be trusted if we can't immediately tell from the URL.
+ * @since Chrome 80.
+ */
+ origin?: string | undefined;
+ /**
+ * The lifecycle the document that opened the connection is in at the time the port was created. Note that the lifecycle state of the document may have changed since port creation.
+ * @since Chrome 106.
+ */
+ documentLifecycle?: DocumentLifecycle | undefined;
+ /**
+ * A UUID of the document that opened the connection.
+ * @since Chrome 106.
+ */
+ documentId?: string | undefined;
+ }
+
+ /**
+ * An object containing information about the current platform.
+ * @since Chrome 36.
+ */
+ export interface PlatformInfo {
+ /**
+ * The operating system chrome is running on.
+ */
+ os: PlatformOs;
+ /**
+ * The machine's processor architecture.
+ */
+ arch: PlatformArch;
+ /**
+ * The native client architecture. This may be different from arch on some platforms.
+ */
+ nacl_arch: PlatformNaclArch;
+ }
+
+ /**
+ * An object which allows two way communication with other pages.
+ * @since Chrome 26.
+ */
+ export interface Port {
+ postMessage: (message: any) => void;
+ disconnect: () => void;
+ /**
+ * Optional.
+ * This property will only be present on ports passed to onConnect/onConnectExternal listeners.
+ */
+ sender?: MessageSender | undefined;
+ /** An object which allows the addition and removal of listeners for a Chrome event. */
+ onDisconnect: PortDisconnectEvent;
+ /** An object which allows the addition and removal of listeners for a Chrome event. */
+ onMessage: PortMessageEvent;
+ name: string;
+ }
+
+ export interface UpdateAvailableDetails {
+ /** The version number of the available update. */
+ version: string;
+ }
+
+ export interface UpdateCheckDetails {
+ /** The version of the available update. */
+ version: string;
+ }
+
+ /** Result of the update check. */
+ export type RequestUpdateCheckStatus = "throttled" | "no_update" | "update_available";
+
+ /** Result of the update check. */
+ export interface RequestUpdateCheckResult {
+ /** The status of the update check. */
+ status: RequestUpdateCheckStatus;
+ /** The version of the available update. */
+ version: string;
+ }
+
+ export interface PortDisconnectEvent extends chrome.events.Event<(port: Port) => void> {}
+
+ export interface PortMessageEvent extends chrome.events.Event<(message: any, port: Port) => void> {}
+
+ export interface ExtensionMessageEvent extends
+ chrome.events.Event<
+ (message: any, sender: MessageSender, sendResponse: (response?: any) => void) => void
+ >
+ {}
+
+ export interface ExtensionConnectEvent extends chrome.events.Event<(port: Port) => void> {}
+
+ export interface RuntimeInstalledEvent extends chrome.events.Event<(details: InstalledDetails) => void> {}
+
+ export interface RuntimeEvent extends chrome.events.Event<() => void> {}
+
+ export interface RuntimeRestartRequiredEvent extends chrome.events.Event<(reason: string) => void> {}
+
+ export interface RuntimeUpdateAvailableEvent
+ extends chrome.events.Event<(details: UpdateAvailableDetails) => void>
+ {}
+
+ export interface ManifestIcons {
+ [size: number]: string;
+ }
+
+ export interface ManifestAction {
+ default_icon?: ManifestIcons | undefined;
+ default_title?: string | undefined;
+ default_popup?: string | undefined;
+ }
+
+ // Source: https://developer.chrome.com/docs/extensions/mv3/declare_permissions/
+ export type ManifestPermissions =
+ | "activeTab"
+ | "alarms"
+ | "background"
+ | "bookmarks"
+ | "browsingData"
+ | "certificateProvider"
+ | "clipboardRead"
+ | "clipboardWrite"
+ | "contentSettings"
+ | "contextMenus"
+ | "cookies"
+ | "debugger"
+ | "declarativeContent"
+ | "declarativeNetRequest"
+ | "declarativeNetRequestFeedback"
+ | "declarativeNetRequestWithHostAccess"
+ | "declarativeWebRequest"
+ | "desktopCapture"
+ | "documentScan"
+ | "downloads"
+ | "downloads.shelf"
+ | "downloads.ui"
+ | "enterprise.deviceAttributes"
+ | "enterprise.hardwarePlatform"
+ | "enterprise.networkingAttributes"
+ | "enterprise.platformKeys"
+ | "experimental"
+ | "favicon"
+ | "fileBrowserHandler"
+ | "fileSystemProvider"
+ | "fontSettings"
+ | "gcm"
+ | "geolocation"
+ | "history"
+ | "identity"
+ | "identity.email"
+ | "idle"
+ | "loginState"
+ | "management"
+ | "nativeMessaging"
+ | "notifications"
+ | "offscreen"
+ | "pageCapture"
+ | "platformKeys"
+ | "power"
+ | "printerProvider"
+ | "printing"
+ | "printingMetrics"
+ | "privacy"
+ | "processes"
+ | "proxy"
+ | "scripting"
+ | "search"
+ | "sessions"
+ | "sidePanel"
+ | "signedInDevices"
+ | "storage"
+ | "system.cpu"
+ | "system.display"
+ | "system.memory"
+ | "system.storage"
+ | "tabCapture"
+ | "tabGroups"
+ | "tabs"
+ | "topSites"
+ | "tts"
+ | "ttsEngine"
+ | "unlimitedStorage"
+ | "vpnProvider"
+ | "wallpaper"
+ | "webNavigation"
+ | "webRequest"
+ | "webRequestBlocking";
+
+ export interface SearchProvider {
+ name?: string | undefined;
+ keyword?: string | undefined;
+ favicon_url?: string | undefined;
+ search_url: string;
+ encoding?: string | undefined;
+ suggest_url?: string | undefined;
+ instant_url?: string | undefined;
+ image_url?: string | undefined;
+ search_url_post_params?: string | undefined;
+ suggest_url_post_params?: string | undefined;
+ instant_url_post_params?: string | undefined;
+ image_url_post_params?: string | undefined;
+ alternate_urls?: string[] | undefined;
+ prepopulated_id?: number | undefined;
+ is_default?: boolean | undefined;
+ }
+
+ export interface ManifestBase {
+ // Required
+ manifest_version: number;
+ name: string;
+ version: string;
+
+ // Recommended
+ default_locale?: string | undefined;
+ description?: string | undefined;
+ icons?: ManifestIcons | undefined;
+
+ // Optional
+ author?: string | undefined;
+ background_page?: string | undefined;
+ chrome_settings_overrides?: {
+ homepage?: string | undefined;
+ search_provider?: SearchProvider | undefined;
+ startup_pages?: string[] | undefined;
+ } | undefined;
+ chrome_ui_overrides?: {
+ bookmarks_ui?: {
+ remove_bookmark_shortcut?: boolean | undefined;
+ remove_button?: boolean | undefined;
+ } | undefined;
+ } | undefined;
+ chrome_url_overrides?: {
+ bookmarks?: string | undefined;
+ history?: string | undefined;
+ newtab?: string | undefined;
+ } | undefined;
+ commands?: {
+ [name: string]: {
+ suggested_key?: {
+ default?: string | undefined;
+ windows?: string | undefined;
+ mac?: string | undefined;
+ chromeos?: string | undefined;
+ linux?: string | undefined;
+ } | undefined;
+ description?: string | undefined;
+ global?: boolean | undefined;
+ };
+ } | undefined;
+ content_capabilities?: {
+ matches?: string[] | undefined;
+ permissions?: string[] | undefined;
+ } | undefined;
+ content_scripts?: {
+ matches?: string[] | undefined;
+ exclude_matches?: string[] | undefined;
+ css?: string[] | undefined;
+ js?: string[] | undefined;
+ run_at?: string | undefined;
+ all_frames?: boolean | undefined;
+ match_about_blank?: boolean | undefined;
+ include_globs?: string[] | undefined;
+ exclude_globs?: string[] | undefined;
+ }[] | undefined;
+ converted_from_user_script?: boolean | undefined;
+ current_locale?: string | undefined;
+ devtools_page?: string | undefined;
+ event_rules?: {
+ event?: string | undefined;
+ actions?: {
+ type: string;
+ }[] | undefined;
+ conditions?: chrome.declarativeContent.PageStateMatcherProperties[] | undefined;
+ }[] | undefined;
+ externally_connectable?: {
+ ids?: string[] | undefined;
+ matches?: string[] | undefined;
+ accepts_tls_channel_id?: boolean | undefined;
+ } | undefined;
+ file_browser_handlers?: {
+ id?: string | undefined;
+ default_title?: string | undefined;
+ file_filters?: string[] | undefined;
+ }[] | undefined;
+ file_system_provider_capabilities?: {
+ configurable?: boolean | undefined;
+ watchable?: boolean | undefined;
+ multiple_mounts?: boolean | undefined;
+ source?: string | undefined;
+ } | undefined;
+ homepage_url?: string | undefined;
+ import?: {
+ id: string;
+ minimum_version?: string | undefined;
+ }[] | undefined;
+ export?: {
+ whitelist?: string[] | undefined;
+ } | undefined;
+ incognito?: string | undefined;
+ input_components?: {
+ name?: string | undefined;
+ type?: string | undefined;
+ id?: string | undefined;
+ description?: string | undefined;
+ language?: string[] | string | undefined;
+ layouts?: string[] | undefined;
+ indicator?: string | undefined;
+ }[] | undefined;
+ key?: string | undefined;
+ minimum_chrome_version?: string | undefined;
+ nacl_modules?: {
+ path: string;
+ mime_type: string;
+ }[] | undefined;
+ oauth2?: {
+ client_id: string;
+ scopes?: string[] | undefined;
+ } | undefined;
+ offline_enabled?: boolean | undefined;
+ omnibox?: {
+ keyword: string;
+ } | undefined;
+ options_page?: string | undefined;
+ options_ui?: {
+ page?: string | undefined;
+ chrome_style?: boolean | undefined;
+ open_in_tab?: boolean | undefined;
+ } | undefined;
+ platforms?: {
+ nacl_arch?: string | undefined;
+ sub_package_path: string;
+ }[] | undefined;
+ plugins?: {
+ path: string;
+ }[] | undefined;
+ requirements?: {
+ "3D"?: {
+ features?: string[] | undefined;
+ } | undefined;
+ plugins?: {
+ npapi?: boolean | undefined;
+ } | undefined;
+ } | undefined;
+ sandbox?: {
+ pages: string[];
+ content_security_policy?: string | undefined;
+ } | undefined;
+ short_name?: string | undefined;
+ spellcheck?: {
+ dictionary_language?: string | undefined;
+ dictionary_locale?: string | undefined;
+ dictionary_format?: string | undefined;
+ dictionary_path?: string | undefined;
+ } | undefined;
+ storage?: {
+ managed_schema: string;
+ } | undefined;
+ tts_engine?: {
+ voices: {
+ voice_name: string;
+ lang?: string | undefined;
+ gender?: string | undefined;
+ event_types?: string[] | undefined;
+ }[];
+ } | undefined;
+ update_url?: string | undefined;
+ version_name?: string | undefined;
+ [key: string]: any;
+ }
+
+ export interface ManifestV2 extends ManifestBase {
+ // Required
+ manifest_version: 2;
+
+ // Pick one (or none)
+ browser_action?: ManifestAction | undefined;
+ page_action?: ManifestAction | undefined;
+
+ // Optional
+ background?:
+ | {
+ scripts?: string[] | undefined;
+ page?: string | undefined;
+ persistent?: boolean | undefined;
+ }
+ | undefined;
+ content_security_policy?: string | undefined;
+ optional_permissions?: string[] | undefined;
+ permissions?: string[] | undefined;
+ web_accessible_resources?: string[] | undefined;
+ }
+
+ export interface ManifestV3 extends ManifestBase {
+ // Required
+ manifest_version: 3;
+
+ // Optional
+ action?: ManifestAction | undefined;
+ background?:
+ | {
+ service_worker: string;
+ type?: "module"; // If the service worker uses ES modules
+ }
+ | undefined;
+ content_scripts?: {
+ matches?: string[] | undefined;
+ exclude_matches?: string[] | undefined;
+ css?: string[] | undefined;
+ js?: string[] | undefined;
+ run_at?: string | undefined;
+ all_frames?: boolean | undefined;
+ match_about_blank?: boolean | undefined;
+ include_globs?: string[] | undefined;
+ exclude_globs?: string[] | undefined;
+ world?: "ISOLATED" | "MAIN" | undefined;
+ }[] | undefined;
+ content_security_policy?: {
+ extension_pages?: string;
+ sandbox?: string;
+ };
+ host_permissions?: string[] | undefined;
+ optional_permissions?: ManifestPermissions[] | undefined;
+ permissions?: ManifestPermissions[] | undefined;
+ web_accessible_resources?: { resources: string[]; matches: string[] }[] | undefined;
+ }
+
+ export type Manifest = ManifestV2 | ManifestV3;
+
+ /**
+ * Attempts to connect to connect listeners within an extension/app (such as the background page), or other extensions/apps. This is useful for content scripts connecting to their extension processes, inter-app/extension communication, and web messaging. Note that this does not connect to any listeners in a content script. Extensions may connect to content scripts embedded in tabs via tabs.connect.
+ * @since Chrome 26.
+ */
+ export function connect(connectInfo?: ConnectInfo): Port;
+ /**
+ * Attempts to connect to connect listeners within an extension/app (such as the background page), or other extensions/apps. This is useful for content scripts connecting to their extension processes, inter-app/extension communication, and web messaging. Note that this does not connect to any listeners in a content script. Extensions may connect to content scripts embedded in tabs via tabs.connect.
+ * @since Chrome 26.
+ * @param extensionId Optional.
+ * The ID of the extension or app to connect to. If omitted, a connection will be attempted with your own extension. Required if sending messages from a web page for web messaging.
+ */
+ export function connect(extensionId: string, connectInfo?: ConnectInfo): Port;
+ /**
+ * Connects to a native application in the host machine.
+ * @since Chrome 28.
+ * @param application The name of the registered application to connect to.
+ */
+ export function connectNative(application: string): Port;
+ /** Retrieves the JavaScript 'window' object for the background page running inside the current extension/app. If the background page is an event page, the system will ensure it is loaded before calling the callback. If there is no background page, an error is set. */
+ export function getBackgroundPage(callback: (backgroundPage?: Window) => void): void;
+ /**
+ * Returns details about the app or extension from the manifest. The object returned is a serialization of the full manifest file.
+ * @return The manifest details.
+ */
+ export function getManifest(): Manifest;
+ /**
+ * Returns a DirectoryEntry for the package directory.
+ * @since Chrome 29.
+ */
+ export function getPackageDirectoryEntry(callback: (directoryEntry: DirectoryEntry) => void): void;
+ /**
+ * Returns information about the current platform.
+ * @since Chrome 29.
+ * @param callback Called with results
+ */
+ export function getPlatformInfo(callback: (platformInfo: PlatformInfo) => void): void;
+ /**
+ * Returns information about the current platform.
+ * @since Chrome 29.
+ * @return The `getPlatformInfo` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function getPlatformInfo(): Promise<PlatformInfo>;
+ /**
+ * Converts a relative path within an app/extension install directory to a fully-qualified URL.
+ * @param path A path to a resource within an app/extension expressed relative to its install directory.
+ */
+ export function getURL(path: string): string;
+ /**
+ * Reloads the app or extension.
+ * @since Chrome 25.
+ */
+ export function reload(): void;
+ /**
+ * Requests an update check for this app/extension.
+ * @since Chrome 109
+ * @return This only returns a Promise when the callback parameter is not specified, and with MV3+.
+ */
+ export function requestUpdateCheck(): Promise<RequestUpdateCheckResult>;
+ /**
+ * Requests an update check for this app/extension.
+ * @since Chrome 25.
+ * @param callback
+ * Parameter status: Result of the update check. One of: "throttled", "no_update", or "update_available"
+ * Optional parameter details: If an update is available, this contains more information about the available update.
+ */
+ export function requestUpdateCheck(
+ callback: (status: RequestUpdateCheckStatus, details?: UpdateCheckDetails) => void,
+ ): void;
+ /**
+ * Restart the ChromeOS device when the app runs in kiosk mode. Otherwise, it's no-op.
+ * @since Chrome 32.
+ */
+ export function restart(): void;
+ /**
+ * Restart the ChromeOS device when the app runs in kiosk mode after the
+ * given seconds. If called again before the time ends, the reboot will
+ * be delayed. If called with a value of -1, the reboot will be
+ * cancelled. It's a no-op in non-kiosk mode. It's only allowed to be
+ * called repeatedly by the first extension to invoke this API.
+ * @since Chrome 53.
+ * @param seconds
+ * @param callback
+ */
+ export function restartAfterDelay(seconds: number, callback?: () => void): void;
+ /**
+ * Sends a single message to event listeners within your extension/app or a different extension/app. Similar to runtime.connect but only sends a single message, with an optional response. If sending to your extension, the runtime.onMessage event will be fired in each page, or runtime.onMessageExternal, if a different extension. Note that extensions cannot send messages to content scripts using this method. To send messages to content scripts, use tabs.sendMessage.
+ * @since Chrome 26.
+ * Parameter response: The JSON response object sent by the handler of the message. If an error occurs while connecting to the extension, the callback will be called with no arguments and runtime.lastError will be set to the error message.
+ */
+ export function sendMessage<M = any, R = any>(message: M, responseCallback: (response: R) => void): void;
+ /**
+ * Sends a single message to event listeners within your extension/app or a different extension/app. Similar to runtime.connect but only sends a single message, with an optional response. If sending to your extension, the runtime.onMessage event will be fired in each page, or runtime.onMessageExternal, if a different extension. Note that extensions cannot send messages to content scripts using this method. To send messages to content scripts, use tabs.sendMessage.
+ * @since Chrome 32.
+ * Parameter response: The JSON response object sent by the handler of the message. If an error occurs while connecting to the extension, the callback will be called with no arguments and runtime.lastError will be set to the error message.
+ */
+ export function sendMessage<M = any, R = any>(
+ message: M,
+ options: MessageOptions,
+ responseCallback: (response: R) => void,
+ ): void;
+ /**
+ * Sends a single message to event listeners within your extension/app or a different extension/app. Similar to runtime.connect but only sends a single message, with an optional response. If sending to your extension, the runtime.onMessage event will be fired in each page, or runtime.onMessageExternal, if a different extension. Note that extensions cannot send messages to content scripts using this method. To send messages to content scripts, use tabs.sendMessage.
+ * @since Chrome 26.
+ * @param extensionId The ID of the extension/app to send the message to. If omitted, the message will be sent to your own extension/app. Required if sending messages from a web page for web messaging.
+ * Parameter response: The JSON response object sent by the handler of the message. If an error occurs while connecting to the extension, the callback will be called with no arguments and runtime.lastError will be set to the error message.
+ */
+ export function sendMessage<M = any, R = any>(
+ extensionId: string | undefined | null,
+ message: M,
+ responseCallback: (response: R) => void,
+ ): void;
+ /**
+ * Sends a single message to event listeners within your extension/app or a different extension/app. Similar to runtime.connect but only sends a single message, with an optional response. If sending to your extension, the runtime.onMessage event will be fired in each page, or runtime.onMessageExternal, if a different extension. Note that extensions cannot send messages to content scripts using this method. To send messages to content scripts, use tabs.sendMessage.
+ * @since Chrome 32.
+ * @param extensionId The ID of the extension/app to send the message to. If omitted, the message will be sent to your own extension/app. Required if sending messages from a web page for web messaging.
+ * Parameter response: The JSON response object sent by the handler of the message. If an error occurs while connecting to the extension, the callback will be called with no arguments and runtime.lastError will be set to the error message.
+ */
+ export function sendMessage<Message = any, Response = any>(
+ extensionId: string | undefined | null,
+ message: Message,
+ options: MessageOptions,
+ responseCallback: (response: Response) => void,
+ ): void;
+ /**
+ * Sends a single message to event listeners within your extension/app or a different extension/app. Similar to runtime.connect but only sends a single message, with an optional response. If sending to your extension, the runtime.onMessage event will be fired in each page, or runtime.onMessageExternal, if a different extension. Note that extensions cannot send messages to content scripts using this method. To send messages to content scripts, use tabs.sendMessage.
+ * @since Chrome 26.
+ */
+ export function sendMessage<M = any, R = any>(message: M): Promise<R>;
+ /**
+ * Sends a single message to event listeners within your extension/app or a different extension/app. Similar to runtime.connect but only sends a single message, with an optional response. If sending to your extension, the runtime.onMessage event will be fired in each page, or runtime.onMessageExternal, if a different extension. Note that extensions cannot send messages to content scripts using this method. To send messages to content scripts, use tabs.sendMessage.
+ * @since Chrome 32.
+ */
+ export function sendMessage<M = any, R = any>(
+ message: M,
+ options: MessageOptions,
+ ): Promise<R>;
+ /**
+ * Sends a single message to event listeners within your extension/app or a different extension/app. Similar to runtime.connect but only sends a single message, with an optional response. If sending to your extension, the runtime.onMessage event will be fired in each page, or runtime.onMessageExternal, if a different extension. Note that extensions cannot send messages to content scripts using this method. To send messages to content scripts, use tabs.sendMessage.
+ * @since Chrome 26.
+ * @param extensionId The ID of the extension/app to send the message to. If omitted, the message will be sent to your own extension/app. Required if sending messages from a web page for web messaging.
+ */
+ export function sendMessage<M = any, R = any>(extensionId: string | undefined | null, message: M): Promise<R>;
+ /**
+ * Sends a single message to event listeners within your extension/app or a different extension/app. Similar to runtime.connect but only sends a single message, with an optional response. If sending to your extension, the runtime.onMessage event will be fired in each page, or runtime.onMessageExternal, if a different extension. Note that extensions cannot send messages to content scripts using this method. To send messages to content scripts, use tabs.sendMessage.
+ * @since Chrome 32.
+ * @param extensionId The ID of the extension/app to send the message to. If omitted, the message will be sent to your own extension/app. Required if sending messages from a web page for web messaging.
+ */
+ export function sendMessage<Message = any, Response = any>(
+ extensionId: string | undefined | null,
+ message: Message,
+ options: MessageOptions,
+ ): Promise<Response>;
+ /**
+ * Send a single message to a native application.
+ * @since Chrome 28.
+ * @param application The of the native messaging host.
+ * @param message The message that will be passed to the native messaging host.
+ * Parameter response: The response message sent by the native messaging host. If an error occurs while connecting to the native messaging host, the callback will be called with no arguments and runtime.lastError will be set to the error message.
+ */
+ export function sendNativeMessage(
+ application: string,
+ message: Object,
+ responseCallback: (response: any) => void,
+ ): void;
+ /**
+ * Send a single message to a native application.
+ * @since Chrome 28.
+ * @param application The of the native messaging host.
+ * @param message The message that will be passed to the native messaging host.
+ */
+ export function sendNativeMessage(
+ application: string,
+ message: Object,
+ ): Promise<any>;
+ /**
+ * Sets the URL to be visited upon uninstallation. This may be used to clean up server-side data, do analytics, and implement surveys. Maximum 255 characters.
+ * @since Chrome 41.
+ * @param url Since Chrome 34.
+ * URL to be opened after the extension is uninstalled. This URL must have an http: or https: scheme. Set an empty string to not open a new tab upon uninstallation.
+ * @param callback Called when the uninstall URL is set. If the given URL is invalid, runtime.lastError will be set.
+ */
+ export function setUninstallURL(url: string, callback?: () => void): void;
+ /**
+ * Open your Extension's options page, if possible.
+ * The precise behavior may depend on your manifest's options_ui or options_page key, or what Chrome happens to support at the time. For example, the page may be opened in a new tab, within chrome://extensions, within an App, or it may just focus an open options page. It will never cause the caller page to reload.
+ * If your Extension does not declare an options page, or Chrome failed to create one for some other reason, the callback will set lastError.
+ * @since Chrome 42.
+ */
+ export function openOptionsPage(callback?: () => void): void;
+
+ /**
+ * Fired when a connection is made from either an extension process or a content script.
+ * @since Chrome 26.
+ */
+ export var onConnect: ExtensionConnectEvent;
+ /**
+ * Fired when a connection is made from another extension.
+ * @since Chrome 26.
+ */
+ export var onConnectExternal: ExtensionConnectEvent;
+ /** Sent to the event page just before it is unloaded. This gives the extension opportunity to do some clean up. Note that since the page is unloading, any asynchronous operations started while handling this event are not guaranteed to complete. If more activity for the event page occurs before it gets unloaded the onSuspendCanceled event will be sent and the page won't be unloaded. */
+ export var onSuspend: RuntimeEvent;
+ /**
+ * Fired when a profile that has this extension installed first starts up. This event is not fired when an incognito profile is started, even if this extension is operating in 'split' incognito mode.
+ * @since Chrome 23.
+ */
+ export var onStartup: RuntimeEvent;
+ /** Fired when the extension is first installed, when the extension is updated to a new version, and when Chrome is updated to a new version. */
+ export var onInstalled: RuntimeInstalledEvent;
+ /** Sent after onSuspend to indicate that the app won't be unloaded after all. */
+ export var onSuspendCanceled: RuntimeEvent;
+ /**
+ * Fired when a message is sent from either an extension process or a content script.
+ * @since Chrome 26.
+ */
+ export var onMessage: ExtensionMessageEvent;
+ /**
+ * Fired when a message is sent from another extension/app. Cannot be used in a content script.
+ * @since Chrome 26.
+ */
+ export var onMessageExternal: ExtensionMessageEvent;
+ /**
+ * Fired when an app or the device that it runs on needs to be restarted. The app should close all its windows at its earliest convenient time to let the restart to happen. If the app does nothing, a restart will be enforced after a 24-hour grace period has passed. Currently, this event is only fired for Chrome OS kiosk apps.
+ * @since Chrome 29.
+ */
+ export var onRestartRequired: RuntimeRestartRequiredEvent;
+ /**
+ * Fired when an update is available, but isn't installed immediately because the app is currently running. If you do nothing, the update will be installed the next time the background page gets unloaded, if you want it to be installed sooner you can explicitly call chrome.runtime.reload(). If your extension is using a persistent background page, the background page of course never gets unloaded, so unless you call chrome.runtime.reload() manually in response to this event the update will not get installed until the next time chrome itself restarts. If no handlers are listening for this event, and your extension has a persistent background page, it behaves as if chrome.runtime.reload() is called in response to this event.
+ * @since Chrome 25.
+ */
+ export var onUpdateAvailable: RuntimeUpdateAvailableEvent;
+ /**
+ * @deprecated since Chrome 33. Please use chrome.runtime.onRestartRequired.
+ * Fired when a Chrome update is available, but isn't installed immediately because a browser restart is required.
+ */
+ export var onBrowserUpdateAvailable: RuntimeEvent;
+}
+
+////////////////////
+// Scripting
+////////////////////
+/**
+ * Use the chrome.scripting API to execute script in different contexts.
+ * Permissions: "scripting", Manifest v3+
+ * @since Chrome 88.
+ */
+declare namespace chrome.scripting {
+ /* The CSS style origin for a style change. */
+ export type StyleOrigin = "AUTHOR" | "USER";
+
+ /* The JavaScript world for a script to execute within. */
+ export type ExecutionWorld = "ISOLATED" | "MAIN";
+
+ export interface InjectionResult<T> {
+ /* The frame associated with the injection. */
+ frameId: number;
+ /* The result of the script execution. */
+ result: T;
+ }
+
+ export interface InjectionTarget {
+ /* Whether the script should inject into all frames within the tab. Defaults to false. This must not be true if frameIds is specified. */
+ allFrames?: boolean | undefined;
+ /* The IDs of specific frames to inject into. */
+ frameIds?: number[] | undefined;
+ /* The ID of the tab into which to inject. */
+ tabId: number;
+ }
+
+ export interface CSSInjection {
+ /* A string containing the CSS to inject. Exactly one of files and css must be specified. */
+ css?: string | undefined;
+ /* The path of the CSS files to inject, relative to the extension's root directory. NOTE: Currently a maximum of one file is supported. Exactly one of files and css must be specified. */
+ files?: string[] | undefined;
+ /* The style origin for the injection. Defaults to 'AUTHOR'. */
+ origin?: StyleOrigin | undefined;
+ /* Details specifying the target into which to insert the CSS. */
+ target: InjectionTarget;
+ }
+
+ export type ScriptInjection<Args extends any[], Result> =
+ & {
+ /* Details specifying the target into which to inject the script. */
+ target: InjectionTarget;
+ /* The JavaScript world for a script to execute within. */
+ world?: ExecutionWorld;
+ /* Whether the injection should be triggered in the target as soon as possible. Note that this is not a guarantee that injection will occur prior to page load, as the page may have already loaded by the time the script reaches the target. */
+ injectImmediately?: boolean;
+ }
+ & (
+ | {
+ /* The path of the JS files to inject, relative to the extension's root directory. NOTE: Currently a maximum of one file is supported. Exactly one of files and function must be specified. */
+ files: string[];
+ }
+ | ({
+ /* A JavaScript function to inject. This function will be serialized, and then deserialized for injection. This means that any bound parameters and execution context will be lost. Exactly one of files and function must be specified. */
+ func: () => Result;
+ } | {
+ /* A JavaScript function to inject. This function will be serialized, and then deserialized for injection. This means that any bound parameters and execution context will be lost. Exactly one of files and function must be specified. */
+ func: (...args: Args) => Result;
+ /* The arguments to carry into a provided function. This is only valid if the func parameter is specified. These arguments must be JSON-serializable. */
+ args: Args;
+ })
+ );
+
+ type Awaited<T> = T extends PromiseLike<infer U> ? U : T;
+
+ interface RegisteredContentScript {
+ id: string;
+ allFrames?: boolean;
+ matchOriginAsFallback?: boolean;
+ css?: string[];
+ excludeMatches?: string[];
+ js?: string[];
+ matches?: string[];
+ persistAcrossSessions?: boolean;
+ runAt?: "document_start" | "document_end" | "document_idle";
+ world?: ExecutionWorld;
+ }
+
+ interface ContentScriptFilter {
+ ids?: string[];
+ css?: string;
+ files?: string[];
+ origin?: StyleOrigin;
+ target?: InjectionTarget;
+ }
+
+ /**
+ * Injects a script into a target context. The script will be run at document_end.
+ * @param injection
+ * The details of the script which to inject.
+ * @return The `executeScript` method provides its result via callback or returned as a `Promise` (MV3 only). The resulting array contains the result of execution for each frame where the injection succeeded.
+ */
+ export function executeScript<Args extends any[], Result>(
+ injection: ScriptInjection<Args, Result>,
+ ): Promise<InjectionResult<Awaited<Result>>[]>;
+
+ /**
+ * Injects a script into a target context. The script will be run at document_end.
+ * @param injection
+ * The details of the script which to inject.
+ * @param callback
+ * Invoked upon completion of the injection. The resulting array contains the result of execution for each frame where the injection succeeded.
+ */
+ export function executeScript<Args extends any[], Result>(
+ injection: ScriptInjection<Args, Result>,
+ callback: (results: InjectionResult<Awaited<Result>>[]) => void,
+ ): void;
+
+ /**
+ * Inserts a CSS stylesheet into a target context. If multiple frames are specified, unsuccessful injections are ignored.
+ * @param injection
+ * The details of the styles to insert.
+ * @return The `insertCSS` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function insertCSS(injection: CSSInjection): Promise<void>;
+
+ /**
+ * Inserts a CSS stylesheet into a target context. If multiple frames are specified, unsuccessful injections are ignored.
+ * @param injection
+ * The details of the styles to insert.
+ * @param callback
+ * Invoked upon completion of the injection.
+ */
+ export function insertCSS(injection: CSSInjection, callback: () => void): void;
+
+ /**
+ * Removes a CSS stylesheet that was previously inserted by this extension from a target context.
+ * @param injection
+ * The details of the styles to remove.
+ * Note that the css, files, and origin properties must exactly match the stylesheet inserted through `insertCSS`.
+ * Attempting to remove a non-existent stylesheet is a no-op.
+ * @return This only returns a Promise when the callback parameter is not specified, and with MV3+.
+ * @since Chrome 90
+ */
+ export function removeCSS(injection: CSSInjection): Promise<void>;
+
+ /**
+ * Removes a CSS stylesheet that was previously inserted by this extension from a target context.
+ * @param injection
+ * The details of the styles to remove.
+ * Note that the css, files, and origin properties must exactly match the stylesheet inserted through `insertCSS`.
+ * Attempting to remove a non-existent stylesheet is a no-op.
+ * @param callback
+ * Invoked upon completion of the removal.
+ * @since Chrome 90
+ */
+ export function removeCSS(injection: CSSInjection, callback: () => void): void;
+
+ /**
+ * Registers one or more content scripts.
+ * @param scripts
+ */
+ export function registerContentScripts(scripts: RegisteredContentScript[]): Promise<void>;
+
+ /**
+ * Registers one or more content scripts.
+ * @param scripts
+ * @param callback
+ */
+ export function registerContentScripts(scripts: RegisteredContentScript[], callback: () => void): void;
+
+ /**
+ * Unregister one or more content scripts.
+ * @param filter
+ * @param callback
+ */
+ export function unregisterContentScripts(filter?: ContentScriptFilter): Promise<void>;
+
+ /**
+ * Unregister one or more content scripts.
+ * @param filter
+ * @param callback
+ */
+ export function unregisterContentScripts(callback: () => void): void;
+ export function unregisterContentScripts(filter: ContentScriptFilter, callback: () => void): void;
+
+ /**
+ * Returns all the content scripts registered with scripting.registerContentScripts()
+ * or a subset of the registered scripts when using a filter.
+ * @param filter
+ */
+ export function getRegisteredContentScripts(filter?: ContentScriptFilter): Promise<RegisteredContentScript[]>;
+
+ /**
+ * Returns all the content scripts registered with scripting.registerContentScripts()
+ * or a subset of the registered scripts when using a filter.
+ * @param filter
+ * @param callback
+ */
+ export function getRegisteredContentScripts(callback: (scripts: RegisteredContentScript[]) => void): void;
+ export function getRegisteredContentScripts(
+ filter: ContentScriptFilter,
+ callback: (scripts: RegisteredContentScript[]) => void,
+ ): void;
+
+ /**
+ * Updates one or more content scripts.
+ * @param scripts
+ */
+ export function updateContentScripts(scripts: RegisteredContentScript[]): Promise<void>;
+
+ /**
+ * Updates one or more content scripts.
+ * @param scripts
+ * @param callback
+ */
+ export function updateContentScripts(scripts: RegisteredContentScript[], callback: () => void): void;
+}
+
+////////////////////
+// Script Badge
+////////////////////
+declare namespace chrome.scriptBadge {
+ export interface GetPopupDetails {
+ tabId: number;
+ }
+
+ export interface AttentionDetails {
+ tabId: number;
+ }
+
+ export interface SetPopupDetails {
+ tabId: number;
+ popup: string;
+ }
+
+ export interface ScriptBadgeClickedEvent extends chrome.events.Event<(tab: chrome.tabs.Tab) => void> {}
+
+ export function getPopup(details: GetPopupDetails, callback: Function): void;
+ export function getAttention(details: AttentionDetails): void;
+ export function setPopup(details: SetPopupDetails): void;
+
+ export var onClicked: ScriptBadgeClickedEvent;
+}
+
+////////////////////
+// Sessions
+////////////////////
+/**
+ * Use the chrome.sessions API to query and restore tabs and windows from a browsing session.
+ * Permissions: "sessions"
+ * @since Chrome 37.
+ */
+declare namespace chrome.sessions {
+ export interface Filter {
+ /**
+ * Optional.
+ * The maximum number of entries to be fetched in the requested list. Omit this parameter to fetch the maximum number of entries (sessions.MAX_SESSION_RESULTS).
+ */
+ maxResults?: number | undefined;
+ }
+
+ export interface Session {
+ /** The time when the window or tab was closed or modified, represented in milliseconds since the epoch. */
+ lastModified: number;
+ /**
+ * Optional.
+ * The tabs.Tab, if this entry describes a tab. Either this or sessions.Session.window will be set.
+ */
+ tab?: tabs.Tab | undefined;
+ /**
+ * Optional.
+ * The windows.Window, if this entry describes a window. Either this or sessions.Session.tab will be set.
+ */
+ window?: windows.Window | undefined;
+ }
+
+ export interface Device {
+ /** The name of the foreign device. */
+ deviceName: string;
+ /** A list of open window sessions for the foreign device, sorted from most recently to least recently modified session. */
+ sessions: Session[];
+ }
+
+ export interface SessionChangedEvent extends chrome.events.Event<() => void> {}
+
+ /** The maximum number of sessions.Session that will be included in a requested list. */
+ export var MAX_SESSION_RESULTS: number;
+
+ /**
+ * Gets the list of recently closed tabs and/or windows.
+ * @return The `getRecentlyClosed` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function getRecentlyClosed(filter?: Filter): Promise<Session[]>;
+ /**
+ * Gets the list of recently closed tabs and/or windows.
+ * @param callback
+ * Parameter sessions: The list of closed entries in reverse order that they were closed (the most recently closed tab or window will be at index 0). The entries may contain either tabs or windows.
+ */
+ export function getRecentlyClosed(filter: Filter, callback: (sessions: Session[]) => void): void;
+ /**
+ * Gets the list of recently closed tabs and/or windows.
+ * @param callback
+ * Parameter sessions: The list of closed entries in reverse order that they were closed (the most recently closed tab or window will be at index 0). The entries may contain either tabs or windows.
+ */
+ export function getRecentlyClosed(callback: (sessions: Session[]) => void): void;
+ /**
+ * Retrieves all devices with synced sessions.
+ * @return The `getDevices` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function getDevices(filter?: Filter): Promise<Device[]>;
+ /**
+ * Retrieves all devices with synced sessions.
+ * @param callback
+ * Parameter devices: The list of sessions.Device objects for each synced session, sorted in order from device with most recently modified session to device with least recently modified session. tabs.Tab objects are sorted by recency in the windows.Window of the sessions.Session objects.
+ */
+ export function getDevices(filter: Filter, callback: (devices: Device[]) => void): void;
+ /**
+ * Retrieves all devices with synced sessions.
+ * @param callback
+ * Parameter devices: The list of sessions.Device objects for each synced session, sorted in order from device with most recently modified session to device with least recently modified session. tabs.Tab objects are sorted by recency in the windows.Window of the sessions.Session objects.
+ */
+ export function getDevices(callback: (devices: Device[]) => void): void;
+ /**
+ * Reopens a windows.Window or tabs.Tab.
+ * @param sessionId Optional.
+ * The windows.Window.sessionId, or tabs.Tab.sessionId to restore. If this parameter is not specified, the most recently closed session is restored.
+ * @return The `restore` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function restore(sessionId?: string): Promise<Session>;
+ /**
+ * Reopens a windows.Window or tabs.Tab, with an optional callback to run when the entry has been restored.
+ * @param sessionId Optional.
+ * The windows.Window.sessionId, or tabs.Tab.sessionId to restore. If this parameter is not specified, the most recently closed session is restored.
+ * @param callback Optional.
+ * Parameter restoredSession: A sessions.Session containing the restored windows.Window or tabs.Tab object.
+ */
+ export function restore(sessionId: string, callback: (restoredSession: Session) => void): void;
+ /**
+ * Reopens a windows.Window or tabs.Tab, with an optional callback to run when the entry has been restored.
+ * @param callback Optional.
+ * Parameter restoredSession: A sessions.Session containing the restored windows.Window or tabs.Tab object.
+ */
+ export function restore(callback: (restoredSession: Session) => void): void;
+
+ /** Fired when recently closed tabs and/or windows are changed. This event does not monitor synced sessions changes. */
+ export var onChanged: SessionChangedEvent;
+}
+
+////////////////////
+// Storage
+////////////////////
+/**
+ * Use the chrome.storage API to store, retrieve, and track changes to user data.
+ * Permissions: "storage"
+ * @since Chrome 20.
+ */
+declare namespace chrome.storage {
+ export interface StorageArea {
+ /**
+ * Gets the amount of space (in bytes) being used by one or more items.
+ * @param callback Callback with the amount of space being used by storage, or on failure (in which case runtime.lastError will be set).
+ * Parameter bytesInUse: Amount of space being used in storage, in bytes.
+ */
+ getBytesInUse(callback: (bytesInUse: number) => void): void;
+ /**
+ * Gets the amount of space (in bytes) being used by one or more items.
+ * @param keys Optional. A single key or list of keys to get the total usage for. An empty list will return 0. Pass in null to get the total usage of all of storage.
+ * @return A Promise that resolves with a number
+ * @since MV3
+ */
+ getBytesInUse(keys?: string | string[] | null): Promise<number>;
+ /**
+ * Gets the amount of space (in bytes) being used by one or more items.
+ * @param keys Optional. A single key or list of keys to get the total usage for. An empty list will return 0. Pass in null to get the total usage of all of storage.
+ * @param callback Callback with the amount of space being used by storage, or on failure (in which case runtime.lastError will be set).
+ * Parameter bytesInUse: Amount of space being used in storage, in bytes.
+ */
+ getBytesInUse(keys: string | string[] | null, callback: (bytesInUse: number) => void): void;
+ /**
+ * Removes all items from storage.
+ * @return A void Promise
+ * @since MV3
+ */
+ clear(): Promise<void>;
+ /**
+ * Removes all items from storage.
+ * @param callback Optional.
+ * Callback on success, or on failure (in which case runtime.lastError will be set).
+ */
+ clear(callback: () => void): void;
+ /**
+ * Sets multiple items.
+ * @param items An object which gives each key/value pair to update storage with. Any other key/value pairs in storage will not be affected.
+ * Primitive values such as numbers will serialize as expected. Values with a typeof "object" and "function" will typically serialize to {}, with the exception of Array (serializes as expected), Date, and Regex (serialize using their String representation).
+ * @return A void Promise
+ * @since MV3
+ */
+ set(items: { [key: string]: any }): Promise<void>;
+ /**
+ * Sets multiple items.
+ * @param items An object which gives each key/value pair to update storage with. Any other key/value pairs in storage will not be affected.
+ * Primitive values such as numbers will serialize as expected. Values with a typeof "object" and "function" will typically serialize to {}, with the exception of Array (serializes as expected), Date, and Regex (serialize using their String representation).
+ * @param callback Optional.
+ * Callback on success, or on failure (in which case runtime.lastError will be set).
+ */
+ set(items: { [key: string]: any }, callback: () => void): void;
+ /**
+ * Removes one or more items from storage.
+ * @param keys A single key or a list of keys for items to remove.
+ * @param callback Optional.
+ * @return A void Promise
+ * @since MV3
+ */
+ remove(keys: string | string[]): Promise<void>;
+ /**
+ * Removes one or more items from storage.
+ * @param keys A single key or a list of keys for items to remove.
+ * @param callback Optional.
+ * Callback on success, or on failure (in which case runtime.lastError will be set).
+ */
+ remove(keys: string | string[], callback: () => void): void;
+ /**
+ * Gets the entire contents of storage.
+ * @param callback Callback with storage items, or on failure (in which case runtime.lastError will be set).
+ * Parameter items: Object with items in their key-value mappings.
+ */
+ get(callback: (items: { [key: string]: any }) => void): void;
+ /**
+ * Gets one or more items from storage.
+ * @param keys A single key to get, list of keys to get, or a dictionary specifying default values.
+ * An empty list or object will return an empty result object. Pass in null to get the entire contents of storage.
+ * @return A Promise that resolves with an object containing items
+ * @since MV3
+ */
+ get(keys?: string | string[] | { [key: string]: any } | null): Promise<{ [key: string]: any }>;
+ /**
+ * Gets one or more items from storage.
+ * @param keys A single key to get, list of keys to get, or a dictionary specifying default values.
+ * An empty list or object will return an empty result object. Pass in null to get the entire contents of storage.
+ * @param callback Callback with storage items, or on failure (in which case runtime.lastError will be set).
+ * Parameter items: Object with items in their key-value mappings.
+ */
+ get(
+ keys: string | string[] | { [key: string]: any } | null,
+ callback: (items: { [key: string]: any }) => void,
+ ): void;
+ /**
+ * Sets the desired access level for the storage area. The default will be only trusted contexts.
+ * @param accessOptions An object containing an accessLevel key which contains the access level of the storage area.
+ * @return A void Promise.
+ * @since Chrome 102
+ */
+ setAccessLevel(accessOptions: { accessLevel: AccessLevel }): Promise<void>;
+ /**
+ * Sets the desired access level for the storage area. The default will be only trusted contexts.
+ * @param accessOptions An object containing an accessLevel key which contains the access level of the storage area.
+ * @param callback Optional.
+ * @since Chrome 102
+ */
+ setAccessLevel(accessOptions: { accessLevel: AccessLevel }, callback: () => void): void;
+ /**
+ * Fired when one or more items change within this storage area.
+ * @param keys A single key to get, list of keys to get, or a dictionary specifying default values.
+ * An empty list or object will return an empty result object. Pass in null to get the entire contents of storage.
+ * @param callback Callback with storage items, or on failure (in which case runtime.lastError will be set).
+ * Parameter items: Object with items in their key-value mappings.
+ */
+ onChanged: StorageAreaChangedEvent;
+ }
+
+ export interface StorageChange {
+ /** Optional. The new value of the item, if there is a new value. */
+ newValue?: any;
+ /** Optional. The old value of the item, if there was an old value. */
+ oldValue?: any;
+ }
+
+ export interface LocalStorageArea extends StorageArea {
+ /** The maximum amount (in bytes) of data that can be stored in local storage, as measured by the JSON stringification of every value plus every key's length. This value will be ignored if the extension has the unlimitedStorage permission. Updates that would cause this limit to be exceeded fail immediately and set runtime.lastError. */
+ QUOTA_BYTES: number;
+ }
+
+ export interface SyncStorageArea extends StorageArea {
+ /** @deprecated since Chrome 40. The storage.sync API no longer has a sustained write operation quota. */
+ MAX_SUSTAINED_WRITE_OPERATIONS_PER_MINUTE: number;
+ /** The maximum total amount (in bytes) of data that can be stored in sync storage, as measured by the JSON stringification of every value plus every key's length. Updates that would cause this limit to be exceeded fail immediately and set runtime.lastError. */
+ QUOTA_BYTES: number;
+ /** The maximum size (in bytes) of each individual item in sync storage, as measured by the JSON stringification of its value plus its key length. Updates containing items larger than this limit will fail immediately and set runtime.lastError. */
+ QUOTA_BYTES_PER_ITEM: number;
+ /** The maximum number of items that can be stored in sync storage. Updates that would cause this limit to be exceeded will fail immediately and set runtime.lastError. */
+ MAX_ITEMS: number;
+ /**
+ * The maximum number of set, remove, or clear operations that can be performed each hour. This is 1 every 2 seconds, a lower ceiling than the short term higher writes-per-minute limit.
+ * Updates that would cause this limit to be exceeded fail immediately and set runtime.lastError.
+ */
+ MAX_WRITE_OPERATIONS_PER_HOUR: number;
+ /**
+ * The maximum number of set, remove, or clear operations that can be performed each minute. This is 2 per second, providing higher throughput than writes-per-hour over a shorter period of time.
+ * Updates that would cause this limit to be exceeded fail immediately and set runtime.lastError.
+ * @since Chrome 40.
+ */
+ MAX_WRITE_OPERATIONS_PER_MINUTE: number;
+ }
+
+ export interface SessionStorageArea extends StorageArea {
+ /** The maximum amount (in bytes) of data that can be stored in memory, as measured by estimating the dynamically allocated memory usage of every value and key. Updates that would cause this limit to be exceeded fail immediately and set runtime.lastError. */
+ QUOTA_BYTES: number;
+ }
+
+ export interface StorageAreaChangedEvent
+ extends chrome.events.Event<(changes: { [key: string]: StorageChange }) => void>
+ {}
+
+ type AreaName = keyof Pick<typeof chrome.storage, "sync" | "local" | "managed" | "session">;
+ export interface StorageChangedEvent
+ extends chrome.events.Event<(changes: { [key: string]: StorageChange }, areaName: AreaName) => void>
+ {}
+
+ type AccessLevel = keyof typeof AccessLevel;
+
+ /** The storage area's access level. */
+ export var AccessLevel: {
+ TRUSTED_AND_UNTRUSTED_CONTEXTS: "TRUSTED_AND_UNTRUSTED_CONTEXTS";
+ TRUSTED_CONTEXTS: "TRUSTED_CONTEXTS";
+ };
+
+ /** Items in the local storage area are local to each machine. */
+ export var local: LocalStorageArea;
+ /** Items in the sync storage area are synced using Chrome Sync. */
+ export var sync: SyncStorageArea;
+
+ /**
+ * Items in the managed storage area are set by the domain administrator, and are read-only for the extension; trying to modify this namespace results in an error.
+ * @since Chrome 33.
+ */
+ export var managed: StorageArea;
+
+ /**
+ * Items in the session storage area are stored in-memory and will not be persisted to disk.
+ * @since Chrome 102.
+ */
+ export var session: SessionStorageArea;
+
+ /** Fired when one or more items change. */
+ export var onChanged: StorageChangedEvent;
+}
+
+////////////////////
+// Socket
+////////////////////
+declare namespace chrome.socket {
+ export interface CreateInfo {
+ socketId: number;
+ }
+
+ export interface AcceptInfo {
+ resultCode: number;
+ socketId?: number | undefined;
+ }
+
+ export interface ReadInfo {
+ resultCode: number;
+ data: ArrayBuffer;
+ }
+
+ export interface WriteInfo {
+ bytesWritten: number;
+ }
+
+ export interface RecvFromInfo {
+ resultCode: number;
+ data: ArrayBuffer;
+ port: number;
+ address: string;
+ }
+
+ export interface SocketInfo {
+ socketType: string;
+ localPort?: number | undefined;
+ peerAddress?: string | undefined;
+ peerPort?: number | undefined;
+ localAddress?: string | undefined;
+ connected: boolean;
+ }
+
+ export interface NetworkInterface {
+ name: string;
+ address: string;
+ }
+
+ export function create(type: string, options?: Object, callback?: (createInfo: CreateInfo) => void): void;
+ export function destroy(socketId: number): void;
+ export function connect(socketId: number, hostname: string, port: number, callback: (result: number) => void): void;
+ export function bind(socketId: number, address: string, port: number, callback: (result: number) => void): void;
+ export function disconnect(socketId: number): void;
+ export function read(socketId: number, bufferSize?: number, callback?: (readInfo: ReadInfo) => void): void;
+ export function write(socketId: number, data: ArrayBuffer, callback?: (writeInfo: WriteInfo) => void): void;
+ export function recvFrom(
+ socketId: number,
+ bufferSize?: number,
+ callback?: (recvFromInfo: RecvFromInfo) => void,
+ ): void;
+ export function sendTo(
+ socketId: number,
+ data: ArrayBuffer,
+ address: string,
+ port: number,
+ callback?: (writeInfo: WriteInfo) => void,
+ ): void;
+ export function listen(
+ socketId: number,
+ address: string,
+ port: number,
+ backlog?: number,
+ callback?: (result: number) => void,
+ ): void;
+ export function accept(socketId: number, callback?: (acceptInfo: AcceptInfo) => void): void;
+ export function setKeepAlive(
+ socketId: number,
+ enable: boolean,
+ delay?: number,
+ callback?: (result: boolean) => void,
+ ): void;
+ export function setNoDelay(socketId: number, noDelay: boolean, callback?: (result: boolean) => void): void;
+ export function getInfo(socketId: number, callback: (result: SocketInfo) => void): void;
+ export function getNetworkList(callback: (result: NetworkInterface[]) => void): void;
+}
+
+////////////////////
+// System CPU
+////////////////////
+/**
+ * Use the system.cpu API to query CPU metadata.
+ * Permissions: "system.cpu"
+ * @since Chrome 32.
+ */
+declare namespace chrome.system.cpu {
+ export interface ProcessorUsage {
+ /** The cumulative time used by userspace programs on this processor. */
+ user: number;
+ /** The cumulative time used by kernel programs on this processor. */
+ kernel: number;
+ /** The cumulative time spent idle by this processor. */
+ idle: number;
+ /** The total cumulative time for this processor. This value is equal to user + kernel + idle. */
+ total: number;
+ }
+
+ export interface ProcessorInfo {
+ /** Cumulative usage info for this logical processor. */
+ usage: ProcessorUsage;
+ }
+
+ export interface CpuInfo {
+ /** The number of logical processors. */
+ numOfProcessors: number;
+ /** The architecture name of the processors. */
+ archName: string;
+ /** The model name of the processors. */
+ modelName: string;
+ /**
+ * A set of feature codes indicating some of the processor's capabilities.
+ * The currently supported codes are "mmx", "sse", "sse2", "sse3", "ssse3", "sse4_1", "sse4_2", and "avx".
+ */
+ features: string[];
+ /** Information about each logical processor. */
+ processors: ProcessorInfo[];
+ }
+
+ /** Queries basic CPU information of the system. */
+ export function getInfo(callback: (info: CpuInfo) => void): void;
+
+ /**
+ * Queries basic CPU information of the system.
+ * @return The `getInfo` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function getInfo(): Promise<CpuInfo>;
+}
+
+////////////////////
+// System Memory
+////////////////////
+/**
+ * The chrome.system.memory API.
+ * Permissions: "system.memory"
+ * @since Chrome 32.
+ */
+declare namespace chrome.system.memory {
+ export interface MemoryInfo {
+ /** The total amount of physical memory capacity, in bytes. */
+ capacity: number;
+ /** The amount of available capacity, in bytes. */
+ availableCapacity: number;
+ }
+
+ /** Get physical memory information. */
+ export function getInfo(callback: (info: MemoryInfo) => void): void;
+
+ /**
+ * Get physical memory information.
+ * @return The `getInfo` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function getInfo(): Promise<MemoryInfo>;
+}
+
+////////////////////
+// System Storage
+////////////////////
+/**
+ * Use the chrome.system.storage API to query storage device information and be notified when a removable storage device is attached and detached.
+ * Permissions: "system.storage"
+ * @since Chrome 30.
+ */
+declare namespace chrome.system.storage {
+ export interface StorageUnitInfo {
+ /** The transient ID that uniquely identifies the storage device. This ID will be persistent within the same run of a single application. It will not be a persistent identifier between different runs of an application, or between different applications. */
+ id: string;
+ /** The name of the storage unit. */
+ name: string;
+ /**
+ * The media type of the storage unit.
+ * fixed: The storage has fixed media, e.g. hard disk or SSD.
+ * removable: The storage is removable, e.g. USB flash drive.
+ * unknown: The storage type is unknown.
+ */
+ type: string;
+ /** The total amount of the storage space, in bytes. */
+ capacity: number;
+ }
+
+ export interface StorageCapacityInfo {
+ /** A copied |id| of getAvailableCapacity function parameter |id|. */
+ id: string;
+ /** The available capacity of the storage device, in bytes. */
+ availableCapacity: number;
+ }
+
+ export interface SystemStorageAttachedEvent extends chrome.events.Event<(info: StorageUnitInfo) => void> {}
+
+ export interface SystemStorageDetachedEvent extends chrome.events.Event<(id: string) => void> {}
+
+ /** Get the storage information from the system. The argument passed to the callback is an array of StorageUnitInfo objects. */
+ export function getInfo(callback: (info: StorageUnitInfo[]) => void): void;
+ /**
+ * Get the storage information from the system. The argument passed to the callback is an array of StorageUnitInfo objects.
+ * @return The `getInfo` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function getInfo(): Promise<StorageUnitInfo[]>;
+ /**
+ * Ejects a removable storage device.
+ * @param callback
+ * Parameter result: success: The ejection command is successful -- the application can prompt the user to remove the device; in_use: The device is in use by another application. The ejection did not succeed; the user should not remove the device until the other application is done with the device; no_such_device: There is no such device known. failure: The ejection command failed.
+ */
+ export function ejectDevice(id: string, callback: (result: string) => void): void;
+ /**
+ * Ejects a removable storage device.
+ * @param callback
+ * Parameter result: success: The ejection command is successful -- the application can prompt the user to remove the device; in_use: The device is in use by another application. The ejection did not succeed; the user should not remove the device until the other application is done with the device; no_such_device: There is no such device known. failure: The ejection command failed.
+ * @return The `ejectDevice` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function ejectDevice(id: string): Promise<string>;
+ /**
+ * Get the available capacity of a specified |id| storage device. The |id| is the transient device ID from StorageUnitInfo.
+ * @since Dev channel only.
+ */
+ export function getAvailableCapacity(id: string, callback: (info: StorageCapacityInfo) => void): void;
+ /**
+ * Get the available capacity of a specified |id| storage device. The |id| is the transient device ID from StorageUnitInfo.
+ * @since Dev channel only.
+ * @return The `getAvailableCapacity` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function getAvailableCapacity(id: string): Promise<StorageCapacityInfo>;
+
+ /** Fired when a new removable storage is attached to the system. */
+ export var onAttached: SystemStorageAttachedEvent;
+ /** Fired when a removable storage is detached from the system. */
+ export var onDetached: SystemStorageDetachedEvent;
+}
+
+////////////////////
+// System Display //
+////////////////////
+/**
+ * Use the system.display API to query display metadata.
+ * Permissions: 'system.display'
+ * @since Chrome 30.
+ */
+declare namespace chrome.system.display {
+ export const DisplayPosition: {
+ TOP: "top";
+ RIGHT: "right";
+ BOTTOM: "bottom";
+ LEFT: "left";
+ };
+ export const MirrorMode: {
+ OFF: "off";
+ NORMAL: "normal";
+ MIXED: "mixed";
+ };
+ export interface Bounds {
+ /** The x-coordinate of the upper-left corner. */
+ left: number;
+ /** The y-coordinate of the upper-left corner. */
+ top: number;
+ /** The width of the display in pixels. */
+ width: number;
+ /** The height of the display in pixels. */
+ height: number;
+ }
+
+ export interface Insets {
+ /** The x-axis distance from the left bound. */
+ left: number;
+ /** The y-axis distance from the top bound. */
+ top: number;
+ /** The x-axis distance from the right bound. */
+ right: number;
+ /** The y-axis distance from the bottom bound. */
+ bottom: number;
+ }
+
+ /**
+ * @since Chrome 57
+ */
+ export interface Point {
+ /** The x-coordinate of the point. */
+ x: number;
+ /** The y-coordinate of the point. */
+ y: number;
+ }
+
+ /**
+ * @since Chrome 57
+ */
+ export interface TouchCalibrationPair {
+ /** The coordinates of the display point. */
+ displayPoint: Point;
+ /** The coordinates of the touch point corresponding to the display point. */
+ touchPoint: Point;
+ }
+
+ /**
+ * @since Chrome 52
+ */
+ export interface DisplayMode {
+ /** The display mode width in device independent (user visible) pixels. */
+ width: number;
+
+ /** The display mode height in device independent (user visible) pixels. */
+ height: number;
+
+ /** The display mode width in native pixels. */
+ widthInNativePixels: number;
+
+ /** The display mode height in native pixels. */
+ heightInNativePixels: number;
+
+ /**
+ * @deprecated Deprecated since Chrome 70. Use `displayZoomFactor`
+ * @description The display mode UI scale factor.
+ */
+ uiScale: number;
+
+ /** The display mode device scale factor. */
+ deviceScaleFactor: number;
+
+ /**
+ * The display mode refresh rate in hertz.
+ * @since Chrome 67
+ */
+ refreshRate: number;
+
+ /** True if the mode is the display's native mode. */
+ isNative: boolean;
+
+ /** True if the display mode is currently selected. */
+ isSelected: boolean;
+ }
+
+ /**
+ * @since Chrome 53
+ */
+ export interface DisplayLayout {
+ /** The unique identifier of the display. */
+ id: string;
+ /** The unique identifier of the parent display. Empty if this is the root. */
+ parentId: string;
+ /**
+ * The layout position of this display relative to the parent.
+ * This will be ignored for the root.
+ * @see enum
+ */
+ position: typeof DisplayPosition[keyof typeof DisplayPosition];
+ /** The offset of the display along the connected edge. 0 indicates that the topmost or leftmost corners are aligned. */
+ offset: number;
+ }
+
+ /**
+ * The pairs of point used to calibrate the display.
+ */
+ export interface TouchCalibrationPairs {
+ /** First pair of touch and display point required for touch calibration. */
+ pair1: TouchCalibrationPair;
+ /** Second pair of touch and display point required for touch calibration. */
+ pair2: TouchCalibrationPair;
+ /** Third pair of touch and display point required for touch calibration. */
+ pair3: TouchCalibrationPair;
+ /** Fourth pair of touch and display point required for touch calibration. */
+ pair4: TouchCalibrationPair;
+ }
+
+ /**
+ * Representation of info data to be used in chrome.system.display.setDisplayProperties()
+ */
+ export interface DisplayPropertiesInfo {
+ /**
+ * requires(CrOS) Chrome OS only.
+ * @description
+ * If set to true, changes the display mode to unified desktop.
+ * If set to false, unified desktop mode will be disabled.
+ * This is only valid for the primary display.
+ * If provided, mirroringSourceId must not be provided and other properties may not apply.
+ * This is has no effect if not provided.
+ * @see `enableUnifiedDesktop` for details
+ * @since Chrome 59
+ */
+ isUnified?: boolean | undefined;
+
+ /**
+ * requires(CrOS) Chrome OS only.
+ * @deprecated Deprecated since Chrome 68. Use ´setMirrorMode´
+ * @see setMirrorMode
+ * @description
+ * If set and not empty, enables mirroring for this display.
+ * Otherwise disables mirroring for this display.
+ * This value should indicate the id of the source display to mirror,
+ * which must not be the same as the id passed to setDisplayProperties.
+ * If set, no other property may be set.
+ */
+ mirroringSourceId?: string | undefined;
+
+ /**
+ * If set to true, makes the display primary.
+ * No-op if set to false.
+ */
+ isPrimary?: boolean | undefined;
+
+ /**
+ * If set, sets the display's overscan insets to the provided values.
+ * Note that overscan values may not be negative or larger than a half of the screen's size.
+ * Overscan cannot be changed on the internal monitor. It's applied after isPrimary parameter.
+ */
+ overscan?: Insets | undefined;
+
+ /**
+ * If set, updates the display's rotation.
+ * Legal values are [0, 90, 180, 270].
+ * The rotation is set clockwise, relative to the display's vertical position.
+ * It's applied after overscan parameter.
+ */
+ rotation?: 0 | 90 | 180 | 270 | undefined;
+
+ /**
+ * If set, updates the display's logical bounds origin along x-axis.
+ * Applied together with boundsOriginY, if boundsOriginY is set.
+ * Note that, when updating the display origin, some constraints will be applied,
+ * so the final bounds origin may be different than the one set.
+ * The final bounds can be retrieved using getInfo. The bounds origin is applied
+ * after rotation. The bounds origin cannot be changed on the primary display.
+ * Note that is also invalid to set bounds origin values if isPrimary is also set
+ * (as isPrimary parameter is applied first).
+ */
+ boundsOriginX?: number | undefined;
+
+ /**
+ * If set, updates the display's logical bounds origin along y-axis.
+ * @see boundsOriginX
+ */
+ boundsOriginY?: number | undefined;
+
+ /**
+ * If set, updates the display mode to the mode matching this value.
+ * @since Chrome 52
+ */
+ displayMode?: DisplayMode | undefined;
+
+ /**
+ * @since Chrome 65.
+ * @description
+ * If set, updates the zoom associated with the display.
+ * This zoom performs re-layout and repaint thus resulting
+ * in a better quality zoom than just performing
+ * a pixel by pixel stretch enlargement.
+ */
+ displayZoomFactor?: number | undefined;
+ }
+
+ /**
+ * Options affecting how the information is returned.
+ * @since Chrome 59
+ */
+ export interface DisplayInfoFlags {
+ /**
+ * If set to true, only a single DisplayUnitInfo will be returned by getInfo when in unified desktop mode.
+ * @see enableUnifiedDesktop
+ * @default false
+ */
+ singleUnified?: boolean | undefined;
+ }
+
+ /** Information about display properties. */
+ export interface DisplayInfo {
+ /** The unique identifier of the display. */
+ id: string;
+ /** The user-friendly name (e.g. 'HP LCD monitor'). */
+ name: string;
+ /**
+ * requires(CrOS Kiosk app) Only available in Chrome OS Kiosk apps
+ */
+ edid?: {
+ /**
+ * 3 character manufacturer code.
+ */
+ manufacturerId: string;
+ /**
+ * 2 byte manufacturer-assigned code.
+ */
+ productId: string;
+ /**
+ * Year of manufacturer.
+ */
+ yearOfManufacture?: string | undefined;
+ } | undefined;
+ /**
+ * requires(CrOS) Only working properly on Chrome OS.
+ * Identifier of the display that is being mirrored on the display unit.
+ * If mirroring is not in progress, set to an empty string
+ * Currently exposed only on ChromeOS.
+ * Will be empty string on other platforms.
+ */
+ mirroringSourceId: string;
+ /**
+ * requires(CrOS) Only available on Chrome OS.
+ * Identifiers of the displays to which the source display is being mirrored.
+ * Empty if no displays are being mirrored. This will be set to the same value
+ * for all displays.
+ * ❗ This must not include *mirroringSourceId*. ❗
+ */
+ mirroringDestinationIds: string[];
+ /** True if this is the primary display. */
+ isPrimary: boolean;
+ /** True if this is an internal display. */
+ isInternal: boolean;
+ /** True if this display is enabled. */
+ isEnabled: boolean;
+ /** The number of pixels per inch along the x-axis. */
+ dpiX: number;
+ /** The number of pixels per inch along the y-axis. */
+ dpiY: number;
+ /** The display's clockwise rotation in degrees relative to the vertical position. Currently exposed only on ChromeOS. Will be set to 0 on other platforms. */
+ rotation: number;
+ /** The display's logical bounds. */
+ bounds: Bounds;
+ /** The display's insets within its screen's bounds. Currently exposed only on ChromeOS. Will be set to empty insets on other platforms. */
+ overscan: Insets;
+ /** The usable work area of the display within the display bounds. The work area excludes areas of the display reserved for OS, for example taskbar and launcher. */
+ workArea: Bounds;
+ /**
+ * requires(CrOS) Only available on Chrome OS.
+ * The list of available display modes.
+ * The current mode will have isSelected=true.
+ * Only available on Chrome OS.
+ * Will be set to an empty array on other platforms.
+ */
+ modes: DisplayMode[];
+ /** True if this display has a touch input device associated with it. */
+ hasTouchSupport: boolean;
+ /** A list of zoom factor values that can be set for the display. */
+ availableDisplayZoomFactors: number[];
+ /**
+ * The ratio between the display's current and default zoom.
+ * For example, value 1 is equivalent to 100% zoom, and value 1.5 is equivalent to 150% zoom.
+ */
+ displayZoomFactor: number;
+ }
+
+ export interface MirrorModeInfo {
+ /**
+ * The mirror mode that should be set.
+ * **off**
+ * Use the default mode (extended or unified desktop).
+ * **normal**
+ * The default source display will be mirrored to all other displays.
+ * **mixed**
+ * The specified source display will be mirrored to the provided destination displays. All other connected displays will be extended.
+ */
+ mode?: "off" | "normal" | "mixed" | undefined;
+ }
+ export interface MirrorModeInfoMixed extends MirrorModeInfo {
+ mode: "mixed";
+ mirroringSourceId?: string | undefined;
+ /** The ids of the mirroring destination displays. */
+ mirroringDestinationIds?: string[] | undefined;
+ }
+
+ /**
+ * Requests the information for all attached display devices.
+ * @param callback The callback to invoke with the results.
+ */
+ export function getInfo(callback: (info: DisplayInfo[]) => void): void;
+ /**
+ * Requests the information for all attached display devices.
+ * @return The `getInfo` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function getInfo(): Promise<DisplayInfo[]>;
+ /**
+ * Requests the information for all attached display devices.
+ * @since Chrome 59
+ * @param flags Options affecting how the information is returned.
+ * @param callback The callback to invoke with the results.
+ */
+ export function getInfo(flags: DisplayInfoFlags, callback: (info: DisplayInfo[]) => void): void;
+ /**
+ * Requests the information for all attached display devices.
+ * @since Chrome 59
+ * @param flags Options affecting how the information is returned.
+ * @return The `getInfo` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function getInfo(flags: DisplayInfoFlags): Promise<DisplayInfo[]>;
+
+ /**
+ * requires(CrOS Kiosk apps | WebUI) This is only available to Chrome OS Kiosk apps and Web UI.
+ * @description Requests the layout info for all displays.
+ * @since Chrome 53
+ * @param callback The callback to invoke with the results.
+ */
+ export function getDisplayLayout(callback: (layouts: DisplayLayout[]) => void): void;
+
+ /**
+ * requires(CrOS Kiosk apps | WebUI) This is only available to Chrome OS Kiosk apps and Web UI.
+ * @description Requests the layout info for all displays.
+ * @since Chrome 53
+ * @return The getDisplayLayout method provides its result via callback or returned as a Promise (MV3 only).
+ */
+ export function getDisplayLayout(): Promise<DisplayLayout[]>;
+
+ /**
+ * requires(CrOS Kiosk apps | WebUI) This is only available to Chrome OS Kiosk apps and Web UI.
+ * @description
+ * Updates the properties for the display specified by **id**,
+ * according to the information provided in **info**.
+ * On failure, runtime.lastError will be set.
+ * @param id The display's unique identifier.
+ * @param info The information about display properties that should be changed. A property will be changed only if a new value for it is specified in |info|.
+ * @return The `setDisplayProperties` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters. To find out whether the function succeeded, runtime.lastError should be queried.
+ */
+ export function setDisplayProperties(id: string, info: DisplayPropertiesInfo): Promise<void>;
+
+ /**
+ * requires(CrOS Kiosk apps | WebUI) This is only available to Chrome OS Kiosk apps and Web UI.
+ * @description
+ * Updates the properties for the display specified by **id**,
+ * according to the information provided in **info**.
+ * On failure, runtime.lastError will be set.
+ * @param id The display's unique identifier.
+ * @param info The information about display properties that should be changed. A property will be changed only if a new value for it is specified in |info|.
+ * @param [callback] Empty function called when the function finishes. To find out whether the function succeeded, runtime.lastError should be queried.
+ */
+ export function setDisplayProperties(id: string, info: DisplayPropertiesInfo, callback: () => void): void;
+
+ /**
+ * requires(CrOS Kiosk apps | WebUI) This is only available to Chrome OS Kiosk apps and Web UI.
+ * @description
+ * Set the layout for all displays.
+ * Any display not included will use the default layout.
+ * If a layout would overlap or be otherwise invalid it will be adjusted to a valid layout.
+ * After layout is resolved, an onDisplayChanged event will be triggered.
+ * @since Chrome 53
+ * @param layouts The layout information, required for all displays except the primary display.
+ * @return The `setDisplayLayout` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters. To find out whether the function succeeded, runtime.lastError should be queried.
+ */
+ export function setDisplayLayout(layouts: DisplayLayout[]): Promise<void>;
+
+ /**
+ * requires(CrOS Kiosk apps | WebUI) This is only available to Chrome OS Kiosk apps and Web UI.
+ * @description
+ * Set the layout for all displays.
+ * Any display not included will use the default layout.
+ * If a layout would overlap or be otherwise invalid it will be adjusted to a valid layout.
+ * After layout is resolved, an onDisplayChanged event will be triggered.
+ * @since Chrome 53
+ * @param layouts The layout information, required for all displays except the primary display.
+ * @param callback Empty function called when the function finishes. To find out whether the function succeeded, runtime.lastError should be queried.
+ */
+ export function setDisplayLayout(layouts: DisplayLayout[], callback: () => void): void;
+
+ /**
+ * requires(CrOS Kiosk apps | WebUI) This is only available to Chrome OS Kiosk apps and Web UI.
+ * @description
+ * Enables/disables the unified desktop feature.
+ * Note that this simply enables the feature, but will not change the actual desktop mode.
+ * (That is, if the desktop is in mirror mode, it will stay in mirror mode)
+ * @since Chrome 46
+ * @param enabled True if unified desktop should be enabled.
+ */
+ export function enableUnifiedDesktop(enabled: boolean): void;
+ /**
+ * Starts overscan calibration for a display.
+ * This will show an overlay on the screen indicating the current overscan insets.
+ * If overscan calibration for display **id** is in progress this will reset calibration.
+ * @since Chrome 53
+ * @param id The display's unique identifier.
+ */
+ export function overscanCalibrationStart(id: string): void;
+ /**
+ * Adjusts the current overscan insets for a display.
+ * Typically this should etiher move the display along an axis (e.g. left+right have the same value)
+ * or scale it along an axis (e.g. top+bottom have opposite values).
+ * Each Adjust call is cumulative with previous calls since Start.
+ * @since Chrome 53
+ * @param id The display's unique identifier.
+ * @param delta The amount to change the overscan insets.
+ */
+ export function overscanCalibrationAdjust(id: string, delta: Insets): void;
+
+ /**
+ * Resets the overscan insets for a display to the last saved value (i.e before Start was called).
+ * @since Chrome 53
+ * @param id The display's unique identifier.
+ */
+ export function overscanCalibrationReset(id: string): void;
+
+ /**
+ * Complete overscan adjustments for a display by saving the current values and hiding the overlay.
+ * @since Chrome 53
+ * @param id The display's unique identifier.
+ */
+ export function overscanCalibrationComplete(id: string): void;
+
+ /**
+ * Displays the native touch calibration UX for the display with **id** as display id.
+ * This will show an overlay on the screen with required instructions on how to proceed.
+ * The callback will be invoked in case of successful calibraion only.
+ * If the calibration fails, this will throw an error.
+ * @since Chrome 57
+ * @param id The display's unique identifier.
+ * @param callback Optional callback to inform the caller that the touch calibration has ended. The argument of the callback informs if the calibration was a success or not.
+ */
+ export function showNativeTouchCalibration(id: string, callback: (success: boolean) => void): void;
+
+ /**
+ * Displays the native touch calibration UX for the display with **id** as display id.
+ * This will show an overlay on the screen with required instructions on how to proceed.
+ * The callback will be invoked in case of successful calibraion only.
+ * If the calibration fails, this will throw an error.
+ * @since Chrome 57
+ * @param id The display's unique identifier.
+ * @return The `showNativeTouchCalibration` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function showNativeTouchCalibration(id: string): Promise<boolean>;
+
+ /**
+ * Starts custom touch calibration for a display.
+ * This should be called when using a custom UX for collecting calibration data.
+ * If another touch calibration is already in progress this will throw an error.
+ * @since Chrome 57
+ * @param id The display's unique identifier.
+ */
+ export function startCustomTouchCalibration(id: string): void;
+
+ /**
+ * Sets the touch calibration pairs for a display.
+ * These **pairs** would be used to calibrate the touch screen for display with **id** called in startCustomTouchCalibration().
+ * Always call **startCustomTouchCalibration** before calling this method.
+ * If another touch calibration is already in progress this will throw an error.
+ * @since Chrome 57
+ * @param pairs The pairs of point used to calibrate the display.
+ * @param bounds Bounds of the display when the touch calibration was performed. |bounds.left| and |bounds.top| values are ignored.
+ * @throws Error
+ */
+ export function completeCustomTouchCalibration(pairs: TouchCalibrationPairs, bounds: Bounds): void;
+
+ /**
+ * Resets the touch calibration for the display and brings it back to its default state by clearing any touch calibration data associated with the display.
+ * @since Chrome 57
+ * @param id The display's unique identifier.
+ */
+ export function clearTouchCalibration(id: string): void;
+
+ /**
+ * requires(CrOS Kiosk app) Chrome OS Kiosk apps only
+ * @since Chrome 65.
+ * @description
+ * Sets the display mode to the specified mirror mode.
+ * Each call resets the state from previous calls.
+ * Calling setDisplayProperties() will fail for the
+ * mirroring destination displays.
+ */
+ export function setMirrorMode(info: MirrorModeInfo | MirrorModeInfoMixed, callback: () => void): void;
+
+ /**
+ * requires(CrOS Kiosk app) Chrome OS Kiosk apps only
+ * @since Chrome 65.
+ * @description
+ * Sets the display mode to the specified mirror mode.
+ * Each call resets the state from previous calls.
+ * Calling setDisplayProperties() will fail for the
+ * mirroring destination displays.
+ * @return The `setMirrorMode` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function setMirrorMode(info: MirrorModeInfo | MirrorModeInfoMixed): Promise<void>;
+
+ /**
+ * Fired when anything changes to the display configuration.
+ */
+ export const onDisplayChanged: chrome.events.Event<() => void>;
+}
+
+////////////////////
+// TabCapture
+////////////////////
+/**
+ * Use the chrome.tabCapture API to interact with tab media streams.
+ * Permissions: "tabCapture"
+ * @since Chrome 31.
+ */
+declare namespace chrome.tabCapture {
+ export interface CaptureInfo {
+ /** The id of the tab whose status changed. */
+ tabId: number;
+ /**
+ * The new capture status of the tab.
+ * One of: "pending", "active", "stopped", or "error"
+ */
+ status: string;
+ /** Whether an element in the tab being captured is in fullscreen mode. */
+ fullscreen: boolean;
+ }
+
+ export interface MediaStreamConstraint {
+ mandatory: object;
+ optional?: object | undefined;
+ }
+
+ export interface CaptureOptions {
+ /** Optional. */
+ audio?: boolean | undefined;
+ /** Optional. */
+ video?: boolean | undefined;
+ /** Optional. */
+ audioConstraints?: MediaStreamConstraint | undefined;
+ /** Optional. */
+ videoConstraints?: MediaStreamConstraint | undefined;
+ }
+
+ export interface GetMediaStreamOptions {
+ /** Optional tab id of the tab which will later invoke getUserMedia() to consume the stream. If not specified then the resulting stream can be used only by the calling extension. The stream can only be used by frames in the given tab whose security origin matches the consumber tab's origin. The tab's origin must be a secure origin, e.g. HTTPS. */
+ consumerTabId?: number | undefined;
+ /** Optional tab id of the tab which will be captured. If not specified then the current active tab will be selected. Only tabs for which the extension has been granted the activeTab permission can be used as the target tab. */
+ targetTabId?: number | undefined;
+ }
+
+ export interface CaptureStatusChangedEvent extends chrome.events.Event<(info: CaptureInfo) => void> {}
+
+ /**
+ * Captures the visible area of the currently active tab. Capture can only be started on the currently active tab after the extension has been invoked. Capture is maintained across page navigations within the tab, and stops when the tab is closed, or the media stream is closed by the extension.
+ * @param options Configures the returned media stream.
+ * @param callback Callback with either the tab capture stream or null.
+ */
+ export function capture(options: CaptureOptions, callback: (stream: MediaStream | null) => void): void;
+ /**
+ * Returns a list of tabs that have requested capture or are being captured, i.e. status != stopped and status != error. This allows extensions to inform the user that there is an existing tab capture that would prevent a new tab capture from succeeding (or to prevent redundant requests for the same tab).
+ * @param callback Callback invoked with CaptureInfo[] for captured tabs.
+ */
+ export function getCapturedTabs(callback: (result: CaptureInfo[]) => void): void;
+
+ /**
+ * Creates a stream ID to capture the target tab. Similar to chrome.tabCapture.capture() method, but returns a media stream ID, instead of a media stream, to the consumer tab.
+ * @param options Options for the media stream id to retrieve.
+ * @param callback Callback to invoke with the result. If successful, the result is an opaque string that can be passed to the getUserMedia() API to generate a media stream that corresponds to the target tab. The created streamId can only be used once and expires after a few seconds if it is not used.
+ */
+ export function getMediaStreamId(options: GetMediaStreamOptions, callback: (streamId: string) => void): void;
+
+ /** Event fired when the capture status of a tab changes. This allows extension authors to keep track of the capture status of tabs to keep UI elements like page actions in sync. */
+ export var onStatusChanged: CaptureStatusChangedEvent;
+}
+
+////////////////////
+// Tabs
+////////////////////
+/**
+ * Use the chrome.tabs API to interact with the browser's tab system. You can use this API to create, modify, and rearrange tabs in the browser.
+ * Permissions: The majority of the chrome.tabs API can be used without declaring any permission. However, the "tabs" permission is required in order to populate the url, title, and favIconUrl properties of Tab.
+ * @since Chrome 5.
+ */
+declare namespace chrome.tabs {
+ /**
+ * Tab muted state and the reason for the last state change.
+ * @since Chrome 46. Warning: this is the current Beta channel.
+ */
+ export interface MutedInfo {
+ /** Whether the tab is prevented from playing sound (but hasn't necessarily recently produced sound). Equivalent to whether the muted audio indicator is showing. */
+ muted: boolean;
+ /**
+ * Optional.
+ * The reason the tab was muted or unmuted. Not set if the tab's mute state has never been changed.
+ * "user": A user input action has set/overridden the muted state.
+ * "capture": Tab capture started, forcing a muted state change.
+ * "extension": An extension, identified by the extensionId field, set the muted state.
+ */
+ reason?: string | undefined;
+ /**
+ * Optional.
+ * The ID of the extension that changed the muted state. Not set if an extension was not the reason the muted state last changed.
+ */
+ extensionId?: string | undefined;
+ }
+
+ export interface Tab {
+ /**
+ * Optional.
+ * Either loading or complete.
+ */
+ status?: string | undefined;
+ /** The zero-based index of the tab within its window. */
+ index: number;
+ /**
+ * Optional.
+ * The ID of the tab that opened this tab, if any. This property is only present if the opener tab still exists.
+ * @since Chrome 18.
+ */
+ openerTabId?: number | undefined;
+ /**
+ * Optional.
+ * The title of the tab. This property is only present if the extension's manifest includes the "tabs" permission.
+ */
+ title?: string | undefined;
+ /**
+ * Optional.
+ * The URL the tab is displaying. This property is only present if the extension's manifest includes the "tabs" permission.
+ */
+ url?: string | undefined;
+ /**
+ * The URL the tab is navigating to, before it has committed.
+ * This property is only present if the extension's manifest includes the "tabs" permission and there is a pending navigation.
+ * @since Chrome 79.
+ */
+ pendingUrl?: string | undefined;
+ /**
+ * Whether the tab is pinned.
+ * @since Chrome 9.
+ */
+ pinned: boolean;
+ /**
+ * Whether the tab is highlighted.
+ * @since Chrome 16.
+ */
+ highlighted: boolean;
+ /** The ID of the window the tab is contained within. */
+ windowId: number;
+ /**
+ * Whether the tab is active in its window. (Does not necessarily mean the window is focused.)
+ * @since Chrome 16.
+ */
+ active: boolean;
+ /**
+ * Optional.
+ * The URL of the tab's favicon. This property is only present if the extension's manifest includes the "tabs" permission. It may also be an empty string if the tab is loading.
+ */
+ favIconUrl?: string | undefined;
+ /**
+ * Optional.
+ * The ID of the tab. Tab IDs are unique within a browser session. Under some circumstances a Tab may not be assigned an ID, for example when querying foreign tabs using the sessions API, in which case a session ID may be present. Tab ID can also be set to chrome.tabs.TAB_ID_NONE for apps and devtools windows.
+ */
+ id?: number | undefined;
+ /** Whether the tab is in an incognito window. */
+ incognito: boolean;
+ /**
+ * Whether the tab is selected.
+ * @deprecated since Chrome 33. Please use tabs.Tab.highlighted.
+ */
+ selected: boolean;
+ /**
+ * Optional.
+ * Whether the tab has produced sound over the past couple of seconds (but it might not be heard if also muted). Equivalent to whether the speaker audio indicator is showing.
+ * @since Chrome 45.
+ */
+ audible?: boolean | undefined;
+ /**
+ * Whether the tab is discarded. A discarded tab is one whose content has been unloaded from memory, but is still visible in the tab strip. Its content gets reloaded the next time it's activated.
+ * @since Chrome 54.
+ */
+ discarded: boolean;
+ /**
+ * Whether the tab can be discarded automatically by the browser when resources are low.
+ * @since Chrome 54.
+ */
+ autoDiscardable: boolean;
+ /**
+ * Optional.
+ * Current tab muted state and the reason for the last state change.
+ * @since Chrome 46. Warning: this is the current Beta channel.
+ */
+ mutedInfo?: MutedInfo | undefined;
+ /**
+ * Optional. The width of the tab in pixels.
+ * @since Chrome 31.
+ */
+ width?: number | undefined;
+ /**
+ * Optional. The height of the tab in pixels.
+ * @since Chrome 31.
+ */
+ height?: number | undefined;
+ /**
+ * Optional. The session ID used to uniquely identify a Tab obtained from the sessions API.
+ * @since Chrome 31.
+ */
+ sessionId?: string | undefined;
+ /**
+ * The ID of the group that the tab belongs to.
+ * @since Chrome 88
+ */
+ groupId: number;
+ }
+
+ /**
+ * Defines how zoom changes in a tab are handled and at what scope.
+ * @since Chrome 38.
+ */
+ export interface ZoomSettings {
+ /**
+ * Optional.
+ * Defines how zoom changes are handled, i.e. which entity is responsible for the actual scaling of the page; defaults to "automatic".
+ * "automatic": Zoom changes are handled automatically by the browser.
+ * "manual": Overrides the automatic handling of zoom changes. The onZoomChange event will still be dispatched, and it is the responsibility of the extension to listen for this event and manually scale the page. This mode does not support per-origin zooming, and will thus ignore the scope zoom setting and assume per-tab.
+ * "disabled": Disables all zooming in the tab. The tab will revert to the default zoom level, and all attempted zoom changes will be ignored.
+ */
+ mode?: string | undefined;
+ /**
+ * Optional.
+ * Defines whether zoom changes will persist for the page's origin, or only take effect in this tab; defaults to per-origin when in automatic mode, and per-tab otherwise.
+ * "per-origin": Zoom changes will persist in the zoomed page's origin, i.e. all other tabs navigated to that same origin will be zoomed as well. Moreover, per-origin zoom changes are saved with the origin, meaning that when navigating to other pages in the same origin, they will all be zoomed to the same zoom factor. The per-origin scope is only available in the automatic mode.
+ * "per-tab": Zoom changes only take effect in this tab, and zoom changes in other tabs will not affect the zooming of this tab. Also, per-tab zoom changes are reset on navigation; navigating a tab will always load pages with their per-origin zoom factors.
+ */
+ scope?: string | undefined;
+ /**
+ * Optional.
+ * Used to return the default zoom level for the current tab in calls to tabs.getZoomSettings.
+ * @since Chrome 43.
+ */
+ defaultZoomFactor?: number | undefined;
+ }
+
+ export interface InjectDetails {
+ /**
+ * Optional.
+ * If allFrames is true, implies that the JavaScript or CSS should be injected into all frames of current page. By default, it's false and is only injected into the top frame.
+ */
+ allFrames?: boolean | undefined;
+ /**
+ * Optional. JavaScript or CSS code to inject.
+ * Warning: Be careful using the code parameter. Incorrect use of it may open your extension to cross site scripting attacks.
+ */
+ code?: string | undefined;
+ /**
+ * Optional. The soonest that the JavaScript or CSS will be injected into the tab.
+ * One of: "document_start", "document_end", or "document_idle"
+ * @since Chrome 20.
+ */
+ runAt?: string | undefined;
+ /** Optional. JavaScript or CSS file to inject. */
+ file?: string | undefined;
+ /**
+ * Optional.
+ * The frame where the script or CSS should be injected. Defaults to 0 (the top-level frame).
+ * @since Chrome 39.
+ */
+ frameId?: number | undefined;
+ /**
+ * Optional.
+ * If matchAboutBlank is true, then the code is also injected in about:blank and about:srcdoc frames if your extension has access to its parent document. Code cannot be inserted in top-level about:-frames. By default it is false.
+ * @since Chrome 39.
+ */
+ matchAboutBlank?: boolean | undefined;
+ /**
+ * Optional. The origin of the CSS to inject. This may only be specified for CSS, not JavaScript. Defaults to "author".
+ * One of: "author", or "user"
+ * @since Chrome 66.
+ */
+ cssOrigin?: string | undefined;
+ }
+
+ export interface CreateProperties {
+ /** Optional. The position the tab should take in the window. The provided value will be clamped to between zero and the number of tabs in the window. */
+ index?: number | undefined;
+ /**
+ * Optional.
+ * The ID of the tab that opened this tab. If specified, the opener tab must be in the same window as the newly created tab.
+ * @since Chrome 18.
+ */
+ openerTabId?: number | undefined;
+ /**
+ * Optional.
+ * The URL to navigate the tab to initially. Fully-qualified URLs must include a scheme (i.e. 'http://www.google.com', not 'www.google.com'). Relative URLs will be relative to the current page within the extension. Defaults to the New Tab Page.
+ */
+ url?: string | undefined;
+ /**
+ * Optional. Whether the tab should be pinned. Defaults to false
+ * @since Chrome 9.
+ */
+ pinned?: boolean | undefined;
+ /** Optional. The window to create the new tab in. Defaults to the current window. */
+ windowId?: number | undefined;
+ /**
+ * Optional.
+ * Whether the tab should become the active tab in the window. Does not affect whether the window is focused (see windows.update). Defaults to true.
+ * @since Chrome 16.
+ */
+ active?: boolean | undefined;
+ /**
+ * Optional. Whether the tab should become the selected tab in the window. Defaults to true
+ * @deprecated since Chrome 33. Please use active.
+ */
+ selected?: boolean | undefined;
+ }
+
+ export interface MoveProperties {
+ /** The position to move the window to. -1 will place the tab at the end of the window. */
+ index: number;
+ /** Optional. Defaults to the window the tab is currently in. */
+ windowId?: number | undefined;
+ }
+
+ export interface UpdateProperties {
+ /**
+ * Optional. Whether the tab should be pinned.
+ * @since Chrome 9.
+ */
+ pinned?: boolean | undefined;
+ /**
+ * Optional. The ID of the tab that opened this tab. If specified, the opener tab must be in the same window as this tab.
+ * @since Chrome 18.
+ */
+ openerTabId?: number | undefined;
+ /** Optional. A URL to navigate the tab to. */
+ url?: string | undefined;
+ /**
+ * Optional. Adds or removes the tab from the current selection.
+ * @since Chrome 16.
+ */
+ highlighted?: boolean | undefined;
+ /**
+ * Optional. Whether the tab should be active. Does not affect whether the window is focused (see windows.update).
+ * @since Chrome 16.
+ */
+ active?: boolean | undefined;
+ /**
+ * Optional. Whether the tab should be selected.
+ * @deprecated since Chrome 33. Please use highlighted.
+ */
+ selected?: boolean | undefined;
+ /**
+ * Optional. Whether the tab should be muted.
+ * @since Chrome 45.
+ */
+ muted?: boolean | undefined;
+ /**
+ * Optional. Whether the tab should be discarded automatically by the browser when resources are low.
+ * @since Chrome 54.
+ */
+ autoDiscardable?: boolean | undefined;
+ }
+
+ export interface CaptureVisibleTabOptions {
+ /**
+ * Optional.
+ * When format is "jpeg", controls the quality of the resulting image. This value is ignored for PNG images. As quality is decreased, the resulting image will have more visual artifacts, and the number of bytes needed to store it will decrease.
+ */
+ quality?: number | undefined;
+ /**
+ * Optional. The format of an image.
+ * One of: "jpeg", or "png"
+ */
+ format?: string | undefined;
+ }
+
+ export interface ReloadProperties {
+ /** Optional. Whether using any local cache. Default is false. */
+ bypassCache?: boolean | undefined;
+ }
+
+ export interface ConnectInfo {
+ /** Optional. Will be passed into onConnect for content scripts that are listening for the connection event. */
+ name?: string | undefined;
+ /**
+ * Open a port to a specific frame identified by frameId instead of all frames in the tab.
+ * @since Chrome 41.
+ */
+ frameId?: number | undefined;
+ /**
+ * Optional. Open a port to a specific document identified by documentId instead of all frames in the tab.
+ * @since Chrome 106.
+ */
+ documentId?: string;
+ }
+
+ export interface MessageSendOptions {
+ /** Optional. Send a message to a specific frame identified by frameId instead of all frames in the tab. */
+ frameId?: number | undefined;
+ /**
+ * Optional. Send a message to a specific document identified by documentId instead of all frames in the tab.
+ * @since Chrome 106.
+ */
+ documentId?: string;
+ }
+
+ export interface GroupOptions {
+ /** Optional. Configurations for creating a group. Cannot be used if groupId is already specified. */
+ createProperties?: {
+ /** Optional. The window of the new group. Defaults to the current window. */
+ windowId?: number | undefined;
+ } | undefined;
+ /** Optional. The ID of the group to add the tabs to. If not specified, a new group will be created. */
+ groupId?: number | undefined;
+ /** TOptional. he tab ID or list of tab IDs to add to the specified group. */
+ tabIds?: number | number[] | undefined;
+ }
+
+ export interface HighlightInfo {
+ /** One or more tab indices to highlight. */
+ tabs: number | number[];
+ /** Optional. The window that contains the tabs. */
+ windowId?: number | undefined;
+ }
+
+ export interface QueryInfo {
+ /**
+ * Optional. Whether the tabs have completed loading.
+ * One of: "loading", or "complete"
+ */
+ status?: "loading" | "complete" | undefined;
+ /**
+ * Optional. Whether the tabs are in the last focused window.
+ * @since Chrome 19.
+ */
+ lastFocusedWindow?: boolean | undefined;
+ /** Optional. The ID of the parent window, or windows.WINDOW_ID_CURRENT for the current window. */
+ windowId?: number | undefined;
+ /**
+ * Optional. The type of window the tabs are in.
+ * One of: "normal", "popup", "panel", "app", or "devtools"
+ */
+ windowType?: "normal" | "popup" | "panel" | "app" | "devtools" | undefined;
+ /** Optional. Whether the tabs are active in their windows. */
+ active?: boolean | undefined;
+ /**
+ * Optional. The position of the tabs within their windows.
+ * @since Chrome 18.
+ */
+ index?: number | undefined;
+ /** Optional. Match page titles against a pattern. */
+ title?: string | undefined;
+ /** Optional. Match tabs against one or more URL patterns. Note that fragment identifiers are not matched. */
+ url?: string | string[] | undefined;
+ /**
+ * Optional. Whether the tabs are in the current window.
+ * @since Chrome 19.
+ */
+ currentWindow?: boolean | undefined;
+ /** Optional. Whether the tabs are highlighted. */
+ highlighted?: boolean | undefined;
+ /**
+ * Optional.
+ * Whether the tabs are discarded. A discarded tab is one whose content has been unloaded from memory, but is still visible in the tab strip. Its content gets reloaded the next time it's activated.
+ * @since Chrome 54.
+ */
+ discarded?: boolean | undefined;
+ /**
+ * Optional.
+ * Whether the tabs can be discarded automatically by the browser when resources are low.
+ * @since Chrome 54.
+ */
+ autoDiscardable?: boolean | undefined;
+ /** Optional. Whether the tabs are pinned. */
+ pinned?: boolean | undefined;
+ /**
+ * Optional. Whether the tabs are audible.
+ * @since Chrome 45.
+ */
+ audible?: boolean | undefined;
+ /**
+ * Optional. Whether the tabs are muted.
+ * @since Chrome 45.
+ */
+ muted?: boolean | undefined;
+ /**
+ * Optional. The ID of the group that the tabs are in, or chrome.tabGroups.TAB_GROUP_ID_NONE for ungrouped tabs.
+ * @since Chrome 88
+ */
+ groupId?: number | undefined;
+ }
+
+ export interface TabHighlightInfo {
+ windowId: number;
+ tabIds: number[];
+ }
+
+ export interface TabRemoveInfo {
+ /**
+ * The window whose tab is closed.
+ * @since Chrome 25.
+ */
+ windowId: number;
+ /** True when the tab is being closed because its window is being closed. */
+ isWindowClosing: boolean;
+ }
+
+ export interface TabAttachInfo {
+ newPosition: number;
+ newWindowId: number;
+ }
+
+ export interface TabChangeInfo {
+ /** Optional. The status of the tab. Can be either loading or complete. */
+ status?: string | undefined;
+ /**
+ * The tab's new pinned state.
+ * @since Chrome 9.
+ */
+ pinned?: boolean | undefined;
+ /** Optional. The tab's URL if it has changed. */
+ url?: string | undefined;
+ /**
+ * The tab's new audible state.
+ * @since Chrome 45.
+ */
+ audible?: boolean | undefined;
+ /**
+ * The tab's new discarded state.
+ * @since Chrome 54.
+ */
+ discarded?: boolean | undefined;
+ /**
+ * The tab's new auto-discardable
+ * @since Chrome 54.
+ */
+ autoDiscardable?: boolean | undefined;
+ /**
+ * The tab's new group.
+ * @since Chrome 88
+ */
+ groupId?: number | undefined;
+ /**
+ * The tab's new muted state and the reason for the change.
+ * @since Chrome 46. Warning: this is the current Beta channel.
+ */
+ mutedInfo?: MutedInfo | undefined;
+ /**
+ * The tab's new favicon URL.
+ * @since Chrome 27.
+ */
+ favIconUrl?: string | undefined;
+ /**
+ * The tab's new title.
+ * @since Chrome 48.
+ */
+ title?: string | undefined;
+ }
+
+ export interface TabMoveInfo {
+ toIndex: number;
+ windowId: number;
+ fromIndex: number;
+ }
+
+ export interface TabDetachInfo {
+ oldWindowId: number;
+ oldPosition: number;
+ }
+
+ export interface TabActiveInfo {
+ /** The ID of the tab that has become active. */
+ tabId: number;
+ /** The ID of the window the active tab changed inside of. */
+ windowId: number;
+ }
+
+ export interface TabWindowInfo {
+ /** The ID of the window of where the tab is located. */
+ windowId: number;
+ }
+
+ export interface ZoomChangeInfo {
+ tabId: number;
+ oldZoomFactor: number;
+ newZoomFactor: number;
+ zoomSettings: ZoomSettings;
+ }
+
+ export interface TabHighlightedEvent extends chrome.events.Event<(highlightInfo: TabHighlightInfo) => void> {}
+
+ export interface TabRemovedEvent extends chrome.events.Event<(tabId: number, removeInfo: TabRemoveInfo) => void> {}
+
+ export interface TabUpdatedEvent
+ extends chrome.events.Event<(tabId: number, changeInfo: TabChangeInfo, tab: Tab) => void>
+ {}
+
+ export interface TabAttachedEvent extends chrome.events.Event<(tabId: number, attachInfo: TabAttachInfo) => void> {}
+
+ export interface TabMovedEvent extends chrome.events.Event<(tabId: number, moveInfo: TabMoveInfo) => void> {}
+
+ export interface TabDetachedEvent extends chrome.events.Event<(tabId: number, detachInfo: TabDetachInfo) => void> {}
+
+ export interface TabCreatedEvent extends chrome.events.Event<(tab: Tab) => void> {}
+
+ export interface TabActivatedEvent extends chrome.events.Event<(activeInfo: TabActiveInfo) => void> {}
+
+ export interface TabReplacedEvent extends chrome.events.Event<(addedTabId: number, removedTabId: number) => void> {}
+
+ export interface TabSelectedEvent extends chrome.events.Event<(tabId: number, selectInfo: TabWindowInfo) => void> {}
+
+ export interface TabZoomChangeEvent extends chrome.events.Event<(ZoomChangeInfo: ZoomChangeInfo) => void> {}
+
+ /**
+ * Injects JavaScript code into a page. For details, see the programmatic injection section of the content scripts doc.
+ * @param details Details of the script or CSS to inject. Either the code or the file property must be set, but both may not be set at the same time.
+ * @return The `executeScript` method provides its result via callback or returned as a `Promise` (MV3 only). The result of the script in every injected frame.
+ */
+ export function executeScript(details: InjectDetails): Promise<any[]>;
+ /**
+ * Injects JavaScript code into a page. For details, see the programmatic injection section of the content scripts doc.
+ * @param details Details of the script or CSS to inject. Either the code or the file property must be set, but both may not be set at the same time.
+ * @param callback Optional. Called after all the JavaScript has been executed.
+ * Parameter result: The result of the script in every injected frame.
+ */
+ export function executeScript(details: InjectDetails, callback?: (result: any[]) => void): void;
+ /**
+ * Injects JavaScript code into a page. For details, see the programmatic injection section of the content scripts doc.
+ * @param tabId Optional. The ID of the tab in which to run the script; defaults to the active tab of the current window.
+ * @param details Details of the script or CSS to inject. Either the code or the file property must be set, but both may not be set at the same time.
+ * @return The `executeScript` method provides its result via callback or returned as a `Promise` (MV3 only). The result of the script in every injected frame.
+ */
+ export function executeScript(tabId: number, details: InjectDetails): Promise<any[]>;
+ /**
+ * Injects JavaScript code into a page. For details, see the programmatic injection section of the content scripts doc.
+ * @param tabId Optional. The ID of the tab in which to run the script; defaults to the active tab of the current window.
+ * @param details Details of the script or CSS to inject. Either the code or the file property must be set, but both may not be set at the same time.
+ * @param callback Optional. Called after all the JavaScript has been executed.
+ * Parameter result: The result of the script in every injected frame.
+ */
+ export function executeScript(tabId: number, details: InjectDetails, callback?: (result: any[]) => void): void;
+ /** Retrieves details about the specified tab. */
+ export function get(tabId: number, callback: (tab: Tab) => void): void;
+ /**
+ * Retrieves details about the specified tab.
+ * @return The `get` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function get(tabId: number): Promise<Tab>;
+ /**
+ * Gets details about all tabs in the specified window.
+ * @deprecated since Chrome 33. Please use tabs.query {windowId: windowId}.
+ */
+ export function getAllInWindow(callback: (tab: Tab) => void): void;
+ /**
+ * Gets details about all tabs in the specified window.
+ * @return The `getAllInWindow` method provides its result via callback or returned as a `Promise` (MV3 only).
+ * @deprecated since Chrome 33. Please use tabs.query {windowId: windowId}.
+ */
+ export function getAllInWindow(): Promise<Tab>;
+ /**
+ * Gets details about all tabs in the specified window.
+ * @deprecated since Chrome 33. Please use tabs.query {windowId: windowId}.
+ * @param windowId Optional. Defaults to the current window.
+ */
+ export function getAllInWindow(windowId: number, callback: (tab: Tab) => void): void;
+ /**
+ * Gets details about all tabs in the specified window.
+ * @deprecated since Chrome 33. Please use tabs.query {windowId: windowId}.
+ * @param windowId Optional. Defaults to the current window.
+ * @return The `getAllInWindow` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function getAllInWindow(windowId: number): Promise<Tab>;
+ /** Gets the tab that this script call is being made from. May be undefined if called from a non-tab context (for example: a background page or popup view). */
+ export function getCurrent(callback: (tab?: Tab) => void): void;
+ /**
+ * Gets the tab that this script call is being made from. May be undefined if called from a non-tab context (for example: a background page or popup view).
+ * @return The `getCurrent` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function getCurrent(): Promise<Tab | undefined>;
+ /**
+ * Gets the tab that is selected in the specified window.
+ * @deprecated since Chrome 33. Please use tabs.query {active: true}.
+ */
+ export function getSelected(callback: (tab: Tab) => void): void;
+ /**
+ * Gets the tab that is selected in the specified window.
+ * @return The `getSelected` method provides its result via callback or returned as a `Promise` (MV3 only).
+ * @deprecated since Chrome 33. Please use tabs.query {active: true}.
+ */
+ export function getSelected(): Promise<Tab>;
+ /**
+ * Gets the tab that is selected in the specified window.
+ * @deprecated since Chrome 33. Please use tabs.query {active: true}.
+ * @param windowId Optional. Defaults to the current window.
+ */
+ export function getSelected(windowId: number, callback: (tab: Tab) => void): void;
+ /**
+ * Gets the tab that is selected in the specified window.
+ * @deprecated since Chrome 33. Please use tabs.query {active: true}.
+ * @param windowId Optional. Defaults to the current window.
+ * @return The `getSelected` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function getSelected(windowId: number): Promise<Tab>;
+ /**
+ * Creates a new tab.
+ * @return The `create` method provides its result via callback or returned as a `Promise` (MV3 only). Details about the created tab. Will contain the ID of the new tab.
+ */
+ export function create(createProperties: CreateProperties): Promise<Tab>;
+ /**
+ * Creates a new tab.
+ * @param callback Optional.
+ * Parameter tab: Details about the created tab. Will contain the ID of the new tab.
+ */
+ export function create(createProperties: CreateProperties, callback: (tab: Tab) => void): void;
+ /**
+ * Moves one or more tabs to a new position within its window, or to a new window. Note that tabs can only be moved to and from normal (window.type === "normal") windows.
+ * @param tabId The tab to move.
+ * @return The `move` method provides its result via callback or returned as a `Promise` (MV3 only). Details about the moved tab.
+ */
+ export function move(tabId: number, moveProperties: MoveProperties): Promise<Tab>;
+ /**
+ * Moves one or more tabs to a new position within its window, or to a new window. Note that tabs can only be moved to and from normal (window.type === "normal") windows.
+ * @param tabId The tab to move.
+ * @param callback Optional.
+ * Parameter tab: Details about the moved tab.
+ */
+ export function move(tabId: number, moveProperties: MoveProperties, callback: (tab: Tab) => void): void;
+ /**
+ * Moves one or more tabs to a new position within its window, or to a new window. Note that tabs can only be moved to and from normal (window.type === "normal") windows.
+ * @param tabIds The tabs to move.
+ * @return The `move` method provides its result via callback or returned as a `Promise` (MV3 only). Details about the moved tabs.
+ */
+ export function move(tabIds: number[], moveProperties: MoveProperties): Promise<Tab[]>;
+ /**
+ * Moves one or more tabs to a new position within its window, or to a new window. Note that tabs can only be moved to and from normal (window.type === "normal") windows.
+ * @param tabIds The tabs to move.
+ * @param callback Optional.
+ * Parameter tabs: Details about the moved tabs.
+ */
+ export function move(tabIds: number[], moveProperties: MoveProperties, callback: (tabs: Tab[]) => void): void;
+ /**
+ * Modifies the properties of a tab. Properties that are not specified in updateProperties are not modified.
+ * @return The `update` method provides its result via callback or returned as a `Promise` (MV3 only). Details about the updated tab. The tabs.Tab object doesn't contain url, title and favIconUrl if the "tabs" permission has not been requested.
+ */
+ export function update(updateProperties: UpdateProperties): Promise<Tab>;
+ /**
+ * Modifies the properties of a tab. Properties that are not specified in updateProperties are not modified.
+ * @param callback Optional.
+ * Optional parameter tab: Details about the updated tab. The tabs.Tab object doesn't contain url, title and favIconUrl if the "tabs" permission has not been requested.
+ */
+ export function update(updateProperties: UpdateProperties, callback: (tab?: Tab) => void): void;
+ /**
+ * Modifies the properties of a tab. Properties that are not specified in updateProperties are not modified.
+ * @param tabId Defaults to the selected tab of the current window.
+ * @return The `update` method provides its result via callback or returned as a `Promise` (MV3 only). Details about the updated tab. The tabs.Tab object doesn't contain url, title and favIconUrl if the "tabs" permission has not been requested.
+ */
+ export function update(tabId: number, updateProperties: UpdateProperties): Promise<Tab>;
+ /**
+ * Modifies the properties of a tab. Properties that are not specified in updateProperties are not modified.
+ * @param tabId Defaults to the selected tab of the current window.
+ * @param callback Optional.
+ * Optional parameter tab: Details about the updated tab. The tabs.Tab object doesn't contain url, title and favIconUrl if the "tabs" permission has not been requested.
+ */
+ export function update(tabId: number, updateProperties: UpdateProperties, callback: (tab?: Tab) => void): void;
+ /**
+ * Closes a tab.
+ * @param tabId The tab to close.
+ * @return The `remove` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function remove(tabId: number): Promise<void>;
+ /**
+ * Closes a tab.
+ * @param tabId The tab to close.
+ */
+ export function remove(tabId: number, callback: Function): void;
+ /**
+ * Closes several tabs.
+ * @param tabIds The list of tabs to close.
+ * @return The `remove` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function remove(tabIds: number[]): Promise<void>;
+ /**
+ * Closes several tabs.
+ * @param tabIds The list of tabs to close.
+ */
+ export function remove(tabIds: number[], callback: Function): void;
+ /**
+ * Captures the visible area of the currently active tab in the specified window. You must have <all_urls> permission to use this method.
+ * @param callback
+ * Parameter dataUrl: A data URL which encodes an image of the visible area of the captured tab. May be assigned to the 'src' property of an HTML Image element for display.
+ */
+ export function captureVisibleTab(callback: (dataUrl: string) => void): void;
+ /**
+ * Captures the visible area of the currently active tab in the specified window. You must have <all_urls> permission to use this method.
+ * @return The `captureVisibleTab` method provides its result via callback or returned as a `Promise` (MV3 only). A data URL which encodes an image of the visible area of the captured tab. May be assigned to the 'src' property of an HTML Image element for display.
+ */
+ export function captureVisibleTab(): Promise<string>;
+ /**
+ * Captures the visible area of the currently active tab in the specified window. You must have <all_urls> permission to use this method.
+ * @param windowId Optional. The target window. Defaults to the current window.
+ * @param callback
+ * Parameter dataUrl: A data URL which encodes an image of the visible area of the captured tab. May be assigned to the 'src' property of an HTML Image element for display.
+ */
+ export function captureVisibleTab(windowId: number, callback: (dataUrl: string) => void): void;
+ /**
+ * Captures the visible area of the currently active tab in the specified window. You must have <all_urls> permission to use this method.
+ * @param windowId Optional. The target window. Defaults to the current window.
+ * @return The `captureVisibleTab` method provides its result via callback or returned as a `Promise` (MV3 only). A data URL which encodes an image of the visible area of the captured tab. May be assigned to the 'src' property of an HTML Image element for display.
+ */
+ export function captureVisibleTab(windowId: number): Promise<string>;
+ /**
+ * Captures the visible area of the currently active tab in the specified window. You must have <all_urls> permission to use this method.
+ * @param options Optional. Details about the format and quality of an image.
+ * @return The `captureVisibleTab` method provides its result via callback or returned as a `Promise` (MV3 only). A data URL which encodes an image of the visible area of the captured tab. May be assigned to the 'src' property of an HTML Image element for display.
+ */
+ export function captureVisibleTab(options: CaptureVisibleTabOptions): Promise<string>;
+ /**
+ * Captures the visible area of the currently active tab in the specified window. You must have <all_urls> permission to use this method.
+ * @param options Optional. Details about the format and quality of an image.
+ * @param callback
+ * Parameter dataUrl: A data URL which encodes an image of the visible area of the captured tab. May be assigned to the 'src' property of an HTML Image element for display.
+ */
+ export function captureVisibleTab(options: CaptureVisibleTabOptions, callback: (dataUrl: string) => void): void;
+ /**
+ * Captures the visible area of the currently active tab in the specified window. You must have <all_urls> permission to use this method.
+ * @param windowId Optional. The target window. Defaults to the current window.
+ * @param options Optional. Details about the format and quality of an image.
+ * @return The `captureVisibleTab` method provides its result via callback or returned as a `Promise` (MV3 only). A data URL which encodes an image of the visible area of the captured tab. May be assigned to the 'src' property of an HTML Image element for display.
+ */
+ export function captureVisibleTab(
+ windowId: number,
+ options: CaptureVisibleTabOptions,
+ ): Promise<string>;
+ /**
+ * Captures the visible area of the currently active tab in the specified window. You must have <all_urls> permission to use this method.
+ * @param windowId Optional. The target window. Defaults to the current window.
+ * @param options Optional. Details about the format and quality of an image.
+ * @param callback
+ * Parameter dataUrl: A data URL which encodes an image of the visible area of the captured tab. May be assigned to the 'src' property of an HTML Image element for display.
+ */
+ export function captureVisibleTab(
+ windowId: number,
+ options: CaptureVisibleTabOptions,
+ callback: (dataUrl: string) => void,
+ ): void;
+ /**
+ * Reload a tab.
+ * @since Chrome 16.
+ * @param tabId The ID of the tab to reload; defaults to the selected tab of the current window.
+ * @return The `reload` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function reload(tabId: number, reloadProperties?: ReloadProperties): Promise<void>;
+ /**
+ * Reload a tab.
+ * @since Chrome 16.
+ * @param tabId The ID of the tab to reload; defaults to the selected tab of the current window.
+ */
+ export function reload(tabId: number, reloadProperties?: ReloadProperties, callback?: () => void): void;
+ /**
+ * Reload the selected tab of the current window.
+ * @since Chrome 16.
+ * @return The `reload` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function reload(reloadProperties: ReloadProperties): Promise<void>;
+ /**
+ * Reload the selected tab of the current window.
+ * @since Chrome 16.
+ */
+ export function reload(reloadProperties: ReloadProperties, callback: () => void): void;
+ /**
+ * Reload the selected tab of the current window.
+ * @since Chrome 16.
+ * @return The `reload` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function reload(): Promise<void>;
+ /**
+ * Reload the selected tab of the current window.
+ * @since Chrome 16.
+ */
+ export function reload(callback: () => void): void;
+ /**
+ * Duplicates a tab.
+ * @since Chrome 23.
+ * @param tabId The ID of the tab which is to be duplicated.
+ * @return The `duplicate` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function duplicate(tabId: number): Promise<Tab | undefined>;
+ /**
+ * Duplicates a tab.
+ * @since Chrome 23.
+ * @param tabId The ID of the tab which is to be duplicated.
+ * @param callback Optional.
+ * Optional parameter tab: Details about the duplicated tab. The tabs.Tab object doesn't contain url, title and favIconUrl if the "tabs" permission has not been requested.
+ */
+ export function duplicate(tabId: number, callback: (tab?: Tab) => void): void;
+ /**
+ * Sends a single message to the content script(s) in the specified tab, with an optional callback to run when a response is sent back. The runtime.onMessage event is fired in each content script running in the specified tab for the current extension.
+ * @since Chrome 20.
+ */
+ export function sendMessage<M = any, R = any>(
+ tabId: number,
+ message: M,
+ responseCallback: (response: R) => void,
+ ): void;
+ /**
+ * Sends a single message to the content script(s) in the specified tab, with an optional callback to run when a response is sent back. The runtime.onMessage event is fired in each content script running in the specified tab for the current extension.
+ * @since Chrome 41.
+ * @param responseCallback Optional.
+ * Parameter response: The JSON response object sent by the handler of the message. If an error occurs while connecting to the specified tab, the callback will be called with no arguments and runtime.lastError will be set to the error message.
+ */
+ export function sendMessage<M = any, R = any>(
+ tabId: number,
+ message: M,
+ options: MessageSendOptions,
+ responseCallback: (response: R) => void,
+ ): void;
+ /**
+ * Sends a single message to the content script(s) in the specified tab, with an optional callback to run when a response is sent back. The runtime.onMessage event is fired in each content script running in the specified tab for the current extension.
+ * @since Chrome 99
+ */
+ export function sendMessage<M = any, R = any>(tabId: number, message: M): Promise<R>;
+ /**
+ * Sends a single message to the content script(s) in the specified tab, with an optional callback to run when a response is sent back. The runtime.onMessage event is fired in each content script running in the specified tab for the current extension.
+ * @since Chrome 99
+ */
+ export function sendMessage<M = any, R = any>(
+ tabId: number,
+ message: M,
+ options: MessageSendOptions,
+ ): Promise<R>;
+ /**
+ * Sends a single request to the content script(s) in the specified tab, with an optional callback to run when a response is sent back. The extension.onRequest event is fired in each content script running in the specified tab for the current extension.
+ * @deprecated since Chrome 33. Please use runtime.sendMessage.
+ * @param responseCallback Optional.
+ * Parameter response: The JSON response object sent by the handler of the request. If an error occurs while connecting to the specified tab, the callback will be called with no arguments and runtime.lastError will be set to the error message.
+ */
+ export function sendRequest<Request = any, Response = any>(
+ tabId: number,
+ request: Request,
+ responseCallback?: (response: Response) => void,
+ ): void;
+ /** Connects to the content script(s) in the specified tab. The runtime.onConnect event is fired in each content script running in the specified tab for the current extension. */
+ export function connect(tabId: number, connectInfo?: ConnectInfo): runtime.Port;
+ /**
+ * Injects CSS into a page. For details, see the programmatic injection section of the content scripts doc.
+ * @param details Details of the script or CSS to inject. Either the code or the file property must be set, but both may not be set at the same time.
+ * @return The `insertCSS` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function insertCSS(details: InjectDetails): Promise<void>;
+ /**
+ * Injects CSS into a page. For details, see the programmatic injection section of the content scripts doc.
+ * @param details Details of the script or CSS to inject. Either the code or the file property must be set, but both may not be set at the same time.
+ * @param callback Optional. Called when all the CSS has been inserted.
+ */
+ export function insertCSS(details: InjectDetails, callback: Function): void;
+ /**
+ * Injects CSS into a page. For details, see the programmatic injection section of the content scripts doc.
+ * @param tabId Optional. The ID of the tab in which to insert the CSS; defaults to the active tab of the current window.
+ * @param details Details of the script or CSS to inject. Either the code or the file property must be set, but both may not be set at the same time.
+ * @return The `insertCSS` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function insertCSS(tabId: number, details: InjectDetails): Promise<void>;
+ /**
+ * Injects CSS into a page. For details, see the programmatic injection section of the content scripts doc.
+ * @param tabId Optional. The ID of the tab in which to insert the CSS; defaults to the active tab of the current window.
+ * @param details Details of the script or CSS to inject. Either the code or the file property must be set, but both may not be set at the same time.
+ * @param callback Optional. Called when all the CSS has been inserted.
+ */
+ export function insertCSS(tabId: number, details: InjectDetails, callback: Function): void;
+ /**
+ * Highlights the given tabs.
+ * @since Chrome 16.
+ * @return The `highlight` method provides its result via callback or returned as a `Promise` (MV3 only). Contains details about the window whose tabs were highlighted.
+ */
+ export function highlight(highlightInfo: HighlightInfo): Promise<chrome.windows.Window>;
+ /**
+ * Highlights the given tabs.
+ * @since Chrome 16.
+ * @param callback Optional.
+ * Parameter window: Contains details about the window whose tabs were highlighted.
+ */
+ export function highlight(highlightInfo: HighlightInfo, callback: (window: chrome.windows.Window) => void): void;
+ /**
+ * Gets all tabs that have the specified properties, or all tabs if no properties are specified.
+ * @since Chrome 16.
+ */
+ export function query(queryInfo: QueryInfo, callback: (result: Tab[]) => void): void;
+ /**
+ * Gets all tabs that have the specified properties, or all tabs if no properties are specified.
+ * @since Chrome 16.
+ * @return The `query` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function query(queryInfo: QueryInfo): Promise<Tab[]>;
+ /**
+ * Detects the primary language of the content in a tab.
+ * @param callback
+ * Parameter language: An ISO language code such as en or fr. For a complete list of languages supported by this method, see kLanguageInfoTable. The 2nd to 4th columns will be checked and the first non-NULL value will be returned except for Simplified Chinese for which zh-CN will be returned. For an unknown language, und will be returned.
+ */
+ export function detectLanguage(callback: (language: string) => void): void;
+ /**
+ * Detects the primary language of the content in a tab.
+ * @return The `detectLanguage` method provides its result via callback or returned as a `Promise` (MV3 only). An ISO language code such as en or fr. For a complete list of languages supported by this method, see kLanguageInfoTable. The 2nd to 4th columns will be checked and the first non-NULL value will be returned except for Simplified Chinese for which zh-CN will be returned. For an unknown language, und will be returned.
+ */
+ export function detectLanguage(): Promise<string>;
+ /**
+ * Detects the primary language of the content in a tab.
+ * @param tabId Optional. Defaults to the active tab of the current window.
+ * @param callback
+ * Parameter language: An ISO language code such as en or fr. For a complete list of languages supported by this method, see kLanguageInfoTable. The 2nd to 4th columns will be checked and the first non-NULL value will be returned except for Simplified Chinese for which zh-CN will be returned. For an unknown language, und will be returned.
+ */
+ export function detectLanguage(tabId: number, callback: (language: string) => void): void;
+ /**
+ * Detects the primary language of the content in a tab.
+ * @param tabId Optional. Defaults to the active tab of the current window.
+ * @return The `detectLanguage` method provides its result via callback or returned as a `Promise` (MV3 only). An ISO language code such as en or fr. For a complete list of languages supported by this method, see kLanguageInfoTable. The 2nd to 4th columns will be checked and the first non-NULL value will be returned except for Simplified Chinese for which zh-CN will be returned. For an unknown language, und will be returned.
+ */
+ export function detectLanguage(tabId: number): Promise<string>;
+ /**
+ * Zooms a specified tab.
+ * @since Chrome 42.
+ * @param zoomFactor The new zoom factor. Use a value of 0 here to set the tab to its current default zoom factor. Values greater than zero specify a (possibly non-default) zoom factor for the tab.
+ * @return The `setZoom` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function setZoom(zoomFactor: number): Promise<void>;
+ /**
+ * Zooms a specified tab.
+ * @since Chrome 42.
+ * @param zoomFactor The new zoom factor. Use a value of 0 here to set the tab to its current default zoom factor. Values greater than zero specify a (possibly non-default) zoom factor for the tab.
+ * @param callback Optional. Called after the zoom factor has been changed.
+ */
+ export function setZoom(zoomFactor: number, callback: () => void): void;
+ /**
+ * Zooms a specified tab.
+ * @since Chrome 42.
+ * @param tabId Optional. The ID of the tab to zoom; defaults to the active tab of the current window.
+ * @param zoomFactor The new zoom factor. Use a value of 0 here to set the tab to its current default zoom factor. Values greater than zero specify a (possibly non-default) zoom factor for the tab.
+ * @return The `setZoom` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function setZoom(tabId: number, zoomFactor: number): Promise<void>;
+ /**
+ * Zooms a specified tab.
+ * @since Chrome 42.
+ * @param tabId Optional. The ID of the tab to zoom; defaults to the active tab of the current window.
+ * @param zoomFactor The new zoom factor. Use a value of 0 here to set the tab to its current default zoom factor. Values greater than zero specify a (possibly non-default) zoom factor for the tab.
+ * @param callback Optional. Called after the zoom factor has been changed.
+ */
+ export function setZoom(tabId: number, zoomFactor: number, callback: () => void): void;
+ /**
+ * Gets the current zoom factor of a specified tab.
+ * @since Chrome 42.
+ * @param callback Called with the tab's current zoom factor after it has been fetched.
+ * Parameter zoomFactor: The tab's current zoom factor.
+ */
+ export function getZoom(callback: (zoomFactor: number) => void): void;
+ /**
+ * Gets the current zoom factor of a specified tab.
+ * @since Chrome 42.
+ * @return The `getZoom` method provides its result via callback or returned as a `Promise` (MV3 only). The tab's current zoom factor.
+ */
+ export function getZoom(): Promise<number>;
+ /**
+ * Gets the current zoom factor of a specified tab.
+ * @since Chrome 42.
+ * @param tabId Optional. The ID of the tab to get the current zoom factor from; defaults to the active tab of the current window.
+ * @param callback Called with the tab's current zoom factor after it has been fetched.
+ * Parameter zoomFactor: The tab's current zoom factor.
+ */
+ export function getZoom(tabId: number, callback: (zoomFactor: number) => void): void;
+ /**
+ * Gets the current zoom factor of a specified tab.
+ * @since Chrome 42.
+ * @param tabId Optional. The ID of the tab to get the current zoom factor from; defaults to the active tab of the current window.
+ * @return The `getZoom` method provides its result via callback or returned as a `Promise` (MV3 only). The tab's current zoom factor.
+ */
+ export function getZoom(tabId: number): Promise<number>;
+ /**
+ * Sets the zoom settings for a specified tab, which define how zoom changes are handled. These settings are reset to defaults upon navigating the tab.
+ * @since Chrome 42.
+ * @param zoomSettings Defines how zoom changes are handled and at what scope.
+ * @return The `setZoomSettings` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function setZoomSettings(zoomSettings: ZoomSettings): Promise<void>;
+ /**
+ * Sets the zoom settings for a specified tab, which define how zoom changes are handled. These settings are reset to defaults upon navigating the tab.
+ * @since Chrome 42.
+ * @param zoomSettings Defines how zoom changes are handled and at what scope.
+ * @param callback Optional. Called after the zoom settings have been changed.
+ */
+ export function setZoomSettings(zoomSettings: ZoomSettings, callback: () => void): void;
+ /**
+ * Sets the zoom settings for a specified tab, which define how zoom changes are handled. These settings are reset to defaults upon navigating the tab.
+ * @since Chrome 42.
+ * @param tabId Optional. The ID of the tab to change the zoom settings for; defaults to the active tab of the current window.
+ * @param zoomSettings Defines how zoom changes are handled and at what scope.
+ * @return The `setZoomSettings` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function setZoomSettings(tabId: number, zoomSettings: ZoomSettings): Promise<void>;
+ /**
+ * Sets the zoom settings for a specified tab, which define how zoom changes are handled. These settings are reset to defaults upon navigating the tab.
+ * @since Chrome 42.
+ * @param tabId Optional. The ID of the tab to change the zoom settings for; defaults to the active tab of the current window.
+ * @param zoomSettings Defines how zoom changes are handled and at what scope.
+ * @param callback Optional. Called after the zoom settings have been changed.
+ */
+ export function setZoomSettings(tabId: number, zoomSettings: ZoomSettings, callback: () => void): void;
+ /**
+ * Gets the current zoom settings of a specified tab.
+ * @since Chrome 42.
+ * @param callback Called with the tab's current zoom settings.
+ * Parameter zoomSettings: The tab's current zoom settings.
+ */
+ export function getZoomSettings(callback: (zoomSettings: ZoomSettings) => void): void;
+ /**
+ * Gets the current zoom settings of a specified tab.
+ * @since Chrome 42.
+ * @return The `getZoomSettings` method provides its result via callback or returned as a `Promise` (MV3 only). The tab's current zoom settings.
+ */
+ export function getZoomSettings(): Promise<ZoomSettings>;
+ /**
+ * Gets the current zoom settings of a specified tab.
+ * @since Chrome 42.
+ * @param tabId Optional. The ID of the tab to get the current zoom settings from; defaults to the active tab of the current window.
+ * @param callback Called with the tab's current zoom settings.
+ * Parameter zoomSettings: The tab's current zoom settings.
+ */
+ export function getZoomSettings(tabId: number, callback: (zoomSettings: ZoomSettings) => void): void;
+ /**
+ * Gets the current zoom settings of a specified tab.
+ * @since Chrome 42.
+ * @param tabId Optional. The ID of the tab to get the current zoom settings from; defaults to the active tab of the current window.
+ * @return The `getZoomSettings` method provides its result via callback or returned as a `Promise` (MV3 only). The tab's current zoom settings.
+ */
+ export function getZoomSettings(tabId: number): Promise<ZoomSettings>;
+ /**
+ * Discards a tab from memory. Discarded tabs are still visible on the tab strip and are reloaded when activated.
+ * @since Chrome 54.
+ * @param tabId Optional. The ID of the tab to be discarded. If specified, the tab will be discarded unless it's active or already discarded. If omitted, the browser will discard the least important tab. This can fail if no discardable tabs exist.
+ * @return The `discard` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function discard(tabId?: number): Promise<Tab>;
+ /**
+ * Discards a tab from memory. Discarded tabs are still visible on the tab strip and are reloaded when activated.
+ * @since Chrome 54.
+ * @param tabId Optional. The ID of the tab to be discarded. If specified, the tab will be discarded unless it's active or already discarded. If omitted, the browser will discard the least important tab. This can fail if no discardable tabs exist.
+ * @param callback Called after the operation is completed.
+ */
+ export function discard(callback: (tab: Tab) => void): void;
+ export function discard(tabId: number, callback: (tab: Tab) => void): void;
+ /**
+ * Go forward to the next page, if one is available.
+ * @since Chrome 72.
+ * @return The `goForward` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function goForward(): Promise<void>;
+ /**
+ * Go forward to the next page, if one is available.
+ * @since Chrome 72.
+ * @param callback Optional. Called after the operation is completed.
+ */
+ export function goForward(callback: () => void): void;
+ /**
+ * Go forward to the next page, if one is available.
+ * @since Chrome 72.
+ * @param tabId Optional. The ID of the tab to navigate forward; defaults to the selected tab of the current window.
+ * @return The `goForward` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function goForward(tabId: number): Promise<void>;
+ /**
+ * Go forward to the next page, if one is available.
+ * @since Chrome 72.
+ * @param tabId Optional. The ID of the tab to navigate forward; defaults to the selected tab of the current window.
+ * @param callback Optional. Called after the operation is completed.
+ */
+ export function goForward(tabId: number, callback: () => void): void;
+ /**
+ * Go back to the previous page, if one is available.
+ * @since Chrome 72.
+ * @return The `goBack` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function goBack(): Promise<void>;
+ /**
+ * Go back to the previous page, if one is available.
+ * @since Chrome 72.
+ * @param callback Optional. Called after the operation is completed.
+ */
+ export function goBack(callback: () => void): void;
+ /**
+ * Go back to the previous page, if one is available.
+ * @since Chrome 72.
+ * @param tabId Optional. The ID of the tab to navigate back; defaults to the selected tab of the current window.
+ * @return The `goBack` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function goBack(tabId: number): Promise<void>;
+ /**
+ * Go back to the previous page, if one is available.
+ * @since Chrome 72.
+ * @param tabId Optional. The ID of the tab to navigate back; defaults to the selected tab of the current window.
+ * @param callback Optional. Called after the operation is completed.
+ */
+ export function goBack(tabId: number, callback: () => void): void;
+ /**
+ * Adds one or more tabs to a specified group, or if no group is specified, adds the given tabs to a newly created group.
+ * @since Chrome 88
+ * @param options Configurations object
+ * @return The `group` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function group(options: GroupOptions): Promise<number>;
+ /**
+ * Adds one or more tabs to a specified group, or if no group is specified, adds the given tabs to a newly created group.
+ * @since Chrome 88
+ * @param options Configurations object
+ * @return The `group` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function group(options: GroupOptions): Promise<number>;
+ /**
+ * Adds one or more tabs to a specified group, or if no group is specified, adds the given tabs to a newly created group.
+ * @since Chrome 88
+ * @param options Configurations object
+ * @param callback Optional.
+ */
+ export function group(options: GroupOptions, callback: (groupId: number) => void): void;
+ /**
+ * Removes one or more tabs from their respective groups. If any groups become empty, they are deleted
+ * @since Chrome 88
+ * @param tabIds The tabs to ungroup.
+ * @return The `ungroup` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function ungroup(tabIds: number | number[]): Promise<void>;
+ /**
+ * Removes one or more tabs from their respective groups. If any groups become empty, they are deleted
+ * @since Chrome 88
+ * @param tabIds The tabs to ungroup.
+ * @param callback Optional. Called after the operation is completed.
+ */
+ export function ungroup(tabIds: number | number[], callback: () => void): void;
+ /**
+ * Fired when the highlighted or selected tabs in a window changes.
+ * @since Chrome 18.
+ */
+ export var onHighlighted: TabHighlightedEvent;
+ /** Fired when a tab is closed. */
+ export var onRemoved: TabRemovedEvent;
+ /** Fired when a tab is updated. */
+ export var onUpdated: TabUpdatedEvent;
+ /** Fired when a tab is attached to a window, for example because it was moved between windows. */
+ export var onAttached: TabAttachedEvent;
+ /**
+ * Fired when a tab is moved within a window. Only one move event is fired, representing the tab the user directly moved. Move events are not fired for the other tabs that must move in response. This event is not fired when a tab is moved between windows. For that, see tabs.onDetached.
+ */
+ export var onMoved: TabMovedEvent;
+ /** Fired when a tab is detached from a window, for example because it is being moved between windows. */
+ export var onDetached: TabDetachedEvent;
+ /** Fired when a tab is created. Note that the tab's URL may not be set at the time this event fired, but you can listen to onUpdated events to be notified when a URL is set. */
+ export var onCreated: TabCreatedEvent;
+ /**
+ * Fires when the active tab in a window changes. Note that the tab's URL may not be set at the time this event fired, but you can listen to onUpdated events to be notified when a URL is set.
+ * @since Chrome 18.
+ */
+ export var onActivated: TabActivatedEvent;
+ /**
+ * Fired when a tab is replaced with another tab due to prerendering or instant.
+ * @since Chrome 26.
+ */
+ export var onReplaced: TabReplacedEvent;
+ /**
+ * @deprecated since Chrome 33. Please use tabs.onActivated.
+ * Fires when the selected tab in a window changes.
+ */
+ export var onSelectionChanged: TabSelectedEvent;
+ /**
+ * @deprecated since Chrome 33. Please use tabs.onActivated.
+ * Fires when the selected tab in a window changes. Note that the tab's URL may not be set at the time this event fired, but you can listen to tabs.onUpdated events to be notified when a URL is set.
+ */
+ export var onActiveChanged: TabSelectedEvent;
+ /**
+ * @deprecated since Chrome 33. Please use tabs.onHighlighted.
+ * Fired when the highlighted or selected tabs in a window changes.
+ */
+ export var onHighlightChanged: TabHighlightedEvent;
+ /**
+ * Fired when a tab is zoomed.
+ * @since Chrome 38.
+ */
+ export var onZoomChange: TabZoomChangeEvent;
+
+ /**
+ * An ID which represents the absence of a browser tab.
+ * @since Chrome 46.
+ */
+ export var TAB_ID_NONE: -1;
+}
+
+////////////////////
+// Tab Groups
+////////////////////
+/**
+ * Use the chrome.tabGroups API to interact with the browser's tab grouping system. You can use this API to modify and rearrange tab groups in the browser. To group and ungroup tabs, or to query what tabs are in groups, use the chrome.tabs API.
+ * Permissions: "tabGroups"
+ * @since Chrome 89. Manifest V3 and above.
+ */
+declare namespace chrome.tabGroups {
+ /** An ID that represents the absence of a group. */
+ export var TAB_GROUP_ID_NONE: -1;
+
+ export type ColorEnum = "grey" | "blue" | "red" | "yellow" | "green" | "pink" | "purple" | "cyan" | "orange";
+
+ export interface TabGroup {
+ /** Whether the group is collapsed. A collapsed group is one whose tabs are hidden. */
+ collapsed: boolean;
+ /** The group's color. */
+ color: ColorEnum;
+ /** The ID of the group. Group IDs are unique within a browser session. */
+ id: number;
+ /** Optional. The title of the group. */
+ title?: string | undefined;
+ /** The ID of the window that contains the group. */
+ windowId: number;
+ }
+
+ export interface MoveProperties {
+ /** The position to move the group to. Use -1 to place the group at the end of the window. */
+ index: number;
+ /** Optional. The window to move the group to. Defaults to the window the group is currently in. Note that groups can only be moved to and from windows with chrome.windows.WindowType type "normal". */
+ windowId?: number | undefined;
+ }
+
+ export interface QueryInfo {
+ /** Optional. Whether the groups are collapsed. */
+ collapsed?: boolean | undefined;
+ /** Optional. The color of the groups. */
+ color?: ColorEnum | undefined;
+ /** Optional. Match group titles against a pattern. */
+ title?: string | undefined;
+ /** Optional. The ID of the window that contains the group. */
+ windowId?: number | undefined;
+ }
+
+ export interface UpdateProperties {
+ /** Optional. Whether the group should be collapsed. */
+ collapsed?: boolean | undefined;
+ /** Optional. The color of the group. */
+ color?: ColorEnum | undefined;
+ /** Optional. The title of the group. */
+ title?: string | undefined;
+ }
+
+ /**
+ * Retrieves details about the specified group.
+ * @param groupId The ID of the tab group.
+ * @param callback Called with the retrieved tab group.
+ */
+ export function get(groupId: number, callback: (group: TabGroup) => void): void;
+
+ /**
+ * Retrieves details about the specified group.
+ * @param groupId The ID of the tab group.
+ * @return The `get` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function get(groupId: number): Promise<TabGroup>;
+
+ /**
+ * Moves the group and all its tabs within its window, or to a new window.
+ * @param groupId The ID of the group to move.
+ * @param moveProperties Information on how to move the group.
+ * @return The `move` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function move(groupId: number, moveProperties: MoveProperties): Promise<TabGroup>;
+
+ /**
+ * Moves the group and all its tabs within its window, or to a new window.
+ * @param groupId The ID of the group to move.
+ * @param moveProperties Information on how to move the group.
+ * @param callback Optional.
+ */
+ export function move(groupId: number, moveProperties: MoveProperties, callback: (group: TabGroup) => void): void;
+
+ /**
+ * Gets all groups that have the specified properties, or all groups if no properties are specified.
+ * @param queryInfo Object with search parameters.
+ * @param callback Called with retrieved tab groups.
+ */
+ export function query(queryInfo: QueryInfo, callback: (result: TabGroup[]) => void): void;
+
+ /**
+ * Gets all groups that have the specified properties, or all groups if no properties are specified.
+ * @param queryInfo Object with search parameters.
+ * @return The `query` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function query(queryInfo: QueryInfo): Promise<TabGroup[]>;
+
+ /**
+ * Modifies the properties of a group. Properties that are not specified in updateProperties are not modified.
+ * @param groupId The ID of the group to modify.
+ * @param updateProperties Information on how to update the group.
+ * @return The `update` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function update(groupId: number, updateProperties: UpdateProperties): Promise<TabGroup>;
+
+ /**
+ * Modifies the properties of a group. Properties that are not specified in updateProperties are not modified.
+ * @param groupId The ID of the group to modify.
+ * @param updateProperties Information on how to update the group.
+ * @param callback Optional.
+ */
+ export function update(
+ groupId: number,
+ updateProperties: UpdateProperties,
+ callback: (group: TabGroup) => void,
+ ): void;
+
+ export interface TabGroupCreatedEvent extends chrome.events.Event<(group: TabGroup) => void> {}
+ export interface TabGroupMovedEvent extends chrome.events.Event<(group: TabGroup) => void> {}
+ export interface TabGroupRemovedEvent extends chrome.events.Event<(group: TabGroup) => void> {}
+ export interface TabGroupUpdated extends chrome.events.Event<(group: TabGroup) => void> {}
+
+ /** Fired when a group is created. */
+ export var onCreated: TabGroupCreatedEvent;
+ /** Fired when a group is moved within a window. Move events are still fired for the individual tabs within the group, as well as for the group itself. This event is not fired when a group is moved between windows; instead, it will be removed from one window and created in another. */
+ export var onMoved: TabGroupMovedEvent;
+ /** Fired when a group is closed, either directly by the user or automatically because it contained zero. */
+ export var onRemoved: TabGroupRemovedEvent;
+ /** Fired when a group is updated. */
+ export var onUpdated: TabGroupUpdated;
+}
+
+////////////////////
+// Top Sites
+////////////////////
+/**
+ * Use the chrome.topSites API to access the top sites that are displayed on the new tab page.
+ * Permissions: "topSites"
+ * @since Chrome 19.
+ */
+declare namespace chrome.topSites {
+ /** An object encapsulating a most visited URL, such as the URLs on the new tab page. */
+ export interface MostVisitedURL {
+ /** The most visited URL. */
+ url: string;
+ /** The title of the page */
+ title: string;
+ }
+
+ /** Gets a list of top sites. */
+ export function get(callback: (data: MostVisitedURL[]) => void): void;
+
+ /**
+ * Gets a list of top sites.
+ * @return The `get` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function get(): Promise<MostVisitedURL[]>;
+}
+
+////////////////////
+// Text to Speech
+////////////////////
+/**
+ * Use the chrome.tts API to play synthesized text-to-speech (TTS). See also the related ttsEngine API, which allows an extension to implement a speech engine.
+ * Permissions: "tts"
+ * @since Chrome 14.
+ */
+declare namespace chrome.tts {
+ /** An event from the TTS engine to communicate the status of an utterance. */
+ export interface TtsEvent {
+ /** Optional. The index of the current character in the utterance. */
+ charIndex?: number | undefined;
+ /** Optional. The error description, if the event type is 'error'. */
+ errorMessage?: string | undefined;
+ /**
+ * The length of the next part of the utterance.
+ * For example, in a word event, this is the length of the word which will be spoken next.
+ * It will be set to -1 if not set by the speech engine.
+ */
+ length?: number | undefined;
+ /**
+ * The type can be 'start' as soon as speech has started, 'word' when a word boundary is reached, 'sentence' when a sentence boundary is reached, 'marker' when an SSML mark element is reached, 'end' when the end of the utterance is reached, 'interrupted' when the utterance is stopped or interrupted before reaching the end, 'cancelled' when it's removed from the queue before ever being synthesized, or 'error' when any other error occurs. When pausing speech, a 'pause' event is fired if a particular utterance is paused in the middle, and 'resume' if an utterance resumes speech. Note that pause and resume events may not fire if speech is paused in-between utterances.
+ * One of: "start", "end", "word", "sentence", "marker", "interrupted", "cancelled", "error", "pause", or "resume"
+ */
+ type:
+ | "start"
+ | "end"
+ | "word"
+ | "sentence"
+ | "marker"
+ | "interrupted"
+ | "cancelled"
+ | "error"
+ | "pause"
+ | "resume";
+ }
+
+ /** A description of a voice available for speech synthesis. */
+ export interface TtsVoice {
+ /** Optional. The language that this voice supports, in the form language-region. Examples: 'en', 'en-US', 'en-GB', 'zh-CN'. */
+ lang?: string | undefined;
+ /**
+ * Optional. This voice's gender.
+ * One of: "male", or "female"
+ * @deprecated since Chrome 70. Gender is deprecated and will be ignored.
+ */
+ gender?: string | undefined;
+ /** Optional. The name of the voice. */
+ voiceName?: string | undefined;
+ /** Optional. The ID of the extension providing this voice. */
+ extensionId?: string | undefined;
+ /** Optional. All of the callback event types that this voice is capable of sending. */
+ eventTypes?: string[] | undefined;
+ /**
+ * Optional. If true, the synthesis engine is a remote network resource. It may be higher latency and may incur bandwidth costs.
+ * @since Chrome 33.
+ */
+ remote?: boolean | undefined;
+ }
+
+ export interface SpeakOptions {
+ /** Optional. Speaking volume between 0 and 1 inclusive, with 0 being lowest and 1 being highest, with a default of 1.0. */
+ volume?: number | undefined;
+ /**
+ * Optional.
+ * If true, enqueues this utterance if TTS is already in progress. If false (the default), interrupts any current speech and flushes the speech queue before speaking this new utterance.
+ */
+ enqueue?: boolean | undefined;
+ /**
+ * Optional.
+ * Speaking rate relative to the default rate for this voice. 1.0 is the default rate, normally around 180 to 220 words per minute. 2.0 is twice as fast, and 0.5 is half as fast. Values below 0.1 or above 10.0 are strictly disallowed, but many voices will constrain the minimum and maximum rates further—for example a particular voice may not actually speak faster than 3 times normal even if you specify a value larger than 3.0.
+ */
+ rate?: number | undefined;
+ /**
+ * Optional. This function is called with events that occur in the process of speaking the utterance.
+ * @param event The update event from the text-to-speech engine indicating the status of this utterance.
+ */
+ onEvent?: ((event: TtsEvent) => void) | undefined;
+ /**
+ * Optional.
+ * Speaking pitch between 0 and 2 inclusive, with 0 being lowest and 2 being highest. 1.0 corresponds to a voice's default pitch.
+ */
+ pitch?: number | undefined;
+ /** Optional. The language to be used for synthesis, in the form language-region. Examples: 'en', 'en-US', 'en-GB', 'zh-CN'. */
+ lang?: string | undefined;
+ /** Optional. The name of the voice to use for synthesis. If empty, uses any available voice. */
+ voiceName?: string | undefined;
+ /** Optional. The extension ID of the speech engine to use, if known. */
+ extensionId?: string | undefined;
+ /**
+ * Optional. Gender of voice for synthesized speech.
+ * One of: "male", or "female"
+ */
+ gender?: string | undefined;
+ /** Optional. The TTS event types the voice must support. */
+ requiredEventTypes?: string[] | undefined;
+ /** Optional. The TTS event types that you are interested in listening to. If missing, all event types may be sent. */
+ desiredEventTypes?: string[] | undefined;
+ }
+
+ /** Checks whether the engine is currently speaking. On Mac OS X, the result is true whenever the system speech engine is speaking, even if the speech wasn't initiated by Chrome. */
+ export function isSpeaking(callback?: (speaking: boolean) => void): void;
+ /** Stops any current speech and flushes the queue of any pending utterances. In addition, if speech was paused, it will now be un-paused for the next call to speak. */
+ export function stop(): void;
+ /** Gets an array of all available voices. */
+ export function getVoices(): Promise<TtsVoice[]>;
+ export function getVoices(callback?: (voices: TtsVoice[]) => void): void;
+ /**
+ * Speaks text using a text-to-speech engine.
+ * @param utterance The text to speak, either plain text or a complete, well-formed SSML document. Speech engines that do not support SSML will strip away the tags and speak the text. The maximum length of the text is 32,768 characters.
+ * @param callback Optional. Called right away, before speech finishes. Check chrome.runtime.lastError to make sure there were no errors. Use options.onEvent to get more detailed feedback.
+ */
+ export function speak(utterance: string, callback?: Function): void;
+ /**
+ * Speaks text using a text-to-speech engine.
+ * @param utterance The text to speak, either plain text or a complete, well-formed SSML document. Speech engines that do not support SSML will strip away the tags and speak the text. The maximum length of the text is 32,768 characters.
+ * @param options Optional. The speech options.
+ * @param callback Optional. Called right away, before speech finishes. Check chrome.runtime.lastError to make sure there were no errors. Use options.onEvent to get more detailed feedback.
+ */
+ export function speak(utterance: string, options: SpeakOptions, callback?: Function): void;
+ /**
+ * Pauses speech synthesis, potentially in the middle of an utterance. A call to resume or stop will un-pause speech.
+ * @since Chrome 29.
+ */
+ export function pause(): void;
+ /**
+ * If speech was paused, resumes speaking where it left off.
+ * @since Chrome 29.
+ */
+ export function resume(): void;
+}
+
+////////////////////
+// Text to Speech Engine
+////////////////////
+/**
+ * Use the chrome.ttsEngine API to implement a text-to-speech(TTS) engine using an extension. If your extension registers using this API, it will receive events containing an utterance to be spoken and other parameters when any extension or Chrome App uses the tts API to generate speech. Your extension can then use any available web technology to synthesize and output the speech, and send events back to the calling function to report the status.
+ * Permissions: "ttsEngine"
+ * @since Chrome 14.
+ */
+declare namespace chrome.ttsEngine {
+ export interface SpeakOptions {
+ /** Optional. The language to be used for synthesis, in the form language-region. Examples: 'en', 'en-US', 'en-GB', 'zh-CN'. */
+ lang?: string | undefined;
+ /** Optional. The name of the voice to use for synthesis. */
+ voiceName?: string | undefined;
+ /**
+ * Optional. Gender of voice for synthesized speech.
+ * One of: "male", or "female"
+ */
+ gender?: string | undefined;
+ /** Optional. Speaking volume between 0 and 1 inclusive, with 0 being lowest and 1 being highest, with a default of 1.0. */
+ volume?: number | undefined;
+ /**
+ * Optional.
+ * Speaking rate relative to the default rate for this voice. 1.0 is the default rate, normally around 180 to 220 words per minute. 2.0 is twice as fast, and 0.5 is half as fast. This value is guaranteed to be between 0.1 and 10.0, inclusive. When a voice does not support this full range of rates, don't return an error. Instead, clip the rate to the range the voice supports.
+ */
+ rate?: number | undefined;
+ /** Optional. Speaking pitch between 0 and 2 inclusive, with 0 being lowest and 2 being highest. 1.0 corresponds to this voice's default pitch. */
+ pitch?: number | undefined;
+ }
+
+ export interface TtsEngineSpeakEvent extends
+ chrome.events.Event<
+ (utterance: string, options: SpeakOptions, sendTtsEvent: (event: chrome.tts.TtsEvent) => void) => void
+ >
+ {}
+
+ /** Called when the user makes a call to tts.speak() and one of the voices from this extension's manifest is the first to match the options object. */
+ export var onSpeak: TtsEngineSpeakEvent;
+ /** Fired when a call is made to tts.stop and this extension may be in the middle of speaking. If an extension receives a call to onStop and speech is already stopped, it should do nothing (not raise an error). If speech is in the paused state, this should cancel the paused state. */
+ export var onStop: chrome.events.Event<() => void>;
+ /**
+ * Optional: if an engine supports the pause event, it should pause the current utterance being spoken, if any, until it receives a resume event or stop event. Note that a stop event should also clear the paused state.
+ * @since Chrome 29.
+ */
+ export var onPause: chrome.events.Event<() => void>;
+ /**
+ * Optional: if an engine supports the pause event, it should also support the resume event, to continue speaking the current utterance, if any. Note that a stop event should also clear the paused state.
+ * @since Chrome 29.
+ */
+ export var onResume: chrome.events.Event<() => void>;
+}
+
+////////////////////
+// Types
+////////////////////
+/**
+ * The chrome.types API contains type declarations for Chrome.
+ * @since Chrome 13.
+ */
+declare namespace chrome.types {
+ type settingsScope = "regular" | "regular_only" | "incognito_persistent" | "incognito_session_only" | undefined;
+
+ export interface ChromeSettingClearDetails {
+ /**
+ * Optional.
+ * The scope of the ChromeSetting. One of
+ * • regular: setting for the regular profile (which is inherited by the incognito profile if not overridden elsewhere),
+ * • regular_only: setting for the regular profile only (not inherited by the incognito profile),
+ * • incognito_persistent: setting for the incognito profile that survives browser restarts (overrides regular preferences),
+ * • incognito_session_only: setting for the incognito profile that can only be set during an incognito session and is deleted when the incognito session ends (overrides regular and incognito_persistent preferences).
+ */
+ scope?: settingsScope;
+ }
+
+ export interface ChromeSettingSetDetails extends ChromeSettingClearDetails {
+ /**
+ * The value of the setting.
+ * Note that every setting has a specific value type, which is described together with the setting. An extension should not set a value of a different type.
+ */
+ value: any;
+ /**
+ * Optional.
+ * The scope of the ChromeSetting. One of
+ * • regular: setting for the regular profile (which is inherited by the incognito profile if not overridden elsewhere),
+ * • regular_only: setting for the regular profile only (not inherited by the incognito profile),
+ * • incognito_persistent: setting for the incognito profile that survives browser restarts (overrides regular preferences),
+ * • incognito_session_only: setting for the incognito profile that can only be set during an incognito session and is deleted when the incognito session ends (overrides regular and incognito_persistent preferences).
+ */
+ scope?: settingsScope;
+ }
+
+ export interface ChromeSettingGetDetails {
+ /** Optional. Whether to return the value that applies to the incognito session (default false). */
+ incognito?: boolean | undefined;
+ }
+
+ /**
+ * @param details Details of the currently effective value.
+ */
+ export type DetailsCallback = (details: ChromeSettingGetResultDetails) => void;
+
+ export interface ChromeSettingGetResultDetails {
+ /**
+ * One of
+ * • not_controllable: cannot be controlled by any extension
+ * • controlled_by_other_extensions: controlled by extensions with higher precedence
+ * • controllable_by_this_extension: can be controlled by this extension
+ * • controlled_by_this_extension: controlled by this extension
+ */
+ levelOfControl:
+ | "not_controllable"
+ | "controlled_by_other_extensions"
+ | "controllable_by_this_extension"
+ | "controlled_by_this_extension";
+ /** The value of the setting. */
+ value: any;
+ /**
+ * Optional.
+ * Whether the effective value is specific to the incognito session.
+ * This property will only be present if the incognito property in the details parameter of get() was true.
+ */
+ incognitoSpecific?: boolean | undefined;
+ }
+
+ export interface ChromeSettingChangedEvent extends chrome.events.Event<DetailsCallback> {}
+
+ /** An interface that allows access to a Chrome browser setting. See accessibilityFeatures for an example. */
+ export interface ChromeSetting {
+ /**
+ * Sets the value of a setting.
+ * @param details Which setting to change.
+ * @param callback Optional. Called at the completion of the set operation.
+ */
+ set(details: ChromeSettingSetDetails, callback?: Function): void;
+ /**
+ * Gets the value of a setting.
+ * @param details Which setting to consider.
+ */
+ get(details: ChromeSettingGetDetails, callback?: DetailsCallback): void;
+ /**
+ * Clears the setting, restoring any default value.
+ * @param details Which setting to clear.
+ * @param callback Optional. Called at the completion of the clear operation.
+ */
+ clear(details: ChromeSettingClearDetails, callback?: Function): void;
+ /** Fired after the setting changes. */
+ onChange: ChromeSettingChangedEvent;
+ }
+}
+
+////////////////////
+// VPN Provider
+////////////////////
+/**
+ * Use the chrome.vpnProvider API to implement a VPN client.
+ * Permissions: "vpnProvider"
+ * Important: This API works only on Chrome OS.
+ * @since Chrome 43.
+ */
+declare namespace chrome.vpnProvider {
+ export interface VpnSessionParameters {
+ /** IP address for the VPN interface in CIDR notation. IPv4 is currently the only supported mode. */
+ address: string;
+ /** Optional. Broadcast address for the VPN interface. (default: deduced from IP address and mask) */
+ broadcastAddress?: string | undefined;
+ /** Optional. MTU setting for the VPN interface. (default: 1500 bytes) */
+ mtu?: string | undefined;
+ /**
+ * Exclude network traffic to the list of IP blocks in CIDR notation from the tunnel. This can be used to bypass traffic to and from the VPN server. When many rules match a destination, the rule with the longest matching prefix wins. Entries that correspond to the same CIDR block are treated as duplicates. Such duplicates in the collated (exclusionList + inclusionList) list are eliminated and the exact duplicate entry that will be eliminated is undefined.
+ */
+ exclusionList: string[];
+ /**
+ * Include network traffic to the list of IP blocks in CIDR notation to the tunnel. This parameter can be used to set up a split tunnel. By default no traffic is directed to the tunnel. Adding the entry "0.0.0.0/0" to this list gets all the user traffic redirected to the tunnel. When many rules match a destination, the rule with the longest matching prefix wins. Entries that correspond to the same CIDR block are treated as duplicates. Such duplicates in the collated (exclusionList + inclusionList) list are eliminated and the exact duplicate entry that will be eliminated is undefined.
+ */
+ inclusionList: string[];
+ /** Optional. A list of search domains. (default: no search domain) */
+ domainSearch?: string[] | undefined;
+ /** A list of IPs for the DNS servers. */
+ dnsServer: string[];
+ }
+
+ export interface VpnPlatformMessageEvent
+ extends chrome.events.Event<(id: string, message: string, error: string) => void>
+ {}
+
+ export interface VpnPacketReceptionEvent extends chrome.events.Event<(data: ArrayBuffer) => void> {}
+
+ export interface VpnConfigRemovalEvent extends chrome.events.Event<(id: string) => void> {}
+
+ export interface VpnConfigCreationEvent
+ extends chrome.events.Event<(id: string, name: string, data: Object) => void>
+ {}
+
+ export interface VpnUiEvent extends chrome.events.Event<(event: string, id?: string) => void> {}
+
+ /**
+ * Creates a new VPN configuration that persists across multiple login sessions of the user.
+ * @param name The name of the VPN configuration.
+ * @param callback Called when the configuration is created or if there is an error.
+ * Parameter id: A unique ID for the created configuration, empty string on failure.
+ */
+ export function createConfig(name: string, callback: (id: string) => void): void;
+ /**
+ * Destroys a VPN configuration created by the extension.
+ * @param id ID of the VPN configuration to destroy.
+ * @param callback Optional. Called when the configuration is destroyed or if there is an error.
+ */
+ export function destroyConfig(id: string, callback?: Function): void;
+ /**
+ * Sets the parameters for the VPN session. This should be called immediately after "connected" is received from the platform. This will succeed only when the VPN session is owned by the extension.
+ * @param parameters The parameters for the VPN session.
+ * @param callback Called when the parameters are set or if there is an error.
+ */
+ export function setParameters(parameters: VpnSessionParameters, callback: Function): void;
+ /**
+ * Sends an IP packet through the tunnel created for the VPN session. This will succeed only when the VPN session is owned by the extension.
+ * @param data The IP packet to be sent to the platform.
+ * @param callback Optional. Called when the packet is sent or if there is an error.
+ */
+ export function sendPacket(data: ArrayBuffer, callback?: Function): void;
+ /**
+ * Notifies the VPN session state to the platform. This will succeed only when the VPN session is owned by the extension.
+ * @param state The VPN session state of the VPN client.
+ * connected: VPN connection was successful.
+ * failure: VPN connection failed.
+ * @param callback Optional. Called when the notification is complete or if there is an error.
+ */
+ export function notifyConnectionStateChanged(state: string, callback?: Function): void;
+
+ /** Triggered when a message is received from the platform for a VPN configuration owned by the extension. */
+ export var onPlatformMessage: VpnPlatformMessageEvent;
+ /** Triggered when an IP packet is received via the tunnel for the VPN session owned by the extension. */
+ export var onPacketReceived: VpnPacketReceptionEvent;
+ /** Triggered when a configuration created by the extension is removed by the platform. */
+ export var onConfigRemoved: VpnConfigRemovalEvent;
+ /** Triggered when a configuration is created by the platform for the extension. */
+ export var onConfigCreated: VpnConfigCreationEvent;
+ /** Triggered when there is a UI event for the extension. UI events are signals from the platform that indicate to the app that a UI dialog needs to be shown to the user. */
+ export var onUIEvent: VpnUiEvent;
+}
+
+////////////////////
+// Wallpaper
+////////////////////
+/**
+ * Use the chrome.wallpaper API to change the ChromeOS wallpaper.
+ * Permissions: "wallpaper"
+ * Important: This API works only on Chrome OS.
+ * @since Chrome 43.
+ */
+declare namespace chrome.wallpaper {
+ export interface WallpaperDetails {
+ /** Optional. The jpeg or png encoded wallpaper image. */
+ data?: ArrayBuffer | undefined;
+ /** Optional. The URL of the wallpaper to be set. */
+ url?: string | undefined;
+ /**
+ * The supported wallpaper layouts.
+ * One of: "STRETCH", "CENTER", or "CENTER_CROPPED"
+ */
+ layout: "STRETCH" | "CENTER" | "CENTER_CROPPED";
+ /** The file name of the saved wallpaper. */
+ filename: string;
+ /** Optional. True if a 128x60 thumbnail should be generated. */
+ thumbnail?: boolean | undefined;
+ }
+
+ /**
+ * Sets wallpaper to the image at url or wallpaperData with the specified layout
+ * @param callback
+ * Optional parameter thumbnail: The jpeg encoded wallpaper thumbnail. It is generated by resizing the wallpaper to 128x60.
+ */
+ export function setWallpaper(details: WallpaperDetails, callback: (thumbnail?: ArrayBuffer) => void): void;
+}
+
+////////////////////
+// Web Navigation
+////////////////////
+/**
+ * Use the chrome.webNavigation API to receive notifications about the status of navigation requests in-flight.
+ * Permissions: "webNavigation"
+ * @since Chrome 16.
+ */
+declare namespace chrome.webNavigation {
+ export interface GetFrameDetails {
+ /**
+ * The ID of the process runs the renderer for this tab.
+ * @since Chrome 22.
+ * @deprecated since Chrome 49. Frames are now uniquely identified by their tab ID and frame ID; the process ID is no longer needed and therefore ignored.
+ */
+ processId?: number | undefined;
+ /** The ID of the tab in which the frame is. */
+ tabId: number;
+ /** The ID of the frame in the given tab. */
+ frameId: number;
+ }
+
+ export interface GetFrameResultDetails {
+ /** The URL currently associated with this frame, if the frame identified by the frameId existed at one point in the given tab. The fact that an URL is associated with a given frameId does not imply that the corresponding frame still exists. */
+ url: string;
+ /** A UUID of the document loaded. */
+ documentId: string;
+ /** The lifecycle the document is in. */
+ documentLifecycle: DocumentLifecycle;
+ /** True if the last navigation in this frame was interrupted by an error, i.e. the onErrorOccurred event fired. */
+ errorOccurred: boolean;
+ /** The type of frame the navigation occurred in. */
+ frameType: FrameType;
+ /** A UUID of the parent document owning this frame. This is not set if there is no parent. */
+ parentDocumentId?: string | undefined;
+ /** ID of frame that wraps the frame. Set to -1 of no parent frame exists. */
+ parentFrameId: number;
+ }
+
+ export interface GetAllFrameDetails {
+ /** The ID of the tab. */
+ tabId: number;
+ }
+
+ export interface GetAllFrameResultDetails extends GetFrameResultDetails {
+ /** The ID of the process runs the renderer for this tab. */
+ processId: number;
+ /** The ID of the frame. 0 indicates that this is the main frame; a positive value indicates the ID of a subframe. */
+ frameId: number;
+ }
+
+ export interface WebNavigationCallbackDetails {
+ /** The ID of the tab in which the navigation is about to occur. */
+ tabId: number;
+ /** The time when the browser was about to start the navigation, in milliseconds since the epoch. */
+ timeStamp: number;
+ }
+
+ export interface WebNavigationUrlCallbackDetails extends WebNavigationCallbackDetails {
+ url: string;
+ }
+
+ export interface WebNavigationReplacementCallbackDetails extends WebNavigationCallbackDetails {
+ /** The ID of the tab that was replaced. */
+ replacedTabId: number;
+ }
+
+ export interface WebNavigationFramedCallbackDetails extends WebNavigationUrlCallbackDetails {
+ /** 0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique for a given tab and process. */
+ frameId: number;
+ /** The type of frame the navigation occurred in. */
+ frameType: FrameType;
+ /** A UUID of the document loaded. (This is not set for onBeforeNavigate callbacks.) */
+ documentId?: string | undefined;
+ /** The lifecycle the document is in. */
+ documentLifecycle: DocumentLifecycle;
+ /** A UUID of the parent document owning this frame. This is not set if there is no parent. */
+ parentDocumentId?: string | undefined;
+ /**
+ * The ID of the process runs the renderer for this tab.
+ * @since Chrome 22.
+ */
+ processId: number;
+ }
+
+ export interface WebNavigationFramedErrorCallbackDetails extends WebNavigationFramedCallbackDetails {
+ /** The error description. */
+ error: string;
+ }
+
+ export interface WebNavigationSourceCallbackDetails extends WebNavigationUrlCallbackDetails {
+ /** The ID of the tab in which the navigation is triggered. */
+ sourceTabId: number;
+ /**
+ * The ID of the process runs the renderer for the source tab.
+ * @since Chrome 22.
+ */
+ sourceProcessId: number;
+ /** The ID of the frame with sourceTabId in which the navigation is triggered. 0 indicates the main frame. */
+ sourceFrameId: number;
+ }
+
+ export interface WebNavigationParentedCallbackDetails extends WebNavigationFramedCallbackDetails {
+ /**
+ * ID of frame that wraps the frame. Set to -1 of no parent frame exists.
+ * @since Chrome 24.
+ */
+ parentFrameId: number;
+ }
+
+ export interface WebNavigationTransitionCallbackDetails extends WebNavigationFramedCallbackDetails {
+ /**
+ * Cause of the navigation.
+ * One of: "link", "typed", "auto_bookmark", "auto_subframe", "manual_subframe", "generated", "start_page", "form_submit", "reload", "keyword", or "keyword_generated"
+ */
+ transitionType: string;
+ /**
+ * A list of transition qualifiers.
+ * Each element one of: "client_redirect", "server_redirect", "forward_back", or "from_address_bar"
+ */
+ transitionQualifiers: string[];
+ }
+
+ export interface WebNavigationEventFilter {
+ /** Conditions that the URL being navigated to must satisfy. The 'schemes' and 'ports' fields of UrlFilter are ignored for this event. */
+ url: chrome.events.UrlFilter[];
+ }
+
+ export interface WebNavigationEvent<T extends WebNavigationCallbackDetails>
+ extends chrome.events.Event<(details: T) => void>
+ {
+ addListener(callback: (details: T) => void, filters?: WebNavigationEventFilter): void;
+ }
+
+ export interface WebNavigationFramedEvent extends WebNavigationEvent<WebNavigationFramedCallbackDetails> {}
+
+ export interface WebNavigationFramedErrorEvent
+ extends WebNavigationEvent<WebNavigationFramedErrorCallbackDetails>
+ {}
+
+ export interface WebNavigationSourceEvent extends WebNavigationEvent<WebNavigationSourceCallbackDetails> {}
+
+ export interface WebNavigationParentedEvent extends WebNavigationEvent<WebNavigationParentedCallbackDetails> {}
+
+ export interface WebNavigationTransitionalEvent
+ extends WebNavigationEvent<WebNavigationTransitionCallbackDetails>
+ {}
+
+ export interface WebNavigationReplacementEvent
+ extends WebNavigationEvent<WebNavigationReplacementCallbackDetails>
+ {}
+
+ /**
+ * Retrieves information about the given frame. A frame refers to an <iframe> or a <frame> of a web page and is identified by a tab ID and a frame ID.
+ * @param details Information about the frame to retrieve information about.
+ * @param callback
+ * Optional parameter details: Information about the requested frame, null if the specified frame ID and/or tab ID are invalid.
+ */
+ export function getFrame(details: GetFrameDetails, callback: (details: GetFrameResultDetails | null) => void): void;
+ /**
+ * Retrieves information about the given frame. A frame refers to an <iframe> or a <frame> of a web page and is identified by a tab ID and a frame ID.
+ * @param details Information about the frame to retrieve information about.
+ * @return The getFrame method provides its result via callback or returned as a Promise (MV3 only).
+ */
+ export function getFrame(details: GetFrameDetails): Promise<GetFrameResultDetails | null>;
+
+ /**
+ * Retrieves information about all frames of a given tab.
+ * @param details Information about the tab to retrieve all frames from.
+ * @param callback
+ * Optional parameter details: A list of frames in the given tab, null if the specified tab ID is invalid.
+ */
+ export function getAllFrames(
+ details: GetAllFrameDetails,
+ callback: (details: GetAllFrameResultDetails[] | null) => void,
+ ): void;
+ /**
+ * Retrieves information about all frames of a given tab.
+ * @param details Information about the tab to retrieve all frames from.
+ * @return The getAllFrames method provides its result via callback or returned as a Promise (MV3 only).
+ */
+ export function getAllFrames(
+ details: GetAllFrameDetails,
+ ): Promise<GetAllFrameResultDetails[] | null>;
+ /** Fired when the reference fragment of a frame was updated. All future events for that frame will use the updated URL. */
+ export var onReferenceFragmentUpdated: WebNavigationTransitionalEvent;
+ /** Fired when a document, including the resources it refers to, is completely loaded and initialized. */
+ export var onCompleted: WebNavigationFramedEvent;
+ /**
+ * Fired when the frame's history was updated to a new URL. All future events for that frame will use the updated URL.
+ * @since Chrome 22.
+ */
+ export var onHistoryStateUpdated: WebNavigationTransitionalEvent;
+ /** Fired when a new window, or a new tab in an existing window, is created to host a navigation. */
+ export var onCreatedNavigationTarget: WebNavigationSourceEvent;
+ /**
+ * Fired when the contents of the tab is replaced by a different (usually previously pre-rendered) tab.
+ * @since Chrome 22.
+ */
+ export var onTabReplaced: WebNavigationReplacementEvent;
+ /** Fired when a navigation is about to occur. */
+ export var onBeforeNavigate: WebNavigationParentedEvent;
+ /** Fired when a navigation is committed. The document (and the resources it refers to, such as images and subframes) might still be downloading, but at least part of the document has been received from the server and the browser has decided to switch to the new document. */
+ export var onCommitted: WebNavigationTransitionalEvent;
+ /** Fired when the page's DOM is fully constructed, but the referenced resources may not finish loading. */
+ export var onDOMContentLoaded: WebNavigationFramedEvent;
+ /** Fired when an error occurs and the navigation is aborted. This can happen if either a network error occurred, or the user aborted the navigation. */
+ export var onErrorOccurred: WebNavigationFramedErrorEvent;
+}
+
+////////////////////
+// Web Request
+////////////////////
+/**
+ * Use the chrome.webRequest API to observe and analyze traffic and to intercept, block, or modify requests in-flight.
+ * Permissions: "webRequest", host permissions
+ * @since Chrome 17.
+ */
+declare namespace chrome.webRequest {
+ /** How the requested resource will be used. */
+ export type ResourceType =
+ | "main_frame"
+ | "sub_frame"
+ | "stylesheet"
+ | "script"
+ | "image"
+ | "font"
+ | "object"
+ | "xmlhttprequest"
+ | "ping"
+ | "csp_report"
+ | "media"
+ | "websocket"
+ | "other";
+
+ export interface AuthCredentials {
+ username: string;
+ password: string;
+ }
+
+ /** An HTTP Header, represented as an object containing a key and either a value or a binaryValue. */
+ export interface HttpHeader {
+ name: string;
+ value?: string | undefined;
+ binaryValue?: ArrayBuffer | undefined;
+ }
+
+ /** Returns value for event handlers that have the 'blocking' extraInfoSpec applied. Allows the event handler to modify network requests. */
+ export interface BlockingResponse {
+ /** Optional. If true, the request is cancelled. Used in onBeforeRequest, this prevents the request from being sent. */
+ cancel?: boolean | undefined;
+ /**
+ * Optional.
+ * Only used as a response to the onBeforeRequest and onHeadersReceived events. If set, the original request is prevented from being sent/completed and is instead redirected to the given URL. Redirections to non-HTTP schemes such as data: are allowed. Redirects initiated by a redirect action use the original request method for the redirect, with one exception: If the redirect is initiated at the onHeadersReceived stage, then the redirect will be issued using the GET method.
+ */
+ redirectUrl?: string | undefined;
+ /**
+ * Optional.
+ * Only used as a response to the onHeadersReceived event. If set, the server is assumed to have responded with these response headers instead. Only return responseHeaders if you really want to modify the headers in order to limit the number of conflicts (only one extension may modify responseHeaders for each request).
+ */
+ responseHeaders?: HttpHeader[] | undefined;
+ /** Optional. Only used as a response to the onAuthRequired event. If set, the request is made using the supplied credentials. */
+ authCredentials?: AuthCredentials | undefined;
+ /**
+ * Optional.
+ * Only used as a response to the onBeforeSendHeaders event. If set, the request is made with these request headers instead.
+ */
+ requestHeaders?: HttpHeader[] | undefined;
+ }
+
+ /** An object describing filters to apply to webRequest events. */
+ export interface RequestFilter {
+ /** Optional. */
+ tabId?: number | undefined;
+ /**
+ * A list of request types. Requests that cannot match any of the types will be filtered out.
+ */
+ types?: ResourceType[] | undefined;
+ /** A list of URLs or URL patterns. Requests that cannot match any of the URLs will be filtered out. */
+ urls: string[];
+
+ /** Optional. */
+ windowId?: number | undefined;
+ }
+
+ /**
+ * Contains data uploaded in a URL request.
+ * @since Chrome 23.
+ */
+ export interface UploadData {
+ /** Optional. An ArrayBuffer with a copy of the data. */
+ bytes?: ArrayBuffer | undefined;
+ /** Optional. A string with the file's path and name. */
+ file?: string | undefined;
+ }
+
+ export interface WebRequestBody {
+ /** Optional. Errors when obtaining request body data. */
+ error?: string | undefined;
+ /**
+ * Optional.
+ * If the request method is POST and the body is a sequence of key-value pairs encoded in UTF8, encoded as either multipart/form-data, or application/x-www-form-urlencoded, this dictionary is present and for each key contains the list of all values for that key. If the data is of another media type, or if it is malformed, the dictionary is not present. An example value of this dictionary is {'key': ['value1', 'value2']}.
+ */
+ formData?: { [key: string]: string[] } | undefined;
+ /**
+ * Optional.
+ * If the request method is PUT or POST, and the body is not already parsed in formData, then the unparsed request body elements are contained in this array.
+ */
+ raw?: UploadData[] | undefined;
+ }
+
+ export interface WebAuthChallenger {
+ host: string;
+ port: number;
+ }
+
+ export interface ResourceRequest {
+ url: string;
+ /** The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request. */
+ requestId: string;
+ /** The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (type is main_frame or sub_frame), frameId indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab. */
+ frameId: number;
+ /** ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists. */
+ parentFrameId: number;
+ /** The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab. */
+ tabId: number;
+ /**
+ * How the requested resource will be used.
+ */
+ type: ResourceType;
+ /** The time when this signal is triggered, in milliseconds since the epoch. */
+ timeStamp: number;
+ /** The origin where the request was initiated. This does not change through redirects. If this is an opaque origin, the string 'null' will be used.
+ * @since Since Chrome 63.
+ */
+ initiator?: string | undefined;
+ }
+
+ export interface WebRequestDetails extends ResourceRequest {
+ /** Standard HTTP method. */
+ method: string;
+ }
+
+ export interface WebRequestHeadersDetails extends WebRequestDetails {
+ /** Optional. The HTTP request headers that are going to be sent out with this request. */
+ requestHeaders?: HttpHeader[] | undefined;
+ documentId: string;
+ documentLifecycle: DocumentLifecycle;
+ frameType: FrameType;
+ frameId: number;
+ initiator?: string | undefined;
+ parentDocumentId?: string | undefined;
+ parentFrameId: number;
+ requestId: string;
+ tabId: number;
+ timeStamp: number;
+ type: ResourceType;
+ url: string;
+ }
+
+ export interface WebRequestBodyDetails extends WebRequestDetails {
+ /**
+ * Contains the HTTP request body data. Only provided if extraInfoSpec contains 'requestBody'.
+ * @since Chrome 23.
+ */
+ requestBody: WebRequestBody | null;
+ }
+
+ export interface WebRequestFullDetails extends WebRequestHeadersDetails, WebRequestBodyDetails {}
+
+ export interface WebResponseDetails extends ResourceRequest {
+ /** HTTP status line of the response or the 'HTTP/0.9 200 OK' string for HTTP/0.9 responses (i.e., responses that lack a status line). */
+ statusLine: string;
+ /**
+ * Standard HTTP status code returned by the server.
+ * @since Chrome 43.
+ */
+ statusCode: number;
+ }
+
+ export interface WebResponseHeadersDetails extends WebResponseDetails {
+ /** Optional. The HTTP response headers that have been received with this response. */
+ responseHeaders?: HttpHeader[] | undefined;
+ method: string /** standard HTTP method i.e. GET, POST, PUT, etc. */;
+ }
+
+ export interface WebResponseCacheDetails extends WebResponseHeadersDetails {
+ /**
+ * Optional.
+ * The server IP address that the request was actually sent to. Note that it may be a literal IPv6 address.
+ */
+ ip?: string | undefined;
+ /** Indicates if this response was fetched from disk cache. */
+ fromCache: boolean;
+ }
+
+ export interface WebRedirectionResponseDetails extends WebResponseCacheDetails {
+ /** The new URL. */
+ redirectUrl: string;
+ }
+
+ export interface WebAuthenticationChallengeDetails extends WebResponseHeadersDetails {
+ /** The authentication scheme, e.g. Basic or Digest. */
+ scheme: string;
+ /** The authentication realm provided by the server, if there is one. */
+ realm?: string | undefined;
+ /** The server requesting authentication. */
+ challenger: WebAuthChallenger;
+ /** True for Proxy-Authenticate, false for WWW-Authenticate. */
+ isProxy: boolean;
+ }
+
+ export interface WebResponseErrorDetails extends WebResponseCacheDetails {
+ /** The error description. This string is not guaranteed to remain backwards compatible between releases. You must not parse and act based upon its content. */
+ error: string;
+ }
+
+ export interface WebRequestBodyEvent extends
+ chrome.events.EventWithRequiredFilterInAddListener<
+ (details: WebRequestBodyDetails) => BlockingResponse | void
+ >
+ {
+ addListener(
+ callback: (details: WebRequestBodyDetails) => BlockingResponse | void,
+ filter: RequestFilter,
+ opt_extraInfoSpec?: string[],
+ ): void;
+ }
+
+ export interface WebRequestHeadersSynchronousEvent extends
+ chrome.events.EventWithRequiredFilterInAddListener<
+ (details: WebRequestHeadersDetails) => BlockingResponse | void
+ >
+ {
+ addListener(
+ callback: (details: WebRequestHeadersDetails) => BlockingResponse | void,
+ filter: RequestFilter,
+ opt_extraInfoSpec?: string[],
+ ): void;
+ }
+
+ export interface WebRequestHeadersEvent
+ extends chrome.events.EventWithRequiredFilterInAddListener<(details: WebRequestHeadersDetails) => void>
+ {
+ addListener(
+ callback: (details: WebRequestHeadersDetails) => void,
+ filter: RequestFilter,
+ opt_extraInfoSpec?: string[],
+ ): void;
+ }
+
+ export interface _WebResponseHeadersEvent<T extends WebResponseHeadersDetails>
+ extends chrome.events.EventWithRequiredFilterInAddListener<(details: T) => void>
+ {
+ addListener(callback: (details: T) => void, filter: RequestFilter, opt_extraInfoSpec?: string[]): void;
+ }
+
+ export interface WebResponseHeadersEvent extends
+ chrome.events.EventWithRequiredFilterInAddListener<
+ (details: WebResponseHeadersDetails) => BlockingResponse | void
+ >
+ {
+ addListener(
+ callback: (details: WebResponseHeadersDetails) => BlockingResponse | void,
+ filter: RequestFilter,
+ opt_extraInfoSpec?: string[],
+ ): void;
+ }
+
+ export interface WebResponseCacheEvent extends _WebResponseHeadersEvent<WebResponseCacheDetails> {}
+
+ export interface WebRedirectionResponseEvent extends _WebResponseHeadersEvent<WebRedirectionResponseDetails> {}
+
+ export interface WebAuthenticationChallengeEvent extends
+ chrome.events.EventWithRequiredFilterInAddListener<
+ (details: WebAuthenticationChallengeDetails, callback?: (response: BlockingResponse) => void) => void
+ >
+ {
+ addListener(
+ callback: (
+ details: WebAuthenticationChallengeDetails,
+ callback?: (response: BlockingResponse) => void,
+ ) => void,
+ filter: RequestFilter,
+ opt_extraInfoSpec?: string[],
+ ): void;
+ }
+
+ export interface WebResponseErrorEvent extends _WebResponseHeadersEvent<WebResponseErrorDetails> {}
+
+ /**
+ * The maximum number of times that handlerBehaviorChanged can be called per 10 minute sustained interval. handlerBehaviorChanged is an expensive function call that shouldn't be called often.
+ * @since Chrome 23.
+ */
+ export var MAX_HANDLER_BEHAVIOR_CHANGED_CALLS_PER_10_MINUTES: number;
+
+ /** Needs to be called when the behavior of the webRequest handlers has changed to prevent incorrect handling due to caching. This function call is expensive. Don't call it often. */
+ export function handlerBehaviorChanged(callback?: Function): void;
+
+ /** Fired when a request is about to occur. */
+ export var onBeforeRequest: WebRequestBodyEvent;
+ /** Fired before sending an HTTP request, once the request headers are available. This may occur after a TCP connection is made to the server, but before any HTTP data is sent. */
+ export var onBeforeSendHeaders: WebRequestHeadersSynchronousEvent;
+ /** Fired just before a request is going to be sent to the server (modifications of previous onBeforeSendHeaders callbacks are visible by the time onSendHeaders is fired). */
+ export var onSendHeaders: WebRequestHeadersEvent;
+ /** Fired when HTTP response headers of a request have been received. */
+ export var onHeadersReceived: WebResponseHeadersEvent;
+ /** Fired when an authentication failure is received. The listener has three options: it can provide authentication credentials, it can cancel the request and display the error page, or it can take no action on the challenge. If bad user credentials are provided, this may be called multiple times for the same request. */
+ export var onAuthRequired: WebAuthenticationChallengeEvent;
+ /** Fired when the first byte of the response body is received. For HTTP requests, this means that the status line and response headers are available. */
+ export var onResponseStarted: WebResponseCacheEvent;
+ /** Fired when a server-initiated redirect is about to occur. */
+ export var onBeforeRedirect: WebRedirectionResponseEvent;
+ /** Fired when a request is completed. */
+ export var onCompleted: WebResponseCacheEvent;
+ /** Fired when an error occurs. */
+ export var onErrorOccurred: WebResponseErrorEvent;
+}
+
+////////////////////
+// Web Store
+////////////////////
+/**
+ * Use the chrome.webstore API to initiate app and extension installations "inline" from your site.
+ * @since Chrome 15.
+ */
+declare namespace chrome.webstore {
+ /**
+ * @param url Optional. If you have more than one <link> tag on your page with the chrome-webstore-item relation, you can choose which item you'd like to install by passing in its URL here. If it is omitted, then the first (or only) link will be used. An exception will be thrown if the passed in URL does not exist on the page.
+ * @param successCallback Optional. This function is invoked when inline installation successfully completes (after the dialog is shown and the user agrees to add the item to Chrome). You may wish to use this to hide the user interface element that prompted the user to install the app or extension.
+ * @param failureCallback Optional. This function is invoked when inline installation does not successfully complete. Possible reasons for this include the user canceling the dialog, the linked item not being found in the store, or the install being initiated from a non-verified site.
+ * Parameter error: The failure detail. You may wish to inspect or log this for debugging purposes, but you should not rely on specific strings being passed back.
+ * Optional parameter errorCode: The error code from the stable set of possible errors.
+ * * Enum of the possible install results, including error codes sent back in the event that an inline installation has failed.
+ * * * "otherError": An uncommon, unrecognized, or unexpected error. In some cases, the readable error string can provide more information.
+ * * * "aborted": The operation was aborted as the requestor is no longer alive.
+ * * * "installInProgress": An installation of the same extension is in progress.
+ * * * "notPermitted": The installation is not permitted.
+ * * * "invalidId": Invalid Chrome Web Store item ID.
+ * * * "webstoreRequestError": Failed to retrieve extension metadata from the Web Store.
+ * * * "invalidWebstoreResponse": The extension metadata retrieved from the Web Store was invalid.
+ * * * "invalidManifest": An error occurred while parsing the extension manifest retrieved from the Web Store.
+ * * * "iconError": Failed to retrieve the extension's icon from the Web Store, or the icon was invalid.
+ * * * "userCanceled": The user canceled the operation.
+ * * * "blacklisted": The extension is blacklisted.
+ * * * "missingDependencies": Unsatisfied dependencies, such as shared modules.
+ * * * "requirementViolations": Unsatisfied requirements, such as webgl.
+ * * * "blockedByPolicy": The extension is blocked by management policies.
+ * * * "launchFeatureDisabled": The launch feature is not available.
+ * * * "launchUnsupportedExtensionType": The launch feature is not supported for the extension type.
+ * * * "launchInProgress": A launch of the same extension is in progress.
+ */
+ export function install(
+ url: string,
+ successCallback?: Function,
+ failureCallback?: (error: string, errorCode?: string) => void,
+ ): void;
+ /**
+ * @param successCallback Optional. This function is invoked when inline installation successfully completes (after the dialog is shown and the user agrees to add the item to Chrome). You may wish to use this to hide the user interface element that prompted the user to install the app or extension.
+ * @param failureCallback Optional. This function is invoked when inline installation does not successfully complete. Possible reasons for this include the user canceling the dialog, the linked item not being found in the store, or the install being initiated from a non-verified site.
+ * Parameter error: The failure detail. You may wish to inspect or log this for debugging purposes, but you should not rely on specific strings being passed back.
+ * Optional parameter errorCode: The error code from the stable set of possible errors.
+ * * Enum of the possible install results, including error codes sent back in the event that an inline installation has failed.
+ * * * "otherError": An uncommon, unrecognized, or unexpected error. In some cases, the readable error string can provide more information.
+ * * * "aborted": The operation was aborted as the requestor is no longer alive.
+ * * * "installInProgress": An installation of the same extension is in progress.
+ * * * "notPermitted": The installation is not permitted.
+ * * * "invalidId": Invalid Chrome Web Store item ID.
+ * * * "webstoreRequestError": Failed to retrieve extension metadata from the Web Store.
+ * * * "invalidWebstoreResponse": The extension metadata retrieved from the Web Store was invalid.
+ * * * "invalidManifest": An error occurred while parsing the extension manifest retrieved from the Web Store.
+ * * * "iconError": Failed to retrieve the extension's icon from the Web Store, or the icon was invalid.
+ * * * "userCanceled": The user canceled the operation.
+ * * * "blacklisted": The extension is blacklisted.
+ * * * "missingDependencies": Unsatisfied dependencies, such as shared modules.
+ * * * "requirementViolations": Unsatisfied requirements, such as webgl.
+ * * * "blockedByPolicy": The extension is blocked by management policies.
+ * * * "launchFeatureDisabled": The launch feature is not available.
+ * * * "launchUnsupportedExtensionType": The launch feature is not supported for the extension type.
+ * * * "launchInProgress": A launch of the same extension is in progress.
+ */
+ export function install(
+ successCallback: Function,
+ failureCallback?: (error: string, errorCode?: string) => void,
+ ): void;
+ /**
+ * @param failureCallback Optional. This function is invoked when inline installation does not successfully complete. Possible reasons for this include the user canceling the dialog, the linked item not being found in the store, or the install being initiated from a non-verified site.
+ * Parameter error: The failure detail. You may wish to inspect or log this for debugging purposes, but you should not rely on specific strings being passed back.
+ * Optional parameter errorCode: The error code from the stable set of possible errors.
+ * * Enum of the possible install results, including error codes sent back in the event that an inline installation has failed.
+ * * * "otherError": An uncommon, unrecognized, or unexpected error. In some cases, the readable error string can provide more information.
+ * * * "aborted": The operation was aborted as the requestor is no longer alive.
+ * * * "installInProgress": An installation of the same extension is in progress.
+ * * * "notPermitted": The installation is not permitted.
+ * * * "invalidId": Invalid Chrome Web Store item ID.
+ * * * "webstoreRequestError": Failed to retrieve extension metadata from the Web Store.
+ * * * "invalidWebstoreResponse": The extension metadata retrieved from the Web Store was invalid.
+ * * * "invalidManifest": An error occurred while parsing the extension manifest retrieved from the Web Store.
+ * * * "iconError": Failed to retrieve the extension's icon from the Web Store, or the icon was invalid.
+ * * * "userCanceled": The user canceled the operation.
+ * * * "blacklisted": The extension is blacklisted.
+ * * * "missingDependencies": Unsatisfied dependencies, such as shared modules.
+ * * * "requirementViolations": Unsatisfied requirements, such as webgl.
+ * * * "blockedByPolicy": The extension is blocked by management policies.
+ * * * "launchFeatureDisabled": The launch feature is not available.
+ * * * "launchUnsupportedExtensionType": The launch feature is not supported for the extension type.
+ * * * "launchInProgress": A launch of the same extension is in progress.
+ */
+ export function install(failureCallback?: (error: string, errorCode?: string) => void): void;
+
+ export interface InstallationStageEvent extends chrome.events.Event<(stage: string) => void> {}
+
+ export interface DownloadProgressEvent extends chrome.events.Event<(percentDownloaded: number) => void> {}
+
+ /**
+ * Fired when an inline installation enters a new InstallStage. In order to receive notifications about this event, listeners must be registered before the inline installation begins.
+ * @since Chrome 35.
+ */
+ export var onInstallStageChanged: InstallationStageEvent;
+ /**
+ * Fired periodically with the download progress of an inline install. In order to receive notifications about this event, listeners must be registered before the inline installation begins.
+ * @since Chrome 35.
+ */
+ export var onDownloadProgress: DownloadProgressEvent;
+}
+
+////////////////////
+// Windows
+////////////////////
+/**
+ * Use the chrome.windows API to interact with browser windows. You can use this API to create, modify, and rearrange windows in the browser.
+ * Permissions: The chrome.windows API can be used without declaring any permission. However, the "tabs" permission is required in order to populate the url, title, and favIconUrl properties of Tab objects.
+ * @since Chrome 5.
+ */
+declare namespace chrome.windows {
+ export interface Window {
+ /** Optional. Array of tabs.Tab objects representing the current tabs in the window. */
+ tabs?: chrome.tabs.Tab[] | undefined;
+ /** Optional. The offset of the window from the top edge of the screen in pixels. Under some circumstances a Window may not be assigned top property, for example when querying closed windows from the sessions API. */
+ top?: number | undefined;
+ /** Optional. The height of the window, including the frame, in pixels. Under some circumstances a Window may not be assigned height property, for example when querying closed windows from the sessions API. */
+ height?: number | undefined;
+ /** Optional. The width of the window, including the frame, in pixels. Under some circumstances a Window may not be assigned width property, for example when querying closed windows from the sessions API. */
+ width?: number | undefined;
+ /**
+ * The state of this browser window.
+ * @since Chrome 17.
+ */
+ state?: windowStateEnum | undefined;
+ /** Whether the window is currently the focused window. */
+ focused: boolean;
+ /**
+ * Whether the window is set to be always on top.
+ * @since Chrome 19.
+ */
+ alwaysOnTop: boolean;
+ /** Whether the window is incognito. */
+ incognito: boolean;
+ /**
+ * The type of browser window this is.
+ */
+ type?: windowTypeEnum | undefined;
+ /** Optional. The ID of the window. Window IDs are unique within a browser session. Under some circumstances a Window may not be assigned an ID, for example when querying windows using the sessions API, in which case a session ID may be present. */
+ id?: number | undefined;
+ /** Optional. The offset of the window from the left edge of the screen in pixels. Under some circumstances a Window may not be assigned left property, for example when querying closed windows from the sessions API. */
+ left?: number | undefined;
+ /**
+ * Optional. The session ID used to uniquely identify a Window obtained from the sessions API.
+ * @since Chrome 31.
+ */
+ sessionId?: string | undefined;
+ }
+
+ export interface QueryOptions {
+ /**
+ * Optional.
+ * If true, the windows.Window object will have a tabs property that contains a list of the tabs.Tab objects.
+ * The Tab objects only contain the url, pendingUrl, title and favIconUrl properties if the extension's manifest file includes the "tabs" permission.
+ */
+ populate?: boolean | undefined;
+ /**
+ * If set, the Window returned is filtered based on its type. If unset, the default filter is set to ['normal', 'popup'].
+ */
+ windowTypes?: windowTypeEnum[] | undefined;
+ }
+
+ export interface CreateData {
+ /**
+ * Optional. The id of the tab for which you want to adopt to the new window.
+ * @since Chrome 10.
+ */
+ tabId?: number | undefined;
+ /**
+ * Optional.
+ * A URL or array of URLs to open as tabs in the window. Fully-qualified URLs must include a scheme (i.e. 'http://www.google.com', not 'www.google.com'). Relative URLs will be relative to the current page within the extension. Defaults to the New Tab Page.
+ */
+ url?: string | string[] | undefined;
+ /**
+ * Optional.
+ * The number of pixels to position the new window from the top edge of the screen. If not specified, the new window is offset naturally from the last focused window. This value is ignored for panels.
+ */
+ top?: number | undefined;
+ /**
+ * Optional.
+ * The height in pixels of the new window, including the frame. If not specified defaults to a natural height.
+ */
+ height?: number | undefined;
+ /**
+ * Optional.
+ * The width in pixels of the new window, including the frame. If not specified defaults to a natural width.
+ */
+ width?: number | undefined;
+ /**
+ * Optional. If true, opens an active window. If false, opens an inactive window.
+ * @since Chrome 12.
+ */
+ focused?: boolean | undefined;
+ /** Optional. Whether the new window should be an incognito window. */
+ incognito?: boolean | undefined;
+ /** Optional. Specifies what type of browser window to create. */
+ type?: createTypeEnum | undefined;
+ /**
+ * Optional.
+ * The number of pixels to position the new window from the left edge of the screen. If not specified, the new window is offset naturally from the last focused window. This value is ignored for panels.
+ */
+ left?: number | undefined;
+ /**
+ * Optional. The initial state of the window. The 'minimized', 'maximized' and 'fullscreen' states cannot be combined with 'left', 'top', 'width' or 'height'.
+ * @since Chrome 44.
+ */
+ state?: windowStateEnum | undefined;
+ /**
+ * If true, the newly-created window's 'window.opener' is set to the caller and is in the same [unit of related browsing contexts](https://www.w3.org/TR/html51/browsers.html#unit-of-related-browsing-contexts) as the caller.
+ * @since Chrome 64.
+ */
+ setSelfAsOpener?: boolean | undefined;
+ }
+
+ export interface UpdateInfo {
+ /** Optional. The offset from the top edge of the screen to move the window to in pixels. This value is ignored for panels. */
+ top?: number | undefined;
+ /**
+ * Optional. If true, causes the window to be displayed in a manner that draws the user's attention to the window, without changing the focused window. The effect lasts until the user changes focus to the window. This option has no effect if the window already has focus. Set to false to cancel a previous draw attention request.
+ * @since Chrome 14.
+ */
+ drawAttention?: boolean | undefined;
+ /** Optional. The height to resize the window to in pixels. This value is ignored for panels. */
+ height?: number | undefined;
+ /** Optional. The width to resize the window to in pixels. This value is ignored for panels. */
+ width?: number | undefined;
+ /**
+ * Optional. The new state of the window. The 'minimized', 'maximized' and 'fullscreen' states cannot be combined with 'left', 'top', 'width' or 'height'.
+ * @since Chrome 17.
+ */
+ state?: windowStateEnum | undefined;
+ /**
+ * Optional. If true, brings the window to the front. If false, brings the next window in the z-order to the front.
+ * @since Chrome 8.
+ */
+ focused?: boolean | undefined;
+ /** Optional. The offset from the left edge of the screen to move the window to in pixels. This value is ignored for panels. */
+ left?: number | undefined;
+ }
+
+ export interface WindowEventFilter {
+ /**
+ * Conditions that the window's type being created must satisfy. By default it will satisfy ['app', 'normal', 'panel', 'popup'], with 'app' and 'panel' window types limited to the extension's own windows.
+ */
+ windowTypes: windowTypeEnum[];
+ }
+
+ export interface WindowIdEvent extends chrome.events.Event<(windowId: number) => void> {
+ addListener(
+ callback: (windowId: number) => void,
+ filters?: WindowEventFilter,
+ ): void;
+ }
+
+ export interface WindowReferenceEvent extends chrome.events.Event<(window: Window) => void> {
+ addListener(
+ callback: (window: Window) => void,
+ filters?: WindowEventFilter,
+ ): void;
+ }
+
+ /**
+ * Specifies what type of browser window to create.
+ * 'panel' is deprecated and is available only to existing whitelisted extensions on Chrome OS.
+ * @since Chrome 44.
+ */
+ export type createTypeEnum = "normal" | "popup" | "panel";
+
+ /**
+ * The state of this browser window.
+ * In some circumstances a window may not be assigned a state property; for example, when querying closed windows from the sessions API.
+ * @since Chrome 44.
+ */
+ export type windowStateEnum = "normal" | "minimized" | "maximized" | "fullscreen" | "locked-fullscreen";
+
+ /**
+ * The type of browser window this is.
+ * In some circumstances a window may not be assigned a type property; for example, when querying closed windows from the sessions API.
+ * @since Chrome 44.
+ */
+ export type windowTypeEnum = "normal" | "popup" | "panel" | "app" | "devtools";
+
+ /**
+ * The windowId value that represents the current window.
+ * @since Chrome 18.
+ */
+ export var WINDOW_ID_CURRENT: -2;
+ /**
+ * The windowId value that represents the absence of a chrome browser window.
+ * @since Chrome 6.
+ */
+ export var WINDOW_ID_NONE: -1;
+
+ /** Gets details about a window. */
+ export function get(windowId: number, callback: (window: chrome.windows.Window) => void): void;
+ /**
+ * Gets details about a window.
+ * @return The `get` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function get(windowId: number): Promise<chrome.windows.Window>;
+ /**
+ * Gets details about a window.
+ * @since Chrome 18.
+ */
+ export function get(
+ windowId: number,
+ queryOptions: QueryOptions,
+ callback: (window: chrome.windows.Window) => void,
+ ): void;
+ /**
+ * Gets details about a window.
+ * @since Chrome 18.
+ * @return The `get` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function get(windowId: number, queryOptions: QueryOptions): Promise<chrome.windows.Window>;
+ /** Gets the current window. */
+ export function getCurrent(callback: (window: chrome.windows.Window) => void): void;
+ /**
+ * Gets the current window.
+ * @return The `getCurrent` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function getCurrent(): Promise<chrome.windows.Window>;
+ /**
+ * Gets the current window.
+ * @param QueryOptions
+ * @since Chrome 18.
+ */
+ export function getCurrent(queryOptions: QueryOptions, callback: (window: chrome.windows.Window) => void): void;
+ /**
+ * Gets the current window.
+ * @param QueryOptions
+ * @since Chrome 18.
+ * @return The `getCurrent` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function getCurrent(queryOptions: QueryOptions): Promise<chrome.windows.Window>;
+ /**
+ * Creates (opens) a new browser with any optional sizing, position or default URL provided.
+ * @return The `create` method provides its result via callback or returned as a `Promise` (MV3 only). Contains details about the created window.
+ */
+ export function create(): Promise<chrome.windows.Window>;
+ /**
+ * Creates (opens) a new browser with any optional sizing, position or default URL provided.
+ * @param callback
+ * Optional parameter window: Contains details about the created window.
+ */
+ export function create(callback: (window?: chrome.windows.Window) => void): void;
+ /**
+ * Creates (opens) a new browser with any optional sizing, position or default URL provided.
+ * @param CreateData
+ * @return The `create` method provides its result via callback or returned as a `Promise` (MV3 only). Contains details about the created window.
+ */
+ export function create(createData: CreateData): Promise<chrome.windows.Window>;
+ /**
+ * Creates (opens) a new browser with any optional sizing, position or default URL provided.
+ * @param CreateData
+ * @param callback
+ * Optional parameter window: Contains details about the created window.
+ */
+ export function create(createData: CreateData, callback: (window?: chrome.windows.Window) => void): void;
+ /**
+ * Gets all windows.
+ */
+ export function getAll(callback: (windows: chrome.windows.Window[]) => void): void;
+ /**
+ * Gets all windows.
+ * @return The `getAll` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function getAll(): Promise<chrome.windows.Window[]>;
+ /**
+ * Gets all windows.
+ * @since Chrome 18.
+ */
+ export function getAll(queryOptions: QueryOptions, callback: (windows: chrome.windows.Window[]) => void): void;
+ /**
+ * Gets all windows.
+ * @since Chrome 18.
+ * @return The `getAll` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function getAll(queryOptions: QueryOptions): Promise<chrome.windows.Window[]>;
+ /**
+ * Updates the properties of a window. Specify only the properties that you want to change; unspecified properties will be left unchanged.
+ * @return The `update` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function update(
+ windowId: number,
+ updateInfo: UpdateInfo,
+ ): Promise<chrome.windows.Window>;
+ /** Updates the properties of a window. Specify only the properties that you want to change; unspecified properties will be left unchanged. */
+ export function update(
+ windowId: number,
+ updateInfo: UpdateInfo,
+ callback: (window: chrome.windows.Window) => void,
+ ): void;
+ /**
+ * Removes (closes) a window, and all the tabs inside it
+ * @return The `remove` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function remove(windowId: number): Promise<void>;
+ /** Removes (closes) a window, and all the tabs inside it. */
+ export function remove(windowId: number, callback: Function): void;
+ /**
+ * Gets the window that was most recently focused — typically the window 'on top'.
+ */
+ export function getLastFocused(callback: (window: chrome.windows.Window) => void): void;
+ /**
+ * Gets the window that was most recently focused — typically the window 'on top'.
+ * @return The `getLastFocused` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function getLastFocused(): Promise<chrome.windows.Window>;
+ /**
+ * Gets the window that was most recently focused — typically the window 'on top'.
+ * @since Chrome 18.
+ */
+ export function getLastFocused(queryOptions: QueryOptions, callback: (window: chrome.windows.Window) => void): void;
+ /**
+ * Gets the window that was most recently focused — typically the window 'on top'.
+ * @since Chrome 18.
+ * @return The `getLastFocused` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function getLastFocused(queryOptions: QueryOptions): Promise<chrome.windows.Window>;
+
+ /** Fired when a window is removed (closed). */
+ export var onRemoved: WindowIdEvent;
+ /** Fired when a window is created. */
+ export var onCreated: WindowReferenceEvent;
+ /**
+ * Fired when the currently focused window changes. Will be chrome.windows.WINDOW_ID_NONE if all chrome windows have lost focus.
+ * Note: On some Linux window managers, WINDOW_ID_NONE will always be sent immediately preceding a switch from one chrome window to another.
+ */
+ export var onFocusChanged: WindowIdEvent;
+
+ /**
+ * Fired when a window has been resized; this event is only dispatched when the new bounds are committed, and not for in-progress changes.
+ * @since Chrome 86.
+ */
+ export var onBoundsChanged: WindowReferenceEvent;
+}
+
+declare namespace chrome.declarativeNetRequest {
+ /** Ruleset ID for the dynamic rules added by the extension. */
+ export const DYNAMIC_RULESET_ID: string;
+
+ /** Time interval within which MAX_GETMATCHEDRULES_CALLS_PER_INTERVAL getMatchedRules calls can be made, specified in minutes.
+ * Additional calls will fail immediately and set runtime.lastError.
+ * Note: getMatchedRules calls associated with a user gesture are exempt from the quota.
+ */
+ export const GETMATCHEDRULES_QUOTA_INTERVAL: number;
+
+ /** The minimum number of static rules guaranteed to an extension across its enabled static rulesets.
+ * Any rules above this limit will count towards the global rule limit.
+ */
+ export const GUARANTEED_MINIMUM_STATIC_RULES: number;
+
+ /** The number of times getMatchedRules can be called within a period of GETMATCHEDRULES_QUOTA_INTERVAL. */
+ export const MAX_GETMATCHEDRULES_CALLS_PER_INTERVAL: number;
+
+ /** The maximum number of combined dynamic and session scoped rules an extension can add. */
+ export const MAX_NUMBER_OF_DYNAMIC_AND_SESSION_RULES: number;
+
+ /** The maximum number of regular expression rules that an extension can add.
+ * This limit is evaluated separately for the set of dynamic rules and those specified in the rule resources file.
+ */
+ export const MAX_NUMBER_OF_REGEX_RULES: number;
+
+ /** The maximum number of static Rulesets an extension can specify as part of the "rule_resources" manifest key. */
+ export const MAX_NUMBER_OF_STATIC_RULESETS: number;
+
+ /** Ruleset ID for the session-scoped rules added by the extension. */
+ export const SESSION_RULESET_ID: string;
+
+ /** This describes the HTTP request method of a network request. */
+ export enum RequestMethod {
+ CONNECT = "connect",
+ DELETE = "delete",
+ GET = "get",
+ HEAD = "head",
+ OPTIONS = "options",
+ PATCH = "patch",
+ POST = "post",
+ PUT = "put",
+ }
+
+ /** This describes the resource type of the network request. */
+ export enum ResourceType {
+ MAIN_FRAME = "main_frame",
+ SUB_FRAME = "sub_frame",
+ STYLESHEET = "stylesheet",
+ SCRIPT = "script",
+ IMAGE = "image",
+ FONT = "font",
+ OBJECT = "object",
+ XMLHTTPREQUEST = "xmlhttprequest",
+ PING = "ping",
+ CSP_REPORT = "csp_report",
+ MEDIA = "media",
+ WEBSOCKET = "websocket",
+ OTHER = "other",
+ }
+
+ /** Describes the kind of action to take if a given RuleCondition matches. */
+ export enum RuleActionType {
+ BLOCK = "block",
+ REDIRECT = "redirect",
+ ALLOW = "allow",
+ UPGRADE_SCHEME = "upgradeScheme",
+ MODIFY_HEADERS = "modifyHeaders",
+ ALLOW_ALL_REQUESTS = "allowAllRequests",
+ }
+
+ /** Describes the reason why a given regular expression isn't supported. */
+ export enum UnsupportedRegexReason {
+ SYNTAX_ERROR = "syntaxError",
+ MEMORY_LIMIT_EXCEEDED = "memoryLimitExceeded",
+ }
+
+ /** TThis describes whether the request is first or third party to the frame in which it originated.
+ * A request is said to be first party if it has the same domain (eTLD+1) as the frame in which the request originated.
+ */
+ export enum DomainType {
+ FIRST_PARTY = "firstParty",
+ THIRD_PARTY = "thirdParty",
+ }
+
+ /** This describes the possible operations for a "modifyHeaders" rule. */
+ export enum HeaderOperation {
+ APPEND = "append",
+ SET = "set",
+ REMOVE = "remove",
+ }
+
+ export interface RequestDetails {
+ /** The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens.
+ * If the document of a (sub-)frame is loaded (type is main_frame or sub_frame), frameId indicates the ID of this frame, not the ID of the outer frame.
+ * Frame IDs are unique within a tab.
+ */
+ frameId: number;
+
+ /** The origin where the request was initiated.
+ * This does not change through redirects.
+ * If this is an opaque origin, the string 'null' will be used.
+ */
+ initiator?: string | undefined;
+
+ /** Standard HTTP method. */
+ method: string;
+
+ /** ID of frame that wraps the frame which sent the request.
+ * Set to -1 if no parent frame exists.
+ */
+ partentFrameId: number;
+
+ /** The ID of the request.
+ * Request IDs are unique within a browser session.
+ */
+ requestId: string;
+
+ /** The ID of the tab in which the request takes place.
+ * Set to -1 if the request isn't related to a tab.
+ */
+ tabId: number;
+
+ /** The resource type of the request. */
+ type: ResourceType;
+
+ /** The URL of the request. */
+ url: string;
+ }
+
+ export interface Rule {
+ /** The action to take if this rule is matched. */
+ action: RuleAction;
+
+ /** The condition under which this rule is triggered. */
+ condition: RuleCondition;
+
+ /** An id which uniquely identifies a rule.
+ * Mandatory and should be >= 1.
+ */
+ id: number;
+
+ /** Rule priority.
+ * Defaults to 1.
+ * When specified, should be >= 1.
+ */
+ priority?: number | undefined;
+ }
+
+ export interface RuleAction {
+ /** Describes how the redirect should be performed.
+ * Only valid for redirect rules.
+ */
+ redirect?: Redirect | undefined;
+
+ /** The request headers to modify for the request.
+ * Only valid if RuleActionType is "modifyHeaders".
+ */
+ requestHeaders?: ModifyHeaderInfo[] | undefined;
+
+ /** The response headers to modify for the request.
+ * Only valid if RuleActionType is "modifyHeaders".
+ */
+ responseHeaders?: ModifyHeaderInfo[] | undefined;
+
+ /** The type of action to perform. */
+ type: RuleActionType;
+ }
+
+ export interface RuleCondition {
+ /**
+ * Specifies whether the network request is first-party or third-party to the domain from which it originated.
+ * If omitted, all requests are accepted.
+ */
+ domainType?: DomainType | undefined;
+
+ /**
+ * @deprecated since Chrome 101. Use initiatorDomains instead.
+
+ * The rule will only match network requests originating from the list of domains.
+ * If the list is omitted, the rule is applied to requests from all domains.
+ * An empty list is not allowed.
+ *
+ * Notes:
+ * Sub-domains like "a.example.com" are also allowed.
+ * The entries must consist of only ascii characters.
+ * Use punycode encoding for internationalized domains.
+ * This matches against the request initiator and not the request url.
+ */
+ domains?: string[] | undefined;
+
+ /**
+ * @deprecated since Chrome 101. Use excludedInitiatorDomains instead
+ *
+ * The rule will not match network requests originating from the list of excludedDomains.
+ * If the list is empty or omitted, no domains are excluded.
+ * This takes precedence over domains.
+ *
+ * Notes:
+ * Sub-domains like "a.example.com" are also allowed.
+ * The entries must consist of only ascii characters.
+ * Use punycode encoding for internationalized domains.
+ * This matches against the request initiator and not the request url.
+ */
+ excludedDomains?: string[] | undefined;
+
+ /**
+ * The rule will only match network requests originating from the list of initiatorDomains.
+ * If the list is omitted, the rule is applied to requests from all domains.
+ * An empty list is not allowed.
+ *
+ * Notes:
+ * Sub-domains like "a.example.com" are also allowed.
+ * The entries must consist of only ascii characters.
+ * Use punycode encoding for internationalized domains.
+ * This matches against the request initiator and not the request url.
+ */
+ initiatorDomains?: string[] | undefined;
+
+ /**
+ * The rule will not match network requests originating from the list of excludedInitiatorDomains.
+ * If the list is empty or omitted, no domains are excluded.
+ * This takes precedence over initiatorDomains.
+ *
+ * Notes:
+ * Sub-domains like "a.example.com" are also allowed.
+ * The entries must consist of only ascii characters.
+ * Use punycode encoding for internationalized domains.
+ * This matches against the request initiator and not the request url.
+ */
+ excludedInitiatorDomains?: string[] | undefined;
+
+ /**
+ * The rule will only match network requests when the domain matches one from the list of requestDomains.
+ * If the list is omitted, the rule is applied to requests from all domains.
+ * An empty list is not allowed.
+ *
+ * Notes:
+ * Sub-domains like "a.example.com" are also allowed.
+ * The entries must consist of only ascii characters.
+ * Use punycode encoding for internationalized domains.
+ */
+ requestDomains?: string[] | undefined;
+
+ /**
+ * The rule will not match network requests when the domains matches one from the list of excludedRequestDomains.
+ * If the list is empty or omitted, no domains are excluded.
+ * This takes precedence over requestDomains.
+ *
+ * Notes:
+ * Sub-domains like "a.example.com" are also allowed.
+ * The entries must consist of only ascii characters.
+ * Use punycode encoding for internationalized domains.
+ */
+ excludedRequestDomains?: string[] | undefined;
+
+ /**
+ * List of request methods which the rule won't match.
+ * Only one of requestMethods and excludedRequestMethods should be specified.
+ * If neither of them is specified, all request methods are matched.
+ */
+ excludedRequestMethods?: RequestMethod[] | undefined;
+
+ /**
+ * List of resource types which the rule won't match.
+ * Only one of {@link chrome.declarativeNetRequest.RuleCondition.resourceTypes}
+ * and {@link chrome.declarativeNetRequest.RuleCondition.excludedResourceTypes} should be specified.
+ * If neither of them is specified, all resource types except "main_frame" are blocked.
+ */
+ excludedResourceTypes?: ResourceType[] | undefined;
+
+ /**
+ * List of {@link chrome.tabs.Tab.id} which the rule should not match.
+ * An ID of {@link chrome.tabs.TAB_ID_NONE} excludes requests which don't originate from a tab.
+ * Only supported for session-scoped rules.
+ */
+ excludedTabIds?: number[] | undefined;
+
+ /**
+ * Whether the urlFilter or regexFilter (whichever is specified) is case sensitive.
+ * Default is true.
+ */
+ isUrlFilterCaseSensitive?: boolean | undefined;
+
+ /**
+ * Regular expression to match against the network request url.
+ * This follows the RE2 syntax.
+ *
+ * Note: Only one of urlFilter or regexFilter can be specified.
+ *
+ * Note: The regexFilter must be composed of only ASCII characters.
+ * This is matched against a url where the host is encoded in the punycode format (in case of internationalized domains) and any other non-ascii characters are url encoded in utf-8.
+ */
+ regexFilter?: string | undefined;
+
+ /**
+ * List of HTTP request methods which the rule can match. An empty list is not allowed.
+ * Note: Specifying a {@link chrome.declarativeNetRequest.RuleCondition.requestMethods} rule condition will also exclude non-HTTP(s) requests,
+ * whereas specifying {@link chrome.declarativeNetRequest.RuleCondition.excludedRequestMethods} will not.
+ */
+ requestMethods?: RequestMethod[];
+
+ /**
+ * List of {@link chrome.tabs.Tab.id} which the rule should not match.
+ * An ID of {@link chrome.tabs.TAB_ID_NONE} excludes requests which don't originate from a tab.
+ * An empty list is not allowed. Only supported for session-scoped rules.
+ */
+ tabIds?: number[] | undefined;
+
+ /**
+ * The pattern which is matched against the network request url.
+ * Supported constructs:
+ *
+ * '*' : Wildcard: Matches any number of characters.
+ *
+ * '|' : Left/right anchor: If used at either end of the pattern, specifies the beginning/end of the url respectively.
+ *
+ * '||' : Domain name anchor: If used at the beginning of the pattern, specifies the start of a (sub-)domain of the URL.
+ *
+ * '^' : Separator character: This matches anything except a letter, a digit or one of the following: _ - . %.
+ * This can also match the end of the URL.
+ *
+ * Therefore urlFilter is composed of the following parts: (optional Left/Domain name anchor) + pattern + (optional Right anchor).
+ *
+ * If omitted, all urls are matched. An empty string is not allowed.
+ *
+ * A pattern beginning with || is not allowed. Use instead.
+ *
+ * Note: Only one of urlFilter or regexFilter can be specified.
+ *
+ * Note: The urlFilter must be composed of only ASCII characters.
+ * This is matched against a url where the host is encoded in the punycode format (in case of internationalized domains) and any other non-ascii characters are url encoded in utf-8.
+ * For example, when the request url is http://abc.рф?q=ф, the urlFilter will be matched against the url http://abc.xn--p1ai/?q=%D1%84.
+ */
+ urlFilter?: string | undefined;
+
+ /**
+ * List of resource types which the rule can match.
+ * An empty list is not allowed.
+ *
+ * Note: this must be specified for allowAllRequests rules and may only include the sub_frame and main_frame resource types.
+ */
+ resourceTypes?: ResourceType[] | undefined;
+ }
+
+ export interface MatchedRule {
+ /** A matching rule's ID. */
+ ruleId: number;
+
+ /** ID of the Ruleset this rule belongs to.
+ * For a rule originating from the set of dynamic rules, this will be equal to DYNAMIC_RULESET_ID.
+ */
+ rulesetId: string;
+ }
+
+ export interface MatchedRuleInfo {
+ rule: MatchedRule;
+
+ /** The tabId of the tab from which the request originated if the tab is still active. Else -1. */
+ tabId: number;
+
+ /** The time the rule was matched.
+ * Timestamps will correspond to the Javascript convention for times, i.e. number of milliseconds since the epoch.
+ */
+ timeStamp: number;
+ }
+
+ export interface MatchedRulesFilter {
+ /** If specified, only matches rules after the given timestamp. */
+ minTimeStamp?: number | undefined;
+
+ /** If specified, only matches rules for the given tab.
+ * Matches rules not associated with any active tab if set to -1.
+ */
+ tabId?: number | undefined;
+ }
+
+ export interface ModifyHeaderInfo {
+ /** The name of the header to be modified. */
+ header: string;
+
+ /** The operation to be performed on a header. */
+ operation: HeaderOperation;
+
+ /** The new value for the header.
+ * Must be specified for append and set operations.
+ */
+ value?: string | undefined;
+ }
+
+ export interface QueryKeyValue {
+ key: string;
+ value: string;
+ }
+
+ export interface QueryTransform {
+ /** The list of query key-value pairs to be added or replaced. */
+ addOrReplaceParams?: QueryKeyValue[] | undefined;
+
+ /** The list of query keys to be removed. */
+ removeParams?: string[] | undefined;
+ }
+
+ export interface URLTransform {
+ /** The new fragment for the request.
+ * Should be either empty, in which case the existing fragment is cleared; or should begin with '#'.
+ */
+ fragment?: string | undefined;
+
+ /** The new host for the request. */
+ host?: string | undefined;
+
+ /** The new password for the request. */
+ password?: string | undefined;
+
+ /** The new path for the request.
+ * If empty, the existing path is cleared.
+ */
+ path?: string | undefined;
+
+ /** The new port for the request.
+ * If empty, the existing port is cleared.
+ */
+ port?: string | undefined;
+
+ /** The new query for the request.
+ * Should be either empty, in which case the existing query is cleared; or should begin with '?'.
+ */
+ query?: string | undefined;
+
+ /** Add, remove or replace query key-value pairs. */
+ queryTransform?: QueryTransform | undefined;
+
+ /** The new scheme for the request.
+ * Allowed values are "http", "https", "ftp" and "chrome-extension".
+ */
+ scheme?: string | undefined;
+
+ /** The new username for the request. */
+ username?: string | undefined;
+ }
+
+ export interface RegexOptions {
+ /** Whether the regex specified is case sensitive.
+ * Default is true.
+ */
+ isCaseSensitive?: boolean | undefined;
+
+ /** The regular expression to check. */
+ regex: string;
+
+ /** Whether the regex specified requires capturing.
+ * Capturing is only required for redirect rules which specify a regexSubstitution action.
+ * The default is false.
+ */
+ requireCapturing?: boolean | undefined;
+ }
+
+ export interface IsRegexSupportedResult {
+ isSupported: boolean;
+
+ /** Specifies the reason why the regular expression is not supported.
+ * Only provided if isSupported is false.
+ */
+ reason?: UnsupportedRegexReason | undefined;
+ }
+
+ export interface TabActionCountUpdate {
+ /** The amount to increment the tab's action count by.
+ * Negative values will decrement the count
+ */
+ increment: number;
+
+ /** The tab for which to update the action count. */
+ tabId: number;
+ }
+
+ export interface ExtensionActionOptions {
+ /** Whether to automatically display the action count for a page as the extension's badge text.
+ * This preference is persisted across sessions.
+ */
+ displayActionCountAsBadgeText?: boolean | undefined;
+
+ /** Details of how the tab's action count should be adjusted. */
+ tabUpdate?: TabActionCountUpdate | undefined;
+ }
+
+ export interface Redirect {
+ /** Path relative to the extension directory.
+ * Should start with '/'.
+ */
+ extensionPath?: string | undefined;
+
+ /** Substitution pattern for rules which specify a regexFilter.
+ * The first match of regexFilter within the url will be replaced with this pattern.
+ * Within regexSubstitution, backslash-escaped digits (\1 to \9) can be used to insert the corresponding capture groups.
+ * \0 refers to the entire matching text.
+ */
+ regexSubstitution?: string | undefined;
+
+ /** Url transformations to perform. */
+ transform?: URLTransform | undefined;
+
+ /** The redirect url.
+ * Redirects to JavaScript urls are not allowed.
+ */
+ url?: string | undefined;
+ }
+
+ export interface UpdateRuleOptions {
+ /** Rules to add. */
+ addRules?: Rule[] | undefined;
+
+ /**
+ * IDs of the rules to remove.
+ * Any invalid IDs will be ignored.
+ */
+ removeRuleIds?: number[] | undefined;
+ }
+
+ export interface UpdateRulesetOptions {
+ /** The set of ids corresponding to a static Ruleset that should be disabled. */
+ disableRulesetIds?: string[] | undefined;
+
+ /** The set of ids corresponding to a static Ruleset that should be enabled. */
+ enableRulesetIds?: string[] | undefined;
+ }
+
+ export interface MatchedRuleInfoDebug {
+ /** Details about the request for which the rule was matched. */
+ request: RequestDetails;
+
+ rule: MatchedRule;
+ }
+
+ export interface Ruleset {
+ /** Whether the ruleset is enabled by default. */
+ enabled: boolean;
+
+ /** A non-empty string uniquely identifying the ruleset.
+ * IDs beginning with '_' are reserved for internal use.
+ */
+ id: string;
+
+ /** The path of the JSON ruleset relative to the extension directory. */
+ path: string;
+ }
+
+ export interface RulesMatchedDetails {
+ /** Rules matching the given filter. */
+ rulesMatchedInfo: MatchedRuleInfo[];
+ }
+
+ /** Returns the number of static rules an extension can enable before the global static rule limit is reached. */
+ export function getAvailableStaticRuleCount(callback: (count: number) => void): void;
+
+ /**
+ * Returns the number of static rules an extension can enable before the global static rule limit is reached.
+ * @return The `getAvailableStaticRuleCount` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function getAvailableStaticRuleCount(): Promise<number>;
+
+ /** Returns the current set of dynamic rules for the extension.
+ *
+ * @param callback Called with the set of dynamic rules.
+ * An error might be raised in case of transient internal errors.
+ */
+ export function getDynamicRules(callback: (rules: Rule[]) => void): void;
+
+ /**
+ * Returns the current set of dynamic rules for the extension.
+ * @return The `getDynamicRules` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function getDynamicRules(): Promise<Rule[]>;
+
+ /** Returns the ids for the current set of enabled static rulesets.
+ *
+ * @param callback Called with a list of ids, where each id corresponds to an enabled static Ruleset. */
+ export function getEnabledRulesets(callback: (rulesetIds: string[]) => void): void;
+
+ /**
+ * Returns the ids for the current set of enabled static rulesets.
+ * @return The `getEnabledRulesets` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function getEnabledRulesets(): Promise<string[]>;
+
+ /** Returns all rules matched for the extension.
+ * Callers can optionally filter the list of matched rules by specifying a filter.
+ * This method is only available to extensions with the declarativeNetRequestFeedback permission or having the activeTab permission granted for the tabId specified in filter.
+ * Note: Rules not associated with an active document that were matched more than five minutes ago will not be returned.
+ *
+ * @param filter An object to filter the list of matched rules.
+ * @param callback Called once the list of matched rules has been fetched.
+ * In case of an error, runtime.lastError will be set and no rules will be returned.
+ * This can happen for multiple reasons, such as insufficient permissions, or exceeding the quota.
+ */
+ export function getMatchedRules(
+ filter: MatchedRulesFilter | undefined,
+ callback: (details: RulesMatchedDetails) => void,
+ ): void;
+
+ /**
+ * Returns all rules matched for the extension.
+ * Callers can optionally filter the list of matched rules by specifying a filter.
+ * This method is only available to extensions with the declarativeNetRequestFeedback permission or having the activeTab permission granted for the tabId specified in filter.
+ * Note: Rules not associated with an active document that were matched more than five minutes ago will not be returned.
+ *
+ * @param filter An object to filter the list of matched rules.
+ * @return The `getMatchedRules` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function getMatchedRules(filter: MatchedRulesFilter | undefined): Promise<RulesMatchedDetails>;
+
+ export function getMatchedRules(callback: (details: RulesMatchedDetails) => void): void;
+
+ export function getMatchedRules(): Promise<RulesMatchedDetails>;
+
+ /** Returns the current set of session scoped rules for the extension.
+ *
+ * @param callback Called with the set of session scoped rules.
+ */
+ export function getSessionRules(callback: (rules: Rule[]) => void): void;
+
+ /**
+ * Returns the current set of session scoped rules for the extension.
+ *
+ * @return The `getSessionRules` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function getSessionRules(): Promise<Rule[]>;
+
+ /** Checks if the given regular expression will be supported as a regexFilter rule condition.
+ *
+ * @param regexOptions The regular expression to check.
+ * @param callback Called with details consisting of whether the regular expression is supported and the
+ * reason if not.
+ */
+ export function isRegexSupported(
+ regexOptions: RegexOptions,
+ callback: (result: IsRegexSupportedResult) => void,
+ ): void;
+
+ /** Checks if the given regular expression will be supported as a regexFilter rule condition.
+ *
+ * @param regexOptions The regular expression to check.
+ * @return The `isRegexSupported` method provides its result via callback or returned as a `Promise` (MV3 only).
+ */
+ export function isRegexSupported(regexOptions: RegexOptions): Promise<IsRegexSupportedResult>;
+
+ /** Configures if the action count for tabs should be displayed as the extension action's badge text and provides a way for that action count to be incremented. */
+ export function setExtensionActionOptions(options: ExtensionActionOptions, callback: Function): void;
+
+ /**
+ * Configures if the action count for tabs should be displayed as the extension action's badge text and provides a way for that action count to be incremented.
+ * @return The `setExtensionActionOptions` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ */
+ export function setExtensionActionOptions(options: ExtensionActionOptions): Promise<void>;
+
+ /** Modifies the current set of dynamic rules for the extension.
+ * The rules with IDs listed in options.removeRuleIds are first removed, and then the rules given in options.addRules are added.
+ *
+ * Notes:
+ * This update happens as a single atomic operation: either all specified rules are added and removed, or an error is returned.
+ * These rules are persisted across browser sessions and across extension updates.
+ * Static rules specified as part of the extension package can not be removed using this function.
+ * MAX_NUMBER_OF_DYNAMIC_AND_SESSION_RULES is the maximum number of combined dynamic and session rules an extension can add.
+ *
+ * @param callback Called once the update is complete or has failed.
+ * In case of an error, runtime.lastError will be set and no change will be made to the rule set.
+ * This can happen for multiple reasons, such as invalid rule format, duplicate rule ID, rule count limit exceeded, internal errors, and others.
+ */
+ export function updateDynamicRules(options: UpdateRuleOptions, callback: Function): void;
+
+ /** Modifies the current set of dynamic rules for the extension.
+ * The rules with IDs listed in options.removeRuleIds are first removed, and then the rules given in options.addRules are added.
+ *
+ * Notes:
+ * This update happens as a single atomic operation: either all specified rules are added and removed, or an error is returned.
+ * These rules are persisted across browser sessions and across extension updates.
+ * Static rules specified as part of the extension package can not be removed using this function.
+ * MAX_NUMBER_OF_DYNAMIC_AND_SESSION_RULES is the maximum number of combined dynamic and session rules an extension can add.
+ *
+ * @return The `updateDynamicRules` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ * In case of an error, runtime.lastError will be set and no change will be made to the rule set.
+ * This can happen for multiple reasons, such as invalid rule format, duplicate rule ID, rule count limit exceeded, internal errors, and others.
+ */
+ export function updateDynamicRules(options: UpdateRuleOptions): Promise<void>;
+
+ /** Updates the set of enabled static rulesets for the extension.
+ * The rulesets with IDs listed in options.disableRulesetIds are first removed, and then the rulesets listed in options.enableRulesetIds are added.
+ *
+ * Note that the set of enabled static rulesets is persisted across sessions but not across extension updates, i.e. the rule_resources manifest key will determine the set of enabled static rulesets on each extension update.
+ *
+ * @param callback Called once the update is complete.
+ * In case of an error, runtime.lastError will be set and no change will be made to set of enabled rulesets.
+ * This can happen for multiple reasons, such as invalid ruleset IDs, rule count limit exceeded, or internal errors.
+ */
+ export function updateEnabledRulesets(options: UpdateRulesetOptions, callback: Function): void;
+
+ /** Updates the set of enabled static rulesets for the extension.
+ * The rulesets with IDs listed in options.disableRulesetIds are first removed, and then the rulesets listed in options.enableRulesetIds are added.
+ *
+ * Note that the set of enabled static rulesets is persisted across sessions but not across extension updates, i.e. the rule_resources manifest key will determine the set of enabled static rulesets on each extension update.
+ *
+ * @return The `updateEnabledRulesets` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ * In case of an error, runtime.lastError will be set and no change will be made to set of enabled rulesets.
+ * This can happen for multiple reasons, such as invalid ruleset IDs, rule count limit exceeded, or internal errors.
+ */
+ export function updateEnabledRulesets(options: UpdateRulesetOptions): Promise<void>;
+
+ /** Modifies the current set of session scoped rules for the extension.
+ * The rules with IDs listed in options.removeRuleIds are first removed, and then the rules given in options.addRules are added.
+ *
+ * Notes:
+ * This update happens as a single atomic operation: either all specified rules are added and removed, or an error is returned.
+ * These rules are not persisted across sessions and are backed in memory.
+ * MAX_NUMBER_OF_DYNAMIC_AND_SESSION_RULES is the maximum number of combined dynamic and session rules an extension can add.
+ *
+ * @param callback Called once the update is complete or has failed.
+ * In case of an error, runtime.lastError will be set and no change will be made to the rule set.
+ * This can happen for multiple reasons, such as invalid rule format, duplicate rule ID, rule count limit exceeded, and others.
+ */
+ export function updateSessionRules(options: UpdateRuleOptions, callback: Function): void;
+
+ /** Modifies the current set of session scoped rules for the extension.
+ * The rules with IDs listed in options.removeRuleIds are first removed, and then the rules given in options.addRules are added.
+ *
+ * Notes:
+ * This update happens as a single atomic operation: either all specified rules are added and removed, or an error is returned.
+ * These rules are not persisted across sessions and are backed in memory.
+ * MAX_NUMBER_OF_DYNAMIC_AND_SESSION_RULES is the maximum number of combined dynamic and session rules an extension can add.
+ *
+ * @return The `updateSessionRules` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
+ * In case of an error, runtime.lastError will be set and no change will be made to the rule set.
+ * This can happen for multiple reasons, such as invalid rule format, duplicate rule ID, rule count limit exceeded, and others.
+ */
+ export function updateSessionRules(options: UpdateRuleOptions): Promise<void>;
+
+ /** The rule that has been matched along with information about the associated request. */
+ export interface RuleMatchedDebugEvent extends chrome.events.Event<(info: MatchedRuleInfoDebug) => void> {}
+
+ /** Fired when a rule is matched with a request.
+ * Only available for unpacked extensions with the declarativeNetRequestFeedback permission as this is intended to be used for debugging purposes only. */
+ export var onRuleMatchedDebug: RuleMatchedDebugEvent;
+}
+
+////////////////////
+// SidePanel
+////////////////////
+/**
+ * Availability: @since Chrome 114. Manifest v3.
+ * https://developer.chrome.com/docs/extensions/reference/sidePanel/
+ * Permissions: "sidePanel"
+ */
+declare namespace chrome.sidePanel {
+ export interface GetPanelOptions {
+ tabId?: number;
+ }
+
+ export interface PanelBehavior {
+ openPanelOnActionClick?: boolean;
+ }
+
+ export interface PanelOptions {
+ enabled?: boolean;
+ path?: string;
+ tabId?: number;
+ }
+
+ export interface SidePanel {
+ default_path: string;
+ }
+
+ export function getOptions(
+ options: GetPanelOptions,
+ callback?: (options: PanelOptions) => void,
+ ): Promise<PanelOptions>;
+
+ export function getPanelBehavior(callback?: (behavior: PanelBehavior) => void): Promise<PanelBehavior>;
+
+ export function setOptions(options: PanelOptions, callback?: () => void): Promise<void>;
+
+ export function setPanelBehavior(behavior: PanelBehavior, callback?: () => void): Promise<void>;
+}
diff --git a/client/node_modules/@types/chrome/package.json b/client/node_modules/@types/chrome/package.json
new file mode 100644
index 0000000..4cfe78a
--- /dev/null
+++ b/client/node_modules/@types/chrome/package.json
@@ -0,0 +1,98 @@
+{
+ "name": "@types/chrome",
+ "version": "0.0.248",
+ "description": "TypeScript definitions for chrome",
+ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/chrome",
+ "license": "MIT",
+ "contributors": [
+ {
+ "name": "Matthew Kimber",
+ "githubUsername": "matthewkimber",
+ "url": "https://github.com/matthewkimber"
+ },
+ {
+ "name": "otiai10",
+ "githubUsername": "otiai10",
+ "url": "https://github.com/otiai10"
+ },
+ {
+ "name": "sreimer15",
+ "githubUsername": "sreimer15",
+ "url": "https://github.com/sreimer15"
+ },
+ {
+ "name": "MatCarlson",
+ "githubUsername": "MatCarlson",
+ "url": "https://github.com/MatCarlson"
+ },
+ {
+ "name": "ekinsol",
+ "githubUsername": "ekinsol",
+ "url": "https://github.com/ekinsol"
+ },
+ {
+ "name": "Brian Wilson",
+ "githubUsername": "echoabstract",
+ "url": "https://github.com/echoabstract"
+ },
+ {
+ "name": "Sebastiaan Pasma",
+ "githubUsername": "spasma",
+ "url": "https://github.com/spasma"
+ },
+ {
+ "name": "bdbai",
+ "githubUsername": "bdbai",
+ "url": "https://github.com/bdbai"
+ },
+ {
+ "name": "pokutuna",
+ "githubUsername": "pokutuna",
+ "url": "https://github.com/pokutuna"
+ },
+ {
+ "name": "Jason Xian",
+ "githubUsername": "JasonXian",
+ "url": "https://github.com/JasonXian"
+ },
+ {
+ "name": "userTim",
+ "githubUsername": "usertim",
+ "url": "https://github.com/usertim"
+ },
+ {
+ "name": "Idan Zeierman",
+ "githubUsername": "idan315",
+ "url": "https://github.com/idan315"
+ },
+ {
+ "name": "Nicolas Rodriguez",
+ "githubUsername": "nicolas377",
+ "url": "https://github.com/nicolas377"
+ },
+ {
+ "name": "Ido Salomon",
+ "githubUsername": "idosal",
+ "url": "https://github.com/idosal"
+ },
+ {
+ "name": "Federico Brigante",
+ "githubUsername": "fregante",
+ "url": "https://github.com/fregante"
+ }
+ ],
+ "main": "",
+ "types": "index.d.ts",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
+ "directory": "types/chrome"
+ },
+ "scripts": {},
+ "dependencies": {
+ "@types/filesystem": "*",
+ "@types/har-format": "*"
+ },
+ "typesPublisherContentHash": "9860d7b122e9b41b782f6587edb1202070e290d8514cb72ce12c73d8e27b281b",
+ "typeScriptVersion": "4.5"
+} \ No newline at end of file
diff --git a/client/node_modules/@types/filesystem/LICENSE b/client/node_modules/@types/filesystem/LICENSE
new file mode 100644
index 0000000..9e841e7
--- /dev/null
+++ b/client/node_modules/@types/filesystem/LICENSE
@@ -0,0 +1,21 @@
+ MIT License
+
+ Copyright (c) Microsoft Corporation.
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE
diff --git a/client/node_modules/@types/filesystem/README.md b/client/node_modules/@types/filesystem/README.md
new file mode 100644
index 0000000..f71d443
--- /dev/null
+++ b/client/node_modules/@types/filesystem/README.md
@@ -0,0 +1,15 @@
+# Installation
+> `npm install --save @types/filesystem`
+
+# Summary
+This package contains type definitions for filesystem (http://www.w3.org/TR/file-system-api/).
+
+# Details
+Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/filesystem.
+
+### Additional Details
+ * Last updated: Tue, 07 Nov 2023 03:09:37 GMT
+ * Dependencies: [@types/filewriter](https://npmjs.com/package/@types/filewriter)
+
+# Credits
+These definitions were written by [Kon](http://phyzkit.net/).
diff --git a/client/node_modules/@types/filesystem/index.d.ts b/client/node_modules/@types/filesystem/index.d.ts
new file mode 100644
index 0000000..ff050ab
--- /dev/null
+++ b/client/node_modules/@types/filesystem/index.d.ts
@@ -0,0 +1,564 @@
+/// <reference types="filewriter" />
+
+interface LocalFileSystem {
+ /**
+ * Used for storage with no guarantee of persistence.
+ */
+ TEMPORARY: number;
+
+ /**
+ * Used for storage that should not be removed by the user agent without application or user permission.
+ */
+ PERSISTENT: number;
+
+ /**
+ * Requests a filesystem in which to store application data.
+ * @param type Whether the filesystem requested should be persistent, as defined above. Use one of TEMPORARY or PERSISTENT.
+ * @param size This is an indicator of how much storage space, in bytes, the application expects to need.
+ * @param successCallback The callback that is called when the user agent provides a filesystem.
+ * @param errorCallback A callback that is called when errors happen, or when the request to obtain the filesystem is denied.
+ */
+ requestFileSystem(
+ type: number,
+ size: number,
+ successCallback: FileSystemCallback,
+ errorCallback?: ErrorCallback,
+ ): void;
+
+ /**
+ * Allows the user to look up the Entry for a file or directory referred to by a local URL.
+ * @param url A URL referring to a local file in a filesystem accessable via this API.
+ * @param successCallback A callback that is called to report the Entry to which the supplied URL refers.
+ * @param errorCallback A callback that is called when errors happen, or when the request to obtain the Entry is denied.
+ */
+ resolveLocalFileSystemURL(url: string, successCallback: EntryCallback, errorCallback?: ErrorCallback): void;
+
+ /**
+ * see requestFileSystem.
+ */
+ webkitRequestFileSystem(
+ type: number,
+ size: number,
+ successCallback: FileSystemCallback,
+ errorCallback?: ErrorCallback,
+ ): void;
+}
+
+interface LocalFileSystemSync {
+ /**
+ * Used for storage with no guarantee of persistence.
+ */
+ TEMPORARY: number;
+
+ /**
+ * Used for storage that should not be removed by the user agent without application or user permission.
+ */
+ PERSISTENT: number;
+
+ /**
+ * Requests a filesystem in which to store application data.
+ * @param type Whether the filesystem requested should be persistent, as defined above. Use one of TEMPORARY or PERSISTENT.
+ * @param size This is an indicator of how much storage space, in bytes, the application expects to need.
+ */
+ requestFileSystemSync(type: number, size: number): FileSystemSync;
+
+ /**
+ * Allows the user to look up the Entry for a file or directory referred to by a local URL.
+ * @param url A URL referring to a local file in a filesystem accessable via this API.
+ */
+ resolveLocalFileSystemSyncURL(url: string): EntrySync;
+
+ /**
+ * see requestFileSystemSync
+ */
+ webkitRequestFileSystemSync(type: number, size: number): FileSystemSync;
+}
+
+interface Metadata {
+ /**
+ * This is the time at which the file or directory was last modified.
+ */
+ modificationTime: Date;
+
+ /**
+ * The size of the file, in bytes. This must return 0 for directories.
+ */
+ size: number;
+}
+
+interface Flags {
+ /**
+ * Used to indicate that the user wants to create a file or directory if it was not previously there.
+ */
+ create?: boolean | undefined;
+
+ /**
+ * By itself, exclusive must have no effect. Used with create, it must cause getFile and getDirectory to fail if the target path already exists.
+ */
+ exclusive?: boolean | undefined;
+}
+
+/**
+ * This interface represents a file system.
+ */
+interface FileSystem {
+ /**
+ * This is the name of the file system. The specifics of naming filesystems is unspecified, but a name must be unique across the list of exposed file systems.
+ */
+ readonly name: string;
+
+ /**
+ * The root directory of the file system.
+ */
+ readonly root: FileSystemDirectoryEntry;
+}
+
+interface FileSystemEntry {
+ /**
+ * Entry is a file.
+ */
+ readonly isFile: boolean;
+
+ /**
+ * Entry is a directory.
+ */
+ readonly isDirectory: boolean;
+
+ /**
+ * Look up metadata about this entry.
+ * @param successCallback A callback that is called with the time of the last modification.
+ * @param errorCallback ErrorCallback A callback that is called when errors happen.
+ */
+ getMetadata(successCallback: MetadataCallback, errorCallback?: ErrorCallback): void;
+
+ /**
+ * The name of the entry, excluding the path leading to it.
+ */
+ readonly name: string;
+
+ /**
+ * The full absolute path from the root to the entry.
+ */
+ readonly fullPath: string;
+
+ /**
+ * The file system on which the entry resides.
+ */
+ readonly filesystem: FileSystem;
+
+ /**
+ * Move an entry to a different location on the file system. It is an error to try to:
+ *
+ * <ui>
+ * <li>move a directory inside itself or to any child at any depth;</li>
+ * <li>move an entry into its parent if a name different from its current one isn't provided;</li>
+ * <li>move a file to a path occupied by a directory;</li>
+ * <li>move a directory to a path occupied by a file;</li>
+ * <li>move any element to a path occupied by a directory which is not empty.</li>
+ * <ul>
+ *
+ * A move of a file on top of an existing file must attempt to delete and replace that file.
+ * A move of a directory on top of an existing empty directory must attempt to delete and replace that directory.
+ */
+ moveTo(
+ parent: FileSystemDirectoryEntry,
+ newName?: string,
+ successCallback?: EntryCallback,
+ errorCallback?: ErrorCallback,
+ ): void;
+
+ /**
+ * Copy an entry to a different location on the file system. It is an error to try to:
+ *
+ * <ul>
+ * <li> copy a directory inside itself or to any child at any depth;</li>
+ * <li> copy an entry into its parent if a name different from its current one isn't provided;</li>
+ * <li> copy a file to a path occupied by a directory;</li>
+ * <li> copy a directory to a path occupied by a file;</li>
+ * <li> copy any element to a path occupied by a directory which is not empty.</li>
+ * <li> A copy of a file on top of an existing file must attempt to delete and replace that file.</li>
+ * <li> A copy of a directory on top of an existing empty directory must attempt to delete and replace that directory.</li>
+ * </ul>
+ *
+ * Directory copies are always recursive--that is, they copy all contents of the directory.
+ */
+ copyTo(
+ parent: FileSystemDirectoryEntry,
+ newName?: string,
+ successCallback?: EntryCallback,
+ errorCallback?: ErrorCallback,
+ ): void;
+
+ /**
+ * Returns a URL that can be used to identify this entry. Unlike the URN defined in [FILE-API-ED], it has no specific expiration; as it describes a location on disk, it should be valid at least as long as that location exists.
+ */
+ toURL(): string;
+
+ /**
+ * Deletes a file or directory. It is an error to attempt to delete a directory that is not empty. It is an error to attempt to delete the root directory of a filesystem.
+ * @param successCallback A callback that is called on success.
+ * @param errorCallback A callback that is called when errors happen.
+ */
+ remove(successCallback: VoidCallback, errorCallback?: ErrorCallback): void;
+
+ /**
+ * Look up the parent DirectoryEntry containing this Entry. If this Entry is the root of its filesystem, its parent is itself.
+ * @param successCallback A callback that is called to return the parent Entry.
+ * @param errorCallback A callback that is called when errors happen.
+ */
+ getParent(successCallback: DirectoryEntryCallback, errorCallback?: ErrorCallback): void;
+}
+
+/** Alias provided for backward compatibility */
+type Entry = FileSystemEntry;
+
+/**
+ * This interface represents a directory on a file system.
+ */
+interface FileSystemDirectoryEntry extends FileSystemEntry {
+ /**
+ * Creates a new DirectoryReader to read Entries from this Directory.
+ */
+ createReader(): DirectoryReader;
+
+ /**
+ * Creates or looks up a file.
+ * @param path Either an absolute path or a relative path from this DirectoryEntry to the file to be looked up or created. It is an error to attempt to create a file whose immediate parent does not yet exist.
+ * @param options
+ * <ul>
+ * <li>If create and exclusive are both true, and the path already exists, getFile must fail.</li>
+ * <li>If create is true, the path doesn't exist, and no other error occurs, getFile must create it as a zero-length file and return a corresponding FileEntry.</li>
+ * <li>If create is not true and the path doesn't exist, getFile must fail.</li>
+ * <li>If create is not true and the path exists, but is a directory, getFile must fail.</li>
+ * <li>Otherwise, if no other error occurs, getFile must return a FileEntry corresponding to path.</li>
+ * </ul>
+ * @param successCallback A callback that is called to return the File selected or created.
+ * @param errorCallback A callback that is called when errors happen.
+ */
+ getFile(path: string, options?: Flags, successCallback?: FileEntryCallback, errorCallback?: ErrorCallback): void;
+
+ /**
+ * Creates or looks up a directory.
+ * @param path Either an absolute path or a relative path from this DirectoryEntry to the directory to be looked up or created. It is an error to attempt to create a directory whose immediate parent does not yet exist.
+ * @param options
+ * <ul>
+ * <li>If create and exclusive are both true and the path already exists, getDirectory must fail.</li>
+ * <li>If create is true, the path doesn't exist, and no other error occurs, getDirectory must create and return a corresponding DirectoryEntry.</li>
+ * <li>If create is not true and the path doesn't exist, getDirectory must fail.</li>
+ * <li>If create is not true and the path exists, but is a file, getDirectory must fail.</li>
+ * <li>Otherwise, if no other error occurs, getDirectory must return a DirectoryEntry corresponding to path.</li>
+ * </ul>
+ * @param successCallback A callback that is called to return the DirectoryEntry selected or created.
+ * @param errorCallback A callback that is called when errors happen.
+ */
+ getDirectory(
+ path: string,
+ options?: Flags,
+ successCallback?: DirectoryEntryCallback,
+ errorCallback?: ErrorCallback,
+ ): void;
+
+ /**
+ * Deletes a directory and all of its contents, if any. In the event of an error [e.g. trying to delete a directory that contains a file that cannot be removed], some of the contents of the directory may be deleted. It is an error to attempt to delete the root directory of a filesystem.
+ * @param successCallback A callback that is called on success.
+ * @param errorCallback A callback that is called when errors happen.
+ */
+ removeRecursively(successCallback: VoidCallback, errorCallback?: ErrorCallback): void;
+}
+
+/** Alias provided for backward compatibility */
+type DirectoryEntry = FileSystemDirectoryEntry;
+
+/**
+ * This interface lets a user list files and directories in a directory. If there are no additions to or deletions from a directory between the first and last call to readEntries, and no errors occur, then:
+ * <ul>
+ * <li> A series of calls to readEntries must return each entry in the directory exactly once.</li>
+ * <li> Once all entries have been returned, the next call to readEntries must produce an empty array.</li>
+ * <li> If not all entries have been returned, the array produced by readEntries must not be empty.</li>
+ * <li> The entries produced by readEntries must not include the directory itself ["."] or its parent [".."].</li>
+ * </ul>
+ */
+interface DirectoryReader {
+ /**
+ * Read the next block of entries from this directory.
+ * @param successCallback Called once per successful call to readEntries to deliver the next previously-unreported set of Entries in the associated Directory. If all Entries have already been returned from previous invocations of readEntries, successCallback must be called with a zero-length array as an argument.
+ * @param errorCallback A callback indicating that there was an error reading from the Directory.
+ */
+ readEntries(successCallback: EntriesCallback, errorCallback?: ErrorCallback): void;
+}
+
+/**
+ * This interface represents a file on a file system.
+ */
+interface FileEntry extends FileSystemEntry {
+ /**
+ * Creates a new FileWriter associated with the file that this FileEntry represents.
+ * @param successCallback A callback that is called with the new FileWriter.
+ * @param errorCallback A callback that is called when errors happen.
+ */
+ createWriter(successCallback: FileWriterCallback, errorCallback?: ErrorCallback): void;
+
+ /**
+ * Returns a File that represents the current state of the file that this FileEntry represents.
+ * @param successCallback A callback that is called with the File.
+ * @param errorCallback A callback that is called when errors happen.
+ */
+ file(successCallback: FileCallback, errorCallback?: ErrorCallback): void;
+}
+
+/**
+ * When requestFileSystem() succeeds, the following callback is made.
+ */
+interface FileSystemCallback {
+ /**
+ * @param filesystem The file systems to which the app is granted access.
+ */
+ (filesystem: FileSystem): void;
+}
+
+/**
+ * This interface is the callback used to look up Entry objects.
+ */
+interface EntryCallback {
+ /**
+ * @param entry
+ */
+ (entry: FileSystemEntry): void;
+}
+
+/**
+ * This interface is the callback used to look up FileEntry objects.
+ */
+interface FileEntryCallback {
+ /**
+ * @param entry
+ */
+ (entry: FileEntry): void;
+}
+
+/**
+ * This interface is the callback used to look up DirectoryEntry objects.
+ */
+interface DirectoryEntryCallback {
+ /**
+ * @param entry
+ */
+ (entry: FileSystemDirectoryEntry): void;
+}
+
+/**
+ * When readEntries() succeeds, the following callback is made.
+ */
+interface EntriesCallback {
+ (entries: FileSystemEntry[]): void;
+}
+
+/**
+ * This interface is the callback used to look up file and directory metadata.
+ */
+interface MetadataCallback {
+ (metadata: Metadata): void;
+}
+
+/**
+ * This interface is the callback used to create a FileWriter.
+ */
+interface FileWriterCallback {
+ (fileWriter: FileWriter): void;
+}
+
+/**
+ * This interface is the callback used to obtain a File.
+ */
+interface FileCallback {
+ (file: File): void;
+}
+
+/**
+ * This interface is the generic callback used to indicate success of an asynchronous method.
+ */
+interface VoidCallback {
+ (): void;
+}
+
+/**
+ * When an error occurs, the following callback is made.
+ */
+interface ErrorCallback {
+ (err: Error): void;
+}
+
+/**
+ * This interface represents a file system.
+ */
+interface FileSystemSync {
+ /**
+ * This is the name of the file system. The specifics of naming filesystems is unspecified, but a name must be unique across the list of exposed file systems.
+ */
+ name: string;
+
+ /**
+ * root The root directory of the file system.
+ */
+ root: DirectoryEntrySync;
+}
+
+/**
+ * An abstract interface representing entries in a file system, each of which may be a FileEntrySync or DirectoryEntrySync.
+ */
+interface EntrySync {
+ /**
+ * EntrySync is a file.
+ */
+ isFile: boolean;
+
+ /**
+ * EntrySync is a directory.
+ */
+ isDirectory: boolean;
+
+ /**
+ * Look up metadata about this entry.
+ */
+ getMetadata(): Metadata;
+
+ /**
+ * The name of the entry, excluding the path leading to it.
+ */
+ name: string;
+
+ /**
+ * The full absolute path from the root to the entry.
+ */
+ fullPath: string;
+
+ /**
+ * The file system on which the entry resides.
+ */
+ filesystem: FileSystemSync;
+
+ /**
+ * Move an entry to a different location on the file system. It is an error to try to:
+ * <ul>
+ * <li> move a directory inside itself or to any child at any depth;</li>
+ * <li> move an entry into its parent if a name different from its current one isn't provided;</li>
+ * <li> move a file to a path occupied by a directory;</li>
+ * <li> move a directory to a path occupied by a file;</li>
+ * <li> move any element to a path occupied by a directory which is not empty.</li>
+ * </ui>
+ * A move of a file on top of an existing file must attempt to delete and replace that file. A move of a directory on top of an existing empty directory must attempt to delete and replace that directory.
+ * @param parent The directory to which to move the entry.
+ * @param newName The new name of the entry. Defaults to the EntrySync's current name if unspecified.
+ */
+ moveTo(parent: DirectoryEntrySync, newName?: string): EntrySync;
+
+ /**
+ * Copy an entry to a different location on the file system. It is an error to try to:
+ * <ul>
+ * <li> copy a directory inside itself or to any child at any depth;</li>
+ * <li> copy an entry into its parent if a name different from its current one isn't provided;</li>
+ * <li> copy a file to a path occupied by a directory;</li>
+ * <li> copy a directory to a path occupied by a file;</li>
+ * <li> copy any element to a path occupied by a directory which is not empty.</li>
+ * </ui>
+ * A copy of a file on top of an existing file must attempt to delete and replace that file.
+ * A copy of a directory on top of an existing empty directory must attempt to delete and replace that directory.
+ * Directory copies are always recursive--that is, they copy all contents of the directory.
+ */
+ copyTo(parent: DirectoryEntrySync, newName?: string): EntrySync;
+
+ /**
+ * Returns a URL that can be used to identify this entry. Unlike the URN defined in [FILE-API-ED], it has no specific expiration; as it describes a location on disk, it should be valid at least as long as that location exists.
+ */
+ toURL(): string;
+
+ /**
+ * Deletes a file or directory. It is an error to attempt to delete a directory that is not empty. It is an error to attempt to delete the root directory of a filesystem.
+ */
+ remove(): void;
+
+ /**
+ * Look up the parent DirectoryEntrySync containing this Entry. If this EntrySync is the root of its filesystem, its parent is itself.
+ */
+ getParent(): DirectoryEntrySync;
+}
+
+/**
+ * This interface represents a directory on a file system.
+ */
+interface DirectoryEntrySync extends EntrySync {
+ /**
+ * Creates a new DirectoryReaderSync to read EntrySyncs from this DirectorySync.
+ */
+ createReader(): DirectoryReaderSync;
+
+ /**
+ * Creates or looks up a directory.
+ * @param path Either an absolute path or a relative path from this DirectoryEntrySync to the file to be looked up or created. It is an error to attempt to create a file whose immediate parent does not yet exist.
+ * @param options
+ * <ul>
+ * <li> If create and exclusive are both true and the path already exists, getFile must fail.</li>
+ * <li> If create is true, the path doesn't exist, and no other error occurs, getFile must create it as a zero-length file and return a corresponding FileEntry.</li>
+ * <li> If create is not true and the path doesn't exist, getFile must fail.</li>
+ * <li> If create is not true and the path exists, but is a directory, getFile must fail.</li>
+ * <li> Otherwise, if no other error occurs, getFile must return a FileEntrySync corresponding to path.</li>
+ * </ul>
+ */
+ getFile(path: string, options?: Flags): FileEntrySync;
+
+ /**
+ * Creates or looks up a directory.
+ * @param path Either an absolute path or a relative path from this DirectoryEntrySync to the directory to be looked up or created. It is an error to attempt to create a directory whose immediate parent does not yet exist.
+ * @param options
+ * <ul>
+ * <li> If create and exclusive are both true and the path already exists, getDirectory must fail.</li>
+ * <li> If create is true, the path doesn't exist, and no other error occurs, getDirectory must create and return a corresponding DirectoryEntry.</li>
+ * <li> If create is not true and the path doesn't exist, getDirectory must fail.</li>
+ * <li> If create is not true and the path exists, but is a file, getDirectory must fail.</li>
+ * <li> Otherwise, if no other error occurs, getDirectory must return a DirectoryEntrySync corresponding to path.</li>
+ * </ul>
+ */
+ getDirectory(path: string, options?: Flags): DirectoryEntrySync;
+
+ /**
+ * Deletes a directory and all of its contents, if any. In the event of an error [e.g. trying to delete a directory that contains a file that cannot be removed], some of the contents of the directory may be deleted. It is an error to attempt to delete the root directory of a filesystem.
+ */
+ removeRecursively(): void;
+}
+
+/**
+ * This interface lets a user list files and directories in a directory. If there are no additions to or deletions from a directory between the first and last call to readEntries, and no errors occur, then:
+ * <ul>
+ * <li> A series of calls to readEntries must return each entry in the directory exactly once.</li>
+ * <li> Once all entries have been returned, the next call to readEntries must produce an empty array.</li>
+ * <li> If not all entries have been returned, the array produced by readEntries must not be empty.</li>
+ * <li> The entries produced by readEntries must not include the directory itself ["."] or its parent [".."].</li>
+ * </ul>
+ */
+interface DirectoryReaderSync {
+ /**
+ * Read the next block of entries from this directory.
+ */
+ readEntries(): EntrySync[];
+}
+
+/**
+ * This interface represents a file on a file system.
+ */
+interface FileEntrySync extends EntrySync {
+ /**
+ * Creates a new FileWriterSync associated with the file that this FileEntrySync represents.
+ */
+ createWriter(): FileWriterSync;
+
+ /**
+ * Returns a File that represents the current state of the file that this FileEntrySync represents.
+ */
+ file(): File;
+}
+
+interface Window extends LocalFileSystem, LocalFileSystemSync {
+}
+
+interface WorkerGlobalScope extends LocalFileSystem, LocalFileSystemSync {
+}
diff --git a/client/node_modules/@types/filesystem/package.json b/client/node_modules/@types/filesystem/package.json
new file mode 100644
index 0000000..2fdb7f4
--- /dev/null
+++ b/client/node_modules/@types/filesystem/package.json
@@ -0,0 +1,26 @@
+{
+ "name": "@types/filesystem",
+ "version": "0.0.35",
+ "description": "TypeScript definitions for filesystem",
+ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/filesystem",
+ "license": "MIT",
+ "contributors": [
+ {
+ "name": "Kon",
+ "url": "http://phyzkit.net/"
+ }
+ ],
+ "main": "",
+ "types": "index.d.ts",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
+ "directory": "types/filesystem"
+ },
+ "scripts": {},
+ "dependencies": {
+ "@types/filewriter": "*"
+ },
+ "typesPublisherContentHash": "84b4ee28d506ce8c499d3e1476c49043570d628616c3748acded42a65e6119b5",
+ "typeScriptVersion": "4.5"
+} \ No newline at end of file
diff --git a/client/node_modules/@types/filewriter/LICENSE b/client/node_modules/@types/filewriter/LICENSE
new file mode 100644
index 0000000..9e841e7
--- /dev/null
+++ b/client/node_modules/@types/filewriter/LICENSE
@@ -0,0 +1,21 @@
+ MIT License
+
+ Copyright (c) Microsoft Corporation.
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE
diff --git a/client/node_modules/@types/filewriter/README.md b/client/node_modules/@types/filewriter/README.md
new file mode 100644
index 0000000..3befe79
--- /dev/null
+++ b/client/node_modules/@types/filewriter/README.md
@@ -0,0 +1,15 @@
+# Installation
+> `npm install --save @types/filewriter`
+
+# Summary
+This package contains type definitions for filewriter (http://www.w3.org/TR/file-writer-api/).
+
+# Details
+Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/filewriter.
+
+### Additional Details
+ * Last updated: Tue, 07 Nov 2023 03:09:37 GMT
+ * Dependencies: none
+
+# Credits
+These definitions were written by [Kon](http://phyzkit.net/).
diff --git a/client/node_modules/@types/filewriter/index.d.ts b/client/node_modules/@types/filewriter/index.d.ts
new file mode 100644
index 0000000..4c2ff13
--- /dev/null
+++ b/client/node_modules/@types/filewriter/index.d.ts
@@ -0,0 +1,166 @@
+/**
+ * This interface provides methods to monitor the asynchronous writing of blobs to disk using progress events [PROGRESS-EVENTS] and event handler attributes.
+ * This interface is specified to be used within the context of the global object (Window [HTML5]) and within Web Workers (WorkerUtils [WEBWORKERS-ED]).
+ */
+interface FileSaver extends EventTarget {
+ /**
+ * When the abort method is called, user agents must run the steps below:
+ * <ol>
+ * <li> If readyState == DONE or readyState == INIT, terminate this overall series of steps without doing anything else. </li>
+ * <li> Set readyState to DONE. </li>
+ * <li> If there are any tasks from the object's FileSaver task source in one of the task queues, then remove those tasks. </li>
+ * <li> Terminate the write algorithm being processed. </li>
+ * <li> Set the error attribute to a DOMError object of type "AbortError". </li>
+ * <li> Fire a progress event called abort </li>
+ * <li> Fire a progress event called writeend </li>
+ * <li> Terminate this algorithm. </li>
+ * </ol>
+ */
+ abort(): void;
+
+ /**
+ * The blob is being written.
+ */
+ INIT: number;
+
+ /**
+ * The object has been constructed, but there is no pending write.
+ */
+ WRITING: number;
+
+ /**
+ * The entire Blob has been written to the file, an error occurred during the write, or the write was aborted using abort(). The FileSaver is no longer writing the blob.
+ */
+ DONE: number;
+
+ /**
+ * The FileSaver object can be in one of 3 states. The readyState attribute, on getting, must return the current state, which must be one of the following values:
+ * <ul>
+ * <li>INIT</li>
+ * <li>WRITING</li>
+ * <li>DONE</li>
+ * <ul>
+ */
+ readyState: number;
+
+ /**
+ * The last error that occurred on the FileSaver.
+ */
+ error: Error;
+
+ /**
+ * Handler for writestart events
+ */
+ onwritestart: (event: ProgressEvent) => void;
+
+ /**
+ * Handler for progress events.
+ */
+ onprogress: (event: ProgressEvent) => void;
+
+ /**
+ * Handler for write events.
+ */
+ onwrite: (event: ProgressEvent) => void;
+
+ /**
+ * Handler for abort events.
+ */
+ onabort: (event: ProgressEvent) => void;
+
+ /**
+ * Handler for error events.
+ */
+ onerror: (event: ProgressEvent) => void;
+
+ /**
+ * Handler for writeend events.
+ */
+ onwriteend: (event: ProgressEvent) => void;
+}
+
+declare var FileSaver: {
+ /**
+ * When the FileSaver constructor is called, the user agent must return a new FileSaver object with readyState set to INIT.
+ * This constructor must be visible when the script's global object is either a Window object or an object implementing the WorkerUtils interface.
+ */
+ new(data: Blob): FileSaver;
+};
+
+/**
+ * This interface expands on the FileSaver interface to allow for multiple write actions, rather than just saving a single Blob.
+ */
+interface FileWriter extends FileSaver {
+ /**
+ * The byte offset at which the next write to the file will occur. This must be no greater than length.
+ * A newly-created FileWriter must have position set to 0.
+ */
+ position: number;
+
+ /**
+ * The length of the file. If the user does not have read access to the file, this must be the highest byte offset at which the user has written.
+ */
+ length: number;
+
+ /**
+ * Write the supplied data to the file at position.
+ * @param data The blob to write.
+ */
+ write(data: Blob): void;
+
+ /**
+ * Seek sets the file position at which the next write will occur.
+ * @param offset If nonnegative, an absolute byte offset into the file. If negative, an offset back from the end of the file.
+ */
+ seek(offset: number): void;
+
+ /**
+ * Changes the length of the file to that specified. If shortening the file, data beyond the new length must be discarded. If extending the file, the existing data must be zero-padded up to the new length.
+ * @param size The size to which the length of the file is to be adjusted, measured in bytes.
+ */
+ truncate(size: number): void;
+}
+
+/**
+ * This interface lets users write, truncate, and append to files using simple synchronous calls.
+ * This interface is specified to be used only within Web Workers (WorkerUtils [WEBWORKERS]).
+ */
+interface FileWriterSync {
+ /**
+ * The byte offset at which the next write to the file will occur. This must be no greater than length.
+ */
+ position: number;
+
+ /**
+ * The length of the file. If the user does not have read access to the file, this must be the highest byte offset at which the user has written.
+ */
+ length: number;
+
+ /**
+ * Write the supplied data to the file at position. Upon completion, position will increase by data.size.
+ * @param data The blob to write.
+ */
+ write(data: Blob): void;
+
+ /**
+ * Seek sets the file position at which the next write will occur.
+ * @param offset An absolute byte offset into the file. If offset is greater than length, length is used instead. If offset is less than zero, length is added to it, so that it is treated as an offset back from the end of the file. If it is still less than zero, zero is used.
+ */
+ seek(offset: number): void;
+
+ /**
+ * Changes the length of the file to that specified. If shortening the file, data beyond the new length must be discarded. If extending the file, the existing data must be zero-padded up to the new length.
+ * Upon successful completion:
+ * <ul>
+ * <li>length must be equal to size.</li>
+ * <li>position must be the lesser of
+ * <ul>
+ * <li>its pre-truncate value,</li>
+ * <li>size.</li>
+ * </ul>
+ * </li>
+ * </ul>
+ * @param size The size to which the length of the file is to be adjusted, measured in bytes.
+ */
+ truncate(size: number): void;
+}
diff --git a/client/node_modules/@types/filewriter/package.json b/client/node_modules/@types/filewriter/package.json
new file mode 100644
index 0000000..4f2d91c
--- /dev/null
+++ b/client/node_modules/@types/filewriter/package.json
@@ -0,0 +1,24 @@
+{
+ "name": "@types/filewriter",
+ "version": "0.0.32",
+ "description": "TypeScript definitions for filewriter",
+ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/filewriter",
+ "license": "MIT",
+ "contributors": [
+ {
+ "name": "Kon",
+ "url": "http://phyzkit.net/"
+ }
+ ],
+ "main": "",
+ "types": "index.d.ts",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
+ "directory": "types/filewriter"
+ },
+ "scripts": {},
+ "dependencies": {},
+ "typesPublisherContentHash": "525ad667a8bf8ce9c80f9b1b826479e78d9c693ef951c38fbb6cf11deef493f1",
+ "typeScriptVersion": "4.5"
+} \ No newline at end of file
diff --git a/client/node_modules/@types/firefox-webext-browser/LICENSE b/client/node_modules/@types/firefox-webext-browser/LICENSE
new file mode 100644
index 0000000..9e841e7
--- /dev/null
+++ b/client/node_modules/@types/firefox-webext-browser/LICENSE
@@ -0,0 +1,21 @@
+ MIT License
+
+ Copyright (c) Microsoft Corporation.
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE
diff --git a/client/node_modules/@types/firefox-webext-browser/README.md b/client/node_modules/@types/firefox-webext-browser/README.md
new file mode 100644
index 0000000..9b99f44
--- /dev/null
+++ b/client/node_modules/@types/firefox-webext-browser/README.md
@@ -0,0 +1,15 @@
+# Installation
+> `npm install --save @types/firefox-webext-browser`
+
+# Summary
+This package contains type definitions for firefox-webext-browser (https://developer.mozilla.org/en-US/Add-ons/WebExtensions).
+
+# Details
+Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/firefox-webext-browser.
+
+### Additional Details
+ * Last updated: Wed, 22 Nov 2023 00:24:48 GMT
+ * Dependencies: none
+
+# Credits
+These definitions were written by [Jasmin Bom](https://github.com/jsmnbom).
diff --git a/client/node_modules/@types/firefox-webext-browser/index.d.ts b/client/node_modules/@types/firefox-webext-browser/index.d.ts
new file mode 100644
index 0000000..2157c36
--- /dev/null
+++ b/client/node_modules/@types/firefox-webext-browser/index.d.ts
@@ -0,0 +1,9332 @@
+interface WebExtEvent<TCallback extends (...args: any[]) => any> {
+ addListener(cb: TCallback): void;
+ removeListener(cb: TCallback): void;
+ hasListener(cb: TCallback): boolean;
+}
+
+/** Not allowed in: Content scripts, Devtools pages */
+declare namespace browser._manifest {
+ /* _manifest types */
+ type PermissionPrivileged = _PermissionPrivileged;
+
+ interface ActionManifest {
+ default_title?: string | undefined;
+ default_icon?: IconPath | undefined;
+ /** Specifies icons to use for dark and light themes */
+ theme_icons?: ThemeIcons[] | undefined;
+ default_popup?: string | undefined;
+ browser_style?: boolean | undefined;
+ /** Defines the location the browserAction will appear by default. The default location is navbar. */
+ default_area?: _ActionManifestDefaultArea | undefined;
+ }
+
+ /** Represents a WebExtension manifest.json file */
+ interface WebExtensionManifest {
+ /** Needs at least manifest version 3. */
+ action?: ActionManifest | undefined;
+ /** Not supported on manifest versions above 2. */
+ browser_action?: ActionManifest | undefined;
+ /** Needs at least manifest version 3. */
+ declarative_net_request?: _WebExtensionManifestDeclarativeNetRequest | undefined;
+ experiment_apis?: { [key: string]: experiments.ExperimentAPI } | undefined;
+ /** A list of protocol handler definitions. */
+ protocol_handlers?: ProtocolHandler[] | undefined;
+ default_locale?: string | undefined;
+ l10n_resources?: string[] | undefined;
+ minimum_chrome_version?: string | undefined;
+ minimum_opera_version?: string | undefined;
+ icons?: _WebExtensionManifestIcons | undefined;
+ incognito?: _WebExtensionManifestIncognito | undefined;
+ background?:
+ | {
+ page: ExtensionURL;
+ /** Not supported on manifest versions above 2. */
+ persistent?: boolean | undefined;
+ }
+ | {
+ scripts: ExtensionURL[];
+ /** Not supported on manifest versions above 2. */
+ persistent?: boolean | undefined;
+ }
+ | {
+ service_worker: ExtensionURL;
+ }
+ | undefined;
+ options_ui?: _WebExtensionManifestOptionsUi | undefined;
+ content_scripts?: ContentScript[] | undefined;
+ content_security_policy?:
+ | string
+ | {
+ /** The Content Security Policy used for extension pages. */
+ extension_pages?: string | undefined;
+ }
+ | undefined;
+ permissions?: PermissionOrOrigin[] | Permission[] | undefined;
+ granted_host_permissions?: boolean | undefined;
+ /** Needs at least manifest version 3. */
+ host_permissions?: MatchPattern[] | undefined;
+ optional_permissions?: OptionalPermissionOrOrigin[] | undefined;
+ web_accessible_resources?:
+ | string[]
+ | Array<{
+ resources: string[];
+ matches?: MatchPattern[] | undefined;
+ extension_ids?: Array<ExtensionID | "*"> | undefined;
+ }>
+ | undefined;
+ hidden?: boolean | undefined;
+ page_action?: _WebExtensionManifestPageAction | undefined;
+ telemetry?: _WebExtensionManifestTelemetry | undefined;
+ theme_experiment?: ThemeExperiment | undefined;
+ /** Not supported on manifest versions above 2. */
+ user_scripts?: _WebExtensionManifestUserScripts | undefined;
+ chrome_settings_overrides?: _WebExtensionManifestChromeSettingsOverrides | undefined;
+ commands?: { [key: string]: _WebExtensionManifestCommands } | undefined;
+ devtools_page?: ExtensionURL | undefined;
+ omnibox?: _WebExtensionManifestOmnibox | undefined;
+ sidebar_action?: _WebExtensionManifestSidebarAction | undefined;
+ chrome_url_overrides?: _WebExtensionManifestChromeUrlOverrides | undefined;
+ manifest_version: number;
+ /**
+ * The applications property is deprecated, please use 'browser_specific_settings'
+ * Not supported on manifest versions above 2.
+ */
+ applications?: BrowserSpecificSettings | undefined;
+ browser_specific_settings?: BrowserSpecificSettings | undefined;
+ name: string;
+ short_name?: string | undefined;
+ description?: string | undefined;
+ author?: string | undefined;
+ version: string;
+ homepage_url?: string | undefined;
+ install_origins?: string[] | undefined;
+ developer?: _WebExtensionManifestDeveloper | undefined;
+ }
+
+ type OptionalPermission = OptionalPermissionNoPrompt | _OptionalPermission;
+
+ type PermissionNoPrompt = OptionalPermissionNoPrompt | PermissionPrivileged | _PermissionNoPrompt;
+
+ type OptionalPermissionNoPrompt = _OptionalPermissionNoPrompt;
+
+ type Permission = string | PermissionNoPrompt | OptionalPermission | "declarativeNetRequest";
+
+ /** Represents a protocol handler definition. */
+ interface ProtocolHandler {
+ /**
+ * A user-readable title string for the protocol handler. This will be displayed to the user in interface objects as needed.
+ */
+ name: string;
+ /**
+ * The protocol the site wishes to handle, specified as a string. For example, you can register to handle SMS text message links by registering to handle the "sms" scheme.
+ */
+ protocol: string | _ProtocolHandlerProtocol;
+ /**
+ * The URL of the handler, as a string. This string should include "%s" as a placeholder which will be replaced with the escaped URL of the document to be handled. This URL might be a true URL, or it could be a phone number, email address, or so forth.
+ */
+ uriTemplate: ExtensionURL | HttpURL;
+ }
+
+ /** Common properties for all manifest.json files */
+ interface ManifestBase {
+ manifest_version: number;
+ /**
+ * The applications property is deprecated, please use 'browser_specific_settings'
+ * Not supported on manifest versions above 2.
+ */
+ applications?: BrowserSpecificSettings | undefined;
+ browser_specific_settings?: BrowserSpecificSettings | undefined;
+ name: string;
+ short_name?: string | undefined;
+ description?: string | undefined;
+ author?: string | undefined;
+ version: string;
+ homepage_url?: string | undefined;
+ install_origins?: string[] | undefined;
+ developer?: _ManifestBaseDeveloper | undefined;
+ }
+
+ /** Represents a WebExtension language pack manifest.json file */
+ interface WebExtensionLangpackManifest {
+ langpack_id: string;
+ languages: _WebExtensionLangpackManifestLanguages;
+ sources?: _WebExtensionLangpackManifestSources | undefined;
+ manifest_version: number;
+ /**
+ * The applications property is deprecated, please use 'browser_specific_settings'
+ * Not supported on manifest versions above 2.
+ */
+ applications?: BrowserSpecificSettings | undefined;
+ browser_specific_settings?: BrowserSpecificSettings | undefined;
+ name: string;
+ short_name?: string | undefined;
+ description?: string | undefined;
+ author?: string | undefined;
+ version: string;
+ homepage_url?: string | undefined;
+ install_origins?: string[] | undefined;
+ developer?: _WebExtensionLangpackManifestDeveloper | undefined;
+ }
+
+ /** Represents a WebExtension dictionary manifest.json file */
+ interface WebExtensionDictionaryManifest {
+ dictionaries: _WebExtensionDictionaryManifestDictionaries;
+ manifest_version: number;
+ /**
+ * The applications property is deprecated, please use 'browser_specific_settings'
+ * Not supported on manifest versions above 2.
+ */
+ applications?: BrowserSpecificSettings | undefined;
+ browser_specific_settings?: BrowserSpecificSettings | undefined;
+ name: string;
+ short_name?: string | undefined;
+ description?: string | undefined;
+ author?: string | undefined;
+ version: string;
+ homepage_url?: string | undefined;
+ install_origins?: string[] | undefined;
+ developer?: _WebExtensionDictionaryManifestDeveloper | undefined;
+ }
+
+ /** Represents a WebExtension site permissions manifest.json file */
+ interface WebExtensionSitePermissionsManifest {
+ site_permissions: SitePermission[];
+ install_origins?: [string] | undefined;
+ manifest_version: number;
+ /**
+ * The applications property is deprecated, please use 'browser_specific_settings'
+ * Not supported on manifest versions above 2.
+ */
+ applications?: BrowserSpecificSettings | undefined;
+ browser_specific_settings?: BrowserSpecificSettings | undefined;
+ name: string;
+ short_name?: string | undefined;
+ description?: string | undefined;
+ author?: string | undefined;
+ version: string;
+ homepage_url?: string | undefined;
+ developer?: _WebExtensionSitePermissionsManifestDeveloper | undefined;
+ }
+
+ interface ThemeIcons {
+ /** A light icon to use for dark themes */
+ light: ExtensionURL;
+ /** The dark icon to use for light themes */
+ dark: ExtensionURL;
+ /** The size of the icons */
+ size: number;
+ }
+
+ type OptionalPermissionOrOrigin = OptionalPermission | MatchPattern;
+
+ type PermissionOrOrigin = Permission | MatchPattern;
+
+ type SitePermission = _SitePermission;
+
+ type HttpURL = string;
+
+ type ExtensionURL = string;
+
+ type ExtensionFileUrl = string;
+
+ type ImageDataOrExtensionURL = string;
+
+ type ExtensionID = string;
+
+ interface FirefoxSpecificProperties {
+ id?: ExtensionID | undefined;
+ update_url?: string | undefined;
+ strict_min_version?: string | undefined;
+ strict_max_version?: string | undefined;
+ }
+
+ interface BrowserSpecificSettings {
+ gecko?: FirefoxSpecificProperties | undefined;
+ }
+
+ type MatchPattern = MatchPatternRestricted | MatchPatternUnestricted | "<all_urls>";
+
+ /** Same as MatchPattern above, but excludes<all_urls></all_urls> */
+ type MatchPatternRestricted = string;
+
+ /**
+ * Mostly unrestricted match patterns for privileged add-ons. This should technically be rejected for unprivileged add-ons, but, reasons. The MatchPattern class will still refuse privileged schemes for those extensions.
+ */
+ type MatchPatternUnestricted = string;
+
+ /**
+ * Details of the script or CSS to inject. Either the code or the file property must be set, but both may not be set at the same time. Based on InjectDetails, but using underscore rather than camel case naming conventions.
+ */
+ interface ContentScript {
+ matches: MatchPattern[];
+ exclude_matches?: MatchPattern[] | undefined;
+ include_globs?: string[] | undefined;
+ exclude_globs?: string[] | undefined;
+ /** The list of CSS files to inject */
+ css?: ExtensionURL[] | undefined;
+ /** The list of JS files to inject */
+ js?: ExtensionURL[] | undefined;
+ /**
+ * If allFrames is `true`, implies that the JavaScript or CSS should be injected into all frames of current page. By default, it's `false` and is only injected into the top frame.
+ */
+ all_frames?: boolean | undefined;
+ /**
+ * If matchAboutBlank is true, then the code is also injected in about:blank and about:srcdoc frames if your extension has access to its parent document. Code cannot be inserted in top-level about:-frames. By default it is `false`.
+ */
+ match_about_blank?: boolean | undefined;
+ /** The soonest that the JavaScript or CSS will be injected into the tab. Defaults to "document_idle". */
+ run_at?: extensionTypes.RunAt | undefined;
+ }
+
+ type IconPath =
+ | {
+ [key: number]: ExtensionFileUrl;
+ }
+ | ExtensionFileUrl;
+
+ type IconImageData =
+ | {
+ [key: number]: ImageData;
+ }
+ | ImageData;
+
+ type ImageData = any;
+
+ /** @deprecated An unexpected property was found in the WebExtension manifest. */
+ type UnrecognizedProperty = any;
+
+ /** Represents a native manifest file */
+ type NativeManifest =
+ | {
+ name: string;
+ description: string;
+ path: string;
+ type: "pkcs11" | "stdio";
+ allowed_extensions: ExtensionID[];
+ }
+ | {
+ name: ExtensionID;
+ description: string;
+ data: { [key: string]: any };
+ type: "storage";
+ };
+
+ type ThemeColor = string | [number, number, number] | [number, number, number, number];
+
+ interface ThemeExperiment {
+ stylesheet?: ExtensionURL | undefined;
+ images?: { [key: string]: string } | undefined;
+ colors?: { [key: string]: string } | undefined;
+ properties?: { [key: string]: string } | undefined;
+ }
+
+ interface ThemeType {
+ images?: _ThemeTypeImages | undefined;
+ colors?: _ThemeTypeColors | undefined;
+ properties?: _ThemeType | undefined;
+ }
+
+ /** Contents of manifest.json for a static theme */
+ interface ThemeManifest {
+ theme: ThemeType;
+ dark_theme?: ThemeType | undefined;
+ default_locale?: string | undefined;
+ theme_experiment?: ThemeExperiment | undefined;
+ icons?: _ThemeManifestIcons | undefined;
+ }
+
+ type KeyName = string;
+
+ type _PermissionPrivileged =
+ | "activityLog"
+ | "mozillaAddons"
+ | "networkStatus"
+ | "telemetry"
+ | "normandyAddonStudy"
+ | "urlbar";
+
+ /** Defines the location the browserAction will appear by default. The default location is navbar. */
+ type _ActionManifestDefaultArea = "navbar" | "menupanel" | "tabstrip" | "personaltoolbar";
+
+ interface _WebExtensionManifestDeclarativeNetRequestRuleResources {
+ /**
+ * A non-empty string uniquely identifying the ruleset. IDs beginning with '_' are reserved for internal use.
+ */
+ id: string;
+ /** Whether the ruleset is enabled by default. */
+ enabled: boolean;
+ /** The path of the JSON ruleset relative to the extension directory. */
+ path: ExtensionURL;
+ }
+
+ /** Needs at least manifest version 3. */
+ interface _WebExtensionManifestDeclarativeNetRequest {
+ rule_resources: _WebExtensionManifestDeclarativeNetRequestRuleResources[];
+ }
+
+ interface _WebExtensionManifestIcons {
+ [key: number]: ExtensionFileUrl;
+ }
+
+ type _WebExtensionManifestIncognito = "not_allowed" | "spanning";
+
+ interface _WebExtensionManifestOptionsUi {
+ page: ExtensionURL;
+ browser_style?: boolean | undefined;
+ chrome_style?: boolean | undefined;
+ open_in_tab?: boolean | undefined;
+ }
+
+ interface _WebExtensionManifestPageAction {
+ default_title?: string | undefined;
+ default_icon?: IconPath | undefined;
+ default_popup?: string | undefined;
+ browser_style?: boolean | undefined;
+ show_matches?: MatchPattern[] | undefined;
+ hide_matches?: MatchPatternRestricted[] | undefined;
+ pinned?: boolean | undefined;
+ }
+
+ interface _WebExtensionManifestTelemetryPublicKeyKey {
+ crv?: string | undefined;
+ kty?: string | undefined;
+ x?: string | undefined;
+ y?: string | undefined;
+ }
+
+ interface _WebExtensionManifestTelemetryPublicKey {
+ id: string;
+ key: _WebExtensionManifestTelemetryPublicKeyKey;
+ }
+
+ interface _WebExtensionManifestTelemetry {
+ ping_type: string;
+ schemaNamespace: string;
+ public_key: _WebExtensionManifestTelemetryPublicKey;
+ study_name?: string | undefined;
+ pioneer_id?: boolean | undefined;
+ }
+
+ /** Not supported on manifest versions above 2. */
+ interface _WebExtensionManifestUserScripts {
+ api_script?: ExtensionURL | undefined;
+ }
+
+ /** The type of param can be either "purpose" or "pref". */
+ type _WebExtensionManifestChromeSettingsOverridesSearchProviderParamsCondition = "purpose" | "pref";
+
+ /** The context that initiates a search, required if condition is "purpose". */
+ type _WebExtensionManifestChromeSettingsOverridesSearchProviderParamsPurpose =
+ | "contextmenu"
+ | "searchbar"
+ | "homepage"
+ | "keyword"
+ | "newtab";
+
+ interface _WebExtensionManifestChromeSettingsOverridesSearchProviderParams {
+ /** A url parameter name */
+ name: string;
+ /** The type of param can be either "purpose" or "pref". */
+ condition?: _WebExtensionManifestChromeSettingsOverridesSearchProviderParamsCondition | undefined;
+ /** The preference to retrieve the value from. */
+ pref?: string | undefined;
+ /** The context that initiates a search, required if condition is "purpose". */
+ purpose?: _WebExtensionManifestChromeSettingsOverridesSearchProviderParamsPurpose | undefined;
+ /** A url parameter value. */
+ value?: string | undefined;
+ }
+
+ interface _WebExtensionManifestChromeSettingsOverridesSearchProvider {
+ name: string;
+ keyword?: string | string[] | undefined;
+ search_url: string;
+ favicon_url?: string | undefined;
+ suggest_url?: string | undefined;
+ /** @deprecated Unsupported on Firefox at this time. */
+ instant_url?: string | undefined;
+ /** @deprecated Unsupported on Firefox at this time. */
+ image_url?: string | undefined;
+ /** GET parameters to the search_url as a query string. */
+ search_url_get_params?: string | undefined;
+ /** POST parameters to the search_url as a query string. */
+ search_url_post_params?: string | undefined;
+ /** GET parameters to the suggest_url as a query string. */
+ suggest_url_get_params?: string | undefined;
+ /** POST parameters to the suggest_url as a query string. */
+ suggest_url_post_params?: string | undefined;
+ /** @deprecated Unsupported on Firefox at this time. */
+ instant_url_post_params?: string | undefined;
+ /** @deprecated Unsupported on Firefox at this time. */
+ image_url_post_params?: string | undefined;
+ search_form?: string | undefined;
+ /** @deprecated Unsupported on Firefox at this time. */
+ alternate_urls?: string[] | undefined;
+ /** @deprecated Unsupported on Firefox. */
+ prepopulated_id?: number | undefined;
+ /** Encoding of the search term. */
+ encoding?: string | undefined;
+ /** Sets the default engine to a built-in engine only. */
+ is_default?: boolean | undefined;
+ /**
+ * A list of optional search url parameters. This allows the additon of search url parameters based on how the search is performed in Firefox.
+ */
+ params?: _WebExtensionManifestChromeSettingsOverridesSearchProviderParams[] | undefined;
+ }
+
+ interface _WebExtensionManifestChromeSettingsOverrides {
+ homepage?: string | undefined;
+ search_provider?: _WebExtensionManifestChromeSettingsOverridesSearchProvider | undefined;
+ }
+
+ interface _WebExtensionManifestCommandsSuggestedKey {
+ default?: KeyName | undefined;
+ mac?: KeyName | undefined;
+ linux?: KeyName | undefined;
+ windows?: KeyName | undefined;
+ chromeos?: string | undefined;
+ android?: string | undefined;
+ ios?: string | undefined;
+ /** @deprecated Unknown platform name */
+ additionalProperties?: string | undefined;
+ }
+
+ interface _WebExtensionManifestCommands {
+ suggested_key?: _WebExtensionManifestCommandsSuggestedKey | undefined;
+ description?: string | undefined;
+ }
+
+ interface _WebExtensionManifestOmnibox {
+ keyword: string;
+ }
+
+ interface _WebExtensionManifestSidebarAction {
+ default_title?: string | undefined;
+ default_icon?: IconPath | undefined;
+ browser_style?: boolean | undefined;
+ default_panel: string;
+ /** Whether or not the sidebar is opened at install. Default is `true`. */
+ open_at_install?: boolean | undefined;
+ }
+
+ interface _WebExtensionManifestChromeUrlOverrides {
+ newtab?: ExtensionURL | undefined;
+ /** @deprecated Unsupported on Firefox at this time. */
+ bookmarks?: ExtensionURL | undefined;
+ /** @deprecated Unsupported on Firefox at this time. */
+ history?: ExtensionURL | undefined;
+ }
+
+ interface _WebExtensionManifestDeveloper {
+ name?: string | undefined;
+ url?: string | undefined;
+ }
+
+ type _OptionalPermission =
+ | "browserSettings"
+ | "browsingData"
+ | "downloads"
+ | "downloads.open"
+ | "management"
+ | "clipboardRead"
+ | "clipboardWrite"
+ | "geolocation"
+ | "notifications"
+ | "privacy"
+ | "proxy"
+ | "nativeMessaging"
+ | "webNavigation"
+ | "bookmarks"
+ | "devtools"
+ | "find"
+ | "history"
+ | "pkcs11"
+ | "sessions"
+ | "tabs"
+ | "tabHide"
+ | "topSites";
+
+ type _PermissionNoPrompt =
+ | "captivePortal"
+ | "contextualIdentities"
+ | "declarativeNetRequestFeedback"
+ | "declarativeNetRequestWithHostAccess"
+ | "dns"
+ | "geckoProfiler"
+ | "identity"
+ | "alarms"
+ | "storage"
+ | "unlimitedStorage"
+ | "theme"
+ | "menus"
+ | "contextMenus";
+
+ type _OptionalPermissionNoPrompt =
+ | "cookies"
+ | "idle"
+ | "scripting"
+ | "webRequest"
+ | "webRequestBlocking"
+ | "webRequestFilterResponse"
+ | "webRequestFilterResponse.serviceWorkerScript"
+ | "menus.overrideContext"
+ | "search"
+ | "activeTab";
+
+ type _ProtocolHandlerProtocol =
+ | "bitcoin"
+ | "dat"
+ | "dweb"
+ | "ftp"
+ | "geo"
+ | "gopher"
+ | "im"
+ | "ipfs"
+ | "ipns"
+ | "irc"
+ | "ircs"
+ | "magnet"
+ | "mailto"
+ | "matrix"
+ | "mms"
+ | "news"
+ | "nntp"
+ | "sip"
+ | "sms"
+ | "smsto"
+ | "ssb"
+ | "ssh"
+ | "tel"
+ | "urn"
+ | "webcal"
+ | "wtai"
+ | "xmpp";
+
+ interface _ManifestBaseDeveloper {
+ name?: string | undefined;
+ url?: string | undefined;
+ }
+
+ interface _UndefinedChromeResources {
+ [key: string]:
+ | ExtensionURL
+ | {
+ [key: string]: ExtensionURL;
+ };
+ }
+
+ interface _WebExtensionLangpackManifestLanguages {
+ [key: string]: {
+ chrome_resources: _UndefinedChromeResources;
+ version: string;
+ };
+ }
+
+ interface _WebExtensionLangpackManifestSources {
+ [key: string]: {
+ base_path: ExtensionURL;
+ paths?: string[] | undefined;
+ };
+ }
+
+ interface _WebExtensionLangpackManifestDeveloper {
+ name?: string | undefined;
+ url?: string | undefined;
+ }
+
+ interface _WebExtensionDictionaryManifestDictionaries {
+ [key: string]: string;
+ }
+
+ interface _WebExtensionDictionaryManifestDeveloper {
+ name?: string | undefined;
+ url?: string | undefined;
+ }
+
+ interface _WebExtensionSitePermissionsManifestDeveloper {
+ name?: string | undefined;
+ url?: string | undefined;
+ }
+
+ type _SitePermission = "midi" | "midi-sysex";
+
+ interface _ThemeTypeImages {
+ additional_backgrounds?: ImageDataOrExtensionURL[] | undefined;
+ /**
+ * @deprecated Unsupported images property, use 'theme.images.theme_frame', this alias is ignored in Firefox >= 70.
+ */
+ headerURL?: ImageDataOrExtensionURL | undefined;
+ theme_frame?: ImageDataOrExtensionURL | undefined;
+ }
+
+ interface _ThemeTypeColors {
+ tab_selected?: ThemeColor | undefined;
+ /**
+ * @deprecated Unsupported colors property, use 'theme.colors.frame', this alias is ignored in Firefox >= 70.
+ */
+ accentcolor?: ThemeColor | undefined;
+ frame?: ThemeColor | undefined;
+ frame_inactive?: ThemeColor | undefined;
+ /**
+ * @deprecated Unsupported color property, use 'theme.colors.tab_background_text', this alias is ignored in Firefox >= 70.
+ */
+ textcolor?: ThemeColor | undefined;
+ tab_background_text?: ThemeColor | undefined;
+ tab_background_separator?: ThemeColor | undefined;
+ tab_loading?: ThemeColor | undefined;
+ tab_text?: ThemeColor | undefined;
+ tab_line?: ThemeColor | undefined;
+ toolbar?: ThemeColor | undefined;
+ /** This color property is an alias of 'bookmark_text'. */
+ toolbar_text?: ThemeColor | undefined;
+ bookmark_text?: ThemeColor | undefined;
+ toolbar_field?: ThemeColor | undefined;
+ toolbar_field_text?: ThemeColor | undefined;
+ toolbar_field_border?: ThemeColor | undefined;
+ /** @deprecated This color property is ignored in Firefox >= 89. */
+ toolbar_field_separator?: ThemeColor | undefined;
+ toolbar_top_separator?: ThemeColor | undefined;
+ toolbar_bottom_separator?: ThemeColor | undefined;
+ toolbar_vertical_separator?: ThemeColor | undefined;
+ icons?: ThemeColor | undefined;
+ icons_attention?: ThemeColor | undefined;
+ button_background_hover?: ThemeColor | undefined;
+ button_background_active?: ThemeColor | undefined;
+ popup?: ThemeColor | undefined;
+ popup_text?: ThemeColor | undefined;
+ popup_border?: ThemeColor | undefined;
+ toolbar_field_focus?: ThemeColor | undefined;
+ toolbar_field_text_focus?: ThemeColor | undefined;
+ toolbar_field_border_focus?: ThemeColor | undefined;
+ popup_highlight?: ThemeColor | undefined;
+ popup_highlight_text?: ThemeColor | undefined;
+ ntp_background?: ThemeColor | undefined;
+ ntp_card_background?: ThemeColor | undefined;
+ ntp_text?: ThemeColor | undefined;
+ sidebar?: ThemeColor | undefined;
+ sidebar_border?: ThemeColor | undefined;
+ sidebar_text?: ThemeColor | undefined;
+ sidebar_highlight?: ThemeColor | undefined;
+ sidebar_highlight_text?: ThemeColor | undefined;
+ toolbar_field_highlight?: ThemeColor | undefined;
+ toolbar_field_highlight_text?: ThemeColor | undefined;
+ }
+
+ type _ThemeTypeAdditionalBackgroundsAlignment =
+ | "bottom"
+ | "center"
+ | "left"
+ | "right"
+ | "top"
+ | "center bottom"
+ | "center center"
+ | "center top"
+ | "left bottom"
+ | "left center"
+ | "left top"
+ | "right bottom"
+ | "right center"
+ | "right top";
+
+ type _ThemeTypeAdditionalBackgroundsTiling = "no-repeat" | "repeat" | "repeat-x" | "repeat-y";
+
+ type _ThemeTypeColorScheme = "auto" | "light" | "dark" | "system";
+
+ type _ThemeTypeContentColorScheme = "auto" | "light" | "dark" | "system";
+
+ interface _ThemeType {
+ additional_backgrounds_alignment?: _ThemeTypeAdditionalBackgroundsAlignment[] | undefined;
+ additional_backgrounds_tiling?: _ThemeTypeAdditionalBackgroundsTiling[] | undefined;
+ color_scheme?: _ThemeTypeColorScheme | undefined;
+ content_color_scheme?: _ThemeTypeContentColorScheme | undefined;
+ }
+
+ interface _ThemeManifestIcons {
+ [key: number]: string;
+ }
+}
+
+/**
+ * Monitor extension activity
+ *
+ * Permissions: `activityLog`
+ *
+ * Not allowed in: Content scripts, Devtools pages
+ */
+declare namespace browser.activityLog {
+ /**
+ * The type of log entry. api_call is a function call made by the extension and api_event is an event callback to the extension. content_script is logged when a content script is injected.
+ */
+ type _OnExtensionActivityDetailsType = "api_call" | "api_event" | "content_script" | "user_script";
+
+ /** The type of view where the activity occurred. Content scripts will not have a viewType. */
+ type _OnExtensionActivityDetailsViewType =
+ | "background"
+ | "popup"
+ | "sidebar"
+ | "tab"
+ | "devtools_page"
+ | "devtools_panel";
+
+ interface _OnExtensionActivityDetailsData {
+ /** A list of arguments passed to the call. */
+ args?: any[] | undefined;
+ /** The result of the call. */
+ result?: object | undefined;
+ /** The tab associated with this event if it is a tab or content script. */
+ tabId?: number | undefined;
+ /** If the type is content_script, this is the url of the script that was injected. */
+ url?: string | undefined;
+ }
+
+ interface _OnExtensionActivityDetails {
+ /** The date string when this call is triggered. */
+ timeStamp: extensionTypes.Date;
+ /**
+ * The type of log entry. api_call is a function call made by the extension and api_event is an event callback to the extension. content_script is logged when a content script is injected.
+ */
+ type: _OnExtensionActivityDetailsType;
+ /** The type of view where the activity occurred. Content scripts will not have a viewType. */
+ viewType?: _OnExtensionActivityDetailsViewType | undefined;
+ /** The name of the api call or event, or the script url if this is a content or user script event. */
+ name: string;
+ data: _OnExtensionActivityDetailsData;
+ }
+
+ interface _ActivityLogOnExtensionActivityEvent<TCallback = (details: _OnExtensionActivityDetails) => void> {
+ addListener(cb: TCallback, id: string): void;
+ removeListener(cb: TCallback): void;
+ hasListener(cb: TCallback): boolean;
+ }
+
+ /* activityLog events */
+ /** Receives an activityItem for each logging event. */
+ const onExtensionActivity: _ActivityLogOnExtensionActivityEvent;
+}
+
+/**
+ * Permissions: `alarms`
+ *
+ * Not allowed in: Content scripts, Devtools pages
+ */
+declare namespace browser.alarms {
+ /* alarms types */
+ interface Alarm {
+ /** Name of this alarm. */
+ name: string;
+ /** Time when the alarm is scheduled to fire, in milliseconds past the epoch. */
+ scheduledTime: number;
+ /** When present, signals that the alarm triggers periodically after so many minutes. */
+ periodInMinutes?: number | undefined;
+ }
+
+ /**
+ * Details about the alarm. The alarm first fires either at 'when' milliseconds past the epoch (if 'when' is provided), after 'delayInMinutes' minutes from the current time (if 'delayInMinutes' is provided instead), or after 'periodInMinutes' minutes from the current time (if only 'periodInMinutes' is provided). Users should never provide both 'when' and 'delayInMinutes'. If 'periodInMinutes' is provided, then the alarm recurs repeatedly after that many minutes.
+ */
+ interface _CreateAlarmInfo {
+ /** Time when the alarm is scheduled to first fire, in milliseconds past the epoch. */
+ when?: number | undefined;
+ /** Number of minutes from the current time after which the alarm should first fire. */
+ delayInMinutes?: number | undefined;
+ /** Number of minutes after which the alarm should recur repeatedly. */
+ periodInMinutes?: number | undefined;
+ }
+
+ /* alarms functions */
+ /**
+ * Creates an alarm. After the delay is expired, the onAlarm event is fired. If there is another alarm with the same name (or no name if none is specified), it will be cancelled and replaced by this alarm.
+ * @param alarmInfo Details about the alarm. The alarm first fires either at 'when' milliseconds past the epoch (if 'when' is provided), after 'delayInMinutes' minutes from the current time (if 'delayInMinutes' is provided instead), or after 'periodInMinutes' minutes from the current time (if only 'periodInMinutes' is provided). Users should never provide both 'when' and 'delayInMinutes'. If 'periodInMinutes' is provided, then the alarm recurs repeatedly after that many minutes.
+ */
+ function create(alarmInfo: _CreateAlarmInfo): void;
+ /**
+ * Creates an alarm. After the delay is expired, the onAlarm event is fired. If there is another alarm with the same name (or no name if none is specified), it will be cancelled and replaced by this alarm.
+ * @param name Optional name to identify this alarm. Defaults to the empty string.
+ * @param alarmInfo Details about the alarm. The alarm first fires either at 'when' milliseconds past the epoch (if 'when' is provided), after 'delayInMinutes' minutes from the current time (if 'delayInMinutes' is provided instead), or after 'periodInMinutes' minutes from the current time (if only 'periodInMinutes' is provided). Users should never provide both 'when' and 'delayInMinutes'. If 'periodInMinutes' is provided, then the alarm recurs repeatedly after that many minutes.
+ */
+ function create(name: string, alarmInfo: _CreateAlarmInfo): void;
+
+ /**
+ * Retrieves details about the specified alarm.
+ * @param [name] The name of the alarm to get. Defaults to the empty string.
+ */
+ function get(name?: string): Promise<Alarm | undefined>;
+
+ /** Gets an array of all the alarms. */
+ function getAll(): Promise<Alarm[]>;
+
+ /**
+ * Clears the alarm with the given name.
+ * @param [name] The name of the alarm to clear. Defaults to the empty string.
+ */
+ function clear(name?: string): Promise<boolean>;
+
+ /** Clears all alarms. */
+ function clearAll(): Promise<boolean>;
+
+ /* alarms events */
+ /**
+ * Fired when an alarm has expired. Useful for transient background pages.
+ * @param name The alarm that has expired.
+ */
+ const onAlarm: WebExtEvent<(name: Alarm) => void>;
+}
+
+/**
+ * Use browser actions to put icons in the main browser toolbar, to the right of the address bar. In addition to its icon, a browser action can also have a tooltip, a badge, and a popup.
+ *
+ * Manifest keys: `action`, `browser_action`
+ *
+ * Needs at least manifest version 3.
+ *
+ * Not allowed in: Content scripts, Devtools pages
+ */
+declare namespace browser.action {
+ /* action types */
+ /**
+ * Specifies to which tab or window the value should be set, or from which one it should be retrieved. If no tab nor window is specified, the global value is set or retrieved.
+ */
+ interface Details {
+ /**
+ * When setting a value, it will be specific to the specified tab, and will automatically reset when the tab navigates. When getting, specifies the tab to get the value from; if there is no tab-specific value, the window one will be inherited.
+ */
+ tabId?: number | undefined;
+ /**
+ * When setting a value, it will be specific to the specified window. When getting, specifies the window to get the value from; if there is no window-specific value, the global one will be inherited.
+ */
+ windowId?: number | undefined;
+ }
+
+ type ColorArray = [number, number, number, number];
+
+ /** Pixel data for an image. Must be an ImageData object (for example, from a `canvas` element). */
+ type ImageDataType = ImageData;
+
+ /**
+ * An array of four integers in the range [0,255] that make up the RGBA color of the badge. For example, opaque red is `[255, 0, 0, 255]`. Can also be a string with a CSS value, with opaque red being `#FF0000` or `#F00`.
+ */
+ type ColorValue = string | ColorArray | null;
+
+ /** Information sent when a browser action is clicked. */
+ interface OnClickData {
+ /** An array of keyboard modifiers that were held while the menu item was clicked. */
+ modifiers: _OnClickDataModifiers[];
+ /** An integer value of button by which menu item was clicked. */
+ button?: number | undefined;
+ }
+
+ type _OnClickDataModifiers = "Shift" | "Alt" | "Command" | "Ctrl" | "MacCtrl";
+
+ /**
+ * Specifies to which tab or window the value should be set, or from which one it should be retrieved. If no tab nor window is specified, the global value is set or retrieved.
+ */
+ interface _SetTitleDetails {
+ /** The string the browser action should display when moused over. */
+ title: string | null;
+ /**
+ * When setting a value, it will be specific to the specified tab, and will automatically reset when the tab navigates. When getting, specifies the tab to get the value from; if there is no tab-specific value, the window one will be inherited.
+ */
+ tabId?: number | undefined;
+ /**
+ * When setting a value, it will be specific to the specified window. When getting, specifies the window to get the value from; if there is no window-specific value, the global one will be inherited.
+ */
+ windowId?: number | undefined;
+ }
+
+ /**
+ * Specifies to which tab or window the value should be set, or from which one it should be retrieved. If no tab nor window is specified, the global value is set or retrieved.
+ */
+ interface _SetIconDetails {
+ /**
+ * Either an ImageData object or a dictionary {size -> ImageData} representing icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals `scale`, then image with size `scale` * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.imageData = foo' is equivalent to 'details.imageData = {'19': foo}'
+ */
+ imageData?:
+ | ImageDataType
+ | {
+ [key: number]: ImageDataType;
+ }
+ | undefined;
+ /**
+ * Either a relative image path or a dictionary {size -> relative image path} pointing to icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals `scale`, then image with size `scale` * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.path = foo' is equivalent to 'details.imageData = {'19': foo}'
+ */
+ path?:
+ | string
+ | {
+ [key: number]: string;
+ }
+ | undefined;
+ /**
+ * When setting a value, it will be specific to the specified tab, and will automatically reset when the tab navigates. When getting, specifies the tab to get the value from; if there is no tab-specific value, the window one will be inherited.
+ */
+ tabId?: number | undefined;
+ /**
+ * When setting a value, it will be specific to the specified window. When getting, specifies the window to get the value from; if there is no window-specific value, the global one will be inherited.
+ */
+ windowId?: number | undefined;
+ }
+
+ /**
+ * Specifies to which tab or window the value should be set, or from which one it should be retrieved. If no tab nor window is specified, the global value is set or retrieved.
+ */
+ interface _SetPopupDetails {
+ /** The html file to show in a popup. If set to the empty string (''), no popup is shown. */
+ popup: string | null;
+ /**
+ * When setting a value, it will be specific to the specified tab, and will automatically reset when the tab navigates. When getting, specifies the tab to get the value from; if there is no tab-specific value, the window one will be inherited.
+ */
+ tabId?: number | undefined;
+ /**
+ * When setting a value, it will be specific to the specified window. When getting, specifies the window to get the value from; if there is no window-specific value, the global one will be inherited.
+ */
+ windowId?: number | undefined;
+ }
+
+ /**
+ * Specifies to which tab or window the value should be set, or from which one it should be retrieved. If no tab nor window is specified, the global value is set or retrieved.
+ */
+ interface _SetBadgeTextDetails {
+ /** Any number of characters can be passed, but only about four can fit in the space. */
+ text: string | null;
+ /**
+ * When setting a value, it will be specific to the specified tab, and will automatically reset when the tab navigates. When getting, specifies the tab to get the value from; if there is no tab-specific value, the window one will be inherited.
+ */
+ tabId?: number | undefined;
+ /**
+ * When setting a value, it will be specific to the specified window. When getting, specifies the window to get the value from; if there is no window-specific value, the global one will be inherited.
+ */
+ windowId?: number | undefined;
+ }
+
+ /**
+ * Specifies to which tab or window the value should be set, or from which one it should be retrieved. If no tab nor window is specified, the global value is set or retrieved.
+ */
+ interface _SetBadgeBackgroundColorDetails {
+ color: ColorValue;
+ /**
+ * When setting a value, it will be specific to the specified tab, and will automatically reset when the tab navigates. When getting, specifies the tab to get the value from; if there is no tab-specific value, the window one will be inherited.
+ */
+ tabId?: number | undefined;
+ /**
+ * When setting a value, it will be specific to the specified window. When getting, specifies the window to get the value from; if there is no window-specific value, the global one will be inherited.
+ */
+ windowId?: number | undefined;
+ }
+
+ /**
+ * Specifies to which tab or window the value should be set, or from which one it should be retrieved. If no tab nor window is specified, the global value is set or retrieved.
+ */
+ interface _SetBadgeTextColorDetails {
+ color: ColorValue;
+ /**
+ * When setting a value, it will be specific to the specified tab, and will automatically reset when the tab navigates. When getting, specifies the tab to get the value from; if there is no tab-specific value, the window one will be inherited.
+ */
+ tabId?: number | undefined;
+ /**
+ * When setting a value, it will be specific to the specified window. When getting, specifies the window to get the value from; if there is no window-specific value, the global one will be inherited.
+ */
+ windowId?: number | undefined;
+ }
+
+ /** An object with information about the popup to open. */
+ interface _OpenPopupOptions {
+ /** Defaults to the current window. */
+ windowId?: number | undefined;
+ }
+
+ /* action functions */
+ /**
+ * Sets the title of the browser action. This shows up in the tooltip.
+ * @param details Specifies to which tab or window the value should be set, or from which one it should be retrieved. If no tab nor window is specified, the global value is set or retrieved.
+ */
+ function setTitle(details: _SetTitleDetails): Promise<void>;
+
+ /** Gets the title of the browser action. */
+ function getTitle(details: Details): Promise<string>;
+
+ /**
+ * Sets the icon for the browser action. The icon can be specified either as the path to an image file or as the pixel data from a canvas element, or as dictionary of either one of those. Either the **path** or the **imageData** property must be specified.
+ * @param details Specifies to which tab or window the value should be set, or from which one it should be retrieved. If no tab nor window is specified, the global value is set or retrieved.
+ */
+ function setIcon(details: _SetIconDetails): Promise<void>;
+
+ /**
+ * Sets the html document to be opened as a popup when the user clicks on the browser action's icon.
+ * @param details Specifies to which tab or window the value should be set, or from which one it should be retrieved. If no tab nor window is specified, the global value is set or retrieved.
+ */
+ function setPopup(details: _SetPopupDetails): Promise<void>;
+
+ /** Gets the html document set as the popup for this browser action. */
+ function getPopup(details: Details): Promise<string>;
+
+ /**
+ * Sets the badge text for the browser action. The badge is displayed on top of the icon.
+ * @param details Specifies to which tab or window the value should be set, or from which one it should be retrieved. If no tab nor window is specified, the global value is set or retrieved.
+ */
+ function setBadgeText(details: _SetBadgeTextDetails): Promise<void>;
+
+ /**
+ * Gets the badge text of the browser action. If no tab nor window is specified is specified, the global badge text is returned.
+ */
+ function getBadgeText(details: Details): Promise<string>;
+
+ /**
+ * Sets the background color for the badge.
+ * @param details Specifies to which tab or window the value should be set, or from which one it should be retrieved. If no tab nor window is specified, the global value is set or retrieved.
+ */
+ function setBadgeBackgroundColor(details: _SetBadgeBackgroundColorDetails): Promise<void>;
+
+ /** Gets the background color of the browser action badge. */
+ function getBadgeBackgroundColor(details: Details): Promise<ColorArray>;
+
+ /**
+ * Sets the text color for the badge.
+ * @param details Specifies to which tab or window the value should be set, or from which one it should be retrieved. If no tab nor window is specified, the global value is set or retrieved.
+ */
+ function setBadgeTextColor(details: _SetBadgeTextColorDetails): Promise<any>;
+
+ /** Gets the text color of the browser action badge. */
+ function getBadgeTextColor(details: Details): Promise<any>;
+
+ /**
+ * Enables the browser action for a tab. By default, browser actions are enabled.
+ * @param [tabId] The id of the tab for which you want to modify the browser action.
+ */
+ function enable(tabId?: number): Promise<void>;
+
+ /**
+ * Disables the browser action for a tab.
+ * @param [tabId] The id of the tab for which you want to modify the browser action.
+ */
+ function disable(tabId?: number): Promise<void>;
+
+ /** Checks whether the browser action is enabled. */
+ function isEnabled(details: Details): Promise<any>;
+
+ /**
+ * Opens the extension popup window in the specified window.
+ * @param [options] An object with information about the popup to open.
+ */
+ function openPopup(options?: _OpenPopupOptions): Promise<boolean>;
+
+ /* action events */
+ /**
+ * Fired when a browser action icon is clicked. This event will not fire if the browser action has a popup.
+ */
+ const onClicked: WebExtEvent<(tab: tabs.Tab, info?: OnClickData) => void>;
+}
+
+/**
+ * Manifest keys: `action`, `browser_action`
+ *
+ * Not supported on manifest versions above 2.
+ *
+ * Not allowed in: Content scripts, Devtools pages
+ */
+declare namespace browser.browserAction {
+ /* browserAction types */
+ /**
+ * Specifies to which tab or window the value should be set, or from which one it should be retrieved. If no tab nor window is specified, the global value is set or retrieved.
+ */
+ interface Details {
+ /**
+ * When setting a value, it will be specific to the specified tab, and will automatically reset when the tab navigates. When getting, specifies the tab to get the value from; if there is no tab-specific value, the window one will be inherited.
+ */
+ tabId?: number | undefined;
+ /**
+ * When setting a value, it will be specific to the specified window. When getting, specifies the window to get the value from; if there is no window-specific value, the global one will be inherited.
+ */
+ windowId?: number | undefined;
+ }
+
+ type ColorArray = [number, number, number, number];
+
+ /** Pixel data for an image. Must be an ImageData object (for example, from a `canvas` element). */
+ type ImageDataType = ImageData;
+
+ /**
+ * An array of four integers in the range [0,255] that make up the RGBA color of the badge. For example, opaque red is `[255, 0, 0, 255]`. Can also be a string with a CSS value, with opaque red being `#FF0000` or `#F00`.
+ */
+ type ColorValue = string | ColorArray | null;
+
+ /** Information sent when a browser action is clicked. */
+ interface OnClickData {
+ /** An array of keyboard modifiers that were held while the menu item was clicked. */
+ modifiers: _OnClickDataModifiers[];
+ /** An integer value of button by which menu item was clicked. */
+ button?: number | undefined;
+ }
+
+ type _OnClickDataModifiers = "Shift" | "Alt" | "Command" | "Ctrl" | "MacCtrl";
+
+ /**
+ * Specifies to which tab or window the value should be set, or from which one it should be retrieved. If no tab nor window is specified, the global value is set or retrieved.
+ */
+ interface _SetTitleDetails {
+ /** The string the browser action should display when moused over. */
+ title: string | null;
+ /**
+ * When setting a value, it will be specific to the specified tab, and will automatically reset when the tab navigates. When getting, specifies the tab to get the value from; if there is no tab-specific value, the window one will be inherited.
+ */
+ tabId?: number | undefined;
+ /**
+ * When setting a value, it will be specific to the specified window. When getting, specifies the window to get the value from; if there is no window-specific value, the global one will be inherited.
+ */
+ windowId?: number | undefined;
+ }
+
+ /**
+ * Specifies to which tab or window the value should be set, or from which one it should be retrieved. If no tab nor window is specified, the global value is set or retrieved.
+ */
+ interface _SetIconDetails {
+ /**
+ * Either an ImageData object or a dictionary {size -> ImageData} representing icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals `scale`, then image with size `scale` * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.imageData = foo' is equivalent to 'details.imageData = {'19': foo}'
+ */
+ imageData?:
+ | ImageDataType
+ | {
+ [key: number]: ImageDataType;
+ }
+ | undefined;
+ /**
+ * Either a relative image path or a dictionary {size -> relative image path} pointing to icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals `scale`, then image with size `scale` * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.path = foo' is equivalent to 'details.imageData = {'19': foo}'
+ */
+ path?:
+ | string
+ | {
+ [key: number]: string;
+ }
+ | undefined;
+ /**
+ * When setting a value, it will be specific to the specified tab, and will automatically reset when the tab navigates. When getting, specifies the tab to get the value from; if there is no tab-specific value, the window one will be inherited.
+ */
+ tabId?: number | undefined;
+ /**
+ * When setting a value, it will be specific to the specified window. When getting, specifies the window to get the value from; if there is no window-specific value, the global one will be inherited.
+ */
+ windowId?: number | undefined;
+ }
+
+ /**
+ * Specifies to which tab or window the value should be set, or from which one it should be retrieved. If no tab nor window is specified, the global value is set or retrieved.
+ */
+ interface _SetPopupDetails {
+ /** The html file to show in a popup. If set to the empty string (''), no popup is shown. */
+ popup: string | null;
+ /**
+ * When setting a value, it will be specific to the specified tab, and will automatically reset when the tab navigates. When getting, specifies the tab to get the value from; if there is no tab-specific value, the window one will be inherited.
+ */
+ tabId?: number | undefined;
+ /**
+ * When setting a value, it will be specific to the specified window. When getting, specifies the window to get the value from; if there is no window-specific value, the global one will be inherited.
+ */
+ windowId?: number | undefined;
+ }
+
+ /**
+ * Specifies to which tab or window the value should be set, or from which one it should be retrieved. If no tab nor window is specified, the global value is set or retrieved.
+ */
+ interface _SetBadgeTextDetails {
+ /** Any number of characters can be passed, but only about four can fit in the space. */
+ text: string | null;
+ /**
+ * When setting a value, it will be specific to the specified tab, and will automatically reset when the tab navigates. When getting, specifies the tab to get the value from; if there is no tab-specific value, the window one will be inherited.
+ */
+ tabId?: number | undefined;
+ /**
+ * When setting a value, it will be specific to the specified window. When getting, specifies the window to get the value from; if there is no window-specific value, the global one will be inherited.
+ */
+ windowId?: number | undefined;
+ }
+
+ /**
+ * Specifies to which tab or window the value should be set, or from which one it should be retrieved. If no tab nor window is specified, the global value is set or retrieved.
+ */
+ interface _SetBadgeBackgroundColorDetails {
+ color: ColorValue;
+ /**
+ * When setting a value, it will be specific to the specified tab, and will automatically reset when the tab navigates. When getting, specifies the tab to get the value from; if there is no tab-specific value, the window one will be inherited.
+ */
+ tabId?: number | undefined;
+ /**
+ * When setting a value, it will be specific to the specified window. When getting, specifies the window to get the value from; if there is no window-specific value, the global one will be inherited.
+ */
+ windowId?: number | undefined;
+ }
+
+ /**
+ * Specifies to which tab or window the value should be set, or from which one it should be retrieved. If no tab nor window is specified, the global value is set or retrieved.
+ */
+ interface _SetBadgeTextColorDetails {
+ color: ColorValue;
+ /**
+ * When setting a value, it will be specific to the specified tab, and will automatically reset when the tab navigates. When getting, specifies the tab to get the value from; if there is no tab-specific value, the window one will be inherited.
+ */
+ tabId?: number | undefined;
+ /**
+ * When setting a value, it will be specific to the specified window. When getting, specifies the window to get the value from; if there is no window-specific value, the global one will be inherited.
+ */
+ windowId?: number | undefined;
+ }
+
+ /** An object with information about the popup to open. */
+ interface _OpenPopupOptions {
+ /** Defaults to the current window. */
+ windowId?: number | undefined;
+ }
+
+ /* browserAction functions */
+ /**
+ * Sets the title of the browser action. This shows up in the tooltip.
+ * @param details Specifies to which tab or window the value should be set, or from which one it should be retrieved. If no tab nor window is specified, the global value is set or retrieved.
+ */
+ function setTitle(details: _SetTitleDetails): Promise<void>;
+
+ /** Gets the title of the browser action. */
+ function getTitle(details: Details): Promise<string>;
+
+ /**
+ * Sets the icon for the browser action. The icon can be specified either as the path to an image file or as the pixel data from a canvas element, or as dictionary of either one of those. Either the **path** or the **imageData** property must be specified.
+ * @param details Specifies to which tab or window the value should be set, or from which one it should be retrieved. If no tab nor window is specified, the global value is set or retrieved.
+ */
+ function setIcon(details: _SetIconDetails): Promise<void>;
+
+ /**
+ * Sets the html document to be opened as a popup when the user clicks on the browser action's icon.
+ * @param details Specifies to which tab or window the value should be set, or from which one it should be retrieved. If no tab nor window is specified, the global value is set or retrieved.
+ */
+ function setPopup(details: _SetPopupDetails): Promise<void>;
+
+ /** Gets the html document set as the popup for this browser action. */
+ function getPopup(details: Details): Promise<string>;
+
+ /**
+ * Sets the badge text for the browser action. The badge is displayed on top of the icon.
+ * @param details Specifies to which tab or window the value should be set, or from which one it should be retrieved. If no tab nor window is specified, the global value is set or retrieved.
+ */
+ function setBadgeText(details: _SetBadgeTextDetails): Promise<void>;
+
+ /**
+ * Gets the badge text of the browser action. If no tab nor window is specified is specified, the global badge text is returned.
+ */
+ function getBadgeText(details: Details): Promise<string>;
+
+ /**
+ * Sets the background color for the badge.
+ * @param details Specifies to which tab or window the value should be set, or from which one it should be retrieved. If no tab nor window is specified, the global value is set or retrieved.
+ */
+ function setBadgeBackgroundColor(details: _SetBadgeBackgroundColorDetails): Promise<void>;
+
+ /** Gets the background color of the browser action badge. */
+ function getBadgeBackgroundColor(details: Details): Promise<ColorArray>;
+
+ /**
+ * Sets the text color for the badge.
+ * @param details Specifies to which tab or window the value should be set, or from which one it should be retrieved. If no tab nor window is specified, the global value is set or retrieved.
+ */
+ function setBadgeTextColor(details: _SetBadgeTextColorDetails): Promise<any>;
+
+ /** Gets the text color of the browser action badge. */
+ function getBadgeTextColor(details: Details): Promise<any>;
+
+ /**
+ * Enables the browser action for a tab. By default, browser actions are enabled.
+ * @param [tabId] The id of the tab for which you want to modify the browser action.
+ */
+ function enable(tabId?: number): Promise<void>;
+
+ /**
+ * Disables the browser action for a tab.
+ * @param [tabId] The id of the tab for which you want to modify the browser action.
+ */
+ function disable(tabId?: number): Promise<void>;
+
+ /** Checks whether the browser action is enabled. */
+ function isEnabled(details: Details): Promise<any>;
+
+ /**
+ * Opens the extension popup window in the specified window.
+ * @param [options] An object with information about the popup to open.
+ */
+ function openPopup(options?: _OpenPopupOptions): Promise<boolean>;
+
+ /* browserAction events */
+ /**
+ * Fired when a browser action icon is clicked. This event will not fire if the browser action has a popup.
+ */
+ const onClicked: WebExtEvent<(tab: tabs.Tab, info?: OnClickData) => void>;
+}
+
+/**
+ * Use the `browser.browserSettings` API to control global settings of the browser.
+ *
+ * Permissions: `browserSettings`
+ *
+ * Not allowed in: Content scripts, Devtools pages
+ */
+declare namespace browser.browserSettings {
+ /* browserSettings types */
+ /** How images should be animated in the browser. */
+ type ImageAnimationBehavior = "normal" | "none" | "once";
+
+ /** After which mouse event context menus should popup. */
+ type ContextMenuMouseEvent = "mouseup" | "mousedown";
+
+ /** Color management mode. */
+ type ColorManagementMode = "off" | "full" | "tagged_only";
+
+ /* browserSettings properties */
+ /** Allows or disallows pop-up windows from opening in response to user events. */
+ const allowPopupsForUserEvents: types.Setting;
+
+ /** Enables or disables the browser cache. */
+ const cacheEnabled: types.Setting;
+
+ /** This boolean setting controls whether the selected tab can be closed with a double click. */
+ const closeTabsByDoubleClick: types.Setting;
+
+ /**
+ * Controls after which mouse event context menus popup. This setting's value is of type ContextMenuMouseEvent, which has possible values of `mouseup` and `mousedown`.
+ */
+ const contextMenuShowEvent: types.Setting;
+
+ /**
+ * Returns whether the FTP protocol is enabled. Read-only.
+ * @deprecated FTP support was removed from Firefox in bug 1574475
+ */
+ const ftpProtocolEnabled: types.Setting;
+
+ /** Returns the value of the overridden home page. Read-only. */
+ const homepageOverride: types.Setting;
+
+ /**
+ * Controls the behaviour of image animation in the browser. This setting's value is of type ImageAnimationBehavior, defaulting to `normal`.
+ */
+ const imageAnimationBehavior: types.Setting;
+
+ /** Returns the value of the overridden new tab page. Read-only. */
+ const newTabPageOverride: types.Setting;
+
+ /**
+ * Controls where new tabs are opened. `afterCurrent` will open all new tabs next to the current tab, `relatedAfterCurrent` will open only related tabs next to the current tab, and `atEnd` will open all tabs at the end of the tab strip. The default is `relatedAfterCurrent`.
+ */
+ const newTabPosition: types.Setting;
+
+ /** This boolean setting controls whether bookmarks are opened in the current tab or in a new tab. */
+ const openBookmarksInNewTabs: types.Setting;
+
+ /** This boolean setting controls whether search results are opened in the current tab or in a new tab. */
+ const openSearchResultsInNewTabs: types.Setting;
+
+ /** This boolean setting controls whether urlbar results are opened in the current tab or in a new tab. */
+ const openUrlbarResultsInNewTabs: types.Setting;
+
+ /** Disables webAPI notifications. */
+ const webNotificationsDisabled: types.Setting;
+
+ /** This setting controls whether the user-chosen colors override the page's colors. */
+ const overrideDocumentColors: types.Setting;
+
+ /**
+ * This setting controls whether a light or dark color scheme overrides the page's preferred color scheme.
+ */
+ const overrideContentColorScheme: types.Setting;
+
+ /** This setting controls whether the document's fonts are used. */
+ const useDocumentFonts: types.Setting;
+
+ /** This boolean setting controls whether zoom is applied to the full page or to text only. */
+ const zoomFullPage: types.Setting;
+
+ /**
+ * This boolean setting controls whether zoom is applied on a per-site basis or to the current tab only. If privacy.resistFingerprinting is true, this setting has no effect and zoom is applied to the current tab only.
+ */
+ const zoomSiteSpecific: types.Setting;
+}
+
+/**
+ * Use the `browserSettings.colorManagement` API to query and set items related to color management.
+ *
+ * Permissions: `browserSettings`
+ *
+ * Not allowed in: Content scripts, Devtools pages
+ */
+declare namespace browser.browserSettings.colorManagement {
+ /* browserSettings.colorManagement properties */
+ /**
+ * This setting controls the mode used for color management and must be a string from `browserSettings.ColorManagementMode`
+ */
+ const mode: types.Setting;
+
+ /** This boolean setting controls whether or not native sRGB color management is used. */
+ const useNativeSRGB: types.Setting;
+
+ /** This boolean setting controls whether or not the WebRender compositor is used. */
+ const useWebRenderCompositor: types.Setting;
+}
+
+/**
+ * Use the `browser.browsingData` API to remove browsing data from a user's local profile.
+ *
+ * Permissions: `browsingData`
+ *
+ * Not allowed in: Content scripts, Devtools pages
+ */
+declare namespace browser.browsingData {
+ /* browsingData types */
+ /** Options that determine exactly what data will be removed. */
+ interface RemovalOptions {
+ /**
+ * Remove data accumulated on or after this date, represented in milliseconds since the epoch (accessible via the `getTime` method of the JavaScript `Date` object). If absent, defaults to 0 (which would remove all browsing data).
+ */
+ since?: extensionTypes.Date | undefined;
+ /** Only remove data associated with these hostnames (only applies to cookies and localStorage). */
+ hostnames?: string[] | undefined;
+ /** Only remove data associated with this specific cookieStoreId. */
+ cookieStoreId?: string | undefined;
+ /**
+ * An object whose properties specify which origin types ought to be cleared. If this object isn't specified, it defaults to clearing only "unprotected" origins. Please ensure that you _really_ want to remove application data before adding 'protectedWeb' or 'extensions'.
+ */
+ originTypes?: _RemovalOptionsOriginTypes | undefined;
+ }
+
+ /** A set of data types. Missing data types are interpreted as `false`. */
+ interface DataTypeSet {
+ /**
+ * The browser's cache. Note: when removing data, this clears the _entire_ cache: it is not limited to the range you specify.
+ */
+ cache?: boolean | undefined;
+ /** The browser's cookies. */
+ cookies?: boolean | undefined;
+ /** The browser's download list. */
+ downloads?: boolean | undefined;
+ /** The browser's stored form data. */
+ formData?: boolean | undefined;
+ /** The browser's history. */
+ history?: boolean | undefined;
+ /** Websites' IndexedDB data. */
+ indexedDB?: boolean | undefined;
+ /** Websites' local storage data. */
+ localStorage?: boolean | undefined;
+ /** Server-bound certificates. */
+ serverBoundCertificates?: boolean | undefined;
+ /** Stored passwords. */
+ passwords?: boolean | undefined;
+ /** Plugins' data. */
+ pluginData?: boolean | undefined;
+ /** Service Workers. */
+ serviceWorkers?: boolean | undefined;
+ }
+
+ /**
+ * An object whose properties specify which origin types ought to be cleared. If this object isn't specified, it defaults to clearing only "unprotected" origins. Please ensure that you _really_ want to remove application data before adding 'protectedWeb' or 'extensions'.
+ */
+ interface _RemovalOptionsOriginTypes {
+ /** Normal websites. */
+ unprotectedWeb?: boolean | undefined;
+ /** Websites that have been installed as hosted applications (be careful!). */
+ protectedWeb?: boolean | undefined;
+ /** Extensions and packaged applications a user has installed (be _really_ careful!). */
+ extension?: boolean | undefined;
+ }
+
+ interface _SettingsReturnResult {
+ options: RemovalOptions;
+ /**
+ * All of the types will be present in the result, with values of `true` if they are both selected to be removed and permitted to be removed, otherwise `false`.
+ */
+ dataToRemove: DataTypeSet;
+ /**
+ * All of the types will be present in the result, with values of `true` if they are permitted to be removed (e.g., by enterprise policy) and `false` if not.
+ */
+ dataRemovalPermitted: DataTypeSet;
+ }
+
+ /* browsingData functions */
+ /**
+ * Reports which types of data are currently selected in the 'Clear browsing data' settings UI. Note: some of the data types included in this API are not available in the settings UI, and some UI settings control more than one data type listed here.
+ */
+ function settings(): Promise<_SettingsReturnResult>;
+
+ /**
+ * Clears various types of browsing data stored in a user's profile.
+ * @param dataToRemove The set of data types to remove.
+ */
+ function remove(options: RemovalOptions, dataToRemove: DataTypeSet): Promise<void>;
+
+ /**
+ * Clears websites' appcache data.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ function removeAppcache(options: RemovalOptions): Promise<void>;
+
+ /** Clears the browser's cache. */
+ function removeCache(options: RemovalOptions): Promise<void>;
+
+ /** Clears the browser's cookies and server-bound certificates modified within a particular timeframe. */
+ function removeCookies(options: RemovalOptions): Promise<void>;
+
+ /** Clears the browser's list of downloaded files (_not_ the downloaded files themselves). */
+ function removeDownloads(options: RemovalOptions): Promise<void>;
+
+ /**
+ * Clears websites' file system data.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ function removeFileSystems(options: RemovalOptions): Promise<void>;
+
+ /** Clears the browser's stored form data (autofill). */
+ function removeFormData(options: RemovalOptions): Promise<void>;
+
+ /** Clears the browser's history. */
+ function removeHistory(options: RemovalOptions): Promise<void>;
+
+ /**
+ * Clears websites' IndexedDB data.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ function removeIndexedDB(options: RemovalOptions): Promise<void>;
+
+ /** Clears websites' local storage data. */
+ function removeLocalStorage(options: RemovalOptions): Promise<void>;
+
+ /** Clears plugins' data. */
+ function removePluginData(options: RemovalOptions): Promise<void>;
+
+ /** Clears the browser's stored passwords. */
+ function removePasswords(options: RemovalOptions): Promise<void>;
+
+ /**
+ * Clears websites' WebSQL data.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ function removeWebSQL(options: RemovalOptions): Promise<void>;
+}
+
+/**
+ * This API provides the ability detect the captive portal state of the users connection.
+ *
+ * Permissions: `captivePortal`
+ *
+ * Not allowed in: Content scripts, Devtools pages
+ */
+declare namespace browser.captivePortal {
+ /** The current captive portal state. */
+ type _OnStateChangedDetailsState = "unknown" | "not_captive" | "unlocked_portal" | "locked_portal";
+
+ interface _OnStateChangedDetails {
+ /** The current captive portal state. */
+ state: _OnStateChangedDetailsState;
+ }
+
+ type _OnConnectivityAvailableStatus = "captive" | "clear";
+
+ /* captivePortal properties */
+ /** Return the canonical captive-portal detection URL. Read-only. */
+ const canonicalURL: types.Setting;
+
+ /* captivePortal functions */
+ /**
+ * Returns the current portal state, one of `unknown`, `not_captive`, `unlocked_portal`, `locked_portal`.
+ */
+ function getState(): Promise<_OnStateChangedDetailsState>;
+
+ /** Returns the time difference between NOW and the last time a request was completed in milliseconds. */
+ function getLastChecked(): Promise<number>;
+
+ /* captivePortal events */
+ /** Fired when the captive portal state changes. */
+ const onStateChanged: WebExtEvent<(details: _OnStateChangedDetails) => void>;
+
+ /**
+ * This notification will be emitted when the captive portal service has determined that we can connect to the internet. The service will pass either `captive` if there is an unlocked captive portal present, or `clear` if no captive portal was detected.
+ */
+ const onConnectivityAvailable: WebExtEvent<(status: _OnConnectivityAvailableStatus) => void>;
+}
+
+/**
+ * Offers the ability to write to the clipboard. Reading is not supported because the clipboard can already be read through the standard web platform APIs.
+ *
+ * Permissions: `clipboardWrite`
+ *
+ * Not allowed in: Content scripts, Devtools pages
+ */
+declare namespace browser.clipboard {
+ /** The type of imageData. */
+ type _SetImageDataImageType = "jpeg" | "png";
+
+ /* clipboard functions */
+ /**
+ * Copy an image to the clipboard. The image is re-encoded before it is written to the clipboard. If the image is invalid, the clipboard is not modified.
+ * @param imageData The image data to be copied.
+ * @param imageType The type of imageData.
+ */
+ function setImageData(imageData: ArrayBuffer, imageType: _SetImageDataImageType): Promise<void>;
+}
+
+/**
+ * Not supported on manifest versions above 2.
+ *
+ * Not allowed in: Content scripts, Devtools pages
+ */
+declare namespace browser.contentScripts {
+ /* contentScripts types */
+ /** Details of a content script registered programmatically */
+ interface RegisteredContentScriptOptions {
+ matches: _manifest.MatchPattern[];
+ excludeMatches?: _manifest.MatchPattern[] | undefined;
+ includeGlobs?: string[] | undefined;
+ excludeGlobs?: string[] | undefined;
+ /** The list of CSS files to inject */
+ css?: extensionTypes.ExtensionFileOrCode[] | undefined;
+ /** The list of JS files to inject */
+ js?: extensionTypes.ExtensionFileOrCode[] | undefined;
+ /**
+ * If allFrames is `true`, implies that the JavaScript or CSS should be injected into all frames of current page. By default, it's `false` and is only injected into the top frame.
+ */
+ allFrames?: boolean | undefined;
+ /**
+ * If matchAboutBlank is true, then the code is also injected in about:blank and about:srcdoc frames if your extension has access to its parent document. Code cannot be inserted in top-level about:-frames. By default it is `false`.
+ */
+ matchAboutBlank?: boolean | undefined;
+ /** The soonest that the JavaScript or CSS will be injected into the tab. Defaults to "document_idle". */
+ runAt?: extensionTypes.RunAt | undefined;
+ /** limit the set of matched tabs to those that belong to the given cookie store id */
+ cookieStoreId?: string[] | string | undefined;
+ }
+
+ /** An object that represents a content script registered programmatically */
+ interface RegisteredContentScript {
+ /** Unregister a content script registered programmatically */
+ unregister(): Promise<any>;
+ }
+
+ /* contentScripts functions */
+ /** Register a content script programmatically */
+ function register(contentScriptOptions: RegisteredContentScriptOptions): Promise<RegisteredContentScript>;
+}
+
+/**
+ * Use the `browser.contextualIdentities` API to query and modify contextual identity, also called as containers.
+ *
+ * Permissions: `contextualIdentities`
+ *
+ * Not allowed in: Content scripts, Devtools pages
+ */
+declare namespace browser.contextualIdentities {
+ /* contextualIdentities types */
+ /** Represents information about a contextual identity. */
+ interface ContextualIdentity {
+ /** The name of the contextual identity. */
+ name: string;
+ /** The icon name of the contextual identity. */
+ icon: string;
+ /** The icon url of the contextual identity. */
+ iconUrl: string;
+ /** The color name of the contextual identity. */
+ color: string;
+ /** The color hash of the contextual identity. */
+ colorCode: string;
+ /** The cookie store ID of the contextual identity. */
+ cookieStoreId: string;
+ }
+
+ /** Information to filter the contextual identities being retrieved. */
+ interface _QueryDetails {
+ /** Filters the contextual identity by name. */
+ name?: string | undefined;
+ }
+
+ /** Details about the contextual identity being created. */
+ interface _CreateDetails {
+ /** The name of the contextual identity. */
+ name: string;
+ /** The color of the contextual identity. */
+ color: string;
+ /** The icon of the contextual identity. */
+ icon: string;
+ }
+
+ /** Details about the contextual identity being created. */
+ interface _UpdateDetails {
+ /** The name of the contextual identity. */
+ name?: string | undefined;
+ /** The color of the contextual identity. */
+ color?: string | undefined;
+ /** The icon of the contextual identity. */
+ icon?: string | undefined;
+ }
+
+ interface _OnUpdatedChangeInfo {
+ /** Contextual identity that has been updated */
+ contextualIdentity: ContextualIdentity;
+ }
+
+ interface _OnCreatedChangeInfo {
+ /** Contextual identity that has been created */
+ contextualIdentity: ContextualIdentity;
+ }
+
+ interface _OnRemovedChangeInfo {
+ /** Contextual identity that has been removed */
+ contextualIdentity: ContextualIdentity;
+ }
+
+ /* contextualIdentities functions */
+ /**
+ * Retrieves information about a single contextual identity.
+ * @param cookieStoreId The ID of the contextual identity cookie store.
+ */
+ function get(cookieStoreId: string): Promise<ContextualIdentity>;
+
+ /**
+ * Retrieves all contextual identities
+ * @param details Information to filter the contextual identities being retrieved.
+ */
+ function query(details: _QueryDetails): Promise<ContextualIdentity[]>;
+
+ /**
+ * Creates a contextual identity with the given data.
+ * @param details Details about the contextual identity being created.
+ */
+ function create(details: _CreateDetails): Promise<ContextualIdentity>;
+
+ /**
+ * Updates a contextual identity with the given data.
+ * @param cookieStoreId The ID of the contextual identity cookie store.
+ * @param details Details about the contextual identity being created.
+ */
+ function update(cookieStoreId: string, details: _UpdateDetails): Promise<ContextualIdentity>;
+
+ /**
+ * Deletes a contetual identity by its cookie Store ID.
+ * @param cookieStoreId The ID of the contextual identity cookie store.
+ */
+ function remove(cookieStoreId: string): Promise<ContextualIdentity>;
+
+ /* contextualIdentities events */
+ /** Fired when a container is updated. */
+ const onUpdated: WebExtEvent<(changeInfo: _OnUpdatedChangeInfo) => void>;
+
+ /** Fired when a new container is created. */
+ const onCreated: WebExtEvent<(changeInfo: _OnCreatedChangeInfo) => void>;
+
+ /** Fired when a container is removed. */
+ const onRemoved: WebExtEvent<(changeInfo: _OnRemovedChangeInfo) => void>;
+}
+
+/**
+ * Use the `browser.cookies` API to query and modify cookies, and to be notified when they change.
+ *
+ * Permissions: `cookies`
+ *
+ * Not allowed in: Content scripts, Devtools pages
+ */
+declare namespace browser.cookies {
+ /* cookies types */
+ /**
+ * A cookie's 'SameSite' state (https://tools.ietf.org/html/draft-west-first-party-cookies). 'no_restriction' corresponds to a cookie set without a 'SameSite' attribute, 'lax' to 'SameSite=Lax', and 'strict' to 'SameSite=Strict'.
+ */
+ type SameSiteStatus = "no_restriction" | "lax" | "strict";
+
+ /**
+ * The description of the storage partition of a cookie. This object may be omitted (null) if a cookie is not partitioned.
+ */
+ interface PartitionKey {
+ /** The first-party URL of the cookie, if the cookie is in storage partitioned by the top-level site. */
+ topLevelSite?: string | undefined;
+ }
+
+ /** Represents information about an HTTP cookie. */
+ interface Cookie {
+ /** The name of the cookie. */
+ name: string;
+ /** The value of the cookie. */
+ value: string;
+ /** The domain of the cookie (e.g. "www.google.com", "example.com"). */
+ domain: string;
+ /**
+ * True if the cookie is a host-only cookie (i.e. a request's host must exactly match the domain of the cookie).
+ */
+ hostOnly: boolean;
+ /** The path of the cookie. */
+ path: string;
+ /**
+ * True if the cookie is marked as Secure (i.e. its scope is limited to secure channels, typically HTTPS).
+ */
+ secure: boolean;
+ /** True if the cookie is marked as HttpOnly (i.e. the cookie is inaccessible to client-side scripts). */
+ httpOnly: boolean;
+ /** The cookie's same-site status (i.e. whether the cookie is sent with cross-site requests). */
+ sameSite: SameSiteStatus;
+ /** True if the cookie is a session cookie, as opposed to a persistent cookie with an expiration date. */
+ session: boolean;
+ /**
+ * The expiration date of the cookie as the number of seconds since the UNIX epoch. Not provided for session cookies.
+ */
+ expirationDate?: number | undefined;
+ /** The ID of the cookie store containing this cookie, as provided in getAllCookieStores(). */
+ storeId: string;
+ /** The first-party domain of the cookie. */
+ firstPartyDomain: string;
+ /** The cookie's storage partition, if any. null if not partitioned. */
+ partitionKey?: PartitionKey | undefined;
+ }
+
+ /**
+ * Represents a cookie store in the browser. An incognito mode window, for instance, uses a separate cookie store from a non-incognito window.
+ */
+ interface CookieStore {
+ /** The unique identifier for the cookie store. */
+ id: string;
+ /** Identifiers of all the browser tabs that share this cookie store. */
+ tabIds: number[];
+ /** Indicates if this is an incognito cookie store */
+ incognito: boolean;
+ }
+
+ /**
+ * The underlying reason behind the cookie's change. If a cookie was inserted, or removed via an explicit call to `cookies.remove`, "cause" will be "explicit". If a cookie was automatically removed due to expiry, "cause" will be "expired". If a cookie was removed due to being overwritten with an already-expired expiration date, "cause" will be set to "expired_overwrite". If a cookie was automatically removed due to garbage collection, "cause" will be "evicted". If a cookie was automatically removed due to a "set" call that overwrote it, "cause" will be "overwrite". Plan your response accordingly.
+ */
+ type OnChangedCause = "evicted" | "expired" | "explicit" | "expired_overwrite" | "overwrite";
+
+ /** Details to identify the cookie being retrieved. */
+ interface _GetDetails {
+ /**
+ * The URL with which the cookie to retrieve is associated. This argument may be a full URL, in which case any data following the URL path (e.g. the query string) is simply ignored. If host permissions for this URL are not specified in the manifest file, the API call will fail.
+ */
+ url: string;
+ /** The name of the cookie to retrieve. */
+ name: string;
+ /**
+ * The ID of the cookie store in which to look for the cookie. By default, the current execution context's cookie store will be used.
+ */
+ storeId?: string | undefined;
+ /**
+ * The first-party domain which the cookie to retrieve is associated. This attribute is required if First-Party Isolation is enabled.
+ */
+ firstPartyDomain?: string | undefined;
+ /**
+ * The storage partition, if the cookie is part of partitioned storage. By default, only non-partitioned cookies are returned.
+ */
+ partitionKey?: PartitionKey | undefined;
+ }
+
+ /** Information to filter the cookies being retrieved. */
+ interface _GetAllDetails {
+ /** Restricts the retrieved cookies to those that would match the given URL. */
+ url?: string | undefined;
+ /** Filters the cookies by name. */
+ name?: string | undefined;
+ /** Restricts the retrieved cookies to those whose domains match or are subdomains of this one. */
+ domain?: string | undefined;
+ /** Restricts the retrieved cookies to those whose path exactly matches this string. */
+ path?: string | undefined;
+ /** Filters the cookies by their Secure property. */
+ secure?: boolean | undefined;
+ /** Filters out session vs. persistent cookies. */
+ session?: boolean | undefined;
+ /**
+ * The cookie store to retrieve cookies from. If omitted, the current execution context's cookie store will be used.
+ */
+ storeId?: string | undefined;
+ /**
+ * Restricts the retrieved cookies to those whose first-party domains match this one. This attribute is required if First-Party Isolation is enabled. To not filter by a specific first-party domain, use `null` or `undefined`.
+ */
+ firstPartyDomain?: string | undefined;
+ /**
+ * Selects a specific storage partition to look up cookies. Defaults to null, in which case only non-partitioned cookies are retrieved. If an object iis passed, partitioned cookies are also included, and filtered based on the keys present in the given PartitionKey description. An empty object ({}) returns all cookies (partitioned + unpartitioned), a non-empty object (e.g. {topLevelSite: '...'}) only returns cookies whose partition match all given attributes.
+ */
+ partitionKey?: PartitionKey | undefined;
+ }
+
+ /** Details about the cookie being set. */
+ interface _SetDetails {
+ /**
+ * The request-URI to associate with the setting of the cookie. This value can affect the default domain and path values of the created cookie. If host permissions for this URL are not specified in the manifest file, the API call will fail.
+ */
+ url: string;
+ /** The name of the cookie. Empty by default if omitted. */
+ name?: string | undefined;
+ /** The value of the cookie. Empty by default if omitted. */
+ value?: string | undefined;
+ /** The domain of the cookie. If omitted, the cookie becomes a host-only cookie. */
+ domain?: string | undefined;
+ /** The path of the cookie. Defaults to the path portion of the url parameter. */
+ path?: string | undefined;
+ /** Whether the cookie should be marked as Secure. Defaults to false. */
+ secure?: boolean | undefined;
+ /** Whether the cookie should be marked as HttpOnly. Defaults to false. */
+ httpOnly?: boolean | undefined;
+ /** The cookie's same-site status. */
+ sameSite?: SameSiteStatus | undefined;
+ /**
+ * The expiration date of the cookie as the number of seconds since the UNIX epoch. If omitted, the cookie becomes a session cookie.
+ */
+ expirationDate?: number | undefined;
+ /**
+ * The ID of the cookie store in which to set the cookie. By default, the cookie is set in the current execution context's cookie store.
+ */
+ storeId?: string | undefined;
+ /**
+ * The first-party domain of the cookie. This attribute is required if First-Party Isolation is enabled.
+ */
+ firstPartyDomain?: string | undefined;
+ /**
+ * The storage partition, if the cookie is part of partitioned storage. By default, non-partitioned storage is used.
+ */
+ partitionKey?: PartitionKey | undefined;
+ }
+
+ /**
+ * Contains details about the cookie that's been removed. If removal failed for any reason, this will be "null", and `runtime.lastError` will be set.
+ */
+ interface _RemoveReturnDetails {
+ /** The URL associated with the cookie that's been removed. */
+ url: string;
+ /** The name of the cookie that's been removed. */
+ name: string;
+ /** The ID of the cookie store from which the cookie was removed. */
+ storeId: string;
+ /** The first-party domain associated with the cookie that's been removed. */
+ firstPartyDomain: string;
+ /** The storage partition, if the cookie is part of partitioned storage. null if not partitioned. */
+ partitionKey?: PartitionKey | undefined;
+ }
+
+ /** Information to identify the cookie to remove. */
+ interface _RemoveDetails {
+ /**
+ * The URL associated with the cookie. If host permissions for this URL are not specified in the manifest file, the API call will fail.
+ */
+ url: string;
+ /** The name of the cookie to remove. */
+ name: string;
+ /**
+ * The ID of the cookie store to look in for the cookie. If unspecified, the cookie is looked for by default in the current execution context's cookie store.
+ */
+ storeId?: string | undefined;
+ /**
+ * The first-party domain associated with the cookie. This attribute is required if First-Party Isolation is enabled.
+ */
+ firstPartyDomain?: string | undefined;
+ /**
+ * The storage partition, if the cookie is part of partitioned storage. By default, non-partitioned storage is used.
+ */
+ partitionKey?: PartitionKey | undefined;
+ }
+
+ interface _OnChangedChangeInfo {
+ /** True if a cookie was removed. */
+ removed: boolean;
+ /** Information about the cookie that was set or removed. */
+ cookie: Cookie;
+ /** The underlying reason behind the cookie's change. */
+ cause: OnChangedCause;
+ }
+
+ /* cookies functions */
+ /**
+ * Retrieves information about a single cookie. If more than one cookie of the same name exists for the given URL, the one with the longest path will be returned. For cookies with the same path length, the cookie with the earliest creation time will be returned.
+ * @param details Details to identify the cookie being retrieved.
+ */
+ function get(details: _GetDetails): Promise<Cookie | null>;
+
+ /**
+ * Retrieves all cookies from a single cookie store that match the given information. The cookies returned will be sorted, with those with the longest path first. If multiple cookies have the same path length, those with the earliest creation time will be first.
+ * @param details Information to filter the cookies being retrieved.
+ */
+ function getAll(details: _GetAllDetails): Promise<Cookie[]>;
+
+ /**
+ * Sets a cookie with the given cookie data; may overwrite equivalent cookies if they exist.
+ * @param details Details about the cookie being set.
+ */
+ function set(details: _SetDetails): Promise<Cookie>;
+
+ /**
+ * Deletes a cookie by name.
+ * @param details Information to identify the cookie to remove.
+ */
+ function remove(details: _RemoveDetails): Promise<_RemoveReturnDetails | null>;
+
+ /** Lists all existing cookie stores. */
+ function getAllCookieStores(): Promise<CookieStore[]>;
+
+ /* cookies events */
+ /**
+ * Fired when a cookie is set or removed. As a special case, note that updating a cookie's properties is implemented as a two step process: the cookie to be updated is first removed entirely, generating a notification with "cause" of "overwrite" . Afterwards, a new cookie is written with the updated values, generating a second notification with "cause" "explicit".
+ */
+ const onChanged: WebExtEvent<(changeInfo: _OnChangedChangeInfo) => void>;
+}
+
+/**
+ * Use the declarativeNetRequest API to block or modify network requests by specifying declarative rules.
+ *
+ * Permissions: `declarativeNetRequest`, `declarativeNetRequestWithHostAccess`
+ *
+ * Not allowed in: Content scripts, Devtools pages
+ */
+declare namespace browser.declarativeNetRequest {
+ /* declarativeNetRequest types */
+ /** How the requested resource will be used. Comparable to the webRequest.ResourceType type. */
+ type ResourceType =
+ | "main_frame"
+ | "sub_frame"
+ | "stylesheet"
+ | "script"
+ | "image"
+ | "object"
+ | "object_subrequest"
+ | "xmlhttprequest"
+ | "xslt"
+ | "ping"
+ | "beacon"
+ | "xml_dtd"
+ | "font"
+ | "media"
+ | "websocket"
+ | "csp_report"
+ | "imageset"
+ | "web_manifest"
+ | "speculative"
+ | "other";
+
+ interface MatchedRule {
+ /** A matching rule's ID. */
+ ruleId: number;
+ /** ID of the Ruleset this rule belongs to. */
+ rulesetId: string;
+ /** ID of the extension, if this rule belongs to a different extension. */
+ extensionId?: string | undefined;
+ }
+
+ /** Describes the type of the Rule.action.redirect.transform property. */
+ interface URLTransform {
+ /** The new scheme for the request. */
+ scheme?: _URLTransformScheme | undefined;
+ /** The new username for the request. */
+ username?: string | undefined;
+ /** The new password for the request. */
+ password?: string | undefined;
+ /** The new host name for the request. */
+ host?: string | undefined;
+ /** The new port for the request. If empty, the existing port is cleared. */
+ port?: string | undefined;
+ /** The new path for the request. If empty, the existing path is cleared. */
+ path?: string | undefined;
+ /**
+ * The new query for the request. Should be either empty, in which case the existing query is cleared; or should begin with '?'. Cannot be specified if 'queryTransform' is specified.
+ */
+ query?: string | undefined;
+ /** Add, remove or replace query key-value pairs. Cannot be specified if 'query' is specified. */
+ queryTransform?: _URLTransformQueryTransform | undefined;
+ /**
+ * The new fragment for the request. Should be either empty, in which case the existing fragment is cleared; or should begin with '#'.
+ */
+ fragment?: string | undefined;
+ }
+
+ interface Rule {
+ /** An id which uniquely identifies a rule. Mandatory and should be >= 1. */
+ id: number;
+ /** Rule priority. Defaults to 1\. When specified, should be >= 1 */
+ priority?: number | undefined;
+ /** The condition under which this rule is triggered. */
+ condition: _RuleCondition;
+ /** The action to take if this rule is matched. */
+ action: _RuleAction;
+ }
+
+ /** The new scheme for the request. */
+ type _URLTransformScheme = "http" | "https" | "moz-extension";
+
+ interface _URLTransformQueryTransformAddOrReplaceParams {
+ key: string;
+ value: string;
+ /**
+ * If true, the query key is replaced only if it's already present. Otherwise, the key is also added if it's missing.
+ */
+ replaceOnly?: boolean | undefined;
+ }
+
+ /** Add, remove or replace query key-value pairs. Cannot be specified if 'query' is specified. */
+ interface _URLTransformQueryTransform {
+ /** The list of query keys to be removed. */
+ removeParams?: string[] | undefined;
+ /** The list of query key-value pairs to be added or replaced. */
+ addOrReplaceParams?: _URLTransformQueryTransformAddOrReplaceParams[] | undefined;
+ }
+
+ /**
+ * Specifies whether the network request is first-party or third-party to the domain from which it originated. If omitted, all requests are matched.
+ */
+ type _RuleConditionDomainType = "firstParty" | "thirdParty";
+
+ /** The condition under which this rule is triggered. */
+ interface _RuleCondition {
+ /**
+ * TODO: link to doc explaining supported pattern. The pattern which is matched against the network request url. Only one of 'urlFilter' or 'regexFilter' can be specified.
+ */
+ urlFilter?: string | undefined;
+ /**
+ * Regular expression to match against the network request url. Only one of 'urlFilter' or 'regexFilter' can be specified.
+ */
+ regexFilter?: string | undefined;
+ /** Whether 'urlFilter' or 'regexFilter' is case-sensitive. */
+ isUrlFilterCaseSensitive?: boolean | undefined;
+ /**
+ * The rule will only match network requests originating from the list of 'initiatorDomains'. If the list is omitted, the rule is applied to requests from all domains.
+ */
+ initiatorDomains?: string[] | undefined;
+ /**
+ * The rule will not match network requests originating from the list of 'initiatorDomains'. If the list is empty or omitted, no domains are excluded. This takes precedence over 'initiatorDomains'.
+ */
+ excludedInitiatorDomains?: string[] | undefined;
+ /**
+ * The rule will only match network requests when the domain matches one from the list of 'requestDomains'. If the list is omitted, the rule is applied to requests from all domains.
+ */
+ requestDomains?: string[] | undefined;
+ /**
+ * The rule will not match network requests when the domains matches one from the list of 'excludedRequestDomains'. If the list is empty or omitted, no domains are excluded. This takes precedence over 'requestDomains'.
+ */
+ excludedRequestDomains?: string[] | undefined;
+ /**
+ * List of resource types which the rule can match. When the rule action is 'allowAllRequests', this must be specified and may only contain 'main_frame' or 'sub_frame'. Cannot be specified if 'excludedResourceTypes' is specified. If neither of them is specified, all resource types except 'main_frame' are matched.
+ */
+ resourceTypes?: ResourceType[] | undefined;
+ /**
+ * List of resource types which the rule won't match. Cannot be specified if 'resourceTypes' is specified. If neither of them is specified, all resource types except 'main_frame' are matched.
+ */
+ excludedResourceTypes?: ResourceType[] | undefined;
+ /**
+ * List of HTTP request methods which the rule can match. Should be a lower-case method such as 'connect', 'delete', 'get', 'head', 'options', 'patch', 'post', 'put'.'
+ */
+ requestMethods?: string[] | undefined;
+ /**
+ * List of request methods which the rule won't match. Cannot be specified if 'requestMethods' is specified. If neither of them is specified, all request methods are matched.
+ */
+ excludedRequestMethods?: string[] | undefined;
+ /**
+ * Specifies whether the network request is first-party or third-party to the domain from which it originated. If omitted, all requests are matched.
+ */
+ domainType?: _RuleConditionDomainType | undefined;
+ /**
+ * List of tabIds which the rule should match. An ID of -1 matches requests which don't originate from a tab. Only supported for session-scoped rules.
+ */
+ tabIds?: number[] | undefined;
+ /**
+ * List of tabIds which the rule should not match. An ID of -1 excludes requests which don't originate from a tab. Only supported for session-scoped rules.
+ */
+ excludedTabIds?: number[] | undefined;
+ }
+
+ type _RuleActionType = "block" | "redirect" | "allow" | "upgradeScheme" | "modifyHeaders" | "allowAllRequests";
+
+ /** Describes how the redirect should be performed. Only valid when type is 'redirect'. */
+ interface _RuleActionRedirect {
+ /** Path relative to the extension directory. Should start with '/'. */
+ extensionPath?: string | undefined;
+ /** Url transformations to perform. */
+ transform?: URLTransform | undefined;
+ /** The redirect url. Redirects to JavaScript urls are not allowed. */
+ url?: string | undefined;
+ /** TODO with regexFilter + Substitution pattern for rules which specify a 'regexFilter'. */
+ regexSubstitution?: string | undefined;
+ }
+
+ /** The operation to be performed on a header. */
+ type _RuleActionRequestHeadersOperation = "append" | "set" | "remove";
+
+ interface _RuleActionRequestHeaders {
+ /** The name of the request header to be modified. */
+ header: string;
+ /** The operation to be performed on a header. */
+ operation: _RuleActionRequestHeadersOperation;
+ /** The new value for the header. Must be specified for the 'append' and 'set' operations. */
+ value?: string | undefined;
+ }
+
+ /** The operation to be performed on a header. */
+ type _RuleActionResponseHeadersOperation = "append" | "set" | "remove";
+
+ interface _RuleActionResponseHeaders {
+ /** The name of the response header to be modified. */
+ header: string;
+ /** The operation to be performed on a header. */
+ operation: _RuleActionResponseHeadersOperation;
+ /** The new value for the header. Must be specified for the 'append' and 'set' operations. */
+ value?: string | undefined;
+ }
+
+ /** The action to take if this rule is matched. */
+ interface _RuleAction {
+ type: _RuleActionType;
+ /** Describes how the redirect should be performed. Only valid when type is 'redirect'. */
+ redirect?: _RuleActionRedirect | undefined;
+ /** The request headers to modify for the request. Only valid when type is 'modifyHeaders'. */
+ requestHeaders?: _RuleActionRequestHeaders[] | undefined;
+ /** The response headers to modify for the request. Only valid when type is 'modifyHeaders'. */
+ responseHeaders?: _RuleActionResponseHeaders[] | undefined;
+ }
+
+ interface _UpdateDynamicRulesOptions {
+ /** IDs of the rules to remove. Any invalid IDs will be ignored. */
+ removeRuleIds?: number[] | undefined;
+ /** Rules to add. */
+ addRules?: Rule[] | undefined;
+ }
+
+ interface _UpdateSessionRulesOptions {
+ /** IDs of the rules to remove. Any invalid IDs will be ignored. */
+ removeRuleIds?: number[] | undefined;
+ /** Rules to add. */
+ addRules?: Rule[] | undefined;
+ }
+
+ interface _UpdateEnabledRulesetsUpdateRulesetOptions {
+ disableRulesetIds?: string[] | undefined;
+ enableRulesetIds?: string[] | undefined;
+ }
+
+ interface _TestMatchOutcomeReturnResult {
+ /** The rules (if any) that match the hypothetical request. */
+ matchedRules: MatchedRule[];
+ }
+
+ /** The details of the request to test. */
+ interface _TestMatchOutcomeRequest {
+ /** The URL of the hypothetical request. */
+ url: string;
+ /** The initiator URL (if any) for the hypothetical request. */
+ initiator?: string | undefined;
+ /** Standard HTTP method of the hypothetical request. */
+ method?: string | undefined;
+ /** The resource type of the hypothetical request. */
+ type: ResourceType;
+ /**
+ * The ID of the tab in which the hypothetical request takes place. Does not need to correspond to a real tab ID. Default is -1, meaning that the request isn't related to a tab.
+ */
+ tabId?: number | undefined;
+ }
+
+ interface _TestMatchOutcomeOptions {
+ /** Whether to account for rules from other installed extensions during rule evaluation. */
+ includeOtherExtensions?: boolean | undefined;
+ }
+
+ /* declarativeNetRequest properties */
+ /** Ruleset ID for the dynamic rules added by the extension. */
+ const DYNAMIC_RULESET_ID: string;
+
+ /**
+ * The minimum number of static rules guaranteed to an extension across its enabled static rulesets. Any rules above this limit will count towards the global static rule limit.
+ */
+ const GUARANTEED_MINIMUM_STATIC_RULES: number;
+
+ /**
+ * The maximum number of static Rulesets an extension can specify as part of the rule_resources manifest key.
+ */
+ const MAX_NUMBER_OF_STATIC_RULESETS: number;
+
+ /** The maximum number of static Rulesets an extension can enable at any one time. */
+ const MAX_NUMBER_OF_ENABLED_STATIC_RULESETS: number;
+
+ /**
+ * The maximum number of dynamic and session rules an extension can add. NOTE: in the Firefox we are enforcing this limit to the session and dynamic rules count separately, instead of enforcing it to the rules count for both combined as the Chrome implementation does.
+ */
+ const MAX_NUMBER_OF_DYNAMIC_AND_SESSION_RULES: number;
+
+ /** Ruleset ID for the session-scoped rules added by the extension. */
+ const SESSION_RULESET_ID: string;
+
+ /* declarativeNetRequest functions */
+ /**
+ * Modifies the current set of dynamic rules for the extension. The rules with IDs listed in options.removeRuleIds are first removed, and then the rules given in options.addRules are added. These rules are persisted across browser sessions and extension updates.
+ */
+ function updateDynamicRules(options: _UpdateDynamicRulesOptions): Promise<void>;
+
+ /**
+ * Modifies the current set of session scoped rules for the extension. The rules with IDs listed in options.removeRuleIds are first removed, and then the rules given in options.addRules are added. These rules are not persisted across sessions and are backed in memory.
+ */
+ function updateSessionRules(options: _UpdateSessionRulesOptions): Promise<void>;
+
+ /** Returns the ids for the current set of enabled static rulesets. */
+ function getEnabledRulesets(): Promise<string[]>;
+
+ /** Returns the ids for the current set of enabled static rulesets. */
+ function updateEnabledRulesets(updateRulesetOptions: _UpdateEnabledRulesetsUpdateRulesetOptions): Promise<void>;
+
+ /** Returns the remaining number of static rules an extension can enable */
+ function getAvailableStaticRuleCount(): Promise<number>;
+
+ /** Returns the current set of dynamic rules for the extension. */
+ function getDynamicRules(): Promise<Rule[]>;
+
+ /** Returns the current set of session scoped rules for the extension. */
+ function getSessionRules(): Promise<Rule[]>;
+
+ /**
+ * Checks if any of the extension's declarativeNetRequest rules would match a hypothetical request.
+ * @param request The details of the request to test.
+ */
+ function testMatchOutcome(
+ request: _TestMatchOutcomeRequest,
+ options?: _TestMatchOutcomeOptions,
+ ): Promise<_TestMatchOutcomeReturnResult>;
+}
+
+/**
+ * Asynchronous DNS API
+ *
+ * Permissions: `dns`
+ *
+ * Not allowed in: Content scripts, Devtools pages
+ */
+declare namespace browser.dns {
+ /* dns types */
+ /** An object encapsulating a DNS Record. */
+ interface DNSRecord {
+ /**
+ * The canonical hostname for this record. this value is empty if the record was not fetched with the 'canonical_name' flag.
+ */
+ canonicalName?: string | undefined;
+ /** Record retreived with TRR. */
+ isTRR: string;
+ addresses: string[];
+ }
+
+ type ResolveFlags = _ResolveFlags[];
+
+ type _ResolveFlags =
+ | "allow_name_collisions"
+ | "bypass_cache"
+ | "canonical_name"
+ | "disable_ipv4"
+ | "disable_ipv6"
+ | "disable_trr"
+ | "offline"
+ | "priority_low"
+ | "priority_medium"
+ | "speculate";
+
+ /* dns functions */
+ /** Resolves a hostname to a DNS record. */
+ function resolve(hostname: string, flags?: ResolveFlags): Promise<DNSRecord>;
+}
+
+/**
+ * Permissions: `downloads`
+ *
+ * Not allowed in: Content scripts, Devtools pages
+ */
+declare namespace browser.downloads {
+ /* downloads types */
+ type FilenameConflictAction = "uniquify" | "overwrite" | "prompt";
+
+ type InterruptReason =
+ | "FILE_FAILED"
+ | "FILE_ACCESS_DENIED"
+ | "FILE_NO_SPACE"
+ | "FILE_NAME_TOO_LONG"
+ | "FILE_TOO_LARGE"
+ | "FILE_VIRUS_INFECTED"
+ | "FILE_TRANSIENT_ERROR"
+ | "FILE_BLOCKED"
+ | "FILE_SECURITY_CHECK_FAILED"
+ | "FILE_TOO_SHORT"
+ | "NETWORK_FAILED"
+ | "NETWORK_TIMEOUT"
+ | "NETWORK_DISCONNECTED"
+ | "NETWORK_SERVER_DOWN"
+ | "NETWORK_INVALID_REQUEST"
+ | "SERVER_FAILED"
+ | "SERVER_NO_RANGE"
+ | "SERVER_BAD_CONTENT"
+ | "SERVER_UNAUTHORIZED"
+ | "SERVER_CERT_PROBLEM"
+ | "SERVER_FORBIDDEN"
+ | "USER_CANCELED"
+ | "USER_SHUTDOWN"
+ | "CRASH";
+
+ /**
+ * *file*:
+ * The download's filename is suspicious.
+ * *url*:
+ * The download's URL is known to be malicious.
+ * *content*:
+ * The downloaded file is known to be malicious.
+ * *uncommon*:
+ * The download's URL is not commonly downloaded and could be dangerous.
+ * *safe*:
+ * The download presents no known danger to the user's computer.
+ *
+ * These string constants will never change, however the set of DangerTypes may change.
+ */
+ type DangerType = "file" | "url" | "content" | "uncommon" | "host" | "unwanted" | "safe" | "accepted";
+
+ /**
+ * *in_progress*:
+ * The download is currently receiving data from the server.
+ * *interrupted*:
+ * An error broke the connection with the file host.
+ * *complete*:
+ * The download completed successfully.
+ *
+ * These string constants will never change, however the set of States may change.
+ */
+ type State = "in_progress" | "interrupted" | "complete";
+
+ interface DownloadItem {
+ /** An identifier that is persistent across browser sessions. */
+ id: number;
+ /** Absolute URL. */
+ url: string;
+ referrer?: string | undefined;
+ /** Absolute local path. */
+ filename: string;
+ /** False if this download is recorded in the history, true if it is not recorded. */
+ incognito: boolean;
+ /** The cookie store ID of the contextual identity. */
+ cookieStoreId?: string | undefined;
+ /** Indication of whether this download is thought to be safe or known to be suspicious. */
+ danger: DangerType;
+ /** The file's MIME type. */
+ mime?: string | undefined;
+ /** Number of milliseconds between the unix epoch and when this download began. */
+ startTime: string;
+ /** Number of milliseconds between the unix epoch and when this download ended. */
+ endTime?: string | undefined;
+ estimatedEndTime?: string | undefined;
+ /** Indicates whether the download is progressing, interrupted, or complete. */
+ state: State;
+ /** True if the download has stopped reading data from the host, but kept the connection open. */
+ paused: boolean;
+ canResume: boolean;
+ /** Number indicating why a download was interrupted. */
+ error?: InterruptReason | undefined;
+ /** Number of bytes received so far from the host, without considering file compression. */
+ bytesReceived: number;
+ /** Number of bytes in the whole file, without considering file compression, or -1 if unknown. */
+ totalBytes: number;
+ /** Number of bytes in the whole file post-decompression, or -1 if unknown. */
+ fileSize: number;
+ exists: boolean;
+ byExtensionId?: string | undefined;
+ byExtensionName?: string | undefined;
+ }
+
+ interface StringDelta {
+ current?: string | undefined;
+ previous?: string | undefined;
+ }
+
+ interface DoubleDelta {
+ current?: number | undefined;
+ previous?: number | undefined;
+ }
+
+ interface BooleanDelta {
+ current?: boolean | undefined;
+ previous?: boolean | undefined;
+ }
+
+ /**
+ * A time specified as a Date object, a number or string representing milliseconds since the epoch, or an ISO 8601 string
+ */
+ type DownloadTime = string | extensionTypes.Date;
+
+ /**
+ * Parameters that combine to specify a predicate that can be used to select a set of downloads. Used for example in search() and erase()
+ */
+ interface DownloadQuery {
+ /**
+ * This array of search terms limits results to DownloadItems whose `filename` or `url` contain all of the search terms that do not begin with a dash '-' and none of the search terms that do begin with a dash.
+ */
+ query?: string[] | undefined;
+ /** Limits results to downloads that started before the given ms since the epoch. */
+ startedBefore?: DownloadTime | undefined;
+ /** Limits results to downloads that started after the given ms since the epoch. */
+ startedAfter?: DownloadTime | undefined;
+ /** Limits results to downloads that ended before the given ms since the epoch. */
+ endedBefore?: DownloadTime | undefined;
+ /** Limits results to downloads that ended after the given ms since the epoch. */
+ endedAfter?: DownloadTime | undefined;
+ /** Limits results to downloads whose totalBytes is greater than the given integer. */
+ totalBytesGreater?: number | undefined;
+ /** Limits results to downloads whose totalBytes is less than the given integer. */
+ totalBytesLess?: number | undefined;
+ /** Limits results to DownloadItems whose `filename` matches the given regular expression. */
+ filenameRegex?: string | undefined;
+ /** Limits results to DownloadItems whose `url` matches the given regular expression. */
+ urlRegex?: string | undefined;
+ /**
+ * Setting this integer limits the number of results. Otherwise, all matching DownloadItems will be returned.
+ */
+ limit?: number | undefined;
+ /**
+ * Setting elements of this array to DownloadItem properties in order to sort the search results. For example, setting `orderBy='startTime'` sorts the DownloadItems by their start time in ascending order. To specify descending order, prefix `orderBy` with a hyphen: '-startTime'.
+ */
+ orderBy?: string[] | undefined;
+ id?: number | undefined;
+ /** Absolute URL. */
+ url?: string | undefined;
+ /** Absolute local path. */
+ filename?: string | undefined;
+ /** The cookie store ID of the contextual identity. */
+ cookieStoreId?: string | undefined;
+ /** Indication of whether this download is thought to be safe or known to be suspicious. */
+ danger?: DangerType | undefined;
+ /** The file's MIME type. */
+ mime?: string | undefined;
+ startTime?: string | undefined;
+ endTime?: string | undefined;
+ /** Indicates whether the download is progressing, interrupted, or complete. */
+ state?: State | undefined;
+ /** True if the download has stopped reading data from the host, but kept the connection open. */
+ paused?: boolean | undefined;
+ /** Why a download was interrupted. */
+ error?: InterruptReason | undefined;
+ /** Number of bytes received so far from the host, without considering file compression. */
+ bytesReceived?: number | undefined;
+ /** Number of bytes in the whole file, without considering file compression, or -1 if unknown. */
+ totalBytes?: number | undefined;
+ /** Number of bytes in the whole file post-decompression, or -1 if unknown. */
+ fileSize?: number | undefined;
+ exists?: boolean | undefined;
+ }
+
+ /** The HTTP method to use if the URL uses the HTTP[S] protocol. */
+ type _DownloadOptionsMethod = "GET" | "POST";
+
+ interface _DownloadOptionsHeaders {
+ /** Name of the HTTP header. */
+ name: string;
+ /** Value of the HTTP header. */
+ value: string;
+ }
+
+ /** What to download and how. */
+ interface _DownloadOptions {
+ /** The URL to download. */
+ url: string;
+ /** A file path relative to the Downloads directory to contain the downloaded file. */
+ filename?: string | undefined;
+ /** Whether to associate the download with a private browsing session. */
+ incognito?: boolean | undefined;
+ /** The cookie store ID of the contextual identity; requires "cookies" permission. */
+ cookieStoreId?: string | undefined;
+ conflictAction?: FilenameConflictAction | undefined;
+ /**
+ * Use a file-chooser to allow the user to select a filename. If the option is not specified, the file chooser will be shown only if the Firefox "Always ask you where to save files" option is enabled (i.e. the pref `browser.download.useDownloadDir` is set to `false`).
+ */
+ saveAs?: boolean | undefined;
+ /** The HTTP method to use if the URL uses the HTTP[S] protocol. */
+ method?: _DownloadOptionsMethod | undefined;
+ /**
+ * Extra HTTP headers to send with the request if the URL uses the HTTP[s] protocol. Each header is represented as a dictionary containing the keys `name` and either `value` or `binaryValue`, restricted to those allowed by XMLHttpRequest.
+ */
+ headers?: _DownloadOptionsHeaders[] | undefined;
+ /** Post body. */
+ body?: string | undefined;
+ /**
+ * When this flag is set to `true`, then the browser will allow downloads to proceed after encountering HTTP errors such as `404 Not Found`.
+ */
+ allowHttpErrors?: boolean | undefined;
+ }
+
+ interface _GetFileIconOptions {
+ /**
+ * The size of the icon. The returned icon will be square with dimensions size * size pixels. The default size for the icon is 32x32 pixels.
+ */
+ size?: number | undefined;
+ }
+
+ interface _OnChangedDownloadDelta {
+ /** The `id` of the DownloadItem that changed. */
+ id: number;
+ /** Describes a change in a DownloadItem's `url`. */
+ url?: StringDelta | undefined;
+ /** Describes a change in a DownloadItem's `filename`. */
+ filename?: StringDelta | undefined;
+ /** Describes a change in a DownloadItem's `danger`. */
+ danger?: StringDelta | undefined;
+ /** Describes a change in a DownloadItem's `mime`. */
+ mime?: StringDelta | undefined;
+ /** Describes a change in a DownloadItem's `startTime`. */
+ startTime?: StringDelta | undefined;
+ /** Describes a change in a DownloadItem's `endTime`. */
+ endTime?: StringDelta | undefined;
+ /** Describes a change in a DownloadItem's `state`. */
+ state?: StringDelta | undefined;
+ canResume?: BooleanDelta | undefined;
+ /** Describes a change in a DownloadItem's `paused`. */
+ paused?: BooleanDelta | undefined;
+ /** Describes a change in a DownloadItem's `error`. */
+ error?: StringDelta | undefined;
+ /** Describes a change in a DownloadItem's `totalBytes`. */
+ totalBytes?: DoubleDelta | undefined;
+ /** Describes a change in a DownloadItem's `fileSize`. */
+ fileSize?: DoubleDelta | undefined;
+ exists?: BooleanDelta | undefined;
+ }
+
+ /* downloads functions */
+ /**
+ * Download a URL. If the URL uses the HTTP[S] protocol, then the request will include all cookies currently set for its hostname. If both `filename` and `saveAs` are specified, then the Save As dialog will be displayed, pre-populated with the specified `filename`. If the download started successfully, `callback` will be called with the new DownloadItem's `downloadId`. If there was an error starting the download, then `callback` will be called with `downloadId=undefined` and browser.extension.lastError will contain a descriptive string. The error strings are not guaranteed to remain backwards compatible between releases. You must not parse it.
+ * @param options What to download and how.
+ */
+ function download(options: _DownloadOptions): Promise<number>;
+
+ /**
+ * Find DownloadItems. Set `query` to the empty object to get all DownloadItems. To get a specific DownloadItem, set only the `id` field.
+ */
+ function search(query: DownloadQuery): Promise<DownloadItem[]>;
+
+ /**
+ * Pause the download. If the request was successful the download is in a paused state. Otherwise browser.extension.lastError contains an error message. The request will fail if the download is not active.
+ * @param downloadId The id of the download to pause.
+ */
+ function pause(downloadId: number): Promise<void>;
+
+ /**
+ * Resume a paused download. If the request was successful the download is in progress and unpaused. Otherwise browser.extension.lastError contains an error message. The request will fail if the download is not active.
+ * @param downloadId The id of the download to resume.
+ */
+ function resume(downloadId: number): Promise<void>;
+
+ /**
+ * Cancel a download. When `callback` is run, the download is cancelled, completed, interrupted or doesn't exist anymore.
+ * @param downloadId The id of the download to cancel.
+ */
+ function cancel(downloadId: number): Promise<void>;
+
+ /**
+ * Retrieve an icon for the specified download. For new downloads, file icons are available after the onCreated event has been received. The image returned by this function while a download is in progress may be different from the image returned after the download is complete. Icon retrieval is done by querying the underlying operating system or toolkit depending on the platform. The icon that is returned will therefore depend on a number of factors including state of the download, platform, registered file types and visual theme. If a file icon cannot be determined, browser.extension.lastError will contain an error message.
+ * @param downloadId The identifier for the download.
+ */
+ function getFileIcon(downloadId: number, options?: _GetFileIconOptions): Promise<string>;
+
+ /** Open the downloaded file. */
+ function open(downloadId: number): Promise<void>;
+
+ /** Show the downloaded file in its folder in a file manager. */
+ function show(downloadId: number): Promise<boolean>;
+
+ function showDefaultFolder(): void;
+
+ /** Erase matching DownloadItems from history */
+ function erase(query: DownloadQuery): Promise<number[]>;
+
+ function removeFile(downloadId: number): Promise<void>;
+
+ /**
+ * Prompt the user to either accept or cancel a dangerous download. `acceptDanger()` does not automatically accept dangerous downloads.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ function acceptDanger(downloadId: number): Promise<void>;
+
+ /**
+ * Initiate dragging the file to another application.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ function drag(downloadId: number): void;
+
+ /** @deprecated Unsupported on Firefox at this time. */
+ function setShelfEnabled(enabled: boolean): void;
+
+ /* downloads events */
+ /** This event fires with the DownloadItem object when a download begins. */
+ const onCreated: WebExtEvent<(downloadItem: DownloadItem) => void>;
+
+ /**
+ * Fires with the `downloadId` when a download is erased from history.
+ * @param downloadId The `id` of the DownloadItem that was erased.
+ */
+ const onErased: WebExtEvent<(downloadId: number) => void>;
+
+ /**
+ * When any of a DownloadItem's properties except `bytesReceived` changes, this event fires with the `downloadId` and an object containing the properties that changed.
+ */
+ const onChanged: WebExtEvent<(downloadDelta: _OnChangedDownloadDelta) => void>;
+}
+
+/**
+ * The `browser.events` namespace contains common types used by APIs dispatching events to notify you when something interesting happens.
+ *
+ * Not allowed in: Content scripts, Devtools pages
+ */
+declare namespace browser.events {
+ /* events types */
+ /** Description of a declarative rule for handling events. */
+ interface Rule {
+ /** Optional identifier that allows referencing this rule. */
+ id?: string | undefined;
+ /** Tags can be used to annotate rules and perform operations on sets of rules. */
+ tags?: string[] | undefined;
+ /** List of conditions that can trigger the actions. */
+ conditions: any[];
+ /** List of actions that are triggered if one of the condtions is fulfilled. */
+ actions: any[];
+ /** Optional priority of this rule. Defaults to 100. */
+ priority?: number | undefined;
+ }
+
+ /** An object which allows the addition and removal of listeners for a Chrome event. */
+ interface Event {
+ /**
+ * Registers an event listener _callback_ to an event.
+ * @param callback Called when an event occurs. The parameters of this function depend on the type of event.
+ */
+ addListener(callback: () => void): void;
+ /**
+ * Deregisters an event listener _callback_ from an event.
+ * @param callback Listener that shall be unregistered.
+ */
+ removeListener(callback: () => void): void;
+ /**
+ * @param callback Listener whose registration status shall be tested.
+ * @returns True if _callback_ is registered to the event.
+ */
+ hasListener(callback: () => void): boolean;
+ /** @returns True if any event listeners are registered to the event. */
+ hasListeners(): boolean;
+ /**
+ * Registers rules to handle events.
+ * @param eventName Name of the event this function affects.
+ * @param webViewInstanceId If provided, this is an integer that uniquely identfies the <webview> associated with this function call.
+ * @param rules Rules to be registered. These do not replace previously registered rules.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ addRules?(eventName: string, webViewInstanceId: number, rules: Rule[]): Promise<Rule[]>;
+ /**
+ * Returns currently registered rules.
+ * @param eventName Name of the event this function affects.
+ * @param webViewInstanceId If provided, this is an integer that uniquely identfies the <webview> associated with this function call.
+ * @param [ruleIdentifiers] If an array is passed, only rules with identifiers contained in this array are returned.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ getRules?(eventName: string, webViewInstanceId: number, ruleIdentifiers?: string[]): Promise<Rule[]>;
+ /**
+ * Unregisters currently registered rules.
+ * @param eventName Name of the event this function affects.
+ * @param webViewInstanceId If provided, this is an integer that uniquely identfies the <webview> associated with this function call.
+ * @param [ruleIdentifiers] If an array is passed, only rules with identifiers contained in this array are unregistered.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ removeRules?(eventName: string, webViewInstanceId: number, ruleIdentifiers?: string[]): Promise<void>;
+ }
+
+ /** Filters URLs for various criteria. See event filtering. All criteria are case sensitive. */
+ interface UrlFilter {
+ /**
+ * Matches if the host name of the URL contains a specified string. To test whether a host name component has a prefix 'foo', use hostContains: '.foo'. This matches 'www.foobar.com' and 'foo.com', because an implicit dot is added at the beginning of the host name. Similarly, hostContains can be used to match against component suffix ('foo.') and to exactly match against components ('.foo.'). Suffix- and exact-matching for the last components need to be done separately using hostSuffix, because no implicit dot is added at the end of the host name.
+ */
+ hostContains?: string | undefined;
+ /** Matches if the host name of the URL is equal to a specified string. */
+ hostEquals?: string | undefined;
+ /** Matches if the host name of the URL starts with a specified string. */
+ hostPrefix?: string | undefined;
+ /** Matches if the host name of the URL ends with a specified string. */
+ hostSuffix?: string | undefined;
+ /** Matches if the path segment of the URL contains a specified string. */
+ pathContains?: string | undefined;
+ /** Matches if the path segment of the URL is equal to a specified string. */
+ pathEquals?: string | undefined;
+ /** Matches if the path segment of the URL starts with a specified string. */
+ pathPrefix?: string | undefined;
+ /** Matches if the path segment of the URL ends with a specified string. */
+ pathSuffix?: string | undefined;
+ /** Matches if the query segment of the URL contains a specified string. */
+ queryContains?: string | undefined;
+ /** Matches if the query segment of the URL is equal to a specified string. */
+ queryEquals?: string | undefined;
+ /** Matches if the query segment of the URL starts with a specified string. */
+ queryPrefix?: string | undefined;
+ /** Matches if the query segment of the URL ends with a specified string. */
+ querySuffix?: string | undefined;
+ /**
+ * Matches if the URL (without fragment identifier) contains a specified string. Port numbers are stripped from the URL if they match the default port number.
+ */
+ urlContains?: string | undefined;
+ /**
+ * Matches if the URL (without fragment identifier) is equal to a specified string. Port numbers are stripped from the URL if they match the default port number.
+ */
+ urlEquals?: string | undefined;
+ /**
+ * Matches if the URL (without fragment identifier) matches a specified regular expression. Port numbers are stripped from the URL if they match the default port number. The regular expressions use the [RE2 syntax](https://github.com/google/re2/blob/master/doc/syntax.txt).
+ */
+ urlMatches?: string | undefined;
+ /**
+ * Matches if the URL without query segment and fragment identifier matches a specified regular expression. Port numbers are stripped from the URL if they match the default port number. The regular expressions use the [RE2 syntax](https://github.com/google/re2/blob/master/doc/syntax.txt).
+ */
+ originAndPathMatches?: string | undefined;
+ /**
+ * Matches if the URL (without fragment identifier) starts with a specified string. Port numbers are stripped from the URL if they match the default port number.
+ */
+ urlPrefix?: string | undefined;
+ /**
+ * Matches if the URL (without fragment identifier) ends with a specified string. Port numbers are stripped from the URL if they match the default port number.
+ */
+ urlSuffix?: string | undefined;
+ /** Matches if the scheme of the URL is equal to any of the schemes specified in the array. */
+ schemes?: string[] | undefined;
+ /**
+ * Matches if the port of the URL is contained in any of the specified port lists. For example `[80, 443, [1000, 1200]]` matches all requests on port 80, 443 and in the range 1000-1200.
+ */
+ ports?: Array<number | [number, number]> | undefined;
+ }
+}
+
+/** Not allowed in: Content scripts, Devtools pages */
+declare namespace browser.experiments {
+ /* experiments types */
+ interface ExperimentAPI {
+ schema: ExperimentURL;
+ parent?: _ExperimentAPIParent | undefined;
+ child?: _ExperimentAPIChild | undefined;
+ }
+
+ type ExperimentURL = string;
+
+ type APIPaths = APIPath[];
+
+ type APIPath = string[];
+
+ type APIEvents = APIEvent[];
+
+ type APIEvent = "startup";
+
+ type APIParentScope = "addon_parent" | "content_parent" | "devtools_parent";
+
+ type APIChildScope = "addon_child" | "content_child" | "devtools_child";
+
+ interface _ExperimentAPIParent {
+ events?: APIEvents | undefined;
+ paths?: APIPaths | undefined;
+ script: ExperimentURL;
+ scopes?: APIParentScope[] | undefined;
+ }
+
+ interface _ExperimentAPIChild {
+ paths: APIPaths;
+ script: ExperimentURL;
+ scopes: APIChildScope[];
+ }
+}
+
+/**
+ * The `browser.extension` API has utilities that can be used by any extension page. It includes support for exchanging messages between an extension and its content scripts or between extensions, as described in detail in Message Passing.
+ */
+declare namespace browser.extension {
+ /* extension types */
+ /** The type of extension view. */
+ type ViewType = "tab" | "popup" | "sidebar";
+
+ /**
+ * Set for the lifetime of a callback if an ansychronous extension api has resulted in an error. If no error has occured lastError will be `undefined`.
+ * @deprecated Please use `runtime.lastError`.
+ * Not supported on manifest versions above 2.
+ */
+ interface _LastError {
+ /** Description of the error that has taken place. */
+ message: string;
+ }
+
+ interface _GetViewsFetchProperties {
+ /**
+ * The type of view to get. If omitted, returns all views (including background pages and tabs). Valid values: 'tab', 'popup', 'sidebar'.
+ */
+ type?: ViewType | undefined;
+ /** The window to restrict the search to. If omitted, returns all views. */
+ windowId?: number | undefined;
+ /** Find a view according to a tab id. If this field is omitted, returns all views. */
+ tabId?: number | undefined;
+ }
+
+ /* extension properties */
+ /**
+ * Set for the lifetime of a callback if an ansychronous extension api has resulted in an error. If no error has occured lastError will be `undefined`.
+ * @deprecated Please use `runtime.lastError`.
+ * Not supported on manifest versions above 2.
+ */
+ const lastError: _LastError | undefined;
+
+ /**
+ * True for content scripts running inside incognito tabs, and for extension pages running inside an incognito process. The latter only applies to extensions with 'split' incognito_behavior.
+ */
+ const inIncognitoContext: boolean | undefined;
+
+ /* extension functions */
+ /**
+ * Converts a relative path within an extension install directory to a fully-qualified URL.
+ * @param path A path to a resource within an extension expressed relative to its install directory.
+ * @deprecated Please use `runtime.getURL`.
+ * Not supported on manifest versions above 2.
+ * @returns The fully-qualified URL to the resource.
+ */
+ function getURL(path: string): string;
+
+ /**
+ * Returns an array of the JavaScript 'window' objects for each of the pages running inside the current extension.
+ * @returns Array of global objects
+ */
+ function getViews(fetchProperties?: _GetViewsFetchProperties): Window[];
+
+ /**
+ * Returns the JavaScript 'window' object for the background page running inside the current extension. Returns null if the extension has no background page.
+ */
+ // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
+ function getBackgroundPage(): Window | void;
+
+ /**
+ * Retrieves the state of the extension's access to Incognito-mode (as determined by the user-controlled 'Allowed in Incognito' checkbox.
+ */
+ function isAllowedIncognitoAccess(): Promise<boolean>;
+
+ /**
+ * Retrieves the state of the extension's access to the 'file://' scheme (as determined by the user-controlled 'Allow access to File URLs' checkbox.
+ */
+ function isAllowedFileSchemeAccess(): Promise<boolean>;
+
+ /**
+ * Sets the value of the ap CGI parameter used in the extension's update URL. This value is ignored for extensions that are hosted in the browser vendor's store.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ function setUpdateUrlData(data: string): void;
+
+ /* extension events */
+ /**
+ * Fired when a request is sent from either an extension process or a content script.
+ * @param request The request sent by the calling script.
+ * @param sendResponse Function to call (at most once) when you have a response. The argument should be any JSON-ifiable object, or undefined if there is no response. If you have more than one `onRequest` listener in the same document, then only one may send a response.
+ * @deprecated Please use `runtime.onMessage`.
+ */
+ const onRequest:
+ | WebExtEvent<(request: any, sender: runtime.MessageSender, sendResponse: (response?: any) => void) => void>
+ | undefined;
+
+ /**
+ * Fired when a request is sent from another extension.
+ * @param request The request sent by the calling script.
+ * @param sendResponse Function to call when you have a response. The argument should be any JSON-ifiable object, or undefined if there is no response.
+ * @deprecated Please use `runtime.onMessageExternal`.
+ */
+ const onRequestExternal:
+ | WebExtEvent<(request: any, sender: runtime.MessageSender, sendResponse: (response?: any) => void) => void>
+ | undefined;
+}
+
+/**
+ * The `browser.extensionTypes` API contains type declarations for WebExtensions.
+ *
+ * Not allowed in: Content scripts, Devtools pages
+ */
+declare namespace browser.extensionTypes {
+ /* extensionTypes types */
+ /** The format of an image. */
+ type ImageFormat = "jpeg" | "png";
+
+ /** Details about the format, quality, area and scale of the capture. */
+ interface ImageDetails {
+ /** The format of the resulting image. Default is `"jpeg"`. */
+ format?: ImageFormat | undefined;
+ /**
+ * When format is `"jpeg"`, controls the quality of the resulting image. This value is ignored for PNG images. As quality is decreased, the resulting image will have more visual artifacts, and the number of bytes needed to store it will decrease.
+ */
+ quality?: number | undefined;
+ /**
+ * The area of the document to capture, in CSS pixels, relative to the page. If omitted, capture the visible viewport.
+ */
+ rect?: _ImageDetailsRect | undefined;
+ /** The scale of the resulting image. Defaults to `devicePixelRatio`. */
+ scale?: number | undefined;
+ /**
+ * If true, temporarily resets the scroll position of the document to 0\. Only takes effect if rect is also specified.
+ */
+ resetScrollPosition?: boolean | undefined;
+ }
+
+ /** The soonest that the JavaScript or CSS will be injected into the tab. */
+ type RunAt = "document_start" | "document_end" | "document_idle";
+
+ /** The origin of the CSS to inject, this affects the cascading order (priority) of the stylesheet. */
+ type CSSOrigin = "user" | "author";
+
+ /**
+ * Details of the script or CSS to inject. Either the code or the file property must be set, but both may not be set at the same time.
+ */
+ interface InjectDetails {
+ /**
+ * JavaScript or CSS code to inject.
+ *
+ * **Warning:**
+ * Be careful using the `code` parameter. Incorrect use of it may open your extension to [cross site scripting](https://en.wikipedia.org/wiki/Cross-site_scripting) attacks.
+ */
+ code?: string | undefined;
+ /** JavaScript or CSS file to inject. */
+ file?: string | undefined;
+ /**
+ * If allFrames is `true`, implies that the JavaScript or CSS should be injected into all frames of current page. By default, it's `false` and is only injected into the top frame.
+ */
+ allFrames?: boolean | undefined;
+ /**
+ * If matchAboutBlank is true, then the code is also injected in about:blank and about:srcdoc frames if your extension has access to its parent document. Code cannot be inserted in top-level about:-frames. By default it is `false`.
+ */
+ matchAboutBlank?: boolean | undefined;
+ /** The ID of the frame to inject the script into. This may not be used in combination with `allFrames`. */
+ frameId?: number | undefined;
+ /** The soonest that the JavaScript or CSS will be injected into the tab. Defaults to "document_idle". */
+ runAt?: RunAt | undefined;
+ /** The css origin of the stylesheet to inject. Defaults to "author". */
+ cssOrigin?: CSSOrigin | undefined;
+ }
+
+ type Date = string | number | globalThis.Date;
+
+ type ExtensionFileOrCode =
+ | {
+ file: _manifest.ExtensionURL;
+ }
+ | {
+ code: string;
+ };
+
+ /** A plain JSON value */
+ type PlainJSONValue = null | string | number | boolean | _PlainJSONArray | _PlainJSONObject;
+
+ /**
+ * The area of the document to capture, in CSS pixels, relative to the page. If omitted, capture the visible viewport.
+ */
+ interface _ImageDetailsRect {
+ x: number;
+ y: number;
+ width: number;
+ height: number;
+ }
+
+ interface _PlainJSONArray extends Array<PlainJSONValue> {}
+
+ interface _PlainJSONObject {
+ [key: string]: PlainJSONValue;
+ }
+}
+
+/**
+ * Exposes the browser's profiler.
+ *
+ * Permissions: `geckoProfiler`
+ *
+ * Not allowed in: Content scripts, Devtools pages
+ */
+declare namespace browser.geckoProfiler {
+ /* geckoProfiler types */
+ type ProfilerFeature =
+ | "java"
+ | "js"
+ | "mainthreadio"
+ | "fileio"
+ | "fileioall"
+ | "noiostacks"
+ | "screenshots"
+ | "seqstyle"
+ | "stackwalk"
+ | "jsallocations"
+ | "nostacksampling"
+ | "nativeallocations"
+ | "ipcmessages"
+ | "audiocallbacktracing"
+ | "cpu"
+ | "notimerresolutionchange"
+ | "cpuallthreads"
+ | "samplingallthreads"
+ | "markersallthreads"
+ | "unregisteredthreads"
+ | "processcpu"
+ | "power"
+ | "responsiveness";
+
+ type Supports = "windowLength";
+
+ interface _StartSettings {
+ /**
+ * The maximum size in bytes of the buffer used to store profiling data. A larger value allows capturing a profile that covers a greater amount of time.
+ */
+ bufferSize: number;
+ /**
+ * The length of the window of time that's kept in the buffer. Any collected samples are discarded as soon as they are older than the number of seconds specified in this setting. Zero means no duration restriction.
+ */
+ windowLength?: number | undefined;
+ /**
+ * Interval in milliseconds between samples of profiling data. A smaller value will increase the detail of the profiles captured.
+ */
+ interval: number;
+ /** A list of active features for the profiler. */
+ features: ProfilerFeature[];
+ /** A list of thread names for which to capture profiles. */
+ threads?: string[] | undefined;
+ }
+
+ /* geckoProfiler functions */
+ /** Starts the profiler with the specified settings. */
+ function start(settings: _StartSettings): Promise<any>;
+
+ /** Stops the profiler and discards any captured profile data. */
+ function stop(): Promise<any>;
+
+ /** Pauses the profiler, keeping any profile data that is already written. */
+ function pause(): Promise<any>;
+
+ /** Resumes the profiler with the settings that were initially used to start it. */
+ function resume(): Promise<any>;
+
+ /**
+ * Gathers the profile data from the current profiling session, and writes it to disk. The returned promise resolves to a path that locates the created file.
+ * @param fileName The name of the file inside the profile/profiler directory
+ */
+ function dumpProfileToFile(fileName: string): Promise<any>;
+
+ /** Gathers the profile data from the current profiling session. */
+ function getProfile(): Promise<any>;
+
+ /**
+ * Gathers the profile data from the current profiling session. The returned promise resolves to an array buffer that contains a JSON string.
+ */
+ function getProfileAsArrayBuffer(): Promise<any>;
+
+ /**
+ * Gathers the profile data from the current profiling session. The returned promise resolves to an array buffer that contains a gzipped JSON string.
+ */
+ function getProfileAsGzippedArrayBuffer(): Promise<any>;
+
+ /**
+ * Gets the debug symbols for a particular library.
+ * @param debugName The name of the library's debug file. For example, 'xul.pdb
+ * @param breakpadId The Breakpad ID of the library
+ */
+ function getSymbols(debugName: string, breakpadId: string): Promise<any>;
+
+ /* geckoProfiler events */
+ /**
+ * Fires when the profiler starts/stops running.
+ * @param isRunning Whether the profiler is running or not. Pausing the profiler will not affect this value.
+ */
+ const onRunning: WebExtEvent<(isRunning: boolean) => void>;
+}
+
+/**
+ * Use the `browser.i18n` infrastructure to implement internationalization across your whole app or extension.
+ */
+declare namespace browser.i18n {
+ /* i18n types */
+ /**
+ * An ISO language code such as `en` or `fr`. For a complete list of languages supported by this method, see [kLanguageInfoTable](http://src.chromium.org/viewvc/chrome/trunk/src/third_party/cld/languages/internal/languages.cc). For an unknown language, `und` will be returned, which means that [percentage] of the text is unknown to CLD
+ */
+ type LanguageCode = string;
+
+ /** DetectedLanguage object that holds detected ISO language code and its percentage in the input string */
+ interface _DetectLanguageReturnResultLanguages {
+ language: LanguageCode;
+ /** The percentage of the detected language */
+ percentage: number;
+ }
+
+ /**
+ * LanguageDetectionResult object that holds detected langugae reliability and array of DetectedLanguage
+ */
+ interface _DetectLanguageReturnResult {
+ /** CLD detected language reliability */
+ isReliable: boolean;
+ /** array of detectedLanguage */
+ languages: _DetectLanguageReturnResultLanguages[];
+ }
+
+ /* i18n functions */
+ /**
+ * Gets the accept-languages of the browser. This is different from the locale used by the browser; to get the locale, use `i18n.getUILanguage`.
+ */
+ function getAcceptLanguages(): Promise<LanguageCode[]>;
+
+ /**
+ * Gets the localized string for the specified message. If the message is missing, this method returns an empty string (''). If the format of the `getMessage()` call is wrong — for example, _messageName_ is not a string or the _substitutions_ array has more than 9 elements — this method returns `undefined`.
+ * @param messageName The name of the message, as specified in the `messages.json` file.
+ * @param [substitutions] Substitution strings, if the message requires any.
+ * @returns Message localized for current locale.
+ */
+ function getMessage(messageName: string, substitutions?: any): string;
+
+ /**
+ * Gets the browser UI language of the browser. This is different from `i18n.getAcceptLanguages` which returns the preferred user languages.
+ * @returns The browser UI language code such as en-US or fr-FR.
+ */
+ function getUILanguage(): string;
+
+ /**
+ * Detects the language of the provided text using CLD.
+ * @param text User input string to be translated.
+ */
+ function detectLanguage(text: string): Promise<_DetectLanguageReturnResult>;
+}
+
+/**
+ * Use the browser.identity API to get OAuth2 access tokens.
+ *
+ * Permissions: `identity`
+ *
+ * Not allowed in: Content scripts, Devtools pages
+ */
+declare namespace browser.identity {
+ /* identity types */
+ /** An object encapsulating an OAuth account id. */
+ interface AccountInfo {
+ /** A unique identifier for the account. This ID will not change for the lifetime of the account. */
+ id: string;
+ }
+
+ interface _GetAuthTokenDetails {
+ interactive?: boolean | undefined;
+ account?: AccountInfo | undefined;
+ scopes?: string[] | undefined;
+ }
+
+ interface _GetProfileUserInfoReturnUserinfo {
+ email: string;
+ id: string;
+ }
+
+ interface _RemoveCachedAuthTokenReturnUserinfo {
+ email: string;
+ id: string;
+ }
+
+ interface _RemoveCachedAuthTokenDetails {
+ token: string;
+ }
+
+ interface _LaunchWebAuthFlowDetails {
+ url: _manifest.HttpURL;
+ interactive?: boolean | undefined;
+ }
+
+ /* identity functions */
+ /**
+ * Retrieves a list of AccountInfo objects describing the accounts present on the profile.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ function getAccounts(): Promise<AccountInfo[]>;
+
+ /**
+ * Gets an OAuth2 access token using the client ID and scopes specified in the oauth2 section of manifest.json.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ function getAuthToken(details?: _GetAuthTokenDetails): Promise<string>;
+
+ /**
+ * Retrieves email address and obfuscated gaia id of the user signed into a profile.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ function getProfileUserInfo(): Promise<_GetProfileUserInfoReturnUserinfo>;
+
+ /**
+ * Removes an OAuth2 access token from the Identity API's token cache.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ function removeCachedAuthToken(
+ details: _RemoveCachedAuthTokenDetails,
+ ): Promise<_RemoveCachedAuthTokenReturnUserinfo>;
+
+ /** Starts an auth flow at the specified URL. */
+ function launchWebAuthFlow(details: _LaunchWebAuthFlowDetails): Promise<string>;
+
+ /**
+ * Generates a redirect URL to be used in |launchWebAuthFlow|.
+ * @param [path] The path appended to the end of the generated URL.
+ */
+ function getRedirectURL(path?: string): string;
+
+ /* identity events */
+ /**
+ * Fired when signin state changes for an account on the user's profile.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ const onSignInChanged: WebExtEvent<(account: AccountInfo, signedIn: boolean) => void> | undefined;
+}
+
+/**
+ * Use the `browser.idle` API to detect when the machine's idle state changes.
+ *
+ * Permissions: `idle`
+ *
+ * Not allowed in: Content scripts, Devtools pages
+ */
+declare namespace browser.idle {
+ /* idle types */
+ type IdleState = "active" | "idle";
+
+ /* idle functions */
+ /**
+ * Returns "idle" if the user has not generated any input for a specified number of seconds, or "active" otherwise.
+ * @param detectionIntervalInSeconds The system is considered idle if detectionIntervalInSeconds seconds have elapsed since the last user input detected.
+ */
+ function queryState(detectionIntervalInSeconds: number): Promise<IdleState>;
+
+ /**
+ * Sets the interval, in seconds, used to determine when the system is in an idle state for onStateChanged events. The default interval is 60 seconds.
+ * @param intervalInSeconds Threshold, in seconds, used to determine when the system is in an idle state.
+ */
+ function setDetectionInterval(intervalInSeconds: number): void;
+
+ /* idle events */
+ /**
+ * Fired when the system changes to an active or idle state. The event fires with "idle" if the the user has not generated any input for a specified number of seconds, and "active" when the user generates input on an idle system.
+ */
+ const onStateChanged: WebExtEvent<(newState: IdleState) => void>;
+}
+
+/**
+ * The `browser.management` API provides ways to manage the list of extensions that are installed and running.
+ *
+ * Not allowed in: Content scripts, Devtools pages
+ */
+declare namespace browser.management {
+ /* management types */
+ /** Information about an icon belonging to an extension. */
+ interface IconInfo {
+ /**
+ * A number representing the width and height of the icon. Likely values include (but are not limited to) 128, 48, 24, and 16.
+ */
+ size: number;
+ /**
+ * The URL for this icon image. To display a grayscale version of the icon (to indicate that an extension is disabled, for example), append `?grayscale=true` to the URL.
+ */
+ url: string;
+ }
+
+ /** A reason the item is disabled. */
+ type ExtensionDisabledReason = "unknown" | "permissions_increase";
+
+ /** The type of this extension, 'extension' or 'theme'. */
+ type ExtensionType = "extension" | "theme";
+
+ /**
+ * How the extension was installed. One of
+ * `development`: The extension was loaded unpacked in developer mode,
+ * `normal`: The extension was installed normally via an .xpi file,
+ * `sideload`: The extension was installed by other software on the machine,
+ * `other`: The extension was installed by other means.
+ */
+ type ExtensionInstallType = "development" | "normal" | "sideload" | "other";
+
+ /** Information about an installed extension. */
+ interface ExtensionInfo {
+ /** The extension's unique identifier. */
+ id: string;
+ /** The name of this extension. */
+ name: string;
+ /** A short version of the name of this extension. */
+ shortName?: string | undefined;
+ /** The description of this extension. */
+ description: string;
+ /** The version of this extension. */
+ version: string;
+ /** The version name of this extension if the manifest specified one. */
+ versionName?: string | undefined;
+ /** Whether this extension can be disabled or uninstalled by the user. */
+ mayDisable: boolean;
+ /** Whether it is currently enabled or disabled. */
+ enabled: boolean;
+ /** A reason the item is disabled. */
+ disabledReason?: ExtensionDisabledReason | undefined;
+ /** The type of this extension, 'extension' or 'theme'. */
+ type: ExtensionType;
+ /** The URL of the homepage of this extension. */
+ homepageUrl?: string | undefined;
+ /** The update URL of this extension. */
+ updateUrl?: string | undefined;
+ /** The url for the item's options page, if it has one. */
+ optionsUrl: string;
+ /**
+ * A list of icon information. Note that this just reflects what was declared in the manifest, and the actual image at that url may be larger or smaller than what was declared, so you might consider using explicit width and height attributes on img tags referencing these images. See the manifest documentation on icons for more details.
+ */
+ icons?: IconInfo[] | undefined;
+ /** Returns a list of API based permissions. */
+ permissions?: string[] | undefined;
+ /** Returns a list of host based permissions. */
+ hostPermissions?: string[] | undefined;
+ /** How the extension was installed. */
+ installType: ExtensionInstallType;
+ }
+
+ interface _InstallReturnResult {
+ id: _manifest.ExtensionID;
+ }
+
+ interface _InstallOptions {
+ /** URL pointing to the XPI file on addons.mozilla.org or similar. */
+ url: _manifest.HttpURL;
+ /** A hash of the XPI file, using sha256 or stronger. */
+ hash?: string | undefined;
+ }
+
+ interface _UninstallSelfOptions {
+ /** Whether or not a confirm-uninstall dialog should prompt the user. Defaults to false. */
+ showConfirmDialog?: boolean | undefined;
+ /** The message to display to a user when being asked to confirm removal of the extension. */
+ dialogMessage?: string | undefined;
+ }
+
+ /* management functions */
+ /** Returns a list of information about installed extensions. */
+ function getAll(): Promise<ExtensionInfo[]>;
+
+ /**
+ * Returns information about the installed extension that has the given ID.
+ * @param id The ID from an item of `management.ExtensionInfo`.
+ */
+ function get(id: _manifest.ExtensionID): Promise<ExtensionInfo>;
+
+ /** Installs and enables a theme extension from the given url. */
+ function install(options: _InstallOptions): Promise<_InstallReturnResult>;
+
+ /**
+ * Returns information about the calling extension. Note: This function can be used without requesting the 'management' permission in the manifest.
+ */
+ function getSelf(): Promise<ExtensionInfo>;
+
+ /**
+ * Uninstalls the calling extension. Note: This function can be used without requesting the 'management' permission in the manifest.
+ */
+ function uninstallSelf(options?: _UninstallSelfOptions): Promise<void>;
+
+ /**
+ * Enables or disables the given add-on.
+ * @param id ID of the add-on to enable/disable.
+ * @param enabled Whether to enable or disable the add-on.
+ */
+ function setEnabled(id: string, enabled: boolean): Promise<void>;
+
+ /* management events */
+ /** Fired when an addon has been disabled. */
+ const onDisabled: WebExtEvent<(info: ExtensionInfo) => void>;
+
+ /** Fired when an addon has been enabled. */
+ const onEnabled: WebExtEvent<(info: ExtensionInfo) => void>;
+
+ /** Fired when an addon has been installed. */
+ const onInstalled: WebExtEvent<(info: ExtensionInfo) => void>;
+
+ /** Fired when an addon has been uninstalled. */
+ const onUninstalled: WebExtEvent<(info: ExtensionInfo) => void>;
+}
+
+/**
+ * This API provides the ability to determine the status of and detect changes in the network connection. This API can only be used in privileged extensions.
+ *
+ * Permissions: `networkStatus`
+ *
+ * Not allowed in: Content scripts, Devtools pages
+ */
+declare namespace browser.networkStatus {
+ /* networkStatus types */
+ interface NetworkLinkInfo {
+ /** Status of the network link, if "unknown" then link is usually assumed to be "up" */
+ status: _NetworkLinkInfoStatus;
+ /** If known, the type of network connection that is avialable. */
+ type: _NetworkLinkInfoType;
+ /** If known, the network id or name. */
+ id?: string | undefined;
+ }
+
+ /** Status of the network link, if "unknown" then link is usually assumed to be "up" */
+ type _NetworkLinkInfoStatus = "unknown" | "up" | "down";
+
+ /** If known, the type of network connection that is avialable. */
+ type _NetworkLinkInfoType = "unknown" | "ethernet" | "usb" | "wifi" | "wimax" | "mobile";
+
+ /* networkStatus functions */
+ /** Returns the $(ref:NetworkLinkInfo} of the current network connection. */
+ function getLinkInfo(): Promise<NetworkLinkInfo>;
+
+ /* networkStatus events */
+ /** Fired when the network connection state changes. */
+ const onConnectionChanged: WebExtEvent<(details: NetworkLinkInfo) => void>;
+}
+
+/**
+ * Permissions: `notifications`
+ *
+ * Not allowed in: Content scripts, Devtools pages
+ */
+declare namespace browser.notifications {
+ /* notifications types */
+ type TemplateType = "basic" | "image" | "list" | "progress";
+
+ type PermissionLevel = "granted" | "denied";
+
+ interface NotificationItem {
+ /** Title of one item of a list notification. */
+ title: string;
+ /** Additional details about this item. */
+ message: string;
+ }
+
+ interface CreateNotificationOptions {
+ /** Which type of notification to display. */
+ type: TemplateType;
+ /** A URL to the sender's avatar, app icon, or a thumbnail for image notifications. */
+ iconUrl?: string | undefined;
+ /** A URL to the app icon mask. */
+ appIconMaskUrl?: string | undefined;
+ /** Title of the notification (e.g. sender name for email). */
+ title: string;
+ /** Main notification content. */
+ message: string;
+ /** Alternate notification content with a lower-weight font. */
+ contextMessage?: string | undefined;
+ /** Priority ranges from -2 to 2\. -2 is lowest priority. 2 is highest. Zero is default. */
+ priority?: number | undefined;
+ /** A timestamp associated with the notification, in milliseconds past the epoch. */
+ eventTime?: number | undefined;
+ /**
+ * Text and icons for up to two notification action buttons.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ buttons?: _CreateNotificationOptionsButtons[] | undefined;
+ /** A URL to the image thumbnail for image-type notifications. */
+ imageUrl?: string | undefined;
+ /** Items for multi-item notifications. */
+ items?: NotificationItem[] | undefined;
+ /** Current progress ranges from 0 to 100. */
+ progress?: number | undefined;
+ /**
+ * Whether to show UI indicating that the app will visibly respond to clicks on the body of a notification.
+ */
+ isClickable?: boolean | undefined;
+ }
+
+ interface UpdateNotificationOptions {
+ /** Which type of notification to display. */
+ type?: TemplateType | undefined;
+ /** A URL to the sender's avatar, app icon, or a thumbnail for image notifications. */
+ iconUrl?: string | undefined;
+ /** A URL to the app icon mask. */
+ appIconMaskUrl?: string | undefined;
+ /** Title of the notification (e.g. sender name for email). */
+ title?: string | undefined;
+ /** Main notification content. */
+ message?: string | undefined;
+ /** Alternate notification content with a lower-weight font. */
+ contextMessage?: string | undefined;
+ /** Priority ranges from -2 to 2\. -2 is lowest priority. 2 is highest. Zero is default. */
+ priority?: number | undefined;
+ /** A timestamp associated with the notification, in milliseconds past the epoch. */
+ eventTime?: number | undefined;
+ /**
+ * Text and icons for up to two notification action buttons.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ buttons?: _UpdateNotificationOptionsButtons[] | undefined;
+ /** A URL to the image thumbnail for image-type notifications. */
+ imageUrl?: string | undefined;
+ /** Items for multi-item notifications. */
+ items?: NotificationItem[] | undefined;
+ /** Current progress ranges from 0 to 100. */
+ progress?: number | undefined;
+ /**
+ * Whether to show UI indicating that the app will visibly respond to clicks on the body of a notification.
+ */
+ isClickable?: boolean | undefined;
+ }
+
+ interface _CreateNotificationOptionsButtons {
+ title: string;
+ iconUrl?: string | undefined;
+ }
+
+ interface _UpdateNotificationOptionsButtons {
+ title: string;
+ iconUrl?: string | undefined;
+ }
+
+ /* notifications functions */
+ /**
+ * Creates and displays a notification.
+ * @param options Contents of the notification.
+ */
+ function create(options: CreateNotificationOptions): Promise<string>;
+ /**
+ * Creates and displays a notification.
+ * @param notificationId Identifier of the notification. If it is empty, this method generates an id. If it matches an existing notification, this method first clears that notification before proceeding with the create operation.
+ * @param options Contents of the notification.
+ */
+ function create(notificationId: string, options: CreateNotificationOptions): Promise<string>;
+
+ /**
+ * Updates an existing notification.
+ * @param notificationId The id of the notification to be updated.
+ * @param options Contents of the notification to update to.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ function update(notificationId: string, options: UpdateNotificationOptions): Promise<boolean>;
+
+ /**
+ * Clears an existing notification.
+ * @param notificationId The id of the notification to be updated.
+ */
+ function clear(notificationId: string): Promise<boolean>;
+
+ /** Retrieves all the notifications. */
+ function getAll(): Promise<{ [key: string]: CreateNotificationOptions }>;
+
+ /**
+ * Retrieves whether the user has enabled notifications from this app or extension.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ function getPermissionLevel(): Promise<PermissionLevel>;
+
+ /* notifications events */
+ /**
+ * Fired when the notification closed, either by the system or by user action.
+ * @param notificationId The notificationId of the closed notification.
+ * @param byUser True if the notification was closed by the user.
+ */
+ const onClosed: WebExtEvent<(notificationId: string, byUser: boolean) => void>;
+
+ /**
+ * Fired when the user clicked in a non-button area of the notification.
+ * @param notificationId The notificationId of the clicked notification.
+ */
+ const onClicked: WebExtEvent<(notificationId: string) => void>;
+
+ /**
+ * Fired when the user pressed a button in the notification.
+ * @param notificationId The notificationId of the clicked notification.
+ * @param buttonIndex The index of the button clicked by the user.
+ */
+ const onButtonClicked: WebExtEvent<(notificationId: string, buttonIndex: number) => void>;
+
+ /**
+ * Fired when the user changes the permission level.
+ * @param level The new permission level.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ const onPermissionLevelChanged: WebExtEvent<(level: PermissionLevel) => void> | undefined;
+
+ /**
+ * Fired when the user clicked on a link for the app's notification settings.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ const onShowSettings: WebExtEvent<() => void> | undefined;
+
+ /**
+ * Fired when the notification is shown.
+ * @param notificationId The notificationId of the shown notification.
+ */
+ const onShown: WebExtEvent<(notificationId: string) => void>;
+}
+
+/**
+ * Use the `browser.pageAction` API to put icons inside the address bar. Page actions represent actions that can be taken on the current page, but that aren't applicable to all pages.
+ *
+ * Manifest keys: `page_action`
+ *
+ * Not allowed in: Content scripts, Devtools pages
+ */
+declare namespace browser.pageAction {
+ /* pageAction types */
+ /** Pixel data for an image. Must be an ImageData object (for example, from a `canvas` element). */
+ type ImageDataType = ImageData;
+
+ /** Information sent when a page action is clicked. */
+ interface OnClickData {
+ /** An array of keyboard modifiers that were held while the menu item was clicked. */
+ modifiers: _OnClickDataModifiers[];
+ /** An integer value of button by which menu item was clicked. */
+ button?: number | undefined;
+ }
+
+ type _OnClickDataModifiers = "Shift" | "Alt" | "Command" | "Ctrl" | "MacCtrl";
+
+ interface _IsShownDetails {
+ /** Specify the tab to get the shownness from. */
+ tabId: number;
+ }
+
+ interface _SetTitleDetails {
+ /** The id of the tab for which you want to modify the page action. */
+ tabId: number;
+ /** The tooltip string. */
+ title: string | null;
+ }
+
+ interface _GetTitleDetails {
+ /** Specify the tab to get the title from. */
+ tabId: number;
+ }
+
+ interface _SetIconDetails {
+ /** The id of the tab for which you want to modify the page action. */
+ tabId: number;
+ /**
+ * Either an ImageData object or a dictionary {size -> ImageData} representing icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals `scale`, then image with size `scale` * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.imageData = foo' is equivalent to 'details.imageData = {'19': foo}'
+ */
+ imageData?:
+ | ImageDataType
+ | {
+ [key: number]: ImageDataType;
+ }
+ | undefined;
+ /**
+ * Either a relative image path or a dictionary {size -> relative image path} pointing to icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals `scale`, then image with size `scale` * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.path = foo' is equivalent to 'details.imageData = {'19': foo}'
+ */
+ path?:
+ | string
+ | {
+ [key: number]: string;
+ }
+ | undefined;
+ }
+
+ interface _SetPopupDetails {
+ /** The id of the tab for which you want to modify the page action. */
+ tabId: number;
+ /** The html file to show in a popup. If set to the empty string (''), no popup is shown. */
+ popup: string | null;
+ }
+
+ interface _GetPopupDetails {
+ /** Specify the tab to get the popup from. */
+ tabId: number;
+ }
+
+ /* pageAction functions */
+ /**
+ * Shows the page action. The page action is shown whenever the tab is selected.
+ * @param tabId The id of the tab for which you want to modify the page action.
+ */
+ function show(tabId: number): Promise<void>;
+
+ /**
+ * Hides the page action.
+ * @param tabId The id of the tab for which you want to modify the page action.
+ */
+ function hide(tabId: number): Promise<void>;
+
+ /** Checks whether the page action is shown. */
+ function isShown(details: _IsShownDetails): Promise<boolean>;
+
+ /** Sets the title of the page action. This is displayed in a tooltip over the page action. */
+ function setTitle(details: _SetTitleDetails): void;
+
+ /** Gets the title of the page action. */
+ function getTitle(details: _GetTitleDetails): Promise<string>;
+
+ /**
+ * Sets the icon for the page action. The icon can be specified either as the path to an image file or as the pixel data from a canvas element, or as dictionary of either one of those. Either the **path** or the **imageData** property must be specified.
+ */
+ function setIcon(details: _SetIconDetails): Promise<void>;
+
+ /** Sets the html document to be opened as a popup when the user clicks on the page action's icon. */
+ function setPopup(details: _SetPopupDetails): void;
+
+ /** Gets the html document set as the popup for this page action. */
+ function getPopup(details: _GetPopupDetails): Promise<string>;
+
+ /** Opens the extension page action in the active window. */
+ function openPopup(): Promise<void>;
+
+ /* pageAction events */
+ /** Fired when a page action icon is clicked. This event will not fire if the page action has a popup. */
+ const onClicked: WebExtEvent<(tab: tabs.Tab, info?: OnClickData) => void>;
+}
+
+/** Not allowed in: Content scripts, Devtools pages */
+declare namespace browser.permissions {
+ /* permissions types */
+ interface Permissions {
+ permissions?: _manifest.OptionalPermission[] | undefined;
+ origins?: _manifest.MatchPattern[] | undefined;
+ }
+
+ interface AnyPermissions {
+ permissions?: _manifest.Permission[] | undefined;
+ origins?: _manifest.MatchPattern[] | undefined;
+ }
+
+ /* permissions functions */
+ /** Get a list of all the extension's permissions. */
+ function getAll(): Promise<AnyPermissions>;
+
+ /** Check if the extension has the given permissions. */
+ function contains(permissions: AnyPermissions): Promise<boolean>;
+
+ /**
+ * Request the given permissions.
+ *
+ * Not allowed in: Devtools pages
+ */
+ function request(permissions: Permissions): Promise<boolean>;
+
+ /** Relinquish the given permissions. */
+ function remove(permissions: Permissions): Promise<boolean>;
+
+ /* permissions events */
+ /** Fired when the extension acquires new permissions. */
+ const onAdded: WebExtEvent<(permissions: Permissions) => void>;
+
+ /** Fired when permissions are removed from the extension. */
+ const onRemoved: WebExtEvent<(permissions: Permissions) => void>;
+}
+
+/**
+ * Permissions: `privacy`
+ *
+ * Not allowed in: Content scripts, Devtools pages
+ */
+declare namespace browser.privacy {}
+
+/**
+ * Use the `browser.privacy` API to control usage of the features in the browser that can affect a user's privacy.
+ *
+ * Permissions: `privacy`
+ *
+ * Not allowed in: Content scripts, Devtools pages
+ */
+declare namespace browser.privacy.network {
+ /* privacy.network types */
+ /** The IP handling policy of WebRTC. */
+ type IPHandlingPolicy =
+ | "default"
+ | "default_public_and_private_interfaces"
+ | "default_public_interface_only"
+ | "disable_non_proxied_udp"
+ | "proxy_only";
+
+ /** An object which describes TLS minimum and maximum versions. */
+ interface tlsVersionRestrictionConfig {
+ /** The minimum TLS version supported. */
+ minimum?: _TlsVersionRestrictionConfigMinimum | undefined;
+ /** The maximum TLS version supported. */
+ maximum?: _TlsVersionRestrictionConfigMaximum | undefined;
+ }
+
+ /** The mode for https-only mode. */
+ type HTTPSOnlyModeOption = "always" | "private_browsing" | "never";
+
+ /** The minimum TLS version supported. */
+ type _TlsVersionRestrictionConfigMinimum = "TLSv1" | "TLSv1.1" | "TLSv1.2" | "TLSv1.3" | "unknown";
+
+ /** The maximum TLS version supported. */
+ type _TlsVersionRestrictionConfigMaximum = "TLSv1" | "TLSv1.1" | "TLSv1.2" | "TLSv1.3" | "unknown";
+
+ /* privacy.network properties */
+ /**
+ * If enabled, the browser attempts to speed up your web browsing experience by pre-resolving DNS entries, prerendering sites (`<link rel='prefetch' ...>`), and preemptively opening TCP and SSL connections to servers. This preference's value is a boolean, defaulting to `true`.
+ */
+ const networkPredictionEnabled: types.Setting;
+
+ /** Allow users to enable and disable RTCPeerConnections (aka WebRTC). */
+ const peerConnectionEnabled: types.Setting;
+
+ /**
+ * Allow users to specify the media performance/privacy tradeoffs which impacts how WebRTC traffic will be routed and how much local address information is exposed. This preference's value is of type IPHandlingPolicy, defaulting to `default`.
+ */
+ const webRTCIPHandlingPolicy: types.Setting;
+
+ /**
+ * This property controls the minimum and maximum TLS versions. This setting's value is an object of `tlsVersionRestrictionConfig`.
+ */
+ const tlsVersionRestriction: types.Setting;
+
+ /**
+ * Allow users to query the mode for 'HTTPS-Only Mode'. This setting's value is of type HTTPSOnlyModeOption, defaulting to `never`.
+ */
+ const httpsOnlyMode: types.Setting;
+
+ /**
+ * Allow users to query the status of 'Global Privacy Control'. This setting's value is of type boolean, defaulting to `false`.
+ */
+ const globalPrivacyControl: types.Setting;
+}
+
+/**
+ * Use the `browser.privacy` API to control usage of the features in the browser that can affect a user's privacy.
+ *
+ * Permissions: `privacy`
+ *
+ * Not allowed in: Content scripts, Devtools pages
+ */
+declare namespace browser.privacy.services {
+ /* privacy.services properties */
+ /**
+ * If enabled, the password manager will ask if you want to save passwords. This preference's value is a boolean, defaulting to `true`.
+ */
+ const passwordSavingEnabled: types.Setting;
+}
+
+/**
+ * Use the `browser.privacy` API to control usage of the features in the browser that can affect a user's privacy.
+ *
+ * Permissions: `privacy`
+ *
+ * Not allowed in: Content scripts, Devtools pages
+ */
+declare namespace browser.privacy.websites {
+ /* privacy.websites types */
+ /** The mode for tracking protection. */
+ type TrackingProtectionModeOption = "always" | "never" | "private_browsing";
+
+ /** The settings for cookies. */
+ interface CookieConfig {
+ /** The type of cookies to allow. */
+ behavior?: _CookieConfigBehavior | undefined;
+ /**
+ * Whether to create all cookies as nonPersistent (i.e., session) cookies.
+ * @deprecated This property has no effect anymore and its value is always `false`.``
+ */
+ nonPersistentCookies?: boolean | undefined;
+ }
+
+ /** The type of cookies to allow. */
+ type _CookieConfigBehavior =
+ | "allow_all"
+ | "reject_all"
+ | "reject_third_party"
+ | "allow_visited"
+ | "reject_trackers"
+ | "reject_trackers_and_partition_foreign";
+
+ /* privacy.websites properties */
+ /**
+ * If disabled, the browser blocks third-party sites from setting cookies. The value of this preference is of type boolean, and the default value is `true`.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ const thirdPartyCookiesAllowed: types.Setting | undefined;
+
+ /**
+ * If enabled, the browser sends auditing pings when requested by a website (`<a ping>`). The value of this preference is of type boolean, and the default value is `true`.
+ */
+ const hyperlinkAuditingEnabled: types.Setting;
+
+ /**
+ * If enabled, the browser sends `referer` headers with your requests. Yes, the name of this preference doesn't match the misspelled header. No, we're not going to change it. The value of this preference is of type boolean, and the default value is `true`.
+ */
+ const referrersEnabled: types.Setting;
+
+ /**
+ * If enabled, the browser attempts to appear similar to other users by reporting generic information to websites. This can prevent websites from uniquely identifying users. Examples of data that is spoofed include number of CPU cores, precision of JavaScript timers, the local timezone, and disabling features such as GamePad support, and the WebSpeech and Navigator APIs. The value of this preference is of type boolean, and the default value is `false`.
+ */
+ const resistFingerprinting: types.Setting;
+
+ /**
+ * If enabled, the browser will associate all data (including cookies, HSTS data, cached images, and more) for any third party domains with the domain in the address bar. This prevents third party trackers from using directly stored information to identify you across different websites, but may break websites where you login with a third party account (such as a Facebook or Google login.) The value of this preference is of type boolean, and the default value is `false`.
+ */
+ const firstPartyIsolate: types.Setting;
+
+ /**
+ * **Available on Windows and ChromeOS only**: If enabled, the browser provides a unique ID to plugins in order to run protected content. The value of this preference is of type boolean, and the default value is `true`.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ const protectedContentEnabled: types.Setting | undefined;
+
+ /**
+ * Allow users to specify the mode for tracking protection. This setting's value is of type TrackingProtectionModeOption, defaulting to `private_browsing_only`.
+ */
+ const trackingProtectionMode: types.Setting;
+
+ /**
+ * Allow users to specify the default settings for allowing cookies, as well as whether all cookies should be created as non-persistent cookies. This setting's value is of type CookieConfig.
+ */
+ const cookieConfig: types.Setting;
+}
+
+/**
+ * Provides access to global proxy settings for Firefox and proxy event listeners to handle dynamic proxy implementations.
+ *
+ * Permissions: `proxy`
+ *
+ * Not allowed in: Content scripts, Devtools pages
+ */
+declare namespace browser.proxy {
+ /* proxy types */
+ /** An object which describes proxy settings. */
+ interface ProxyConfig {
+ /** The type of proxy to use. */
+ proxyType?: _ProxyConfigProxyType | undefined;
+ /** The address of the http proxy, can include a port. */
+ http?: string | undefined;
+ /** Use the http proxy server for all protocols. */
+ httpProxyAll?: boolean | undefined;
+ /**
+ * The address of the ftp proxy, can include a port. Deprecated since Firefox 88.
+ * @deprecated The address of the ftp proxy, can include a port. Deprecated since Firefox 88.
+ */
+ ftp?: string | undefined;
+ /** The address of the ssl proxy, can include a port. */
+ ssl?: string | undefined;
+ /** The address of the socks proxy, can include a port. */
+ socks?: string | undefined;
+ /** The version of the socks proxy. */
+ socksVersion?: number | undefined;
+ /** A list of hosts which should not be proxied. */
+ passthrough?: string | undefined;
+ /** A URL to use to configure the proxy. */
+ autoConfigUrl?: string | undefined;
+ /** Do not prompt for authentication if password is saved. */
+ autoLogin?: boolean | undefined;
+ /** Proxy DNS when using SOCKS v5. */
+ proxyDNS?: boolean | undefined;
+ /**
+ * If true (the default value), do not use newer TLS protocol features that might have interoperability problems on the Internet. This is intended only for use with critical infrastructure like the updates, and is only available to privileged addons.
+ */
+ respectBeConservative?: boolean | undefined;
+ }
+
+ /** The type of proxy to use. */
+ type _ProxyConfigProxyType = "none" | "autoDetect" | "system" | "manual" | "autoConfig";
+
+ interface _OnRequestDetails {
+ /**
+ * The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request.
+ */
+ requestId: string;
+ url: string;
+ /** Standard HTTP method. */
+ method: string;
+ /**
+ * The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (`type` is `main_frame` or `sub_frame`), `frameId` indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab.
+ */
+ frameId: number;
+ /** ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists. */
+ parentFrameId: number;
+ /** True for private browsing requests. */
+ incognito?: boolean | undefined;
+ /** The cookie store ID of the contextual identity. */
+ cookieStoreId?: string | undefined;
+ /** URL of the resource that triggered this request. */
+ originUrl?: string | undefined;
+ /** URL of the page into which the requested resource will be loaded. */
+ documentUrl?: string | undefined;
+ /** The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab. */
+ tabId: number;
+ /** How the requested resource will be used. */
+ type: webRequest.ResourceType;
+ /** The time when this signal is triggered, in milliseconds since the epoch. */
+ timeStamp: number;
+ /** Indicates if this response was fetched from disk cache. */
+ fromCache: boolean;
+ /** The HTTP request headers that are going to be sent out with this request. */
+ requestHeaders?: webRequest.HttpHeaders | undefined;
+ /** Url classification if the request has been classified. */
+ urlClassification: webRequest.UrlClassification;
+ /** Indicates if this request and its content window hierarchy is third party. */
+ thirdParty: boolean;
+ }
+
+ interface _ProxyOnRequestEvent<TCallback = (details: _OnRequestDetails) => void> {
+ addListener(cb: TCallback, filter: webRequest.RequestFilter, extraInfoSpec?: Array<"requestHeaders">): void;
+ removeListener(cb: TCallback): void;
+ hasListener(cb: TCallback): boolean;
+ }
+
+ /* proxy properties */
+ /** Configures proxy settings. This setting's value is an object of type ProxyConfig. */
+ const settings: types.Setting;
+
+ /* proxy events */
+ /** Fired when proxy data is needed for a request. */
+ const onRequest: _ProxyOnRequestEvent;
+
+ /** Notifies about errors caused by the invalid use of the proxy API. */
+ const onError: WebExtEvent<(error: Error) => void>;
+}
+
+/**
+ * Use the `browser.runtime` API to retrieve the background page, return details about the manifest, and listen for and respond to events in the app or extension lifecycle. You can also use this API to convert the relative path of URLs to fully-qualified URLs.
+ */
+declare namespace browser.runtime {
+ /* runtime types */
+ /** An object which allows two way communication with other pages. */
+ interface Port {
+ name: string;
+ disconnect: () => void;
+ postMessage: (message: object) => void;
+ /** This property will **only** be present on ports passed to onConnect/onConnectExternal listeners. */
+ sender?: MessageSender | undefined;
+ error?: Error | undefined;
+ onMessage: WebExtEvent<(response: object) => void>;
+ onDisconnect: WebExtEvent<(port: Port) => void>;
+ }
+
+ /** An object containing information about the script context that sent a message or request. */
+ interface MessageSender {
+ /**
+ * The `tabs.Tab` which opened the connection, if any. This property will **only** be present when the connection was opened from a tab (including content scripts), and **only** if the receiver is an extension, not an app.
+ */
+ tab?: tabs.Tab | undefined;
+ /**
+ * The frame that opened the connection. 0 for top-level frames, positive for child frames. This will only be set when `tab` is set.
+ */
+ frameId?: number | undefined;
+ /** The ID of the extension or app that opened the connection, if any. */
+ id?: string | undefined;
+ /**
+ * The URL of the page or frame that opened the connection. If the sender is in an iframe, it will be iframe's URL not the URL of the page which hosts it.
+ */
+ url?: string | undefined;
+ /**
+ * The TLS channel ID of the page or frame that opened the connection, if requested by the extension or app, and if available.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ tlsChannelId?: string | undefined;
+ }
+
+ /** The operating system the browser is running on. */
+ type PlatformOs = "mac" | "win" | "android" | "cros" | "linux" | "openbsd";
+
+ /** The machine's processor architecture. */
+ type PlatformArch = "aarch64" | "arm" | "ppc64" | "s390x" | "sparc64" | "x86-32" | "x86-64" | "noarch";
+
+ /** An object containing information about the current platform. */
+ interface PlatformInfo {
+ /** The operating system the browser is running on. */
+ os: PlatformOs;
+ /** The machine's processor architecture. */
+ arch: PlatformArch;
+ /**
+ * The native client architecture. This may be different from arch on some platforms.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ nacl_arch?: PlatformNaclArch | undefined;
+ }
+
+ /** An object containing information about the current browser. */
+ interface BrowserInfo {
+ /** The name of the browser, for example 'Firefox'. */
+ name: string;
+ /** The name of the browser vendor, for example 'Mozilla'. */
+ vendor: string;
+ /** The browser's version, for example '42.0.0' or '0.8.1pre'. */
+ version: string;
+ /** The browser's build ID/date, for example '20160101'. */
+ buildID: string;
+ }
+
+ /** Result of the update check. */
+ type RequestUpdateCheckStatus = "throttled" | "no_update" | "update_available";
+
+ /** The reason that this event is being dispatched. */
+ type OnInstalledReason = "install" | "update" | "browser_update";
+
+ /**
+ * The reason that the event is being dispatched. 'app_update' is used when the restart is needed because the application is updated to a newer version. 'os_update' is used when the restart is needed because the browser/OS is updated to a newer version. 'periodic' is used when the system runs for more than the permitted uptime set in the enterprise policy.
+ */
+ type OnRestartRequiredReason = "app_update" | "os_update" | "periodic";
+
+ type PlatformNaclArch = "arm" | "x86-32" | "x86-64";
+
+ /** This will be defined during an API method callback if there was an error */
+ interface _LastError {
+ /** Details about the error which occurred. */
+ message?: string | undefined;
+ }
+
+ /** If an update is available, this contains more information about the available update. */
+ interface _RequestUpdateCheckReturnDetails {
+ /** The version of the available update. */
+ version: string;
+ }
+
+ interface _ConnectConnectInfo {
+ /** Will be passed into onConnect for processes that are listening for the connection event. */
+ name?: string | undefined;
+ /**
+ * Whether the TLS channel ID will be passed into onConnectExternal for processes that are listening for the connection event.
+ */
+ includeTlsChannelId?: boolean | undefined;
+ }
+
+ interface _SendMessageOptions {
+ /**
+ * Whether the TLS channel ID will be passed into onMessageExternal for processes that are listening for the connection event.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ includeTlsChannelId?: boolean | undefined;
+ }
+
+ type DirectoryEntry = any;
+
+ interface _OnInstalledDetails {
+ /** The reason that this event is being dispatched. */
+ reason: OnInstalledReason;
+ /**
+ * Indicates the previous version of the extension, which has just been updated. This is present only if 'reason' is 'update'.
+ */
+ previousVersion?: string | undefined;
+ /** Indicates whether the addon is installed as a temporary extension. */
+ temporary: boolean;
+ /**
+ * Indicates the ID of the imported shared module extension which updated. This is present only if 'reason' is 'shared_module_update'.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ id?: string | undefined;
+ }
+
+ /** The manifest details of the available update. */
+ interface _OnUpdateAvailableDetails {
+ /** The version number of the available update. */
+ version: string;
+ }
+
+ /* runtime properties */
+ /** This will be defined during an API method callback if there was an error */
+ const lastError: _LastError | undefined;
+
+ /** The ID of the extension/app. */
+ const id: string;
+
+ /* runtime functions */
+ /**
+ * Retrieves the JavaScript 'window' object for the background page running inside the current extension/app. If the background page is an event page, the system will ensure it is loaded before calling the callback. If there is no background page, an error is set.
+ */
+ function getBackgroundPage(): Promise<Window>;
+
+ /**
+ * Open your Extension's options page, if possible.
+ *
+ * The precise behavior may depend on your manifest's `options_ui` or `options_page` key, or what the browser happens to support at the time.
+ *
+ * If your Extension does not declare an options page, or the browser failed to create one for some other reason, the callback will set `lastError`.
+ */
+ function openOptionsPage(): Promise<void>;
+
+ /**
+ * Returns details about the app or extension from the manifest. The object returned is a serialization of the full manifest file.
+ */
+ function getManifest(): _manifest.WebExtensionManifest;
+
+ /**
+ * Converts a relative path within an app/extension install directory to a fully-qualified URL.
+ * @param path A path to a resource within an app/extension expressed relative to its install directory.
+ * @returns The fully-qualified URL to the resource.
+ */
+ function getURL(path: string): string;
+
+ /**
+ * Get the frameId of any window global or frame element.
+ * @param target A WindowProxy or a Browsing Context container element (IFrame, Frame, Embed, Object) for the target frame.
+ * @returns The frameId of the target frame, or -1 if it doesn't exist.
+ */
+ function getFrameId(target: any): number;
+
+ /**
+ * Sets the URL to be visited upon uninstallation. This may be used to clean up server-side data, do analytics, and implement surveys. Maximum 255 characters.
+ * @param [url] URL to be opened after the extension is uninstalled. This URL must have an http: or https: scheme. Set an empty string to not open a new tab upon uninstallation.
+ */
+ function setUninstallURL(url?: string): Promise<void>;
+
+ /** Reloads the app or extension. */
+ function reload(): void;
+
+ /**
+ * Requests an update check for this app/extension.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ function requestUpdateCheck(): Promise<object>;
+
+ /**
+ * Restart the device when the app runs in kiosk mode. Otherwise, it's no-op.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ function restart(): void;
+
+ /**
+ * Attempts to connect to connect listeners within an extension/app (such as the background page), or other extensions/apps. This is useful for content scripts connecting to their extension processes, inter-app/extension communication, and web messaging. Note that this does not connect to any listeners in a content script. Extensions may connect to content scripts embedded in tabs via `tabs.connect`.
+ * @returns Port through which messages can be sent and received. The port's `runtime.Port onDisconnect` event is fired if the extension/app does not exist.
+ */
+ function connect(): Port;
+ /**
+ * Attempts to connect to connect listeners within an extension/app (such as the background page), or other extensions/apps. This is useful for content scripts connecting to their extension processes, inter-app/extension communication, and web messaging. Note that this does not connect to any listeners in a content script. Extensions may connect to content scripts embedded in tabs via `tabs.connect`.
+ * @param extensionId The ID of the extension or app to connect to. If omitted, a connection will be attempted with your own extension. Required if sending messages from a web page for web messaging.
+ * @returns Port through which messages can be sent and received. The port's `runtime.Port onDisconnect` event is fired if the extension/app does not exist.
+ */
+ function connect(extensionId: string, connectInfo?: _ConnectConnectInfo): Port;
+ /**
+ * Attempts to connect to connect listeners within an extension/app (such as the background page), or other extensions/apps. This is useful for content scripts connecting to their extension processes, inter-app/extension communication, and web messaging. Note that this does not connect to any listeners in a content script. Extensions may connect to content scripts embedded in tabs via `tabs.connect`.
+ * @returns Port through which messages can be sent and received. The port's `runtime.Port onDisconnect` event is fired if the extension/app does not exist.
+ */
+ function connect(connectInfo: _ConnectConnectInfo): Port;
+
+ /**
+ * Connects to a native application in the host machine.
+ *
+ * Not allowed in: Devtools pages
+ * @param application The name of the registered application to connect to.
+ * @returns Port through which messages can be sent and received with the application
+ */
+ function connectNative(application: string): Port;
+
+ /**
+ * Sends a single message to event listeners within your extension/app or a different extension/app. Similar to `runtime.connect` but only sends a single message, with an optional response. If sending to your extension, the `runtime.onMessage` event will be fired in each page, or `runtime.onMessageExternal`, if a different extension. Note that extensions cannot send messages to content scripts using this method. To send messages to content scripts, use `tabs.sendMessage`.
+ */
+ function sendMessage(message: any, options?: _SendMessageOptions): Promise<any>;
+ /**
+ * Sends a single message to event listeners within your extension/app or a different extension/app. Similar to `runtime.connect` but only sends a single message, with an optional response. If sending to your extension, the `runtime.onMessage` event will be fired in each page, or `runtime.onMessageExternal`, if a different extension. Note that extensions cannot send messages to content scripts using this method. To send messages to content scripts, use `tabs.sendMessage`.
+ * @param extensionId The ID of the extension/app to send the message to. If omitted, the message will be sent to your own extension/app. Required if sending messages from a web page for web messaging.
+ */
+ function sendMessage(extensionId: string, message: any, options?: _SendMessageOptions): Promise<any>;
+
+ /**
+ * Send a single message to a native application.
+ *
+ * Not allowed in: Devtools pages
+ * @param application The name of the native messaging host.
+ * @param message The message that will be passed to the native messaging host.
+ */
+ function sendNativeMessage(application: string, message: any): Promise<any>;
+
+ /** Returns information about the current browser. */
+ function getBrowserInfo(): Promise<BrowserInfo>;
+
+ /** Returns information about the current platform. */
+ function getPlatformInfo(): Promise<PlatformInfo>;
+
+ /**
+ * Returns a DirectoryEntry for the package directory.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ function getPackageDirectoryEntry(): Promise<DirectoryEntry>;
+
+ /* runtime events */
+ /**
+ * Fired when a profile that has this extension installed first starts up. This event is not fired for incognito profiles.
+ */
+ const onStartup: WebExtEvent<() => void>;
+
+ /**
+ * Fired when the extension is first installed, when the extension is updated to a new version, and when the browser is updated to a new version.
+ */
+ const onInstalled: WebExtEvent<(details: _OnInstalledDetails) => void>;
+
+ /**
+ * Sent to the event page just before it is unloaded. This gives the extension opportunity to do some clean up. Note that since the page is unloading, any asynchronous operations started while handling this event are not guaranteed to complete. If more activity for the event page occurs before it gets unloaded the onSuspendCanceled event will be sent and the page won't be unloaded.
+ */
+ const onSuspend: WebExtEvent<() => void>;
+
+ /** Sent after onSuspend to indicate that the app won't be unloaded after all. */
+ const onSuspendCanceled: WebExtEvent<() => void>;
+
+ /**
+ * Fired when an update is available, but isn't installed immediately because the app is currently running. If you do nothing, the update will be installed the next time the background page gets unloaded, if you want it to be installed sooner you can explicitly call `runtime.reload`. If your extension is using a persistent background page, the background page of course never gets unloaded, so unless you call `runtime.reload` manually in response to this event the update will not get installed until the next time the browser itself restarts. If no handlers are listening for this event, and your extension has a persistent background page, it behaves as if `runtime.reload` is called in response to this event.
+ * @param details The manifest details of the available update.
+ */
+ const onUpdateAvailable: WebExtEvent<(details: _OnUpdateAvailableDetails) => void>;
+
+ /**
+ * Fired when an update for the browser is available, but isn't installed immediately because a browser restart is required.
+ * @deprecated Please use `runtime.onRestartRequired`.
+ */
+ const onBrowserUpdateAvailable: WebExtEvent<() => void> | undefined;
+
+ /** Fired when a connection is made from either an extension process or a content script. */
+ const onConnect: WebExtEvent<(port: Port) => void>;
+
+ /** Fired when a connection is made from another extension. */
+ const onConnectExternal: WebExtEvent<(port: Port) => void>;
+
+ /**
+ * Fired when a message is sent from either an extension process or a content script.
+ * @param message The message sent by the calling script.
+ * @param sendResponse Function to call (at most once) when you have a response. The argument should be any JSON-ifiable object. If you have more than one `onMessage` listener in the same document, then only one may send a response. This function becomes invalid when the event listener returns, unless you return true from the event listener to indicate you wish to send a response asynchronously (this will keep the message channel open to the other end until `sendResponse` is called).
+ * @returns Return true from the event listener if you wish to call `sendResponse` after the event listener returns.
+ */
+ const onMessage: WebExtEvent<
+ // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
+ (message: any, sender: MessageSender, sendResponse: (response?: any) => void) => boolean | Promise<any> | void
+ >;
+
+ /**
+ * Fired when a message is sent from another extension/app. Cannot be used in a content script.
+ * @param message The message sent by the calling script.
+ * @param sendResponse Function to call (at most once) when you have a response. The argument should be any JSON-ifiable object. If you have more than one `onMessage` listener in the same document, then only one may send a response. This function becomes invalid when the event listener returns, unless you return true from the event listener to indicate you wish to send a response asynchronously (this will keep the message channel open to the other end until `sendResponse` is called).
+ * @returns Return true from the event listener if you wish to call `sendResponse` after the event listener returns.
+ */
+ const onMessageExternal: WebExtEvent<
+ // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
+ (message: any, sender: MessageSender, sendResponse: (response?: any) => void) => boolean | Promise<any> | void
+ >;
+
+ /**
+ * Fired when an app or the device that it runs on needs to be restarted. The app should close all its windows at its earliest convenient time to let the restart to happen. If the app does nothing, a restart will be enforced after a 24-hour grace period has passed. Currently, this event is only fired for Chrome OS kiosk apps.
+ * @param reason The reason that the event is being dispatched.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ const onRestartRequired: WebExtEvent<(reason: OnRestartRequiredReason) => void> | undefined;
+}
+
+/**
+ * Use the scripting API to execute script in different contexts.
+ *
+ * Permissions: `scripting`
+ *
+ * Not allowed in: Content scripts, Devtools pages
+ */
+declare namespace browser.scripting {
+ /* scripting types */
+ /** Details of a script injection */
+ interface ScriptInjection {
+ /**
+ * The arguments to curry into a provided function. This is only valid if the `func` parameter is specified. These arguments must be JSON-serializable.
+ */
+ args?: any[] | undefined;
+ /**
+ * The path of the JS files to inject, relative to the extension's root directory. Exactly one of `files` and `func` must be specified.
+ */
+ files?: string[] | undefined;
+ /**
+ * A JavaScript function to inject. This function will be serialized, and then deserialized for injection. This means that any bound parameters and execution context will be lost. Exactly one of `files` and `func` must be specified.
+ */
+ // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
+ func?: () => void | undefined;
+ /** Details specifying the target into which to inject the script. */
+ target: InjectionTarget;
+ world?: ExecutionWorld | undefined;
+ /**
+ * Whether the injection should be triggered in the target as soon as possible (but not necessarily prior to page load).
+ */
+ injectImmediately?: boolean | undefined;
+ }
+
+ /** Result of a script injection. */
+ interface InjectionResult {
+ /** The frame ID associated with the injection. */
+ frameId: number;
+ /** The result of the script execution. */
+ result?: any;
+ /**
+ * The error property is set when the script execution failed. The value is typically an (Error) object with a message property, but could be any value (including primitives and undefined) if the script threw or rejected with such a value.
+ */
+ error?: any;
+ }
+
+ interface InjectionTarget {
+ /** The IDs of specific frames to inject into. */
+ frameIds?: number[] | undefined;
+ /**
+ * Whether the script should inject into all frames within the tab. Defaults to false. This must not be true if `frameIds` is specified.
+ */
+ allFrames?: boolean | undefined;
+ /** The ID of the tab into which to inject. */
+ tabId: number;
+ }
+
+ interface CSSInjection {
+ /** A string containing the CSS to inject. Exactly one of `files` and `css` must be specified. */
+ css?: string | undefined;
+ /**
+ * The path of the CSS files to inject, relative to the extension's root directory. Exactly one of `files` and `css` must be specified.
+ */
+ files?: string[] | undefined;
+ /** The style origin for the injection. Defaults to `'AUTHOR'`. */
+ origin?: _CSSInjectionOrigin | undefined;
+ /** Details specifying the target into which to inject the CSS. */
+ target: InjectionTarget;
+ }
+
+ interface ContentScriptFilter {
+ /**
+ * The IDs of specific scripts to retrieve with `getRegisteredContentScripts()` or to unregister with `unregisterContentScripts()`.
+ */
+ ids?: string[] | undefined;
+ }
+
+ /**
+ * The JavaScript world for a script to execute within. We currently only support the `'ISOLATED'` world.
+ */
+ type ExecutionWorld = "ISOLATED";
+
+ interface RegisteredContentScript {
+ /**
+ * If specified true, it will inject into all frames, even if the frame is not the top-most frame in the tab. Each frame is checked independently for URL requirements; it will not inject into child frames if the URL requirements are not met. Defaults to false, meaning that only the top frame is matched.
+ */
+ allFrames?: boolean | undefined;
+ /** Excludes pages that this content script would otherwise be injected into. */
+ excludeMatches?: string[] | undefined;
+ /** The id of the content script, specified in the API call. */
+ id: string;
+ /**
+ * The list of JavaScript files to be injected into matching pages. These are injected in the order they appear in this array.
+ */
+ js?: _manifest.ExtensionURL[] | undefined;
+ /**
+ * Specifies which pages this content script will be injected into. Must be specified for `registerContentScripts()`.
+ */
+ matches?: string[] | undefined;
+ /**
+ * Specifies when JavaScript files are injected into the web page. The preferred and default value is `document_idle`.
+ */
+ runAt?: extensionTypes.RunAt | undefined;
+ /** Specifies if this content script will persist into future sessions. Defaults to true. */
+ persistAcrossSessions?: boolean | undefined;
+ /**
+ * The list of CSS files to be injected into matching pages. These are injected in the order they appear in this array.
+ */
+ css?: _manifest.ExtensionURL[] | undefined;
+ }
+
+ /** The style origin for the injection. Defaults to `'AUTHOR'`. */
+ type _CSSInjectionOrigin = "USER" | "AUTHOR";
+
+ interface _UpdateContentScriptsScripts {
+ /** Specifies if this content script will persist into future sessions. */
+ persistAcrossSessions?: boolean | undefined;
+ /**
+ * If specified true, it will inject into all frames, even if the frame is not the top-most frame in the tab. Each frame is checked independently for URL requirements; it will not inject into child frames if the URL requirements are not met. Defaults to false, meaning that only the top frame is matched.
+ */
+ allFrames?: boolean | undefined;
+ /** Excludes pages that this content script would otherwise be injected into. */
+ excludeMatches?: string[] | undefined;
+ /** The id of the content script, specified in the API call. */
+ id: string;
+ /**
+ * The list of JavaScript files to be injected into matching pages. These are injected in the order they appear in this array.
+ */
+ js?: _manifest.ExtensionURL[] | undefined;
+ /**
+ * Specifies which pages this content script will be injected into. Must be specified for `registerContentScripts()`.
+ */
+ matches?: string[] | undefined;
+ /**
+ * Specifies when JavaScript files are injected into the web page. The preferred and default value is `document_idle`.
+ */
+ runAt?: extensionTypes.RunAt | undefined;
+ /**
+ * The list of CSS files to be injected into matching pages. These are injected in the order they appear in this array.
+ */
+ css?: _manifest.ExtensionURL[] | undefined;
+ }
+
+ /* scripting functions */
+ /**
+ * Injects a script into a target context. The script will be run at `document_idle`.
+ * @param injection The details of the script which to inject.
+ */
+ function executeScript(injection: ScriptInjection): Promise<InjectionResult[]>;
+
+ /**
+ * Inserts a CSS stylesheet into a target context. If multiple frames are specified, unsuccessful injections are ignored.
+ * @param injection The details of the styles to insert.
+ */
+ function insertCSS(injection: CSSInjection): Promise<void>;
+
+ /**
+ * Removes a CSS stylesheet that was previously inserted by this extension from a target context.
+ * @param injection The details of the styles to remove. Note that the `css`, `files`, and `origin` properties must exactly match the stylesheet inserted through `insertCSS`. Attempting to remove a non-existent stylesheet is a no-op.
+ */
+ function removeCSS(injection: CSSInjection): Promise<void>;
+
+ /**
+ * Registers one or more content scripts for this extension.
+ * @param scripts Contains a list of scripts to be registered. If there are errors during script parsing/file validation, or if the IDs specified already exist, then no scripts are registered.
+ */
+ function registerContentScripts(scripts: RegisteredContentScript[]): Promise<void>;
+
+ /**
+ * Returns all dynamically registered content scripts for this extension that match the given filter.
+ * @param [filter] An object to filter the extension's dynamically registered scripts.
+ */
+ function getRegisteredContentScripts(filter?: ContentScriptFilter): Promise<RegisteredContentScript[]>;
+
+ /**
+ * Unregisters one or more content scripts for this extension.
+ * @param [filter] If specified, only unregisters dynamic content scripts which match the filter. Otherwise, all of the extension's dynamic content scripts are unregistered.
+ */
+ function unregisterContentScripts(filter?: ContentScriptFilter): Promise<void>;
+
+ /**
+ * Updates one or more content scripts for this extension.
+ * @param scripts Contains a list of scripts to be updated. If there are errors during script parsing/file validation, or if the IDs specified do not already exist, then no scripts are updated.
+ */
+ function updateContentScripts(scripts: _UpdateContentScriptsScripts[]): Promise<void>;
+}
+
+/**
+ * Use the `browser.storage` API to store, retrieve, and track changes to user data.
+ *
+ * Permissions: `storage`
+ */
+declare namespace browser.storage {
+ /* storage types */
+ interface StorageChange {
+ /** The old value of the item, if there was an old value. */
+ oldValue?: any;
+ /** The new value of the item, if there is a new value. */
+ newValue?: any;
+ }
+
+ interface StorageArea {
+ /**
+ * Gets one or more items from storage.
+ * @param [keys] A single key to get, list of keys to get, or a dictionary specifying default values (see description of the object). An empty list or object will return an empty result object. Pass in `null` to get the entire contents of storage.
+ */
+ get(keys?: string | string[] | { [key: string]: any }): Promise<{ [key: string]: any }>;
+ /**
+ * Gets the amount of space (in bytes) being used by one or more items.
+ * @param [keys] A single key or list of keys to get the total usage for. An empty list will return 0\. Pass in `null` to get the total usage of all of storage.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ getBytesInUse?(keys?: string | string[]): Promise<number>;
+ /**
+ * Sets multiple items.
+ * @param items An object which gives each key/value pair to update storage with. Any other key/value pairs in storage will not be affected.
+ *
+ * Primitive values such as numbers will serialize as expected. Values with a `typeof` `"object"` and `"function"` will typically serialize to `{}`, with the exception of `Array` (serializes as expected), `Date`, and `Regex` (serialize using their `String` representation).
+ */
+ set(items: { [key: string]: any }): Promise<void>;
+ /**
+ * Removes one or more items from storage.
+ * @param keys A single key or a list of keys for items to remove.
+ */
+ remove(keys: string | string[]): Promise<void>;
+ /** Removes all items from storage. */
+ clear(): Promise<void>;
+ /**
+ * Fired when one or more items change.
+ * @param changes Object mapping each key that changed to its corresponding `storage.StorageChange` for that item.
+ */
+ onChanged: WebExtEvent<(changes: { [key: string]: StorageChange }) => void>;
+ }
+
+ interface StorageAreaSync {
+ /**
+ * Gets one or more items from storage.
+ * @param [keys] A single key to get, list of keys to get, or a dictionary specifying default values (see description of the object). An empty list or object will return an empty result object. Pass in `null` to get the entire contents of storage.
+ */
+ get(keys?: string | string[] | { [key: string]: any }): Promise<{ [key: string]: any }>;
+ /**
+ * Gets the amount of space (in bytes) being used by one or more items.
+ * @param [keys] A single key or list of keys to get the total usage for. An empty list will return 0\. Pass in `null` to get the total usage of all of storage.
+ */
+ getBytesInUse(keys?: string | string[]): Promise<number>;
+ /**
+ * Sets multiple items.
+ * @param items An object which gives each key/value pair to update storage with. Any other key/value pairs in storage will not be affected.
+ *
+ * Primitive values such as numbers will serialize as expected. Values with a `typeof` `"object"` and `"function"` will typically serialize to `{}`, with the exception of `Array` (serializes as expected), `Date`, and `Regex` (serialize using their `String` representation).
+ */
+ set(items: { [key: string]: any }): Promise<void>;
+ /**
+ * Removes one or more items from storage.
+ * @param keys A single key or a list of keys for items to remove.
+ */
+ remove(keys: string | string[]): Promise<void>;
+ /** Removes all items from storage. */
+ clear(): Promise<void>;
+ /**
+ * Fired when one or more items change.
+ * @param changes Object mapping each key that changed to its corresponding `storage.StorageChange` for that item.
+ */
+ onChanged: WebExtEvent<(changes: { [key: string]: StorageChange }) => void>;
+ }
+
+ /* storage properties */
+ /** Items in the `sync` storage area are synced by the browser. */
+ const sync: StorageAreaSync;
+
+ /** Items in the `local` storage area are local to each machine. */
+ const local: StorageArea;
+
+ /**
+ * Items in the `managed` storage area are set by administrators or native applications, and are read-only for the extension; trying to modify this namespace results in an error.
+ */
+ const managed: StorageArea;
+
+ /* storage events */
+ /**
+ * Fired when one or more items change.
+ * @param changes Object mapping each key that changed to its corresponding `storage.StorageChange` for that item.
+ * @param areaName The name of the storage area (`"sync"`, `"local"` or `"managed"`) the changes are for.
+ */
+ const onChanged: WebExtEvent<(changes: { [key: string]: StorageChange }, areaName: string) => void>;
+}
+
+/**
+ * Use the `browser.telemetry` API to send telemetry data to the Mozilla Telemetry service. Restricted to Mozilla privileged webextensions.
+ *
+ * Permissions: `telemetry`
+ *
+ * Not allowed in: Content scripts, Devtools pages
+ */
+declare namespace browser.telemetry {
+ /* telemetry types */
+ /**
+ * Type of scalar: 'count' for numeric values, 'string' for string values, 'boolean' for boolean values. Maps to `nsITelemetry.SCALAR_TYPE_*`.
+ */
+ type ScalarType = "count" | "string" | "boolean";
+
+ /** Represents registration data for a Telemetry scalar. */
+ interface ScalarData {
+ kind: ScalarType;
+ /** True if this is a keyed scalar. */
+ keyed?: boolean | undefined;
+ /** True if this data should be recorded on release. */
+ record_on_release?: boolean | undefined;
+ /**
+ * True if this scalar entry is expired. This allows recording it without error, but it will be discarded.
+ */
+ expired?: boolean | undefined;
+ }
+
+ /** Represents registration data for a Telemetry event. */
+ interface EventData {
+ /** List of methods for this event entry. */
+ methods: string[];
+ /** List of objects for this event entry. */
+ objects: string[];
+ /** List of allowed extra keys for this event entry. */
+ extra_keys: string[];
+ /** True if this data should be recorded on release. */
+ record_on_release?: boolean | undefined;
+ /**
+ * True if this event entry is expired. This allows recording it without error, but it will be discarded.
+ */
+ expired?: boolean | undefined;
+ }
+
+ /** Options object. */
+ interface _SubmitPingOptions {
+ /** True if the ping should contain the client id. */
+ addClientId?: boolean | undefined;
+ /** True if the ping should contain the environment data. */
+ addEnvironment?: boolean | undefined;
+ /** Set to override the environment data. */
+ overrideEnvironment?: { [key: string]: any } | undefined;
+ /** If true, send the ping using the PingSender. */
+ usePingSender?: boolean | undefined;
+ }
+
+ /** Options object. */
+ interface _SubmitEncryptedPingOptions {
+ /** Schema name used for payload. */
+ schemaName: string;
+ /** Schema version used for payload. */
+ schemaVersion: number;
+ }
+
+ /* telemetry functions */
+ /**
+ * Submits a custom ping to the Telemetry back-end. See `submitExternalPing` inside TelemetryController.sys.mjs for more details.
+ * @param type The type of the ping.
+ * @param message The data payload for the ping.
+ * @param options Options object.
+ */
+ function submitPing(type: string, message: { [key: string]: any }, options: _SubmitPingOptions): Promise<any>;
+
+ /**
+ * Submits a custom ping to the Telemetry back-end, with an encrypted payload. Requires a telemetry entry in the manifest to be used.
+ * @param message The data payload for the ping, which will be encrypted.
+ * @param options Options object.
+ */
+ function submitEncryptedPing(message: { [key: string]: any }, options: _SubmitEncryptedPingOptions): Promise<any>;
+
+ /** Checks if Telemetry upload is enabled. */
+ function canUpload(): Promise<any>;
+
+ /**
+ * Adds the value to the given scalar.
+ * @param name The scalar name.
+ * @param value The numeric value to add to the scalar. Only unsigned integers supported.
+ */
+ function scalarAdd(name: string, value: number): Promise<any>;
+
+ /**
+ * Sets the named scalar to the given value. Throws if the value type doesn't match the scalar type.
+ * @param name The scalar name
+ * @param value The value to set the scalar to
+ */
+ function scalarSet(name: string, value: string | boolean | number | { [key: string]: any }): Promise<any>;
+
+ /**
+ * Sets the scalar to the maximum of the current and the passed value
+ * @param name The scalar name.
+ * @param value The numeric value to set the scalar to. Only unsigned integers supported.
+ */
+ function scalarSetMaximum(name: string, value: number): Promise<any>;
+
+ /**
+ * Adds the value to the given keyed scalar.
+ * @param name The scalar name
+ * @param key The key name
+ * @param value The numeric value to add to the scalar. Only unsigned integers supported.
+ */
+ function keyedScalarAdd(name: string, key: string, value: number): Promise<any>;
+
+ /**
+ * Sets the keyed scalar to the given value. Throws if the value type doesn't match the scalar type.
+ * @param name The scalar name.
+ * @param key The key name.
+ * @param value The value to set the scalar to.
+ */
+ function keyedScalarSet(
+ name: string,
+ key: string,
+ value: string | boolean | number | { [key: string]: any },
+ ): Promise<any>;
+
+ /**
+ * Sets the keyed scalar to the maximum of the current and the passed value
+ * @param name The scalar name.
+ * @param key The key name.
+ * @param value The numeric value to set the scalar to. Only unsigned integers supported.
+ */
+ function keyedScalarSetMaximum(name: string, key: string, value: number): Promise<any>;
+
+ /**
+ * Record an event in Telemetry. Throws when trying to record an unknown event.
+ * @param category The category name.
+ * @param method The method name.
+ * @param object The object name.
+ * @param [value] An optional string value to record.
+ * @param [extra] An optional object of the form (string -> string). It should only contain registered extra keys.
+ */
+ function recordEvent(
+ category: string,
+ method: string,
+ object: string,
+ value?: string,
+ extra?: { [key: string]: string },
+ ): Promise<any>;
+
+ /**
+ * Register new scalars to record them from addons. See nsITelemetry.idl for more details.
+ * @param category The unique category the scalars are registered in.
+ * @param data An object that contains registration data for multiple scalars. Each property name is the scalar name, and the corresponding property value is an object of ScalarData type.
+ */
+ function registerScalars(category: string, data: { [key: string]: ScalarData }): Promise<any>;
+
+ /**
+ * Register new events to record them from addons. See nsITelemetry.idl for more details.
+ * @param category The unique category the events are registered in.
+ * @param data An object that contains registration data for 1+ events. Each property name is the category name, and the corresponding property value is an object of EventData type.
+ */
+ function registerEvents(category: string, data: { [key: string]: EventData }): Promise<any>;
+
+ /**
+ * Enable recording of events in a category. Events default to recording disabled. This allows to toggle recording for all events in the specified category.
+ * @param category The category name.
+ * @param enabled Whether recording is enabled for events in that category.
+ */
+ function setEventRecordingEnabled(category: string, enabled: boolean): Promise<any>;
+}
+
+/**
+ * The theme API allows customizing of visual elements of the browser.
+ *
+ * Not allowed in: Content scripts, Devtools pages
+ */
+declare namespace browser.theme {
+ /* theme types */
+ /** Info provided in the onUpdated listener. */
+ interface ThemeUpdateInfo {
+ /** The new theme after update */
+ theme: object;
+ /** The id of the window the theme has been applied to */
+ windowId?: number | undefined;
+ }
+
+ /* theme functions */
+ /**
+ * Returns the current theme for the specified window or the last focused window.
+ * @param [windowId] The window for which we want the theme.
+ */
+ function getCurrent(windowId?: number): Promise<_manifest.ThemeType>;
+
+ /**
+ * Make complete updates to the theme. Resolves when the update has completed.
+ * @param details The properties of the theme to update.
+ */
+ function update(details: _manifest.ThemeType): void;
+ /**
+ * Make complete updates to the theme. Resolves when the update has completed.
+ * @param windowId The id of the window to update. No id updates all windows.
+ * @param details The properties of the theme to update.
+ */
+ function update(windowId: number, details: _manifest.ThemeType): void;
+
+ /**
+ * Removes the updates made to the theme.
+ * @param [windowId] The id of the window to reset. No id resets all windows.
+ */
+ function reset(windowId?: number): void;
+
+ /* theme events */
+ /**
+ * Fired when a new theme has been applied
+ * @param updateInfo Details of the theme update
+ */
+ const onUpdated: WebExtEvent<(updateInfo: ThemeUpdateInfo) => void>;
+}
+
+/**
+ * Contains types used by other schemas.
+ *
+ * Not allowed in: Content scripts, Devtools pages
+ */
+declare namespace browser.types {
+ /* types types */
+ /**
+ * The scope of the Setting. One of
+ *
+ * * `regular`: setting for the regular profile (which is inherited by the incognito profile if not overridden elsewhere),
+ * * `regular_only`: setting for the regular profile only (not inherited by the incognito profile),
+ * * `incognito_persistent`: setting for the incognito profile that survives browser restarts (overrides regular preferences),
+ * * `incognito_session_only`: setting for the incognito profile that can only be set during an incognito session and is deleted when the incognito session ends (overrides regular and incognito_persistent preferences).
+ *
+ * Only `regular` is supported by Firefox at this time.
+ */
+ type SettingScope = "regular" | "regular_only" | "incognito_persistent" | "incognito_session_only";
+
+ /**
+ * One of
+ *
+ * * `not_controllable`: cannot be controlled by any extension
+ * * `controlled_by_other_extensions`: controlled by extensions with higher precedence
+ * * `controllable_by_this_extension`: can be controlled by this extension
+ * * `controlled_by_this_extension`: controlled by this extension
+ */
+ type LevelOfControl =
+ | "not_controllable"
+ | "controlled_by_other_extensions"
+ | "controllable_by_this_extension"
+ | "controlled_by_this_extension";
+
+ interface Setting {
+ /**
+ * Gets the value of a setting.
+ * @param details Which setting to consider.
+ */
+ get(details: _GetDetails): Promise<_GetReturnDetails>;
+ /**
+ * Sets the value of a setting.
+ * @param details Which setting to change.
+ */
+ set(details: _SetDetails): Promise<void>;
+ /**
+ * Clears the setting, restoring any default value.
+ * @param details Which setting to clear.
+ */
+ clear(details: _ClearDetails): Promise<void>;
+ /** Fired after the setting changes. */
+ onChange: WebExtEvent<(details: _OnChangeDetails) => void>;
+ }
+
+ /** Details of the currently effective value. */
+ interface _GetReturnDetails {
+ /** The value of the setting. */
+ value: any;
+ /** The level of control of the setting. */
+ levelOfControl: LevelOfControl;
+ /**
+ * Whether the effective value is specific to the incognito session.
+ * This property will _only_ be present if the `incognito` property in the `details` parameter of `get()` was true.
+ */
+ incognitoSpecific?: boolean | undefined;
+ }
+
+ /** Which setting to consider. */
+ interface _GetDetails {
+ /** Whether to return the value that applies to the incognito session (default false). */
+ incognito?: boolean | undefined;
+ }
+
+ /** Which setting to change. */
+ interface _SetDetails {
+ /**
+ * The value of the setting.
+ * Note that every setting has a specific value type, which is described together with the setting. An extension should _not_ set a value of a different type.
+ */
+ value: any;
+ /** Where to set the setting (default: regular). */
+ scope?: SettingScope | undefined;
+ }
+
+ /** Which setting to clear. */
+ interface _ClearDetails {
+ /** Where to clear the setting (default: regular). */
+ scope?: SettingScope | undefined;
+ }
+
+ interface _OnChangeDetails {
+ /** The value of the setting after the change. */
+ value: any;
+ /** The level of control of the setting. */
+ levelOfControl: LevelOfControl;
+ /**
+ * Whether the value that has changed is specific to the incognito session.
+ * This property will _only_ be present if the user has enabled the extension in incognito mode.
+ */
+ incognitoSpecific?: boolean | undefined;
+ }
+}
+
+/**
+ * Manifest keys: `user_scripts`, `user_scripts`
+ *
+ * Not supported on manifest versions above 2.
+ *
+ * Not allowed in: Devtools pages
+ */
+declare namespace browser.userScripts {
+ /* userScripts types */
+ /** Details of a user script */
+ interface UserScriptOptions {
+ /** The list of JS files to inject */
+ js: extensionTypes.ExtensionFileOrCode[];
+ /** An opaque user script metadata value */
+ scriptMetadata?: extensionTypes.PlainJSONValue | undefined;
+ matches: _manifest.MatchPattern[];
+ excludeMatches?: _manifest.MatchPattern[] | undefined;
+ includeGlobs?: string[] | undefined;
+ excludeGlobs?: string[] | undefined;
+ /**
+ * If allFrames is `true`, implies that the JavaScript should be injected into all frames of current page. By default, it's `false` and is only injected into the top frame.
+ */
+ allFrames?: boolean | undefined;
+ /**
+ * If matchAboutBlank is true, then the code is also injected in about:blank and about:srcdoc frames if your extension has access to its parent document. Code cannot be inserted in top-level about:-frames. By default it is `false`.
+ */
+ matchAboutBlank?: boolean | undefined;
+ /** The soonest that the JavaScript will be injected into the tab. Defaults to "document_idle". */
+ runAt?: extensionTypes.RunAt | undefined;
+ /** limit the set of matched tabs to those that belong to the given cookie store id */
+ cookieStoreId?: string[] | string | undefined;
+ }
+
+ /** An object that represents a user script registered programmatically */
+ interface RegisteredUserScript {
+ /** Unregister a user script registered programmatically */
+ unregister(): Promise<any>;
+ }
+
+ interface _OnBeforeScriptUserScript {
+ /** The userScript metadata (as set in userScripts.register) */
+ metadata: any;
+ /** The userScript global */
+ global: any;
+ /**
+ * Exports all the properties of a given plain object as userScript globals
+ * @param sourceObject A plain object whose properties are exported as userScript globals
+ */
+ defineGlobals: (sourceObject: object) => void;
+ /**
+ * Convert a given value to make it accessible to the userScript code
+ * @param value A value to convert into an object accessible to the userScript
+ */
+ export: (value: any) => any;
+ }
+
+ /* userScripts functions */
+ /**
+ * Register a user script programmatically given its `userScripts.UserScriptOptions`, and resolves to a `userScripts.RegisteredUserScript` instance
+ */
+ function register(userScriptOptions: UserScriptOptions): Promise<RegisteredUserScript>;
+
+ /* userScripts events */
+ /**
+ * Event called when a new userScript global has been created
+ *
+ * Allowed in: Content scripts only
+ */
+ const onBeforeScript: WebExtEvent<(userScript: _OnBeforeScriptUserScript) => void>;
+}
+
+/**
+ * Use the `browser.webNavigation` API to receive notifications about the status of navigation requests in-flight.
+ *
+ * Permissions: `webNavigation`
+ *
+ * Not allowed in: Content scripts, Devtools pages
+ */
+declare namespace browser.webNavigation {
+ /* webNavigation types */
+ /**
+ * Cause of the navigation. The same transition types as defined in the history API are used. These are the same transition types as defined in the history API except with `"start_page"` in place of `"auto_toplevel"` (for backwards compatibility).
+ */
+ type TransitionType =
+ | "link"
+ | "typed"
+ | "auto_bookmark"
+ | "auto_subframe"
+ | "manual_subframe"
+ | "generated"
+ | "start_page"
+ | "form_submit"
+ | "reload"
+ | "keyword"
+ | "keyword_generated";
+
+ type TransitionQualifier = "client_redirect" | "server_redirect" | "forward_back" | "from_address_bar";
+
+ interface EventUrlFilters {
+ url: events.UrlFilter[];
+ }
+
+ /** Information about the requested frame, null if the specified frame ID and/or tab ID are invalid. */
+ interface _GetFrameReturnDetails {
+ /**
+ * True if the last navigation in this frame was interrupted by an error, i.e. the onErrorOccurred event fired.
+ */
+ errorOccurred?: boolean | undefined;
+ /**
+ * The URL currently associated with this frame, if the frame identified by the frameId existed at one point in the given tab. The fact that an URL is associated with a given frameId does not imply that the corresponding frame still exists.
+ */
+ url: string;
+ /** The ID of the tab in which the frame is. */
+ tabId: number;
+ /**
+ * The ID of the frame. 0 indicates that this is the main frame; a positive value indicates the ID of a subframe.
+ */
+ frameId: number;
+ /** ID of frame that wraps the frame. Set to -1 of no parent frame exists. */
+ parentFrameId: number;
+ }
+
+ /** Information about the frame to retrieve information about. */
+ interface _GetFrameDetails {
+ /** The ID of the tab in which the frame is. */
+ tabId: number;
+ /** The ID of the process runs the renderer for this tab. */
+ processId?: number | undefined;
+ /** The ID of the frame in the given tab. */
+ frameId: number;
+ }
+
+ interface _GetAllFramesReturnDetails {
+ /**
+ * True if the last navigation in this frame was interrupted by an error, i.e. the onErrorOccurred event fired.
+ */
+ errorOccurred?: boolean | undefined;
+ /**
+ * The ID of the process runs the renderer for this tab.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ processId?: number | undefined;
+ /** The ID of the tab in which the frame is. */
+ tabId: number;
+ /**
+ * The ID of the frame. 0 indicates that this is the main frame; a positive value indicates the ID of a subframe.
+ */
+ frameId: number;
+ /** ID of frame that wraps the frame. Set to -1 of no parent frame exists. */
+ parentFrameId: number;
+ /** The URL currently associated with this frame. */
+ url: string;
+ }
+
+ /** Information about the tab to retrieve all frames from. */
+ interface _GetAllFramesDetails {
+ /** The ID of the tab. */
+ tabId: number;
+ }
+
+ interface _OnBeforeNavigateDetails {
+ /** The ID of the tab in which the navigation is about to occur. */
+ tabId: number;
+ url: string;
+ /**
+ * The ID of the process runs the renderer for this tab.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ processId?: number | undefined;
+ /**
+ * 0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique for a given tab and process.
+ */
+ frameId: number;
+ /** ID of frame that wraps the frame. Set to -1 of no parent frame exists. */
+ parentFrameId: number;
+ /** The time when the browser was about to start the navigation, in milliseconds since the epoch. */
+ timeStamp: number;
+ }
+
+ interface _WebNavigationOnBeforeNavigateEvent<TCallback = (details: _OnBeforeNavigateDetails) => void> {
+ addListener(cb: TCallback, filters?: EventUrlFilters): void;
+ removeListener(cb: TCallback): void;
+ hasListener(cb: TCallback): boolean;
+ }
+
+ interface _OnCommittedDetails {
+ /** The ID of the tab in which the navigation occurs. */
+ tabId: number;
+ url: string;
+ /**
+ * The ID of the process runs the renderer for this tab.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ processId?: number | undefined;
+ /**
+ * 0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique within a tab.
+ */
+ frameId: number;
+ /**
+ * Cause of the navigation.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ transitionType?: TransitionType | undefined;
+ /**
+ * A list of transition qualifiers.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ transitionQualifiers?: TransitionQualifier[] | undefined;
+ /** The time when the navigation was committed, in milliseconds since the epoch. */
+ timeStamp: number;
+ }
+
+ interface _WebNavigationOnCommittedEvent<TCallback = (details: _OnCommittedDetails) => void> {
+ addListener(cb: TCallback, filters?: EventUrlFilters): void;
+ removeListener(cb: TCallback): void;
+ hasListener(cb: TCallback): boolean;
+ }
+
+ interface _OnDOMContentLoadedDetails {
+ /** The ID of the tab in which the navigation occurs. */
+ tabId: number;
+ url: string;
+ /**
+ * The ID of the process runs the renderer for this tab.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ processId?: number | undefined;
+ /**
+ * 0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique within a tab.
+ */
+ frameId: number;
+ /** The time when the page's DOM was fully constructed, in milliseconds since the epoch. */
+ timeStamp: number;
+ }
+
+ interface _WebNavigationOnDOMContentLoadedEvent<TCallback = (details: _OnDOMContentLoadedDetails) => void> {
+ addListener(cb: TCallback, filters?: EventUrlFilters): void;
+ removeListener(cb: TCallback): void;
+ hasListener(cb: TCallback): boolean;
+ }
+
+ interface _OnCompletedDetails {
+ /** The ID of the tab in which the navigation occurs. */
+ tabId: number;
+ url: string;
+ /**
+ * The ID of the process runs the renderer for this tab.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ processId?: number | undefined;
+ /**
+ * 0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique within a tab.
+ */
+ frameId: number;
+ /** The time when the document finished loading, in milliseconds since the epoch. */
+ timeStamp: number;
+ }
+
+ interface _WebNavigationOnCompletedEvent<TCallback = (details: _OnCompletedDetails) => void> {
+ addListener(cb: TCallback, filters?: EventUrlFilters): void;
+ removeListener(cb: TCallback): void;
+ hasListener(cb: TCallback): boolean;
+ }
+
+ interface _OnErrorOccurredDetails {
+ /** The ID of the tab in which the navigation occurs. */
+ tabId: number;
+ url: string;
+ /**
+ * The ID of the process runs the renderer for this tab.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ processId?: number | undefined;
+ /**
+ * 0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique within a tab.
+ */
+ frameId: number;
+ /**
+ * The error description.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ error?: string | undefined;
+ /** The time when the error occurred, in milliseconds since the epoch. */
+ timeStamp: number;
+ }
+
+ interface _WebNavigationOnErrorOccurredEvent<TCallback = (details: _OnErrorOccurredDetails) => void> {
+ addListener(cb: TCallback, filters?: EventUrlFilters): void;
+ removeListener(cb: TCallback): void;
+ hasListener(cb: TCallback): boolean;
+ }
+
+ interface _OnCreatedNavigationTargetDetails {
+ /** The ID of the tab in which the navigation is triggered. */
+ sourceTabId: number;
+ /** The ID of the process runs the renderer for the source tab. */
+ sourceProcessId: number;
+ /**
+ * The ID of the frame with sourceTabId in which the navigation is triggered. 0 indicates the main frame.
+ */
+ sourceFrameId: number;
+ /** The URL to be opened in the new window. */
+ url: string;
+ /** The ID of the tab in which the url is opened */
+ tabId: number;
+ /** The time when the browser was about to create a new view, in milliseconds since the epoch. */
+ timeStamp: number;
+ }
+
+ interface _WebNavigationOnCreatedNavigationTargetEvent<
+ TCallback = (details: _OnCreatedNavigationTargetDetails) => void,
+ > {
+ addListener(cb: TCallback, filters?: EventUrlFilters): void;
+ removeListener(cb: TCallback): void;
+ hasListener(cb: TCallback): boolean;
+ }
+
+ interface _OnReferenceFragmentUpdatedDetails {
+ /** The ID of the tab in which the navigation occurs. */
+ tabId: number;
+ url: string;
+ /**
+ * The ID of the process runs the renderer for this tab.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ processId?: number | undefined;
+ /**
+ * 0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique within a tab.
+ */
+ frameId: number;
+ /**
+ * Cause of the navigation.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ transitionType?: TransitionType | undefined;
+ /**
+ * A list of transition qualifiers.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ transitionQualifiers?: TransitionQualifier[] | undefined;
+ /** The time when the navigation was committed, in milliseconds since the epoch. */
+ timeStamp: number;
+ }
+
+ interface _WebNavigationOnReferenceFragmentUpdatedEvent<
+ TCallback = (details: _OnReferenceFragmentUpdatedDetails) => void,
+ > {
+ addListener(cb: TCallback, filters?: EventUrlFilters): void;
+ removeListener(cb: TCallback): void;
+ hasListener(cb: TCallback): boolean;
+ }
+
+ interface _OnTabReplacedDetails {
+ /** The ID of the tab that was replaced. */
+ replacedTabId: number;
+ /** The ID of the tab that replaced the old tab. */
+ tabId: number;
+ /** The time when the replacement happened, in milliseconds since the epoch. */
+ timeStamp: number;
+ }
+
+ interface _OnHistoryStateUpdatedDetails {
+ /** The ID of the tab in which the navigation occurs. */
+ tabId: number;
+ url: string;
+ /**
+ * The ID of the process runs the renderer for this tab.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ processId?: number | undefined;
+ /**
+ * 0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique within a tab.
+ */
+ frameId: number;
+ /**
+ * Cause of the navigation.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ transitionType?: TransitionType | undefined;
+ /**
+ * A list of transition qualifiers.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ transitionQualifiers?: TransitionQualifier[] | undefined;
+ /** The time when the navigation was committed, in milliseconds since the epoch. */
+ timeStamp: number;
+ }
+
+ interface _WebNavigationOnHistoryStateUpdatedEvent<TCallback = (details: _OnHistoryStateUpdatedDetails) => void> {
+ addListener(cb: TCallback, filters?: EventUrlFilters): void;
+ removeListener(cb: TCallback): void;
+ hasListener(cb: TCallback): boolean;
+ }
+
+ /* webNavigation functions */
+ /**
+ * Retrieves information about the given frame. A frame refers to an <iframe> or a <frame> of a web page and is identified by a tab ID and a frame ID.
+ * @param details Information about the frame to retrieve information about.
+ */
+ function getFrame(details: _GetFrameDetails): Promise<_GetFrameReturnDetails>;
+
+ /**
+ * Retrieves information about all frames of a given tab.
+ * @param details Information about the tab to retrieve all frames from.
+ */
+ function getAllFrames(details: _GetAllFramesDetails): Promise<_GetAllFramesReturnDetails[]>;
+
+ /* webNavigation events */
+ /** Fired when a navigation is about to occur. */
+ const onBeforeNavigate: _WebNavigationOnBeforeNavigateEvent;
+
+ /**
+ * Fired when a navigation is committed. The document (and the resources it refers to, such as images and subframes) might still be downloading, but at least part of the document has been received from the server and the browser has decided to switch to the new document.
+ */
+ const onCommitted: _WebNavigationOnCommittedEvent;
+
+ /** Fired when the page's DOM is fully constructed, but the referenced resources may not finish loading. */
+ const onDOMContentLoaded: _WebNavigationOnDOMContentLoadedEvent;
+
+ /** Fired when a document, including the resources it refers to, is completely loaded and initialized. */
+ const onCompleted: _WebNavigationOnCompletedEvent;
+
+ /**
+ * Fired when an error occurs and the navigation is aborted. This can happen if either a network error occurred, or the user aborted the navigation.
+ */
+ const onErrorOccurred: _WebNavigationOnErrorOccurredEvent;
+
+ /** Fired when a new window, or a new tab in an existing window, is created to host a navigation. */
+ const onCreatedNavigationTarget: _WebNavigationOnCreatedNavigationTargetEvent;
+
+ /**
+ * Fired when the reference fragment of a frame was updated. All future events for that frame will use the updated URL.
+ */
+ const onReferenceFragmentUpdated: _WebNavigationOnReferenceFragmentUpdatedEvent;
+
+ /** Fired when the contents of the tab is replaced by a different (usually previously pre-rendered) tab. */
+ const onTabReplaced: WebExtEvent<(details: _OnTabReplacedDetails) => void>;
+
+ /**
+ * Fired when the frame's history was updated to a new URL. All future events for that frame will use the updated URL.
+ */
+ const onHistoryStateUpdated: _WebNavigationOnHistoryStateUpdatedEvent;
+}
+
+/**
+ * Use the `browser.webRequest` API to observe and analyze traffic and to intercept, block, or modify requests in-flight.
+ *
+ * Permissions: `webRequest`
+ *
+ * Not allowed in: Content scripts, Devtools pages
+ */
+declare namespace browser.webRequest {
+ /* webRequest types */
+ type ResourceType =
+ | "main_frame"
+ | "sub_frame"
+ | "stylesheet"
+ | "script"
+ | "image"
+ | "object"
+ | "object_subrequest"
+ | "xmlhttprequest"
+ | "xslt"
+ | "ping"
+ | "beacon"
+ | "xml_dtd"
+ | "font"
+ | "media"
+ | "websocket"
+ | "csp_report"
+ | "imageset"
+ | "web_manifest"
+ | "speculative"
+ | "other";
+
+ type OnBeforeRequestOptions = "blocking" | "requestBody";
+
+ type OnBeforeSendHeadersOptions = "requestHeaders" | "blocking";
+
+ type OnSendHeadersOptions = "requestHeaders";
+
+ type OnHeadersReceivedOptions = "blocking" | "responseHeaders";
+
+ type OnAuthRequiredOptions = "responseHeaders" | "blocking" | "asyncBlocking";
+
+ type OnResponseStartedOptions = "responseHeaders";
+
+ type OnBeforeRedirectOptions = "responseHeaders";
+
+ type OnCompletedOptions = "responseHeaders";
+
+ /** An object describing filters to apply to webRequest events. */
+ interface RequestFilter {
+ /** A list of URLs or URL patterns. Requests that cannot match any of the URLs will be filtered out. */
+ urls: string[];
+ /** A list of request types. Requests that cannot match any of the types will be filtered out. */
+ types?: ResourceType[] | undefined;
+ tabId?: number | undefined;
+ windowId?: number | undefined;
+ /** If provided, requests that do not match the incognito state will be filtered out. */
+ incognito?: boolean | undefined;
+ }
+
+ /**
+ * An array of HTTP headers. Each header is represented as a dictionary containing the keys `name` and either `value` or `binaryValue`.
+ */
+ type HttpHeaders = _HttpHeaders[];
+
+ /**
+ * Returns value for event handlers that have the 'blocking' extraInfoSpec applied. Allows the event handler to modify network requests.
+ */
+ interface BlockingResponse {
+ /**
+ * If true, the request is cancelled. Used in onBeforeRequest, this prevents the request from being sent.
+ */
+ cancel?: boolean | undefined;
+ /**
+ * Only used as a response to the onBeforeRequest and onHeadersReceived events. If set, the original request is prevented from being sent/completed and is instead redirected to the given URL. Redirections to non-HTTP schemes such as data: are allowed. Redirects initiated by a redirect action use the original request method for the redirect, with one exception: If the redirect is initiated at the onHeadersReceived stage, then the redirect will be issued using the GET method.
+ */
+ redirectUrl?: string | undefined;
+ /**
+ * Only used as a response to the onBeforeRequest event. If set, the original request is prevented from being sent/completed and is instead upgraded to a secure request. If any extension returns `redirectUrl` during onBeforeRequest, `upgradeToSecure` will have no affect.
+ */
+ upgradeToSecure?: boolean | undefined;
+ /**
+ * Only used as a response to the onBeforeSendHeaders event. If set, the request is made with these request headers instead.
+ */
+ requestHeaders?: HttpHeaders | undefined;
+ /**
+ * Only used as a response to the onHeadersReceived event. If set, the server is assumed to have responded with these response headers instead. Only return `responseHeaders` if you really want to modify the headers in order to limit the number of conflicts (only one extension may modify `responseHeaders` for each request).
+ */
+ responseHeaders?: HttpHeaders | undefined;
+ /**
+ * Only used as a response to the onAuthRequired event. If set, the request is made using the supplied credentials.
+ */
+ authCredentials?: _BlockingResponseAuthCredentials | undefined;
+ }
+
+ /** Contains the certificate properties of the request if it is a secure request. */
+ interface CertificateInfo {
+ subject: string;
+ issuer: string;
+ /** Contains start and end timestamps. */
+ validity: _CertificateInfoValidity;
+ fingerprint: _CertificateInfoFingerprint;
+ serialNumber: string;
+ isBuiltInRoot: boolean;
+ subjectPublicKeyInfoDigest: _CertificateInfoSubjectPublicKeyInfoDigest;
+ rawDER?: number[] | undefined;
+ }
+
+ type CertificateTransparencyStatus =
+ | "not_applicable"
+ | "policy_compliant"
+ | "policy_not_enough_scts"
+ | "policy_not_diverse_scts";
+
+ type TransportWeaknessReasons = "cipher";
+
+ /** Contains the security properties of the request (ie. SSL/TLS information). */
+ interface SecurityInfo {
+ state: _SecurityInfoState;
+ /** Error message if state is "broken" */
+ errorMessage?: string | undefined;
+ /** Protocol version if state is "secure" */
+ protocolVersion?: _SecurityInfoProtocolVersion | undefined;
+ /** The cipher suite used in this request if state is "secure". */
+ cipherSuite?: string | undefined;
+ /** The key exchange algorithm used in this request if state is "secure". */
+ keaGroupName?: string | undefined;
+ /** The length (in bits) of the secret key. */
+ secretKeyLength?: number | undefined;
+ /** The signature scheme used in this request if state is "secure". */
+ signatureSchemeName?: string | undefined;
+ /**
+ * Certificate data if state is "secure". Will only contain one entry unless `certificateChain` is passed as an option.
+ */
+ certificates: CertificateInfo[];
+ /** The type of certificate error that was overridden for this connection, if any. */
+ overridableErrorCategory?: _SecurityInfoOverridableErrorCategory | undefined;
+ /**
+ * The domain name does not match the certificate domain.
+ * @deprecated Please use `SecurityInfo.overridableErrorCategory`.
+ */
+ isDomainMismatch?: boolean | undefined;
+ /**
+ * The certificate is either expired or is not yet valid. See `CertificateInfo.validity` for start and end dates.
+ * @deprecated Please use `SecurityInfo.overridableErrorCategory`.
+ */
+ isNotValidAtThisTime?: boolean | undefined;
+ /** @deprecated Please use `SecurityInfo.overridableErrorCategory`. */
+ isUntrusted?: boolean | undefined;
+ isExtendedValidation?: boolean | undefined;
+ /**
+ * Certificate transparency compliance per RFC 6962\. See `https://www.certificate-transparency.org/what-is-ct` for more information.
+ */
+ certificateTransparencyStatus?: CertificateTransparencyStatus | undefined;
+ /** True if host uses Strict Transport Security and state is "secure". */
+ hsts?: boolean | undefined;
+ /** True if host uses Public Key Pinning and state is "secure". */
+ hpkp?: string | undefined;
+ /** list of reasons that cause the request to be considered weak, if state is "weak" */
+ weaknessReasons?: TransportWeaknessReasons[] | undefined;
+ }
+
+ /** Contains data uploaded in a URL request. */
+ interface UploadData {
+ /** An ArrayBuffer with a copy of the data. */
+ bytes?: any;
+ /** A string with the file's path and name. */
+ file?: string | undefined;
+ }
+
+ /** Tracking flags that match our internal tracking classification */
+ type UrlClassificationFlags =
+ | "fingerprinting"
+ | "fingerprinting_content"
+ | "cryptomining"
+ | "cryptomining_content"
+ | "emailtracking"
+ | "emailtracking_content"
+ | "tracking"
+ | "tracking_ad"
+ | "tracking_analytics"
+ | "tracking_social"
+ | "tracking_content"
+ | "any_basic_tracking"
+ | "any_strict_tracking"
+ | "any_social_tracking";
+
+ /** If the request has been classified this is an array of `UrlClassificationFlags`. */
+ type UrlClassificationParty = UrlClassificationFlags[];
+
+ interface UrlClassification {
+ /** Classification flags if the request has been classified and it is first party. */
+ firstParty: UrlClassificationParty;
+ /**
+ * Classification flags if the request has been classified and it or its window hierarchy is third party.
+ */
+ thirdParty: UrlClassificationParty;
+ }
+
+ /** An object you can use to monitor and modify HTTP responses. */
+ interface StreamFilter {
+ /** Describes the current status of the stream. */
+ status: _StreamFilterStatus;
+ /** A string that will contain an error message after the onerror event has fired. */
+ error: string;
+ /** Event handler which is called when an error has occurred. */
+ onerror: ((event: Event) => void) | null;
+ /** Event handler which is called when the stream has no more data to deliver and has closed. */
+ onstop: ((event: Event) => void) | null;
+ /** Event handler which is called when the stream is about to start receiving data. */
+ onstart: ((event: Event) => void) | null;
+ /** Event handler which is called when incoming data is available. */
+ ondata: ((event: _StreamFilterOndataEvent) => void) | null;
+ /** Closes the request. */
+ close(): void;
+ /** Disconnects the filter from the request. */
+ disconnect(): void;
+ /** Suspends processing of the request. */
+ suspend(): void;
+ /** Resumes processing of the request. */
+ resume(): void;
+ /** Writes some data to the output stream. */
+ write(data: Uint8Array | ArrayBuffer): void;
+ }
+
+ interface _HttpHeaders {
+ /** Name of the HTTP header. */
+ name: string;
+ /** Value of the HTTP header if it can be represented by UTF-8. */
+ value?: string | undefined;
+ /**
+ * Value of the HTTP header if it cannot be represented by UTF-8, stored as individual byte values (0..255).
+ */
+ binaryValue?: number[] | undefined;
+ }
+
+ /**
+ * Only used as a response to the onAuthRequired event. If set, the request is made using the supplied credentials.
+ */
+ interface _BlockingResponseAuthCredentials {
+ username: string;
+ password: string;
+ }
+
+ /** Contains start and end timestamps. */
+ interface _CertificateInfoValidity {
+ start: number;
+ end: number;
+ }
+
+ interface _CertificateInfoFingerprint {
+ sha1: string;
+ sha256: string;
+ }
+
+ interface _CertificateInfoSubjectPublicKeyInfoDigest {
+ sha256: string;
+ }
+
+ type _SecurityInfoState = "insecure" | "weak" | "broken" | "secure";
+
+ /** Protocol version if state is "secure" */
+ type _SecurityInfoProtocolVersion = "TLSv1" | "TLSv1.1" | "TLSv1.2" | "TLSv1.3" | "unknown";
+
+ /** The type of certificate error that was overridden for this connection, if any. */
+ type _SecurityInfoOverridableErrorCategory = "trust_error" | "domain_mismatch" | "expired_or_not_yet_valid";
+
+ /** Describes the current status of the stream. */
+ type _StreamFilterStatus =
+ | "uninitialized"
+ | "transferringdata"
+ | "finishedtransferringdata"
+ | "suspended"
+ | "closed"
+ | "disconnected"
+ | "failed";
+
+ interface _StreamFilterOndataEvent extends Event {
+ data: ArrayBuffer;
+ }
+
+ interface _GetSecurityInfoOptions {
+ /** Include the entire certificate chain. */
+ certificateChain?: boolean | undefined;
+ /** Include raw certificate data for processing by the extension. */
+ rawDER?: boolean | undefined;
+ }
+
+ /** Contains the HTTP request body data. Only provided if extraInfoSpec contains 'requestBody'. */
+ interface _OnBeforeRequestDetailsRequestBody {
+ /** Errors when obtaining request body data. */
+ error?: string | undefined;
+ /**
+ * If the request method is POST and the body is a sequence of key-value pairs encoded in UTF8, encoded as either multipart/form-data, or application/x-www-form-urlencoded, this dictionary is present and for each key contains the list of all values for that key. If the data is of another media type, or if it is malformed, the dictionary is not present. An example value of this dictionary is {'key': ['value1', 'value2']}.
+ */
+ formData?: object | undefined;
+ /**
+ * If the request method is PUT or POST, and the body is not already parsed in formData, then the unparsed request body elements are contained in this array.
+ */
+ raw?: UploadData[] | undefined;
+ }
+
+ interface _OnBeforeRequestDetails {
+ /**
+ * The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request.
+ */
+ requestId: string;
+ url: string;
+ /** Standard HTTP method. */
+ method: string;
+ /**
+ * The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (`type` is `main_frame` or `sub_frame`), `frameId` indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab.
+ */
+ frameId: number;
+ /** ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists. */
+ parentFrameId: number;
+ /** True for private browsing requests. */
+ incognito?: boolean | undefined;
+ /** The cookie store ID of the contextual identity. */
+ cookieStoreId?: string | undefined;
+ /** URL of the resource that triggered this request. */
+ originUrl?: string | undefined;
+ /** URL of the page into which the requested resource will be loaded. */
+ documentUrl?: string | undefined;
+ /** Contains the HTTP request body data. Only provided if extraInfoSpec contains 'requestBody'. */
+ requestBody?: _OnBeforeRequestDetailsRequestBody | undefined;
+ /** The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab. */
+ tabId: number;
+ /** How the requested resource will be used. */
+ type: ResourceType;
+ /** The time when this signal is triggered, in milliseconds since the epoch. */
+ timeStamp: number;
+ /** Tracking classification if the request has been classified. */
+ urlClassification?: UrlClassification | undefined;
+ /** Indicates if this request and its content window hierarchy is third party. */
+ thirdParty: boolean;
+ }
+
+ interface _WebRequestOnBeforeRequestEvent<
+ // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
+ TCallback = (details: _OnBeforeRequestDetails) => BlockingResponse | Promise<BlockingResponse> | void,
+ > {
+ addListener(cb: TCallback, filter: RequestFilter, extraInfoSpec?: OnBeforeRequestOptions[]): void;
+ removeListener(cb: TCallback): void;
+ hasListener(cb: TCallback): boolean;
+ }
+
+ interface _OnBeforeSendHeadersDetails {
+ /**
+ * The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request.
+ */
+ requestId: string;
+ url: string;
+ /** Standard HTTP method. */
+ method: string;
+ /**
+ * The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (`type` is `main_frame` or `sub_frame`), `frameId` indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab.
+ */
+ frameId: number;
+ /** ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists. */
+ parentFrameId: number;
+ /** True for private browsing requests. */
+ incognito?: boolean | undefined;
+ /** The cookie store ID of the contextual identity. */
+ cookieStoreId?: string | undefined;
+ /** URL of the resource that triggered this request. */
+ originUrl?: string | undefined;
+ /** URL of the page into which the requested resource will be loaded. */
+ documentUrl?: string | undefined;
+ /** The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab. */
+ tabId: number;
+ /** How the requested resource will be used. */
+ type: ResourceType;
+ /** The time when this signal is triggered, in milliseconds since the epoch. */
+ timeStamp: number;
+ /** The HTTP request headers that are going to be sent out with this request. */
+ requestHeaders?: HttpHeaders | undefined;
+ /** Tracking classification if the request has been classified. */
+ urlClassification?: UrlClassification | undefined;
+ /** Indicates if this request and its content window hierarchy is third party. */
+ thirdParty: boolean;
+ }
+
+ interface _WebRequestOnBeforeSendHeadersEvent<
+ // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
+ TCallback = (details: _OnBeforeSendHeadersDetails) => BlockingResponse | Promise<BlockingResponse> | void,
+ > {
+ addListener(cb: TCallback, filter: RequestFilter, extraInfoSpec?: OnBeforeSendHeadersOptions[]): void;
+ removeListener(cb: TCallback): void;
+ hasListener(cb: TCallback): boolean;
+ }
+
+ interface _OnSendHeadersDetails {
+ /**
+ * The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request.
+ */
+ requestId: string;
+ url: string;
+ /** Standard HTTP method. */
+ method: string;
+ /**
+ * The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (`type` is `main_frame` or `sub_frame`), `frameId` indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab.
+ */
+ frameId: number;
+ /** ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists. */
+ parentFrameId: number;
+ /** True for private browsing requests. */
+ incognito?: boolean | undefined;
+ /** The cookie store ID of the contextual identity. */
+ cookieStoreId?: string | undefined;
+ /** URL of the resource that triggered this request. */
+ originUrl?: string | undefined;
+ /** URL of the page into which the requested resource will be loaded. */
+ documentUrl?: string | undefined;
+ /** The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab. */
+ tabId: number;
+ /** How the requested resource will be used. */
+ type: ResourceType;
+ /** The time when this signal is triggered, in milliseconds since the epoch. */
+ timeStamp: number;
+ /** The HTTP request headers that have been sent out with this request. */
+ requestHeaders?: HttpHeaders | undefined;
+ /** Tracking classification if the request has been classified. */
+ urlClassification?: UrlClassification | undefined;
+ /** Indicates if this request and its content window hierarchy is third party. */
+ thirdParty: boolean;
+ }
+
+ interface _WebRequestOnSendHeadersEvent<TCallback = (details: _OnSendHeadersDetails) => void> {
+ addListener(cb: TCallback, filter: RequestFilter, extraInfoSpec?: OnSendHeadersOptions[]): void;
+ removeListener(cb: TCallback): void;
+ hasListener(cb: TCallback): boolean;
+ }
+
+ interface _OnHeadersReceivedDetails {
+ /**
+ * The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request.
+ */
+ requestId: string;
+ url: string;
+ /** Standard HTTP method. */
+ method: string;
+ /**
+ * The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (`type` is `main_frame` or `sub_frame`), `frameId` indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab.
+ */
+ frameId: number;
+ /** ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists. */
+ parentFrameId: number;
+ /** True for private browsing requests. */
+ incognito?: boolean | undefined;
+ /** The cookie store ID of the contextual identity. */
+ cookieStoreId?: string | undefined;
+ /** URL of the resource that triggered this request. */
+ originUrl?: string | undefined;
+ /** URL of the page into which the requested resource will be loaded. */
+ documentUrl?: string | undefined;
+ /** The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab. */
+ tabId: number;
+ /** How the requested resource will be used. */
+ type: ResourceType;
+ /** The time when this signal is triggered, in milliseconds since the epoch. */
+ timeStamp: number;
+ /**
+ * HTTP status line of the response or the 'HTTP/0.9 200 OK' string for HTTP/0.9 responses (i.e., responses that lack a status line).
+ */
+ statusLine: string;
+ /** The HTTP response headers that have been received with this response. */
+ responseHeaders?: HttpHeaders | undefined;
+ /** Standard HTTP status code returned by the server. */
+ statusCode: number;
+ /** Tracking classification if the request has been classified. */
+ urlClassification?: UrlClassification | undefined;
+ /** Indicates if this request and its content window hierarchy is third party. */
+ thirdParty: boolean;
+ }
+
+ interface _WebRequestOnHeadersReceivedEvent<
+ // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
+ TCallback = (details: _OnHeadersReceivedDetails) => BlockingResponse | Promise<BlockingResponse> | void,
+ > {
+ addListener(cb: TCallback, filter: RequestFilter, extraInfoSpec?: OnHeadersReceivedOptions[]): void;
+ removeListener(cb: TCallback): void;
+ hasListener(cb: TCallback): boolean;
+ }
+
+ /** The server requesting authentication. */
+ interface _OnAuthRequiredDetailsChallenger {
+ host: string;
+ port: number;
+ }
+
+ interface _OnAuthRequiredDetails {
+ /**
+ * The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request.
+ */
+ requestId: string;
+ url: string;
+ /** Standard HTTP method. */
+ method: string;
+ /**
+ * The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (`type` is `main_frame` or `sub_frame`), `frameId` indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab.
+ */
+ frameId: number;
+ /** ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists. */
+ parentFrameId: number;
+ /** True for private browsing requests. */
+ incognito?: boolean | undefined;
+ /** The cookie store ID of the contextual identity. */
+ cookieStoreId?: string | undefined;
+ /** URL of the resource that triggered this request. */
+ originUrl?: string | undefined;
+ /** URL of the page into which the requested resource will be loaded. */
+ documentUrl?: string | undefined;
+ /** The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab. */
+ tabId: number;
+ /** How the requested resource will be used. */
+ type: ResourceType;
+ /** The time when this signal is triggered, in milliseconds since the epoch. */
+ timeStamp: number;
+ /** The authentication scheme, e.g. Basic or Digest. */
+ scheme: string;
+ /** The authentication realm provided by the server, if there is one. */
+ realm?: string | undefined;
+ /** The server requesting authentication. */
+ challenger: _OnAuthRequiredDetailsChallenger;
+ /** True for Proxy-Authenticate, false for WWW-Authenticate. */
+ isProxy: boolean;
+ /** The HTTP response headers that were received along with this response. */
+ responseHeaders?: HttpHeaders | undefined;
+ /**
+ * HTTP status line of the response or the 'HTTP/0.9 200 OK' string for HTTP/0.9 responses (i.e., responses that lack a status line) or an empty string if there are no headers.
+ */
+ statusLine: string;
+ /** Standard HTTP status code returned by the server. */
+ statusCode: number;
+ /** Tracking classification if the request has been classified. */
+ urlClassification?: UrlClassification | undefined;
+ /** Indicates if this request and its content window hierarchy is third party. */
+ thirdParty: boolean;
+ }
+
+ interface _WebRequestOnAuthRequiredEvent<
+ // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
+ TCallback = (details: _OnAuthRequiredDetails) => BlockingResponse | Promise<BlockingResponse> | void,
+ > {
+ addListener(cb: TCallback, filter: RequestFilter, extraInfoSpec?: OnAuthRequiredOptions[]): void;
+ removeListener(cb: TCallback): void;
+ hasListener(cb: TCallback): boolean;
+ }
+
+ interface _OnResponseStartedDetails {
+ /**
+ * The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request.
+ */
+ requestId: string;
+ url: string;
+ /** Standard HTTP method. */
+ method: string;
+ /**
+ * The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (`type` is `main_frame` or `sub_frame`), `frameId` indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab.
+ */
+ frameId: number;
+ /** ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists. */
+ parentFrameId: number;
+ /** True for private browsing requests. */
+ incognito?: boolean | undefined;
+ /** The cookie store ID of the contextual identity. */
+ cookieStoreId?: string | undefined;
+ /** URL of the resource that triggered this request. */
+ originUrl?: string | undefined;
+ /** URL of the page into which the requested resource will be loaded. */
+ documentUrl?: string | undefined;
+ /** The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab. */
+ tabId: number;
+ /** How the requested resource will be used. */
+ type: ResourceType;
+ /** The time when this signal is triggered, in milliseconds since the epoch. */
+ timeStamp: number;
+ /**
+ * The server IP address that the request was actually sent to. Note that it may be a literal IPv6 address.
+ */
+ ip?: string | undefined;
+ /** Indicates if this response was fetched from disk cache. */
+ fromCache: boolean;
+ /** Standard HTTP status code returned by the server. */
+ statusCode: number;
+ /** The HTTP response headers that were received along with this response. */
+ responseHeaders?: HttpHeaders | undefined;
+ /**
+ * HTTP status line of the response or the 'HTTP/0.9 200 OK' string for HTTP/0.9 responses (i.e., responses that lack a status line) or an empty string if there are no headers.
+ */
+ statusLine: string;
+ /** Tracking classification if the request has been classified. */
+ urlClassification?: UrlClassification | undefined;
+ /** Indicates if this request and its content window hierarchy is third party. */
+ thirdParty: boolean;
+ }
+
+ interface _WebRequestOnResponseStartedEvent<TCallback = (details: _OnResponseStartedDetails) => void> {
+ addListener(cb: TCallback, filter: RequestFilter, extraInfoSpec?: OnResponseStartedOptions[]): void;
+ removeListener(cb: TCallback): void;
+ hasListener(cb: TCallback): boolean;
+ }
+
+ interface _OnBeforeRedirectDetails {
+ /**
+ * The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request.
+ */
+ requestId: string;
+ url: string;
+ /** Standard HTTP method. */
+ method: string;
+ /**
+ * The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (`type` is `main_frame` or `sub_frame`), `frameId` indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab.
+ */
+ frameId: number;
+ /** ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists. */
+ parentFrameId: number;
+ /** True for private browsing requests. */
+ incognito?: boolean | undefined;
+ /** The cookie store ID of the contextual identity. */
+ cookieStoreId?: string | undefined;
+ /** URL of the resource that triggered this request. */
+ originUrl?: string | undefined;
+ /** URL of the page into which the requested resource will be loaded. */
+ documentUrl?: string | undefined;
+ /** The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab. */
+ tabId: number;
+ /** How the requested resource will be used. */
+ type: ResourceType;
+ /** The time when this signal is triggered, in milliseconds since the epoch. */
+ timeStamp: number;
+ /**
+ * The server IP address that the request was actually sent to. Note that it may be a literal IPv6 address.
+ */
+ ip?: string | undefined;
+ /** Indicates if this response was fetched from disk cache. */
+ fromCache: boolean;
+ /** Standard HTTP status code returned by the server. */
+ statusCode: number;
+ /** The new URL. */
+ redirectUrl: string;
+ /** The HTTP response headers that were received along with this redirect. */
+ responseHeaders?: HttpHeaders | undefined;
+ /**
+ * HTTP status line of the response or the 'HTTP/0.9 200 OK' string for HTTP/0.9 responses (i.e., responses that lack a status line) or an empty string if there are no headers.
+ */
+ statusLine: string;
+ /** Tracking classification if the request has been classified. */
+ urlClassification?: UrlClassification | undefined;
+ /** Indicates if this request and its content window hierarchy is third party. */
+ thirdParty: boolean;
+ }
+
+ interface _WebRequestOnBeforeRedirectEvent<TCallback = (details: _OnBeforeRedirectDetails) => void> {
+ addListener(cb: TCallback, filter: RequestFilter, extraInfoSpec?: OnBeforeRedirectOptions[]): void;
+ removeListener(cb: TCallback): void;
+ hasListener(cb: TCallback): boolean;
+ }
+
+ interface _OnCompletedDetails {
+ /**
+ * The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request.
+ */
+ requestId: string;
+ url: string;
+ /** Standard HTTP method. */
+ method: string;
+ /**
+ * The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (`type` is `main_frame` or `sub_frame`), `frameId` indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab.
+ */
+ frameId: number;
+ /** ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists. */
+ parentFrameId: number;
+ /** True for private browsing requests. */
+ incognito?: boolean | undefined;
+ /** The cookie store ID of the contextual identity. */
+ cookieStoreId?: string | undefined;
+ /** URL of the resource that triggered this request. */
+ originUrl?: string | undefined;
+ /** URL of the page into which the requested resource will be loaded. */
+ documentUrl?: string | undefined;
+ /** The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab. */
+ tabId: number;
+ /** How the requested resource will be used. */
+ type: ResourceType;
+ /** The time when this signal is triggered, in milliseconds since the epoch. */
+ timeStamp: number;
+ /**
+ * The server IP address that the request was actually sent to. Note that it may be a literal IPv6 address.
+ */
+ ip?: string | undefined;
+ /** Indicates if this response was fetched from disk cache. */
+ fromCache: boolean;
+ /** Standard HTTP status code returned by the server. */
+ statusCode: number;
+ /** The HTTP response headers that were received along with this response. */
+ responseHeaders?: HttpHeaders | undefined;
+ /**
+ * HTTP status line of the response or the 'HTTP/0.9 200 OK' string for HTTP/0.9 responses (i.e., responses that lack a status line) or an empty string if there are no headers.
+ */
+ statusLine: string;
+ /** Tracking classification if the request has been classified. */
+ urlClassification: UrlClassification;
+ /** Indicates if this request and its content window hierarchy is third party. */
+ thirdParty: boolean;
+ /** For http requests, the bytes transferred in the request. Only available in onCompleted. */
+ requestSize: number;
+ /** For http requests, the bytes received in the request. Only available in onCompleted. */
+ responseSize: number;
+ }
+
+ interface _WebRequestOnCompletedEvent<TCallback = (details: _OnCompletedDetails) => void> {
+ addListener(cb: TCallback, filter: RequestFilter, extraInfoSpec?: OnCompletedOptions[]): void;
+ removeListener(cb: TCallback): void;
+ hasListener(cb: TCallback): boolean;
+ }
+
+ interface _OnErrorOccurredDetails {
+ /**
+ * The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request.
+ */
+ requestId: string;
+ url: string;
+ /** Standard HTTP method. */
+ method: string;
+ /**
+ * The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (`type` is `main_frame` or `sub_frame`), `frameId` indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab.
+ */
+ frameId: number;
+ /** ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists. */
+ parentFrameId: number;
+ /** True for private browsing requests. */
+ incognito?: boolean | undefined;
+ /** The cookie store ID of the contextual identity. */
+ cookieStoreId?: string | undefined;
+ /** URL of the resource that triggered this request. */
+ originUrl?: string | undefined;
+ /** URL of the page into which the requested resource will be loaded. */
+ documentUrl?: string | undefined;
+ /** The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab. */
+ tabId: number;
+ /** How the requested resource will be used. */
+ type: ResourceType;
+ /** The time when this signal is triggered, in milliseconds since the epoch. */
+ timeStamp: number;
+ /**
+ * The server IP address that the request was actually sent to. Note that it may be a literal IPv6 address.
+ */
+ ip?: string | undefined;
+ /** Indicates if this response was fetched from disk cache. */
+ fromCache: boolean;
+ /**
+ * The error description. This string is _not_ guaranteed to remain backwards compatible between releases. You must not parse and act based upon its content.
+ */
+ error: string;
+ /** Tracking classification if the request has been classified. */
+ urlClassification?: UrlClassification | undefined;
+ /** Indicates if this request and its content window hierarchy is third party. */
+ thirdParty: boolean;
+ }
+
+ interface _WebRequestOnErrorOccurredEvent<TCallback = (details: _OnErrorOccurredDetails) => void> {
+ addListener(cb: TCallback, filter: RequestFilter): void;
+ removeListener(cb: TCallback): void;
+ hasListener(cb: TCallback): boolean;
+ }
+
+ /* webRequest properties */
+ /**
+ * The maximum number of times that `handlerBehaviorChanged` can be called per 10 minute sustained interval. `handlerBehaviorChanged` is an expensive function call that shouldn't be called often.
+ */
+ const MAX_HANDLER_BEHAVIOR_CHANGED_CALLS_PER_10_MINUTES: number;
+
+ /* webRequest functions */
+ /**
+ * Needs to be called when the behavior of the webRequest handlers has changed to prevent incorrect handling due to caching. This function call is expensive. Don't call it often.
+ */
+ function handlerBehaviorChanged(): Promise<void>;
+
+ /** ... */
+ function filterResponseData(requestId: string): StreamFilter;
+
+ /**
+ * Retrieves the security information for the request. Returns a promise that will resolve to a SecurityInfo object.
+ */
+ function getSecurityInfo(requestId: string, options?: _GetSecurityInfoOptions): Promise<SecurityInfo>;
+
+ /* webRequest events */
+ /**
+ * Fired when a request is about to occur.
+ * @returns If "blocking" is specified in the "extraInfoSpec" parameter, the event listener should return an object of this type.
+ */
+ const onBeforeRequest: _WebRequestOnBeforeRequestEvent;
+
+ /**
+ * Fired before sending an HTTP request, once the request headers are available. This may occur after a TCP connection is made to the server, but before any HTTP data is sent.
+ * @returns If "blocking" is specified in the "extraInfoSpec" parameter, the event listener should return an object of this type.
+ */
+ const onBeforeSendHeaders: _WebRequestOnBeforeSendHeadersEvent;
+
+ /**
+ * Fired just before a request is going to be sent to the server (modifications of previous onBeforeSendHeaders callbacks are visible by the time onSendHeaders is fired).
+ */
+ const onSendHeaders: _WebRequestOnSendHeadersEvent;
+
+ /**
+ * Fired when HTTP response headers of a request have been received.
+ * @returns If "blocking" is specified in the "extraInfoSpec" parameter, the event listener should return an object of this type.
+ */
+ const onHeadersReceived: _WebRequestOnHeadersReceivedEvent;
+
+ /**
+ * Fired when an authentication failure is received. The listener has three options: it can provide authentication credentials, it can cancel the request and display the error page, or it can take no action on the challenge. If bad user credentials are provided, this may be called multiple times for the same request.
+ * @returns If "blocking" is specified in the "extraInfoSpec" parameter, the event listener should return an object of this type.
+ */
+ const onAuthRequired: _WebRequestOnAuthRequiredEvent;
+
+ /**
+ * Fired when the first byte of the response body is received. For HTTP requests, this means that the status line and response headers are available.
+ */
+ const onResponseStarted: _WebRequestOnResponseStartedEvent;
+
+ /** Fired when a server-initiated redirect is about to occur. */
+ const onBeforeRedirect: _WebRequestOnBeforeRedirectEvent;
+
+ /** Fired when a request is completed. */
+ const onCompleted: _WebRequestOnCompletedEvent;
+
+ /** Fired when an error occurs. */
+ const onErrorOccurred: _WebRequestOnErrorOccurredEvent;
+}
+
+/**
+ * Use the `browser.bookmarks` API to create, organize, and otherwise manipulate bookmarks. Also see Override Pages, which you can use to create a custom Bookmark Manager page.
+ *
+ * Permissions: `bookmarks`
+ *
+ * Not allowed in: Content scripts, Devtools pages
+ */
+declare namespace browser.bookmarks {
+ /* bookmarks types */
+ /**
+ * Indicates the reason why this node is unmodifiable. The `managed` value indicates that this node was configured by the system administrator or by the custodian of a supervised user. Omitted if the node can be modified by the user and the extension (default).
+ */
+ type BookmarkTreeNodeUnmodifiable = "managed";
+
+ /** Indicates the type of a BookmarkTreeNode, which can be one of bookmark, folder or separator. */
+ type BookmarkTreeNodeType = "bookmark" | "folder" | "separator";
+
+ /**
+ * A node (either a bookmark or a folder) in the bookmark tree. Child nodes are ordered within their parent folder.
+ */
+ interface BookmarkTreeNode {
+ /**
+ * The unique identifier for the node. IDs are unique within the current profile, and they remain valid even after the browser is restarted.
+ */
+ id: string;
+ /** The `id` of the parent folder. Omitted for the root node. */
+ parentId?: string | undefined;
+ /** The 0-based position of this node within its parent folder. */
+ index?: number | undefined;
+ /** The URL navigated to when a user clicks the bookmark. Omitted for folders. */
+ url?: string | undefined;
+ /** The text displayed for the node. */
+ title: string;
+ /** When this node was created, in milliseconds since the epoch (`new Date(dateAdded)`). */
+ dateAdded?: number | undefined;
+ /** When the contents of this folder last changed, in milliseconds since the epoch. */
+ dateGroupModified?: number | undefined;
+ /**
+ * Indicates the reason why this node is unmodifiable. The `managed` value indicates that this node was configured by the system administrator or by the custodian of a supervised user. Omitted if the node can be modified by the user and the extension (default).
+ */
+ unmodifiable?: BookmarkTreeNodeUnmodifiable | undefined;
+ /** Indicates the type of the BookmarkTreeNode, which can be one of bookmark, folder or separator. */
+ type?: BookmarkTreeNodeType | undefined;
+ /** An ordered list of children of this node. */
+ children?: BookmarkTreeNode[] | undefined;
+ }
+
+ /** Object passed to the create() function. */
+ interface CreateDetails {
+ /** Defaults to the Other Bookmarks folder. */
+ parentId?: string | undefined;
+ index?: number | undefined;
+ title?: string | undefined;
+ url?: string | undefined;
+ /** Indicates the type of BookmarkTreeNode to create, which can be one of bookmark, folder or separator. */
+ type?: BookmarkTreeNodeType | undefined;
+ }
+
+ interface _MoveDestination {
+ parentId?: string | undefined;
+ index?: number | undefined;
+ }
+
+ interface _UpdateChanges {
+ title?: string | undefined;
+ url?: string | undefined;
+ }
+
+ interface _OnRemovedRemoveInfo {
+ parentId: string;
+ index: number;
+ node: BookmarkTreeNode;
+ }
+
+ interface _OnChangedChangeInfo {
+ title: string;
+ url?: string | undefined;
+ }
+
+ interface _OnMovedMoveInfo {
+ parentId: string;
+ index: number;
+ oldParentId: string;
+ oldIndex: number;
+ }
+
+ interface _OnChildrenReorderedReorderInfo {
+ childIds: string[];
+ }
+
+ /* bookmarks functions */
+ /**
+ * Retrieves the specified BookmarkTreeNode(s).
+ * @param idOrIdList A single string-valued id, or an array of string-valued ids
+ */
+ function get(idOrIdList: string | string[]): Promise<BookmarkTreeNode[]>;
+
+ /** Retrieves the children of the specified BookmarkTreeNode id. */
+ function getChildren(id: string): Promise<BookmarkTreeNode[]>;
+
+ /**
+ * Retrieves the recently added bookmarks.
+ * @param numberOfItems The maximum number of items to return.
+ */
+ function getRecent(numberOfItems: number): Promise<BookmarkTreeNode[]>;
+
+ /** Retrieves the entire Bookmarks hierarchy. */
+ function getTree(): Promise<BookmarkTreeNode[]>;
+
+ /**
+ * Retrieves part of the Bookmarks hierarchy, starting at the specified node.
+ * @param id The ID of the root of the subtree to retrieve.
+ */
+ function getSubTree(id: string): Promise<BookmarkTreeNode[]>;
+
+ /**
+ * Searches for BookmarkTreeNodes matching the given query. Queries specified with an object produce BookmarkTreeNodes matching all specified properties.
+ * @param query Either a string of words that are matched against bookmark URLs and titles, or an object. If an object, the properties `query`, `url`, and `title` may be specified and bookmarks matching all specified properties will be produced.
+ */
+ function search(
+ query:
+ | string
+ | {
+ /** A string of words that are matched against bookmark URLs and titles. */
+ query?: string | undefined;
+ /** The URL of the bookmark; matches verbatim. Note that folders have no URL. */
+ url?: string | undefined;
+ /** The title of the bookmark; matches verbatim. */
+ title?: string | undefined;
+ },
+ ): Promise<BookmarkTreeNode[]>;
+
+ /**
+ * Creates a bookmark or folder under the specified parentId. If url is NULL or missing, it will be a folder.
+ */
+ function create(bookmark: CreateDetails): Promise<BookmarkTreeNode>;
+
+ /** Moves the specified BookmarkTreeNode to the provided location. */
+ function move(id: string, destination: _MoveDestination): Promise<BookmarkTreeNode>;
+
+ /**
+ * Updates the properties of a bookmark or folder. Specify only the properties that you want to change; unspecified properties will be left unchanged. **Note:** Currently, only 'title' and 'url' are supported.
+ */
+ function update(id: string, changes: _UpdateChanges): Promise<BookmarkTreeNode>;
+
+ /** Removes a bookmark or an empty bookmark folder. */
+ function remove(id: string): Promise<void>;
+
+ /** Recursively removes a bookmark folder. */
+ function removeTree(id: string): Promise<void>;
+
+ /* bookmarks events */
+ /** Fired when a bookmark or folder is created. */
+ const onCreated: WebExtEvent<(id: string, bookmark: BookmarkTreeNode) => void>;
+
+ /**
+ * Fired when a bookmark or folder is removed. When a folder is removed recursively, a single notification is fired for the folder, and none for its contents.
+ */
+ const onRemoved: WebExtEvent<(id: string, removeInfo: _OnRemovedRemoveInfo) => void>;
+
+ /**
+ * Fired when a bookmark or folder changes. **Note:** Currently, only title and url changes trigger this.
+ */
+ const onChanged: WebExtEvent<(id: string, changeInfo: _OnChangedChangeInfo) => void>;
+
+ /** Fired when a bookmark or folder is moved to a different parent folder. */
+ const onMoved: WebExtEvent<(id: string, moveInfo: _OnMovedMoveInfo) => void>;
+
+ /**
+ * Fired when the children of a folder have changed their order due to the order being sorted in the UI. This is not called as a result of a move().
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ const onChildrenReordered:
+ | WebExtEvent<(id: string, reorderInfo: _OnChildrenReorderedReorderInfo) => void>
+ | undefined;
+}
+
+/**
+ * Use the commands API to add keyboard shortcuts that trigger actions in your extension, for example, an action to open the browser action or send a command to the xtension.
+ *
+ * Manifest keys: `commands`
+ *
+ * Not allowed in: Content scripts, Devtools pages
+ */
+declare namespace browser.commands {
+ /* commands types */
+ interface Command {
+ /** The name of the Extension Command */
+ name?: string | undefined;
+ /** The Extension Command description */
+ description?: string | undefined;
+ /** The shortcut active for this command, or blank if not active. */
+ shortcut?: string | undefined;
+ }
+
+ /** The new description for the command. */
+ interface _UpdateDetail {
+ /** The name of the command. */
+ name: string;
+ /** The new description for the command. */
+ description?: string | undefined;
+ shortcut?: string | undefined;
+ }
+
+ /* commands functions */
+ /**
+ * Update the details of an already defined command.
+ * @param detail The new description for the command.
+ */
+ function update(detail: _UpdateDetail): Promise<void>;
+
+ /**
+ * Reset a command's details to what is specified in the manifest.
+ * @param name The name of the command.
+ */
+ function reset(name: string): Promise<void>;
+
+ /** Returns all the registered extension commands for this extension and their shortcut (if active). */
+ function getAll(): Promise<Command[]>;
+
+ /* commands events */
+ /** Fired when a registered command is activated using a keyboard shortcut. */
+ const onCommand: WebExtEvent<(command: string) => void>;
+}
+
+/**
+ * Manifest keys: `devtools_page`
+ *
+ * Allowed in: Devtools pages only
+ */
+declare namespace browser.devtools {}
+
+/**
+ * Use the `browser.devtools.inspectedWindow` API to interact with the inspected window: obtain the tab ID for the inspected page, evaluate the code in the context of the inspected window, reload the page, or obtain the list of resources within the page.
+ *
+ * Allowed in: Devtools pages only
+ */
+declare namespace browser.devtools.inspectedWindow {
+ /* devtools.inspectedWindow types */
+ /** A resource within the inspected page, such as a document, a script, or an image. */
+ interface Resource {
+ /** The URL of the resource. */
+ url: string;
+ /**
+ * Gets the content of the resource.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ getContent?(): Promise<object>;
+ /**
+ * Sets the content of the resource.
+ * @param content New content of the resource. Only resources with the text type are currently supported.
+ * @param commit True if the user has finished editing the resource, and the new content of the resource should be persisted; false if this is a minor change sent in progress of the user editing the resource.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ setContent?(content: string, commit: boolean): Promise<{ [key: string]: any }>;
+ }
+
+ /** An object providing details if an exception occurred while evaluating the expression. */
+ interface _EvalReturnExceptionInfo {
+ /** Set if the error occurred on the DevTools side before the expression is evaluated. */
+ isError: boolean;
+ /** Set if the error occurred on the DevTools side before the expression is evaluated. */
+ code: string;
+ /** Set if the error occurred on the DevTools side before the expression is evaluated. */
+ description: string;
+ /**
+ * Set if the error occurred on the DevTools side before the expression is evaluated, contains the array of the values that may be substituted into the description string to provide more information about the cause of the error.
+ */
+ details: any[];
+ /** Set if the evaluated code produces an unhandled exception. */
+ isException: boolean;
+ /** Set if the evaluated code produces an unhandled exception. */
+ value: string;
+ }
+
+ /** The options parameter can contain one or more options. */
+ interface _EvalOptions {
+ /**
+ * If specified, the expression is evaluated on the iframe whose URL matches the one specified. By default, the expression is evaluated in the top frame of the inspected page.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ frameURL?: string | undefined;
+ /**
+ * Evaluate the expression in the context of the content script of the calling extension, provided that the content script is already injected into the inspected page. If not, the expression is not evaluated and the callback is invoked with the exception parameter set to an object that has the `isError` field set to true and the `code` field set to `E_NOTFOUND`.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ useContentScriptContext?: boolean | undefined;
+ /**
+ * Evaluate the expression in the context of a content script of an extension that matches the specified origin. If given, contextSecurityOrigin overrides the 'true' setting on userContentScriptContext.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ contextSecurityOrigin?: string | undefined;
+ }
+
+ interface _ReloadReloadOptions {
+ /**
+ * When true, the loader will bypass the cache for all inspected page resources loaded before the `load` event is fired. The effect is similar to pressing Ctrl+Shift+R in the inspected window or within the Developer Tools window.
+ */
+ ignoreCache?: boolean | undefined;
+ /**
+ * If specified, the string will override the value of the `User-Agent` HTTP header that's sent while loading the resources of the inspected page. The string will also override the value of the `navigator.userAgent` property that's returned to any scripts that are running within the inspected page.
+ */
+ userAgent?: string | undefined;
+ /**
+ * If specified, the script will be injected into every frame of the inspected page immediately upon load, before any of the frame's scripts. The script will not be injected after subsequent reloads—for example, if the user presses Ctrl+R.
+ */
+ injectedScript?: string | undefined;
+ /**
+ * If specified, this script evaluates into a function that accepts three string arguments: the source to preprocess, the URL of the source, and a function name if the source is an DOM event handler. The preprocessorerScript function should return a string to be compiled by Chrome in place of the input source. In the case that the source is a DOM event handler, the returned source must compile to a single JS function.
+ * @deprecated Please avoid using this parameter, it will be removed soon.
+ */
+ preprocessorScript?: string | undefined;
+ }
+
+ /* devtools.inspectedWindow properties */
+ /** The ID of the tab being inspected. This ID may be used with browser.tabs.* API. */
+ const tabId: number;
+
+ /* devtools.inspectedWindow functions */
+ /**
+ * Evaluates a JavaScript expression in the context of the main frame of the inspected page. The expression must evaluate to a JSON-compliant object, otherwise an exception is thrown. The eval function can report either a DevTools-side error or a JavaScript exception that occurs during evaluation. In either case, the `result` parameter of the callback is `undefined`. In the case of a DevTools-side error, the `isException` parameter is non-null and has `isError` set to true and `code` set to an error code. In the case of a JavaScript error, `isException` is set to true and `value` is set to the string value of thrown object.
+ * @param expression An expression to evaluate.
+ * @param [options] The options parameter can contain one or more options.
+ */
+ function eval(expression: string, options?: _EvalOptions): Promise<object>;
+
+ /** Reloads the inspected page. */
+ function reload(reloadOptions?: _ReloadReloadOptions): void;
+
+ /**
+ * Retrieves the list of resources from the inspected page.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ function getResources(): Promise<Resource[]>;
+
+ /* devtools.inspectedWindow events */
+ /**
+ * Fired when a new resource is added to the inspected page.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ const onResourceAdded: WebExtEvent<(resource: Resource) => void> | undefined;
+
+ /**
+ * Fired when a new revision of the resource is committed (e.g. user saves an edited version of the resource in the Developer Tools).
+ * @param content New content of the resource.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ const onResourceContentCommitted: WebExtEvent<(resource: Resource, content: string) => void> | undefined;
+}
+
+/**
+ * Use the `browser.devtools.network` API to retrieve the information about network requests displayed by the Developer Tools in the Network panel.
+ *
+ * Allowed in: Devtools pages only
+ */
+declare namespace browser.devtools.network {
+ /* devtools.network types */
+ /**
+ * Represents a network request for a document resource (script, image and so on). See HAR Specification for reference.
+ */
+ interface Request {
+ /** Returns content of the response body. */
+ getContent(): Promise<object>;
+ }
+
+ /* devtools.network functions */
+ /** Returns HAR log that contains all known network requests. */
+ function getHAR(): Promise<{ [key: string]: any }>;
+
+ /* devtools.network events */
+ /**
+ * Fired when a network request is finished and all request data are available.
+ * @param request Description of a network request in the form of a HAR entry. See HAR specification for details.
+ */
+ const onRequestFinished: WebExtEvent<(request: Request) => void>;
+
+ /**
+ * Fired when the inspected window navigates to a new page.
+ * @param url URL of the new page.
+ */
+ const onNavigated: WebExtEvent<(url: string) => void>;
+}
+
+/**
+ * Use the `browser.devtools.panels` API to integrate your extension into Developer Tools window UI: create your own panels, access existing panels, and add sidebars.
+ *
+ * Allowed in: Devtools pages only
+ */
+declare namespace browser.devtools.panels {
+ /* devtools.panels types */
+ /** Represents the Elements panel. */
+ interface ElementsPanel {
+ /**
+ * Creates a pane within panel's sidebar.
+ * @param title Text that is displayed in sidebar caption.
+ */
+ createSidebarPane(title: string): Promise<ExtensionSidebarPane>;
+ /** Fired when an object is selected in the panel. */
+ onSelectionChanged: WebExtEvent<() => void>;
+ }
+
+ /** Represents the Sources panel. */
+ interface SourcesPanel {
+ /**
+ * Creates a pane within panel's sidebar.
+ * @param title Text that is displayed in sidebar caption.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ createSidebarPane?(title: string): Promise<ExtensionSidebarPane>;
+ /**
+ * Fired when an object is selected in the panel.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ onSelectionChanged: WebExtEvent<() => void>;
+ }
+
+ /** Represents a panel created by extension. */
+ interface ExtensionPanel {
+ /**
+ * Appends a button to the status bar of the panel.
+ * @param iconPath Path to the icon of the button. The file should contain a 64x24-pixel image composed of two 32x24 icons. The left icon is used when the button is inactive; the right icon is displayed when the button is pressed.
+ * @param tooltipText Text shown as a tooltip when user hovers the mouse over the button.
+ * @param disabled Whether the button is disabled.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ createStatusBarButton?(iconPath: string, tooltipText: string, disabled: boolean): Button;
+ /**
+ * Fired upon a search action (start of a new search, search result navigation, or search being canceled).
+ * @param action Type of search action being performed.
+ * @param [queryString] Query string (only for 'performSearch').
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ onSearch: WebExtEvent<(action: string, queryString?: string) => void>;
+ /**
+ * Fired when the user switches to the panel.
+ * @param window The JavaScript `window` object of panel's page.
+ */
+ onShown: WebExtEvent<(window: Window) => void>;
+ /** Fired when the user switches away from the panel. */
+ onHidden: WebExtEvent<() => void>;
+ }
+
+ /** A sidebar created by the extension. */
+ interface ExtensionSidebarPane {
+ /**
+ * Sets the height of the sidebar.
+ * @param height A CSS-like size specification, such as `'100px'` or `'12ex'`.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ setHeight?(height: string): void;
+ /**
+ * Sets an expression that is evaluated within the inspected page. The result is displayed in the sidebar pane.
+ * @param expression An expression to be evaluated in context of the inspected page. JavaScript objects and DOM nodes are displayed in an expandable tree similar to the console/watch.
+ * @param [rootTitle] An optional title for the root of the expression tree.
+ */
+ setExpression(expression: string, rootTitle?: string): Promise<void>;
+ /**
+ * Sets a JSON-compliant object to be displayed in the sidebar pane.
+ * @param jsonObject An object to be displayed in context of the inspected page. Evaluated in the context of the caller (API client).
+ * @param [rootTitle] An optional title for the root of the expression tree.
+ */
+ setObject(jsonObject: string, rootTitle?: string): Promise<void>;
+ /**
+ * Sets an HTML page to be displayed in the sidebar pane.
+ * @param path Relative path of an extension page to display within the sidebar.
+ */
+ setPage(path: _manifest.ExtensionURL): Promise<any>;
+ /**
+ * Fired when the sidebar pane becomes visible as a result of user switching to the panel that hosts it.
+ * @param window The JavaScript `window` object of the sidebar page, if one was set with the `setPage()` method.
+ */
+ onShown: WebExtEvent<(window: Window) => void>;
+ /**
+ * Fired when the sidebar pane becomes hidden as a result of the user switching away from the panel that hosts the sidebar pane.
+ */
+ onHidden: WebExtEvent<() => void>;
+ }
+
+ /** A button created by the extension. */
+ interface Button {
+ /**
+ * Updates the attributes of the button. If some of the arguments are omitted or `null`, the corresponding attributes are not updated.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ update?(): void;
+ /**
+ * Updates the attributes of the button. If some of the arguments are omitted or `null`, the corresponding attributes are not updated.
+ * @param iconPath Path to the new icon of the button.
+ * @param [tooltipText] Text shown as a tooltip when user hovers the mouse over the button.
+ * @param [disabled] Whether the button is disabled.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ update?(iconPath: string, tooltipText?: string, disabled?: boolean): void;
+
+ /**
+ * Updates the attributes of the button. If some of the arguments are omitted or `null`, the corresponding attributes are not updated.
+ * @param tooltipText Text shown as a tooltip when user hovers the mouse over the button.
+ * @param disabled Whether the button is disabled.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ update?(tooltipText: string, disabled: boolean): void;
+
+ /**
+ * Updates the attributes of the button. If some of the arguments are omitted or `null`, the corresponding attributes are not updated.
+ * @param disabled Whether the button is disabled.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ update?(disabled: boolean): void;
+ /**
+ * Fired when the button is clicked.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ onClicked: WebExtEvent<() => void>;
+ }
+
+ /* devtools.panels properties */
+ /** Elements panel. */
+ const elements: ElementsPanel;
+
+ /** Sources panel. */
+ const sources: SourcesPanel;
+
+ /** The name of the current devtools theme. */
+ const themeName: string;
+
+ /* devtools.panels functions */
+ /**
+ * Creates an extension panel.
+ * @param title Title that is displayed next to the extension icon in the Developer Tools toolbar.
+ * @param iconPath Path of the panel's icon relative to the extension directory, or an empty string to use the default extension icon as the panel icon.
+ * @param pagePath Path of the panel's HTML page relative to the extension directory.
+ */
+ function create(
+ title: string,
+ iconPath: _manifest.ExtensionURL | "",
+ pagePath: _manifest.ExtensionURL,
+ ): Promise<ExtensionPanel>;
+
+ /**
+ * Specifies the function to be called when the user clicks a resource link in the Developer Tools window. To unset the handler, either call the method with no parameters or pass null as the parameter.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ function setOpenResourceHandler(): Promise<devtools.inspectedWindow.Resource>;
+
+ /**
+ * Requests DevTools to open a URL in a Developer Tools panel.
+ * @param url The URL of the resource to open.
+ * @param lineNumber Specifies the line number to scroll to when the resource is loaded.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ function openResource(url: string, lineNumber: number): Promise<void>;
+
+ /* devtools.panels events */
+ /**
+ * Fired when the devtools theme changes.
+ * @param themeName The name of the current devtools theme.
+ */
+ const onThemeChanged: WebExtEvent<(themeName: string) => void>;
+}
+
+/**
+ * Use the `browser.find` API to interact with the browser's `Find` interface.
+ *
+ * Permissions: `find`
+ *
+ * Not allowed in: Content scripts, Devtools pages
+ */
+declare namespace browser.find {
+ /** Search parameters. */
+ interface _FindParams {
+ /** Tab to query. Defaults to the active tab. */
+ tabId?: number | undefined;
+ /** Find only ranges with case sensitive match. */
+ caseSensitive?: boolean | undefined;
+ /** Find only ranges with diacritic sensitive match. */
+ matchDiacritics?: boolean | undefined;
+ /** Find only ranges that match entire word. */
+ entireWord?: boolean | undefined;
+ /** Return rectangle data which describes visual position of search results. */
+ includeRectData?: boolean | undefined;
+ /** Return range data which provides range data in a serializable form. */
+ includeRangeData?: boolean | undefined;
+ }
+
+ /** highlightResults parameters */
+ interface _HighlightResultsParams {
+ /** Found range to be highlighted. Default highlights all ranges. */
+ rangeIndex?: number | undefined;
+ /** Tab to highlight. Defaults to the active tab. */
+ tabId?: number | undefined;
+ /** Don't scroll to highlighted item. */
+ noScroll?: boolean | undefined;
+ }
+
+ /* find functions */
+ /**
+ * Search for text in document and store found ranges in array, in document order.
+ * @param queryphrase The string to search for.
+ * @param [params] Search parameters.
+ */
+ function find(
+ queryphrase: string,
+ params?: _FindParams,
+ ): Promise<{
+ count: number;
+ rangeData?: Array<{
+ framePos: number;
+ startTextNodePos: number;
+ endTextNodePos: number;
+ startOffset: number;
+ endOffset: number;
+ }>;
+ rectData?: Array<{
+ rectsAndTexts: {
+ rectList: Array<{
+ top: number;
+ left: number;
+ bottom: number;
+ right: number;
+ }>;
+ textList: string[];
+ };
+ textList: string;
+ }>;
+ }>;
+
+ /**
+ * Highlight a range
+ * @param [params] highlightResults parameters
+ */
+ function highlightResults(params?: _HighlightResultsParams): void;
+
+ /**
+ * Remove all highlighting from previous searches.
+ * @param [tabId] Tab to highlight. Defaults to the active tab.
+ */
+ function removeHighlighting(tabId?: number): void;
+}
+
+/**
+ * Use the `browser.history` API to interact with the browser's record of visited pages. You can add, remove, and query for URLs in the browser's history. To override the history page with your own version, see Override Pages.
+ *
+ * Permissions: `history`
+ *
+ * Not allowed in: Content scripts, Devtools pages
+ */
+declare namespace browser.history {
+ /* history types */
+ /** The transition type for this visit from its referrer. */
+ type TransitionType =
+ | "link"
+ | "typed"
+ | "auto_bookmark"
+ | "auto_subframe"
+ | "manual_subframe"
+ | "generated"
+ | "auto_toplevel"
+ | "form_submit"
+ | "reload"
+ | "keyword"
+ | "keyword_generated";
+
+ /** An object encapsulating one result of a history query. */
+ interface HistoryItem {
+ /** The unique identifier for the item. */
+ id: string;
+ /** The URL navigated to by a user. */
+ url?: string | undefined;
+ /** The title of the page when it was last loaded. */
+ title?: string | undefined;
+ /** When this page was last loaded, represented in milliseconds since the epoch. */
+ lastVisitTime?: number | undefined;
+ /** The number of times the user has navigated to this page. */
+ visitCount?: number | undefined;
+ /** The number of times the user has navigated to this page by typing in the address. */
+ typedCount?: number | undefined;
+ }
+
+ /** An object encapsulating one visit to a URL. */
+ interface VisitItem {
+ /** The unique identifier for the item. */
+ id: string;
+ /** The unique identifier for this visit. */
+ visitId: string;
+ /** When this visit occurred, represented in milliseconds since the epoch. */
+ visitTime?: number | undefined;
+ /** The visit ID of the referrer. */
+ referringVisitId: string;
+ /** The transition type for this visit from its referrer. */
+ transition: TransitionType;
+ }
+
+ interface _SearchQuery {
+ /** A free-text query to the history service. Leave empty to retrieve all pages. */
+ text: string;
+ /**
+ * Limit results to those visited after this date. If not specified, this defaults to 24 hours in the past.
+ */
+ startTime?: extensionTypes.Date | undefined;
+ /** Limit results to those visited before this date. */
+ endTime?: extensionTypes.Date | undefined;
+ /** The maximum number of results to retrieve. Defaults to 100. */
+ maxResults?: number | undefined;
+ }
+
+ interface _GetVisitsDetails {
+ /**
+ * The URL for which to retrieve visit information. It must be in the format as returned from a call to history.search.
+ */
+ url: string;
+ }
+
+ interface _AddUrlDetails {
+ /** The URL to add. Must be a valid URL that can be added to history. */
+ url: string;
+ /** The title of the page. */
+ title?: string | undefined;
+ /** The transition type for this visit from its referrer. */
+ transition?: TransitionType | undefined;
+ /** The date when this visit occurred. */
+ visitTime?: extensionTypes.Date | undefined;
+ }
+
+ interface _DeleteUrlDetails {
+ /** The URL to remove. */
+ url: string;
+ }
+
+ interface _DeleteRangeRange {
+ /** Items added to history after this date. */
+ startTime: extensionTypes.Date;
+ /** Items added to history before this date. */
+ endTime: extensionTypes.Date;
+ }
+
+ interface _OnVisitRemovedRemoved {
+ /** True if all history was removed. If true, then urls will be empty. */
+ allHistory: boolean;
+ urls: string[];
+ }
+
+ interface _OnTitleChangedChanged {
+ /** The URL for which the title has changed */
+ url: string;
+ /** The new title for the URL. */
+ title: string;
+ }
+
+ /* history functions */
+ /** Searches the history for the last visit time of each page matching the query. */
+ function search(query: _SearchQuery): Promise<HistoryItem[]>;
+
+ /** Retrieves information about visits to a URL. */
+ function getVisits(details: _GetVisitsDetails): Promise<VisitItem[]>;
+
+ /**
+ * Adds a URL to the history with a default visitTime of the current time and a default transition type of "link".
+ */
+ function addUrl(details: _AddUrlDetails): Promise<void>;
+
+ /** Removes all occurrences of the given URL from the history. */
+ function deleteUrl(details: _DeleteUrlDetails): Promise<void>;
+
+ /**
+ * Removes all items within the specified date range from the history. Pages will not be removed from the history unless all visits fall within the range.
+ */
+ function deleteRange(range: _DeleteRangeRange): Promise<void>;
+
+ /** Deletes all items from the history. */
+ function deleteAll(): Promise<void>;
+
+ /* history events */
+ /**
+ * Fired when a URL is visited, providing the HistoryItem data for that URL. This event fires before the page has loaded.
+ */
+ const onVisited: WebExtEvent<(result: HistoryItem) => void>;
+
+ /**
+ * Fired when one or more URLs are removed from the history service. When all visits have been removed the URL is purged from history.
+ */
+ const onVisitRemoved: WebExtEvent<(removed: _OnVisitRemovedRemoved) => void>;
+
+ /** Fired when the title of a URL is changed in the browser history. */
+ const onTitleChanged: WebExtEvent<(changed: _OnTitleChangedChanged) => void>;
+}
+
+/**
+ * Use the browser.contextMenus API to add items to the browser's context menu. You can choose what types of objects your context menu additions apply to, such as images, hyperlinks, and pages.
+ *
+ * Permissions: `contextMenus`
+ */
+declare namespace browser.contextMenus {
+ /* contextMenus types */
+ /**
+ * The different contexts a menu can appear in. Specifying 'all' is equivalent to the combination of all other contexts except for 'tab' and 'tools_menu'.
+ */
+ type ContextType = _ContextType;
+
+ /** The type of menu item. */
+ type ItemType = "normal" | "checkbox" | "radio" | "separator";
+
+ /** Information sent when a context menu item is clicked. */
+ interface OnClickData {
+ /** The ID of the menu item that was clicked. */
+ menuItemId: number | string;
+ /** The parent ID, if any, for the item clicked. */
+ parentMenuItemId?: number | string | undefined;
+ /** The type of view where the menu is clicked. May be unset if the menu is not associated with a view. */
+ viewType?: extension.ViewType | undefined;
+ /**
+ * One of 'image', 'video', or 'audio' if the context menu was activated on one of these types of elements.
+ */
+ mediaType?: string | undefined;
+ /** If the element is a link, the text of that link. */
+ linkText?: string | undefined;
+ /** If the element is a link, the URL it points to. */
+ linkUrl?: string | undefined;
+ /** Will be present for elements with a 'src' URL. */
+ srcUrl?: string | undefined;
+ /**
+ * The URL of the page where the menu item was clicked. This property is not set if the click occured in a context where there is no current page, such as in a launcher context menu.
+ */
+ pageUrl?: string | undefined;
+ /** The id of the frame of the element where the context menu was clicked. */
+ frameId?: number | undefined;
+ /** The URL of the frame of the element where the context menu was clicked, if it was in a frame. */
+ frameUrl?: string | undefined;
+ /** The text for the context selection, if any. */
+ selectionText?: string | undefined;
+ /** A flag indicating whether the element is editable (text input, textarea, etc.). */
+ editable: boolean;
+ /** A flag indicating the state of a checkbox or radio item before it was clicked. */
+ wasChecked?: boolean | undefined;
+ /** A flag indicating the state of a checkbox or radio item after it is clicked. */
+ checked?: boolean | undefined;
+ /** The id of the bookmark where the context menu was clicked, if it was on a bookmark. */
+ bookmarkId?: string | undefined;
+ /** An array of keyboard modifiers that were held while the menu item was clicked. */
+ modifiers: _OnClickDataModifiers[];
+ /** An integer value of button by which menu item was clicked. */
+ button?: number | undefined;
+ /**
+ * An identifier of the clicked element, if any. Use menus.getTargetElement in the page to find the corresponding element.
+ */
+ targetElementId?: number | undefined;
+ }
+
+ type _ContextType =
+ | "all"
+ | "page"
+ | "frame"
+ | "selection"
+ | "link"
+ | "editable"
+ | "password"
+ | "image"
+ | "video"
+ | "audio"
+ | "launcher"
+ | "bookmark"
+ | "tab"
+ | "tools_menu"
+ | "browser_action"
+ | "page_action"
+ | "action";
+
+ type _OnClickDataModifiers = "Shift" | "Alt" | "Command" | "Ctrl" | "MacCtrl";
+
+ interface _CreateCreatePropertiesIcons {
+ [key: number]: string;
+ }
+
+ type _CreateCreatePropertiesCommand =
+ | "_execute_browser_action"
+ | "_execute_page_action"
+ | "_execute_sidebar_action"
+ | "_execute_action"
+ | "_execute_page_action"
+ | "_execute_sidebar_action";
+
+ interface _CreateCreateProperties {
+ /** The type of menu item. Defaults to 'normal' if not specified. */
+ type?: ItemType | undefined;
+ /**
+ * The unique ID to assign to this item. Mandatory for event pages. Cannot be the same as another ID for this extension.
+ */
+ id?: string | undefined;
+ icons?: _CreateCreatePropertiesIcons | undefined;
+ /**
+ * The text to be displayed in the item; this is _required_ unless `type` is 'separator'. When the context is 'selection', you can use `%s` within the string to show the selected text. For example, if this parameter's value is "Translate '%s' to Pig Latin" and the user selects the word "cool", the context menu item for the selection is "Translate 'cool' to Pig Latin".
+ */
+ title?: string | undefined;
+ /**
+ * The initial state of a checkbox or radio item: true for selected and false for unselected. Only one radio item can be selected at a time in a given group of radio items.
+ */
+ checked?: boolean | undefined;
+ /** List of contexts this menu item will appear in. Defaults to ['page'] if not specified. */
+ contexts?: ContextType[] | undefined;
+ /**
+ * List of view types where the menu item will be shown. Defaults to any view, including those without a viewType.
+ */
+ viewTypes?: extension.ViewType[] | undefined;
+ /** Whether the item is visible in the menu. */
+ visible?: boolean | undefined;
+ /**
+ * A function that will be called back when the menu item is clicked. Event pages cannot use this; instead, they should register a listener for `contextMenus.onClicked`.
+ * @param info Information about the item clicked and the context where the click happened.
+ * @param tab The details of the tab where the click took place. Note: this parameter only present for extensions.
+ * Not supported on manifest versions above 2.
+ */
+ // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
+ onclick?: (info: OnClickData, tab: tabs.Tab) => void | undefined;
+ /** The ID of a parent menu item; this makes the item a child of a previously added item. */
+ parentId?: number | string | undefined;
+ /**
+ * Lets you restrict the item to apply only to documents whose URL matches one of the given patterns. (This applies to frames as well.) For details on the format of a pattern, see Match Patterns.
+ */
+ documentUrlPatterns?: string[] | undefined;
+ /**
+ * Similar to documentUrlPatterns, but lets you filter based on the src attribute of img/audio/video tags and the href of anchor tags.
+ */
+ targetUrlPatterns?: string[] | undefined;
+ /** Whether this context menu item is enabled or disabled. Defaults to true. */
+ enabled?: boolean | undefined;
+ /** Specifies a command to issue for the context click. */
+ command?: string | _CreateCreatePropertiesCommand | undefined;
+ }
+
+ interface _UpdateUpdatePropertiesIcons {
+ [key: number]: string;
+ }
+
+ /** The properties to update. Accepts the same values as the create function. */
+ interface _UpdateUpdateProperties {
+ type?: ItemType | undefined;
+ icons?: _UpdateUpdatePropertiesIcons | undefined;
+ title?: string | undefined;
+ checked?: boolean | undefined;
+ contexts?: ContextType[] | undefined;
+ viewTypes?: extension.ViewType[] | undefined;
+ /** Whether the item is visible in the menu. */
+ visible?: boolean | undefined;
+ /**
+ * @param tab The details of the tab where the click took place. Note: this parameter only present for extensions.
+ * Not supported on manifest versions above 2.
+ */
+ // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
+ onclick?: (info: OnClickData, tab: tabs.Tab) => void | undefined;
+ /** Note: You cannot change an item to be a child of one of its own descendants. */
+ parentId?: number | string | undefined;
+ documentUrlPatterns?: string[] | undefined;
+ targetUrlPatterns?: string[] | undefined;
+ enabled?: boolean | undefined;
+ }
+
+ /**
+ * ContextType to override, to allow menu items from other extensions in the menu. Currently only 'bookmark' and 'tab' are supported. showDefaults cannot be used with this option.
+ */
+ type _OverrideContextContextOptionsContext = "bookmark" | "tab";
+
+ interface _OverrideContextContextOptions {
+ /** Whether to also include default menu items in the menu. */
+ showDefaults?: boolean | undefined;
+ /**
+ * ContextType to override, to allow menu items from other extensions in the menu. Currently only 'bookmark' and 'tab' are supported. showDefaults cannot be used with this option.
+ */
+ context?: _OverrideContextContextOptionsContext | undefined;
+ /** Required when context is 'bookmark'. Requires 'bookmark' permission. */
+ bookmarkId?: string | undefined;
+ /** Required when context is 'tab'. Requires 'tabs' permission. */
+ tabId?: number | undefined;
+ }
+
+ /**
+ * Information about the context of the menu action and the created menu items. For more information about each property, see OnClickData. The following properties are only set if the extension has host permissions for the given context: linkUrl, linkText, srcUrl, pageUrl, frameUrl, selectionText.
+ */
+ interface _OnShownInfo {
+ /** A list of IDs of the menu items that were shown. */
+ menuIds: Array<number | string>;
+ /** A list of all contexts that apply to the menu. */
+ contexts: ContextType[];
+ viewType?: extension.ViewType | undefined;
+ editable: boolean;
+ mediaType?: string | undefined;
+ linkUrl?: string | undefined;
+ linkText?: string | undefined;
+ srcUrl?: string | undefined;
+ pageUrl?: string | undefined;
+ frameUrl?: string | undefined;
+ selectionText?: string | undefined;
+ targetElementId?: number | undefined;
+ }
+
+ /* contextMenus properties */
+ const ACTION_MENU_TOP_LEVEL_LIMIT: number;
+
+ /* contextMenus functions */
+ /**
+ * Creates a new context menu item. Note that if an error occurs during creation, you may not find out until the creation callback fires (the details will be in `runtime.lastError`).
+ * @param [callback] Called when the item has been created in the browser. If there were any problems creating the item, details will be available in `runtime.lastError`.
+ * @returns The ID of the newly created item.
+ */
+ function create(createProperties: _CreateCreateProperties, callback?: () => void): number | string;
+
+ /**
+ * Updates a previously created context menu item.
+ * @param id The ID of the item to update.
+ * @param updateProperties The properties to update. Accepts the same values as the create function.
+ */
+ function update(id: number | string, updateProperties: _UpdateUpdateProperties): Promise<void>;
+
+ /**
+ * Removes a context menu item.
+ * @param menuItemId The ID of the context menu item to remove.
+ */
+ function remove(menuItemId: number | string): Promise<void>;
+
+ /** Removes all context menu items added by this extension. */
+ function removeAll(): Promise<void>;
+
+ /**
+ * Show the matching menu items from this extension instead of the default menu. This should be called during a 'contextmenu' DOM event handler, and only applies to the menu that opens after this event.
+ */
+ function overrideContext(contextOptions: _OverrideContextContextOptions): void;
+
+ /**
+ * Updates the extension items in the shown menu, including changes that have been made since the menu was shown. Has no effect if the menu is hidden. Rebuilding a shown menu is an expensive operation, only invoke this method when necessary.
+ */
+ function refresh(): Promise<any>;
+
+ /**
+ * Retrieve the element that was associated with a recent contextmenu event.
+ * @param targetElementId The identifier of the clicked element, available as info.targetElementId in the menus.onShown, onClicked or onclick event.
+ */
+ // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
+ function getTargetElement(targetElementId: number): Element | void;
+
+ /* contextMenus events */
+ /**
+ * Fired when a context menu item is clicked.
+ * @param info Information about the item clicked and the context where the click happened.
+ * @param [tab] The details of the tab where the click took place. If the click did not take place in a tab, this parameter will be missing.
+ */
+ const onClicked: WebExtEvent<(info: OnClickData, tab?: tabs.Tab) => void>;
+
+ /**
+ * Fired when a menu is shown. The extension can add, modify or remove menu items and call menus.refresh() to update the menu.
+ * @param info Information about the context of the menu action and the created menu items. For more information about each property, see OnClickData. The following properties are only set if the extension has host permissions for the given context: linkUrl, linkText, srcUrl, pageUrl, frameUrl, selectionText.
+ * @param tab The details of the tab where the menu was opened.
+ */
+ const onShown: WebExtEvent<(info: _OnShownInfo, tab: tabs.Tab) => void>;
+
+ /** Fired when a menu is hidden. This event is only fired if onShown has fired before. */
+ const onHidden: WebExtEvent<() => void>;
+}
+
+/**
+ * Use the browser.menus API to add items to the browser's menus. You can choose what types of objects your context menu additions apply to, such as images, hyperlinks, and pages.
+ *
+ * Permissions: `menus`, `menus`
+ */
+declare namespace browser.menus {
+ /* menus types */
+ /**
+ * The different contexts a menu can appear in. Specifying 'all' is equivalent to the combination of all other contexts except for 'tab' and 'tools_menu'.
+ */
+ type ContextType = _ContextType;
+
+ /** The type of menu item. */
+ type ItemType = "normal" | "checkbox" | "radio" | "separator";
+
+ /** Information sent when a context menu item is clicked. */
+ interface OnClickData {
+ /** The ID of the menu item that was clicked. */
+ menuItemId: number | string;
+ /** The parent ID, if any, for the item clicked. */
+ parentMenuItemId?: number | string | undefined;
+ /** The type of view where the menu is clicked. May be unset if the menu is not associated with a view. */
+ viewType?: extension.ViewType | undefined;
+ /**
+ * One of 'image', 'video', or 'audio' if the context menu was activated on one of these types of elements.
+ */
+ mediaType?: string | undefined;
+ /** If the element is a link, the text of that link. */
+ linkText?: string | undefined;
+ /** If the element is a link, the URL it points to. */
+ linkUrl?: string | undefined;
+ /** Will be present for elements with a 'src' URL. */
+ srcUrl?: string | undefined;
+ /**
+ * The URL of the page where the menu item was clicked. This property is not set if the click occured in a context where there is no current page, such as in a launcher context menu.
+ */
+ pageUrl?: string | undefined;
+ /** The id of the frame of the element where the context menu was clicked. */
+ frameId?: number | undefined;
+ /** The URL of the frame of the element where the context menu was clicked, if it was in a frame. */
+ frameUrl?: string | undefined;
+ /** The text for the context selection, if any. */
+ selectionText?: string | undefined;
+ /** A flag indicating whether the element is editable (text input, textarea, etc.). */
+ editable: boolean;
+ /** A flag indicating the state of a checkbox or radio item before it was clicked. */
+ wasChecked?: boolean | undefined;
+ /** A flag indicating the state of a checkbox or radio item after it is clicked. */
+ checked?: boolean | undefined;
+ /** The id of the bookmark where the context menu was clicked, if it was on a bookmark. */
+ bookmarkId?: string | undefined;
+ /** An array of keyboard modifiers that were held while the menu item was clicked. */
+ modifiers: _OnClickDataModifiers[];
+ /** An integer value of button by which menu item was clicked. */
+ button?: number | undefined;
+ /**
+ * An identifier of the clicked element, if any. Use menus.getTargetElement in the page to find the corresponding element.
+ */
+ targetElementId?: number | undefined;
+ }
+
+ type _ContextType =
+ | "all"
+ | "page"
+ | "frame"
+ | "selection"
+ | "link"
+ | "editable"
+ | "password"
+ | "image"
+ | "video"
+ | "audio"
+ | "launcher"
+ | "bookmark"
+ | "tab"
+ | "tools_menu"
+ | "browser_action"
+ | "page_action"
+ | "action";
+
+ type _OnClickDataModifiers = "Shift" | "Alt" | "Command" | "Ctrl" | "MacCtrl";
+
+ interface _CreateCreatePropertiesIcons {
+ [key: number]: string;
+ }
+
+ type _CreateCreatePropertiesCommand =
+ | "_execute_browser_action"
+ | "_execute_page_action"
+ | "_execute_sidebar_action"
+ | "_execute_action"
+ | "_execute_page_action"
+ | "_execute_sidebar_action";
+
+ interface _CreateCreateProperties {
+ /** The type of menu item. Defaults to 'normal' if not specified. */
+ type?: ItemType | undefined;
+ /**
+ * The unique ID to assign to this item. Mandatory for event pages. Cannot be the same as another ID for this extension.
+ */
+ id?: string | undefined;
+ icons?: _CreateCreatePropertiesIcons | undefined;
+ /**
+ * The text to be displayed in the item; this is _required_ unless `type` is 'separator'. When the context is 'selection', you can use `%s` within the string to show the selected text. For example, if this parameter's value is "Translate '%s' to Pig Latin" and the user selects the word "cool", the context menu item for the selection is "Translate 'cool' to Pig Latin".
+ */
+ title?: string | undefined;
+ /**
+ * The initial state of a checkbox or radio item: true for selected and false for unselected. Only one radio item can be selected at a time in a given group of radio items.
+ */
+ checked?: boolean | undefined;
+ /** List of contexts this menu item will appear in. Defaults to ['page'] if not specified. */
+ contexts?: ContextType[] | undefined;
+ /**
+ * List of view types where the menu item will be shown. Defaults to any view, including those without a viewType.
+ */
+ viewTypes?: extension.ViewType[] | undefined;
+ /** Whether the item is visible in the menu. */
+ visible?: boolean | undefined;
+ /**
+ * A function that will be called back when the menu item is clicked. Event pages cannot use this; instead, they should register a listener for `contextMenus.onClicked`.
+ * @param info Information about the item clicked and the context where the click happened.
+ * @param tab The details of the tab where the click took place. Note: this parameter only present for extensions.
+ * Not supported on manifest versions above 2.
+ */
+ // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
+ onclick?: (info: OnClickData, tab: tabs.Tab) => void | undefined;
+ /** The ID of a parent menu item; this makes the item a child of a previously added item. */
+ parentId?: number | string | undefined;
+ /**
+ * Lets you restrict the item to apply only to documents whose URL matches one of the given patterns. (This applies to frames as well.) For details on the format of a pattern, see Match Patterns.
+ */
+ documentUrlPatterns?: string[] | undefined;
+ /**
+ * Similar to documentUrlPatterns, but lets you filter based on the src attribute of img/audio/video tags and the href of anchor tags.
+ */
+ targetUrlPatterns?: string[] | undefined;
+ /** Whether this context menu item is enabled or disabled. Defaults to true. */
+ enabled?: boolean | undefined;
+ /** Specifies a command to issue for the context click. */
+ command?: string | _CreateCreatePropertiesCommand | undefined;
+ }
+
+ interface _UpdateUpdatePropertiesIcons {
+ [key: number]: string;
+ }
+
+ /** The properties to update. Accepts the same values as the create function. */
+ interface _UpdateUpdateProperties {
+ type?: ItemType | undefined;
+ icons?: _UpdateUpdatePropertiesIcons | undefined;
+ title?: string | undefined;
+ checked?: boolean | undefined;
+ contexts?: ContextType[] | undefined;
+ viewTypes?: extension.ViewType[] | undefined;
+ /** Whether the item is visible in the menu. */
+ visible?: boolean | undefined;
+ /**
+ * @param tab The details of the tab where the click took place. Note: this parameter only present for extensions.
+ * Not supported on manifest versions above 2.
+ */
+ // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
+ onclick?: (info: OnClickData, tab: tabs.Tab) => void | undefined;
+ /** Note: You cannot change an item to be a child of one of its own descendants. */
+ parentId?: number | string | undefined;
+ documentUrlPatterns?: string[] | undefined;
+ targetUrlPatterns?: string[] | undefined;
+ enabled?: boolean | undefined;
+ }
+
+ /**
+ * ContextType to override, to allow menu items from other extensions in the menu. Currently only 'bookmark' and 'tab' are supported. showDefaults cannot be used with this option.
+ */
+ type _OverrideContextContextOptionsContext = "bookmark" | "tab";
+
+ interface _OverrideContextContextOptions {
+ /** Whether to also include default menu items in the menu. */
+ showDefaults?: boolean | undefined;
+ /**
+ * ContextType to override, to allow menu items from other extensions in the menu. Currently only 'bookmark' and 'tab' are supported. showDefaults cannot be used with this option.
+ */
+ context?: _OverrideContextContextOptionsContext | undefined;
+ /** Required when context is 'bookmark'. Requires 'bookmark' permission. */
+ bookmarkId?: string | undefined;
+ /** Required when context is 'tab'. Requires 'tabs' permission. */
+ tabId?: number | undefined;
+ }
+
+ /**
+ * Information about the context of the menu action and the created menu items. For more information about each property, see OnClickData. The following properties are only set if the extension has host permissions for the given context: linkUrl, linkText, srcUrl, pageUrl, frameUrl, selectionText.
+ */
+ interface _OnShownInfo {
+ /** A list of IDs of the menu items that were shown. */
+ menuIds: Array<number | string>;
+ /** A list of all contexts that apply to the menu. */
+ contexts: ContextType[];
+ viewType?: extension.ViewType | undefined;
+ editable: boolean;
+ mediaType?: string | undefined;
+ linkUrl?: string | undefined;
+ linkText?: string | undefined;
+ srcUrl?: string | undefined;
+ pageUrl?: string | undefined;
+ frameUrl?: string | undefined;
+ selectionText?: string | undefined;
+ targetElementId?: number | undefined;
+ }
+
+ /* menus properties */
+ /**
+ * The maximum number of top level extension items that can be added to an extension action context menu. Any items beyond this limit will be ignored.
+ */
+ const ACTION_MENU_TOP_LEVEL_LIMIT: number;
+
+ /* menus functions */
+ /**
+ * Creates a new context menu item. Note that if an error occurs during creation, you may not find out until the creation callback fires (the details will be in `runtime.lastError`).
+ * @param [callback] Called when the item has been created in the browser. If there were any problems creating the item, details will be available in `runtime.lastError`.
+ * @returns The ID of the newly created item.
+ */
+ function create(createProperties: _CreateCreateProperties, callback?: () => void): number | string;
+
+ /**
+ * Updates a previously created context menu item.
+ * @param id The ID of the item to update.
+ * @param updateProperties The properties to update. Accepts the same values as the create function.
+ */
+ function update(id: number | string, updateProperties: _UpdateUpdateProperties): Promise<void>;
+
+ /**
+ * Removes a context menu item.
+ * @param menuItemId The ID of the context menu item to remove.
+ */
+ function remove(menuItemId: number | string): Promise<void>;
+
+ /** Removes all context menu items added by this extension. */
+ function removeAll(): Promise<void>;
+
+ /**
+ * Show the matching menu items from this extension instead of the default menu. This should be called during a 'contextmenu' DOM event handler, and only applies to the menu that opens after this event.
+ */
+ function overrideContext(contextOptions: _OverrideContextContextOptions): void;
+
+ /**
+ * Updates the extension items in the shown menu, including changes that have been made since the menu was shown. Has no effect if the menu is hidden. Rebuilding a shown menu is an expensive operation, only invoke this method when necessary.
+ */
+ function refresh(): Promise<any>;
+
+ /**
+ * Retrieve the element that was associated with a recent contextmenu event.
+ * @param targetElementId The identifier of the clicked element, available as info.targetElementId in the menus.onShown, onClicked or onclick event.
+ */
+ // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
+ function getTargetElement(targetElementId: number): Element | void;
+
+ /* menus events */
+ /**
+ * Fired when a context menu item is clicked.
+ * @param info Information about the item clicked and the context where the click happened.
+ * @param [tab] The details of the tab where the click took place. If the click did not take place in a tab, this parameter will be missing.
+ */
+ const onClicked: WebExtEvent<(info: OnClickData, tab?: tabs.Tab) => void>;
+
+ /**
+ * Fired when a menu is shown. The extension can add, modify or remove menu items and call menus.refresh() to update the menu.
+ * @param info Information about the context of the menu action and the created menu items. For more information about each property, see OnClickData. The following properties are only set if the extension has host permissions for the given context: linkUrl, linkText, srcUrl, pageUrl, frameUrl, selectionText.
+ * @param tab The details of the tab where the menu was opened.
+ */
+ const onShown: WebExtEvent<(info: _OnShownInfo, tab: tabs.Tab) => void>;
+
+ /** Fired when a menu is hidden. This event is only fired if onShown has fired before. */
+ const onHidden: WebExtEvent<() => void>;
+}
+
+/**
+ * Normandy Study API
+ *
+ * Permissions: `normandyAddonStudy`
+ */
+declare namespace browser.normandyAddonStudy {
+ /* normandyAddonStudy types */
+ interface Study {
+ /** The ID of the recipe for the study. */
+ recipeId: number;
+ /** A slug to identify the study. */
+ slug: string;
+ /** The name presented on about:studies. */
+ userFacingName: string;
+ /** The description presented on about:studies. */
+ userFacingDescription: string;
+ /** The study branch in which the user is enrolled. */
+ branch: string;
+ /** The state of the study. */
+ active: boolean;
+ /** The ID of the extension installed by the study. */
+ addonId: string;
+ /** The URL of the XPI that was downloaded and installed by the study. */
+ addonUrl: string;
+ /** The version of the extension installed by the study. */
+ addonVersion: string;
+ /** The start date for the study. */
+ studyStartDate: extensionTypes.Date;
+ /** The end date for the study. */
+ studyEndDate: extensionTypes.Date;
+ /** The record ID for the extension in Normandy server's database. */
+ extensionApiId: number;
+ /** A hash of the extension XPI file. */
+ extensionHash: string;
+ /** The algorithm used to hash the extension XPI file. */
+ extensionHashAlgorithm: string;
+ }
+
+ /* normandyAddonStudy functions */
+ /** Returns a study object for the current study. */
+ function getStudy(): Promise<any>;
+
+ /**
+ * Marks the study as ended and then uninstalls the addon.
+ * @param reason The reason why the study is ending.
+ */
+ function endStudy(reason: string): Promise<any>;
+
+ /** Returns an object with metadata about the client which may be required for constructing survey URLs. */
+ function getClientMetadata(): Promise<any>;
+
+ /* normandyAddonStudy events */
+ /**
+ * Fired when a user unenrolls from a study but before the addon is uninstalled.
+ * @param reason The reason why the study is ending.
+ */
+ const onUnenroll: WebExtEvent<(reason: string) => void>;
+}
+
+/**
+ * The omnibox API allows you to register a keyword with Firefox's address bar.
+ *
+ * Manifest keys: `omnibox`
+ *
+ * Not allowed in: Content scripts, Devtools pages
+ */
+declare namespace browser.omnibox {
+ /* omnibox types */
+ /** The style type. */
+ type DescriptionStyleType = "url" | "match" | "dim";
+
+ /**
+ * The window disposition for the omnibox query. This is the recommended context to display results. For example, if the omnibox command is to navigate to a certain URL, a disposition of 'newForegroundTab' means the navigation should take place in a new selected tab.
+ */
+ type OnInputEnteredDisposition = "currentTab" | "newForegroundTab" | "newBackgroundTab";
+
+ /** A suggest result. */
+ interface SuggestResult {
+ /**
+ * The text that is put into the URL bar, and that is sent to the extension when the user chooses this entry.
+ */
+ content: string;
+ /**
+ * The text that is displayed in the URL dropdown. Can contain XML-style markup for styling. The supported tags are 'url' (for a literal URL), 'match' (for highlighting text that matched what the user's query), and 'dim' (for dim helper text). The styles can be nested, eg. <dim><match>dimmed match</match></dim>. You must escape the five predefined entities to display them as text: stackoverflow.com/a/1091953/89484
+ */
+ description: string;
+ /** Whether the suggest result can be deleted by the user. */
+ deletable?: boolean | undefined;
+ /**
+ * An array of style ranges for the description, as provided by the extension.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ descriptionStyles?: _SuggestResultDescriptionStyles[] | undefined;
+ /**
+ * An array of style ranges for the description, as provided by ToValue().
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ descriptionStylesRaw?: _SuggestResultDescriptionStylesRaw[] | undefined;
+ }
+
+ /** A suggest result. */
+ interface DefaultSuggestResult {
+ /** The text that is displayed in the URL dropdown. */
+ description: string;
+ /**
+ * An array of style ranges for the description, as provided by the extension.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ descriptionStyles?: _DefaultSuggestResultDescriptionStyles[] | undefined;
+ /**
+ * An array of style ranges for the description, as provided by ToValue().
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ descriptionStylesRaw?: _DefaultSuggestResultDescriptionStylesRaw[] | undefined;
+ }
+
+ /** The style ranges for the description, as provided by the extension. */
+ interface _SuggestResultDescriptionStyles {
+ offset: number;
+ /** The style type */
+ type: DescriptionStyleType;
+ length?: number | undefined;
+ }
+
+ /** The style ranges for the description, as provided by ToValue(). */
+ interface _SuggestResultDescriptionStylesRaw {
+ offset: number;
+ type: number;
+ }
+
+ /** The style ranges for the description, as provided by the extension. */
+ interface _DefaultSuggestResultDescriptionStyles {
+ offset: number;
+ /** The style type */
+ type: DescriptionStyleType;
+ length?: number | undefined;
+ }
+
+ /** The style ranges for the description, as provided by ToValue(). */
+ interface _DefaultSuggestResultDescriptionStylesRaw {
+ offset: number;
+ type: number;
+ }
+
+ /* omnibox functions */
+ /**
+ * Sets the description and styling for the default suggestion. The default suggestion is the text that is displayed in the first suggestion row underneath the URL bar.
+ * @param suggestion A partial SuggestResult object, without the 'content' parameter.
+ */
+ function setDefaultSuggestion(suggestion: DefaultSuggestResult): void;
+
+ /* omnibox events */
+ /**
+ * User has started a keyword input session by typing the extension's keyword. This is guaranteed to be sent exactly once per input session, and before any onInputChanged events.
+ */
+ const onInputStarted: WebExtEvent<() => void>;
+
+ /**
+ * User has changed what is typed into the omnibox.
+ * @param suggest A callback passed to the onInputChanged event used for sending suggestions back to the browser.
+ */
+ const onInputChanged: WebExtEvent<(text: string, suggest: (suggestResults: SuggestResult[]) => void) => void>;
+
+ /** User has accepted what is typed into the omnibox. */
+ const onInputEntered: WebExtEvent<(text: string, disposition: OnInputEnteredDisposition) => void>;
+
+ /** User has ended the keyword input session without accepting the input. */
+ const onInputCancelled: WebExtEvent<() => void>;
+
+ /** User has deleted a suggested result. */
+ const onDeleteSuggestion: WebExtEvent<(text: string) => void>;
+}
+
+/**
+ * PKCS#11 module management API
+ *
+ * Permissions: `pkcs11`
+ *
+ * Not allowed in: Content scripts, Devtools pages
+ */
+declare namespace browser.pkcs11 {
+ /* pkcs11 functions */
+ /** checks whether a PKCS#11 module, given by name, is installed */
+ function isModuleInstalled(name: string): Promise<boolean>;
+
+ /** Install a PKCS#11 module with a given name */
+ function installModule(name: string, flags?: number): Promise<void>;
+
+ /** Remove an installed PKCS#11 module from firefox */
+ function uninstallModule(name: string): Promise<void>;
+
+ /** Enumerate a module's slots, each with their name and whether a token is present */
+ function getModuleSlots(name: string): Promise<{
+ name: string;
+ token?: {
+ name: string;
+ manufacturer: string;
+ HWVersion: string;
+ FWVersion: string;
+ serial: string;
+ isLoggedIn: string;
+ };
+ }>;
+}
+
+/**
+ * Use browser.search to interact with search engines.
+ *
+ * Permissions: `search`
+ *
+ * Not allowed in: Content scripts, Devtools pages
+ */
+declare namespace browser.search {
+ /* search types */
+ /** An object encapsulating a search engine */
+ interface SearchEngine {
+ name: string;
+ isDefault: boolean;
+ alias?: string | undefined;
+ favIconUrl?: string | undefined;
+ }
+
+ /** Location where search results should be displayed. */
+ type Disposition = "CURRENT_TAB" | "NEW_TAB" | "NEW_WINDOW";
+
+ interface _SearchSearchProperties {
+ /** Terms to search for. */
+ query: string;
+ /** Search engine to use. Uses the default if not specified. */
+ engine?: string | undefined;
+ /** Location where search results should be displayed. NEW_TAB is the default. */
+ disposition?: Disposition | undefined;
+ /**
+ * The ID of the tab for the search results. If not specified, a new tab is created, unless disposition is set. tabId cannot be used with disposition.
+ */
+ tabId?: number | undefined;
+ }
+
+ interface _QueryQueryInfo {
+ /** String to query with the default search provider. */
+ text: string;
+ /** Location where search results should be displayed. CURRENT_TAB is the default. */
+ disposition?: Disposition | undefined;
+ /** Location where search results should be displayed. tabId cannot be used with disposition. */
+ tabId?: number | undefined;
+ }
+
+ /* search functions */
+ /** Gets a list of search engines. */
+ function get(): Promise<SearchEngine[]>;
+
+ /** Perform a search. */
+ function search(searchProperties: _SearchSearchProperties): Promise<any>;
+
+ /** Use the browser.search API to search via the default provider. */
+ function query(queryInfo: _QueryQueryInfo): Promise<void>;
+}
+
+/**
+ * Use the `browser.sessions` API to query and restore tabs and windows from a browsing session.
+ *
+ * Permissions: `sessions`
+ *
+ * Not allowed in: Content scripts, Devtools pages
+ */
+declare namespace browser.sessions {
+ /* sessions types */
+ interface Filter {
+ /**
+ * The maximum number of entries to be fetched in the requested list. Omit this parameter to fetch the maximum number of entries (`sessions.MAX_SESSION_RESULTS`).
+ */
+ maxResults?: number | undefined;
+ }
+
+ interface Session {
+ /** The time when the window or tab was closed or modified, represented in milliseconds since the epoch. */
+ lastModified: number;
+ /** The `tabs.Tab`, if this entry describes a tab. Either this or `sessions.Session.window` will be set. */
+ tab?: tabs.Tab | undefined;
+ /**
+ * The `windows.Window`, if this entry describes a window. Either this or `sessions.Session.tab` will be set.
+ */
+ window?: windows.Window | undefined;
+ }
+
+ interface Device {
+ info: string;
+ /** The name of the foreign device. */
+ deviceName: string;
+ /**
+ * A list of open window sessions for the foreign device, sorted from most recently to least recently modified session.
+ */
+ sessions: Session[];
+ }
+
+ /* sessions properties */
+ /** The maximum number of `sessions.Session` that will be included in a requested list. */
+ const MAX_SESSION_RESULTS: number;
+
+ /* sessions functions */
+ /**
+ * Forget a recently closed tab.
+ * @param windowId The windowId of the window to which the recently closed tab to be forgotten belongs.
+ * @param sessionId The sessionId (closedId) of the recently closed tab to be forgotten.
+ */
+ function forgetClosedTab(windowId: number, sessionId: string): Promise<void>;
+
+ /**
+ * Forget a recently closed window.
+ * @param sessionId The sessionId (closedId) of the recently closed window to be forgotten.
+ */
+ function forgetClosedWindow(sessionId: string): Promise<void>;
+
+ /** Gets the list of recently closed tabs and/or windows. */
+ function getRecentlyClosed(filter?: Filter): Promise<Session[]>;
+
+ /**
+ * Retrieves all devices with synced sessions.
+ * @deprecated Unsupported on Firefox at this time.
+ */
+ function getDevices(filter?: Filter): Promise<Device[]>;
+
+ /**
+ * Reopens a `windows.Window` or `tabs.Tab`, with an optional callback to run when the entry has been restored.
+ * @param [sessionId] The `windows.Window.sessionId`, or `tabs.Tab.sessionId` to restore. If this parameter is not specified, the most recently closed session is restored.
+ */
+ function restore(sessionId?: string): Promise<Session>;
+
+ /**
+ * Set a key/value pair on a given tab.
+ * @param tabId The id of the tab that the key/value pair is being set on.
+ * @param key The key which corresponds to the value being set.
+ * @param value The value being set.
+ */
+ function setTabValue(tabId: number, key: string, value: any): Promise<void>;
+
+ /**
+ * Retrieve a value that was set for a given key on a given tab.
+ * @param tabId The id of the tab whose value is being retrieved from.
+ * @param key The key which corresponds to the value.
+ */
+ function getTabValue(tabId: number, key: string): Promise<string | object | undefined>;
+
+ /**
+ * Remove a key/value pair that was set on a given tab.
+ * @param tabId The id of the tab whose key/value pair is being removed.
+ * @param key The key which corresponds to the value.
+ */
+ function removeTabValue(tabId: number, key: string): Promise<void>;
+
+ /**
+ * Set a key/value pair on a given window.
+ * @param windowId The id of the window that the key/value pair is being set on.
+ * @param key The key which corresponds to the value being set.
+ * @param value The value being set.
+ */
+ function setWindowValue(windowId: number, key: string, value: any): Promise<void>;
+
+ /**
+ * Retrieve a value that was set for a given key on a given window.
+ * @param windowId The id of the window whose value is being retrieved from.
+ * @param key The key which corresponds to the value.
+ */
+ function getWindowValue(windowId: number, key: string): Promise<string | object | undefined>;
+
+ /**
+ * Remove a key/value pair that was set on a given window.
+ * @param windowId The id of the window whose key/value pair is being removed.
+ * @param key The key which corresponds to the value.
+ */
+ function removeWindowValue(windowId: number, key: string): Promise<void>;
+
+ /* sessions events */
+ /**
+ * Fired when recently closed tabs and/or windows are changed. This event does not monitor synced sessions changes.
+ */
+ const onChanged: WebExtEvent<() => void>;
+}
+
+/**
+ * Use sidebar actions to add a sidebar to Firefox.
+ *
+ * Manifest keys: `sidebar_action`
+ *
+ * Not allowed in: Content scripts, Devtools pages
+ */
+declare namespace browser.sidebarAction {
+ /* sidebarAction types */
+ /** Pixel data for an image. Must be an ImageData object (for example, from a `canvas` element). */
+ type ImageDataType = ImageData;
+
+ interface _SetTitleDetails {
+ /** The string the sidebar action should display when moused over. */
+ title: string | null;
+ /** Sets the sidebar title for the tab specified by tabId. Automatically resets when the tab is closed. */
+ tabId?: number | undefined;
+ /** Sets the sidebar title for the window specified by windowId. */
+ windowId?: number | undefined;
+ }
+
+ interface _GetTitleDetails {
+ /**
+ * Specify the tab to get the title from. If no tab nor window is specified, the global title is returned.
+ */
+ tabId?: number | undefined;
+ /**
+ * Specify the window to get the title from. If no tab nor window is specified, the global title is returned.
+ */
+ windowId?: number | undefined;
+ }
+
+ interface _SetIconDetails {
+ /**
+ * Either an ImageData object or a dictionary {size -> ImageData} representing icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals `scale`, then image with size `scale` * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.imageData = foo' is equivalent to 'details.imageData = {'19': foo}'
+ */
+ imageData?:
+ | ImageDataType
+ | {
+ [key: number]: ImageDataType;
+ }
+ | undefined;
+ /**
+ * Either a relative image path or a dictionary {size -> relative image path} pointing to icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals `scale`, then image with size `scale` * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.path = foo' is equivalent to 'details.imageData = {'19': foo}'
+ */
+ path?: string | { [key: string]: string } | undefined;
+ /** Sets the sidebar icon for the tab specified by tabId. Automatically resets when the tab is closed. */
+ tabId?: number | undefined;
+ /** Sets the sidebar icon for the window specified by windowId. */
+ windowId?: number | undefined;
+ }
+
+ interface _SetPanelDetails {
+ /** Sets the sidebar url for the tab specified by tabId. Automatically resets when the tab is closed. */
+ tabId?: number | undefined;
+ /** Sets the sidebar url for the window specified by windowId. */
+ windowId?: number | undefined;
+ /** The url to the html file to show in a sidebar. If set to the empty string (''), no sidebar is shown. */
+ panel: string | null;
+ }
+
+ interface _GetPanelDetails {
+ /**
+ * Specify the tab to get the panel from. If no tab nor window is specified, the global panel is returned.
+ */
+ tabId?: number | undefined;
+ /**
+ * Specify the window to get the panel from. If no tab nor window is specified, the global panel is returned.
+ */
+ windowId?: number | undefined;
+ }
+
+ interface _IsOpenDetails {
+ /** Specify the window to get the openness from. */
+ windowId?: number | undefined;
+ }
+
+ /* sidebarAction functions */
+ /** Sets the title of the sidebar action. This shows up in the tooltip. */
+ function setTitle(details: _SetTitleDetails): Promise<void>;
+
+ /** Gets the title of the sidebar action. */
+ function getTitle(details: _GetTitleDetails): Promise<string>;
+
+ /**
+ * Sets the icon for the sidebar action. The icon can be specified either as the path to an image file or as the pixel data from a canvas element, or as dictionary of either one of those. Either the **path** or the **imageData** property must be specified.
+ */
+ function setIcon(details: _SetIconDetails): Promise<void>;
+
+ /**
+ * Sets the url to the html document to be opened in the sidebar when the user clicks on the sidebar action's icon.
+ */
+ function setPanel(details: _SetPanelDetails): Promise<void>;
+
+ /** Gets the url to the html document set as the panel for this sidebar action. */
+ function getPanel(details: _GetPanelDetails): Promise<string>;
+
+ /** Opens the extension sidebar in the active window. */
+ function open(): Promise<void>;
+
+ /** Closes the extension sidebar in the active window if the sidebar belongs to the extension. */
+ function close(): Promise<void>;
+
+ /** Toggles the extension sidebar in the active window. */
+ function toggle(): Promise<void>;
+
+ /** Checks whether the sidebar action is open. */
+ function isOpen(details: _IsOpenDetails): Promise<boolean>;
+}
+
+/**
+ * Use the `browser.tabs` API to interact with the browser's tab system. You can use this API to create, modify, and rearrange tabs in the browser.
+ *
+ * Not allowed in: Content scripts, Devtools pages
+ */
+declare namespace browser.tabs {
+ /* tabs types */
+ /** An event that caused a muted state change. */
+ type MutedInfoReason =
+ /** A user input action has set/overridden the muted state. */
+ | "user"
+ /** Tab capture started, forcing a muted state change. */
+ | "capture"
+ /** An extension, identified by the extensionId field, set the muted state. */
+ | "extension";
+
+ /** Tab muted state and the reason for the last state change. */
+ interface MutedInfo {
+ /**
+ * Whether the tab is prevented from playing sound (but hasn't necessarily recently produced sound). Equivalent to whether the muted audio indicator is showing.
+ */
+ muted: boolean;
+ /** The reason the tab was muted or unmuted. Not set if the tab's mute state has never been changed. */
+ reason?: MutedInfoReason | undefined;
+ /**
+ * The ID of the extension that changed the muted state. Not set if an extension was not the reason the muted state last changed.
+ */
+ extensionId?: string | undefined;
+ }
+
+ /** Tab sharing state for screen, microphone and camera. */
+ interface SharingState {
+ /**
+ * If the tab is sharing the screen the value will be one of "Screen", "Window", or "Application", or undefined if not screen sharing.
+ */
+ screen?: string | undefined;
+ /** True if the tab is using the camera. */
+ camera: boolean;
+ /** True if the tab is using the microphone. */
+ microphone: boolean;
+ }
+
+ interface Tab {
+ /**
+ * The ID of the tab. Tab IDs are unique within a browser session. Under some circumstances a Tab may not be assigned an ID, for example when querying foreign tabs using the `sessions` API, in which case a session ID may be present. Tab ID can also be set to `tabs.TAB_ID_NONE` for apps and devtools windows.
+ */
+ id?: number | undefined;
+ /** The zero-based index of the tab within its window. */
+ index: number;
+ /** The ID of the window the tab is contained within. */
+ windowId?: number | undefined;
+ /**
+ * The ID of the tab that opened this tab, if any. This property is only present if the opener tab still exists.
+ */
+ openerTabId?: number | undefined;
+ /** Whether the tab is highlighted. Works as an alias of active */
+ highlighted: boolean;
+ /** Whether the tab is active in its window. (Does not necessarily mean the window is focused.) */
+ active: boolean;
+ /** Whether the tab is pinned. */
+ pinned: boolean;
+ /** The last time the tab was accessed as the number of milliseconds since epoch. */
+ lastAccessed?: number | undefined;
+ /**
+ * Whether the tab has produced sound over the past couple of seconds (but it might not be heard if also muted). Equivalent to whether the speaker audio indicator is showing.
+ */
+ audible?: boolean | undefined;
+ /** Current tab muted state and the reason for the last state change. */
+ mutedInfo?: MutedInfo | undefined;
+ /**
+ * The URL the tab is displaying. This property is only present if the extension's manifest includes the `"tabs"` permission.
+ */
+ url?: string | undefined;
+ /**
+ * The title of the tab. This property is only present if the extension's manifest includes the `"tabs"` permission.
+ */
+ title?: string | undefined;
+ /**
+ * The URL of the tab's favicon. This property is only present if the extension's manifest includes the `"tabs"` permission. It may also be an empty string if the tab is loading.
+ */
+ favIconUrl?: string | undefined;
+ /** Either _loading_ or _complete_. */
+ status?: string | undefined;
+ /** True while the tab is not loaded with content. */
+ discarded?: boolean | undefined;
+ /** Whether the tab is in an incognito window. */
+ incognito: boolean;
+ /** The width of the tab in pixels. */
+ width?: number | undefined;
+ /** The height of the tab in pixels. */
+ height?: number | undefined;
+ /** True if the tab is hidden. */
+ hidden?: boolean | undefined;
+ /** The session ID used to uniquely identify a Tab obtained from the `sessions` API. */
+ sessionId?: string | undefined;
+ /** The CookieStoreId used for the tab. */
+ cookieStoreId?: string | undefined;
+ /** Whether the document in the tab can be rendered in reader mode. */
+ isArticle?: boolean | undefined;
+ /** Whether the document in the tab is being rendered in reader mode. */
+ isInReaderMode?: boolean | undefined;
+ /** Current tab sharing state for screen, microphone and camera. */
+ sharingState?: SharingState | undefined;
+ /** Whether the tab is drawing attention. */
+ attention?: boolean | undefined;
+ /** The ID of this tab's successor, if any; `tabs.TAB_ID_NONE` otherwise. */
+ successorTabId?: number | undefined;
+ }
+
+ /**
+ * Defines how zoom changes are handled, i.e. which entity is responsible for the actual scaling of the page; defaults to `automatic`.
+ */
+ type ZoomSettingsMode =
+ /** Zoom changes are handled automatically by the browser. */
+ | "automatic"
+ /**
+ * Overrides the automatic handling of zoom changes. The `onZoomChange` event will still be dispatched, and it is the responsibility of the extension to listen for this event and manually scale the page. This mode does not support `per-origin` zooming, and will thus ignore the `scope` zoom setting and assume `per-tab`.
+ */
+ | "manual"
+ /**
+ * Disables all zooming in the tab. The tab will revert to the default zoom level, and all attempted zoom changes will be ignored.
+ */
+ | "disabled";
+
+ /**
+ * Defines whether zoom changes will persist for the page's origin, or only take effect in this tab; defaults to `per-origin` when in `automatic` mode, and `per-tab` otherwise.
+ */
+ type ZoomSettingsScope =
+ /**
+ * Zoom changes will persist in the zoomed page's origin, i.e. all other tabs navigated to that same origin will be zoomed as well. Moreover, `per-origin` zoom changes are saved with the origin, meaning that when navigating to other pages in the same origin, they will all be zoomed to the same zoom factor. The `per-origin` scope is only available in the `automatic` mode.
+ */
+ | "per-origin"
+ /**
+ * Zoom changes only take effect in this tab, and zoom changes in other tabs will not affect the zooming of this tab. Also, `per-tab` zoom changes are reset on navigation; navigating a tab will always load pages with their `per-origin` zoom factors.
+ */
+ | "per-tab";
+
+ /** Defines how zoom changes in a tab are handled and at what scope. */
+ interface ZoomSettings {
+ /**
+ * Defines how zoom changes are handled, i.e. which entity is responsible for the actual scaling of the page; defaults to `automatic`.
+ */
+ mode?: ZoomSettingsMode | undefined;
+ /**
+ * Defines whether zoom changes will persist for the page's origin, or only take effect in this tab; defaults to `per-origin` when in `automatic` mode, and `per-tab` otherwise.
+ */
+ scope?: ZoomSettingsScope | undefined;
+ /** Used to return the default zoom level for the current tab in calls to tabs.getZoomSettings. */
+ defaultZoomFactor?: number | undefined;
+ }
+
+ /** Defines the page settings to be used when saving a page as a pdf file. */
+ interface PageSettings {
+ /** The name of the file. May include optional .pdf extension. */
+ toFileName?: string | undefined;
+ /** The page size unit: 0 = inches, 1 = millimeters. Default: 0. */
+ paperSizeUnit?: number | undefined;
+ /** The paper width in paper size units. Default: 8.5. */
+ paperWidth?: number | undefined;
+ /** The paper height in paper size units. Default: 11.0. */
+ paperHeight?: number | undefined;
+ /** The page content orientation: 0 = portrait, 1 = landscape. Default: 0. */
+ orientation?: number | undefined;
+ /** The page content scaling factor: 1.0 = 100% = normal size. Default: 1.0. */
+ scaling?: number | undefined;
+ /** Whether the page content should shrink to fit the page width (overrides scaling). Default: true. */
+ shrinkToFit?: boolean | undefined;
+ /** Whether the page background colors should be shown. Default: false. */
+ showBackgroundColors?: boolean | undefined;
+ /** Whether the page background images should be shown. Default: false. */
+ showBackgroundImages?: boolean | undefined;
+ /** The spacing between the left header/footer and the left edge of the paper (inches). Default: 0. */
+ edgeLeft?: number | undefined;
+ /** The spacing between the right header/footer and the right edge of the paper (inches). Default: 0. */
+ edgeRight?: number | undefined;
+ /** The spacing between the top of the headers and the top edge of the paper (inches). Default: 0 */
+ edgeTop?: number | undefined;
+ /** The spacing between the bottom of the footers and the bottom edge of the paper (inches). Default: 0. */
+ edgeBottom?: number | undefined;
+ /** The margin between the page content and the left edge of the paper (inches). Default: 0.5. */
+ marginLeft?: number | undefined;
+ /** The margin between the page content and the right edge of the paper (inches). Default: 0.5. */
+ marginRight?: number | undefined;
+ /** The margin between the page content and the top edge of the paper (inches). Default: 0.5. */
+ marginTop?: number | undefined;
+ /** The margin between the page content and the bottom edge of the paper (inches). Default: 0.5. */
+ marginBottom?: number | undefined;
+ /** The text for the page's left header. Default: '&T'. */
+ headerLeft?: string | undefined;
+ /** The text for the page's center header. Default: ''. */
+ headerCenter?: string | undefined;
+ /** The text for the page's right header. Default: '&U'. */
+ headerRight?: string | undefined;
+ /** The text for the page's left footer. Default: '&PT'. */
+ footerLeft?: string | undefined;
+ /** The text for the page's center footer. Default: ''. */
+ footerCenter?: string | undefined;
+ /** The text for the page's right footer. Default: '&D'. */
+ footerRight?: string | undefined;
+ }
+
+ /** Whether the tabs have completed loading. */
+ type TabStatus = "loading" | "complete";
+
+ /** The type of window. */
+ type WindowType = "normal" | "popup" | "panel" | "app" | "devtools";
+
+ /** Event names supported in onUpdated. */
+ type UpdatePropertyName =
+ | "attention"
+ | "audible"
+ | "discarded"
+ | "favIconUrl"
+ | "hidden"
+ | "isArticle"
+ | "mutedInfo"
+ | "pinned"
+ | "sharingState"
+ | "status"
+ | "title"
+ | "url";
+
+ /** An object describing filters to apply to tabs.onUpdated events. */
+ interface UpdateFilter {
+ /**
+ * A list of URLs or URL patterns. Events that cannot match any of the URLs will be filtered out. Filtering with urls requires the `"tabs"` or `"activeTab"` permission.
+ */
+ urls?: string[] | undefined;
+ /** A list of property names. Events that do not match any of the names will be filtered out. */
+ properties?: UpdatePropertyName[] | undefined;
+ tabId?: number | undefined;
+ windowId?: number | undefined;
+ }
+
+ interface _ConnectConnectInfo {
+ /** Will be passed into onConnect for content scripts that are listening for the connection event. */
+ name?: string | undefined;
+ /** Open a port to a specific frame identified by `frameId` instead of all frames in the tab. */
+ frameId?: number | undefined;
+ }
+
+ interface _SendMessageOptions {
+ /** Send a message to a specific frame identified by `frameId` instead of all frames in the tab. */
+ frameId?: number | undefined;
+ }
+
+ interface _CreateCreateProperties {
+ /** The window to create the new tab in. Defaults to the current window. */
+ windowId?: number | undefined;
+ /**
+ * The position the tab should take in the window. The provided value will be clamped to between zero and the number of tabs in the window.
+ */
+ index?: number | undefined;
+ /**
+ * The URL to navigate the tab to initially. Fully-qualified URLs must include a scheme (i.e. 'http://www.google.com', not 'www.google.com'). Relative URLs will be relative to the current page within the extension. Defaults to the New Tab Page.
+ */
+ url?: string | undefined;
+ /**
+ * Whether the tab should become the active tab in the window. Does not affect whether the window is focused (see `windows.update`). Defaults to `true`.
+ */
+ active?: boolean | undefined;
+ /** Whether the tab should be pinned. Defaults to `false` */
+ pinned?: boolean | undefined;
+ /**
+ * The ID of the tab that opened this tab. If specified, the opener tab must be in the same window as the newly created tab.
+ */
+ openerTabId?: number | undefined;
+ /** The CookieStoreId for the tab that opened this tab. */
+ cookieStoreId?: string | undefined;
+ /** Whether the document in the tab should be opened in reader mode. */
+ openInReaderMode?: boolean | undefined;
+ /** Whether the tab is marked as 'discarded' when created. */
+ discarded?: boolean | undefined;
+ /** The title used for display if the tab is created in discarded mode. */
+ title?: string | undefined;
+ /** Whether the tab should be muted when created. */
+ muted?: boolean | undefined;
+ }
+
+ interface _DuplicateDuplicateProperties {
+ /**
+ * The position the new tab should take in the window. The provided value will be clamped to between zero and the number of tabs in the window.
+ */
+ index?: number | undefined;
+ /**
+ * Whether the tab should become the active tab in the window. Does not affect whether the window is focused (see `windows.update`). Defaults to `true`.
+ */
+ active?: boolean | undefined;
+ }
+
+ type _QueryQueryInfoScreen = "Screen" | "Window" | "Application";
+
+ interface _QueryQueryInfo {
+ /** Whether the tabs are active in their windows. */
+ active?: boolean | undefined;
+ /** Whether the tabs are drawing attention. */
+ attention?: boolean | undefined;
+ /** Whether the tabs are pinned. */
+ pinned?: boolean | undefined;
+ /** Whether the tabs are audible. */
+ audible?: boolean | undefined;
+ /** Whether the tabs are muted. */
+ muted?: boolean | undefined;
+ /** Whether the tabs are highlighted. Works as an alias of active. */
+ highlighted?: boolean | undefined;
+ /** Whether the tabs are in the current window. */
+ currentWindow?: boolean | undefined;
+ /** Whether the tabs are in the last focused window. */
+ lastFocusedWindow?: boolean | undefined;
+ /** Whether the tabs have completed loading. */
+ status?: TabStatus | undefined;
+ /** True while the tabs are not loaded with content. */
+ discarded?: boolean | undefined;
+ /** True while the tabs are hidden. */
+ hidden?: boolean | undefined;
+ /** Match page titles against a pattern. */
+ title?: string | undefined;
+ /** Match tabs against one or more URL patterns. Note that fragment identifiers are not matched. */
+ url?: string | string[] | undefined;
+ /** The ID of the parent window, or `windows.WINDOW_ID_CURRENT` for the current window. */
+ windowId?: number | undefined;
+ /** The type of window the tabs are in. */
+ windowType?: WindowType | undefined;
+ /** The position of the tabs within their windows. */
+ index?: number | undefined;
+ /** The CookieStoreId used for the tab. */
+ cookieStoreId?: string[] | string | undefined;
+ /**
+ * The ID of the tab that opened this tab. If specified, the opener tab must be in the same window as this tab.
+ */
+ openerTabId?: number | undefined;
+ /** True for any screen sharing, or a string to specify type of screen sharing. */
+ screen?: boolean | _QueryQueryInfoScreen | undefined;
+ /** True if the tab is using the camera. */
+ camera?: boolean | undefined;
+ /** True if the tab is using the microphone. */
+ microphone?: boolean | undefined;
+ }
+
+ interface _HighlightHighlightInfo {
+ /** The window that contains the tabs. */
+ windowId?: number | undefined;
+ /**
+ * If true, the `windows.Window` returned will have a `tabs` property that contains a list of the `tabs.Tab` objects. The `Tab` objects only contain the `url`, `title` and `favIconUrl` properties if the extension's manifest file includes the `"tabs"` permission. If false, the `windows.Window` won't have the `tabs` property.
+ */
+ populate?: boolean | undefined;
+ /** One or more tab indices to highlight. */
+ tabs: number[] | number;
+ }
+
+ interface _UpdateUpdateProperties {
+ /** A URL to navigate the tab to. */
+ url?: string | undefined;
+ /**
+ * Whether the tab should be active. Does not affect whether the window is focused (see `windows.update`).
+ */
+ active?: boolean | undefined;
+ /** Adds or removes the tab from the current selection. */
+ highlighted?: boolean | undefined;
+ /** Whether the tab should be pinned. */
+ pinned?: boolean | undefined;
+ /** Whether the tab should be muted. */
+ muted?: boolean | undefined;
+ /**
+ * The ID of the tab that opened this tab. If specified, the opener tab must be in the same window as this tab.
+ */
+ openerTabId?: number | undefined;
+ /** Whether the load should replace the current history entry for the tab. */
+ loadReplace?: boolean | undefined;
+ /**
+ * The ID of this tab's successor. If specified, the successor tab must be in the same window as this tab.
+ */
+ successorTabId?: number | undefined;
+ }
+
+ interface _MoveMoveProperties {
+ /** Defaults to the window the tab is currently in. */
+ windowId?: number | undefined;
+ /** The position to move the window to. -1 will place the tab at the end of the window. */
+ index: number;
+ }
+
+ interface _ReloadReloadProperties {
+ /** Whether using any local cache. Default is false. */
+ bypassCache?: boolean | undefined;
+ }
+
+ interface _MoveInSuccessionOptions {
+ /** Whether to move the tabs before (false) or after (true) tabId in the succession. Defaults to false. */
+ append?: boolean | undefined;
+ /**
+ * Whether to link up the current predecessors or successor (depending on options.append) of tabId to the other side of the chain after it is prepended or appended. If true, one of the following happens: if options.append is false, the first tab in the array is set as the successor of any current predecessors of tabId; if options.append is true, the current successor of tabId is set as the successor of the last tab in the array. Defaults to false.
+ */
+ insert?: boolean | undefined;
+ }
+
+ /** Lists the changes to the state of the tab that was updated. */
+ interface _OnUpdatedChangeInfo {
+ /** The tab's new attention state. */
+ attention?: boolean | undefined;
+ /** The tab's new audible state. */
+ audible?: boolean | undefined;
+ /** True while the tab is not loaded with content. */
+ discarded?: boolean | undefined;
+ /**
+ * The tab's new favicon URL. This property is only present if the extension's manifest includes the `"tabs"` permission.
+ */
+ favIconUrl?: string | undefined;
+ /** The tab's new hidden state. */
+ hidden?: boolean | undefined;
+ /** Whether the document in the tab can be rendered in reader mode. */
+ isArticle?: boolean | undefined;
+ /** The tab's new muted state and the reason for the change. */
+ mutedInfo?: MutedInfo | undefined;
+ /** The tab's new pinned state. */
+ pinned?: boolean | undefined;
+ /** The tab's new sharing state for screen, microphone and camera. */
+ sharingState?: SharingState | undefined;
+ /** The status of the tab. Can be either _loading_ or _complete_. */
+ status?: string | undefined;
+ /**
+ * The title of the tab if it has changed. This property is only present if the extension's manifest includes the `"tabs"` permission.
+ */
+ title?: string | undefined;
+ /**
+ * The tab's URL if it has changed. This property is only present if the extension's manifest includes the `"tabs"` permission.
+ */
+ url?: string | undefined;
+ }
+
+ interface _TabsOnUpdatedEvent<TCallback = (tabId: number, changeInfo: _OnUpdatedChangeInfo, tab: Tab) => void> {
+ addListener(cb: TCallback, filter?: UpdateFilter): void;
+ removeListener(cb: TCallback): void;
+ hasListener(cb: TCallback): boolean;
+ }
+
+ interface _OnMovedMoveInfo {
+ windowId: number;
+ fromIndex: number;
+ toIndex: number;
+ }
+
+ interface _OnActivatedActiveInfo {
+ /** The ID of the tab that has become active. */
+ tabId: number;
+ /** The ID of the tab that was previously active, if that tab is still open. */
+ previousTabId?: number | undefined;
+ /** The ID of the window the active tab changed inside of. */
+ windowId: number;
+ }
+
+ interface _OnHighlightedHighlightInfo {
+ /** The window whose tabs changed. */
+ windowId: number;
+ /** All highlighted tabs in the window. */
+ tabIds: number[];
+ }
+
+ interface _OnDetachedDetachInfo {
+ oldWindowId: number;
+ oldPosition: number;
+ }
+
+ interface _OnAttachedAttachInfo {
+ newWindowId: number;
+ newPosition: number;
+ }
+
+ interface _OnRemovedRemoveInfo {
+ /** The window whose tab is closed. */
+ windowId: number;
+ /** True when the tab is being closed because its window is being closed. */
+ isWindowClosing: boolean;
+ }
+
+ interface _OnZoomChangeZoomChangeInfo {
+ tabId: number;
+ oldZoomFactor: number;
+ newZoomFactor: number;
+ zoomSettings: ZoomSettings;
+ }
+
+ /* tabs properties */
+ /** An ID which represents the absence of a browser tab. */
+ const TAB_ID_NONE: number;
+
+ /* tabs functions */
+ /** Retrieves details about the specified tab. */
+ function get(tabId: number): Promise<Tab>;
+
+ /**
+ * Gets the tab that this script call is being made from. May be undefined if called from a non-tab context (for example: a background page or popup view).
+ */
+ function getCurrent(): Promise<Tab | undefined>;
+
+ /**
+ * Connects to the content script(s) in the specified tab. The `runtime.onConnect` event is fired in each content script running in the specified tab for the current extension. For more details, see Content Script Messaging.
+ * @returns A port that can be used to communicate with the content scripts running in the specified tab. The port's `runtime.Port` event is fired if the tab closes or does not exist.
+ */
+ function connect(tabId: number, connectInfo?: _ConnectConnectInfo): runtime.Port;
+
+ /**
+ * Sends a single message to the content script(s) in the specified tab, with an optional callback to run when a response is sent back. The `runtime.onMessage` event is fired in each content script running in the specified tab for the current extension.
+ */
+ function sendMessage(tabId: number, message: any, options?: _SendMessageOptions): Promise<any>;
+
+ /** Creates a new tab. */
+ function create(createProperties: _CreateCreateProperties): Promise<Tab>;
+
+ /**
+ * Duplicates a tab.
+ * @param tabId The ID of the tab which is to be duplicated.
+ */
+ function duplicate(tabId: number, duplicateProperties?: _DuplicateDuplicateProperties): Promise<Tab>;
+
+ /** Gets all tabs that have the specified properties, or all tabs if no properties are specified. */
+ function query(queryInfo: _QueryQueryInfo): Promise<Tab[]>;
+
+ /** Highlights the given tabs. */
+ function highlight(highlightInfo: _HighlightHighlightInfo): Promise<windows.Window>;
+
+ /**
+ * Modifies the properties of a tab. Properties that are not specified in `updateProperties` are not modified.
+ */
+ function update(updateProperties: _UpdateUpdateProperties): Promise<Tab>;
+ /**
+ * Modifies the properties of a tab. Properties that are not specified in `updateProperties` are not modified.
+ * @param tabId Defaults to the selected tab of the current window.
+ */
+ function update(tabId: number, updateProperties: _UpdateUpdateProperties): Promise<Tab>;
+
+ /**
+ * Moves one or more tabs to a new position within its window, or to a new window. Note that tabs can only be moved to and from normal (window.type === "normal") windows.
+ * @param tabIds The tab or list of tabs to move.
+ */
+ function move(tabIds: number | number[], moveProperties: _MoveMoveProperties): Promise<Tab | Tab[]>;
+
+ /** Reload a tab. */
+ function reload(): Promise<void>;
+ /**
+ * Reload a tab.
+ * @param tabId The ID of the tab to reload; defaults to the selected tab of the current window.
+ */
+ function reload(tabId: number, reloadProperties?: _ReloadReloadProperties): Promise<void>;
+ /** Reload a tab. */
+ function reload(reloadProperties: _ReloadReloadProperties): Promise<void>;
+
+ /**
+ * Warm up a tab
+ * @param tabId The ID of the tab to warm up.
+ */
+ function warmup(tabId: number): Promise<any>;
+
+ /**
+ * Closes one or more tabs.
+ * @param tabIds The tab or list of tabs to close.
+ */
+ function remove(tabIds: number | number[]): Promise<void>;
+
+ /**
+ * discards one or more tabs.
+ * @param tabIds The tab or list of tabs to discard.
+ */
+ function discard(tabIds: number | number[]): Promise<void>;
+
+ /**
+ * Detects the primary language of the content in a tab.
+ * @param [tabId] Defaults to the active tab of the current window.
+ */
+ function detectLanguage(tabId?: number): Promise<string>;
+
+ /**
+ * Toggles reader mode for the document in the tab.
+ * @param [tabId] Defaults to the active tab of the current window.
+ */
+ function toggleReaderMode(tabId?: number): Promise<void>;
+
+ /** Captures an area of a specified tab. You must have <all_urls> permission to use this method. */
+ function captureTab(): Promise<string>;
+ /**
+ * Captures an area of a specified tab. You must have <all_urls> permission to use this method.
+ * @param tabId The tab to capture. Defaults to the active tab of the current window.
+ */
+ function captureTab(tabId: number, options?: extensionTypes.ImageDetails): Promise<string>;
+ /** Captures an area of a specified tab. You must have <all_urls> permission to use this method. */
+ function captureTab(options: extensionTypes.ImageDetails): Promise<string>;
+
+ /**
+ * Captures an area of the currently active tab in the specified window. You must have <all_urls> permission to use this method.
+ */
+ function captureVisibleTab(): Promise<string>;
+ /**
+ * Captures an area of the currently active tab in the specified window. You must have <all_urls> permission to use this method.
+ * @param windowId The target window. Defaults to the current window.
+ */
+ function captureVisibleTab(windowId: number, options?: extensionTypes.ImageDetails): Promise<string>;
+ /**
+ * Captures an area of the currently active tab in the specified window. You must have <all_urls> permission to use this method.
+ */
+ function captureVisibleTab(options: extensionTypes.ImageDetails): Promise<string>;
+
+ /**
+ * Injects JavaScript code into a page. For details, see the programmatic injection section of the content scripts doc.
+ * @param details Details of the script to run.
+ * Not supported on manifest versions above 2.
+ */
+ function executeScript(details: extensionTypes.InjectDetails): Promise<any[]>;
+ /**
+ * Injects JavaScript code into a page. For details, see the programmatic injection section of the content scripts doc.
+ * @param tabId The ID of the tab in which to run the script; defaults to the active tab of the current window.
+ * @param details Details of the script to run.
+ * Not supported on manifest versions above 2.
+ */
+ function executeScript(tabId: number, details: extensionTypes.InjectDetails): Promise<any[]>;
+
+ /**
+ * Injects CSS into a page. For details, see the programmatic injection section of the content scripts doc.
+ * @param details Details of the CSS text to insert.
+ * Not supported on manifest versions above 2.
+ */
+ function insertCSS(details: extensionTypes.InjectDetails): Promise<void>;
+ /**
+ * Injects CSS into a page. For details, see the programmatic injection section of the content scripts doc.
+ * @param tabId The ID of the tab in which to insert the CSS; defaults to the active tab of the current window.
+ * @param details Details of the CSS text to insert.
+ * Not supported on manifest versions above 2.
+ */
+ function insertCSS(tabId: number, details: extensionTypes.InjectDetails): Promise<void>;
+
+ /**
+ * Removes injected CSS from a page. For details, see the programmatic injection section of the content scripts doc.
+ * @param details Details of the CSS text to remove.
+ * Not supported on manifest versions above 2.
+ */
+ function removeCSS(details: extensionTypes.InjectDetails): Promise<void>;
+ /**
+ * Removes injected CSS from a page. For details, see the programmatic injection section of the content scripts doc.
+ * @param tabId The ID of the tab from which to remove the injected CSS; defaults to the active tab of the current window.
+ * @param details Details of the CSS text to remove.
+ * Not supported on manifest versions above 2.
+ */
+ function removeCSS(tabId: number, details: extensionTypes.InjectDetails): Promise<void>;
+
+ /**
+ * Zooms a specified tab.
+ * @param zoomFactor The new zoom factor. Use a value of 0 here to set the tab to its current default zoom factor. Values greater than zero specify a (possibly non-default) zoom factor for the tab.
+ */
+ function setZoom(zoomFactor: number): Promise<void>;
+ /**
+ * Zooms a specified tab.
+ * @param tabId The ID of the tab to zoom; defaults to the active tab of the current window.
+ * @param zoomFactor The new zoom factor. Use a value of 0 here to set the tab to its current default zoom factor. Values greater than zero specify a (possibly non-default) zoom factor for the tab.
+ */
+ function setZoom(tabId: number, zoomFactor: number): Promise<void>;
+
+ /**
+ * Gets the current zoom factor of a specified tab.
+ * @param [tabId] The ID of the tab to get the current zoom factor from; defaults to the active tab of the current window.
+ */
+ function getZoom(tabId?: number): Promise<number>;
+
+ /**
+ * Sets the zoom settings for a specified tab, which define how zoom changes are handled. These settings are reset to defaults upon navigating the tab.
+ * @param zoomSettings Defines how zoom changes are handled and at what scope.
+ */
+ function setZoomSettings(zoomSettings: ZoomSettings): Promise<void>;
+ /**
+ * Sets the zoom settings for a specified tab, which define how zoom changes are handled. These settings are reset to defaults upon navigating the tab.
+ * @param tabId The ID of the tab to change the zoom settings for; defaults to the active tab of the current window.
+ * @param zoomSettings Defines how zoom changes are handled and at what scope.
+ */
+ function setZoomSettings(tabId: number, zoomSettings: ZoomSettings): Promise<void>;
+
+ /**
+ * Gets the current zoom settings of a specified tab.
+ * @param [tabId] The ID of the tab to get the current zoom settings from; defaults to the active tab of the current window.
+ */
+ function getZoomSettings(tabId?: number): Promise<ZoomSettings>;
+
+ /** Prints page in active tab. */
+ function print(): void;
+
+ /** Shows print preview for page in active tab. */
+ function printPreview(): Promise<void>;
+
+ /**
+ * Saves page in active tab as a PDF file.
+ * @param pageSettings The page settings used to save the PDF file.
+ */
+ function saveAsPDF(pageSettings: PageSettings): Promise<string>;
+
+ /**
+ * Shows one or more tabs.
+ * @param tabIds The TAB ID or list of TAB IDs to show.
+ */
+ function show(tabIds: number | number[]): Promise<void>;
+
+ /**
+ * Hides one or more tabs. The `"tabHide"` permission is required to hide tabs. Not all tabs are hidable. Returns an array of hidden tabs.
+ * @param tabIds The TAB ID or list of TAB IDs to hide.
+ */
+ function hide(tabIds: number | number[]): Promise<number[]>;
+
+ /**
+ * Removes an array of tabs from their lines of succession and prepends or appends them in a chain to another tab.
+ * @param tabIds An array of tab IDs to move in the line of succession. For each tab in the array, the tab's current predecessors will have their successor set to the tab's current successor, and each tab will then be set to be the successor of the previous tab in the array. Any tabs not in the same window as the tab indicated by the second argument (or the first tab in the array, if no second argument) will be skipped.
+ * @param [tabId] The ID of a tab to set as the successor of the last tab in the array, or `tabs.TAB_ID_NONE` to leave the last tab without a successor. If options.append is true, then this tab is made the predecessor of the first tab in the array instead.
+ */
+ function moveInSuccession(tabIds: number[], tabId?: number, options?: _MoveInSuccessionOptions): Promise<any>;
+
+ /**
+ * Navigate to next page in tab's history, if available
+ * @param [tabId] The ID of the tab to navigate forward.
+ */
+ function goForward(tabId?: number): Promise<void>;
+
+ /**
+ * Navigate to previous page in tab's history, if available.
+ * @param [tabId] The ID of the tab to navigate backward.
+ */
+ function goBack(tabId?: number): Promise<void>;
+
+ /* tabs events */
+ /**
+ * Fired when a tab is created. Note that the tab's URL may not be set at the time this event fired, but you can listen to onUpdated events to be notified when a URL is set.
+ * @param tab Details of the tab that was created.
+ */
+ const onCreated: WebExtEvent<(tab: Tab) => void>;
+
+ /**
+ * Fired when a tab is updated.
+ * @param changeInfo Lists the changes to the state of the tab that was updated.
+ * @param tab Gives the state of the tab that was updated.
+ */
+ const onUpdated: _TabsOnUpdatedEvent;
+
+ /**
+ * Fired when a tab is moved within a window. Only one move event is fired, representing the tab the user directly moved. Move events are not fired for the other tabs that must move in response. This event is not fired when a tab is moved between windows. For that, see `tabs.onDetached`.
+ */
+ const onMoved: WebExtEvent<(tabId: number, moveInfo: _OnMovedMoveInfo) => void>;
+
+ /**
+ * Fires when the active tab in a window changes. Note that the tab's URL may not be set at the time this event fired, but you can listen to onUpdated events to be notified when a URL is set.
+ */
+ const onActivated: WebExtEvent<(activeInfo: _OnActivatedActiveInfo) => void>;
+
+ /** Fired when the highlighted or selected tabs in a window changes. */
+ const onHighlighted: WebExtEvent<(highlightInfo: _OnHighlightedHighlightInfo) => void>;
+
+ /** Fired when a tab is detached from a window, for example because it is being moved between windows. */
+ const onDetached: WebExtEvent<(tabId: number, detachInfo: _OnDetachedDetachInfo) => void>;
+
+ /** Fired when a tab is attached to a window, for example because it was moved between windows. */
+ const onAttached: WebExtEvent<(tabId: number, attachInfo: _OnAttachedAttachInfo) => void>;
+
+ /** Fired when a tab is closed. */
+ const onRemoved: WebExtEvent<(tabId: number, removeInfo: _OnRemovedRemoveInfo) => void>;
+
+ /** Fired when a tab is replaced with another tab due to prerendering or instant. */
+ const onReplaced: WebExtEvent<(addedTabId: number, removedTabId: number) => void>;
+
+ /** Fired when a tab is zoomed. */
+ const onZoomChange: WebExtEvent<(ZoomChangeInfo: _OnZoomChangeZoomChangeInfo) => void>;
+}
+
+/**
+ * Use the browser.topSites API to access the top sites that are displayed on the new tab page.
+ *
+ * Permissions: `topSites`
+ *
+ * Not allowed in: Content scripts, Devtools pages
+ */
+declare namespace browser.topSites {
+ /* topSites types */
+ /** An object encapsulating a most visited URL, such as the URLs on the new tab page. */
+ interface MostVisitedURL {
+ /** The most visited URL. */
+ url: string;
+ /** The title of the page. */
+ title?: string | undefined;
+ /** Data URL for the favicon, if available. */
+ favicon?: string | undefined;
+ /** The entry type, either `url` for a normal page link, or `search` for a search shortcut. */
+ type?: _MostVisitedURLType | undefined;
+ }
+
+ /** The entry type, either `url` for a normal page link, or `search` for a search shortcut. */
+ type _MostVisitedURLType = "url" | "search";
+
+ interface _GetOptions {
+ /** @deprecated Please use the other options to tune the results received from topSites. */
+ providers?: string[] | undefined;
+ /** The number of top sites to return, defaults to the value used by Firefox */
+ limit?: number | undefined;
+ /** Limit the result to a single top site link per domain */
+ onePerDomain?: boolean | undefined;
+ /** Include sites that the user has blocked from appearing on the Firefox new tab. */
+ includeBlocked?: boolean | undefined;
+ /** Include sites favicon if available. */
+ includeFavicon?: boolean | undefined;
+ /** Include sites that the user has pinned on the Firefox new tab. */
+ includePinned?: boolean | undefined;
+ /** Include search shortcuts appearing on the Firefox new tab. */
+ includeSearchShortcuts?: boolean | undefined;
+ /**
+ * Return the sites that exactly appear on the user's new-tab page. When true, all other options are ignored except limit and includeFavicon. If the user disabled newtab Top Sites, the newtab parameter will be ignored.
+ */
+ newtab?: boolean | undefined;
+ }
+
+ /* topSites functions */
+ /** Gets a list of top sites. */
+ function get(options?: _GetOptions): Promise<MostVisitedURL[]>;
+}
+
+/**
+ * Use the `browser.urlbar` API to experiment with new features in the URLBar. Restricted to Mozilla privileged WebExtensions.
+ *
+ * Permissions: `urlbar`
+ *
+ * Not allowed in: Content scripts, Devtools pages
+ */
+declare namespace browser.urlbar {
+ /* urlbar types */
+ /**
+ * The state of an engagement made with the urlbar by the user. `start`: The user has started an engagement. `engagement`: The user has completed an engagement by picking a result. `abandonment`: The user has abandoned their engagement, for example by blurring the urlbar. `discard`: The engagement ended in a way that should be ignored by listeners.
+ */
+ type EngagementState = "start" | "engagement" | "abandonment" | "discard";
+
+ /** A query performed in the urlbar. */
+ interface Query {
+ /** Whether the query's browser context is private. */
+ isPrivate: boolean;
+ /** The maximum number of results shown to the user. */
+ maxResults: number;
+ /** The query's search string. */
+ searchString: string;
+ /** List of acceptable source types to return. */
+ sources: SourceType[];
+ }
+
+ /** A result of a query. Queries can have many results. Each result is created by a provider. */
+ interface Result {
+ /** An object with arbitrary properties depending on the result's type. */
+ payload: object;
+ /** The result's source. */
+ source: SourceType;
+ /** The result's type. */
+ type: ResultType;
+ /** Suggest a preferred position for this result within the result set. */
+ suggestedIndex?: number | undefined;
+ }
+
+ /**
+ * Possible types of results. `dynamic`: A result whose view and payload are specified by the extension. `remote_tab`: A synced tab from another device. `search`: A search suggestion from a search engine. `tab`: An open tab in the browser. `tip`: An actionable message to help the user with their query. `url`: A URL that's not one of the other types.
+ */
+ type ResultType = "dynamic" | "remote_tab" | "search" | "tab" | "tip" | "url";
+
+ /** Options to the `search` function. */
+ interface SearchOptions {
+ /** Whether to focus the input field and select its contents. */
+ focus?: boolean | undefined;
+ }
+
+ /**
+ * Possible sources of results. `bookmarks`: The result comes from the user's bookmarks. `history`: The result comes from the user's history. `local`: The result comes from some local source not covered by another source type. `network`: The result comes from some network source not covered by another source type. `search`: The result comes from a search engine. `tabs`: The result is an open tab in the browser or a synced tab from another device.
+ */
+ type SourceType = "bookmarks" | "history" | "local" | "network" | "search" | "tabs";
+
+ interface _UrlbarOnBehaviorRequestedEvent<TCallback = (query: Query) => "active" | "inactive" | "restricting"> {
+ addListener(cb: TCallback, providerName: string): void;
+ removeListener(cb: TCallback): void;
+ hasListener(cb: TCallback): boolean;
+ }
+
+ interface _UrlbarOnEngagementEvent<TCallback = (state: EngagementState) => void> {
+ addListener(cb: TCallback, providerName: string): void;
+ removeListener(cb: TCallback): void;
+ hasListener(cb: TCallback): boolean;
+ }
+
+ interface _UrlbarOnQueryCanceledEvent<TCallback = (query: Query) => void> {
+ addListener(cb: TCallback, providerName: string): void;
+ removeListener(cb: TCallback): void;
+ hasListener(cb: TCallback): boolean;
+ }
+
+ interface _UrlbarOnResultsRequestedEvent<TCallback = (query: Query) => Result[]> {
+ addListener(cb: TCallback, providerName: string): void;
+ removeListener(cb: TCallback): void;
+ hasListener(cb: TCallback): boolean;
+ }
+
+ interface _UrlbarOnResultPickedEvent<TCallback = (payload: object, elementName: string) => void> {
+ addListener(cb: TCallback, providerName: string): void;
+ removeListener(cb: TCallback): void;
+ hasListener(cb: TCallback): boolean;
+ }
+
+ /* urlbar properties */
+ /** Enables or disables the engagement telemetry. */
+ const engagementTelemetry: types.Setting;
+
+ /* urlbar functions */
+ /** Closes the urlbar view in the current window. */
+ function closeView(): Promise<any>;
+
+ /**
+ * Focuses the urlbar in the current window.
+ * @param [select] If true, the text in the urlbar will also be selected.
+ */
+ function focus(select?: boolean): Promise<any>;
+
+ /**
+ * Starts a search in the urlbar in the current window.
+ * @param searchString The search string.
+ * @param [options] Options for the search.
+ */
+ function search(searchString: string, options?: SearchOptions): Promise<any>;
+
+ /* urlbar events */
+ /**
+ * Before a query starts, this event is fired for the given provider. Its purpose is to request the provider's behavior for the query. The listener should return a behavior in response. By default, providers are inactive, so if your provider should always be inactive, you don't need to listen for this event.
+ * @param query The query for which the behavior is requested.
+ * @returns The behavior of the provider for the query.
+ */
+ const onBehaviorRequested: _UrlbarOnBehaviorRequestedEvent;
+
+ /**
+ * This event is fired when the user starts and ends an engagement with the urlbar.
+ * @param state The state of the engagement.
+ */
+ const onEngagement: _UrlbarOnEngagementEvent;
+
+ /**
+ * This event is fired for the given provider when a query is canceled. The listener should stop any ongoing fetch or creation of results and clean up its resources.
+ * @param query The query that was canceled.
+ */
+ const onQueryCanceled: _UrlbarOnQueryCanceledEvent;
+
+ /**
+ * When a query starts, this event is fired for the given provider if the provider is active for the query and there are no other providers that are restricting. Its purpose is to request the provider's results for the query. The listener should return a list of results in response.
+ * @param query The query for which results are requested.
+ * @returns The results that the provider fetched for the query.
+ */
+ const onResultsRequested: _UrlbarOnResultsRequestedEvent;
+
+ /**
+ * Typically, a provider includes a `url` property in its results' payloads. When the user picks a result with a URL, Firefox automatically loads the URL. URLs don't make sense for every result type, however. When the user picks a result without a URL, this event is fired. The provider should take an appropriate action in response. Currently the only applicable `ResultTypes` are `dynamic` and `tip`.
+ * @param payload The payload of the result that was picked.
+ * @param elementName If the result is a dynamic type, this is the name of the element in the result view that was picked. If the result is not a dynamic type, this is an empty string.
+ */
+ const onResultPicked: _UrlbarOnResultPickedEvent;
+}
+
+/**
+ * Use the `browser.windows` API to interact with browser windows. You can use this API to create, modify, and rearrange windows in the browser.
+ *
+ * Not allowed in: Content scripts, Devtools pages
+ */
+declare namespace browser.windows {
+ /* windows types */
+ /**
+ * The type of browser window this is. Under some circumstances a Window may not be assigned type property, for example when querying closed windows from the `sessions` API.
+ */
+ type WindowType = "normal" | "popup" | "panel" | "app" | "devtools";
+
+ /**
+ * The state of this browser window. Under some circumstances a Window may not be assigned state property, for example when querying closed windows from the `sessions` API.
+ */
+ type WindowState = "normal" | "minimized" | "maximized" | "fullscreen" | "docked";
+
+ interface Window {
+ /**
+ * The ID of the window. Window IDs are unique within a browser session. Under some circumstances a Window may not be assigned an ID, for example when querying windows using the `sessions` API, in which case a session ID may be present.
+ */
+ id?: number | undefined;
+ /** Whether the window is currently the focused window. */
+ focused: boolean;
+ /**
+ * The offset of the window from the top edge of the screen in pixels. Under some circumstances a Window may not be assigned top property, for example when querying closed windows from the `sessions` API.
+ */
+ top?: number | undefined;
+ /**
+ * The offset of the window from the left edge of the screen in pixels. Under some circumstances a Window may not be assigned left property, for example when querying closed windows from the `sessions` API.
+ */
+ left?: number | undefined;
+ /**
+ * The width of the window, including the frame, in pixels. Under some circumstances a Window may not be assigned width property, for example when querying closed windows from the `sessions` API.
+ */
+ width?: number | undefined;
+ /**
+ * The height of the window, including the frame, in pixels. Under some circumstances a Window may not be assigned height property, for example when querying closed windows from the `sessions` API.
+ */
+ height?: number | undefined;
+ /** Array of `tabs.Tab` objects representing the current tabs in the window. */
+ tabs?: tabs.Tab[] | undefined;
+ /** Whether the window is incognito. */
+ incognito: boolean;
+ /** The type of browser window this is. */
+ type?: WindowType | undefined;
+ /** The state of this browser window. */
+ state?: WindowState | undefined;
+ /** Whether the window is set to be always on top. */
+ alwaysOnTop: boolean;
+ /** The session ID used to uniquely identify a Window obtained from the `sessions` API. */
+ sessionId?: string | undefined;
+ /** The title of the window. Read-only. */
+ title?: string | undefined;
+ }
+
+ /**
+ * Specifies what type of browser window to create. The 'panel' and 'detached_panel' types create a popup unless the '--enable-panels' flag is set.
+ */
+ type CreateType = "normal" | "popup" | "panel" | "detached_panel";
+
+ /** Specifies whether the `windows.Window` returned should contain a list of the `tabs.Tab` objects. */
+ interface GetInfo {
+ /**
+ * If true, the `windows.Window` returned will have a `tabs` property that contains a list of the `tabs.Tab` objects. The `Tab` objects only contain the `url`, `title` and `favIconUrl` properties if the extension's manifest file includes the `"tabs"` permission.
+ */
+ populate?: boolean | undefined;
+ /**
+ * `windowTypes` is deprecated and ignored on Firefox.
+ * @deprecated `windowTypes` is deprecated and ignored on Firefox.
+ */
+ windowTypes?: WindowType[] | undefined;
+ }
+
+ /**
+ * Specifies properties used to filter the `windows.Window` returned and to determine whether they should contain a list of the `tabs.Tab` objects.
+ */
+ interface _GetAllGetInfo {
+ /**
+ * If set, the `windows.Window` returned will be filtered based on its type. If unset the default filter is set to `['app', 'normal', 'panel', 'popup']`, with `'app'` and `'panel'` window types limited to the extension's own windows.
+ * @deprecated If set, the `windows.Window` returned will be filtered based on its type. If unset the default filter is set to `['app', 'normal', 'panel', 'popup']`, with `'app'` and `'panel'` window types limited to the extension's own windows.
+ */
+ windowTypes?: WindowType[] | undefined;
+ /**
+ * If true, the `windows.Window` returned will have a `tabs` property that contains a list of the `tabs.Tab` objects. The `Tab` objects only contain the `url`, `title` and `favIconUrl` properties if the extension's manifest file includes the `"tabs"` permission.
+ */
+ populate?: boolean | undefined;
+ }
+
+ interface _CreateCreateData {
+ /**
+ * A URL or array of URLs to open as tabs in the window. Fully-qualified URLs must include a scheme (i.e. 'http://www.google.com', not 'www.google.com'). Relative URLs will be relative to the current page within the extension. Defaults to the New Tab Page.
+ */
+ url?: string | string[] | undefined;
+ /** The id of the tab for which you want to adopt to the new window. */
+ tabId?: number | undefined;
+ /**
+ * The number of pixels to position the new window from the left edge of the screen. If not specified, the new window is offset naturally from the last focused window. This value is ignored for panels.
+ */
+ left?: number | undefined;
+ /**
+ * The number of pixels to position the new window from the top edge of the screen. If not specified, the new window is offset naturally from the last focused window. This value is ignored for panels.
+ */
+ top?: number | undefined;
+ /**
+ * The width in pixels of the new window, including the frame. If not specified defaults to a natural width.
+ */
+ width?: number | undefined;
+ /**
+ * The height in pixels of the new window, including the frame. If not specified defaults to a natural height.
+ */
+ height?: number | undefined;
+ /** If true, opens an active window. If false, opens an inactive window. */
+ focused?: boolean | undefined;
+ /** Whether the new window should be an incognito window. */
+ incognito?: boolean | undefined;
+ /**
+ * Specifies what type of browser window to create. The 'panel' and 'detached_panel' types create a popup unless the '--enable-panels' flag is set.
+ */
+ type?: CreateType | undefined;
+ /**
+ * The initial state of the window. The 'minimized', 'maximized' and 'fullscreen' states cannot be combined with 'left', 'top', 'width' or 'height'.
+ */
+ state?: WindowState | undefined;
+ /** Allow scripts to close the window. */
+ allowScriptsToClose?: boolean | undefined;
+ /** The CookieStoreId to use for all tabs that were created when the window is opened. */
+ cookieStoreId?: string | undefined;
+ /** A string to add to the beginning of the window title. */
+ titlePreface?: string | undefined;
+ }
+
+ interface _UpdateUpdateInfo {
+ /**
+ * The offset from the left edge of the screen to move the window to in pixels. This value is ignored for panels.
+ */
+ left?: number | undefined;
+ /**
+ * The offset from the top edge of the screen to move the window to in pixels. This value is ignored for panels.
+ */
+ top?: number | undefined;
+ /** The width to resize the window to in pixels. This value is ignored for panels. */
+ width?: number | undefined;
+ /** The height to resize the window to in pixels. This value is ignored for panels. */
+ height?: number | undefined;
+ /**
+ * If true, brings the window to the front. If false, brings the next window in the z-order to the front.
+ */
+ focused?: boolean | undefined;
+ /**
+ * If true, causes the window to be displayed in a manner that draws the user's attention to the window, without changing the focused window. The effect lasts until the user changes focus to the window. This option has no effect if the window already has focus. Set to false to cancel a previous draw attention request.
+ */
+ drawAttention?: boolean | undefined;
+ /**
+ * The new state of the window. The 'minimized', 'maximized' and 'fullscreen' states cannot be combined with 'left', 'top', 'width' or 'height'.
+ */
+ state?: WindowState | undefined;
+ /** A string to add to the beginning of the window title. */
+ titlePreface?: string | undefined;
+ }
+
+ /* windows properties */
+ /** The windowId value that represents the absence of a browser window. */
+ const WINDOW_ID_NONE: number;
+
+ /** The windowId value that represents the current window. */
+ const WINDOW_ID_CURRENT: number;
+
+ /* windows functions */
+ /** Gets details about a window. */
+ function get(windowId: number, getInfo?: GetInfo): Promise<Window>;
+
+ /** Gets the current window. */
+ function getCurrent(getInfo?: GetInfo): Promise<Window>;
+
+ /** Gets the window that was most recently focused — typically the window 'on top'. */
+ function getLastFocused(getInfo?: GetInfo): Promise<Window>;
+
+ /**
+ * Gets all windows.
+ * @param [getInfo] Specifies properties used to filter the `windows.Window` returned and to determine whether they should contain a list of the `tabs.Tab` objects.
+ */
+ function getAll(getInfo?: _GetAllGetInfo): Promise<Window[]>;
+
+ /** Creates (opens) a new browser with any optional sizing, position or default URL provided. */
+ function create(createData?: _CreateCreateData): Promise<Window>;
+
+ /**
+ * Updates the properties of a window. Specify only the properties that you want to change; unspecified properties will be left unchanged.
+ */
+ function update(windowId: number, updateInfo: _UpdateUpdateInfo): Promise<Window>;
+
+ /** Removes (closes) a window, and all the tabs inside it. */
+ function remove(windowId: number): Promise<void>;
+
+ /* windows events */
+ /**
+ * Fired when a window is created.
+ * @param window Details of the window that was created.
+ */
+ const onCreated: WebExtEvent<(window: Window) => void>;
+
+ /**
+ * Fired when a window is removed (closed).
+ * @param windowId ID of the removed window.
+ */
+ const onRemoved: WebExtEvent<(windowId: number) => void>;
+
+ /**
+ * Fired when the currently focused window changes. Will be `windows.WINDOW_ID_NONE` if all browser windows have lost focus. Note: On some Linux window managers, WINDOW_ID_NONE will always be sent immediately preceding a switch from one browser window to another.
+ * @param windowId ID of the newly focused window.
+ */
+ const onFocusChanged: WebExtEvent<(windowId: number) => void>;
+}
diff --git a/client/node_modules/@types/firefox-webext-browser/package.json b/client/node_modules/@types/firefox-webext-browser/package.json
new file mode 100644
index 0000000..485f767
--- /dev/null
+++ b/client/node_modules/@types/firefox-webext-browser/package.json
@@ -0,0 +1,26 @@
+{
+ "name": "@types/firefox-webext-browser",
+ "version": "111.0.5",
+ "description": "TypeScript definitions for firefox-webext-browser",
+ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/firefox-webext-browser",
+ "license": "MIT",
+ "contributors": [
+ {
+ "name": "Jasmin Bom",
+ "githubUsername": "jsmnbom",
+ "url": "https://github.com/jsmnbom"
+ }
+ ],
+ "main": "",
+ "types": "index.d.ts",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
+ "directory": "types/firefox-webext-browser"
+ },
+ "scripts": {},
+ "dependencies": {},
+ "typesPublisherContentHash": "a37a48587c44ad1ebf1ada5f9737c6199bbd066b4f1a8e3e77b57df3d9e66a52",
+ "typeScriptVersion": "4.5",
+ "nonNpm": true
+} \ No newline at end of file
diff --git a/client/node_modules/@types/har-format/LICENSE b/client/node_modules/@types/har-format/LICENSE
new file mode 100644
index 0000000..9e841e7
--- /dev/null
+++ b/client/node_modules/@types/har-format/LICENSE
@@ -0,0 +1,21 @@
+ MIT License
+
+ Copyright (c) Microsoft Corporation.
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE
diff --git a/client/node_modules/@types/har-format/README.md b/client/node_modules/@types/har-format/README.md
new file mode 100644
index 0000000..49dbc5d
--- /dev/null
+++ b/client/node_modules/@types/har-format/README.md
@@ -0,0 +1,15 @@
+# Installation
+> `npm install --save @types/har-format`
+
+# Summary
+This package contains type definitions for har-format (https://w3c.github.io/web-performance/specs/HAR/Overview.html).
+
+# Details
+Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/har-format.
+
+### Additional Details
+ * Last updated: Tue, 07 Nov 2023 03:09:37 GMT
+ * Dependencies: none
+
+# Credits
+These definitions were written by [Michael Mrowetz](https://github.com/micmro), and [Marcell Toth](https://github.com/marcelltoth).
diff --git a/client/node_modules/@types/har-format/index.d.ts b/client/node_modules/@types/har-format/index.d.ts
new file mode 100644
index 0000000..9583ee0
--- /dev/null
+++ b/client/node_modules/@types/har-format/index.d.ts
@@ -0,0 +1,904 @@
+/**
+ * HTTP Archive 1.2
+ *
+ * http://www.softwareishard.com/blog/har-12-spec
+ */
+export interface Har {
+ /** This object represents the root of exported data. */
+ log: Log;
+}
+/**
+ * This object (`log`) represents the root of exported data.
+ *
+ * http://www.softwareishard.com/blog/har-12-spec/#log
+ */
+export interface Log {
+ /**
+ * Version number of the format.
+ *
+ * _If empty, string "1.1" is assumed by default._
+ */
+ version: string;
+ /** Name and version info of the log creator application. */
+ creator: Creator;
+ /** Name and version info of used browser. */
+ browser?: Browser | undefined;
+ /**
+ * List of all exported (tracked) pages.
+ *
+ * _Leave out this field if the application
+ * does not support grouping by pages._
+ *
+ * There is one `<page>` object for every exported web page and one
+ * `<entry>` object for every HTTP request.
+ * In case when an HTTP trace tool isn't able to group requests by a page,
+ * the `<pages>` object is empty and individual requests doesn't have a
+ * parent page.
+ */
+ pages?: Page[] | undefined;
+ /** List of all exported (tracked) requests. */
+ entries: Entry[];
+ /** A comment provided by the user or the application. */
+ comment?: string | undefined;
+}
+/**
+ * Infos about application/browser used to export the log.
+ *
+ * `Creator` and `Browser` objects share the same structure.
+ *
+ * http://www.softwareishard.com/blog/har-12-spec/#creator
+ */
+export interface Creator {
+ /** Name of the application/browser used to export the log. */
+ name: string;
+ /** Version of the application/browser used to export the log. */
+ version: string;
+ /** A comment provided by the user or the application. */
+ comment?: string | undefined;
+}
+/**
+ * Infos about application/browser used to export the log.
+ *
+ * `Browser` and `Creator` objects share the same structure.
+ *
+ * http://www.softwareishard.com/blog/har-12-spec/#browser
+ */
+export interface Browser {
+ /** Name of the application/browser used to export the log. */
+ name: string;
+ /** Version of the application/browser used to export the log. */
+ version: string;
+ /** A comment provided by the user or the application. */
+ comment?: string | undefined;
+}
+/**
+ * This object represents list of exported pages.
+ *
+ * http://www.softwareishard.com/blog/har-12-spec/#pages
+ */
+export interface Page {
+ /**
+ * Date and time stamp for the beginning of the page load
+ *
+ * (ISO 8601 - `YYYY-MM-DDThh:mm:ss.sTZD`,
+ * e.g. `2009-07-24T19:20:30.45+01:00`).
+ */
+ startedDateTime: string;
+ /**
+ * Unique identifier of a page within the `<log>` (HAR doc).
+ * Entries use it to refer the parent page.
+ */
+ id: string;
+ /** Page title. */
+ title: string;
+ /** Detailed timing info about page load */
+ pageTimings: PageTiming;
+ /** A comment provided by the user or the application */
+ comment?: string | undefined;
+ /** _non-standard_ */
+ /** _non-standard_ */
+ _adult_site?: number | null | undefined;
+ /** _non-standard_ */
+ _aft?: number | null | undefined;
+ /** _non-standard_ */
+ _base_page_cdn?: string | null | undefined;
+ /** _non-standard_ */
+ _base_page_redirects?: number | null | undefined;
+ /** _non-standard_ */
+ _base_page_ttfb?: number | null | undefined;
+ /** _non-standard_ */
+ _browser_main_memory_kb?: number | null | undefined;
+ /** _non-standard_ */
+ _browser_name?: string | null | undefined;
+ /** _non-standard_ */
+ _browser_other_private_memory_kb?: number | null | undefined;
+ /** _non-standard_ */
+ _browser_process_count?: number | null | undefined;
+ /** _non-standard_ */
+ _browser_version?: string | null | undefined;
+ /** _non-standard_ */
+ _browser_working_set_kb?: number | null | undefined;
+ /** _non-standard_ */
+ _bytesIn?: number | null | undefined;
+ /** _non-standard_ */
+ _bytesInDoc?: number | null | undefined;
+ /** _non-standard_ */
+ _bytesOut?: number | null | undefined;
+ /** _non-standard_ */
+ _bytesOutDoc?: number | null | undefined;
+ /** _non-standard_ */
+ _cached?: number | null | undefined;
+ /** _non-standard_ */
+ _certificate_bytes?: number | null | undefined;
+ /** _non-standard_ */
+ _connections?: number | null | undefined;
+ /** _non-standard_ */
+ _date?: number | null | undefined;
+ /** _non-standard_ */
+ _docCPUms?: number | null | undefined;
+ /** _non-standard_ */
+ _docCPUpct?: number | null | undefined;
+ /** _non-standard_ */
+ _docTime?: number | null | undefined;
+ /** _non-standard_ */
+ _domContentLoadedEventEnd?: number | null | undefined;
+ /** _non-standard_ */
+ _domContentLoadedEventStart?: number | null | undefined;
+ /** _non-standard_ */
+ _domElements?: number | null | undefined;
+ /** _non-standard_ */
+ _domInteractive?: number | null | undefined;
+ /** _non-standard_ */
+ _domLoading?: number | null | undefined;
+ /** _non-standard_ */
+ _domTime?: number | null | undefined;
+ /** _non-standard_ */
+ _effectiveBps?: number | null | undefined;
+ /** _non-standard_ */
+ _effectiveBpsDoc?: number | null | undefined;
+ /** _non-standard_ */
+ _eventName?: string | null | undefined;
+ /** _non-standard_ */
+ _firstPaint?: number | null | undefined;
+ /** _non-standard_ */
+ _fixed_viewport?: number | null | undefined;
+ /** _non-standard_ */
+ _fullyLoaded?: number | null | undefined;
+ /** _non-standard_ */
+ _fullyLoadedCPUms?: number | null | undefined;
+ /** _non-standard_ */
+ _fullyLoadedCPUpct?: number | null | undefined;
+ /** _non-standard_ */
+ _gzip_savings?: number | null | undefined;
+ /** _non-standard_ */
+ _gzip_total?: number | null | undefined;
+ /** _non-standard_ */
+ _image_savings?: number | null | undefined;
+ /** _non-standard_ */
+ _image_total?: number | null | undefined;
+ /** _non-standard_ */
+ _isResponsive?: number | null | undefined;
+ /** _non-standard_ */
+ _lastVisualChange?: number | null | undefined;
+ /** _non-standard_ */
+ _loadEventEnd?: number | null | undefined;
+ /** _non-standard_ */
+ _loadEventStart?: number | null | undefined;
+ /** _non-standard_ */
+ _loadTime?: number | null | undefined;
+ /** _non-standard_ */
+ _minify_savings?: number | null | undefined;
+ /** _non-standard_ */
+ _minify_total?: number | null | undefined;
+ /** _non-standard_ */
+ _optimization_checked?: number | null | undefined;
+ /** _non-standard_ */
+ _pageSpeedVersion?: string | null | undefined;
+ /** _non-standard_ */
+ _render?: number | null | undefined;
+ /** _non-standard_ */
+ _requests?: number | null | undefined;
+ /** _non-standard_ */
+ _requestsDoc?: number | null | undefined;
+ /** _non-standard_ */
+ _requestsFull?: number | null | undefined;
+ /** _non-standard_ */
+ _responses_200?: number | null | undefined;
+ /** _non-standard_ */
+ _responses_404?: number | null | undefined;
+ /** _non-standard_ */
+ _responses_other?: number | null | undefined;
+ /** _non-standard_ */
+ _result?: number | null | undefined;
+ /** _non-standard_ */
+ _run?: number | null | undefined;
+ /** _non-standard_ */
+ _score_cache?: number | null | undefined;
+ /** _non-standard_ */
+ _score_cdn?: number | null | undefined;
+ /** _non-standard_ */
+ _score_combine?: number | null | undefined;
+ /** _non-standard_ */
+ _score_compress?: number | null | undefined;
+ /** _non-standard_ */
+ _score_cookies?: number | null | undefined;
+ /** _non-standard_ */
+ _score_etags?: number | null | undefined;
+ /** _non-standard_ */
+ _score_gzip?: number | null | undefined;
+ /** _non-standard_ */
+ "_score_keep-alive"?: number | null | undefined;
+ /** _non-standard_ */
+ _score_minify?: number | null | undefined;
+ /** _non-standard_ */
+ _score_progressive_jpeg?: number | null | undefined;
+ /** _non-standard_ */
+ _server_count?: number | null | undefined;
+ /** _non-standard_ */
+ _server_rtt?: number | null | undefined;
+ /** _non-standard_ */
+ _SpeedIndex?: number | null | undefined;
+ /** _non-standard_ */
+ _step?: number | null | undefined;
+ /** _non-standard_ */
+ _title?: string | null | undefined;
+ /** _non-standard_ */
+ _titleTime?: number | null | undefined;
+ /** _non-standard_ */
+ _TTFB?: number | null | undefined;
+ /** _non-standard_ */
+ _URL?: string | null | undefined;
+ /** _non-standard_ */
+ _visualComplete?: number | null | undefined;
+ /**
+ * _non-standard_
+ *
+ * See "Custom Fields" under http://www.softwareishard.com/blog/har-12-spec
+ */
+ [customField: `_${string}`]: unknown | null | undefined;
+}
+/**
+ * This object describes timings for various events (states) fired during the
+ * page load.
+ *
+ * All times are specified in milliseconds.
+ *
+ * If a time info is not available appropriate field is set to `-1`.
+ *
+ * http://www.softwareishard.com/blog/har-12-spec/#pageTimings
+ */
+export interface PageTiming {
+ /**
+ * Content of the page loaded. Number of milliseconds since page load
+ * started (`page.startedDateTime`).
+ *
+ * Use `-1` if the timing does not apply to the current request.
+ */
+ onContentLoad?: number | undefined;
+ /**
+ * Page is loaded (`onLoad` event fired). Number of milliseconds since
+ * page load started (`page.startedDateTime`).
+ *
+ * Use `-1` if the timing does not apply to the current request.
+ */
+ onLoad?: number | undefined;
+ /** A comment provided by the user or the application */
+ comment?: string | undefined;
+ _startRender?: number | null | undefined;
+}
+/**
+ * _non-standard_
+ *
+ * Data for Chunk as provided by e.g. WebPageTest
+ */
+export interface Chunk {
+ bytes: number;
+ ts: number;
+}
+/**
+ * This object represents an array with all exported HTTP requests. Sorting
+ * entries by `startedDateTime` (starting from the oldest) is preferred way how
+ * to export data since it can make importing faster.
+ * However the reader application should always make sure the array is sorted
+ * (if required for the import).
+ *
+ * http://www.softwareishard.com/blog/har-12-spec/#entries
+ */
+export interface Entry {
+ /**
+ * Reference to the parent page. Leave out this field if the application
+ * does not support grouping by pages.
+ */
+ pageref?: string | undefined;
+ /**
+ * Date and time stamp of the request start
+ *
+ * (ISO 8601 - `YYYY-MM-DDThh:mm:ss.sTZD`).
+ */
+ startedDateTime: string;
+ /**
+ * Total elapsed time of the request in milliseconds.
+ *
+ * This is the sum of all timings available in the timings object
+ * (i.e. not including `-1` values).
+ */
+ time: number;
+ /** Detailed info about the request. */
+ request: Request;
+ /** Detailed info about the response. */
+ response: Response;
+ /** Info about cache usage. */
+ cache: Cache;
+ /** Detailed timing info about request/response round trip. */
+ timings: Timings;
+ /**
+ * IP address of the server that was connected
+ * (result of DNS resolution).
+ */
+ serverIPAddress?: string | undefined;
+ /**
+ * Unique ID of the parent TCP/IP connection, can be the client or server
+ * port number.
+ *
+ * Note that a port number doesn't have to be unique identifier
+ * in cases where the port is shared for more connections.
+ *
+ * If the port isn't available for the application, any other unique
+ * connection ID can be used instead (e.g. connection index). Leave out
+ * this field if the application doesn't support this info.
+ */
+ connection?: string | undefined;
+ /** A comment provided by the user or the application */
+ comment?: string | undefined;
+ /** _non-standard_ */
+ _all_end?: number | string | null | undefined;
+ /** _non-standard_ */
+ _all_ms?: number | string | null | undefined;
+ /** _non-standard_ */
+ _all_start?: number | string | null | undefined;
+ /** _non-standard_ */
+ _bytesIn?: number | string | null | undefined;
+ /** _non-standard_ */
+ _bytesOut?: number | string | null | undefined;
+ /** _non-standard_ */
+ _cacheControl?: string | null | undefined;
+ /** _non-standard_ */
+ _cache_time?: number | string | null | undefined;
+ /** _non-standard_ */
+ _cdn_provider?: string | null | undefined;
+ /** _non-standard_ */
+ _certificate_bytes?: number | string | null | undefined;
+ /** _non-standard_ */
+ _chunks?: Chunk[] | null | undefined;
+ /** _non-standard_ */
+ _client_port?: number | string | null | undefined;
+ /** _non-standard_ */
+ _connect_end?: number | string | null | undefined;
+ /** _non-standard_ */
+ _connect_ms?: number | string | null | undefined;
+ /** _non-standard_ */
+ _connect_start?: number | string | null | undefined;
+ /** _non-standard_ */
+ _contentEncoding?: string | null | undefined;
+ /** _non-standard_ */
+ _contentType?: string | null | undefined;
+ /** _non-standard_ */
+ _dns_end?: number | string | null | undefined;
+ /** _non-standard_ */
+ _dns_ms?: number | string | null | undefined;
+ /** _non-standard_ */
+ _dns_start?: number | string | null | undefined;
+ /** _non-standard_ */
+ _download_end?: number | string | null | undefined;
+ /** _non-standard_ */
+ _download_ms?: number | string | null | undefined;
+ /** _non-standard_ */
+ _download_start?: number | string | null | undefined;
+ /** _non-standard_ */
+ _expires?: string | null | undefined;
+ /** _non-standard_ */
+ _fromCache?: "memory" | "disk" | null | undefined;
+ /** _non-standard_ */
+ _full_url?: string | null | undefined;
+ /** _non-standard_ */
+ _gzip_save?: number | string | null | undefined;
+ /** _non-standard_ */
+ _gzip_total?: number | string | null | undefined;
+ /** _non-standard_ */
+ _host?: string | null | undefined;
+ /** _non-standard_ */
+ _http2_stream_dependency?: number | string | null | undefined;
+ /** _non-standard_ */
+ _http2_stream_exclusive?: number | string | null | undefined;
+ /** _non-standard_ */
+ _http2_stream_id?: number | string | null | undefined;
+ /** _non-standard_ */
+ _http2_stream_weight?: number | string | null | undefined;
+ /** _non-standard_ */
+ _image_save?: number | string | null | undefined;
+ /** _non-standard_ */
+ _image_total?: number | string | null | undefined;
+ /** _non-standard_ */
+ _index?: number | null | undefined;
+ /** _non-standard_ */
+ _initiator?: string | null | undefined;
+ /** _non-standard_ */
+ _initiator_column?: string | null | undefined;
+ /** _non-standard_ */
+ _initiator_detail?: string | null | undefined;
+ /** _non-standard_ */
+ _initiator_function?: string | null | undefined;
+ /** _non-standard_ */
+ _initiator_line?: string | null | undefined;
+ /** _non-standard_ */
+ _initiator_type?: string | null | undefined;
+ /** _non-standard_ */
+ _ip_addr?: string | null | undefined;
+ /** _non-standard_ */
+ _is_secure?: number | string | null | undefined;
+ /** _non-standard_ */
+ _jpeg_scan_count?: number | string | null | undefined;
+ /** _non-standard_ */
+ _load_end?: number | string | null | undefined;
+ /** _non-standard_ */
+ _load_ms?: number | string | null | undefined;
+ /** _non-standard_ */
+ _load_start?: number | string | null | undefined;
+ /** _non-standard_ */
+ _method?: string | null | undefined;
+ /** _non-standard_ */
+ _minify_save?: number | string | null | undefined;
+ /** _non-standard_ */
+ _minify_total?: number | string | null | undefined;
+ /** _non-standard_ */
+ _number?: number | null | undefined;
+ /** _non-standard_ */
+ _objectSize?: number | string | null | undefined;
+ /** _non-standard_ */
+ _objectSizeUncompressed?: number | string | null | undefined;
+ /** _non-standard_ */
+ _priority?: string | null | undefined;
+ /** _non-standard_ */
+ _protocol?: number | string | null | undefined;
+ /** _non-standard_ */
+ _request_id?: number | string | null | undefined;
+ /** _non-standard_ */
+ _resourceType?:
+ | "document"
+ | "stylesheet"
+ | "image"
+ | "media"
+ | "font"
+ | "script"
+ | "texttrack"
+ | "xhr"
+ | "fetch"
+ | "prefetch"
+ | "eventsource"
+ | "websocket"
+ | "webtransport"
+ | "wasm"
+ | "manifest"
+ | "signed-exchange"
+ | "ping"
+ | "csp-violation-report"
+ | "other"
+ | "preflight"
+ | "sm-script"
+ | "sm-stylesheet"
+ | "webbundle"
+ | null
+ | undefined;
+ /** _non-standard_ */
+ _responseCode?: number | string | null | undefined;
+ /** _non-standard_ */
+ _score_cache?: number | string | null | undefined;
+ /** _non-standard_ */
+ _score_cdn?: number | string | null | undefined;
+ /** _non-standard_ */
+ _score_combine?: number | string | null | undefined;
+ /** _non-standard_ */
+ _score_compress?: number | string | null | undefined;
+ /** _non-standard_ */
+ _score_cookies?: number | string | null | undefined;
+ /** _non-standard_ */
+ _score_etags?: number | string | null | undefined;
+ /** _non-standard_ */
+ _score_gzip?: number | string | null | undefined;
+ /** _non-standard_ */
+ "_score_keep-alive"?: number | string | null | undefined;
+ /** _non-standard_ */
+ _score_minify?: number | string | null | undefined;
+ /** _non-standard_ */
+ _score_progressive_jpeg?: number | null | undefined;
+ /** _non-standard_ */
+ _server_count?: number | string | null | undefined;
+ /** _non-standard_ */
+ _server_rtt?: number | string | null | undefined;
+ /** _non-standard_ */
+ _socket?: number | string | null | undefined;
+ /** _non-standard_ */
+ _ssl_end?: number | string | null | undefined;
+ /** _non-standard_ */
+ _ssl_ms?: number | string | null | undefined;
+ /** _non-standard_ */
+ _ssl_start?: number | string | null | undefined;
+ /** _non-standard_ */
+ _ttfb_end?: number | string | null | undefined;
+ /** _non-standard_ */
+ _ttfb_ms?: number | string | null | undefined;
+ /** _non-standard_ */
+ _ttfb_start?: number | string | null | undefined;
+ /** _non-standard_ */
+ _type?: number | string | null | undefined;
+ /** _non-standard_ */
+ _url?: string | null | undefined;
+ /** _non-standard_ */
+ _was_pushed?: number | string | null | undefined;
+ /** _non-standard_ */
+ _initialPriority?: string | null | undefined;
+ /** _non-standard_ */
+ _renderBlocking?: string | null | undefined;
+ /** _non-standard_ */
+ _isLCP?: boolean | null | undefined;
+ /** _non-standard_ */
+ _webSocketMessages?:
+ | Array<{
+ type: "send" | "receive";
+ time: number;
+ opcode: number;
+ data: string;
+ }>
+ | null
+ | undefined;
+ /**
+ * _non-standard_
+ *
+ * See "Custom Fields" under http://www.softwareishard.com/blog/har-12-spec
+ */
+ [customField: `_${string}`]: unknown | null | undefined;
+}
+/**
+ * This object contains detailed info about performed request.
+ *
+ * http://www.softwareishard.com/blog/har-12-spec/#request
+ */
+export interface Request {
+ /** Request method (`GET`, `POST`, ...). */
+ method: string;
+ /** Absolute URL of the request (fragments are not included). */
+ url: string;
+ /** Request HTTP Version. */
+ httpVersion: string;
+ /** List of cookie objects. */
+ cookies: Cookie[];
+ /** List of header objects. */
+ headers: Header[];
+ /** List of query parameter objects. */
+ queryString: QueryString[];
+ /** Posted data info. */
+ postData?: PostData | undefined;
+ /**
+ * Total number of bytes from the start of the HTTP request message until
+ * (and including) the double CRLF before the body.
+ *
+ * Set to `-1` if the info is not available.
+ */
+ headersSize: number;
+ /**
+ * Size of the request body (POST data payload) in bytes.
+ *
+ * Set to `-1` if the info is not available.
+ */
+ bodySize: number;
+ /** A comment provided by the user or the application */
+ comment?: string | undefined;
+}
+/**
+ * This object contains detailed info about the response.
+ *
+ * http://www.softwareishard.com/blog/har-12-spec/#response
+ */
+export interface Response {
+ /** Response status. */
+ status: number;
+ /** Response status description. */
+ statusText: string;
+ /** Response HTTP Version. */
+ httpVersion: string;
+ /** List of cookie objects. */
+ cookies: Cookie[];
+ /** List of header objects. */
+ headers: Header[];
+ /** Details about the response body. */
+ content: Content;
+ /** Redirection target URL from the Location response header. */
+ redirectURL: string;
+ /**
+ * Total number of bytes from the start of the HTTP response message until
+ * (and including) the double CRLF before the body.
+ *
+ * Set to `-1` if the info is not available.
+ *
+ * _The size of received response-headers is computed only from headers
+ * that are really received from the server. Additional headers appended by
+ * the browser are not included in this number, but they appear in the list
+ * of header objects._
+ */
+ headersSize: number;
+ /**
+ * Size of the received response body in bytes.
+ *
+ * - Set to zero in case of responses coming from the cache (`304`).
+ * - Set to `-1` if the info is not available.
+ */
+ bodySize: number;
+ /** A comment provided by the user or the application */
+ comment?: string | undefined;
+ /** _non-standard_ */
+ _transferSize?: number | null | undefined;
+}
+/**
+ * This object contains list of all cookies (used in `request` and `response`
+ * objects).
+ *
+ * http://www.softwareishard.com/blog/har-12-spec/#cookies
+ */
+export interface Cookie {
+ /** The name of the cookie. */
+ name: string;
+ /** The cookie value. */
+ value: string;
+ /** The path pertaining to the cookie. */
+ path?: string | undefined;
+ /** The host of the cookie. */
+ domain?: string | undefined;
+ /**
+ * Cookie expiration time.
+ * (ISO 8601 - `YYYY-MM-DDThh:mm:ss.sTZD`,
+ * e.g. `2009-07-24T19:20:30.123+02:00`).
+ */
+ expires?: string | undefined;
+ /** Set to true if the cookie is HTTP only, false otherwise. */
+ httpOnly?: boolean | undefined;
+ /** True if the cookie was transmitted over ssl, false otherwise. */
+ secure?: boolean | undefined;
+ /** A comment provided by the user or the application */
+ comment?: string | undefined;
+}
+
+/**
+ * This object represents a headers (used in `request` and `response` objects).
+ *
+ * http://www.softwareishard.com/blog/har-12-spec/#headers
+ */
+export interface Header {
+ name: string;
+ value: string;
+ /** A comment provided by the user or the application */
+ comment?: string | undefined;
+}
+/**
+ * This object represents a parameter & value parsed from a query string,
+ * if any (embedded in `request` object).
+ *
+ * http://www.softwareishard.com/blog/har-12-spec/#queryString
+ */
+export interface QueryString {
+ name: string;
+ value: string;
+ /** A comment provided by the user or the application */
+ comment?: string | undefined;
+}
+/**
+ * This object describes posted data, if any (embedded in `request` object).
+ *
+ * http://www.softwareishard.com/blog/har-12-spec/#postData
+ */
+export type PostData = PostDataCommon & (PostDataParams | PostDataText);
+
+/**
+ * The common properties of PostData
+ */
+export interface PostDataCommon {
+ /** Mime type of posted data. */
+ mimeType: string;
+ /** A comment provided by the user or the application */
+ comment?: string | undefined;
+}
+
+/**
+ * Post data with `params` specified.
+ */
+export interface PostDataParams {
+ /**
+ * List of posted parameters (in case of URL encoded parameters).
+ */
+ params: Param[];
+
+ /**
+ * _`params` and `text` fields are mutually exclusive._
+ */
+ text?: never | undefined;
+}
+
+/**
+ * Post data with `text` specified.
+ */
+export interface PostDataText {
+ /**
+ * Plain text posted data
+ */
+ text: string;
+
+ /**
+ * _`params` and `text` fields are mutually exclusive._
+ */
+ params?: never | undefined;
+}
+
+/**
+ * List of posted parameters, if any (embedded in `postData` object).
+ *
+ * http://www.softwareishard.com/blog/har-12-spec/#params
+ */
+export interface Param {
+ /** name of a posted parameter. */
+ name: string;
+ /** value of a posted parameter or content of a posted file */
+ value?: string | undefined;
+ /** name of a posted file. */
+ fileName?: string | undefined;
+ /** content type of a posted file. */
+ contentType?: string | undefined;
+ /** A comment provided by the user or the application */
+ comment?: string | undefined;
+}
+
+/**
+ * This object describes details about response content
+ * (embedded in `response` object).
+ *
+ * http://www.softwareishard.com/blog/har-12-spec/#content
+ */
+export interface Content {
+ /**
+ * Length of the returned content in bytes.
+ *
+ * Should be equal to `response.bodySize` if there is no compression and
+ * bigger when the content has been compressed.
+ */
+ size: number;
+ /**
+ * Number of bytes saved. Leave out this field if the information is not
+ * available.
+ */
+ compression?: number | undefined;
+ /**
+ * MIME type of the response text (value of the Content-Type response
+ * header).
+ *
+ * The charset attribute of the MIME type is included (if available).
+ */
+ mimeType: string;
+ /**
+ * Response body sent from the server or loaded from the browser cache.
+ *
+ * This field is populated with textual content only.
+ *
+ * The text field is either HTTP decoded text or a encoded (e.g. `base64`)
+ * representation of the response body.
+ *
+ * Leave out this field if the information is not available.
+ */
+ text?: string | undefined;
+ /**
+ * Encoding used for response text field e.g `base64`.
+ *
+ * Leave out this field if the text field is HTTP decoded
+ * (decompressed & unchunked), than trans-coded from its original character
+ * set into UTF-8.
+ */
+ encoding?: string | undefined;
+ /** A comment provided by the user or the application */
+ comment?: string | undefined;
+}
+/**
+ * This objects contains info about a request coming from browser cache.
+ *
+ * http://www.softwareishard.com/blog/har-12-spec/#cache
+ */
+export interface Cache {
+ /**
+ * State of a cache entry before the request.
+ *
+ * Leave out this field if the information is not available.
+ */
+ beforeRequest?: CacheDetails | null | undefined;
+ /**
+ * State of a cache entry after the request.
+ *
+ * Leave out this field if the information is not available.
+ */
+ afterRequest?: CacheDetails | null | undefined;
+ /** A comment provided by the user or the application */
+ comment?: string | undefined;
+}
+export interface CacheDetails {
+ /**
+ * Expiration time of the cache entry.
+ *
+ * _(Format not documente but assumingly ISO 8601 -
+ * `YYYY-MM-DDThh:mm:ss.sTZD`)_
+ */
+ expires?: string | undefined;
+ /**
+ * The last time the cache entry was opened.
+ *
+ * _(Format not documente but assumingly ISO 8601 -
+ * `YYYY-MM-DDThh:mm:ss.sTZD`)_
+ */
+ lastAccess: string;
+ /** Etag */
+ eTag: string;
+ /** The number of times the cache entry has been opened. */
+ hitCount: number;
+ /** A comment provided by the user or the application */
+ comment?: string | undefined;
+}
+/**
+ * This object describes various phases within request-response round trip.
+ *
+ * All times are specified in milliseconds.
+ *
+ * http://www.softwareishard.com/blog/har-12-spec/#timings
+ */
+export interface Timings {
+ /**
+ * Time spent in a queue waiting for a network connection.
+ *
+ * Use `-1` if the timing does not apply to the current request.
+ */
+ blocked?: number | undefined;
+ /**
+ * DNS resolution time. The time required to resolve a host name.
+ *
+ * Use `-1` if the timing does not apply to the current request.
+ */
+ dns?: number | undefined;
+ /**
+ * Time required to create TCP connection.
+ *
+ * Use `-1` if the timing does not apply to the current request.
+ */
+ connect?: number | undefined;
+ /**
+ * Time required to send HTTP request to the server.
+ *
+ * _Not optional and must have non-negative values._
+ */
+ send?: number | undefined;
+ /**
+ * Waiting for a response from the server.
+ *
+ * _Not optional and must have non-negative values._
+ */
+ wait: number;
+ /**
+ * Time required to read entire response from the server (or cache).
+ *
+ * _Not optional and must have non-negative values._
+ */
+ receive: number;
+ /**
+ * Time required for SSL/TLS negotiation.
+ *
+ * If this field is defined then the time is also included in the connect
+ * field (to ensure backward compatibility with HAR 1.1).
+ *
+ * Use `-1` if the timing does not apply to the current request.
+ */
+ ssl?: number | undefined;
+ /** A comment provided by the user or the application */
+ comment?: string | undefined;
+}
diff --git a/client/node_modules/@types/har-format/package.json b/client/node_modules/@types/har-format/package.json
new file mode 100644
index 0000000..2d4b3a9
--- /dev/null
+++ b/client/node_modules/@types/har-format/package.json
@@ -0,0 +1,31 @@
+{
+ "name": "@types/har-format",
+ "version": "1.2.15",
+ "description": "TypeScript definitions for har-format",
+ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/har-format",
+ "license": "MIT",
+ "contributors": [
+ {
+ "name": "Michael Mrowetz",
+ "githubUsername": "micmro",
+ "url": "https://github.com/micmro"
+ },
+ {
+ "name": "Marcell Toth",
+ "githubUsername": "marcelltoth",
+ "url": "https://github.com/marcelltoth"
+ }
+ ],
+ "main": "",
+ "types": "index.d.ts",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
+ "directory": "types/har-format"
+ },
+ "scripts": {},
+ "dependencies": {},
+ "typesPublisherContentHash": "e63d7ea213011e64bcb2c4f9a90f51143dd5417a770523a75ff76680a13467ec",
+ "typeScriptVersion": "4.5",
+ "nonNpm": true
+} \ No newline at end of file
diff --git a/client/node_modules/@types/http-cache-semantics/LICENSE b/client/node_modules/@types/http-cache-semantics/LICENSE
new file mode 100644
index 0000000..9e841e7
--- /dev/null
+++ b/client/node_modules/@types/http-cache-semantics/LICENSE
@@ -0,0 +1,21 @@
+ MIT License
+
+ Copyright (c) Microsoft Corporation.
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE
diff --git a/client/node_modules/@types/http-cache-semantics/README.md b/client/node_modules/@types/http-cache-semantics/README.md
new file mode 100644
index 0000000..c50100b
--- /dev/null
+++ b/client/node_modules/@types/http-cache-semantics/README.md
@@ -0,0 +1,15 @@
+# Installation
+> `npm install --save @types/http-cache-semantics`
+
+# Summary
+This package contains type definitions for http-cache-semantics (https://github.com/kornelski/http-cache-semantics#readme).
+
+# Details
+Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/http-cache-semantics.
+
+### Additional Details
+ * Last updated: Tue, 07 Nov 2023 03:09:37 GMT
+ * Dependencies: none
+
+# Credits
+These definitions were written by [BendingBender](https://github.com/BendingBender).
diff --git a/client/node_modules/@types/http-cache-semantics/index.d.ts b/client/node_modules/@types/http-cache-semantics/index.d.ts
new file mode 100644
index 0000000..b615076
--- /dev/null
+++ b/client/node_modules/@types/http-cache-semantics/index.d.ts
@@ -0,0 +1,165 @@
+export = CachePolicy;
+
+declare class CachePolicy {
+ constructor(req: CachePolicy.Request, res: CachePolicy.Response, options?: CachePolicy.Options);
+
+ /**
+ * Returns `true` if the response can be stored in a cache.
+ * If it's `false` then you MUST NOT store either the request or the response.
+ */
+ storable(): boolean;
+
+ /**
+ * This is the most important method. Use this method to check whether the cached response is still fresh
+ * in the context of the new request.
+ *
+ * If it returns `true`, then the given `request` matches the original response this cache policy has been
+ * created with, and the response can be reused without contacting the server. Note that the old response
+ * can't be returned without being updated, see `responseHeaders()`.
+ *
+ * If it returns `false`, then the response may not be matching at all (e.g. it's for a different URL or method),
+ * or may require to be refreshed first (see `revalidationHeaders()`).
+ */
+ satisfiesWithoutRevalidation(newRequest: CachePolicy.Request): boolean;
+
+ /**
+ * Returns updated, filtered set of response headers to return to clients receiving the cached response.
+ * This function is necessary, because proxies MUST always remove hop-by-hop headers (such as `TE` and `Connection`)
+ * and update response's `Age` to avoid doubling cache time.
+ *
+ * @example
+ * cachedResponse.headers = cachePolicy.responseHeaders(cachedResponse);
+ */
+ responseHeaders(): CachePolicy.Headers;
+
+ /**
+ * Returns approximate time in milliseconds until the response becomes stale (i.e. not fresh).
+ *
+ * After that time (when `timeToLive() <= 0`) the response might not be usable without revalidation. However,
+ * there are exceptions, e.g. a client can explicitly allow stale responses, so always check with
+ * `satisfiesWithoutRevalidation()`.
+ */
+ timeToLive(): number;
+
+ /**
+ * Chances are you'll want to store the `CachePolicy` object along with the cached response.
+ * `obj = policy.toObject()` gives a plain JSON-serializable object.
+ */
+ toObject(): CachePolicy.CachePolicyObject;
+
+ /**
+ * `policy = CachePolicy.fromObject(obj)` creates an instance from object created by `toObject()`.
+ */
+ static fromObject(obj: CachePolicy.CachePolicyObject): CachePolicy;
+
+ /**
+ * Returns updated, filtered set of request headers to send to the origin server to check if the cached
+ * response can be reused. These headers allow the origin server to return status 304 indicating the
+ * response is still fresh. All headers unrelated to caching are passed through as-is.
+ *
+ * Use this method when updating cache from the origin server.
+ *
+ * @example
+ * updateRequest.headers = cachePolicy.revalidationHeaders(updateRequest);
+ */
+ revalidationHeaders(newRequest: CachePolicy.Request): CachePolicy.Headers;
+
+ /**
+ * Use this method to update the cache after receiving a new response from the origin server.
+ */
+ revalidatedPolicy(
+ revalidationRequest: CachePolicy.Request,
+ revalidationResponse: CachePolicy.Response,
+ ): CachePolicy.RevalidationPolicy;
+}
+
+declare namespace CachePolicy {
+ interface Request {
+ url?: string | undefined;
+ method?: string | undefined;
+ headers: Headers;
+ }
+
+ interface Response {
+ status?: number | undefined;
+ headers: Headers;
+ }
+
+ interface Options {
+ /**
+ * If `true`, then the response is evaluated from a perspective of a shared cache (i.e. `private` is not
+ * cacheable and `s-maxage` is respected). If `false`, then the response is evaluated from a perspective
+ * of a single-user cache (i.e. `private` is cacheable and `s-maxage` is ignored).
+ * `true` is recommended for HTTP clients.
+ * @default true
+ */
+ shared?: boolean | undefined;
+ /**
+ * A fraction of response's age that is used as a fallback cache duration. The default is 0.1 (10%),
+ * e.g. if a file hasn't been modified for 100 days, it'll be cached for 100*0.1 = 10 days.
+ * @default 0.1
+ */
+ cacheHeuristic?: number | undefined;
+ /**
+ * A number of milliseconds to assume as the default time to cache responses with `Cache-Control: immutable`.
+ * Note that [per RFC](https://httpwg.org/specs/rfc8246.html#the-immutable-cache-control-extension)
+ * these can become stale, so `max-age` still overrides the default.
+ * @default 24*3600*1000 (24h)
+ */
+ immutableMinTimeToLive?: number | undefined;
+ /**
+ * If `true`, common anti-cache directives will be completely ignored if the non-standard `pre-check`
+ * and `post-check` directives are present. These two useless directives are most commonly found
+ * in bad StackOverflow answers and PHP's "session limiter" defaults.
+ * @default false
+ */
+ ignoreCargoCult?: boolean | undefined;
+ /**
+ * If `false`, then server's `Date` header won't be used as the base for `max-age`. This is against the RFC,
+ * but it's useful if you want to cache responses with very short `max-age`, but your local clock
+ * is not exactly in sync with the server's.
+ * @default true
+ */
+ trustServerDate?: boolean | undefined;
+ }
+
+ interface CachePolicyObject {
+ v: number;
+ t: number;
+ sh: boolean;
+ ch: number;
+ imm: number;
+ st: number;
+ resh: Headers;
+ rescc: { [key: string]: string };
+ m: string;
+ u?: string | undefined;
+ h?: string | undefined;
+ a: boolean;
+ reqh: Headers | null;
+ reqcc: { [key: string]: string };
+ }
+
+ interface Headers {
+ [header: string]: string | string[] | undefined;
+ }
+
+ interface RevalidationPolicy {
+ /**
+ * A new `CachePolicy` with HTTP headers updated from `revalidationResponse`. You can always replace
+ * the old cached `CachePolicy` with the new one.
+ */
+ policy: CachePolicy;
+ /**
+ * Boolean indicating whether the response body has changed.
+ *
+ * - If `false`, then a valid 304 Not Modified response has been received, and you can reuse the old
+ * cached response body.
+ * - If `true`, you should use new response's body (if present), or make another request to the origin
+ * server without any conditional headers (i.e. don't use `revalidationHeaders()` this time) to get
+ * the new resource.
+ */
+ modified: boolean;
+ matches: boolean;
+ }
+}
diff --git a/client/node_modules/@types/http-cache-semantics/package.json b/client/node_modules/@types/http-cache-semantics/package.json
new file mode 100644
index 0000000..2753df5
--- /dev/null
+++ b/client/node_modules/@types/http-cache-semantics/package.json
@@ -0,0 +1,25 @@
+{
+ "name": "@types/http-cache-semantics",
+ "version": "4.0.4",
+ "description": "TypeScript definitions for http-cache-semantics",
+ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/http-cache-semantics",
+ "license": "MIT",
+ "contributors": [
+ {
+ "name": "BendingBender",
+ "githubUsername": "BendingBender",
+ "url": "https://github.com/BendingBender"
+ }
+ ],
+ "main": "",
+ "types": "index.d.ts",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
+ "directory": "types/http-cache-semantics"
+ },
+ "scripts": {},
+ "dependencies": {},
+ "typesPublisherContentHash": "6cf8e230d4a5ae72d31765a8facf404307c59791befc65343d177843c7bbae91",
+ "typeScriptVersion": "4.5"
+} \ No newline at end of file
diff --git a/client/node_modules/@types/keyv/LICENSE b/client/node_modules/@types/keyv/LICENSE
new file mode 100755
index 0000000..9e841e7
--- /dev/null
+++ b/client/node_modules/@types/keyv/LICENSE
@@ -0,0 +1,21 @@
+ MIT License
+
+ Copyright (c) Microsoft Corporation.
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE
diff --git a/client/node_modules/@types/keyv/README.md b/client/node_modules/@types/keyv/README.md
new file mode 100755
index 0000000..8167fcc
--- /dev/null
+++ b/client/node_modules/@types/keyv/README.md
@@ -0,0 +1,16 @@
+# Installation
+> `npm install --save @types/keyv`
+
+# Summary
+This package contains type definitions for keyv (https://github.com/lukechilds/keyv).
+
+# Details
+Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/keyv.
+
+### Additional Details
+ * Last updated: Thu, 17 Mar 2022 05:31:42 GMT
+ * Dependencies: [@types/node](https://npmjs.com/package/@types/node)
+ * Global values: none
+
+# Credits
+These definitions were written by [AryloYeung](https://github.com/Arylo), and [BendingBender](https://github.com/BendingBender).
diff --git a/client/node_modules/@types/keyv/index.d.ts b/client/node_modules/@types/keyv/index.d.ts
new file mode 100755
index 0000000..adca74d
--- /dev/null
+++ b/client/node_modules/@types/keyv/index.d.ts
@@ -0,0 +1,90 @@
+// Type definitions for keyv 3.1
+// Project: https://github.com/lukechilds/keyv
+// Definitions by: AryloYeung <https://github.com/Arylo>
+// BendingBender <https://github.com/BendingBender>
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+// TypeScript Version: 2.8
+
+/// <reference types="node" />
+import { EventEmitter } from 'events';
+
+type WithRequiredProperties<T, K extends keyof T> = T & Required<Pick<T, K>>;
+
+declare class Keyv<TValue = any, TOpts extends { [key: string]: any } = {}> extends EventEmitter {
+ /**
+ * `this.opts` is an object containing at least the properties listed
+ * below. However, `Keyv.Options` allows arbitrary properties as well.
+ * These properties can be specified as the second type parameter to `Keyv`.
+ */
+ opts: WithRequiredProperties<
+ Keyv.Options<TValue>,
+ 'deserialize' | 'namespace' | 'serialize' | 'store' | 'uri'
+ > &
+ TOpts;
+
+ /**
+ * @param opts The options object is also passed through to the storage adapter. Check your storage adapter docs for any extra options.
+ */
+ constructor(opts?: Keyv.Options<TValue> & TOpts);
+ /**
+ * @param uri The connection string URI.
+ *
+ * Merged into the options object as options.uri.
+ * @param opts The options object is also passed through to the storage adapter. Check your storage adapter docs for any extra options.
+ */
+ constructor(uri?: string, opts?: Keyv.Options<TValue> & TOpts);
+
+ /** Returns the value. */
+ get<TRaw extends boolean = false>(key: string, options?: { raw?: TRaw }):
+ Promise<(TRaw extends false
+ ? TValue
+ : Keyv.DeserializedData<TValue>) | undefined>;
+ /**
+ * Set a value.
+ *
+ * By default keys are persistent. You can set an expiry TTL in milliseconds.
+ */
+ set(key: string, value: TValue, ttl?: number): Promise<true>;
+ /**
+ * Deletes an entry.
+ *
+ * Returns `true` if the key existed, `false` if not.
+ */
+ delete(key: string): Promise<boolean>;
+ /** Delete all entries in the current namespace. */
+ clear(): Promise<void>;
+}
+
+declare namespace Keyv {
+ interface Options<TValue> {
+ /** Namespace for the current instance. */
+ namespace?: string | undefined;
+ /** A custom serialization function. */
+ serialize?: ((data: DeserializedData<TValue>) => string) | undefined;
+ /** A custom deserialization function. */
+ deserialize?: ((data: string) => DeserializedData<TValue> | undefined) | undefined;
+ /** The connection string URI. */
+ uri?: string | undefined;
+ /** The storage adapter instance to be used by Keyv. */
+ store?: Store<TValue> | undefined;
+ /** Default TTL. Can be overridden by specififying a TTL on `.set()`. */
+ ttl?: number | undefined;
+ /** Specify an adapter to use. e.g `'redis'` or `'mongodb'`. */
+ adapter?: 'redis' | 'mongodb' | 'mongo' | 'sqlite' | 'postgresql' | 'postgres' | 'mysql' | undefined;
+
+ [key: string]: any;
+ }
+
+ interface DeserializedData<TValue> {
+ value: TValue; expires: number | null;
+ }
+
+ interface Store<TValue> {
+ get(key: string): TValue | Promise<TValue | undefined> | undefined;
+ set(key: string, value: TValue, ttl?: number): any;
+ delete(key: string): boolean | Promise<boolean>;
+ clear(): void | Promise<void>;
+ }
+}
+
+export = Keyv;
diff --git a/client/node_modules/@types/keyv/package.json b/client/node_modules/@types/keyv/package.json
new file mode 100755
index 0000000..15d4020
--- /dev/null
+++ b/client/node_modules/@types/keyv/package.json
@@ -0,0 +1,32 @@
+{
+ "name": "@types/keyv",
+ "version": "3.1.4",
+ "description": "TypeScript definitions for keyv",
+ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/keyv",
+ "license": "MIT",
+ "contributors": [
+ {
+ "name": "AryloYeung",
+ "url": "https://github.com/Arylo",
+ "githubUsername": "Arylo"
+ },
+ {
+ "name": "BendingBender",
+ "url": "https://github.com/BendingBender",
+ "githubUsername": "BendingBender"
+ }
+ ],
+ "main": "",
+ "types": "index.d.ts",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
+ "directory": "types/keyv"
+ },
+ "scripts": {},
+ "dependencies": {
+ "@types/node": "*"
+ },
+ "typesPublisherContentHash": "e83393e0860475d12e960cede22532e18e129cf659f31f2a0298a88cb5d02d36",
+ "typeScriptVersion": "3.9"
+} \ No newline at end of file
diff --git a/client/node_modules/@types/node/LICENSE b/client/node_modules/@types/node/LICENSE
new file mode 100644
index 0000000..9e841e7
--- /dev/null
+++ b/client/node_modules/@types/node/LICENSE
@@ -0,0 +1,21 @@
+ MIT License
+
+ Copyright (c) Microsoft Corporation.
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE
diff --git a/client/node_modules/@types/node/README.md b/client/node_modules/@types/node/README.md
new file mode 100644
index 0000000..32e0954
--- /dev/null
+++ b/client/node_modules/@types/node/README.md
@@ -0,0 +1,15 @@
+# Installation
+> `npm install --save @types/node`
+
+# Summary
+This package contains type definitions for node (https://nodejs.org/).
+
+# Details
+Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node/v18.
+
+### Additional Details
+ * Last updated: Wed, 22 Nov 2023 00:24:48 GMT
+ * Dependencies: [undici-types](https://npmjs.com/package/undici-types)
+
+# 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), [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), [wafuwafu13](https://github.com/wafuwafu13), [Matteo Collina](https://github.com/mcollina), and [Dmitry Semigradsky](https://github.com/Semigradsky).
diff --git a/client/node_modules/@types/node/assert.d.ts b/client/node_modules/@types/node/assert.d.ts
new file mode 100644
index 0000000..e4a8a78
--- /dev/null
+++ b/client/node_modules/@types/node/assert.d.ts
@@ -0,0 +1,985 @@
+/**
+ * The `assert` module provides a set of assertion functions for verifying
+ * invariants.
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/assert.js)
+ */
+declare module "assert" {
+ /**
+ * An alias of {@link ok}.
+ * @since v0.5.9
+ * @param value The input that is checked for being truthy.
+ */
+ function assert(value: unknown, message?: string | Error): asserts value;
+ namespace assert {
+ /**
+ * Indicates the failure of an assertion. All errors thrown by the `assert` module
+ * will be instances of the `AssertionError` class.
+ */
+ class AssertionError extends Error {
+ actual: unknown;
+ expected: unknown;
+ operator: string;
+ generatedMessage: boolean;
+ code: "ERR_ASSERTION";
+ constructor(options?: {
+ /** If provided, the error message is set to this value. */
+ message?: string | undefined;
+ /** The `actual` property on the error instance. */
+ actual?: unknown | undefined;
+ /** The `expected` property on the error instance. */
+ expected?: unknown | undefined;
+ /** The `operator` property on the error instance. */
+ operator?: string | undefined;
+ /** If provided, the generated stack trace omits frames before this function. */
+ // eslint-disable-next-line @typescript-eslint/ban-types
+ stackStartFn?: Function | undefined;
+ });
+ }
+ /**
+ * This feature is currently experimental and behavior might still change.
+ * @since v14.2.0, v12.19.0
+ * @experimental
+ */
+ class CallTracker {
+ /**
+ * The wrapper function is expected to be called exactly `exact` times. If the
+ * function has not been called exactly `exact` times when `tracker.verify()` is called, then `tracker.verify()` will throw an
+ * error.
+ *
+ * ```js
+ * import assert from 'assert';
+ *
+ * // Creates call tracker.
+ * const tracker = new assert.CallTracker();
+ *
+ * function func() {}
+ *
+ * // Returns a function that wraps func() that must be called exact times
+ * // before tracker.verify().
+ * const callsfunc = tracker.calls(func);
+ * ```
+ * @since v14.2.0, v12.19.0
+ * @param [fn='A no-op function']
+ * @param [exact=1]
+ * @return that wraps `fn`.
+ */
+ calls(exact?: number): () => void;
+ 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: this, arguments: [1, 2, 3 ] }]);
+ * ```
+ *
+ * @since v18.8.0, v16.18.0
+ * @param fn
+ * @returns An Array with the calls to a tracked function.
+ */
+ getCalls(fn: Function): CallTrackerCall[];
+ /**
+ * 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.
+ *
+ * ```js
+ * import assert from 'assert';
+ *
+ * // Creates call tracker.
+ * const tracker = new assert.CallTracker();
+ *
+ * function func() {}
+ *
+ * function foo() {}
+ *
+ * // Returns a function that wraps func() that must be called exact times
+ * // before tracker.verify().
+ * const callsfunc = tracker.calls(func, 2);
+ *
+ * // Returns an array containing information on callsfunc()
+ * tracker.report();
+ * // [
+ * // {
+ * // message: 'Expected the func function to be executed 2 time(s) but was
+ * // executed 0 time(s).',
+ * // actual: 0,
+ * // expected: 2,
+ * // operator: 'func',
+ * // stack: stack trace
+ * // }
+ * // ]
+ * ```
+ * @since v14.2.0, v12.19.0
+ * @return of objects containing information about the wrapper functions returned by `calls`.
+ */
+ 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
+ * tracker.getCalls(callsfunc).length === 1;
+ *
+ * tracker.reset(callsfunc);
+ * 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
+ * have not been called the expected number of times.
+ *
+ * ```js
+ * import assert from 'assert';
+ *
+ * // Creates call tracker.
+ * const tracker = new assert.CallTracker();
+ *
+ * function func() {}
+ *
+ * // Returns a function that wraps func() that must be called exact times
+ * // before tracker.verify().
+ * const callsfunc = tracker.calls(func, 2);
+ *
+ * callsfunc();
+ *
+ * // Will throw an error since callsfunc() was only called once.
+ * tracker.verify();
+ * ```
+ * @since v14.2.0, v12.19.0
+ */
+ verify(): void;
+ }
+ interface CallTrackerCall {
+ thisArg: object;
+ arguments: unknown[];
+ }
+ interface CallTrackerReportInformation {
+ message: string;
+ /** The actual number of times the function was called. */
+ actual: number;
+ /** The number of times the function was expected to be called. */
+ expected: number;
+ /** The name of the function that is wrapped. */
+ operator: string;
+ /** A stack trace of the function. */
+ stack: object;
+ }
+ type AssertPredicate = RegExp | (new() => object) | ((thrown: unknown) => boolean) | object | Error;
+ /**
+ * Throws an `AssertionError` with the provided error message or a default
+ * error message. If the `message` parameter is an instance of an `Error` then
+ * it will be thrown instead of the `AssertionError`.
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * assert.fail();
+ * // AssertionError [ERR_ASSERTION]: Failed
+ *
+ * assert.fail('boom');
+ * // AssertionError [ERR_ASSERTION]: boom
+ *
+ * assert.fail(new TypeError('need array'));
+ * // TypeError: need array
+ * ```
+ *
+ * Using `assert.fail()` with more than two arguments is possible but deprecated.
+ * See below for further details.
+ * @since v0.1.21
+ * @param [message='Failed']
+ */
+ function fail(message?: string | Error): never;
+ /** @deprecated since v10.0.0 - use fail([message]) or other assert functions instead. */
+ function fail(
+ actual: unknown,
+ expected: unknown,
+ message?: string | Error,
+ operator?: string,
+ // eslint-disable-next-line @typescript-eslint/ban-types
+ stackStartFn?: Function,
+ ): never;
+ /**
+ * Tests if `value` is truthy. It is equivalent to`assert.equal(!!value, true, message)`.
+ *
+ * If `value` is not truthy, an `AssertionError` is thrown with a `message`property set equal to the value of the `message` parameter. If the `message`parameter is `undefined`, a default
+ * error message is assigned. If the `message`parameter is an instance of an `Error` then it will be thrown instead of the`AssertionError`.
+ * If no arguments are passed in at all `message` will be set to the string:`` 'No value argument passed to `assert.ok()`' ``.
+ *
+ * Be aware that in the `repl` the error message will be different to the one
+ * thrown in a file! See below for further details.
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * assert.ok(true);
+ * // OK
+ * assert.ok(1);
+ * // OK
+ *
+ * assert.ok();
+ * // AssertionError: No value argument passed to `assert.ok()`
+ *
+ * assert.ok(false, 'it\'s false');
+ * // AssertionError: it's false
+ *
+ * // In the repl:
+ * assert.ok(typeof 123 === 'string');
+ * // AssertionError: false == true
+ *
+ * // In a file (e.g. test.js):
+ * assert.ok(typeof 123 === 'string');
+ * // AssertionError: The expression evaluated to a falsy value:
+ * //
+ * // assert.ok(typeof 123 === 'string')
+ *
+ * assert.ok(false);
+ * // AssertionError: The expression evaluated to a falsy value:
+ * //
+ * // assert.ok(false)
+ *
+ * assert.ok(0);
+ * // AssertionError: The expression evaluated to a falsy value:
+ * //
+ * // assert.ok(0)
+ * ```
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * // Using `assert()` works the same:
+ * assert(0);
+ * // AssertionError: The expression evaluated to a falsy value:
+ * //
+ * // assert(0)
+ * ```
+ * @since v0.1.21
+ */
+ function ok(value: unknown, message?: string | Error): asserts value;
+ /**
+ * **Strict assertion mode**
+ *
+ * An alias of {@link strictEqual}.
+ *
+ * **Legacy assertion mode**
+ *
+ * > Stability: 3 - Legacy: Use {@link strictEqual} instead.
+ *
+ * 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
+ * and treated as being identical if both sides are `NaN`.
+ *
+ * ```js
+ * import assert from 'assert';
+ *
+ * assert.equal(1, 1);
+ * // OK, 1 == 1
+ * assert.equal(1, '1');
+ * // OK, 1 == '1'
+ * assert.equal(NaN, NaN);
+ * // OK
+ *
+ * assert.equal(1, 2);
+ * // AssertionError: 1 == 2
+ * assert.equal({ a: { b: 1 } }, { a: { b: 1 } });
+ * // AssertionError: { a: { b: 1 } } == { a: { b: 1 } }
+ * ```
+ *
+ * If the values are not equal, an `AssertionError` is thrown with a `message`property set equal to the value of the `message` parameter. If the `message`parameter is undefined, a default
+ * error message is assigned. If the `message`parameter is an instance of an `Error` then it will be thrown instead of the`AssertionError`.
+ * @since v0.1.21
+ */
+ function equal(actual: unknown, expected: unknown, message?: string | Error): void;
+ /**
+ * **Strict assertion mode**
+ *
+ * An alias of {@link notStrictEqual}.
+ *
+ * **Legacy assertion mode**
+ *
+ * > 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
+ * specially handled and treated as being identical if both sides are `NaN`.
+ *
+ * ```js
+ * import assert from 'assert';
+ *
+ * assert.notEqual(1, 2);
+ * // OK
+ *
+ * assert.notEqual(1, 1);
+ * // AssertionError: 1 != 1
+ *
+ * assert.notEqual(1, '1');
+ * // AssertionError: 1 != '1'
+ * ```
+ *
+ * If the values are equal, an `AssertionError` is thrown with a `message`property set equal to the value of the `message` parameter. If the `message`parameter is undefined, a default error
+ * message is assigned. If the `message`parameter is an instance of an `Error` then it will be thrown instead of the`AssertionError`.
+ * @since v0.1.21
+ */
+ function notEqual(actual: unknown, expected: unknown, message?: string | Error): void;
+ /**
+ * **Strict assertion mode**
+ *
+ * An alias of {@link deepStrictEqual}.
+ *
+ * **Legacy assertion mode**
+ *
+ * > Stability: 3 - Legacy: Use {@link deepStrictEqual} instead.
+ *
+ * Tests for deep equality between the `actual` and `expected` parameters. Consider
+ * using {@link deepStrictEqual} instead. {@link deepEqual} can have
+ * surprising results.
+ *
+ * _Deep equality_ means that the enumerable "own" properties of child objects
+ * are also recursively evaluated by the following rules.
+ * @since v0.1.21
+ */
+ function deepEqual(actual: unknown, expected: unknown, message?: string | Error): void;
+ /**
+ * **Strict assertion mode**
+ *
+ * An alias of {@link notDeepStrictEqual}.
+ *
+ * **Legacy assertion mode**
+ *
+ * > Stability: 3 - Legacy: Use {@link notDeepStrictEqual} instead.
+ *
+ * Tests for any deep inequality. Opposite of {@link deepEqual}.
+ *
+ * ```js
+ * import assert from 'assert';
+ *
+ * const obj1 = {
+ * a: {
+ * b: 1
+ * }
+ * };
+ * const obj2 = {
+ * a: {
+ * b: 2
+ * }
+ * };
+ * const obj3 = {
+ * a: {
+ * b: 1
+ * }
+ * };
+ * const obj4 = Object.create(obj1);
+ *
+ * assert.notDeepEqual(obj1, obj1);
+ * // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } }
+ *
+ * assert.notDeepEqual(obj1, obj2);
+ * // OK
+ *
+ * assert.notDeepEqual(obj1, obj3);
+ * // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } }
+ *
+ * assert.notDeepEqual(obj1, obj4);
+ * // OK
+ * ```
+ *
+ * If the values are deeply equal, an `AssertionError` is thrown with a`message` property set equal to the value of the `message` parameter. If the`message` parameter is undefined, a default
+ * error message is assigned. If the`message` parameter is an instance of an `Error` then it will be thrown
+ * instead of the `AssertionError`.
+ * @since v0.1.21
+ */
+ function notDeepEqual(actual: unknown, expected: unknown, message?: string | Error): void;
+ /**
+ * 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).
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * assert.strictEqual(1, 2);
+ * // AssertionError [ERR_ASSERTION]: Expected inputs to be strictly equal:
+ * //
+ * // 1 !== 2
+ *
+ * assert.strictEqual(1, 1);
+ * // OK
+ *
+ * assert.strictEqual('Hello foobar', 'Hello World!');
+ * // AssertionError [ERR_ASSERTION]: Expected inputs to be strictly equal:
+ * // + actual - expected
+ * //
+ * // + 'Hello foobar'
+ * // - 'Hello World!'
+ * // ^
+ *
+ * const apples = 1;
+ * const oranges = 2;
+ * assert.strictEqual(apples, oranges, `apples ${apples} !== oranges ${oranges}`);
+ * // AssertionError [ERR_ASSERTION]: apples 1 !== oranges 2
+ *
+ * assert.strictEqual(1, '1', new TypeError('Inputs are not identical'));
+ * // TypeError: Inputs are not identical
+ * ```
+ *
+ * If the values are not strictly equal, an `AssertionError` is thrown with a`message` property set equal to the value of the `message` parameter. If the`message` parameter is undefined, a
+ * default error message is assigned. If the`message` parameter is an instance of an `Error` then it will be thrown
+ * instead of the `AssertionError`.
+ * @since v0.1.21
+ */
+ function strictEqual<T>(actual: unknown, expected: T, message?: string | Error): asserts actual is T;
+ /**
+ * 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).
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * assert.notStrictEqual(1, 2);
+ * // OK
+ *
+ * assert.notStrictEqual(1, 1);
+ * // AssertionError [ERR_ASSERTION]: Expected "actual" to be strictly unequal to:
+ * //
+ * // 1
+ *
+ * assert.notStrictEqual(1, '1');
+ * // OK
+ * ```
+ *
+ * If the values are strictly equal, an `AssertionError` is thrown with a`message` property set equal to the value of the `message` parameter. If the`message` parameter is undefined, a
+ * default error message is assigned. If the`message` parameter is an instance of an `Error` then it will be thrown
+ * instead of the `AssertionError`.
+ * @since v0.1.21
+ */
+ function notStrictEqual(actual: unknown, expected: unknown, message?: string | Error): void;
+ /**
+ * Tests for deep equality between the `actual` and `expected` parameters.
+ * "Deep" equality means that the enumerable "own" properties of child objects
+ * are recursively evaluated also by the following rules.
+ * @since v1.2.0
+ */
+ function deepStrictEqual<T>(actual: unknown, expected: T, message?: string | Error): asserts actual is T;
+ /**
+ * Tests for deep strict inequality. Opposite of {@link deepStrictEqual}.
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * assert.notDeepStrictEqual({ a: 1 }, { a: '1' });
+ * // OK
+ * ```
+ *
+ * If the values are deeply and strictly equal, an `AssertionError` is thrown
+ * with a `message` property set equal to the value of the `message` parameter. If
+ * the `message` parameter is undefined, a default error message is assigned. If
+ * the `message` parameter is an instance of an `Error` then it will be thrown
+ * instead of the `AssertionError`.
+ * @since v1.2.0
+ */
+ function notDeepStrictEqual(actual: unknown, expected: unknown, message?: string | Error): void;
+ /**
+ * Expects the function `fn` to throw an error.
+ *
+ * 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), a validation function,
+ * a validation object where each property will be tested for strict deep equality,
+ * or an instance of error where each property will be tested for strict deep
+ * equality including the non-enumerable `message` and `name` properties. When
+ * using an object, it is also possible to use a regular expression, when
+ * validating against a string property. See below for examples.
+ *
+ * If specified, `message` will be appended to the message provided by the`AssertionError` if the `fn` call fails to throw or in case the error validation
+ * fails.
+ *
+ * Custom validation object/error instance:
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * const err = new TypeError('Wrong value');
+ * err.code = 404;
+ * err.foo = 'bar';
+ * err.info = {
+ * nested: true,
+ * baz: 'text'
+ * };
+ * err.reg = /abc/i;
+ *
+ * assert.throws(
+ * () => {
+ * throw err;
+ * },
+ * {
+ * name: 'TypeError',
+ * message: 'Wrong value',
+ * info: {
+ * nested: true,
+ * baz: 'text'
+ * }
+ * // Only properties on the validation object will be tested for.
+ * // Using nested objects requires all properties to be present. Otherwise
+ * // the validation is going to fail.
+ * }
+ * );
+ *
+ * // Using regular expressions to validate error properties:
+ * throws(
+ * () => {
+ * throw err;
+ * },
+ * {
+ * // The `name` and `message` properties are strings and using regular
+ * // expressions on those will match against the string. If they fail, an
+ * // error is thrown.
+ * name: /^TypeError$/,
+ * message: /Wrong/,
+ * foo: 'bar',
+ * info: {
+ * nested: true,
+ * // It is not possible to use regular expressions for nested properties!
+ * baz: 'text'
+ * },
+ * // The `reg` property contains a regular expression and only if the
+ * // validation object contains an identical regular expression, it is going
+ * // to pass.
+ * reg: /abc/i
+ * }
+ * );
+ *
+ * // Fails due to the different `message` and `name` properties:
+ * throws(
+ * () => {
+ * const otherErr = new Error('Not found');
+ * // Copy all enumerable properties from `err` to `otherErr`.
+ * for (const [key, value] of Object.entries(err)) {
+ * otherErr[key] = value;
+ * }
+ * throw otherErr;
+ * },
+ * // The error's `message` and `name` properties will also be checked when using
+ * // an error as validation object.
+ * err
+ * );
+ * ```
+ *
+ * Validate instanceof using constructor:
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * assert.throws(
+ * () => {
+ * throw new Error('Wrong value');
+ * },
+ * Error
+ * );
+ * ```
+ *
+ * Validate error message using [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions):
+ *
+ * Using a regular expression runs `.toString` on the error object, and will
+ * therefore also include the error name.
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * assert.throws(
+ * () => {
+ * throw new Error('Wrong value');
+ * },
+ * /^Error: Wrong value$/
+ * );
+ * ```
+ *
+ * Custom error validation:
+ *
+ * The function must return `true` to indicate all internal validations passed.
+ * It will otherwise fail with an `AssertionError`.
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * assert.throws(
+ * () => {
+ * throw new Error('Wrong value');
+ * },
+ * (err) => {
+ * assert(err instanceof Error);
+ * assert(/value/.test(err));
+ * // Avoid returning anything from validation functions besides `true`.
+ * // Otherwise, it's not clear what part of the validation failed. Instead,
+ * // throw an error about the specific validation that failed (as done in this
+ * // example) and add as much helpful debugging information to that error as
+ * // possible.
+ * return true;
+ * },
+ * 'unexpected error'
+ * );
+ * ```
+ *
+ * `error` cannot be a string. If a string is provided as the second
+ * argument, then `error` is assumed to be omitted and the string will be used for`message` instead. This can lead to easy-to-miss mistakes. Using the same
+ * message as the thrown error message is going to result in an`ERR_AMBIGUOUS_ARGUMENT` error. Please read the example below carefully if using
+ * a string as the second argument gets considered:
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * function throwingFirst() {
+ * throw new Error('First');
+ * }
+ *
+ * function throwingSecond() {
+ * throw new Error('Second');
+ * }
+ *
+ * function notThrowing() {}
+ *
+ * // The second argument is a string and the input function threw an Error.
+ * // The first case will not throw as it does not match for the error message
+ * // thrown by the input function!
+ * assert.throws(throwingFirst, 'Second');
+ * // In the next example the message has no benefit over the message from the
+ * // error and since it is not clear if the user intended to actually match
+ * // against the error message, Node.js throws an `ERR_AMBIGUOUS_ARGUMENT` error.
+ * assert.throws(throwingSecond, 'Second');
+ * // TypeError [ERR_AMBIGUOUS_ARGUMENT]
+ *
+ * // The string is only used (as message) in case the function does not throw:
+ * assert.throws(notThrowing, 'Second');
+ * // AssertionError [ERR_ASSERTION]: Missing expected exception: Second
+ *
+ * // If it was intended to match for the error message do this instead:
+ * // It does not throw because the error messages match.
+ * assert.throws(throwingSecond, /Second$/);
+ *
+ * // If the error message does not match, an AssertionError is thrown.
+ * assert.throws(throwingFirst, /Second$/);
+ * // AssertionError [ERR_ASSERTION]
+ * ```
+ *
+ * Due to the confusing error-prone notation, avoid a string as the second
+ * argument.
+ * @since v0.1.21
+ */
+ function throws(block: () => unknown, message?: string | Error): void;
+ function throws(block: () => unknown, error: AssertPredicate, message?: string | Error): void;
+ /**
+ * Asserts that the function `fn` does not throw an error.
+ *
+ * Using `assert.doesNotThrow()` is actually not useful because there
+ * is no benefit in catching an error and then rethrowing it. Instead, consider
+ * adding a comment next to the specific code path that should not throw and keep
+ * error messages as expressive as possible.
+ *
+ * When `assert.doesNotThrow()` is called, it will immediately call the `fn`function.
+ *
+ * If an error is thrown and it is the same type as that specified by the `error`parameter, then an `AssertionError` is thrown. If the error is of a
+ * different type, or if the `error` parameter is undefined, the error is
+ * propagated back to the caller.
+ *
+ * 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
+ * function. See {@link throws} for more details.
+ *
+ * The following, for instance, will throw the `TypeError` because there is no
+ * matching error type in the assertion:
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * assert.doesNotThrow(
+ * () => {
+ * throw new TypeError('Wrong value');
+ * },
+ * SyntaxError
+ * );
+ * ```
+ *
+ * However, the following will result in an `AssertionError` with the message
+ * 'Got unwanted exception...':
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * assert.doesNotThrow(
+ * () => {
+ * throw new TypeError('Wrong value');
+ * },
+ * 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:
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * assert.doesNotThrow(
+ * () => {
+ * throw new TypeError('Wrong value');
+ * },
+ * /Wrong value/,
+ * 'Whoops'
+ * );
+ * // Throws: AssertionError: Got unwanted exception: Whoops
+ * ```
+ * @since v0.1.21
+ */
+ function doesNotThrow(block: () => unknown, message?: string | Error): void;
+ function doesNotThrow(block: () => unknown, error: AssertPredicate, message?: string | Error): void;
+ /**
+ * Throws `value` if `value` is not `undefined` or `null`. This is useful when
+ * testing the `error` argument in callbacks. The stack trace contains all frames
+ * from the error passed to `ifError()` including the potential new frames for`ifError()` itself.
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * assert.ifError(null);
+ * // OK
+ * assert.ifError(0);
+ * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: 0
+ * assert.ifError('error');
+ * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: 'error'
+ * assert.ifError(new Error());
+ * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: Error
+ *
+ * // Create some random error frames.
+ * let err;
+ * (function errorFrame() {
+ * err = new Error('test error');
+ * })();
+ *
+ * (function ifErrorFrame() {
+ * assert.ifError(err);
+ * })();
+ * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: test error
+ * // at ifErrorFrame
+ * // at errorFrame
+ * ```
+ * @since v0.1.97
+ */
+ function ifError(value: unknown): asserts value is null | undefined;
+ /**
+ * Awaits the `asyncFn` promise or, if `asyncFn` is a function, immediately
+ * calls the function and awaits the returned promise to complete. It will then
+ * check that the promise is rejected.
+ *
+ * If `asyncFn` is a function and it throws an error synchronously,`assert.rejects()` will return a rejected `Promise` with that error. If the
+ * function does not return a promise, `assert.rejects()` will return a rejected`Promise` with an `ERR_INVALID_RETURN_VALUE` error. In both cases the error
+ * handler is skipped.
+ *
+ * Besides the async nature to await the completion behaves identically to {@link throws}.
+ *
+ * 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), a validation function,
+ * an object where each property will be tested for, or an instance of error where
+ * each property will be tested for including the non-enumerable `message` and`name` properties.
+ *
+ * If specified, `message` will be the message provided by the `AssertionError` if the `asyncFn` fails to reject.
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * await assert.rejects(
+ * async () => {
+ * throw new TypeError('Wrong value');
+ * },
+ * {
+ * name: 'TypeError',
+ * message: 'Wrong value'
+ * }
+ * );
+ * ```
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * await assert.rejects(
+ * async () => {
+ * throw new TypeError('Wrong value');
+ * },
+ * (err) => {
+ * assert.strictEqual(err.name, 'TypeError');
+ * assert.strictEqual(err.message, 'Wrong value');
+ * return true;
+ * }
+ * );
+ * ```
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * assert.rejects(
+ * Promise.reject(new Error('Wrong value')),
+ * Error
+ * ).then(() => {
+ * // ...
+ * });
+ * ```
+ *
+ * `error` cannot be a string. If a string is provided as the second
+ * argument, then `error` is assumed to be omitted and the string will be used for`message` instead. This can lead to easy-to-miss mistakes. Please read the
+ * example in {@link throws} carefully if using a string as the second
+ * argument gets considered.
+ * @since v10.0.0
+ */
+ function rejects(block: (() => Promise<unknown>) | Promise<unknown>, message?: string | Error): Promise<void>;
+ function rejects(
+ block: (() => Promise<unknown>) | Promise<unknown>,
+ error: AssertPredicate,
+ message?: string | Error,
+ ): Promise<void>;
+ /**
+ * Awaits the `asyncFn` promise or, if `asyncFn` is a function, immediately
+ * calls the function and awaits the returned promise to complete. It will then
+ * check that the promise is not rejected.
+ *
+ * If `asyncFn` is a function and it throws an error synchronously,`assert.doesNotReject()` will return a rejected `Promise` with that error. If
+ * the function does not return a promise, `assert.doesNotReject()` will return a
+ * rejected `Promise` with an `ERR_INVALID_RETURN_VALUE` error. In both cases
+ * the error handler is skipped.
+ *
+ * Using `assert.doesNotReject()` is actually not useful because there is little
+ * benefit in catching a rejection and then rejecting it again. Instead, consider
+ * adding a comment next to the specific code path that should not reject and keep
+ * error messages as expressive as possible.
+ *
+ * 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
+ * function. See {@link throws} for more details.
+ *
+ * Besides the async nature to await the completion behaves identically to {@link doesNotThrow}.
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * await assert.doesNotReject(
+ * async () => {
+ * throw new TypeError('Wrong value');
+ * },
+ * SyntaxError
+ * );
+ * ```
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * assert.doesNotReject(Promise.reject(new TypeError('Wrong value')))
+ * .then(() => {
+ * // ...
+ * });
+ * ```
+ * @since v10.0.0
+ */
+ function doesNotReject(
+ block: (() => Promise<unknown>) | Promise<unknown>,
+ 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.
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * assert.match('I will fail', /pass/);
+ * // AssertionError [ERR_ASSERTION]: The input did not match the regular ...
+ *
+ * assert.match(123, /pass/);
+ * // AssertionError [ERR_ASSERTION]: The "string" argument must be of type string.
+ *
+ * assert.match('I will pass', /pass/);
+ * // OK
+ * ```
+ *
+ * If the values do not match, or if the `string` argument is of another type than`string`, an `AssertionError` is thrown with a `message` property set equal
+ * to the value of the `message` parameter. If the `message` parameter is
+ * undefined, a default error message is assigned. If the `message` parameter is an
+ * instance of an `Error` then it will be thrown instead of the `AssertionError`.
+ * @since v13.6.0, v12.16.0
+ */
+ function match(value: string, regExp: RegExp, message?: string | Error): void;
+ /**
+ * Expects the `string` input not to match the regular expression.
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * assert.doesNotMatch('I will fail', /fail/);
+ * // AssertionError [ERR_ASSERTION]: The input was expected to not match the ...
+ *
+ * assert.doesNotMatch(123, /pass/);
+ * // AssertionError [ERR_ASSERTION]: The "string" argument must be of type string.
+ *
+ * assert.doesNotMatch('I will pass', /different/);
+ * // OK
+ * ```
+ *
+ * If the values do match, or if the `string` argument is of another type than`string`, an `AssertionError` is thrown with a `message` property set equal
+ * to the value of the `message` parameter. If the `message` parameter is
+ * undefined, a default error message is assigned. If the `message` parameter is an
+ * instance of an `Error` then it will be thrown instead of the `AssertionError`.
+ * @since v13.6.0, v12.16.0
+ */
+ function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void;
+ const strict:
+ & Omit<
+ typeof assert,
+ | "equal"
+ | "notEqual"
+ | "deepEqual"
+ | "notDeepEqual"
+ | "ok"
+ | "strictEqual"
+ | "deepStrictEqual"
+ | "ifError"
+ | "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;
+}
+declare module "node:assert" {
+ import assert = require("assert");
+ export = assert;
+}
diff --git a/client/node_modules/@types/node/assert/strict.d.ts b/client/node_modules/@types/node/assert/strict.d.ts
new file mode 100644
index 0000000..f333913
--- /dev/null
+++ b/client/node_modules/@types/node/assert/strict.d.ts
@@ -0,0 +1,8 @@
+declare module "assert/strict" {
+ import { strict } from "node:assert";
+ export = strict;
+}
+declare module "node:assert/strict" {
+ import { strict } from "node:assert";
+ export = strict;
+}
diff --git a/client/node_modules/@types/node/async_hooks.d.ts b/client/node_modules/@types/node/async_hooks.d.ts
new file mode 100644
index 0000000..1ae6885
--- /dev/null
+++ b/client/node_modules/@types/node/async_hooks.d.ts
@@ -0,0 +1,522 @@
+/**
+ * The `async_hooks` module provides an API to track asynchronous resources. It
+ * can be accessed using:
+ *
+ * ```js
+ * import async_hooks from 'async_hooks';
+ * ```
+ * @experimental
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/async_hooks.js)
+ */
+declare module "async_hooks" {
+ /**
+ * ```js
+ * import { executionAsyncId } from 'async_hooks';
+ *
+ * console.log(executionAsyncId()); // 1 - bootstrap
+ * fs.open(path, 'r', (err, fd) => {
+ * console.log(executionAsyncId()); // 6 - open()
+ * });
+ * ```
+ *
+ * The ID returned from `executionAsyncId()` is related to execution timing, not
+ * causality (which is covered by `triggerAsyncId()`):
+ *
+ * ```js
+ * const server = net.createServer((conn) => {
+ * // Returns the ID of the server, not of the new connection, because the
+ * // callback runs in the execution scope of the server's MakeCallback().
+ * async_hooks.executionAsyncId();
+ *
+ * }).listen(port, () => {
+ * // Returns the ID of a TickObject (process.nextTick()) because all
+ * // callbacks passed to .listen() are wrapped in a nextTick().
+ * async_hooks.executionAsyncId();
+ * });
+ * ```
+ *
+ * Promise contexts may not get precise `executionAsyncIds` by default.
+ * See the section on `promise execution tracking`.
+ * @since v8.1.0
+ * @return The `asyncId` of the current execution context. Useful to track when something calls.
+ */
+ function executionAsyncId(): number;
+ /**
+ * Resource objects returned by `executionAsyncResource()` are most often internal
+ * Node.js handle objects with undocumented APIs. Using any functions or properties
+ * on the object is likely to crash your application and should be avoided.
+ *
+ * Using `executionAsyncResource()` in the top-level execution context will
+ * return an empty object as there is no handle or request object to use,
+ * but having an object representing the top-level can be helpful.
+ *
+ * ```js
+ * import { open } from 'fs';
+ * import { executionAsyncId, executionAsyncResource } from 'async_hooks';
+ *
+ * console.log(executionAsyncId(), executionAsyncResource()); // 1 {}
+ * open(new URL(import.meta.url), 'r', (err, fd) => {
+ * console.log(executionAsyncId(), executionAsyncResource()); // 7 FSReqWrap
+ * });
+ * ```
+ *
+ * This can be used to implement continuation local storage without the
+ * use of a tracking `Map` to store the metadata:
+ *
+ * ```js
+ * import { createServer } from 'http';
+ * import {
+ * executionAsyncId,
+ * executionAsyncResource,
+ * createHook
+ * } from 'async_hooks';
+ * const sym = Symbol('state'); // Private symbol to avoid pollution
+ *
+ * createHook({
+ * init(asyncId, type, triggerAsyncId, resource) {
+ * const cr = executionAsyncResource();
+ * if (cr) {
+ * resource[sym] = cr[sym];
+ * }
+ * }
+ * }).enable();
+ *
+ * const server = createServer((req, res) => {
+ * executionAsyncResource()[sym] = { state: req.url };
+ * setTimeout(function() {
+ * res.end(JSON.stringify(executionAsyncResource()[sym]));
+ * }, 100);
+ * }).listen(3000);
+ * ```
+ * @since v13.9.0, v12.17.0
+ * @return The resource representing the current execution. Useful to store data within the resource.
+ */
+ function executionAsyncResource(): object;
+ /**
+ * ```js
+ * const server = net.createServer((conn) => {
+ * // The resource that caused (or triggered) this callback to be called
+ * // was that of the new connection. Thus the return value of triggerAsyncId()
+ * // is the asyncId of "conn".
+ * async_hooks.triggerAsyncId();
+ *
+ * }).listen(port, () => {
+ * // Even though all callbacks passed to .listen() are wrapped in a nextTick()
+ * // the callback itself exists because the call to the server's .listen()
+ * // was made. So the return value would be the ID of the server.
+ * async_hooks.triggerAsyncId();
+ * });
+ * ```
+ *
+ * Promise contexts may not get valid `triggerAsyncId`s by default. See
+ * the section on `promise execution tracking`.
+ * @return The ID of the resource responsible for calling the callback that is currently being executed.
+ */
+ function triggerAsyncId(): number;
+ interface HookCallbacks {
+ /**
+ * Called when a class is constructed that has the possibility to emit an asynchronous event.
+ * @param asyncId a unique ID for the async resource
+ * @param type the type of the async resource
+ * @param triggerAsyncId the unique ID of the async resource in whose execution context this async resource was created
+ * @param resource reference to the resource representing the async operation, needs to be released during destroy
+ */
+ init?(asyncId: number, type: string, triggerAsyncId: number, resource: object): void;
+ /**
+ * When an asynchronous operation is initiated or completes a callback is called to notify the user.
+ * The before callback is called just before said callback is executed.
+ * @param asyncId the unique identifier assigned to the resource about to execute the callback.
+ */
+ before?(asyncId: number): void;
+ /**
+ * Called immediately after the callback specified in before is completed.
+ * @param asyncId the unique identifier assigned to the resource which has executed the callback.
+ */
+ after?(asyncId: number): void;
+ /**
+ * Called when a promise has resolve() called. This may not be in the same execution id
+ * as the promise itself.
+ * @param asyncId the unique id for the promise that was resolve()d.
+ */
+ promiseResolve?(asyncId: number): void;
+ /**
+ * Called after the resource corresponding to asyncId is destroyed
+ * @param asyncId a unique ID for the async resource
+ */
+ destroy?(asyncId: number): void;
+ }
+ interface AsyncHook {
+ /**
+ * Enable the callbacks for a given AsyncHook instance. If no callbacks are provided enabling is a noop.
+ */
+ enable(): this;
+ /**
+ * Disable the callbacks for a given AsyncHook instance from the global pool of AsyncHook callbacks to be executed. Once a hook has been disabled it will not be called again until enabled.
+ */
+ disable(): this;
+ }
+ /**
+ * Registers functions to be called for different lifetime events of each async
+ * operation.
+ *
+ * The callbacks `init()`/`before()`/`after()`/`destroy()` are called for the
+ * respective asynchronous event during a resource's lifetime.
+ *
+ * All callbacks are optional. For example, if only resource cleanup needs to
+ * be tracked, then only the `destroy` callback needs to be passed. The
+ * specifics of all functions that can be passed to `callbacks` is in the `Hook Callbacks` section.
+ *
+ * ```js
+ * import { createHook } from 'async_hooks';
+ *
+ * const asyncHook = createHook({
+ * init(asyncId, type, triggerAsyncId, resource) { },
+ * destroy(asyncId) { }
+ * });
+ * ```
+ *
+ * The callbacks will be inherited via the prototype chain:
+ *
+ * ```js
+ * class MyAsyncCallbacks {
+ * init(asyncId, type, triggerAsyncId, resource) { }
+ * destroy(asyncId) {}
+ * }
+ *
+ * class MyAddedCallbacks extends MyAsyncCallbacks {
+ * before(asyncId) { }
+ * after(asyncId) { }
+ * }
+ *
+ * const asyncHook = async_hooks.createHook(new MyAddedCallbacks());
+ * ```
+ *
+ * Because promises are asynchronous resources whose lifecycle is tracked
+ * via the async hooks mechanism, the `init()`, `before()`, `after()`, and`destroy()` callbacks _must not_ be async functions that return promises.
+ * @since v8.1.0
+ * @param callbacks The `Hook Callbacks` to register
+ * @return Instance used for disabling and enabling hooks
+ */
+ function createHook(callbacks: HookCallbacks): AsyncHook;
+ interface AsyncResourceOptions {
+ /**
+ * The ID of the execution context that created this async event.
+ * @default executionAsyncId()
+ */
+ triggerAsyncId?: number | undefined;
+ /**
+ * Disables automatic `emitDestroy` when the object is garbage collected.
+ * This usually does not need to be set (even if `emitDestroy` is called
+ * manually), unless the resource's `asyncId` is retrieved and the
+ * sensitive API's `emitDestroy` is called with it.
+ * @default false
+ */
+ requireManualDestroy?: boolean | undefined;
+ }
+ /**
+ * The class `AsyncResource` is designed to be extended by the embedder's async
+ * resources. Using this, users can easily trigger the lifetime events of their
+ * own resources.
+ *
+ * The `init` hook will trigger when an `AsyncResource` is instantiated.
+ *
+ * The following is an overview of the `AsyncResource` API.
+ *
+ * ```js
+ * import { AsyncResource, executionAsyncId } from 'async_hooks';
+ *
+ * // AsyncResource() is meant to be extended. Instantiating a
+ * // new AsyncResource() also triggers init. If triggerAsyncId is omitted then
+ * // async_hook.executionAsyncId() is used.
+ * const asyncResource = new AsyncResource(
+ * type, { triggerAsyncId: executionAsyncId(), requireManualDestroy: false }
+ * );
+ *
+ * // Run a function in the execution context of the resource. This will
+ * // * establish the context of the resource
+ * // * trigger the AsyncHooks before callbacks
+ * // * call the provided function `fn` with the supplied arguments
+ * // * trigger the AsyncHooks after callbacks
+ * // * restore the original execution context
+ * asyncResource.runInAsyncScope(fn, thisArg, ...args);
+ *
+ * // Call AsyncHooks destroy callbacks.
+ * asyncResource.emitDestroy();
+ *
+ * // Return the unique ID assigned to the AsyncResource instance.
+ * asyncResource.asyncId();
+ *
+ * // Return the trigger ID for the AsyncResource instance.
+ * asyncResource.triggerAsyncId();
+ * ```
+ */
+ class AsyncResource {
+ /**
+ * AsyncResource() is meant to be extended. Instantiating a
+ * new AsyncResource() also triggers init. If triggerAsyncId is omitted then
+ * async_hook.executionAsyncId() is used.
+ * @param type The type of async event.
+ * @param triggerAsyncId The ID of the execution context that created
+ * this async event (default: `executionAsyncId()`), or an
+ * AsyncResourceOptions object (since v9.3.0)
+ */
+ constructor(type: string, triggerAsyncId?: number | AsyncResourceOptions);
+ /**
+ * 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
+ * @param fn The function to bind to the current execution context.
+ * @param type An optional name to associate with the underlying `AsyncResource`.
+ */
+ static bind<Func extends (this: ThisArg, ...args: any[]) => any, ThisArg>(
+ fn: Func,
+ type?: string,
+ thisArg?: ThisArg,
+ ): Func & {
+ asyncResource: AsyncResource;
+ };
+ /**
+ * 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
+ * @param fn The function to bind to the current `AsyncResource`.
+ */
+ bind<Func extends (...args: any[]) => any>(
+ fn: Func,
+ ): Func & {
+ asyncResource: AsyncResource;
+ };
+ /**
+ * Call the provided function with the provided arguments in the execution context
+ * of the async resource. This will establish the context, trigger the AsyncHooks
+ * before callbacks, call the function, trigger the AsyncHooks after callbacks, and
+ * then restore the original execution context.
+ * @since v9.6.0
+ * @param fn The function to call in the execution context of this async resource.
+ * @param thisArg The receiver to be used for the function call.
+ * @param args Optional arguments to pass to the function.
+ */
+ runInAsyncScope<This, 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
+ * 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.
+ * @return A reference to `asyncResource`.
+ */
+ emitDestroy(): this;
+ /**
+ * @return The unique `asyncId` assigned to the resource.
+ */
+ asyncId(): number;
+ /**
+ * @return The same `triggerAsyncId` that is passed to the `AsyncResource` constructor.
+ */
+ triggerAsyncId(): number;
+ }
+ /**
+ * This class creates stores that stay coherent through asynchronous operations.
+ *
+ * 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
+ * implementation that involves significant optimizations that are non-obvious to
+ * implement.
+ *
+ * The following example uses `AsyncLocalStorage` to build a simple logger
+ * that assigns IDs to incoming HTTP requests and includes them in messages
+ * logged within each request.
+ *
+ * ```js
+ * import http from 'http';
+ * import { AsyncLocalStorage } from 'async_hooks';
+ *
+ * const asyncLocalStorage = new AsyncLocalStorage();
+ *
+ * function logWithId(msg) {
+ * const id = asyncLocalStorage.getStore();
+ * console.log(`${id !== undefined ? id : '-'}:`, msg);
+ * }
+ *
+ * let idSeq = 0;
+ * http.createServer((req, res) => {
+ * asyncLocalStorage.run(idSeq++, () => {
+ * logWithId('start');
+ * // Imagine any chain of async operations here
+ * setImmediate(() => {
+ * logWithId('finish');
+ * res.end();
+ * });
+ * });
+ * }).listen(8080);
+ *
+ * http.get('http://localhost:8080');
+ * http.get('http://localhost:8080');
+ * // Prints:
+ * // 0: start
+ * // 1: start
+ * // 0: finish
+ * // 1: finish
+ * ```
+ *
+ * Each instance of `AsyncLocalStorage` maintains an independent storage context.
+ * Multiple instances can safely exist simultaneously without risk of interfering
+ * with each other's data.
+ * @since v13.10.0, v12.17.0
+ */
+ class AsyncLocalStorage<T> {
+ /**
+ * Binds the given function to the current execution context.
+ * @since v18.16.0
+ * @param fn The function to bind to the current execution context.
+ * @returns A new function that calls `fn` within the captured execution context.
+ */
+ static bind<Func extends (...args: any[]) => any>(fn: Func): Func & {
+ asyncResource: AsyncResource;
+ };
+ /**
+ * 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.
+ * @since v18.16.0
+ */
+ static snapshot(): (<R, TArgs extends any[]>(fn: (...args: TArgs) => R, ...args: TArgs) => R) & {
+ asyncResource: AsyncResource;
+ };
+ /**
+ * Disables the instance of `AsyncLocalStorage`. All subsequent calls
+ * to `asyncLocalStorage.getStore()` will return `undefined` until`asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()` is called again.
+ *
+ * When calling `asyncLocalStorage.disable()`, all current contexts linked to the
+ * instance will be exited.
+ *
+ * Calling `asyncLocalStorage.disable()` is required before the`asyncLocalStorage` can be garbage collected. This does not apply to stores
+ * provided by the `asyncLocalStorage`, as those objects are garbage collected
+ * along with the corresponding async resources.
+ *
+ * Use this method when the `asyncLocalStorage` is not in use anymore
+ * in the current process.
+ * @since v13.10.0, v12.17.0
+ * @experimental
+ */
+ disable(): void;
+ /**
+ * Returns the current store.
+ * If called outside of an asynchronous context initialized by
+ * calling `asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()`, it
+ * returns `undefined`.
+ * @since v13.10.0, v12.17.0
+ */
+ getStore(): T | undefined;
+ /**
+ * Runs a function synchronously within a context and returns its
+ * return value. The store is not accessible outside of the callback function.
+ * The store is accessible to any asynchronous operations created within the
+ * callback.
+ *
+ * The optional `args` are passed to the callback function.
+ *
+ * If the callback function throws an error, the error is thrown by `run()` too.
+ * The stacktrace is not impacted by this call and the context is exited.
+ *
+ * Example:
+ *
+ * ```js
+ * const store = { id: 2 };
+ * try {
+ * asyncLocalStorage.run(store, () => {
+ * asyncLocalStorage.getStore(); // Returns the store object
+ * setTimeout(() => {
+ * asyncLocalStorage.getStore(); // Returns the store object
+ * }, 200);
+ * throw new Error();
+ * });
+ * } catch (e) {
+ * asyncLocalStorage.getStore(); // Returns undefined
+ * // The error will be caught here
+ * }
+ * ```
+ * @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;
+ /**
+ * Runs a function synchronously outside of a context and returns its
+ * return value. The store is not accessible within the callback function or
+ * the asynchronous operations created within the callback. Any `getStore()`call done within the callback function will always return `undefined`.
+ *
+ * The optional `args` are passed to the callback function.
+ *
+ * If the callback function throws an error, the error is thrown by `exit()` too.
+ * The stacktrace is not impacted by this call and the context is re-entered.
+ *
+ * Example:
+ *
+ * ```js
+ * // Within a call to run
+ * try {
+ * asyncLocalStorage.getStore(); // Returns the store object or value
+ * asyncLocalStorage.exit(() => {
+ * asyncLocalStorage.getStore(); // Returns undefined
+ * throw new Error();
+ * });
+ * } catch (e) {
+ * asyncLocalStorage.getStore(); // Returns the same object or value
+ * // The error will be caught here
+ * }
+ * ```
+ * @since v13.10.0, v12.17.0
+ * @experimental
+ */
+ exit<R, TArgs extends any[]>(callback: (...args: TArgs) => R, ...args: TArgs): R;
+ /**
+ * Transitions into the context for the remainder of the current
+ * synchronous execution and then persists the store through any following
+ * asynchronous calls.
+ *
+ * Example:
+ *
+ * ```js
+ * const store = { id: 1 };
+ * // Replaces previous store with the given store object
+ * asyncLocalStorage.enterWith(store);
+ * asyncLocalStorage.getStore(); // Returns the store object
+ * someAsyncOperation(() => {
+ * asyncLocalStorage.getStore(); // Returns the same object
+ * });
+ * ```
+ *
+ * This transition will continue for the _entire_ synchronous execution.
+ * This means that if, for example, the context is entered within an event
+ * handler subsequent event handlers will also run within that context unless
+ * specifically bound to another context with an `AsyncResource`. That is why`run()` should be preferred over `enterWith()` unless there are strong reasons
+ * to use the latter method.
+ *
+ * ```js
+ * const store = { id: 1 };
+ *
+ * emitter.on('my-event', () => {
+ * asyncLocalStorage.enterWith(store);
+ * });
+ * emitter.on('my-event', () => {
+ * asyncLocalStorage.getStore(); // Returns the same object
+ * });
+ *
+ * asyncLocalStorage.getStore(); // Returns undefined
+ * emitter.emit('my-event');
+ * asyncLocalStorage.getStore(); // Returns the same object
+ * ```
+ * @since v13.11.0, v12.17.0
+ * @experimental
+ */
+ enterWith(store: T): void;
+ }
+}
+declare module "node:async_hooks" {
+ export * from "async_hooks";
+}
diff --git a/client/node_modules/@types/node/buffer.d.ts b/client/node_modules/@types/node/buffer.d.ts
new file mode 100644
index 0000000..cfc1f39
--- /dev/null
+++ b/client/node_modules/@types/node/buffer.d.ts
@@ -0,0 +1,2321 @@
+/**
+ * `Buffer` objects are used to represent a fixed-length sequence of bytes. Many
+ * Node.js APIs support `Buffer`s.
+ *
+ * The `Buffer` class is a subclass of JavaScript's [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) class and
+ * extends it with methods that cover additional use cases. Node.js APIs accept
+ * plain [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) s wherever `Buffer`s are supported as well.
+ *
+ * While the `Buffer` class is available within the global scope, it is still
+ * recommended to explicitly reference it via an import or require statement.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * // Creates a zero-filled Buffer of length 10.
+ * const buf1 = Buffer.alloc(10);
+ *
+ * // Creates a Buffer of length 10,
+ * // filled with bytes which all have the value `1`.
+ * const buf2 = Buffer.alloc(10, 1);
+ *
+ * // Creates an uninitialized buffer of length 10.
+ * // This is faster than calling Buffer.alloc() but the returned
+ * // Buffer instance might contain old data that needs to be
+ * // overwritten using fill(), write(), or other functions that fill the Buffer's
+ * // contents.
+ * const buf3 = Buffer.allocUnsafe(10);
+ *
+ * // Creates a Buffer containing the bytes [1, 2, 3].
+ * const buf4 = Buffer.from([1, 2, 3]);
+ *
+ * // Creates a Buffer containing the bytes [1, 1, 1, 1] – the entries
+ * // are all truncated using `(value &#x26; 255)` to fit into the range 0–255.
+ * const buf5 = Buffer.from([257, 257.5, -255, '1']);
+ *
+ * // Creates a Buffer containing the UTF-8-encoded bytes for the string 'tést':
+ * // [0x74, 0xc3, 0xa9, 0x73, 0x74] (in hexadecimal notation)
+ * // [116, 195, 169, 115, 116] (in decimal notation)
+ * const buf6 = Buffer.from('tést');
+ *
+ * // Creates a Buffer containing the Latin-1 bytes [0x74, 0xe9, 0x73, 0x74].
+ * const buf7 = Buffer.from('tést', 'latin1');
+ * ```
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/buffer.js)
+ */
+declare module "buffer" {
+ import { BinaryLike } from "node:crypto";
+ import { ReadableStream as WebReadableStream } from "node:stream/web";
+ export function isUtf8(input: Buffer | ArrayBuffer | NodeJS.TypedArray): boolean;
+ export function isAscii(input: Buffer | ArrayBuffer | NodeJS.TypedArray): boolean;
+ export const INSPECT_MAX_BYTES: number;
+ export const kMaxLength: number;
+ export const kStringMaxLength: number;
+ export const constants: {
+ MAX_LENGTH: number;
+ MAX_STRING_LENGTH: number;
+ };
+ export type TranscodeEncoding = "ascii" | "utf8" | "utf16le" | "ucs2" | "latin1" | "binary";
+ /**
+ * Re-encodes the given `Buffer` or `Uint8Array` instance from one character
+ * encoding to another. Returns a new `Buffer` instance.
+ *
+ * Throws if the `fromEnc` or `toEnc` specify invalid character encodings or if
+ * conversion from `fromEnc` to `toEnc` is not permitted.
+ *
+ * Encodings supported by `buffer.transcode()` are: `'ascii'`, `'utf8'`,`'utf16le'`, `'ucs2'`, `'latin1'`, and `'binary'`.
+ *
+ * The transcoding process will use substitution characters if a given byte
+ * sequence cannot be adequately represented in the target encoding. For instance:
+ *
+ * ```js
+ * import { Buffer, transcode } from 'buffer';
+ *
+ * const newBuf = transcode(Buffer.from('€'), 'utf8', 'ascii');
+ * console.log(newBuf.toString('ascii'));
+ * // Prints: '?'
+ * ```
+ *
+ * Because the Euro (`€`) sign is not representable in US-ASCII, it is replaced
+ * with `?` in the transcoded `Buffer`.
+ * @since v7.1.0
+ * @param source A `Buffer` or `Uint8Array` instance.
+ * @param fromEnc The current encoding.
+ * @param toEnc To target encoding.
+ */
+ export function transcode(source: Uint8Array, fromEnc: TranscodeEncoding, toEnc: TranscodeEncoding): Buffer;
+ export const SlowBuffer: {
+ /** @deprecated since v6.0.0, use `Buffer.allocUnsafeSlow()` */
+ new(size: number): Buffer;
+ prototype: Buffer;
+ };
+ /**
+ * Resolves a `'blob:nodedata:...'` an associated `Blob` object registered using
+ * a prior call to `URL.createObjectURL()`.
+ * @since v16.7.0
+ * @experimental
+ * @param id A `'blob:nodedata:...` URL string returned by a prior call to `URL.createObjectURL()`.
+ */
+ export function resolveObjectURL(id: string): Blob | undefined;
+ export { Buffer };
+ /**
+ * @experimental
+ */
+ export interface BlobOptions {
+ /**
+ * @default 'utf8'
+ */
+ encoding?: BufferEncoding | undefined;
+ /**
+ * The Blob content-type. The intent is for `type` to convey
+ * the MIME media type of the data, however no validation of the type format
+ * is performed.
+ */
+ type?: string | undefined;
+ }
+ /**
+ * A [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) encapsulates immutable, raw data that can be safely shared across
+ * multiple worker threads.
+ * @since v15.7.0, v14.18.0
+ */
+ export class Blob {
+ /**
+ * The total size of the `Blob` in bytes.
+ * @since v15.7.0, v14.18.0
+ */
+ readonly size: number;
+ /**
+ * The content-type of the `Blob`.
+ * @since v15.7.0, v14.18.0
+ */
+ readonly type: string;
+ /**
+ * Creates a new `Blob` object containing a concatenation of the given sources.
+ *
+ * {ArrayBuffer}, {TypedArray}, {DataView}, and {Buffer} sources are copied into
+ * the 'Blob' and can therefore be safely modified after the 'Blob' is created.
+ *
+ * String sources are also copied into the `Blob`.
+ */
+ constructor(sources: Array<BinaryLike | Blob>, options?: BlobOptions);
+ /**
+ * Returns a promise that fulfills with an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) containing a copy of
+ * the `Blob` data.
+ * @since v15.7.0, v14.18.0
+ */
+ arrayBuffer(): Promise<ArrayBuffer>;
+ /**
+ * Creates and returns a new `Blob` containing a subset of this `Blob` objects
+ * data. The original `Blob` is not altered.
+ * @since v15.7.0, v14.18.0
+ * @param start The starting index.
+ * @param end The ending index.
+ * @param type The content-type for the new `Blob`
+ */
+ slice(start?: number, end?: number, type?: string): Blob;
+ /**
+ * Returns a promise that fulfills with the contents of the `Blob` decoded as a
+ * UTF-8 string.
+ * @since v15.7.0, v14.18.0
+ */
+ text(): Promise<string>;
+ /**
+ * Returns a new (WHATWG) `ReadableStream` that allows the content of the `Blob` to be read.
+ * @since v16.7.0
+ */
+ stream(): WebReadableStream;
+ }
+ export interface FileOptions {
+ /**
+ * One of either `'transparent'` or `'native'`. When set to `'native'`, line endings in string source parts will be
+ * converted to the platform native line-ending as specified by `require('node:os').EOL`.
+ */
+ endings?: "native" | "transparent";
+ /** The File content-type. */
+ type?: string;
+ /** The last modified date of the file. `Default`: Date.now(). */
+ lastModified?: number;
+ }
+ /**
+ * A [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File) provides information about files.
+ * @experimental
+ * @since v18.13.0
+ */
+ export class File extends Blob {
+ constructor(sources: Array<BinaryLike | Blob>, fileName: string, options?: FileOptions);
+ /**
+ * The name of the `File`.
+ * @since v18.13.0
+ */
+ readonly name: string;
+ /**
+ * The last modified date of the `File`.
+ * @since v18.13.0
+ */
+ readonly lastModified: number;
+ }
+ export import atob = globalThis.atob;
+ export import btoa = globalThis.btoa;
+
+ import { Blob as NodeBlob } from "buffer";
+ // This conditional type will be the existing global Blob in a browser, or
+ // the copy below in a Node environment.
+ type __Blob = typeof globalThis extends { onmessage: any; Blob: any } ? {} : NodeBlob;
+ global {
+ namespace NodeJS {
+ export { BufferEncoding };
+ }
+ // Buffer class
+ type BufferEncoding =
+ | "ascii"
+ | "utf8"
+ | "utf-8"
+ | "utf16le"
+ | "ucs2"
+ | "ucs-2"
+ | "base64"
+ | "base64url"
+ | "latin1"
+ | "binary"
+ | "hex";
+ type WithImplicitCoercion<T> =
+ | T
+ | {
+ valueOf(): T;
+ };
+ /**
+ * Raw data is stored in instances of the Buffer class.
+ * A Buffer is similar to an array of integers but corresponds to a raw memory allocation outside the V8 heap. A Buffer cannot be resized.
+ * Valid string encodings: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'base64url'|'binary'(deprecated)|'hex'
+ */
+ interface BufferConstructor {
+ /**
+ * Allocates a new buffer containing the given {str}.
+ *
+ * @param str String to store in buffer.
+ * @param encoding encoding to use, optional. Default is 'utf8'
+ * @deprecated since v10.0.0 - Use `Buffer.from(string[, encoding])` instead.
+ */
+ new(str: string, encoding?: BufferEncoding): Buffer;
+ /**
+ * Allocates a new buffer of {size} octets.
+ *
+ * @param size count of octets to allocate.
+ * @deprecated since v10.0.0 - Use `Buffer.alloc()` instead (also see `Buffer.allocUnsafe()`).
+ */
+ new(size: number): Buffer;
+ /**
+ * Allocates a new buffer containing the given {array} of octets.
+ *
+ * @param array The octets to store.
+ * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead.
+ */
+ new(array: Uint8Array): Buffer;
+ /**
+ * Produces a Buffer backed by the same allocated memory as
+ * the given {ArrayBuffer}/{SharedArrayBuffer}.
+ *
+ * @param arrayBuffer The ArrayBuffer with which to share memory.
+ * @deprecated since v10.0.0 - Use `Buffer.from(arrayBuffer[, byteOffset[, length]])` instead.
+ */
+ new(arrayBuffer: ArrayBuffer | SharedArrayBuffer): Buffer;
+ /**
+ * Allocates a new buffer containing the given {array} of octets.
+ *
+ * @param array The octets to store.
+ * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead.
+ */
+ new(array: readonly any[]): Buffer;
+ /**
+ * Copies the passed {buffer} data onto a new {Buffer} instance.
+ *
+ * @param buffer The buffer to copy.
+ * @deprecated since v10.0.0 - Use `Buffer.from(buffer)` instead.
+ */
+ new(buffer: Buffer): Buffer;
+ /**
+ * Allocates a new `Buffer` using an `array` of bytes in the range `0` – `255`.
+ * Array entries outside that range will be truncated to fit into it.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * // Creates a new Buffer containing the UTF-8 bytes of the string 'buffer'.
+ * const buf = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]);
+ * ```
+ *
+ * A `TypeError` will be thrown if `array` is not an `Array` or another type
+ * appropriate for `Buffer.from()` variants.
+ *
+ * `Buffer.from(array)` and `Buffer.from(string)` may also use the internal`Buffer` pool like `Buffer.allocUnsafe()` does.
+ * @since v5.10.0
+ */
+ from(
+ arrayBuffer: WithImplicitCoercion<ArrayBuffer | SharedArrayBuffer>,
+ byteOffset?: number,
+ length?: number,
+ ): Buffer;
+ /**
+ * Creates a new Buffer using the passed {data}
+ * @param data data to create a new Buffer
+ */
+ from(data: Uint8Array | readonly number[]): Buffer;
+ from(data: WithImplicitCoercion<Uint8Array | readonly number[] | string>): Buffer;
+ /**
+ * Creates a new Buffer containing the given JavaScript string {str}.
+ * If provided, the {encoding} parameter identifies the character encoding.
+ * If not provided, {encoding} defaults to 'utf8'.
+ */
+ from(
+ str:
+ | WithImplicitCoercion<string>
+ | {
+ [Symbol.toPrimitive](hint: "string"): string;
+ },
+ encoding?: BufferEncoding,
+ ): Buffer;
+ /**
+ * Creates a new Buffer using the passed {data}
+ * @param values to create a new Buffer
+ */
+ of(...items: number[]): Buffer;
+ /**
+ * Returns `true` if `obj` is a `Buffer`, `false` otherwise.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * Buffer.isBuffer(Buffer.alloc(10)); // true
+ * Buffer.isBuffer(Buffer.from('foo')); // true
+ * Buffer.isBuffer('a string'); // false
+ * Buffer.isBuffer([]); // false
+ * Buffer.isBuffer(new Uint8Array(1024)); // false
+ * ```
+ * @since v0.1.101
+ */
+ isBuffer(obj: any): obj is Buffer;
+ /**
+ * Returns `true` if `encoding` is the name of a supported character encoding,
+ * or `false` otherwise.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * console.log(Buffer.isEncoding('utf8'));
+ * // Prints: true
+ *
+ * console.log(Buffer.isEncoding('hex'));
+ * // Prints: true
+ *
+ * console.log(Buffer.isEncoding('utf/8'));
+ * // Prints: false
+ *
+ * console.log(Buffer.isEncoding(''));
+ * // Prints: false
+ * ```
+ * @since v0.9.1
+ * @param encoding A character encoding name to check.
+ */
+ isEncoding(encoding: string): encoding is BufferEncoding;
+ /**
+ * Returns the byte length of a string when encoded using `encoding`.
+ * This is not the same as [`String.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length), which does not account
+ * for the encoding that is used to convert the string into bytes.
+ *
+ * For `'base64'`, `'base64url'`, and `'hex'`, this function assumes valid input.
+ * For strings that contain non-base64/hex-encoded data (e.g. whitespace), the
+ * return value might be greater than the length of a `Buffer` created from the
+ * string.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const str = '\u00bd + \u00bc = \u00be';
+ *
+ * console.log(`${str}: ${str.length} characters, ` +
+ * `${Buffer.byteLength(str, 'utf8')} bytes`);
+ * // Prints: ½ + ¼ = ¾: 9 characters, 12 bytes
+ * ```
+ *
+ * When `string` is a
+ * `Buffer`/[`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView)/[`TypedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/-
+ * Reference/Global_Objects/TypedArray)/[`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)/[`SharedArrayBuffer`](https://develop-
+ * er.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer), the byte length as reported by `.byteLength`is returned.
+ * @since v0.1.90
+ * @param string A value to calculate the length of.
+ * @param [encoding='utf8'] If `string` is a string, this is its encoding.
+ * @return The number of bytes contained within `string`.
+ */
+ byteLength(
+ string: string | NodeJS.ArrayBufferView | ArrayBuffer | SharedArrayBuffer,
+ encoding?: BufferEncoding,
+ ): number;
+ /**
+ * Returns a new `Buffer` which is the result of concatenating all the `Buffer`instances in the `list` together.
+ *
+ * If the list has no items, or if the `totalLength` is 0, then a new zero-length`Buffer` is returned.
+ *
+ * If `totalLength` is not provided, it is calculated from the `Buffer` instances
+ * in `list` by adding their lengths.
+ *
+ * If `totalLength` is provided, it is coerced to an unsigned integer. If the
+ * combined length of the `Buffer`s in `list` exceeds `totalLength`, the result is
+ * truncated to `totalLength`.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * // Create a single `Buffer` from a list of three `Buffer` instances.
+ *
+ * const buf1 = Buffer.alloc(10);
+ * const buf2 = Buffer.alloc(14);
+ * const buf3 = Buffer.alloc(18);
+ * const totalLength = buf1.length + buf2.length + buf3.length;
+ *
+ * console.log(totalLength);
+ * // Prints: 42
+ *
+ * const bufA = Buffer.concat([buf1, buf2, buf3], totalLength);
+ *
+ * console.log(bufA);
+ * // Prints: <Buffer 00 00 00 00 ...>
+ * console.log(bufA.length);
+ * // Prints: 42
+ * ```
+ *
+ * `Buffer.concat()` may also use the internal `Buffer` pool like `Buffer.allocUnsafe()` does.
+ * @since v0.7.11
+ * @param list List of `Buffer` or {@link Uint8Array} instances to concatenate.
+ * @param totalLength Total length of the `Buffer` instances in `list` when concatenated.
+ */
+ concat(list: readonly Uint8Array[], totalLength?: number): Buffer;
+ /**
+ * Copies the underlying memory of `view` into a new `Buffer`.
+ * @since v18.16.0
+ * @param view The `TypedArray` to copy.
+ * @param offset The starting offset within `view`.
+ * @param length The number of elements from `view` to copy.
+ */
+ copyBytesFrom(view: NodeJS.TypedArray, offset?: number, length?: number): Buffer;
+ /**
+ * Compares `buf1` to `buf2`, typically for the purpose of sorting arrays of`Buffer` instances. This is equivalent to calling `buf1.compare(buf2)`.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf1 = Buffer.from('1234');
+ * const buf2 = Buffer.from('0123');
+ * const arr = [buf1, buf2];
+ *
+ * console.log(arr.sort(Buffer.compare));
+ * // Prints: [ <Buffer 30 31 32 33>, <Buffer 31 32 33 34> ]
+ * // (This result is equal to: [buf2, buf1].)
+ * ```
+ * @since v0.11.13
+ * @return Either `-1`, `0`, or `1`, depending on the result of the comparison. See `compare` for details.
+ */
+ compare(buf1: Uint8Array, buf2: Uint8Array): -1 | 0 | 1;
+ /**
+ * Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the`Buffer` will be zero-filled.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.alloc(5);
+ *
+ * console.log(buf);
+ * // Prints: <Buffer 00 00 00 00 00>
+ * ```
+ *
+ * If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_INVALID_ARG_VALUE` is thrown.
+ *
+ * If `fill` is specified, the allocated `Buffer` will be initialized by calling `buf.fill(fill)`.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.alloc(5, 'a');
+ *
+ * console.log(buf);
+ * // Prints: <Buffer 61 61 61 61 61>
+ * ```
+ *
+ * If both `fill` and `encoding` are specified, the allocated `Buffer` will be
+ * initialized by calling `buf.fill(fill, encoding)`.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64');
+ *
+ * console.log(buf);
+ * // Prints: <Buffer 68 65 6c 6c 6f 20 77 6f 72 6c 64>
+ * ```
+ *
+ * Calling `Buffer.alloc()` can be measurably slower than the alternative `Buffer.allocUnsafe()` but ensures that the newly created `Buffer` instance
+ * contents will never contain sensitive data from previous allocations, including
+ * data that might not have been allocated for `Buffer`s.
+ *
+ * A `TypeError` will be thrown if `size` is not a number.
+ * @since v5.10.0
+ * @param size The desired length of the new `Buffer`.
+ * @param [fill=0] A value to pre-fill the new `Buffer` with.
+ * @param [encoding='utf8'] If `fill` is a string, this is its encoding.
+ */
+ alloc(size: number, fill?: string | Uint8Array | number, encoding?: BufferEncoding): Buffer;
+ /**
+ * Allocates a new `Buffer` of `size` bytes. If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_INVALID_ARG_VALUE` is thrown.
+ *
+ * The underlying memory for `Buffer` instances created in this way is _not_
+ * _initialized_. The contents of the newly created `Buffer` are unknown and _may contain sensitive data_. Use `Buffer.alloc()` instead to initialize`Buffer` instances with zeroes.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(10);
+ *
+ * console.log(buf);
+ * // Prints (contents may vary): <Buffer a0 8b 28 3f 01 00 00 00 50 32>
+ *
+ * buf.fill(0);
+ *
+ * console.log(buf);
+ * // Prints: <Buffer 00 00 00 00 00 00 00 00 00 00>
+ * ```
+ *
+ * A `TypeError` will be thrown if `size` is not a number.
+ *
+ * The `Buffer` module pre-allocates an internal `Buffer` instance of
+ * size `Buffer.poolSize` that is used as a pool for the fast allocation of new`Buffer` instances created using `Buffer.allocUnsafe()`,`Buffer.from(array)`, `Buffer.concat()`, and the
+ * deprecated`new Buffer(size)` constructor only when `size` is less than or equal
+ * to `Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two).
+ *
+ * Use of this pre-allocated internal memory pool is a key difference between
+ * calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`.
+ * Specifically, `Buffer.alloc(size, fill)` will _never_ use the internal `Buffer`pool, while `Buffer.allocUnsafe(size).fill(fill)`_will_ use the internal`Buffer` pool if `size` is less
+ * than or equal to half `Buffer.poolSize`. The
+ * difference is subtle but can be important when an application requires the
+ * additional performance that `Buffer.allocUnsafe()` provides.
+ * @since v5.10.0
+ * @param size The desired length of the new `Buffer`.
+ */
+ allocUnsafe(size: number): Buffer;
+ /**
+ * Allocates a new `Buffer` of `size` bytes. If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_INVALID_ARG_VALUE` is thrown. A zero-length `Buffer` is created
+ * if `size` is 0.
+ *
+ * The underlying memory for `Buffer` instances created in this way is _not_
+ * _initialized_. The contents of the newly created `Buffer` are unknown and _may contain sensitive data_. Use `buf.fill(0)` to initialize
+ * such `Buffer` instances with zeroes.
+ *
+ * When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances,
+ * allocations under 4 KB are sliced from a single pre-allocated `Buffer`. This
+ * allows applications to avoid the garbage collection overhead of creating many
+ * individually allocated `Buffer` instances. This approach improves both
+ * performance and memory usage by eliminating the need to track and clean up as
+ * many individual `ArrayBuffer` objects.
+ *
+ * However, in the case where a developer may need to retain a small chunk of
+ * memory from a pool for an indeterminate amount of time, it may be appropriate
+ * to create an un-pooled `Buffer` instance using `Buffer.allocUnsafeSlow()` and
+ * then copying out the relevant bits.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * // Need to keep around a few small chunks of memory.
+ * const store = [];
+ *
+ * socket.on('readable', () => {
+ * let data;
+ * while (null !== (data = readable.read())) {
+ * // Allocate for retained data.
+ * const sb = Buffer.allocUnsafeSlow(10);
+ *
+ * // Copy the data into the new allocation.
+ * data.copy(sb, 0, 0, 10);
+ *
+ * store.push(sb);
+ * }
+ * });
+ * ```
+ *
+ * A `TypeError` will be thrown if `size` is not a number.
+ * @since v5.12.0
+ * @param size The desired length of the new `Buffer`.
+ */
+ allocUnsafeSlow(size: number): Buffer;
+ /**
+ * This is the size (in bytes) of pre-allocated internal `Buffer` instances used
+ * for pooling. This value may be modified.
+ * @since v0.11.3
+ */
+ poolSize: number;
+ }
+ interface Buffer extends Uint8Array {
+ /**
+ * Writes `string` to `buf` at `offset` according to the character encoding in`encoding`. The `length` parameter is the number of bytes to write. If `buf` did
+ * not contain enough space to fit the entire string, only part of `string` will be
+ * written. However, partially encoded characters will not be written.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.alloc(256);
+ *
+ * const len = buf.write('\u00bd + \u00bc = \u00be', 0);
+ *
+ * console.log(`${len} bytes: ${buf.toString('utf8', 0, len)}`);
+ * // Prints: 12 bytes: ½ + ¼ = ¾
+ *
+ * const buffer = Buffer.alloc(10);
+ *
+ * const length = buffer.write('abcd', 8);
+ *
+ * console.log(`${length} bytes: ${buffer.toString('utf8', 8, 10)}`);
+ * // Prints: 2 bytes : ab
+ * ```
+ * @since v0.1.90
+ * @param string String to write to `buf`.
+ * @param [offset=0] Number of bytes to skip before starting to write `string`.
+ * @param [length=buf.length - offset] Maximum number of bytes to write (written bytes will not exceed `buf.length - offset`).
+ * @param [encoding='utf8'] The character encoding of `string`.
+ * @return Number of bytes written.
+ */
+ write(string: string, encoding?: BufferEncoding): number;
+ write(string: string, offset: number, encoding?: BufferEncoding): number;
+ write(string: string, offset: number, length: number, encoding?: BufferEncoding): number;
+ /**
+ * Decodes `buf` to a string according to the specified character encoding in`encoding`. `start` and `end` may be passed to decode only a subset of `buf`.
+ *
+ * If `encoding` is `'utf8'` and a byte sequence in the input is not valid UTF-8,
+ * then each invalid byte is replaced with the replacement character `U+FFFD`.
+ *
+ * The maximum length of a string instance (in UTF-16 code units) is available
+ * as {@link constants.MAX_STRING_LENGTH}.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf1 = Buffer.allocUnsafe(26);
+ *
+ * for (let i = 0; i < 26; i++) {
+ * // 97 is the decimal ASCII value for 'a'.
+ * buf1[i] = i + 97;
+ * }
+ *
+ * console.log(buf1.toString('utf8'));
+ * // Prints: abcdefghijklmnopqrstuvwxyz
+ * console.log(buf1.toString('utf8', 0, 5));
+ * // Prints: abcde
+ *
+ * const buf2 = Buffer.from('tést');
+ *
+ * console.log(buf2.toString('hex'));
+ * // Prints: 74c3a97374
+ * console.log(buf2.toString('utf8', 0, 3));
+ * // Prints: té
+ * console.log(buf2.toString(undefined, 0, 3));
+ * // Prints: té
+ * ```
+ * @since v0.1.90
+ * @param [encoding='utf8'] The character encoding to use.
+ * @param [start=0] The byte offset to start decoding at.
+ * @param [end=buf.length] The byte offset to stop decoding at (not inclusive).
+ */
+ toString(encoding?: BufferEncoding, start?: number, end?: number): string;
+ /**
+ * Returns a JSON representation of `buf`. [`JSON.stringify()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) implicitly calls
+ * this function when stringifying a `Buffer` instance.
+ *
+ * `Buffer.from()` accepts objects in the format returned from this method.
+ * In particular, `Buffer.from(buf.toJSON())` works like `Buffer.from(buf)`.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5]);
+ * const json = JSON.stringify(buf);
+ *
+ * console.log(json);
+ * // Prints: {"type":"Buffer","data":[1,2,3,4,5]}
+ *
+ * const copy = JSON.parse(json, (key, value) => {
+ * return value &#x26;&#x26; value.type === 'Buffer' ?
+ * Buffer.from(value) :
+ * value;
+ * });
+ *
+ * console.log(copy);
+ * // Prints: <Buffer 01 02 03 04 05>
+ * ```
+ * @since v0.9.2
+ */
+ toJSON(): {
+ type: "Buffer";
+ data: number[];
+ };
+ /**
+ * Returns `true` if both `buf` and `otherBuffer` have exactly the same bytes,`false` otherwise. Equivalent to `buf.compare(otherBuffer) === 0`.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf1 = Buffer.from('ABC');
+ * const buf2 = Buffer.from('414243', 'hex');
+ * const buf3 = Buffer.from('ABCD');
+ *
+ * console.log(buf1.equals(buf2));
+ * // Prints: true
+ * console.log(buf1.equals(buf3));
+ * // Prints: false
+ * ```
+ * @since v0.11.13
+ * @param otherBuffer A `Buffer` or {@link Uint8Array} with which to compare `buf`.
+ */
+ equals(otherBuffer: Uint8Array): boolean;
+ /**
+ * Compares `buf` with `target` and returns a number indicating whether `buf`comes before, after, or is the same as `target` in sort order.
+ * Comparison is based on the actual sequence of bytes in each `Buffer`.
+ *
+ * * `0` is returned if `target` is the same as `buf`
+ * * `1` is returned if `target` should come _before_`buf` when sorted.
+ * * `-1` is returned if `target` should come _after_`buf` when sorted.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf1 = Buffer.from('ABC');
+ * const buf2 = Buffer.from('BCD');
+ * const buf3 = Buffer.from('ABCD');
+ *
+ * console.log(buf1.compare(buf1));
+ * // Prints: 0
+ * console.log(buf1.compare(buf2));
+ * // Prints: -1
+ * console.log(buf1.compare(buf3));
+ * // Prints: -1
+ * console.log(buf2.compare(buf1));
+ * // Prints: 1
+ * console.log(buf2.compare(buf3));
+ * // Prints: 1
+ * console.log([buf1, buf2, buf3].sort(Buffer.compare));
+ * // Prints: [ <Buffer 41 42 43>, <Buffer 41 42 43 44>, <Buffer 42 43 44> ]
+ * // (This result is equal to: [buf1, buf3, buf2].)
+ * ```
+ *
+ * The optional `targetStart`, `targetEnd`, `sourceStart`, and `sourceEnd`arguments can be used to limit the comparison to specific ranges within `target`and `buf` respectively.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf1 = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8, 9]);
+ * const buf2 = Buffer.from([5, 6, 7, 8, 9, 1, 2, 3, 4]);
+ *
+ * console.log(buf1.compare(buf2, 5, 9, 0, 4));
+ * // Prints: 0
+ * console.log(buf1.compare(buf2, 0, 6, 4));
+ * // Prints: -1
+ * console.log(buf1.compare(buf2, 5, 6, 5));
+ * // Prints: 1
+ * ```
+ *
+ * `ERR_OUT_OF_RANGE` is thrown if `targetStart < 0`, `sourceStart < 0`,`targetEnd > target.byteLength`, or `sourceEnd > source.byteLength`.
+ * @since v0.11.13
+ * @param target A `Buffer` or {@link Uint8Array} with which to compare `buf`.
+ * @param [targetStart=0] The offset within `target` at which to begin comparison.
+ * @param [targetEnd=target.length] The offset within `target` at which to end comparison (not inclusive).
+ * @param [sourceStart=0] The offset within `buf` at which to begin comparison.
+ * @param [sourceEnd=buf.length] The offset within `buf` at which to end comparison (not inclusive).
+ */
+ compare(
+ target: Uint8Array,
+ targetStart?: number,
+ targetEnd?: number,
+ sourceStart?: number,
+ sourceEnd?: number,
+ ): -1 | 0 | 1;
+ /**
+ * Copies data from a region of `buf` to a region in `target`, even if the `target`memory region overlaps with `buf`.
+ *
+ * [`TypedArray.prototype.set()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) performs the same operation, and is available
+ * for all TypedArrays, including Node.js `Buffer`s, although it takes
+ * different function arguments.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * // Create two `Buffer` instances.
+ * const buf1 = Buffer.allocUnsafe(26);
+ * const buf2 = Buffer.allocUnsafe(26).fill('!');
+ *
+ * for (let i = 0; i < 26; i++) {
+ * // 97 is the decimal ASCII value for 'a'.
+ * buf1[i] = i + 97;
+ * }
+ *
+ * // Copy `buf1` bytes 16 through 19 into `buf2` starting at byte 8 of `buf2`.
+ * buf1.copy(buf2, 8, 16, 20);
+ * // This is equivalent to:
+ * // buf2.set(buf1.subarray(16, 20), 8);
+ *
+ * console.log(buf2.toString('ascii', 0, 25));
+ * // Prints: !!!!!!!!qrst!!!!!!!!!!!!!
+ * ```
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * // Create a `Buffer` and copy data from one region to an overlapping region
+ * // within the same `Buffer`.
+ *
+ * const buf = Buffer.allocUnsafe(26);
+ *
+ * for (let i = 0; i < 26; i++) {
+ * // 97 is the decimal ASCII value for 'a'.
+ * buf[i] = i + 97;
+ * }
+ *
+ * buf.copy(buf, 0, 4, 10);
+ *
+ * console.log(buf.toString());
+ * // Prints: efghijghijklmnopqrstuvwxyz
+ * ```
+ * @since v0.1.90
+ * @param target A `Buffer` or {@link Uint8Array} to copy into.
+ * @param [targetStart=0] The offset within `target` at which to begin writing.
+ * @param [sourceStart=0] The offset within `buf` from which to begin copying.
+ * @param [sourceEnd=buf.length] The offset within `buf` at which to stop copying (not inclusive).
+ * @return The number of bytes copied.
+ */
+ copy(target: Uint8Array, targetStart?: number, sourceStart?: number, sourceEnd?: number): number;
+ /**
+ * Returns a new `Buffer` that references the same memory as the original, but
+ * offset and cropped by the `start` and `end` indices.
+ *
+ * This method is not compatible with the `Uint8Array.prototype.slice()`,
+ * which is a superclass of `Buffer`. To copy the slice, use`Uint8Array.prototype.slice()`.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from('buffer');
+ *
+ * const copiedBuf = Uint8Array.prototype.slice.call(buf);
+ * copiedBuf[0]++;
+ * console.log(copiedBuf.toString());
+ * // Prints: cuffer
+ *
+ * console.log(buf.toString());
+ * // Prints: buffer
+ *
+ * // With buf.slice(), the original buffer is modified.
+ * const notReallyCopiedBuf = buf.slice();
+ * notReallyCopiedBuf[0]++;
+ * console.log(notReallyCopiedBuf.toString());
+ * // Prints: cuffer
+ * console.log(buf.toString());
+ * // Also prints: cuffer (!)
+ * ```
+ * @since v0.3.0
+ * @deprecated Use `subarray` instead.
+ * @param [start=0] Where the new `Buffer` will start.
+ * @param [end=buf.length] Where the new `Buffer` will end (not inclusive).
+ */
+ slice(start?: number, end?: number): Buffer;
+ /**
+ * Returns a new `Buffer` that references the same memory as the original, but
+ * offset and cropped by the `start` and `end` indices.
+ *
+ * Specifying `end` greater than `buf.length` will return the same result as
+ * that of `end` equal to `buf.length`.
+ *
+ * This method is inherited from [`TypedArray.prototype.subarray()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray).
+ *
+ * Modifying the new `Buffer` slice will modify the memory in the original `Buffer`because the allocated memory of the two objects overlap.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * // Create a `Buffer` with the ASCII alphabet, take a slice, and modify one byte
+ * // from the original `Buffer`.
+ *
+ * const buf1 = Buffer.allocUnsafe(26);
+ *
+ * for (let i = 0; i < 26; i++) {
+ * // 97 is the decimal ASCII value for 'a'.
+ * buf1[i] = i + 97;
+ * }
+ *
+ * const buf2 = buf1.subarray(0, 3);
+ *
+ * console.log(buf2.toString('ascii', 0, buf2.length));
+ * // Prints: abc
+ *
+ * buf1[0] = 33;
+ *
+ * console.log(buf2.toString('ascii', 0, buf2.length));
+ * // Prints: !bc
+ * ```
+ *
+ * Specifying negative indexes causes the slice to be generated relative to the
+ * end of `buf` rather than the beginning.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from('buffer');
+ *
+ * console.log(buf.subarray(-6, -1).toString());
+ * // Prints: buffe
+ * // (Equivalent to buf.subarray(0, 5).)
+ *
+ * console.log(buf.subarray(-6, -2).toString());
+ * // Prints: buff
+ * // (Equivalent to buf.subarray(0, 4).)
+ *
+ * console.log(buf.subarray(-5, -2).toString());
+ * // Prints: uff
+ * // (Equivalent to buf.subarray(1, 4).)
+ * ```
+ * @since v3.0.0
+ * @param [start=0] Where the new `Buffer` will start.
+ * @param [end=buf.length] Where the new `Buffer` will end (not inclusive).
+ */
+ subarray(start?: number, end?: number): Buffer;
+ /**
+ * Writes `value` to `buf` at the specified `offset` as big-endian.
+ *
+ * `value` is interpreted and written as a two's complement signed integer.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(8);
+ *
+ * buf.writeBigInt64BE(0x0102030405060708n, 0);
+ *
+ * console.log(buf);
+ * // Prints: <Buffer 01 02 03 04 05 06 07 08>
+ * ```
+ * @since v12.0.0, v10.20.0
+ * @param value Number to be written to `buf`.
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeBigInt64BE(value: bigint, offset?: number): number;
+ /**
+ * Writes `value` to `buf` at the specified `offset` as little-endian.
+ *
+ * `value` is interpreted and written as a two's complement signed integer.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(8);
+ *
+ * buf.writeBigInt64LE(0x0102030405060708n, 0);
+ *
+ * console.log(buf);
+ * // Prints: <Buffer 08 07 06 05 04 03 02 01>
+ * ```
+ * @since v12.0.0, v10.20.0
+ * @param value Number to be written to `buf`.
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeBigInt64LE(value: bigint, offset?: number): number;
+ /**
+ * Writes `value` to `buf` at the specified `offset` as big-endian.
+ *
+ * This function is also available under the `writeBigUint64BE` alias.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(8);
+ *
+ * buf.writeBigUInt64BE(0xdecafafecacefaden, 0);
+ *
+ * console.log(buf);
+ * // Prints: <Buffer de ca fa fe ca ce fa de>
+ * ```
+ * @since v12.0.0, v10.20.0
+ * @param value Number to be written to `buf`.
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeBigUInt64BE(value: bigint, offset?: number): number;
+ /**
+ * @alias Buffer.writeBigUInt64BE
+ * @since v14.10.0, v12.19.0
+ */
+ writeBigUint64BE(value: bigint, offset?: number): number;
+ /**
+ * Writes `value` to `buf` at the specified `offset` as little-endian
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(8);
+ *
+ * buf.writeBigUInt64LE(0xdecafafecacefaden, 0);
+ *
+ * console.log(buf);
+ * // Prints: <Buffer de fa ce ca fe fa ca de>
+ * ```
+ *
+ * This function is also available under the `writeBigUint64LE` alias.
+ * @since v12.0.0, v10.20.0
+ * @param value Number to be written to `buf`.
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeBigUInt64LE(value: bigint, offset?: number): number;
+ /**
+ * @alias Buffer.writeBigUInt64LE
+ * @since v14.10.0, v12.19.0
+ */
+ writeBigUint64LE(value: bigint, offset?: number): number;
+ /**
+ * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as little-endian. Supports up to 48 bits of accuracy. Behavior is undefined
+ * when `value` is anything other than an unsigned integer.
+ *
+ * This function is also available under the `writeUintLE` alias.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(6);
+ *
+ * buf.writeUIntLE(0x1234567890ab, 0, 6);
+ *
+ * console.log(buf);
+ * // Prints: <Buffer ab 90 78 56 34 12>
+ * ```
+ * @since v0.5.5
+ * @param value Number to be written to `buf`.
+ * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`.
+ * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeUIntLE(value: number, offset: number, byteLength: number): number;
+ /**
+ * @alias Buffer.writeUIntLE
+ * @since v14.9.0, v12.19.0
+ */
+ writeUintLE(value: number, offset: number, byteLength: number): number;
+ /**
+ * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as big-endian. Supports up to 48 bits of accuracy. Behavior is undefined
+ * when `value` is anything other than an unsigned integer.
+ *
+ * This function is also available under the `writeUintBE` alias.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(6);
+ *
+ * buf.writeUIntBE(0x1234567890ab, 0, 6);
+ *
+ * console.log(buf);
+ * // Prints: <Buffer 12 34 56 78 90 ab>
+ * ```
+ * @since v0.5.5
+ * @param value Number to be written to `buf`.
+ * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`.
+ * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeUIntBE(value: number, offset: number, byteLength: number): number;
+ /**
+ * @alias Buffer.writeUIntBE
+ * @since v14.9.0, v12.19.0
+ */
+ writeUintBE(value: number, offset: number, byteLength: number): number;
+ /**
+ * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as little-endian. Supports up to 48 bits of accuracy. Behavior is undefined
+ * when `value` is anything other than a signed integer.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(6);
+ *
+ * buf.writeIntLE(0x1234567890ab, 0, 6);
+ *
+ * console.log(buf);
+ * // Prints: <Buffer ab 90 78 56 34 12>
+ * ```
+ * @since v0.11.15
+ * @param value Number to be written to `buf`.
+ * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`.
+ * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeIntLE(value: number, offset: number, byteLength: number): number;
+ /**
+ * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as big-endian. Supports up to 48 bits of accuracy. Behavior is undefined when`value` is anything other than a
+ * signed integer.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(6);
+ *
+ * buf.writeIntBE(0x1234567890ab, 0, 6);
+ *
+ * console.log(buf);
+ * // Prints: <Buffer 12 34 56 78 90 ab>
+ * ```
+ * @since v0.11.15
+ * @param value Number to be written to `buf`.
+ * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`.
+ * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeIntBE(value: number, offset: number, byteLength: number): number;
+ /**
+ * Reads an unsigned, big-endian 64-bit integer from `buf` at the specified`offset`.
+ *
+ * This function is also available under the `readBigUint64BE` alias.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]);
+ *
+ * console.log(buf.readBigUInt64BE(0));
+ * // Prints: 4294967295n
+ * ```
+ * @since v12.0.0, v10.20.0
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`.
+ */
+ readBigUInt64BE(offset?: number): bigint;
+ /**
+ * @alias Buffer.readBigUInt64BE
+ * @since v14.10.0, v12.19.0
+ */
+ readBigUint64BE(offset?: number): bigint;
+ /**
+ * Reads an unsigned, little-endian 64-bit integer from `buf` at the specified`offset`.
+ *
+ * This function is also available under the `readBigUint64LE` alias.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]);
+ *
+ * console.log(buf.readBigUInt64LE(0));
+ * // Prints: 18446744069414584320n
+ * ```
+ * @since v12.0.0, v10.20.0
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`.
+ */
+ readBigUInt64LE(offset?: number): bigint;
+ /**
+ * @alias Buffer.readBigUInt64LE
+ * @since v14.10.0, v12.19.0
+ */
+ readBigUint64LE(offset?: number): bigint;
+ /**
+ * Reads a signed, big-endian 64-bit integer from `buf` at the specified `offset`.
+ *
+ * Integers read from a `Buffer` are interpreted as two's complement signed
+ * values.
+ * @since v12.0.0, v10.20.0
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`.
+ */
+ readBigInt64BE(offset?: number): bigint;
+ /**
+ * Reads a signed, little-endian 64-bit integer from `buf` at the specified`offset`.
+ *
+ * Integers read from a `Buffer` are interpreted as two's complement signed
+ * values.
+ * @since v12.0.0, v10.20.0
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`.
+ */
+ readBigInt64LE(offset?: number): bigint;
+ /**
+ * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as an unsigned, little-endian integer supporting
+ * up to 48 bits of accuracy.
+ *
+ * This function is also available under the `readUintLE` alias.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);
+ *
+ * console.log(buf.readUIntLE(0, 6).toString(16));
+ * // Prints: ab9078563412
+ * ```
+ * @since v0.11.15
+ * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`.
+ * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`.
+ */
+ readUIntLE(offset: number, byteLength: number): number;
+ /**
+ * @alias Buffer.readUIntLE
+ * @since v14.9.0, v12.19.0
+ */
+ readUintLE(offset: number, byteLength: number): number;
+ /**
+ * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as an unsigned big-endian integer supporting
+ * up to 48 bits of accuracy.
+ *
+ * This function is also available under the `readUintBE` alias.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);
+ *
+ * console.log(buf.readUIntBE(0, 6).toString(16));
+ * // Prints: 1234567890ab
+ * console.log(buf.readUIntBE(1, 6).toString(16));
+ * // Throws ERR_OUT_OF_RANGE.
+ * ```
+ * @since v0.11.15
+ * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`.
+ * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`.
+ */
+ readUIntBE(offset: number, byteLength: number): number;
+ /**
+ * @alias Buffer.readUIntBE
+ * @since v14.9.0, v12.19.0
+ */
+ readUintBE(offset: number, byteLength: number): number;
+ /**
+ * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as a little-endian, two's complement signed value
+ * supporting up to 48 bits of accuracy.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);
+ *
+ * console.log(buf.readIntLE(0, 6).toString(16));
+ * // Prints: -546f87a9cbee
+ * ```
+ * @since v0.11.15
+ * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`.
+ * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`.
+ */
+ readIntLE(offset: number, byteLength: number): number;
+ /**
+ * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as a big-endian, two's complement signed value
+ * supporting up to 48 bits of accuracy.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);
+ *
+ * console.log(buf.readIntBE(0, 6).toString(16));
+ * // Prints: 1234567890ab
+ * console.log(buf.readIntBE(1, 6).toString(16));
+ * // Throws ERR_OUT_OF_RANGE.
+ * console.log(buf.readIntBE(1, 0).toString(16));
+ * // Throws ERR_OUT_OF_RANGE.
+ * ```
+ * @since v0.11.15
+ * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`.
+ * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`.
+ */
+ readIntBE(offset: number, byteLength: number): number;
+ /**
+ * Reads an unsigned 8-bit integer from `buf` at the specified `offset`.
+ *
+ * This function is also available under the `readUint8` alias.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([1, -2]);
+ *
+ * console.log(buf.readUInt8(0));
+ * // Prints: 1
+ * console.log(buf.readUInt8(1));
+ * // Prints: 254
+ * console.log(buf.readUInt8(2));
+ * // Throws ERR_OUT_OF_RANGE.
+ * ```
+ * @since v0.5.0
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 1`.
+ */
+ readUInt8(offset?: number): number;
+ /**
+ * @alias Buffer.readUInt8
+ * @since v14.9.0, v12.19.0
+ */
+ readUint8(offset?: number): number;
+ /**
+ * Reads an unsigned, little-endian 16-bit integer from `buf` at the specified`offset`.
+ *
+ * This function is also available under the `readUint16LE` alias.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([0x12, 0x34, 0x56]);
+ *
+ * console.log(buf.readUInt16LE(0).toString(16));
+ * // Prints: 3412
+ * console.log(buf.readUInt16LE(1).toString(16));
+ * // Prints: 5634
+ * console.log(buf.readUInt16LE(2).toString(16));
+ * // Throws ERR_OUT_OF_RANGE.
+ * ```
+ * @since v0.5.5
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`.
+ */
+ readUInt16LE(offset?: number): number;
+ /**
+ * @alias Buffer.readUInt16LE
+ * @since v14.9.0, v12.19.0
+ */
+ readUint16LE(offset?: number): number;
+ /**
+ * Reads an unsigned, big-endian 16-bit integer from `buf` at the specified`offset`.
+ *
+ * This function is also available under the `readUint16BE` alias.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([0x12, 0x34, 0x56]);
+ *
+ * console.log(buf.readUInt16BE(0).toString(16));
+ * // Prints: 1234
+ * console.log(buf.readUInt16BE(1).toString(16));
+ * // Prints: 3456
+ * ```
+ * @since v0.5.5
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`.
+ */
+ readUInt16BE(offset?: number): number;
+ /**
+ * @alias Buffer.readUInt16BE
+ * @since v14.9.0, v12.19.0
+ */
+ readUint16BE(offset?: number): number;
+ /**
+ * Reads an unsigned, little-endian 32-bit integer from `buf` at the specified`offset`.
+ *
+ * This function is also available under the `readUint32LE` alias.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]);
+ *
+ * console.log(buf.readUInt32LE(0).toString(16));
+ * // Prints: 78563412
+ * console.log(buf.readUInt32LE(1).toString(16));
+ * // Throws ERR_OUT_OF_RANGE.
+ * ```
+ * @since v0.5.5
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.
+ */
+ readUInt32LE(offset?: number): number;
+ /**
+ * @alias Buffer.readUInt32LE
+ * @since v14.9.0, v12.19.0
+ */
+ readUint32LE(offset?: number): number;
+ /**
+ * Reads an unsigned, big-endian 32-bit integer from `buf` at the specified`offset`.
+ *
+ * This function is also available under the `readUint32BE` alias.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]);
+ *
+ * console.log(buf.readUInt32BE(0).toString(16));
+ * // Prints: 12345678
+ * ```
+ * @since v0.5.5
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.
+ */
+ readUInt32BE(offset?: number): number;
+ /**
+ * @alias Buffer.readUInt32BE
+ * @since v14.9.0, v12.19.0
+ */
+ readUint32BE(offset?: number): number;
+ /**
+ * Reads a signed 8-bit integer from `buf` at the specified `offset`.
+ *
+ * Integers read from a `Buffer` are interpreted as two's complement signed values.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([-1, 5]);
+ *
+ * console.log(buf.readInt8(0));
+ * // Prints: -1
+ * console.log(buf.readInt8(1));
+ * // Prints: 5
+ * console.log(buf.readInt8(2));
+ * // Throws ERR_OUT_OF_RANGE.
+ * ```
+ * @since v0.5.0
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 1`.
+ */
+ readInt8(offset?: number): number;
+ /**
+ * Reads a signed, little-endian 16-bit integer from `buf` at the specified`offset`.
+ *
+ * Integers read from a `Buffer` are interpreted as two's complement signed values.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([0, 5]);
+ *
+ * console.log(buf.readInt16LE(0));
+ * // Prints: 1280
+ * console.log(buf.readInt16LE(1));
+ * // Throws ERR_OUT_OF_RANGE.
+ * ```
+ * @since v0.5.5
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`.
+ */
+ readInt16LE(offset?: number): number;
+ /**
+ * Reads a signed, big-endian 16-bit integer from `buf` at the specified `offset`.
+ *
+ * Integers read from a `Buffer` are interpreted as two's complement signed values.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([0, 5]);
+ *
+ * console.log(buf.readInt16BE(0));
+ * // Prints: 5
+ * ```
+ * @since v0.5.5
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`.
+ */
+ readInt16BE(offset?: number): number;
+ /**
+ * Reads a signed, little-endian 32-bit integer from `buf` at the specified`offset`.
+ *
+ * Integers read from a `Buffer` are interpreted as two's complement signed values.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([0, 0, 0, 5]);
+ *
+ * console.log(buf.readInt32LE(0));
+ * // Prints: 83886080
+ * console.log(buf.readInt32LE(1));
+ * // Throws ERR_OUT_OF_RANGE.
+ * ```
+ * @since v0.5.5
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.
+ */
+ readInt32LE(offset?: number): number;
+ /**
+ * Reads a signed, big-endian 32-bit integer from `buf` at the specified `offset`.
+ *
+ * Integers read from a `Buffer` are interpreted as two's complement signed values.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([0, 0, 0, 5]);
+ *
+ * console.log(buf.readInt32BE(0));
+ * // Prints: 5
+ * ```
+ * @since v0.5.5
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.
+ */
+ readInt32BE(offset?: number): number;
+ /**
+ * Reads a 32-bit, little-endian float from `buf` at the specified `offset`.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([1, 2, 3, 4]);
+ *
+ * console.log(buf.readFloatLE(0));
+ * // Prints: 1.539989614439558e-36
+ * console.log(buf.readFloatLE(1));
+ * // Throws ERR_OUT_OF_RANGE.
+ * ```
+ * @since v0.11.15
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.
+ */
+ readFloatLE(offset?: number): number;
+ /**
+ * Reads a 32-bit, big-endian float from `buf` at the specified `offset`.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([1, 2, 3, 4]);
+ *
+ * console.log(buf.readFloatBE(0));
+ * // Prints: 2.387939260590663e-38
+ * ```
+ * @since v0.11.15
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.
+ */
+ readFloatBE(offset?: number): number;
+ /**
+ * Reads a 64-bit, little-endian double from `buf` at the specified `offset`.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]);
+ *
+ * console.log(buf.readDoubleLE(0));
+ * // Prints: 5.447603722011605e-270
+ * console.log(buf.readDoubleLE(1));
+ * // Throws ERR_OUT_OF_RANGE.
+ * ```
+ * @since v0.11.15
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 8`.
+ */
+ readDoubleLE(offset?: number): number;
+ /**
+ * Reads a 64-bit, big-endian double from `buf` at the specified `offset`.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]);
+ *
+ * console.log(buf.readDoubleBE(0));
+ * // Prints: 8.20788039913184e-304
+ * ```
+ * @since v0.11.15
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 8`.
+ */
+ readDoubleBE(offset?: number): number;
+ reverse(): this;
+ /**
+ * Interprets `buf` as an array of unsigned 16-bit integers and swaps the
+ * byte order _in-place_. Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 2.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]);
+ *
+ * console.log(buf1);
+ * // Prints: <Buffer 01 02 03 04 05 06 07 08>
+ *
+ * buf1.swap16();
+ *
+ * console.log(buf1);
+ * // Prints: <Buffer 02 01 04 03 06 05 08 07>
+ *
+ * const buf2 = Buffer.from([0x1, 0x2, 0x3]);
+ *
+ * buf2.swap16();
+ * // Throws ERR_INVALID_BUFFER_SIZE.
+ * ```
+ *
+ * One convenient use of `buf.swap16()` is to perform a fast in-place conversion
+ * between UTF-16 little-endian and UTF-16 big-endian:
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from('This is little-endian UTF-16', 'utf16le');
+ * buf.swap16(); // Convert to big-endian UTF-16 text.
+ * ```
+ * @since v5.10.0
+ * @return A reference to `buf`.
+ */
+ swap16(): Buffer;
+ /**
+ * Interprets `buf` as an array of unsigned 32-bit integers and swaps the
+ * byte order _in-place_. Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 4.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]);
+ *
+ * console.log(buf1);
+ * // Prints: <Buffer 01 02 03 04 05 06 07 08>
+ *
+ * buf1.swap32();
+ *
+ * console.log(buf1);
+ * // Prints: <Buffer 04 03 02 01 08 07 06 05>
+ *
+ * const buf2 = Buffer.from([0x1, 0x2, 0x3]);
+ *
+ * buf2.swap32();
+ * // Throws ERR_INVALID_BUFFER_SIZE.
+ * ```
+ * @since v5.10.0
+ * @return A reference to `buf`.
+ */
+ swap32(): Buffer;
+ /**
+ * Interprets `buf` as an array of 64-bit numbers and swaps byte order _in-place_.
+ * Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 8.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]);
+ *
+ * console.log(buf1);
+ * // Prints: <Buffer 01 02 03 04 05 06 07 08>
+ *
+ * buf1.swap64();
+ *
+ * console.log(buf1);
+ * // Prints: <Buffer 08 07 06 05 04 03 02 01>
+ *
+ * const buf2 = Buffer.from([0x1, 0x2, 0x3]);
+ *
+ * buf2.swap64();
+ * // Throws ERR_INVALID_BUFFER_SIZE.
+ * ```
+ * @since v6.3.0
+ * @return A reference to `buf`.
+ */
+ swap64(): Buffer;
+ /**
+ * Writes `value` to `buf` at the specified `offset`. `value` must be a
+ * valid unsigned 8-bit integer. Behavior is undefined when `value` is anything
+ * other than an unsigned 8-bit integer.
+ *
+ * This function is also available under the `writeUint8` alias.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(4);
+ *
+ * buf.writeUInt8(0x3, 0);
+ * buf.writeUInt8(0x4, 1);
+ * buf.writeUInt8(0x23, 2);
+ * buf.writeUInt8(0x42, 3);
+ *
+ * console.log(buf);
+ * // Prints: <Buffer 03 04 23 42>
+ * ```
+ * @since v0.5.0
+ * @param value Number to be written to `buf`.
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 1`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeUInt8(value: number, offset?: number): number;
+ /**
+ * @alias Buffer.writeUInt8
+ * @since v14.9.0, v12.19.0
+ */
+ writeUint8(value: number, offset?: number): number;
+ /**
+ * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid unsigned 16-bit integer. Behavior is undefined when `value` is
+ * anything other than an unsigned 16-bit integer.
+ *
+ * This function is also available under the `writeUint16LE` alias.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(4);
+ *
+ * buf.writeUInt16LE(0xdead, 0);
+ * buf.writeUInt16LE(0xbeef, 2);
+ *
+ * console.log(buf);
+ * // Prints: <Buffer ad de ef be>
+ * ```
+ * @since v0.5.5
+ * @param value Number to be written to `buf`.
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeUInt16LE(value: number, offset?: number): number;
+ /**
+ * @alias Buffer.writeUInt16LE
+ * @since v14.9.0, v12.19.0
+ */
+ writeUint16LE(value: number, offset?: number): number;
+ /**
+ * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid unsigned 16-bit integer. Behavior is undefined when `value`is anything other than an
+ * unsigned 16-bit integer.
+ *
+ * This function is also available under the `writeUint16BE` alias.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(4);
+ *
+ * buf.writeUInt16BE(0xdead, 0);
+ * buf.writeUInt16BE(0xbeef, 2);
+ *
+ * console.log(buf);
+ * // Prints: <Buffer de ad be ef>
+ * ```
+ * @since v0.5.5
+ * @param value Number to be written to `buf`.
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeUInt16BE(value: number, offset?: number): number;
+ /**
+ * @alias Buffer.writeUInt16BE
+ * @since v14.9.0, v12.19.0
+ */
+ writeUint16BE(value: number, offset?: number): number;
+ /**
+ * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid unsigned 32-bit integer. Behavior is undefined when `value` is
+ * anything other than an unsigned 32-bit integer.
+ *
+ * This function is also available under the `writeUint32LE` alias.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(4);
+ *
+ * buf.writeUInt32LE(0xfeedface, 0);
+ *
+ * console.log(buf);
+ * // Prints: <Buffer ce fa ed fe>
+ * ```
+ * @since v0.5.5
+ * @param value Number to be written to `buf`.
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeUInt32LE(value: number, offset?: number): number;
+ /**
+ * @alias Buffer.writeUInt32LE
+ * @since v14.9.0, v12.19.0
+ */
+ writeUint32LE(value: number, offset?: number): number;
+ /**
+ * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid unsigned 32-bit integer. Behavior is undefined when `value`is anything other than an
+ * unsigned 32-bit integer.
+ *
+ * This function is also available under the `writeUint32BE` alias.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(4);
+ *
+ * buf.writeUInt32BE(0xfeedface, 0);
+ *
+ * console.log(buf);
+ * // Prints: <Buffer fe ed fa ce>
+ * ```
+ * @since v0.5.5
+ * @param value Number to be written to `buf`.
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeUInt32BE(value: number, offset?: number): number;
+ /**
+ * @alias Buffer.writeUInt32BE
+ * @since v14.9.0, v12.19.0
+ */
+ writeUint32BE(value: number, offset?: number): number;
+ /**
+ * Writes `value` to `buf` at the specified `offset`. `value` must be a valid
+ * signed 8-bit integer. Behavior is undefined when `value` is anything other than
+ * a signed 8-bit integer.
+ *
+ * `value` is interpreted and written as a two's complement signed integer.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(2);
+ *
+ * buf.writeInt8(2, 0);
+ * buf.writeInt8(-2, 1);
+ *
+ * console.log(buf);
+ * // Prints: <Buffer 02 fe>
+ * ```
+ * @since v0.5.0
+ * @param value Number to be written to `buf`.
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 1`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeInt8(value: number, offset?: number): number;
+ /**
+ * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid signed 16-bit integer. Behavior is undefined when `value` is
+ * anything other than a signed 16-bit integer.
+ *
+ * The `value` is interpreted and written as a two's complement signed integer.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(2);
+ *
+ * buf.writeInt16LE(0x0304, 0);
+ *
+ * console.log(buf);
+ * // Prints: <Buffer 04 03>
+ * ```
+ * @since v0.5.5
+ * @param value Number to be written to `buf`.
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeInt16LE(value: number, offset?: number): number;
+ /**
+ * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid signed 16-bit integer. Behavior is undefined when `value` is
+ * anything other than a signed 16-bit integer.
+ *
+ * The `value` is interpreted and written as a two's complement signed integer.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(2);
+ *
+ * buf.writeInt16BE(0x0102, 0);
+ *
+ * console.log(buf);
+ * // Prints: <Buffer 01 02>
+ * ```
+ * @since v0.5.5
+ * @param value Number to be written to `buf`.
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeInt16BE(value: number, offset?: number): number;
+ /**
+ * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid signed 32-bit integer. Behavior is undefined when `value` is
+ * anything other than a signed 32-bit integer.
+ *
+ * The `value` is interpreted and written as a two's complement signed integer.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(4);
+ *
+ * buf.writeInt32LE(0x05060708, 0);
+ *
+ * console.log(buf);
+ * // Prints: <Buffer 08 07 06 05>
+ * ```
+ * @since v0.5.5
+ * @param value Number to be written to `buf`.
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeInt32LE(value: number, offset?: number): number;
+ /**
+ * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid signed 32-bit integer. Behavior is undefined when `value` is
+ * anything other than a signed 32-bit integer.
+ *
+ * The `value` is interpreted and written as a two's complement signed integer.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(4);
+ *
+ * buf.writeInt32BE(0x01020304, 0);
+ *
+ * console.log(buf);
+ * // Prints: <Buffer 01 02 03 04>
+ * ```
+ * @since v0.5.5
+ * @param value Number to be written to `buf`.
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeInt32BE(value: number, offset?: number): number;
+ /**
+ * Writes `value` to `buf` at the specified `offset` as little-endian. Behavior is
+ * undefined when `value` is anything other than a JavaScript number.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(4);
+ *
+ * buf.writeFloatLE(0xcafebabe, 0);
+ *
+ * console.log(buf);
+ * // Prints: <Buffer bb fe 4a 4f>
+ * ```
+ * @since v0.11.15
+ * @param value Number to be written to `buf`.
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeFloatLE(value: number, offset?: number): number;
+ /**
+ * Writes `value` to `buf` at the specified `offset` as big-endian. Behavior is
+ * undefined when `value` is anything other than a JavaScript number.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(4);
+ *
+ * buf.writeFloatBE(0xcafebabe, 0);
+ *
+ * console.log(buf);
+ * // Prints: <Buffer 4f 4a fe bb>
+ * ```
+ * @since v0.11.15
+ * @param value Number to be written to `buf`.
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeFloatBE(value: number, offset?: number): number;
+ /**
+ * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a JavaScript number. Behavior is undefined when `value` is anything
+ * other than a JavaScript number.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(8);
+ *
+ * buf.writeDoubleLE(123.456, 0);
+ *
+ * console.log(buf);
+ * // Prints: <Buffer 77 be 9f 1a 2f dd 5e 40>
+ * ```
+ * @since v0.11.15
+ * @param value Number to be written to `buf`.
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 8`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeDoubleLE(value: number, offset?: number): number;
+ /**
+ * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a JavaScript number. Behavior is undefined when `value` is anything
+ * other than a JavaScript number.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(8);
+ *
+ * buf.writeDoubleBE(123.456, 0);
+ *
+ * console.log(buf);
+ * // Prints: <Buffer 40 5e dd 2f 1a 9f be 77>
+ * ```
+ * @since v0.11.15
+ * @param value Number to be written to `buf`.
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 8`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeDoubleBE(value: number, offset?: number): number;
+ /**
+ * Fills `buf` with the specified `value`. If the `offset` and `end` are not given,
+ * the entire `buf` will be filled:
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * // Fill a `Buffer` with the ASCII character 'h'.
+ *
+ * const b = Buffer.allocUnsafe(50).fill('h');
+ *
+ * console.log(b.toString());
+ * // Prints: hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
+ * ```
+ *
+ * `value` is coerced to a `uint32` value if it is not a string, `Buffer`, or
+ * integer. If the resulting integer is greater than `255` (decimal), `buf` will be
+ * filled with `value &#x26; 255`.
+ *
+ * If the final write of a `fill()` operation falls on a multi-byte character,
+ * then only the bytes of that character that fit into `buf` are written:
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * // Fill a `Buffer` with character that takes up two bytes in UTF-8.
+ *
+ * console.log(Buffer.allocUnsafe(5).fill('\u0222'));
+ * // Prints: <Buffer c8 a2 c8 a2 c8>
+ * ```
+ *
+ * If `value` contains invalid characters, it is truncated; if no valid
+ * fill data remains, an exception is thrown:
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(5);
+ *
+ * console.log(buf.fill('a'));
+ * // Prints: <Buffer 61 61 61 61 61>
+ * console.log(buf.fill('aazz', 'hex'));
+ * // Prints: <Buffer aa aa aa aa aa>
+ * console.log(buf.fill('zz', 'hex'));
+ * // Throws an exception.
+ * ```
+ * @since v0.5.0
+ * @param value The value with which to fill `buf`.
+ * @param [offset=0] Number of bytes to skip before starting to fill `buf`.
+ * @param [end=buf.length] Where to stop filling `buf` (not inclusive).
+ * @param [encoding='utf8'] The encoding for `value` if `value` is a string.
+ * @return A reference to `buf`.
+ */
+ fill(value: string | Uint8Array | number, offset?: number, end?: number, encoding?: BufferEncoding): this;
+ /**
+ * If `value` is:
+ *
+ * * a string, `value` is interpreted according to the character encoding in`encoding`.
+ * * a `Buffer` or [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array), `value` will be used in its entirety.
+ * To compare a partial `Buffer`, use `buf.subarray`.
+ * * a number, `value` will be interpreted as an unsigned 8-bit integer
+ * value between `0` and `255`.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from('this is a buffer');
+ *
+ * console.log(buf.indexOf('this'));
+ * // Prints: 0
+ * console.log(buf.indexOf('is'));
+ * // Prints: 2
+ * console.log(buf.indexOf(Buffer.from('a buffer')));
+ * // Prints: 8
+ * console.log(buf.indexOf(97));
+ * // Prints: 8 (97 is the decimal ASCII value for 'a')
+ * console.log(buf.indexOf(Buffer.from('a buffer example')));
+ * // Prints: -1
+ * console.log(buf.indexOf(Buffer.from('a buffer example').slice(0, 8)));
+ * // Prints: 8
+ *
+ * const utf16Buffer = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'utf16le');
+ *
+ * console.log(utf16Buffer.indexOf('\u03a3', 0, 'utf16le'));
+ * // Prints: 4
+ * console.log(utf16Buffer.indexOf('\u03a3', -4, 'utf16le'));
+ * // Prints: 6
+ * ```
+ *
+ * If `value` is not a string, number, or `Buffer`, this method will throw a`TypeError`. If `value` is a number, it will be coerced to a valid byte value,
+ * an integer between 0 and 255.
+ *
+ * If `byteOffset` is not a number, it will be coerced to a number. If the result
+ * of coercion is `NaN` or `0`, then the entire buffer will be searched. This
+ * behavior matches [`String.prototype.indexOf()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf).
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const b = Buffer.from('abcdef');
+ *
+ * // Passing a value that's a number, but not a valid byte.
+ * // Prints: 2, equivalent to searching for 99 or 'c'.
+ * console.log(b.indexOf(99.9));
+ * console.log(b.indexOf(256 + 99));
+ *
+ * // Passing a byteOffset that coerces to NaN or 0.
+ * // Prints: 1, searching the whole buffer.
+ * console.log(b.indexOf('b', undefined));
+ * console.log(b.indexOf('b', {}));
+ * console.log(b.indexOf('b', null));
+ * console.log(b.indexOf('b', []));
+ * ```
+ *
+ * If `value` is an empty string or empty `Buffer` and `byteOffset` is less
+ * than `buf.length`, `byteOffset` will be returned. If `value` is empty and`byteOffset` is at least `buf.length`, `buf.length` will be returned.
+ * @since v1.5.0
+ * @param value What to search for.
+ * @param [byteOffset=0] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`.
+ * @param [encoding='utf8'] If `value` is a string, this is the encoding used to determine the binary representation of the string that will be searched for in `buf`.
+ * @return The index of the first occurrence of `value` in `buf`, or `-1` if `buf` does not contain `value`.
+ */
+ indexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number;
+ /**
+ * Identical to `buf.indexOf()`, except the last occurrence of `value` is found
+ * rather than the first occurrence.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from('this buffer is a buffer');
+ *
+ * console.log(buf.lastIndexOf('this'));
+ * // Prints: 0
+ * console.log(buf.lastIndexOf('buffer'));
+ * // Prints: 17
+ * console.log(buf.lastIndexOf(Buffer.from('buffer')));
+ * // Prints: 17
+ * console.log(buf.lastIndexOf(97));
+ * // Prints: 15 (97 is the decimal ASCII value for 'a')
+ * console.log(buf.lastIndexOf(Buffer.from('yolo')));
+ * // Prints: -1
+ * console.log(buf.lastIndexOf('buffer', 5));
+ * // Prints: 5
+ * console.log(buf.lastIndexOf('buffer', 4));
+ * // Prints: -1
+ *
+ * const utf16Buffer = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'utf16le');
+ *
+ * console.log(utf16Buffer.lastIndexOf('\u03a3', undefined, 'utf16le'));
+ * // Prints: 6
+ * console.log(utf16Buffer.lastIndexOf('\u03a3', -5, 'utf16le'));
+ * // Prints: 4
+ * ```
+ *
+ * If `value` is not a string, number, or `Buffer`, this method will throw a`TypeError`. If `value` is a number, it will be coerced to a valid byte value,
+ * an integer between 0 and 255.
+ *
+ * If `byteOffset` is not a number, it will be coerced to a number. Any arguments
+ * that coerce to `NaN`, like `{}` or `undefined`, will search the whole buffer.
+ * This behavior matches [`String.prototype.lastIndexOf()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf).
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const b = Buffer.from('abcdef');
+ *
+ * // Passing a value that's a number, but not a valid byte.
+ * // Prints: 2, equivalent to searching for 99 or 'c'.
+ * console.log(b.lastIndexOf(99.9));
+ * console.log(b.lastIndexOf(256 + 99));
+ *
+ * // Passing a byteOffset that coerces to NaN.
+ * // Prints: 1, searching the whole buffer.
+ * console.log(b.lastIndexOf('b', undefined));
+ * console.log(b.lastIndexOf('b', {}));
+ *
+ * // Passing a byteOffset that coerces to 0.
+ * // Prints: -1, equivalent to passing 0.
+ * console.log(b.lastIndexOf('b', null));
+ * console.log(b.lastIndexOf('b', []));
+ * ```
+ *
+ * If `value` is an empty string or empty `Buffer`, `byteOffset` will be returned.
+ * @since v6.0.0
+ * @param value What to search for.
+ * @param [byteOffset=buf.length - 1] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`.
+ * @param [encoding='utf8'] If `value` is a string, this is the encoding used to determine the binary representation of the string that will be searched for in `buf`.
+ * @return The index of the last occurrence of `value` in `buf`, or `-1` if `buf` does not contain `value`.
+ */
+ lastIndexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number;
+ /**
+ * Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) of `[index, byte]` pairs from the contents
+ * of `buf`.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * // Log the entire contents of a `Buffer`.
+ *
+ * const buf = Buffer.from('buffer');
+ *
+ * for (const pair of buf.entries()) {
+ * console.log(pair);
+ * }
+ * // Prints:
+ * // [0, 98]
+ * // [1, 117]
+ * // [2, 102]
+ * // [3, 102]
+ * // [4, 101]
+ * // [5, 114]
+ * ```
+ * @since v1.1.0
+ */
+ entries(): IterableIterator<[number, number]>;
+ /**
+ * Equivalent to `buf.indexOf() !== -1`.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from('this is a buffer');
+ *
+ * console.log(buf.includes('this'));
+ * // Prints: true
+ * console.log(buf.includes('is'));
+ * // Prints: true
+ * console.log(buf.includes(Buffer.from('a buffer')));
+ * // Prints: true
+ * console.log(buf.includes(97));
+ * // Prints: true (97 is the decimal ASCII value for 'a')
+ * console.log(buf.includes(Buffer.from('a buffer example')));
+ * // Prints: false
+ * console.log(buf.includes(Buffer.from('a buffer example').slice(0, 8)));
+ * // Prints: true
+ * console.log(buf.includes('this', 4));
+ * // Prints: false
+ * ```
+ * @since v5.3.0
+ * @param value What to search for.
+ * @param [byteOffset=0] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`.
+ * @param [encoding='utf8'] If `value` is a string, this is its encoding.
+ * @return `true` if `value` was found in `buf`, `false` otherwise.
+ */
+ includes(value: string | number | Buffer, byteOffset?: number, encoding?: BufferEncoding): boolean;
+ /**
+ * Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) of `buf` keys (indices).
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from('buffer');
+ *
+ * for (const key of buf.keys()) {
+ * console.log(key);
+ * }
+ * // Prints:
+ * // 0
+ * // 1
+ * // 2
+ * // 3
+ * // 4
+ * // 5
+ * ```
+ * @since v1.1.0
+ */
+ keys(): IterableIterator<number>;
+ /**
+ * Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) for `buf` values (bytes). This function is
+ * called automatically when a `Buffer` is used in a `for..of` statement.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from('buffer');
+ *
+ * for (const value of buf.values()) {
+ * console.log(value);
+ * }
+ * // Prints:
+ * // 98
+ * // 117
+ * // 102
+ * // 102
+ * // 101
+ * // 114
+ *
+ * for (const value of buf) {
+ * console.log(value);
+ * }
+ * // Prints:
+ * // 98
+ * // 117
+ * // 102
+ * // 102
+ * // 101
+ * // 114
+ * ```
+ * @since v1.1.0
+ */
+ values(): IterableIterator<number>;
+ }
+ var Buffer: BufferConstructor;
+ /**
+ * Decodes a string of Base64-encoded data into bytes, and encodes those bytes
+ * into a string using Latin-1 (ISO-8859-1).
+ *
+ * The `data` may be any JavaScript-value that can be coerced into a string.
+ *
+ * **This function is only provided for compatibility with legacy web platform APIs**
+ * **and should never be used in new code, because they use strings to represent**
+ * **binary data and predate the introduction of typed arrays in JavaScript.**
+ * **For code running using Node.js APIs, converting between base64-encoded strings**
+ * **and binary data should be performed using `Buffer.from(str, 'base64')` and`buf.toString('base64')`.**
+ * @since v15.13.0, v14.17.0
+ * @legacy Use `Buffer.from(data, 'base64')` instead.
+ * @param data The Base64-encoded input string.
+ */
+ function atob(data: string): string;
+ /**
+ * Decodes a string into bytes using Latin-1 (ISO-8859), and encodes those bytes
+ * into a string using Base64.
+ *
+ * The `data` may be any JavaScript-value that can be coerced into a string.
+ *
+ * **This function is only provided for compatibility with legacy web platform APIs**
+ * **and should never be used in new code, because they use strings to represent**
+ * **binary data and predate the introduction of typed arrays in JavaScript.**
+ * **For code running using Node.js APIs, converting between base64-encoded strings**
+ * **and binary data should be performed using `Buffer.from(str, 'base64')` and`buf.toString('base64')`.**
+ * @since v15.13.0, v14.17.0
+ * @legacy Use `buf.toString('base64')` instead.
+ * @param data An ASCII (Latin1) string.
+ */
+ function btoa(data: string): string;
+
+ interface Blob extends __Blob {}
+ /**
+ * `Blob` class is a global reference for `require('node:buffer').Blob`
+ * https://nodejs.org/api/buffer.html#class-blob
+ * @since v18.0.0
+ */
+ var Blob: typeof globalThis extends {
+ onmessage: any;
+ Blob: infer T;
+ } ? T
+ : typeof NodeBlob;
+ }
+}
+declare module "node:buffer" {
+ export * from "buffer";
+}
diff --git a/client/node_modules/@types/node/child_process.d.ts b/client/node_modules/@types/node/child_process.d.ts
new file mode 100644
index 0000000..6c7a2c1
--- /dev/null
+++ b/client/node_modules/@types/node/child_process.d.ts
@@ -0,0 +1,1544 @@
+/**
+ * The `child_process` module provides the ability to spawn subprocesses in
+ * a manner that is similar, but not identical, to [`popen(3)`](http://man7.org/linux/man-pages/man3/popen.3.html). This capability
+ * is primarily provided by the {@link spawn} function:
+ *
+ * ```js
+ * const { spawn } = require('child_process');
+ * const ls = spawn('ls', ['-lh', '/usr']);
+ *
+ * ls.stdout.on('data', (data) => {
+ * console.log(`stdout: ${data}`);
+ * });
+ *
+ * ls.stderr.on('data', (data) => {
+ * console.error(`stderr: ${data}`);
+ * });
+ *
+ * ls.on('close', (code) => {
+ * console.log(`child process exited with code ${code}`);
+ * });
+ * ```
+ *
+ * By default, pipes for `stdin`, `stdout`, and `stderr` are established between
+ * the parent Node.js process and the spawned subprocess. These pipes have
+ * limited (and platform-specific) capacity. If the subprocess writes to
+ * stdout in excess of that limit without the output being captured, the
+ * subprocess blocks waiting for the pipe buffer to accept more data. This is
+ * identical to the behavior of pipes in the shell. Use the `{ stdio: 'ignore' }`option if the output will not be consumed.
+ *
+ * The command lookup is performed using the `options.env.PATH` environment
+ * variable if `env` is in the `options` object. Otherwise, `process.env.PATH` is
+ * used. If `options.env` is set without `PATH`, lookup on Unix is performed
+ * on a default search path search of `/usr/bin:/bin` (see your operating system's
+ * manual for execvpe/execvp), on Windows the current processes environment
+ * variable `PATH` is used.
+ *
+ * On Windows, environment variables are case-insensitive. Node.js
+ * lexicographically sorts the `env` keys and uses the first one that
+ * case-insensitively matches. Only first (in lexicographic order) entry will be
+ * passed to the subprocess. This might lead to issues on Windows when passing
+ * objects to the `env` option that have multiple variants of the same key, such as`PATH` and `Path`.
+ *
+ * The {@link spawn} method spawns the child process asynchronously,
+ * without blocking the Node.js event loop. The {@link spawnSync} function provides equivalent functionality in a synchronous manner that blocks
+ * the event loop until the spawned process either exits or is terminated.
+ *
+ * For convenience, the `child_process` module provides a handful of synchronous
+ * and asynchronous alternatives to {@link spawn} and {@link spawnSync}. Each of these alternatives are implemented on
+ * top of {@link spawn} or {@link spawnSync}.
+ *
+ * * {@link exec}: spawns a shell and runs a command within that
+ * shell, passing the `stdout` and `stderr` to a callback function when
+ * complete.
+ * * {@link execFile}: similar to {@link exec} except
+ * that it spawns the command directly without first spawning a shell by
+ * default.
+ * * {@link fork}: spawns a new Node.js process and invokes a
+ * specified module with an IPC communication channel established that allows
+ * sending messages between parent and child.
+ * * {@link execSync}: a synchronous version of {@link exec} that will block the Node.js event loop.
+ * * {@link execFileSync}: a synchronous version of {@link execFile} that will block the Node.js event loop.
+ *
+ * For certain use cases, such as automating shell scripts, the `synchronous counterparts` may be more convenient. In many cases, however,
+ * the synchronous methods can have significant impact on performance due to
+ * stalling the event loop while spawned processes complete.
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/child_process.js)
+ */
+declare module "child_process" {
+ import { ObjectEncodingOptions } from "node:fs";
+ import { Abortable, EventEmitter } from "node:events";
+ import * as net from "node:net";
+ import { Pipe, Readable, Stream, Writable } from "node:stream";
+ import { URL } from "node:url";
+ type Serializable = string | object | number | boolean | bigint;
+ type SendHandle = net.Socket | net.Server;
+ /**
+ * Instances of the `ChildProcess` represent spawned child processes.
+ *
+ * Instances of `ChildProcess` are not intended to be created directly. Rather,
+ * use the {@link spawn}, {@link exec},{@link execFile}, or {@link fork} methods to create
+ * instances of `ChildProcess`.
+ * @since v2.2.0
+ */
+ class ChildProcess extends EventEmitter {
+ /**
+ * A `Writable Stream` that represents the child process's `stdin`.
+ *
+ * If a child process waits to read all of its input, the child will not continue
+ * until this stream has been closed via `end()`.
+ *
+ * If the child was spawned with `stdio[0]` set to anything other than `'pipe'`,
+ * then this will be `null`.
+ *
+ * `subprocess.stdin` is an alias for `subprocess.stdio[0]`. Both properties will
+ * refer to the same value.
+ *
+ * The `subprocess.stdin` property can be `undefined` if the child process could
+ * not be successfully spawned.
+ * @since v0.1.90
+ */
+ stdin: Writable | null;
+ /**
+ * A `Readable Stream` that represents the child process's `stdout`.
+ *
+ * If the child was spawned with `stdio[1]` set to anything other than `'pipe'`,
+ * then this will be `null`.
+ *
+ * `subprocess.stdout` is an alias for `subprocess.stdio[1]`. Both properties will
+ * refer to the same value.
+ *
+ * ```js
+ * const { spawn } = require('child_process');
+ *
+ * const subprocess = spawn('ls');
+ *
+ * subprocess.stdout.on('data', (data) => {
+ * console.log(`Received chunk ${data}`);
+ * });
+ * ```
+ *
+ * The `subprocess.stdout` property can be `null` if the child process could
+ * not be successfully spawned.
+ * @since v0.1.90
+ */
+ stdout: Readable | null;
+ /**
+ * A `Readable Stream` that represents the child process's `stderr`.
+ *
+ * If the child was spawned with `stdio[2]` set to anything other than `'pipe'`,
+ * then this will be `null`.
+ *
+ * `subprocess.stderr` is an alias for `subprocess.stdio[2]`. Both properties will
+ * refer to the same value.
+ *
+ * The `subprocess.stderr` property can be `null` if the child process could
+ * not be successfully spawned.
+ * @since v0.1.90
+ */
+ stderr: Readable | null;
+ /**
+ * The `subprocess.channel` property is a reference to the child's IPC channel. If
+ * no IPC channel currently exists, this property is `undefined`.
+ * @since v7.1.0
+ */
+ readonly channel?: Pipe | null | undefined;
+ /**
+ * A sparse array of pipes to the child process, corresponding with positions in
+ * the `stdio` option passed to {@link spawn} that have been set
+ * to the value `'pipe'`. `subprocess.stdio[0]`, `subprocess.stdio[1]`, and`subprocess.stdio[2]` are also available as `subprocess.stdin`,`subprocess.stdout`, and `subprocess.stderr`,
+ * respectively.
+ *
+ * In the following example, only the child's fd `1` (stdout) is configured as a
+ * pipe, so only the parent's `subprocess.stdio[1]` is a stream, all other values
+ * in the array are `null`.
+ *
+ * ```js
+ * const assert = require('assert');
+ * const fs = require('fs');
+ * const child_process = require('child_process');
+ *
+ * const subprocess = child_process.spawn('ls', {
+ * stdio: [
+ * 0, // Use parent's stdin for child.
+ * 'pipe', // Pipe child's stdout to parent.
+ * fs.openSync('err.out', 'w'), // Direct child's stderr to a file.
+ * ]
+ * });
+ *
+ * assert.strictEqual(subprocess.stdio[0], null);
+ * assert.strictEqual(subprocess.stdio[0], subprocess.stdin);
+ *
+ * assert(subprocess.stdout);
+ * assert.strictEqual(subprocess.stdio[1], subprocess.stdout);
+ *
+ * assert.strictEqual(subprocess.stdio[2], null);
+ * assert.strictEqual(subprocess.stdio[2], subprocess.stderr);
+ * ```
+ *
+ * The `subprocess.stdio` property can be `undefined` if the child process could
+ * not be successfully spawned.
+ * @since v0.7.10
+ */
+ readonly stdio: [
+ Writable | null,
+ // stdin
+ Readable | null,
+ // stdout
+ Readable | null,
+ // stderr
+ Readable | Writable | null | undefined,
+ // extra
+ Readable | Writable | null | undefined, // extra
+ ];
+ /**
+ * The `subprocess.killed` property indicates whether the child process
+ * successfully received a signal from `subprocess.kill()`. The `killed` property
+ * does not indicate that the child process has been terminated.
+ * @since v0.5.10
+ */
+ readonly killed: boolean;
+ /**
+ * Returns the process identifier (PID) of the child process. If the child process
+ * fails to spawn due to errors, then the value is `undefined` and `error` is
+ * emitted.
+ *
+ * ```js
+ * const { spawn } = require('child_process');
+ * const grep = spawn('grep', ['ssh']);
+ *
+ * console.log(`Spawned child pid: ${grep.pid}`);
+ * grep.stdin.end();
+ * ```
+ * @since v0.1.90
+ */
+ readonly pid?: number | undefined;
+ /**
+ * The `subprocess.connected` property indicates whether it is still possible to
+ * send and receive messages from a child process. When `subprocess.connected` is`false`, it is no longer possible to send or receive messages.
+ * @since v0.7.2
+ */
+ readonly connected: boolean;
+ /**
+ * The `subprocess.exitCode` property indicates the exit code of the child process.
+ * If the child process is still running, the field will be `null`.
+ */
+ readonly exitCode: number | null;
+ /**
+ * The `subprocess.signalCode` property indicates the signal received by
+ * the child process if any, else `null`.
+ */
+ readonly signalCode: NodeJS.Signals | null;
+ /**
+ * The `subprocess.spawnargs` property represents the full list of command-line
+ * arguments the child process was launched with.
+ */
+ readonly spawnargs: string[];
+ /**
+ * The `subprocess.spawnfile` property indicates the executable file name of
+ * the child process that is launched.
+ *
+ * For {@link fork}, its value will be equal to `process.execPath`.
+ * For {@link spawn}, its value will be the name of
+ * the executable file.
+ * For {@link exec}, its value will be the name of the shell
+ * in which the child process is launched.
+ */
+ readonly spawnfile: string;
+ /**
+ * The `subprocess.kill()` method sends a signal to the child process. If no
+ * argument is given, the process will be sent the `'SIGTERM'` signal. See [`signal(7)`](http://man7.org/linux/man-pages/man7/signal.7.html) for a list of available signals. This function
+ * returns `true` if [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) succeeds, and `false` otherwise.
+ *
+ * ```js
+ * const { spawn } = require('child_process');
+ * const grep = spawn('grep', ['ssh']);
+ *
+ * grep.on('close', (code, signal) => {
+ * console.log(
+ * `child process terminated due to receipt of signal ${signal}`);
+ * });
+ *
+ * // Send SIGHUP to process.
+ * grep.kill('SIGHUP');
+ * ```
+ *
+ * The `ChildProcess` object may emit an `'error'` event if the signal
+ * cannot be delivered. Sending a signal to a child process that has already exited
+ * is not an error but may have unforeseen consequences. Specifically, if the
+ * process identifier (PID) has been reassigned to another process, the signal will
+ * be delivered to that process instead which can have unexpected results.
+ *
+ * While the function is called `kill`, the signal delivered to the child process
+ * may not actually terminate the process.
+ *
+ * See [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) for reference.
+ *
+ * On Windows, where POSIX signals do not exist, the `signal` argument will be
+ * ignored, and the process will be killed forcefully and abruptly (similar to`'SIGKILL'`).
+ * See `Signal Events` for more details.
+ *
+ * On Linux, child processes of child processes will not be terminated
+ * when attempting to kill their parent. This is likely to happen when running a
+ * new process in a shell or with the use of the `shell` option of `ChildProcess`:
+ *
+ * ```js
+ * 'use strict';
+ * const { spawn } = require('child_process');
+ *
+ * const subprocess = spawn(
+ * 'sh',
+ * [
+ * '-c',
+ * `node -e "setInterval(() => {
+ * console.log(process.pid, 'is alive')
+ * }, 500);"`,
+ * ], {
+ * stdio: ['inherit', 'inherit', 'inherit']
+ * }
+ * );
+ *
+ * setTimeout(() => {
+ * subprocess.kill(); // Does not terminate the Node.js process in the shell.
+ * }, 2000);
+ * ```
+ * @since v0.1.90
+ */
+ kill(signal?: NodeJS.Signals | number): boolean;
+ /**
+ * Calls {@link ChildProcess.kill} with `'SIGTERM'`.
+ * @since v18.18.0
+ */
+ [Symbol.dispose](): void;
+ /**
+ * When an IPC channel has been established between the parent and child (
+ * i.e. when using {@link fork}), the `subprocess.send()` method can
+ * be used to send messages to the child process. When the child process is a
+ * Node.js instance, these messages can be received via the `'message'` event.
+ *
+ * The message goes through serialization and parsing. The resulting
+ * message might not be the same as what is originally sent.
+ *
+ * For example, in the parent script:
+ *
+ * ```js
+ * const cp = require('child_process');
+ * const n = cp.fork(`${__dirname}/sub.js`);
+ *
+ * n.on('message', (m) => {
+ * console.log('PARENT got message:', m);
+ * });
+ *
+ * // Causes the child to print: CHILD got message: { hello: 'world' }
+ * n.send({ hello: 'world' });
+ * ```
+ *
+ * And then the child script, `'sub.js'` might look like this:
+ *
+ * ```js
+ * process.on('message', (m) => {
+ * console.log('CHILD got message:', m);
+ * });
+ *
+ * // Causes the parent to print: PARENT got message: { foo: 'bar', baz: null }
+ * process.send({ foo: 'bar', baz: NaN });
+ * ```
+ *
+ * Child Node.js processes will have a `process.send()` method of their own
+ * that allows the child to send messages back to the parent.
+ *
+ * There is a special case when sending a `{cmd: 'NODE_foo'}` message. Messages
+ * containing a `NODE_` prefix in the `cmd` property are reserved for use within
+ * Node.js core and will not be emitted in the child's `'message'` event. Rather, such messages are emitted using the`'internalMessage'` event and are consumed internally by Node.js.
+ * Applications should avoid using such messages or listening for`'internalMessage'` events as it is subject to change without notice.
+ *
+ * The optional `sendHandle` argument that may be passed to `subprocess.send()` is
+ * for passing a TCP server or socket object to the child process. The child will
+ * receive the object as the second argument passed to the callback function
+ * registered on the `'message'` event. Any data that is received
+ * and buffered in the socket will not be sent to the child.
+ *
+ * The optional `callback` is a function that is invoked after the message is
+ * sent but before the child may have received it. The function is called with a
+ * single argument: `null` on success, or an `Error` object on failure.
+ *
+ * If no `callback` function is provided and the message cannot be sent, an`'error'` event will be emitted by the `ChildProcess` object. This can
+ * happen, for instance, when the child process has already exited.
+ *
+ * `subprocess.send()` will return `false` if the channel has closed or when the
+ * backlog of unsent messages exceeds a threshold that makes it unwise to send
+ * more. Otherwise, the method returns `true`. The `callback` function can be
+ * used to implement flow control.
+ *
+ * #### Example: sending a server object
+ *
+ * The `sendHandle` argument can be used, for instance, to pass the handle of
+ * a TCP server object to the child process as illustrated in the example below:
+ *
+ * ```js
+ * const subprocess = require('child_process').fork('subprocess.js');
+ *
+ * // Open up the server object and send the handle.
+ * const server = require('net').createServer();
+ * server.on('connection', (socket) => {
+ * socket.end('handled by parent');
+ * });
+ * server.listen(1337, () => {
+ * subprocess.send('server', server);
+ * });
+ * ```
+ *
+ * The child would then receive the server object as:
+ *
+ * ```js
+ * process.on('message', (m, server) => {
+ * if (m === 'server') {
+ * server.on('connection', (socket) => {
+ * socket.end('handled by child');
+ * });
+ * }
+ * });
+ * ```
+ *
+ * Once the server is now shared between the parent and child, some connections
+ * can be handled by the parent and some by the child.
+ *
+ * While the example above uses a server created using the `net` module, `dgram`module servers use exactly the same workflow with the exceptions of listening on
+ * a `'message'` event instead of `'connection'` and using `server.bind()` instead
+ * of `server.listen()`. This is, however, currently only supported on Unix
+ * platforms.
+ *
+ * #### Example: sending a socket object
+ *
+ * Similarly, the `sendHandler` argument can be used to pass the handle of a
+ * socket to the child process. The example below spawns two children that each
+ * handle connections with "normal" or "special" priority:
+ *
+ * ```js
+ * const { fork } = require('child_process');
+ * const normal = fork('subprocess.js', ['normal']);
+ * const special = fork('subprocess.js', ['special']);
+ *
+ * // Open up the server and send sockets to child. Use pauseOnConnect to prevent
+ * // the sockets from being read before they are sent to the child process.
+ * const server = require('net').createServer({ pauseOnConnect: true });
+ * server.on('connection', (socket) => {
+ *
+ * // If this is special priority...
+ * if (socket.remoteAddress === '74.125.127.100') {
+ * special.send('socket', socket);
+ * return;
+ * }
+ * // This is normal priority.
+ * normal.send('socket', socket);
+ * });
+ * server.listen(1337);
+ * ```
+ *
+ * The `subprocess.js` would receive the socket handle as the second argument
+ * passed to the event callback function:
+ *
+ * ```js
+ * process.on('message', (m, socket) => {
+ * if (m === 'socket') {
+ * if (socket) {
+ * // Check that the client socket exists.
+ * // It is possible for the socket to be closed between the time it is
+ * // sent and the time it is received in the child process.
+ * socket.end(`Request handled with ${process.argv[2]} priority`);
+ * }
+ * }
+ * });
+ * ```
+ *
+ * Do not use `.maxConnections` on a socket that has been passed to a subprocess.
+ * The parent cannot track when the socket is destroyed.
+ *
+ * Any `'message'` handlers in the subprocess should verify that `socket` exists,
+ * as the connection may have been closed during the time it takes to send the
+ * connection to the child.
+ * @since v0.5.9
+ * @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: Serializable, callback?: (error: Error | null) => void): boolean;
+ send(message: Serializable, sendHandle?: SendHandle, callback?: (error: Error | null) => void): boolean;
+ send(
+ message: Serializable,
+ sendHandle?: SendHandle,
+ options?: MessageOptions,
+ callback?: (error: Error | null) => void,
+ ): boolean;
+ /**
+ * Closes the IPC channel between parent and child, allowing the child to exit
+ * gracefully once there are no other connections keeping it alive. After calling
+ * this method the `subprocess.connected` and `process.connected` properties in
+ * both the parent and child (respectively) will be set to `false`, and it will be
+ * no longer possible to pass messages between the processes.
+ *
+ * The `'disconnect'` event will be emitted when there are no messages in the
+ * process of being received. This will most often be triggered immediately after
+ * calling `subprocess.disconnect()`.
+ *
+ * When the child process is a Node.js instance (e.g. spawned using {@link fork}), the `process.disconnect()` method can be invoked
+ * within the child process to close the IPC channel as well.
+ * @since v0.7.2
+ */
+ disconnect(): void;
+ /**
+ * By default, the parent will wait for the detached child to exit. To prevent the
+ * parent from waiting for a given `subprocess` to exit, use the`subprocess.unref()` method. Doing so will cause the parent's event loop to not
+ * include the child in its reference count, allowing the parent to exit
+ * independently of the child, unless there is an established IPC channel between
+ * the child and the parent.
+ *
+ * ```js
+ * const { spawn } = require('child_process');
+ *
+ * const subprocess = spawn(process.argv[0], ['child_program.js'], {
+ * detached: true,
+ * stdio: 'ignore'
+ * });
+ *
+ * subprocess.unref();
+ * ```
+ * @since v0.7.10
+ */
+ unref(): void;
+ /**
+ * Calling `subprocess.ref()` after making a call to `subprocess.unref()` will
+ * restore the removed reference count for the child process, forcing the parent
+ * to wait for the child to exit before exiting itself.
+ *
+ * ```js
+ * const { spawn } = require('child_process');
+ *
+ * const subprocess = spawn(process.argv[0], ['child_program.js'], {
+ * detached: true,
+ * stdio: 'ignore'
+ * });
+ *
+ * subprocess.unref();
+ * subprocess.ref();
+ * ```
+ * @since v0.7.10
+ */
+ ref(): void;
+ /**
+ * events.EventEmitter
+ * 1. close
+ * 2. disconnect
+ * 3. error
+ * 4. exit
+ * 5. message
+ * 6. spawn
+ */
+ addListener(event: string, listener: (...args: any[]) => void): this;
+ addListener(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
+ addListener(event: "disconnect", listener: () => void): this;
+ addListener(event: "error", listener: (err: Error) => void): this;
+ addListener(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
+ addListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
+ addListener(event: "spawn", listener: () => void): this;
+ emit(event: string | symbol, ...args: any[]): boolean;
+ emit(event: "close", code: number | null, signal: NodeJS.Signals | null): boolean;
+ emit(event: "disconnect"): boolean;
+ emit(event: "error", err: Error): boolean;
+ emit(event: "exit", code: number | null, signal: NodeJS.Signals | null): boolean;
+ emit(event: "message", message: Serializable, sendHandle: SendHandle): boolean;
+ emit(event: "spawn", listener: () => void): boolean;
+ on(event: string, listener: (...args: any[]) => void): this;
+ on(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
+ on(event: "disconnect", listener: () => void): this;
+ on(event: "error", listener: (err: Error) => void): this;
+ on(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
+ on(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
+ on(event: "spawn", listener: () => void): this;
+ once(event: string, listener: (...args: any[]) => void): this;
+ once(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
+ once(event: "disconnect", listener: () => void): this;
+ once(event: "error", listener: (err: Error) => void): this;
+ once(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
+ once(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
+ once(event: "spawn", listener: () => void): this;
+ prependListener(event: string, listener: (...args: any[]) => void): this;
+ prependListener(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
+ prependListener(event: "disconnect", listener: () => void): this;
+ prependListener(event: "error", listener: (err: Error) => void): this;
+ prependListener(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
+ prependListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
+ prependListener(event: "spawn", listener: () => void): this;
+ prependOnceListener(event: string, listener: (...args: any[]) => void): this;
+ prependOnceListener(
+ event: "close",
+ listener: (code: number | null, signal: NodeJS.Signals | null) => void,
+ ): this;
+ prependOnceListener(event: "disconnect", listener: () => void): this;
+ prependOnceListener(event: "error", listener: (err: Error) => void): this;
+ prependOnceListener(
+ event: "exit",
+ listener: (code: number | null, signal: NodeJS.Signals | null) => void,
+ ): this;
+ prependOnceListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
+ prependOnceListener(event: "spawn", listener: () => void): this;
+ }
+ // return this object when stdio option is undefined or not specified
+ interface ChildProcessWithoutNullStreams extends ChildProcess {
+ stdin: Writable;
+ stdout: Readable;
+ stderr: Readable;
+ readonly stdio: [
+ Writable,
+ Readable,
+ Readable,
+ // stderr
+ Readable | Writable | null | undefined,
+ // extra, no modification
+ Readable | Writable | null | undefined, // extra, no modification
+ ];
+ }
+ // return this object when stdio option is a tuple of 3
+ interface ChildProcessByStdio<I extends null | Writable, O extends null | Readable, E extends null | Readable>
+ extends ChildProcess
+ {
+ stdin: I;
+ stdout: O;
+ stderr: E;
+ readonly stdio: [
+ I,
+ O,
+ E,
+ Readable | Writable | null | undefined,
+ // extra, no modification
+ Readable | Writable | null | undefined, // extra, no modification
+ ];
+ }
+ interface MessageOptions {
+ keepOpen?: boolean | undefined;
+ }
+ type IOType = "overlapped" | "pipe" | "ignore" | "inherit";
+ type StdioOptions = IOType | Array<IOType | "ipc" | Stream | number | null | undefined>;
+ type SerializationType = "json" | "advanced";
+ interface MessagingOptions extends Abortable {
+ /**
+ * Specify the kind of serialization used for sending messages between processes.
+ * @default 'json'
+ */
+ serialization?: SerializationType | undefined;
+ /**
+ * The signal value to be used when the spawned process will be killed by the abort signal.
+ * @default 'SIGTERM'
+ */
+ killSignal?: NodeJS.Signals | number | undefined;
+ /**
+ * In milliseconds the maximum amount of time the process is allowed to run.
+ */
+ timeout?: number | undefined;
+ }
+ interface ProcessEnvOptions {
+ uid?: number | undefined;
+ gid?: number | undefined;
+ cwd?: string | URL | undefined;
+ env?: NodeJS.ProcessEnv | undefined;
+ }
+ interface CommonOptions extends ProcessEnvOptions {
+ /**
+ * @default false
+ */
+ windowsHide?: boolean | undefined;
+ /**
+ * @default 0
+ */
+ timeout?: number | undefined;
+ }
+ interface CommonSpawnOptions extends CommonOptions, MessagingOptions, Abortable {
+ argv0?: string | undefined;
+ /**
+ * Can be set to 'pipe', 'inherit', 'overlapped', or 'ignore', or an array of these strings.
+ * If passed as an array, the first element is used for `stdin`, the second for
+ * `stdout`, and the third for `stderr`. A fourth element can be used to
+ * specify the `stdio` behavior beyond the standard streams. See
+ * {@link ChildProcess.stdio} for more information.
+ *
+ * @default 'pipe'
+ */
+ stdio?: StdioOptions | undefined;
+ shell?: boolean | string | undefined;
+ windowsVerbatimArguments?: boolean | undefined;
+ }
+ interface SpawnOptions extends CommonSpawnOptions {
+ detached?: boolean | undefined;
+ }
+ interface SpawnOptionsWithoutStdio extends SpawnOptions {
+ stdio?: StdioPipeNamed | StdioPipe[] | undefined;
+ }
+ type StdioNull = "inherit" | "ignore" | Stream;
+ type StdioPipeNamed = "pipe" | "overlapped";
+ type StdioPipe = undefined | null | StdioPipeNamed;
+ interface SpawnOptionsWithStdioTuple<
+ Stdin extends StdioNull | StdioPipe,
+ Stdout extends StdioNull | StdioPipe,
+ Stderr extends StdioNull | StdioPipe,
+ > extends SpawnOptions {
+ stdio: [Stdin, Stdout, Stderr];
+ }
+ /**
+ * The `child_process.spawn()` method spawns a new process using the given`command`, with command-line arguments in `args`. If omitted, `args` defaults
+ * to an empty array.
+ *
+ * **If the `shell` option is enabled, do not pass unsanitized user input to this**
+ * **function. Any input containing shell metacharacters may be used to trigger**
+ * **arbitrary command execution.**
+ *
+ * A third argument may be used to specify additional options, with these defaults:
+ *
+ * ```js
+ * const defaults = {
+ * cwd: undefined,
+ * env: process.env
+ * };
+ * ```
+ *
+ * Use `cwd` to specify the working directory from which the process is spawned.
+ * If not given, the default is to inherit the current working directory. If given,
+ * but the path does not exist, the child process emits an `ENOENT` error
+ * and exits immediately. `ENOENT` is also emitted when the command
+ * does not exist.
+ *
+ * Use `env` to specify environment variables that will be visible to the new
+ * process, the default is `process.env`.
+ *
+ * `undefined` values in `env` will be ignored.
+ *
+ * Example of running `ls -lh /usr`, capturing `stdout`, `stderr`, and the
+ * exit code:
+ *
+ * ```js
+ * const { spawn } = require('child_process');
+ * const ls = spawn('ls', ['-lh', '/usr']);
+ *
+ * ls.stdout.on('data', (data) => {
+ * console.log(`stdout: ${data}`);
+ * });
+ *
+ * ls.stderr.on('data', (data) => {
+ * console.error(`stderr: ${data}`);
+ * });
+ *
+ * ls.on('close', (code) => {
+ * console.log(`child process exited with code ${code}`);
+ * });
+ * ```
+ *
+ * Example: A very elaborate way to run `ps ax | grep ssh`
+ *
+ * ```js
+ * const { spawn } = require('child_process');
+ * const ps = spawn('ps', ['ax']);
+ * const grep = spawn('grep', ['ssh']);
+ *
+ * ps.stdout.on('data', (data) => {
+ * grep.stdin.write(data);
+ * });
+ *
+ * ps.stderr.on('data', (data) => {
+ * console.error(`ps stderr: ${data}`);
+ * });
+ *
+ * ps.on('close', (code) => {
+ * if (code !== 0) {
+ * console.log(`ps process exited with code ${code}`);
+ * }
+ * grep.stdin.end();
+ * });
+ *
+ * grep.stdout.on('data', (data) => {
+ * console.log(data.toString());
+ * });
+ *
+ * grep.stderr.on('data', (data) => {
+ * console.error(`grep stderr: ${data}`);
+ * });
+ *
+ * grep.on('close', (code) => {
+ * if (code !== 0) {
+ * console.log(`grep process exited with code ${code}`);
+ * }
+ * });
+ * ```
+ *
+ * Example of checking for failed `spawn`:
+ *
+ * ```js
+ * const { spawn } = require('child_process');
+ * const subprocess = spawn('bad_command');
+ *
+ * subprocess.on('error', (err) => {
+ * console.error('Failed to start subprocess.');
+ * });
+ * ```
+ *
+ * Certain platforms (macOS, Linux) will use the value of `argv[0]` for the process
+ * title while others (Windows, SunOS) will use `command`.
+ *
+ * Node.js currently overwrites `argv[0]` with `process.execPath` on startup, so`process.argv[0]` in a Node.js child process will not match the `argv0`parameter passed to `spawn` from the parent,
+ * retrieve it with the`process.argv0` property instead.
+ *
+ * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except
+ * the error passed to the callback will be an `AbortError`:
+ *
+ * ```js
+ * const { spawn } = require('child_process');
+ * const controller = new AbortController();
+ * const { signal } = controller;
+ * const grep = spawn('grep', ['ssh'], { signal });
+ * grep.on('error', (err) => {
+ * // This will be called with err being an AbortError if the controller aborts
+ * });
+ * controller.abort(); // Stops the child process
+ * ```
+ * @since v0.1.90
+ * @param command The command to run.
+ * @param args List of string arguments.
+ */
+ function spawn(command: string, options?: SpawnOptionsWithoutStdio): ChildProcessWithoutNullStreams;
+ function spawn(
+ command: string,
+ options: SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioPipe>,
+ ): ChildProcessByStdio<Writable, Readable, Readable>;
+ function spawn(
+ command: string,
+ options: SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioNull>,
+ ): ChildProcessByStdio<Writable, Readable, null>;
+ function spawn(
+ command: string,
+ options: SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioPipe>,
+ ): ChildProcessByStdio<Writable, null, Readable>;
+ function spawn(
+ command: string,
+ options: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioPipe>,
+ ): ChildProcessByStdio<null, Readable, Readable>;
+ function spawn(
+ command: string,
+ options: SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioNull>,
+ ): ChildProcessByStdio<Writable, null, null>;
+ function spawn(
+ command: string,
+ options: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioNull>,
+ ): ChildProcessByStdio<null, Readable, null>;
+ function spawn(
+ command: string,
+ options: SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioPipe>,
+ ): ChildProcessByStdio<null, null, Readable>;
+ function spawn(
+ command: string,
+ options: SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioNull>,
+ ): ChildProcessByStdio<null, null, null>;
+ function spawn(command: string, options: SpawnOptions): ChildProcess;
+ // overloads of spawn with 'args'
+ function spawn(
+ command: string,
+ args?: readonly string[],
+ options?: SpawnOptionsWithoutStdio,
+ ): ChildProcessWithoutNullStreams;
+ function spawn(
+ command: string,
+ args: readonly string[],
+ options: SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioPipe>,
+ ): ChildProcessByStdio<Writable, Readable, Readable>;
+ function spawn(
+ command: string,
+ args: readonly string[],
+ options: SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioNull>,
+ ): ChildProcessByStdio<Writable, Readable, null>;
+ function spawn(
+ command: string,
+ args: readonly string[],
+ options: SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioPipe>,
+ ): ChildProcessByStdio<Writable, null, Readable>;
+ function spawn(
+ command: string,
+ args: readonly string[],
+ options: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioPipe>,
+ ): ChildProcessByStdio<null, Readable, Readable>;
+ function spawn(
+ command: string,
+ args: readonly string[],
+ options: SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioNull>,
+ ): ChildProcessByStdio<Writable, null, null>;
+ function spawn(
+ command: string,
+ args: readonly string[],
+ options: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioNull>,
+ ): ChildProcessByStdio<null, Readable, null>;
+ function spawn(
+ command: string,
+ args: readonly string[],
+ options: SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioPipe>,
+ ): ChildProcessByStdio<null, null, Readable>;
+ function spawn(
+ command: string,
+ args: readonly string[],
+ options: SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioNull>,
+ ): ChildProcessByStdio<null, null, null>;
+ function spawn(command: string, args: readonly string[], options: SpawnOptions): ChildProcess;
+ interface ExecOptions extends CommonOptions {
+ shell?: string | undefined;
+ signal?: AbortSignal | undefined;
+ maxBuffer?: number | undefined;
+ killSignal?: NodeJS.Signals | number | undefined;
+ }
+ interface ExecOptionsWithStringEncoding extends ExecOptions {
+ encoding: BufferEncoding;
+ }
+ interface ExecOptionsWithBufferEncoding extends ExecOptions {
+ encoding: BufferEncoding | null; // specify `null`.
+ }
+ interface ExecException extends Error {
+ cmd?: string | undefined;
+ killed?: boolean | undefined;
+ code?: number | undefined;
+ signal?: NodeJS.Signals | undefined;
+ }
+ /**
+ * Spawns a shell then executes the `command` within that shell, buffering any
+ * generated output. The `command` string passed to the exec function is processed
+ * directly by the shell and special characters (vary based on [shell](https://en.wikipedia.org/wiki/List_of_command-line_interpreters))
+ * need to be dealt with accordingly:
+ *
+ * ```js
+ * const { exec } = require('child_process');
+ *
+ * exec('"/path/to/test file/test.sh" arg1 arg2');
+ * // Double quotes are used so that the space in the path is not interpreted as
+ * // a delimiter of multiple arguments.
+ *
+ * exec('echo "The \\$HOME variable is $HOME"');
+ * // The $HOME variable is escaped in the first instance, but not in the second.
+ * ```
+ *
+ * **Never pass unsanitized user input to this function. Any input containing shell**
+ * **metacharacters may be used to trigger arbitrary command execution.**
+ *
+ * If a `callback` function is provided, it is called with the arguments`(error, stdout, stderr)`. On success, `error` will be `null`. On error,`error` will be an instance of `Error`. The
+ * `error.code` property will be
+ * the exit code of the process. By convention, any exit code other than `0`indicates an error. `error.signal` will be the signal that terminated the
+ * process.
+ *
+ * The `stdout` and `stderr` arguments passed to the callback will contain the
+ * stdout and stderr output of the child process. By default, Node.js will decode
+ * the output as UTF-8 and pass strings to the callback. The `encoding` option
+ * can be used to specify the character encoding used to decode the stdout and
+ * stderr output. If `encoding` is `'buffer'`, or an unrecognized character
+ * encoding, `Buffer` objects will be passed to the callback instead.
+ *
+ * ```js
+ * const { exec } = require('child_process');
+ * exec('cat *.js missing_file | wc -l', (error, stdout, stderr) => {
+ * if (error) {
+ * console.error(`exec error: ${error}`);
+ * return;
+ * }
+ * console.log(`stdout: ${stdout}`);
+ * console.error(`stderr: ${stderr}`);
+ * });
+ * ```
+ *
+ * If `timeout` is greater than `0`, the parent will send the signal
+ * identified by the `killSignal` property (the default is `'SIGTERM'`) if the
+ * child runs longer than `timeout` milliseconds.
+ *
+ * Unlike the [`exec(3)`](http://man7.org/linux/man-pages/man3/exec.3.html) POSIX system call, `child_process.exec()` does not replace
+ * the existing process and uses a shell to execute the command.
+ *
+ * If this method is invoked as its `util.promisify()` ed version, it returns
+ * a `Promise` for an `Object` with `stdout` and `stderr` properties. The returned`ChildProcess` instance is attached to the `Promise` as a `child` property. In
+ * case of an error (including any error resulting in an exit code other than 0), a
+ * rejected promise is returned, with the same `error` object given in the
+ * callback, but with two additional properties `stdout` and `stderr`.
+ *
+ * ```js
+ * const util = require('util');
+ * const exec = util.promisify(require('child_process').exec);
+ *
+ * async function lsExample() {
+ * const { stdout, stderr } = await exec('ls');
+ * console.log('stdout:', stdout);
+ * console.error('stderr:', stderr);
+ * }
+ * lsExample();
+ * ```
+ *
+ * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except
+ * the error passed to the callback will be an `AbortError`:
+ *
+ * ```js
+ * const { exec } = require('child_process');
+ * const controller = new AbortController();
+ * const { signal } = controller;
+ * const child = exec('grep ssh', { signal }, (error) => {
+ * console.log(error); // an AbortError
+ * });
+ * controller.abort();
+ * ```
+ * @since v0.1.90
+ * @param command The command to run, with space-separated arguments.
+ * @param callback called with the output when process terminates.
+ */
+ function exec(
+ command: string,
+ callback?: (error: ExecException | null, stdout: string, stderr: string) => void,
+ ): ChildProcess;
+ // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`.
+ function exec(
+ command: string,
+ options: {
+ encoding: "buffer" | null;
+ } & ExecOptions,
+ callback?: (error: ExecException | null, stdout: Buffer, stderr: Buffer) => void,
+ ): ChildProcess;
+ // `options` with well known `encoding` means stdout/stderr are definitely `string`.
+ function exec(
+ command: string,
+ options: {
+ encoding: BufferEncoding;
+ } & ExecOptions,
+ callback?: (error: ExecException | null, stdout: string, stderr: string) => void,
+ ): ChildProcess;
+ // `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`.
+ // There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`.
+ function exec(
+ command: string,
+ options: {
+ encoding: BufferEncoding;
+ } & ExecOptions,
+ callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
+ ): ChildProcess;
+ // `options` without an `encoding` means stdout/stderr are definitely `string`.
+ function exec(
+ command: string,
+ options: ExecOptions,
+ callback?: (error: ExecException | null, stdout: string, stderr: string) => void,
+ ): ChildProcess;
+ // fallback if nothing else matches. Worst case is always `string | Buffer`.
+ function exec(
+ command: string,
+ options: (ObjectEncodingOptions & ExecOptions) | undefined | null,
+ callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
+ ): ChildProcess;
+ interface PromiseWithChild<T> extends Promise<T> {
+ child: ChildProcess;
+ }
+ namespace exec {
+ function __promisify__(command: string): PromiseWithChild<{
+ stdout: string;
+ stderr: string;
+ }>;
+ function __promisify__(
+ command: string,
+ options: {
+ encoding: "buffer" | null;
+ } & ExecOptions,
+ ): PromiseWithChild<{
+ stdout: Buffer;
+ stderr: Buffer;
+ }>;
+ function __promisify__(
+ command: string,
+ options: {
+ encoding: BufferEncoding;
+ } & ExecOptions,
+ ): PromiseWithChild<{
+ stdout: string;
+ stderr: string;
+ }>;
+ function __promisify__(
+ command: string,
+ options: ExecOptions,
+ ): PromiseWithChild<{
+ stdout: string;
+ stderr: string;
+ }>;
+ function __promisify__(
+ command: string,
+ options?: (ObjectEncodingOptions & ExecOptions) | null,
+ ): PromiseWithChild<{
+ stdout: string | Buffer;
+ stderr: string | Buffer;
+ }>;
+ }
+ interface ExecFileOptions extends CommonOptions, Abortable {
+ maxBuffer?: number | undefined;
+ killSignal?: NodeJS.Signals | number | undefined;
+ windowsVerbatimArguments?: boolean | undefined;
+ shell?: boolean | string | undefined;
+ signal?: AbortSignal | undefined;
+ }
+ interface ExecFileOptionsWithStringEncoding extends ExecFileOptions {
+ encoding: BufferEncoding;
+ }
+ interface ExecFileOptionsWithBufferEncoding extends ExecFileOptions {
+ encoding: "buffer" | null;
+ }
+ interface ExecFileOptionsWithOtherEncoding extends ExecFileOptions {
+ encoding: BufferEncoding;
+ }
+ type ExecFileException =
+ & Omit<ExecException, "code">
+ & Omit<NodeJS.ErrnoException, "code">
+ & { code?: string | number | undefined | null };
+ /**
+ * The `child_process.execFile()` function is similar to {@link exec} except that it does not spawn a shell by default. Rather, the specified
+ * executable `file` is spawned directly as a new process making it slightly more
+ * efficient than {@link exec}.
+ *
+ * The same options as {@link exec} are supported. Since a shell is
+ * not spawned, behaviors such as I/O redirection and file globbing are not
+ * supported.
+ *
+ * ```js
+ * const { execFile } = require('child_process');
+ * const child = execFile('node', ['--version'], (error, stdout, stderr) => {
+ * if (error) {
+ * throw error;
+ * }
+ * console.log(stdout);
+ * });
+ * ```
+ *
+ * The `stdout` and `stderr` arguments passed to the callback will contain the
+ * stdout and stderr output of the child process. By default, Node.js will decode
+ * the output as UTF-8 and pass strings to the callback. The `encoding` option
+ * can be used to specify the character encoding used to decode the stdout and
+ * stderr output. If `encoding` is `'buffer'`, or an unrecognized character
+ * encoding, `Buffer` objects will be passed to the callback instead.
+ *
+ * If this method is invoked as its `util.promisify()` ed version, it returns
+ * a `Promise` for an `Object` with `stdout` and `stderr` properties. The returned`ChildProcess` instance is attached to the `Promise` as a `child` property. In
+ * case of an error (including any error resulting in an exit code other than 0), a
+ * rejected promise is returned, with the same `error` object given in the
+ * callback, but with two additional properties `stdout` and `stderr`.
+ *
+ * ```js
+ * const util = require('util');
+ * const execFile = util.promisify(require('child_process').execFile);
+ * async function getVersion() {
+ * const { stdout } = await execFile('node', ['--version']);
+ * console.log(stdout);
+ * }
+ * getVersion();
+ * ```
+ *
+ * **If the `shell` option is enabled, do not pass unsanitized user input to this**
+ * **function. Any input containing shell metacharacters may be used to trigger**
+ * **arbitrary command execution.**
+ *
+ * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except
+ * the error passed to the callback will be an `AbortError`:
+ *
+ * ```js
+ * const { execFile } = require('child_process');
+ * const controller = new AbortController();
+ * const { signal } = controller;
+ * const child = execFile('node', ['--version'], { signal }, (error) => {
+ * console.log(error); // an AbortError
+ * });
+ * controller.abort();
+ * ```
+ * @since v0.1.91
+ * @param file The name or path of the executable file to run.
+ * @param args List of string arguments.
+ * @param callback Called with the output when process terminates.
+ */
+ function execFile(file: string): ChildProcess;
+ function execFile(
+ file: string,
+ options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
+ ): ChildProcess;
+ function execFile(file: string, args?: readonly string[] | null): ChildProcess;
+ function execFile(
+ file: string,
+ args: readonly string[] | undefined | null,
+ options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
+ ): ChildProcess;
+ // no `options` definitely means stdout/stderr are `string`.
+ function execFile(
+ file: string,
+ callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
+ ): ChildProcess;
+ function execFile(
+ file: string,
+ args: readonly string[] | undefined | null,
+ callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
+ ): ChildProcess;
+ // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`.
+ function execFile(
+ file: string,
+ options: ExecFileOptionsWithBufferEncoding,
+ callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void,
+ ): ChildProcess;
+ function execFile(
+ file: string,
+ args: readonly string[] | undefined | null,
+ options: ExecFileOptionsWithBufferEncoding,
+ callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void,
+ ): ChildProcess;
+ // `options` with well known `encoding` means stdout/stderr are definitely `string`.
+ function execFile(
+ file: string,
+ options: ExecFileOptionsWithStringEncoding,
+ callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
+ ): ChildProcess;
+ function execFile(
+ file: string,
+ args: readonly string[] | undefined | null,
+ options: ExecFileOptionsWithStringEncoding,
+ callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
+ ): ChildProcess;
+ // `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`.
+ // There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`.
+ function execFile(
+ file: string,
+ options: ExecFileOptionsWithOtherEncoding,
+ callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
+ ): ChildProcess;
+ function execFile(
+ file: string,
+ args: readonly string[] | undefined | null,
+ options: ExecFileOptionsWithOtherEncoding,
+ callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
+ ): ChildProcess;
+ // `options` without an `encoding` means stdout/stderr are definitely `string`.
+ function execFile(
+ file: string,
+ options: ExecFileOptions,
+ callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
+ ): ChildProcess;
+ function execFile(
+ file: string,
+ args: readonly string[] | undefined | null,
+ options: ExecFileOptions,
+ callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
+ ): ChildProcess;
+ // fallback if nothing else matches. Worst case is always `string | Buffer`.
+ function execFile(
+ file: string,
+ options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
+ callback:
+ | ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void)
+ | undefined
+ | null,
+ ): ChildProcess;
+ function execFile(
+ file: string,
+ args: readonly string[] | undefined | null,
+ options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
+ callback:
+ | ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void)
+ | undefined
+ | null,
+ ): ChildProcess;
+ namespace execFile {
+ function __promisify__(file: string): PromiseWithChild<{
+ stdout: string;
+ stderr: string;
+ }>;
+ function __promisify__(
+ file: string,
+ args: readonly string[] | undefined | null,
+ ): PromiseWithChild<{
+ stdout: string;
+ stderr: string;
+ }>;
+ function __promisify__(
+ file: string,
+ options: ExecFileOptionsWithBufferEncoding,
+ ): PromiseWithChild<{
+ stdout: Buffer;
+ stderr: Buffer;
+ }>;
+ function __promisify__(
+ file: string,
+ args: readonly string[] | undefined | null,
+ options: ExecFileOptionsWithBufferEncoding,
+ ): PromiseWithChild<{
+ stdout: Buffer;
+ stderr: Buffer;
+ }>;
+ function __promisify__(
+ file: string,
+ options: ExecFileOptionsWithStringEncoding,
+ ): PromiseWithChild<{
+ stdout: string;
+ stderr: string;
+ }>;
+ function __promisify__(
+ file: string,
+ args: readonly string[] | undefined | null,
+ options: ExecFileOptionsWithStringEncoding,
+ ): PromiseWithChild<{
+ stdout: string;
+ stderr: string;
+ }>;
+ function __promisify__(
+ file: string,
+ options: ExecFileOptionsWithOtherEncoding,
+ ): PromiseWithChild<{
+ stdout: string | Buffer;
+ stderr: string | Buffer;
+ }>;
+ function __promisify__(
+ file: string,
+ args: readonly string[] | undefined | null,
+ options: ExecFileOptionsWithOtherEncoding,
+ ): PromiseWithChild<{
+ stdout: string | Buffer;
+ stderr: string | Buffer;
+ }>;
+ function __promisify__(
+ file: string,
+ options: ExecFileOptions,
+ ): PromiseWithChild<{
+ stdout: string;
+ stderr: string;
+ }>;
+ function __promisify__(
+ file: string,
+ args: readonly string[] | undefined | null,
+ options: ExecFileOptions,
+ ): PromiseWithChild<{
+ stdout: string;
+ stderr: string;
+ }>;
+ function __promisify__(
+ file: string,
+ options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
+ ): PromiseWithChild<{
+ stdout: string | Buffer;
+ stderr: string | Buffer;
+ }>;
+ function __promisify__(
+ file: string,
+ args: readonly string[] | undefined | null,
+ options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
+ ): PromiseWithChild<{
+ stdout: string | Buffer;
+ stderr: string | Buffer;
+ }>;
+ }
+ interface ForkOptions extends ProcessEnvOptions, MessagingOptions, Abortable {
+ execPath?: string | undefined;
+ execArgv?: string[] | undefined;
+ silent?: boolean | undefined;
+ /**
+ * Can be set to 'pipe', 'inherit', 'overlapped', or 'ignore', or an array of these strings.
+ * If passed as an array, the first element is used for `stdin`, the second for
+ * `stdout`, and the third for `stderr`. A fourth element can be used to
+ * specify the `stdio` behavior beyond the standard streams. See
+ * {@link ChildProcess.stdio} for more information.
+ *
+ * @default 'pipe'
+ */
+ stdio?: StdioOptions | undefined;
+ detached?: boolean | undefined;
+ windowsVerbatimArguments?: boolean | undefined;
+ }
+ /**
+ * The `child_process.fork()` method is a special case of {@link spawn} used specifically to spawn new Node.js processes.
+ * Like {@link spawn}, a `ChildProcess` object is returned. The
+ * returned `ChildProcess` will have an additional communication channel
+ * built-in that allows messages to be passed back and forth between the parent and
+ * child. See `subprocess.send()` for details.
+ *
+ * Keep in mind that spawned Node.js child processes are
+ * independent of the parent with exception of the IPC communication channel
+ * that is established between the two. Each process has its own memory, with
+ * their own V8 instances. Because of the additional resource allocations
+ * required, spawning a large number of child Node.js processes is not
+ * recommended.
+ *
+ * By default, `child_process.fork()` will spawn new Node.js instances using the `process.execPath` of the parent process. The `execPath` property in the`options` object allows for an alternative
+ * execution path to be used.
+ *
+ * Node.js processes launched with a custom `execPath` will communicate with the
+ * parent process using the file descriptor (fd) identified using the
+ * environment variable `NODE_CHANNEL_FD` on the child process.
+ *
+ * Unlike the [`fork(2)`](http://man7.org/linux/man-pages/man2/fork.2.html) POSIX system call, `child_process.fork()` does not clone the
+ * current process.
+ *
+ * The `shell` option available in {@link spawn} is not supported by`child_process.fork()` and will be ignored if set.
+ *
+ * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except
+ * the error passed to the callback will be an `AbortError`:
+ *
+ * ```js
+ * if (process.argv[2] === 'child') {
+ * setTimeout(() => {
+ * console.log(`Hello from ${process.argv[2]}!`);
+ * }, 1_000);
+ * } else {
+ * const { fork } = require('child_process');
+ * const controller = new AbortController();
+ * const { signal } = controller;
+ * const child = fork(__filename, ['child'], { signal });
+ * child.on('error', (err) => {
+ * // This will be called with err being an AbortError if the controller aborts
+ * });
+ * controller.abort(); // Stops the child process
+ * }
+ * ```
+ * @since v0.5.0
+ * @param modulePath The module to run in the child.
+ * @param args List of string arguments.
+ */
+ function fork(modulePath: string, options?: ForkOptions): ChildProcess;
+ function fork(modulePath: string, args?: readonly string[], options?: ForkOptions): ChildProcess;
+ interface SpawnSyncOptions extends CommonSpawnOptions {
+ input?: string | NodeJS.ArrayBufferView | undefined;
+ maxBuffer?: number | undefined;
+ encoding?: BufferEncoding | "buffer" | null | undefined;
+ }
+ interface SpawnSyncOptionsWithStringEncoding extends SpawnSyncOptions {
+ encoding: BufferEncoding;
+ }
+ interface SpawnSyncOptionsWithBufferEncoding extends SpawnSyncOptions {
+ encoding?: "buffer" | null | undefined;
+ }
+ interface SpawnSyncReturns<T> {
+ pid: number;
+ output: Array<T | null>;
+ stdout: T;
+ stderr: T;
+ status: number | null;
+ signal: NodeJS.Signals | null;
+ error?: Error | undefined;
+ }
+ /**
+ * The `child_process.spawnSync()` method is generally identical to {@link spawn} with the exception that the function will not return
+ * until the child process has fully closed. When a timeout has been encountered
+ * and `killSignal` is sent, the method won't return until the process has
+ * completely exited. If the process intercepts and handles the `SIGTERM` signal
+ * and doesn't exit, the parent process will wait until the child process has
+ * exited.
+ *
+ * **If the `shell` option is enabled, do not pass unsanitized user input to this**
+ * **function. Any input containing shell metacharacters may be used to trigger**
+ * **arbitrary command execution.**
+ * @since v0.11.12
+ * @param command The command to run.
+ * @param args List of string arguments.
+ */
+ function spawnSync(command: string): SpawnSyncReturns<Buffer>;
+ function spawnSync(command: string, options: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns<string>;
+ function spawnSync(command: string, options: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns<Buffer>;
+ function spawnSync(command: string, options?: SpawnSyncOptions): SpawnSyncReturns<string | Buffer>;
+ function spawnSync(command: string, args: readonly string[]): SpawnSyncReturns<Buffer>;
+ function spawnSync(
+ command: string,
+ args: readonly string[],
+ options: SpawnSyncOptionsWithStringEncoding,
+ ): SpawnSyncReturns<string>;
+ function spawnSync(
+ command: string,
+ args: readonly string[],
+ options: SpawnSyncOptionsWithBufferEncoding,
+ ): SpawnSyncReturns<Buffer>;
+ function spawnSync(
+ command: string,
+ args?: readonly string[],
+ options?: SpawnSyncOptions,
+ ): SpawnSyncReturns<string | Buffer>;
+ interface CommonExecOptions extends CommonOptions {
+ input?: string | NodeJS.ArrayBufferView | undefined;
+ /**
+ * Can be set to 'pipe', 'inherit', 'overlapped', or 'ignore', or an array of these strings.
+ * If passed as an array, the first element is used for `stdin`, the second for
+ * `stdout`, and the third for `stderr`. A fourth element can be used to
+ * specify the `stdio` behavior beyond the standard streams. See
+ * {@link ChildProcess.stdio} for more information.
+ *
+ * @default 'pipe'
+ */
+ stdio?: StdioOptions | undefined;
+ killSignal?: NodeJS.Signals | number | undefined;
+ maxBuffer?: number | undefined;
+ encoding?: BufferEncoding | "buffer" | null | undefined;
+ }
+ interface ExecSyncOptions extends CommonExecOptions {
+ shell?: string | undefined;
+ }
+ interface ExecSyncOptionsWithStringEncoding extends ExecSyncOptions {
+ encoding: BufferEncoding;
+ }
+ interface ExecSyncOptionsWithBufferEncoding extends ExecSyncOptions {
+ encoding?: "buffer" | null | undefined;
+ }
+ /**
+ * The `child_process.execSync()` method is generally identical to {@link exec} with the exception that the method will not return
+ * until the child process has fully closed. When a timeout has been encountered
+ * and `killSignal` is sent, the method won't return until the process has
+ * completely exited. If the child process intercepts and handles the `SIGTERM`signal and doesn't exit, the parent process will wait until the child process
+ * has exited.
+ *
+ * If the process times out or has a non-zero exit code, this method will throw.
+ * The `Error` object will contain the entire result from {@link spawnSync}.
+ *
+ * **Never pass unsanitized user input to this function. Any input containing shell**
+ * **metacharacters may be used to trigger arbitrary command execution.**
+ * @since v0.11.12
+ * @param command The command to run.
+ * @return The stdout from the command.
+ */
+ function execSync(command: string): Buffer;
+ function execSync(command: string, options: ExecSyncOptionsWithStringEncoding): string;
+ function execSync(command: string, options: ExecSyncOptionsWithBufferEncoding): Buffer;
+ function execSync(command: string, options?: ExecSyncOptions): string | Buffer;
+ interface ExecFileSyncOptions extends CommonExecOptions {
+ shell?: boolean | string | undefined;
+ }
+ interface ExecFileSyncOptionsWithStringEncoding extends ExecFileSyncOptions {
+ encoding: BufferEncoding;
+ }
+ interface ExecFileSyncOptionsWithBufferEncoding extends ExecFileSyncOptions {
+ encoding?: "buffer" | null; // specify `null`.
+ }
+ /**
+ * The `child_process.execFileSync()` method is generally identical to {@link execFile} with the exception that the method will not
+ * return until the child process has fully closed. When a timeout has been
+ * encountered and `killSignal` is sent, the method won't return until the process
+ * has completely exited.
+ *
+ * If the child process intercepts and handles the `SIGTERM` signal and
+ * does not exit, the parent process will still wait until the child process has
+ * exited.
+ *
+ * If the process times out or has a non-zero exit code, this method will throw an `Error` that will include the full result of the underlying {@link spawnSync}.
+ *
+ * **If the `shell` option is enabled, do not pass unsanitized user input to this**
+ * **function. Any input containing shell metacharacters may be used to trigger**
+ * **arbitrary command execution.**
+ * @since v0.11.12
+ * @param file The name or path of the executable file to run.
+ * @param args List of string arguments.
+ * @return The stdout from the command.
+ */
+ function execFileSync(file: string): Buffer;
+ function execFileSync(file: string, options: ExecFileSyncOptionsWithStringEncoding): string;
+ function execFileSync(file: string, options: ExecFileSyncOptionsWithBufferEncoding): Buffer;
+ function execFileSync(file: string, options?: ExecFileSyncOptions): string | Buffer;
+ function execFileSync(file: string, args: readonly string[]): Buffer;
+ function execFileSync(
+ file: string,
+ args: readonly string[],
+ options: ExecFileSyncOptionsWithStringEncoding,
+ ): string;
+ function execFileSync(
+ file: string,
+ args: readonly string[],
+ options: ExecFileSyncOptionsWithBufferEncoding,
+ ): Buffer;
+ function execFileSync(file: string, args?: readonly string[], options?: ExecFileSyncOptions): string | Buffer;
+}
+declare module "node:child_process" {
+ export * from "child_process";
+}
diff --git a/client/node_modules/@types/node/cluster.d.ts b/client/node_modules/@types/node/cluster.d.ts
new file mode 100644
index 0000000..e33eab7
--- /dev/null
+++ b/client/node_modules/@types/node/cluster.d.ts
@@ -0,0 +1,432 @@
+/**
+ * Clusters of Node.js processes can be used to run multiple instances of Node.js
+ * that can distribute workloads among their application threads. When process
+ * isolation is not needed, use the `worker_threads` module instead, which
+ * allows running multiple application threads within a single Node.js instance.
+ *
+ * The cluster module allows easy creation of child processes that all share
+ * server ports.
+ *
+ * ```js
+ * import cluster from 'cluster';
+ * import http from 'http';
+ * import { cpus } from 'os';
+ * import process from 'process';
+ *
+ * const numCPUs = cpus().length;
+ *
+ * if (cluster.isPrimary) {
+ * console.log(`Primary ${process.pid} is running`);
+ *
+ * // Fork workers.
+ * for (let i = 0; i < numCPUs; i++) {
+ * cluster.fork();
+ * }
+ *
+ * cluster.on('exit', (worker, code, signal) => {
+ * console.log(`worker ${worker.process.pid} died`);
+ * });
+ * } else {
+ * // Workers can share any TCP connection
+ * // In this case it is an HTTP server
+ * http.createServer((req, res) => {
+ * res.writeHead(200);
+ * res.end('hello world\n');
+ * }).listen(8000);
+ *
+ * console.log(`Worker ${process.pid} started`);
+ * }
+ * ```
+ *
+ * Running Node.js will now share port 8000 between the workers:
+ *
+ * ```console
+ * $ node server.js
+ * Primary 3596 is running
+ * Worker 4324 started
+ * Worker 4520 started
+ * Worker 6056 started
+ * Worker 5644 started
+ * ```
+ *
+ * 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/v18.0.0/lib/cluster.js)
+ */
+declare module "cluster" {
+ import * as child from "node:child_process";
+ import EventEmitter = require("node:events");
+ import * as net from "node:net";
+ type SerializationType = "json" | "advanced";
+ export interface ClusterSettings {
+ execArgv?: string[] | undefined; // default: process.execArgv
+ exec?: string | undefined;
+ args?: string[] | undefined;
+ silent?: boolean | undefined;
+ stdio?: any[] | undefined;
+ uid?: number | undefined;
+ gid?: number | undefined;
+ inspectPort?: number | (() => number) | undefined;
+ serialization?: SerializationType | undefined;
+ cwd?: string | undefined;
+ windowsHide?: boolean | undefined;
+ }
+ export interface Address {
+ address: string;
+ port: number;
+ addressType: number | "udp4" | "udp6"; // 4, 6, -1, "udp4", "udp6"
+ }
+ /**
+ * A `Worker` object contains all public information and method about a worker.
+ * In the primary it can be obtained using `cluster.workers`. In a worker
+ * it can be obtained using `cluster.worker`.
+ * @since v0.7.0
+ */
+ export class Worker extends EventEmitter {
+ /**
+ * Each new worker is given its own unique id, this id is stored in the`id`.
+ *
+ * While a worker is alive, this is the key that indexes it in`cluster.workers`.
+ * @since v0.8.0
+ */
+ id: number;
+ /**
+ * All workers are created using `child_process.fork()`, the returned object
+ * from this function is stored as `.process`. In a worker, the global `process`is stored.
+ *
+ * See: `Child Process module`.
+ *
+ * Workers will call `process.exit(0)` if the `'disconnect'` event occurs
+ * on `process` and `.exitedAfterDisconnect` is not `true`. This protects against
+ * accidental disconnection.
+ * @since v0.7.0
+ */
+ process: child.ChildProcess;
+ /**
+ * 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 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:
+ *
+ * ```js
+ * if (cluster.isPrimary) {
+ * const worker = cluster.fork();
+ * worker.send('hi there');
+ *
+ * } else if (cluster.isWorker) {
+ * process.on('message', (msg) => {
+ * process.send(msg);
+ * });
+ * }
+ * ```
+ * @since v0.7.0
+ * @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,
+ 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
+ * disconnecting the `worker.process`, and once disconnected, killing with`signal`. In the worker, it does it by killing the process with `signal`.
+ *
+ * The `kill()` function kills the worker process without waiting for a graceful
+ * disconnect, it has the same behavior as `worker.process.kill()`.
+ *
+ * This method is aliased as `worker.destroy()` for backwards compatibility.
+ *
+ * In a worker, `process.kill()` exists, but it is not this function;
+ * it is `kill()`.
+ * @since v0.9.12
+ * @param [signal='SIGTERM'] Name of the kill signal to send to the worker process.
+ */
+ kill(signal?: string): void;
+ destroy(signal?: string): void;
+ /**
+ * In a worker, this function will close all servers, wait for the `'close'` event
+ * on those servers, and then disconnect the IPC channel.
+ *
+ * In the primary, an internal message is sent to the worker causing it to call`.disconnect()` on itself.
+ *
+ * Causes `.exitedAfterDisconnect` to be set.
+ *
+ * After a server is closed, it will no longer accept new connections,
+ * but connections may be accepted by any other listening worker. Existing
+ * connections will be allowed to close as usual. When no more connections exist,
+ * see `server.close()`, the IPC channel to the worker will close allowing it
+ * to die gracefully.
+ *
+ * The above applies _only_ to server connections, client connections are not
+ * automatically closed by workers, and disconnect does not wait for them to close
+ * before exiting.
+ *
+ * In a worker, `process.disconnect` exists, but it is not this function;
+ * it is `disconnect()`.
+ *
+ * Because long living server connections may block workers from disconnecting, it
+ * may be useful to send a message, so application specific actions may be taken to
+ * close them. It also may be useful to implement a timeout, killing a worker if
+ * the `'disconnect'` event has not been emitted after some time.
+ *
+ * ```js
+ * if (cluster.isPrimary) {
+ * const worker = cluster.fork();
+ * let timeout;
+ *
+ * worker.on('listening', (address) => {
+ * worker.send('shutdown');
+ * worker.disconnect();
+ * timeout = setTimeout(() => {
+ * worker.kill();
+ * }, 2000);
+ * });
+ *
+ * worker.on('disconnect', () => {
+ * clearTimeout(timeout);
+ * });
+ *
+ * } else if (cluster.isWorker) {
+ * const net = require('net');
+ * const server = net.createServer((socket) => {
+ * // Connections never end
+ * });
+ *
+ * server.listen(8000);
+ *
+ * process.on('message', (msg) => {
+ * if (msg === 'shutdown') {
+ * // Initiate graceful close of any connections to server
+ * }
+ * });
+ * }
+ * ```
+ * @since v0.7.7
+ * @return A reference to `worker`.
+ */
+ disconnect(): void;
+ /**
+ * This function returns `true` if the worker is connected to its primary via its
+ * IPC channel, `false` otherwise. A worker is connected to its primary after it
+ * has been created. It is disconnected after the `'disconnect'` event is emitted.
+ * @since v0.11.14
+ */
+ isConnected(): boolean;
+ /**
+ * This function returns `true` if the worker's process has terminated (either
+ * because of exiting or being signaled). Otherwise, it returns `false`.
+ *
+ * ```js
+ * import cluster from 'cluster';
+ * import http from 'http';
+ * import { cpus } from 'os';
+ * import process from 'process';
+ *
+ * const numCPUs = cpus().length;
+ *
+ * if (cluster.isPrimary) {
+ * console.log(`Primary ${process.pid} is running`);
+ *
+ * // Fork workers.
+ * for (let i = 0; i < numCPUs; i++) {
+ * cluster.fork();
+ * }
+ *
+ * cluster.on('fork', (worker) => {
+ * console.log('worker is dead:', worker.isDead());
+ * });
+ *
+ * cluster.on('exit', (worker, code, signal) => {
+ * console.log('worker is dead:', worker.isDead());
+ * });
+ * } else {
+ * // Workers can share any TCP connection. In this case, it is an HTTP server.
+ * http.createServer((req, res) => {
+ * res.writeHead(200);
+ * res.end(`Current process\n ${process.pid}`);
+ * process.kill(process.pid);
+ * }).listen(8000);
+ * }
+ * ```
+ * @since v0.11.14
+ */
+ isDead(): boolean;
+ /**
+ * This property is `true` if the worker exited due to `.disconnect()`.
+ * If the worker exited any other way, it is `false`. If the
+ * worker has not exited, it is `undefined`.
+ *
+ * The boolean `worker.exitedAfterDisconnect` allows distinguishing between
+ * voluntary and accidental exit, the primary may choose not to respawn a worker
+ * based on this value.
+ *
+ * ```js
+ * cluster.on('exit', (worker, code, signal) => {
+ * if (worker.exitedAfterDisconnect === true) {
+ * console.log('Oh, it was just voluntary – no need to worry');
+ * }
+ * });
+ *
+ * // kill worker
+ * worker.kill();
+ * ```
+ * @since v6.0.0
+ */
+ exitedAfterDisconnect: boolean;
+ /**
+ * events.EventEmitter
+ * 1. disconnect
+ * 2. error
+ * 3. exit
+ * 4. listening
+ * 5. message
+ * 6. online
+ */
+ addListener(event: string, listener: (...args: any[]) => void): this;
+ addListener(event: "disconnect", listener: () => void): this;
+ addListener(event: "error", listener: (error: Error) => void): this;
+ addListener(event: "exit", listener: (code: number, signal: string) => 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: "online", listener: () => void): this;
+ emit(event: string | symbol, ...args: any[]): boolean;
+ emit(event: "disconnect"): boolean;
+ emit(event: "error", error: Error): boolean;
+ emit(event: "exit", code: number, signal: string): boolean;
+ emit(event: "listening", address: Address): boolean;
+ emit(event: "message", message: any, handle: net.Socket | net.Server): boolean;
+ emit(event: "online"): boolean;
+ on(event: string, listener: (...args: any[]) => void): this;
+ on(event: "disconnect", listener: () => void): this;
+ on(event: "error", listener: (error: Error) => void): this;
+ on(event: "exit", listener: (code: number, signal: string) => 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: "online", listener: () => void): this;
+ once(event: string, listener: (...args: any[]) => void): this;
+ once(event: "disconnect", listener: () => void): this;
+ once(event: "error", listener: (error: Error) => void): this;
+ once(event: "exit", listener: (code: number, signal: string) => 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: "online", listener: () => void): this;
+ prependListener(event: string, listener: (...args: any[]) => void): this;
+ prependListener(event: "disconnect", listener: () => void): this;
+ prependListener(event: "error", listener: (error: Error) => void): this;
+ prependListener(event: "exit", listener: (code: number, signal: string) => 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: "online", listener: () => void): this;
+ prependOnceListener(event: string, listener: (...args: any[]) => void): this;
+ prependOnceListener(event: "disconnect", listener: () => void): this;
+ prependOnceListener(event: "error", listener: (error: Error) => void): this;
+ prependOnceListener(event: "exit", listener: (code: number, signal: string) => 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: "online", listener: () => void): this;
+ }
+ export interface Cluster extends EventEmitter {
+ disconnect(callback?: () => void): void;
+ fork(env?: any): Worker;
+ /** @deprecated since v16.0.0 - use isPrimary. */
+ readonly isMaster: boolean;
+ readonly isPrimary: boolean;
+ readonly isWorker: boolean;
+ schedulingPolicy: number;
+ readonly settings: ClusterSettings;
+ /** @deprecated since v16.0.0 - use setupPrimary. */
+ setupMaster(settings?: ClusterSettings): void;
+ /**
+ * `setupPrimary` is used to change the default 'fork' behavior. Once called, the settings will be present in cluster.settings.
+ */
+ setupPrimary(settings?: ClusterSettings): void;
+ readonly worker?: Worker | undefined;
+ readonly workers?: NodeJS.Dict<Worker> | undefined;
+ readonly SCHED_NONE: number;
+ readonly SCHED_RR: number;
+ /**
+ * events.EventEmitter
+ * 1. disconnect
+ * 2. exit
+ * 3. fork
+ * 4. listening
+ * 5. message
+ * 6. online
+ * 7. setup
+ */
+ addListener(event: string, listener: (...args: any[]) => void): this;
+ addListener(event: "disconnect", listener: (worker: Worker) => void): this;
+ addListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
+ addListener(event: "fork", listener: (worker: Worker) => void): this;
+ addListener(event: "listening", listener: (worker: Worker, address: Address) => void): this;
+ 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.
+ 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: "disconnect", worker: Worker): boolean;
+ emit(event: "exit", worker: Worker, code: number, signal: string): boolean;
+ emit(event: "fork", worker: Worker): boolean;
+ emit(event: "listening", worker: Worker, address: Address): boolean;
+ emit(event: "message", worker: Worker, message: any, handle: net.Socket | net.Server): boolean;
+ emit(event: "online", worker: Worker): boolean;
+ emit(event: "setup", settings: ClusterSettings): boolean;
+ on(event: string, listener: (...args: any[]) => void): this;
+ on(event: "disconnect", listener: (worker: Worker) => void): this;
+ on(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
+ on(event: "fork", listener: (worker: Worker) => 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: "online", listener: (worker: Worker) => void): this;
+ on(event: "setup", listener: (settings: ClusterSettings) => void): this;
+ once(event: string, listener: (...args: any[]) => void): this;
+ once(event: "disconnect", listener: (worker: Worker) => void): this;
+ once(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
+ once(event: "fork", listener: (worker: Worker) => 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: "online", listener: (worker: Worker) => void): this;
+ once(event: "setup", listener: (settings: ClusterSettings) => void): this;
+ prependListener(event: string, listener: (...args: any[]) => void): this;
+ prependListener(event: "disconnect", listener: (worker: Worker) => void): this;
+ prependListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
+ prependListener(event: "fork", listener: (worker: Worker) => void): this;
+ prependListener(event: "listening", listener: (worker: Worker, address: Address) => void): this;
+ // the handle is a net.Socket or net.Server object, or undefined.
+ prependListener(
+ event: "message",
+ listener: (worker: Worker, message: any, handle?: net.Socket | net.Server) => void,
+ ): 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: "disconnect", listener: (worker: Worker) => void): this;
+ prependOnceListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
+ prependOnceListener(event: "fork", listener: (worker: Worker) => void): this;
+ prependOnceListener(event: "listening", listener: (worker: Worker, address: Address) => void): this;
+ // the handle is a net.Socket or net.Server object, or undefined.
+ prependOnceListener(
+ event: "message",
+ listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void,
+ ): this;
+ prependOnceListener(event: "online", listener: (worker: Worker) => void): this;
+ prependOnceListener(event: "setup", listener: (settings: ClusterSettings) => void): this;
+ }
+ const cluster: Cluster;
+ export default cluster;
+}
+declare module "node:cluster" {
+ export * from "cluster";
+ export { default as default } from "cluster";
+}
diff --git a/client/node_modules/@types/node/console.d.ts b/client/node_modules/@types/node/console.d.ts
new file mode 100644
index 0000000..c627daf
--- /dev/null
+++ b/client/node_modules/@types/node/console.d.ts
@@ -0,0 +1,412 @@
+/**
+ * The `console` module provides a simple debugging console that is similar to the
+ * JavaScript console mechanism provided by web browsers.
+ *
+ * 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 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
+ * synchronous like the browser APIs they resemble, nor are they consistently
+ * asynchronous like all other Node.js streams. See the `note on process I/O` for
+ * more information.
+ *
+ * Example using the global `console`:
+ *
+ * ```js
+ * console.log('hello world');
+ * // Prints: hello world, to stdout
+ * console.log('hello %s', 'world');
+ * // Prints: hello world, to stdout
+ * console.error(new Error('Whoops, something bad happened'));
+ * // Prints error message and stack trace to stderr:
+ * // Error: Whoops, something bad happened
+ * // at [eval]:5:15
+ * // at Script.runInThisContext (node:vm:132:18)
+ * // at Object.runInThisContext (node:vm:309:38)
+ * // at node:internal/process/execution:77:19
+ * // at [eval]-wrapper:6:22
+ * // at evalScript (node:internal/process/execution:76:60)
+ * // at node:internal/main/eval_string:23:3
+ *
+ * const name = 'Will Robinson';
+ * console.warn(`Danger ${name}! Danger!`);
+ * // Prints: Danger Will Robinson! Danger!, to stderr
+ * ```
+ *
+ * Example using the `Console` class:
+ *
+ * ```js
+ * const out = getStreamSomehow();
+ * const err = getStreamSomehow();
+ * const myConsole = new console.Console(out, err);
+ *
+ * myConsole.log('hello world');
+ * // Prints: hello world, to out
+ * myConsole.log('hello %s', 'world');
+ * // Prints: hello world, to out
+ * myConsole.error(new Error('Whoops, something bad happened'));
+ * // Prints: [Error: Whoops, something bad happened], to err
+ *
+ * const name = 'Will Robinson';
+ * myConsole.warn(`Danger ${name}! Danger!`);
+ * // Prints: Danger Will Robinson! Danger!, to err
+ * ```
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/console.js)
+ */
+declare module "console" {
+ import console = require("node:console");
+ export = console;
+}
+declare module "node:console" {
+ import { InspectOptions } from "node:util";
+ global {
+ // This needs to be global to avoid TS2403 in case lib.dom.d.ts is present in the same build
+ interface Console {
+ Console: console.ConsoleConstructor;
+ /**
+ * `console.assert()` writes a message if `value` is [falsy](https://developer.mozilla.org/en-US/docs/Glossary/Falsy) or omitted. It only
+ * writes a message and does not otherwise affect execution. The output always
+ * starts with `"Assertion failed"`. If provided, `message` is formatted using `util.format()`.
+ *
+ * If `value` is [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy), nothing happens.
+ *
+ * ```js
+ * console.assert(true, 'does nothing');
+ *
+ * console.assert(false, 'Whoops %s work', 'didn\'t');
+ * // Assertion failed: Whoops didn't work
+ *
+ * console.assert();
+ * // Assertion failed
+ * ```
+ * @since v0.1.101
+ * @param value The value tested for being truthy.
+ * @param message All arguments besides `value` are used as error message.
+ */
+ assert(value: any, message?: string, ...optionalParams: any[]): void;
+ /**
+ * When `stdout` is a TTY, calling `console.clear()` will attempt to clear the
+ * TTY. When `stdout` is not a TTY, this method does nothing.
+ *
+ * The specific operation of `console.clear()` can vary across operating systems
+ * and terminal types. For most Linux operating systems, `console.clear()`operates similarly to the `clear` shell command. On Windows, `console.clear()`will clear only the output in the
+ * current terminal viewport for the Node.js
+ * binary.
+ * @since v8.3.0
+ */
+ clear(): void;
+ /**
+ * Maintains an internal counter specific to `label` and outputs to `stdout` the
+ * number of times `console.count()` has been called with the given `label`.
+ *
+ * ```js
+ * > console.count()
+ * default: 1
+ * undefined
+ * > console.count('default')
+ * default: 2
+ * undefined
+ * > console.count('abc')
+ * abc: 1
+ * undefined
+ * > console.count('xyz')
+ * xyz: 1
+ * undefined
+ * > console.count('abc')
+ * abc: 2
+ * undefined
+ * > console.count()
+ * default: 3
+ * undefined
+ * >
+ * ```
+ * @since v8.3.0
+ * @param label The display label for the counter.
+ */
+ count(label?: string): void;
+ /**
+ * Resets the internal counter specific to `label`.
+ *
+ * ```js
+ * > console.count('abc');
+ * abc: 1
+ * undefined
+ * > console.countReset('abc');
+ * undefined
+ * > console.count('abc');
+ * abc: 1
+ * undefined
+ * >
+ * ```
+ * @since v8.3.0
+ * @param label The display label for the counter.
+ */
+ countReset(label?: string): void;
+ /**
+ * The `console.debug()` function is an alias for {@link log}.
+ * @since v8.0.0
+ */
+ debug(message?: any, ...optionalParams: any[]): void;
+ /**
+ * Uses `util.inspect()` on `obj` and prints the resulting string to `stdout`.
+ * This function bypasses any custom `inspect()` function defined on `obj`.
+ * @since v0.1.101
+ */
+ dir(obj: any, options?: InspectOptions): void;
+ /**
+ * This method calls `console.log()` passing it the arguments received.
+ * This method does not produce any XML formatting.
+ * @since v8.0.0
+ */
+ dirxml(...data: any[]): void;
+ /**
+ * Prints to `stderr` with newline. Multiple arguments can be passed, with the
+ * first used as the primary message and all additional used as substitution
+ * values similar to [`printf(3)`](http://man7.org/linux/man-pages/man3/printf.3.html) (the arguments are all passed to `util.format()`).
+ *
+ * ```js
+ * const code = 5;
+ * console.error('error #%d', code);
+ * // Prints: error #5, to stderr
+ * console.error('error', code);
+ * // Prints: error 5, to stderr
+ * ```
+ *
+ * If formatting elements (e.g. `%d`) are not found in the first string then `util.inspect()` is called on each argument and the resulting string
+ * values are concatenated. See `util.format()` for more information.
+ * @since v0.1.100
+ */
+ error(message?: any, ...optionalParams: any[]): void;
+ /**
+ * Increases indentation of subsequent lines by spaces for `groupIndentation`length.
+ *
+ * If one or more `label`s are provided, those are printed first without the
+ * additional indentation.
+ * @since v8.5.0
+ */
+ group(...label: any[]): void;
+ /**
+ * An alias for {@link group}.
+ * @since v8.5.0
+ */
+ groupCollapsed(...label: any[]): void;
+ /**
+ * Decreases indentation of subsequent lines by spaces for `groupIndentation`length.
+ * @since v8.5.0
+ */
+ groupEnd(): void;
+ /**
+ * The `console.info()` function is an alias for {@link log}.
+ * @since v0.1.100
+ */
+ info(message?: any, ...optionalParams: any[]): void;
+ /**
+ * Prints to `stdout` with newline. Multiple arguments can be passed, with the
+ * first used as the primary message and all additional used as substitution
+ * values similar to [`printf(3)`](http://man7.org/linux/man-pages/man3/printf.3.html) (the arguments are all passed to `util.format()`).
+ *
+ * ```js
+ * const count = 5;
+ * console.log('count: %d', count);
+ * // Prints: count: 5, to stdout
+ * console.log('count:', count);
+ * // Prints: count: 5, to stdout
+ * ```
+ *
+ * See `util.format()` for more information.
+ * @since v0.1.100
+ */
+ 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
+ * logging the argument if it can’t be parsed as tabular.
+ *
+ * ```js
+ * // These can't be parsed as tabular data
+ * console.table(Symbol());
+ * // Symbol()
+ *
+ * console.table(undefined);
+ * // undefined
+ *
+ * console.table([{ a: 1, b: 'Y' }, { a: 'Z', b: 2 }]);
+ * // ┌─────────┬─────┬─────┐
+ * // │ (index) │ a │ b │
+ * // ├─────────┼─────┼─────┤
+ * // │ 0 │ 1 │ 'Y' │
+ * // │ 1 │ 'Z' │ 2 │
+ * // └─────────┴─────┴─────┘
+ *
+ * console.table([{ a: 1, b: 'Y' }, { a: 'Z', b: 2 }], ['a']);
+ * // ┌─────────┬─────┐
+ * // │ (index) │ a │
+ * // ├─────────┼─────┤
+ * // │ 0 │ 1 │
+ * // │ 1 │ 'Z' │
+ * // └─────────┴─────┘
+ * ```
+ * @since v10.0.0
+ * @param properties Alternate properties for constructing the table.
+ */
+ table(tabularData: any, properties?: readonly string[]): void;
+ /**
+ * Starts a timer that can be used to compute the duration of an operation. Timers
+ * are identified by a unique `label`. Use the same `label` when calling {@link timeEnd} to stop the timer and output the elapsed time in
+ * suitable time units to `stdout`. For example, if the elapsed
+ * time is 3869ms, `console.timeEnd()` displays "3.869s".
+ * @since v0.1.104
+ */
+ time(label?: string): void;
+ /**
+ * Stops a timer that was previously started by calling {@link time} and
+ * prints the result to `stdout`:
+ *
+ * ```js
+ * console.time('100-elements');
+ * for (let i = 0; i < 100; i++) {}
+ * console.timeEnd('100-elements');
+ * // prints 100-elements: 225.438ms
+ * ```
+ * @since v0.1.104
+ */
+ timeEnd(label?: string): void;
+ /**
+ * For a timer that was previously started by calling {@link time}, prints
+ * the elapsed time and other `data` arguments to `stdout`:
+ *
+ * ```js
+ * console.time('process');
+ * const value = expensiveProcess1(); // Returns 42
+ * console.timeLog('process', value);
+ * // Prints "process: 365.227ms 42".
+ * doExpensiveProcess2(value);
+ * console.timeEnd('process');
+ * ```
+ * @since v10.7.0
+ */
+ timeLog(label?: string, ...data: any[]): void;
+ /**
+ * Prints to `stderr` the string `'Trace: '`, followed by the `util.format()` formatted message and stack trace to the current position in the code.
+ *
+ * ```js
+ * console.trace('Show me');
+ * // Prints: (stack trace will vary based on where trace is called)
+ * // Trace: Show me
+ * // at repl:2:9
+ * // at REPLServer.defaultEval (repl.js:248:27)
+ * // at bound (domain.js:287:14)
+ * // at REPLServer.runBound [as eval] (domain.js:300:12)
+ * // at REPLServer.<anonymous> (repl.js:412:12)
+ * // at emitOne (events.js:82:20)
+ * // at REPLServer.emit (events.js:169:7)
+ * // at REPLServer.Interface._onLine (readline.js:210:10)
+ * // at REPLServer.Interface._line (readline.js:549:8)
+ * // at REPLServer.Interface._ttyWrite (readline.js:826:14)
+ * ```
+ * @since v0.1.104
+ */
+ trace(message?: any, ...optionalParams: any[]): void;
+ /**
+ * The `console.warn()` function is an alias for {@link error}.
+ * @since v0.1.100
+ */
+ warn(message?: any, ...optionalParams: any[]): void;
+ // --- Inspector mode only ---
+ /**
+ * This method does not display anything unless used in the inspector.
+ * Starts a JavaScript CPU profile with an optional label.
+ */
+ profile(label?: string): void;
+ /**
+ * This method does not display anything unless used in the inspector.
+ * Stops the current JavaScript CPU profiling session if one has been started and prints the report to the Profiles panel of the inspector.
+ */
+ profileEnd(label?: string): void;
+ /**
+ * This method does not display anything unless used in the inspector.
+ * Adds an event with the label `label` to the Timeline panel of the inspector.
+ */
+ timeStamp(label?: string): void;
+ }
+ /**
+ * The `console` module provides a simple debugging console that is similar to the
+ * JavaScript console mechanism provided by web browsers.
+ *
+ * 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 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
+ * synchronous like the browser APIs they resemble, nor are they consistently
+ * asynchronous like all other Node.js streams. See the `note on process I/O` for
+ * more information.
+ *
+ * Example using the global `console`:
+ *
+ * ```js
+ * console.log('hello world');
+ * // Prints: hello world, to stdout
+ * console.log('hello %s', 'world');
+ * // Prints: hello world, to stdout
+ * console.error(new Error('Whoops, something bad happened'));
+ * // Prints error message and stack trace to stderr:
+ * // Error: Whoops, something bad happened
+ * // at [eval]:5:15
+ * // at Script.runInThisContext (node:vm:132:18)
+ * // at Object.runInThisContext (node:vm:309:38)
+ * // at node:internal/process/execution:77:19
+ * // at [eval]-wrapper:6:22
+ * // at evalScript (node:internal/process/execution:76:60)
+ * // at node:internal/main/eval_string:23:3
+ *
+ * const name = 'Will Robinson';
+ * console.warn(`Danger ${name}! Danger!`);
+ * // Prints: Danger Will Robinson! Danger!, to stderr
+ * ```
+ *
+ * Example using the `Console` class:
+ *
+ * ```js
+ * const out = getStreamSomehow();
+ * const err = getStreamSomehow();
+ * const myConsole = new console.Console(out, err);
+ *
+ * myConsole.log('hello world');
+ * // Prints: hello world, to out
+ * myConsole.log('hello %s', 'world');
+ * // Prints: hello world, to out
+ * myConsole.error(new Error('Whoops, something bad happened'));
+ * // Prints: [Error: Whoops, something bad happened], to err
+ *
+ * const name = 'Will Robinson';
+ * myConsole.warn(`Danger ${name}! Danger!`);
+ * // Prints: Danger Will Robinson! Danger!, to err
+ * ```
+ * @see [source](https://github.com/nodejs/node/blob/v16.4.2/lib/console.js)
+ */
+ namespace console {
+ interface ConsoleConstructorOptions {
+ stdout: NodeJS.WritableStream;
+ stderr?: NodeJS.WritableStream | undefined;
+ ignoreErrors?: boolean | undefined;
+ colorMode?: boolean | "auto" | undefined;
+ inspectOptions?: InspectOptions | undefined;
+ /**
+ * Set group indentation
+ * @default 2
+ */
+ groupIndentation?: number | undefined;
+ }
+ interface ConsoleConstructor {
+ prototype: Console;
+ new(stdout: NodeJS.WritableStream, stderr?: NodeJS.WritableStream, ignoreErrors?: boolean): Console;
+ new(options: ConsoleConstructorOptions): Console;
+ }
+ }
+ var console: Console;
+ }
+ export = globalThis.console;
+}
diff --git a/client/node_modules/@types/node/constants.d.ts b/client/node_modules/@types/node/constants.d.ts
new file mode 100644
index 0000000..c3ac2b8
--- /dev/null
+++ b/client/node_modules/@types/node/constants.d.ts
@@ -0,0 +1,19 @@
+/** @deprecated since v6.3.0 - use constants property exposed by the relevant module instead. */
+declare module "constants" {
+ import { constants as osConstants, SignalConstants } from "node:os";
+ import { constants as cryptoConstants } from "node:crypto";
+ import { constants as fsConstants } from "node:fs";
+
+ const exp:
+ & typeof osConstants.errno
+ & typeof osConstants.priority
+ & SignalConstants
+ & typeof cryptoConstants
+ & typeof fsConstants;
+ export = exp;
+}
+
+declare module "node:constants" {
+ import constants = require("constants");
+ export = constants;
+}
diff --git a/client/node_modules/@types/node/crypto.d.ts b/client/node_modules/@types/node/crypto.d.ts
new file mode 100644
index 0000000..c778aba
--- /dev/null
+++ b/client/node_modules/@types/node/crypto.d.ts
@@ -0,0 +1,4451 @@
+/**
+ * The `crypto` module provides cryptographic functionality that includes a set of
+ * wrappers for OpenSSL's hash, HMAC, cipher, decipher, sign, and verify functions.
+ *
+ * ```js
+ * const { createHmac } = await import('crypto');
+ *
+ * const secret = 'abcdefg';
+ * const hash = createHmac('sha256', secret)
+ * .update('I love cupcakes')
+ * .digest('hex');
+ * console.log(hash);
+ * // Prints:
+ * // c0fa1bc00531bd78ef38c628449c5102aeabd49b5dc3a2a516ea6ea959d6658e
+ * ```
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/crypto.js)
+ */
+declare module "crypto" {
+ import * as stream from "node:stream";
+ import { PeerCertificate } from "node:tls";
+ /**
+ * SPKAC is a Certificate Signing Request mechanism originally implemented by
+ * Netscape and was specified formally as part of [HTML5's `keygen` element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/keygen).
+ *
+ * `<keygen>` is deprecated since [HTML 5.2](https://www.w3.org/TR/html52/changes.html#features-removed) and new projects
+ * should not use this element anymore.
+ *
+ * The `crypto` module provides the `Certificate` class for working with SPKAC
+ * data. The most common usage is handling output generated by the HTML5`<keygen>` element. Node.js uses [OpenSSL's SPKAC
+ * implementation](https://www.openssl.org/docs/man1.1.0/apps/openssl-spkac.html) internally.
+ * @since v0.11.8
+ */
+ class Certificate {
+ /**
+ * ```js
+ * const { Certificate } = await import('crypto');
+ * const spkac = getSpkacSomehow();
+ * const challenge = Certificate.exportChallenge(spkac);
+ * console.log(challenge.toString('utf8'));
+ * // Prints: the challenge as a UTF8 string
+ * ```
+ * @since v9.0.0
+ * @param encoding The `encoding` of the `spkac` string.
+ * @return The challenge component of the `spkac` data structure, which includes a public key and a challenge.
+ */
+ static exportChallenge(spkac: BinaryLike): Buffer;
+ /**
+ * ```js
+ * const { Certificate } = await import('crypto');
+ * const spkac = getSpkacSomehow();
+ * const publicKey = Certificate.exportPublicKey(spkac);
+ * console.log(publicKey);
+ * // Prints: the public key as <Buffer ...>
+ * ```
+ * @since v9.0.0
+ * @param encoding The `encoding` of the `spkac` string.
+ * @return The public key component of the `spkac` data structure, which includes a public key and a challenge.
+ */
+ static exportPublicKey(spkac: BinaryLike, encoding?: string): Buffer;
+ /**
+ * ```js
+ * import { Buffer } from 'buffer';
+ * const { Certificate } = await import('crypto');
+ *
+ * const spkac = getSpkacSomehow();
+ * console.log(Certificate.verifySpkac(Buffer.from(spkac)));
+ * // Prints: true or false
+ * ```
+ * @since v9.0.0
+ * @param encoding The `encoding` of the `spkac` string.
+ * @return `true` if the given `spkac` data structure is valid, `false` otherwise.
+ */
+ static verifySpkac(spkac: NodeJS.ArrayBufferView): boolean;
+ /**
+ * @deprecated
+ * @param spkac
+ * @returns The challenge component of the `spkac` data structure,
+ * which includes a public key and a challenge.
+ */
+ exportChallenge(spkac: BinaryLike): Buffer;
+ /**
+ * @deprecated
+ * @param spkac
+ * @param encoding The encoding of the spkac string.
+ * @returns The public key component of the `spkac` data structure,
+ * which includes a public key and a challenge.
+ */
+ exportPublicKey(spkac: BinaryLike, encoding?: string): Buffer;
+ /**
+ * @deprecated
+ * @param spkac
+ * @returns `true` if the given `spkac` data structure is valid,
+ * `false` otherwise.
+ */
+ verifySpkac(spkac: NodeJS.ArrayBufferView): boolean;
+ }
+ namespace constants {
+ // https://nodejs.org/dist/latest-v10.x/docs/api/crypto.html#crypto_crypto_constants
+ const OPENSSL_VERSION_NUMBER: number;
+ /** Applies multiple bug workarounds within OpenSSL. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html for detail. */
+ const SSL_OP_ALL: number;
+ /** Allows legacy insecure renegotiation between OpenSSL and unpatched clients or servers. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html. */
+ const SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION: number;
+ /** Attempts to use the server's preferences instead of the client's when selecting a cipher. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html. */
+ const SSL_OP_CIPHER_SERVER_PREFERENCE: number;
+ /** Instructs OpenSSL to use Cisco's "speshul" version of DTLS_BAD_VER. */
+ const SSL_OP_CISCO_ANYCONNECT: number;
+ /** Instructs OpenSSL to turn on cookie exchange. */
+ const SSL_OP_COOKIE_EXCHANGE: number;
+ /** Instructs OpenSSL to add server-hello extension from an early version of the cryptopro draft. */
+ const SSL_OP_CRYPTOPRO_TLSEXT_BUG: number;
+ /** Instructs OpenSSL to disable a SSL 3.0/TLS 1.0 vulnerability workaround added in OpenSSL 0.9.6d. */
+ const SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS: number;
+ /** Instructs OpenSSL to always use the tmp_rsa key when performing RSA operations. */
+ const SSL_OP_EPHEMERAL_RSA: number;
+ /** Allows initial connection to servers that do not support RI. */
+ const SSL_OP_LEGACY_SERVER_CONNECT: number;
+ const SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER: number;
+ const SSL_OP_MICROSOFT_SESS_ID_BUG: number;
+ /** Instructs OpenSSL to disable the workaround for a man-in-the-middle protocol-version vulnerability in the SSL 2.0 server implementation. */
+ const SSL_OP_MSIE_SSLV2_RSA_PADDING: number;
+ const SSL_OP_NETSCAPE_CA_DN_BUG: number;
+ const SSL_OP_NETSCAPE_CHALLENGE_BUG: number;
+ const SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG: number;
+ const SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG: number;
+ /** Instructs OpenSSL to disable support for SSL/TLS compression. */
+ const SSL_OP_NO_COMPRESSION: number;
+ const SSL_OP_NO_QUERY_MTU: number;
+ /** Instructs OpenSSL to always start a new session when performing renegotiation. */
+ const SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION: number;
+ const SSL_OP_NO_SSLv2: number;
+ const SSL_OP_NO_SSLv3: number;
+ const SSL_OP_NO_TICKET: number;
+ const SSL_OP_NO_TLSv1: number;
+ const SSL_OP_NO_TLSv1_1: number;
+ const SSL_OP_NO_TLSv1_2: number;
+ const SSL_OP_PKCS1_CHECK_1: number;
+ const SSL_OP_PKCS1_CHECK_2: number;
+ /** Instructs OpenSSL to always create a new key when using temporary/ephemeral DH parameters. */
+ const SSL_OP_SINGLE_DH_USE: number;
+ /** Instructs OpenSSL to always create a new key when using temporary/ephemeral ECDH parameters. */
+ const SSL_OP_SINGLE_ECDH_USE: number;
+ const SSL_OP_SSLEAY_080_CLIENT_DH_BUG: number;
+ const SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG: number;
+ const SSL_OP_TLS_BLOCK_PADDING_BUG: number;
+ const SSL_OP_TLS_D5_BUG: number;
+ /** Instructs OpenSSL to disable version rollback attack detection. */
+ const SSL_OP_TLS_ROLLBACK_BUG: number;
+ const ENGINE_METHOD_RSA: number;
+ const ENGINE_METHOD_DSA: number;
+ const ENGINE_METHOD_DH: number;
+ const ENGINE_METHOD_RAND: number;
+ const ENGINE_METHOD_EC: number;
+ const ENGINE_METHOD_CIPHERS: number;
+ const ENGINE_METHOD_DIGESTS: number;
+ const ENGINE_METHOD_PKEY_METHS: number;
+ const ENGINE_METHOD_PKEY_ASN1_METHS: number;
+ const ENGINE_METHOD_ALL: number;
+ const ENGINE_METHOD_NONE: number;
+ const DH_CHECK_P_NOT_SAFE_PRIME: number;
+ const DH_CHECK_P_NOT_PRIME: number;
+ const DH_UNABLE_TO_CHECK_GENERATOR: number;
+ const DH_NOT_SUITABLE_GENERATOR: number;
+ const ALPN_ENABLED: number;
+ const RSA_PKCS1_PADDING: number;
+ const RSA_SSLV23_PADDING: number;
+ const RSA_NO_PADDING: number;
+ const RSA_PKCS1_OAEP_PADDING: number;
+ const RSA_X931_PADDING: number;
+ const RSA_PKCS1_PSS_PADDING: number;
+ /** Sets the salt length for RSA_PKCS1_PSS_PADDING to the digest size when signing or verifying. */
+ const RSA_PSS_SALTLEN_DIGEST: number;
+ /** Sets the salt length for RSA_PKCS1_PSS_PADDING to the maximum permissible value when signing data. */
+ const RSA_PSS_SALTLEN_MAX_SIGN: number;
+ /** Causes the salt length for RSA_PKCS1_PSS_PADDING to be determined automatically when verifying a signature. */
+ const RSA_PSS_SALTLEN_AUTO: number;
+ const POINT_CONVERSION_COMPRESSED: number;
+ const POINT_CONVERSION_UNCOMPRESSED: number;
+ const POINT_CONVERSION_HYBRID: number;
+ /** Specifies the built-in default cipher list used by Node.js (colon-separated values). */
+ const defaultCoreCipherList: string;
+ /** Specifies the active default cipher list used by the current Node.js process (colon-separated values). */
+ const defaultCipherList: string;
+ }
+ interface HashOptions extends stream.TransformOptions {
+ /**
+ * For XOF hash functions such as `shake256`, the
+ * outputLength option can be used to specify the desired output length in bytes.
+ */
+ outputLength?: number | undefined;
+ }
+ /** @deprecated since v10.0.0 */
+ const fips: boolean;
+ /**
+ * Creates and returns a `Hash` object that can be used to generate hash digests
+ * using the given `algorithm`. Optional `options` argument controls stream
+ * behavior. For XOF hash functions such as `'shake256'`, the `outputLength` option
+ * can be used to specify the desired output length in bytes.
+ *
+ * The `algorithm` is dependent on the available algorithms supported by the
+ * version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc.
+ * On recent releases of OpenSSL, `openssl list -digest-algorithms` will
+ * display the available digest algorithms.
+ *
+ * Example: generating the sha256 sum of a file
+ *
+ * ```js
+ * import {
+ * createReadStream
+ * } from 'fs';
+ * import { argv } from 'process';
+ * const {
+ * createHash
+ * } = await import('crypto');
+ *
+ * const filename = argv[2];
+ *
+ * const hash = createHash('sha256');
+ *
+ * const input = createReadStream(filename);
+ * input.on('readable', () => {
+ * // Only one element is going to be produced by the
+ * // hash stream.
+ * const data = input.read();
+ * if (data)
+ * hash.update(data);
+ * else {
+ * console.log(`${hash.digest('hex')} ${filename}`);
+ * }
+ * });
+ * ```
+ * @since v0.1.92
+ * @param options `stream.transform` options
+ */
+ function createHash(algorithm: string, options?: HashOptions): Hash;
+ /**
+ * Creates and returns an `Hmac` object that uses the given `algorithm` and `key`.
+ * Optional `options` argument controls stream behavior.
+ *
+ * The `algorithm` is dependent on the available algorithms supported by the
+ * version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc.
+ * On recent releases of OpenSSL, `openssl list -digest-algorithms` will
+ * display the available digest algorithms.
+ *
+ * The `key` is the HMAC key used to generate the cryptographic HMAC hash. If it is
+ * a `KeyObject`, its type must be `secret`.
+ *
+ * Example: generating the sha256 HMAC of a file
+ *
+ * ```js
+ * import {
+ * createReadStream
+ * } from 'fs';
+ * import { argv } from 'process';
+ * const {
+ * createHmac
+ * } = await import('crypto');
+ *
+ * const filename = argv[2];
+ *
+ * const hmac = createHmac('sha256', 'a secret');
+ *
+ * const input = createReadStream(filename);
+ * input.on('readable', () => {
+ * // Only one element is going to be produced by the
+ * // hash stream.
+ * const data = input.read();
+ * if (data)
+ * hmac.update(data);
+ * else {
+ * console.log(`${hmac.digest('hex')} ${filename}`);
+ * }
+ * });
+ * ```
+ * @since v0.1.94
+ * @param options `stream.transform` options
+ */
+ function createHmac(algorithm: string, key: BinaryLike | KeyObject, options?: stream.TransformOptions): Hmac;
+ // https://nodejs.org/api/buffer.html#buffer_buffers_and_character_encodings
+ type BinaryToTextEncoding = "base64" | "base64url" | "hex" | "binary";
+ type CharacterEncoding = "utf8" | "utf-8" | "utf16le" | "latin1";
+ type LegacyCharacterEncoding = "ascii" | "binary" | "ucs2" | "ucs-2";
+ type Encoding = BinaryToTextEncoding | CharacterEncoding | LegacyCharacterEncoding;
+ type ECDHKeyFormat = "compressed" | "uncompressed" | "hybrid";
+ /**
+ * The `Hash` class is a utility for creating hash digests of data. It can be
+ * used in one of two ways:
+ *
+ * * As a `stream` that is both readable and writable, where data is written
+ * to produce a computed hash digest on the readable side, or
+ * * Using the `hash.update()` and `hash.digest()` methods to produce the
+ * computed hash.
+ *
+ * The {@link createHash} method is used to create `Hash` instances. `Hash`objects are not to be created directly using the `new` keyword.
+ *
+ * Example: Using `Hash` objects as streams:
+ *
+ * ```js
+ * const {
+ * createHash
+ * } = await import('crypto');
+ *
+ * const hash = createHash('sha256');
+ *
+ * hash.on('readable', () => {
+ * // Only one element is going to be produced by the
+ * // hash stream.
+ * const data = hash.read();
+ * if (data) {
+ * console.log(data.toString('hex'));
+ * // Prints:
+ * // 6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50
+ * }
+ * });
+ *
+ * hash.write('some data to hash');
+ * hash.end();
+ * ```
+ *
+ * Example: Using `Hash` and piped streams:
+ *
+ * ```js
+ * import { createReadStream } from 'fs';
+ * import { stdout } from 'process';
+ * const { createHash } = await import('crypto');
+ *
+ * const hash = createHash('sha256');
+ *
+ * const input = createReadStream('test.js');
+ * input.pipe(hash).setEncoding('hex').pipe(stdout);
+ * ```
+ *
+ * Example: Using the `hash.update()` and `hash.digest()` methods:
+ *
+ * ```js
+ * const {
+ * createHash
+ * } = await import('crypto');
+ *
+ * const hash = createHash('sha256');
+ *
+ * hash.update('some data to hash');
+ * console.log(hash.digest('hex'));
+ * // Prints:
+ * // 6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50
+ * ```
+ * @since v0.1.92
+ */
+ class Hash extends stream.Transform {
+ private constructor();
+ /**
+ * Creates a new `Hash` object that contains a deep copy of the internal state
+ * of the current `Hash` object.
+ *
+ * The optional `options` argument controls stream behavior. For XOF hash
+ * functions such as `'shake256'`, the `outputLength` option can be used to
+ * specify the desired output length in bytes.
+ *
+ * An error is thrown when an attempt is made to copy the `Hash` object after
+ * its `hash.digest()` method has been called.
+ *
+ * ```js
+ * // Calculate a rolling hash.
+ * const {
+ * createHash
+ * } = await import('crypto');
+ *
+ * const hash = createHash('sha256');
+ *
+ * hash.update('one');
+ * console.log(hash.copy().digest('hex'));
+ *
+ * hash.update('two');
+ * console.log(hash.copy().digest('hex'));
+ *
+ * hash.update('three');
+ * console.log(hash.copy().digest('hex'));
+ *
+ * // Etc.
+ * ```
+ * @since v13.1.0
+ * @param options `stream.transform` options
+ */
+ copy(options?: stream.TransformOptions): Hash;
+ /**
+ * Updates the hash content with the given `data`, the encoding of which
+ * is given in `inputEncoding`.
+ * If `encoding` is not provided, and the `data` is a string, an
+ * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored.
+ *
+ * This can be called many times with new data as it is streamed.
+ * @since v0.1.92
+ * @param inputEncoding The `encoding` of the `data` string.
+ */
+ update(data: BinaryLike): Hash;
+ update(data: string, inputEncoding: Encoding): Hash;
+ /**
+ * Calculates the digest of all of the data passed to be hashed (using the `hash.update()` method).
+ * If `encoding` is provided a string will be returned; otherwise
+ * a `Buffer` is returned.
+ *
+ * The `Hash` object can not be used again after `hash.digest()` method has been
+ * called. Multiple calls will cause an error to be thrown.
+ * @since v0.1.92
+ * @param encoding The `encoding` of the return value.
+ */
+ digest(): Buffer;
+ digest(encoding: BinaryToTextEncoding): string;
+ }
+ /**
+ * The `Hmac` class is a utility for creating cryptographic HMAC digests. It can
+ * be used in one of two ways:
+ *
+ * * As a `stream` that is both readable and writable, where data is written
+ * to produce a computed HMAC digest on the readable side, or
+ * * Using the `hmac.update()` and `hmac.digest()` methods to produce the
+ * computed HMAC digest.
+ *
+ * The {@link createHmac} method is used to create `Hmac` instances. `Hmac`objects are not to be created directly using the `new` keyword.
+ *
+ * Example: Using `Hmac` objects as streams:
+ *
+ * ```js
+ * const {
+ * createHmac
+ * } = await import('crypto');
+ *
+ * const hmac = createHmac('sha256', 'a secret');
+ *
+ * hmac.on('readable', () => {
+ * // Only one element is going to be produced by the
+ * // hash stream.
+ * const data = hmac.read();
+ * if (data) {
+ * console.log(data.toString('hex'));
+ * // Prints:
+ * // 7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e
+ * }
+ * });
+ *
+ * hmac.write('some data to hash');
+ * hmac.end();
+ * ```
+ *
+ * Example: Using `Hmac` and piped streams:
+ *
+ * ```js
+ * import { createReadStream } from 'fs';
+ * import { stdout } from 'process';
+ * const {
+ * createHmac
+ * } = await import('crypto');
+ *
+ * const hmac = createHmac('sha256', 'a secret');
+ *
+ * const input = createReadStream('test.js');
+ * input.pipe(hmac).pipe(stdout);
+ * ```
+ *
+ * Example: Using the `hmac.update()` and `hmac.digest()` methods:
+ *
+ * ```js
+ * const {
+ * createHmac
+ * } = await import('crypto');
+ *
+ * const hmac = createHmac('sha256', 'a secret');
+ *
+ * hmac.update('some data to hash');
+ * console.log(hmac.digest('hex'));
+ * // Prints:
+ * // 7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e
+ * ```
+ * @since v0.1.94
+ */
+ class Hmac extends stream.Transform {
+ private constructor();
+ /**
+ * Updates the `Hmac` content with the given `data`, the encoding of which
+ * is given in `inputEncoding`.
+ * If `encoding` is not provided, and the `data` is a string, an
+ * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored.
+ *
+ * This can be called many times with new data as it is streamed.
+ * @since v0.1.94
+ * @param inputEncoding The `encoding` of the `data` string.
+ */
+ update(data: BinaryLike): Hmac;
+ update(data: string, inputEncoding: Encoding): Hmac;
+ /**
+ * Calculates the HMAC digest of all of the data passed using `hmac.update()`.
+ * If `encoding` is
+ * provided a string is returned; otherwise a `Buffer` is returned;
+ *
+ * The `Hmac` object can not be used again after `hmac.digest()` has been
+ * called. Multiple calls to `hmac.digest()` will result in an error being thrown.
+ * @since v0.1.94
+ * @param encoding The `encoding` of the return value.
+ */
+ digest(): Buffer;
+ digest(encoding: BinaryToTextEncoding): string;
+ }
+ type KeyObjectType = "secret" | "public" | "private";
+ interface KeyExportOptions<T extends KeyFormat> {
+ type: "pkcs1" | "spki" | "pkcs8" | "sec1";
+ format: T;
+ cipher?: string | undefined;
+ passphrase?: string | Buffer | undefined;
+ }
+ interface JwkKeyExportOptions {
+ format: "jwk";
+ }
+ interface JsonWebKey {
+ crv?: string | undefined;
+ d?: string | undefined;
+ dp?: string | undefined;
+ dq?: string | undefined;
+ e?: string | undefined;
+ k?: string | undefined;
+ kty?: string | undefined;
+ n?: string | undefined;
+ p?: string | undefined;
+ q?: string | undefined;
+ qi?: string | undefined;
+ x?: string | undefined;
+ y?: string | undefined;
+ [key: string]: unknown;
+ }
+ interface AsymmetricKeyDetails {
+ /**
+ * Key size in bits (RSA, DSA).
+ */
+ modulusLength?: number | undefined;
+ /**
+ * Public exponent (RSA).
+ */
+ publicExponent?: bigint | undefined;
+ /**
+ * Name of the message digest (RSA-PSS).
+ */
+ hashAlgorithm?: string | undefined;
+ /**
+ * Name of the message digest used by MGF1 (RSA-PSS).
+ */
+ mgf1HashAlgorithm?: string | undefined;
+ /**
+ * Minimal salt length in bytes (RSA-PSS).
+ */
+ saltLength?: number | undefined;
+ /**
+ * Size of q in bits (DSA).
+ */
+ divisorLength?: number | undefined;
+ /**
+ * Name of the curve (EC).
+ */
+ namedCurve?: string | undefined;
+ }
+ /**
+ * Node.js uses a `KeyObject` class to represent a symmetric or asymmetric key,
+ * and each kind of key exposes different functions. The {@link createSecretKey}, {@link createPublicKey} and {@link createPrivateKey} methods are used to create `KeyObject`instances. `KeyObject`
+ * objects are not to be created directly using the `new`keyword.
+ *
+ * Most applications should consider using the new `KeyObject` API instead of
+ * passing keys as strings or `Buffer`s due to improved security features.
+ *
+ * `KeyObject` instances can be passed to other threads via `postMessage()`.
+ * The receiver obtains a cloned `KeyObject`, and the `KeyObject` does not need to
+ * be listed in the `transferList` argument.
+ * @since v11.6.0
+ */
+ class KeyObject {
+ private constructor();
+ /**
+ * Example: Converting a `CryptoKey` instance to a `KeyObject`:
+ *
+ * ```js
+ * const { webcrypto, KeyObject } = await import('crypto');
+ * const { subtle } = webcrypto;
+ *
+ * const key = await subtle.generateKey({
+ * name: 'HMAC',
+ * hash: 'SHA-256',
+ * length: 256
+ * }, true, ['sign', 'verify']);
+ *
+ * const keyObject = KeyObject.from(key);
+ * console.log(keyObject.symmetricKeySize);
+ * // Prints: 32 (symmetric key size in bytes)
+ * ```
+ * @since v15.0.0
+ */
+ static from(key: webcrypto.CryptoKey): KeyObject;
+ /**
+ * For asymmetric keys, this property represents the type of the key. Supported key
+ * types are:
+ *
+ * * `'rsa'` (OID 1.2.840.113549.1.1.1)
+ * * `'rsa-pss'` (OID 1.2.840.113549.1.1.10)
+ * * `'dsa'` (OID 1.2.840.10040.4.1)
+ * * `'ec'` (OID 1.2.840.10045.2.1)
+ * * `'x25519'` (OID 1.3.101.110)
+ * * `'x448'` (OID 1.3.101.111)
+ * * `'ed25519'` (OID 1.3.101.112)
+ * * `'ed448'` (OID 1.3.101.113)
+ * * `'dh'` (OID 1.2.840.113549.1.3.1)
+ *
+ * This property is `undefined` for unrecognized `KeyObject` types and symmetric
+ * keys.
+ * @since v11.6.0
+ */
+ asymmetricKeyType?: KeyType | undefined;
+ /**
+ * For asymmetric keys, this property represents the size of the embedded key in
+ * bytes. This property is `undefined` for symmetric keys.
+ */
+ asymmetricKeySize?: number | undefined;
+ /**
+ * This property exists only on asymmetric keys. Depending on the type of the key,
+ * this object contains information about the key. None of the information obtained
+ * through this property can be used to uniquely identify a key or to compromise
+ * the security of the key.
+ *
+ * For RSA-PSS keys, if the key material contains a `RSASSA-PSS-params` sequence,
+ * the `hashAlgorithm`, `mgf1HashAlgorithm`, and `saltLength` properties will be
+ * set.
+ *
+ * Other key details might be exposed via this API using additional attributes.
+ * @since v15.7.0
+ */
+ asymmetricKeyDetails?: AsymmetricKeyDetails | undefined;
+ /**
+ * For symmetric keys, the following encoding options can be used:
+ *
+ * For public keys, the following encoding options can be used:
+ *
+ * For private keys, the following encoding options can be used:
+ *
+ * The result type depends on the selected encoding format, when PEM the
+ * result is a string, when DER it will be a buffer containing the data
+ * encoded as DER, when [JWK](https://tools.ietf.org/html/rfc7517) it will be an object.
+ *
+ * When [JWK](https://tools.ietf.org/html/rfc7517) encoding format was selected, all other encoding options are
+ * ignored.
+ *
+ * PKCS#1, SEC1, and PKCS#8 type keys can be encrypted by using a combination of
+ * the `cipher` and `format` options. The PKCS#8 `type` can be used with any`format` to encrypt any key algorithm (RSA, EC, or DH) by specifying a`cipher`. PKCS#1 and SEC1 can only be
+ * encrypted by specifying a `cipher`when the PEM `format` is used. For maximum compatibility, use PKCS#8 for
+ * encrypted private keys. Since PKCS#8 defines its own
+ * encryption mechanism, PEM-level encryption is not supported when encrypting
+ * a PKCS#8 key. See [RFC 5208](https://www.rfc-editor.org/rfc/rfc5208.txt) for PKCS#8 encryption and [RFC 1421](https://www.rfc-editor.org/rfc/rfc1421.txt) for
+ * PKCS#1 and SEC1 encryption.
+ * @since v11.6.0
+ */
+ export(options: KeyExportOptions<"pem">): string | Buffer;
+ export(options?: KeyExportOptions<"der">): Buffer;
+ export(options?: JwkKeyExportOptions): JsonWebKey;
+ /**
+ * For secret keys, this property represents the size of the key in bytes. This
+ * property is `undefined` for asymmetric keys.
+ * @since v11.6.0
+ */
+ symmetricKeySize?: number | undefined;
+ /**
+ * Depending on the type of this `KeyObject`, this property is either`'secret'` for secret (symmetric) keys, `'public'` for public (asymmetric) keys
+ * or `'private'` for private (asymmetric) keys.
+ * @since v11.6.0
+ */
+ type: KeyObjectType;
+ }
+ type CipherCCMTypes = "aes-128-ccm" | "aes-192-ccm" | "aes-256-ccm" | "chacha20-poly1305";
+ type CipherGCMTypes = "aes-128-gcm" | "aes-192-gcm" | "aes-256-gcm";
+ type CipherOCBTypes = "aes-128-ocb" | "aes-192-ocb" | "aes-256-ocb";
+ type BinaryLike = string | NodeJS.ArrayBufferView;
+ type CipherKey = BinaryLike | KeyObject;
+ interface CipherCCMOptions extends stream.TransformOptions {
+ authTagLength: number;
+ }
+ interface CipherGCMOptions extends stream.TransformOptions {
+ authTagLength?: number | undefined;
+ }
+ interface CipherOCBOptions extends stream.TransformOptions {
+ authTagLength: number;
+ }
+ /**
+ * Creates and returns a `Cipher` object that uses the given `algorithm` and`password`.
+ *
+ * The `options` argument controls stream behavior and is optional except when a
+ * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the
+ * authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength`option is not required but can be used to set the length of the authentication
+ * tag that will be returned by `getAuthTag()` and defaults to 16 bytes.
+ * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes.
+ *
+ * The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On
+ * recent OpenSSL releases, `openssl list -cipher-algorithms` will
+ * display the available cipher algorithms.
+ *
+ * The `password` is used to derive the cipher key and initialization vector (IV).
+ * The value must be either a `'latin1'` encoded string, a `Buffer`, a`TypedArray`, or a `DataView`.
+ *
+ * The implementation of `crypto.createCipher()` derives keys using the OpenSSL
+ * function [`EVP_BytesToKey`](https://www.openssl.org/docs/man1.1.0/crypto/EVP_BytesToKey.html) with the digest algorithm set to MD5, one
+ * iteration, and no salt. The lack of salt allows dictionary attacks as the same
+ * password always creates the same key. The low iteration count and
+ * non-cryptographically secure hash algorithm allow passwords to be tested very
+ * rapidly.
+ *
+ * In line with OpenSSL's recommendation to use a more modern algorithm instead of [`EVP_BytesToKey`](https://www.openssl.org/docs/man1.1.0/crypto/EVP_BytesToKey.html) it is recommended that
+ * developers derive a key and IV on
+ * their own using {@link scrypt} and to use {@link createCipheriv} to create the `Cipher` object. Users should not use ciphers with counter mode
+ * (e.g. CTR, GCM, or CCM) in `crypto.createCipher()`. A warning is emitted when
+ * they are used in order to avoid the risk of IV reuse that causes
+ * vulnerabilities. For the case when IV is reused in GCM, see [Nonce-Disrespecting Adversaries](https://github.com/nonce-disrespect/nonce-disrespect) for details.
+ * @since v0.1.94
+ * @deprecated Since v10.0.0 - Use {@link createCipheriv} instead.
+ * @param options `stream.transform` options
+ */
+ function createCipher(algorithm: CipherCCMTypes, password: BinaryLike, options: CipherCCMOptions): CipherCCM;
+ /** @deprecated since v10.0.0 use `createCipheriv()` */
+ function createCipher(algorithm: CipherGCMTypes, password: BinaryLike, options?: CipherGCMOptions): CipherGCM;
+ /** @deprecated since v10.0.0 use `createCipheriv()` */
+ function createCipher(algorithm: string, password: BinaryLike, options?: stream.TransformOptions): Cipher;
+ /**
+ * Creates and returns a `Cipher` object, with the given `algorithm`, `key` and
+ * initialization vector (`iv`).
+ *
+ * The `options` argument controls stream behavior and is optional except when a
+ * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the
+ * authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength`option is not required but can be used to set the length of the authentication
+ * tag that will be returned by `getAuthTag()` and defaults to 16 bytes.
+ * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes.
+ *
+ * The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On
+ * recent OpenSSL releases, `openssl list -cipher-algorithms` will
+ * display the available cipher algorithms.
+ *
+ * The `key` is the raw key used by the `algorithm` and `iv` is an [initialization vector](https://en.wikipedia.org/wiki/Initialization_vector). Both arguments must be `'utf8'` encoded
+ * strings,`Buffers`, `TypedArray`, or `DataView`s. The `key` may optionally be
+ * a `KeyObject` of type `secret`. If the cipher does not need
+ * an initialization vector, `iv` may be `null`.
+ *
+ * When passing strings for `key` or `iv`, please consider `caveats when using strings as inputs to cryptographic APIs`.
+ *
+ * Initialization vectors should be unpredictable and unique; ideally, they will be
+ * cryptographically random. They do not have to be secret: IVs are typically just
+ * added to ciphertext messages unencrypted. It may sound contradictory that
+ * something has to be unpredictable and unique, but does not have to be secret;
+ * remember that an attacker must not be able to predict ahead of time what a
+ * given IV will be.
+ * @since v0.1.94
+ * @param options `stream.transform` options
+ */
+ function createCipheriv(
+ algorithm: CipherCCMTypes,
+ key: CipherKey,
+ iv: BinaryLike,
+ options: CipherCCMOptions,
+ ): CipherCCM;
+ function createCipheriv(
+ algorithm: CipherOCBTypes,
+ key: CipherKey,
+ iv: BinaryLike,
+ options: CipherOCBOptions,
+ ): CipherOCB;
+ function createCipheriv(
+ algorithm: CipherGCMTypes,
+ key: CipherKey,
+ iv: BinaryLike,
+ options?: CipherGCMOptions,
+ ): CipherGCM;
+ function createCipheriv(
+ algorithm: string,
+ key: CipherKey,
+ iv: BinaryLike | null,
+ options?: stream.TransformOptions,
+ ): Cipher;
+ /**
+ * Instances of the `Cipher` class are used to encrypt data. The class can be
+ * used in one of two ways:
+ *
+ * * As a `stream` that is both readable and writable, where plain unencrypted
+ * data is written to produce encrypted data on the readable side, or
+ * * Using the `cipher.update()` and `cipher.final()` methods to produce
+ * the encrypted data.
+ *
+ * The {@link createCipher} or {@link createCipheriv} methods are
+ * used to create `Cipher` instances. `Cipher` objects are not to be created
+ * directly using the `new` keyword.
+ *
+ * Example: Using `Cipher` objects as streams:
+ *
+ * ```js
+ * const {
+ * scrypt,
+ * randomFill,
+ * createCipheriv
+ * } = await import('crypto');
+ *
+ * const algorithm = 'aes-192-cbc';
+ * const password = 'Password used to generate key';
+ *
+ * // First, we'll generate the key. The key length is dependent on the algorithm.
+ * // In this case for aes192, it is 24 bytes (192 bits).
+ * scrypt(password, 'salt', 24, (err, key) => {
+ * if (err) throw err;
+ * // Then, we'll generate a random initialization vector
+ * randomFill(new Uint8Array(16), (err, iv) => {
+ * if (err) throw err;
+ *
+ * // Once we have the key and iv, we can create and use the cipher...
+ * const cipher = createCipheriv(algorithm, key, iv);
+ *
+ * let encrypted = '';
+ * cipher.setEncoding('hex');
+ *
+ * cipher.on('data', (chunk) => encrypted += chunk);
+ * cipher.on('end', () => console.log(encrypted));
+ *
+ * cipher.write('some clear text data');
+ * cipher.end();
+ * });
+ * });
+ * ```
+ *
+ * Example: Using `Cipher` and piped streams:
+ *
+ * ```js
+ * import {
+ * createReadStream,
+ * createWriteStream,
+ * } from 'fs';
+ *
+ * import {
+ * pipeline
+ * } from 'stream';
+ *
+ * const {
+ * scrypt,
+ * randomFill,
+ * createCipheriv
+ * } = await import('crypto');
+ *
+ * const algorithm = 'aes-192-cbc';
+ * const password = 'Password used to generate key';
+ *
+ * // First, we'll generate the key. The key length is dependent on the algorithm.
+ * // In this case for aes192, it is 24 bytes (192 bits).
+ * scrypt(password, 'salt', 24, (err, key) => {
+ * if (err) throw err;
+ * // Then, we'll generate a random initialization vector
+ * randomFill(new Uint8Array(16), (err, iv) => {
+ * if (err) throw err;
+ *
+ * const cipher = createCipheriv(algorithm, key, iv);
+ *
+ * const input = createReadStream('test.js');
+ * const output = createWriteStream('test.enc');
+ *
+ * pipeline(input, cipher, output, (err) => {
+ * if (err) throw err;
+ * });
+ * });
+ * });
+ * ```
+ *
+ * Example: Using the `cipher.update()` and `cipher.final()` methods:
+ *
+ * ```js
+ * const {
+ * scrypt,
+ * randomFill,
+ * createCipheriv
+ * } = await import('crypto');
+ *
+ * const algorithm = 'aes-192-cbc';
+ * const password = 'Password used to generate key';
+ *
+ * // First, we'll generate the key. The key length is dependent on the algorithm.
+ * // In this case for aes192, it is 24 bytes (192 bits).
+ * scrypt(password, 'salt', 24, (err, key) => {
+ * if (err) throw err;
+ * // Then, we'll generate a random initialization vector
+ * randomFill(new Uint8Array(16), (err, iv) => {
+ * if (err) throw err;
+ *
+ * const cipher = createCipheriv(algorithm, key, iv);
+ *
+ * let encrypted = cipher.update('some clear text data', 'utf8', 'hex');
+ * encrypted += cipher.final('hex');
+ * console.log(encrypted);
+ * });
+ * });
+ * ```
+ * @since v0.1.94
+ */
+ class Cipher extends stream.Transform {
+ private constructor();
+ /**
+ * Updates the cipher with `data`. If the `inputEncoding` argument is given,
+ * the `data`argument is a string using the specified encoding. If the `inputEncoding`argument is not given, `data` must be a `Buffer`, `TypedArray`, or`DataView`. If `data` is a `Buffer`,
+ * `TypedArray`, or `DataView`, then`inputEncoding` is ignored.
+ *
+ * The `outputEncoding` specifies the output format of the enciphered
+ * data. If the `outputEncoding`is specified, a string using the specified encoding is returned. If no`outputEncoding` is provided, a `Buffer` is returned.
+ *
+ * The `cipher.update()` method can be called multiple times with new data until `cipher.final()` is called. Calling `cipher.update()` after `cipher.final()` will result in an error being
+ * thrown.
+ * @since v0.1.94
+ * @param inputEncoding The `encoding` of the data.
+ * @param outputEncoding The `encoding` of the return value.
+ */
+ update(data: BinaryLike): Buffer;
+ update(data: string, inputEncoding: Encoding): Buffer;
+ update(data: NodeJS.ArrayBufferView, inputEncoding: undefined, outputEncoding: Encoding): string;
+ update(data: string, inputEncoding: Encoding | undefined, outputEncoding: Encoding): string;
+ /**
+ * Once the `cipher.final()` method has been called, the `Cipher` object can no
+ * longer be used to encrypt data. Attempts to call `cipher.final()` more than
+ * once will result in an error being thrown.
+ * @since v0.1.94
+ * @param outputEncoding The `encoding` of the return value.
+ * @return Any remaining enciphered contents. If `outputEncoding` is specified, a string is returned. If an `outputEncoding` is not provided, a {@link Buffer} is returned.
+ */
+ final(): Buffer;
+ final(outputEncoding: BufferEncoding): string;
+ /**
+ * When using block encryption algorithms, the `Cipher` class will automatically
+ * add padding to the input data to the appropriate block size. To disable the
+ * default padding call `cipher.setAutoPadding(false)`.
+ *
+ * When `autoPadding` is `false`, the length of the entire input data must be a
+ * multiple of the cipher's block size or `cipher.final()` will throw an error.
+ * Disabling automatic padding is useful for non-standard padding, for instance
+ * using `0x0` instead of PKCS padding.
+ *
+ * The `cipher.setAutoPadding()` method must be called before `cipher.final()`.
+ * @since v0.7.1
+ * @param [autoPadding=true]
+ * @return for method chaining.
+ */
+ setAutoPadding(autoPadding?: boolean): this;
+ }
+ interface CipherCCM extends Cipher {
+ setAAD(
+ buffer: NodeJS.ArrayBufferView,
+ options: {
+ plaintextLength: number;
+ },
+ ): this;
+ getAuthTag(): Buffer;
+ }
+ interface CipherGCM extends Cipher {
+ setAAD(
+ buffer: NodeJS.ArrayBufferView,
+ options?: {
+ plaintextLength: number;
+ },
+ ): this;
+ getAuthTag(): Buffer;
+ }
+ interface CipherOCB extends Cipher {
+ setAAD(
+ buffer: NodeJS.ArrayBufferView,
+ options?: {
+ plaintextLength: number;
+ },
+ ): this;
+ getAuthTag(): Buffer;
+ }
+ /**
+ * Creates and returns a `Decipher` object that uses the given `algorithm` and`password` (key).
+ *
+ * The `options` argument controls stream behavior and is optional except when a
+ * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the
+ * authentication tag in bytes, see `CCM mode`.
+ * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes.
+ *
+ * The implementation of `crypto.createDecipher()` derives keys using the OpenSSL
+ * function [`EVP_BytesToKey`](https://www.openssl.org/docs/man1.1.0/crypto/EVP_BytesToKey.html) with the digest algorithm set to MD5, one
+ * iteration, and no salt. The lack of salt allows dictionary attacks as the same
+ * password always creates the same key. The low iteration count and
+ * non-cryptographically secure hash algorithm allow passwords to be tested very
+ * rapidly.
+ *
+ * In line with OpenSSL's recommendation to use a more modern algorithm instead of [`EVP_BytesToKey`](https://www.openssl.org/docs/man1.1.0/crypto/EVP_BytesToKey.html) it is recommended that
+ * developers derive a key and IV on
+ * their own using {@link scrypt} and to use {@link createDecipheriv} to create the `Decipher` object.
+ * @since v0.1.94
+ * @deprecated Since v10.0.0 - Use {@link createDecipheriv} instead.
+ * @param options `stream.transform` options
+ */
+ function createDecipher(algorithm: CipherCCMTypes, password: BinaryLike, options: CipherCCMOptions): DecipherCCM;
+ /** @deprecated since v10.0.0 use `createDecipheriv()` */
+ function createDecipher(algorithm: CipherGCMTypes, password: BinaryLike, options?: CipherGCMOptions): DecipherGCM;
+ /** @deprecated since v10.0.0 use `createDecipheriv()` */
+ function createDecipher(algorithm: string, password: BinaryLike, options?: stream.TransformOptions): Decipher;
+ /**
+ * Creates and returns a `Decipher` object that uses the given `algorithm`, `key`and initialization vector (`iv`).
+ *
+ * The `options` argument controls stream behavior and is optional except when a
+ * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the
+ * authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength`option is not required but can be used to restrict accepted authentication tags
+ * to those with the specified length.
+ * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes.
+ *
+ * The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On
+ * recent OpenSSL releases, `openssl list -cipher-algorithms` will
+ * display the available cipher algorithms.
+ *
+ * The `key` is the raw key used by the `algorithm` and `iv` is an [initialization vector](https://en.wikipedia.org/wiki/Initialization_vector). Both arguments must be `'utf8'` encoded
+ * strings,`Buffers`, `TypedArray`, or `DataView`s. The `key` may optionally be
+ * a `KeyObject` of type `secret`. If the cipher does not need
+ * an initialization vector, `iv` may be `null`.
+ *
+ * When passing strings for `key` or `iv`, please consider `caveats when using strings as inputs to cryptographic APIs`.
+ *
+ * Initialization vectors should be unpredictable and unique; ideally, they will be
+ * cryptographically random. They do not have to be secret: IVs are typically just
+ * added to ciphertext messages unencrypted. It may sound contradictory that
+ * something has to be unpredictable and unique, but does not have to be secret;
+ * remember that an attacker must not be able to predict ahead of time what a given
+ * IV will be.
+ * @since v0.1.94
+ * @param options `stream.transform` options
+ */
+ function createDecipheriv(
+ algorithm: CipherCCMTypes,
+ key: CipherKey,
+ iv: BinaryLike,
+ options: CipherCCMOptions,
+ ): DecipherCCM;
+ function createDecipheriv(
+ algorithm: CipherOCBTypes,
+ key: CipherKey,
+ iv: BinaryLike,
+ options: CipherOCBOptions,
+ ): DecipherOCB;
+ function createDecipheriv(
+ algorithm: CipherGCMTypes,
+ key: CipherKey,
+ iv: BinaryLike,
+ options?: CipherGCMOptions,
+ ): DecipherGCM;
+ function createDecipheriv(
+ algorithm: string,
+ key: CipherKey,
+ iv: BinaryLike | null,
+ options?: stream.TransformOptions,
+ ): Decipher;
+ /**
+ * Instances of the `Decipher` class are used to decrypt data. The class can be
+ * used in one of two ways:
+ *
+ * * As a `stream` that is both readable and writable, where plain encrypted
+ * data is written to produce unencrypted data on the readable side, or
+ * * Using the `decipher.update()` and `decipher.final()` methods to
+ * produce the unencrypted data.
+ *
+ * The {@link createDecipher} or {@link createDecipheriv} methods are
+ * used to create `Decipher` instances. `Decipher` objects are not to be created
+ * directly using the `new` keyword.
+ *
+ * Example: Using `Decipher` objects as streams:
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ * const {
+ * scryptSync,
+ * createDecipheriv
+ * } = await import('crypto');
+ *
+ * const algorithm = 'aes-192-cbc';
+ * const password = 'Password used to generate key';
+ * // Key length is dependent on the algorithm. In this case for aes192, it is
+ * // 24 bytes (192 bits).
+ * // Use the async `crypto.scrypt()` instead.
+ * const key = scryptSync(password, 'salt', 24);
+ * // The IV is usually passed along with the ciphertext.
+ * const iv = Buffer.alloc(16, 0); // Initialization vector.
+ *
+ * const decipher = createDecipheriv(algorithm, key, iv);
+ *
+ * let decrypted = '';
+ * decipher.on('readable', () => {
+ * while (null !== (chunk = decipher.read())) {
+ * decrypted += chunk.toString('utf8');
+ * }
+ * });
+ * decipher.on('end', () => {
+ * console.log(decrypted);
+ * // Prints: some clear text data
+ * });
+ *
+ * // Encrypted with same algorithm, key and iv.
+ * const encrypted =
+ * 'e5f79c5915c02171eec6b212d5520d44480993d7d622a7c4c2da32f6efda0ffa';
+ * decipher.write(encrypted, 'hex');
+ * decipher.end();
+ * ```
+ *
+ * Example: Using `Decipher` and piped streams:
+ *
+ * ```js
+ * import {
+ * createReadStream,
+ * createWriteStream,
+ * } from 'fs';
+ * import { Buffer } from 'buffer';
+ * const {
+ * scryptSync,
+ * createDecipheriv
+ * } = await import('crypto');
+ *
+ * const algorithm = 'aes-192-cbc';
+ * const password = 'Password used to generate key';
+ * // Use the async `crypto.scrypt()` instead.
+ * const key = scryptSync(password, 'salt', 24);
+ * // The IV is usually passed along with the ciphertext.
+ * const iv = Buffer.alloc(16, 0); // Initialization vector.
+ *
+ * const decipher = createDecipheriv(algorithm, key, iv);
+ *
+ * const input = createReadStream('test.enc');
+ * const output = createWriteStream('test.js');
+ *
+ * input.pipe(decipher).pipe(output);
+ * ```
+ *
+ * Example: Using the `decipher.update()` and `decipher.final()` methods:
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ * const {
+ * scryptSync,
+ * createDecipheriv
+ * } = await import('crypto');
+ *
+ * const algorithm = 'aes-192-cbc';
+ * const password = 'Password used to generate key';
+ * // Use the async `crypto.scrypt()` instead.
+ * const key = scryptSync(password, 'salt', 24);
+ * // The IV is usually passed along with the ciphertext.
+ * const iv = Buffer.alloc(16, 0); // Initialization vector.
+ *
+ * const decipher = createDecipheriv(algorithm, key, iv);
+ *
+ * // Encrypted using same algorithm, key and iv.
+ * const encrypted =
+ * 'e5f79c5915c02171eec6b212d5520d44480993d7d622a7c4c2da32f6efda0ffa';
+ * let decrypted = decipher.update(encrypted, 'hex', 'utf8');
+ * decrypted += decipher.final('utf8');
+ * console.log(decrypted);
+ * // Prints: some clear text data
+ * ```
+ * @since v0.1.94
+ */
+ class Decipher extends stream.Transform {
+ private constructor();
+ /**
+ * Updates the decipher with `data`. If the `inputEncoding` argument is given,
+ * the `data`argument is a string using the specified encoding. If the `inputEncoding`argument is not given, `data` must be a `Buffer`. If `data` is a `Buffer` then `inputEncoding` is
+ * ignored.
+ *
+ * The `outputEncoding` specifies the output format of the enciphered
+ * data. If the `outputEncoding`is specified, a string using the specified encoding is returned. If no`outputEncoding` is provided, a `Buffer` is returned.
+ *
+ * The `decipher.update()` method can be called multiple times with new data until `decipher.final()` is called. Calling `decipher.update()` after `decipher.final()` will result in an error
+ * being thrown.
+ * @since v0.1.94
+ * @param inputEncoding The `encoding` of the `data` string.
+ * @param outputEncoding The `encoding` of the return value.
+ */
+ update(data: NodeJS.ArrayBufferView): Buffer;
+ update(data: string, inputEncoding: Encoding): Buffer;
+ update(data: NodeJS.ArrayBufferView, inputEncoding: undefined, outputEncoding: Encoding): string;
+ update(data: string, inputEncoding: Encoding | undefined, outputEncoding: Encoding): string;
+ /**
+ * Once the `decipher.final()` method has been called, the `Decipher` object can
+ * no longer be used to decrypt data. Attempts to call `decipher.final()` more
+ * than once will result in an error being thrown.
+ * @since v0.1.94
+ * @param outputEncoding The `encoding` of the return value.
+ * @return Any remaining deciphered contents. If `outputEncoding` is specified, a string is returned. If an `outputEncoding` is not provided, a {@link Buffer} is returned.
+ */
+ final(): Buffer;
+ final(outputEncoding: BufferEncoding): string;
+ /**
+ * When data has been encrypted without standard block padding, calling`decipher.setAutoPadding(false)` will disable automatic padding to prevent `decipher.final()` from checking for and
+ * removing padding.
+ *
+ * Turning auto padding off will only work if the input data's length is a
+ * multiple of the ciphers block size.
+ *
+ * The `decipher.setAutoPadding()` method must be called before `decipher.final()`.
+ * @since v0.7.1
+ * @param [autoPadding=true]
+ * @return for method chaining.
+ */
+ setAutoPadding(auto_padding?: boolean): this;
+ }
+ interface DecipherCCM extends Decipher {
+ setAuthTag(buffer: NodeJS.ArrayBufferView): this;
+ setAAD(
+ buffer: NodeJS.ArrayBufferView,
+ options: {
+ plaintextLength: number;
+ },
+ ): this;
+ }
+ interface DecipherGCM extends Decipher {
+ setAuthTag(buffer: NodeJS.ArrayBufferView): this;
+ setAAD(
+ buffer: NodeJS.ArrayBufferView,
+ options?: {
+ plaintextLength: number;
+ },
+ ): this;
+ }
+ interface DecipherOCB extends Decipher {
+ setAuthTag(buffer: NodeJS.ArrayBufferView): this;
+ setAAD(
+ buffer: NodeJS.ArrayBufferView,
+ options?: {
+ plaintextLength: number;
+ },
+ ): this;
+ }
+ interface PrivateKeyInput {
+ key: string | Buffer;
+ format?: KeyFormat | undefined;
+ type?: "pkcs1" | "pkcs8" | "sec1" | undefined;
+ passphrase?: string | Buffer | undefined;
+ encoding?: string | undefined;
+ }
+ interface PublicKeyInput {
+ key: string | Buffer;
+ format?: KeyFormat | undefined;
+ type?: "pkcs1" | "spki" | undefined;
+ encoding?: string | undefined;
+ }
+ /**
+ * Asynchronously generates a new random secret key of the given `length`. The`type` will determine which validations will be performed on the `length`.
+ *
+ * ```js
+ * const {
+ * generateKey
+ * } = await import('crypto');
+ *
+ * generateKey('hmac', { length: 64 }, (err, key) => {
+ * if (err) throw err;
+ * console.log(key.export().toString('hex')); // 46e..........620
+ * });
+ * ```
+ * @since v15.0.0
+ * @param type The intended use of the generated secret key. Currently accepted values are `'hmac'` and `'aes'`.
+ */
+ function generateKey(
+ type: "hmac" | "aes",
+ options: {
+ length: number;
+ },
+ callback: (err: Error | null, key: KeyObject) => void,
+ ): void;
+ /**
+ * Synchronously generates a new random secret key of the given `length`. The`type` will determine which validations will be performed on the `length`.
+ *
+ * ```js
+ * const {
+ * generateKeySync
+ * } = await import('crypto');
+ *
+ * const key = generateKeySync('hmac', { length: 64 });
+ * console.log(key.export().toString('hex')); // e89..........41e
+ * ```
+ * @since v15.0.0
+ * @param type The intended use of the generated secret key. Currently accepted values are `'hmac'` and `'aes'`.
+ */
+ function generateKeySync(
+ type: "hmac" | "aes",
+ options: {
+ length: number;
+ },
+ ): KeyObject;
+ interface JsonWebKeyInput {
+ key: JsonWebKey;
+ format: "jwk";
+ }
+ /**
+ * Creates and returns a new key object containing a private key. If `key` is a
+ * string or `Buffer`, `format` is assumed to be `'pem'`; otherwise, `key`must be an object with the properties described above.
+ *
+ * If the private key is encrypted, a `passphrase` must be specified. The length
+ * of the passphrase is limited to 1024 bytes.
+ * @since v11.6.0
+ */
+ function createPrivateKey(key: PrivateKeyInput | string | Buffer | JsonWebKeyInput): KeyObject;
+ /**
+ * Creates and returns a new key object containing a public key. If `key` is a
+ * string or `Buffer`, `format` is assumed to be `'pem'`; if `key` is a `KeyObject`with type `'private'`, the public key is derived from the given private key;
+ * otherwise, `key` must be an object with the properties described above.
+ *
+ * If the format is `'pem'`, the `'key'` may also be an X.509 certificate.
+ *
+ * Because public keys can be derived from private keys, a private key may be
+ * passed instead of a public key. In that case, this function behaves as if {@link createPrivateKey} had been called, except that the type of the
+ * returned `KeyObject` will be `'public'` and that the private key cannot be
+ * extracted from the returned `KeyObject`. Similarly, if a `KeyObject` with type`'private'` is given, a new `KeyObject` with type `'public'` will be returned
+ * and it will be impossible to extract the private key from the returned object.
+ * @since v11.6.0
+ */
+ function createPublicKey(key: PublicKeyInput | string | Buffer | KeyObject | JsonWebKeyInput): KeyObject;
+ /**
+ * Creates and returns a new key object containing a secret key for symmetric
+ * encryption or `Hmac`.
+ * @since v11.6.0
+ * @param encoding The string encoding when `key` is a string.
+ */
+ function createSecretKey(key: NodeJS.ArrayBufferView): KeyObject;
+ function createSecretKey(key: string, encoding: BufferEncoding): KeyObject;
+ /**
+ * Creates and returns a `Sign` object that uses the given `algorithm`. Use {@link getHashes} to obtain the names of the available digest algorithms.
+ * Optional `options` argument controls the `stream.Writable` behavior.
+ *
+ * In some cases, a `Sign` instance can be created using the name of a signature
+ * algorithm, such as `'RSA-SHA256'`, instead of a digest algorithm. This will use
+ * the corresponding digest algorithm. This does not work for all signature
+ * algorithms, such as `'ecdsa-with-SHA256'`, so it is best to always use digest
+ * algorithm names.
+ * @since v0.1.92
+ * @param options `stream.Writable` options
+ */
+ function createSign(algorithm: string, options?: stream.WritableOptions): Sign;
+ type DSAEncoding = "der" | "ieee-p1363";
+ interface SigningOptions {
+ /**
+ * @see crypto.constants.RSA_PKCS1_PADDING
+ */
+ padding?: number | undefined;
+ saltLength?: number | undefined;
+ dsaEncoding?: DSAEncoding | undefined;
+ }
+ interface SignPrivateKeyInput extends PrivateKeyInput, SigningOptions {}
+ interface SignKeyObjectInput extends SigningOptions {
+ key: KeyObject;
+ }
+ interface VerifyPublicKeyInput extends PublicKeyInput, SigningOptions {}
+ interface VerifyKeyObjectInput extends SigningOptions {
+ key: KeyObject;
+ }
+ interface VerifyJsonWebKeyInput extends JsonWebKeyInput, SigningOptions {}
+ type KeyLike = string | Buffer | KeyObject;
+ /**
+ * The `Sign` class is a utility for generating signatures. It can be used in one
+ * of two ways:
+ *
+ * * As a writable `stream`, where data to be signed is written and the `sign.sign()` method is used to generate and return the signature, or
+ * * Using the `sign.update()` and `sign.sign()` methods to produce the
+ * signature.
+ *
+ * The {@link createSign} method is used to create `Sign` instances. The
+ * argument is the string name of the hash function to use. `Sign` objects are not
+ * to be created directly using the `new` keyword.
+ *
+ * Example: Using `Sign` and `Verify` objects as streams:
+ *
+ * ```js
+ * const {
+ * generateKeyPairSync,
+ * createSign,
+ * createVerify
+ * } = await import('crypto');
+ *
+ * const { privateKey, publicKey } = generateKeyPairSync('ec', {
+ * namedCurve: 'sect239k1'
+ * });
+ *
+ * const sign = createSign('SHA256');
+ * sign.write('some data to sign');
+ * sign.end();
+ * const signature = sign.sign(privateKey, 'hex');
+ *
+ * const verify = createVerify('SHA256');
+ * verify.write('some data to sign');
+ * verify.end();
+ * console.log(verify.verify(publicKey, signature, 'hex'));
+ * // Prints: true
+ * ```
+ *
+ * Example: Using the `sign.update()` and `verify.update()` methods:
+ *
+ * ```js
+ * const {
+ * generateKeyPairSync,
+ * createSign,
+ * createVerify
+ * } = await import('crypto');
+ *
+ * const { privateKey, publicKey } = generateKeyPairSync('rsa', {
+ * modulusLength: 2048,
+ * });
+ *
+ * const sign = createSign('SHA256');
+ * sign.update('some data to sign');
+ * sign.end();
+ * const signature = sign.sign(privateKey);
+ *
+ * const verify = createVerify('SHA256');
+ * verify.update('some data to sign');
+ * verify.end();
+ * console.log(verify.verify(publicKey, signature));
+ * // Prints: true
+ * ```
+ * @since v0.1.92
+ */
+ class Sign extends stream.Writable {
+ private constructor();
+ /**
+ * Updates the `Sign` content with the given `data`, the encoding of which
+ * is given in `inputEncoding`.
+ * If `encoding` is not provided, and the `data` is a string, an
+ * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored.
+ *
+ * This can be called many times with new data as it is streamed.
+ * @since v0.1.92
+ * @param inputEncoding The `encoding` of the `data` string.
+ */
+ update(data: BinaryLike): this;
+ update(data: string, inputEncoding: Encoding): this;
+ /**
+ * Calculates the signature on all the data passed through using either `sign.update()` or `sign.write()`.
+ *
+ * If `privateKey` is not a `KeyObject`, this function behaves as if`privateKey` had been passed to {@link createPrivateKey}. If it is an
+ * object, the following additional properties can be passed:
+ *
+ * If `outputEncoding` is provided a string is returned; otherwise a `Buffer` is returned.
+ *
+ * The `Sign` object can not be again used after `sign.sign()` method has been
+ * called. Multiple calls to `sign.sign()` will result in an error being thrown.
+ * @since v0.1.92
+ */
+ sign(privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput): Buffer;
+ sign(
+ privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput,
+ outputFormat: BinaryToTextEncoding,
+ ): string;
+ }
+ /**
+ * Creates and returns a `Verify` object that uses the given algorithm.
+ * Use {@link getHashes} to obtain an array of names of the available
+ * signing algorithms. Optional `options` argument controls the`stream.Writable` behavior.
+ *
+ * In some cases, a `Verify` instance can be created using the name of a signature
+ * algorithm, such as `'RSA-SHA256'`, instead of a digest algorithm. This will use
+ * the corresponding digest algorithm. This does not work for all signature
+ * algorithms, such as `'ecdsa-with-SHA256'`, so it is best to always use digest
+ * algorithm names.
+ * @since v0.1.92
+ * @param options `stream.Writable` options
+ */
+ function createVerify(algorithm: string, options?: stream.WritableOptions): Verify;
+ /**
+ * The `Verify` class is a utility for verifying signatures. It can be used in one
+ * of two ways:
+ *
+ * * As a writable `stream` where written data is used to validate against the
+ * supplied signature, or
+ * * Using the `verify.update()` and `verify.verify()` methods to verify
+ * the signature.
+ *
+ * The {@link createVerify} method is used to create `Verify` instances.`Verify` objects are not to be created directly using the `new` keyword.
+ *
+ * See `Sign` for examples.
+ * @since v0.1.92
+ */
+ class Verify extends stream.Writable {
+ private constructor();
+ /**
+ * Updates the `Verify` content with the given `data`, the encoding of which
+ * is given in `inputEncoding`.
+ * If `inputEncoding` is not provided, and the `data` is a string, an
+ * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored.
+ *
+ * This can be called many times with new data as it is streamed.
+ * @since v0.1.92
+ * @param inputEncoding The `encoding` of the `data` string.
+ */
+ update(data: BinaryLike): Verify;
+ update(data: string, inputEncoding: Encoding): Verify;
+ /**
+ * Verifies the provided data using the given `object` and `signature`.
+ *
+ * If `object` is not a `KeyObject`, this function behaves as if`object` had been passed to {@link createPublicKey}. If it is an
+ * object, the following additional properties can be passed:
+ *
+ * The `signature` argument is the previously calculated signature for the data, in
+ * the `signatureEncoding`.
+ * If a `signatureEncoding` is specified, the `signature` is expected to be a
+ * string; otherwise `signature` is expected to be a `Buffer`,`TypedArray`, or `DataView`.
+ *
+ * The `verify` object can not be used again after `verify.verify()` has been
+ * called. Multiple calls to `verify.verify()` will result in an error being
+ * thrown.
+ *
+ * Because public keys can be derived from private keys, a private key may
+ * be passed instead of a public key.
+ * @since v0.1.92
+ */
+ verify(
+ object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput,
+ signature: NodeJS.ArrayBufferView,
+ ): boolean;
+ verify(
+ object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput,
+ signature: string,
+ signature_format?: BinaryToTextEncoding,
+ ): boolean;
+ }
+ /**
+ * Creates a `DiffieHellman` key exchange object using the supplied `prime` and an
+ * optional specific `generator`.
+ *
+ * The `generator` argument can be a number, string, or `Buffer`. If`generator` is not specified, the value `2` is used.
+ *
+ * If `primeEncoding` is specified, `prime` is expected to be a string; otherwise
+ * a `Buffer`, `TypedArray`, or `DataView` is expected.
+ *
+ * If `generatorEncoding` is specified, `generator` is expected to be a string;
+ * otherwise a number, `Buffer`, `TypedArray`, or `DataView` is expected.
+ * @since v0.11.12
+ * @param primeEncoding The `encoding` of the `prime` string.
+ * @param [generator=2]
+ * @param generatorEncoding The `encoding` of the `generator` string.
+ */
+ function createDiffieHellman(primeLength: number, generator?: number): DiffieHellman;
+ function createDiffieHellman(
+ prime: ArrayBuffer | NodeJS.ArrayBufferView,
+ generator?: number | ArrayBuffer | NodeJS.ArrayBufferView,
+ ): DiffieHellman;
+ function createDiffieHellman(
+ prime: ArrayBuffer | NodeJS.ArrayBufferView,
+ generator: string,
+ generatorEncoding: BinaryToTextEncoding,
+ ): DiffieHellman;
+ function createDiffieHellman(
+ prime: string,
+ primeEncoding: BinaryToTextEncoding,
+ generator?: number | ArrayBuffer | NodeJS.ArrayBufferView,
+ ): DiffieHellman;
+ function createDiffieHellman(
+ prime: string,
+ primeEncoding: BinaryToTextEncoding,
+ generator: string,
+ generatorEncoding: BinaryToTextEncoding,
+ ): DiffieHellman;
+ /**
+ * The `DiffieHellman` class is a utility for creating Diffie-Hellman key
+ * exchanges.
+ *
+ * Instances of the `DiffieHellman` class can be created using the {@link createDiffieHellman} function.
+ *
+ * ```js
+ * import assert from 'assert';
+ *
+ * const {
+ * createDiffieHellman
+ * } = await import('crypto');
+ *
+ * // Generate Alice's keys...
+ * const alice = createDiffieHellman(2048);
+ * const aliceKey = alice.generateKeys();
+ *
+ * // Generate Bob's keys...
+ * const bob = createDiffieHellman(alice.getPrime(), alice.getGenerator());
+ * const bobKey = bob.generateKeys();
+ *
+ * // Exchange and generate the secret...
+ * const aliceSecret = alice.computeSecret(bobKey);
+ * const bobSecret = bob.computeSecret(aliceKey);
+ *
+ * // OK
+ * assert.strictEqual(aliceSecret.toString('hex'), bobSecret.toString('hex'));
+ * ```
+ * @since v0.5.0
+ */
+ class DiffieHellman {
+ private constructor();
+ /**
+ * Generates private and public Diffie-Hellman key values, and returns
+ * the public key in the specified `encoding`. This key should be
+ * transferred to the other party.
+ * If `encoding` is provided a string is returned; otherwise a `Buffer` is returned.
+ * @since v0.5.0
+ * @param encoding The `encoding` of the return value.
+ */
+ generateKeys(): Buffer;
+ generateKeys(encoding: BinaryToTextEncoding): string;
+ /**
+ * Computes the shared secret using `otherPublicKey` as the other
+ * party's public key and returns the computed shared secret. The supplied
+ * key is interpreted using the specified `inputEncoding`, and secret is
+ * encoded using specified `outputEncoding`.
+ * If the `inputEncoding` is not
+ * provided, `otherPublicKey` is expected to be a `Buffer`,`TypedArray`, or `DataView`.
+ *
+ * If `outputEncoding` is given a string is returned; otherwise, a `Buffer` is returned.
+ * @since v0.5.0
+ * @param inputEncoding The `encoding` of an `otherPublicKey` string.
+ * @param outputEncoding The `encoding` of the return value.
+ */
+ computeSecret(otherPublicKey: NodeJS.ArrayBufferView, inputEncoding?: null, outputEncoding?: null): Buffer;
+ computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding, outputEncoding?: null): Buffer;
+ computeSecret(
+ otherPublicKey: NodeJS.ArrayBufferView,
+ inputEncoding: null,
+ outputEncoding: BinaryToTextEncoding,
+ ): string;
+ computeSecret(
+ otherPublicKey: string,
+ inputEncoding: BinaryToTextEncoding,
+ outputEncoding: BinaryToTextEncoding,
+ ): string;
+ /**
+ * Returns the Diffie-Hellman prime in the specified `encoding`.
+ * If `encoding` is provided a string is
+ * returned; otherwise a `Buffer` is returned.
+ * @since v0.5.0
+ * @param encoding The `encoding` of the return value.
+ */
+ getPrime(): Buffer;
+ getPrime(encoding: BinaryToTextEncoding): string;
+ /**
+ * Returns the Diffie-Hellman generator in the specified `encoding`.
+ * If `encoding` is provided a string is
+ * returned; otherwise a `Buffer` is returned.
+ * @since v0.5.0
+ * @param encoding The `encoding` of the return value.
+ */
+ getGenerator(): Buffer;
+ getGenerator(encoding: BinaryToTextEncoding): string;
+ /**
+ * Returns the Diffie-Hellman public key in the specified `encoding`.
+ * If `encoding` is provided a
+ * string is returned; otherwise a `Buffer` is returned.
+ * @since v0.5.0
+ * @param encoding The `encoding` of the return value.
+ */
+ getPublicKey(): Buffer;
+ getPublicKey(encoding: BinaryToTextEncoding): string;
+ /**
+ * Returns the Diffie-Hellman private key in the specified `encoding`.
+ * If `encoding` is provided a
+ * string is returned; otherwise a `Buffer` is returned.
+ * @since v0.5.0
+ * @param encoding The `encoding` of the return value.
+ */
+ getPrivateKey(): Buffer;
+ getPrivateKey(encoding: BinaryToTextEncoding): string;
+ /**
+ * Sets the Diffie-Hellman public key. If the `encoding` argument is provided,`publicKey` is expected
+ * to be a string. If no `encoding` is provided, `publicKey` is expected
+ * to be a `Buffer`, `TypedArray`, or `DataView`.
+ * @since v0.5.0
+ * @param encoding The `encoding` of the `publicKey` string.
+ */
+ setPublicKey(publicKey: NodeJS.ArrayBufferView): void;
+ setPublicKey(publicKey: string, encoding: BufferEncoding): void;
+ /**
+ * Sets the Diffie-Hellman private key. If the `encoding` argument is provided,`privateKey` is expected
+ * to be a string. If no `encoding` is provided, `privateKey` is expected
+ * to be a `Buffer`, `TypedArray`, or `DataView`.
+ * @since v0.5.0
+ * @param encoding The `encoding` of the `privateKey` string.
+ */
+ setPrivateKey(privateKey: NodeJS.ArrayBufferView): void;
+ setPrivateKey(privateKey: string, encoding: BufferEncoding): void;
+ /**
+ * A bit field containing any warnings and/or errors resulting from a check
+ * performed during initialization of the `DiffieHellman` object.
+ *
+ * The following values are valid for this property (as defined in `constants`module):
+ *
+ * * `DH_CHECK_P_NOT_SAFE_PRIME`
+ * * `DH_CHECK_P_NOT_PRIME`
+ * * `DH_UNABLE_TO_CHECK_GENERATOR`
+ * * `DH_NOT_SUITABLE_GENERATOR`
+ * @since v0.11.12
+ */
+ verifyError: number;
+ }
+ /**
+ * The `DiffieHellmanGroup` class takes a well-known modp group as its argument.
+ * It works the same as `DiffieHellman`, except that it does not allow changing its keys after creation.
+ * In other words, it does not implement `setPublicKey()` or `setPrivateKey()` methods.
+ *
+ * ```js
+ * const { createDiffieHellmanGroup } = await import('node:crypto');
+ * const dh = createDiffieHellmanGroup('modp1');
+ * ```
+ * The name (e.g. `'modp1'`) is taken from [RFC 2412](https://www.rfc-editor.org/rfc/rfc2412.txt) (modp1 and 2) and [RFC 3526](https://www.rfc-editor.org/rfc/rfc3526.txt):
+ * ```bash
+ * $ perl -ne 'print "$1\n" if /"(modp\d+)"/' src/node_crypto_groups.h
+ * modp1 # 768 bits
+ * modp2 # 1024 bits
+ * modp5 # 1536 bits
+ * modp14 # 2048 bits
+ * modp15 # etc.
+ * modp16
+ * modp17
+ * modp18
+ * ```
+ * @since v0.7.5
+ */
+ const DiffieHellmanGroup: DiffieHellmanGroupConstructor;
+ interface DiffieHellmanGroupConstructor {
+ new(name: string): DiffieHellmanGroup;
+ (name: string): DiffieHellmanGroup;
+ readonly prototype: DiffieHellmanGroup;
+ }
+ type DiffieHellmanGroup = Omit<DiffieHellman, "setPublicKey" | "setPrivateKey">;
+ /**
+ * Creates a predefined `DiffieHellmanGroup` key exchange object. The
+ * supported groups are: `'modp1'`, `'modp2'`, `'modp5'` (defined in [RFC 2412](https://www.rfc-editor.org/rfc/rfc2412.txt), but see `Caveats`) and `'modp14'`, `'modp15'`,`'modp16'`, `'modp17'`,
+ * `'modp18'` (defined in [RFC 3526](https://www.rfc-editor.org/rfc/rfc3526.txt)). The
+ * returned object mimics the interface of objects created by {@link createDiffieHellman}, but will not allow changing
+ * the keys (with `diffieHellman.setPublicKey()`, for example). The
+ * advantage of using this method is that the parties do not have to
+ * generate nor exchange a group modulus beforehand, saving both processor
+ * and communication time.
+ *
+ * Example (obtaining a shared secret):
+ *
+ * ```js
+ * const {
+ * getDiffieHellman
+ * } = await import('crypto');
+ * const alice = getDiffieHellman('modp14');
+ * const bob = getDiffieHellman('modp14');
+ *
+ * alice.generateKeys();
+ * bob.generateKeys();
+ *
+ * const aliceSecret = alice.computeSecret(bob.getPublicKey(), null, 'hex');
+ * const bobSecret = bob.computeSecret(alice.getPublicKey(), null, 'hex');
+ *
+ * // aliceSecret and bobSecret should be the same
+ * console.log(aliceSecret === bobSecret);
+ * ```
+ * @since v0.7.5
+ */
+ function getDiffieHellman(groupName: string): DiffieHellmanGroup;
+ /**
+ * An alias for {@link getDiffieHellman}
+ * @since v0.9.3
+ */
+ function createDiffieHellmanGroup(name: string): DiffieHellmanGroup;
+ /**
+ * Provides an asynchronous Password-Based Key Derivation Function 2 (PBKDF2)
+ * implementation. A selected HMAC digest algorithm specified by `digest` is
+ * applied to derive a key of the requested byte length (`keylen`) from the`password`, `salt` and `iterations`.
+ *
+ * The supplied `callback` function is called with two arguments: `err` and`derivedKey`. If an error occurs while deriving the key, `err` will be set;
+ * otherwise `err` will be `null`. By default, the successfully generated`derivedKey` will be passed to the callback as a `Buffer`. An error will be
+ * thrown if any of the input arguments specify invalid values or types.
+ *
+ * If `digest` is `null`, `'sha1'` will be used. This behavior is deprecated,
+ * please specify a `digest` explicitly.
+ *
+ * The `iterations` argument must be a number set as high as possible. The
+ * higher the number of iterations, the more secure the derived key will be,
+ * but will take a longer amount of time to complete.
+ *
+ * The `salt` should be as unique as possible. It is recommended that a salt is
+ * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details.
+ *
+ * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`.
+ *
+ * ```js
+ * const {
+ * pbkdf2
+ * } = await import('crypto');
+ *
+ * pbkdf2('secret', 'salt', 100000, 64, 'sha512', (err, derivedKey) => {
+ * if (err) throw err;
+ * console.log(derivedKey.toString('hex')); // '3745e48...08d59ae'
+ * });
+ * ```
+ *
+ * The `crypto.DEFAULT_ENCODING` property can be used to change the way the`derivedKey` is passed to the callback. This property, however, has been
+ * deprecated and use should be avoided.
+ *
+ * ```js
+ * import crypto from 'crypto';
+ * crypto.DEFAULT_ENCODING = 'hex';
+ * crypto.pbkdf2('secret', 'salt', 100000, 512, 'sha512', (err, derivedKey) => {
+ * if (err) throw err;
+ * console.log(derivedKey); // '3745e48...aa39b34'
+ * });
+ * ```
+ *
+ * An array of supported digest functions can be retrieved using {@link getHashes}.
+ *
+ * This API uses libuv's threadpool, which can have surprising and
+ * negative performance implications for some applications; see the `UV_THREADPOOL_SIZE` documentation for more information.
+ * @since v0.5.5
+ */
+ function pbkdf2(
+ password: BinaryLike,
+ salt: BinaryLike,
+ iterations: number,
+ keylen: number,
+ digest: string,
+ callback: (err: Error | null, derivedKey: Buffer) => void,
+ ): void;
+ /**
+ * Provides a synchronous Password-Based Key Derivation Function 2 (PBKDF2)
+ * implementation. A selected HMAC digest algorithm specified by `digest` is
+ * applied to derive a key of the requested byte length (`keylen`) from the`password`, `salt` and `iterations`.
+ *
+ * If an error occurs an `Error` will be thrown, otherwise the derived key will be
+ * returned as a `Buffer`.
+ *
+ * If `digest` is `null`, `'sha1'` will be used. This behavior is deprecated,
+ * please specify a `digest` explicitly.
+ *
+ * The `iterations` argument must be a number set as high as possible. The
+ * higher the number of iterations, the more secure the derived key will be,
+ * but will take a longer amount of time to complete.
+ *
+ * The `salt` should be as unique as possible. It is recommended that a salt is
+ * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details.
+ *
+ * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`.
+ *
+ * ```js
+ * const {
+ * pbkdf2Sync
+ * } = await import('crypto');
+ *
+ * const key = pbkdf2Sync('secret', 'salt', 100000, 64, 'sha512');
+ * console.log(key.toString('hex')); // '3745e48...08d59ae'
+ * ```
+ *
+ * The `crypto.DEFAULT_ENCODING` property may be used to change the way the`derivedKey` is returned. This property, however, is deprecated and use
+ * should be avoided.
+ *
+ * ```js
+ * import crypto from 'crypto';
+ * crypto.DEFAULT_ENCODING = 'hex';
+ * const key = crypto.pbkdf2Sync('secret', 'salt', 100000, 512, 'sha512');
+ * console.log(key); // '3745e48...aa39b34'
+ * ```
+ *
+ * An array of supported digest functions can be retrieved using {@link getHashes}.
+ * @since v0.9.3
+ */
+ function pbkdf2Sync(
+ password: BinaryLike,
+ salt: BinaryLike,
+ iterations: number,
+ keylen: number,
+ digest: string,
+ ): Buffer;
+ /**
+ * Generates cryptographically strong pseudorandom data. The `size` argument
+ * is a number indicating the number of bytes to generate.
+ *
+ * If a `callback` function is provided, the bytes are generated asynchronously
+ * and the `callback` function is invoked with two arguments: `err` and `buf`.
+ * If an error occurs, `err` will be an `Error` object; otherwise it is `null`. The`buf` argument is a `Buffer` containing the generated bytes.
+ *
+ * ```js
+ * // Asynchronous
+ * const {
+ * randomBytes
+ * } = await import('crypto');
+ *
+ * randomBytes(256, (err, buf) => {
+ * if (err) throw err;
+ * console.log(`${buf.length} bytes of random data: ${buf.toString('hex')}`);
+ * });
+ * ```
+ *
+ * If the `callback` function is not provided, the random bytes are generated
+ * synchronously and returned as a `Buffer`. An error will be thrown if
+ * there is a problem generating the bytes.
+ *
+ * ```js
+ * // Synchronous
+ * const {
+ * randomBytes
+ * } = await import('crypto');
+ *
+ * const buf = randomBytes(256);
+ * console.log(
+ * `${buf.length} bytes of random data: ${buf.toString('hex')}`);
+ * ```
+ *
+ * The `crypto.randomBytes()` method will not complete until there is
+ * sufficient entropy available.
+ * This should normally never take longer than a few milliseconds. The only time
+ * when generating the random bytes may conceivably block for a longer period of
+ * time is right after boot, when the whole system is still low on entropy.
+ *
+ * This API uses libuv's threadpool, which can have surprising and
+ * negative performance implications for some applications; see the `UV_THREADPOOL_SIZE` documentation for more information.
+ *
+ * The asynchronous version of `crypto.randomBytes()` is carried out in a single
+ * threadpool request. To minimize threadpool task length variation, partition
+ * large `randomBytes` requests when doing so as part of fulfilling a client
+ * request.
+ * @since v0.5.8
+ * @param size The number of bytes to generate. The `size` must not be larger than `2**31 - 1`.
+ * @return if the `callback` function is not provided.
+ */
+ function randomBytes(size: number): Buffer;
+ function randomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void;
+ function pseudoRandomBytes(size: number): Buffer;
+ function pseudoRandomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void;
+ /**
+ * Return a random integer `n` such that `min <= n < max`. This
+ * implementation avoids [modulo bias](https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#Modulo_bias).
+ *
+ * The range (`max - min`) must be less than 2^48. `min` and `max` must
+ * be [safe integers](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger).
+ *
+ * If the `callback` function is not provided, the random integer is
+ * generated synchronously.
+ *
+ * ```js
+ * // Asynchronous
+ * const {
+ * randomInt
+ * } = await import('crypto');
+ *
+ * randomInt(3, (err, n) => {
+ * if (err) throw err;
+ * console.log(`Random number chosen from (0, 1, 2): ${n}`);
+ * });
+ * ```
+ *
+ * ```js
+ * // Synchronous
+ * const {
+ * randomInt
+ * } = await import('crypto');
+ *
+ * const n = randomInt(3);
+ * console.log(`Random number chosen from (0, 1, 2): ${n}`);
+ * ```
+ *
+ * ```js
+ * // With `min` argument
+ * const {
+ * randomInt
+ * } = await import('crypto');
+ *
+ * const n = randomInt(1, 7);
+ * console.log(`The dice rolled: ${n}`);
+ * ```
+ * @since v14.10.0, v12.19.0
+ * @param [min=0] Start of random range (inclusive).
+ * @param max End of random range (exclusive).
+ * @param callback `function(err, n) {}`.
+ */
+ function randomInt(max: number): number;
+ function randomInt(min: number, max: number): number;
+ function randomInt(max: number, callback: (err: Error | null, value: number) => void): void;
+ function randomInt(min: number, max: number, callback: (err: Error | null, value: number) => void): void;
+ /**
+ * Synchronous version of {@link randomFill}.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ * const { randomFillSync } = await import('crypto');
+ *
+ * const buf = Buffer.alloc(10);
+ * console.log(randomFillSync(buf).toString('hex'));
+ *
+ * randomFillSync(buf, 5);
+ * console.log(buf.toString('hex'));
+ *
+ * // The above is equivalent to the following:
+ * randomFillSync(buf, 5, 5);
+ * console.log(buf.toString('hex'));
+ * ```
+ *
+ * Any `ArrayBuffer`, `TypedArray` or `DataView` instance may be passed as`buffer`.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ * const { randomFillSync } = await import('crypto');
+ *
+ * const a = new Uint32Array(10);
+ * console.log(Buffer.from(randomFillSync(a).buffer,
+ * a.byteOffset, a.byteLength).toString('hex'));
+ *
+ * const b = new DataView(new ArrayBuffer(10));
+ * console.log(Buffer.from(randomFillSync(b).buffer,
+ * b.byteOffset, b.byteLength).toString('hex'));
+ *
+ * const c = new ArrayBuffer(10);
+ * console.log(Buffer.from(randomFillSync(c)).toString('hex'));
+ * ```
+ * @since v7.10.0, v6.13.0
+ * @param buffer Must be supplied. The size of the provided `buffer` must not be larger than `2**31 - 1`.
+ * @param [offset=0]
+ * @param [size=buffer.length - offset]
+ * @return The object passed as `buffer` argument.
+ */
+ function randomFillSync<T extends NodeJS.ArrayBufferView>(buffer: T, offset?: number, size?: number): T;
+ /**
+ * This function is similar to {@link randomBytes} but requires the first
+ * argument to be a `Buffer` that will be filled. It also
+ * requires that a callback is passed in.
+ *
+ * If the `callback` function is not provided, an error will be thrown.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ * const { randomFill } = await import('crypto');
+ *
+ * const buf = Buffer.alloc(10);
+ * randomFill(buf, (err, buf) => {
+ * if (err) throw err;
+ * console.log(buf.toString('hex'));
+ * });
+ *
+ * randomFill(buf, 5, (err, buf) => {
+ * if (err) throw err;
+ * console.log(buf.toString('hex'));
+ * });
+ *
+ * // The above is equivalent to the following:
+ * randomFill(buf, 5, 5, (err, buf) => {
+ * if (err) throw err;
+ * console.log(buf.toString('hex'));
+ * });
+ * ```
+ *
+ * Any `ArrayBuffer`, `TypedArray`, or `DataView` instance may be passed as`buffer`.
+ *
+ * While this includes instances of `Float32Array` and `Float64Array`, this
+ * function should not be used to generate random floating-point numbers. The
+ * result may contain `+Infinity`, `-Infinity`, and `NaN`, and even if the array
+ * contains finite numbers only, they are not drawn from a uniform random
+ * distribution and have no meaningful lower or upper bounds.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ * const { randomFill } = await import('crypto');
+ *
+ * const a = new Uint32Array(10);
+ * randomFill(a, (err, buf) => {
+ * if (err) throw err;
+ * console.log(Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength)
+ * .toString('hex'));
+ * });
+ *
+ * const b = new DataView(new ArrayBuffer(10));
+ * randomFill(b, (err, buf) => {
+ * if (err) throw err;
+ * console.log(Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength)
+ * .toString('hex'));
+ * });
+ *
+ * const c = new ArrayBuffer(10);
+ * randomFill(c, (err, buf) => {
+ * if (err) throw err;
+ * console.log(Buffer.from(buf).toString('hex'));
+ * });
+ * ```
+ *
+ * This API uses libuv's threadpool, which can have surprising and
+ * negative performance implications for some applications; see the `UV_THREADPOOL_SIZE` documentation for more information.
+ *
+ * The asynchronous version of `crypto.randomFill()` is carried out in a single
+ * threadpool request. To minimize threadpool task length variation, partition
+ * large `randomFill` requests when doing so as part of fulfilling a client
+ * request.
+ * @since v7.10.0, v6.13.0
+ * @param buffer Must be supplied. The size of the provided `buffer` must not be larger than `2**31 - 1`.
+ * @param [offset=0]
+ * @param [size=buffer.length - offset]
+ * @param callback `function(err, buf) {}`.
+ */
+ function randomFill<T extends NodeJS.ArrayBufferView>(
+ buffer: T,
+ callback: (err: Error | null, buf: T) => void,
+ ): void;
+ function randomFill<T extends NodeJS.ArrayBufferView>(
+ buffer: T,
+ offset: number,
+ callback: (err: Error | null, buf: T) => void,
+ ): void;
+ function randomFill<T extends NodeJS.ArrayBufferView>(
+ buffer: T,
+ offset: number,
+ size: number,
+ callback: (err: Error | null, buf: T) => void,
+ ): void;
+ interface ScryptOptions {
+ cost?: number | undefined;
+ blockSize?: number | undefined;
+ parallelization?: number | undefined;
+ N?: number | undefined;
+ r?: number | undefined;
+ p?: number | undefined;
+ maxmem?: number | undefined;
+ }
+ /**
+ * Provides an asynchronous [scrypt](https://en.wikipedia.org/wiki/Scrypt) implementation. Scrypt is a password-based
+ * key derivation function that is designed to be expensive computationally and
+ * memory-wise in order to make brute-force attacks unrewarding.
+ *
+ * The `salt` should be as unique as possible. It is recommended that a salt is
+ * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details.
+ *
+ * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`.
+ *
+ * The `callback` function is called with two arguments: `err` and `derivedKey`.`err` is an exception object when key derivation fails, otherwise `err` is`null`. `derivedKey` is passed to the
+ * callback as a `Buffer`.
+ *
+ * An exception is thrown when any of the input arguments specify invalid values
+ * or types.
+ *
+ * ```js
+ * const {
+ * scrypt
+ * } = await import('crypto');
+ *
+ * // Using the factory defaults.
+ * scrypt('password', 'salt', 64, (err, derivedKey) => {
+ * if (err) throw err;
+ * console.log(derivedKey.toString('hex')); // '3745e48...08d59ae'
+ * });
+ * // Using a custom N parameter. Must be a power of two.
+ * scrypt('password', 'salt', 64, { N: 1024 }, (err, derivedKey) => {
+ * if (err) throw err;
+ * console.log(derivedKey.toString('hex')); // '3745e48...aa39b34'
+ * });
+ * ```
+ * @since v10.5.0
+ */
+ function scrypt(
+ password: BinaryLike,
+ salt: BinaryLike,
+ keylen: number,
+ callback: (err: Error | null, derivedKey: Buffer) => void,
+ ): void;
+ function scrypt(
+ password: BinaryLike,
+ salt: BinaryLike,
+ keylen: number,
+ options: ScryptOptions,
+ callback: (err: Error | null, derivedKey: Buffer) => void,
+ ): void;
+ /**
+ * Provides a synchronous [scrypt](https://en.wikipedia.org/wiki/Scrypt) implementation. Scrypt is a password-based
+ * key derivation function that is designed to be expensive computationally and
+ * memory-wise in order to make brute-force attacks unrewarding.
+ *
+ * The `salt` should be as unique as possible. It is recommended that a salt is
+ * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details.
+ *
+ * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`.
+ *
+ * An exception is thrown when key derivation fails, otherwise the derived key is
+ * returned as a `Buffer`.
+ *
+ * An exception is thrown when any of the input arguments specify invalid values
+ * or types.
+ *
+ * ```js
+ * const {
+ * scryptSync
+ * } = await import('crypto');
+ * // Using the factory defaults.
+ *
+ * const key1 = scryptSync('password', 'salt', 64);
+ * console.log(key1.toString('hex')); // '3745e48...08d59ae'
+ * // Using a custom N parameter. Must be a power of two.
+ * const key2 = scryptSync('password', 'salt', 64, { N: 1024 });
+ * console.log(key2.toString('hex')); // '3745e48...aa39b34'
+ * ```
+ * @since v10.5.0
+ */
+ function scryptSync(password: BinaryLike, salt: BinaryLike, keylen: number, options?: ScryptOptions): Buffer;
+ interface RsaPublicKey {
+ key: KeyLike;
+ padding?: number | undefined;
+ }
+ interface RsaPrivateKey {
+ key: KeyLike;
+ passphrase?: string | undefined;
+ /**
+ * @default 'sha1'
+ */
+ oaepHash?: string | undefined;
+ oaepLabel?: NodeJS.TypedArray | undefined;
+ padding?: number | undefined;
+ }
+ /**
+ * Encrypts the content of `buffer` with `key` and returns a new `Buffer` with encrypted content. The returned data can be decrypted using
+ * the corresponding private key, for example using {@link privateDecrypt}.
+ *
+ * If `key` is not a `KeyObject`, this function behaves as if`key` had been passed to {@link createPublicKey}. If it is an
+ * object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_OAEP_PADDING`.
+ *
+ * Because RSA public keys can be derived from private keys, a private key may
+ * be passed instead of a public key.
+ * @since v0.11.14
+ */
+ function publicEncrypt(key: RsaPublicKey | RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer;
+ /**
+ * Decrypts `buffer` with `key`.`buffer` was previously encrypted using
+ * the corresponding private key, for example using {@link privateEncrypt}.
+ *
+ * If `key` is not a `KeyObject`, this function behaves as if`key` had been passed to {@link createPublicKey}. If it is an
+ * object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_PADDING`.
+ *
+ * Because RSA public keys can be derived from private keys, a private key may
+ * be passed instead of a public key.
+ * @since v1.1.0
+ */
+ function publicDecrypt(key: RsaPublicKey | RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer;
+ /**
+ * Decrypts `buffer` with `privateKey`. `buffer` was previously encrypted using
+ * the corresponding public key, for example using {@link publicEncrypt}.
+ *
+ * If `privateKey` is not a `KeyObject`, this function behaves as if`privateKey` had been passed to {@link createPrivateKey}. If it is an
+ * object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_OAEP_PADDING`.
+ * @since v0.11.14
+ */
+ function privateDecrypt(privateKey: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer;
+ /**
+ * Encrypts `buffer` with `privateKey`. The returned data can be decrypted using
+ * the corresponding public key, for example using {@link publicDecrypt}.
+ *
+ * If `privateKey` is not a `KeyObject`, this function behaves as if`privateKey` had been passed to {@link createPrivateKey}. If it is an
+ * object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_PADDING`.
+ * @since v1.1.0
+ */
+ function privateEncrypt(privateKey: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer;
+ /**
+ * ```js
+ * const {
+ * getCiphers
+ * } = await import('crypto');
+ *
+ * console.log(getCiphers()); // ['aes-128-cbc', 'aes-128-ccm', ...]
+ * ```
+ * @since v0.9.3
+ * @return An array with the names of the supported cipher algorithms.
+ */
+ function getCiphers(): string[];
+ /**
+ * ```js
+ * const {
+ * getCurves
+ * } = await import('crypto');
+ *
+ * console.log(getCurves()); // ['Oakley-EC2N-3', 'Oakley-EC2N-4', ...]
+ * ```
+ * @since v2.3.0
+ * @return An array with the names of the supported elliptic curves.
+ */
+ function getCurves(): string[];
+ /**
+ * @since v10.0.0
+ * @return `1` if and only if a FIPS compliant crypto provider is currently in use, `0` otherwise. A future semver-major release may change the return type of this API to a {boolean}.
+ */
+ function getFips(): 1 | 0;
+ /**
+ * Enables the FIPS compliant crypto provider in a FIPS-enabled Node.js build. Throws an error if FIPS mode is not available.
+ * @since v10.0.0
+ * @param bool `true` to enable FIPS mode.
+ */
+ function setFips(bool: boolean): void;
+ /**
+ * ```js
+ * const {
+ * getHashes
+ * } = await import('crypto');
+ *
+ * console.log(getHashes()); // ['DSA', 'DSA-SHA', 'DSA-SHA1', ...]
+ * ```
+ * @since v0.9.3
+ * @return An array of the names of the supported hash algorithms, such as `'RSA-SHA256'`. Hash algorithms are also called "digest" algorithms.
+ */
+ function getHashes(): string[];
+ /**
+ * The `ECDH` class is a utility for creating Elliptic Curve Diffie-Hellman (ECDH)
+ * key exchanges.
+ *
+ * Instances of the `ECDH` class can be created using the {@link createECDH} function.
+ *
+ * ```js
+ * import assert from 'assert';
+ *
+ * const {
+ * createECDH
+ * } = await import('crypto');
+ *
+ * // Generate Alice's keys...
+ * const alice = createECDH('secp521r1');
+ * const aliceKey = alice.generateKeys();
+ *
+ * // Generate Bob's keys...
+ * const bob = createECDH('secp521r1');
+ * const bobKey = bob.generateKeys();
+ *
+ * // Exchange and generate the secret...
+ * const aliceSecret = alice.computeSecret(bobKey);
+ * const bobSecret = bob.computeSecret(aliceKey);
+ *
+ * assert.strictEqual(aliceSecret.toString('hex'), bobSecret.toString('hex'));
+ * // OK
+ * ```
+ * @since v0.11.14
+ */
+ class ECDH {
+ private constructor();
+ /**
+ * Converts the EC Diffie-Hellman public key specified by `key` and `curve` to the
+ * format specified by `format`. The `format` argument specifies point encoding
+ * and can be `'compressed'`, `'uncompressed'` or `'hybrid'`. The supplied key is
+ * interpreted using the specified `inputEncoding`, and the returned key is encoded
+ * using the specified `outputEncoding`.
+ *
+ * Use {@link getCurves} to obtain a list of available curve names.
+ * On recent OpenSSL releases, `openssl ecparam -list_curves` will also display
+ * the name and description of each available elliptic curve.
+ *
+ * If `format` is not specified the point will be returned in `'uncompressed'`format.
+ *
+ * If the `inputEncoding` is not provided, `key` is expected to be a `Buffer`,`TypedArray`, or `DataView`.
+ *
+ * Example (uncompressing a key):
+ *
+ * ```js
+ * const {
+ * createECDH,
+ * ECDH
+ * } = await import('crypto');
+ *
+ * const ecdh = createECDH('secp256k1');
+ * ecdh.generateKeys();
+ *
+ * const compressedKey = ecdh.getPublicKey('hex', 'compressed');
+ *
+ * const uncompressedKey = ECDH.convertKey(compressedKey,
+ * 'secp256k1',
+ * 'hex',
+ * 'hex',
+ * 'uncompressed');
+ *
+ * // The converted key and the uncompressed public key should be the same
+ * console.log(uncompressedKey === ecdh.getPublicKey('hex'));
+ * ```
+ * @since v10.0.0
+ * @param inputEncoding The `encoding` of the `key` string.
+ * @param outputEncoding The `encoding` of the return value.
+ * @param [format='uncompressed']
+ */
+ static convertKey(
+ key: BinaryLike,
+ curve: string,
+ inputEncoding?: BinaryToTextEncoding,
+ outputEncoding?: "latin1" | "hex" | "base64" | "base64url",
+ format?: "uncompressed" | "compressed" | "hybrid",
+ ): Buffer | string;
+ /**
+ * Generates private and public EC Diffie-Hellman key values, and returns
+ * the public key in the specified `format` and `encoding`. This key should be
+ * transferred to the other party.
+ *
+ * The `format` argument specifies point encoding and can be `'compressed'` or`'uncompressed'`. If `format` is not specified, the point will be returned in`'uncompressed'` format.
+ *
+ * If `encoding` is provided a string is returned; otherwise a `Buffer` is returned.
+ * @since v0.11.14
+ * @param encoding The `encoding` of the return value.
+ * @param [format='uncompressed']
+ */
+ generateKeys(): Buffer;
+ generateKeys(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string;
+ /**
+ * Computes the shared secret using `otherPublicKey` as the other
+ * party's public key and returns the computed shared secret. The supplied
+ * key is interpreted using specified `inputEncoding`, and the returned secret
+ * is encoded using the specified `outputEncoding`.
+ * If the `inputEncoding` is not
+ * provided, `otherPublicKey` is expected to be a `Buffer`, `TypedArray`, or`DataView`.
+ *
+ * If `outputEncoding` is given a string will be returned; otherwise a `Buffer` is returned.
+ *
+ * `ecdh.computeSecret` will throw an`ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY` error when `otherPublicKey`lies outside of the elliptic curve. Since `otherPublicKey` is
+ * usually supplied from a remote user over an insecure network,
+ * be sure to handle this exception accordingly.
+ * @since v0.11.14
+ * @param inputEncoding The `encoding` of the `otherPublicKey` string.
+ * @param outputEncoding The `encoding` of the return value.
+ */
+ computeSecret(otherPublicKey: NodeJS.ArrayBufferView): Buffer;
+ computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding): Buffer;
+ computeSecret(otherPublicKey: NodeJS.ArrayBufferView, outputEncoding: BinaryToTextEncoding): string;
+ computeSecret(
+ otherPublicKey: string,
+ inputEncoding: BinaryToTextEncoding,
+ outputEncoding: BinaryToTextEncoding,
+ ): string;
+ /**
+ * If `encoding` is specified, a string is returned; otherwise a `Buffer` is
+ * returned.
+ * @since v0.11.14
+ * @param encoding The `encoding` of the return value.
+ * @return The EC Diffie-Hellman in the specified `encoding`.
+ */
+ getPrivateKey(): Buffer;
+ getPrivateKey(encoding: BinaryToTextEncoding): string;
+ /**
+ * The `format` argument specifies point encoding and can be `'compressed'` or`'uncompressed'`. If `format` is not specified the point will be returned in`'uncompressed'` format.
+ *
+ * If `encoding` is specified, a string is returned; otherwise a `Buffer` is
+ * returned.
+ * @since v0.11.14
+ * @param [encoding] The `encoding` of the return value.
+ * @param [format='uncompressed']
+ * @return The EC Diffie-Hellman public key in the specified `encoding` and `format`.
+ */
+ getPublicKey(encoding?: null, format?: ECDHKeyFormat): Buffer;
+ getPublicKey(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string;
+ /**
+ * Sets the EC Diffie-Hellman private key.
+ * If `encoding` is provided, `privateKey` is expected
+ * to be a string; otherwise `privateKey` is expected to be a `Buffer`,`TypedArray`, or `DataView`.
+ *
+ * If `privateKey` is not valid for the curve specified when the `ECDH` object was
+ * created, an error is thrown. Upon setting the private key, the associated
+ * public point (key) is also generated and set in the `ECDH` object.
+ * @since v0.11.14
+ * @param encoding The `encoding` of the `privateKey` string.
+ */
+ setPrivateKey(privateKey: NodeJS.ArrayBufferView): void;
+ setPrivateKey(privateKey: string, encoding: BinaryToTextEncoding): void;
+ }
+ /**
+ * Creates an Elliptic Curve Diffie-Hellman (`ECDH`) key exchange object using a
+ * predefined curve specified by the `curveName` string. Use {@link getCurves} to obtain a list of available curve names. On recent
+ * OpenSSL releases, `openssl ecparam -list_curves` will also display the name
+ * and description of each available elliptic curve.
+ * @since v0.11.14
+ */
+ function createECDH(curveName: string): ECDH;
+ /**
+ * This function is based on a constant-time algorithm.
+ * Returns true if `a` is equal to `b`, without leaking timing information that
+ * would allow an attacker to guess one of the values. This is suitable for
+ * comparing HMAC digests or secret values like authentication cookies or [capability urls](https://www.w3.org/TR/capability-urls/).
+ *
+ * `a` and `b` must both be `Buffer`s, `TypedArray`s, or `DataView`s, and they
+ * must have the same byte length. An error is thrown if `a` and `b` have
+ * different byte lengths.
+ *
+ * If at least one of `a` and `b` is a `TypedArray` with more than one byte per
+ * entry, such as `Uint16Array`, the result will be computed using the platform
+ * byte order.
+ *
+ * Use of `crypto.timingSafeEqual` does not guarantee that the _surrounding_ code
+ * is timing-safe. Care should be taken to ensure that the surrounding code does
+ * not introduce timing vulnerabilities.
+ * @since v6.6.0
+ */
+ function timingSafeEqual(a: NodeJS.ArrayBufferView, b: NodeJS.ArrayBufferView): boolean;
+ /** @deprecated since v10.0.0 */
+ const DEFAULT_ENCODING: BufferEncoding;
+ type KeyType = "rsa" | "rsa-pss" | "dsa" | "ec" | "ed25519" | "ed448" | "x25519" | "x448";
+ type KeyFormat = "pem" | "der" | "jwk";
+ interface BasePrivateKeyEncodingOptions<T extends KeyFormat> {
+ format: T;
+ cipher?: string | undefined;
+ passphrase?: string | undefined;
+ }
+ interface KeyPairKeyObjectResult {
+ publicKey: KeyObject;
+ privateKey: KeyObject;
+ }
+ interface ED25519KeyPairKeyObjectOptions {}
+ interface ED448KeyPairKeyObjectOptions {}
+ interface X25519KeyPairKeyObjectOptions {}
+ interface X448KeyPairKeyObjectOptions {}
+ interface ECKeyPairKeyObjectOptions {
+ /**
+ * Name of the curve to use
+ */
+ namedCurve: string;
+ }
+ interface RSAKeyPairKeyObjectOptions {
+ /**
+ * Key size in bits
+ */
+ modulusLength: number;
+ /**
+ * Public exponent
+ * @default 0x10001
+ */
+ publicExponent?: number | undefined;
+ }
+ interface RSAPSSKeyPairKeyObjectOptions {
+ /**
+ * Key size in bits
+ */
+ modulusLength: number;
+ /**
+ * Public exponent
+ * @default 0x10001
+ */
+ publicExponent?: number | undefined;
+ /**
+ * Name of the message digest
+ */
+ hashAlgorithm?: string;
+ /**
+ * Name of the message digest used by MGF1
+ */
+ mgf1HashAlgorithm?: string;
+ /**
+ * Minimal salt length in bytes
+ */
+ saltLength?: string;
+ }
+ interface DSAKeyPairKeyObjectOptions {
+ /**
+ * Key size in bits
+ */
+ modulusLength: number;
+ /**
+ * Size of q in bits
+ */
+ divisorLength: number;
+ }
+ interface RSAKeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
+ /**
+ * Key size in bits
+ */
+ modulusLength: number;
+ /**
+ * Public exponent
+ * @default 0x10001
+ */
+ publicExponent?: number | undefined;
+ publicKeyEncoding: {
+ type: "pkcs1" | "spki";
+ format: PubF;
+ };
+ privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
+ type: "pkcs1" | "pkcs8";
+ };
+ }
+ interface RSAPSSKeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
+ /**
+ * Key size in bits
+ */
+ modulusLength: number;
+ /**
+ * Public exponent
+ * @default 0x10001
+ */
+ publicExponent?: number | undefined;
+ /**
+ * Name of the message digest
+ */
+ hashAlgorithm?: string;
+ /**
+ * Name of the message digest used by MGF1
+ */
+ mgf1HashAlgorithm?: string;
+ /**
+ * Minimal salt length in bytes
+ */
+ saltLength?: string;
+ publicKeyEncoding: {
+ type: "spki";
+ format: PubF;
+ };
+ privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
+ type: "pkcs8";
+ };
+ }
+ interface DSAKeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
+ /**
+ * Key size in bits
+ */
+ modulusLength: number;
+ /**
+ * Size of q in bits
+ */
+ divisorLength: number;
+ publicKeyEncoding: {
+ type: "spki";
+ format: PubF;
+ };
+ privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
+ type: "pkcs8";
+ };
+ }
+ interface ECKeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
+ /**
+ * Name of the curve to use.
+ */
+ namedCurve: string;
+ publicKeyEncoding: {
+ type: "pkcs1" | "spki";
+ format: PubF;
+ };
+ privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
+ type: "sec1" | "pkcs8";
+ };
+ }
+ interface ED25519KeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
+ publicKeyEncoding: {
+ type: "spki";
+ format: PubF;
+ };
+ privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
+ type: "pkcs8";
+ };
+ }
+ interface ED448KeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
+ publicKeyEncoding: {
+ type: "spki";
+ format: PubF;
+ };
+ privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
+ type: "pkcs8";
+ };
+ }
+ interface X25519KeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
+ publicKeyEncoding: {
+ type: "spki";
+ format: PubF;
+ };
+ privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
+ type: "pkcs8";
+ };
+ }
+ interface X448KeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
+ publicKeyEncoding: {
+ type: "spki";
+ format: PubF;
+ };
+ privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
+ type: "pkcs8";
+ };
+ }
+ interface KeyPairSyncResult<T1 extends string | Buffer, T2 extends string | Buffer> {
+ publicKey: T1;
+ privateKey: T2;
+ }
+ /**
+ * Generates a new asymmetric key pair of the given `type`. RSA, RSA-PSS, DSA, EC,
+ * Ed25519, Ed448, X25519, X448, and DH are currently supported.
+ *
+ * If a `publicKeyEncoding` or `privateKeyEncoding` was specified, this function
+ * behaves as if `keyObject.export()` had been called on its result. Otherwise,
+ * the respective part of the key is returned as a `KeyObject`.
+ *
+ * When encoding public keys, it is recommended to use `'spki'`. When encoding
+ * private keys, it is recommended to use `'pkcs8'` with a strong passphrase,
+ * and to keep the passphrase confidential.
+ *
+ * ```js
+ * const {
+ * generateKeyPairSync
+ * } = await import('crypto');
+ *
+ * const {
+ * publicKey,
+ * privateKey,
+ * } = generateKeyPairSync('rsa', {
+ * modulusLength: 4096,
+ * publicKeyEncoding: {
+ * type: 'spki',
+ * format: 'pem'
+ * },
+ * privateKeyEncoding: {
+ * type: 'pkcs8',
+ * format: 'pem',
+ * cipher: 'aes-256-cbc',
+ * passphrase: 'top secret'
+ * }
+ * });
+ * ```
+ *
+ * The return value `{ publicKey, privateKey }` represents the generated key pair.
+ * When PEM encoding was selected, the respective key will be a string, otherwise
+ * it will be a buffer containing the data encoded as DER.
+ * @since v10.12.0
+ * @param type Must be `'rsa'`, `'rsa-pss'`, `'dsa'`, `'ec'`, `'ed25519'`, `'ed448'`, `'x25519'`, `'x448'`, or `'dh'`.
+ */
+ function generateKeyPairSync(
+ type: "rsa",
+ options: RSAKeyPairOptions<"pem", "pem">,
+ ): KeyPairSyncResult<string, string>;
+ function generateKeyPairSync(
+ type: "rsa",
+ options: RSAKeyPairOptions<"pem", "der">,
+ ): KeyPairSyncResult<string, Buffer>;
+ function generateKeyPairSync(
+ type: "rsa",
+ options: RSAKeyPairOptions<"der", "pem">,
+ ): KeyPairSyncResult<Buffer, string>;
+ function generateKeyPairSync(
+ type: "rsa",
+ options: RSAKeyPairOptions<"der", "der">,
+ ): KeyPairSyncResult<Buffer, Buffer>;
+ function generateKeyPairSync(type: "rsa", options: RSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
+ function generateKeyPairSync(
+ type: "rsa-pss",
+ options: RSAPSSKeyPairOptions<"pem", "pem">,
+ ): KeyPairSyncResult<string, string>;
+ function generateKeyPairSync(
+ type: "rsa-pss",
+ options: RSAPSSKeyPairOptions<"pem", "der">,
+ ): KeyPairSyncResult<string, Buffer>;
+ function generateKeyPairSync(
+ type: "rsa-pss",
+ options: RSAPSSKeyPairOptions<"der", "pem">,
+ ): KeyPairSyncResult<Buffer, string>;
+ function generateKeyPairSync(
+ type: "rsa-pss",
+ options: RSAPSSKeyPairOptions<"der", "der">,
+ ): KeyPairSyncResult<Buffer, Buffer>;
+ function generateKeyPairSync(type: "rsa-pss", options: RSAPSSKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
+ function generateKeyPairSync(
+ type: "dsa",
+ options: DSAKeyPairOptions<"pem", "pem">,
+ ): KeyPairSyncResult<string, string>;
+ function generateKeyPairSync(
+ type: "dsa",
+ options: DSAKeyPairOptions<"pem", "der">,
+ ): KeyPairSyncResult<string, Buffer>;
+ function generateKeyPairSync(
+ type: "dsa",
+ options: DSAKeyPairOptions<"der", "pem">,
+ ): KeyPairSyncResult<Buffer, string>;
+ function generateKeyPairSync(
+ type: "dsa",
+ options: DSAKeyPairOptions<"der", "der">,
+ ): KeyPairSyncResult<Buffer, Buffer>;
+ function generateKeyPairSync(type: "dsa", options: DSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
+ function generateKeyPairSync(
+ type: "ec",
+ options: ECKeyPairOptions<"pem", "pem">,
+ ): KeyPairSyncResult<string, string>;
+ function generateKeyPairSync(
+ type: "ec",
+ options: ECKeyPairOptions<"pem", "der">,
+ ): KeyPairSyncResult<string, Buffer>;
+ function generateKeyPairSync(
+ type: "ec",
+ options: ECKeyPairOptions<"der", "pem">,
+ ): KeyPairSyncResult<Buffer, string>;
+ function generateKeyPairSync(
+ type: "ec",
+ options: ECKeyPairOptions<"der", "der">,
+ ): KeyPairSyncResult<Buffer, Buffer>;
+ function generateKeyPairSync(type: "ec", options: ECKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
+ function generateKeyPairSync(
+ type: "ed25519",
+ options: ED25519KeyPairOptions<"pem", "pem">,
+ ): KeyPairSyncResult<string, string>;
+ function generateKeyPairSync(
+ type: "ed25519",
+ options: ED25519KeyPairOptions<"pem", "der">,
+ ): KeyPairSyncResult<string, Buffer>;
+ function generateKeyPairSync(
+ type: "ed25519",
+ options: ED25519KeyPairOptions<"der", "pem">,
+ ): KeyPairSyncResult<Buffer, string>;
+ function generateKeyPairSync(
+ type: "ed25519",
+ options: ED25519KeyPairOptions<"der", "der">,
+ ): KeyPairSyncResult<Buffer, Buffer>;
+ function generateKeyPairSync(type: "ed25519", options?: ED25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
+ function generateKeyPairSync(
+ type: "ed448",
+ options: ED448KeyPairOptions<"pem", "pem">,
+ ): KeyPairSyncResult<string, string>;
+ function generateKeyPairSync(
+ type: "ed448",
+ options: ED448KeyPairOptions<"pem", "der">,
+ ): KeyPairSyncResult<string, Buffer>;
+ function generateKeyPairSync(
+ type: "ed448",
+ options: ED448KeyPairOptions<"der", "pem">,
+ ): KeyPairSyncResult<Buffer, string>;
+ function generateKeyPairSync(
+ type: "ed448",
+ options: ED448KeyPairOptions<"der", "der">,
+ ): KeyPairSyncResult<Buffer, Buffer>;
+ function generateKeyPairSync(type: "ed448", options?: ED448KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
+ function generateKeyPairSync(
+ type: "x25519",
+ options: X25519KeyPairOptions<"pem", "pem">,
+ ): KeyPairSyncResult<string, string>;
+ function generateKeyPairSync(
+ type: "x25519",
+ options: X25519KeyPairOptions<"pem", "der">,
+ ): KeyPairSyncResult<string, Buffer>;
+ function generateKeyPairSync(
+ type: "x25519",
+ options: X25519KeyPairOptions<"der", "pem">,
+ ): KeyPairSyncResult<Buffer, string>;
+ function generateKeyPairSync(
+ type: "x25519",
+ options: X25519KeyPairOptions<"der", "der">,
+ ): KeyPairSyncResult<Buffer, Buffer>;
+ function generateKeyPairSync(type: "x25519", options?: X25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
+ function generateKeyPairSync(
+ type: "x448",
+ options: X448KeyPairOptions<"pem", "pem">,
+ ): KeyPairSyncResult<string, string>;
+ function generateKeyPairSync(
+ type: "x448",
+ options: X448KeyPairOptions<"pem", "der">,
+ ): KeyPairSyncResult<string, Buffer>;
+ function generateKeyPairSync(
+ type: "x448",
+ options: X448KeyPairOptions<"der", "pem">,
+ ): KeyPairSyncResult<Buffer, string>;
+ function generateKeyPairSync(
+ type: "x448",
+ options: X448KeyPairOptions<"der", "der">,
+ ): KeyPairSyncResult<Buffer, Buffer>;
+ function generateKeyPairSync(type: "x448", options?: X448KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
+ /**
+ * Generates a new asymmetric key pair of the given `type`. RSA, RSA-PSS, DSA, EC,
+ * Ed25519, Ed448, X25519, X448, and DH are currently supported.
+ *
+ * If a `publicKeyEncoding` or `privateKeyEncoding` was specified, this function
+ * behaves as if `keyObject.export()` had been called on its result. Otherwise,
+ * the respective part of the key is returned as a `KeyObject`.
+ *
+ * It is recommended to encode public keys as `'spki'` and private keys as`'pkcs8'` with encryption for long-term storage:
+ *
+ * ```js
+ * const {
+ * generateKeyPair
+ * } = await import('crypto');
+ *
+ * generateKeyPair('rsa', {
+ * modulusLength: 4096,
+ * publicKeyEncoding: {
+ * type: 'spki',
+ * format: 'pem'
+ * },
+ * privateKeyEncoding: {
+ * type: 'pkcs8',
+ * format: 'pem',
+ * cipher: 'aes-256-cbc',
+ * passphrase: 'top secret'
+ * }
+ * }, (err, publicKey, privateKey) => {
+ * // Handle errors and use the generated key pair.
+ * });
+ * ```
+ *
+ * On completion, `callback` will be called with `err` set to `undefined` and`publicKey` / `privateKey` representing the generated key pair.
+ *
+ * If this method is invoked as its `util.promisify()` ed version, it returns
+ * a `Promise` for an `Object` with `publicKey` and `privateKey` properties.
+ * @since v10.12.0
+ * @param type Must be `'rsa'`, `'rsa-pss'`, `'dsa'`, `'ec'`, `'ed25519'`, `'ed448'`, `'x25519'`, `'x448'`, or `'dh'`.
+ */
+ function generateKeyPair(
+ type: "rsa",
+ options: RSAKeyPairOptions<"pem", "pem">,
+ callback: (err: Error | null, publicKey: string, privateKey: string) => void,
+ ): void;
+ function generateKeyPair(
+ type: "rsa",
+ options: RSAKeyPairOptions<"pem", "der">,
+ callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
+ ): void;
+ function generateKeyPair(
+ type: "rsa",
+ options: RSAKeyPairOptions<"der", "pem">,
+ callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
+ ): void;
+ function generateKeyPair(
+ type: "rsa",
+ options: RSAKeyPairOptions<"der", "der">,
+ callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
+ ): void;
+ function generateKeyPair(
+ type: "rsa",
+ options: RSAKeyPairKeyObjectOptions,
+ callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
+ ): void;
+ function generateKeyPair(
+ type: "rsa-pss",
+ options: RSAPSSKeyPairOptions<"pem", "pem">,
+ callback: (err: Error | null, publicKey: string, privateKey: string) => void,
+ ): void;
+ function generateKeyPair(
+ type: "rsa-pss",
+ options: RSAPSSKeyPairOptions<"pem", "der">,
+ callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
+ ): void;
+ function generateKeyPair(
+ type: "rsa-pss",
+ options: RSAPSSKeyPairOptions<"der", "pem">,
+ callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
+ ): void;
+ function generateKeyPair(
+ type: "rsa-pss",
+ options: RSAPSSKeyPairOptions<"der", "der">,
+ callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
+ ): void;
+ function generateKeyPair(
+ type: "rsa-pss",
+ options: RSAPSSKeyPairKeyObjectOptions,
+ callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
+ ): void;
+ function generateKeyPair(
+ type: "dsa",
+ options: DSAKeyPairOptions<"pem", "pem">,
+ callback: (err: Error | null, publicKey: string, privateKey: string) => void,
+ ): void;
+ function generateKeyPair(
+ type: "dsa",
+ options: DSAKeyPairOptions<"pem", "der">,
+ callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
+ ): void;
+ function generateKeyPair(
+ type: "dsa",
+ options: DSAKeyPairOptions<"der", "pem">,
+ callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
+ ): void;
+ function generateKeyPair(
+ type: "dsa",
+ options: DSAKeyPairOptions<"der", "der">,
+ callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
+ ): void;
+ function generateKeyPair(
+ type: "dsa",
+ options: DSAKeyPairKeyObjectOptions,
+ callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
+ ): void;
+ function generateKeyPair(
+ type: "ec",
+ options: ECKeyPairOptions<"pem", "pem">,
+ callback: (err: Error | null, publicKey: string, privateKey: string) => void,
+ ): void;
+ function generateKeyPair(
+ type: "ec",
+ options: ECKeyPairOptions<"pem", "der">,
+ callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
+ ): void;
+ function generateKeyPair(
+ type: "ec",
+ options: ECKeyPairOptions<"der", "pem">,
+ callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
+ ): void;
+ function generateKeyPair(
+ type: "ec",
+ options: ECKeyPairOptions<"der", "der">,
+ callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
+ ): void;
+ function generateKeyPair(
+ type: "ec",
+ options: ECKeyPairKeyObjectOptions,
+ callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
+ ): void;
+ function generateKeyPair(
+ type: "ed25519",
+ options: ED25519KeyPairOptions<"pem", "pem">,
+ callback: (err: Error | null, publicKey: string, privateKey: string) => void,
+ ): void;
+ function generateKeyPair(
+ type: "ed25519",
+ options: ED25519KeyPairOptions<"pem", "der">,
+ callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
+ ): void;
+ function generateKeyPair(
+ type: "ed25519",
+ options: ED25519KeyPairOptions<"der", "pem">,
+ callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
+ ): void;
+ function generateKeyPair(
+ type: "ed25519",
+ options: ED25519KeyPairOptions<"der", "der">,
+ callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
+ ): void;
+ function generateKeyPair(
+ type: "ed25519",
+ options: ED25519KeyPairKeyObjectOptions | undefined,
+ callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
+ ): void;
+ function generateKeyPair(
+ type: "ed448",
+ options: ED448KeyPairOptions<"pem", "pem">,
+ callback: (err: Error | null, publicKey: string, privateKey: string) => void,
+ ): void;
+ function generateKeyPair(
+ type: "ed448",
+ options: ED448KeyPairOptions<"pem", "der">,
+ callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
+ ): void;
+ function generateKeyPair(
+ type: "ed448",
+ options: ED448KeyPairOptions<"der", "pem">,
+ callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
+ ): void;
+ function generateKeyPair(
+ type: "ed448",
+ options: ED448KeyPairOptions<"der", "der">,
+ callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
+ ): void;
+ function generateKeyPair(
+ type: "ed448",
+ options: ED448KeyPairKeyObjectOptions | undefined,
+ callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
+ ): void;
+ function generateKeyPair(
+ type: "x25519",
+ options: X25519KeyPairOptions<"pem", "pem">,
+ callback: (err: Error | null, publicKey: string, privateKey: string) => void,
+ ): void;
+ function generateKeyPair(
+ type: "x25519",
+ options: X25519KeyPairOptions<"pem", "der">,
+ callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
+ ): void;
+ function generateKeyPair(
+ type: "x25519",
+ options: X25519KeyPairOptions<"der", "pem">,
+ callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
+ ): void;
+ function generateKeyPair(
+ type: "x25519",
+ options: X25519KeyPairOptions<"der", "der">,
+ callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
+ ): void;
+ function generateKeyPair(
+ type: "x25519",
+ options: X25519KeyPairKeyObjectOptions | undefined,
+ callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
+ ): void;
+ function generateKeyPair(
+ type: "x448",
+ options: X448KeyPairOptions<"pem", "pem">,
+ callback: (err: Error | null, publicKey: string, privateKey: string) => void,
+ ): void;
+ function generateKeyPair(
+ type: "x448",
+ options: X448KeyPairOptions<"pem", "der">,
+ callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
+ ): void;
+ function generateKeyPair(
+ type: "x448",
+ options: X448KeyPairOptions<"der", "pem">,
+ callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
+ ): void;
+ function generateKeyPair(
+ type: "x448",
+ options: X448KeyPairOptions<"der", "der">,
+ callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
+ ): void;
+ function generateKeyPair(
+ type: "x448",
+ options: X448KeyPairKeyObjectOptions | undefined,
+ callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
+ ): void;
+ namespace generateKeyPair {
+ function __promisify__(
+ type: "rsa",
+ options: RSAKeyPairOptions<"pem", "pem">,
+ ): Promise<{
+ publicKey: string;
+ privateKey: string;
+ }>;
+ function __promisify__(
+ type: "rsa",
+ options: RSAKeyPairOptions<"pem", "der">,
+ ): Promise<{
+ publicKey: string;
+ privateKey: Buffer;
+ }>;
+ function __promisify__(
+ type: "rsa",
+ options: RSAKeyPairOptions<"der", "pem">,
+ ): Promise<{
+ publicKey: Buffer;
+ privateKey: string;
+ }>;
+ function __promisify__(
+ type: "rsa",
+ options: RSAKeyPairOptions<"der", "der">,
+ ): Promise<{
+ publicKey: Buffer;
+ privateKey: Buffer;
+ }>;
+ function __promisify__(type: "rsa", options: RSAKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
+ function __promisify__(
+ type: "rsa-pss",
+ options: RSAPSSKeyPairOptions<"pem", "pem">,
+ ): Promise<{
+ publicKey: string;
+ privateKey: string;
+ }>;
+ function __promisify__(
+ type: "rsa-pss",
+ options: RSAPSSKeyPairOptions<"pem", "der">,
+ ): Promise<{
+ publicKey: string;
+ privateKey: Buffer;
+ }>;
+ function __promisify__(
+ type: "rsa-pss",
+ options: RSAPSSKeyPairOptions<"der", "pem">,
+ ): Promise<{
+ publicKey: Buffer;
+ privateKey: string;
+ }>;
+ function __promisify__(
+ type: "rsa-pss",
+ options: RSAPSSKeyPairOptions<"der", "der">,
+ ): Promise<{
+ publicKey: Buffer;
+ privateKey: Buffer;
+ }>;
+ function __promisify__(
+ type: "rsa-pss",
+ options: RSAPSSKeyPairKeyObjectOptions,
+ ): Promise<KeyPairKeyObjectResult>;
+ function __promisify__(
+ type: "dsa",
+ options: DSAKeyPairOptions<"pem", "pem">,
+ ): Promise<{
+ publicKey: string;
+ privateKey: string;
+ }>;
+ function __promisify__(
+ type: "dsa",
+ options: DSAKeyPairOptions<"pem", "der">,
+ ): Promise<{
+ publicKey: string;
+ privateKey: Buffer;
+ }>;
+ function __promisify__(
+ type: "dsa",
+ options: DSAKeyPairOptions<"der", "pem">,
+ ): Promise<{
+ publicKey: Buffer;
+ privateKey: string;
+ }>;
+ function __promisify__(
+ type: "dsa",
+ options: DSAKeyPairOptions<"der", "der">,
+ ): Promise<{
+ publicKey: Buffer;
+ privateKey: Buffer;
+ }>;
+ function __promisify__(type: "dsa", options: DSAKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
+ function __promisify__(
+ type: "ec",
+ options: ECKeyPairOptions<"pem", "pem">,
+ ): Promise<{
+ publicKey: string;
+ privateKey: string;
+ }>;
+ function __promisify__(
+ type: "ec",
+ options: ECKeyPairOptions<"pem", "der">,
+ ): Promise<{
+ publicKey: string;
+ privateKey: Buffer;
+ }>;
+ function __promisify__(
+ type: "ec",
+ options: ECKeyPairOptions<"der", "pem">,
+ ): Promise<{
+ publicKey: Buffer;
+ privateKey: string;
+ }>;
+ function __promisify__(
+ type: "ec",
+ options: ECKeyPairOptions<"der", "der">,
+ ): Promise<{
+ publicKey: Buffer;
+ privateKey: Buffer;
+ }>;
+ function __promisify__(type: "ec", options: ECKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
+ function __promisify__(
+ type: "ed25519",
+ options: ED25519KeyPairOptions<"pem", "pem">,
+ ): Promise<{
+ publicKey: string;
+ privateKey: string;
+ }>;
+ function __promisify__(
+ type: "ed25519",
+ options: ED25519KeyPairOptions<"pem", "der">,
+ ): Promise<{
+ publicKey: string;
+ privateKey: Buffer;
+ }>;
+ function __promisify__(
+ type: "ed25519",
+ options: ED25519KeyPairOptions<"der", "pem">,
+ ): Promise<{
+ publicKey: Buffer;
+ privateKey: string;
+ }>;
+ function __promisify__(
+ type: "ed25519",
+ options: ED25519KeyPairOptions<"der", "der">,
+ ): Promise<{
+ publicKey: Buffer;
+ privateKey: Buffer;
+ }>;
+ function __promisify__(
+ type: "ed25519",
+ options?: ED25519KeyPairKeyObjectOptions,
+ ): Promise<KeyPairKeyObjectResult>;
+ function __promisify__(
+ type: "ed448",
+ options: ED448KeyPairOptions<"pem", "pem">,
+ ): Promise<{
+ publicKey: string;
+ privateKey: string;
+ }>;
+ function __promisify__(
+ type: "ed448",
+ options: ED448KeyPairOptions<"pem", "der">,
+ ): Promise<{
+ publicKey: string;
+ privateKey: Buffer;
+ }>;
+ function __promisify__(
+ type: "ed448",
+ options: ED448KeyPairOptions<"der", "pem">,
+ ): Promise<{
+ publicKey: Buffer;
+ privateKey: string;
+ }>;
+ function __promisify__(
+ type: "ed448",
+ options: ED448KeyPairOptions<"der", "der">,
+ ): Promise<{
+ publicKey: Buffer;
+ privateKey: Buffer;
+ }>;
+ function __promisify__(type: "ed448", options?: ED448KeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
+ function __promisify__(
+ type: "x25519",
+ options: X25519KeyPairOptions<"pem", "pem">,
+ ): Promise<{
+ publicKey: string;
+ privateKey: string;
+ }>;
+ function __promisify__(
+ type: "x25519",
+ options: X25519KeyPairOptions<"pem", "der">,
+ ): Promise<{
+ publicKey: string;
+ privateKey: Buffer;
+ }>;
+ function __promisify__(
+ type: "x25519",
+ options: X25519KeyPairOptions<"der", "pem">,
+ ): Promise<{
+ publicKey: Buffer;
+ privateKey: string;
+ }>;
+ function __promisify__(
+ type: "x25519",
+ options: X25519KeyPairOptions<"der", "der">,
+ ): Promise<{
+ publicKey: Buffer;
+ privateKey: Buffer;
+ }>;
+ function __promisify__(
+ type: "x25519",
+ options?: X25519KeyPairKeyObjectOptions,
+ ): Promise<KeyPairKeyObjectResult>;
+ function __promisify__(
+ type: "x448",
+ options: X448KeyPairOptions<"pem", "pem">,
+ ): Promise<{
+ publicKey: string;
+ privateKey: string;
+ }>;
+ function __promisify__(
+ type: "x448",
+ options: X448KeyPairOptions<"pem", "der">,
+ ): Promise<{
+ publicKey: string;
+ privateKey: Buffer;
+ }>;
+ function __promisify__(
+ type: "x448",
+ options: X448KeyPairOptions<"der", "pem">,
+ ): Promise<{
+ publicKey: Buffer;
+ privateKey: string;
+ }>;
+ function __promisify__(
+ type: "x448",
+ options: X448KeyPairOptions<"der", "der">,
+ ): Promise<{
+ publicKey: Buffer;
+ privateKey: Buffer;
+ }>;
+ function __promisify__(type: "x448", options?: X448KeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
+ }
+ /**
+ * Calculates and returns the signature for `data` using the given private key and
+ * algorithm. If `algorithm` is `null` or `undefined`, then the algorithm is
+ * dependent upon the key type (especially Ed25519 and Ed448).
+ *
+ * If `key` is not a `KeyObject`, this function behaves as if `key` had been
+ * passed to {@link createPrivateKey}. If it is an object, the following
+ * additional properties can be passed:
+ *
+ * If the `callback` function is provided this function uses libuv's threadpool.
+ * @since v12.0.0
+ */
+ function sign(
+ algorithm: string | null | undefined,
+ data: NodeJS.ArrayBufferView,
+ key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput,
+ ): Buffer;
+ function sign(
+ algorithm: string | null | undefined,
+ data: NodeJS.ArrayBufferView,
+ key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput,
+ callback: (error: Error | null, data: Buffer) => void,
+ ): void;
+ /**
+ * Verifies the given signature for `data` using the given key and algorithm. If`algorithm` is `null` or `undefined`, then the algorithm is dependent upon the
+ * key type (especially Ed25519 and Ed448).
+ *
+ * If `key` is not a `KeyObject`, this function behaves as if `key` had been
+ * passed to {@link createPublicKey}. If it is an object, the following
+ * additional properties can be passed:
+ *
+ * The `signature` argument is the previously calculated signature for the `data`.
+ *
+ * Because public keys can be derived from private keys, a private key or a public
+ * key may be passed for `key`.
+ *
+ * If the `callback` function is provided this function uses libuv's threadpool.
+ * @since v12.0.0
+ */
+ function verify(
+ algorithm: string | null | undefined,
+ data: NodeJS.ArrayBufferView,
+ key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput,
+ signature: NodeJS.ArrayBufferView,
+ ): boolean;
+ function verify(
+ algorithm: string | null | undefined,
+ data: NodeJS.ArrayBufferView,
+ key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput,
+ signature: NodeJS.ArrayBufferView,
+ callback: (error: Error | null, result: boolean) => void,
+ ): void;
+ /**
+ * Computes the Diffie-Hellman secret based on a `privateKey` and a `publicKey`.
+ * Both keys must have the same `asymmetricKeyType`, which must be one of `'dh'`(for Diffie-Hellman), `'ec'` (for ECDH), `'x448'`, or `'x25519'` (for ECDH-ES).
+ * @since v13.9.0, v12.17.0
+ */
+ function diffieHellman(options: { privateKey: KeyObject; publicKey: KeyObject }): Buffer;
+ type CipherMode = "cbc" | "ccm" | "cfb" | "ctr" | "ecb" | "gcm" | "ocb" | "ofb" | "stream" | "wrap" | "xts";
+ interface CipherInfoOptions {
+ /**
+ * A test key length.
+ */
+ keyLength?: number | undefined;
+ /**
+ * A test IV length.
+ */
+ ivLength?: number | undefined;
+ }
+ interface CipherInfo {
+ /**
+ * The name of the cipher.
+ */
+ name: string;
+ /**
+ * The nid of the cipher.
+ */
+ nid: number;
+ /**
+ * The block size of the cipher in bytes.
+ * This property is omitted when mode is 'stream'.
+ */
+ blockSize?: number | undefined;
+ /**
+ * The expected or default initialization vector length in bytes.
+ * This property is omitted if the cipher does not use an initialization vector.
+ */
+ ivLength?: number | undefined;
+ /**
+ * The expected or default key length in bytes.
+ */
+ keyLength: number;
+ /**
+ * The cipher mode.
+ */
+ mode: CipherMode;
+ }
+ /**
+ * Returns information about a given cipher.
+ *
+ * Some ciphers accept variable length keys and initialization vectors. By default,
+ * the `crypto.getCipherInfo()` method will return the default values for these
+ * ciphers. To test if a given key length or iv length is acceptable for given
+ * cipher, use the `keyLength` and `ivLength` options. If the given values are
+ * unacceptable, `undefined` will be returned.
+ * @since v15.0.0
+ * @param nameOrNid The name or nid of the cipher to query.
+ */
+ function getCipherInfo(nameOrNid: string | number, options?: CipherInfoOptions): CipherInfo | undefined;
+ /**
+ * HKDF is a simple key derivation function defined in RFC 5869\. The given `ikm`,`salt` and `info` are used with the `digest` to derive a key of `keylen` bytes.
+ *
+ * The supplied `callback` function is called with two arguments: `err` and`derivedKey`. If an errors occurs while deriving the key, `err` will be set;
+ * otherwise `err` will be `null`. The successfully generated `derivedKey` will
+ * be passed to the callback as an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). An error will be thrown if any
+ * of the input arguments specify invalid values or types.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ * const {
+ * hkdf
+ * } = await import('crypto');
+ *
+ * hkdf('sha512', 'key', 'salt', 'info', 64, (err, derivedKey) => {
+ * if (err) throw err;
+ * console.log(Buffer.from(derivedKey).toString('hex')); // '24156e2...5391653'
+ * });
+ * ```
+ * @since v15.0.0
+ * @param digest The digest algorithm to use.
+ * @param ikm The input keying material. It must be at least one byte in length.
+ * @param salt The salt value. Must be provided but can be zero-length.
+ * @param info Additional info value. Must be provided but can be zero-length, and cannot be more than 1024 bytes.
+ * @param keylen The length of the key to generate. Must be greater than 0. The maximum allowable value is `255` times the number of bytes produced by the selected digest function (e.g. `sha512`
+ * generates 64-byte hashes, making the maximum HKDF output 16320 bytes).
+ */
+ function hkdf(
+ digest: string,
+ irm: BinaryLike | KeyObject,
+ salt: BinaryLike,
+ info: BinaryLike,
+ keylen: number,
+ callback: (err: Error | null, derivedKey: ArrayBuffer) => void,
+ ): void;
+ /**
+ * Provides a synchronous HKDF key derivation function as defined in RFC 5869\. The
+ * given `ikm`, `salt` and `info` are used with the `digest` to derive a key of`keylen` bytes.
+ *
+ * The successfully generated `derivedKey` will be returned as an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer).
+ *
+ * An error will be thrown if any of the input arguments specify invalid values or
+ * types, or if the derived key cannot be generated.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ * const {
+ * hkdfSync
+ * } = await import('crypto');
+ *
+ * const derivedKey = hkdfSync('sha512', 'key', 'salt', 'info', 64);
+ * console.log(Buffer.from(derivedKey).toString('hex')); // '24156e2...5391653'
+ * ```
+ * @since v15.0.0
+ * @param digest The digest algorithm to use.
+ * @param ikm The input keying material. It must be at least one byte in length.
+ * @param salt The salt value. Must be provided but can be zero-length.
+ * @param info Additional info value. Must be provided but can be zero-length, and cannot be more than 1024 bytes.
+ * @param keylen The length of the key to generate. Must be greater than 0. The maximum allowable value is `255` times the number of bytes produced by the selected digest function (e.g. `sha512`
+ * generates 64-byte hashes, making the maximum HKDF output 16320 bytes).
+ */
+ function hkdfSync(
+ digest: string,
+ ikm: BinaryLike | KeyObject,
+ salt: BinaryLike,
+ info: BinaryLike,
+ keylen: number,
+ ): ArrayBuffer;
+ interface SecureHeapUsage {
+ /**
+ * The total allocated secure heap size as specified using the `--secure-heap=n` command-line flag.
+ */
+ total: number;
+ /**
+ * The minimum allocation from the secure heap as specified using the `--secure-heap-min` command-line flag.
+ */
+ min: number;
+ /**
+ * The total number of bytes currently allocated from the secure heap.
+ */
+ used: number;
+ /**
+ * The calculated ratio of `used` to `total` allocated bytes.
+ */
+ utilization: number;
+ }
+ /**
+ * @since v15.6.0
+ */
+ function secureHeapUsed(): SecureHeapUsage;
+ interface RandomUUIDOptions {
+ /**
+ * By default, to improve performance,
+ * Node.js will pre-emptively generate and persistently cache enough
+ * random data to generate up to 128 random UUIDs. To generate a UUID
+ * without using the cache, set `disableEntropyCache` to `true`.
+ *
+ * @default `false`
+ */
+ disableEntropyCache?: boolean | undefined;
+ }
+ type UUID = `${string}-${string}-${string}-${string}-${string}`;
+ /**
+ * Generates a random [RFC 4122](https://www.rfc-editor.org/rfc/rfc4122.txt) version 4 UUID. The UUID is generated using a
+ * cryptographic pseudorandom number generator.
+ * @since v15.6.0, v14.17.0
+ */
+ function randomUUID(options?: RandomUUIDOptions): UUID;
+ interface X509CheckOptions {
+ /**
+ * @default 'always'
+ */
+ subject?: "always" | "default" | "never";
+ /**
+ * @default true
+ */
+ wildcards?: boolean;
+ /**
+ * @default true
+ */
+ partialWildcards?: boolean;
+ /**
+ * @default false
+ */
+ multiLabelWildcards?: boolean;
+ /**
+ * @default false
+ */
+ singleLabelSubdomains?: boolean;
+ }
+ /**
+ * Encapsulates an X509 certificate and provides read-only access to
+ * its information.
+ *
+ * ```js
+ * const { X509Certificate } = await import('crypto');
+ *
+ * const x509 = new X509Certificate('{... pem encoded cert ...}');
+ *
+ * console.log(x509.subject);
+ * ```
+ * @since v15.6.0
+ */
+ class X509Certificate {
+ /**
+ * Will be \`true\` if this is a Certificate Authority (CA) certificate.
+ * @since v15.6.0
+ */
+ readonly ca: boolean;
+ /**
+ * The SHA-1 fingerprint of this certificate.
+ *
+ * Because SHA-1 is cryptographically broken and because the security of SHA-1 is
+ * significantly worse than that of algorithms that are commonly used to sign
+ * certificates, consider using `x509.fingerprint256` instead.
+ * @since v15.6.0
+ */
+ readonly fingerprint: string;
+ /**
+ * The SHA-256 fingerprint of this certificate.
+ * @since v15.6.0
+ */
+ readonly fingerprint256: string;
+ /**
+ * The SHA-512 fingerprint of this certificate.
+ * @since v16.14.0
+ */
+ readonly fingerprint512: string;
+ /**
+ * The complete subject of this certificate.
+ * @since v15.6.0
+ */
+ readonly subject: string;
+ /**
+ * The subject alternative name specified for this certificate or `undefined`
+ * if not available.
+ * @since v15.6.0
+ */
+ readonly subjectAltName: string | undefined;
+ /**
+ * The information access content of this certificate or `undefined` if not
+ * available.
+ * @since v15.6.0
+ */
+ readonly infoAccess: string | undefined;
+ /**
+ * An array detailing the key usages for this certificate.
+ * @since v15.6.0
+ */
+ readonly keyUsage: string[];
+ /**
+ * The issuer identification included in this certificate.
+ * @since v15.6.0
+ */
+ readonly issuer: string;
+ /**
+ * The issuer certificate or `undefined` if the issuer certificate is not
+ * available.
+ * @since v15.9.0
+ */
+ readonly issuerCertificate?: X509Certificate | undefined;
+ /**
+ * The public key `KeyObject` for this certificate.
+ * @since v15.6.0
+ */
+ readonly publicKey: KeyObject;
+ /**
+ * A `Buffer` containing the DER encoding of this certificate.
+ * @since v15.6.0
+ */
+ readonly raw: Buffer;
+ /**
+ * The serial number of this certificate.
+ *
+ * Serial numbers are assigned by certificate authorities and do not uniquely
+ * identify certificates. Consider using `x509.fingerprint256` as a unique
+ * identifier instead.
+ * @since v15.6.0
+ */
+ readonly serialNumber: string;
+ /**
+ * The date/time from which this certificate is considered valid.
+ * @since v15.6.0
+ */
+ readonly validFrom: string;
+ /**
+ * The date/time until which this certificate is considered valid.
+ * @since v15.6.0
+ */
+ readonly validTo: string;
+ constructor(buffer: BinaryLike);
+ /**
+ * Checks whether the certificate matches the given email address.
+ *
+ * If the `'subject'` option is undefined or set to `'default'`, the certificate
+ * subject is only considered if the subject alternative name extension either does
+ * not exist or does not contain any email addresses.
+ *
+ * If the `'subject'` option is set to `'always'` and if the subject alternative
+ * name extension either does not exist or does not contain a matching email
+ * address, the certificate subject is considered.
+ *
+ * If the `'subject'` option is set to `'never'`, the certificate subject is never
+ * considered, even if the certificate contains no subject alternative names.
+ * @since v15.6.0
+ * @return Returns `email` if the certificate matches, `undefined` if it does not.
+ */
+ checkEmail(email: string, options?: Pick<X509CheckOptions, "subject">): string | undefined;
+ /**
+ * Checks whether the certificate matches the given host name.
+ *
+ * If the certificate matches the given host name, the matching subject name is
+ * returned. The returned name might be an exact match (e.g., `foo.example.com`)
+ * or it might contain wildcards (e.g., `*.example.com`). Because host name
+ * comparisons are case-insensitive, the returned subject name might also differ
+ * from the given `name` in capitalization.
+ *
+ * If the `'subject'` option is undefined or set to `'default'`, the certificate
+ * subject is only considered if the subject alternative name extension either does
+ * not exist or does not contain any DNS names. This behavior is consistent with [RFC 2818](https://www.rfc-editor.org/rfc/rfc2818.txt) ("HTTP Over TLS").
+ *
+ * If the `'subject'` option is set to `'always'` and if the subject alternative
+ * name extension either does not exist or does not contain a matching DNS name,
+ * the certificate subject is considered.
+ *
+ * If the `'subject'` option is set to `'never'`, the certificate subject is never
+ * considered, even if the certificate contains no subject alternative names.
+ * @since v15.6.0
+ * @return Returns a subject name that matches `name`, or `undefined` if no subject name matches `name`.
+ */
+ checkHost(name: string, options?: X509CheckOptions): string | undefined;
+ /**
+ * Checks whether the certificate matches the given IP address (IPv4 or IPv6).
+ *
+ * Only [RFC 5280](https://www.rfc-editor.org/rfc/rfc5280.txt) `iPAddress` subject alternative names are considered, and they
+ * must match the given `ip` address exactly. Other subject alternative names as
+ * well as the subject field of the certificate are ignored.
+ * @since v15.6.0
+ * @return Returns `ip` if the certificate matches, `undefined` if it does not.
+ */
+ checkIP(ip: string): string | undefined;
+ /**
+ * Checks whether this certificate was issued by the given `otherCert`.
+ * @since v15.6.0
+ */
+ checkIssued(otherCert: X509Certificate): boolean;
+ /**
+ * Checks whether the public key for this certificate is consistent with
+ * the given private key.
+ * @since v15.6.0
+ * @param privateKey A private key.
+ */
+ checkPrivateKey(privateKey: KeyObject): boolean;
+ /**
+ * There is no standard JSON encoding for X509 certificates. The`toJSON()` method returns a string containing the PEM encoded
+ * certificate.
+ * @since v15.6.0
+ */
+ toJSON(): string;
+ /**
+ * Returns information about this certificate using the legacy `certificate object` encoding.
+ * @since v15.6.0
+ */
+ toLegacyObject(): PeerCertificate;
+ /**
+ * Returns the PEM-encoded certificate.
+ * @since v15.6.0
+ */
+ toString(): string;
+ /**
+ * Verifies that this certificate was signed by the given public key.
+ * Does not perform any other validation checks on the certificate.
+ * @since v15.6.0
+ * @param publicKey A public key.
+ */
+ verify(publicKey: KeyObject): boolean;
+ }
+ type LargeNumberLike = NodeJS.ArrayBufferView | SharedArrayBuffer | ArrayBuffer | bigint;
+ interface GeneratePrimeOptions {
+ add?: LargeNumberLike | undefined;
+ rem?: LargeNumberLike | undefined;
+ /**
+ * @default false
+ */
+ safe?: boolean | undefined;
+ bigint?: boolean | undefined;
+ }
+ interface GeneratePrimeOptionsBigInt extends GeneratePrimeOptions {
+ bigint: true;
+ }
+ interface GeneratePrimeOptionsArrayBuffer extends GeneratePrimeOptions {
+ bigint?: false | undefined;
+ }
+ /**
+ * Generates a pseudorandom prime of `size` bits.
+ *
+ * If `options.safe` is `true`, the prime will be a safe prime -- that is,`(prime - 1) / 2` will also be a prime.
+ *
+ * The `options.add` and `options.rem` parameters can be used to enforce additional
+ * requirements, e.g., for Diffie-Hellman:
+ *
+ * * If `options.add` and `options.rem` are both set, the prime will satisfy the
+ * condition that `prime % add = rem`.
+ * * If only `options.add` is set and `options.safe` is not `true`, the prime will
+ * satisfy the condition that `prime % add = 1`.
+ * * If only `options.add` is set and `options.safe` is set to `true`, the prime
+ * will instead satisfy the condition that `prime % add = 3`. This is necessary
+ * because `prime % add = 1` for `options.add > 2` would contradict the condition
+ * enforced by `options.safe`.
+ * * `options.rem` is ignored if `options.add` is not given.
+ *
+ * Both `options.add` and `options.rem` must be encoded as big-endian sequences
+ * if given as an `ArrayBuffer`, `SharedArrayBuffer`, `TypedArray`, `Buffer`, or`DataView`.
+ *
+ * By default, the prime is encoded as a big-endian sequence of octets
+ * in an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). If the `bigint` option is `true`, then a
+ * [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) is provided.
+ * @since v15.8.0
+ * @param size The size (in bits) of the prime to generate.
+ */
+ function generatePrime(size: number, callback: (err: Error | null, prime: ArrayBuffer) => void): void;
+ function generatePrime(
+ size: number,
+ options: GeneratePrimeOptionsBigInt,
+ callback: (err: Error | null, prime: bigint) => void,
+ ): void;
+ function generatePrime(
+ size: number,
+ options: GeneratePrimeOptionsArrayBuffer,
+ callback: (err: Error | null, prime: ArrayBuffer) => void,
+ ): void;
+ function generatePrime(
+ size: number,
+ options: GeneratePrimeOptions,
+ callback: (err: Error | null, prime: ArrayBuffer | bigint) => void,
+ ): void;
+ /**
+ * Generates a pseudorandom prime of `size` bits.
+ *
+ * If `options.safe` is `true`, the prime will be a safe prime -- that is,`(prime - 1) / 2` will also be a prime.
+ *
+ * The `options.add` and `options.rem` parameters can be used to enforce additional
+ * requirements, e.g., for Diffie-Hellman:
+ *
+ * * If `options.add` and `options.rem` are both set, the prime will satisfy the
+ * condition that `prime % add = rem`.
+ * * If only `options.add` is set and `options.safe` is not `true`, the prime will
+ * satisfy the condition that `prime % add = 1`.
+ * * If only `options.add` is set and `options.safe` is set to `true`, the prime
+ * will instead satisfy the condition that `prime % add = 3`. This is necessary
+ * because `prime % add = 1` for `options.add > 2` would contradict the condition
+ * enforced by `options.safe`.
+ * * `options.rem` is ignored if `options.add` is not given.
+ *
+ * Both `options.add` and `options.rem` must be encoded as big-endian sequences
+ * if given as an `ArrayBuffer`, `SharedArrayBuffer`, `TypedArray`, `Buffer`, or`DataView`.
+ *
+ * By default, the prime is encoded as a big-endian sequence of octets
+ * in an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). If the `bigint` option is `true`, then a
+ * [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) is provided.
+ * @since v15.8.0
+ * @param size The size (in bits) of the prime to generate.
+ */
+ function generatePrimeSync(size: number): ArrayBuffer;
+ function generatePrimeSync(size: number, options: GeneratePrimeOptionsBigInt): bigint;
+ function generatePrimeSync(size: number, options: GeneratePrimeOptionsArrayBuffer): ArrayBuffer;
+ function generatePrimeSync(size: number, options: GeneratePrimeOptions): ArrayBuffer | bigint;
+ interface CheckPrimeOptions {
+ /**
+ * The number of Miller-Rabin probabilistic primality iterations to perform.
+ * When the value is 0 (zero), a number of checks is used that yields a false positive rate of at most `2**-64` for random input.
+ * Care must be used when selecting a number of checks.
+ * Refer to the OpenSSL documentation for the BN_is_prime_ex function nchecks options for more details.
+ *
+ * @default 0
+ */
+ checks?: number | undefined;
+ }
+ /**
+ * Checks the primality of the `candidate`.
+ * @since v15.8.0
+ * @param candidate A possible prime encoded as a sequence of big endian octets of arbitrary length.
+ */
+ function checkPrime(value: LargeNumberLike, callback: (err: Error | null, result: boolean) => void): void;
+ function checkPrime(
+ value: LargeNumberLike,
+ options: CheckPrimeOptions,
+ callback: (err: Error | null, result: boolean) => void,
+ ): void;
+ /**
+ * Checks the primality of the `candidate`.
+ * @since v15.8.0
+ * @param candidate A possible prime encoded as a sequence of big endian octets of arbitrary length.
+ * @return `true` if the candidate is a prime with an error probability less than `0.25 ** options.checks`.
+ */
+ function checkPrimeSync(candidate: LargeNumberLike, options?: CheckPrimeOptions): boolean;
+ /**
+ * Load and set the `engine` for some or all OpenSSL functions (selected by flags).
+ *
+ * `engine` could be either an id or a path to the engine's shared library.
+ *
+ * The optional `flags` argument uses `ENGINE_METHOD_ALL` by default.
+ * The `flags` is a bit field taking one of or a mix of the following flags (defined in `crypto.constants`):
+ *
+ * - `crypto.constants.ENGINE_METHOD_RSA`
+ * - `crypto.constants.ENGINE_METHOD_DSA`
+ * - `crypto.constants.ENGINE_METHOD_DH`
+ * - `crypto.constants.ENGINE_METHOD_RAND`
+ * - `crypto.constants.ENGINE_METHOD_EC`
+ * - `crypto.constants.ENGINE_METHOD_CIPHERS`
+ * - `crypto.constants.ENGINE_METHOD_DIGESTS`
+ * - `crypto.constants.ENGINE_METHOD_PKEY_METHS`
+ * - `crypto.constants.ENGINE_METHOD_PKEY_ASN1_METHS`
+ * - `crypto.constants.ENGINE_METHOD_ALL`
+ * - `crypto.constants.ENGINE_METHOD_NONE`
+ *
+ * The flags below are deprecated in OpenSSL-1.1.0.
+ *
+ * - `crypto.constants.ENGINE_METHOD_ECDH`
+ * - `crypto.constants.ENGINE_METHOD_ECDSA`
+ * - `crypto.constants.ENGINE_METHOD_STORE`
+ * @since v0.11.11
+ * @param [flags=crypto.constants.ENGINE_METHOD_ALL]
+ */
+ function setEngine(engine: string, flags?: number): void;
+ /**
+ * A convenient alias for `crypto.webcrypto.getRandomValues()`.
+ * This implementation is not compliant with the Web Crypto spec,
+ * to write web-compatible code use `crypto.webcrypto.getRandomValues()` instead.
+ * @since v17.4.0
+ * @returns Returns `typedArray`.
+ */
+ function getRandomValues<T extends webcrypto.BufferSource>(typedArray: T): T;
+ /**
+ * A convenient alias for `crypto.webcrypto.subtle`.
+ * @since v17.4.0
+ */
+ const subtle: webcrypto.SubtleCrypto;
+ /**
+ * An implementation of the Web Crypto API standard.
+ *
+ * See the {@link https://nodejs.org/docs/latest/api/webcrypto.html Web Crypto API documentation} for details.
+ * @since v15.0.0
+ */
+ const webcrypto: webcrypto.Crypto;
+ namespace webcrypto {
+ type BufferSource = ArrayBufferView | ArrayBuffer;
+ type KeyFormat = "jwk" | "pkcs8" | "raw" | "spki";
+ type KeyType = "private" | "public" | "secret";
+ type KeyUsage =
+ | "decrypt"
+ | "deriveBits"
+ | "deriveKey"
+ | "encrypt"
+ | "sign"
+ | "unwrapKey"
+ | "verify"
+ | "wrapKey";
+ type AlgorithmIdentifier = Algorithm | string;
+ type HashAlgorithmIdentifier = AlgorithmIdentifier;
+ type NamedCurve = string;
+ type BigInteger = Uint8Array;
+ interface AesCbcParams extends Algorithm {
+ iv: BufferSource;
+ }
+ interface AesCtrParams extends Algorithm {
+ counter: BufferSource;
+ length: number;
+ }
+ interface AesDerivedKeyParams extends Algorithm {
+ length: number;
+ }
+ interface AesGcmParams extends Algorithm {
+ additionalData?: BufferSource;
+ iv: BufferSource;
+ tagLength?: number;
+ }
+ interface AesKeyAlgorithm extends KeyAlgorithm {
+ length: number;
+ }
+ interface AesKeyGenParams extends Algorithm {
+ length: number;
+ }
+ interface Algorithm {
+ name: string;
+ }
+ interface EcKeyAlgorithm extends KeyAlgorithm {
+ namedCurve: NamedCurve;
+ }
+ interface EcKeyGenParams extends Algorithm {
+ namedCurve: NamedCurve;
+ }
+ interface EcKeyImportParams extends Algorithm {
+ namedCurve: NamedCurve;
+ }
+ interface EcdhKeyDeriveParams extends Algorithm {
+ public: CryptoKey;
+ }
+ interface EcdsaParams extends Algorithm {
+ hash: HashAlgorithmIdentifier;
+ }
+ interface Ed448Params extends Algorithm {
+ context?: BufferSource;
+ }
+ interface HkdfParams extends Algorithm {
+ hash: HashAlgorithmIdentifier;
+ info: BufferSource;
+ salt: BufferSource;
+ }
+ interface HmacImportParams extends Algorithm {
+ hash: HashAlgorithmIdentifier;
+ length?: number;
+ }
+ interface HmacKeyAlgorithm extends KeyAlgorithm {
+ hash: KeyAlgorithm;
+ length: number;
+ }
+ interface HmacKeyGenParams extends Algorithm {
+ hash: HashAlgorithmIdentifier;
+ length?: number;
+ }
+ interface JsonWebKey {
+ alg?: string;
+ crv?: string;
+ d?: string;
+ dp?: string;
+ dq?: string;
+ e?: string;
+ ext?: boolean;
+ k?: string;
+ key_ops?: string[];
+ kty?: string;
+ n?: string;
+ oth?: RsaOtherPrimesInfo[];
+ p?: string;
+ q?: string;
+ qi?: string;
+ use?: string;
+ x?: string;
+ y?: string;
+ }
+ interface KeyAlgorithm {
+ name: string;
+ }
+ interface Pbkdf2Params extends Algorithm {
+ hash: HashAlgorithmIdentifier;
+ iterations: number;
+ salt: BufferSource;
+ }
+ interface RsaHashedImportParams extends Algorithm {
+ hash: HashAlgorithmIdentifier;
+ }
+ interface RsaHashedKeyAlgorithm extends RsaKeyAlgorithm {
+ hash: KeyAlgorithm;
+ }
+ interface RsaHashedKeyGenParams extends RsaKeyGenParams {
+ hash: HashAlgorithmIdentifier;
+ }
+ interface RsaKeyAlgorithm extends KeyAlgorithm {
+ modulusLength: number;
+ publicExponent: BigInteger;
+ }
+ interface RsaKeyGenParams extends Algorithm {
+ modulusLength: number;
+ publicExponent: BigInteger;
+ }
+ interface RsaOaepParams extends Algorithm {
+ label?: BufferSource;
+ }
+ interface RsaOtherPrimesInfo {
+ d?: string;
+ r?: string;
+ t?: string;
+ }
+ interface RsaPssParams extends Algorithm {
+ saltLength: number;
+ }
+ /**
+ * Calling `require('node:crypto').webcrypto` returns an instance of the `Crypto` class.
+ * `Crypto` is a singleton that provides access to the remainder of the crypto API.
+ * @since v15.0.0
+ */
+ interface Crypto {
+ /**
+ * Provides access to the `SubtleCrypto` API.
+ * @since v15.0.0
+ */
+ readonly subtle: SubtleCrypto;
+ /**
+ * Generates cryptographically strong random values.
+ * The given `typedArray` is filled with random values, and a reference to `typedArray` is returned.
+ *
+ * The given `typedArray` must be an integer-based instance of {@link NodeJS.TypedArray}, i.e. `Float32Array` and `Float64Array` are not accepted.
+ *
+ * An error will be thrown if the given `typedArray` is larger than 65,536 bytes.
+ * @since v15.0.0
+ */
+ getRandomValues<T extends Exclude<NodeJS.TypedArray, Float32Array | Float64Array>>(typedArray: T): T;
+ /**
+ * Generates a random {@link https://www.rfc-editor.org/rfc/rfc4122.txt RFC 4122} version 4 UUID.
+ * The UUID is generated using a cryptographic pseudorandom number generator.
+ * @since v16.7.0
+ */
+ randomUUID(): UUID;
+ CryptoKey: CryptoKeyConstructor;
+ }
+ // This constructor throws ILLEGAL_CONSTRUCTOR so it should not be newable.
+ interface CryptoKeyConstructor {
+ /** Illegal constructor */
+ (_: { readonly _: unique symbol }): never; // Allows instanceof to work but not be callable by the user.
+ readonly length: 0;
+ readonly name: "CryptoKey";
+ readonly prototype: CryptoKey;
+ }
+ /**
+ * @since v15.0.0
+ */
+ interface CryptoKey {
+ /**
+ * An object detailing the algorithm for which the key can be used along with additional algorithm-specific parameters.
+ * @since v15.0.0
+ */
+ readonly algorithm: KeyAlgorithm;
+ /**
+ * When `true`, the {@link CryptoKey} can be extracted using either `subtleCrypto.exportKey()` or `subtleCrypto.wrapKey()`.
+ * @since v15.0.0
+ */
+ readonly extractable: boolean;
+ /**
+ * A string identifying whether the key is a symmetric (`'secret'`) or asymmetric (`'private'` or `'public'`) key.
+ * @since v15.0.0
+ */
+ readonly type: KeyType;
+ /**
+ * An array of strings identifying the operations for which the key may be used.
+ *
+ * The possible usages are:
+ * - `'encrypt'` - The key may be used to encrypt data.
+ * - `'decrypt'` - The key may be used to decrypt data.
+ * - `'sign'` - The key may be used to generate digital signatures.
+ * - `'verify'` - The key may be used to verify digital signatures.
+ * - `'deriveKey'` - The key may be used to derive a new key.
+ * - `'deriveBits'` - The key may be used to derive bits.
+ * - `'wrapKey'` - The key may be used to wrap another key.
+ * - `'unwrapKey'` - The key may be used to unwrap another key.
+ *
+ * Valid key usages depend on the key algorithm (identified by `cryptokey.algorithm.name`).
+ * @since v15.0.0
+ */
+ readonly usages: KeyUsage[];
+ }
+ /**
+ * The `CryptoKeyPair` is a simple dictionary object with `publicKey` and `privateKey` properties, representing an asymmetric key pair.
+ * @since v15.0.0
+ */
+ interface CryptoKeyPair {
+ /**
+ * A {@link CryptoKey} whose type will be `'private'`.
+ * @since v15.0.0
+ */
+ privateKey: CryptoKey;
+ /**
+ * A {@link CryptoKey} whose type will be `'public'`.
+ * @since v15.0.0
+ */
+ publicKey: CryptoKey;
+ }
+ /**
+ * @since v15.0.0
+ */
+ interface SubtleCrypto {
+ /**
+ * Using the method and parameters specified in `algorithm` and the keying material provided by `key`,
+ * `subtle.decrypt()` attempts to decipher the provided `data`. If successful,
+ * the returned promise will be resolved with an `<ArrayBuffer>` containing the plaintext result.
+ *
+ * The algorithms currently supported include:
+ *
+ * - `'RSA-OAEP'`
+ * - `'AES-CTR'`
+ * - `'AES-CBC'`
+ * - `'AES-GCM'`
+ * @since v15.0.0
+ */
+ decrypt(
+ algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams,
+ key: CryptoKey,
+ data: BufferSource,
+ ): Promise<ArrayBuffer>;
+ /**
+ * Using the method and parameters specified in `algorithm` and the keying material provided by `baseKey`,
+ * `subtle.deriveBits()` attempts to generate `length` bits.
+ * The Node.js implementation requires that when `length` is a number it must be multiple of `8`.
+ * When `length` is `null` the maximum number of bits for a given algorithm is generated. This is allowed
+ * for the `'ECDH'`, `'X25519'`, and `'X448'` algorithms.
+ * If successful, the returned promise will be resolved with an `<ArrayBuffer>` containing the generated data.
+ *
+ * The algorithms currently supported include:
+ *
+ * - `'ECDH'`
+ * - `'X25519'`
+ * - `'X448'`
+ * - `'HKDF'`
+ * - `'PBKDF2'`
+ * @since v15.0.0
+ */
+ deriveBits(algorithm: EcdhKeyDeriveParams, baseKey: CryptoKey, length: number | null): Promise<ArrayBuffer>;
+ deriveBits(
+ algorithm: AlgorithmIdentifier | HkdfParams | Pbkdf2Params,
+ baseKey: CryptoKey,
+ length: number,
+ ): Promise<ArrayBuffer>;
+ /**
+ * Using the method and parameters specified in `algorithm`, and the keying material provided by `baseKey`,
+ * `subtle.deriveKey()` attempts to generate a new <CryptoKey>` based on the method and parameters in `derivedKeyAlgorithm`.
+ *
+ * Calling `subtle.deriveKey()` is equivalent to calling `subtle.deriveBits()` to generate raw keying material,
+ * then passing the result into the `subtle.importKey()` method using the `deriveKeyAlgorithm`, `extractable`, and `keyUsages` parameters as input.
+ *
+ * The algorithms currently supported include:
+ *
+ * - `'ECDH'`
+ * - `'X25519'`
+ * - `'X448'`
+ * - `'HKDF'`
+ * - `'PBKDF2'`
+ * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}.
+ * @since v15.0.0
+ */
+ deriveKey(
+ algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params,
+ baseKey: CryptoKey,
+ derivedKeyAlgorithm:
+ | AlgorithmIdentifier
+ | AesDerivedKeyParams
+ | HmacImportParams
+ | HkdfParams
+ | Pbkdf2Params,
+ extractable: boolean,
+ keyUsages: readonly KeyUsage[],
+ ): Promise<CryptoKey>;
+ /**
+ * Using the method identified by `algorithm`, `subtle.digest()` attempts to generate a digest of `data`.
+ * If successful, the returned promise is resolved with an `<ArrayBuffer>` containing the computed digest.
+ *
+ * If `algorithm` is provided as a `<string>`, it must be one of:
+ *
+ * - `'SHA-1'`
+ * - `'SHA-256'`
+ * - `'SHA-384'`
+ * - `'SHA-512'`
+ *
+ * If `algorithm` is provided as an `<Object>`, it must have a `name` property whose value is one of the above.
+ * @since v15.0.0
+ */
+ digest(algorithm: AlgorithmIdentifier, data: BufferSource): Promise<ArrayBuffer>;
+ /**
+ * Using the method and parameters specified by `algorithm` and the keying material provided by `key`,
+ * `subtle.encrypt()` attempts to encipher `data`. If successful,
+ * the returned promise is resolved with an `<ArrayBuffer>` containing the encrypted result.
+ *
+ * The algorithms currently supported include:
+ *
+ * - `'RSA-OAEP'`
+ * - `'AES-CTR'`
+ * - `'AES-CBC'`
+ * - `'AES-GCM'`
+ * @since v15.0.0
+ */
+ encrypt(
+ algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams,
+ key: CryptoKey,
+ data: BufferSource,
+ ): Promise<ArrayBuffer>;
+ /**
+ * Exports the given key into the specified format, if supported.
+ *
+ * If the `<CryptoKey>` is not extractable, the returned promise will reject.
+ *
+ * When `format` is either `'pkcs8'` or `'spki'` and the export is successful,
+ * the returned promise will be resolved with an `<ArrayBuffer>` containing the exported key data.
+ *
+ * When `format` is `'jwk'` and the export is successful, the returned promise will be resolved with a
+ * JavaScript object conforming to the {@link https://tools.ietf.org/html/rfc7517 JSON Web Key} specification.
+ * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`.
+ * @returns `<Promise>` containing `<ArrayBuffer>`.
+ * @since v15.0.0
+ */
+ exportKey(format: "jwk", key: CryptoKey): Promise<JsonWebKey>;
+ exportKey(format: Exclude<KeyFormat, "jwk">, key: CryptoKey): Promise<ArrayBuffer>;
+ /**
+ * Using the method and parameters provided in `algorithm`,
+ * `subtle.generateKey()` attempts to generate new keying material.
+ * Depending the method used, the method may generate either a single `<CryptoKey>` or a `<CryptoKeyPair>`.
+ *
+ * The `<CryptoKeyPair>` (public and private key) generating algorithms supported include:
+ *
+ * - `'RSASSA-PKCS1-v1_5'`
+ * - `'RSA-PSS'`
+ * - `'RSA-OAEP'`
+ * - `'ECDSA'`
+ * - `'Ed25519'`
+ * - `'Ed448'`
+ * - `'ECDH'`
+ * - `'X25519'`
+ * - `'X448'`
+ * The `<CryptoKey>` (secret key) generating algorithms supported include:
+ *
+ * - `'HMAC'`
+ * - `'AES-CTR'`
+ * - `'AES-CBC'`
+ * - `'AES-GCM'`
+ * - `'AES-KW'`
+ * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}.
+ * @since v15.0.0
+ */
+ generateKey(
+ algorithm: RsaHashedKeyGenParams | EcKeyGenParams,
+ extractable: boolean,
+ keyUsages: readonly KeyUsage[],
+ ): Promise<CryptoKeyPair>;
+ generateKey(
+ algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params,
+ extractable: boolean,
+ keyUsages: readonly KeyUsage[],
+ ): Promise<CryptoKey>;
+ generateKey(
+ algorithm: AlgorithmIdentifier,
+ extractable: boolean,
+ keyUsages: KeyUsage[],
+ ): Promise<CryptoKeyPair | CryptoKey>;
+ /**
+ * The `subtle.importKey()` method attempts to interpret the provided `keyData` as the given `format`
+ * to create a `<CryptoKey>` instance using the provided `algorithm`, `extractable`, and `keyUsages` arguments.
+ * If the import is successful, the returned promise will be resolved with the created `<CryptoKey>`.
+ *
+ * If importing a `'PBKDF2'` key, `extractable` must be `false`.
+ * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`.
+ * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}.
+ * @since v15.0.0
+ */
+ importKey(
+ format: "jwk",
+ keyData: JsonWebKey,
+ algorithm:
+ | AlgorithmIdentifier
+ | RsaHashedImportParams
+ | EcKeyImportParams
+ | HmacImportParams
+ | AesKeyAlgorithm,
+ extractable: boolean,
+ keyUsages: readonly KeyUsage[],
+ ): Promise<CryptoKey>;
+ importKey(
+ format: Exclude<KeyFormat, "jwk">,
+ keyData: BufferSource,
+ algorithm:
+ | AlgorithmIdentifier
+ | RsaHashedImportParams
+ | EcKeyImportParams
+ | HmacImportParams
+ | AesKeyAlgorithm,
+ extractable: boolean,
+ keyUsages: KeyUsage[],
+ ): Promise<CryptoKey>;
+ /**
+ * Using the method and parameters given by `algorithm` and the keying material provided by `key`,
+ * `subtle.sign()` attempts to generate a cryptographic signature of `data`. If successful,
+ * the returned promise is resolved with an `<ArrayBuffer>` containing the generated signature.
+ *
+ * The algorithms currently supported include:
+ *
+ * - `'RSASSA-PKCS1-v1_5'`
+ * - `'RSA-PSS'`
+ * - `'ECDSA'`
+ * - `'Ed25519'`
+ * - `'Ed448'`
+ * - `'HMAC'`
+ * @since v15.0.0
+ */
+ sign(
+ algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | Ed448Params,
+ key: CryptoKey,
+ data: BufferSource,
+ ): Promise<ArrayBuffer>;
+ /**
+ * In cryptography, "wrapping a key" refers to exporting and then encrypting the keying material.
+ * The `subtle.unwrapKey()` method attempts to decrypt a wrapped key and create a `<CryptoKey>` instance.
+ * It is equivalent to calling `subtle.decrypt()` first on the encrypted key data (using the `wrappedKey`, `unwrapAlgo`, and `unwrappingKey` arguments as input)
+ * then passing the results in to the `subtle.importKey()` method using the `unwrappedKeyAlgo`, `extractable`, and `keyUsages` arguments as inputs.
+ * If successful, the returned promise is resolved with a `<CryptoKey>` object.
+ *
+ * The wrapping algorithms currently supported include:
+ *
+ * - `'RSA-OAEP'`
+ * - `'AES-CTR'`
+ * - `'AES-CBC'`
+ * - `'AES-GCM'`
+ * - `'AES-KW'`
+ *
+ * The unwrapped key algorithms supported include:
+ *
+ * - `'RSASSA-PKCS1-v1_5'`
+ * - `'RSA-PSS'`
+ * - `'RSA-OAEP'`
+ * - `'ECDSA'`
+ * - `'Ed25519'`
+ * - `'Ed448'`
+ * - `'ECDH'`
+ * - `'X25519'`
+ * - `'X448'`
+ * - `'HMAC'`
+ * - `'AES-CTR'`
+ * - `'AES-CBC'`
+ * - `'AES-GCM'`
+ * - `'AES-KW'`
+ * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`.
+ * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}.
+ * @since v15.0.0
+ */
+ unwrapKey(
+ format: KeyFormat,
+ wrappedKey: BufferSource,
+ unwrappingKey: CryptoKey,
+ unwrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams,
+ unwrappedKeyAlgorithm:
+ | AlgorithmIdentifier
+ | RsaHashedImportParams
+ | EcKeyImportParams
+ | HmacImportParams
+ | AesKeyAlgorithm,
+ extractable: boolean,
+ keyUsages: KeyUsage[],
+ ): Promise<CryptoKey>;
+ /**
+ * Using the method and parameters given in `algorithm` and the keying material provided by `key`,
+ * `subtle.verify()` attempts to verify that `signature` is a valid cryptographic signature of `data`.
+ * The returned promise is resolved with either `true` or `false`.
+ *
+ * The algorithms currently supported include:
+ *
+ * - `'RSASSA-PKCS1-v1_5'`
+ * - `'RSA-PSS'`
+ * - `'ECDSA'`
+ * - `'Ed25519'`
+ * - `'Ed448'`
+ * - `'HMAC'`
+ * @since v15.0.0
+ */
+ verify(
+ algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | Ed448Params,
+ key: CryptoKey,
+ signature: BufferSource,
+ data: BufferSource,
+ ): Promise<boolean>;
+ /**
+ * In cryptography, "wrapping a key" refers to exporting and then encrypting the keying material.
+ * The `subtle.wrapKey()` method exports the keying material into the format identified by `format`,
+ * then encrypts it using the method and parameters specified by `wrapAlgo` and the keying material provided by `wrappingKey`.
+ * It is the equivalent to calling `subtle.exportKey()` using `format` and `key` as the arguments,
+ * then passing the result to the `subtle.encrypt()` method using `wrappingKey` and `wrapAlgo` as inputs.
+ * If successful, the returned promise will be resolved with an `<ArrayBuffer>` containing the encrypted key data.
+ *
+ * The wrapping algorithms currently supported include:
+ *
+ * - `'RSA-OAEP'`
+ * - `'AES-CTR'`
+ * - `'AES-CBC'`
+ * - `'AES-GCM'`
+ * - `'AES-KW'`
+ * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`.
+ * @since v15.0.0
+ */
+ wrapKey(
+ format: KeyFormat,
+ key: CryptoKey,
+ wrappingKey: CryptoKey,
+ wrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams,
+ ): Promise<ArrayBuffer>;
+ }
+ }
+}
+declare module "node:crypto" {
+ export * from "crypto";
+}
diff --git a/client/node_modules/@types/node/dgram.d.ts b/client/node_modules/@types/node/dgram.d.ts
new file mode 100644
index 0000000..c50162c
--- /dev/null
+++ b/client/node_modules/@types/node/dgram.d.ts
@@ -0,0 +1,586 @@
+/**
+ * The `dgram` module provides an implementation of UDP datagram sockets.
+ *
+ * ```js
+ * import dgram from 'dgram';
+ *
+ * const server = dgram.createSocket('udp4');
+ *
+ * server.on('error', (err) => {
+ * console.log(`server error:\n${err.stack}`);
+ * server.close();
+ * });
+ *
+ * server.on('message', (msg, rinfo) => {
+ * console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`);
+ * });
+ *
+ * server.on('listening', () => {
+ * const address = server.address();
+ * console.log(`server listening ${address.address}:${address.port}`);
+ * });
+ *
+ * server.bind(41234);
+ * // Prints: server listening 0.0.0.0:41234
+ * ```
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/dgram.js)
+ */
+declare module "dgram" {
+ import { AddressInfo } from "node:net";
+ import * as dns from "node:dns";
+ import { Abortable, EventEmitter } from "node:events";
+ interface RemoteInfo {
+ address: string;
+ family: "IPv4" | "IPv6";
+ port: number;
+ size: number;
+ }
+ interface BindOptions {
+ port?: number | undefined;
+ address?: string | undefined;
+ exclusive?: boolean | undefined;
+ fd?: number | undefined;
+ }
+ type SocketType = "udp4" | "udp6";
+ interface SocketOptions extends Abortable {
+ type: SocketType;
+ reuseAddr?: boolean | undefined;
+ /**
+ * @default false
+ */
+ ipv6Only?: boolean | undefined;
+ recvBufferSize?: number | undefined;
+ sendBufferSize?: number | undefined;
+ lookup?:
+ | ((
+ 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
+ * messages. When `address` and `port` are not passed to `socket.bind()` the
+ * method will bind the socket to the "all interfaces" address on a random port
+ * (it does the right thing for both `udp4` and `udp6` sockets). The bound address
+ * and port can be retrieved using `socket.address().address` and `socket.address().port`.
+ *
+ * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.close()` on the socket:
+ *
+ * ```js
+ * const controller = new AbortController();
+ * const { signal } = controller;
+ * const server = dgram.createSocket({ type: 'udp4', signal });
+ * server.on('message', (msg, rinfo) => {
+ * console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`);
+ * });
+ * // Later, when you want to close the server.
+ * controller.abort();
+ * ```
+ * @since v0.11.13
+ * @param options Available options are:
+ * @param callback Attached as a listener for `'message'` events. Optional.
+ */
+ function createSocket(type: SocketType, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket;
+ function createSocket(options: SocketOptions, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket;
+ /**
+ * Encapsulates the datagram functionality.
+ *
+ * New instances of `dgram.Socket` are created using {@link createSocket}.
+ * The `new` keyword is not to be used to create `dgram.Socket` instances.
+ * @since v0.1.99
+ */
+ class Socket extends EventEmitter {
+ /**
+ * Tells the kernel to join a multicast group at the given `multicastAddress` and`multicastInterface` using the `IP_ADD_MEMBERSHIP` socket option. If the`multicastInterface` argument is not
+ * specified, the operating system will choose
+ * one interface and will add membership to it. To add membership to every
+ * available interface, call `addMembership` multiple times, once per interface.
+ *
+ * When called on an unbound socket, this method will implicitly bind to a random
+ * port, listening on all interfaces.
+ *
+ * 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
+ * import cluster from 'cluster';
+ * import dgram from 'dgram';
+ *
+ * if (cluster.isPrimary) {
+ * cluster.fork(); // Works ok.
+ * cluster.fork(); // Fails with EADDRINUSE.
+ * } else {
+ * const s = dgram.createSocket('udp4');
+ * s.bind(1234, () => {
+ * s.addMembership('224.0.0.114');
+ * });
+ * }
+ * ```
+ * @since v0.6.9
+ */
+ addMembership(multicastAddress: string, multicastInterface?: string): void;
+ /**
+ * Returns an object containing the address information for a socket.
+ * For UDP sockets, this object will contain `address`, `family` and `port`properties.
+ *
+ * This method throws `EBADF` if called on an unbound socket.
+ * @since v0.1.99
+ */
+ address(): AddressInfo;
+ /**
+ * For UDP sockets, causes the `dgram.Socket` to listen for datagram
+ * messages on a named `port` and optional `address`. If `port` is not
+ * specified or is `0`, the operating system will attempt to bind to a
+ * random port. If `address` is not specified, the operating system will
+ * attempt to listen on all addresses. Once binding is complete, a`'listening'` event is emitted and the optional `callback` function is
+ * called.
+ *
+ * Specifying both a `'listening'` event listener and passing a`callback` to the `socket.bind()` method is not harmful but not very
+ * useful.
+ *
+ * A bound datagram socket keeps the Node.js process running to receive
+ * datagram messages.
+ *
+ * If binding fails, an `'error'` event is generated. In rare case (e.g.
+ * attempting to bind with a closed socket), an `Error` may be thrown.
+ *
+ * Example of a UDP server listening on port 41234:
+ *
+ * ```js
+ * import dgram from 'dgram';
+ *
+ * const server = dgram.createSocket('udp4');
+ *
+ * server.on('error', (err) => {
+ * console.log(`server error:\n${err.stack}`);
+ * server.close();
+ * });
+ *
+ * server.on('message', (msg, rinfo) => {
+ * console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`);
+ * });
+ *
+ * server.on('listening', () => {
+ * const address = server.address();
+ * console.log(`server listening ${address.address}:${address.port}`);
+ * });
+ *
+ * server.bind(41234);
+ * // Prints: server listening 0.0.0.0:41234
+ * ```
+ * @since v0.1.99
+ * @param callback with no parameters. Called when binding is complete.
+ */
+ bind(port?: number, address?: string, callback?: () => void): this;
+ bind(port?: number, callback?: () => void): this;
+ bind(callback?: () => void): this;
+ bind(options: BindOptions, callback?: () => void): this;
+ /**
+ * Close the underlying socket and stop listening for data on it. If a callback is
+ * provided, it is added as a listener for the `'close'` event.
+ * @since v0.1.99
+ * @param callback Called when the socket has been closed.
+ */
+ close(callback?: () => void): this;
+ /**
+ * Associates the `dgram.Socket` to a remote address and port. Every
+ * message sent by this handle is automatically sent to that destination. Also,
+ * the socket will only receive messages from that remote peer.
+ * Trying to call `connect()` on an already connected socket will result
+ * in an `ERR_SOCKET_DGRAM_IS_CONNECTED` exception. If `address` is not
+ * provided, `'127.0.0.1'` (for `udp4` sockets) or `'::1'` (for `udp6` sockets)
+ * will be used by default. Once the connection is complete, a `'connect'` event
+ * is emitted and the optional `callback` function is called. In case of failure,
+ * the `callback` is called or, failing this, an `'error'` event is emitted.
+ * @since v12.0.0
+ * @param callback Called when the connection is completed or on error.
+ */
+ connect(port: number, address?: string, callback?: () => void): void;
+ connect(port: number, callback: () => void): void;
+ /**
+ * A synchronous function that disassociates a connected `dgram.Socket` from
+ * its remote address. Trying to call `disconnect()` on an unbound or already
+ * disconnected socket will result in an `ERR_SOCKET_DGRAM_NOT_CONNECTED` exception.
+ * @since v12.0.0
+ */
+ disconnect(): void;
+ /**
+ * Instructs the kernel to leave a multicast group at `multicastAddress` using the`IP_DROP_MEMBERSHIP` socket option. This method is automatically called by the
+ * kernel when the socket is closed or the process terminates, so most apps will
+ * never have reason to call this.
+ *
+ * If `multicastInterface` is not specified, the operating system will attempt to
+ * drop membership on all valid interfaces.
+ * @since v0.6.9
+ */
+ dropMembership(multicastAddress: string, multicastInterface?: string): void;
+ /**
+ * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket.
+ * @since v8.7.0
+ * @return the `SO_RCVBUF` socket receive buffer size in bytes.
+ */
+ getRecvBufferSize(): number;
+ /**
+ * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket.
+ * @since v8.7.0
+ * @return the `SO_SNDBUF` socket send buffer size in bytes.
+ */
+ getSendBufferSize(): number;
+ /**
+ * By default, binding a socket will cause it to block the Node.js process from
+ * exiting as long as the socket is open. The `socket.unref()` method can be used
+ * to exclude the socket from the reference counting that keeps the Node.js
+ * process active. The `socket.ref()` method adds the socket back to the reference
+ * counting and restores the default behavior.
+ *
+ * Calling `socket.ref()` multiples times will have no additional effect.
+ *
+ * The `socket.ref()` method returns a reference to the socket so calls can be
+ * chained.
+ * @since v0.9.1
+ */
+ ref(): this;
+ /**
+ * Returns an object containing the `address`, `family`, and `port` of the remote
+ * endpoint. This method throws an `ERR_SOCKET_DGRAM_NOT_CONNECTED` exception
+ * if the socket is not connected.
+ * @since v12.0.0
+ */
+ remoteAddress(): AddressInfo;
+ /**
+ * Broadcasts a datagram on the socket.
+ * For connectionless sockets, the destination `port` and `address` must be
+ * specified. Connected sockets, on the other hand, will use their associated
+ * remote endpoint, so the `port` and `address` arguments must not be set.
+ *
+ * The `msg` argument contains the message to be sent.
+ * Depending on its type, different behavior can apply. If `msg` is a `Buffer`,
+ * any `TypedArray` or a `DataView`,
+ * the `offset` and `length` specify the offset within the `Buffer` where the
+ * message begins and the number of bytes in the message, respectively.
+ * If `msg` is a `String`, then it is automatically converted to a `Buffer`with `'utf8'` encoding. With messages that
+ * contain multi-byte characters, `offset` and `length` will be calculated with
+ * respect to `byte length` and not the character position.
+ * If `msg` is an array, `offset` and `length` must not be specified.
+ *
+ * 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
+ * provided or otherwise nullish, `'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
+ * is assigned a random port number and is bound to the "all interfaces" address
+ * (`'0.0.0.0'` for `udp4` sockets, `'::0'` for `udp6` sockets.)
+ *
+ * An optional `callback` function may be specified to as a way of reporting
+ * DNS errors or for determining when it is safe to reuse the `buf` object.
+ * DNS lookups delay the time to send for at least one tick of the
+ * Node.js event loop.
+ *
+ * The only way to know for sure that the datagram has been sent is by using a`callback`. If an error occurs and a `callback` is given, the error will be
+ * passed as the first argument to the `callback`. If a `callback` is not given,
+ * the error is emitted as an `'error'` event on the `socket` object.
+ *
+ * Offset and length are optional but both _must_ be set if either are used.
+ * They are supported only when the first argument is a `Buffer`, a `TypedArray`,
+ * or a `DataView`.
+ *
+ * This method throws `ERR_SOCKET_BAD_PORT` if called on an unbound socket.
+ *
+ * Example of sending a UDP packet to a port on `localhost`;
+ *
+ * ```js
+ * import dgram from 'dgram';
+ * import { Buffer } from 'buffer';
+ *
+ * const message = Buffer.from('Some bytes');
+ * const client = dgram.createSocket('udp4');
+ * client.send(message, 41234, 'localhost', (err) => {
+ * client.close();
+ * });
+ * ```
+ *
+ * Example of sending a UDP packet composed of multiple buffers to a port on`127.0.0.1`;
+ *
+ * ```js
+ * import dgram from 'dgram';
+ * import { Buffer } from 'buffer';
+ *
+ * const buf1 = Buffer.from('Some ');
+ * const buf2 = Buffer.from('bytes');
+ * const client = dgram.createSocket('udp4');
+ * client.send([buf1, buf2], 41234, (err) => {
+ * client.close();
+ * });
+ * ```
+ *
+ * Sending multiple buffers might be faster or slower depending on the
+ * application and operating system. Run benchmarks to
+ * determine the optimal strategy on a case-by-case basis. Generally speaking,
+ * however, sending multiple buffers is faster.
+ *
+ * Example of sending a UDP packet using a socket connected to a port on`localhost`:
+ *
+ * ```js
+ * import dgram from 'dgram';
+ * import { Buffer } from 'buffer';
+ *
+ * const message = Buffer.from('Some bytes');
+ * const client = dgram.createSocket('udp4');
+ * client.connect(41234, 'localhost', (err) => {
+ * client.send(message, (err) => {
+ * client.close();
+ * });
+ * });
+ * ```
+ * @since v0.1.99
+ * @param msg Message to be sent.
+ * @param offset Offset in the buffer where the message starts.
+ * @param length Number of bytes in the message.
+ * @param port Destination port.
+ * @param address Destination host name or IP address.
+ * @param callback Called when the message has been sent.
+ */
+ send(
+ msg: string | Uint8Array | readonly any[],
+ port?: number,
+ address?: string,
+ callback?: (error: Error | null, bytes: number) => void,
+ ): void;
+ send(
+ msg: string | Uint8Array | readonly any[],
+ port?: number,
+ callback?: (error: Error | null, bytes: number) => void,
+ ): void;
+ send(
+ msg: string | Uint8Array | readonly 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
+ * packets may be sent to a local interface's broadcast address.
+ *
+ * This method throws `EBADF` if called on an unbound socket.
+ * @since v0.6.9
+ */
+ setBroadcast(flag: boolean): void;
+ /**
+ * _All references to scope in this section are referring to [IPv6 Zone Indices](https://en.wikipedia.org/wiki/IPv6_address#Scoped_literal_IPv6_addresses), which are defined by [RFC
+ * 4007](https://tools.ietf.org/html/rfc4007). In string form, an IP_
+ * _with a scope index is written as `'IP%scope'` where scope is an interface name_
+ * _or interface number._
+ *
+ * Sets the default outgoing multicast interface of the socket to a chosen
+ * interface or back to system interface selection. The `multicastInterface` must
+ * be a valid string representation of an IP from the socket's family.
+ *
+ * For IPv4 sockets, this should be the IP configured for the desired physical
+ * interface. All packets sent to multicast on the socket will be sent on the
+ * interface determined by the most recent successful use of this call.
+ *
+ * For IPv6 sockets, `multicastInterface` should include a scope to indicate the
+ * interface as in the examples that follow. In IPv6, individual `send` calls can
+ * also use explicit scope in addresses, so only packets sent to a multicast
+ * address without specifying an explicit scope are affected by the most recent
+ * successful use of this call.
+ *
+ * This method throws `EBADF` if called on an unbound socket.
+ *
+ * #### Example: IPv6 outgoing multicast interface
+ *
+ * On most systems, where scope format uses the interface name:
+ *
+ * ```js
+ * const socket = dgram.createSocket('udp6');
+ *
+ * socket.bind(1234, () => {
+ * socket.setMulticastInterface('::%eth1');
+ * });
+ * ```
+ *
+ * On Windows, where scope format uses an interface number:
+ *
+ * ```js
+ * const socket = dgram.createSocket('udp6');
+ *
+ * socket.bind(1234, () => {
+ * socket.setMulticastInterface('::%2');
+ * });
+ * ```
+ *
+ * #### Example: IPv4 outgoing multicast interface
+ *
+ * All systems use an IP of the host on the desired physical interface:
+ *
+ * ```js
+ * const socket = dgram.createSocket('udp4');
+ *
+ * socket.bind(1234, () => {
+ * socket.setMulticastInterface('10.0.0.2');
+ * });
+ * ```
+ * @since v8.6.0
+ */
+ setMulticastInterface(multicastInterface: string): void;
+ /**
+ * Sets or clears the `IP_MULTICAST_LOOP` socket option. When set to `true`,
+ * multicast packets will also be received on the local interface.
+ *
+ * This method throws `EBADF` if called on an unbound socket.
+ * @since v0.3.8
+ */
+ setMulticastLoopback(flag: boolean): boolean;
+ /**
+ * Sets the `IP_MULTICAST_TTL` socket option. While TTL generally stands for
+ * "Time to Live", in this context it specifies the number of IP hops that a
+ * packet is allowed to travel through, specifically for multicast traffic. Each
+ * router or gateway that forwards a packet decrements the TTL. If the TTL is
+ * decremented to 0 by a router, it will not be forwarded.
+ *
+ * The `ttl` argument may be between 0 and 255\. The default on most systems is `1`.
+ *
+ * This method throws `EBADF` if called on an unbound socket.
+ * @since v0.3.8
+ */
+ setMulticastTTL(ttl: number): number;
+ /**
+ * Sets the `SO_RCVBUF` socket option. Sets the maximum socket receive buffer
+ * in bytes.
+ *
+ * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket.
+ * @since v8.7.0
+ */
+ setRecvBufferSize(size: number): void;
+ /**
+ * Sets the `SO_SNDBUF` socket option. Sets the maximum socket send buffer
+ * in bytes.
+ *
+ * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket.
+ * @since v8.7.0
+ */
+ setSendBufferSize(size: number): void;
+ /**
+ * Sets the `IP_TTL` socket option. While TTL generally stands for "Time to Live",
+ * in this context it specifies the number of IP hops that a packet is allowed to
+ * travel through. Each router or gateway that forwards a packet decrements the
+ * 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.
+ *
+ * The `ttl` argument may be between 1 and 255\. The default on most systems
+ * is 64.
+ *
+ * This method throws `EBADF` if called on an unbound socket.
+ * @since v0.1.101
+ */
+ setTTL(ttl: number): number;
+ /**
+ * By default, binding a socket will cause it to block the Node.js process from
+ * exiting as long as the socket is open. The `socket.unref()` method can be used
+ * to exclude the socket from the reference counting that keeps the Node.js
+ * process active, allowing the process to exit even if the socket is still
+ * listening.
+ *
+ * Calling `socket.unref()` multiple times will have no addition effect.
+ *
+ * The `socket.unref()` method returns a reference to the socket so calls can be
+ * chained.
+ * @since v0.9.1
+ */
+ unref(): this;
+ /**
+ * Tells the kernel to join a source-specific multicast channel at the given`sourceAddress` and `groupAddress`, using the `multicastInterface` with the`IP_ADD_SOURCE_MEMBERSHIP` socket
+ * option. If the `multicastInterface` argument
+ * is not specified, the operating system will choose one interface and will add
+ * membership to it. To add membership to every available interface, call`socket.addSourceSpecificMembership()` multiple times, once per interface.
+ *
+ * When called on an unbound socket, this method will implicitly bind to a random
+ * port, listening on all interfaces.
+ * @since v13.1.0, v12.16.0
+ */
+ addSourceSpecificMembership(sourceAddress: string, groupAddress: string, multicastInterface?: string): void;
+ /**
+ * Instructs the kernel to leave a source-specific multicast channel at the given`sourceAddress` and `groupAddress` using the `IP_DROP_SOURCE_MEMBERSHIP`socket option. This method is
+ * automatically called by the kernel when the
+ * socket is closed or the process terminates, so most apps will never have
+ * reason to call this.
+ *
+ * If `multicastInterface` is not specified, the operating system will attempt to
+ * drop membership on all valid interfaces.
+ * @since v13.1.0, v12.16.0
+ */
+ dropSourceSpecificMembership(sourceAddress: string, groupAddress: string, multicastInterface?: string): void;
+ /**
+ * events.EventEmitter
+ * 1. close
+ * 2. connect
+ * 3. error
+ * 4. listening
+ * 5. message
+ */
+ addListener(event: string, listener: (...args: any[]) => void): this;
+ addListener(event: "close", listener: () => void): this;
+ addListener(event: "connect", listener: () => void): this;
+ addListener(event: "error", listener: (err: Error) => void): this;
+ addListener(event: "listening", listener: () => void): this;
+ addListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
+ emit(event: string | symbol, ...args: any[]): boolean;
+ emit(event: "close"): boolean;
+ emit(event: "connect"): boolean;
+ emit(event: "error", err: Error): boolean;
+ emit(event: "listening"): boolean;
+ emit(event: "message", msg: Buffer, rinfo: RemoteInfo): boolean;
+ on(event: string, listener: (...args: any[]) => void): this;
+ on(event: "close", listener: () => void): this;
+ on(event: "connect", listener: () => void): this;
+ on(event: "error", listener: (err: Error) => void): this;
+ on(event: "listening", listener: () => void): this;
+ on(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
+ once(event: string, listener: (...args: any[]) => void): this;
+ once(event: "close", listener: () => void): this;
+ once(event: "connect", listener: () => void): this;
+ once(event: "error", listener: (err: Error) => void): this;
+ once(event: "listening", listener: () => void): this;
+ once(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
+ prependListener(event: string, listener: (...args: any[]) => void): this;
+ prependListener(event: "close", listener: () => void): this;
+ prependListener(event: "connect", listener: () => void): this;
+ prependListener(event: "error", listener: (err: Error) => void): this;
+ prependListener(event: "listening", listener: () => void): this;
+ prependListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
+ prependOnceListener(event: string, listener: (...args: any[]) => void): this;
+ prependOnceListener(event: "close", listener: () => void): this;
+ prependOnceListener(event: "connect", listener: () => void): this;
+ prependOnceListener(event: "error", listener: (err: Error) => void): this;
+ prependOnceListener(event: "listening", listener: () => 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 v18.18.0
+ */
+ [Symbol.asyncDispose](): Promise<void>;
+ }
+}
+declare module "node:dgram" {
+ export * from "dgram";
+}
diff --git a/client/node_modules/@types/node/diagnostics_channel.d.ts b/client/node_modules/@types/node/diagnostics_channel.d.ts
new file mode 100644
index 0000000..eeb4d91
--- /dev/null
+++ b/client/node_modules/@types/node/diagnostics_channel.d.ts
@@ -0,0 +1,192 @@
+/**
+ * The `diagnostics_channel` module provides an API to create named channels
+ * to report arbitrary message data for diagnostics purposes.
+ *
+ * It can be accessed using:
+ *
+ * ```js
+ * import diagnostics_channel from 'diagnostics_channel';
+ * ```
+ *
+ * It is intended that a module writer wanting to report diagnostics messages
+ * will create one or many top-level channels to report messages through.
+ * Channels may also be acquired at runtime but it is not encouraged
+ * due to the additional overhead of doing so. Channels may be exported for
+ * convenience, but as long as the name is known it can be acquired anywhere.
+ *
+ * If you intend for your module to produce diagnostics data for others to
+ * consume it is recommended that you include documentation of what named
+ * 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
+ * other modules.
+ * @experimental
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/diagnostics_channel.js)
+ */
+declare module "diagnostics_channel" {
+ /**
+ * 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.
+ *
+ * This API is optional but helpful when trying to publish messages from very
+ * performance-sensitive code.
+ *
+ * ```js
+ * import diagnostics_channel from 'diagnostics_channel';
+ *
+ * if (diagnostics_channel.hasSubscribers('my-channel')) {
+ * // There are subscribers, prepare and publish message
+ * }
+ * ```
+ * @since v15.1.0, v14.17.0
+ * @param name The channel name
+ * @return If there are active subscribers
+ */
+ function hasSubscribers(name: string | symbol): boolean;
+ /**
+ * 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
+ * publish time as much as possible.
+ *
+ * ```js
+ * import diagnostics_channel from 'diagnostics_channel';
+ *
+ * const channel = diagnostics_channel.channel('my-channel');
+ * ```
+ * @since v15.1.0, v14.17.0
+ * @param name The channel name
+ * @return The named channel object
+ */
+ function channel(name: string | symbol): Channel;
+ type ChannelListener = (message: unknown, name: string | symbol) => 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 '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 diagnostics_channel.subscribe(name, onMessage).
+ *
+ * ```js
+ * import diagnostics_channel from '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
+ * @returns `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
+ * 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
+ * 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
+ * with `new Channel(name)` is not supported.
+ * @since v15.1.0, v14.17.0
+ */
+ class Channel {
+ readonly name: string | symbol;
+ /**
+ * Check if there are active subscribers to this channel. This is helpful if
+ * the message you want to send might be expensive to prepare.
+ *
+ * This API is optional but helpful when trying to publish messages from very
+ * performance-sensitive code.
+ *
+ * ```js
+ * import diagnostics_channel from 'diagnostics_channel';
+ *
+ * const channel = diagnostics_channel.channel('my-channel');
+ *
+ * if (channel.hasSubscribers) {
+ * // There are subscribers, prepare and publish message
+ * }
+ * ```
+ * @since v15.1.0, v14.17.0
+ */
+ readonly hasSubscribers: boolean;
+ private constructor(name: string | symbol);
+ /**
+ * 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 '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
+ * 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 'diagnostics_channel';
+ *
+ * const channel = diagnostics_channel.channel('my-channel');
+ *
+ * channel.subscribe((message, name) => {
+ * // Received data
+ * });
+ * ```
+ * @since v15.1.0, v14.17.0
+ * @param onMessage The handler to receive channel messages
+ */
+ subscribe(onMessage: ChannelListener): void;
+ /**
+ * Remove a message handler previously registered to this channel with `channel.subscribe(onMessage)`.
+ *
+ * ```js
+ * import diagnostics_channel from 'diagnostics_channel';
+ *
+ * const channel = diagnostics_channel.channel('my-channel');
+ *
+ * function onMessage(message, name) {
+ * // Received data
+ * }
+ *
+ * channel.subscribe(onMessage);
+ *
+ * channel.unsubscribe(onMessage);
+ * ```
+ * @since v15.1.0, v14.17.0
+ * @param onMessage The previous subscribed handler to remove
+ * @return `true` if the handler was found, `false` otherwise.
+ */
+ unsubscribe(onMessage: ChannelListener): void;
+ }
+}
+declare module "node:diagnostics_channel" {
+ export * from "diagnostics_channel";
+}
diff --git a/client/node_modules/@types/node/dns.d.ts b/client/node_modules/@types/node/dns.d.ts
new file mode 100644
index 0000000..104dd76
--- /dev/null
+++ b/client/node_modules/@types/node/dns.d.ts
@@ -0,0 +1,809 @@
+/**
+ * The `dns` module enables name resolution. For example, use it to look up IP
+ * 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
+ * DNS protocol for lookups. {@link lookup} uses the operating system
+ * facilities to perform name resolution. It may not need to perform any network
+ * communication. To perform name resolution the way other applications on the same
+ * system do, use {@link lookup}.
+ *
+ * ```js
+ * const dns = require('dns');
+ *
+ * dns.lookup('example.org', (err, address, family) => {
+ * console.log('address: %j family: IPv%s', address, family);
+ * });
+ * // address: "93.184.216.34" family: IPv4
+ * ```
+ *
+ * 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
+ * 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.
+ *
+ * ```js
+ * const dns = require('dns');
+ *
+ * dns.resolve4('archive.org', (err, addresses) => {
+ * if (err) throw err;
+ *
+ * console.log(`addresses: ${JSON.stringify(addresses)}`);
+ *
+ * addresses.forEach((a) => {
+ * dns.reverse(a, (err, hostnames) => {
+ * if (err) {
+ * throw err;
+ * }
+ * console.log(`reverse for ${a}: ${JSON.stringify(hostnames)}`);
+ * });
+ * });
+ * });
+ * ```
+ *
+ * See the `Implementation considerations section` for more information.
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/dns.js)
+ */
+declare module "dns" {
+ import * as dnsPromises from "node:dns/promises";
+ // Supported getaddrinfo flags.
+ export const ADDRCONFIG: number;
+ export const V4MAPPED: number;
+ /**
+ * If `dns.V4MAPPED` is specified, return resolved IPv6 addresses as
+ * well as IPv4 mapped IPv6 addresses.
+ */
+ export const ALL: number;
+ export interface LookupOptions {
+ family?: number | undefined;
+ hints?: number | undefined;
+ all?: boolean | undefined;
+ /**
+ * @default true
+ */
+ verbatim?: boolean | undefined;
+ }
+ export interface LookupOneOptions extends LookupOptions {
+ all?: false | undefined;
+ }
+ export interface LookupAllOptions extends LookupOptions {
+ all: true;
+ }
+ export interface LookupAddress {
+ address: string;
+ family: number;
+ }
+ /**
+ * 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
+ * integer, then it must be `4` or `6` – if `options` is not provided, then IPv4
+ * 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
+ * properties `address` and `family`.
+ *
+ * On error, `err` is an `Error` object, where `err.code` is the error code.
+ * Keep in mind that `err.code` will be set to `'ENOTFOUND'` not only when
+ * the host name does not exist but also when the lookup fails in other ways
+ * such as no available file descriptors.
+ *
+ * `dns.lookup()` does not necessarily have anything to do with the DNS protocol.
+ * The implementation uses an operating system facility that can associate names
+ * with addresses, and vice versa. This implementation can have subtle but
+ * important consequences on the behavior of any Node.js program. Please take some
+ * time to consult the `Implementation considerations section` before using`dns.lookup()`.
+ *
+ * Example usage:
+ *
+ * ```js
+ * const dns = require('dns');
+ * const options = {
+ * family: 6,
+ * hints: dns.ADDRCONFIG | dns.V4MAPPED,
+ * };
+ * dns.lookup('example.com', options, (err, address, family) =>
+ * console.log('address: %j family: IPv%s', address, family));
+ * // address: "2606:2800:220:1:248:1893:25c8:1946" family: IPv6
+ *
+ * // When options.all is true, the result will be an Array.
+ * options.all = true;
+ * dns.lookup('example.com', options, (err, addresses) =>
+ * console.log('addresses: %j', addresses));
+ * // addresses: [{"address":"2606:2800:220:1:248:1893:25c8:1946","family":6}]
+ * ```
+ *
+ * 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
+ */
+ export function lookup(
+ hostname: string,
+ family: number,
+ 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 {
+ function __promisify__(hostname: string, options: LookupAllOptions): Promise<LookupAddress[]>;
+ function __promisify__(hostname: string, options?: LookupOneOptions | number): Promise<LookupAddress>;
+ function __promisify__(hostname: string, options: LookupOptions): Promise<LookupAddress | LookupAddress[]>;
+ }
+ /**
+ * Resolves the given `address` and `port` into a host name and service using
+ * the operating system's underlying `getnameinfo` implementation.
+ *
+ * If `address` is not a valid IP address, a `TypeError` will be thrown.
+ * The `port` will be coerced to a number. If it is not a legal port, a `TypeError`will be thrown.
+ *
+ * On an error, `err` is an `Error` object, where `err.code` is the error code.
+ *
+ * ```js
+ * const dns = require('dns');
+ * dns.lookupService('127.0.0.1', 22, (err, hostname, service) => {
+ * console.log(hostname, service);
+ * // Prints: localhost ssh
+ * });
+ * ```
+ *
+ * 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
+ */
+ export function lookupService(
+ address: string,
+ port: number,
+ callback: (err: NodeJS.ErrnoException | null, hostname: string, service: string) => void,
+ ): void;
+ export namespace lookupService {
+ function __promisify__(
+ address: string,
+ port: number,
+ ): Promise<{
+ hostname: string;
+ service: string;
+ }>;
+ }
+ export interface ResolveOptions {
+ ttl: boolean;
+ }
+ export interface ResolveWithTtlOptions extends ResolveOptions {
+ ttl: true;
+ }
+ export interface RecordWithTtl {
+ address: string;
+ ttl: number;
+ }
+ /** @deprecated Use `AnyARecord` or `AnyAaaaRecord` instead. */
+ export type AnyRecordWithTtl = AnyARecord | AnyAaaaRecord;
+ export interface AnyARecord extends RecordWithTtl {
+ type: "A";
+ }
+ export interface AnyAaaaRecord extends RecordWithTtl {
+ type: "AAAA";
+ }
+ export interface CaaRecord {
+ critical: number;
+ issue?: string | undefined;
+ issuewild?: string | undefined;
+ iodef?: string | undefined;
+ contactemail?: string | undefined;
+ contactphone?: string | undefined;
+ }
+ export interface MxRecord {
+ priority: number;
+ exchange: string;
+ }
+ export interface AnyMxRecord extends MxRecord {
+ type: "MX";
+ }
+ export interface NaptrRecord {
+ flags: string;
+ service: string;
+ regexp: string;
+ replacement: string;
+ order: number;
+ preference: number;
+ }
+ export interface AnyNaptrRecord extends NaptrRecord {
+ type: "NAPTR";
+ }
+ export interface SoaRecord {
+ nsname: string;
+ hostmaster: string;
+ serial: number;
+ refresh: number;
+ retry: number;
+ expire: number;
+ minttl: number;
+ }
+ export interface AnySoaRecord extends SoaRecord {
+ type: "SOA";
+ }
+ export interface SrvRecord {
+ priority: number;
+ weight: number;
+ port: number;
+ name: string;
+ }
+ export interface AnySrvRecord extends SrvRecord {
+ type: "SRV";
+ }
+ export interface AnyTxtRecord {
+ type: "TXT";
+ entries: string[];
+ }
+ export interface AnyNsRecord {
+ type: "NS";
+ value: string;
+ }
+ export interface AnyPtrRecord {
+ type: "PTR";
+ value: string;
+ }
+ export interface AnyCnameRecord {
+ type: "CNAME";
+ value: string;
+ }
+ export type AnyRecord =
+ | 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
+ * of the resource records. The `callback` function has arguments`(err, records)`. When successful, `records` will be an array of resource
+ * records. The type and structure of individual results varies based on `rrtype`:
+ *
+ * <omitted>
+ *
+ * On error, `err` is an `Error` object, where `err.code` is one of the `DNS error codes`.
+ * @since v0.1.27
+ * @param hostname Host name to resolve.
+ * @param [rrtype='A'] Resource record type.
+ */
+ export function resolve(
+ hostname: string,
+ callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
+ ): void;
+ export function resolve(
+ hostname: string,
+ rrtype: "A",
+ callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
+ ): void;
+ export function resolve(
+ hostname: string,
+ rrtype: "AAAA",
+ 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(
+ hostname: string,
+ rrtype: string,
+ callback: (
+ err: NodeJS.ErrnoException | null,
+ addresses: string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[],
+ ) => void,
+ ): void;
+ export namespace resolve {
+ 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: "MX"): Promise<MxRecord[]>;
+ function __promisify__(hostname: string, rrtype: "NAPTR"): Promise<NaptrRecord[]>;
+ function __promisify__(hostname: string, rrtype: "SOA"): Promise<SoaRecord>;
+ function __promisify__(hostname: string, rrtype: "SRV"): Promise<SrvRecord[]>;
+ function __promisify__(hostname: string, rrtype: "TXT"): Promise<string[][]>;
+ function __promisify__(
+ 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
+ * will contain an array of IPv4 addresses (e.g.`['74.125.79.104', '74.125.79.105', '74.125.79.106']`).
+ * @since v0.1.16
+ * @param hostname Host name to resolve.
+ */
+ export function resolve4(
+ hostname: string,
+ callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => 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 {
+ function __promisify__(hostname: string): Promise<string[]>;
+ function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise<RecordWithTtl[]>;
+ function __promisify__(hostname: string, options?: ResolveOptions): Promise<string[] | RecordWithTtl[]>;
+ }
+ /**
+ * 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.
+ * @since v0.1.16
+ * @param hostname Host name to resolve.
+ */
+ export function resolve6(
+ hostname: string,
+ callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => 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 {
+ function __promisify__(hostname: string): Promise<string[]>;
+ function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise<RecordWithTtl[]>;
+ function __promisify__(hostname: string, options?: ResolveOptions): Promise<string[] | RecordWithTtl[]>;
+ }
+ /**
+ * Uses the DNS protocol to resolve `CNAME` records for the `hostname`. The`addresses` argument passed to the `callback` function
+ * will contain an array of canonical name records available for the `hostname`(e.g. `['bar.example.com']`).
+ * @since v0.3.2
+ */
+ export function resolveCname(
+ hostname: string,
+ callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
+ ): void;
+ export namespace resolveCname {
+ function __promisify__(hostname: string): Promise<string[]>;
+ }
+ /**
+ * 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
+ * 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
+ */
+ export function resolveCaa(
+ hostname: string,
+ callback: (err: NodeJS.ErrnoException | null, records: CaaRecord[]) => void,
+ ): void;
+ export namespace resolveCaa {
+ function __promisify__(hostname: string): Promise<CaaRecord[]>;
+ }
+ /**
+ * Uses the DNS protocol to resolve mail exchange records (`MX` records) for the`hostname`. The `addresses` argument passed to the `callback` function will
+ * contain an array of objects containing both a `priority` and `exchange`property (e.g. `[{priority: 10, exchange: 'mx.example.com'}, ...]`).
+ * @since v0.1.27
+ */
+ export function resolveMx(
+ hostname: string,
+ callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void,
+ ): void;
+ export namespace resolveMx {
+ 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
+ * objects with the following properties:
+ *
+ * * `flags`
+ * * `service`
+ * * `regexp`
+ * * `replacement`
+ * * `order`
+ * * `preference`
+ *
+ * ```js
+ * {
+ * flags: 's',
+ * service: 'SIP+D2U',
+ * regexp: '',
+ * replacement: '_sip._udp.example.com',
+ * order: 30,
+ * preference: 100
+ * }
+ * ```
+ * @since v0.9.12
+ */
+ export function resolveNaptr(
+ hostname: string,
+ callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void,
+ ): void;
+ export namespace resolveNaptr {
+ function __promisify__(hostname: string): Promise<NaptrRecord[]>;
+ }
+ /**
+ * Uses the DNS protocol to resolve name server records (`NS` records) for the`hostname`. The `addresses` argument passed to the `callback` function will
+ * contain an array of name server records available for `hostname`(e.g. `['ns1.example.com', 'ns2.example.com']`).
+ * @since v0.1.90
+ */
+ export function resolveNs(
+ hostname: string,
+ callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
+ ): void;
+ export namespace resolveNs {
+ function __promisify__(hostname: string): Promise<string[]>;
+ }
+ /**
+ * Uses the DNS protocol to resolve pointer records (`PTR` records) for the`hostname`. The `addresses` argument passed to the `callback` function will
+ * be an array of strings containing the reply records.
+ * @since v6.0.0
+ */
+ export function resolvePtr(
+ hostname: string,
+ callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
+ ): void;
+ export namespace resolvePtr {
+ function __promisify__(hostname: string): Promise<string[]>;
+ }
+ /**
+ * Uses the DNS protocol to resolve a start of authority record (`SOA` record) for
+ * the `hostname`. The `address` argument passed to the `callback` function will
+ * be an object with the following properties:
+ *
+ * * `nsname`
+ * * `hostmaster`
+ * * `serial`
+ * * `refresh`
+ * * `retry`
+ * * `expire`
+ * * `minttl`
+ *
+ * ```js
+ * {
+ * nsname: 'ns.example.com',
+ * hostmaster: 'root.example.com',
+ * serial: 2013101809,
+ * refresh: 10000,
+ * retry: 2400,
+ * expire: 604800,
+ * minttl: 3600
+ * }
+ * ```
+ * @since v0.11.10
+ */
+ export function resolveSoa(
+ hostname: string,
+ callback: (err: NodeJS.ErrnoException | null, address: SoaRecord) => void,
+ ): void;
+ export namespace resolveSoa {
+ function __promisify__(hostname: string): Promise<SoaRecord>;
+ }
+ /**
+ * Uses the DNS protocol to resolve service records (`SRV` records) for the`hostname`. The `addresses` argument passed to the `callback` function will
+ * be an array of objects with the following properties:
+ *
+ * * `priority`
+ * * `weight`
+ * * `port`
+ * * `name`
+ *
+ * ```js
+ * {
+ * priority: 10,
+ * weight: 5,
+ * port: 21223,
+ * name: 'service.example.com'
+ * }
+ * ```
+ * @since v0.1.27
+ */
+ export function resolveSrv(
+ hostname: string,
+ callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void,
+ ): void;
+ export namespace resolveSrv {
+ function __promisify__(hostname: string): Promise<SrvRecord[]>;
+ }
+ /**
+ * Uses the DNS protocol to resolve text queries (`TXT` records) for the`hostname`. The `records` argument passed to the `callback` function is a
+ * two-dimensional array of the text records available for `hostname` (e.g.`[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]`). Each sub-array contains TXT chunks of
+ * one record. Depending on the use case, these could be either joined together or
+ * treated separately.
+ * @since v0.1.27
+ */
+ export function resolveTxt(
+ hostname: string,
+ callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void,
+ ): void;
+ export namespace resolveTxt {
+ function __promisify__(hostname: string): Promise<string[][]>;
+ }
+ /**
+ * Uses the DNS protocol to resolve all records (also known as `ANY` or `*` query).
+ * The `ret` argument passed to the `callback` function will be an array containing
+ * various types of records. Each object has a property `type` that indicates the
+ * type of the current record. And depending on the `type`, additional properties
+ * will be present on the object:
+ *
+ * <omitted>
+ *
+ * Here is an example of the `ret` object passed to the callback:
+ *
+ * ```js
+ * [ { type: 'A', address: '127.0.0.1', ttl: 299 },
+ * { type: 'CNAME', value: 'example.com' },
+ * { type: 'MX', exchange: 'alt4.aspmx.l.example.com', priority: 50 },
+ * { type: 'NS', value: 'ns1.example.com' },
+ * { type: 'TXT', entries: [ 'v=spf1 include:_spf.example.com ~all' ] },
+ * { type: 'SOA',
+ * nsname: 'ns1.example.com',
+ * hostmaster: 'admin.example.com',
+ * serial: 156696742,
+ * refresh: 900,
+ * retry: 900,
+ * expire: 1800,
+ * minttl: 60 } ]
+ * ```
+ *
+ * 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).
+ */
+ export function resolveAny(
+ hostname: string,
+ callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void,
+ ): void;
+ export namespace resolveAny {
+ function __promisify__(hostname: string): Promise<AnyRecord[]>;
+ }
+ /**
+ * Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an
+ * array of host names.
+ *
+ * On error, `err` is an `Error` object, where `err.code` is
+ * one of the `DNS error codes`.
+ * @since v0.1.16
+ */
+ export function reverse(
+ 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 v18.17.0
+ */
+ export function getDefaultResultOrder(): "ipv4first" | "verbatim";
+ /**
+ * 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
+ * addresses. If the port is the IANA default DNS port (53) it can be omitted.
+ *
+ * ```js
+ * dns.setServers([
+ * '4.4.4.4',
+ * '[2001:4860:4860::8888]',
+ * '4.4.4.4:1053',
+ * '[2001:4860:4860::8888]:1053',
+ * ]);
+ * ```
+ *
+ * An error will be thrown if an invalid address is provided.
+ *
+ * The `dns.setServers()` method must not be called while a DNS query is in
+ * progress.
+ *
+ * The {@link setServers} method affects only {@link resolve},`dns.resolve*()` and {@link reverse} (and specifically _not_ {@link lookup}).
+ *
+ * This method works much like [resolve.conf](https://man7.org/linux/man-pages/man5/resolv.conf.5.html).
+ * That is, if attempting to resolve with the first server provided results in a`NOTFOUND` error, the `resolve()` method will _not_ attempt to resolve with
+ * subsequent servers provided. Fallback DNS servers will only be used if the
+ * earlier ones time out or result in some other error.
+ * @since v0.11.3
+ * @param servers array of `RFC 5952` formatted addresses
+ */
+ export function setServers(servers: readonly string[]): void;
+ /**
+ * 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
+ * section if a custom port is used.
+ *
+ * ```js
+ * [
+ * '4.4.4.4',
+ * '2001:4860:4860::8888',
+ * '4.4.4.4:1053',
+ * '[2001:4860:4860::8888]:1053',
+ * ]
+ * ```
+ * @since v0.11.3
+ */
+ export function getServers(): string[];
+ /**
+ * Set the default value of `verbatim` in {@link lookup} and `dnsPromises.lookup()`. The value could be:
+ *
+ * * `ipv4first`: sets default `verbatim` `false`.
+ * * `verbatim`: sets default `verbatim` `true`.
+ *
+ * The default is `ipv4first` and {@link setDefaultResultOrder} have higher
+ * 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;
+ // Error codes
+ export const NODATA: string;
+ export const FORMERR: string;
+ export const SERVFAIL: string;
+ export const NOTFOUND: string;
+ export const NOTIMP: string;
+ export const REFUSED: string;
+ export const BADQUERY: string;
+ export const BADNAME: string;
+ export const BADFAMILY: string;
+ export const BADRESP: string;
+ export const CONNREFUSED: string;
+ export const TIMEOUT: string;
+ export const EOF: string;
+ export const FILE: string;
+ export const NOMEM: string;
+ export const DESTRUCTION: string;
+ export const BADSTR: string;
+ export const BADFLAGS: string;
+ export const NONAME: string;
+ export const BADHINTS: string;
+ export const NOTINITIALIZED: string;
+ export const LOADIPHLPAPI: string;
+ export const ADDRGETNETWORKPARAMS: string;
+ export const CANCELLED: string;
+ export interface ResolverOptions {
+ timeout?: number | undefined;
+ /**
+ * @default 4
+ */
+ tries?: number;
+ }
+ /**
+ * 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('dns');
+ * 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', (err, addresses) => {
+ * // ...
+ * });
+ * ```
+ *
+ * The following methods from the `dns` module 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 v8.3.0
+ */
+ export class Resolver {
+ constructor(options?: ResolverOptions);
+ /**
+ * Cancel all outstanding DNS queries made by this resolver. The corresponding
+ * callbacks will be called with an error with code `ECANCELLED`.
+ * @since v8.3.0
+ */
+ cancel(): void;
+ getServers: typeof getServers;
+ resolve: typeof resolve;
+ resolve4: typeof resolve4;
+ resolve6: typeof resolve6;
+ resolveAny: typeof resolveAny;
+ resolveCaa: typeof resolveCaa;
+ resolveCname: typeof resolveCname;
+ resolveMx: typeof resolveMx;
+ resolveNaptr: typeof resolveNaptr;
+ resolveNs: typeof resolveNs;
+ resolvePtr: typeof resolvePtr;
+ resolveSoa: typeof resolveSoa;
+ resolveSrv: typeof resolveSrv;
+ resolveTxt: typeof resolveTxt;
+ reverse: typeof reverse;
+ /**
+ * The resolver instance will send its requests from the specified IP address.
+ * This allows programs to specify outbound interfaces when used on multi-homed
+ * systems.
+ *
+ * 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.
+ *
+ * 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.
+ * The `rrtype` of resolution requests has no impact on the local address used.
+ * @since v15.1.0, v14.17.0
+ * @param [ipv4='0.0.0.0'] A string representation of an IPv4 address.
+ * @param [ipv6='::0'] A string representation of an IPv6 address.
+ */
+ setLocalAddress(ipv4?: string, ipv6?: string): void;
+ setServers: typeof setServers;
+ }
+ export { dnsPromises as promises };
+}
+declare module "node:dns" {
+ export * from "dns";
+}
diff --git a/client/node_modules/@types/node/dns/promises.d.ts b/client/node_modules/@types/node/dns/promises.d.ts
new file mode 100644
index 0000000..282ec72
--- /dev/null
+++ b/client/node_modules/@types/node/dns/promises.d.ts
@@ -0,0 +1,381 @@
+/**
+ * The `dns.promises` API provides an alternative set of asynchronous DNS methods
+ * that return `Promise` objects rather than using callbacks. The API is accessible
+ * via `require('dns').promises` or `require('dns/promises')`.
+ * @since v10.6.0
+ */
+declare module "dns/promises" {
+ import {
+ AnyRecord,
+ CaaRecord,
+ LookupAddress,
+ LookupAllOptions,
+ LookupOneOptions,
+ LookupOptions,
+ MxRecord,
+ NaptrRecord,
+ RecordWithTtl,
+ ResolveOptions,
+ ResolverOptions,
+ ResolveWithTtlOptions,
+ 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),
+ * that are currently configured for DNS resolution. A string will include a port
+ * section if a custom port is used.
+ *
+ * ```js
+ * [
+ * '4.4.4.4',
+ * '2001:4860:4860::8888',
+ * '4.4.4.4:1053',
+ * '[2001:4860:4860::8888]:1053',
+ * ]
+ * ```
+ * @since v10.6.0
+ */
+ function getServers(): string[];
+ /**
+ * 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
+ * integer, then it must be `4` or `6` – if `options` is not provided, then IPv4
+ * and IPv6 addresses are both returned if found.
+ *
+ * With the `all` option set to `true`, the `Promise` is resolved with `addresses`being an array of objects with the properties `address` and `family`.
+ *
+ * On error, the `Promise` is rejected with an `Error` object, where `err.code`is the error code.
+ * Keep in mind that `err.code` will be set to `'ENOTFOUND'` not only when
+ * the host name does not exist but also when the lookup fails in other ways
+ * such as no available file descriptors.
+ *
+ * `dnsPromises.lookup()` does not necessarily have anything to do with the DNS
+ * protocol. The implementation uses an operating system facility that can
+ * associate names with addresses, and vice versa. This implementation can have
+ * subtle but important consequences on the behavior of any Node.js program. Please
+ * take some time to consult the `Implementation considerations section` before
+ * using `dnsPromises.lookup()`.
+ *
+ * Example usage:
+ *
+ * ```js
+ * const dns = require('dns');
+ * const dnsPromises = dns.promises;
+ * const options = {
+ * family: 6,
+ * hints: dns.ADDRCONFIG | dns.V4MAPPED,
+ * };
+ *
+ * dnsPromises.lookup('example.com', options).then((result) => {
+ * console.log('address: %j family: IPv%s', result.address, result.family);
+ * // address: "2606:2800:220:1:248:1893:25c8:1946" family: IPv6
+ * });
+ *
+ * // When options.all is true, the result will be an Array.
+ * options.all = true;
+ * dnsPromises.lookup('example.com', options).then((result) => {
+ * console.log('addresses: %j', result);
+ * // addresses: [{"address":"2606:2800:220:1:248:1893:25c8:1946","family":6}]
+ * });
+ * ```
+ * @since v10.6.0
+ */
+ function lookup(hostname: string, family: number): Promise<LookupAddress>;
+ function lookup(hostname: string, options: LookupOneOptions): Promise<LookupAddress>;
+ function lookup(hostname: string, options: LookupAllOptions): Promise<LookupAddress[]>;
+ function lookup(hostname: string, options: LookupOptions): Promise<LookupAddress | LookupAddress[]>;
+ function lookup(hostname: string): Promise<LookupAddress>;
+ /**
+ * Resolves the given `address` and `port` into a host name and service using
+ * the operating system's underlying `getnameinfo` implementation.
+ *
+ * If `address` is not a valid IP address, a `TypeError` will be thrown.
+ * The `port` will be coerced to a number. If it is not a legal port, a `TypeError`will be thrown.
+ *
+ * On error, the `Promise` is rejected with an `Error` object, where `err.code`is the error code.
+ *
+ * ```js
+ * const dnsPromises = require('dns').promises;
+ * dnsPromises.lookupService('127.0.0.1', 22).then((result) => {
+ * console.log(result.hostname, result.service);
+ * // Prints: localhost ssh
+ * });
+ * ```
+ * @since v10.6.0
+ */
+ function lookupService(
+ address: string,
+ port: number,
+ ): Promise<{
+ hostname: string;
+ service: string;
+ }>;
+ /**
+ * Uses the DNS protocol to resolve a host name (e.g. `'nodejs.org'`) into an array
+ * of the resource records. When successful, the `Promise` is resolved with an
+ * array of resource records. The type and structure of individual results vary
+ * based on `rrtype`:
+ *
+ * <omitted>
+ *
+ * On error, the `Promise` is rejected with an `Error` object, where `err.code`is one of the `DNS error codes`.
+ * @since v10.6.0
+ * @param hostname Host name to resolve.
+ * @param [rrtype='A'] Resource record type.
+ */
+ function resolve(hostname: string): Promise<string[]>;
+ function resolve(hostname: string, rrtype: "A"): Promise<string[]>;
+ function resolve(hostname: string, rrtype: "AAAA"): Promise<string[]>;
+ function resolve(hostname: string, rrtype: "ANY"): Promise<AnyRecord[]>;
+ function resolve(hostname: string, rrtype: "CAA"): Promise<CaaRecord[]>;
+ function resolve(hostname: string, rrtype: "CNAME"): Promise<string[]>;
+ function resolve(hostname: string, rrtype: "MX"): Promise<MxRecord[]>;
+ function resolve(hostname: string, rrtype: "NAPTR"): Promise<NaptrRecord[]>;
+ function resolve(hostname: string, rrtype: "NS"): Promise<string[]>;
+ function resolve(hostname: string, rrtype: "PTR"): Promise<string[]>;
+ function resolve(hostname: string, rrtype: "SOA"): Promise<SoaRecord>;
+ function resolve(hostname: string, rrtype: "SRV"): Promise<SrvRecord[]>;
+ function resolve(hostname: string, rrtype: "TXT"): Promise<string[][]>;
+ function resolve(
+ 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
+ * addresses (e.g. `['74.125.79.104', '74.125.79.105', '74.125.79.106']`).
+ * @since v10.6.0
+ * @param hostname Host name to resolve.
+ */
+ function resolve4(hostname: string): Promise<string[]>;
+ function resolve4(hostname: string, options: ResolveWithTtlOptions): Promise<RecordWithTtl[]>;
+ function resolve4(hostname: string, options: ResolveOptions): Promise<string[] | RecordWithTtl[]>;
+ /**
+ * Uses the DNS protocol to resolve IPv6 addresses (`AAAA` records) for the`hostname`. On success, the `Promise` is resolved with an array of IPv6
+ * addresses.
+ * @since v10.6.0
+ * @param hostname Host name to resolve.
+ */
+ function resolve6(hostname: string): Promise<string[]>;
+ function resolve6(hostname: string, options: ResolveWithTtlOptions): Promise<RecordWithTtl[]>;
+ function resolve6(hostname: string, options: ResolveOptions): Promise<string[] | RecordWithTtl[]>;
+ /**
+ * Uses the DNS protocol to resolve all records (also known as `ANY` or `*` query).
+ * On success, the `Promise` is resolved with an array containing various types of
+ * records. Each object has a property `type` that indicates the type of the
+ * current record. And depending on the `type`, additional properties will be
+ * present on the object:
+ *
+ * <omitted>
+ *
+ * Here is an example of the result object:
+ *
+ * ```js
+ * [ { type: 'A', address: '127.0.0.1', ttl: 299 },
+ * { type: 'CNAME', value: 'example.com' },
+ * { type: 'MX', exchange: 'alt4.aspmx.l.example.com', priority: 50 },
+ * { type: 'NS', value: 'ns1.example.com' },
+ * { type: 'TXT', entries: [ 'v=spf1 include:_spf.example.com ~all' ] },
+ * { type: 'SOA',
+ * nsname: 'ns1.example.com',
+ * hostmaster: 'admin.example.com',
+ * serial: 156696742,
+ * refresh: 900,
+ * retry: 900,
+ * expire: 1800,
+ * minttl: 60 } ]
+ * ```
+ * @since v10.6.0
+ */
+ function resolveAny(hostname: string): Promise<AnyRecord[]>;
+ /**
+ * Uses the DNS protocol to resolve `CAA` records for the `hostname`. On success,
+ * 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'}]`).
+ * @since v15.0.0, v14.17.0
+ */
+ function resolveCaa(hostname: string): Promise<CaaRecord[]>;
+ /**
+ * Uses the DNS protocol to resolve `CNAME` records for the `hostname`. On success,
+ * the `Promise` is resolved with an array of canonical name records available for
+ * the `hostname` (e.g. `['bar.example.com']`).
+ * @since v10.6.0
+ */
+ function resolveCname(hostname: string): Promise<string[]>;
+ /**
+ * Uses the DNS protocol to resolve mail exchange records (`MX` records) for the`hostname`. On success, the `Promise` is resolved with an array of objects
+ * containing both a `priority` and `exchange` property (e.g.`[{priority: 10, exchange: 'mx.example.com'}, ...]`).
+ * @since v10.6.0
+ */
+ 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
+ * of objects with the following properties:
+ *
+ * * `flags`
+ * * `service`
+ * * `regexp`
+ * * `replacement`
+ * * `order`
+ * * `preference`
+ *
+ * ```js
+ * {
+ * flags: 's',
+ * service: 'SIP+D2U',
+ * regexp: '',
+ * replacement: '_sip._udp.example.com',
+ * order: 30,
+ * preference: 100
+ * }
+ * ```
+ * @since v10.6.0
+ */
+ function resolveNaptr(hostname: string): Promise<NaptrRecord[]>;
+ /**
+ * Uses the DNS protocol to resolve name server records (`NS` records) for the`hostname`. On success, the `Promise` is resolved with an array of name server
+ * records available for `hostname` (e.g.`['ns1.example.com', 'ns2.example.com']`).
+ * @since v10.6.0
+ */
+ function resolveNs(hostname: string): Promise<string[]>;
+ /**
+ * Uses the DNS protocol to resolve pointer records (`PTR` records) for the`hostname`. On success, the `Promise` is resolved with an array of strings
+ * containing the reply records.
+ * @since v10.6.0
+ */
+ function resolvePtr(hostname: string): Promise<string[]>;
+ /**
+ * Uses the DNS protocol to resolve a start of authority record (`SOA` record) for
+ * the `hostname`. On success, the `Promise` is resolved with an object with the
+ * following properties:
+ *
+ * * `nsname`
+ * * `hostmaster`
+ * * `serial`
+ * * `refresh`
+ * * `retry`
+ * * `expire`
+ * * `minttl`
+ *
+ * ```js
+ * {
+ * nsname: 'ns.example.com',
+ * hostmaster: 'root.example.com',
+ * serial: 2013101809,
+ * refresh: 10000,
+ * retry: 2400,
+ * expire: 604800,
+ * minttl: 3600
+ * }
+ * ```
+ * @since v10.6.0
+ */
+ function resolveSoa(hostname: string): Promise<SoaRecord>;
+ /**
+ * Uses the DNS protocol to resolve service records (`SRV` records) for the`hostname`. On success, the `Promise` is resolved with an array of objects with
+ * the following properties:
+ *
+ * * `priority`
+ * * `weight`
+ * * `port`
+ * * `name`
+ *
+ * ```js
+ * {
+ * priority: 10,
+ * weight: 5,
+ * port: 21223,
+ * name: 'service.example.com'
+ * }
+ * ```
+ * @since v10.6.0
+ */
+ function resolveSrv(hostname: string): Promise<SrvRecord[]>;
+ /**
+ * Uses the DNS protocol to resolve text queries (`TXT` records) for the`hostname`. On success, the `Promise` is resolved with a two-dimensional array
+ * of the text records available for `hostname` (e.g.`[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]`). Each sub-array contains TXT chunks of
+ * one record. Depending on the use case, these could be either joined together or
+ * treated separately.
+ * @since v10.6.0
+ */
+ function resolveTxt(hostname: string): Promise<string[][]>;
+ /**
+ * Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an
+ * array of host names.
+ *
+ * On error, the `Promise` is rejected with an `Error` object, where `err.code`is one of the `DNS error codes`.
+ * @since v10.6.0
+ */
+ function reverse(ip: string): Promise<string[]>;
+ /**
+ * 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 v18.17.0
+ */
+ function getDefaultResultOrder(): "ipv4first" | "verbatim";
+ /**
+ * 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
+ * addresses. If the port is the IANA default DNS port (53) it can be omitted.
+ *
+ * ```js
+ * dnsPromises.setServers([
+ * '4.4.4.4',
+ * '[2001:4860:4860::8888]',
+ * '4.4.4.4:1053',
+ * '[2001:4860:4860::8888]:1053',
+ * ]);
+ * ```
+ *
+ * An error will be thrown if an invalid address is provided.
+ *
+ * The `dnsPromises.setServers()` method must not be called while a DNS query is in
+ * progress.
+ *
+ * This method works much like [resolve.conf](https://man7.org/linux/man-pages/man5/resolv.conf.5.html).
+ * That is, if attempting to resolve with the first server provided results in a`NOTFOUND` error, the `resolve()` method will _not_ attempt to resolve with
+ * subsequent servers provided. Fallback DNS servers will only be used if the
+ * earlier ones time out or result in some other error.
+ * @since v10.6.0
+ * @param servers array of `RFC 5952` formatted addresses
+ */
+ function setServers(servers: readonly string[]): void;
+ /**
+ * Set the default value of `verbatim` in `dns.lookup()` and `dnsPromises.lookup()`. The value could be:
+ *
+ * * `ipv4first`: sets default `verbatim` `false`.
+ * * `verbatim`: sets default `verbatim` `true`.
+ *
+ * The default is `ipv4first` and `dnsPromises.setDefaultResultOrder()` have
+ * 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;
+ class Resolver {
+ constructor(options?: ResolverOptions);
+ cancel(): void;
+ getServers: typeof getServers;
+ resolve: typeof resolve;
+ resolve4: typeof resolve4;
+ resolve6: typeof resolve6;
+ resolveAny: typeof resolveAny;
+ resolveCname: typeof resolveCname;
+ resolveMx: typeof resolveMx;
+ resolveNaptr: typeof resolveNaptr;
+ resolveNs: typeof resolveNs;
+ resolvePtr: typeof resolvePtr;
+ resolveSoa: typeof resolveSoa;
+ resolveSrv: typeof resolveSrv;
+ resolveTxt: typeof resolveTxt;
+ reverse: typeof reverse;
+ setLocalAddress(ipv4?: string, ipv6?: string): void;
+ setServers: typeof setServers;
+ }
+}
+declare module "node:dns/promises" {
+ export * from "dns/promises";
+}
diff --git a/client/node_modules/@types/node/dom-events.d.ts b/client/node_modules/@types/node/dom-events.d.ts
new file mode 100644
index 0000000..147a7b6
--- /dev/null
+++ b/client/node_modules/@types/node/dom-events.d.ts
@@ -0,0 +1,122 @@
+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;
+ };
+}
diff --git a/client/node_modules/@types/node/domain.d.ts b/client/node_modules/@types/node/domain.d.ts
new file mode 100644
index 0000000..ca8728f
--- /dev/null
+++ b/client/node_modules/@types/node/domain.d.ts
@@ -0,0 +1,170 @@
+/**
+ * **This module is pending deprecation.** Once a replacement API has been
+ * finalized, this module will be fully deprecated. Most developers should
+ * **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
+ * but should expect to have to migrate to a different solution
+ * in the future.
+ *
+ * Domains provide a way to handle multiple different IO operations as a
+ * single group. If any of the event emitters or callbacks registered to a
+ * domain emit an `'error'` event, or throw an error, then the domain object
+ * 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.
+ * @deprecated Since v1.4.2 - Deprecated
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/domain.js)
+ */
+declare module "domain" {
+ import EventEmitter = require("node:events");
+ /**
+ * The `Domain` class encapsulates the functionality of routing errors and
+ * uncaught exceptions to the active `Domain` object.
+ *
+ * To handle the errors that it catches, listen to its `'error'` event.
+ */
+ class Domain extends EventEmitter {
+ /**
+ * An array of timers and event emitters that have been explicitly added
+ * to the domain.
+ */
+ members: Array<EventEmitter | NodeJS.Timer>;
+ /**
+ * The `enter()` method is plumbing used by the `run()`, `bind()`, and`intercept()` methods to set the active domain. It sets `domain.active` and`process.domain` to the domain, and implicitly
+ * pushes the domain onto the domain
+ * stack managed by the domain module (see {@link exit} for details on the
+ * domain stack). The call to `enter()` delimits the beginning of a chain of
+ * asynchronous calls and I/O operations bound to a domain.
+ *
+ * Calling `enter()` changes only the active domain, and does not alter the domain
+ * itself. `enter()` and `exit()` can be called an arbitrary number of times on a
+ * single domain.
+ */
+ enter(): void;
+ /**
+ * The `exit()` method exits the current domain, popping it off the domain stack.
+ * Any time execution is going to switch to the context of a different chain of
+ * asynchronous calls, it's important to ensure that the current domain is exited.
+ * The call to `exit()` delimits either the end of or an interruption to the chain
+ * of asynchronous calls and I/O operations bound to a domain.
+ *
+ * If there are multiple, nested domains bound to the current execution context,`exit()` will exit any domains nested within this domain.
+ *
+ * Calling `exit()` changes only the active domain, and does not alter the domain
+ * itself. `enter()` and `exit()` can be called an arbitrary number of times on a
+ * single domain.
+ */
+ exit(): void;
+ /**
+ * Run the supplied function in the context of the domain, implicitly
+ * binding all event emitters, timers, and lowlevel requests that are
+ * created in that context. Optionally, arguments can be passed to
+ * the function.
+ *
+ * This is the most basic way to use a domain.
+ *
+ * ```js
+ * const domain = require('domain');
+ * const fs = require('fs');
+ * const d = domain.create();
+ * d.on('error', (er) => {
+ * console.error('Caught error!', er);
+ * });
+ * d.run(() => {
+ * process.nextTick(() => {
+ * setTimeout(() => { // Simulating some various async stuff
+ * fs.open('non-existent file', 'r', (er, fd) => {
+ * if (er) throw er;
+ * // proceed...
+ * });
+ * }, 100);
+ * });
+ * });
+ * ```
+ *
+ * In this example, the `d.on('error')` handler will be triggered, rather
+ * than crashing the program.
+ */
+ run<T>(fn: (...args: any[]) => T, ...args: any[]): T;
+ /**
+ * Explicitly adds an emitter to the domain. If any event handlers called by
+ * the emitter throw an error, or if the emitter emits an `'error'` event, it
+ * will be routed to the domain's `'error'` event, just like with implicit
+ * binding.
+ *
+ * This also works with timers that are returned from `setInterval()` and `setTimeout()`. If their callback function throws, it will be caught by
+ * the domain `'error'` handler.
+ *
+ * If the Timer or `EventEmitter` was already bound to a domain, it is removed
+ * from that one, and bound to this one instead.
+ * @param emitter emitter or timer to be added to the domain
+ */
+ add(emitter: EventEmitter | NodeJS.Timer): void;
+ /**
+ * The opposite of {@link add}. Removes domain handling from the
+ * specified emitter.
+ * @param emitter emitter or timer to be removed from the domain
+ */
+ remove(emitter: EventEmitter | NodeJS.Timer): void;
+ /**
+ * The returned function will be a wrapper around the supplied callback
+ * function. When the returned function is called, any errors that are
+ * thrown will be routed to the domain's `'error'` event.
+ *
+ * ```js
+ * const d = domain.create();
+ *
+ * function readSomeFile(filename, cb) {
+ * fs.readFile(filename, 'utf8', d.bind((er, data) => {
+ * // If this throws, it will also be passed to the domain.
+ * return cb(er, data ? JSON.parse(data) : null);
+ * }));
+ * }
+ *
+ * d.on('error', (er) => {
+ * // An error occurred somewhere. If we throw it now, it will crash the program
+ * // with the normal line number and stack message.
+ * });
+ * ```
+ * @param callback The callback function
+ * @return The bound function
+ */
+ bind<T extends Function>(callback: T): T;
+ /**
+ * This method is almost identical to {@link bind}. However, in
+ * addition to catching thrown errors, it will also intercept `Error` objects sent as the first argument to the function.
+ *
+ * In this way, the common `if (err) return callback(err);` pattern can be replaced
+ * with a single error handler in a single place.
+ *
+ * ```js
+ * const d = domain.create();
+ *
+ * function readSomeFile(filename, cb) {
+ * fs.readFile(filename, 'utf8', d.intercept((data) => {
+ * // Note, the first argument is never passed to the
+ * // callback since it is assumed to be the 'Error' argument
+ * // and thus intercepted by the domain.
+ *
+ * // If this throws, it will also be passed to the domain
+ * // so the error-handling logic can be moved to the 'error'
+ * // event on the domain instead of being repeated throughout
+ * // the program.
+ * return cb(null, JSON.parse(data));
+ * }));
+ * }
+ *
+ * d.on('error', (er) => {
+ * // An error occurred somewhere. If we throw it now, it will crash the program
+ * // with the normal line number and stack message.
+ * });
+ * ```
+ * @param callback The callback function
+ * @return The intercepted function
+ */
+ intercept<T extends Function>(callback: T): T;
+ }
+ function create(): Domain;
+}
+declare module "node:domain" {
+ export * from "domain";
+}
diff --git a/client/node_modules/@types/node/events.d.ts b/client/node_modules/@types/node/events.d.ts
new file mode 100644
index 0000000..9ffd523
--- /dev/null
+++ b/client/node_modules/@types/node/events.d.ts
@@ -0,0 +1,803 @@
+/**
+ * Much of the Node.js core API is built around an idiomatic asynchronous
+ * event-driven architecture in which certain kinds of objects (called "emitters")
+ * emit named events that cause `Function` objects ("listeners") to be called.
+ *
+ * For instance: a `net.Server` object emits an event each time a peer
+ * connects to it; a `fs.ReadStream` emits an event when the file is opened;
+ * a `stream` emits an event whenever data is available to be read.
+ *
+ * All objects that emit events are instances of the `EventEmitter` class. These
+ * objects expose an `eventEmitter.on()` function that allows one or more
+ * functions to be attached to named events emitted by the object. Typically,
+ * event names are camel-cased strings but any valid JavaScript property key
+ * can be used.
+ *
+ * When the `EventEmitter` object emits an event, all of the functions attached
+ * to that specific event are called _synchronously_. Any values returned by the
+ * called listeners are _ignored_ and discarded.
+ *
+ * The following example shows a simple `EventEmitter` instance with a single
+ * listener. The `eventEmitter.on()` method is used to register listeners, while
+ * the `eventEmitter.emit()` method is used to trigger the event.
+ *
+ * ```js
+ * const EventEmitter = require('events');
+ *
+ * class MyEmitter extends EventEmitter {}
+ *
+ * const myEmitter = new MyEmitter();
+ * myEmitter.on('event', () => {
+ * console.log('an event occurred!');
+ * });
+ * myEmitter.emit('event');
+ * ```
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/events.js)
+ */
+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 {
+ /**
+ * Enables automatic capturing of promise rejection.
+ */
+ captureRejections?: boolean | undefined;
+ }
+ // Any EventTarget with a Node-style `once` function
+ interface _NodeEventTarget {
+ once(eventName: string | symbol, listener: (...args: any[]) => void): this;
+ }
+ // Any EventTarget with a DOM-style `addEventListener`
+ interface _DOMEventTarget {
+ addEventListener(
+ eventName: string,
+ listener: (...args: any[]) => void,
+ opts?: {
+ once: boolean;
+ },
+ ): any;
+ }
+ interface StaticEventEmitterOptions {
+ signal?: AbortSignal | undefined;
+ }
+ interface EventEmitter extends NodeJS.EventEmitter {}
+ /**
+ * The `EventEmitter` class is defined and exposed by the `events` module:
+ *
+ * ```js
+ * const EventEmitter = require('events');
+ * ```
+ *
+ * All `EventEmitter`s emit the event `'newListener'` when new listeners are
+ * added and `'removeListener'` when existing listeners are removed.
+ *
+ * It supports the following option:
+ * @since v0.1.26
+ */
+ class EventEmitter {
+ constructor(options?: EventEmitterOptions);
+
+ [EventEmitter.captureRejectionSymbol]?(error: Error, event: string, ...args: any[]): void;
+
+ /**
+ * Creates a `Promise` that is fulfilled when the `EventEmitter` emits the given
+ * event or that is rejected if the `EventEmitter` emits `'error'` while waiting.
+ * The `Promise` will resolve with an array of all the arguments emitted to the
+ * given event.
+ *
+ * This method is intentionally generic and works with the web platform [EventTarget](https://dom.spec.whatwg.org/#interface-eventtarget) interface, which has no special`'error'` event
+ * semantics and does not listen to the `'error'` event.
+ *
+ * ```js
+ * const { once, EventEmitter } = require('events');
+ *
+ * async function run() {
+ * const ee = new EventEmitter();
+ *
+ * process.nextTick(() => {
+ * ee.emit('myevent', 42);
+ * });
+ *
+ * const [value] = await once(ee, 'myevent');
+ * console.log(value);
+ *
+ * const err = new Error('kaboom');
+ * process.nextTick(() => {
+ * ee.emit('error', err);
+ * });
+ *
+ * try {
+ * await once(ee, 'myevent');
+ * } catch (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
+ * '`error'` event itself, then it is treated as any other kind of event without
+ * special handling:
+ *
+ * ```js
+ * const { EventEmitter, once } = require('events');
+ *
+ * const ee = new EventEmitter();
+ *
+ * once(ee, 'error')
+ * .then(([err]) => console.log('ok', err.message))
+ * .catch((err) => console.log('error', err.message));
+ *
+ * ee.emit('error', new Error('boom'));
+ *
+ * // Prints: ok boom
+ * ```
+ *
+ * An `AbortSignal` can be used to cancel waiting for the event:
+ *
+ * ```js
+ * const { EventEmitter, once } = require('events');
+ *
+ * const ee = new EventEmitter();
+ * const ac = new AbortController();
+ *
+ * async function foo(emitter, event, signal) {
+ * try {
+ * await once(emitter, event, { signal });
+ * console.log('event emitted!');
+ * } catch (error) {
+ * if (error.name === 'AbortError') {
+ * console.error('Waiting for the event was canceled!');
+ * } else {
+ * console.error('There was an error', error.message);
+ * }
+ * }
+ * }
+ *
+ * foo(ee, 'foo', ac.signal);
+ * ac.abort(); // Abort waiting for the event
+ * ee.emit('foo'); // Prints: Waiting for the event was canceled!
+ * ```
+ * @since v11.13.0, v10.16.0
+ */
+ static once(
+ emitter: _NodeEventTarget,
+ eventName: string | symbol,
+ options?: StaticEventEmitterOptions,
+ ): Promise<any[]>;
+ static once(emitter: _DOMEventTarget, eventName: string, options?: StaticEventEmitterOptions): Promise<any[]>;
+ /**
+ * ```js
+ * const { on, EventEmitter } = require('events');
+ *
+ * (async () => {
+ * const ee = new EventEmitter();
+ *
+ * // Emit later on
+ * process.nextTick(() => {
+ * ee.emit('foo', 'bar');
+ * ee.emit('foo', 42);
+ * });
+ *
+ * for await (const event of on(ee, 'foo')) {
+ * // The execution of this inner block is synchronous and it
+ * // processes one event at a time (even with await). Do not use
+ * // if concurrent execution is required.
+ * console.log(event); // prints ['bar'] [42]
+ * }
+ * // Unreachable here
+ * })();
+ * ```
+ *
+ * Returns an `AsyncIterator` that iterates `eventName` events. It will throw
+ * if the `EventEmitter` emits `'error'`. It removes all listeners when
+ * exiting the loop. The `value` returned by each iteration is an array
+ * composed of the emitted event arguments.
+ *
+ * An `AbortSignal` can be used to cancel waiting on events:
+ *
+ * ```js
+ * const { on, EventEmitter } = require('events');
+ * const ac = new AbortController();
+ *
+ * (async () => {
+ * const ee = new EventEmitter();
+ *
+ * // Emit later on
+ * process.nextTick(() => {
+ * ee.emit('foo', 'bar');
+ * ee.emit('foo', 42);
+ * });
+ *
+ * for await (const event of on(ee, 'foo', { signal: ac.signal })) {
+ * // The execution of this inner block is synchronous and it
+ * // processes one event at a time (even with await). Do not use
+ * // if concurrent execution is required.
+ * console.log(event); // prints ['bar'] [42]
+ * }
+ * // Unreachable here
+ * })();
+ *
+ * process.nextTick(() => ac.abort());
+ * ```
+ * @since v13.6.0, v12.16.0
+ * @param eventName The name of the event being listened for
+ * @return that iterates `eventName` events emitted by the `emitter`
+ */
+ static on(
+ 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`.
+ *
+ * ```js
+ * const { EventEmitter, listenerCount } = require('events');
+ * const myEmitter = new EventEmitter();
+ * myEmitter.on('event', () => {});
+ * myEmitter.on('event', () => {});
+ * console.log(listenerCount(myEmitter, 'event'));
+ * // Prints: 2
+ * ```
+ * @since v0.9.12
+ * @deprecated Since v3.2.0 - Use `listenerCount` instead.
+ * @param emitter The emitter to query
+ * @param eventName The event name
+ */
+ static listenerCount(emitter: NodeJS.EventEmitter, eventName: string | symbol): number;
+ /**
+ * Returns a copy of the array of listeners for the event named `eventName`.
+ *
+ * For `EventEmitter`s this behaves exactly the same as calling `.listeners` on
+ * the emitter.
+ *
+ * For `EventTarget`s this is the only way to get the event listeners for the
+ * event target. This is useful for debugging and diagnostic purposes.
+ *
+ * ```js
+ * const { getEventListeners, EventEmitter } = require('events');
+ *
+ * {
+ * const ee = new EventEmitter();
+ * const listener = () => console.log('Events are fun');
+ * ee.on('foo', listener);
+ * getEventListeners(ee, 'foo'); // [listener]
+ * }
+ * {
+ * const et = new EventTarget();
+ * const listener = () => console.log('Events are fun');
+ * et.addEventListener('foo', listener);
+ * getEventListeners(et, 'foo'); // [listener]
+ * }
+ * ```
+ * @since v15.2.0, v14.17.0
+ */
+ static getEventListeners(emitter: _DOMEventTarget | NodeJS.EventEmitter, name: string | symbol): Function[];
+ /**
+ * Returns the currently set max amount of listeners.
+ *
+ * For `EventEmitter`s this behaves exactly the same as calling `.getMaxListeners` on
+ * the emitter.
+ *
+ * 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 v18.17.0
+ */
+ static getMaxListeners(emitter: _DOMEventTarget | NodeJS.EventEmitter): number;
+ /**
+ * ```js
+ * const {
+ * setMaxListeners,
+ * EventEmitter
+ * } = require('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 v18.18.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.
+ */
+ static readonly errorMonitor: unique symbol;
+ static readonly captureRejectionSymbol: unique symbol;
+ /**
+ * Sets or gets the default captureRejection value for all emitters.
+ */
+ // TODO: These should be described using static getter/setter pairs:
+ static captureRejections: boolean;
+ static defaultMaxListeners: number;
+ }
+ import internal = require("node:events");
+ namespace EventEmitter {
+ // Should just be `export { EventEmitter }`, but that doesn't work in TypeScript 3.4
+ export { internal as EventEmitter };
+ export interface Abortable {
+ /**
+ * When provided the corresponding `AbortController` can be used to cancel an asynchronous action.
+ */
+ 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 {
+ namespace NodeJS {
+ interface EventEmitter {
+ [EventEmitter.captureRejectionSymbol]?(error: Error, event: string, ...args: any[]): void;
+ /**
+ * Alias for `emitter.on(eventName, listener)`.
+ * @since v0.1.26
+ */
+ addListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
+ /**
+ * Adds the `listener` function to the end of the listeners array for the
+ * event named `eventName`. No checks are made to see if the `listener` has
+ * already been added. Multiple calls passing the same combination of `eventName`and `listener` will result in the `listener` being added, and called, multiple
+ * times.
+ *
+ * ```js
+ * server.on('connection', (stream) => {
+ * console.log('someone connected!');
+ * });
+ * ```
+ *
+ * Returns a reference to the `EventEmitter`, so that calls can be chained.
+ *
+ * By default, event listeners are invoked in the order they are added. The`emitter.prependListener()` method can be used as an alternative to add the
+ * event listener to the beginning of the listeners array.
+ *
+ * ```js
+ * const myEE = new EventEmitter();
+ * myEE.on('foo', () => console.log('a'));
+ * myEE.prependListener('foo', () => console.log('b'));
+ * myEE.emit('foo');
+ * // Prints:
+ * // b
+ * // a
+ * ```
+ * @since v0.1.101
+ * @param eventName The name of the event.
+ * @param listener The callback function
+ */
+ on(eventName: string | symbol, listener: (...args: any[]) => void): this;
+ /**
+ * Adds a **one-time**`listener` function for the event named `eventName`. The
+ * next time `eventName` is triggered, this listener is removed and then invoked.
+ *
+ * ```js
+ * server.once('connection', (stream) => {
+ * console.log('Ah, we have our first user!');
+ * });
+ * ```
+ *
+ * Returns a reference to the `EventEmitter`, so that calls can be chained.
+ *
+ * By default, event listeners are invoked in the order they are added. The`emitter.prependOnceListener()` method can be used as an alternative to add the
+ * event listener to the beginning of the listeners array.
+ *
+ * ```js
+ * const myEE = new EventEmitter();
+ * myEE.once('foo', () => console.log('a'));
+ * myEE.prependOnceListener('foo', () => console.log('b'));
+ * myEE.emit('foo');
+ * // Prints:
+ * // b
+ * // a
+ * ```
+ * @since v0.3.0
+ * @param eventName The name of the event.
+ * @param listener The callback function
+ */
+ once(eventName: string | symbol, listener: (...args: any[]) => void): this;
+ /**
+ * Removes the specified `listener` from the listener array for the event named`eventName`.
+ *
+ * ```js
+ * const callback = (stream) => {
+ * console.log('someone connected!');
+ * };
+ * server.on('connection', callback);
+ * // ...
+ * server.removeListener('connection', callback);
+ * ```
+ *
+ * `removeListener()` will remove, at most, one instance of a listener from the
+ * listener array. If any single listener has been added multiple times to the
+ * listener array for the specified `eventName`, then `removeListener()` must be
+ * called multiple times to remove each instance.
+ *
+ * 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
+ * will not remove them from`emit()` in progress. Subsequent events behave as expected.
+ *
+ * ```js
+ * const myEmitter = new MyEmitter();
+ *
+ * const callbackA = () => {
+ * console.log('A');
+ * myEmitter.removeListener('event', callbackB);
+ * };
+ *
+ * const callbackB = () => {
+ * console.log('B');
+ * };
+ *
+ * myEmitter.on('event', callbackA);
+ *
+ * myEmitter.on('event', callbackB);
+ *
+ * // callbackA removes listener callbackB but it will still be called.
+ * // Internal listener array at time of emit [callbackA, callbackB]
+ * myEmitter.emit('event');
+ * // Prints:
+ * // A
+ * // B
+ *
+ * // callbackB is now removed.
+ * // Internal listener array [callbackA]
+ * myEmitter.emit('event');
+ * // Prints:
+ * // A
+ * ```
+ *
+ * Because listeners are managed using an internal array, calling this will
+ * change the position indices of any listener registered _after_ the listener
+ * being removed. This will not impact the order in which listeners are called,
+ * but it means that any copies of the listener array as returned by
+ * the `emitter.listeners()` method will need to be recreated.
+ *
+ * When a single function has been added as a handler multiple times for a single
+ * event (as in the example below), `removeListener()` will remove the most
+ * recently added instance. In the example the `once('ping')`listener is removed:
+ *
+ * ```js
+ * const ee = new EventEmitter();
+ *
+ * function pong() {
+ * console.log('pong');
+ * }
+ *
+ * ee.on('ping', pong);
+ * ee.once('ping', pong);
+ * ee.removeListener('ping', pong);
+ *
+ * ee.emit('ping');
+ * ee.emit('ping');
+ * ```
+ *
+ * Returns a reference to the `EventEmitter`, so that calls can be chained.
+ * @since v0.1.26
+ */
+ removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
+ /**
+ * Alias for `emitter.removeListener()`.
+ * @since v10.0.0
+ */
+ off(eventName: string | symbol, listener: (...args: any[]) => void): this;
+ /**
+ * Removes all listeners, or those of the specified `eventName`.
+ *
+ * It is bad practice to remove listeners added elsewhere in the code,
+ * particularly when the `EventEmitter` instance was created by some other
+ * component or module (e.g. sockets or file streams).
+ *
+ * Returns a reference to the `EventEmitter`, so that calls can be chained.
+ * @since v0.1.26
+ */
+ removeAllListeners(event?: string | symbol): this;
+ /**
+ * By default `EventEmitter`s will print a warning if more than `10` listeners are
+ * added for a particular event. This is a useful default that helps finding
+ * memory leaks. The `emitter.setMaxListeners()` method allows the limit to be
+ * modified for this specific `EventEmitter` instance. The value can be set to`Infinity` (or `0`) to indicate an unlimited number of listeners.
+ *
+ * Returns a reference to the `EventEmitter`, so that calls can be chained.
+ * @since v0.3.5
+ */
+ setMaxListeners(n: number): this;
+ /**
+ * Returns the current max listener value for the `EventEmitter` which is either
+ * set by `emitter.setMaxListeners(n)` or defaults to {@link defaultMaxListeners}.
+ * @since v1.0.0
+ */
+ getMaxListeners(): number;
+ /**
+ * Returns a copy of the array of listeners for the event named `eventName`.
+ *
+ * ```js
+ * server.on('connection', (stream) => {
+ * console.log('someone connected!');
+ * });
+ * console.log(util.inspect(server.listeners('connection')));
+ * // Prints: [ [Function] ]
+ * ```
+ * @since v0.1.26
+ */
+ listeners(eventName: string | symbol): Function[];
+ /**
+ * Returns a copy of the array of listeners for the event named `eventName`,
+ * including any wrappers (such as those created by `.once()`).
+ *
+ * ```js
+ * const emitter = new EventEmitter();
+ * emitter.once('log', () => console.log('log once'));
+ *
+ * // Returns a new Array with a function `onceWrapper` which has a property
+ * // `listener` which contains the original listener bound above
+ * const listeners = emitter.rawListeners('log');
+ * const logFnWrapper = listeners[0];
+ *
+ * // Logs "log once" to the console and does not unbind the `once` event
+ * logFnWrapper.listener();
+ *
+ * // Logs "log once" to the console and removes the listener
+ * logFnWrapper();
+ *
+ * emitter.on('log', () => console.log('log persistently'));
+ * // Will return a new Array with a single function bound by `.on()` above
+ * const newListeners = emitter.rawListeners('log');
+ *
+ * // Logs "log persistently" twice
+ * newListeners[0]();
+ * emitter.emit('log');
+ * ```
+ * @since v9.4.0
+ */
+ rawListeners(eventName: string | symbol): Function[];
+ /**
+ * Synchronously calls each of the listeners registered for the event named`eventName`, in the order they were registered, passing the supplied arguments
+ * to each.
+ *
+ * Returns `true` if the event had listeners, `false` otherwise.
+ *
+ * ```js
+ * const EventEmitter = require('events');
+ * const myEmitter = new EventEmitter();
+ *
+ * // First listener
+ * myEmitter.on('event', function firstListener() {
+ * console.log('Helloooo! first listener');
+ * });
+ * // Second listener
+ * myEmitter.on('event', function secondListener(arg1, arg2) {
+ * console.log(`event with parameters ${arg1}, ${arg2} in second listener`);
+ * });
+ * // Third listener
+ * myEmitter.on('event', function thirdListener(...args) {
+ * const parameters = args.join(', ');
+ * console.log(`event with parameters ${parameters} in third listener`);
+ * });
+ *
+ * console.log(myEmitter.listeners('event'));
+ *
+ * myEmitter.emit('event', 1, 2, 3, 4, 5);
+ *
+ * // Prints:
+ * // [
+ * // [Function: firstListener],
+ * // [Function: secondListener],
+ * // [Function: thirdListener]
+ * // ]
+ * // Helloooo! first listener
+ * // event with parameters 1, 2 in second listener
+ * // event with parameters 1, 2, 3, 4, 5 in third listener
+ * ```
+ * @since v0.1.26
+ */
+ emit(eventName: string | symbol, ...args: any[]): boolean;
+ /**
+ * 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
+ * @param eventName The name of the event being listened for
+ * @param listener The event handler function
+ */
+ listenerCount(eventName: string | symbol, listener?: Function): number;
+ /**
+ * 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
+ * already been added. Multiple calls passing the same combination of `eventName`and `listener` will result in the `listener` being added, and called, multiple
+ * times.
+ *
+ * ```js
+ * server.prependListener('connection', (stream) => {
+ * console.log('someone connected!');
+ * });
+ * ```
+ *
+ * Returns a reference to the `EventEmitter`, so that calls can be chained.
+ * @since v6.0.0
+ * @param eventName The name of the event.
+ * @param listener The callback function
+ */
+ 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
+ * listener is removed, and then invoked.
+ *
+ * ```js
+ * server.prependOnceListener('connection', (stream) => {
+ * console.log('Ah, we have our first user!');
+ * });
+ * ```
+ *
+ * Returns a reference to the `EventEmitter`, so that calls can be chained.
+ * @since v6.0.0
+ * @param eventName The name of the event.
+ * @param listener The callback function
+ */
+ prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
+ /**
+ * Returns an array listing the events for which the emitter has registered
+ * listeners. The values in the array are strings or `Symbol`s.
+ *
+ * ```js
+ * const EventEmitter = require('events');
+ * const myEE = new EventEmitter();
+ * myEE.on('foo', () => {});
+ * myEE.on('bar', () => {});
+ *
+ * const sym = Symbol('symbol');
+ * myEE.on(sym, () => {});
+ *
+ * console.log(myEE.eventNames());
+ * // Prints: [ 'foo', 'bar', Symbol(symbol) ]
+ * ```
+ * @since v6.0.0
+ */
+ eventNames(): Array<string | symbol>;
+ }
+ }
+ }
+ export = EventEmitter;
+}
+declare module "node:events" {
+ import events = require("events");
+ export = events;
+}
diff --git a/client/node_modules/@types/node/fs.d.ts b/client/node_modules/@types/node/fs.d.ts
new file mode 100644
index 0000000..1d7be30
--- /dev/null
+++ b/client/node_modules/@types/node/fs.d.ts
@@ -0,0 +1,4211 @@
+/**
+ * The `fs` module enables interacting with the file system in a
+ * way modeled on standard POSIX functions.
+ *
+ * To use the promise-based APIs:
+ *
+ * ```js
+ * import * as fs from 'fs/promises';
+ * ```
+ *
+ * To use the callback and sync APIs:
+ *
+ * ```js
+ * import * as fs from 'fs';
+ * ```
+ *
+ * All file system operations have synchronous, callback, and promise-based
+ * forms, and are accessible using both CommonJS syntax and ES6 Modules (ESM).
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/fs.js)
+ */
+declare module "fs" {
+ import * as stream from "node:stream";
+ import { Abortable, EventEmitter } from "node:events";
+ import { URL } from "node:url";
+ import * as promises from "node:fs/promises";
+ export { promises };
+ /**
+ * Valid types for path values in "fs".
+ */
+ export type PathLike = string | Buffer | URL;
+ export type PathOrFileDescriptor = PathLike | number;
+ export type TimeLike = string | number | Date;
+ export type NoParamCallback = (err: NodeJS.ErrnoException | null) => void;
+ export type BufferEncodingOption =
+ | "buffer"
+ | {
+ encoding: "buffer";
+ };
+ export interface ObjectEncodingOptions {
+ encoding?: BufferEncoding | null | undefined;
+ }
+ export type EncodingOption = ObjectEncodingOptions | BufferEncoding | undefined | null;
+ export type OpenMode = number | string;
+ export type Mode = number | string;
+ export interface StatsBase<T> {
+ isFile(): boolean;
+ isDirectory(): boolean;
+ isBlockDevice(): boolean;
+ isCharacterDevice(): boolean;
+ isSymbolicLink(): boolean;
+ isFIFO(): boolean;
+ isSocket(): boolean;
+ dev: T;
+ ino: T;
+ mode: T;
+ nlink: T;
+ uid: T;
+ gid: T;
+ rdev: T;
+ size: T;
+ blksize: T;
+ blocks: T;
+ atimeMs: T;
+ mtimeMs: T;
+ ctimeMs: T;
+ birthtimeMs: T;
+ atime: Date;
+ mtime: Date;
+ ctime: Date;
+ birthtime: Date;
+ }
+ export interface Stats extends StatsBase<number> {}
+ /**
+ * A `fs.Stats` object provides information about a file.
+ *
+ * Objects returned from {@link stat}, {@link lstat} and {@link fstat} and
+ * their synchronous counterparts are of this type.
+ * If `bigint` in the `options` passed to those methods is true, the numeric values
+ * will be `bigint` instead of `number`, and the object will contain additional
+ * nanosecond-precision properties suffixed with `Ns`.
+ *
+ * ```console
+ * Stats {
+ * dev: 2114,
+ * ino: 48064969,
+ * mode: 33188,
+ * nlink: 1,
+ * uid: 85,
+ * gid: 100,
+ * rdev: 0,
+ * size: 527,
+ * blksize: 4096,
+ * blocks: 8,
+ * atimeMs: 1318289051000.1,
+ * mtimeMs: 1318289051000.1,
+ * ctimeMs: 1318289051000.1,
+ * birthtimeMs: 1318289051000.1,
+ * atime: Mon, 10 Oct 2011 23:24:11 GMT,
+ * mtime: Mon, 10 Oct 2011 23:24:11 GMT,
+ * ctime: Mon, 10 Oct 2011 23:24:11 GMT,
+ * birthtime: Mon, 10 Oct 2011 23:24:11 GMT }
+ * ```
+ *
+ * `bigint` version:
+ *
+ * ```console
+ * BigIntStats {
+ * dev: 2114n,
+ * ino: 48064969n,
+ * mode: 33188n,
+ * nlink: 1n,
+ * uid: 85n,
+ * gid: 100n,
+ * rdev: 0n,
+ * size: 527n,
+ * blksize: 4096n,
+ * blocks: 8n,
+ * atimeMs: 1318289051000n,
+ * mtimeMs: 1318289051000n,
+ * ctimeMs: 1318289051000n,
+ * birthtimeMs: 1318289051000n,
+ * atimeNs: 1318289051000000000n,
+ * mtimeNs: 1318289051000000000n,
+ * ctimeNs: 1318289051000000000n,
+ * birthtimeNs: 1318289051000000000n,
+ * atime: Mon, 10 Oct 2011 23:24:11 GMT,
+ * mtime: Mon, 10 Oct 2011 23:24:11 GMT,
+ * ctime: Mon, 10 Oct 2011 23:24:11 GMT,
+ * birthtime: Mon, 10 Oct 2011 23:24:11 GMT }
+ * ```
+ * @since v0.1.21
+ */
+ export class Stats {}
+
+ export interface StatsFsBase<T> {
+ /** Type of file system. */
+ type: T;
+ /** Optimal transfer block size. */
+ bsize: T;
+ /** Total data blocks in file system. */
+ blocks: T;
+ /** Free blocks in file system. */
+ bfree: T;
+ /** Available blocks for unprivileged users */
+ bavail: T;
+ /** Total file nodes in file system. */
+ files: T;
+ /** Free file nodes in file system. */
+ ffree: T;
+ }
+
+ export interface StatsFs extends StatsFsBase<number> {}
+
+ /**
+ * Provides information about a mounted file system
+ *
+ * Objects returned from {@link statfs} and {@link statfsSync} are of this type.
+ * If `bigint` in the `options` passed to those methods is true, the numeric values
+ * will be `bigint` instead of `number`.
+ * @since v18.15.0
+ */
+ export class StatsFs {}
+
+ export interface BigIntStatsFs extends StatsFsBase<bigint> {}
+
+ export interface StatFsOptions {
+ bigint?: boolean | undefined;
+ }
+
+ /**
+ * A representation of a directory entry, which can be a file or a subdirectory
+ * within the directory, as returned by reading from an `fs.Dir`. The
+ * directory entry is a combination of the file name and file type pairs.
+ *
+ * Additionally, when {@link readdir} or {@link readdirSync} is called with
+ * the `withFileTypes` option set to `true`, the resulting array is filled with `fs.Dirent` objects, rather than strings or `Buffer` s.
+ * @since v10.10.0
+ */
+ export class Dirent {
+ /**
+ * Returns `true` if the `fs.Dirent` object describes a regular file.
+ * @since v10.10.0
+ */
+ isFile(): boolean;
+ /**
+ * Returns `true` if the `fs.Dirent` object describes a file system
+ * directory.
+ * @since v10.10.0
+ */
+ isDirectory(): boolean;
+ /**
+ * Returns `true` if the `fs.Dirent` object describes a block device.
+ * @since v10.10.0
+ */
+ isBlockDevice(): boolean;
+ /**
+ * Returns `true` if the `fs.Dirent` object describes a character device.
+ * @since v10.10.0
+ */
+ isCharacterDevice(): boolean;
+ /**
+ * Returns `true` if the `fs.Dirent` object describes a symbolic link.
+ * @since v10.10.0
+ */
+ isSymbolicLink(): boolean;
+ /**
+ * Returns `true` if the `fs.Dirent` object describes a first-in-first-out
+ * (FIFO) pipe.
+ * @since v10.10.0
+ */
+ isFIFO(): boolean;
+ /**
+ * Returns `true` if the `fs.Dirent` object describes a socket.
+ * @since v10.10.0
+ */
+ isSocket(): boolean;
+ /**
+ * The file name that this `fs.Dirent` object refers to. The type of this
+ * value is determined by the `options.encoding` passed to {@link readdir} or {@link readdirSync}.
+ * @since v10.10.0
+ */
+ name: string;
+ /**
+ * The base path that this `fs.Dirent` object refers to.
+ * @since v18.17.0
+ */
+ path: string;
+ }
+ /**
+ * A class representing a directory stream.
+ *
+ * Created by {@link opendir}, {@link opendirSync}, or `fsPromises.opendir()`.
+ *
+ * ```js
+ * import { opendir } from 'fs/promises';
+ *
+ * try {
+ * const dir = await opendir('./');
+ * for await (const dirent of dir)
+ * console.log(dirent.name);
+ * } catch (err) {
+ * console.error(err);
+ * }
+ * ```
+ *
+ * When using the async iterator, the `fs.Dir` object will be automatically
+ * closed after the iterator exits.
+ * @since v12.12.0
+ */
+ export class Dir implements AsyncIterable<Dirent> {
+ /**
+ * The read-only path of this directory as was provided to {@link opendir},{@link opendirSync}, or `fsPromises.opendir()`.
+ * @since v12.12.0
+ */
+ readonly path: string;
+ /**
+ * Asynchronously iterates over the directory via `readdir(3)` until all entries have been read.
+ */
+ [Symbol.asyncIterator](): AsyncIterableIterator<Dirent>;
+ /**
+ * Asynchronously close the directory's underlying resource handle.
+ * Subsequent reads will result in errors.
+ *
+ * A promise is returned that will be resolved after the resource has been
+ * closed.
+ * @since v12.12.0
+ */
+ close(): Promise<void>;
+ close(cb: NoParamCallback): void;
+ /**
+ * Synchronously close the directory's underlying resource handle.
+ * Subsequent reads will result in errors.
+ * @since v12.12.0
+ */
+ closeSync(): void;
+ /**
+ * Asynchronously read the next directory entry via [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) as an `fs.Dirent`.
+ *
+ * A promise is returned that will be resolved with an `fs.Dirent`, or `null`if there are no more directory entries to read.
+ *
+ * Directory entries returned by this function are in no particular order as
+ * provided by the operating system's underlying directory mechanisms.
+ * Entries added or removed while iterating over the directory might not be
+ * included in the iteration results.
+ * @since v12.12.0
+ * @return containing {fs.Dirent|null}
+ */
+ read(): Promise<Dirent | null>;
+ read(cb: (err: NodeJS.ErrnoException | null, dirEnt: Dirent | null) => void): void;
+ /**
+ * Synchronously read the next directory entry as an `fs.Dirent`. See the
+ * POSIX [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) documentation for more detail.
+ *
+ * If there are no more directory entries to read, `null` will be returned.
+ *
+ * Directory entries returned by this function are in no particular order as
+ * provided by the operating system's underlying directory mechanisms.
+ * Entries added or removed while iterating over the directory might not be
+ * included in the iteration results.
+ * @since v12.12.0
+ */
+ readSync(): Dirent | null;
+ }
+ /**
+ * Class: fs.StatWatcher
+ * @since v14.3.0, v12.20.0
+ * Extends `EventEmitter`
+ * A successful call to {@link watchFile} method will return a new fs.StatWatcher object.
+ */
+ export interface StatWatcher extends EventEmitter {
+ /**
+ * When called, requests that the Node.js event loop _not_ exit so long as the `fs.StatWatcher` is active. Calling `watcher.ref()` multiple times will have
+ * no effect.
+ *
+ * By default, all `fs.StatWatcher` objects are "ref'ed", making it normally
+ * unnecessary to call `watcher.ref()` unless `watcher.unref()` had been
+ * called previously.
+ * @since v14.3.0, v12.20.0
+ */
+ ref(): this;
+ /**
+ * When called, the active `fs.StatWatcher` object will not require the Node.js
+ * event loop to remain active. If there is no other activity keeping the
+ * event loop running, the process may exit before the `fs.StatWatcher` object's
+ * callback is invoked. Calling `watcher.unref()` multiple times will have
+ * no effect.
+ * @since v14.3.0, v12.20.0
+ */
+ unref(): this;
+ }
+ export interface FSWatcher extends EventEmitter {
+ /**
+ * Stop watching for changes on the given `fs.FSWatcher`. Once stopped, the `fs.FSWatcher` object is no longer usable.
+ * @since v0.5.8
+ */
+ close(): void;
+ /**
+ * events.EventEmitter
+ * 1. change
+ * 2. error
+ */
+ addListener(event: string, listener: (...args: any[]) => void): this;
+ addListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this;
+ addListener(event: "error", listener: (error: Error) => void): this;
+ addListener(event: "close", listener: () => void): this;
+ on(event: string, listener: (...args: any[]) => void): this;
+ on(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this;
+ on(event: "error", listener: (error: Error) => void): this;
+ on(event: "close", listener: () => void): this;
+ once(event: string, listener: (...args: any[]) => void): this;
+ once(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this;
+ once(event: "error", listener: (error: Error) => void): this;
+ once(event: "close", listener: () => void): this;
+ prependListener(event: string, listener: (...args: any[]) => void): this;
+ prependListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this;
+ prependListener(event: "error", listener: (error: Error) => void): this;
+ prependListener(event: "close", listener: () => void): this;
+ prependOnceListener(event: string, listener: (...args: any[]) => void): this;
+ prependOnceListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this;
+ prependOnceListener(event: "error", listener: (error: Error) => void): this;
+ prependOnceListener(event: "close", listener: () => void): this;
+ }
+ /**
+ * Instances of `fs.ReadStream` are created and returned using the {@link createReadStream} function.
+ * @since v0.1.93
+ */
+ export class ReadStream extends stream.Readable {
+ close(callback?: (err?: NodeJS.ErrnoException | null) => void): void;
+ /**
+ * The number of bytes that have been read so far.
+ * @since v6.4.0
+ */
+ bytesRead: number;
+ /**
+ * The path to the file the stream is reading from as specified in the first
+ * argument to `fs.createReadStream()`. If `path` is passed as a string, then`readStream.path` will be a string. If `path` is passed as a `Buffer`, then`readStream.path` will be a
+ * `Buffer`. If `fd` is specified, then`readStream.path` will be `undefined`.
+ * @since v0.1.93
+ */
+ path: string | Buffer;
+ /**
+ * This property is `true` if the underlying file has not been opened yet,
+ * i.e. before the `'ready'` event is emitted.
+ * @since v11.2.0, v10.16.0
+ */
+ pending: boolean;
+ /**
+ * events.EventEmitter
+ * 1. open
+ * 2. close
+ * 3. ready
+ */
+ addListener(event: "close", listener: () => void): this;
+ addListener(event: "data", listener: (chunk: Buffer | string) => void): this;
+ addListener(event: "end", listener: () => void): this;
+ addListener(event: "error", listener: (err: Error) => void): this;
+ addListener(event: "open", listener: (fd: number) => void): this;
+ addListener(event: "pause", listener: () => void): this;
+ addListener(event: "readable", listener: () => void): this;
+ addListener(event: "ready", listener: () => void): this;
+ addListener(event: "resume", listener: () => void): this;
+ addListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ on(event: "close", listener: () => void): this;
+ on(event: "data", listener: (chunk: Buffer | string) => void): this;
+ on(event: "end", listener: () => void): this;
+ on(event: "error", listener: (err: Error) => void): this;
+ on(event: "open", listener: (fd: number) => void): this;
+ on(event: "pause", listener: () => void): this;
+ on(event: "readable", listener: () => void): this;
+ on(event: "ready", listener: () => void): this;
+ on(event: "resume", listener: () => void): this;
+ on(event: string | symbol, listener: (...args: any[]) => void): this;
+ once(event: "close", listener: () => void): this;
+ once(event: "data", listener: (chunk: Buffer | string) => void): this;
+ once(event: "end", listener: () => void): this;
+ once(event: "error", listener: (err: Error) => void): this;
+ once(event: "open", listener: (fd: number) => void): this;
+ once(event: "pause", listener: () => void): this;
+ once(event: "readable", listener: () => void): this;
+ once(event: "ready", listener: () => void): this;
+ once(event: "resume", listener: () => void): this;
+ once(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependListener(event: "close", listener: () => void): this;
+ prependListener(event: "data", listener: (chunk: Buffer | string) => void): this;
+ prependListener(event: "end", listener: () => void): this;
+ prependListener(event: "error", listener: (err: Error) => void): this;
+ prependListener(event: "open", listener: (fd: number) => void): this;
+ prependListener(event: "pause", listener: () => void): this;
+ prependListener(event: "readable", listener: () => void): this;
+ prependListener(event: "ready", listener: () => void): this;
+ prependListener(event: "resume", listener: () => void): this;
+ prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependOnceListener(event: "close", listener: () => void): this;
+ prependOnceListener(event: "data", listener: (chunk: Buffer | string) => void): this;
+ prependOnceListener(event: "end", listener: () => void): this;
+ prependOnceListener(event: "error", listener: (err: Error) => void): this;
+ prependOnceListener(event: "open", listener: (fd: number) => void): this;
+ prependOnceListener(event: "pause", listener: () => void): this;
+ prependOnceListener(event: "readable", listener: () => void): this;
+ prependOnceListener(event: "ready", listener: () => void): this;
+ prependOnceListener(event: "resume", listener: () => void): this;
+ prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ }
+ /**
+ * * Extends `stream.Writable`
+ *
+ * Instances of `fs.WriteStream` are created and returned using the {@link createWriteStream} function.
+ * @since v0.1.93
+ */
+ export class WriteStream extends stream.Writable {
+ /**
+ * Closes `writeStream`. Optionally accepts a
+ * callback that will be executed once the `writeStream`is closed.
+ * @since v0.9.4
+ */
+ close(callback?: (err?: NodeJS.ErrnoException | null) => void): void;
+ /**
+ * The number of bytes written so far. Does not include data that is still queued
+ * for writing.
+ * @since v0.4.7
+ */
+ bytesWritten: number;
+ /**
+ * The path to the file the stream is writing to as specified in the first
+ * argument to {@link createWriteStream}. If `path` is passed as a string, then`writeStream.path` will be a string. If `path` is passed as a `Buffer`, then`writeStream.path` will be a
+ * `Buffer`.
+ * @since v0.1.93
+ */
+ path: string | Buffer;
+ /**
+ * This property is `true` if the underlying file has not been opened yet,
+ * i.e. before the `'ready'` event is emitted.
+ * @since v11.2.0
+ */
+ pending: boolean;
+ /**
+ * events.EventEmitter
+ * 1. open
+ * 2. close
+ * 3. ready
+ */
+ addListener(event: "close", listener: () => void): this;
+ addListener(event: "drain", listener: () => void): this;
+ addListener(event: "error", listener: (err: Error) => void): this;
+ addListener(event: "finish", listener: () => void): this;
+ addListener(event: "open", listener: (fd: number) => void): this;
+ addListener(event: "pipe", listener: (src: stream.Readable) => void): this;
+ addListener(event: "ready", listener: () => void): this;
+ addListener(event: "unpipe", listener: (src: stream.Readable) => void): this;
+ addListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ on(event: "close", listener: () => void): this;
+ on(event: "drain", listener: () => void): this;
+ on(event: "error", listener: (err: Error) => void): this;
+ on(event: "finish", listener: () => void): this;
+ on(event: "open", listener: (fd: number) => void): this;
+ on(event: "pipe", listener: (src: stream.Readable) => void): this;
+ on(event: "ready", listener: () => void): this;
+ on(event: "unpipe", listener: (src: stream.Readable) => void): this;
+ on(event: string | symbol, listener: (...args: any[]) => void): this;
+ once(event: "close", listener: () => void): this;
+ once(event: "drain", listener: () => void): this;
+ once(event: "error", listener: (err: Error) => void): this;
+ once(event: "finish", listener: () => void): this;
+ once(event: "open", listener: (fd: number) => void): this;
+ once(event: "pipe", listener: (src: stream.Readable) => void): this;
+ once(event: "ready", listener: () => void): this;
+ once(event: "unpipe", listener: (src: stream.Readable) => void): this;
+ once(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependListener(event: "close", listener: () => void): this;
+ prependListener(event: "drain", listener: () => void): this;
+ prependListener(event: "error", listener: (err: Error) => void): this;
+ prependListener(event: "finish", listener: () => void): this;
+ prependListener(event: "open", listener: (fd: number) => void): this;
+ prependListener(event: "pipe", listener: (src: stream.Readable) => void): this;
+ prependListener(event: "ready", listener: () => void): this;
+ prependListener(event: "unpipe", listener: (src: stream.Readable) => void): this;
+ prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependOnceListener(event: "close", listener: () => void): this;
+ prependOnceListener(event: "drain", listener: () => void): this;
+ prependOnceListener(event: "error", listener: (err: Error) => void): this;
+ prependOnceListener(event: "finish", listener: () => void): this;
+ prependOnceListener(event: "open", listener: (fd: number) => void): this;
+ prependOnceListener(event: "pipe", listener: (src: stream.Readable) => void): this;
+ prependOnceListener(event: "ready", listener: () => void): this;
+ prependOnceListener(event: "unpipe", listener: (src: stream.Readable) => void): this;
+ prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ }
+ /**
+ * Asynchronously rename file at `oldPath` to the pathname provided
+ * as `newPath`. In the case that `newPath` already exists, it will
+ * be overwritten. If there is a directory at `newPath`, an error will
+ * be raised instead. No arguments other than a possible exception are
+ * given to the completion callback.
+ *
+ * See also: [`rename(2)`](http://man7.org/linux/man-pages/man2/rename.2.html).
+ *
+ * ```js
+ * import { rename } from 'fs';
+ *
+ * rename('oldFile.txt', 'newFile.txt', (err) => {
+ * if (err) throw err;
+ * console.log('Rename complete!');
+ * });
+ * ```
+ * @since v0.0.2
+ */
+ export function rename(oldPath: PathLike, newPath: PathLike, callback: NoParamCallback): void;
+ export namespace rename {
+ /**
+ * Asynchronous rename(2) - Change the name or location of a file or directory.
+ * @param oldPath A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * URL support is _experimental_.
+ * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * URL support is _experimental_.
+ */
+ function __promisify__(oldPath: PathLike, newPath: PathLike): Promise<void>;
+ }
+ /**
+ * Renames the file from `oldPath` to `newPath`. Returns `undefined`.
+ *
+ * See the POSIX [`rename(2)`](http://man7.org/linux/man-pages/man2/rename.2.html) documentation for more details.
+ * @since v0.1.21
+ */
+ export function renameSync(oldPath: PathLike, newPath: PathLike): void;
+ /**
+ * Truncates the file. No arguments other than a possible exception are
+ * given to the completion callback. A file descriptor can also be passed as the
+ * first argument. In this case, `fs.ftruncate()` is called.
+ *
+ * ```js
+ * import { truncate } from 'fs';
+ * // Assuming that 'path/file.txt' is a regular file.
+ * truncate('path/file.txt', (err) => {
+ * if (err) throw err;
+ * console.log('path/file.txt was truncated');
+ * });
+ * ```
+ *
+ * Passing a file descriptor is deprecated and may result in an error being thrown
+ * in the future.
+ *
+ * See the POSIX [`truncate(2)`](http://man7.org/linux/man-pages/man2/truncate.2.html) documentation for more details.
+ * @since v0.8.6
+ * @param [len=0]
+ */
+ export function truncate(path: PathLike, len: number | undefined | null, callback: NoParamCallback): void;
+ /**
+ * Asynchronous truncate(2) - Truncate a file to a specified length.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ */
+ export function truncate(path: PathLike, callback: NoParamCallback): void;
+ export namespace truncate {
+ /**
+ * Asynchronous truncate(2) - Truncate a file to a specified length.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * @param len If not specified, defaults to `0`.
+ */
+ function __promisify__(path: PathLike, len?: number | null): Promise<void>;
+ }
+ /**
+ * Truncates the file. Returns `undefined`. A file descriptor can also be
+ * passed as the first argument. In this case, `fs.ftruncateSync()` is called.
+ *
+ * Passing a file descriptor is deprecated and may result in an error being thrown
+ * in the future.
+ * @since v0.8.6
+ * @param [len=0]
+ */
+ export function truncateSync(path: PathLike, len?: number | null): void;
+ /**
+ * Truncates the file descriptor. No arguments other than a possible exception are
+ * given to the completion callback.
+ *
+ * See the POSIX [`ftruncate(2)`](http://man7.org/linux/man-pages/man2/ftruncate.2.html) documentation for more detail.
+ *
+ * If the file referred to by the file descriptor was larger than `len` bytes, only
+ * the first `len` bytes will be retained in the file.
+ *
+ * For example, the following program retains only the first four bytes of the
+ * file:
+ *
+ * ```js
+ * import { open, close, ftruncate } from 'fs';
+ *
+ * function closeFd(fd) {
+ * close(fd, (err) => {
+ * if (err) throw err;
+ * });
+ * }
+ *
+ * open('temp.txt', 'r+', (err, fd) => {
+ * if (err) throw err;
+ *
+ * try {
+ * ftruncate(fd, 4, (err) => {
+ * closeFd(fd);
+ * if (err) throw err;
+ * });
+ * } catch (err) {
+ * closeFd(fd);
+ * if (err) throw err;
+ * }
+ * });
+ * ```
+ *
+ * If the file previously was shorter than `len` bytes, it is extended, and the
+ * extended part is filled with null bytes (`'\0'`):
+ *
+ * If `len` is negative then `0` will be used.
+ * @since v0.8.6
+ * @param [len=0]
+ */
+ export function ftruncate(fd: number, len: number | undefined | null, callback: NoParamCallback): void;
+ /**
+ * Asynchronous ftruncate(2) - Truncate a file to a specified length.
+ * @param fd A file descriptor.
+ */
+ export function ftruncate(fd: number, callback: NoParamCallback): void;
+ export namespace ftruncate {
+ /**
+ * Asynchronous ftruncate(2) - Truncate a file to a specified length.
+ * @param fd A file descriptor.
+ * @param len If not specified, defaults to `0`.
+ */
+ function __promisify__(fd: number, len?: number | null): Promise<void>;
+ }
+ /**
+ * Truncates the file descriptor. Returns `undefined`.
+ *
+ * For detailed information, see the documentation of the asynchronous version of
+ * this API: {@link ftruncate}.
+ * @since v0.8.6
+ * @param [len=0]
+ */
+ export function ftruncateSync(fd: number, len?: number | null): void;
+ /**
+ * Asynchronously changes owner and group of a file. No arguments other than a
+ * possible exception are given to the completion callback.
+ *
+ * See the POSIX [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html) documentation for more detail.
+ * @since v0.1.97
+ */
+ export function chown(path: PathLike, uid: number, gid: number, callback: NoParamCallback): void;
+ export namespace chown {
+ /**
+ * Asynchronous chown(2) - Change ownership of a file.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ */
+ function __promisify__(path: PathLike, uid: number, gid: number): Promise<void>;
+ }
+ /**
+ * Synchronously changes owner and group of a file. Returns `undefined`.
+ * This is the synchronous version of {@link chown}.
+ *
+ * See the POSIX [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html) documentation for more detail.
+ * @since v0.1.97
+ */
+ export function chownSync(path: PathLike, uid: number, gid: number): void;
+ /**
+ * Sets the owner of the file. No arguments other than a possible exception are
+ * given to the completion callback.
+ *
+ * See the POSIX [`fchown(2)`](http://man7.org/linux/man-pages/man2/fchown.2.html) documentation for more detail.
+ * @since v0.4.7
+ */
+ export function fchown(fd: number, uid: number, gid: number, callback: NoParamCallback): void;
+ export namespace fchown {
+ /**
+ * Asynchronous fchown(2) - Change ownership of a file.
+ * @param fd A file descriptor.
+ */
+ function __promisify__(fd: number, uid: number, gid: number): Promise<void>;
+ }
+ /**
+ * Sets the owner of the file. Returns `undefined`.
+ *
+ * See the POSIX [`fchown(2)`](http://man7.org/linux/man-pages/man2/fchown.2.html) documentation for more detail.
+ * @since v0.4.7
+ * @param uid The file's new owner's user id.
+ * @param gid The file's new group's group id.
+ */
+ export function fchownSync(fd: number, uid: number, gid: number): void;
+ /**
+ * Set the owner of the symbolic link. No arguments other than a possible
+ * exception are given to the completion callback.
+ *
+ * See the POSIX [`lchown(2)`](http://man7.org/linux/man-pages/man2/lchown.2.html) documentation for more detail.
+ */
+ export function lchown(path: PathLike, uid: number, gid: number, callback: NoParamCallback): void;
+ export namespace lchown {
+ /**
+ * Asynchronous lchown(2) - Change ownership of a file. Does not dereference symbolic links.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ */
+ function __promisify__(path: PathLike, uid: number, gid: number): Promise<void>;
+ }
+ /**
+ * Set the owner for the path. Returns `undefined`.
+ *
+ * See the POSIX [`lchown(2)`](http://man7.org/linux/man-pages/man2/lchown.2.html) documentation for more details.
+ * @param uid The file's new owner's user id.
+ * @param gid The file's new group's group id.
+ */
+ export function lchownSync(path: PathLike, uid: number, gid: number): void;
+ /**
+ * Changes the access and modification times of a file in the same way as {@link utimes}, with the difference that if the path refers to a symbolic
+ * link, then the link is not dereferenced: instead, the timestamps of the
+ * symbolic link itself are changed.
+ *
+ * No arguments other than a possible exception are given to the completion
+ * callback.
+ * @since v14.5.0, v12.19.0
+ */
+ export function lutimes(path: PathLike, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void;
+ export namespace lutimes {
+ /**
+ * Changes the access and modification times of a file in the same way as `fsPromises.utimes()`,
+ * with the difference that if the path refers to a symbolic link, then the link is not
+ * dereferenced: instead, the timestamps of the symbolic link itself are changed.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * @param atime The last access time. If a string is provided, it will be coerced to number.
+ * @param mtime The last modified time. If a string is provided, it will be coerced to number.
+ */
+ function __promisify__(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise<void>;
+ }
+ /**
+ * Change the file system timestamps of the symbolic link referenced by `path`.
+ * Returns `undefined`, or throws an exception when parameters are incorrect or
+ * the operation fails. This is the synchronous version of {@link lutimes}.
+ * @since v14.5.0, v12.19.0
+ */
+ export function lutimesSync(path: PathLike, atime: TimeLike, mtime: TimeLike): void;
+ /**
+ * Asynchronously changes the permissions of a file. No arguments other than a
+ * possible exception are given to the completion callback.
+ *
+ * See the POSIX [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html) documentation for more detail.
+ *
+ * ```js
+ * import { chmod } from 'fs';
+ *
+ * chmod('my_file.txt', 0o775, (err) => {
+ * if (err) throw err;
+ * console.log('The permissions for file "my_file.txt" have been changed!');
+ * });
+ * ```
+ * @since v0.1.30
+ */
+ export function chmod(path: PathLike, mode: Mode, callback: NoParamCallback): void;
+ export namespace chmod {
+ /**
+ * Asynchronous chmod(2) - Change permissions of a file.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * @param mode A file mode. If a string is passed, it is parsed as an octal integer.
+ */
+ function __promisify__(path: PathLike, mode: Mode): Promise<void>;
+ }
+ /**
+ * For detailed information, see the documentation of the asynchronous version of
+ * this API: {@link chmod}.
+ *
+ * See the POSIX [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html) documentation for more detail.
+ * @since v0.6.7
+ */
+ export function chmodSync(path: PathLike, mode: Mode): void;
+ /**
+ * Sets the permissions on the file. No arguments other than a possible exception
+ * are given to the completion callback.
+ *
+ * See the POSIX [`fchmod(2)`](http://man7.org/linux/man-pages/man2/fchmod.2.html) documentation for more detail.
+ * @since v0.4.7
+ */
+ export function fchmod(fd: number, mode: Mode, callback: NoParamCallback): void;
+ export namespace fchmod {
+ /**
+ * Asynchronous fchmod(2) - Change permissions of a file.
+ * @param fd A file descriptor.
+ * @param mode A file mode. If a string is passed, it is parsed as an octal integer.
+ */
+ function __promisify__(fd: number, mode: Mode): Promise<void>;
+ }
+ /**
+ * Sets the permissions on the file. Returns `undefined`.
+ *
+ * See the POSIX [`fchmod(2)`](http://man7.org/linux/man-pages/man2/fchmod.2.html) documentation for more detail.
+ * @since v0.4.7
+ */
+ export function fchmodSync(fd: number, mode: Mode): void;
+ /**
+ * Changes the permissions on a symbolic link. No arguments other than a possible
+ * exception are given to the completion callback.
+ *
+ * This method is only implemented on macOS.
+ *
+ * See the POSIX [`lchmod(2)`](https://www.freebsd.org/cgi/man.cgi?query=lchmod&sektion=2) documentation for more detail.
+ * @deprecated Since v0.4.7
+ */
+ export function lchmod(path: PathLike, mode: Mode, callback: NoParamCallback): void;
+ /** @deprecated */
+ export namespace lchmod {
+ /**
+ * Asynchronous lchmod(2) - Change permissions of a file. Does not dereference symbolic links.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * @param mode A file mode. If a string is passed, it is parsed as an octal integer.
+ */
+ function __promisify__(path: PathLike, mode: Mode): Promise<void>;
+ }
+ /**
+ * Changes the permissions on a symbolic link. Returns `undefined`.
+ *
+ * This method is only implemented on macOS.
+ *
+ * See the POSIX [`lchmod(2)`](https://www.freebsd.org/cgi/man.cgi?query=lchmod&sektion=2) documentation for more detail.
+ * @deprecated Since v0.4.7
+ */
+ export function lchmodSync(path: PathLike, mode: Mode): void;
+ /**
+ * Asynchronous [`stat(2)`](http://man7.org/linux/man-pages/man2/stat.2.html). The callback gets two arguments `(err, stats)` where`stats` is an `fs.Stats` object.
+ *
+ * In case of an error, the `err.code` will be one of `Common System Errors`.
+ *
+ * Using `fs.stat()` to check for the existence of a file before calling`fs.open()`, `fs.readFile()` or `fs.writeFile()` is not recommended.
+ * Instead, user code should open/read/write the file directly and handle the
+ * error raised if the file is not available.
+ *
+ * To check if a file exists without manipulating it afterwards, {@link access} is recommended.
+ *
+ * For example, given the following directory structure:
+ *
+ * ```text
+ * - txtDir
+ * -- file.txt
+ * - app.js
+ * ```
+ *
+ * The next program will check for the stats of the given paths:
+ *
+ * ```js
+ * import { stat } from 'fs';
+ *
+ * const pathsToCheck = ['./txtDir', './txtDir/file.txt'];
+ *
+ * for (let i = 0; i < pathsToCheck.length; i++) {
+ * stat(pathsToCheck[i], (err, stats) => {
+ * console.log(stats.isDirectory());
+ * console.log(stats);
+ * });
+ * }
+ * ```
+ *
+ * The resulting output will resemble:
+ *
+ * ```console
+ * true
+ * Stats {
+ * dev: 16777220,
+ * mode: 16877,
+ * nlink: 3,
+ * uid: 501,
+ * gid: 20,
+ * rdev: 0,
+ * blksize: 4096,
+ * ino: 14214262,
+ * size: 96,
+ * blocks: 0,
+ * atimeMs: 1561174653071.963,
+ * mtimeMs: 1561174614583.3518,
+ * ctimeMs: 1561174626623.5366,
+ * birthtimeMs: 1561174126937.2893,
+ * atime: 2019-06-22T03:37:33.072Z,
+ * mtime: 2019-06-22T03:36:54.583Z,
+ * ctime: 2019-06-22T03:37:06.624Z,
+ * birthtime: 2019-06-22T03:28:46.937Z
+ * }
+ * false
+ * Stats {
+ * dev: 16777220,
+ * mode: 33188,
+ * nlink: 1,
+ * uid: 501,
+ * gid: 20,
+ * rdev: 0,
+ * blksize: 4096,
+ * ino: 14214074,
+ * size: 8,
+ * blocks: 8,
+ * atimeMs: 1561174616618.8555,
+ * mtimeMs: 1561174614584,
+ * ctimeMs: 1561174614583.8145,
+ * birthtimeMs: 1561174007710.7478,
+ * atime: 2019-06-22T03:36:56.619Z,
+ * mtime: 2019-06-22T03:36:54.584Z,
+ * ctime: 2019-06-22T03:36:54.584Z,
+ * birthtime: 2019-06-22T03:26:47.711Z
+ * }
+ * ```
+ * @since v0.0.2
+ */
+ export function stat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void;
+ export function stat(
+ path: PathLike,
+ options:
+ | (StatOptions & {
+ bigint?: false | undefined;
+ })
+ | undefined,
+ callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void,
+ ): void;
+ export function stat(
+ path: PathLike,
+ options: StatOptions & {
+ bigint: true;
+ },
+ callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void,
+ ): void;
+ export function stat(
+ path: PathLike,
+ options: StatOptions | undefined,
+ callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void,
+ ): void;
+ export namespace stat {
+ /**
+ * Asynchronous stat(2) - Get file status.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ */
+ function __promisify__(
+ path: PathLike,
+ options?: StatOptions & {
+ bigint?: false | undefined;
+ },
+ ): Promise<Stats>;
+ function __promisify__(
+ path: PathLike,
+ options: StatOptions & {
+ bigint: true;
+ },
+ ): Promise<BigIntStats>;
+ function __promisify__(path: PathLike, options?: StatOptions): Promise<Stats | BigIntStats>;
+ }
+ export interface StatSyncFn extends Function {
+ (path: PathLike, options?: undefined): Stats;
+ (
+ path: PathLike,
+ options?: StatSyncOptions & {
+ bigint?: false | undefined;
+ throwIfNoEntry: false;
+ },
+ ): Stats | undefined;
+ (
+ path: PathLike,
+ options: StatSyncOptions & {
+ bigint: true;
+ throwIfNoEntry: false;
+ },
+ ): BigIntStats | undefined;
+ (
+ path: PathLike,
+ options?: StatSyncOptions & {
+ bigint?: false | undefined;
+ },
+ ): Stats;
+ (
+ path: PathLike,
+ options: StatSyncOptions & {
+ bigint: true;
+ },
+ ): BigIntStats;
+ (
+ path: PathLike,
+ options: StatSyncOptions & {
+ bigint: boolean;
+ throwIfNoEntry?: false | undefined;
+ },
+ ): Stats | BigIntStats;
+ (path: PathLike, options?: StatSyncOptions): Stats | BigIntStats | undefined;
+ }
+ /**
+ * Synchronous stat(2) - Get file status.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ */
+ export const statSync: StatSyncFn;
+ /**
+ * Invokes the callback with the `fs.Stats` for the file descriptor.
+ *
+ * See the POSIX [`fstat(2)`](http://man7.org/linux/man-pages/man2/fstat.2.html) documentation for more detail.
+ * @since v0.1.95
+ */
+ export function fstat(fd: number, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void;
+ export function fstat(
+ fd: number,
+ options:
+ | (StatOptions & {
+ bigint?: false | undefined;
+ })
+ | undefined,
+ callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void,
+ ): void;
+ export function fstat(
+ fd: number,
+ options: StatOptions & {
+ bigint: true;
+ },
+ callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void,
+ ): void;
+ export function fstat(
+ fd: number,
+ options: StatOptions | undefined,
+ callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void,
+ ): void;
+ export namespace fstat {
+ /**
+ * Asynchronous fstat(2) - Get file status.
+ * @param fd A file descriptor.
+ */
+ function __promisify__(
+ fd: number,
+ options?: StatOptions & {
+ bigint?: false | undefined;
+ },
+ ): Promise<Stats>;
+ function __promisify__(
+ fd: number,
+ options: StatOptions & {
+ bigint: true;
+ },
+ ): Promise<BigIntStats>;
+ function __promisify__(fd: number, options?: StatOptions): Promise<Stats | BigIntStats>;
+ }
+ /**
+ * Retrieves the `fs.Stats` for the file descriptor.
+ *
+ * See the POSIX [`fstat(2)`](http://man7.org/linux/man-pages/man2/fstat.2.html) documentation for more detail.
+ * @since v0.1.95
+ */
+ export function fstatSync(
+ fd: number,
+ options?: StatOptions & {
+ bigint?: false | undefined;
+ },
+ ): Stats;
+ export function fstatSync(
+ fd: number,
+ options: StatOptions & {
+ bigint: true;
+ },
+ ): BigIntStats;
+ export function fstatSync(fd: number, options?: StatOptions): Stats | BigIntStats;
+ /**
+ * Retrieves the `fs.Stats` for the symbolic link referred to by the path.
+ * The callback gets two arguments `(err, stats)` where `stats` is a `fs.Stats` object. `lstat()` is identical to `stat()`, except that if `path` is a symbolic
+ * link, then the link itself is stat-ed, not the file that it refers to.
+ *
+ * See the POSIX [`lstat(2)`](http://man7.org/linux/man-pages/man2/lstat.2.html) documentation for more details.
+ * @since v0.1.30
+ */
+ export function lstat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void;
+ export function lstat(
+ path: PathLike,
+ options:
+ | (StatOptions & {
+ bigint?: false | undefined;
+ })
+ | undefined,
+ callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void,
+ ): void;
+ export function lstat(
+ path: PathLike,
+ options: StatOptions & {
+ bigint: true;
+ },
+ callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void,
+ ): void;
+ export function lstat(
+ path: PathLike,
+ options: StatOptions | undefined,
+ callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void,
+ ): void;
+ export namespace lstat {
+ /**
+ * Asynchronous lstat(2) - Get file status. Does not dereference symbolic links.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ */
+ function __promisify__(
+ path: PathLike,
+ options?: StatOptions & {
+ bigint?: false | undefined;
+ },
+ ): Promise<Stats>;
+ function __promisify__(
+ path: PathLike,
+ options: StatOptions & {
+ bigint: true;
+ },
+ ): Promise<BigIntStats>;
+ function __promisify__(path: PathLike, options?: StatOptions): Promise<Stats | BigIntStats>;
+ }
+ /**
+ * Asynchronous statfs(2). Returns information about the mounted file system which contains path. The callback gets two arguments (err, stats) where stats is an <fs.StatFs> object.
+ * In case of an error, the err.code will be one of Common System Errors.
+ * @param path A path to an existing file or directory on the file system to be queried.
+ * @param callback
+ */
+ export function statfs(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: StatsFs) => void): void;
+ export function statfs(
+ path: PathLike,
+ options:
+ | (StatFsOptions & {
+ bigint?: false | undefined;
+ })
+ | undefined,
+ callback: (err: NodeJS.ErrnoException | null, stats: StatsFs) => void,
+ ): void;
+ export function statfs(
+ path: PathLike,
+ options: StatFsOptions & {
+ bigint: true;
+ },
+ callback: (err: NodeJS.ErrnoException | null, stats: BigIntStatsFs) => void,
+ ): void;
+ export function statfs(
+ path: PathLike,
+ options: StatFsOptions | undefined,
+ callback: (err: NodeJS.ErrnoException | null, stats: StatsFs | BigIntStatsFs) => void,
+ ): void;
+ export namespace statfs {
+ /**
+ * Asynchronous statfs(2) - Returns information about the mounted file system which contains path. The callback gets two arguments (err, stats) where stats is an <fs.StatFs> object.
+ * @param path A path to an existing file or directory on the file system to be queried.
+ */
+ function __promisify__(
+ path: PathLike,
+ options?: StatFsOptions & {
+ bigint?: false | undefined;
+ },
+ ): Promise<StatsFs>;
+ function __promisify__(
+ path: PathLike,
+ options: StatFsOptions & {
+ bigint: true;
+ },
+ ): Promise<BigIntStatsFs>;
+ function __promisify__(path: PathLike, options?: StatFsOptions): Promise<StatsFs | BigIntStatsFs>;
+ }
+
+ /**
+ * Synchronous statfs(2). Returns information about the mounted file system which contains path. The callback gets two arguments (err, stats) where stats is an <fs.StatFs> object.
+ * In case of an error, the err.code will be one of Common System Errors.
+ * @param path A path to an existing file or directory on the file system to be queried.
+ * @param callback
+ */
+ export function statfsSync(
+ path: PathLike,
+ options?: StatFsOptions & {
+ bigint?: false | undefined;
+ },
+ ): StatsFs;
+ export function statfsSync(
+ path: PathLike,
+ options: StatFsOptions & {
+ bigint: true;
+ },
+ ): BigIntStatsFs;
+
+ export function statfsSync(path: PathLike, options?: StatFsOptions): StatsFs | BigIntStatsFs;
+ /**
+ * Synchronous lstat(2) - Get file status. Does not dereference symbolic links.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ */
+ export const lstatSync: StatSyncFn;
+ /**
+ * 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. No arguments other than
+ * a possible
+ * exception are given to the completion callback.
+ * @since v0.1.31
+ */
+ export function link(existingPath: PathLike, newPath: PathLike, callback: NoParamCallback): void;
+ export namespace link {
+ /**
+ * Asynchronous link(2) - Create a new link (also known as a hard link) to an existing file.
+ * @param existingPath A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol.
+ */
+ function __promisify__(existingPath: PathLike, newPath: PathLike): Promise<void>;
+ }
+ /**
+ * 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. Returns `undefined`.
+ * @since v0.1.31
+ */
+ export function linkSync(existingPath: PathLike, newPath: PathLike): void;
+ /**
+ * Creates the link called `path` pointing to `target`. No arguments other than a
+ * possible exception are given to the completion callback.
+ *
+ * See the POSIX [`symlink(2)`](http://man7.org/linux/man-pages/man2/symlink.2.html) documentation for more details.
+ *
+ * The `type` argument is only available on Windows and ignored on other platforms.
+ * It can be set to `'dir'`, `'file'`, or `'junction'`. If the `type` argument is
+ * not set, Node.js will autodetect `target` type and use `'file'` or `'dir'`. If
+ * the `target` does not exist, `'file'` will be used. Windows junction points
+ * require the destination path to be absolute. When using `'junction'`, the`target` argument will automatically be normalized to absolute path.
+ *
+ * Relative targets are relative to the link’s parent directory.
+ *
+ * ```js
+ * import { symlink } from 'fs';
+ *
+ * symlink('./mew', './mewtwo', callback);
+ * ```
+ *
+ * The above example creates a symbolic link `mewtwo` which points to `mew` in the
+ * same directory:
+ *
+ * ```bash
+ * $ tree .
+ * .
+ * ├── mew
+ * └── mewtwo -> ./mew
+ * ```
+ * @since v0.1.31
+ */
+ export function symlink(
+ target: PathLike,
+ path: PathLike,
+ type: symlink.Type | undefined | null,
+ callback: NoParamCallback,
+ ): void;
+ /**
+ * Asynchronous symlink(2) - Create a new symbolic link to an existing file.
+ * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol.
+ * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol.
+ */
+ export function symlink(target: PathLike, path: PathLike, callback: NoParamCallback): void;
+ export namespace symlink {
+ /**
+ * Asynchronous symlink(2) - Create a new symbolic link to an existing file.
+ * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol.
+ * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol.
+ * @param type May be set to `'dir'`, `'file'`, or `'junction'` (default is `'file'`) and is only available on Windows (ignored on other platforms).
+ * When using `'junction'`, the `target` argument will automatically be normalized to an absolute path.
+ */
+ function __promisify__(target: PathLike, path: PathLike, type?: string | null): Promise<void>;
+ type Type = "dir" | "file" | "junction";
+ }
+ /**
+ * Returns `undefined`.
+ *
+ * For detailed information, see the documentation of the asynchronous version of
+ * this API: {@link symlink}.
+ * @since v0.1.31
+ */
+ export function symlinkSync(target: PathLike, path: PathLike, type?: symlink.Type | null): void;
+ /**
+ * Reads the contents of the symbolic link referred to by `path`. The callback gets
+ * two arguments `(err, linkString)`.
+ *
+ * See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more details.
+ *
+ * The optional `options` argument can be a string specifying an encoding, or an
+ * object with an `encoding` property specifying the character encoding to use for
+ * the link path passed to the callback. If the `encoding` is set to `'buffer'`,
+ * the link path returned will be passed as a `Buffer` object.
+ * @since v0.1.31
+ */
+ export function readlink(
+ path: PathLike,
+ options: EncodingOption,
+ callback: (err: NodeJS.ErrnoException | null, linkString: string) => void,
+ ): void;
+ /**
+ * Asynchronous readlink(2) - read value of a symbolic link.
+ * @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.
+ */
+ export function readlink(
+ path: PathLike,
+ options: BufferEncodingOption,
+ callback: (err: NodeJS.ErrnoException | null, linkString: Buffer) => void,
+ ): void;
+ /**
+ * Asynchronous readlink(2) - read value of a symbolic link.
+ * @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.
+ */
+ export function readlink(
+ path: PathLike,
+ options: EncodingOption,
+ callback: (err: NodeJS.ErrnoException | null, linkString: string | Buffer) => void,
+ ): void;
+ /**
+ * Asynchronous readlink(2) - read value of a symbolic link.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ */
+ export function readlink(
+ path: PathLike,
+ callback: (err: NodeJS.ErrnoException | null, linkString: string) => void,
+ ): void;
+ export namespace readlink {
+ /**
+ * Asynchronous readlink(2) - read value of a symbolic link.
+ * @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.
+ */
+ function __promisify__(path: PathLike, options?: EncodingOption): Promise<string>;
+ /**
+ * Asynchronous readlink(2) - read value of a symbolic link.
+ * @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.
+ */
+ function __promisify__(path: PathLike, options: BufferEncodingOption): Promise<Buffer>;
+ /**
+ * Asynchronous readlink(2) - read value of a symbolic link.
+ * @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.
+ */
+ function __promisify__(path: PathLike, options?: EncodingOption): Promise<string | Buffer>;
+ }
+ /**
+ * Returns the symbolic link's string value.
+ *
+ * See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more details.
+ *
+ * The optional `options` argument can be a string specifying an encoding, or an
+ * object with an `encoding` property specifying the character encoding to use for
+ * the link path returned. If the `encoding` is set to `'buffer'`,
+ * the link path returned will be passed as a `Buffer` object.
+ * @since v0.1.31
+ */
+ export function readlinkSync(path: PathLike, options?: EncodingOption): string;
+ /**
+ * Synchronous readlink(2) - read value of a symbolic link.
+ * @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.
+ */
+ export function readlinkSync(path: PathLike, options: BufferEncodingOption): Buffer;
+ /**
+ * Synchronous readlink(2) - read value of a symbolic link.
+ * @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.
+ */
+ export function readlinkSync(path: PathLike, options?: EncodingOption): string | Buffer;
+ /**
+ * Asynchronously computes the canonical pathname by resolving `.`, `..` and
+ * symbolic links.
+ *
+ * A canonical pathname is not necessarily unique. Hard links and bind mounts can
+ * expose a file system entity through many pathnames.
+ *
+ * This function behaves like [`realpath(3)`](http://man7.org/linux/man-pages/man3/realpath.3.html), with some exceptions:
+ *
+ * 1. No case conversion is performed on case-insensitive file systems.
+ * 2. The maximum number of symbolic links is platform-independent and generally
+ * (much) higher than what the native [`realpath(3)`](http://man7.org/linux/man-pages/man3/realpath.3.html) implementation supports.
+ *
+ * The `callback` gets two arguments `(err, resolvedPath)`. May use `process.cwd`to resolve relative paths.
+ *
+ * Only paths that can be converted to UTF8 strings are supported.
+ *
+ * The optional `options` argument can be a string specifying an encoding, or an
+ * object with an `encoding` property specifying the character encoding to use for
+ * the path passed to the callback. If the `encoding` is set to `'buffer'`,
+ * the path returned will be passed as a `Buffer` object.
+ *
+ * If `path` resolves to a socket or a pipe, the function will return a system
+ * dependent name for that object.
+ * @since v0.1.31
+ */
+ export function realpath(
+ path: PathLike,
+ options: EncodingOption,
+ callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void,
+ ): void;
+ /**
+ * Asynchronous realpath(3) - return the canonicalized absolute pathname.
+ * @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.
+ */
+ export function realpath(
+ path: PathLike,
+ options: BufferEncodingOption,
+ callback: (err: NodeJS.ErrnoException | null, resolvedPath: Buffer) => void,
+ ): void;
+ /**
+ * Asynchronous realpath(3) - return the canonicalized absolute pathname.
+ * @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.
+ */
+ export function realpath(
+ path: PathLike,
+ options: EncodingOption,
+ callback: (err: NodeJS.ErrnoException | null, resolvedPath: string | Buffer) => void,
+ ): void;
+ /**
+ * Asynchronous realpath(3) - return the canonicalized absolute pathname.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ */
+ export function realpath(
+ path: PathLike,
+ callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void,
+ ): void;
+ export namespace realpath {
+ /**
+ * Asynchronous realpath(3) - return the canonicalized absolute pathname.
+ * @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.
+ */
+ function __promisify__(path: PathLike, options?: EncodingOption): Promise<string>;
+ /**
+ * Asynchronous realpath(3) - return the canonicalized absolute pathname.
+ * @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.
+ */
+ function __promisify__(path: PathLike, options: BufferEncodingOption): Promise<Buffer>;
+ /**
+ * Asynchronous realpath(3) - return the canonicalized absolute pathname.
+ * @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.
+ */
+ function __promisify__(path: PathLike, options?: EncodingOption): Promise<string | Buffer>;
+ /**
+ * Asynchronous [`realpath(3)`](http://man7.org/linux/man-pages/man3/realpath.3.html).
+ *
+ * The `callback` gets two arguments `(err, resolvedPath)`.
+ *
+ * Only paths that can be converted to UTF8 strings are supported.
+ *
+ * The optional `options` argument can be a string specifying an encoding, or an
+ * object with an `encoding` property specifying the character encoding to use for
+ * the path passed to the callback. If the `encoding` is set to `'buffer'`,
+ * the path returned will be passed as a `Buffer` object.
+ *
+ * On Linux, when Node.js is linked against musl libc, the procfs file system must
+ * be mounted on `/proc` in order for this function to work. Glibc does not have
+ * this restriction.
+ * @since v9.2.0
+ */
+ function native(
+ path: PathLike,
+ options: EncodingOption,
+ callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void,
+ ): void;
+ function native(
+ path: PathLike,
+ options: BufferEncodingOption,
+ callback: (err: NodeJS.ErrnoException | null, resolvedPath: Buffer) => void,
+ ): void;
+ function native(
+ path: PathLike,
+ options: EncodingOption,
+ callback: (err: NodeJS.ErrnoException | null, resolvedPath: string | Buffer) => void,
+ ): void;
+ function native(
+ path: PathLike,
+ callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void,
+ ): void;
+ }
+ /**
+ * Returns the resolved pathname.
+ *
+ * For detailed information, see the documentation of the asynchronous version of
+ * this API: {@link realpath}.
+ * @since v0.1.31
+ */
+ export function realpathSync(path: PathLike, options?: EncodingOption): string;
+ /**
+ * Synchronous realpath(3) - return the canonicalized absolute pathname.
+ * @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.
+ */
+ export function realpathSync(path: PathLike, options: BufferEncodingOption): Buffer;
+ /**
+ * Synchronous realpath(3) - return the canonicalized absolute pathname.
+ * @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.
+ */
+ export function realpathSync(path: PathLike, options?: EncodingOption): string | Buffer;
+ export namespace realpathSync {
+ function native(path: PathLike, options?: EncodingOption): string;
+ function native(path: PathLike, options: BufferEncodingOption): Buffer;
+ function native(path: PathLike, options?: EncodingOption): string | Buffer;
+ }
+ /**
+ * Asynchronously removes a file or symbolic link. No arguments other than a
+ * possible exception are given to the completion callback.
+ *
+ * ```js
+ * import { unlink } from 'fs';
+ * // Assuming that 'path/file.txt' is a regular file.
+ * unlink('path/file.txt', (err) => {
+ * if (err) throw err;
+ * console.log('path/file.txt was deleted');
+ * });
+ * ```
+ *
+ * `fs.unlink()` will not work on a directory, empty or otherwise. To remove a
+ * directory, use {@link rmdir}.
+ *
+ * See the POSIX [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html) documentation for more details.
+ * @since v0.0.2
+ */
+ export function unlink(path: PathLike, callback: NoParamCallback): void;
+ export namespace unlink {
+ /**
+ * Asynchronous unlink(2) - delete a name and possibly the file it refers to.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ */
+ function __promisify__(path: PathLike): Promise<void>;
+ }
+ /**
+ * Synchronous [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html). Returns `undefined`.
+ * @since v0.1.21
+ */
+ export function unlinkSync(path: PathLike): void;
+ export interface RmDirOptions {
+ /**
+ * If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or
+ * `EPERM` error is encountered, Node.js will retry the operation with a linear
+ * backoff wait of `retryDelay` ms longer on each try. This option represents the
+ * number of retries. This option is ignored if the `recursive` option is not
+ * `true`.
+ * @default 0
+ */
+ maxRetries?: number | undefined;
+ /**
+ * @deprecated since v14.14.0 In future versions of Node.js and will trigger a warning
+ * `fs.rmdir(path, { recursive: true })` will throw if `path` does not exist or is a file.
+ * Use `fs.rm(path, { recursive: true, force: true })` instead.
+ *
+ * If `true`, perform a recursive directory removal. In
+ * recursive mode, operations are retried on failure.
+ * @default false
+ */
+ recursive?: boolean | undefined;
+ /**
+ * The amount of time in milliseconds to wait between retries.
+ * This option is ignored if the `recursive` option is not `true`.
+ * @default 100
+ */
+ retryDelay?: number | undefined;
+ }
+ /**
+ * Asynchronous [`rmdir(2)`](http://man7.org/linux/man-pages/man2/rmdir.2.html). No arguments other than a possible exception are given
+ * to the completion callback.
+ *
+ * Using `fs.rmdir()` on a file (not a directory) results in an `ENOENT` error on
+ * Windows and an `ENOTDIR` error on POSIX.
+ *
+ * To get a behavior similar to the `rm -rf` Unix command, use {@link rm} with options `{ recursive: true, force: true }`.
+ * @since v0.0.2
+ */
+ export function rmdir(path: PathLike, callback: NoParamCallback): void;
+ export function rmdir(path: PathLike, options: RmDirOptions, callback: NoParamCallback): void;
+ export namespace rmdir {
+ /**
+ * Asynchronous rmdir(2) - delete a directory.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ */
+ function __promisify__(path: PathLike, options?: RmDirOptions): Promise<void>;
+ }
+ /**
+ * Synchronous [`rmdir(2)`](http://man7.org/linux/man-pages/man2/rmdir.2.html). Returns `undefined`.
+ *
+ * Using `fs.rmdirSync()` on a file (not a directory) results in an `ENOENT` error
+ * on Windows and an `ENOTDIR` error on POSIX.
+ *
+ * To get a behavior similar to the `rm -rf` Unix command, use {@link rmSync} with options `{ recursive: true, force: true }`.
+ * @since v0.1.21
+ */
+ export function rmdirSync(path: PathLike, options?: RmDirOptions): void;
+ export interface RmOptions {
+ /**
+ * When `true`, exceptions will be ignored if `path` does not exist.
+ * @default false
+ */
+ force?: boolean | undefined;
+ /**
+ * If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or
+ * `EPERM` error is encountered, Node.js will retry the operation with a linear
+ * backoff wait of `retryDelay` ms longer on each try. This option represents the
+ * number of retries. This option is ignored if the `recursive` option is not
+ * `true`.
+ * @default 0
+ */
+ maxRetries?: number | undefined;
+ /**
+ * If `true`, perform a recursive directory removal. In
+ * recursive mode, operations are retried on failure.
+ * @default false
+ */
+ recursive?: boolean | undefined;
+ /**
+ * The amount of time in milliseconds to wait between retries.
+ * This option is ignored if the `recursive` option is not `true`.
+ * @default 100
+ */
+ retryDelay?: number | undefined;
+ }
+ /**
+ * Asynchronously removes files and directories (modeled on the standard POSIX `rm`utility). No arguments other than a possible exception are given to the
+ * completion callback.
+ * @since v14.14.0
+ */
+ export function rm(path: PathLike, callback: NoParamCallback): void;
+ export function rm(path: PathLike, options: RmOptions, callback: NoParamCallback): void;
+ export namespace rm {
+ /**
+ * Asynchronously removes files and directories (modeled on the standard POSIX `rm` utility).
+ */
+ function __promisify__(path: PathLike, options?: RmOptions): Promise<void>;
+ }
+ /**
+ * Synchronously removes files and directories (modeled on the standard POSIX `rm`utility). Returns `undefined`.
+ * @since v14.14.0
+ */
+ export function rmSync(path: PathLike, options?: RmOptions): void;
+ export interface MakeDirectoryOptions {
+ /**
+ * Indicates whether parent folders should be created.
+ * If a folder was created, the path to the first created folder will be returned.
+ * @default false
+ */
+ recursive?: boolean | undefined;
+ /**
+ * A file mode. If a string is passed, it is parsed as an octal integer. If not specified
+ * @default 0o777
+ */
+ mode?: Mode | undefined;
+ }
+ /**
+ * Asynchronously creates a directory.
+ *
+ * The callback is given a possible exception and, if `recursive` is `true`, the
+ * first directory path created, `(err[, path])`.`path` can still be `undefined` when `recursive` is `true`, if no directory was
+ * created.
+ *
+ * The optional `options` argument can be an integer specifying `mode` (permission
+ * and sticky bits), or an object with a `mode` property and a `recursive`property indicating whether parent directories should be created. Calling`fs.mkdir()` when `path` is a directory that
+ * exists results in an error only
+ * when `recursive` is false.
+ *
+ * ```js
+ * import { mkdir } from 'fs';
+ *
+ * // Creates /tmp/a/apple, regardless of whether `/tmp` and /tmp/a exist.
+ * mkdir('/tmp/a/apple', { recursive: true }, (err) => {
+ * if (err) throw err;
+ * });
+ * ```
+ *
+ * On Windows, using `fs.mkdir()` on the root directory even with recursion will
+ * result in an error:
+ *
+ * ```js
+ * import { mkdir } from 'fs';
+ *
+ * mkdir('/', { recursive: true }, (err) => {
+ * // => [Error: EPERM: operation not permitted, mkdir 'C:\']
+ * });
+ * ```
+ *
+ * See the POSIX [`mkdir(2)`](http://man7.org/linux/man-pages/man2/mkdir.2.html) documentation for more details.
+ * @since v0.1.8
+ */
+ export function mkdir(
+ path: PathLike,
+ options: MakeDirectoryOptions & {
+ recursive: true;
+ },
+ callback: (err: NodeJS.ErrnoException | null, path?: string) => void,
+ ): void;
+ /**
+ * Asynchronous mkdir(2) - create a directory.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
+ * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
+ */
+ export function mkdir(
+ path: PathLike,
+ options:
+ | Mode
+ | (MakeDirectoryOptions & {
+ recursive?: false | undefined;
+ })
+ | null
+ | undefined,
+ callback: NoParamCallback,
+ ): void;
+ /**
+ * Asynchronous mkdir(2) - create a directory.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
+ * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
+ */
+ export function mkdir(
+ path: PathLike,
+ options: Mode | MakeDirectoryOptions | null | undefined,
+ callback: (err: NodeJS.ErrnoException | null, path?: string) => void,
+ ): void;
+ /**
+ * Asynchronous mkdir(2) - create a directory with a mode of `0o777`.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ */
+ export function mkdir(path: PathLike, callback: NoParamCallback): void;
+ export namespace mkdir {
+ /**
+ * Asynchronous mkdir(2) - create a directory.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
+ * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
+ */
+ function __promisify__(
+ path: PathLike,
+ options: MakeDirectoryOptions & {
+ recursive: true;
+ },
+ ): Promise<string | undefined>;
+ /**
+ * Asynchronous mkdir(2) - create a directory.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
+ * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
+ */
+ function __promisify__(
+ path: PathLike,
+ options?:
+ | Mode
+ | (MakeDirectoryOptions & {
+ recursive?: false | undefined;
+ })
+ | null,
+ ): Promise<void>;
+ /**
+ * Asynchronous mkdir(2) - create a directory.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
+ * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
+ */
+ function __promisify__(
+ path: PathLike,
+ options?: Mode | MakeDirectoryOptions | null,
+ ): Promise<string | undefined>;
+ }
+ /**
+ * Synchronously creates a directory. Returns `undefined`, or if `recursive` is`true`, the first directory path created.
+ * This is the synchronous version of {@link mkdir}.
+ *
+ * See the POSIX [`mkdir(2)`](http://man7.org/linux/man-pages/man2/mkdir.2.html) documentation for more details.
+ * @since v0.1.21
+ */
+ export function mkdirSync(
+ path: PathLike,
+ options: MakeDirectoryOptions & {
+ recursive: true;
+ },
+ ): string | undefined;
+ /**
+ * Synchronous mkdir(2) - create a directory.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
+ * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
+ */
+ export function mkdirSync(
+ path: PathLike,
+ options?:
+ | Mode
+ | (MakeDirectoryOptions & {
+ recursive?: false | undefined;
+ })
+ | null,
+ ): void;
+ /**
+ * Synchronous mkdir(2) - create a directory.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
+ * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
+ */
+ export function mkdirSync(path: PathLike, options?: Mode | MakeDirectoryOptions | null): string | undefined;
+ /**
+ * Creates a unique temporary directory.
+ *
+ * Generates six random characters to be appended behind a required`prefix` to create a unique temporary directory. Due to platform
+ * inconsistencies, avoid trailing `X` characters in `prefix`. Some platforms,
+ * notably the BSDs, can return more than six random characters, and replace
+ * trailing `X` characters in `prefix` with random characters.
+ *
+ * The created directory path is passed as a string to the callback's second
+ * parameter.
+ *
+ * The optional `options` argument can be a string specifying an encoding, or an
+ * object with an `encoding` property specifying the character encoding to use.
+ *
+ * ```js
+ * import { mkdtemp } from 'fs';
+ *
+ * mkdtemp(path.join(os.tmpdir(), 'foo-'), (err, directory) => {
+ * if (err) throw err;
+ * console.log(directory);
+ * // Prints: /tmp/foo-itXde2 or C:\Users\...\AppData\Local\Temp\foo-itXde2
+ * });
+ * ```
+ *
+ * The `fs.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 platform-specific path separator
+ * (`require('path').sep`).
+ *
+ * ```js
+ * import { tmpdir } from 'os';
+ * import { mkdtemp } from 'fs';
+ *
+ * // The parent directory for the new temporary directory
+ * const tmpDir = tmpdir();
+ *
+ * // This method is *INCORRECT*:
+ * mkdtemp(tmpDir, (err, directory) => {
+ * if (err) throw err;
+ * console.log(directory);
+ * // Will print something similar to `/tmpabc123`.
+ * // A new temporary directory is created at the file system root
+ * // rather than *within* the /tmp directory.
+ * });
+ *
+ * // This method is *CORRECT*:
+ * import { sep } from 'path';
+ * mkdtemp(`${tmpDir}${sep}`, (err, directory) => {
+ * if (err) throw err;
+ * console.log(directory);
+ * // Will print something similar to `/tmp/abc123`.
+ * // A new temporary directory is created within
+ * // the /tmp directory.
+ * });
+ * ```
+ * @since v5.10.0
+ */
+ export function mkdtemp(
+ prefix: string,
+ options: EncodingOption,
+ callback: (err: NodeJS.ErrnoException | null, folder: string) => void,
+ ): void;
+ /**
+ * Asynchronously creates a unique temporary directory.
+ * Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
+ * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+ */
+ export function mkdtemp(
+ prefix: string,
+ options:
+ | "buffer"
+ | {
+ encoding: "buffer";
+ },
+ callback: (err: NodeJS.ErrnoException | null, folder: Buffer) => void,
+ ): void;
+ /**
+ * Asynchronously creates a unique temporary directory.
+ * Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
+ * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+ */
+ export function mkdtemp(
+ prefix: string,
+ options: EncodingOption,
+ callback: (err: NodeJS.ErrnoException | null, folder: string | Buffer) => void,
+ ): void;
+ /**
+ * Asynchronously creates a unique temporary directory.
+ * Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
+ */
+ export function mkdtemp(
+ prefix: string,
+ callback: (err: NodeJS.ErrnoException | null, folder: string) => void,
+ ): void;
+ export namespace mkdtemp {
+ /**
+ * Asynchronously creates a unique temporary directory.
+ * Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
+ * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+ */
+ function __promisify__(prefix: string, options?: EncodingOption): Promise<string>;
+ /**
+ * Asynchronously creates a unique temporary directory.
+ * Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
+ * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+ */
+ function __promisify__(prefix: string, options: BufferEncodingOption): Promise<Buffer>;
+ /**
+ * Asynchronously creates a unique temporary directory.
+ * Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
+ * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+ */
+ function __promisify__(prefix: string, options?: EncodingOption): Promise<string | Buffer>;
+ }
+ /**
+ * Returns the created directory path.
+ *
+ * For detailed information, see the documentation of the asynchronous version of
+ * this API: {@link mkdtemp}.
+ *
+ * The optional `options` argument can be a string specifying an encoding, or an
+ * object with an `encoding` property specifying the character encoding to use.
+ * @since v5.10.0
+ */
+ export function mkdtempSync(prefix: string, options?: EncodingOption): string;
+ /**
+ * Synchronously creates a unique temporary directory.
+ * Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
+ * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+ */
+ export function mkdtempSync(prefix: string, options: BufferEncodingOption): Buffer;
+ /**
+ * Synchronously creates a unique temporary directory.
+ * Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
+ * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+ */
+ export function mkdtempSync(prefix: string, options?: EncodingOption): string | Buffer;
+ /**
+ * Reads the contents of a directory. The callback gets two arguments `(err, files)`where `files` is an array of the names of the files in the directory excluding`'.'` and `'..'`.
+ *
+ * See the POSIX [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) documentation for more details.
+ *
+ * The optional `options` argument can be a string specifying an encoding, or an
+ * object with an `encoding` property specifying the character encoding to use for
+ * the filenames passed to the callback. If the `encoding` is set to `'buffer'`,
+ * the filenames returned will be passed as `Buffer` objects.
+ *
+ * If `options.withFileTypes` is set to `true`, the `files` array will contain `fs.Dirent` objects.
+ * @since v0.1.8
+ */
+ export function readdir(
+ path: PathLike,
+ options:
+ | {
+ encoding: BufferEncoding | null;
+ withFileTypes?: false | undefined;
+ recursive?: boolean | undefined;
+ }
+ | BufferEncoding
+ | undefined
+ | null,
+ callback: (err: NodeJS.ErrnoException | null, files: string[]) => void,
+ ): void;
+ /**
+ * Asynchronous readdir(3) - read a directory.
+ * @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.
+ */
+ export function readdir(
+ path: PathLike,
+ options:
+ | {
+ encoding: "buffer";
+ withFileTypes?: false | undefined;
+ recursive?: boolean | undefined;
+ }
+ | "buffer",
+ callback: (err: NodeJS.ErrnoException | null, files: Buffer[]) => void,
+ ): void;
+ /**
+ * Asynchronous readdir(3) - read a directory.
+ * @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.
+ */
+ export function readdir(
+ path: PathLike,
+ options:
+ | (ObjectEncodingOptions & {
+ withFileTypes?: false | undefined;
+ recursive?: boolean | undefined;
+ })
+ | BufferEncoding
+ | undefined
+ | null,
+ callback: (err: NodeJS.ErrnoException | null, files: string[] | Buffer[]) => void,
+ ): void;
+ /**
+ * Asynchronous readdir(3) - read a directory.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ */
+ export function readdir(
+ path: PathLike,
+ callback: (err: NodeJS.ErrnoException | null, files: string[]) => void,
+ ): void;
+ /**
+ * Asynchronous readdir(3) - read a directory.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * @param options If called with `withFileTypes: true` the result data will be an array of Dirent.
+ */
+ export function readdir(
+ path: PathLike,
+ options: ObjectEncodingOptions & {
+ withFileTypes: true;
+ recursive?: boolean | undefined;
+ },
+ callback: (err: NodeJS.ErrnoException | null, files: Dirent[]) => void,
+ ): void;
+ export namespace readdir {
+ /**
+ * Asynchronous readdir(3) - read a directory.
+ * @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.
+ */
+ function __promisify__(
+ path: PathLike,
+ options?:
+ | {
+ encoding: BufferEncoding | null;
+ withFileTypes?: false | undefined;
+ recursive?: boolean | undefined;
+ }
+ | BufferEncoding
+ | null,
+ ): Promise<string[]>;
+ /**
+ * Asynchronous readdir(3) - read a directory.
+ * @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.
+ */
+ function __promisify__(
+ path: PathLike,
+ options:
+ | "buffer"
+ | {
+ encoding: "buffer";
+ withFileTypes?: false | undefined;
+ recursive?: boolean | undefined;
+ },
+ ): Promise<Buffer[]>;
+ /**
+ * Asynchronous readdir(3) - read a directory.
+ * @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.
+ */
+ function __promisify__(
+ path: PathLike,
+ options?:
+ | (ObjectEncodingOptions & {
+ withFileTypes?: false | undefined;
+ recursive?: boolean | undefined;
+ })
+ | BufferEncoding
+ | null,
+ ): Promise<string[] | Buffer[]>;
+ /**
+ * Asynchronous readdir(3) - read a directory.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * @param options If called with `withFileTypes: true` the result data will be an array of Dirent
+ */
+ function __promisify__(
+ path: PathLike,
+ options: ObjectEncodingOptions & {
+ withFileTypes: true;
+ recursive?: boolean | undefined;
+ },
+ ): Promise<Dirent[]>;
+ }
+ /**
+ * Reads the contents of the directory.
+ *
+ * See the POSIX [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) documentation for more details.
+ *
+ * The optional `options` argument can be a string specifying an encoding, or an
+ * object with an `encoding` property specifying the character encoding to use for
+ * the filenames returned. If the `encoding` is set to `'buffer'`,
+ * the filenames returned will be passed as `Buffer` objects.
+ *
+ * If `options.withFileTypes` is set to `true`, the result will contain `fs.Dirent` objects.
+ * @since v0.1.21
+ */
+ export function readdirSync(
+ path: PathLike,
+ options?:
+ | {
+ encoding: BufferEncoding | null;
+ withFileTypes?: false | undefined;
+ recursive?: boolean | undefined;
+ }
+ | BufferEncoding
+ | null,
+ ): string[];
+ /**
+ * Synchronous readdir(3) - read a directory.
+ * @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.
+ */
+ export function readdirSync(
+ path: PathLike,
+ options:
+ | {
+ encoding: "buffer";
+ withFileTypes?: false | undefined;
+ recursive?: boolean | undefined;
+ }
+ | "buffer",
+ ): Buffer[];
+ /**
+ * Synchronous readdir(3) - read a directory.
+ * @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.
+ */
+ export function readdirSync(
+ path: PathLike,
+ options?:
+ | (ObjectEncodingOptions & {
+ withFileTypes?: false | undefined;
+ recursive?: boolean | undefined;
+ })
+ | BufferEncoding
+ | null,
+ ): string[] | Buffer[];
+ /**
+ * Synchronous readdir(3) - read a directory.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * @param options If called with `withFileTypes: true` the result data will be an array of Dirent.
+ */
+ export function readdirSync(
+ path: PathLike,
+ options: ObjectEncodingOptions & {
+ withFileTypes: true;
+ recursive?: boolean | undefined;
+ },
+ ): Dirent[];
+ /**
+ * Closes the file descriptor. No arguments other than a possible exception are
+ * given to the completion callback.
+ *
+ * Calling `fs.close()` on any file descriptor (`fd`) that is currently in use
+ * through any other `fs` operation may lead to undefined behavior.
+ *
+ * See the POSIX [`close(2)`](http://man7.org/linux/man-pages/man2/close.2.html) documentation for more detail.
+ * @since v0.0.2
+ */
+ export function close(fd: number, callback?: NoParamCallback): void;
+ export namespace close {
+ /**
+ * Asynchronous close(2) - close a file descriptor.
+ * @param fd A file descriptor.
+ */
+ function __promisify__(fd: number): Promise<void>;
+ }
+ /**
+ * Closes the file descriptor. Returns `undefined`.
+ *
+ * Calling `fs.closeSync()` on any file descriptor (`fd`) that is currently in use
+ * through any other `fs` operation may lead to undefined behavior.
+ *
+ * See the POSIX [`close(2)`](http://man7.org/linux/man-pages/man2/close.2.html) documentation for more detail.
+ * @since v0.1.21
+ */
+ export function closeSync(fd: number): void;
+ /**
+ * Asynchronous file open. See the POSIX [`open(2)`](http://man7.org/linux/man-pages/man2/open.2.html) documentation for more details.
+ *
+ * `mode` sets the file mode (permission and sticky bits), but only if the file was
+ * created. On Windows, only the write permission can be manipulated; see {@link chmod}.
+ *
+ * The callback gets two arguments `(err, fd)`.
+ *
+ * Some characters (`< > : " / \ | ? *`) are reserved under Windows as documented
+ * by [Naming Files, Paths, and Namespaces](https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file). Under NTFS, if the filename contains
+ * a colon, Node.js will open a file system stream, as described by [this MSDN page](https://docs.microsoft.com/en-us/windows/desktop/FileIO/using-streams).
+ *
+ * Functions based on `fs.open()` exhibit this behavior as well:`fs.writeFile()`, `fs.readFile()`, etc.
+ * @since v0.0.2
+ * @param [flags='r'] See `support of file system `flags``.
+ * @param [mode=0o666]
+ */
+ export function open(
+ path: PathLike,
+ flags: OpenMode | undefined,
+ mode: Mode | undefined | null,
+ callback: (err: NodeJS.ErrnoException | null, fd: number) => void,
+ ): void;
+ /**
+ * Asynchronous open(2) - open and possibly create a file. If the file is created, its mode will be `0o666`.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * @param [flags='r'] See `support of file system `flags``.
+ */
+ export function open(
+ path: PathLike,
+ flags: OpenMode | undefined,
+ callback: (err: NodeJS.ErrnoException | null, fd: number) => void,
+ ): void;
+ /**
+ * Asynchronous open(2) - open and possibly create a file. If the file is created, its mode will be `0o666`.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ */
+ export function open(path: PathLike, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void;
+
+ export namespace open {
+ /**
+ * Asynchronous open(2) - open and possibly create a file.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not supplied, defaults to `0o666`.
+ */
+ function __promisify__(path: PathLike, flags: OpenMode, mode?: Mode | null): Promise<number>;
+ }
+ /**
+ * Returns an integer representing the file descriptor.
+ *
+ * For detailed information, see the documentation of the asynchronous version of
+ * this API: {@link open}.
+ * @since v0.1.21
+ * @param [flags='r']
+ * @param [mode=0o666]
+ */
+ export function openSync(path: PathLike, flags: OpenMode, mode?: Mode | null): number;
+ /**
+ * Change the file system timestamps of the object referenced by `path`.
+ *
+ * The `atime` and `mtime` arguments follow these rules:
+ *
+ * * Values can be either numbers representing Unix epoch time in seconds,`Date`s, or a 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.
+ * @since v0.4.2
+ */
+ export function utimes(path: PathLike, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void;
+ export namespace utimes {
+ /**
+ * Asynchronously change file timestamps of the file referenced by the supplied path.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * @param atime The last access time. If a string is provided, it will be coerced to number.
+ * @param mtime The last modified time. If a string is provided, it will be coerced to number.
+ */
+ function __promisify__(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise<void>;
+ }
+ /**
+ * Returns `undefined`.
+ *
+ * For detailed information, see the documentation of the asynchronous version of
+ * this API: {@link utimes}.
+ * @since v0.4.2
+ */
+ export function utimesSync(path: PathLike, atime: TimeLike, mtime: TimeLike): void;
+ /**
+ * Change the file system timestamps of the object referenced by the supplied file
+ * descriptor. See {@link utimes}.
+ * @since v0.4.2
+ */
+ export function futimes(fd: number, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void;
+ export namespace futimes {
+ /**
+ * Asynchronously change file timestamps of the file referenced by the supplied file descriptor.
+ * @param fd A file descriptor.
+ * @param atime The last access time. If a string is provided, it will be coerced to number.
+ * @param mtime The last modified time. If a string is provided, it will be coerced to number.
+ */
+ function __promisify__(fd: number, atime: TimeLike, mtime: TimeLike): Promise<void>;
+ }
+ /**
+ * Synchronous version of {@link futimes}. Returns `undefined`.
+ * @since v0.4.2
+ */
+ export function futimesSync(fd: number, atime: TimeLike, mtime: TimeLike): void;
+ /**
+ * Request that all data for the open file descriptor is flushed to the storage
+ * 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. No arguments other
+ * than a possible exception are given to the completion callback.
+ * @since v0.1.96
+ */
+ export function fsync(fd: number, callback: NoParamCallback): void;
+ export namespace fsync {
+ /**
+ * Asynchronous fsync(2) - synchronize a file's in-core state with the underlying storage device.
+ * @param fd A file descriptor.
+ */
+ function __promisify__(fd: number): Promise<void>;
+ }
+ /**
+ * Request that all data for the open file descriptor is flushed to the storage
+ * 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. Returns `undefined`.
+ * @since v0.1.96
+ */
+ export function fsyncSync(fd: number): void;
+ /**
+ * Write `buffer` to the file specified by `fd`.
+ *
+ * `offset` determines the part of the buffer to be written, and `length` is
+ * an integer specifying the number of bytes to write.
+ *
+ * `position` refers to the offset from the beginning of the file where this data
+ * should be written. If `typeof position !== 'number'`, the data will be written
+ * at the current position. See [`pwrite(2)`](http://man7.org/linux/man-pages/man2/pwrite.2.html).
+ *
+ * The callback will be given three arguments `(err, bytesWritten, buffer)` where`bytesWritten` specifies how many _bytes_ were written from `buffer`.
+ *
+ * If this method is invoked as its `util.promisify()` ed version, it returns
+ * a promise for an `Object` with `bytesWritten` and `buffer` properties.
+ *
+ * It is unsafe to use `fs.write()` multiple times on the same file without waiting
+ * for the callback. For this scenario, {@link createWriteStream} is
+ * recommended.
+ *
+ * On Linux, positional writes don't work when the file is opened in append mode.
+ * The kernel ignores the position argument and always appends the data to
+ * the end of the file.
+ * @since v0.0.2
+ */
+ export function write<TBuffer extends NodeJS.ArrayBufferView>(
+ fd: number,
+ buffer: TBuffer,
+ offset: number | undefined | null,
+ length: number | undefined | null,
+ position: number | undefined | null,
+ callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void,
+ ): void;
+ /**
+ * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor.
+ * @param fd A file descriptor.
+ * @param offset The part of the buffer to be written. If not supplied, defaults to `0`.
+ * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`.
+ */
+ export function write<TBuffer extends NodeJS.ArrayBufferView>(
+ fd: number,
+ buffer: TBuffer,
+ offset: number | undefined | null,
+ length: number | undefined | null,
+ callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void,
+ ): void;
+ /**
+ * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor.
+ * @param fd A file descriptor.
+ * @param offset The part of the buffer to be written. If not supplied, defaults to `0`.
+ */
+ export function write<TBuffer extends NodeJS.ArrayBufferView>(
+ fd: number,
+ buffer: TBuffer,
+ offset: number | undefined | null,
+ callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void,
+ ): void;
+ /**
+ * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor.
+ * @param fd A file descriptor.
+ */
+ export function write<TBuffer extends NodeJS.ArrayBufferView>(
+ fd: number,
+ buffer: TBuffer,
+ callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void,
+ ): void;
+ /**
+ * Asynchronously writes `string` to the file referenced by the supplied file descriptor.
+ * @param fd A file descriptor.
+ * @param string A string to write.
+ * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
+ * @param encoding The expected string encoding.
+ */
+ export function write(
+ fd: number,
+ string: string,
+ position: number | undefined | null,
+ encoding: BufferEncoding | undefined | null,
+ callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void,
+ ): void;
+ /**
+ * Asynchronously writes `string` to the file referenced by the supplied file descriptor.
+ * @param fd A file descriptor.
+ * @param string A string to write.
+ * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
+ */
+ export function write(
+ fd: number,
+ string: string,
+ position: number | undefined | null,
+ callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void,
+ ): void;
+ /**
+ * Asynchronously writes `string` to the file referenced by the supplied file descriptor.
+ * @param fd A file descriptor.
+ * @param string A string to write.
+ */
+ export function write(
+ fd: number,
+ string: string,
+ callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void,
+ ): void;
+ export namespace write {
+ /**
+ * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor.
+ * @param fd A file descriptor.
+ * @param offset The part of the buffer to be written. If not supplied, defaults to `0`.
+ * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`.
+ * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
+ */
+ function __promisify__<TBuffer extends NodeJS.ArrayBufferView>(
+ fd: number,
+ buffer?: TBuffer,
+ offset?: number,
+ length?: number,
+ position?: number | null,
+ ): Promise<{
+ bytesWritten: number;
+ buffer: TBuffer;
+ }>;
+ /**
+ * Asynchronously writes `string` to the file referenced by the supplied file descriptor.
+ * @param fd A file descriptor.
+ * @param string A string to write.
+ * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
+ * @param encoding The expected string encoding.
+ */
+ function __promisify__(
+ fd: number,
+ string: string,
+ position?: number | null,
+ encoding?: BufferEncoding | null,
+ ): Promise<{
+ bytesWritten: number;
+ buffer: string;
+ }>;
+ }
+ /**
+ * For detailed information, see the documentation of the asynchronous version of
+ * this API: {@link write}.
+ * @since v0.1.21
+ * @return The number of bytes written.
+ */
+ export function writeSync(
+ fd: number,
+ buffer: NodeJS.ArrayBufferView,
+ offset?: number | null,
+ length?: number | null,
+ position?: number | null,
+ ): number;
+ /**
+ * Synchronously writes `string` to the file referenced by the supplied file descriptor, returning the number of bytes written.
+ * @param fd A file descriptor.
+ * @param string A string to write.
+ * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
+ * @param encoding The expected string encoding.
+ */
+ export function writeSync(
+ fd: number,
+ string: string,
+ position?: number | null,
+ encoding?: BufferEncoding | null,
+ ): number;
+ export type ReadPosition = number | bigint;
+ export interface ReadSyncOptions {
+ /**
+ * @default 0
+ */
+ offset?: number | undefined;
+ /**
+ * @default `length of buffer`
+ */
+ length?: number | undefined;
+ /**
+ * @default null
+ */
+ position?: ReadPosition | null | undefined;
+ }
+ export interface ReadAsyncOptions<TBuffer extends NodeJS.ArrayBufferView> extends ReadSyncOptions {
+ buffer?: TBuffer;
+ }
+ /**
+ * Read data from the file specified by `fd`.
+ *
+ * The callback is given the three arguments, `(err, bytesRead, buffer)`.
+ *
+ * If the file is not modified concurrently, the end-of-file is reached when the
+ * number of bytes read is zero.
+ *
+ * If this method is invoked as its `util.promisify()` ed version, it returns
+ * a promise for an `Object` with `bytesRead` and `buffer` properties.
+ * @since v0.0.2
+ * @param buffer The buffer that the data will be written to.
+ * @param offset The position in `buffer` to write the data to.
+ * @param length The number of bytes to read.
+ * @param position Specifies where to begin reading from in the file. If `position` is `null` or `-1 `, data will be read from the current file position, and the file position will be updated. If
+ * `position` is an integer, the file position will be unchanged.
+ */
+ export function read<TBuffer extends NodeJS.ArrayBufferView>(
+ fd: number,
+ buffer: TBuffer,
+ offset: number,
+ length: number,
+ position: ReadPosition | null,
+ callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void,
+ ): void;
+ /**
+ * Similar to the above `fs.read` function, this version takes an optional `options` object.
+ * If not otherwise specified in an `options` object,
+ * `buffer` defaults to `Buffer.alloc(16384)`,
+ * `offset` defaults to `0`,
+ * `length` defaults to `buffer.byteLength`, `- offset` as of Node 17.6.0
+ * `position` defaults to `null`
+ * @since v12.17.0, 13.11.0
+ */
+ export function read<TBuffer extends NodeJS.ArrayBufferView>(
+ fd: number,
+ options: ReadAsyncOptions<TBuffer>,
+ callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void,
+ ): void;
+ export function read(
+ fd: number,
+ callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: NodeJS.ArrayBufferView) => void,
+ ): void;
+ export namespace read {
+ /**
+ * @param fd A file descriptor.
+ * @param buffer The buffer that the data will be written to.
+ * @param offset The offset in the buffer at which to start writing.
+ * @param length The number of bytes to read.
+ * @param position The offset from the beginning of the file from which data should be read. If `null`, data will be read from the current position.
+ */
+ function __promisify__<TBuffer extends NodeJS.ArrayBufferView>(
+ fd: number,
+ buffer: TBuffer,
+ offset: number,
+ length: number,
+ position: number | null,
+ ): Promise<{
+ bytesRead: number;
+ buffer: TBuffer;
+ }>;
+ function __promisify__<TBuffer extends NodeJS.ArrayBufferView>(
+ fd: number,
+ options: ReadAsyncOptions<TBuffer>,
+ ): Promise<{
+ bytesRead: number;
+ buffer: TBuffer;
+ }>;
+ function __promisify__(fd: number): Promise<{
+ bytesRead: number;
+ buffer: NodeJS.ArrayBufferView;
+ }>;
+ }
+ /**
+ * Returns the number of `bytesRead`.
+ *
+ * For detailed information, see the documentation of the asynchronous version of
+ * this API: {@link read}.
+ * @since v0.1.21
+ */
+ export function readSync(
+ fd: number,
+ buffer: NodeJS.ArrayBufferView,
+ offset: number,
+ length: number,
+ position: ReadPosition | null,
+ ): number;
+ /**
+ * Similar to the above `fs.readSync` function, this version takes an optional `options` object.
+ * If no `options` object is specified, it will default with the above values.
+ */
+ export function readSync(fd: number, buffer: NodeJS.ArrayBufferView, opts?: ReadSyncOptions): number;
+ /**
+ * Asynchronously reads the entire contents of a file.
+ *
+ * ```js
+ * import { readFile } from 'fs';
+ *
+ * readFile('/etc/passwd', (err, data) => {
+ * if (err) throw err;
+ * console.log(data);
+ * });
+ * ```
+ *
+ * The callback is passed two arguments `(err, data)`, where `data` is the
+ * contents of the file.
+ *
+ * If no encoding is specified, then the raw buffer is returned.
+ *
+ * If `options` is a string, then it specifies the encoding:
+ *
+ * ```js
+ * import { readFile } from 'fs';
+ *
+ * readFile('/etc/passwd', 'utf8', callback);
+ * ```
+ *
+ * When the path is a directory, the behavior of `fs.readFile()` and {@link readFileSync} is platform-specific. On macOS, Linux, and Windows, an
+ * error will be returned. On FreeBSD, a representation of the directory's contents
+ * will be returned.
+ *
+ * ```js
+ * import { readFile } from 'fs';
+ *
+ * // macOS, Linux, and Windows
+ * readFile('<directory>', (err, data) => {
+ * // => [Error: EISDIR: illegal operation on a directory, read <directory>]
+ * });
+ *
+ * // FreeBSD
+ * readFile('<directory>', (err, data) => {
+ * // => null, <data>
+ * });
+ * ```
+ *
+ * It is possible to abort an ongoing request using an `AbortSignal`. If a
+ * request is aborted the callback is called with an `AbortError`:
+ *
+ * ```js
+ * import { readFile } from 'fs';
+ *
+ * const controller = new AbortController();
+ * const signal = controller.signal;
+ * readFile(fileInfo[0].name, { signal }, (err, buf) => {
+ * // ...
+ * });
+ * // When you want to abort the request
+ * controller.abort();
+ * ```
+ *
+ * The `fs.readFile()` function buffers the entire file. To minimize memory costs,
+ * when possible prefer streaming via `fs.createReadStream()`.
+ *
+ * Aborting an ongoing request does not abort individual operating
+ * system requests but rather the internal buffering `fs.readFile` performs.
+ * @since v0.1.29
+ * @param path filename or file descriptor
+ */
+ export function readFile(
+ path: PathOrFileDescriptor,
+ options:
+ | ({
+ encoding?: null | undefined;
+ flag?: string | undefined;
+ } & Abortable)
+ | undefined
+ | null,
+ callback: (err: NodeJS.ErrnoException | null, data: Buffer) => void,
+ ): void;
+ /**
+ * Asynchronously reads the entire contents of a file.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
+ * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag.
+ * If a flag is not provided, it defaults to `'r'`.
+ */
+ export function readFile(
+ path: PathOrFileDescriptor,
+ options:
+ | ({
+ encoding: BufferEncoding;
+ flag?: string | undefined;
+ } & Abortable)
+ | BufferEncoding,
+ callback: (err: NodeJS.ErrnoException | null, data: string) => void,
+ ): void;
+ /**
+ * Asynchronously reads the entire contents of a file.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
+ * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag.
+ * If a flag is not provided, it defaults to `'r'`.
+ */
+ export function readFile(
+ path: PathOrFileDescriptor,
+ options:
+ | (ObjectEncodingOptions & {
+ flag?: string | undefined;
+ } & Abortable)
+ | BufferEncoding
+ | undefined
+ | null,
+ callback: (err: NodeJS.ErrnoException | null, data: string | Buffer) => void,
+ ): void;
+ /**
+ * Asynchronously reads the entire contents of a file.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
+ */
+ export function readFile(
+ path: PathOrFileDescriptor,
+ callback: (err: NodeJS.ErrnoException | null, data: Buffer) => void,
+ ): void;
+ export namespace readFile {
+ /**
+ * Asynchronously reads the entire contents of a file.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
+ * @param options An object that may contain an optional flag.
+ * If a flag is not provided, it defaults to `'r'`.
+ */
+ function __promisify__(
+ path: PathOrFileDescriptor,
+ options?: {
+ encoding?: null | undefined;
+ flag?: string | undefined;
+ } | null,
+ ): Promise<Buffer>;
+ /**
+ * Asynchronously reads the entire contents of a file.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * URL support is _experimental_.
+ * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
+ * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag.
+ * If a flag is not provided, it defaults to `'r'`.
+ */
+ function __promisify__(
+ path: PathOrFileDescriptor,
+ options:
+ | {
+ encoding: BufferEncoding;
+ flag?: string | undefined;
+ }
+ | BufferEncoding,
+ ): Promise<string>;
+ /**
+ * Asynchronously reads the entire contents of a file.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * URL support is _experimental_.
+ * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
+ * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag.
+ * If a flag is not provided, it defaults to `'r'`.
+ */
+ function __promisify__(
+ path: PathOrFileDescriptor,
+ options?:
+ | (ObjectEncodingOptions & {
+ flag?: string | undefined;
+ })
+ | BufferEncoding
+ | null,
+ ): Promise<string | Buffer>;
+ }
+ /**
+ * Returns the contents of the `path`.
+ *
+ * For detailed information, see the documentation of the asynchronous version of
+ * this API: {@link readFile}.
+ *
+ * If the `encoding` option is specified then this function returns a
+ * string. Otherwise it returns a buffer.
+ *
+ * Similar to {@link readFile}, when the path is a directory, the behavior of`fs.readFileSync()` is platform-specific.
+ *
+ * ```js
+ * import { readFileSync } from 'fs';
+ *
+ * // macOS, Linux, and Windows
+ * readFileSync('<directory>');
+ * // => [Error: EISDIR: illegal operation on a directory, read <directory>]
+ *
+ * // FreeBSD
+ * readFileSync('<directory>'); // => <data>
+ * ```
+ * @since v0.1.8
+ * @param path filename or file descriptor
+ */
+ export function readFileSync(
+ path: PathOrFileDescriptor,
+ options?: {
+ encoding?: null | undefined;
+ flag?: string | undefined;
+ } | null,
+ ): Buffer;
+ /**
+ * Synchronously reads the entire contents of a file.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
+ * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag.
+ * If a flag is not provided, it defaults to `'r'`.
+ */
+ export function readFileSync(
+ path: PathOrFileDescriptor,
+ options:
+ | {
+ encoding: BufferEncoding;
+ flag?: string | undefined;
+ }
+ | BufferEncoding,
+ ): string;
+ /**
+ * Synchronously reads the entire contents of a file.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
+ * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag.
+ * If a flag is not provided, it defaults to `'r'`.
+ */
+ export function readFileSync(
+ path: PathOrFileDescriptor,
+ options?:
+ | (ObjectEncodingOptions & {
+ flag?: string | undefined;
+ })
+ | BufferEncoding
+ | null,
+ ): string | Buffer;
+ export type WriteFileOptions =
+ | (
+ & ObjectEncodingOptions
+ & Abortable
+ & {
+ mode?: Mode | undefined;
+ flag?: string | undefined;
+ }
+ )
+ | BufferEncoding
+ | null;
+ /**
+ * When `file` is a filename, asynchronously writes data to the file, replacing the
+ * file if it already exists. `data` can be a string or a buffer.
+ *
+ * When `file` is a file descriptor, the behavior is similar to calling`fs.write()` directly (which is recommended). See the notes below on using
+ * a file descriptor.
+ *
+ * The `encoding` option is ignored if `data` is a buffer.
+ *
+ * The `mode` option only affects the newly created file. See {@link open} for more details.
+ *
+ * ```js
+ * import { writeFile } from 'fs';
+ * import { Buffer } from 'buffer';
+ *
+ * const data = new Uint8Array(Buffer.from('Hello Node.js'));
+ * writeFile('message.txt', data, (err) => {
+ * if (err) throw err;
+ * console.log('The file has been saved!');
+ * });
+ * ```
+ *
+ * If `options` is a string, then it specifies the encoding:
+ *
+ * ```js
+ * import { writeFile } from 'fs';
+ *
+ * writeFile('message.txt', 'Hello Node.js', 'utf8', callback);
+ * ```
+ *
+ * It is unsafe to use `fs.writeFile()` multiple times on the same file without
+ * waiting for the callback. For this scenario, {@link createWriteStream} is
+ * recommended.
+ *
+ * Similarly to `fs.readFile` \- `fs.writeFile` is a convenience method that
+ * performs multiple `write` calls internally to write the buffer passed to it.
+ * For performance sensitive code consider using {@link createWriteStream}.
+ *
+ * It is possible to use an `AbortSignal` to cancel an `fs.writeFile()`.
+ * Cancelation is "best effort", and some amount of data is likely still
+ * to be written.
+ *
+ * ```js
+ * import { writeFile } from 'fs';
+ * import { Buffer } from 'buffer';
+ *
+ * const controller = new AbortController();
+ * const { signal } = controller;
+ * const data = new Uint8Array(Buffer.from('Hello Node.js'));
+ * writeFile('message.txt', data, { signal }, (err) => {
+ * // When a request is aborted - the callback is called with an AbortError
+ * });
+ * // When the request should be aborted
+ * controller.abort();
+ * ```
+ *
+ * Aborting an ongoing request does not abort individual operating
+ * system requests but rather the internal buffering `fs.writeFile` performs.
+ * @since v0.1.29
+ * @param file filename or file descriptor
+ */
+ export function writeFile(
+ file: PathOrFileDescriptor,
+ data: string | NodeJS.ArrayBufferView,
+ options: WriteFileOptions,
+ callback: NoParamCallback,
+ ): void;
+ /**
+ * Asynchronously writes data to a file, replacing the file if it already exists.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
+ * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string.
+ */
+ export function writeFile(
+ path: PathOrFileDescriptor,
+ data: string | NodeJS.ArrayBufferView,
+ callback: NoParamCallback,
+ ): void;
+ export namespace writeFile {
+ /**
+ * Asynchronously writes data to a file, replacing the file if it already exists.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * URL support is _experimental_.
+ * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
+ * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string.
+ * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag.
+ * If `encoding` is not supplied, the default of `'utf8'` is used.
+ * If `mode` is not supplied, the default of `0o666` is used.
+ * If `mode` is a string, it is parsed as an octal integer.
+ * If `flag` is not supplied, the default of `'w'` is used.
+ */
+ function __promisify__(
+ path: PathOrFileDescriptor,
+ data: string | NodeJS.ArrayBufferView,
+ options?: WriteFileOptions,
+ ): Promise<void>;
+ }
+ /**
+ * Returns `undefined`.
+ *
+ * The `mode` option only affects the newly created file. See {@link open} for more details.
+ *
+ * For detailed information, see the documentation of the asynchronous version of
+ * this API: {@link writeFile}.
+ * @since v0.1.29
+ * @param file filename or file descriptor
+ */
+ export function writeFileSync(
+ file: PathOrFileDescriptor,
+ data: string | NodeJS.ArrayBufferView,
+ options?: WriteFileOptions,
+ ): void;
+ /**
+ * Asynchronously append data to a file, creating the file if it does not yet
+ * exist. `data` can be a string or a `Buffer`.
+ *
+ * The `mode` option only affects the newly created file. See {@link open} for more details.
+ *
+ * ```js
+ * import { appendFile } from 'fs';
+ *
+ * appendFile('message.txt', 'data to append', (err) => {
+ * if (err) throw err;
+ * console.log('The "data to append" was appended to file!');
+ * });
+ * ```
+ *
+ * If `options` is a string, then it specifies the encoding:
+ *
+ * ```js
+ * import { appendFile } from 'fs';
+ *
+ * appendFile('message.txt', 'data to append', 'utf8', callback);
+ * ```
+ *
+ * The `path` may be specified as a numeric file descriptor that has been opened
+ * for appending (using `fs.open()` or `fs.openSync()`). The file descriptor will
+ * not be closed automatically.
+ *
+ * ```js
+ * import { open, close, appendFile } from 'fs';
+ *
+ * function closeFd(fd) {
+ * close(fd, (err) => {
+ * if (err) throw err;
+ * });
+ * }
+ *
+ * open('message.txt', 'a', (err, fd) => {
+ * if (err) throw err;
+ *
+ * try {
+ * appendFile(fd, 'data to append', 'utf8', (err) => {
+ * closeFd(fd);
+ * if (err) throw err;
+ * });
+ * } catch (err) {
+ * closeFd(fd);
+ * throw err;
+ * }
+ * });
+ * ```
+ * @since v0.6.7
+ * @param path filename or file descriptor
+ */
+ export function appendFile(
+ path: PathOrFileDescriptor,
+ data: string | Uint8Array,
+ options: WriteFileOptions,
+ callback: NoParamCallback,
+ ): void;
+ /**
+ * Asynchronously append data to a file, creating the file if it does not exist.
+ * @param file A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
+ * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string.
+ */
+ export function appendFile(file: PathOrFileDescriptor, data: string | Uint8Array, callback: NoParamCallback): void;
+ export namespace appendFile {
+ /**
+ * Asynchronously append data to a file, creating the file if it does not exist.
+ * @param file A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * URL support is _experimental_.
+ * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
+ * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string.
+ * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag.
+ * If `encoding` is not supplied, the default of `'utf8'` is used.
+ * If `mode` is not supplied, the default of `0o666` is used.
+ * If `mode` is a string, it is parsed as an octal integer.
+ * If `flag` is not supplied, the default of `'a'` is used.
+ */
+ function __promisify__(
+ file: PathOrFileDescriptor,
+ data: string | Uint8Array,
+ options?: WriteFileOptions,
+ ): Promise<void>;
+ }
+ /**
+ * Synchronously append data to a file, creating the file if it does not yet
+ * exist. `data` can be a string or a `Buffer`.
+ *
+ * The `mode` option only affects the newly created file. See {@link open} for more details.
+ *
+ * ```js
+ * import { appendFileSync } from 'fs';
+ *
+ * try {
+ * appendFileSync('message.txt', 'data to append');
+ * console.log('The "data to append" was appended to file!');
+ * } catch (err) {
+ * // Handle the error
+ * }
+ * ```
+ *
+ * If `options` is a string, then it specifies the encoding:
+ *
+ * ```js
+ * import { appendFileSync } from 'fs';
+ *
+ * appendFileSync('message.txt', 'data to append', 'utf8');
+ * ```
+ *
+ * The `path` may be specified as a numeric file descriptor that has been opened
+ * for appending (using `fs.open()` or `fs.openSync()`). The file descriptor will
+ * not be closed automatically.
+ *
+ * ```js
+ * import { openSync, closeSync, appendFileSync } from 'fs';
+ *
+ * let fd;
+ *
+ * try {
+ * fd = openSync('message.txt', 'a');
+ * appendFileSync(fd, 'data to append', 'utf8');
+ * } catch (err) {
+ * // Handle the error
+ * } finally {
+ * if (fd !== undefined)
+ * closeSync(fd);
+ * }
+ * ```
+ * @since v0.6.7
+ * @param path filename or file descriptor
+ */
+ export function appendFileSync(
+ path: PathOrFileDescriptor,
+ data: string | Uint8Array,
+ options?: WriteFileOptions,
+ ): void;
+ /**
+ * Watch for changes on `filename`. The callback `listener` will be called each
+ * time the file is accessed.
+ *
+ * The `options` argument may be omitted. If provided, it should be an object. The`options` object may contain a boolean named `persistent` that indicates
+ * whether the process should continue to run as long as files are being watched.
+ * The `options` object may specify an `interval` property indicating how often the
+ * target should be polled in milliseconds.
+ *
+ * The `listener` gets two arguments the current stat object and the previous
+ * stat object:
+ *
+ * ```js
+ * import { watchFile } from 'fs';
+ *
+ * watchFile('message.text', (curr, prev) => {
+ * console.log(`the current mtime is: ${curr.mtime}`);
+ * console.log(`the previous mtime was: ${prev.mtime}`);
+ * });
+ * ```
+ *
+ * These stat objects are instances of `fs.Stat`. If the `bigint` option is `true`,
+ * the numeric values in these objects are specified as `BigInt`s.
+ *
+ * To be notified when the file was modified, not just accessed, it is necessary
+ * to compare `curr.mtimeMs` and `prev.mtimeMs`.
+ *
+ * When an `fs.watchFile` operation results in an `ENOENT` error, it
+ * will invoke the listener once, with all the fields zeroed (or, for dates, the
+ * Unix Epoch). If the file is created later on, the listener will be called
+ * again, with the latest stat objects. This is a change in functionality since
+ * v0.10.
+ *
+ * Using {@link watch} is more efficient than `fs.watchFile` and`fs.unwatchFile`. `fs.watch` should be used instead of `fs.watchFile` and`fs.unwatchFile` when possible.
+ *
+ * When a file being watched by `fs.watchFile()` disappears and reappears,
+ * then the contents of `previous` in the second callback event (the file's
+ * reappearance) will be the same as the contents of `previous` in the first
+ * callback event (its disappearance).
+ *
+ * This happens when:
+ *
+ * * the file is deleted, followed by a restore
+ * * the file is renamed and then renamed a second time back to its original name
+ * @since v0.1.31
+ */
+ export interface WatchFileOptions {
+ bigint?: boolean | undefined;
+ persistent?: boolean | undefined;
+ interval?: number | undefined;
+ }
+ /**
+ * Watch for changes on `filename`. The callback `listener` will be called each
+ * time the file is accessed.
+ *
+ * The `options` argument may be omitted. If provided, it should be an object. The`options` object may contain a boolean named `persistent` that indicates
+ * whether the process should continue to run as long as files are being watched.
+ * The `options` object may specify an `interval` property indicating how often the
+ * target should be polled in milliseconds.
+ *
+ * The `listener` gets two arguments the current stat object and the previous
+ * stat object:
+ *
+ * ```js
+ * import { watchFile } from 'fs';
+ *
+ * watchFile('message.text', (curr, prev) => {
+ * console.log(`the current mtime is: ${curr.mtime}`);
+ * console.log(`the previous mtime was: ${prev.mtime}`);
+ * });
+ * ```
+ *
+ * These stat objects are instances of `fs.Stat`. If the `bigint` option is `true`,
+ * the numeric values in these objects are specified as `BigInt`s.
+ *
+ * To be notified when the file was modified, not just accessed, it is necessary
+ * to compare `curr.mtimeMs` and `prev.mtimeMs`.
+ *
+ * When an `fs.watchFile` operation results in an `ENOENT` error, it
+ * will invoke the listener once, with all the fields zeroed (or, for dates, the
+ * Unix Epoch). If the file is created later on, the listener will be called
+ * again, with the latest stat objects. This is a change in functionality since
+ * v0.10.
+ *
+ * Using {@link watch} is more efficient than `fs.watchFile` and`fs.unwatchFile`. `fs.watch` should be used instead of `fs.watchFile` and`fs.unwatchFile` when possible.
+ *
+ * When a file being watched by `fs.watchFile()` disappears and reappears,
+ * then the contents of `previous` in the second callback event (the file's
+ * reappearance) will be the same as the contents of `previous` in the first
+ * callback event (its disappearance).
+ *
+ * This happens when:
+ *
+ * * the file is deleted, followed by a restore
+ * * the file is renamed and then renamed a second time back to its original name
+ * @since v0.1.31
+ */
+ export function watchFile(
+ filename: PathLike,
+ options:
+ | (WatchFileOptions & {
+ bigint?: false | undefined;
+ })
+ | undefined,
+ listener: StatsListener,
+ ): StatWatcher;
+ export function watchFile(
+ filename: PathLike,
+ options:
+ | (WatchFileOptions & {
+ bigint: true;
+ })
+ | undefined,
+ listener: BigIntStatsListener,
+ ): StatWatcher;
+ /**
+ * Watch for changes on `filename`. The callback `listener` will be called each time the file is accessed.
+ * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
+ * @param listener The callback listener will be called each time the file is accessed.
+ */
+ export function watchFile(filename: PathLike, listener: StatsListener): StatWatcher;
+ /**
+ * Stop watching for changes on `filename`. If `listener` is specified, only that
+ * particular listener is removed. Otherwise, _all_ listeners are removed,
+ * effectively stopping watching of `filename`.
+ *
+ * Calling `fs.unwatchFile()` with a filename that is not being watched is a
+ * no-op, not an error.
+ *
+ * Using {@link watch} is more efficient than `fs.watchFile()` and`fs.unwatchFile()`. `fs.watch()` should be used instead of `fs.watchFile()`and `fs.unwatchFile()` when possible.
+ * @since v0.1.31
+ * @param listener Optional, a listener previously attached using `fs.watchFile()`
+ */
+ export function unwatchFile(filename: PathLike, listener?: StatsListener): void;
+ export function unwatchFile(filename: PathLike, listener?: BigIntStatsListener): void;
+ export interface WatchOptions extends Abortable {
+ encoding?: BufferEncoding | "buffer" | undefined;
+ persistent?: boolean | undefined;
+ recursive?: boolean | undefined;
+ }
+ export type WatchEventType = "rename" | "change";
+ export type WatchListener<T> = (event: WatchEventType, filename: T | null) => void;
+ export type StatsListener = (curr: Stats, prev: Stats) => void;
+ export type BigIntStatsListener = (curr: BigIntStats, prev: BigIntStats) => void;
+ /**
+ * Watch for changes on `filename`, where `filename` is either a file or a
+ * directory.
+ *
+ * The second argument is optional. If `options` is provided as a string, it
+ * specifies the `encoding`. Otherwise `options` should be passed as an object.
+ *
+ * The listener callback gets two arguments `(eventType, filename)`. `eventType`is either `'rename'` or `'change'`, and `filename` is the name of the file
+ * which triggered the event.
+ *
+ * On most platforms, `'rename'` is emitted whenever a filename appears or
+ * disappears in the directory.
+ *
+ * The listener callback is attached to the `'change'` event fired by `fs.FSWatcher`, but it is not the same thing as the `'change'` value of`eventType`.
+ *
+ * If a `signal` is passed, aborting the corresponding AbortController will close
+ * the returned `fs.FSWatcher`.
+ * @since v0.5.10
+ * @param listener
+ */
+ export function watch(
+ filename: PathLike,
+ options:
+ | (WatchOptions & {
+ encoding: "buffer";
+ })
+ | "buffer",
+ listener?: WatchListener<Buffer>,
+ ): FSWatcher;
+ /**
+ * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`.
+ * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
+ * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options.
+ * If `encoding` is not supplied, the default of `'utf8'` is used.
+ * If `persistent` is not supplied, the default of `true` is used.
+ * If `recursive` is not supplied, the default of `false` is used.
+ */
+ export function watch(
+ filename: PathLike,
+ options?: WatchOptions | BufferEncoding | null,
+ listener?: WatchListener<string>,
+ ): FSWatcher;
+ /**
+ * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`.
+ * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
+ * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options.
+ * If `encoding` is not supplied, the default of `'utf8'` is used.
+ * If `persistent` is not supplied, the default of `true` is used.
+ * If `recursive` is not supplied, the default of `false` is used.
+ */
+ export function watch(
+ filename: PathLike,
+ options: WatchOptions | string,
+ listener?: WatchListener<string | Buffer>,
+ ): FSWatcher;
+ /**
+ * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`.
+ * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
+ */
+ export function watch(filename: PathLike, listener?: WatchListener<string>): FSWatcher;
+ /**
+ * Test whether or not the given path exists by checking with the file system.
+ * Then call the `callback` argument with either true or false:
+ *
+ * ```js
+ * import { exists } from 'fs';
+ *
+ * exists('/etc/passwd', (e) => {
+ * console.log(e ? 'it exists' : 'no passwd!');
+ * });
+ * ```
+ *
+ * **The parameters for this callback are not consistent with other Node.js**
+ * **callbacks.** Normally, the first parameter to a Node.js callback is an `err`parameter, optionally followed by other parameters. The `fs.exists()` callback
+ * has only one boolean parameter. This is one reason `fs.access()` is recommended
+ * instead of `fs.exists()`.
+ *
+ * Using `fs.exists()` to check for the existence of a file before calling`fs.open()`, `fs.readFile()` or `fs.writeFile()` is not recommended. Doing
+ * so introduces a race condition, since other processes may change the file's
+ * state between the two calls. Instead, user code should open/read/write the
+ * file directly and handle the error raised if the file does not exist.
+ *
+ * **write (NOT RECOMMENDED)**
+ *
+ * ```js
+ * import { exists, open, close } from 'fs';
+ *
+ * exists('myfile', (e) => {
+ * if (e) {
+ * console.error('myfile already exists');
+ * } else {
+ * open('myfile', 'wx', (err, fd) => {
+ * if (err) throw err;
+ *
+ * try {
+ * writeMyData(fd);
+ * } finally {
+ * close(fd, (err) => {
+ * if (err) throw err;
+ * });
+ * }
+ * });
+ * }
+ * });
+ * ```
+ *
+ * **write (RECOMMENDED)**
+ *
+ * ```js
+ * import { open, close } from 'fs';
+ * open('myfile', 'wx', (err, fd) => {
+ * if (err) {
+ * if (err.code === 'EEXIST') {
+ * console.error('myfile already exists');
+ * return;
+ * }
+ *
+ * throw err;
+ * }
+ *
+ * try {
+ * writeMyData(fd);
+ * } finally {
+ * close(fd, (err) => {
+ * if (err) throw err;
+ * });
+ * }
+ * });
+ * ```
+ *
+ * **read (NOT RECOMMENDED)**
+ *
+ * ```js
+ * import { open, close, exists } from 'fs';
+ *
+ * exists('myfile', (e) => {
+ * if (e) {
+ * open('myfile', 'r', (err, fd) => {
+ * if (err) throw err;
+ *
+ * try {
+ * readMyData(fd);
+ * } finally {
+ * close(fd, (err) => {
+ * if (err) throw err;
+ * });
+ * }
+ * });
+ * } else {
+ * console.error('myfile does not exist');
+ * }
+ * });
+ * ```
+ *
+ * **read (RECOMMENDED)**
+ *
+ * ```js
+ * import { open, close } from 'fs';
+ *
+ * open('myfile', 'r', (err, fd) => {
+ * if (err) {
+ * if (err.code === 'ENOENT') {
+ * console.error('myfile does not exist');
+ * return;
+ * }
+ *
+ * throw err;
+ * }
+ *
+ * try {
+ * readMyData(fd);
+ * } finally {
+ * close(fd, (err) => {
+ * if (err) throw err;
+ * });
+ * }
+ * });
+ * ```
+ *
+ * The "not recommended" examples above check for existence and then use the
+ * file; the "recommended" examples are better because they use the file directly
+ * and handle the error, if any.
+ *
+ * In general, check for the existence of a file only if the file won’t be
+ * used directly, for example when its existence is a signal from another
+ * process.
+ * @since v0.0.2
+ * @deprecated Since v1.0.0 - Use {@link stat} or {@link access} instead.
+ */
+ export function exists(path: PathLike, callback: (exists: boolean) => void): void;
+ /** @deprecated */
+ export namespace exists {
+ /**
+ * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
+ * URL support is _experimental_.
+ */
+ function __promisify__(path: PathLike): Promise<boolean>;
+ }
+ /**
+ * Returns `true` if the path exists, `false` otherwise.
+ *
+ * For detailed information, see the documentation of the asynchronous version of
+ * this API: {@link exists}.
+ *
+ * `fs.exists()` is deprecated, but `fs.existsSync()` is not. The `callback`parameter to `fs.exists()` accepts parameters that are inconsistent with other
+ * Node.js callbacks. `fs.existsSync()` does not use a callback.
+ *
+ * ```js
+ * import { existsSync } from 'fs';
+ *
+ * if (existsSync('/etc/passwd'))
+ * console.log('The path exists.');
+ * ```
+ * @since v0.1.21
+ */
+ export function existsSync(path: PathLike): boolean;
+ export namespace constants {
+ // File Access Constants
+ /** Constant for fs.access(). File is visible to the calling process. */
+ const F_OK: number;
+ /** Constant for fs.access(). File can be read by the calling process. */
+ const R_OK: number;
+ /** Constant for fs.access(). File can be written by the calling process. */
+ const W_OK: number;
+ /** Constant for fs.access(). File can be executed by the calling process. */
+ const X_OK: number;
+ // File Copy Constants
+ /** Constant for fs.copyFile. Flag indicating the destination file should not be overwritten if it already exists. */
+ const COPYFILE_EXCL: number;
+ /**
+ * Constant for fs.copyFile. copy operation will attempt to create a copy-on-write reflink.
+ * If the underlying platform does not support copy-on-write, then a fallback copy mechanism is used.
+ */
+ const COPYFILE_FICLONE: number;
+ /**
+ * Constant for fs.copyFile. Copy operation will attempt to create a copy-on-write reflink.
+ * If the underlying platform does not support copy-on-write, then the operation will fail with an error.
+ */
+ const COPYFILE_FICLONE_FORCE: number;
+ // File Open Constants
+ /** Constant for fs.open(). Flag indicating to open a file for read-only access. */
+ const O_RDONLY: number;
+ /** Constant for fs.open(). Flag indicating to open a file for write-only access. */
+ const O_WRONLY: number;
+ /** Constant for fs.open(). Flag indicating to open a file for read-write access. */
+ const O_RDWR: number;
+ /** Constant for fs.open(). Flag indicating to create the file if it does not already exist. */
+ const O_CREAT: number;
+ /** Constant for fs.open(). Flag indicating that opening a file should fail if the O_CREAT flag is set and the file already exists. */
+ const O_EXCL: number;
+ /**
+ * Constant for fs.open(). Flag indicating that if path identifies a terminal device,
+ * opening the path shall not cause that terminal to become the controlling terminal for the process
+ * (if the process does not already have one).
+ */
+ const O_NOCTTY: number;
+ /** Constant for fs.open(). Flag indicating that if the file exists and is a regular file, and the file is opened successfully for write access, its length shall be truncated to zero. */
+ const O_TRUNC: number;
+ /** Constant for fs.open(). Flag indicating that data will be appended to the end of the file. */
+ const O_APPEND: number;
+ /** Constant for fs.open(). Flag indicating that the open should fail if the path is not a directory. */
+ const O_DIRECTORY: number;
+ /**
+ * constant for fs.open().
+ * Flag indicating reading accesses to the file system will no longer result in
+ * an update to the atime information associated with the file.
+ * This flag is available on Linux operating systems only.
+ */
+ const O_NOATIME: number;
+ /** Constant for fs.open(). Flag indicating that the open should fail if the path is a symbolic link. */
+ const O_NOFOLLOW: number;
+ /** Constant for fs.open(). Flag indicating that the file is opened for synchronous I/O. */
+ const O_SYNC: number;
+ /** Constant for fs.open(). Flag indicating that the file is opened for synchronous I/O with write operations waiting for data integrity. */
+ const O_DSYNC: number;
+ /** Constant for fs.open(). Flag indicating to open the symbolic link itself rather than the resource it is pointing to. */
+ const O_SYMLINK: number;
+ /** Constant for fs.open(). When set, an attempt will be made to minimize caching effects of file I/O. */
+ const O_DIRECT: number;
+ /** Constant for fs.open(). Flag indicating to open the file in nonblocking mode when possible. */
+ const O_NONBLOCK: number;
+ // File Type Constants
+ /** Constant for fs.Stats mode property for determining a file's type. Bit mask used to extract the file type code. */
+ const S_IFMT: number;
+ /** Constant for fs.Stats mode property for determining a file's type. File type constant for a regular file. */
+ const S_IFREG: number;
+ /** Constant for fs.Stats mode property for determining a file's type. File type constant for a directory. */
+ const S_IFDIR: number;
+ /** Constant for fs.Stats mode property for determining a file's type. File type constant for a character-oriented device file. */
+ const S_IFCHR: number;
+ /** Constant for fs.Stats mode property for determining a file's type. File type constant for a block-oriented device file. */
+ const S_IFBLK: number;
+ /** Constant for fs.Stats mode property for determining a file's type. File type constant for a FIFO/pipe. */
+ const S_IFIFO: number;
+ /** Constant for fs.Stats mode property for determining a file's type. File type constant for a symbolic link. */
+ const S_IFLNK: number;
+ /** Constant for fs.Stats mode property for determining a file's type. File type constant for a socket. */
+ const S_IFSOCK: number;
+ // File Mode Constants
+ /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by owner. */
+ const S_IRWXU: number;
+ /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by owner. */
+ const S_IRUSR: number;
+ /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by owner. */
+ const S_IWUSR: number;
+ /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by owner. */
+ const S_IXUSR: number;
+ /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by group. */
+ const S_IRWXG: number;
+ /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by group. */
+ const S_IRGRP: number;
+ /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by group. */
+ const S_IWGRP: number;
+ /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by group. */
+ const S_IXGRP: number;
+ /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by others. */
+ const S_IRWXO: number;
+ /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by others. */
+ const S_IROTH: number;
+ /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by others. */
+ const S_IWOTH: number;
+ /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by others. */
+ const S_IXOTH: number;
+ /**
+ * When set, a memory file mapping is used to access the file. This flag
+ * is available on Windows operating systems only. On other operating systems,
+ * this flag is ignored.
+ */
+ const UV_FS_O_FILEMAP: number;
+ }
+ /**
+ * Tests a user's permissions for the file or directory specified by `path`.
+ * 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`
+ * (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for
+ * possible values of `mode`.
+ *
+ * The final argument, `callback`, is a callback function that is invoked with
+ * a possible error argument. If any of the accessibility checks fail, the error
+ * argument will be an `Error` object. The following examples check if`package.json` exists, and if it is readable or writable.
+ *
+ * ```js
+ * import { access, constants } from 'fs';
+ *
+ * const file = 'package.json';
+ *
+ * // Check if the file exists in the current directory.
+ * access(file, constants.F_OK, (err) => {
+ * console.log(`${file} ${err ? 'does not exist' : 'exists'}`);
+ * });
+ *
+ * // Check if the file is readable.
+ * access(file, constants.R_OK, (err) => {
+ * console.log(`${file} ${err ? 'is not readable' : 'is readable'}`);
+ * });
+ *
+ * // Check if the file is writable.
+ * access(file, constants.W_OK, (err) => {
+ * console.log(`${file} ${err ? 'is not writable' : 'is writable'}`);
+ * });
+ *
+ * // Check if the file is readable and writable.
+ * access(file, constants.R_OK | constants.W_OK, (err) => {
+ * console.log(`${file} ${err ? 'is not' : 'is'} readable and writable`);
+ * });
+ * ```
+ *
+ * Do not use `fs.access()` to check for the accessibility of a file before calling`fs.open()`, `fs.readFile()` or `fs.writeFile()`. Doing
+ * so introduces a race condition, since other processes may change the file's
+ * state between the two calls. Instead, user code should open/read/write the
+ * file directly and handle the error raised if the file is not accessible.
+ *
+ * **write (NOT RECOMMENDED)**
+ *
+ * ```js
+ * import { access, open, close } from 'fs';
+ *
+ * access('myfile', (err) => {
+ * if (!err) {
+ * console.error('myfile already exists');
+ * return;
+ * }
+ *
+ * open('myfile', 'wx', (err, fd) => {
+ * if (err) throw err;
+ *
+ * try {
+ * writeMyData(fd);
+ * } finally {
+ * close(fd, (err) => {
+ * if (err) throw err;
+ * });
+ * }
+ * });
+ * });
+ * ```
+ *
+ * **write (RECOMMENDED)**
+ *
+ * ```js
+ * import { open, close } from 'fs';
+ *
+ * open('myfile', 'wx', (err, fd) => {
+ * if (err) {
+ * if (err.code === 'EEXIST') {
+ * console.error('myfile already exists');
+ * return;
+ * }
+ *
+ * throw err;
+ * }
+ *
+ * try {
+ * writeMyData(fd);
+ * } finally {
+ * close(fd, (err) => {
+ * if (err) throw err;
+ * });
+ * }
+ * });
+ * ```
+ *
+ * **read (NOT RECOMMENDED)**
+ *
+ * ```js
+ * import { access, open, close } from 'fs';
+ * access('myfile', (err) => {
+ * if (err) {
+ * if (err.code === 'ENOENT') {
+ * console.error('myfile does not exist');
+ * return;
+ * }
+ *
+ * throw err;
+ * }
+ *
+ * open('myfile', 'r', (err, fd) => {
+ * if (err) throw err;
+ *
+ * try {
+ * readMyData(fd);
+ * } finally {
+ * close(fd, (err) => {
+ * if (err) throw err;
+ * });
+ * }
+ * });
+ * });
+ * ```
+ *
+ * **read (RECOMMENDED)**
+ *
+ * ```js
+ * import { open, close } from 'fs';
+ *
+ * open('myfile', 'r', (err, fd) => {
+ * if (err) {
+ * if (err.code === 'ENOENT') {
+ * console.error('myfile does not exist');
+ * return;
+ * }
+ *
+ * throw err;
+ * }
+ *
+ * try {
+ * readMyData(fd);
+ * } finally {
+ * close(fd, (err) => {
+ * if (err) throw err;
+ * });
+ * }
+ * });
+ * ```
+ *
+ * The "not recommended" examples above check for accessibility and then use the
+ * file; the "recommended" examples are better because they use the file directly
+ * and handle the error, if any.
+ *
+ * In general, check for the accessibility of a file only if the file will not be
+ * used directly, for example when its accessibility is a signal from another
+ * process.
+ *
+ * On Windows, access-control policies (ACLs) on a directory may limit access to
+ * a file or directory. The `fs.access()` function, however, does not check the
+ * ACL and therefore may report that a path is accessible even if the ACL restricts
+ * the user from reading or writing to it.
+ * @since v0.11.15
+ * @param [mode=fs.constants.F_OK]
+ */
+ export function access(path: PathLike, mode: number | undefined, callback: NoParamCallback): void;
+ /**
+ * Asynchronously tests a user's permissions for the file specified by path.
+ * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
+ */
+ export function access(path: PathLike, callback: NoParamCallback): void;
+ export namespace access {
+ /**
+ * Asynchronously tests a user's permissions for the file specified by path.
+ * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
+ * URL support is _experimental_.
+ */
+ function __promisify__(path: PathLike, mode?: number): Promise<void>;
+ }
+ /**
+ * Synchronously tests a user's permissions for the file or directory specified
+ * by `path`. 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` (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for
+ * possible values of `mode`.
+ *
+ * If any of the accessibility checks fail, an `Error` will be thrown. Otherwise,
+ * the method will return `undefined`.
+ *
+ * ```js
+ * import { accessSync, constants } from 'fs';
+ *
+ * try {
+ * accessSync('etc/passwd', constants.R_OK | constants.W_OK);
+ * console.log('can read/write');
+ * } catch (err) {
+ * console.error('no access!');
+ * }
+ * ```
+ * @since v0.11.15
+ * @param [mode=fs.constants.F_OK]
+ */
+ export function accessSync(path: PathLike, mode?: number): void;
+ interface StreamOptions {
+ flags?: string | undefined;
+ encoding?: BufferEncoding | undefined;
+ fd?: number | promises.FileHandle | undefined;
+ mode?: number | undefined;
+ autoClose?: boolean | undefined;
+ emitClose?: boolean | undefined;
+ start?: number | undefined;
+ highWaterMark?: number | undefined;
+ }
+ interface FSImplementation {
+ open?: (...args: any[]) => any;
+ close?: (...args: any[]) => any;
+ }
+ interface CreateReadStreamFSImplementation extends FSImplementation {
+ read: (...args: any[]) => any;
+ }
+ interface CreateWriteStreamFSImplementation extends FSImplementation {
+ write: (...args: any[]) => any;
+ writev?: (...args: any[]) => any;
+ }
+ interface ReadStreamOptions extends StreamOptions {
+ fs?: CreateReadStreamFSImplementation | null | undefined;
+ end?: number | undefined;
+ }
+ interface WriteStreamOptions extends StreamOptions {
+ fs?: CreateWriteStreamFSImplementation | null | undefined;
+ }
+ /**
+ * Unlike the 16 kb default `highWaterMark` for a `stream.Readable`, the stream
+ * 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
+ * the file instead of the entire file. Both `start` and `end` are inclusive and
+ * start counting at 0, 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. If `fd` is specified and `start` is
+ * omitted or `undefined`, `fs.createReadStream()` reads sequentially from the
+ * current file position. The `encoding` can be any one of those accepted by `Buffer`.
+ *
+ * If `fd` is specified, `ReadStream` will ignore the `path` argument and will use
+ * the specified file descriptor. This means that no `'open'` event will be
+ * emitted. `fd` should be blocking; non-blocking `fd`s should be passed to `net.Socket`.
+ *
+ * If `fd` points to a character device that only supports blocking reads
+ * (such as keyboard or sound card), read operations do not finish until data is
+ * available. This can prevent the process from exiting and the stream from
+ * closing naturally.
+ *
+ * By default, the stream will emit a `'close'` event after it has been
+ * destroyed. Set the `emitClose` option to `false` to change this behavior.
+ *
+ * By providing the `fs` option, it is possible to override the corresponding `fs`implementations for `open`, `read`, and `close`. When providing the `fs` option,
+ * an override for `read` is required. If no `fd` is provided, an override for`open` is also required. If `autoClose` is `true`, an override for `close` is
+ * also required.
+ *
+ * ```js
+ * import { createReadStream } from 'fs';
+ *
+ * // Create a stream from some character device.
+ * const stream = createReadStream('/dev/input/event0');
+ * setTimeout(() => {
+ * stream.close(); // This may not close the stream.
+ * // Artificially marking end-of-stream, as if the underlying resource had
+ * // indicated end-of-file by itself, allows the stream to close.
+ * // This does not cancel pending read operations, and if there is such an
+ * // operation, the process may still not be able to exit successfully
+ * // until it finishes.
+ * stream.push(null);
+ * stream.read(0);
+ * }, 100);
+ * ```
+ *
+ * If `autoClose` is false, then the file descriptor won't be closed, even if
+ * there's an error. It is the application's responsibility to close it and make
+ * sure there's no file descriptor leak. If `autoClose` is set to true (default
+ * behavior), on `'error'` or `'end'` the file descriptor will be closed
+ * automatically.
+ *
+ * `mode` sets the file mode (permission and sticky bits), but only if the
+ * file was created.
+ *
+ * An example to read the last 10 bytes of a file which is 100 bytes long:
+ *
+ * ```js
+ * import { createReadStream } from 'fs';
+ *
+ * createReadStream('sample.txt', { start: 90, end: 99 });
+ * ```
+ *
+ * If `options` is a string, then it specifies the encoding.
+ * @since v0.1.31
+ */
+ export function createReadStream(path: PathLike, options?: BufferEncoding | ReadStreamOptions): ReadStream;
+ /**
+ * `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
+ * \[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 it may require the `flags` option to be set to `r+` rather than the
+ * default `w`. 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,
+ * then the file descriptor won't be closed, even if there's an error.
+ * It is the application's responsibility to close it and make sure there's no
+ * file descriptor leak.
+ *
+ * By default, the stream will emit a `'close'` event after it has been
+ * destroyed. Set the `emitClose` option to `false` to change this behavior.
+ *
+ * By providing the `fs` option it is possible to override the corresponding `fs`implementations for `open`, `write`, `writev` and `close`. Overriding `write()`without `writev()` can reduce
+ * performance as some optimizations (`_writev()`)
+ * will be disabled. When providing the `fs` option, overrides for at least one of`write` and `writev` are required. If no `fd` option is supplied, an override
+ * for `open` is also required. If `autoClose` is `true`, an override for `close`is also required.
+ *
+ * Like `fs.ReadStream`, if `fd` is specified, `fs.WriteStream` will ignore the`path` argument and will use the specified file descriptor. This means that no`'open'` event will be
+ * emitted. `fd` should be blocking; non-blocking `fd`s
+ * should be passed to `net.Socket`.
+ *
+ * If `options` is a string, then it specifies the encoding.
+ * @since v0.1.31
+ */
+ export function createWriteStream(path: PathLike, options?: BufferEncoding | WriteStreamOptions): WriteStream;
+ /**
+ * Forces all currently queued I/O operations associated with the file to the
+ * operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. No arguments other
+ * than a possible
+ * exception are given to the completion callback.
+ * @since v0.1.96
+ */
+ export function fdatasync(fd: number, callback: NoParamCallback): void;
+ export namespace fdatasync {
+ /**
+ * Asynchronous fdatasync(2) - synchronize a file's in-core state with storage device.
+ * @param fd A file descriptor.
+ */
+ function __promisify__(fd: number): Promise<void>;
+ }
+ /**
+ * Forces all currently queued I/O operations associated with the file to the
+ * operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. Returns `undefined`.
+ * @since v0.1.96
+ */
+ export function fdatasyncSync(fd: number): void;
+ /**
+ * Asynchronously copies `src` to `dest`. By default, `dest` is overwritten if it
+ * already exists. No arguments other than a possible exception are given to the
+ * callback function. Node.js makes no guarantees about the atomicity of the copy
+ * operation. If an error occurs after the destination file has been opened for
+ * writing, Node.js will attempt to remove the destination.
+ *
+ * `mode` is an optional integer that specifies the behavior
+ * of the copy operation. It is possible to create a mask consisting of the bitwise
+ * OR of two or more values (e.g.`fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`).
+ *
+ * * `fs.constants.COPYFILE_EXCL`: The copy operation will fail if `dest` already
+ * exists.
+ * * `fs.constants.COPYFILE_FICLONE`: The copy operation will attempt to create a
+ * copy-on-write reflink. If the platform does not support copy-on-write, then a
+ * fallback copy mechanism is used.
+ * * `fs.constants.COPYFILE_FICLONE_FORCE`: The copy operation will attempt to
+ * create a copy-on-write reflink. If the platform does not support
+ * copy-on-write, then the operation will fail.
+ *
+ * ```js
+ * import { copyFile, constants } from 'fs';
+ *
+ * function callback(err) {
+ * if (err) throw err;
+ * console.log('source.txt was copied to destination.txt');
+ * }
+ *
+ * // destination.txt will be created or overwritten by default.
+ * copyFile('source.txt', 'destination.txt', callback);
+ *
+ * // By using COPYFILE_EXCL, the operation will fail if destination.txt exists.
+ * copyFile('source.txt', 'destination.txt', constants.COPYFILE_EXCL, callback);
+ * ```
+ * @since v8.5.0
+ * @param src source filename to copy
+ * @param dest destination filename of the copy operation
+ * @param [mode=0] modifiers for copy operation.
+ */
+ export function copyFile(src: PathLike, dest: PathLike, callback: NoParamCallback): void;
+ export function copyFile(src: PathLike, dest: PathLike, mode: number, callback: NoParamCallback): void;
+ export namespace copyFile {
+ function __promisify__(src: PathLike, dst: PathLike, mode?: number): Promise<void>;
+ }
+ /**
+ * Synchronously copies `src` to `dest`. By default, `dest` is overwritten if it
+ * already exists. Returns `undefined`. Node.js makes no guarantees about the
+ * atomicity of the copy operation. If an error occurs after the destination file
+ * has been opened for writing, Node.js will attempt to remove the destination.
+ *
+ * `mode` is an optional integer that specifies the behavior
+ * of the copy operation. It is possible to create a mask consisting of the bitwise
+ * OR of two or more values (e.g.`fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`).
+ *
+ * * `fs.constants.COPYFILE_EXCL`: The copy operation will fail if `dest` already
+ * exists.
+ * * `fs.constants.COPYFILE_FICLONE`: The copy operation will attempt to create a
+ * copy-on-write reflink. If the platform does not support copy-on-write, then a
+ * fallback copy mechanism is used.
+ * * `fs.constants.COPYFILE_FICLONE_FORCE`: The copy operation will attempt to
+ * create a copy-on-write reflink. If the platform does not support
+ * copy-on-write, then the operation will fail.
+ *
+ * ```js
+ * import { copyFileSync, constants } from 'fs';
+ *
+ * // destination.txt will be created or overwritten by default.
+ * copyFileSync('source.txt', 'destination.txt');
+ * console.log('source.txt was copied to destination.txt');
+ *
+ * // By using COPYFILE_EXCL, the operation will fail if destination.txt exists.
+ * copyFileSync('source.txt', 'destination.txt', constants.COPYFILE_EXCL);
+ * ```
+ * @since v8.5.0
+ * @param src source filename to copy
+ * @param dest destination filename of the copy operation
+ * @param [mode=0] modifiers for copy operation.
+ */
+ export function copyFileSync(src: PathLike, dest: PathLike, mode?: number): void;
+ /**
+ * Write an array of `ArrayBufferView`s to the file specified by `fd` using`writev()`.
+ *
+ * `position` is the offset from the beginning of the file where this data
+ * should be written. If `typeof position !== 'number'`, the data will be written
+ * at the current position.
+ *
+ * The callback will be given three arguments: `err`, `bytesWritten`, and`buffers`. `bytesWritten` is how many bytes were written from `buffers`.
+ *
+ * If this method is `util.promisify()` ed, it returns a promise for an`Object` with `bytesWritten` and `buffers` properties.
+ *
+ * It is unsafe to use `fs.writev()` multiple times on the same file without
+ * waiting for the callback. For this scenario, use {@link createWriteStream}.
+ *
+ * On Linux, positional writes don't work when the file is opened in append mode.
+ * The kernel ignores the position argument and always appends the data to
+ * the end of the file.
+ * @since v12.9.0
+ */
+ export function writev(
+ fd: number,
+ buffers: readonly NodeJS.ArrayBufferView[],
+ cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => void,
+ ): void;
+ export function writev(
+ fd: number,
+ buffers: readonly NodeJS.ArrayBufferView[],
+ position: number,
+ cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => void,
+ ): void;
+ export interface WriteVResult {
+ bytesWritten: number;
+ buffers: NodeJS.ArrayBufferView[];
+ }
+ export namespace writev {
+ function __promisify__(
+ fd: number,
+ buffers: readonly NodeJS.ArrayBufferView[],
+ position?: number,
+ ): Promise<WriteVResult>;
+ }
+ /**
+ * For detailed information, see the documentation of the asynchronous version of
+ * this API: {@link writev}.
+ * @since v12.9.0
+ * @return The number of bytes written.
+ */
+ export function writevSync(fd: number, buffers: readonly NodeJS.ArrayBufferView[], position?: number): number;
+ /**
+ * Read from a file specified by `fd` and write to an array of `ArrayBufferView`s
+ * using `readv()`.
+ *
+ * `position` is the offset from the beginning of the file from where data
+ * should be read. If `typeof position !== 'number'`, the data will be read
+ * from the current position.
+ *
+ * The callback will be given three arguments: `err`, `bytesRead`, and`buffers`. `bytesRead` is how many bytes were read from the file.
+ *
+ * If this method is invoked as its `util.promisify()` ed version, it returns
+ * a promise for an `Object` with `bytesRead` and `buffers` properties.
+ * @since v13.13.0, v12.17.0
+ */
+ export function readv(
+ fd: number,
+ buffers: readonly NodeJS.ArrayBufferView[],
+ cb: (err: NodeJS.ErrnoException | null, bytesRead: number, buffers: NodeJS.ArrayBufferView[]) => void,
+ ): void;
+ export function readv(
+ fd: number,
+ buffers: readonly NodeJS.ArrayBufferView[],
+ position: number,
+ cb: (err: NodeJS.ErrnoException | null, bytesRead: number, buffers: NodeJS.ArrayBufferView[]) => void,
+ ): void;
+ export interface ReadVResult {
+ bytesRead: number;
+ buffers: NodeJS.ArrayBufferView[];
+ }
+ export namespace readv {
+ function __promisify__(
+ fd: number,
+ buffers: readonly NodeJS.ArrayBufferView[],
+ position?: number,
+ ): Promise<ReadVResult>;
+ }
+ /**
+ * For detailed information, see the documentation of the asynchronous version of
+ * this API: {@link readv}.
+ * @since v13.13.0, v12.17.0
+ * @return The number of bytes read.
+ */
+ export function readvSync(fd: number, buffers: readonly NodeJS.ArrayBufferView[], position?: number): number;
+ export interface OpenDirOptions {
+ encoding?: BufferEncoding | undefined;
+ /**
+ * Number of directory entries that are buffered
+ * internally when reading from the directory. Higher values lead to better
+ * performance but higher memory usage.
+ * @default 32
+ */
+ bufferSize?: number | undefined;
+ }
+ /**
+ * Synchronously open a directory. See [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html).
+ *
+ * Creates an `fs.Dir`, which contains all further functions for reading from
+ * and cleaning up the directory.
+ *
+ * The `encoding` option sets the encoding for the `path` while opening the
+ * directory and subsequent read operations.
+ * @since v12.12.0
+ */
+ export function opendirSync(path: PathLike, options?: OpenDirOptions): Dir;
+ /**
+ * Asynchronously open a directory. See the POSIX [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html) documentation for
+ * more details.
+ *
+ * Creates an `fs.Dir`, which contains all further functions for reading from
+ * and cleaning up the directory.
+ *
+ * The `encoding` option sets the encoding for the `path` while opening the
+ * directory and subsequent read operations.
+ * @since v12.12.0
+ */
+ export function opendir(path: PathLike, cb: (err: NodeJS.ErrnoException | null, dir: Dir) => void): void;
+ export function opendir(
+ path: PathLike,
+ options: OpenDirOptions,
+ cb: (err: NodeJS.ErrnoException | null, dir: Dir) => void,
+ ): void;
+ export namespace opendir {
+ function __promisify__(path: PathLike, options?: OpenDirOptions): Promise<Dir>;
+ }
+ export interface BigIntStats extends StatsBase<bigint> {
+ atimeNs: bigint;
+ mtimeNs: bigint;
+ ctimeNs: bigint;
+ birthtimeNs: bigint;
+ }
+ export interface BigIntOptions {
+ bigint: true;
+ }
+ export interface StatOptions {
+ bigint?: boolean | undefined;
+ }
+ export interface StatSyncOptions extends StatOptions {
+ throwIfNoEntry?: boolean | undefined;
+ }
+ interface CopyOptionsBase {
+ /**
+ * Dereference symlinks
+ * @default false
+ */
+ dereference?: boolean;
+ /**
+ * When `force` is `false`, and the destination
+ * exists, throw an error.
+ * @default false
+ */
+ errorOnExist?: boolean;
+ /**
+ * Overwrite existing file or directory. _The copy
+ * operation will ignore errors if you set this to false and the destination
+ * exists. Use the `errorOnExist` option to change this behavior.
+ * @default true
+ */
+ force?: boolean;
+ /**
+ * Modifiers for copy operation. See `mode` flag of {@link copyFileSync()}
+ */
+ mode?: number;
+ /**
+ * When `true` timestamps from `src` will
+ * be preserved.
+ * @default false
+ */
+ preserveTimestamps?: boolean;
+ /**
+ * Copy directories recursively.
+ * @default false
+ */
+ recursive?: boolean;
+ /**
+ * When true, path resolution for symlinks will be skipped
+ * @default false
+ */
+ verbatimSymlinks?: boolean;
+ }
+ export interface CopyOptions extends CopyOptionsBase {
+ /**
+ * Function to filter copied files/directories. Return
+ * `true` to copy the item, `false` to ignore it.
+ */
+ filter?(source: string, destination: string): boolean | Promise<boolean>;
+ }
+ export interface CopySyncOptions extends CopyOptionsBase {
+ /**
+ * Function to filter copied files/directories. Return
+ * `true` to copy the item, `false` to ignore it.
+ */
+ filter?(source: string, destination: string): boolean;
+ }
+ /**
+ * Asynchronously copies the entire directory structure from `src` to `dest`,
+ * including subdirectories and files.
+ *
+ * When copying a directory to another directory, globs are not supported and
+ * behavior is similar to `cp dir1/ dir2/`.
+ * @since v16.7.0
+ * @experimental
+ * @param src source path to copy.
+ * @param dest destination path to copy to.
+ */
+ export function cp(
+ source: string | URL,
+ destination: string | URL,
+ callback: (err: NodeJS.ErrnoException | null) => void,
+ ): void;
+ export function cp(
+ source: string | URL,
+ destination: string | URL,
+ opts: CopyOptions,
+ callback: (err: NodeJS.ErrnoException | null) => void,
+ ): void;
+ /**
+ * Synchronously copies the entire directory structure from `src` to `dest`,
+ * including subdirectories and files.
+ *
+ * When copying a directory to another directory, globs are not supported and
+ * behavior is similar to `cp dir1/ dir2/`.
+ * @since v16.7.0
+ * @experimental
+ * @param src source path to copy.
+ * @param dest destination path to copy to.
+ */
+ export function cpSync(source: string | URL, destination: string | URL, opts?: CopySyncOptions): void;
+}
+declare module "node:fs" {
+ export * from "fs";
+}
diff --git a/client/node_modules/@types/node/fs/promises.d.ts b/client/node_modules/@types/node/fs/promises.d.ts
new file mode 100644
index 0000000..7e55f89
--- /dev/null
+++ b/client/node_modules/@types/node/fs/promises.d.ts
@@ -0,0 +1,1205 @@
+/**
+ * The `fs/promises` API provides asynchronous file system methods that return
+ * promises.
+ *
+ * The promise APIs use the underlying Node.js threadpool to perform file
+ * system operations off the event loop thread. These operations are not
+ * synchronized or threadsafe. Care must be taken when performing multiple
+ * concurrent modifications on the same file or data corruption may occur.
+ * @since v10.0.0
+ */
+declare module "fs/promises" {
+ import { Abortable } from "node:events";
+ import { Stream } from "node:stream";
+ import { ReadableStream } from "node:stream/web";
+ import {
+ BigIntStats,
+ BigIntStatsFs,
+ BufferEncodingOption,
+ constants as fsConstants,
+ CopyOptions,
+ Dir,
+ Dirent,
+ MakeDirectoryOptions,
+ Mode,
+ ObjectEncodingOptions,
+ OpenDirOptions,
+ OpenMode,
+ PathLike,
+ ReadStream,
+ ReadVResult,
+ RmDirOptions,
+ RmOptions,
+ StatFsOptions,
+ StatOptions,
+ Stats,
+ StatsFs,
+ TimeLike,
+ WatchEventType,
+ WatchOptions,
+ WriteStream,
+ WriteVResult,
+ } from "node:fs";
+ import { Interface as ReadlineInterface } from "node:readline";
+
+ interface FileChangeInfo<T extends string | Buffer> {
+ eventType: WatchEventType;
+ filename: T | null;
+ }
+ interface FlagAndOpenMode {
+ mode?: Mode | undefined;
+ flag?: OpenMode | undefined;
+ }
+ interface FileReadResult<T extends NodeJS.ArrayBufferView> {
+ bytesRead: number;
+ buffer: T;
+ }
+ interface FileReadOptions<T extends NodeJS.ArrayBufferView = Buffer> {
+ /**
+ * @default `Buffer.alloc(0xffff)`
+ */
+ buffer?: T;
+ /**
+ * @default 0
+ */
+ offset?: number | null;
+ /**
+ * @default `buffer.byteLength`
+ */
+ length?: number | null;
+ position?: number | null;
+ }
+ interface CreateReadStreamOptions {
+ encoding?: BufferEncoding | null | undefined;
+ autoClose?: boolean | undefined;
+ emitClose?: boolean | undefined;
+ start?: number | undefined;
+ end?: number | undefined;
+ highWaterMark?: number | undefined;
+ }
+ interface CreateWriteStreamOptions {
+ encoding?: BufferEncoding | null | undefined;
+ autoClose?: boolean | undefined;
+ emitClose?: boolean | undefined;
+ start?: number | undefined;
+ highWaterMark?: number | undefined;
+ }
+ interface ReadableWebStreamOptions {
+ /**
+ * Whether to open a normal or a `'bytes'` stream.
+ * @since v18.17.0
+ */
+ type?: "bytes" | undefined;
+ }
+ // TODO: Add `EventEmitter` close
+ interface FileHandle {
+ /**
+ * The numeric file descriptor managed by the {FileHandle} object.
+ * @since v10.0.0
+ */
+ readonly fd: number;
+ /**
+ * Alias of `filehandle.writeFile()`.
+ *
+ * When operating on file handles, the mode cannot be changed from what it was set
+ * to with `fsPromises.open()`. Therefore, this is equivalent to `filehandle.writeFile()`.
+ * @since v10.0.0
+ * @return Fulfills with `undefined` upon success.
+ */
+ appendFile(
+ 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).
+ * @since v10.0.0
+ * @param uid The file's new owner's user id.
+ * @param gid The file's new group's group id.
+ * @return Fulfills with `undefined` upon success.
+ */
+ chown(uid: number, gid: number): Promise<void>;
+ /**
+ * Modifies the permissions on the file. See [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html).
+ * @since v10.0.0
+ * @param mode the file mode bit mask.
+ * @return Fulfills with `undefined` upon success.
+ */
+ chmod(mode: Mode): Promise<void>;
+ /**
+ * Unlike the 16 kb default `highWaterMark` for a `stream.Readable`, the stream
+ * 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
+ * the file instead of the entire file. Both `start` and `end` are inclusive and
+ * start counting at 0, 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. If `start` is
+ * omitted or `undefined`, `filehandle.createReadStream()` reads sequentially from
+ * the current file position. The `encoding` can be any one of those accepted by `Buffer`.
+ *
+ * If the `FileHandle` points to a character device that only supports blocking
+ * reads (such as keyboard or sound card), read operations do not finish until data
+ * is available. This can prevent the process from exiting and the stream from
+ * closing naturally.
+ *
+ * By default, the stream will emit a `'close'` event after it has been
+ * destroyed. Set the `emitClose` option to `false` to change this behavior.
+ *
+ * ```js
+ * import { open } from 'fs/promises';
+ *
+ * const fd = await open('/dev/input/event0');
+ * // Create a stream from some character device.
+ * const stream = fd.createReadStream();
+ * setTimeout(() => {
+ * stream.close(); // This may not close the stream.
+ * // Artificially marking end-of-stream, as if the underlying resource had
+ * // indicated end-of-file by itself, allows the stream to close.
+ * // This does not cancel pending read operations, and if there is such an
+ * // operation, the process may still not be able to exit successfully
+ * // until it finishes.
+ * stream.push(null);
+ * stream.read(0);
+ * }, 100);
+ * ```
+ *
+ * If `autoClose` is false, then the file descriptor won't be closed, even if
+ * there's an error. It is the application's responsibility to close it and make
+ * sure there's no file descriptor leak. If `autoClose` is set to true (default
+ * behavior), on `'error'` or `'end'` the file descriptor will be closed
+ * automatically.
+ *
+ * An example to read the last 10 bytes of a file which is 100 bytes long:
+ *
+ * ```js
+ * import { open } from 'fs/promises';
+ *
+ * const fd = await open('sample.txt');
+ * fd.createReadStream({ start: 90, end: 99 });
+ * ```
+ * @since v16.11.0
+ */
+ createReadStream(options?: CreateReadStreamOptions): ReadStream;
+ /**
+ * `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
+ * \[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 it may require the `flags` `open` option to be set to `r+` rather than
+ * the 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,
+ * then the file descriptor won't be closed, even if there's an error.
+ * It is the application's responsibility to close it and make sure there's no
+ * file descriptor leak.
+ *
+ * By default, the stream will emit a `'close'` event after it has been
+ * destroyed. Set the `emitClose` option to `false` to change this behavior.
+ * @since v16.11.0
+ */
+ createWriteStream(options?: CreateWriteStreamOptions): WriteStream;
+ /**
+ * Forces all currently queued I/O operations associated with the file to the
+ * operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details.
+ *
+ * Unlike `filehandle.sync` this method does not flush modified metadata.
+ * @since v10.0.0
+ * @return Fulfills with `undefined` upon success.
+ */
+ datasync(): Promise<void>;
+ /**
+ * Request that all data for the open file descriptor is flushed to the storage
+ * 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.
+ * @since v10.0.0
+ * @return Fufills with `undefined` upon success.
+ */
+ sync(): Promise<void>;
+ /**
+ * Reads data from the file and stores that in the given buffer.
+ *
+ * If the file is not modified concurrently, the end-of-file is reached when the
+ * number of bytes read is zero.
+ * @since v10.0.0
+ * @param buffer A buffer that will be filled with the file data read.
+ * @param offset The location in the buffer at which to start filling.
+ * @param length The number of bytes to read.
+ * @param position The location where to begin reading data from the file. If `null`, data will be read from the current file position, and the position will be updated. If `position` is an
+ * integer, the current file position will remain unchanged.
+ * @return Fulfills upon success with an object with two properties:
+ */
+ read<T extends NodeJS.ArrayBufferView>(
+ buffer: 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.
+ *
+ * If `options` is a string, then it specifies the `encoding`.
+ *
+ * The `FileHandle` has to support reading.
+ *
+ * If one or more `filehandle.read()` calls are made on a file handle and then a`filehandle.readFile()` call is made, the data will be read from the current
+ * position till the end of the file. It doesn't always read from the beginning
+ * of the file.
+ * @since v10.0.0
+ * @return Fulfills upon a successful read with the contents of the file. If no encoding is specified (using `options.encoding`), the data is returned as a {Buffer} object. Otherwise, the
+ * data will be a string.
+ */
+ readFile(
+ options?: {
+ encoding?: null | undefined;
+ flag?: OpenMode | undefined;
+ } | null,
+ ): Promise<Buffer>;
+ /**
+ * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically.
+ * The `FileHandle` must have been opened for reading.
+ * @param options An object that may contain an optional flag.
+ * If a flag is not provided, it defaults to `'r'`.
+ */
+ readFile(
+ options:
+ | {
+ encoding: BufferEncoding;
+ flag?: OpenMode | undefined;
+ }
+ | BufferEncoding,
+ ): Promise<string>;
+ /**
+ * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically.
+ * The `FileHandle` must have been opened for reading.
+ * @param options An object that may contain an optional flag.
+ * If a flag is not provided, it defaults to `'r'`.
+ */
+ readFile(
+ options?:
+ | (ObjectEncodingOptions & {
+ flag?: OpenMode | undefined;
+ })
+ | BufferEncoding
+ | null,
+ ): Promise<string | Buffer>;
+ /**
+ * Convenience method to create a `readline` interface and stream over the file. For example:
+ *
+ * ```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
+ * @param options See `filehandle.createReadStream()` for the options.
+ */
+ readLines(options?: CreateReadStreamOptions): ReadlineInterface;
+ /**
+ * @since v10.0.0
+ * @return Fulfills with an {fs.Stats} for the file.
+ */
+ stat(
+ opts?: StatOptions & {
+ bigint?: false | undefined;
+ },
+ ): Promise<Stats>;
+ stat(
+ opts: StatOptions & {
+ bigint: true;
+ },
+ ): Promise<BigIntStats>;
+ stat(opts?: StatOptions): Promise<Stats | BigIntStats>;
+ /**
+ * Truncates the file.
+ *
+ * If the file was larger than `len` bytes, only the first `len` bytes will be
+ * retained in the file.
+ *
+ * The following example retains only the first four bytes of the file:
+ *
+ * ```js
+ * import { open } from 'fs/promises';
+ *
+ * let filehandle = null;
+ * try {
+ * filehandle = await open('temp.txt', 'r+');
+ * await filehandle.truncate(4);
+ * } finally {
+ * await filehandle?.close();
+ * }
+ * ```
+ *
+ * If the file previously was shorter than `len` bytes, it is extended, and the
+ * extended part is filled with null bytes (`'\0'`):
+ *
+ * If `len` is negative then `0` will be used.
+ * @since v10.0.0
+ * @param [len=0]
+ * @return Fulfills with `undefined` upon success.
+ */
+ truncate(len?: number): Promise<void>;
+ /**
+ * 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
+ */
+ utimes(atime: TimeLike, mtime: TimeLike): Promise<void>;
+ /**
+ * 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
+ * [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol) object.
+ * The promise is resolved with no arguments upon success.
+ *
+ * If `options` is a string, then it specifies the `encoding`.
+ *
+ * The `FileHandle` has to support writing.
+ *
+ * It is unsafe to use `filehandle.writeFile()` multiple times on the same file
+ * without waiting for the promise to be resolved (or rejected).
+ *
+ * If one or more `filehandle.write()` calls are made on a file handle and then a`filehandle.writeFile()` call is made, the data will be written from the
+ * current position till the end of the file. It doesn't always write from the
+ * beginning of the file.
+ * @since v10.0.0
+ */
+ writeFile(
+ data: string | Uint8Array,
+ options?: (ObjectEncodingOptions & FlagAndOpenMode & Abortable) | BufferEncoding | null,
+ ): Promise<void>;
+ /**
+ * Write `buffer` to the file.
+ *
+ * The promise is resolved with an object containing two properties:
+ *
+ * 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
+ * scenario, use `filehandle.createWriteStream()`.
+ *
+ * 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 end of the file.
+ * @since v10.0.0
+ * @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 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.
+ * See the POSIX pwrite(2) documentation for more detail.
+ */
+ write<TBuffer extends Uint8Array>(
+ buffer: TBuffer,
+ offset?: number | null,
+ length?: number | null,
+ position?: number | null,
+ ): Promise<{
+ bytesWritten: number;
+ buffer: TBuffer;
+ }>;
+ write(
+ data: string,
+ position?: number | null,
+ encoding?: BufferEncoding | null,
+ ): Promise<{
+ bytesWritten: number;
+ buffer: string;
+ }>;
+ /**
+ * Write an array of [ArrayBufferView](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView) s to the file.
+ *
+ * The promise is resolved with an object containing a two properties:
+ *
+ * It is unsafe to call `writev()` multiple times on the same file without waiting
+ * for the promise to be resolved (or rejected).
+ *
+ * On Linux, positional writes don't work when the file is opened in append mode.
+ * The kernel ignores the position argument and always appends the data to
+ * the end of the file.
+ * @since v12.9.0
+ * @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.
+ */
+ writev(buffers: readonly 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
+ * @since v13.13.0, v12.17.0
+ * @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:
+ */
+ readv(buffers: readonly NodeJS.ArrayBufferView[], position?: number): Promise<ReadVResult>;
+ /**
+ * Closes the file handle after waiting for any pending operation on the handle to
+ * complete.
+ *
+ * ```js
+ * import { open } from 'fs/promises';
+ *
+ * let filehandle;
+ * try {
+ * filehandle = await open('thefile.txt', 'r');
+ * } finally {
+ * await filehandle?.close();
+ * }
+ * ```
+ * @since v10.0.0
+ * @return Fulfills with `undefined` upon success.
+ */
+ close(): Promise<void>;
+ /**
+ * An alias for {@link FileHandle.close()}.
+ * @since v18.18.0
+ */
+ [Symbol.asyncDispose](): Promise<void>;
+ }
+
+ const constants: typeof fsConstants;
+
+ /**
+ * Tests a user's permissions for the file or directory specified by `path`.
+ * 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`
+ * (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for
+ * possible values of `mode`.
+ *
+ * If the accessibility check is successful, the promise is resolved with no
+ * value. If any of the accessibility checks fail, the promise is rejected
+ * with an [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object. The following example checks if the file`/etc/passwd` can be read and
+ * written by the current process.
+ *
+ * ```js
+ * import { access } from 'fs/promises';
+ * import { constants } from 'fs';
+ *
+ * try {
+ * await access('/etc/passwd', constants.R_OK | constants.W_OK);
+ * console.log('can access');
+ * } catch {
+ * console.error('cannot access');
+ * }
+ * ```
+ *
+ * Using `fsPromises.access()` to check for the accessibility of a file before
+ * calling `fsPromises.open()` is not recommended. Doing so introduces a race
+ * condition, since other processes may change the file's state between the two
+ * calls. Instead, user code should open/read/write the file directly and handle
+ * the error raised if the file is not accessible.
+ * @since v10.0.0
+ * @param [mode=fs.constants.F_OK]
+ * @return Fulfills with `undefined` upon success.
+ */
+ function access(path: PathLike, mode?: number): Promise<void>;
+ /**
+ * Asynchronously copies `src` to `dest`. By default, `dest` is overwritten if it
+ * already exists.
+ *
+ * No guarantees are made about the atomicity of the copy operation. If an
+ * error occurs after the destination file has been opened for writing, an attempt
+ * will be made to remove the destination.
+ *
+ * ```js
+ * import { constants } from 'fs';
+ * import { copyFile } from 'fs/promises';
+ *
+ * try {
+ * await copyFile('source.txt', 'destination.txt');
+ * console.log('source.txt was copied to destination.txt');
+ * } catch {
+ * console.log('The file could not be copied');
+ * }
+ *
+ * // By using COPYFILE_EXCL, the operation will fail if destination.txt exists.
+ * try {
+ * await copyFile('source.txt', 'destination.txt', constants.COPYFILE_EXCL);
+ * console.log('source.txt was copied to destination.txt');
+ * } catch {
+ * console.log('The file could not be copied');
+ * }
+ * ```
+ * @since v10.0.0
+ * @param src source filename to copy
+ * @param dest destination filename of the copy operation
+ * @param [mode=0] Optional modifiers that specify the behavior of the copy operation. It is possible to create a mask consisting of the bitwise OR of two or more values (e.g.
+ * `fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`)
+ * @return Fulfills with `undefined` upon success.
+ */
+ function copyFile(src: PathLike, dest: PathLike, mode?: number): Promise<void>;
+ /**
+ * Opens a `FileHandle`.
+ *
+ * Refer to the POSIX [`open(2)`](http://man7.org/linux/man-pages/man2/open.2.html) documentation for more detail.
+ *
+ * Some characters (`< > : " / \ | ? *`) are reserved under Windows as documented
+ * by [Naming Files, Paths, and Namespaces](https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file). Under NTFS, if the filename contains
+ * a colon, Node.js will open a file system stream, as described by [this MSDN page](https://docs.microsoft.com/en-us/windows/desktop/FileIO/using-streams).
+ * @since v10.0.0
+ * @param [flags='r'] See `support of file system `flags``.
+ * @param [mode=0o666] Sets the file mode (permission and sticky bits) if the file is created.
+ * @return Fulfills with a {FileHandle} object.
+ */
+ function open(path: PathLike, flags?: string | number, mode?: Mode): Promise<FileHandle>;
+ /**
+ * Renames `oldPath` to `newPath`.
+ * @since v10.0.0
+ * @return Fulfills with `undefined` upon success.
+ */
+ function rename(oldPath: PathLike, newPath: PathLike): Promise<void>;
+ /**
+ * Truncates (shortens or extends the length) of the content at `path` to `len`bytes.
+ * @since v10.0.0
+ * @param [len=0]
+ * @return Fulfills with `undefined` upon success.
+ */
+ function truncate(path: PathLike, len?: number): Promise<void>;
+ /**
+ * Removes the directory identified by `path`.
+ *
+ * Using `fsPromises.rmdir()` on a file (not a directory) results in the
+ * promise being rejected with an `ENOENT` error on Windows and an `ENOTDIR`error on POSIX.
+ *
+ * To get a behavior similar to the `rm -rf` Unix command, use `fsPromises.rm()` with options `{ recursive: true, force: true }`.
+ * @since v10.0.0
+ * @return Fulfills with `undefined` upon success.
+ */
+ function rmdir(path: PathLike, options?: RmDirOptions): Promise<void>;
+ /**
+ * Removes files and directories (modeled on the standard POSIX `rm` utility).
+ * @since v14.14.0
+ * @return Fulfills with `undefined` upon success.
+ */
+ function rm(path: PathLike, options?: RmOptions): Promise<void>;
+ /**
+ * Asynchronously creates a directory.
+ *
+ * The optional `options` argument can be an integer specifying `mode` (permission
+ * 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
+ * rejection only when `recursive` is false.
+ * @since v10.0.0
+ * @return Upon success, fulfills with `undefined` if `recursive` is `false`, or the first directory path created if `recursive` is `true`.
+ */
+ function mkdir(
+ path: PathLike,
+ options: MakeDirectoryOptions & {
+ recursive: true;
+ },
+ ): Promise<string | undefined>;
+ /**
+ * Asynchronous mkdir(2) - create a directory.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
+ * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
+ */
+ function mkdir(
+ path: PathLike,
+ options?:
+ | Mode
+ | (MakeDirectoryOptions & {
+ recursive?: false | undefined;
+ })
+ | null,
+ ): Promise<void>;
+ /**
+ * Asynchronous mkdir(2) - create a directory.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
+ * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
+ */
+ function mkdir(path: PathLike, options?: Mode | MakeDirectoryOptions | null): Promise<string | undefined>;
+ /**
+ * Reads the contents of a directory.
+ *
+ * The optional `options` argument can be a string specifying an encoding, or an
+ * object with an `encoding` property specifying the character encoding to use for
+ * the filenames. If the `encoding` is set to `'buffer'`, the filenames returned
+ * will be passed as `Buffer` objects.
+ *
+ * If `options.withFileTypes` is set to `true`, the resolved array will contain `fs.Dirent` objects.
+ *
+ * ```js
+ * import { readdir } from 'fs/promises';
+ *
+ * try {
+ * const files = await readdir(path);
+ * for (const file of files)
+ * console.log(file);
+ * } catch (err) {
+ * console.error(err);
+ * }
+ * ```
+ * @since v10.0.0
+ * @return Fulfills with an array of the names of the files in the directory excluding `'.'` and `'..'`.
+ */
+ function readdir(
+ path: PathLike,
+ options?:
+ | (ObjectEncodingOptions & {
+ withFileTypes?: false | undefined;
+ recursive?: boolean | undefined;
+ })
+ | BufferEncoding
+ | null,
+ ): Promise<string[]>;
+ /**
+ * Asynchronous readdir(3) - read a directory.
+ * @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.
+ */
+ function readdir(
+ path: PathLike,
+ options:
+ | {
+ encoding: "buffer";
+ withFileTypes?: false | undefined;
+ recursive?: boolean | undefined;
+ }
+ | "buffer",
+ ): Promise<Buffer[]>;
+ /**
+ * Asynchronous readdir(3) - read a directory.
+ * @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.
+ */
+ function readdir(
+ path: PathLike,
+ options?:
+ | (ObjectEncodingOptions & {
+ withFileTypes?: false | undefined;
+ recursive?: boolean | undefined;
+ })
+ | BufferEncoding
+ | null,
+ ): Promise<string[] | Buffer[]>;
+ /**
+ * Asynchronous readdir(3) - read a directory.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * @param options If called with `withFileTypes: true` the result data will be an array of Dirent.
+ */
+ function readdir(
+ path: PathLike,
+ options: ObjectEncodingOptions & {
+ withFileTypes: true;
+ recursive?: boolean | undefined;
+ },
+ ): 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
+ * resolved with the`linkString` upon success.
+ *
+ * The optional `options` argument can be a string specifying an encoding, or an
+ * object with an `encoding` property specifying the character encoding to use for
+ * the link path returned. If the `encoding` is set to `'buffer'`, the link path
+ * returned will be passed as a `Buffer` object.
+ * @since v10.0.0
+ * @return Fulfills with the `linkString` upon success.
+ */
+ function readlink(path: PathLike, options?: ObjectEncodingOptions | BufferEncoding | null): Promise<string>;
+ /**
+ * Asynchronous readlink(2) - read value of a symbolic link.
+ * @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.
+ */
+ function readlink(path: PathLike, options: BufferEncodingOption): Promise<Buffer>;
+ /**
+ * Asynchronous readlink(2) - read value of a symbolic link.
+ * @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.
+ */
+ function readlink(path: PathLike, options?: ObjectEncodingOptions | string | null): Promise<string | Buffer>;
+ /**
+ * Creates a symbolic link.
+ *
+ * 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
+ * to be absolute. When using `'junction'`, the `target` argument will
+ * automatically be normalized to absolute path.
+ * @since v10.0.0
+ * @param [type='file']
+ * @return Fulfills with `undefined` upon success.
+ */
+ function symlink(target: PathLike, path: PathLike, type?: string | null): Promise<void>;
+ /**
+ * Equivalent to `fsPromises.stat()` unless `path` refers to a symbolic link,
+ * in which case the link itself is stat-ed, not the file that it refers to.
+ * Refer to the POSIX [`lstat(2)`](http://man7.org/linux/man-pages/man2/lstat.2.html) document for more detail.
+ * @since v10.0.0
+ * @return Fulfills with the {fs.Stats} object for the given symbolic link `path`.
+ */
+ function lstat(
+ path: PathLike,
+ opts?: StatOptions & {
+ bigint?: false | undefined;
+ },
+ ): Promise<Stats>;
+ function lstat(
+ path: PathLike,
+ opts: StatOptions & {
+ bigint: true;
+ },
+ ): Promise<BigIntStats>;
+ function lstat(path: PathLike, opts?: StatOptions): Promise<Stats | BigIntStats>;
+ /**
+ * @since v10.0.0
+ * @return Fulfills with the {fs.Stats} object for the given `path`.
+ */
+ function stat(
+ path: PathLike,
+ opts?: StatOptions & {
+ bigint?: false | undefined;
+ },
+ ): Promise<Stats>;
+ function stat(
+ path: PathLike,
+ opts: StatOptions & {
+ bigint: true;
+ },
+ ): Promise<BigIntStats>;
+ function stat(path: PathLike, opts?: StatOptions): Promise<Stats | BigIntStats>;
+ /**
+ * @since v18.15.0
+ * @return Fulfills with an {fs.StatFs} for the file system.
+ */
+ 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.
+ * @since v10.0.0
+ * @return Fulfills with `undefined` upon success.
+ */
+ function link(existingPath: PathLike, newPath: PathLike): Promise<void>;
+ /**
+ * If `path` refers to a symbolic link, then the link is removed without affecting
+ * the file or directory to which that link refers. If the `path` refers to a file
+ * path that is not a symbolic link, the file is deleted. See the POSIX [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html) documentation for more detail.
+ * @since v10.0.0
+ * @return Fulfills with `undefined` upon success.
+ */
+ function unlink(path: PathLike): Promise<void>;
+ /**
+ * Changes the permissions of a file.
+ * @since v10.0.0
+ * @return Fulfills with `undefined` upon success.
+ */
+ function chmod(path: PathLike, mode: Mode): Promise<void>;
+ /**
+ * Changes the permissions on a symbolic link.
+ *
+ * This method is only implemented on macOS.
+ * @deprecated Since v10.0.0
+ * @return Fulfills with `undefined` upon success.
+ */
+ function lchmod(path: PathLike, mode: Mode): Promise<void>;
+ /**
+ * Changes the ownership on a symbolic link.
+ * @since v10.0.0
+ * @return Fulfills with `undefined` upon success.
+ */
+ function lchown(path: PathLike, uid: number, gid: number): Promise<void>;
+ /**
+ * Changes the access and modification times of a file in the same way as `fsPromises.utimes()`, with the difference that if the path refers to a
+ * symbolic link, then the link is not dereferenced: instead, the timestamps of
+ * the symbolic link itself are changed.
+ * @since v14.5.0, v12.19.0
+ * @return Fulfills with `undefined` upon success.
+ */
+ function lutimes(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise<void>;
+ /**
+ * Changes the ownership of a file.
+ * @since v10.0.0
+ * @return Fulfills with `undefined` upon success.
+ */
+ function chown(path: PathLike, uid: number, gid: number): Promise<void>;
+ /**
+ * Change the file system timestamps of the object referenced by `path`.
+ *
+ * The `atime` and `mtime` arguments follow these rules:
+ *
+ * * Values can be either numbers representing Unix epoch time, `Date`s, or a
+ * 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.
+ * @since v10.0.0
+ * @return Fulfills with `undefined` upon success.
+ */
+ function utimes(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise<void>;
+ /**
+ * Determines the actual location of `path` using the same semantics as the`fs.realpath.native()` function.
+ *
+ * Only paths that can be converted to UTF8 strings are supported.
+ *
+ * The optional `options` argument can be a string specifying an encoding, or an
+ * object with an `encoding` property specifying the character encoding to use for
+ * the path. If the `encoding` is set to `'buffer'`, the path returned will be
+ * passed as a `Buffer` object.
+ *
+ * On Linux, when Node.js is linked against musl libc, the procfs file system must
+ * be mounted on `/proc` in order for this function to work. Glibc does not have
+ * this restriction.
+ * @since v10.0.0
+ * @return Fulfills with the resolved path upon success.
+ */
+ function realpath(path: PathLike, options?: ObjectEncodingOptions | BufferEncoding | null): Promise<string>;
+ /**
+ * Asynchronous realpath(3) - return the canonicalized absolute pathname.
+ * @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.
+ */
+ function realpath(path: PathLike, options: BufferEncodingOption): Promise<Buffer>;
+ /**
+ * Asynchronous realpath(3) - return the canonicalized absolute pathname.
+ * @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.
+ */
+ function realpath(
+ path: PathLike,
+ options?: ObjectEncodingOptions | BufferEncoding | null,
+ ): Promise<string | Buffer>;
+ /**
+ * 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
+ * platform inconsistencies, avoid trailing `X` characters in `prefix`. Some
+ * platforms, notably the BSDs, can return more than six random characters, and
+ * replace trailing `X` characters in `prefix` with random characters.
+ *
+ * The optional `options` argument can be a string specifying an encoding, or an
+ * object with an `encoding` property specifying the character encoding to use.
+ *
+ * ```js
+ * import { mkdtemp } from 'fs/promises';
+ *
+ * try {
+ * await mkdtemp(path.join(os.tmpdir(), 'foo-'));
+ * } catch (err) {
+ * console.error(err);
+ * }
+ * ```
+ *
+ * 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
+ * platform-specific path separator
+ * (`require('path').sep`).
+ * @since v10.0.0
+ * @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>;
+ /**
+ * Asynchronously creates a unique temporary directory.
+ * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory.
+ * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+ */
+ function mkdtemp(prefix: string, options: BufferEncodingOption): Promise<Buffer>;
+ /**
+ * Asynchronously creates a unique temporary directory.
+ * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory.
+ * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+ */
+ 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
+ * [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.
+ *
+ * The `encoding` option is ignored if `data` is a buffer.
+ *
+ * If `options` is a string, then it specifies the encoding.
+ *
+ * The `mode` option only affects the newly created file. See `fs.open()` for more details.
+ *
+ * Any specified `FileHandle` has to support writing.
+ *
+ * It is unsafe to use `fsPromises.writeFile()` multiple times on the same file
+ * without waiting for the promise to be settled.
+ *
+ * Similarly to `fsPromises.readFile` \- `fsPromises.writeFile` is a convenience
+ * 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()`.
+ *
+ * It is possible to use an `AbortSignal` to cancel an `fsPromises.writeFile()`.
+ * Cancelation is "best effort", and some amount of data is likely still
+ * to be written.
+ *
+ * ```js
+ * import { writeFile } from 'fs/promises';
+ * import { Buffer } from 'buffer';
+ *
+ * try {
+ * const controller = new AbortController();
+ * const { signal } = controller;
+ * const data = new Uint8Array(Buffer.from('Hello Node.js'));
+ * const promise = writeFile('message.txt', data, { signal });
+ *
+ * // Abort the request before the promise settles.
+ * controller.abort();
+ *
+ * await promise;
+ * } catch (err) {
+ * // When a request is aborted - err is an AbortError
+ * console.error(err);
+ * }
+ * ```
+ *
+ * Aborting an ongoing request does not abort individual operating
+ * system requests but rather the internal buffering `fs.writeFile` performs.
+ * @since v10.0.0
+ * @param file filename or `FileHandle`
+ * @return Fulfills with `undefined` upon success.
+ */
+ function writeFile(
+ file: PathLike | FileHandle,
+ data:
+ | string
+ | NodeJS.ArrayBufferView
+ | Iterable<string | NodeJS.ArrayBufferView>
+ | AsyncIterable<string | NodeJS.ArrayBufferView>
+ | Stream,
+ options?:
+ | (ObjectEncodingOptions & {
+ mode?: Mode | undefined;
+ flag?: OpenMode | undefined;
+ } & Abortable)
+ | BufferEncoding
+ | null,
+ ): Promise<void>;
+ /**
+ * Asynchronously append data to a file, creating the file if it does not yet
+ * exist. `data` can be a string or a `Buffer`.
+ *
+ * If `options` is a string, then it specifies the `encoding`.
+ *
+ * The `mode` option only affects the newly created file. See `fs.open()` for more details.
+ *
+ * The `path` may be specified as a `FileHandle` that has been opened
+ * for appending (using `fsPromises.open()`).
+ * @since v10.0.0
+ * @param path filename or {FileHandle}
+ * @return Fulfills with `undefined` upon success.
+ */
+ function appendFile(
+ path: PathLike | FileHandle,
+ data: string | Uint8Array,
+ options?: (ObjectEncodingOptions & FlagAndOpenMode) | BufferEncoding | null,
+ ): Promise<void>;
+ /**
+ * Asynchronously reads the entire contents of a file.
+ *
+ * If no encoding is specified (using `options.encoding`), the data is returned
+ * as a `Buffer` object. Otherwise, the data will be a string.
+ *
+ * If `options` is a string, then it specifies the encoding.
+ *
+ * When the `path` is a directory, the behavior of `fsPromises.readFile()` is
+ * platform-specific. On macOS, Linux, and Windows, the promise will be rejected
+ * with an error. On FreeBSD, a representation of the directory's contents will be
+ * returned.
+ *
+ * It is possible to abort an ongoing `readFile` using an `AbortSignal`. If a
+ * request is aborted the promise returned is rejected with an `AbortError`:
+ *
+ * ```js
+ * import { readFile } from 'fs/promises';
+ *
+ * try {
+ * const controller = new AbortController();
+ * const { signal } = controller;
+ * const promise = readFile(fileName, { signal });
+ *
+ * // Abort the request before the promise settles.
+ * controller.abort();
+ *
+ * await promise;
+ * } catch (err) {
+ * // When a request is aborted - err is an AbortError
+ * console.error(err);
+ * }
+ * ```
+ *
+ * Aborting an ongoing request does not abort individual operating
+ * system requests but rather the internal buffering `fs.readFile` performs.
+ *
+ * Any specified `FileHandle` has to support reading.
+ * @since v10.0.0
+ * @param path filename or `FileHandle`
+ * @return Fulfills with the contents of the file.
+ */
+ function readFile(
+ path: PathLike | FileHandle,
+ options?:
+ | ({
+ encoding?: null | undefined;
+ flag?: OpenMode | undefined;
+ } & Abortable)
+ | null,
+ ): Promise<Buffer>;
+ /**
+ * Asynchronously reads the entire contents of a file.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically.
+ * @param options An object that may contain an optional flag.
+ * If a flag is not provided, it defaults to `'r'`.
+ */
+ function readFile(
+ path: PathLike | FileHandle,
+ options:
+ | ({
+ encoding: BufferEncoding;
+ flag?: OpenMode | undefined;
+ } & Abortable)
+ | BufferEncoding,
+ ): Promise<string>;
+ /**
+ * Asynchronously reads the entire contents of a file.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically.
+ * @param options An object that may contain an optional flag.
+ * If a flag is not provided, it defaults to `'r'`.
+ */
+ function readFile(
+ path: PathLike | FileHandle,
+ options?:
+ | (
+ & ObjectEncodingOptions
+ & Abortable
+ & {
+ flag?: OpenMode | undefined;
+ }
+ )
+ | BufferEncoding
+ | null,
+ ): 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.
+ *
+ * Creates an `fs.Dir`, which contains all further functions for reading from
+ * and cleaning up the directory.
+ *
+ * The `encoding` option sets the encoding for the `path` while opening the
+ * directory and subsequent read operations.
+ *
+ * Example using async iteration:
+ *
+ * ```js
+ * import { opendir } from 'fs/promises';
+ *
+ * try {
+ * const dir = await opendir('./');
+ * for await (const dirent of dir)
+ * console.log(dirent.name);
+ * } catch (err) {
+ * console.error(err);
+ * }
+ * ```
+ *
+ * When using the async iterator, the `fs.Dir` object will be automatically
+ * closed after the iterator exits.
+ * @since v12.12.0
+ * @return Fulfills with an {fs.Dir}.
+ */
+ function opendir(path: PathLike, options?: OpenDirOptions): Promise<Dir>;
+ /**
+ * Returns an async iterator that watches for changes on `filename`, where `filename`is either a file or a directory.
+ *
+ * ```js
+ * const { watch } = require('fs/promises');
+ *
+ * const ac = new AbortController();
+ * const { signal } = ac;
+ * setTimeout(() => ac.abort(), 10000);
+ *
+ * (async () => {
+ * try {
+ * const watcher = watch(__filename, { signal });
+ * for await (const event of watcher)
+ * console.log(event);
+ * } catch (err) {
+ * if (err.name === 'AbortError')
+ * return;
+ * throw err;
+ * }
+ * })();
+ * ```
+ *
+ * On most platforms, `'rename'` is emitted whenever a filename appears or
+ * disappears in the directory.
+ *
+ * All the `caveats` for `fs.watch()` also apply to `fsPromises.watch()`.
+ * @since v15.9.0, v14.18.0
+ * @return of objects with the properties:
+ */
+ function watch(
+ filename: PathLike,
+ options:
+ | (WatchOptions & {
+ encoding: "buffer";
+ })
+ | "buffer",
+ ): AsyncIterable<FileChangeInfo<Buffer>>;
+ /**
+ * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`.
+ * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
+ * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options.
+ * If `encoding` is not supplied, the default of `'utf8'` is used.
+ * If `persistent` is not supplied, the default of `true` is used.
+ * If `recursive` is not supplied, the default of `false` is used.
+ */
+ function watch(filename: PathLike, options?: WatchOptions | BufferEncoding): AsyncIterable<FileChangeInfo<string>>;
+ /**
+ * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`.
+ * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
+ * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options.
+ * If `encoding` is not supplied, the default of `'utf8'` is used.
+ * If `persistent` is not supplied, the default of `true` is used.
+ * If `recursive` is not supplied, the default of `false` is used.
+ */
+ function watch(
+ filename: PathLike,
+ options: WatchOptions | string,
+ ): AsyncIterable<FileChangeInfo<string>> | AsyncIterable<FileChangeInfo<Buffer>>;
+ /**
+ * Asynchronously copies the entire directory structure from `src` to `dest`,
+ * including subdirectories and files.
+ *
+ * When copying a directory to another directory, globs are not supported and
+ * behavior is similar to `cp dir1/ dir2/`.
+ * @since v16.7.0
+ * @experimental
+ * @param src source path to copy.
+ * @param dest destination path to copy to.
+ * @return Fulfills with `undefined` upon success.
+ */
+ function cp(source: string | URL, destination: string | URL, opts?: CopyOptions): Promise<void>;
+}
+declare module "node:fs/promises" {
+ export * from "fs/promises";
+}
diff --git a/client/node_modules/@types/node/globals.d.ts b/client/node_modules/@types/node/globals.d.ts
new file mode 100644
index 0000000..3a449e4
--- /dev/null
+++ b/client/node_modules/@types/node/globals.d.ts
@@ -0,0 +1,381 @@
+// Declare "static" methods in Error
+interface ErrorConstructor {
+ /** Create .stack property on a target object */
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
+
+ /**
+ * Optional override for formatting stack traces
+ *
+ * @see https://v8.dev/docs/stack-trace-api#customizing-stack-traces
+ */
+ prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
+
+ stackTraceLimit: number;
+}
+
+/*-----------------------------------------------*
+ * *
+ * GLOBAL *
+ * *
+ ------------------------------------------------*/
+
+// For backwards compability
+interface NodeRequire extends NodeJS.Require {}
+interface RequireResolve extends NodeJS.RequireResolve {}
+interface NodeModule extends NodeJS.Module {}
+
+declare var process: NodeJS.Process;
+declare var console: Console;
+
+declare var __filename: string;
+declare var __dirname: string;
+
+declare var require: NodeRequire;
+declare var module: NodeModule;
+
+// Same as module.exports
+declare var exports: any;
+
+/**
+ * Only available if `--expose-gc` is passed to the process.
+ */
+declare var gc: undefined | (() => void);
+
+// #region borrowed
+// 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. */
+interface AbortController {
+ /**
+ * Returns the AbortSignal object associated with this object.
+ */
+
+ readonly signal: AbortSignal;
+ /**
+ * 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;
+}
+
+/** 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 {
+ /**
+ * Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise.
+ */
+ 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
+ : {
+ prototype: AbortController;
+ new(): AbortController;
+ };
+
+declare var AbortSignal: typeof globalThis extends { onmessage: any; AbortSignal: infer T } ? T
+ : {
+ prototype: AbortSignal;
+ new(): AbortSignal;
+ abort(reason?: any): AbortSignal;
+ timeout(milliseconds: number): AbortSignal;
+ };
+// #endregion borrowed
+
+// #region Disposable
+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> {
+ /**
+ * Takes an integer value and returns the item at that index,
+ * allowing for positive and negative integers.
+ * Negative integers count back from the last item in the array.
+ */
+ at(index: number): T | undefined;
+}
+interface String extends RelativeIndexable<string> {}
+interface Array<T> extends RelativeIndexable<T> {}
+interface ReadonlyArray<T> extends RelativeIndexable<T> {}
+interface Int8Array extends RelativeIndexable<number> {}
+interface Uint8Array extends RelativeIndexable<number> {}
+interface Uint8ClampedArray extends RelativeIndexable<number> {}
+interface Int16Array extends RelativeIndexable<number> {}
+interface Uint16Array extends RelativeIndexable<number> {}
+interface Int32Array extends RelativeIndexable<number> {}
+interface Uint32Array extends RelativeIndexable<number> {}
+interface Float32Array extends RelativeIndexable<number> {}
+interface Float64Array extends RelativeIndexable<number> {}
+interface BigInt64Array extends RelativeIndexable<bigint> {}
+interface BigUint64Array extends RelativeIndexable<bigint> {}
+// #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;
+
+/*----------------------------------------------*
+* *
+* GLOBAL INTERFACES *
+* *
+*-----------------------------------------------*/
+declare namespace NodeJS {
+ interface CallSite {
+ /**
+ * Value of "this"
+ */
+ getThis(): unknown;
+
+ /**
+ * Type of "this" as a string.
+ * This is the name of the function stored in the constructor field of
+ * "this", if available. Otherwise the object's [[Class]] internal
+ * property.
+ */
+ getTypeName(): string | null;
+
+ /**
+ * Current function
+ */
+ getFunction(): Function | undefined;
+
+ /**
+ * Name of the current function, typically its name property.
+ * If a name property is not available an attempt will be made to try
+ * to infer a name from the function's context.
+ */
+ getFunctionName(): string | null;
+
+ /**
+ * Name of the property [of "this" or one of its prototypes] that holds
+ * the current function
+ */
+ getMethodName(): string | null;
+
+ /**
+ * Name of the script [if this function was defined in a script]
+ */
+ getFileName(): string | undefined;
+
+ /**
+ * Current line number [if this function was defined in a script]
+ */
+ getLineNumber(): number | null;
+
+ /**
+ * Current column number [if this function was defined in a script]
+ */
+ getColumnNumber(): number | null;
+
+ /**
+ * A call site object representing the location where eval was called
+ * [if this function was created using a call to eval]
+ */
+ getEvalOrigin(): string | undefined;
+
+ /**
+ * Is this a toplevel invocation, that is, is "this" the global object?
+ */
+ isToplevel(): boolean;
+
+ /**
+ * Does this call take place in code defined by a call to eval?
+ */
+ isEval(): boolean;
+
+ /**
+ * Is this call in native V8 code?
+ */
+ isNative(): boolean;
+
+ /**
+ * Is this a constructor call?
+ */
+ isConstructor(): boolean;
+ }
+
+ interface ErrnoException extends Error {
+ errno?: number | undefined;
+ code?: string | undefined;
+ path?: string | undefined;
+ syscall?: string | undefined;
+ }
+
+ interface ReadableStream extends EventEmitter {
+ readable: boolean;
+ read(size?: number): string | Buffer;
+ setEncoding(encoding: BufferEncoding): this;
+ pause(): this;
+ resume(): this;
+ isPaused(): boolean;
+ pipe<T extends WritableStream>(destination: T, options?: { end?: boolean | undefined }): T;
+ unpipe(destination?: WritableStream): this;
+ unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void;
+ wrap(oldStream: ReadableStream): this;
+ [Symbol.asyncIterator](): AsyncIterableIterator<string | Buffer>;
+ }
+
+ interface WritableStream extends EventEmitter {
+ writable: boolean;
+ write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean;
+ write(str: string, encoding?: BufferEncoding, cb?: (err?: Error | null) => void): boolean;
+ end(cb?: () => void): this;
+ end(data: string | Uint8Array, cb?: () => void): this;
+ end(str: string, encoding?: BufferEncoding, cb?: () => void): this;
+ }
+
+ interface ReadWriteStream extends ReadableStream, WritableStream {}
+
+ interface RefCounted {
+ ref(): this;
+ unref(): this;
+ }
+
+ type TypedArray =
+ | Uint8Array
+ | Uint8ClampedArray
+ | Uint16Array
+ | Uint32Array
+ | Int8Array
+ | Int16Array
+ | Int32Array
+ | BigUint64Array
+ | BigInt64Array
+ | Float32Array
+ | Float64Array;
+ type ArrayBufferView = TypedArray | DataView;
+
+ interface Require {
+ (id: string): any;
+ resolve: RequireResolve;
+ cache: Dict<NodeModule>;
+ /**
+ * @deprecated
+ */
+ extensions: RequireExtensions;
+ main: Module | undefined;
+ }
+
+ interface RequireResolve {
+ (id: string, options?: { paths?: string[] | undefined }): string;
+ paths(request: string): string[] | null;
+ }
+
+ interface RequireExtensions extends Dict<(m: Module, filename: string) => any> {
+ ".js": (m: Module, filename: string) => any;
+ ".json": (m: Module, filename: string) => any;
+ ".node": (m: Module, filename: string) => any;
+ }
+ interface Module {
+ /**
+ * `true` if the module is running during the Node.js preload
+ */
+ isPreloading: boolean;
+ exports: any;
+ require: Require;
+ id: string;
+ filename: string;
+ loaded: boolean;
+ /** @deprecated since v14.6.0 Please use `require.main` and `module.children` instead. */
+ parent: Module | null | undefined;
+ children: Module[];
+ /**
+ * @since v11.14.0
+ *
+ * The directory name of the module. This is usually the same as the path.dirname() of the module.id.
+ */
+ path: string;
+ paths: string[];
+ }
+
+ interface Dict<T> {
+ [key: string]: T | undefined;
+ }
+
+ interface ReadOnlyDict<T> {
+ 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;
diff --git a/client/node_modules/@types/node/globals.global.d.ts b/client/node_modules/@types/node/globals.global.d.ts
new file mode 100644
index 0000000..ef1198c
--- /dev/null
+++ b/client/node_modules/@types/node/globals.global.d.ts
@@ -0,0 +1 @@
+declare var global: typeof globalThis;
diff --git a/client/node_modules/@types/node/http.d.ts b/client/node_modules/@types/node/http.d.ts
new file mode 100644
index 0000000..73fd70a
--- /dev/null
+++ b/client/node_modules/@types/node/http.d.ts
@@ -0,0 +1,1801 @@
+/**
+ * To use the HTTP server and client one must `require('http')`.
+ *
+ * The HTTP interfaces in Node.js are designed to support many features
+ * of the protocol which have been traditionally difficult to use.
+ * In particular, large, possibly chunk-encoded, messages. The interface is
+ * careful to never buffer entire requests or responses, so the
+ * user is able to stream data.
+ *
+ * HTTP message headers are represented by an object like this:
+ *
+ * ```js
+ * { 'content-length': '123',
+ * 'content-type': 'text/plain',
+ * 'connection': 'keep-alive',
+ * 'host': 'example.com',
+ * 'accept': '*' }
+ * ```
+ *
+ * Keys are lowercased. Values are not modified.
+ *
+ * In order to support the full spectrum of possible HTTP applications, the Node.js
+ * HTTP API is very low-level. It deals with stream handling and message
+ * parsing only. It parses a message into headers and body but it does not
+ * parse the actual headers or the body.
+ *
+ * See `message.headers` for details on how duplicate headers are handled.
+ *
+ * The raw headers as they were received are retained in the `rawHeaders`property, which is an array of `[key, value, key2, value2, ...]`. For
+ * example, the previous message header object might have a `rawHeaders`list like the following:
+ *
+ * ```js
+ * [ 'ConTent-Length', '123456',
+ * 'content-LENGTH', '123',
+ * 'content-type', 'text/plain',
+ * 'CONNECTION', 'keep-alive',
+ * 'Host', 'example.com',
+ * 'accepT', '*' ]
+ * ```
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/http.js)
+ */
+declare module "http" {
+ import * as stream from "node:stream";
+ import { URL } from "node:url";
+ import { EventEmitter } from "node:events";
+ import { LookupOptions } from "node:dns";
+ import { LookupFunction, Server as NetServer, Socket, TcpSocketConnectOpts } from "node:net";
+ // incoming headers will never contain number
+ interface IncomingHttpHeaders extends NodeJS.Dict<string | string[]> {
+ accept?: string | undefined;
+ "accept-language"?: string | undefined;
+ "accept-patch"?: string | undefined;
+ "accept-ranges"?: string | undefined;
+ "access-control-allow-credentials"?: string | undefined;
+ "access-control-allow-headers"?: string | undefined;
+ "access-control-allow-methods"?: string | undefined;
+ "access-control-allow-origin"?: string | undefined;
+ "access-control-expose-headers"?: string | undefined;
+ "access-control-max-age"?: string | undefined;
+ "access-control-request-headers"?: string | undefined;
+ "access-control-request-method"?: string | undefined;
+ age?: string | undefined;
+ allow?: string | undefined;
+ "alt-svc"?: string | undefined;
+ authorization?: string | undefined;
+ "cache-control"?: string | undefined;
+ connection?: string | undefined;
+ "content-disposition"?: string | undefined;
+ "content-encoding"?: string | undefined;
+ "content-language"?: string | undefined;
+ "content-length"?: string | undefined;
+ "content-location"?: string | undefined;
+ "content-range"?: string | undefined;
+ "content-type"?: string | undefined;
+ cookie?: string | undefined;
+ date?: string | undefined;
+ etag?: string | undefined;
+ expect?: string | undefined;
+ expires?: string | undefined;
+ forwarded?: string | undefined;
+ from?: string | undefined;
+ host?: string | undefined;
+ "if-match"?: string | undefined;
+ "if-modified-since"?: string | undefined;
+ "if-none-match"?: string | undefined;
+ "if-unmodified-since"?: string | undefined;
+ "last-modified"?: string | undefined;
+ location?: string | undefined;
+ origin?: string | undefined;
+ pragma?: string | undefined;
+ "proxy-authenticate"?: string | undefined;
+ "proxy-authorization"?: string | undefined;
+ "public-key-pins"?: string | undefined;
+ range?: string | undefined;
+ referer?: string | undefined;
+ "retry-after"?: string | undefined;
+ "sec-websocket-accept"?: string | undefined;
+ "sec-websocket-extensions"?: string | undefined;
+ "sec-websocket-key"?: string | undefined;
+ "sec-websocket-protocol"?: string | undefined;
+ "sec-websocket-version"?: string | undefined;
+ "set-cookie"?: string[] | undefined;
+ "strict-transport-security"?: string | undefined;
+ tk?: string | undefined;
+ trailer?: string | undefined;
+ "transfer-encoding"?: string | undefined;
+ upgrade?: string | undefined;
+ "user-agent"?: string | undefined;
+ vary?: string | undefined;
+ via?: string | undefined;
+ warning?: string | undefined;
+ "www-authenticate"?: string | undefined;
+ }
+ // outgoing headers allows numbers (as they are converted internally to strings)
+ type OutgoingHttpHeader = number | string | string[];
+ interface OutgoingHttpHeaders extends NodeJS.Dict<OutgoingHttpHeader> {
+ accept?: string | string[] | undefined;
+ "accept-charset"?: string | string[] | undefined;
+ "accept-encoding"?: string | string[] | undefined;
+ "accept-language"?: string | string[] | undefined;
+ "accept-ranges"?: string | undefined;
+ "access-control-allow-credentials"?: string | undefined;
+ "access-control-allow-headers"?: string | undefined;
+ "access-control-allow-methods"?: string | undefined;
+ "access-control-allow-origin"?: string | undefined;
+ "access-control-expose-headers"?: string | undefined;
+ "access-control-max-age"?: string | undefined;
+ "access-control-request-headers"?: string | undefined;
+ "access-control-request-method"?: string | undefined;
+ age?: string | undefined;
+ allow?: string | undefined;
+ authorization?: string | undefined;
+ "cache-control"?: string | undefined;
+ "cdn-cache-control"?: string | undefined;
+ connection?: string | string[] | undefined;
+ "content-disposition"?: string | undefined;
+ "content-encoding"?: string | undefined;
+ "content-language"?: string | undefined;
+ "content-length"?: string | number | undefined;
+ "content-location"?: string | undefined;
+ "content-range"?: string | undefined;
+ "content-security-policy"?: string | undefined;
+ "content-security-policy-report-only"?: string | undefined;
+ cookie?: string | string[] | undefined;
+ dav?: string | string[] | undefined;
+ dnt?: string | undefined;
+ date?: string | undefined;
+ etag?: string | undefined;
+ expect?: string | undefined;
+ expires?: string | undefined;
+ forwarded?: string | undefined;
+ from?: string | undefined;
+ host?: string | undefined;
+ "if-match"?: string | undefined;
+ "if-modified-since"?: string | undefined;
+ "if-none-match"?: string | undefined;
+ "if-range"?: string | undefined;
+ "if-unmodified-since"?: string | undefined;
+ "last-modified"?: string | undefined;
+ link?: string | string[] | undefined;
+ location?: string | undefined;
+ "max-forwards"?: string | undefined;
+ origin?: string | undefined;
+ prgama?: string | string[] | undefined;
+ "proxy-authenticate"?: string | string[] | undefined;
+ "proxy-authorization"?: string | undefined;
+ "public-key-pins"?: string | undefined;
+ "public-key-pins-report-only"?: string | undefined;
+ range?: string | undefined;
+ referer?: string | undefined;
+ "referrer-policy"?: string | undefined;
+ refresh?: string | undefined;
+ "retry-after"?: string | undefined;
+ "sec-websocket-accept"?: string | undefined;
+ "sec-websocket-extensions"?: string | string[] | undefined;
+ "sec-websocket-key"?: string | undefined;
+ "sec-websocket-protocol"?: string | string[] | undefined;
+ "sec-websocket-version"?: string | undefined;
+ server?: string | undefined;
+ "set-cookie"?: string | string[] | undefined;
+ "strict-transport-security"?: string | undefined;
+ te?: string | undefined;
+ trailer?: string | undefined;
+ "transfer-encoding"?: string | undefined;
+ "user-agent"?: string | undefined;
+ upgrade?: string | undefined;
+ "upgrade-insecure-requests"?: string | undefined;
+ vary?: string | undefined;
+ via?: string | string[] | undefined;
+ warning?: string | undefined;
+ "www-authenticate"?: string | string[] | undefined;
+ "x-content-type-options"?: string | undefined;
+ "x-dns-prefetch-control"?: string | undefined;
+ "x-frame-options"?: string | undefined;
+ "x-xss-protection"?: string | undefined;
+ }
+ interface ClientRequestArgs {
+ _defaultAgent?: Agent | undefined;
+ agent?: Agent | boolean | undefined;
+ auth?: string | null | undefined;
+ // https://github.com/nodejs/node/blob/master/lib/_http_client.js#L278
+ createConnection?:
+ | ((options: ClientRequestArgs, oncreate: (err: Error, socket: Socket) => void) => Socket)
+ | undefined;
+ defaultPort?: number | string | undefined;
+ family?: number | undefined;
+ headers?: OutgoingHttpHeaders | undefined;
+ hints?: LookupOptions["hints"];
+ host?: string | null | undefined;
+ hostname?: string | null | undefined;
+ insecureHTTPParser?: boolean | undefined;
+ localAddress?: string | undefined;
+ localPort?: number | undefined;
+ lookup?: LookupFunction | undefined;
+ /**
+ * @default 16384
+ */
+ maxHeaderSize?: number | undefined;
+ method?: string | undefined;
+ path?: string | null | undefined;
+ port?: number | string | null | undefined;
+ protocol?: string | null | undefined;
+ setHost?: boolean | undefined;
+ signal?: AbortSignal | undefined;
+ socketPath?: string | undefined;
+ timeout?: number | undefined;
+ uniqueHeaders?: Array<string | string[]> | undefined;
+ joinDuplicateHeaders?: boolean;
+ }
+ interface ServerOptions<
+ Request extends typeof IncomingMessage = typeof IncomingMessage,
+ Response extends typeof ServerResponse = typeof ServerResponse,
+ > {
+ /**
+ * Specifies the `IncomingMessage` class to be used. Useful for extending the original `IncomingMessage`.
+ */
+ IncomingMessage?: Request | undefined;
+ /**
+ * Specifies the `ServerResponse` class to be used. Useful for extending the original `ServerResponse`.
+ */
+ ServerResponse?: Response | undefined;
+ /**
+ * Sets the timeout value in milliseconds for receiving the entire request from the client.
+ * @see Server.requestTimeout for more information.
+ * @default 300000
+ * @since v18.0.0
+ */
+ requestTimeout?: number | undefined;
+ /**
+ * It joins the field line values of multiple headers in a request with `, ` instead of discarding the duplicates.
+ * @default false
+ * @since v18.14.0
+ */
+ joinDuplicateHeaders?: boolean;
+ /**
+ * The number of milliseconds of inactivity a server needs to wait for additional incoming data,
+ * after it has finished writing the last response, before a socket will be destroyed.
+ * @see Server.keepAliveTimeout for more information.
+ * @default 5000
+ * @since v18.0.0
+ */
+ keepAliveTimeout?: number | undefined;
+ /**
+ * Sets the interval value in milliseconds to check for request and headers timeout in incomplete requests.
+ * @default 30000
+ */
+ connectionsCheckingInterval?: number | undefined;
+ /**
+ * Optionally overrides all `socket`s' `readableHighWaterMark` and `writableHighWaterMark`.
+ * This affects `highWaterMark` property of both `IncomingMessage` and `ServerResponse`.
+ * Default: @see stream.getDefaultHighWaterMark().
+ * @since v18.17.0
+ */
+ highWaterMark?: number | undefined;
+ /**
+ * Use an insecure HTTP parser that accepts invalid HTTP headers when `true`.
+ * Using the insecure parser should be avoided.
+ * See --insecure-http-parser for more information.
+ * @default false
+ */
+ insecureHTTPParser?: boolean | undefined;
+ /**
+ * Optionally overrides the value of
+ * `--max-http-header-size` for requests received by this server, i.e.
+ * the maximum length of request headers in bytes.
+ * @default 16384
+ * @since v13.3.0
+ */
+ maxHeaderSize?: number | undefined;
+ /**
+ * If set to `true`, it disables the use of Nagle's algorithm immediately after a new incoming connection is received.
+ * @default true
+ * @since v16.5.0
+ */
+ noDelay?: boolean | undefined;
+ /**
+ * If set to `true`, it enables keep-alive functionality on the socket immediately after a new incoming connection is received,
+ * similarly on what is done in `socket.setKeepAlive([enable][, initialDelay])`.
+ * @default false
+ * @since v16.5.0
+ */
+ keepAlive?: boolean | undefined;
+ /**
+ * If set to a positive number, it sets the initial delay before the first keepalive probe is sent on an idle socket.
+ * @default 0
+ * @since v16.5.0
+ */
+ keepAliveInitialDelay?: number | undefined;
+ /**
+ * A list of response headers that should be sent only once.
+ * If the header's value is an array, the items will be joined using `; `.
+ */
+ uniqueHeaders?: Array<string | string[]> | undefined;
+ }
+ type RequestListener<
+ Request extends typeof IncomingMessage = typeof IncomingMessage,
+ Response extends typeof ServerResponse = typeof ServerResponse,
+ > = (req: InstanceType<Request>, res: InstanceType<Response> & { req: InstanceType<Request> }) => void;
+ /**
+ * @since v0.1.17
+ */
+ class Server<
+ Request extends typeof IncomingMessage = typeof IncomingMessage,
+ Response extends typeof ServerResponse = typeof ServerResponse,
+ > extends NetServer {
+ constructor(requestListener?: RequestListener<Request, Response>);
+ constructor(options: ServerOptions<Request, Response>, requestListener?: RequestListener<Request, Response>);
+ /**
+ * Sets the timeout value for sockets, and emits a `'timeout'` event on
+ * the Server object, passing the socket as an argument, if a timeout
+ * occurs.
+ *
+ * If there is a `'timeout'` event listener on the Server object, then it
+ * will be called with the timed-out socket as an argument.
+ *
+ * By default, the Server does not timeout sockets. However, if a callback
+ * is assigned to the Server's `'timeout'` event, timeouts must be handled
+ * explicitly.
+ * @since v0.9.12
+ * @param [msecs=0 (no timeout)]
+ */
+ setTimeout(msecs?: number, callback?: () => void): this;
+ setTimeout(callback: () => void): this;
+ /**
+ * Limits maximum incoming headers count. If set to 0, no limit will be applied.
+ * @since v0.7.0
+ */
+ maxHeadersCount: number | null;
+ /**
+ * The maximum number of requests socket can handle
+ * before closing keep alive connection.
+ *
+ * A value of `0` will disable the limit.
+ *
+ * When the limit is reached it will set the `Connection` header value to `close`,
+ * but will not actually close the connection, subsequent requests sent
+ * after the limit is reached will get `503 Service Unavailable` as a response.
+ * @since v16.10.0
+ */
+ maxRequestsPerSocket: number | null;
+ /**
+ * The number of milliseconds of inactivity before a socket is presumed
+ * to have timed out.
+ *
+ * A value of `0` will disable the timeout behavior on incoming connections.
+ *
+ * The socket timeout logic is set up on connection, so changing this
+ * value only affects new connections to the server, not any existing connections.
+ * @since v0.9.12
+ */
+ timeout: number;
+ /**
+ * Limit the amount of time the parser will wait to receive the complete HTTP
+ * headers.
+ *
+ * If the timeout expires, the server responds with status 408 without
+ * forwarding the request to the request listener and then closes the connection.
+ *
+ * It must be set to a non-zero value (e.g. 120 seconds) to protect against
+ * potential Denial-of-Service attacks in case the server is deployed without a
+ * reverse proxy in front.
+ * @since v11.3.0, v10.14.0
+ */
+ headersTimeout: number;
+ /**
+ * The number of milliseconds of inactivity a server needs to wait for additional
+ * incoming data, after it has finished writing the last response, before a socket
+ * will be destroyed. If the server receives new data before the keep-alive
+ * timeout has fired, it will reset the regular inactivity timeout, i.e.,`server.timeout`.
+ *
+ * A value of `0` will disable the keep-alive timeout behavior on incoming
+ * connections.
+ * A value of `0` makes the http server behave similarly to Node.js versions prior
+ * to 8.0.0, which did not have a keep-alive timeout.
+ *
+ * The socket timeout logic is set up on connection, so changing this value only
+ * affects new connections to the server, not any existing connections.
+ * @since v8.0.0
+ */
+ keepAliveTimeout: number;
+ /**
+ * Sets the timeout value in milliseconds for receiving the entire request from
+ * the client.
+ *
+ * If the timeout expires, the server responds with status 408 without
+ * forwarding the request to the request listener and then closes the connection.
+ *
+ * It must be set to a non-zero value (e.g. 120 seconds) to protect against
+ * potential Denial-of-Service attacks in case the server is deployed without a
+ * reverse proxy in front.
+ * @since v14.11.0
+ */
+ requestTimeout: number;
+ /**
+ * Closes all connections connected to this server.
+ * @since v18.2.0
+ */
+ closeAllConnections(): void;
+ /**
+ * Closes all connections connected to this server which are not sending a request or waiting for a response.
+ * @since v18.2.0
+ */
+ closeIdleConnections(): void;
+ addListener(event: string, listener: (...args: any[]) => void): this;
+ addListener(event: "close", listener: () => void): this;
+ addListener(event: "connection", listener: (socket: Socket) => void): this;
+ addListener(event: "error", listener: (err: Error) => void): this;
+ addListener(event: "listening", listener: () => void): this;
+ addListener(event: "checkContinue", listener: RequestListener<Request, Response>): this;
+ addListener(event: "checkExpectation", listener: RequestListener<Request, Response>): this;
+ addListener(event: "clientError", listener: (err: Error, socket: stream.Duplex) => void): this;
+ addListener(
+ event: "connect",
+ listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void,
+ ): this;
+ addListener(event: "dropRequest", listener: (req: InstanceType<Request>, socket: stream.Duplex) => void): this;
+ addListener(event: "request", listener: RequestListener<Request, Response>): this;
+ addListener(
+ event: "upgrade",
+ listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void,
+ ): this;
+ emit(event: string, ...args: any[]): boolean;
+ emit(event: "close"): boolean;
+ emit(event: "connection", socket: Socket): boolean;
+ emit(event: "error", err: Error): boolean;
+ emit(event: "listening"): boolean;
+ emit(
+ event: "checkContinue",
+ req: InstanceType<Request>,
+ res: InstanceType<Response> & { req: InstanceType<Request> },
+ ): boolean;
+ emit(
+ event: "checkExpectation",
+ req: InstanceType<Request>,
+ res: InstanceType<Response> & { req: InstanceType<Request> },
+ ): boolean;
+ emit(event: "clientError", err: Error, socket: stream.Duplex): boolean;
+ emit(event: "connect", req: InstanceType<Request>, socket: stream.Duplex, head: Buffer): boolean;
+ emit(event: "dropRequest", req: InstanceType<Request>, socket: stream.Duplex): boolean;
+ emit(
+ event: "request",
+ req: InstanceType<Request>,
+ res: InstanceType<Response> & { req: InstanceType<Request> },
+ ): boolean;
+ emit(event: "upgrade", req: InstanceType<Request>, socket: stream.Duplex, head: Buffer): boolean;
+ on(event: string, listener: (...args: any[]) => void): this;
+ on(event: "close", listener: () => void): this;
+ on(event: "connection", listener: (socket: Socket) => void): this;
+ on(event: "error", listener: (err: Error) => void): this;
+ on(event: "listening", listener: () => void): this;
+ on(event: "checkContinue", listener: RequestListener<Request, Response>): this;
+ on(event: "checkExpectation", listener: RequestListener<Request, Response>): this;
+ on(event: "clientError", listener: (err: Error, socket: stream.Duplex) => void): this;
+ on(event: "connect", listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void): this;
+ on(event: "dropRequest", listener: (req: InstanceType<Request>, socket: stream.Duplex) => void): this;
+ on(event: "request", listener: RequestListener<Request, Response>): this;
+ on(event: "upgrade", listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void): this;
+ once(event: string, listener: (...args: any[]) => void): this;
+ once(event: "close", listener: () => void): this;
+ once(event: "connection", listener: (socket: Socket) => void): this;
+ once(event: "error", listener: (err: Error) => void): this;
+ once(event: "listening", listener: () => void): this;
+ once(event: "checkContinue", listener: RequestListener<Request, Response>): this;
+ once(event: "checkExpectation", listener: RequestListener<Request, Response>): this;
+ once(event: "clientError", listener: (err: Error, socket: stream.Duplex) => void): this;
+ once(
+ event: "connect",
+ listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void,
+ ): this;
+ once(event: "dropRequest", listener: (req: InstanceType<Request>, socket: stream.Duplex) => void): this;
+ once(event: "request", listener: RequestListener<Request, Response>): this;
+ once(
+ event: "upgrade",
+ listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void,
+ ): this;
+ prependListener(event: string, listener: (...args: any[]) => void): this;
+ prependListener(event: "close", listener: () => void): this;
+ prependListener(event: "connection", listener: (socket: Socket) => void): this;
+ prependListener(event: "error", listener: (err: Error) => void): this;
+ prependListener(event: "listening", listener: () => void): this;
+ prependListener(event: "checkContinue", listener: RequestListener<Request, Response>): this;
+ prependListener(event: "checkExpectation", listener: RequestListener<Request, Response>): this;
+ prependListener(event: "clientError", listener: (err: Error, socket: stream.Duplex) => void): this;
+ prependListener(
+ event: "connect",
+ listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void,
+ ): this;
+ prependListener(
+ event: "dropRequest",
+ listener: (req: InstanceType<Request>, socket: stream.Duplex) => void,
+ ): this;
+ prependListener(event: "request", listener: RequestListener<Request, Response>): this;
+ prependListener(
+ event: "upgrade",
+ listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void,
+ ): this;
+ prependOnceListener(event: string, listener: (...args: any[]) => void): this;
+ prependOnceListener(event: "close", listener: () => void): this;
+ prependOnceListener(event: "connection", listener: (socket: Socket) => void): this;
+ prependOnceListener(event: "error", listener: (err: Error) => void): this;
+ prependOnceListener(event: "listening", listener: () => void): this;
+ prependOnceListener(event: "checkContinue", listener: RequestListener<Request, Response>): this;
+ prependOnceListener(event: "checkExpectation", listener: RequestListener<Request, Response>): this;
+ prependOnceListener(event: "clientError", listener: (err: Error, socket: stream.Duplex) => void): this;
+ prependOnceListener(
+ event: "connect",
+ listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void,
+ ): this;
+ prependOnceListener(
+ event: "dropRequest",
+ listener: (req: InstanceType<Request>, socket: stream.Duplex) => void,
+ ): this;
+ prependOnceListener(event: "request", listener: RequestListener<Request, Response>): this;
+ prependOnceListener(
+ event: "upgrade",
+ listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void,
+ ): this;
+ }
+ /**
+ * This class serves as the parent class of {@link ClientRequest} and {@link ServerResponse}. It is an abstract of outgoing message from
+ * the perspective of the participants of HTTP transaction.
+ * @since v0.1.17
+ */
+ class OutgoingMessage<Request extends IncomingMessage = IncomingMessage> extends stream.Writable {
+ readonly req: Request;
+ chunkedEncoding: boolean;
+ shouldKeepAlive: boolean;
+ useChunkedEncodingByDefault: boolean;
+ sendDate: boolean;
+ /**
+ * @deprecated Use `writableEnded` instead.
+ */
+ finished: boolean;
+ /**
+ * Read-only. `true` if the headers were sent, otherwise `false`.
+ * @since v0.9.3
+ */
+ readonly headersSent: boolean;
+ /**
+ * Aliases of `outgoingMessage.socket`
+ * @since v0.3.0
+ * @deprecated Since v15.12.0,v14.17.1 - Use `socket` instead.
+ */
+ readonly connection: Socket | null;
+ /**
+ * Reference to the underlying socket. Usually, users will not want to access
+ * this property.
+ *
+ * After calling `outgoingMessage.end()`, this property will be nulled.
+ * @since v0.3.0
+ */
+ readonly socket: Socket | null;
+ constructor();
+ /**
+ * Once a socket is associated with the message and is connected,`socket.setTimeout()` will be called with `msecs` as the first parameter.
+ * @since v0.9.12
+ * @param callback Optional function to be called when a timeout occurs. Same as binding to the `timeout` event.
+ */
+ setTimeout(msecs: number, callback?: () => void): this;
+ /**
+ * Sets a single header value for the header object.
+ * If the header already exists in the to-be-sent headers, its value will be replaced. Use an array of strings to send multiple headers with the same name.
+ * @since v0.4.0
+ * @param name Header name
+ * @param value Header value
+ */
+ setHeader(name: string, value: number | string | readonly string[]): this;
+ /**
+ * Append a single header value for the header object.
+ *
+ * If the value is an array, this is equivalent of calling this method multiple times.
+ *
+ * If there were no previous value for the header, this is equivalent of calling `outgoingMessage.setHeader(name, value)`.
+ *
+ * Depending of the value of `options.uniqueHeaders` when the client request or the server were created,
+ * this will end up in the header being sent multiple times or a single time with values joined using `; `.
+ * @since v18.3.0, v16.17.0
+ * @param name Header name
+ * @param value Header value
+ */
+ appendHeader(name: string, value: string | readonly string[]): this;
+ /**
+ * Gets the value of HTTP header with the given name. If such a name doesn't
+ * exist in message, it will be `undefined`.
+ * @since v0.4.0
+ * @param name Name of header
+ */
+ getHeader(name: string): number | string | string[] | undefined;
+ /**
+ * Returns a shallow copy of the current outgoing headers. Since a shallow
+ * copy is used, array values may be mutated without additional calls to
+ * various header-related HTTP module methods. The keys of the returned
+ * object are the header names and the values are the respective header
+ * values. All header names are lowercase.
+ *
+ * The object returned by the `outgoingMessage.getHeaders()` method does
+ * not prototypically inherit from the JavaScript Object. This means that
+ * typical Object methods such as `obj.toString()`, `obj.hasOwnProperty()`,
+ * and others are not defined and will not work.
+ *
+ * ```js
+ * outgoingMessage.setHeader('Foo', 'bar');
+ * outgoingMessage.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']);
+ *
+ * const headers = outgoingMessage.getHeaders();
+ * // headers === { foo: 'bar', 'set-cookie': ['foo=bar', 'bar=baz'] }
+ * ```
+ * @since v7.7.0
+ */
+ getHeaders(): OutgoingHttpHeaders;
+ /**
+ * Returns an array of names of headers of the outgoing outgoingMessage. All
+ * names are lowercase.
+ * @since v7.7.0
+ */
+ getHeaderNames(): string[];
+ /**
+ * Returns `true` if the header identified by `name` is currently set in the
+ * outgoing headers. The header name is case-insensitive.
+ *
+ * ```js
+ * const hasContentType = outgoingMessage.hasHeader('content-type');
+ * ```
+ * @since v7.7.0
+ */
+ hasHeader(name: string): boolean;
+ /**
+ * Removes a header that is queued for implicit sending.
+ *
+ * ```js
+ * outgoingMessage.removeHeader('Content-Encoding');
+ * ```
+ * @since v0.4.0
+ * @param name Header name
+ */
+ removeHeader(name: string): void;
+ /**
+ * Adds HTTP trailers (headers but at the end of the message) to the message.
+ *
+ * Trailers are **only** be emitted if the message is chunked encoded. If not,
+ * the trailer will be silently discarded.
+ *
+ * HTTP requires the `Trailer` header to be sent to emit trailers,
+ * with a list of header fields in its value, e.g.
+ *
+ * ```js
+ * message.writeHead(200, { 'Content-Type': 'text/plain',
+ * 'Trailer': 'Content-MD5' });
+ * message.write(fileData);
+ * message.addTrailers({ 'Content-MD5': '7895bf4b8828b55ceaf47747b4bca667' });
+ * message.end();
+ * ```
+ *
+ * Attempting to set a header field name or value that contains invalid characters
+ * will result in a `TypeError` being thrown.
+ * @since v0.3.0
+ */
+ addTrailers(headers: OutgoingHttpHeaders | ReadonlyArray<[string, string]>): void;
+ /**
+ * Compulsorily flushes the message headers
+ *
+ * For efficiency reason, Node.js normally buffers the message headers
+ * until `outgoingMessage.end()` is called or the first chunk of message data
+ * is written. It then tries to pack the headers and data into a single TCP
+ * packet.
+ *
+ * It is usually desired (it saves a TCP round-trip), but not when the first
+ * data is not sent until possibly much later. `outgoingMessage.flushHeaders()`bypasses the optimization and kickstarts the request.
+ * @since v1.6.0
+ */
+ flushHeaders(): void;
+ }
+ /**
+ * This object is created internally by an HTTP server, not by the user. It is
+ * passed as the second parameter to the `'request'` event.
+ * @since v0.1.17
+ */
+ class ServerResponse<Request extends IncomingMessage = IncomingMessage> extends OutgoingMessage<Request> {
+ /**
+ * When using implicit headers (not calling `response.writeHead()` explicitly),
+ * this property controls the status code that will be sent to the client when
+ * the headers get flushed.
+ *
+ * ```js
+ * response.statusCode = 404;
+ * ```
+ *
+ * After response header was sent to the client, this property indicates the
+ * status code which was sent out.
+ * @since v0.4.0
+ */
+ statusCode: number;
+ /**
+ * When using implicit headers (not calling `response.writeHead()` explicitly),
+ * this property controls the status message that will be sent to the client when
+ * the headers get flushed. If this is left as `undefined` then the standard
+ * message for the status code will be used.
+ *
+ * ```js
+ * response.statusMessage = 'Not found';
+ * ```
+ *
+ * After response header was sent to the client, this property indicates the
+ * status message which was sent out.
+ * @since v0.11.8
+ */
+ statusMessage: string;
+ /**
+ * If set to `true`, Node.js will check whether the `Content-Length` header value
+ * and the size of the body, in bytes, are equal. Mismatching the
+ * `Content-Length` header value will result in an `Error` being thrown,
+ * identified by `code: 'ERR_HTTP_CONTENT_LENGTH_MISMATCH'`.
+ * @since v18.10.0, v16.18.0
+ */
+ strictContentLength: boolean;
+ constructor(req: Request);
+ assignSocket(socket: Socket): void;
+ detachSocket(socket: Socket): void;
+ /**
+ * Sends an HTTP/1.1 100 Continue message to the client, indicating that
+ * the request body should be sent. See the `'checkContinue'` event on`Server`.
+ * @since v0.3.0
+ */
+ writeContinue(callback?: () => void): void;
+ /**
+ * Sends an HTTP/1.1 103 Early Hints message to the client with a Link header,
+ * indicating that the user agent can preload/preconnect the linked resources.
+ * The `hints` is an object containing the values of headers to be sent with
+ * early hints message. The optional `callback` argument will be called when
+ * the response message has been written.
+ *
+ * Example:
+ *
+ * ```js
+ * const earlyHintsLink = '</styles.css>; rel=preload; as=style';
+ * response.writeEarlyHints({
+ * 'link': earlyHintsLink,
+ * });
+ *
+ * const earlyHintsLinks = [
+ * '</styles.css>; rel=preload; as=style',
+ * '</scripts.js>; rel=preload; as=script',
+ * ];
+ * response.writeEarlyHints({
+ * 'link': earlyHintsLinks,
+ * 'x-trace-id': 'id for diagnostics'
+ * });
+ *
+ * const earlyHintsCallback = () => console.log('early hints message sent');
+ * response.writeEarlyHints({
+ * 'link': earlyHintsLinks
+ * }, earlyHintsCallback);
+ * ```
+ *
+ * @since v18.11.0
+ * @param hints An object containing the values of headers
+ * @param callback Will be called when the response message has been written
+ */
+ writeEarlyHints(hints: Record<string, string | string[]>, callback?: () => void): void;
+ /**
+ * Sends a response header to the request. The status code is a 3-digit HTTP
+ * status code, like `404`. The last argument, `headers`, are the response headers.
+ * Optionally one can give a human-readable `statusMessage` as the second
+ * argument.
+ *
+ * `headers` may be an `Array` where the keys and values are in the same list.
+ * It is _not_ a list of tuples. So, the even-numbered offsets are key values,
+ * and the odd-numbered offsets are the associated values. The array is in the same
+ * format as `request.rawHeaders`.
+ *
+ * Returns a reference to the `ServerResponse`, so that calls can be chained.
+ *
+ * ```js
+ * const body = 'hello world';
+ * response
+ * .writeHead(200, {
+ * 'Content-Length': Buffer.byteLength(body),
+ * 'Content-Type': 'text/plain'
+ * })
+ * .end(body);
+ * ```
+ *
+ * This method must only be called once on a message and it must
+ * be called before `response.end()` is called.
+ *
+ * If `response.write()` or `response.end()` are called before calling
+ * this, the implicit/mutable headers will be calculated and call this function.
+ *
+ * When headers have been set with `response.setHeader()`, they will be merged
+ * with any headers passed to `response.writeHead()`, with the headers passed
+ * to `response.writeHead()` given precedence.
+ *
+ * If this method is called and `response.setHeader()` has not been called,
+ * it will directly write the supplied header values onto the network channel
+ * without caching internally, and the `response.getHeader()` on the header
+ * will not yield the expected result. If progressive population of headers is
+ * desired with potential future retrieval and modification, use `response.setHeader()` instead.
+ *
+ * ```js
+ * // Returns content-type = text/plain
+ * const server = http.createServer((req, res) => {
+ * res.setHeader('Content-Type', 'text/html');
+ * res.setHeader('X-Foo', 'bar');
+ * res.writeHead(200, { 'Content-Type': 'text/plain' });
+ * res.end('ok');
+ * });
+ * ```
+ *
+ * `Content-Length` is given in bytes, not characters. Use `Buffer.byteLength()` to determine the length of the body in bytes. Node.js
+ * does not check whether `Content-Length` and the length of the body which has
+ * been transmitted are equal or not.
+ *
+ * Attempting to set a header field name or value that contains invalid characters
+ * will result in a `TypeError` being thrown.
+ * @since v0.1.30
+ */
+ writeHead(
+ statusCode: number,
+ statusMessage?: string,
+ headers?: OutgoingHttpHeaders | OutgoingHttpHeader[],
+ ): this;
+ writeHead(statusCode: number, headers?: OutgoingHttpHeaders | OutgoingHttpHeader[]): this;
+ /**
+ * Sends an HTTP/1.1 102 Processing message to the client, indicating that
+ * the request body should be sent.
+ * @since v10.0.0
+ */
+ writeProcessing(): void;
+ }
+ interface InformationEvent {
+ statusCode: number;
+ statusMessage: string;
+ httpVersion: string;
+ httpVersionMajor: number;
+ httpVersionMinor: number;
+ headers: IncomingHttpHeaders;
+ rawHeaders: string[];
+ }
+ /**
+ * This object is created internally and returned from {@link request}. It
+ * represents an _in-progress_ request whose header has already been queued. The
+ * header is still mutable using the `setHeader(name, value)`,`getHeader(name)`, `removeHeader(name)` API. The actual header will
+ * be sent along with the first data chunk or when calling `request.end()`.
+ *
+ * To get the response, add a listener for `'response'` to the request object.`'response'` will be emitted from the request object when the response
+ * headers have been received. The `'response'` event is executed with one
+ * argument which is an instance of {@link IncomingMessage}.
+ *
+ * During the `'response'` event, one can add listeners to the
+ * response object; particularly to listen for the `'data'` event.
+ *
+ * If no `'response'` handler is added, then the response will be
+ * entirely discarded. However, if a `'response'` event handler is added,
+ * then the data from the response object **must** be consumed, either by
+ * calling `response.read()` whenever there is a `'readable'` event, or
+ * by adding a `'data'` handler, or by calling the `.resume()` method.
+ * Until the data is consumed, the `'end'` event will not fire. Also, until
+ * the data is read it will consume memory that can eventually lead to a
+ * 'process out of memory' error.
+ *
+ * For backward compatibility, `res` will only emit `'error'` if there is an`'error'` listener registered.
+ *
+ * Node.js does not check whether Content-Length and the length of the
+ * body which has been transmitted are equal or not.
+ * @since v0.1.17
+ */
+ class ClientRequest extends OutgoingMessage {
+ /**
+ * The `request.aborted` property will be `true` if the request has
+ * been aborted.
+ * @since v0.11.14
+ * @deprecated Since v17.0.0,v16.12.0 - Check `destroyed` instead.
+ */
+ aborted: boolean;
+ /**
+ * The request host.
+ * @since v14.5.0, v12.19.0
+ */
+ host: string;
+ /**
+ * The request protocol.
+ * @since v14.5.0, v12.19.0
+ */
+ protocol: string;
+ /**
+ * When sending request through a keep-alive enabled agent, the underlying socket
+ * might be reused. But if server closes connection at unfortunate time, client
+ * may run into a 'ECONNRESET' error.
+ *
+ * ```js
+ * const http = require('http');
+ *
+ * // Server has a 5 seconds keep-alive timeout by default
+ * http
+ * .createServer((req, res) => {
+ * res.write('hello\n');
+ * res.end();
+ * })
+ * .listen(3000);
+ *
+ * setInterval(() => {
+ * // Adapting a keep-alive agent
+ * http.get('http://localhost:3000', { agent }, (res) => {
+ * res.on('data', (data) => {
+ * // Do nothing
+ * });
+ * });
+ * }, 5000); // Sending request on 5s interval so it's easy to hit idle timeout
+ * ```
+ *
+ * By marking a request whether it reused socket or not, we can do
+ * automatic error retry base on it.
+ *
+ * ```js
+ * const http = require('http');
+ * const agent = new http.Agent({ keepAlive: true });
+ *
+ * function retriableRequest() {
+ * const req = http
+ * .get('http://localhost:3000', { agent }, (res) => {
+ * // ...
+ * })
+ * .on('error', (err) => {
+ * // Check if retry is needed
+ * if (req.reusedSocket &#x26;&#x26; err.code === 'ECONNRESET') {
+ * retriableRequest();
+ * }
+ * });
+ * }
+ *
+ * retriableRequest();
+ * ```
+ * @since v13.0.0, v12.16.0
+ */
+ reusedSocket: boolean;
+ /**
+ * Limits maximum response headers count. If set to 0, no limit will be applied.
+ */
+ maxHeadersCount: number;
+ constructor(url: string | URL | ClientRequestArgs, cb?: (res: IncomingMessage) => void);
+ /**
+ * The request method.
+ * @since v0.1.97
+ */
+ method: string;
+ /**
+ * The request path.
+ * @since v0.4.0
+ */
+ path: string;
+ /**
+ * Marks the request as aborting. Calling this will cause remaining data
+ * in the response to be dropped and the socket to be destroyed.
+ * @since v0.3.8
+ * @deprecated Since v14.1.0,v13.14.0 - Use `destroy` instead.
+ */
+ abort(): void;
+ onSocket(socket: Socket): void;
+ /**
+ * Once a socket is assigned to this request and is connected `socket.setTimeout()` will be called.
+ * @since v0.5.9
+ * @param timeout Milliseconds before a request times out.
+ * @param callback Optional function to be called when a timeout occurs. Same as binding to the `'timeout'` event.
+ */
+ setTimeout(timeout: number, callback?: () => void): this;
+ /**
+ * Once a socket is assigned to this request and is connected `socket.setNoDelay()` will be called.
+ * @since v0.5.9
+ */
+ setNoDelay(noDelay?: boolean): void;
+ /**
+ * Once a socket is assigned to this request and is connected `socket.setKeepAlive()` will be called.
+ * @since v0.5.9
+ */
+ setSocketKeepAlive(enable?: boolean, initialDelay?: number): void;
+ /**
+ * Returns an array containing the unique names of the current outgoing raw
+ * headers. Header names are returned with their exact casing being set.
+ *
+ * ```js
+ * request.setHeader('Foo', 'bar');
+ * request.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']);
+ *
+ * const headerNames = request.getRawHeaderNames();
+ * // headerNames === ['Foo', 'Set-Cookie']
+ * ```
+ * @since v15.13.0, v14.17.0
+ */
+ getRawHeaderNames(): string[];
+ /**
+ * @deprecated
+ */
+ addListener(event: "abort", listener: () => void): this;
+ addListener(
+ event: "connect",
+ listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void,
+ ): this;
+ addListener(event: "continue", listener: () => void): this;
+ addListener(event: "information", listener: (info: InformationEvent) => void): this;
+ addListener(event: "response", listener: (response: IncomingMessage) => void): this;
+ addListener(event: "socket", listener: (socket: Socket) => void): this;
+ addListener(event: "timeout", listener: () => void): this;
+ addListener(
+ event: "upgrade",
+ listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void,
+ ): this;
+ addListener(event: "close", listener: () => void): this;
+ addListener(event: "drain", listener: () => void): this;
+ addListener(event: "error", listener: (err: Error) => void): this;
+ addListener(event: "finish", listener: () => void): this;
+ addListener(event: "pipe", listener: (src: stream.Readable) => void): this;
+ addListener(event: "unpipe", listener: (src: stream.Readable) => void): this;
+ addListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ /**
+ * @deprecated
+ */
+ on(event: "abort", listener: () => void): this;
+ on(event: "connect", listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this;
+ on(event: "continue", listener: () => void): this;
+ on(event: "information", listener: (info: InformationEvent) => void): this;
+ on(event: "response", listener: (response: IncomingMessage) => void): this;
+ on(event: "socket", listener: (socket: Socket) => void): this;
+ on(event: "timeout", listener: () => void): this;
+ on(event: "upgrade", listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this;
+ on(event: "close", listener: () => void): this;
+ on(event: "drain", listener: () => void): this;
+ on(event: "error", listener: (err: Error) => void): this;
+ on(event: "finish", listener: () => void): this;
+ on(event: "pipe", listener: (src: stream.Readable) => void): this;
+ on(event: "unpipe", listener: (src: stream.Readable) => void): this;
+ on(event: string | symbol, listener: (...args: any[]) => void): this;
+ /**
+ * @deprecated
+ */
+ once(event: "abort", listener: () => void): this;
+ once(event: "connect", listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this;
+ once(event: "continue", listener: () => void): this;
+ once(event: "information", listener: (info: InformationEvent) => void): this;
+ once(event: "response", listener: (response: IncomingMessage) => void): this;
+ once(event: "socket", listener: (socket: Socket) => void): this;
+ once(event: "timeout", listener: () => void): this;
+ once(event: "upgrade", listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this;
+ once(event: "close", listener: () => void): this;
+ once(event: "drain", listener: () => void): this;
+ once(event: "error", listener: (err: Error) => void): this;
+ once(event: "finish", listener: () => void): this;
+ once(event: "pipe", listener: (src: stream.Readable) => void): this;
+ once(event: "unpipe", listener: (src: stream.Readable) => void): this;
+ once(event: string | symbol, listener: (...args: any[]) => void): this;
+ /**
+ * @deprecated
+ */
+ prependListener(event: "abort", listener: () => void): this;
+ prependListener(
+ event: "connect",
+ listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void,
+ ): this;
+ prependListener(event: "continue", listener: () => void): this;
+ prependListener(event: "information", listener: (info: InformationEvent) => void): this;
+ prependListener(event: "response", listener: (response: IncomingMessage) => void): this;
+ prependListener(event: "socket", listener: (socket: Socket) => void): this;
+ prependListener(event: "timeout", listener: () => void): this;
+ prependListener(
+ event: "upgrade",
+ listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void,
+ ): this;
+ prependListener(event: "close", listener: () => void): this;
+ prependListener(event: "drain", listener: () => void): this;
+ prependListener(event: "error", listener: (err: Error) => void): this;
+ prependListener(event: "finish", listener: () => void): this;
+ prependListener(event: "pipe", listener: (src: stream.Readable) => void): this;
+ prependListener(event: "unpipe", listener: (src: stream.Readable) => void): this;
+ prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ /**
+ * @deprecated
+ */
+ prependOnceListener(event: "abort", listener: () => void): this;
+ prependOnceListener(
+ event: "connect",
+ listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void,
+ ): this;
+ prependOnceListener(event: "continue", listener: () => void): this;
+ prependOnceListener(event: "information", listener: (info: InformationEvent) => void): this;
+ prependOnceListener(event: "response", listener: (response: IncomingMessage) => void): this;
+ prependOnceListener(event: "socket", listener: (socket: Socket) => void): this;
+ prependOnceListener(event: "timeout", listener: () => void): this;
+ prependOnceListener(
+ event: "upgrade",
+ listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void,
+ ): this;
+ prependOnceListener(event: "close", listener: () => void): this;
+ prependOnceListener(event: "drain", listener: () => void): this;
+ prependOnceListener(event: "error", listener: (err: Error) => void): this;
+ prependOnceListener(event: "finish", listener: () => void): this;
+ prependOnceListener(event: "pipe", listener: (src: stream.Readable) => void): this;
+ prependOnceListener(event: "unpipe", listener: (src: stream.Readable) => void): this;
+ prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ }
+ /**
+ * An `IncomingMessage` object is created by {@link Server} or {@link ClientRequest} and passed as the first argument to the `'request'` and `'response'` event respectively. It may be used to
+ * access response
+ * status, headers and data.
+ *
+ * Different from its `socket` value which is a subclass of `stream.Duplex`, the`IncomingMessage` itself extends `stream.Readable` and is created separately to
+ * parse and emit the incoming HTTP headers and payload, as the underlying socket
+ * may be reused multiple times in case of keep-alive.
+ * @since v0.1.17
+ */
+ class IncomingMessage extends stream.Readable {
+ constructor(socket: Socket);
+ /**
+ * The `message.aborted` property will be `true` if the request has
+ * been aborted.
+ * @since v10.1.0
+ * @deprecated Since v17.0.0,v16.12.0 - Check `message.destroyed` from <a href="stream.html#class-streamreadable" class="type">stream.Readable</a>.
+ */
+ aborted: boolean;
+ /**
+ * In case of server request, the HTTP version sent by the client. In the case of
+ * client response, the HTTP version of the connected-to server.
+ * Probably either `'1.1'` or `'1.0'`.
+ *
+ * Also `message.httpVersionMajor` is the first integer and`message.httpVersionMinor` is the second.
+ * @since v0.1.1
+ */
+ httpVersion: string;
+ httpVersionMajor: number;
+ httpVersionMinor: number;
+ /**
+ * The `message.complete` property will be `true` if a complete HTTP message has
+ * been received and successfully parsed.
+ *
+ * This property is particularly useful as a means of determining if a client or
+ * server fully transmitted a message before a connection was terminated:
+ *
+ * ```js
+ * const req = http.request({
+ * host: '127.0.0.1',
+ * port: 8080,
+ * method: 'POST'
+ * }, (res) => {
+ * res.resume();
+ * res.on('end', () => {
+ * if (!res.complete)
+ * console.error(
+ * 'The connection was terminated while the message was still being sent');
+ * });
+ * });
+ * ```
+ * @since v0.3.0
+ */
+ complete: boolean;
+ /**
+ * Alias for `message.socket`.
+ * @since v0.1.90
+ * @deprecated Since v16.0.0 - Use `socket`.
+ */
+ connection: Socket;
+ /**
+ * The `net.Socket` object associated with the connection.
+ *
+ * With HTTPS support, use `request.socket.getPeerCertificate()` to obtain the
+ * client's authentication details.
+ *
+ * This property is guaranteed to be an instance of the `net.Socket` class,
+ * a subclass of `stream.Duplex`, unless the user specified a socket
+ * type other than `net.Socket` or internally nulled.
+ * @since v0.3.0
+ */
+ socket: Socket;
+ /**
+ * The request/response headers object.
+ *
+ * Key-value pairs of header names and values. Header names are lower-cased.
+ *
+ * ```js
+ * // Prints something like:
+ * //
+ * // { 'user-agent': 'curl/7.22.0',
+ * // host: '127.0.0.1:8000',
+ * // accept: '*' }
+ * console.log(request.getHeaders());
+ * ```
+ *
+ * Duplicates in raw headers are handled in the following ways, depending on the
+ * header name:
+ *
+ * * Duplicates of `age`, `authorization`, `content-length`, `content-type`,`etag`, `expires`, `from`, `host`, `if-modified-since`, `if-unmodified-since`,`last-modified`, `location`,
+ * `max-forwards`, `proxy-authorization`, `referer`,`retry-after`, `server`, or `user-agent` are discarded.
+ * * `set-cookie` is always an array. Duplicates are added to the array.
+ * * For duplicate `cookie` headers, the values are joined together with '; '.
+ * * For all other headers, the values are joined together with ', '.
+ * @since v0.1.5
+ */
+ headers: IncomingHttpHeaders;
+ /**
+ * Similar to `message.headers`, but there is no join logic and the values are always arrays of strings, even for headers received just once.
+ *
+ * ```js
+ * // Prints something like:
+ * //
+ * // { 'user-agent': ['curl/7.22.0'],
+ * // host: ['127.0.0.1:8000'],
+ * // accept: ['*'] }
+ * console.log(request.headersDistinct);
+ * ```
+ * @since v18.3.0, v16.17.0
+ */
+ headersDistinct: NodeJS.Dict<string[]>;
+ /**
+ * The raw request/response headers list exactly as they were received.
+ *
+ * The keys and values are in the same list. It is _not_ a
+ * list of tuples. So, the even-numbered offsets are key values, and the
+ * odd-numbered offsets are the associated values.
+ *
+ * Header names are not lowercased, and duplicates are not merged.
+ *
+ * ```js
+ * // Prints something like:
+ * //
+ * // [ 'user-agent',
+ * // 'this is invalid because there can be only one',
+ * // 'User-Agent',
+ * // 'curl/7.22.0',
+ * // 'Host',
+ * // '127.0.0.1:8000',
+ * // 'ACCEPT',
+ * // '*' ]
+ * console.log(request.rawHeaders);
+ * ```
+ * @since v0.11.6
+ */
+ rawHeaders: string[];
+ /**
+ * The request/response trailers object. Only populated at the `'end'` event.
+ * @since v0.3.0
+ */
+ trailers: NodeJS.Dict<string>;
+ /**
+ * Similar to `message.trailers`, but there is no join logic and the values are always arrays of strings, even for headers received just once.
+ * Only populated at the `'end'` event.
+ * @since v18.3.0, v16.17.0
+ */
+ trailersDistinct: NodeJS.Dict<string[]>;
+ /**
+ * The raw request/response trailer keys and values exactly as they were
+ * received. Only populated at the `'end'` event.
+ * @since v0.11.6
+ */
+ rawTrailers: string[];
+ /**
+ * Calls `message.socket.setTimeout(msecs, callback)`.
+ * @since v0.5.9
+ */
+ setTimeout(msecs: number, callback?: () => void): this;
+ /**
+ * **Only valid for request obtained from {@link Server}.**
+ *
+ * The request method as a string. Read only. Examples: `'GET'`, `'DELETE'`.
+ * @since v0.1.1
+ */
+ method?: string | undefined;
+ /**
+ * **Only valid for request obtained from {@link Server}.**
+ *
+ * Request URL string. This contains only the URL that is present in the actual
+ * HTTP request. Take the following request:
+ *
+ * ```http
+ * GET /status?name=ryan HTTP/1.1
+ * Accept: text/plain
+ * ```
+ *
+ * To parse the URL into its parts:
+ *
+ * ```js
+ * new URL(request.url, `http://${request.getHeaders().host}`);
+ * ```
+ *
+ * When `request.url` is `'/status?name=ryan'` and`request.getHeaders().host` is `'localhost:3000'`:
+ *
+ * ```console
+ * $ node
+ * > new URL(request.url, `http://${request.getHeaders().host}`)
+ * URL {
+ * href: 'http://localhost:3000/status?name=ryan',
+ * origin: 'http://localhost:3000',
+ * protocol: 'http:',
+ * username: '',
+ * password: '',
+ * host: 'localhost:3000',
+ * hostname: 'localhost',
+ * port: '3000',
+ * pathname: '/status',
+ * search: '?name=ryan',
+ * searchParams: URLSearchParams { 'name' => 'ryan' },
+ * hash: ''
+ * }
+ * ```
+ * @since v0.1.90
+ */
+ url?: string | undefined;
+ /**
+ * **Only valid for response obtained from {@link ClientRequest}.**
+ *
+ * The 3-digit HTTP response status code. E.G. `404`.
+ * @since v0.1.1
+ */
+ statusCode?: number | undefined;
+ /**
+ * **Only valid for response obtained from {@link ClientRequest}.**
+ *
+ * The HTTP response status message (reason phrase). E.G. `OK` or `Internal Server Error`.
+ * @since v0.11.10
+ */
+ statusMessage?: string | undefined;
+ /**
+ * Calls `destroy()` on the socket that received the `IncomingMessage`. If `error`is provided, an `'error'` event is emitted on the socket and `error` is passed
+ * as an argument to any listeners on the event.
+ * @since v0.3.0
+ */
+ destroy(error?: Error): this;
+ }
+ interface AgentOptions extends Partial<TcpSocketConnectOpts> {
+ /**
+ * Keep sockets around in a pool to be used by other requests in the future. Default = false
+ */
+ keepAlive?: boolean | undefined;
+ /**
+ * When using HTTP KeepAlive, how often to send TCP KeepAlive packets over sockets being kept alive. Default = 1000.
+ * Only relevant if keepAlive is set to true.
+ */
+ keepAliveMsecs?: number | undefined;
+ /**
+ * Maximum number of sockets to allow per host. Default for Node 0.10 is 5, default for Node 0.12 is Infinity
+ */
+ maxSockets?: number | undefined;
+ /**
+ * Maximum number of sockets allowed for all hosts in total. Each request will use a new socket until the maximum is reached. Default: Infinity.
+ */
+ maxTotalSockets?: number | undefined;
+ /**
+ * Maximum number of sockets to leave open in a free state. Only relevant if keepAlive is set to true. Default = 256.
+ */
+ maxFreeSockets?: number | undefined;
+ /**
+ * Socket timeout in milliseconds. This will set the timeout after the socket is connected.
+ */
+ timeout?: number | undefined;
+ /**
+ * Scheduling strategy to apply when picking the next free socket to use.
+ * @default `lifo`
+ */
+ scheduling?: "fifo" | "lifo" | undefined;
+ }
+ /**
+ * An `Agent` is responsible for managing connection persistence
+ * and reuse for HTTP clients. It maintains a queue of pending requests
+ * for a given host and port, reusing a single socket connection for each
+ * until the queue is empty, at which time the socket is either destroyed
+ * or put into a pool where it is kept to be used again for requests to the
+ * same host and port. Whether it is destroyed or pooled depends on the`keepAlive` `option`.
+ *
+ * Pooled connections have TCP Keep-Alive enabled for them, but servers may
+ * still close idle connections, in which case they will be removed from the
+ * pool and a new connection will be made when a new HTTP request is made for
+ * that host and port. Servers may also refuse to allow multiple requests
+ * over the same connection, in which case the connection will have to be
+ * remade for every request and cannot be pooled. The `Agent` will still make
+ * the requests to that server, but each one will occur over a new connection.
+ *
+ * When a connection is closed by the client or the server, it is removed
+ * from the pool. Any unused sockets in the pool will be unrefed so as not
+ * to keep the Node.js process running when there are no outstanding requests.
+ * (see `socket.unref()`).
+ *
+ * It is good practice, to `destroy()` an `Agent` instance when it is no
+ * longer in use, because unused sockets consume OS resources.
+ *
+ * Sockets are removed from an agent when the socket emits either
+ * a `'close'` event or an `'agentRemove'` event. When intending to keep one
+ * HTTP request open for a long time without keeping it in the agent, something
+ * like the following may be done:
+ *
+ * ```js
+ * http.get(options, (res) => {
+ * // Do stuff
+ * }).on('socket', (socket) => {
+ * socket.emit('agentRemove');
+ * });
+ * ```
+ *
+ * An agent may also be used for an individual request. By providing`{agent: false}` as an option to the `http.get()` or `http.request()`functions, a one-time use `Agent` with default options
+ * will be used
+ * for the client connection.
+ *
+ * `agent:false`:
+ *
+ * ```js
+ * http.get({
+ * hostname: 'localhost',
+ * port: 80,
+ * path: '/',
+ * agent: false // Create a new agent just for this one request
+ * }, (res) => {
+ * // Do stuff with response
+ * });
+ * ```
+ * @since v0.3.4
+ */
+ class Agent extends EventEmitter {
+ /**
+ * By default set to 256. For agents with `keepAlive` enabled, this
+ * sets the maximum number of sockets that will be left open in the free
+ * state.
+ * @since v0.11.7
+ */
+ maxFreeSockets: number;
+ /**
+ * By default set to `Infinity`. Determines how many concurrent sockets the agent
+ * can have open per origin. Origin is the returned value of `agent.getName()`.
+ * @since v0.3.6
+ */
+ maxSockets: number;
+ /**
+ * By default set to `Infinity`. Determines how many concurrent sockets the agent
+ * can have open. Unlike `maxSockets`, this parameter applies across all origins.
+ * @since v14.5.0, v12.19.0
+ */
+ maxTotalSockets: number;
+ /**
+ * An object which contains arrays of sockets currently awaiting use by
+ * the agent when `keepAlive` is enabled. Do not modify.
+ *
+ * Sockets in the `freeSockets` list will be automatically destroyed and
+ * removed from the array on `'timeout'`.
+ * @since v0.11.4
+ */
+ readonly freeSockets: NodeJS.ReadOnlyDict<Socket[]>;
+ /**
+ * An object which contains arrays of sockets currently in use by the
+ * agent. Do not modify.
+ * @since v0.3.6
+ */
+ readonly sockets: NodeJS.ReadOnlyDict<Socket[]>;
+ /**
+ * An object which contains queues of requests that have not yet been assigned to
+ * sockets. Do not modify.
+ * @since v0.5.9
+ */
+ readonly requests: NodeJS.ReadOnlyDict<IncomingMessage[]>;
+ constructor(opts?: AgentOptions);
+ /**
+ * Destroy any sockets that are currently in use by the agent.
+ *
+ * It is usually not necessary to do this. However, if using an
+ * agent with `keepAlive` enabled, then it is best to explicitly shut down
+ * the agent when it is no longer needed. Otherwise,
+ * sockets might stay open for quite a long time before the server
+ * terminates them.
+ * @since v0.11.4
+ */
+ destroy(): void;
+ }
+ const METHODS: string[];
+ const STATUS_CODES: {
+ [errorCode: number]: string | undefined;
+ [errorCode: string]: string | undefined;
+ };
+ /**
+ * Returns a new instance of {@link Server}.
+ *
+ * The `requestListener` is a function which is automatically
+ * added to the `'request'` event.
+ * @since v0.1.13
+ */
+ function createServer<
+ Request extends typeof IncomingMessage = typeof IncomingMessage,
+ Response extends typeof ServerResponse = typeof ServerResponse,
+ >(requestListener?: RequestListener<Request, Response>): Server<Request, Response>;
+ function createServer<
+ Request extends typeof IncomingMessage = typeof IncomingMessage,
+ Response extends typeof ServerResponse = typeof ServerResponse,
+ >(
+ options: ServerOptions<Request, Response>,
+ requestListener?: RequestListener<Request, Response>,
+ ): Server<Request, Response>;
+ // although RequestOptions are passed as ClientRequestArgs to ClientRequest directly,
+ // create interface RequestOptions would make the naming more clear to developers
+ interface RequestOptions extends ClientRequestArgs {}
+ /**
+ * `options` in `socket.connect()` are also supported.
+ *
+ * Node.js maintains several connections per server to make HTTP requests.
+ * This function allows one to transparently issue requests.
+ *
+ * `url` can be a string or a `URL` object. If `url` is a
+ * string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object.
+ *
+ * If both `url` and `options` are specified, the objects are merged, with the`options` properties taking precedence.
+ *
+ * The optional `callback` parameter will be added as a one-time listener for
+ * the `'response'` event.
+ *
+ * `http.request()` returns an instance of the {@link ClientRequest} class. The `ClientRequest` instance is a writable stream. If one needs to
+ * upload a file with a POST request, then write to the `ClientRequest` object.
+ *
+ * ```js
+ * const http = require('http');
+ *
+ * const postData = JSON.stringify({
+ * 'msg': 'Hello World!'
+ * });
+ *
+ * const options = {
+ * hostname: 'www.google.com',
+ * port: 80,
+ * path: '/upload',
+ * method: 'POST',
+ * headers: {
+ * 'Content-Type': 'application/json',
+ * 'Content-Length': Buffer.byteLength(postData)
+ * }
+ * };
+ *
+ * const req = http.request(options, (res) => {
+ * console.log(`STATUS: ${res.statusCode}`);
+ * console.log(`HEADERS: ${JSON.stringify(res.headers)}`);
+ * res.setEncoding('utf8');
+ * res.on('data', (chunk) => {
+ * console.log(`BODY: ${chunk}`);
+ * });
+ * res.on('end', () => {
+ * console.log('No more data in response.');
+ * });
+ * });
+ *
+ * req.on('error', (e) => {
+ * console.error(`problem with request: ${e.message}`);
+ * });
+ *
+ * // Write data to request body
+ * req.write(postData);
+ * req.end();
+ * ```
+ *
+ * In the example `req.end()` was called. With `http.request()` one
+ * must always call `req.end()` to signify the end of the request -
+ * even if there is no data being written to the request body.
+ *
+ * If any error is encountered during the request (be that with DNS resolution,
+ * TCP level errors, or actual HTTP parse errors) an `'error'` event is emitted
+ * on the returned request object. As with all `'error'` events, if no listeners
+ * are registered the error will be thrown.
+ *
+ * There are a few special headers that should be noted.
+ *
+ * * Sending a 'Connection: keep-alive' will notify Node.js that the connection to
+ * the server should be persisted until the next request.
+ * * Sending a 'Content-Length' header will disable the default chunked encoding.
+ * * Sending an 'Expect' header will immediately send the request headers.
+ * Usually, when sending 'Expect: 100-continue', both a timeout and a listener
+ * for the `'continue'` event should be set. See RFC 2616 Section 8.2.3 for more
+ * information.
+ * * Sending an Authorization header will override using the `auth` option
+ * to compute basic authentication.
+ *
+ * Example using a `URL` as `options`:
+ *
+ * ```js
+ * const options = new URL('http://abc:xyz@example.com');
+ *
+ * const req = http.request(options, (res) => {
+ * // ...
+ * });
+ * ```
+ *
+ * In a successful request, the following events will be emitted in the following
+ * order:
+ *
+ * * `'socket'`
+ * * `'response'`
+ * * `'data'` any number of times, on the `res` object
+ * (`'data'` will not be emitted at all if the response body is empty, for
+ * instance, in most redirects)
+ * * `'end'` on the `res` object
+ * * `'close'`
+ *
+ * In the case of a connection error, the following events will be emitted:
+ *
+ * * `'socket'`
+ * * `'error'`
+ * * `'close'`
+ *
+ * In the case of a premature connection close before the response is received,
+ * the following events will be emitted in the following order:
+ *
+ * * `'socket'`
+ * * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'`
+ * * `'close'`
+ *
+ * In the case of a premature connection close after the response is received,
+ * the following events will be emitted in the following order:
+ *
+ * * `'socket'`
+ * * `'response'`
+ * * `'data'` any number of times, on the `res` object
+ * * (connection closed here)
+ * * `'aborted'` on the `res` object
+ * * `'error'` on the `res` object with an error with message`'Error: aborted'` and code `'ECONNRESET'`.
+ * * `'close'`
+ * * `'close'` on the `res` object
+ *
+ * If `req.destroy()` is called before a socket is assigned, the following
+ * events will be emitted in the following order:
+ *
+ * * (`req.destroy()` called here)
+ * * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'`
+ * * `'close'`
+ *
+ * If `req.destroy()` is called before the connection succeeds, the following
+ * events will be emitted in the following order:
+ *
+ * * `'socket'`
+ * * (`req.destroy()` called here)
+ * * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'`
+ * * `'close'`
+ *
+ * If `req.destroy()` is called after the response is received, the following
+ * events will be emitted in the following order:
+ *
+ * * `'socket'`
+ * * `'response'`
+ * * `'data'` any number of times, on the `res` object
+ * * (`req.destroy()` called here)
+ * * `'aborted'` on the `res` object
+ * * `'error'` on the `res` object with an error with message`'Error: aborted'` and code `'ECONNRESET'`.
+ * * `'close'`
+ * * `'close'` on the `res` object
+ *
+ * If `req.abort()` is called before a socket is assigned, the following
+ * events will be emitted in the following order:
+ *
+ * * (`req.abort()` called here)
+ * * `'abort'`
+ * * `'close'`
+ *
+ * If `req.abort()` is called before the connection succeeds, the following
+ * events will be emitted in the following order:
+ *
+ * * `'socket'`
+ * * (`req.abort()` called here)
+ * * `'abort'`
+ * * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'`
+ * * `'close'`
+ *
+ * If `req.abort()` is called after the response is received, the following
+ * events will be emitted in the following order:
+ *
+ * * `'socket'`
+ * * `'response'`
+ * * `'data'` any number of times, on the `res` object
+ * * (`req.abort()` called here)
+ * * `'abort'`
+ * * `'aborted'` on the `res` object
+ * * `'error'` on the `res` object with an error with message`'Error: aborted'` and code `'ECONNRESET'`.
+ * * `'close'`
+ * * `'close'` on the `res` object
+ *
+ * Setting the `timeout` option or using the `setTimeout()` function will
+ * not abort the request or do anything besides add a `'timeout'` event.
+ *
+ * Passing an `AbortSignal` and then calling `abort` on the corresponding`AbortController` will behave the same way as calling `.destroy()` on the
+ * request itself.
+ * @since v0.3.6
+ */
+ function request(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest;
+ function request(
+ url: string | URL,
+ options: RequestOptions,
+ callback?: (res: IncomingMessage) => void,
+ ): ClientRequest;
+ /**
+ * Since most requests are GET requests without bodies, Node.js provides this
+ * convenience method. The only difference between this method and {@link request} is that it sets the method to GET and calls `req.end()`automatically. The callback must take care to consume the
+ * response
+ * data for reasons stated in {@link ClientRequest} section.
+ *
+ * The `callback` is invoked with a single argument that is an instance of {@link IncomingMessage}.
+ *
+ * JSON fetching example:
+ *
+ * ```js
+ * http.get('http://localhost:8000/', (res) => {
+ * const { statusCode } = res;
+ * const contentType = res.headers['content-type'];
+ *
+ * let error;
+ * // Any 2xx status code signals a successful response but
+ * // here we're only checking for 200.
+ * if (statusCode !== 200) {
+ * error = new Error('Request Failed.\n' +
+ * `Status Code: ${statusCode}`);
+ * } else if (!/^application\/json/.test(contentType)) {
+ * error = new Error('Invalid content-type.\n' +
+ * `Expected application/json but received ${contentType}`);
+ * }
+ * if (error) {
+ * console.error(error.message);
+ * // Consume response data to free up memory
+ * res.resume();
+ * return;
+ * }
+ *
+ * res.setEncoding('utf8');
+ * let rawData = '';
+ * res.on('data', (chunk) => { rawData += chunk; });
+ * res.on('end', () => {
+ * try {
+ * const parsedData = JSON.parse(rawData);
+ * console.log(parsedData);
+ * } catch (e) {
+ * console.error(e.message);
+ * }
+ * });
+ * }).on('error', (e) => {
+ * console.error(`Got error: ${e.message}`);
+ * });
+ *
+ * // Create a local server to receive data from
+ * const server = http.createServer((req, res) => {
+ * res.writeHead(200, { 'Content-Type': 'application/json' });
+ * res.end(JSON.stringify({
+ * data: 'Hello World!'
+ * }));
+ * });
+ *
+ * server.listen(8000);
+ * ```
+ * @since v0.3.6
+ * @param options Accepts the same `options` as {@link request}, with the `method` always set to `GET`. Properties that are inherited from the prototype are ignored.
+ */
+ function get(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest;
+ function get(url: string | URL, options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest;
+
+ /**
+ * Performs the low-level validations on the provided name that are done when `res.setHeader(name, value)` is called.
+ * Passing illegal value as name will result in a TypeError being thrown, identified by `code: 'ERR_INVALID_HTTP_TOKEN'`.
+ * @param name Header name
+ * @since v14.3.0
+ */
+ function validateHeaderName(name: string): void;
+ /**
+ * Performs the low-level validations on the provided value that are done when `res.setHeader(name, value)` is called.
+ * Passing illegal value as value will result in a TypeError being thrown.
+ * - Undefined value error is identified by `code: 'ERR_HTTP_INVALID_HEADER_VALUE'`.
+ * - Invalid value character error is identified by `code: 'ERR_INVALID_CHAR'`.
+ * @param name Header name
+ * @param value Header value
+ * @since v14.3.0
+ */
+ function validateHeaderValue(name: string, value: string): void;
+
+ /**
+ * Set the maximum number of idle HTTP parsers. Default: 1000.
+ * @param count
+ * @since v18.8.0, v16.18.0
+ */
+ function setMaxIdleHTTPParsers(count: number): void;
+
+ let globalAgent: Agent;
+ /**
+ * Read-only property specifying the maximum allowed size of HTTP headers in bytes.
+ * Defaults to 16KB. Configurable using the `--max-http-header-size` CLI option.
+ */
+ const maxHeaderSize: number;
+}
+declare module "node:http" {
+ export * from "http";
+}
diff --git a/client/node_modules/@types/node/http2.d.ts b/client/node_modules/@types/node/http2.d.ts
new file mode 100644
index 0000000..03e92ab
--- /dev/null
+++ b/client/node_modules/@types/node/http2.d.ts
@@ -0,0 +1,2386 @@
+/**
+ * The `http2` module provides an implementation of the [HTTP/2](https://tools.ietf.org/html/rfc7540) protocol. It
+ * can be accessed using:
+ *
+ * ```js
+ * const http2 = require('http2');
+ * ```
+ * @since v8.4.0
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/http2.js)
+ */
+declare module "http2" {
+ import EventEmitter = require("node:events");
+ import * as fs from "node:fs";
+ import * as net from "node:net";
+ import * as stream from "node:stream";
+ import * as tls from "node:tls";
+ import * as url from "node:url";
+ import {
+ IncomingHttpHeaders as Http1IncomingHttpHeaders,
+ IncomingMessage,
+ OutgoingHttpHeaders,
+ ServerResponse,
+ } from "node:http";
+ export { OutgoingHttpHeaders } from "node:http";
+ export interface IncomingHttpStatusHeader {
+ ":status"?: number | undefined;
+ }
+ export interface IncomingHttpHeaders extends Http1IncomingHttpHeaders {
+ ":path"?: string | undefined;
+ ":method"?: string | undefined;
+ ":authority"?: string | undefined;
+ ":scheme"?: string | undefined;
+ }
+ // Http2Stream
+ export interface StreamPriorityOptions {
+ exclusive?: boolean | undefined;
+ parent?: number | undefined;
+ weight?: number | undefined;
+ silent?: boolean | undefined;
+ }
+ export interface StreamState {
+ localWindowSize?: number | undefined;
+ state?: number | undefined;
+ localClose?: number | undefined;
+ remoteClose?: number | undefined;
+ sumDependencyWeight?: number | undefined;
+ weight?: number | undefined;
+ }
+ export interface ServerStreamResponseOptions {
+ endStream?: boolean | undefined;
+ waitForTrailers?: boolean | undefined;
+ }
+ export interface StatOptions {
+ offset: number;
+ length: number;
+ }
+ export interface ServerStreamFileResponseOptions {
+ // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
+ statCheck?(stats: fs.Stats, headers: OutgoingHttpHeaders, statOptions: StatOptions): void | boolean;
+ waitForTrailers?: boolean | undefined;
+ offset?: number | undefined;
+ length?: number | undefined;
+ }
+ export interface ServerStreamFileResponseOptionsWithError extends ServerStreamFileResponseOptions {
+ onError?(err: NodeJS.ErrnoException): void;
+ }
+ export interface Http2Stream extends stream.Duplex {
+ /**
+ * Set to `true` if the `Http2Stream` instance was aborted abnormally. When set,
+ * the `'aborted'` event will have been emitted.
+ * @since v8.4.0
+ */
+ readonly aborted: boolean;
+ /**
+ * This property shows the number of characters currently buffered to be written.
+ * See `net.Socket.bufferSize` for details.
+ * @since v11.2.0, v10.16.0
+ */
+ readonly bufferSize: number;
+ /**
+ * Set to `true` if the `Http2Stream` instance has been closed.
+ * @since v9.4.0
+ */
+ readonly closed: boolean;
+ /**
+ * Set to `true` if the `Http2Stream` instance has been destroyed and is no longer
+ * usable.
+ * @since v8.4.0
+ */
+ readonly destroyed: boolean;
+ /**
+ * Set to `true` if the `END_STREAM` flag was set in the request or response
+ * HEADERS frame received, indicating that no additional data should be received
+ * and the readable side of the `Http2Stream` will be closed.
+ * @since v10.11.0
+ */
+ readonly endAfterHeaders: boolean;
+ /**
+ * The numeric stream identifier of this `Http2Stream` instance. Set to `undefined`if the stream identifier has not yet been assigned.
+ * @since v8.4.0
+ */
+ readonly id?: number | undefined;
+ /**
+ * Set to `true` if the `Http2Stream` instance has not yet been assigned a
+ * numeric stream identifier.
+ * @since v9.4.0
+ */
+ readonly pending: boolean;
+ /**
+ * Set to the `RST_STREAM` `error code` reported when the `Http2Stream` is
+ * destroyed after either receiving an `RST_STREAM` frame from the connected peer,
+ * calling `http2stream.close()`, or `http2stream.destroy()`. Will be`undefined` if the `Http2Stream` has not been closed.
+ * @since v8.4.0
+ */
+ readonly rstCode: number;
+ /**
+ * An object containing the outbound headers sent for this `Http2Stream`.
+ * @since v9.5.0
+ */
+ readonly sentHeaders: OutgoingHttpHeaders;
+ /**
+ * An array of objects containing the outbound informational (additional) headers
+ * sent for this `Http2Stream`.
+ * @since v9.5.0
+ */
+ readonly sentInfoHeaders?: OutgoingHttpHeaders[] | undefined;
+ /**
+ * An object containing the outbound trailers sent for this `HttpStream`.
+ * @since v9.5.0
+ */
+ readonly sentTrailers?: OutgoingHttpHeaders | undefined;
+ /**
+ * A reference to the `Http2Session` instance that owns this `Http2Stream`. The
+ * value will be `undefined` after the `Http2Stream` instance is destroyed.
+ * @since v8.4.0
+ */
+ readonly session: Http2Session | undefined;
+ /**
+ * Provides miscellaneous information about the current state of the`Http2Stream`.
+ *
+ * A current state of this `Http2Stream`.
+ * @since v8.4.0
+ */
+ readonly state: StreamState;
+ /**
+ * Closes the `Http2Stream` instance by sending an `RST_STREAM` frame to the
+ * connected HTTP/2 peer.
+ * @since v8.4.0
+ * @param [code=http2.constants.NGHTTP2_NO_ERROR] Unsigned 32-bit integer identifying the error code.
+ * @param callback An optional function registered to listen for the `'close'` event.
+ */
+ close(code?: number, callback?: () => void): void;
+ /**
+ * Updates the priority for this `Http2Stream` instance.
+ * @since v8.4.0
+ */
+ priority(options: StreamPriorityOptions): void;
+ /**
+ * ```js
+ * const http2 = require('http2');
+ * const client = http2.connect('http://example.org:8000');
+ * const { NGHTTP2_CANCEL } = http2.constants;
+ * const req = client.request({ ':path': '/' });
+ *
+ * // Cancel the stream if there's no activity after 5 seconds
+ * req.setTimeout(5000, () => req.close(NGHTTP2_CANCEL));
+ * ```
+ * @since v8.4.0
+ */
+ setTimeout(msecs: number, callback?: () => void): void;
+ /**
+ * Sends a trailing `HEADERS` frame to the connected HTTP/2 peer. This method
+ * will cause the `Http2Stream` to be immediately closed and must only be
+ * called after the `'wantTrailers'` event has been emitted. When sending a
+ * request or sending a response, the `options.waitForTrailers` option must be set
+ * in order to keep the `Http2Stream` open after the final `DATA` frame so that
+ * trailers can be sent.
+ *
+ * ```js
+ * const http2 = require('http2');
+ * const server = http2.createServer();
+ * server.on('stream', (stream) => {
+ * stream.respond(undefined, { waitForTrailers: true });
+ * stream.on('wantTrailers', () => {
+ * stream.sendTrailers({ xyz: 'abc' });
+ * });
+ * stream.end('Hello World');
+ * });
+ * ```
+ *
+ * The HTTP/1 specification forbids trailers from containing HTTP/2 pseudo-header
+ * fields (e.g. `':method'`, `':path'`, etc).
+ * @since v10.0.0
+ */
+ sendTrailers(headers: OutgoingHttpHeaders): void;
+ addListener(event: "aborted", listener: () => void): this;
+ addListener(event: "close", listener: () => void): this;
+ addListener(event: "data", listener: (chunk: Buffer | string) => void): this;
+ addListener(event: "drain", listener: () => void): this;
+ addListener(event: "end", listener: () => void): this;
+ addListener(event: "error", listener: (err: Error) => void): this;
+ addListener(event: "finish", listener: () => void): this;
+ addListener(event: "frameError", listener: (frameType: number, errorCode: number) => void): this;
+ addListener(event: "pipe", listener: (src: stream.Readable) => void): this;
+ addListener(event: "unpipe", listener: (src: stream.Readable) => void): this;
+ addListener(event: "streamClosed", listener: (code: number) => void): this;
+ addListener(event: "timeout", listener: () => void): this;
+ addListener(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this;
+ addListener(event: "wantTrailers", listener: () => void): this;
+ addListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ emit(event: "aborted"): boolean;
+ emit(event: "close"): boolean;
+ emit(event: "data", chunk: Buffer | string): boolean;
+ emit(event: "drain"): boolean;
+ emit(event: "end"): boolean;
+ emit(event: "error", err: Error): boolean;
+ emit(event: "finish"): boolean;
+ emit(event: "frameError", frameType: number, errorCode: number): boolean;
+ emit(event: "pipe", src: stream.Readable): boolean;
+ emit(event: "unpipe", src: stream.Readable): boolean;
+ emit(event: "streamClosed", code: number): boolean;
+ emit(event: "timeout"): boolean;
+ emit(event: "trailers", trailers: IncomingHttpHeaders, flags: number): boolean;
+ emit(event: "wantTrailers"): boolean;
+ emit(event: string | symbol, ...args: any[]): boolean;
+ on(event: "aborted", listener: () => void): this;
+ on(event: "close", listener: () => void): this;
+ on(event: "data", listener: (chunk: Buffer | string) => void): this;
+ on(event: "drain", listener: () => void): this;
+ on(event: "end", listener: () => void): this;
+ on(event: "error", listener: (err: Error) => void): this;
+ on(event: "finish", listener: () => void): this;
+ on(event: "frameError", listener: (frameType: number, errorCode: number) => void): this;
+ on(event: "pipe", listener: (src: stream.Readable) => void): this;
+ on(event: "unpipe", listener: (src: stream.Readable) => void): this;
+ on(event: "streamClosed", listener: (code: number) => void): this;
+ on(event: "timeout", listener: () => void): this;
+ on(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this;
+ on(event: "wantTrailers", listener: () => void): this;
+ on(event: string | symbol, listener: (...args: any[]) => void): this;
+ once(event: "aborted", listener: () => void): this;
+ once(event: "close", listener: () => void): this;
+ once(event: "data", listener: (chunk: Buffer | string) => void): this;
+ once(event: "drain", listener: () => void): this;
+ once(event: "end", listener: () => void): this;
+ once(event: "error", listener: (err: Error) => void): this;
+ once(event: "finish", listener: () => void): this;
+ once(event: "frameError", listener: (frameType: number, errorCode: number) => void): this;
+ once(event: "pipe", listener: (src: stream.Readable) => void): this;
+ once(event: "unpipe", listener: (src: stream.Readable) => void): this;
+ once(event: "streamClosed", listener: (code: number) => void): this;
+ once(event: "timeout", listener: () => void): this;
+ once(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this;
+ once(event: "wantTrailers", listener: () => void): this;
+ once(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependListener(event: "aborted", listener: () => void): this;
+ prependListener(event: "close", listener: () => void): this;
+ prependListener(event: "data", listener: (chunk: Buffer | string) => void): this;
+ prependListener(event: "drain", listener: () => void): this;
+ prependListener(event: "end", listener: () => void): this;
+ prependListener(event: "error", listener: (err: Error) => void): this;
+ prependListener(event: "finish", listener: () => void): this;
+ prependListener(event: "frameError", listener: (frameType: number, errorCode: number) => void): this;
+ prependListener(event: "pipe", listener: (src: stream.Readable) => void): this;
+ prependListener(event: "unpipe", listener: (src: stream.Readable) => void): this;
+ prependListener(event: "streamClosed", listener: (code: number) => void): this;
+ prependListener(event: "timeout", listener: () => void): this;
+ prependListener(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this;
+ prependListener(event: "wantTrailers", listener: () => void): this;
+ prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependOnceListener(event: "aborted", listener: () => void): this;
+ prependOnceListener(event: "close", listener: () => void): this;
+ prependOnceListener(event: "data", listener: (chunk: Buffer | string) => void): this;
+ prependOnceListener(event: "drain", listener: () => void): this;
+ prependOnceListener(event: "end", listener: () => void): this;
+ prependOnceListener(event: "error", listener: (err: Error) => void): this;
+ prependOnceListener(event: "finish", listener: () => void): this;
+ prependOnceListener(event: "frameError", listener: (frameType: number, errorCode: number) => void): this;
+ prependOnceListener(event: "pipe", listener: (src: stream.Readable) => void): this;
+ prependOnceListener(event: "unpipe", listener: (src: stream.Readable) => void): this;
+ prependOnceListener(event: "streamClosed", listener: (code: number) => void): this;
+ prependOnceListener(event: "timeout", listener: () => void): this;
+ prependOnceListener(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this;
+ prependOnceListener(event: "wantTrailers", listener: () => void): this;
+ prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ }
+ export interface ClientHttp2Stream extends Http2Stream {
+ addListener(event: "continue", listener: () => {}): this;
+ addListener(
+ event: "headers",
+ listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void,
+ ): this;
+ addListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
+ addListener(
+ event: "response",
+ listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void,
+ ): this;
+ addListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ emit(event: "continue"): boolean;
+ emit(event: "headers", headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean;
+ emit(event: "push", headers: IncomingHttpHeaders, flags: number): boolean;
+ emit(event: "response", headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean;
+ emit(event: string | symbol, ...args: any[]): boolean;
+ on(event: "continue", listener: () => {}): this;
+ on(
+ event: "headers",
+ listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void,
+ ): this;
+ on(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
+ on(
+ event: "response",
+ listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void,
+ ): this;
+ on(event: string | symbol, listener: (...args: any[]) => void): this;
+ once(event: "continue", listener: () => {}): this;
+ once(
+ event: "headers",
+ listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void,
+ ): this;
+ once(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
+ once(
+ event: "response",
+ listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void,
+ ): this;
+ once(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependListener(event: "continue", listener: () => {}): this;
+ prependListener(
+ event: "headers",
+ listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void,
+ ): this;
+ prependListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
+ prependListener(
+ event: "response",
+ listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void,
+ ): this;
+ prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependOnceListener(event: "continue", listener: () => {}): this;
+ prependOnceListener(
+ event: "headers",
+ listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void,
+ ): this;
+ prependOnceListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
+ prependOnceListener(
+ event: "response",
+ listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void,
+ ): this;
+ prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ }
+ export interface ServerHttp2Stream extends Http2Stream {
+ /**
+ * True if headers were sent, false otherwise (read-only).
+ * @since v8.4.0
+ */
+ readonly headersSent: boolean;
+ /**
+ * Read-only property mapped to the `SETTINGS_ENABLE_PUSH` flag of the remote
+ * client's most recent `SETTINGS` frame. Will be `true` if the remote peer
+ * accepts push streams, `false` otherwise. Settings are the same for every`Http2Stream` in the same `Http2Session`.
+ * @since v8.4.0
+ */
+ readonly pushAllowed: boolean;
+ /**
+ * Sends an additional informational `HEADERS` frame to the connected HTTP/2 peer.
+ * @since v8.4.0
+ */
+ additionalHeaders(headers: OutgoingHttpHeaders): void;
+ /**
+ * Initiates a push stream. The callback is invoked with the new `Http2Stream`instance created for the push stream passed as the second argument, or an`Error` passed as the first argument.
+ *
+ * ```js
+ * const http2 = require('http2');
+ * const server = http2.createServer();
+ * server.on('stream', (stream) => {
+ * stream.respond({ ':status': 200 });
+ * stream.pushStream({ ':path': '/' }, (err, pushStream, headers) => {
+ * if (err) throw err;
+ * pushStream.respond({ ':status': 200 });
+ * pushStream.end('some pushed data');
+ * });
+ * stream.end('some data');
+ * });
+ * ```
+ *
+ * Setting the weight of a push stream is not allowed in the `HEADERS` frame. Pass
+ * a `weight` value to `http2stream.priority` with the `silent` option set to`true` to enable server-side bandwidth balancing between concurrent streams.
+ *
+ * Calling `http2stream.pushStream()` from within a pushed stream is not permitted
+ * and will throw an error.
+ * @since v8.4.0
+ * @param callback Callback that is called once the push stream has been initiated.
+ */
+ pushStream(
+ headers: OutgoingHttpHeaders,
+ callback?: (err: Error | null, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) => void,
+ ): void;
+ pushStream(
+ headers: OutgoingHttpHeaders,
+ options?: StreamPriorityOptions,
+ callback?: (err: Error | null, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) => void,
+ ): void;
+ /**
+ * ```js
+ * const http2 = require('http2');
+ * const server = http2.createServer();
+ * server.on('stream', (stream) => {
+ * stream.respond({ ':status': 200 });
+ * stream.end('some data');
+ * });
+ * ```
+ *
+ * When the `options.waitForTrailers` option is set, the `'wantTrailers'` event
+ * will be emitted immediately after queuing the last chunk of payload data to be
+ * sent. The `http2stream.sendTrailers()` method can then be used to sent trailing
+ * header fields to the peer.
+ *
+ * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically
+ * close when the final `DATA` frame is transmitted. User code must call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`.
+ *
+ * ```js
+ * const http2 = require('http2');
+ * const server = http2.createServer();
+ * server.on('stream', (stream) => {
+ * stream.respond({ ':status': 200 }, { waitForTrailers: true });
+ * stream.on('wantTrailers', () => {
+ * stream.sendTrailers({ ABC: 'some value to send' });
+ * });
+ * stream.end('some data');
+ * });
+ * ```
+ * @since v8.4.0
+ */
+ respond(headers?: OutgoingHttpHeaders, options?: ServerStreamResponseOptions): void;
+ /**
+ * Initiates a response whose data is read from the given file descriptor. No
+ * validation is performed on the given file descriptor. If an error occurs while
+ * attempting to read data using the file descriptor, the `Http2Stream` will be
+ * closed using an `RST_STREAM` frame using the standard `INTERNAL_ERROR` code.
+ *
+ * When used, the `Http2Stream` object's `Duplex` interface will be closed
+ * automatically.
+ *
+ * ```js
+ * const http2 = require('http2');
+ * const fs = require('fs');
+ *
+ * const server = http2.createServer();
+ * server.on('stream', (stream) => {
+ * const fd = fs.openSync('/some/file', 'r');
+ *
+ * const stat = fs.fstatSync(fd);
+ * const headers = {
+ * 'content-length': stat.size,
+ * 'last-modified': stat.mtime.toUTCString(),
+ * 'content-type': 'text/plain; charset=utf-8'
+ * };
+ * stream.respondWithFD(fd, headers);
+ * stream.on('close', () => fs.closeSync(fd));
+ * });
+ * ```
+ *
+ * The optional `options.statCheck` function may be specified to give user code
+ * an opportunity to set additional content headers based on the `fs.Stat` details
+ * of the given fd. If the `statCheck` function is provided, the`http2stream.respondWithFD()` method will perform an `fs.fstat()` call to
+ * collect details on the provided file descriptor.
+ *
+ * The `offset` and `length` options may be used to limit the response to a
+ * specific range subset. This can be used, for instance, to support HTTP Range
+ * requests.
+ *
+ * The file descriptor or `FileHandle` is not closed when the stream is closed,
+ * so it will need to be closed manually once it is no longer needed.
+ * Using the same file descriptor concurrently for multiple streams
+ * is not supported and may result in data loss. Re-using a file descriptor
+ * after a stream has finished is supported.
+ *
+ * When the `options.waitForTrailers` option is set, the `'wantTrailers'` event
+ * will be emitted immediately after queuing the last chunk of payload data to be
+ * sent. The `http2stream.sendTrailers()` method can then be used to sent trailing
+ * header fields to the peer.
+ *
+ * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically
+ * close when the final `DATA` frame is transmitted. User code _must_ call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`.
+ *
+ * ```js
+ * const http2 = require('http2');
+ * const fs = require('fs');
+ *
+ * const server = http2.createServer();
+ * server.on('stream', (stream) => {
+ * const fd = fs.openSync('/some/file', 'r');
+ *
+ * const stat = fs.fstatSync(fd);
+ * const headers = {
+ * 'content-length': stat.size,
+ * 'last-modified': stat.mtime.toUTCString(),
+ * 'content-type': 'text/plain; charset=utf-8'
+ * };
+ * stream.respondWithFD(fd, headers, { waitForTrailers: true });
+ * stream.on('wantTrailers', () => {
+ * stream.sendTrailers({ ABC: 'some value to send' });
+ * });
+ *
+ * stream.on('close', () => fs.closeSync(fd));
+ * });
+ * ```
+ * @since v8.4.0
+ * @param fd A readable file descriptor.
+ */
+ respondWithFD(
+ fd: number | fs.promises.FileHandle,
+ headers?: OutgoingHttpHeaders,
+ options?: ServerStreamFileResponseOptions,
+ ): void;
+ /**
+ * Sends a regular file as the response. The `path` must specify a regular file
+ * or an `'error'` event will be emitted on the `Http2Stream` object.
+ *
+ * When used, the `Http2Stream` object's `Duplex` interface will be closed
+ * automatically.
+ *
+ * The optional `options.statCheck` function may be specified to give user code
+ * an opportunity to set additional content headers based on the `fs.Stat` details
+ * of the given file:
+ *
+ * If an error occurs while attempting to read the file data, the `Http2Stream`will be closed using an `RST_STREAM` frame using the standard `INTERNAL_ERROR`code. If the `onError` callback is
+ * defined, then it will be called. Otherwise
+ * the stream will be destroyed.
+ *
+ * Example using a file path:
+ *
+ * ```js
+ * const http2 = require('http2');
+ * const server = http2.createServer();
+ * server.on('stream', (stream) => {
+ * function statCheck(stat, headers) {
+ * headers['last-modified'] = stat.mtime.toUTCString();
+ * }
+ *
+ * function onError(err) {
+ * // stream.respond() can throw if the stream has been destroyed by
+ * // the other side.
+ * try {
+ * if (err.code === 'ENOENT') {
+ * stream.respond({ ':status': 404 });
+ * } else {
+ * stream.respond({ ':status': 500 });
+ * }
+ * } catch (err) {
+ * // Perform actual error handling.
+ * console.log(err);
+ * }
+ * stream.end();
+ * }
+ *
+ * stream.respondWithFile('/some/file',
+ * { 'content-type': 'text/plain; charset=utf-8' },
+ * { statCheck, onError });
+ * });
+ * ```
+ *
+ * The `options.statCheck` function may also be used to cancel the send operation
+ * by returning `false`. For instance, a conditional request may check the stat
+ * results to determine if the file has been modified to return an appropriate`304` response:
+ *
+ * ```js
+ * const http2 = require('http2');
+ * const server = http2.createServer();
+ * server.on('stream', (stream) => {
+ * function statCheck(stat, headers) {
+ * // Check the stat here...
+ * stream.respond({ ':status': 304 });
+ * return false; // Cancel the send operation
+ * }
+ * stream.respondWithFile('/some/file',
+ * { 'content-type': 'text/plain; charset=utf-8' },
+ * { statCheck });
+ * });
+ * ```
+ *
+ * The `content-length` header field will be automatically set.
+ *
+ * The `offset` and `length` options may be used to limit the response to a
+ * specific range subset. This can be used, for instance, to support HTTP Range
+ * requests.
+ *
+ * The `options.onError` function may also be used to handle all the errors
+ * that could happen before the delivery of the file is initiated. The
+ * default behavior is to destroy the stream.
+ *
+ * When the `options.waitForTrailers` option is set, the `'wantTrailers'` event
+ * will be emitted immediately after queuing the last chunk of payload data to be
+ * sent. The `http2stream.sendTrailers()` method can then be used to sent trailing
+ * header fields to the peer.
+ *
+ * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically
+ * close when the final `DATA` frame is transmitted. User code must call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`.
+ *
+ * ```js
+ * const http2 = require('http2');
+ * const server = http2.createServer();
+ * server.on('stream', (stream) => {
+ * stream.respondWithFile('/some/file',
+ * { 'content-type': 'text/plain; charset=utf-8' },
+ * { waitForTrailers: true });
+ * stream.on('wantTrailers', () => {
+ * stream.sendTrailers({ ABC: 'some value to send' });
+ * });
+ * });
+ * ```
+ * @since v8.4.0
+ */
+ respondWithFile(
+ path: string,
+ headers?: OutgoingHttpHeaders,
+ options?: ServerStreamFileResponseOptionsWithError,
+ ): void;
+ }
+ // Http2Session
+ export interface Settings {
+ headerTableSize?: number | undefined;
+ enablePush?: boolean | undefined;
+ initialWindowSize?: number | undefined;
+ maxFrameSize?: number | undefined;
+ maxConcurrentStreams?: number | undefined;
+ maxHeaderListSize?: number | undefined;
+ enableConnectProtocol?: boolean | undefined;
+ }
+ export interface ClientSessionRequestOptions {
+ endStream?: boolean | undefined;
+ exclusive?: boolean | undefined;
+ parent?: number | undefined;
+ weight?: number | undefined;
+ waitForTrailers?: boolean | undefined;
+ signal?: AbortSignal | undefined;
+ }
+ export interface SessionState {
+ effectiveLocalWindowSize?: number | undefined;
+ effectiveRecvDataLength?: number | undefined;
+ nextStreamID?: number | undefined;
+ localWindowSize?: number | undefined;
+ lastProcStreamID?: number | undefined;
+ remoteWindowSize?: number | undefined;
+ outboundQueueSize?: number | undefined;
+ deflateDynamicTableSize?: number | undefined;
+ inflateDynamicTableSize?: number | undefined;
+ }
+ export interface Http2Session extends EventEmitter {
+ /**
+ * Value will be `undefined` if the `Http2Session` is not yet connected to a
+ * socket, `h2c` if the `Http2Session` is not connected to a `TLSSocket`, or
+ * will return the value of the connected `TLSSocket`'s own `alpnProtocol`property.
+ * @since v9.4.0
+ */
+ readonly alpnProtocol?: string | undefined;
+ /**
+ * Will be `true` if this `Http2Session` instance has been closed, otherwise`false`.
+ * @since v9.4.0
+ */
+ readonly closed: boolean;
+ /**
+ * Will be `true` if this `Http2Session` instance is still connecting, will be set
+ * to `false` before emitting `connect` event and/or calling the `http2.connect`callback.
+ * @since v10.0.0
+ */
+ readonly connecting: boolean;
+ /**
+ * Will be `true` if this `Http2Session` instance has been destroyed and must no
+ * longer be used, otherwise `false`.
+ * @since v8.4.0
+ */
+ readonly destroyed: boolean;
+ /**
+ * Value is `undefined` if the `Http2Session` session socket has not yet been
+ * connected, `true` if the `Http2Session` is connected with a `TLSSocket`,
+ * and `false` if the `Http2Session` is connected to any other kind of socket
+ * or stream.
+ * @since v9.4.0
+ */
+ readonly encrypted?: boolean | undefined;
+ /**
+ * A prototype-less object describing the current local settings of this`Http2Session`. The local settings are local to _this_`Http2Session` instance.
+ * @since v8.4.0
+ */
+ readonly localSettings: Settings;
+ /**
+ * If the `Http2Session` is connected to a `TLSSocket`, the `originSet` property
+ * will return an `Array` of origins for which the `Http2Session` may be
+ * considered authoritative.
+ *
+ * The `originSet` property is only available when using a secure TLS connection.
+ * @since v9.4.0
+ */
+ readonly originSet?: string[] | undefined;
+ /**
+ * Indicates whether the `Http2Session` is currently waiting for acknowledgment of
+ * a sent `SETTINGS` frame. Will be `true` after calling the`http2session.settings()` method. Will be `false` once all sent `SETTINGS`frames have been acknowledged.
+ * @since v8.4.0
+ */
+ readonly pendingSettingsAck: boolean;
+ /**
+ * A prototype-less object describing the current remote settings of this`Http2Session`. The remote settings are set by the _connected_ HTTP/2 peer.
+ * @since v8.4.0
+ */
+ readonly remoteSettings: Settings;
+ /**
+ * Returns a `Proxy` object that acts as a `net.Socket` (or `tls.TLSSocket`) but
+ * limits available methods to ones safe to use with HTTP/2.
+ *
+ * `destroy`, `emit`, `end`, `pause`, `read`, `resume`, and `write` will throw
+ * an error with code `ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for more information.
+ *
+ * `setTimeout` method will be called on this `Http2Session`.
+ *
+ * All other interactions will be routed directly to the socket.
+ * @since v8.4.0
+ */
+ readonly socket: net.Socket | tls.TLSSocket;
+ /**
+ * Provides miscellaneous information about the current state of the`Http2Session`.
+ *
+ * An object describing the current status of this `Http2Session`.
+ * @since v8.4.0
+ */
+ readonly state: SessionState;
+ /**
+ * The `http2session.type` will be equal to`http2.constants.NGHTTP2_SESSION_SERVER` if this `Http2Session` instance is a
+ * server, and `http2.constants.NGHTTP2_SESSION_CLIENT` if the instance is a
+ * client.
+ * @since v8.4.0
+ */
+ readonly type: number;
+ /**
+ * Gracefully closes the `Http2Session`, allowing any existing streams to
+ * complete on their own and preventing new `Http2Stream` instances from being
+ * created. Once closed, `http2session.destroy()`_might_ be called if there
+ * are no open `Http2Stream` instances.
+ *
+ * If specified, the `callback` function is registered as a handler for the`'close'` event.
+ * @since v9.4.0
+ */
+ close(callback?: () => void): void;
+ /**
+ * Immediately terminates the `Http2Session` and the associated `net.Socket` or`tls.TLSSocket`.
+ *
+ * Once destroyed, the `Http2Session` will emit the `'close'` event. If `error`is not undefined, an `'error'` event will be emitted immediately before the`'close'` event.
+ *
+ * If there are any remaining open `Http2Streams` associated with the`Http2Session`, those will also be destroyed.
+ * @since v8.4.0
+ * @param error An `Error` object if the `Http2Session` is being destroyed due to an error.
+ * @param code The HTTP/2 error code to send in the final `GOAWAY` frame. If unspecified, and `error` is not undefined, the default is `INTERNAL_ERROR`, otherwise defaults to `NO_ERROR`.
+ */
+ destroy(error?: Error, code?: number): void;
+ /**
+ * Transmits a `GOAWAY` frame to the connected peer _without_ shutting down the`Http2Session`.
+ * @since v9.4.0
+ * @param code An HTTP/2 error code
+ * @param lastStreamID The numeric ID of the last processed `Http2Stream`
+ * @param opaqueData A `TypedArray` or `DataView` instance containing additional data to be carried within the `GOAWAY` frame.
+ */
+ goaway(code?: number, lastStreamID?: number, opaqueData?: NodeJS.ArrayBufferView): void;
+ /**
+ * Sends a `PING` frame to the connected HTTP/2 peer. A `callback` function must
+ * be provided. The method will return `true` if the `PING` was sent, `false`otherwise.
+ *
+ * The maximum number of outstanding (unacknowledged) pings is determined by the`maxOutstandingPings` configuration option. The default maximum is 10.
+ *
+ * If provided, the `payload` must be a `Buffer`, `TypedArray`, or `DataView`containing 8 bytes of data that will be transmitted with the `PING` and
+ * returned with the ping acknowledgment.
+ *
+ * The callback will be invoked with three arguments: an error argument that will
+ * be `null` if the `PING` was successfully acknowledged, a `duration` argument
+ * that reports the number of milliseconds elapsed since the ping was sent and the
+ * acknowledgment was received, and a `Buffer` containing the 8-byte `PING`payload.
+ *
+ * ```js
+ * session.ping(Buffer.from('abcdefgh'), (err, duration, payload) => {
+ * if (!err) {
+ * console.log(`Ping acknowledged in ${duration} milliseconds`);
+ * console.log(`With payload '${payload.toString()}'`);
+ * }
+ * });
+ * ```
+ *
+ * If the `payload` argument is not specified, the default payload will be the
+ * 64-bit timestamp (little endian) marking the start of the `PING` duration.
+ * @since v8.9.3
+ * @param payload Optional ping payload.
+ */
+ ping(callback: (err: Error | null, duration: number, payload: Buffer) => void): boolean;
+ ping(
+ payload: NodeJS.ArrayBufferView,
+ callback: (err: Error | null, duration: number, payload: Buffer) => void,
+ ): boolean;
+ /**
+ * Calls `ref()` on this `Http2Session`instance's underlying `net.Socket`.
+ * @since v9.4.0
+ */
+ ref(): void;
+ /**
+ * Sets the local endpoint's window size.
+ * The `windowSize` is the total window size to set, not
+ * the delta.
+ *
+ * ```js
+ * const http2 = require('http2');
+ *
+ * const server = http2.createServer();
+ * const expectedWindowSize = 2 ** 20;
+ * server.on('connect', (session) => {
+ *
+ * // Set local window size to be 2 ** 20
+ * session.setLocalWindowSize(expectedWindowSize);
+ * });
+ * ```
+ * @since v15.3.0, v14.18.0
+ */
+ setLocalWindowSize(windowSize: number): void;
+ /**
+ * Used to set a callback function that is called when there is no activity on
+ * the `Http2Session` after `msecs` milliseconds. The given `callback` is
+ * registered as a listener on the `'timeout'` event.
+ * @since v8.4.0
+ */
+ setTimeout(msecs: number, callback?: () => void): void;
+ /**
+ * Updates the current local settings for this `Http2Session` and sends a new`SETTINGS` frame to the connected HTTP/2 peer.
+ *
+ * Once called, the `http2session.pendingSettingsAck` property will be `true`while the session is waiting for the remote peer to acknowledge the new
+ * settings.
+ *
+ * The new settings will not become effective until the `SETTINGS` acknowledgment
+ * is received and the `'localSettings'` event is emitted. It is possible to send
+ * multiple `SETTINGS` frames while acknowledgment is still pending.
+ * @since v8.4.0
+ * @param callback Callback that is called once the session is connected or right away if the session is already connected.
+ */
+ settings(
+ settings: Settings,
+ callback?: (err: Error | null, settings: Settings, duration: number) => void,
+ ): void;
+ /**
+ * Calls `unref()` on this `Http2Session`instance's underlying `net.Socket`.
+ * @since v9.4.0
+ */
+ unref(): void;
+ addListener(event: "close", listener: () => void): this;
+ addListener(event: "error", listener: (err: Error) => void): this;
+ addListener(
+ event: "frameError",
+ listener: (frameType: number, errorCode: number, streamID: number) => void,
+ ): this;
+ addListener(
+ event: "goaway",
+ listener: (errorCode: number, lastStreamID: number, opaqueData?: Buffer) => void,
+ ): this;
+ addListener(event: "localSettings", listener: (settings: Settings) => void): this;
+ addListener(event: "ping", listener: () => void): this;
+ addListener(event: "remoteSettings", listener: (settings: Settings) => void): this;
+ addListener(event: "timeout", listener: () => void): this;
+ addListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ emit(event: "close"): boolean;
+ emit(event: "error", err: Error): boolean;
+ emit(event: "frameError", frameType: number, errorCode: number, streamID: number): boolean;
+ emit(event: "goaway", errorCode: number, lastStreamID: number, opaqueData?: Buffer): boolean;
+ emit(event: "localSettings", settings: Settings): boolean;
+ emit(event: "ping"): boolean;
+ emit(event: "remoteSettings", settings: Settings): boolean;
+ emit(event: "timeout"): boolean;
+ emit(event: string | symbol, ...args: any[]): boolean;
+ on(event: "close", listener: () => void): this;
+ on(event: "error", listener: (err: Error) => void): this;
+ on(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this;
+ on(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData?: Buffer) => void): this;
+ on(event: "localSettings", listener: (settings: Settings) => void): this;
+ on(event: "ping", listener: () => void): this;
+ on(event: "remoteSettings", listener: (settings: Settings) => void): this;
+ on(event: "timeout", listener: () => void): this;
+ on(event: string | symbol, listener: (...args: any[]) => void): this;
+ once(event: "close", listener: () => void): this;
+ once(event: "error", listener: (err: Error) => void): this;
+ once(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this;
+ once(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData?: Buffer) => void): this;
+ once(event: "localSettings", listener: (settings: Settings) => void): this;
+ once(event: "ping", listener: () => void): this;
+ once(event: "remoteSettings", listener: (settings: Settings) => void): this;
+ once(event: "timeout", listener: () => void): this;
+ once(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependListener(event: "close", listener: () => void): this;
+ prependListener(event: "error", listener: (err: Error) => void): this;
+ prependListener(
+ event: "frameError",
+ listener: (frameType: number, errorCode: number, streamID: number) => void,
+ ): this;
+ prependListener(
+ event: "goaway",
+ listener: (errorCode: number, lastStreamID: number, opaqueData?: Buffer) => void,
+ ): this;
+ prependListener(event: "localSettings", listener: (settings: Settings) => void): this;
+ prependListener(event: "ping", listener: () => void): this;
+ prependListener(event: "remoteSettings", listener: (settings: Settings) => void): this;
+ prependListener(event: "timeout", listener: () => void): this;
+ prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependOnceListener(event: "close", listener: () => void): this;
+ prependOnceListener(event: "error", listener: (err: Error) => void): this;
+ prependOnceListener(
+ event: "frameError",
+ listener: (frameType: number, errorCode: number, streamID: number) => void,
+ ): this;
+ prependOnceListener(
+ event: "goaway",
+ listener: (errorCode: number, lastStreamID: number, opaqueData?: Buffer) => void,
+ ): this;
+ prependOnceListener(event: "localSettings", listener: (settings: Settings) => void): this;
+ prependOnceListener(event: "ping", listener: () => void): this;
+ prependOnceListener(event: "remoteSettings", listener: (settings: Settings) => void): this;
+ prependOnceListener(event: "timeout", listener: () => void): this;
+ prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ }
+ export interface ClientHttp2Session extends Http2Session {
+ /**
+ * For HTTP/2 Client `Http2Session` instances only, the `http2session.request()`creates and returns an `Http2Stream` instance that can be used to send an
+ * HTTP/2 request to the connected server.
+ *
+ * When a `ClientHttp2Session` is first created, the socket may not yet be
+ * connected. if `clienthttp2session.request()` is called during this time, the
+ * actual request will be deferred until the socket is ready to go.
+ * If the `session` is closed before the actual request be executed, an`ERR_HTTP2_GOAWAY_SESSION` is thrown.
+ *
+ * This method is only available if `http2session.type` is equal to`http2.constants.NGHTTP2_SESSION_CLIENT`.
+ *
+ * ```js
+ * const http2 = require('http2');
+ * const clientSession = http2.connect('https://localhost:1234');
+ * const {
+ * HTTP2_HEADER_PATH,
+ * HTTP2_HEADER_STATUS
+ * } = http2.constants;
+ *
+ * const req = clientSession.request({ [HTTP2_HEADER_PATH]: '/' });
+ * req.on('response', (headers) => {
+ * console.log(headers[HTTP2_HEADER_STATUS]);
+ * req.on('data', (chunk) => { // .. });
+ * req.on('end', () => { // .. });
+ * });
+ * ```
+ *
+ * When the `options.waitForTrailers` option is set, the `'wantTrailers'` event
+ * is emitted immediately after queuing the last chunk of payload data to be sent.
+ * The `http2stream.sendTrailers()` method can then be called to send trailing
+ * headers to the peer.
+ *
+ * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically
+ * close when the final `DATA` frame is transmitted. User code must call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`.
+ *
+ * When `options.signal` is set with an `AbortSignal` and then `abort` on the
+ * corresponding `AbortController` is called, the request will emit an `'error'`event with an `AbortError` error.
+ *
+ * The `:method` and `:path` pseudo-headers are not specified within `headers`,
+ * they respectively default to:
+ *
+ * * `:method` \= `'GET'`
+ * * `:path` \= `/`
+ * @since v8.4.0
+ */
+ request(headers?: OutgoingHttpHeaders, options?: ClientSessionRequestOptions): ClientHttp2Stream;
+ addListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this;
+ addListener(event: "origin", listener: (origins: string[]) => void): this;
+ addListener(
+ event: "connect",
+ listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void,
+ ): this;
+ addListener(
+ event: "stream",
+ listener: (
+ stream: ClientHttp2Stream,
+ headers: IncomingHttpHeaders & IncomingHttpStatusHeader,
+ flags: number,
+ ) => void,
+ ): this;
+ addListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ emit(event: "altsvc", alt: string, origin: string, stream: number): boolean;
+ emit(event: "origin", origins: readonly string[]): boolean;
+ emit(event: "connect", session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket): boolean;
+ emit(
+ event: "stream",
+ stream: ClientHttp2Stream,
+ headers: IncomingHttpHeaders & IncomingHttpStatusHeader,
+ flags: number,
+ ): boolean;
+ emit(event: string | symbol, ...args: any[]): boolean;
+ on(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this;
+ on(event: "origin", listener: (origins: string[]) => void): this;
+ on(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
+ on(
+ event: "stream",
+ listener: (
+ stream: ClientHttp2Stream,
+ headers: IncomingHttpHeaders & IncomingHttpStatusHeader,
+ flags: number,
+ ) => void,
+ ): this;
+ on(event: string | symbol, listener: (...args: any[]) => void): this;
+ once(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this;
+ once(event: "origin", listener: (origins: string[]) => void): this;
+ once(
+ event: "connect",
+ listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void,
+ ): this;
+ once(
+ event: "stream",
+ listener: (
+ stream: ClientHttp2Stream,
+ headers: IncomingHttpHeaders & IncomingHttpStatusHeader,
+ flags: number,
+ ) => void,
+ ): this;
+ once(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this;
+ prependListener(event: "origin", listener: (origins: string[]) => void): this;
+ prependListener(
+ event: "connect",
+ listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void,
+ ): this;
+ prependListener(
+ event: "stream",
+ listener: (
+ stream: ClientHttp2Stream,
+ headers: IncomingHttpHeaders & IncomingHttpStatusHeader,
+ flags: number,
+ ) => void,
+ ): this;
+ prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependOnceListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this;
+ prependOnceListener(event: "origin", listener: (origins: string[]) => void): this;
+ prependOnceListener(
+ event: "connect",
+ listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void,
+ ): this;
+ prependOnceListener(
+ event: "stream",
+ listener: (
+ stream: ClientHttp2Stream,
+ headers: IncomingHttpHeaders & IncomingHttpStatusHeader,
+ flags: number,
+ ) => void,
+ ): this;
+ prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ }
+ export interface AlternativeServiceOptions {
+ origin: number | string | url.URL;
+ }
+ export interface ServerHttp2Session extends Http2Session {
+ readonly server: Http2Server | Http2SecureServer;
+ /**
+ * Submits an `ALTSVC` frame (as defined by [RFC 7838](https://tools.ietf.org/html/rfc7838)) to the connected client.
+ *
+ * ```js
+ * const http2 = require('http2');
+ *
+ * const server = http2.createServer();
+ * server.on('session', (session) => {
+ * // Set altsvc for origin https://example.org:80
+ * session.altsvc('h2=":8000"', 'https://example.org:80');
+ * });
+ *
+ * server.on('stream', (stream) => {
+ * // Set altsvc for a specific stream
+ * stream.session.altsvc('h2=":8000"', stream.id);
+ * });
+ * ```
+ *
+ * Sending an `ALTSVC` frame with a specific stream ID indicates that the alternate
+ * service is associated with the origin of the given `Http2Stream`.
+ *
+ * The `alt` and origin string _must_ contain only ASCII bytes and are
+ * strictly interpreted as a sequence of ASCII bytes. The special value `'clear'`may be passed to clear any previously set alternative service for a given
+ * domain.
+ *
+ * When a string is passed for the `originOrStream` argument, it will be parsed as
+ * a URL and the origin will be derived. For instance, the origin for the
+ * HTTP URL `'https://example.org/foo/bar'` is the ASCII string`'https://example.org'`. An error will be thrown if either the given string
+ * cannot be parsed as a URL or if a valid origin cannot be derived.
+ *
+ * A `URL` object, or any object with an `origin` property, may be passed as`originOrStream`, in which case the value of the `origin` property will be
+ * used. The value of the `origin` property _must_ be a properly serialized
+ * ASCII origin.
+ * @since v9.4.0
+ * @param alt A description of the alternative service configuration as defined by `RFC 7838`.
+ * @param originOrStream Either a URL string specifying the origin (or an `Object` with an `origin` property) or the numeric identifier of an active `Http2Stream` as given by the
+ * `http2stream.id` property.
+ */
+ altsvc(alt: string, originOrStream: number | string | url.URL | AlternativeServiceOptions): void;
+ /**
+ * Submits an `ORIGIN` frame (as defined by [RFC 8336](https://tools.ietf.org/html/rfc8336)) to the connected client
+ * to advertise the set of origins for which the server is capable of providing
+ * authoritative responses.
+ *
+ * ```js
+ * const http2 = require('http2');
+ * const options = getSecureOptionsSomehow();
+ * const server = http2.createSecureServer(options);
+ * server.on('stream', (stream) => {
+ * stream.respond();
+ * stream.end('ok');
+ * });
+ * server.on('session', (session) => {
+ * session.origin('https://example.com', 'https://example.org');
+ * });
+ * ```
+ *
+ * When a string is passed as an `origin`, it will be parsed as a URL and the
+ * origin will be derived. For instance, the origin for the HTTP URL`'https://example.org/foo/bar'` is the ASCII string`'https://example.org'`. An error will be thrown if either the given
+ * string
+ * cannot be parsed as a URL or if a valid origin cannot be derived.
+ *
+ * A `URL` object, or any object with an `origin` property, may be passed as
+ * an `origin`, in which case the value of the `origin` property will be
+ * used. The value of the `origin` property _must_ be a properly serialized
+ * ASCII origin.
+ *
+ * Alternatively, the `origins` option may be used when creating a new HTTP/2
+ * server using the `http2.createSecureServer()` method:
+ *
+ * ```js
+ * const http2 = require('http2');
+ * const options = getSecureOptionsSomehow();
+ * options.origins = ['https://example.com', 'https://example.org'];
+ * const server = http2.createSecureServer(options);
+ * server.on('stream', (stream) => {
+ * stream.respond();
+ * stream.end('ok');
+ * });
+ * ```
+ * @since v10.12.0
+ * @param origins One or more URL Strings passed as separate arguments.
+ */
+ origin(
+ ...origins: Array<
+ | string
+ | url.URL
+ | {
+ origin: string;
+ }
+ >
+ ): void;
+ addListener(
+ event: "connect",
+ listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void,
+ ): this;
+ addListener(
+ event: "stream",
+ listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void,
+ ): this;
+ addListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ emit(event: "connect", session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket): boolean;
+ emit(event: "stream", stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean;
+ emit(event: string | symbol, ...args: any[]): boolean;
+ on(event: "connect", listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
+ on(
+ event: "stream",
+ listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void,
+ ): this;
+ on(event: string | symbol, listener: (...args: any[]) => void): this;
+ once(
+ event: "connect",
+ listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void,
+ ): this;
+ once(
+ event: "stream",
+ listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void,
+ ): this;
+ once(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependListener(
+ event: "connect",
+ listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void,
+ ): this;
+ prependListener(
+ event: "stream",
+ listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void,
+ ): this;
+ prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependOnceListener(
+ event: "connect",
+ listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void,
+ ): this;
+ prependOnceListener(
+ event: "stream",
+ listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void,
+ ): this;
+ prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ }
+ // Http2Server
+ export interface SessionOptions {
+ maxDeflateDynamicTableSize?: number | undefined;
+ maxSessionMemory?: number | undefined;
+ maxHeaderListPairs?: number | undefined;
+ maxOutstandingPings?: number | undefined;
+ maxSendHeaderBlockLength?: number | undefined;
+ paddingStrategy?: number | undefined;
+ peerMaxConcurrentStreams?: number | undefined;
+ settings?: Settings | undefined;
+ /**
+ * Specifies a timeout in milliseconds that
+ * a server should wait when an [`'unknownProtocol'`][] is emitted. If the
+ * socket has not been destroyed by that time the server will destroy it.
+ * @default 100000
+ */
+ unknownProtocolTimeout?: number | undefined;
+ selectPadding?(frameLen: number, maxFrameLen: number): number;
+ }
+ export interface ClientSessionOptions extends SessionOptions {
+ maxReservedRemoteStreams?: number | undefined;
+ createConnection?: ((authority: url.URL, option: SessionOptions) => stream.Duplex) | undefined;
+ protocol?: "http:" | "https:" | undefined;
+ }
+ export interface ServerSessionOptions extends SessionOptions {
+ Http1IncomingMessage?: typeof IncomingMessage | undefined;
+ Http1ServerResponse?: typeof ServerResponse | undefined;
+ Http2ServerRequest?: typeof Http2ServerRequest | undefined;
+ Http2ServerResponse?: typeof Http2ServerResponse | undefined;
+ }
+ export interface SecureClientSessionOptions extends ClientSessionOptions, tls.ConnectionOptions {}
+ export interface SecureServerSessionOptions extends ServerSessionOptions, tls.TlsOptions {}
+ export interface ServerOptions extends ServerSessionOptions {}
+ export interface SecureServerOptions extends SecureServerSessionOptions {
+ allowHTTP1?: boolean | undefined;
+ origins?: string[] | undefined;
+ }
+ interface HTTP2ServerCommon {
+ setTimeout(msec?: number, callback?: () => void): this;
+ /**
+ * Throws ERR_HTTP2_INVALID_SETTING_VALUE for invalid settings values.
+ * Throws ERR_INVALID_ARG_TYPE for invalid settings argument.
+ */
+ updateSettings(settings: Settings): void;
+ }
+ export interface Http2Server extends net.Server, HTTP2ServerCommon {
+ addListener(
+ event: "checkContinue",
+ listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
+ ): this;
+ addListener(
+ event: "request",
+ listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
+ ): this;
+ addListener(event: "session", listener: (session: ServerHttp2Session) => void): this;
+ addListener(event: "sessionError", listener: (err: Error) => void): this;
+ addListener(
+ event: "stream",
+ listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void,
+ ): this;
+ addListener(event: "timeout", listener: () => void): this;
+ addListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ emit(event: "checkContinue", request: Http2ServerRequest, response: Http2ServerResponse): boolean;
+ emit(event: "request", request: Http2ServerRequest, response: Http2ServerResponse): boolean;
+ emit(event: "session", session: ServerHttp2Session): boolean;
+ emit(event: "sessionError", err: Error): boolean;
+ emit(event: "stream", stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean;
+ emit(event: "timeout"): boolean;
+ emit(event: string | symbol, ...args: any[]): boolean;
+ on(
+ event: "checkContinue",
+ listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
+ ): this;
+ on(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
+ on(event: "session", listener: (session: ServerHttp2Session) => void): this;
+ on(event: "sessionError", listener: (err: Error) => void): this;
+ on(
+ event: "stream",
+ listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void,
+ ): this;
+ on(event: "timeout", listener: () => void): this;
+ on(event: string | symbol, listener: (...args: any[]) => void): this;
+ once(
+ event: "checkContinue",
+ listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
+ ): this;
+ once(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
+ once(event: "session", listener: (session: ServerHttp2Session) => void): this;
+ once(event: "sessionError", listener: (err: Error) => void): this;
+ once(
+ event: "stream",
+ listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void,
+ ): this;
+ once(event: "timeout", listener: () => void): this;
+ once(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependListener(
+ event: "checkContinue",
+ listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
+ ): this;
+ prependListener(
+ event: "request",
+ listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
+ ): this;
+ prependListener(event: "session", listener: (session: ServerHttp2Session) => void): this;
+ prependListener(event: "sessionError", listener: (err: Error) => void): this;
+ prependListener(
+ event: "stream",
+ listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void,
+ ): this;
+ prependListener(event: "timeout", listener: () => void): this;
+ prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependOnceListener(
+ event: "checkContinue",
+ listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
+ ): this;
+ prependOnceListener(
+ event: "request",
+ listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
+ ): this;
+ prependOnceListener(event: "session", listener: (session: ServerHttp2Session) => void): this;
+ prependOnceListener(event: "sessionError", listener: (err: Error) => void): this;
+ prependOnceListener(
+ event: "stream",
+ listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void,
+ ): this;
+ prependOnceListener(event: "timeout", listener: () => void): this;
+ prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ }
+ export interface Http2SecureServer extends tls.Server, HTTP2ServerCommon {
+ addListener(
+ event: "checkContinue",
+ listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
+ ): this;
+ addListener(
+ event: "request",
+ listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
+ ): this;
+ addListener(event: "session", listener: (session: ServerHttp2Session) => void): this;
+ addListener(event: "sessionError", listener: (err: Error) => void): this;
+ addListener(
+ event: "stream",
+ listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void,
+ ): this;
+ addListener(event: "timeout", listener: () => void): this;
+ addListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this;
+ addListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ emit(event: "checkContinue", request: Http2ServerRequest, response: Http2ServerResponse): boolean;
+ emit(event: "request", request: Http2ServerRequest, response: Http2ServerResponse): boolean;
+ emit(event: "session", session: ServerHttp2Session): boolean;
+ emit(event: "sessionError", err: Error): boolean;
+ emit(event: "stream", stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean;
+ emit(event: "timeout"): boolean;
+ emit(event: "unknownProtocol", socket: tls.TLSSocket): boolean;
+ emit(event: string | symbol, ...args: any[]): boolean;
+ on(
+ event: "checkContinue",
+ listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
+ ): this;
+ on(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
+ on(event: "session", listener: (session: ServerHttp2Session) => void): this;
+ on(event: "sessionError", listener: (err: Error) => void): this;
+ on(
+ event: "stream",
+ listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void,
+ ): this;
+ on(event: "timeout", listener: () => void): this;
+ on(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this;
+ on(event: string | symbol, listener: (...args: any[]) => void): this;
+ once(
+ event: "checkContinue",
+ listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
+ ): this;
+ once(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
+ once(event: "session", listener: (session: ServerHttp2Session) => void): this;
+ once(event: "sessionError", listener: (err: Error) => void): this;
+ once(
+ event: "stream",
+ listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void,
+ ): this;
+ once(event: "timeout", listener: () => void): this;
+ once(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this;
+ once(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependListener(
+ event: "checkContinue",
+ listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
+ ): this;
+ prependListener(
+ event: "request",
+ listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
+ ): this;
+ prependListener(event: "session", listener: (session: ServerHttp2Session) => void): this;
+ prependListener(event: "sessionError", listener: (err: Error) => void): this;
+ prependListener(
+ event: "stream",
+ listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void,
+ ): this;
+ prependListener(event: "timeout", listener: () => void): this;
+ prependListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this;
+ prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependOnceListener(
+ event: "checkContinue",
+ listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
+ ): this;
+ prependOnceListener(
+ event: "request",
+ listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
+ ): this;
+ prependOnceListener(event: "session", listener: (session: ServerHttp2Session) => void): this;
+ prependOnceListener(event: "sessionError", listener: (err: Error) => void): this;
+ prependOnceListener(
+ event: "stream",
+ listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void,
+ ): this;
+ prependOnceListener(event: "timeout", listener: () => void): this;
+ prependOnceListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this;
+ prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ }
+ /**
+ * A `Http2ServerRequest` object is created by {@link Server} or {@link SecureServer} and passed as the first argument to the `'request'` event. It may be used to access a request status,
+ * headers, and
+ * data.
+ * @since v8.4.0
+ */
+ export class Http2ServerRequest extends stream.Readable {
+ constructor(
+ stream: ServerHttp2Stream,
+ headers: IncomingHttpHeaders,
+ options: stream.ReadableOptions,
+ rawHeaders: readonly string[],
+ );
+ /**
+ * The `request.aborted` property will be `true` if the request has
+ * been aborted.
+ * @since v10.1.0
+ */
+ readonly aborted: boolean;
+ /**
+ * The request authority pseudo header field. Because HTTP/2 allows requests
+ * to set either `:authority` or `host`, this value is derived from`req.headers[':authority']` if present. Otherwise, it is derived from`req.headers['host']`.
+ * @since v8.4.0
+ */
+ readonly authority: string;
+ /**
+ * See `request.socket`.
+ * @since v8.4.0
+ * @deprecated Since v13.0.0 - Use `socket`.
+ */
+ readonly connection: net.Socket | tls.TLSSocket;
+ /**
+ * The `request.complete` property will be `true` if the request has
+ * been completed, aborted, or destroyed.
+ * @since v12.10.0
+ */
+ readonly complete: boolean;
+ /**
+ * The request/response headers object.
+ *
+ * Key-value pairs of header names and values. Header names are lower-cased.
+ *
+ * ```js
+ * // Prints something like:
+ * //
+ * // { 'user-agent': 'curl/7.22.0',
+ * // host: '127.0.0.1:8000',
+ * // accept: '*' }
+ * console.log(request.headers);
+ * ```
+ *
+ * See `HTTP/2 Headers Object`.
+ *
+ * In HTTP/2, the request path, host name, protocol, and method are represented as
+ * special headers prefixed with the `:` character (e.g. `':path'`). These special
+ * headers will be included in the `request.headers` object. Care must be taken not
+ * to inadvertently modify these special headers or errors may occur. For instance,
+ * removing all headers from the request will cause errors to occur:
+ *
+ * ```js
+ * removeAllHeaders(request.headers);
+ * assert(request.url); // Fails because the :path header has been removed
+ * ```
+ * @since v8.4.0
+ */
+ readonly headers: IncomingHttpHeaders;
+ /**
+ * In case of server request, the HTTP version sent by the client. In the case of
+ * client response, the HTTP version of the connected-to server. Returns`'2.0'`.
+ *
+ * Also `message.httpVersionMajor` is the first integer and`message.httpVersionMinor` is the second.
+ * @since v8.4.0
+ */
+ readonly httpVersion: string;
+ readonly httpVersionMinor: number;
+ readonly httpVersionMajor: number;
+ /**
+ * The request method as a string. Read-only. Examples: `'GET'`, `'DELETE'`.
+ * @since v8.4.0
+ */
+ readonly method: string;
+ /**
+ * The raw request/response headers list exactly as they were received.
+ *
+ * The keys and values are in the same list. It is _not_ a
+ * list of tuples. So, the even-numbered offsets are key values, and the
+ * odd-numbered offsets are the associated values.
+ *
+ * Header names are not lowercased, and duplicates are not merged.
+ *
+ * ```js
+ * // Prints something like:
+ * //
+ * // [ 'user-agent',
+ * // 'this is invalid because there can be only one',
+ * // 'User-Agent',
+ * // 'curl/7.22.0',
+ * // 'Host',
+ * // '127.0.0.1:8000',
+ * // 'ACCEPT',
+ * // '*' ]
+ * console.log(request.rawHeaders);
+ * ```
+ * @since v8.4.0
+ */
+ readonly rawHeaders: string[];
+ /**
+ * The raw request/response trailer keys and values exactly as they were
+ * received. Only populated at the `'end'` event.
+ * @since v8.4.0
+ */
+ readonly rawTrailers: string[];
+ /**
+ * The request scheme pseudo header field indicating the scheme
+ * portion of the target URL.
+ * @since v8.4.0
+ */
+ readonly scheme: string;
+ /**
+ * Returns a `Proxy` object that acts as a `net.Socket` (or `tls.TLSSocket`) but
+ * applies getters, setters, and methods based on HTTP/2 logic.
+ *
+ * `destroyed`, `readable`, and `writable` properties will be retrieved from and
+ * set on `request.stream`.
+ *
+ * `destroy`, `emit`, `end`, `on` and `once` methods will be called on`request.stream`.
+ *
+ * `setTimeout` method will be called on `request.stream.session`.
+ *
+ * `pause`, `read`, `resume`, and `write` will throw an error with code`ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for
+ * more information.
+ *
+ * All other interactions will be routed directly to the socket. With TLS support,
+ * use `request.socket.getPeerCertificate()` to obtain the client's
+ * authentication details.
+ * @since v8.4.0
+ */
+ readonly socket: net.Socket | tls.TLSSocket;
+ /**
+ * The `Http2Stream` object backing the request.
+ * @since v8.4.0
+ */
+ readonly stream: ServerHttp2Stream;
+ /**
+ * The request/response trailers object. Only populated at the `'end'` event.
+ * @since v8.4.0
+ */
+ readonly trailers: IncomingHttpHeaders;
+ /**
+ * Request URL string. This contains only the URL that is present in the actual
+ * HTTP request. If the request is:
+ *
+ * ```http
+ * GET /status?name=ryan HTTP/1.1
+ * Accept: text/plain
+ * ```
+ *
+ * Then `request.url` will be:
+ *
+ * ```js
+ * '/status?name=ryan'
+ * ```
+ *
+ * To parse the url into its parts, `new URL()` can be used:
+ *
+ * ```console
+ * $ node
+ * > new URL('/status?name=ryan', 'http://example.com')
+ * URL {
+ * href: 'http://example.com/status?name=ryan',
+ * origin: 'http://example.com',
+ * protocol: 'http:',
+ * username: '',
+ * password: '',
+ * host: 'example.com',
+ * hostname: 'example.com',
+ * port: '',
+ * pathname: '/status',
+ * search: '?name=ryan',
+ * searchParams: URLSearchParams { 'name' => 'ryan' },
+ * hash: ''
+ * }
+ * ```
+ * @since v8.4.0
+ */
+ url: string;
+ /**
+ * Sets the `Http2Stream`'s timeout value to `msecs`. If a callback is
+ * provided, then it is added as a listener on the `'timeout'` event on
+ * the response object.
+ *
+ * If no `'timeout'` listener is added to the request, the response, or
+ * the server, then `Http2Stream` s are destroyed when they time out. If a
+ * handler is assigned to the request, the response, or the server's `'timeout'`events, timed out sockets must be handled explicitly.
+ * @since v8.4.0
+ */
+ setTimeout(msecs: number, callback?: () => void): void;
+ read(size?: number): Buffer | string | null;
+ addListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this;
+ addListener(event: "close", listener: () => void): this;
+ addListener(event: "data", listener: (chunk: Buffer | string) => void): this;
+ addListener(event: "end", listener: () => void): this;
+ addListener(event: "readable", listener: () => void): this;
+ addListener(event: "error", listener: (err: Error) => void): this;
+ addListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ emit(event: "aborted", hadError: boolean, code: number): boolean;
+ emit(event: "close"): boolean;
+ emit(event: "data", chunk: Buffer | string): boolean;
+ emit(event: "end"): boolean;
+ emit(event: "readable"): boolean;
+ emit(event: "error", err: Error): boolean;
+ emit(event: string | symbol, ...args: any[]): boolean;
+ on(event: "aborted", listener: (hadError: boolean, code: number) => void): this;
+ on(event: "close", listener: () => void): this;
+ on(event: "data", listener: (chunk: Buffer | string) => void): this;
+ on(event: "end", listener: () => void): this;
+ on(event: "readable", listener: () => void): this;
+ on(event: "error", listener: (err: Error) => void): this;
+ on(event: string | symbol, listener: (...args: any[]) => void): this;
+ once(event: "aborted", listener: (hadError: boolean, code: number) => void): this;
+ once(event: "close", listener: () => void): this;
+ once(event: "data", listener: (chunk: Buffer | string) => void): this;
+ once(event: "end", listener: () => void): this;
+ once(event: "readable", listener: () => void): this;
+ once(event: "error", listener: (err: Error) => void): this;
+ once(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this;
+ prependListener(event: "close", listener: () => void): this;
+ prependListener(event: "data", listener: (chunk: Buffer | string) => void): this;
+ prependListener(event: "end", listener: () => void): this;
+ prependListener(event: "readable", listener: () => void): this;
+ prependListener(event: "error", listener: (err: Error) => void): this;
+ prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependOnceListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this;
+ prependOnceListener(event: "close", listener: () => void): this;
+ prependOnceListener(event: "data", listener: (chunk: Buffer | string) => void): this;
+ prependOnceListener(event: "end", listener: () => void): this;
+ prependOnceListener(event: "readable", listener: () => void): this;
+ prependOnceListener(event: "error", listener: (err: Error) => void): this;
+ prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ }
+ /**
+ * This object is created internally by an HTTP server, not by the user. It is
+ * passed as the second parameter to the `'request'` event.
+ * @since v8.4.0
+ */
+ export class Http2ServerResponse extends stream.Writable {
+ constructor(stream: ServerHttp2Stream);
+ /**
+ * See `response.socket`.
+ * @since v8.4.0
+ * @deprecated Since v13.0.0 - Use `socket`.
+ */
+ readonly connection: net.Socket | tls.TLSSocket;
+ /**
+ * Boolean value that indicates whether the response has completed. Starts
+ * as `false`. After `response.end()` executes, the value will be `true`.
+ * @since v8.4.0
+ * @deprecated Since v13.4.0,v12.16.0 - Use `writableEnded`.
+ */
+ readonly finished: boolean;
+ /**
+ * True if headers were sent, false otherwise (read-only).
+ * @since v8.4.0
+ */
+ readonly headersSent: boolean;
+ /**
+ * A reference to the original HTTP2 request object.
+ * @since v15.7.0
+ */
+ readonly req: Http2ServerRequest;
+ /**
+ * Returns a `Proxy` object that acts as a `net.Socket` (or `tls.TLSSocket`) but
+ * applies getters, setters, and methods based on HTTP/2 logic.
+ *
+ * `destroyed`, `readable`, and `writable` properties will be retrieved from and
+ * set on `response.stream`.
+ *
+ * `destroy`, `emit`, `end`, `on` and `once` methods will be called on`response.stream`.
+ *
+ * `setTimeout` method will be called on `response.stream.session`.
+ *
+ * `pause`, `read`, `resume`, and `write` will throw an error with code`ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for
+ * more information.
+ *
+ * All other interactions will be routed directly to the socket.
+ *
+ * ```js
+ * const http2 = require('http2');
+ * const server = http2.createServer((req, res) => {
+ * const ip = req.socket.remoteAddress;
+ * const port = req.socket.remotePort;
+ * res.end(`Your IP address is ${ip} and your source port is ${port}.`);
+ * }).listen(3000);
+ * ```
+ * @since v8.4.0
+ */
+ readonly socket: net.Socket | tls.TLSSocket;
+ /**
+ * The `Http2Stream` object backing the response.
+ * @since v8.4.0
+ */
+ readonly stream: ServerHttp2Stream;
+ /**
+ * When true, the Date header will be automatically generated and sent in
+ * the response if it is not already present in the headers. Defaults to true.
+ *
+ * This should only be disabled for testing; HTTP requires the Date header
+ * in responses.
+ * @since v8.4.0
+ */
+ sendDate: boolean;
+ /**
+ * When using implicit headers (not calling `response.writeHead()` explicitly),
+ * this property controls the status code that will be sent to the client when
+ * the headers get flushed.
+ *
+ * ```js
+ * response.statusCode = 404;
+ * ```
+ *
+ * After response header was sent to the client, this property indicates the
+ * status code which was sent out.
+ * @since v8.4.0
+ */
+ statusCode: number;
+ /**
+ * Status message is not supported by HTTP/2 (RFC 7540 8.1.2.4). It returns
+ * an empty string.
+ * @since v8.4.0
+ */
+ statusMessage: "";
+ /**
+ * This method adds HTTP trailing headers (a header but at the end of the
+ * message) to the response.
+ *
+ * Attempting to set a header field name or value that contains invalid characters
+ * will result in a `TypeError` being thrown.
+ * @since v8.4.0
+ */
+ addTrailers(trailers: OutgoingHttpHeaders): void;
+ /**
+ * This method signals to the server that all of the response headers and body
+ * have been sent; that server should consider this message complete.
+ * The method, `response.end()`, MUST be called on each response.
+ *
+ * If `data` is specified, it is equivalent to calling `response.write(data, encoding)` followed by `response.end(callback)`.
+ *
+ * If `callback` is specified, it will be called when the response stream
+ * is finished.
+ * @since v8.4.0
+ */
+ end(callback?: () => void): this;
+ end(data: string | Uint8Array, callback?: () => void): this;
+ end(data: string | Uint8Array, encoding: BufferEncoding, callback?: () => void): this;
+ /**
+ * Reads out a header that has already been queued but not sent to the client.
+ * The name is case-insensitive.
+ *
+ * ```js
+ * const contentType = response.getHeader('content-type');
+ * ```
+ * @since v8.4.0
+ */
+ getHeader(name: string): string;
+ /**
+ * Returns an array containing the unique names of the current outgoing headers.
+ * All header names are lowercase.
+ *
+ * ```js
+ * response.setHeader('Foo', 'bar');
+ * response.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']);
+ *
+ * const headerNames = response.getHeaderNames();
+ * // headerNames === ['foo', 'set-cookie']
+ * ```
+ * @since v8.4.0
+ */
+ getHeaderNames(): string[];
+ /**
+ * Returns a shallow copy of the current outgoing headers. Since a shallow copy
+ * is used, array values may be mutated without additional calls to various
+ * header-related http module methods. The keys of the returned object are the
+ * header names and the values are the respective header values. All header names
+ * are lowercase.
+ *
+ * The object returned by the `response.getHeaders()` method _does not_prototypically inherit from the JavaScript `Object`. This means that typical`Object` methods such as `obj.toString()`,
+ * `obj.hasOwnProperty()`, and others
+ * are not defined and _will not work_.
+ *
+ * ```js
+ * response.setHeader('Foo', 'bar');
+ * response.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']);
+ *
+ * const headers = response.getHeaders();
+ * // headers === { foo: 'bar', 'set-cookie': ['foo=bar', 'bar=baz'] }
+ * ```
+ * @since v8.4.0
+ */
+ getHeaders(): OutgoingHttpHeaders;
+ /**
+ * Returns `true` if the header identified by `name` is currently set in the
+ * outgoing headers. The header name matching is case-insensitive.
+ *
+ * ```js
+ * const hasContentType = response.hasHeader('content-type');
+ * ```
+ * @since v8.4.0
+ */
+ hasHeader(name: string): boolean;
+ /**
+ * Removes a header that has been queued for implicit sending.
+ *
+ * ```js
+ * response.removeHeader('Content-Encoding');
+ * ```
+ * @since v8.4.0
+ */
+ removeHeader(name: string): void;
+ /**
+ * Sets a single header value for implicit headers. If this header already exists
+ * in the to-be-sent headers, its value will be replaced. Use an array of strings
+ * here to send multiple headers with the same name.
+ *
+ * ```js
+ * response.setHeader('Content-Type', 'text/html; charset=utf-8');
+ * ```
+ *
+ * or
+ *
+ * ```js
+ * response.setHeader('Set-Cookie', ['type=ninja', 'language=javascript']);
+ * ```
+ *
+ * Attempting to set a header field name or value that contains invalid characters
+ * will result in a `TypeError` being thrown.
+ *
+ * When headers have been set with `response.setHeader()`, they will be merged
+ * with any headers passed to `response.writeHead()`, with the headers passed
+ * to `response.writeHead()` given precedence.
+ *
+ * ```js
+ * // Returns content-type = text/plain
+ * const server = http2.createServer((req, res) => {
+ * res.setHeader('Content-Type', 'text/html; charset=utf-8');
+ * res.setHeader('X-Foo', 'bar');
+ * res.writeHead(200, { 'Content-Type': 'text/plain; charset=utf-8' });
+ * res.end('ok');
+ * });
+ * ```
+ * @since v8.4.0
+ */
+ setHeader(name: string, value: number | string | readonly string[]): void;
+ /**
+ * Sets the `Http2Stream`'s timeout value to `msecs`. If a callback is
+ * provided, then it is added as a listener on the `'timeout'` event on
+ * the response object.
+ *
+ * If no `'timeout'` listener is added to the request, the response, or
+ * the server, then `Http2Stream` s are destroyed when they time out. If a
+ * handler is assigned to the request, the response, or the server's `'timeout'`events, timed out sockets must be handled explicitly.
+ * @since v8.4.0
+ */
+ setTimeout(msecs: number, callback?: () => void): void;
+ /**
+ * If this method is called and `response.writeHead()` has not been called,
+ * it will switch to implicit header mode and flush the implicit headers.
+ *
+ * This sends a chunk of the response body. This method may
+ * be called multiple times to provide successive parts of the body.
+ *
+ * In the `http` module, the response body is omitted when the
+ * request is a HEAD request. Similarly, the `204` and `304` responses _must not_ include a message body.
+ *
+ * `chunk` can be a string or a buffer. If `chunk` is a string,
+ * the second parameter specifies how to encode it into a byte stream.
+ * By default the `encoding` is `'utf8'`. `callback` will be called when this chunk
+ * of data is flushed.
+ *
+ * This is the raw HTTP body and has nothing to do with higher-level multi-part
+ * body encodings that may be used.
+ *
+ * The first time `response.write()` is called, it will send the buffered
+ * header information and the first chunk of the body to the client. The second
+ * time `response.write()` is called, Node.js assumes data will be streamed,
+ * and sends the new data separately. That is, the response is buffered up to the
+ * first chunk of the body.
+ *
+ * Returns `true` if the entire data was flushed successfully to the kernel
+ * buffer. Returns `false` if all or part of the data was queued in user memory.`'drain'` will be emitted when the buffer is free again.
+ * @since v8.4.0
+ */
+ write(chunk: string | Uint8Array, callback?: (err: Error) => void): boolean;
+ write(chunk: string | Uint8Array, encoding: BufferEncoding, callback?: (err: Error) => void): boolean;
+ /**
+ * Sends a status `100 Continue` to the client, indicating that the request body
+ * should be sent. See the `'checkContinue'` event on `Http2Server` and`Http2SecureServer`.
+ * @since v8.4.0
+ */
+ writeContinue(): void;
+ /**
+ * Sends a status `103 Early Hints` to the client with a Link header,
+ * indicating that the user agent can preload/preconnect the linked resources.
+ * The `hints` is an object containing the values of headers to be sent with
+ * early hints message.
+ *
+ * Example:
+ *
+ * ```js
+ * const earlyHintsLink = '</styles.css>; rel=preload; as=style';
+ * response.writeEarlyHints({
+ * 'link': earlyHintsLink,
+ * });
+ *
+ * const earlyHintsLinks = [
+ * '</styles.css>; rel=preload; as=style',
+ * '</scripts.js>; rel=preload; as=script',
+ * ];
+ * response.writeEarlyHints({
+ * 'link': earlyHintsLinks,
+ * 'x-trace-id': 'id for diagnostics'
+ * });
+ * ```
+ *
+ * @since v18.11.0
+ * @param hints An object containing the values of headers
+ */
+ writeEarlyHints(hints: Record<string, string | string[]>): void;
+ /**
+ * Sends a response header to the request. The status code is a 3-digit HTTP
+ * status code, like `404`. The last argument, `headers`, are the response headers.
+ *
+ * Returns a reference to the `Http2ServerResponse`, so that calls can be chained.
+ *
+ * For compatibility with `HTTP/1`, a human-readable `statusMessage` may be
+ * passed as the second argument. However, because the `statusMessage` has no
+ * meaning within HTTP/2, the argument will have no effect and a process warning
+ * will be emitted.
+ *
+ * ```js
+ * const body = 'hello world';
+ * response.writeHead(200, {
+ * 'Content-Length': Buffer.byteLength(body),
+ * 'Content-Type': 'text/plain; charset=utf-8',
+ * });
+ * ```
+ *
+ * `Content-Length` is given in bytes not characters. The`Buffer.byteLength()` API may be used to determine the number of bytes in a
+ * given encoding. On outbound messages, Node.js does not check if Content-Length
+ * and the length of the body being transmitted are equal or not. However, when
+ * receiving messages, Node.js will automatically reject messages when the`Content-Length` does not match the actual payload size.
+ *
+ * This method may be called at most one time on a message before `response.end()` is called.
+ *
+ * If `response.write()` or `response.end()` are called before calling
+ * this, the implicit/mutable headers will be calculated and call this function.
+ *
+ * When headers have been set with `response.setHeader()`, they will be merged
+ * with any headers passed to `response.writeHead()`, with the headers passed
+ * to `response.writeHead()` given precedence.
+ *
+ * ```js
+ * // Returns content-type = text/plain
+ * const server = http2.createServer((req, res) => {
+ * res.setHeader('Content-Type', 'text/html; charset=utf-8');
+ * res.setHeader('X-Foo', 'bar');
+ * res.writeHead(200, { 'Content-Type': 'text/plain; charset=utf-8' });
+ * res.end('ok');
+ * });
+ * ```
+ *
+ * Attempting to set a header field name or value that contains invalid characters
+ * will result in a `TypeError` being thrown.
+ * @since v8.4.0
+ */
+ writeHead(statusCode: number, headers?: OutgoingHttpHeaders): this;
+ writeHead(statusCode: number, statusMessage: string, headers?: OutgoingHttpHeaders): this;
+ /**
+ * Call `http2stream.pushStream()` with the given headers, and wrap the
+ * given `Http2Stream` on a newly created `Http2ServerResponse` as the callback
+ * parameter if successful. When `Http2ServerRequest` is closed, the callback is
+ * called with an error `ERR_HTTP2_INVALID_STREAM`.
+ * @since v8.4.0
+ * @param headers An object describing the headers
+ * @param callback Called once `http2stream.pushStream()` is finished, or either when the attempt to create the pushed `Http2Stream` has failed or has been rejected, or the state of
+ * `Http2ServerRequest` is closed prior to calling the `http2stream.pushStream()` method
+ */
+ createPushResponse(
+ headers: OutgoingHttpHeaders,
+ callback: (err: Error | null, res: Http2ServerResponse) => void,
+ ): void;
+ addListener(event: "close", listener: () => void): this;
+ addListener(event: "drain", listener: () => void): this;
+ addListener(event: "error", listener: (error: Error) => void): this;
+ addListener(event: "finish", listener: () => void): this;
+ addListener(event: "pipe", listener: (src: stream.Readable) => void): this;
+ addListener(event: "unpipe", listener: (src: stream.Readable) => void): this;
+ addListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ emit(event: "close"): boolean;
+ emit(event: "drain"): boolean;
+ emit(event: "error", error: Error): boolean;
+ emit(event: "finish"): boolean;
+ emit(event: "pipe", src: stream.Readable): boolean;
+ emit(event: "unpipe", src: stream.Readable): boolean;
+ emit(event: string | symbol, ...args: any[]): boolean;
+ on(event: "close", listener: () => void): this;
+ on(event: "drain", listener: () => void): this;
+ on(event: "error", listener: (error: Error) => void): this;
+ on(event: "finish", listener: () => void): this;
+ on(event: "pipe", listener: (src: stream.Readable) => void): this;
+ on(event: "unpipe", listener: (src: stream.Readable) => void): this;
+ on(event: string | symbol, listener: (...args: any[]) => void): this;
+ once(event: "close", listener: () => void): this;
+ once(event: "drain", listener: () => void): this;
+ once(event: "error", listener: (error: Error) => void): this;
+ once(event: "finish", listener: () => void): this;
+ once(event: "pipe", listener: (src: stream.Readable) => void): this;
+ once(event: "unpipe", listener: (src: stream.Readable) => void): this;
+ once(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependListener(event: "close", listener: () => void): this;
+ prependListener(event: "drain", listener: () => void): this;
+ prependListener(event: "error", listener: (error: Error) => void): this;
+ prependListener(event: "finish", listener: () => void): this;
+ prependListener(event: "pipe", listener: (src: stream.Readable) => void): this;
+ prependListener(event: "unpipe", listener: (src: stream.Readable) => void): this;
+ prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependOnceListener(event: "close", listener: () => void): this;
+ prependOnceListener(event: "drain", listener: () => void): this;
+ prependOnceListener(event: "error", listener: (error: Error) => void): this;
+ prependOnceListener(event: "finish", listener: () => void): this;
+ prependOnceListener(event: "pipe", listener: (src: stream.Readable) => void): this;
+ prependOnceListener(event: "unpipe", listener: (src: stream.Readable) => void): this;
+ prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ }
+ export namespace constants {
+ const NGHTTP2_SESSION_SERVER: number;
+ const NGHTTP2_SESSION_CLIENT: number;
+ const NGHTTP2_STREAM_STATE_IDLE: number;
+ const NGHTTP2_STREAM_STATE_OPEN: number;
+ const NGHTTP2_STREAM_STATE_RESERVED_LOCAL: number;
+ const NGHTTP2_STREAM_STATE_RESERVED_REMOTE: number;
+ const NGHTTP2_STREAM_STATE_HALF_CLOSED_LOCAL: number;
+ const NGHTTP2_STREAM_STATE_HALF_CLOSED_REMOTE: number;
+ const NGHTTP2_STREAM_STATE_CLOSED: number;
+ const NGHTTP2_NO_ERROR: number;
+ const NGHTTP2_PROTOCOL_ERROR: number;
+ const NGHTTP2_INTERNAL_ERROR: number;
+ const NGHTTP2_FLOW_CONTROL_ERROR: number;
+ const NGHTTP2_SETTINGS_TIMEOUT: number;
+ const NGHTTP2_STREAM_CLOSED: number;
+ const NGHTTP2_FRAME_SIZE_ERROR: number;
+ const NGHTTP2_REFUSED_STREAM: number;
+ const NGHTTP2_CANCEL: number;
+ const NGHTTP2_COMPRESSION_ERROR: number;
+ const NGHTTP2_CONNECT_ERROR: number;
+ const NGHTTP2_ENHANCE_YOUR_CALM: number;
+ const NGHTTP2_INADEQUATE_SECURITY: number;
+ const NGHTTP2_HTTP_1_1_REQUIRED: number;
+ const NGHTTP2_ERR_FRAME_SIZE_ERROR: number;
+ const NGHTTP2_FLAG_NONE: number;
+ const NGHTTP2_FLAG_END_STREAM: number;
+ const NGHTTP2_FLAG_END_HEADERS: number;
+ const NGHTTP2_FLAG_ACK: number;
+ const NGHTTP2_FLAG_PADDED: number;
+ const NGHTTP2_FLAG_PRIORITY: number;
+ const DEFAULT_SETTINGS_HEADER_TABLE_SIZE: number;
+ const DEFAULT_SETTINGS_ENABLE_PUSH: number;
+ const DEFAULT_SETTINGS_INITIAL_WINDOW_SIZE: number;
+ const DEFAULT_SETTINGS_MAX_FRAME_SIZE: number;
+ const MAX_MAX_FRAME_SIZE: number;
+ const MIN_MAX_FRAME_SIZE: number;
+ const MAX_INITIAL_WINDOW_SIZE: number;
+ const NGHTTP2_DEFAULT_WEIGHT: number;
+ const NGHTTP2_SETTINGS_HEADER_TABLE_SIZE: number;
+ const NGHTTP2_SETTINGS_ENABLE_PUSH: number;
+ const NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS: number;
+ const NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE: number;
+ const NGHTTP2_SETTINGS_MAX_FRAME_SIZE: number;
+ const NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE: number;
+ const PADDING_STRATEGY_NONE: number;
+ const PADDING_STRATEGY_MAX: number;
+ const PADDING_STRATEGY_CALLBACK: number;
+ const HTTP2_HEADER_STATUS: string;
+ const HTTP2_HEADER_METHOD: string;
+ const HTTP2_HEADER_AUTHORITY: string;
+ const HTTP2_HEADER_SCHEME: string;
+ const HTTP2_HEADER_PATH: string;
+ const HTTP2_HEADER_ACCEPT_CHARSET: string;
+ const HTTP2_HEADER_ACCEPT_ENCODING: string;
+ const HTTP2_HEADER_ACCEPT_LANGUAGE: string;
+ const HTTP2_HEADER_ACCEPT_RANGES: string;
+ const HTTP2_HEADER_ACCEPT: string;
+ const HTTP2_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN: string;
+ const HTTP2_HEADER_AGE: string;
+ const HTTP2_HEADER_ALLOW: string;
+ const HTTP2_HEADER_AUTHORIZATION: string;
+ const HTTP2_HEADER_CACHE_CONTROL: string;
+ const HTTP2_HEADER_CONNECTION: string;
+ const HTTP2_HEADER_CONTENT_DISPOSITION: string;
+ const HTTP2_HEADER_CONTENT_ENCODING: string;
+ const HTTP2_HEADER_CONTENT_LANGUAGE: string;
+ const HTTP2_HEADER_CONTENT_LENGTH: string;
+ const HTTP2_HEADER_CONTENT_LOCATION: string;
+ const HTTP2_HEADER_CONTENT_MD5: string;
+ const HTTP2_HEADER_CONTENT_RANGE: string;
+ const HTTP2_HEADER_CONTENT_TYPE: string;
+ const HTTP2_HEADER_COOKIE: string;
+ const HTTP2_HEADER_DATE: string;
+ const HTTP2_HEADER_ETAG: string;
+ const HTTP2_HEADER_EXPECT: string;
+ const HTTP2_HEADER_EXPIRES: string;
+ const HTTP2_HEADER_FROM: string;
+ const HTTP2_HEADER_HOST: string;
+ const HTTP2_HEADER_IF_MATCH: string;
+ const HTTP2_HEADER_IF_MODIFIED_SINCE: string;
+ const HTTP2_HEADER_IF_NONE_MATCH: string;
+ const HTTP2_HEADER_IF_RANGE: string;
+ const HTTP2_HEADER_IF_UNMODIFIED_SINCE: string;
+ const HTTP2_HEADER_LAST_MODIFIED: string;
+ const HTTP2_HEADER_LINK: string;
+ const HTTP2_HEADER_LOCATION: string;
+ const HTTP2_HEADER_MAX_FORWARDS: string;
+ const HTTP2_HEADER_PREFER: string;
+ const HTTP2_HEADER_PROXY_AUTHENTICATE: string;
+ const HTTP2_HEADER_PROXY_AUTHORIZATION: string;
+ const HTTP2_HEADER_RANGE: string;
+ const HTTP2_HEADER_REFERER: string;
+ const HTTP2_HEADER_REFRESH: string;
+ const HTTP2_HEADER_RETRY_AFTER: string;
+ const HTTP2_HEADER_SERVER: string;
+ const HTTP2_HEADER_SET_COOKIE: string;
+ const HTTP2_HEADER_STRICT_TRANSPORT_SECURITY: string;
+ const HTTP2_HEADER_TRANSFER_ENCODING: string;
+ const HTTP2_HEADER_TE: string;
+ const HTTP2_HEADER_UPGRADE: string;
+ const HTTP2_HEADER_USER_AGENT: string;
+ const HTTP2_HEADER_VARY: string;
+ const HTTP2_HEADER_VIA: string;
+ const HTTP2_HEADER_WWW_AUTHENTICATE: string;
+ const HTTP2_HEADER_HTTP2_SETTINGS: string;
+ const HTTP2_HEADER_KEEP_ALIVE: string;
+ const HTTP2_HEADER_PROXY_CONNECTION: string;
+ const HTTP2_METHOD_ACL: string;
+ const HTTP2_METHOD_BASELINE_CONTROL: string;
+ const HTTP2_METHOD_BIND: string;
+ const HTTP2_METHOD_CHECKIN: string;
+ const HTTP2_METHOD_CHECKOUT: string;
+ const HTTP2_METHOD_CONNECT: string;
+ const HTTP2_METHOD_COPY: string;
+ const HTTP2_METHOD_DELETE: string;
+ const HTTP2_METHOD_GET: string;
+ const HTTP2_METHOD_HEAD: string;
+ const HTTP2_METHOD_LABEL: string;
+ const HTTP2_METHOD_LINK: string;
+ const HTTP2_METHOD_LOCK: string;
+ const HTTP2_METHOD_MERGE: string;
+ const HTTP2_METHOD_MKACTIVITY: string;
+ const HTTP2_METHOD_MKCALENDAR: string;
+ const HTTP2_METHOD_MKCOL: string;
+ const HTTP2_METHOD_MKREDIRECTREF: string;
+ const HTTP2_METHOD_MKWORKSPACE: string;
+ const HTTP2_METHOD_MOVE: string;
+ const HTTP2_METHOD_OPTIONS: string;
+ const HTTP2_METHOD_ORDERPATCH: string;
+ const HTTP2_METHOD_PATCH: string;
+ const HTTP2_METHOD_POST: string;
+ const HTTP2_METHOD_PRI: string;
+ const HTTP2_METHOD_PROPFIND: string;
+ const HTTP2_METHOD_PROPPATCH: string;
+ const HTTP2_METHOD_PUT: string;
+ const HTTP2_METHOD_REBIND: string;
+ const HTTP2_METHOD_REPORT: string;
+ const HTTP2_METHOD_SEARCH: string;
+ const HTTP2_METHOD_TRACE: string;
+ const HTTP2_METHOD_UNBIND: string;
+ const HTTP2_METHOD_UNCHECKOUT: string;
+ const HTTP2_METHOD_UNLINK: string;
+ const HTTP2_METHOD_UNLOCK: string;
+ const HTTP2_METHOD_UPDATE: string;
+ const HTTP2_METHOD_UPDATEREDIRECTREF: string;
+ const HTTP2_METHOD_VERSION_CONTROL: string;
+ const HTTP_STATUS_CONTINUE: number;
+ const HTTP_STATUS_SWITCHING_PROTOCOLS: number;
+ const HTTP_STATUS_PROCESSING: number;
+ const HTTP_STATUS_OK: number;
+ const HTTP_STATUS_CREATED: number;
+ const HTTP_STATUS_ACCEPTED: number;
+ const HTTP_STATUS_NON_AUTHORITATIVE_INFORMATION: number;
+ const HTTP_STATUS_NO_CONTENT: number;
+ const HTTP_STATUS_RESET_CONTENT: number;
+ const HTTP_STATUS_PARTIAL_CONTENT: number;
+ const HTTP_STATUS_MULTI_STATUS: number;
+ const HTTP_STATUS_ALREADY_REPORTED: number;
+ const HTTP_STATUS_IM_USED: number;
+ const HTTP_STATUS_MULTIPLE_CHOICES: number;
+ const HTTP_STATUS_MOVED_PERMANENTLY: number;
+ const HTTP_STATUS_FOUND: number;
+ const HTTP_STATUS_SEE_OTHER: number;
+ const HTTP_STATUS_NOT_MODIFIED: number;
+ const HTTP_STATUS_USE_PROXY: number;
+ const HTTP_STATUS_TEMPORARY_REDIRECT: number;
+ const HTTP_STATUS_PERMANENT_REDIRECT: number;
+ const HTTP_STATUS_BAD_REQUEST: number;
+ const HTTP_STATUS_UNAUTHORIZED: number;
+ const HTTP_STATUS_PAYMENT_REQUIRED: number;
+ const HTTP_STATUS_FORBIDDEN: number;
+ const HTTP_STATUS_NOT_FOUND: number;
+ const HTTP_STATUS_METHOD_NOT_ALLOWED: number;
+ const HTTP_STATUS_NOT_ACCEPTABLE: number;
+ const HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED: number;
+ const HTTP_STATUS_REQUEST_TIMEOUT: number;
+ const HTTP_STATUS_CONFLICT: number;
+ const HTTP_STATUS_GONE: number;
+ const HTTP_STATUS_LENGTH_REQUIRED: number;
+ const HTTP_STATUS_PRECONDITION_FAILED: number;
+ const HTTP_STATUS_PAYLOAD_TOO_LARGE: number;
+ const HTTP_STATUS_URI_TOO_LONG: number;
+ const HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE: number;
+ const HTTP_STATUS_RANGE_NOT_SATISFIABLE: number;
+ const HTTP_STATUS_EXPECTATION_FAILED: number;
+ const HTTP_STATUS_TEAPOT: number;
+ const HTTP_STATUS_MISDIRECTED_REQUEST: number;
+ const HTTP_STATUS_UNPROCESSABLE_ENTITY: number;
+ const HTTP_STATUS_LOCKED: number;
+ const HTTP_STATUS_FAILED_DEPENDENCY: number;
+ const HTTP_STATUS_UNORDERED_COLLECTION: number;
+ const HTTP_STATUS_UPGRADE_REQUIRED: number;
+ const HTTP_STATUS_PRECONDITION_REQUIRED: number;
+ const HTTP_STATUS_TOO_MANY_REQUESTS: number;
+ const HTTP_STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE: number;
+ const HTTP_STATUS_UNAVAILABLE_FOR_LEGAL_REASONS: number;
+ const HTTP_STATUS_INTERNAL_SERVER_ERROR: number;
+ const HTTP_STATUS_NOT_IMPLEMENTED: number;
+ const HTTP_STATUS_BAD_GATEWAY: number;
+ const HTTP_STATUS_SERVICE_UNAVAILABLE: number;
+ const HTTP_STATUS_GATEWAY_TIMEOUT: number;
+ const HTTP_STATUS_HTTP_VERSION_NOT_SUPPORTED: number;
+ const HTTP_STATUS_VARIANT_ALSO_NEGOTIATES: number;
+ const HTTP_STATUS_INSUFFICIENT_STORAGE: number;
+ const HTTP_STATUS_LOOP_DETECTED: number;
+ const HTTP_STATUS_BANDWIDTH_LIMIT_EXCEEDED: number;
+ const HTTP_STATUS_NOT_EXTENDED: number;
+ const HTTP_STATUS_NETWORK_AUTHENTICATION_REQUIRED: number;
+ }
+ /**
+ * This symbol can be set as a property on the HTTP/2 headers object with
+ * an array value in order to provide a list of headers considered sensitive.
+ */
+ export const sensitiveHeaders: symbol;
+ /**
+ * Returns an object containing the default settings for an `Http2Session`instance. This method returns a new object instance every time it is called
+ * so instances returned may be safely modified for use.
+ * @since v8.4.0
+ */
+ export function getDefaultSettings(): Settings;
+ /**
+ * Returns a `Buffer` instance containing serialized representation of the given
+ * HTTP/2 settings as specified in the [HTTP/2](https://tools.ietf.org/html/rfc7540) specification. This is intended
+ * for use with the `HTTP2-Settings` header field.
+ *
+ * ```js
+ * const http2 = require('http2');
+ *
+ * const packed = http2.getPackedSettings({ enablePush: false });
+ *
+ * console.log(packed.toString('base64'));
+ * // Prints: AAIAAAAA
+ * ```
+ * @since v8.4.0
+ */
+ export function getPackedSettings(settings: Settings): Buffer;
+ /**
+ * Returns a `HTTP/2 Settings Object` containing the deserialized settings from
+ * the given `Buffer` as generated by `http2.getPackedSettings()`.
+ * @since v8.4.0
+ * @param buf The packed settings.
+ */
+ export function getUnpackedSettings(buf: Uint8Array): Settings;
+ /**
+ * Returns a `net.Server` instance that creates and manages `Http2Session`instances.
+ *
+ * Since there are no browsers known that support [unencrypted HTTP/2](https://http2.github.io/faq/#does-http2-require-encryption), the use of {@link createSecureServer} is necessary when
+ * communicating
+ * with browser clients.
+ *
+ * ```js
+ * const http2 = require('http2');
+ *
+ * // Create an unencrypted HTTP/2 server.
+ * // Since there are no browsers known that support
+ * // unencrypted HTTP/2, the use of `http2.createSecureServer()`
+ * // is necessary when communicating with browser clients.
+ * const server = http2.createServer();
+ *
+ * server.on('stream', (stream, headers) => {
+ * stream.respond({
+ * 'content-type': 'text/html; charset=utf-8',
+ * ':status': 200
+ * });
+ * stream.end('<h1>Hello World</h1>');
+ * });
+ *
+ * server.listen(80);
+ * ```
+ * @since v8.4.0
+ * @param onRequestHandler See `Compatibility API`
+ */
+ export function createServer(
+ onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
+ ): Http2Server;
+ export function createServer(
+ options: ServerOptions,
+ onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
+ ): Http2Server;
+ /**
+ * Returns a `tls.Server` instance that creates and manages `Http2Session`instances.
+ *
+ * ```js
+ * const http2 = require('http2');
+ * const fs = require('fs');
+ *
+ * const options = {
+ * key: fs.readFileSync('server-key.pem'),
+ * cert: fs.readFileSync('server-cert.pem')
+ * };
+ *
+ * // Create a secure HTTP/2 server
+ * const server = http2.createSecureServer(options);
+ *
+ * server.on('stream', (stream, headers) => {
+ * stream.respond({
+ * 'content-type': 'text/html; charset=utf-8',
+ * ':status': 200
+ * });
+ * stream.end('<h1>Hello World</h1>');
+ * });
+ *
+ * server.listen(80);
+ * ```
+ * @since v8.4.0
+ * @param onRequestHandler See `Compatibility API`
+ */
+ export function createSecureServer(
+ onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
+ ): Http2SecureServer;
+ export function createSecureServer(
+ options: SecureServerOptions,
+ onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
+ ): Http2SecureServer;
+ /**
+ * Returns a `ClientHttp2Session` instance.
+ *
+ * ```js
+ * const http2 = require('http2');
+ * const client = http2.connect('https://localhost:1234');
+ *
+ * // Use the client
+ *
+ * client.close();
+ * ```
+ * @since v8.4.0
+ * @param authority The remote HTTP/2 server to connect to. This must be in the form of a minimal, valid URL with the `http://` or `https://` prefix, host name, and IP port (if a non-default port
+ * is used). Userinfo (user ID and password), path, querystring, and fragment details in the URL will be ignored.
+ * @param listener Will be registered as a one-time listener of the {@link 'connect'} event.
+ */
+ export function connect(
+ authority: string | url.URL,
+ listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void,
+ ): ClientHttp2Session;
+ export function connect(
+ authority: string | url.URL,
+ options?: ClientSessionOptions | SecureClientSessionOptions,
+ listener?: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void,
+ ): ClientHttp2Session;
+}
+declare module "node:http2" {
+ export * from "http2";
+}
diff --git a/client/node_modules/@types/node/https.d.ts b/client/node_modules/@types/node/https.d.ts
new file mode 100644
index 0000000..2f06928
--- /dev/null
+++ b/client/node_modules/@types/node/https.d.ts
@@ -0,0 +1,544 @@
+/**
+ * HTTPS is the HTTP protocol over TLS/SSL. In Node.js this is implemented as a
+ * separate module.
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/https.js)
+ */
+declare module "https" {
+ import { Duplex } from "node:stream";
+ import * as tls from "node:tls";
+ import * as http from "node:http";
+ import { URL } from "node:url";
+ type ServerOptions<
+ Request extends typeof http.IncomingMessage = typeof http.IncomingMessage,
+ Response extends typeof http.ServerResponse = typeof http.ServerResponse,
+ > = tls.SecureContextOptions & tls.TlsOptions & http.ServerOptions<Request, Response>;
+ type RequestOptions =
+ & http.RequestOptions
+ & tls.SecureContextOptions
+ & {
+ checkServerIdentity?: typeof tls.checkServerIdentity | undefined;
+ rejectUnauthorized?: boolean | undefined; // Defaults to true
+ servername?: string | undefined; // SNI TLS Extension
+ };
+ interface AgentOptions extends http.AgentOptions, tls.ConnectionOptions {
+ rejectUnauthorized?: boolean | undefined;
+ maxCachedSessions?: number | undefined;
+ }
+ /**
+ * An `Agent` object for HTTPS similar to `http.Agent`. See {@link request} for more information.
+ * @since v0.4.5
+ */
+ class Agent extends http.Agent {
+ constructor(options?: AgentOptions);
+ options: AgentOptions;
+ }
+ interface Server<
+ Request extends typeof http.IncomingMessage = typeof http.IncomingMessage,
+ Response extends typeof http.ServerResponse = typeof http.ServerResponse,
+ > extends http.Server<Request, Response> {}
+ /**
+ * See `http.Server` for more information.
+ * @since v0.3.4
+ */
+ class Server<
+ Request extends typeof http.IncomingMessage = typeof http.IncomingMessage,
+ Response extends typeof http.ServerResponse = typeof http.ServerResponse,
+ > extends tls.Server {
+ constructor(requestListener?: http.RequestListener<Request, Response>);
+ constructor(
+ options: ServerOptions<Request, Response>,
+ requestListener?: http.RequestListener<Request, Response>,
+ );
+ /**
+ * Closes all connections connected to this server.
+ * @since v18.2.0
+ */
+ closeAllConnections(): void;
+ /**
+ * Closes all connections connected to this server which are not sending a request or waiting for a response.
+ * @since v18.2.0
+ */
+ closeIdleConnections(): void;
+ addListener(event: string, listener: (...args: any[]) => void): this;
+ addListener(event: "keylog", listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
+ addListener(
+ event: "newSession",
+ listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void,
+ ): this;
+ addListener(
+ event: "OCSPRequest",
+ listener: (
+ certificate: Buffer,
+ issuer: Buffer,
+ callback: (err: Error | null, resp: Buffer) => void,
+ ) => void,
+ ): this;
+ addListener(
+ event: "resumeSession",
+ listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void,
+ ): this;
+ addListener(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this;
+ addListener(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
+ addListener(event: "close", listener: () => void): this;
+ addListener(event: "connection", listener: (socket: Duplex) => void): this;
+ addListener(event: "error", listener: (err: Error) => void): this;
+ addListener(event: "listening", listener: () => void): this;
+ addListener(event: "checkContinue", listener: http.RequestListener<Request, Response>): this;
+ addListener(event: "checkExpectation", listener: http.RequestListener<Request, Response>): this;
+ addListener(event: "clientError", listener: (err: Error, socket: Duplex) => void): this;
+ addListener(
+ event: "connect",
+ listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void,
+ ): this;
+ addListener(event: "request", listener: http.RequestListener<Request, Response>): this;
+ addListener(
+ event: "upgrade",
+ listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void,
+ ): this;
+ emit(event: string, ...args: any[]): boolean;
+ emit(event: "keylog", line: Buffer, tlsSocket: tls.TLSSocket): boolean;
+ emit(
+ event: "newSession",
+ sessionId: Buffer,
+ sessionData: Buffer,
+ callback: (err: Error, resp: Buffer) => void,
+ ): boolean;
+ emit(
+ event: "OCSPRequest",
+ certificate: Buffer,
+ issuer: Buffer,
+ callback: (err: Error | null, resp: Buffer) => void,
+ ): boolean;
+ emit(event: "resumeSession", sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void): boolean;
+ emit(event: "secureConnection", tlsSocket: tls.TLSSocket): boolean;
+ emit(event: "tlsClientError", err: Error, tlsSocket: tls.TLSSocket): boolean;
+ emit(event: "close"): boolean;
+ emit(event: "connection", socket: Duplex): boolean;
+ emit(event: "error", err: Error): boolean;
+ emit(event: "listening"): boolean;
+ emit(
+ event: "checkContinue",
+ req: InstanceType<Request>,
+ res: InstanceType<Response> & { req: InstanceType<Request> },
+ ): boolean;
+ emit(
+ event: "checkExpectation",
+ req: InstanceType<Request>,
+ res: InstanceType<Response> & { req: InstanceType<Request> },
+ ): boolean;
+ emit(event: "clientError", err: Error, socket: Duplex): boolean;
+ emit(event: "connect", req: InstanceType<Request>, socket: Duplex, head: Buffer): boolean;
+ emit(
+ event: "request",
+ req: InstanceType<Request>,
+ res: InstanceType<Response> & { req: InstanceType<Request> },
+ ): boolean;
+ emit(event: "upgrade", req: InstanceType<Request>, socket: Duplex, head: Buffer): boolean;
+ on(event: string, listener: (...args: any[]) => void): this;
+ on(event: "keylog", listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
+ on(
+ event: "newSession",
+ listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void,
+ ): this;
+ on(
+ event: "OCSPRequest",
+ listener: (
+ certificate: Buffer,
+ issuer: Buffer,
+ callback: (err: Error | null, resp: Buffer) => void,
+ ) => void,
+ ): this;
+ on(
+ event: "resumeSession",
+ listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void,
+ ): this;
+ on(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this;
+ on(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
+ on(event: "close", listener: () => void): this;
+ on(event: "connection", listener: (socket: Duplex) => void): this;
+ on(event: "error", listener: (err: Error) => void): this;
+ on(event: "listening", listener: () => void): this;
+ on(event: "checkContinue", listener: http.RequestListener<Request, Response>): this;
+ on(event: "checkExpectation", listener: http.RequestListener<Request, Response>): this;
+ on(event: "clientError", listener: (err: Error, socket: Duplex) => void): this;
+ on(event: "connect", listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
+ on(event: "request", listener: http.RequestListener<Request, Response>): this;
+ on(event: "upgrade", listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
+ once(event: string, listener: (...args: any[]) => void): this;
+ once(event: "keylog", listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
+ once(
+ event: "newSession",
+ listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void,
+ ): this;
+ once(
+ event: "OCSPRequest",
+ listener: (
+ certificate: Buffer,
+ issuer: Buffer,
+ callback: (err: Error | null, resp: Buffer) => void,
+ ) => void,
+ ): this;
+ once(
+ event: "resumeSession",
+ listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void,
+ ): this;
+ once(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this;
+ once(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
+ once(event: "close", listener: () => void): this;
+ once(event: "connection", listener: (socket: Duplex) => void): this;
+ once(event: "error", listener: (err: Error) => void): this;
+ once(event: "listening", listener: () => void): this;
+ once(event: "checkContinue", listener: http.RequestListener<Request, Response>): this;
+ once(event: "checkExpectation", listener: http.RequestListener<Request, Response>): this;
+ once(event: "clientError", listener: (err: Error, socket: Duplex) => void): this;
+ once(event: "connect", listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
+ once(event: "request", listener: http.RequestListener<Request, Response>): this;
+ once(event: "upgrade", listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
+ prependListener(event: string, listener: (...args: any[]) => void): this;
+ prependListener(event: "keylog", listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
+ prependListener(
+ event: "newSession",
+ listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void,
+ ): this;
+ prependListener(
+ event: "OCSPRequest",
+ listener: (
+ certificate: Buffer,
+ issuer: Buffer,
+ callback: (err: Error | null, resp: Buffer) => void,
+ ) => void,
+ ): this;
+ prependListener(
+ event: "resumeSession",
+ listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void,
+ ): this;
+ prependListener(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this;
+ prependListener(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
+ prependListener(event: "close", listener: () => void): this;
+ prependListener(event: "connection", listener: (socket: Duplex) => void): this;
+ prependListener(event: "error", listener: (err: Error) => void): this;
+ prependListener(event: "listening", listener: () => void): this;
+ prependListener(event: "checkContinue", listener: http.RequestListener<Request, Response>): this;
+ prependListener(event: "checkExpectation", listener: http.RequestListener<Request, Response>): this;
+ prependListener(event: "clientError", listener: (err: Error, socket: Duplex) => void): this;
+ prependListener(
+ event: "connect",
+ listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void,
+ ): this;
+ prependListener(event: "request", listener: http.RequestListener<Request, Response>): this;
+ prependListener(
+ event: "upgrade",
+ listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void,
+ ): this;
+ prependOnceListener(event: string, listener: (...args: any[]) => void): this;
+ prependOnceListener(event: "keylog", listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
+ prependOnceListener(
+ event: "newSession",
+ listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void,
+ ): this;
+ prependOnceListener(
+ event: "OCSPRequest",
+ listener: (
+ certificate: Buffer,
+ issuer: Buffer,
+ callback: (err: Error | null, resp: Buffer) => void,
+ ) => void,
+ ): this;
+ prependOnceListener(
+ event: "resumeSession",
+ listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void,
+ ): this;
+ prependOnceListener(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this;
+ prependOnceListener(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
+ prependOnceListener(event: "close", listener: () => void): this;
+ prependOnceListener(event: "connection", listener: (socket: Duplex) => void): this;
+ prependOnceListener(event: "error", listener: (err: Error) => void): this;
+ prependOnceListener(event: "listening", listener: () => void): this;
+ prependOnceListener(event: "checkContinue", listener: http.RequestListener<Request, Response>): this;
+ prependOnceListener(event: "checkExpectation", listener: http.RequestListener<Request, Response>): this;
+ prependOnceListener(event: "clientError", listener: (err: Error, socket: Duplex) => void): this;
+ prependOnceListener(
+ event: "connect",
+ listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void,
+ ): this;
+ prependOnceListener(event: "request", listener: http.RequestListener<Request, Response>): this;
+ prependOnceListener(
+ event: "upgrade",
+ listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void,
+ ): this;
+ }
+ /**
+ * ```js
+ * // curl -k https://localhost:8000/
+ * const https = require('https');
+ * const fs = require('fs');
+ *
+ * const options = {
+ * key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'),
+ * cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem')
+ * };
+ *
+ * https.createServer(options, (req, res) => {
+ * res.writeHead(200);
+ * res.end('hello world\n');
+ * }).listen(8000);
+ * ```
+ *
+ * Or
+ *
+ * ```js
+ * const https = require('https');
+ * const fs = require('fs');
+ *
+ * const options = {
+ * pfx: fs.readFileSync('test/fixtures/test_cert.pfx'),
+ * passphrase: 'sample'
+ * };
+ *
+ * https.createServer(options, (req, res) => {
+ * res.writeHead(200);
+ * res.end('hello world\n');
+ * }).listen(8000);
+ * ```
+ * @since v0.3.4
+ * @param options Accepts `options` from `createServer`, `createSecureContext` and `createServer`.
+ * @param requestListener A listener to be added to the `'request'` event.
+ */
+ function createServer<
+ Request extends typeof http.IncomingMessage = typeof http.IncomingMessage,
+ Response extends typeof http.ServerResponse = typeof http.ServerResponse,
+ >(requestListener?: http.RequestListener<Request, Response>): Server<Request, Response>;
+ function createServer<
+ Request extends typeof http.IncomingMessage = typeof http.IncomingMessage,
+ Response extends typeof http.ServerResponse = typeof http.ServerResponse,
+ >(
+ options: ServerOptions<Request, Response>,
+ requestListener?: http.RequestListener<Request, Response>,
+ ): Server<Request, Response>;
+ /**
+ * Makes a request to a secure web server.
+ *
+ * The following additional `options` from `tls.connect()` are also accepted:`ca`, `cert`, `ciphers`, `clientCertEngine`, `crl`, `dhparam`, `ecdhCurve`,`honorCipherOrder`, `key`, `passphrase`,
+ * `pfx`, `rejectUnauthorized`,`secureOptions`, `secureProtocol`, `servername`, `sessionIdContext`,`highWaterMark`.
+ *
+ * `options` can be an object, a string, or a `URL` object. If `options` is a
+ * string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object.
+ *
+ * `https.request()` returns an instance of the `http.ClientRequest` class. The `ClientRequest` instance is a writable stream. If one needs to
+ * upload a file with a POST request, then write to the `ClientRequest` object.
+ *
+ * ```js
+ * const https = require('https');
+ *
+ * const options = {
+ * hostname: 'encrypted.google.com',
+ * port: 443,
+ * path: '/',
+ * method: 'GET'
+ * };
+ *
+ * const req = https.request(options, (res) => {
+ * console.log('statusCode:', res.statusCode);
+ * console.log('headers:', res.headers);
+ *
+ * res.on('data', (d) => {
+ * process.stdout.write(d);
+ * });
+ * });
+ *
+ * req.on('error', (e) => {
+ * console.error(e);
+ * });
+ * req.end();
+ * ```
+ *
+ * Example using options from `tls.connect()`:
+ *
+ * ```js
+ * const options = {
+ * hostname: 'encrypted.google.com',
+ * port: 443,
+ * path: '/',
+ * method: 'GET',
+ * key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'),
+ * cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem')
+ * };
+ * options.agent = new https.Agent(options);
+ *
+ * const req = https.request(options, (res) => {
+ * // ...
+ * });
+ * ```
+ *
+ * Alternatively, opt out of connection pooling by not using an `Agent`.
+ *
+ * ```js
+ * const options = {
+ * hostname: 'encrypted.google.com',
+ * port: 443,
+ * path: '/',
+ * method: 'GET',
+ * key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'),
+ * cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem'),
+ * agent: false
+ * };
+ *
+ * const req = https.request(options, (res) => {
+ * // ...
+ * });
+ * ```
+ *
+ * Example using a `URL` as `options`:
+ *
+ * ```js
+ * const options = new URL('https://abc:xyz@example.com');
+ *
+ * const req = https.request(options, (res) => {
+ * // ...
+ * });
+ * ```
+ *
+ * Example pinning on certificate fingerprint, or the public key (similar to`pin-sha256`):
+ *
+ * ```js
+ * const tls = require('tls');
+ * const https = require('https');
+ * const crypto = require('crypto');
+ *
+ * function sha256(s) {
+ * return crypto.createHash('sha256').update(s).digest('base64');
+ * }
+ * const options = {
+ * hostname: 'github.com',
+ * port: 443,
+ * path: '/',
+ * method: 'GET',
+ * checkServerIdentity: function(host, cert) {
+ * // Make sure the certificate is issued to the host we are connected to
+ * const err = tls.checkServerIdentity(host, cert);
+ * if (err) {
+ * return err;
+ * }
+ *
+ * // Pin the public key, similar to HPKP pin-sha25 pinning
+ * const pubkey256 = 'pL1+qb9HTMRZJmuC/bB/ZI9d302BYrrqiVuRyW+DGrU=';
+ * if (sha256(cert.pubkey) !== pubkey256) {
+ * const msg = 'Certificate verification error: ' +
+ * `The public key of '${cert.subject.CN}' ` +
+ * 'does not match our pinned fingerprint';
+ * return new Error(msg);
+ * }
+ *
+ * // Pin the exact certificate, rather than the pub key
+ * const cert256 = '25:FE:39:32:D9:63:8C:8A:FC:A1:9A:29:87:' +
+ * 'D8:3E:4C:1D:98:DB:71:E4:1A:48:03:98:EA:22:6A:BD:8B:93:16';
+ * if (cert.fingerprint256 !== cert256) {
+ * const msg = 'Certificate verification error: ' +
+ * `The certificate of '${cert.subject.CN}' ` +
+ * 'does not match our pinned fingerprint';
+ * return new Error(msg);
+ * }
+ *
+ * // This loop is informational only.
+ * // Print the certificate and public key fingerprints of all certs in the
+ * // chain. Its common to pin the public key of the issuer on the public
+ * // internet, while pinning the public key of the service in sensitive
+ * // environments.
+ * do {
+ * console.log('Subject Common Name:', cert.subject.CN);
+ * console.log(' Certificate SHA256 fingerprint:', cert.fingerprint256);
+ *
+ * hash = crypto.createHash('sha256');
+ * console.log(' Public key ping-sha256:', sha256(cert.pubkey));
+ *
+ * lastprint256 = cert.fingerprint256;
+ * cert = cert.issuerCertificate;
+ * } while (cert.fingerprint256 !== lastprint256);
+ *
+ * },
+ * };
+ *
+ * options.agent = new https.Agent(options);
+ * const req = https.request(options, (res) => {
+ * console.log('All OK. Server matched our pinned cert or public key');
+ * console.log('statusCode:', res.statusCode);
+ * // Print the HPKP values
+ * console.log('headers:', res.headers['public-key-pins']);
+ *
+ * res.on('data', (d) => {});
+ * });
+ *
+ * req.on('error', (e) => {
+ * console.error(e.message);
+ * });
+ * req.end();
+ * ```
+ *
+ * Outputs for example:
+ *
+ * ```text
+ * Subject Common Name: github.com
+ * Certificate SHA256 fingerprint: 25:FE:39:32:D9:63:8C:8A:FC:A1:9A:29:87:D8:3E:4C:1D:98:DB:71:E4:1A:48:03:98:EA:22:6A:BD:8B:93:16
+ * Public key ping-sha256: pL1+qb9HTMRZJmuC/bB/ZI9d302BYrrqiVuRyW+DGrU=
+ * Subject Common Name: DigiCert SHA2 Extended Validation Server CA
+ * Certificate SHA256 fingerprint: 40:3E:06:2A:26:53:05:91:13:28:5B:AF:80:A0:D4:AE:42:2C:84:8C:9F:78:FA:D0:1F:C9:4B:C5:B8:7F:EF:1A
+ * Public key ping-sha256: RRM1dGqnDFsCJXBTHky16vi1obOlCgFFn/yOhI/y+ho=
+ * Subject Common Name: DigiCert High Assurance EV Root CA
+ * Certificate SHA256 fingerprint: 74:31:E5:F4:C3:C1:CE:46:90:77:4F:0B:61:E0:54:40:88:3B:A9:A0:1E:D0:0B:A6:AB:D7:80:6E:D3:B1:18:CF
+ * Public key ping-sha256: WoiWRyIOVNa9ihaBciRSC7XHjliYS9VwUGOIud4PB18=
+ * All OK. Server matched our pinned cert or public key
+ * statusCode: 200
+ * headers: max-age=0; pin-sha256="WoiWRyIOVNa9ihaBciRSC7XHjliYS9VwUGOIud4PB18="; pin-sha256="RRM1dGqnDFsCJXBTHky16vi1obOlCgFFn/yOhI/y+ho=";
+ * pin-sha256="k2v657xBsOVe1PQRwOsHsw3bsGT2VzIqz5K+59sNQws="; pin-sha256="K87oWBWM9UZfyddvDfoxL+8lpNyoUB2ptGtn0fv6G2Q="; pin-sha256="IQBnNBEiFuhj+8x6X8XLgh01V9Ic5/V3IRQLNFFc7v4=";
+ * pin-sha256="iie1VXtL7HzAMF+/PVPR9xzT80kQxdZeJ+zduCB3uj0="; pin-sha256="LvRiGEjRqfzurezaWuj8Wie2gyHMrW5Q06LspMnox7A="; includeSubDomains
+ * ```
+ * @since v0.3.6
+ * @param options Accepts all `options` from `request`, with some differences in default values:
+ */
+ function request(
+ options: RequestOptions | string | URL,
+ callback?: (res: http.IncomingMessage) => void,
+ ): http.ClientRequest;
+ function request(
+ url: string | URL,
+ options: RequestOptions,
+ callback?: (res: http.IncomingMessage) => void,
+ ): http.ClientRequest;
+ /**
+ * Like `http.get()` but for HTTPS.
+ *
+ * `options` can be an object, a string, or a `URL` object. If `options` is a
+ * string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object.
+ *
+ * ```js
+ * const https = require('https');
+ *
+ * https.get('https://encrypted.google.com/', (res) => {
+ * console.log('statusCode:', res.statusCode);
+ * console.log('headers:', res.headers);
+ *
+ * res.on('data', (d) => {
+ * process.stdout.write(d);
+ * });
+ *
+ * }).on('error', (e) => {
+ * console.error(e);
+ * });
+ * ```
+ * @since v0.3.6
+ * @param options Accepts the same `options` as {@link request}, with the `method` always set to `GET`.
+ */
+ function get(
+ options: RequestOptions | string | URL,
+ callback?: (res: http.IncomingMessage) => void,
+ ): http.ClientRequest;
+ function get(
+ url: string | URL,
+ options: RequestOptions,
+ callback?: (res: http.IncomingMessage) => void,
+ ): http.ClientRequest;
+ let globalAgent: Agent;
+}
+declare module "node:https" {
+ export * from "https";
+}
diff --git a/client/node_modules/@types/node/index.d.ts b/client/node_modules/@types/node/index.d.ts
new file mode 100644
index 0000000..a596cad
--- /dev/null
+++ b/client/node_modules/@types/node/index.d.ts
@@ -0,0 +1,88 @@
+/**
+ * License for programmatically and manually incorporated
+ * documentation aka. `JSDoc` from https://github.com/nodejs/node/tree/master/doc
+ *
+ * Copyright Node.js contributors. All rights reserved.
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+// NOTE: These definitions support NodeJS and TypeScript 4.9+.
+
+// Reference required types from the default lib:
+/// <reference lib="es2020" />
+/// <reference lib="esnext.asynciterable" />
+/// <reference lib="esnext.intl" />
+/// <reference lib="esnext.bigint" />
+
+// Base definitions for all NodeJS modules that are not specific to any version of TypeScript:
+/// <reference path="assert.d.ts" />
+/// <reference path="assert/strict.d.ts" />
+/// <reference path="globals.d.ts" />
+/// <reference path="async_hooks.d.ts" />
+/// <reference path="buffer.d.ts" />
+/// <reference path="child_process.d.ts" />
+/// <reference path="cluster.d.ts" />
+/// <reference path="console.d.ts" />
+/// <reference path="constants.d.ts" />
+/// <reference path="crypto.d.ts" />
+/// <reference path="dgram.d.ts" />
+/// <reference path="diagnostics_channel.d.ts" />
+/// <reference path="dns.d.ts" />
+/// <reference path="dns/promises.d.ts" />
+/// <reference path="dns/promises.d.ts" />
+/// <reference path="domain.d.ts" />
+/// <reference path="dom-events.d.ts" />
+/// <reference path="events.d.ts" />
+/// <reference path="fs.d.ts" />
+/// <reference path="fs/promises.d.ts" />
+/// <reference path="http.d.ts" />
+/// <reference path="http2.d.ts" />
+/// <reference path="https.d.ts" />
+/// <reference path="inspector.d.ts" />
+/// <reference path="module.d.ts" />
+/// <reference path="net.d.ts" />
+/// <reference path="os.d.ts" />
+/// <reference path="path.d.ts" />
+/// <reference path="perf_hooks.d.ts" />
+/// <reference path="process.d.ts" />
+/// <reference path="punycode.d.ts" />
+/// <reference path="querystring.d.ts" />
+/// <reference path="readline.d.ts" />
+/// <reference path="readline/promises.d.ts" />
+/// <reference path="repl.d.ts" />
+/// <reference path="stream.d.ts" />
+/// <reference path="stream/promises.d.ts" />
+/// <reference path="stream/consumers.d.ts" />
+/// <reference path="stream/web.d.ts" />
+/// <reference path="string_decoder.d.ts" />
+/// <reference path="test.d.ts" />
+/// <reference path="timers.d.ts" />
+/// <reference path="timers/promises.d.ts" />
+/// <reference path="tls.d.ts" />
+/// <reference path="trace_events.d.ts" />
+/// <reference path="tty.d.ts" />
+/// <reference path="url.d.ts" />
+/// <reference path="util.d.ts" />
+/// <reference path="v8.d.ts" />
+/// <reference path="vm.d.ts" />
+/// <reference path="wasi.d.ts" />
+/// <reference path="worker_threads.d.ts" />
+/// <reference path="zlib.d.ts" />
+
+/// <reference path="globals.global.d.ts" />
diff --git a/client/node_modules/@types/node/inspector.d.ts b/client/node_modules/@types/node/inspector.d.ts
new file mode 100644
index 0000000..9022f38
--- /dev/null
+++ b/client/node_modules/@types/node/inspector.d.ts
@@ -0,0 +1,2739 @@
+// Type definitions for inspector
+
+// These definitions are auto-generated.
+// Please see https://github.com/DefinitelyTyped/DefinitelyTyped/pull/19330
+// for more information.
+
+
+/**
+ * The `inspector` module provides an API for interacting with the V8 inspector.
+ *
+ * It can be accessed using:
+ *
+ * ```js
+ * const inspector = require('inspector');
+ * ```
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/inspector.js)
+ */
+declare module 'inspector' {
+ import EventEmitter = require('node:events');
+ interface InspectorNotification<T> {
+ method: string;
+ params: T;
+ }
+ namespace Schema {
+ /**
+ * Description of the protocol domain.
+ */
+ interface Domain {
+ /**
+ * Domain name.
+ */
+ name: string;
+ /**
+ * Domain version.
+ */
+ version: string;
+ }
+ interface GetDomainsReturnType {
+ /**
+ * List of supported domains.
+ */
+ domains: Domain[];
+ }
+ }
+ namespace Runtime {
+ /**
+ * Unique script identifier.
+ */
+ type ScriptId = string;
+ /**
+ * Unique object identifier.
+ */
+ type RemoteObjectId = string;
+ /**
+ * Primitive value which cannot be JSON-stringified.
+ */
+ type UnserializableValue = string;
+ /**
+ * Mirror object referencing original JavaScript object.
+ */
+ interface RemoteObject {
+ /**
+ * Object type.
+ */
+ type: string;
+ /**
+ * Object subtype hint. Specified for <code>object</code> type values only.
+ */
+ subtype?: string | undefined;
+ /**
+ * Object class (constructor) name. Specified for <code>object</code> type values only.
+ */
+ className?: string | undefined;
+ /**
+ * Remote object value in case of primitive values or JSON values (if it was requested).
+ */
+ value?: any;
+ /**
+ * Primitive value which can not be JSON-stringified does not have <code>value</code>, but gets this property.
+ */
+ unserializableValue?: UnserializableValue | undefined;
+ /**
+ * String representation of the object.
+ */
+ description?: string | undefined;
+ /**
+ * Unique object identifier (for non-primitive values).
+ */
+ objectId?: RemoteObjectId | undefined;
+ /**
+ * Preview containing abbreviated property values. Specified for <code>object</code> type values only.
+ * @experimental
+ */
+ preview?: ObjectPreview | undefined;
+ /**
+ * @experimental
+ */
+ customPreview?: CustomPreview | undefined;
+ }
+ /**
+ * @experimental
+ */
+ interface CustomPreview {
+ header: string;
+ hasBody: boolean;
+ formatterObjectId: RemoteObjectId;
+ bindRemoteObjectFunctionId: RemoteObjectId;
+ configObjectId?: RemoteObjectId | undefined;
+ }
+ /**
+ * Object containing abbreviated remote object value.
+ * @experimental
+ */
+ interface ObjectPreview {
+ /**
+ * Object type.
+ */
+ type: string;
+ /**
+ * Object subtype hint. Specified for <code>object</code> type values only.
+ */
+ subtype?: string | undefined;
+ /**
+ * String representation of the object.
+ */
+ description?: string | undefined;
+ /**
+ * True iff some of the properties or entries of the original object did not fit.
+ */
+ overflow: boolean;
+ /**
+ * List of the properties.
+ */
+ properties: PropertyPreview[];
+ /**
+ * List of the entries. Specified for <code>map</code> and <code>set</code> subtype values only.
+ */
+ entries?: EntryPreview[] | undefined;
+ }
+ /**
+ * @experimental
+ */
+ interface PropertyPreview {
+ /**
+ * Property name.
+ */
+ name: string;
+ /**
+ * Object type. Accessor means that the property itself is an accessor property.
+ */
+ type: string;
+ /**
+ * User-friendly property value string.
+ */
+ value?: string | undefined;
+ /**
+ * Nested value preview.
+ */
+ valuePreview?: ObjectPreview | undefined;
+ /**
+ * Object subtype hint. Specified for <code>object</code> type values only.
+ */
+ subtype?: string | undefined;
+ }
+ /**
+ * @experimental
+ */
+ interface EntryPreview {
+ /**
+ * Preview of the key. Specified for map-like collection entries.
+ */
+ key?: ObjectPreview | undefined;
+ /**
+ * Preview of the value.
+ */
+ value: ObjectPreview;
+ }
+ /**
+ * Object property descriptor.
+ */
+ interface PropertyDescriptor {
+ /**
+ * Property name or symbol description.
+ */
+ name: string;
+ /**
+ * The value associated with the property.
+ */
+ value?: RemoteObject | undefined;
+ /**
+ * True if the value associated with the property may be changed (data descriptors only).
+ */
+ writable?: boolean | undefined;
+ /**
+ * A function which serves as a getter for the property, or <code>undefined</code> if there is no getter (accessor descriptors only).
+ */
+ get?: RemoteObject | undefined;
+ /**
+ * A function which serves as a setter for the property, or <code>undefined</code> if there is no setter (accessor descriptors only).
+ */
+ set?: RemoteObject | undefined;
+ /**
+ * True if the type of this property descriptor may be changed and if the property may be deleted from the corresponding object.
+ */
+ configurable: boolean;
+ /**
+ * True if this property shows up during enumeration of the properties on the corresponding object.
+ */
+ enumerable: boolean;
+ /**
+ * True if the result was thrown during the evaluation.
+ */
+ wasThrown?: boolean | undefined;
+ /**
+ * True if the property is owned for the object.
+ */
+ isOwn?: boolean | undefined;
+ /**
+ * Property symbol object, if the property is of the <code>symbol</code> type.
+ */
+ symbol?: RemoteObject | undefined;
+ }
+ /**
+ * Object internal property descriptor. This property isn't normally visible in JavaScript code.
+ */
+ interface InternalPropertyDescriptor {
+ /**
+ * Conventional property name.
+ */
+ name: string;
+ /**
+ * The value associated with the property.
+ */
+ value?: RemoteObject | undefined;
+ }
+ /**
+ * Represents function call argument. Either remote object id <code>objectId</code>, primitive <code>value</code>, unserializable primitive value or neither of (for undefined) them should be specified.
+ */
+ interface CallArgument {
+ /**
+ * Primitive value or serializable javascript object.
+ */
+ value?: any;
+ /**
+ * Primitive value which can not be JSON-stringified.
+ */
+ unserializableValue?: UnserializableValue | undefined;
+ /**
+ * Remote object handle.
+ */
+ objectId?: RemoteObjectId | undefined;
+ }
+ /**
+ * Id of an execution context.
+ */
+ type ExecutionContextId = number;
+ /**
+ * Description of an isolated world.
+ */
+ interface ExecutionContextDescription {
+ /**
+ * Unique id of the execution context. It can be used to specify in which execution context script evaluation should be performed.
+ */
+ id: ExecutionContextId;
+ /**
+ * Execution context origin.
+ */
+ origin: string;
+ /**
+ * Human readable name describing given context.
+ */
+ name: string;
+ /**
+ * Embedder-specific auxiliary data.
+ */
+ auxData?: {} | undefined;
+ }
+ /**
+ * Detailed information about exception (or error) that was thrown during script compilation or execution.
+ */
+ interface ExceptionDetails {
+ /**
+ * Exception id.
+ */
+ exceptionId: number;
+ /**
+ * Exception text, which should be used together with exception object when available.
+ */
+ text: string;
+ /**
+ * Line number of the exception location (0-based).
+ */
+ lineNumber: number;
+ /**
+ * Column number of the exception location (0-based).
+ */
+ columnNumber: number;
+ /**
+ * Script ID of the exception location.
+ */
+ scriptId?: ScriptId | undefined;
+ /**
+ * URL of the exception location, to be used when the script was not reported.
+ */
+ url?: string | undefined;
+ /**
+ * JavaScript stack trace if available.
+ */
+ stackTrace?: StackTrace | undefined;
+ /**
+ * Exception object if available.
+ */
+ exception?: RemoteObject | undefined;
+ /**
+ * Identifier of the context where exception happened.
+ */
+ executionContextId?: ExecutionContextId | undefined;
+ }
+ /**
+ * Number of milliseconds since epoch.
+ */
+ type Timestamp = number;
+ /**
+ * Stack entry for runtime errors and assertions.
+ */
+ interface CallFrame {
+ /**
+ * JavaScript function name.
+ */
+ functionName: string;
+ /**
+ * JavaScript script id.
+ */
+ scriptId: ScriptId;
+ /**
+ * JavaScript script name or url.
+ */
+ url: string;
+ /**
+ * JavaScript script line number (0-based).
+ */
+ lineNumber: number;
+ /**
+ * JavaScript script column number (0-based).
+ */
+ columnNumber: number;
+ }
+ /**
+ * Call frames for assertions or error messages.
+ */
+ interface StackTrace {
+ /**
+ * String label of this stack trace. For async traces this may be a name of the function that initiated the async call.
+ */
+ description?: string | undefined;
+ /**
+ * JavaScript function name.
+ */
+ callFrames: CallFrame[];
+ /**
+ * Asynchronous JavaScript stack trace that preceded this stack, if available.
+ */
+ parent?: StackTrace | undefined;
+ /**
+ * Asynchronous JavaScript stack trace that preceded this stack, if available.
+ * @experimental
+ */
+ parentId?: StackTraceId | undefined;
+ }
+ /**
+ * Unique identifier of current debugger.
+ * @experimental
+ */
+ type UniqueDebuggerId = string;
+ /**
+ * If <code>debuggerId</code> is set stack trace comes from another debugger and can be resolved there. This allows to track cross-debugger calls. See <code>Runtime.StackTrace</code> and <code>Debugger.paused</code> for usages.
+ * @experimental
+ */
+ interface StackTraceId {
+ id: string;
+ debuggerId?: UniqueDebuggerId | undefined;
+ }
+ interface EvaluateParameterType {
+ /**
+ * Expression to evaluate.
+ */
+ expression: string;
+ /**
+ * Symbolic group name that can be used to release multiple objects.
+ */
+ objectGroup?: string | undefined;
+ /**
+ * Determines whether Command Line API should be available during the evaluation.
+ */
+ includeCommandLineAPI?: boolean | undefined;
+ /**
+ * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides <code>setPauseOnException</code> state.
+ */
+ silent?: boolean | undefined;
+ /**
+ * Specifies in which execution context to perform evaluation. If the parameter is omitted the evaluation will be performed in the context of the inspected page.
+ */
+ contextId?: ExecutionContextId | undefined;
+ /**
+ * Whether the result is expected to be a JSON object that should be sent by value.
+ */
+ returnByValue?: boolean | undefined;
+ /**
+ * Whether preview should be generated for the result.
+ * @experimental
+ */
+ generatePreview?: boolean | undefined;
+ /**
+ * Whether execution should be treated as initiated by user in the UI.
+ */
+ userGesture?: boolean | undefined;
+ /**
+ * Whether execution should <code>await</code> for resulting value and return once awaited promise is resolved.
+ */
+ awaitPromise?: boolean | undefined;
+ }
+ interface AwaitPromiseParameterType {
+ /**
+ * Identifier of the promise.
+ */
+ promiseObjectId: RemoteObjectId;
+ /**
+ * Whether the result is expected to be a JSON object that should be sent by value.
+ */
+ returnByValue?: boolean | undefined;
+ /**
+ * Whether preview should be generated for the result.
+ */
+ generatePreview?: boolean | undefined;
+ }
+ interface CallFunctionOnParameterType {
+ /**
+ * Declaration of the function to call.
+ */
+ functionDeclaration: string;
+ /**
+ * Identifier of the object to call function on. Either objectId or executionContextId should be specified.
+ */
+ objectId?: RemoteObjectId | undefined;
+ /**
+ * Call arguments. All call arguments must belong to the same JavaScript world as the target object.
+ */
+ arguments?: CallArgument[] | undefined;
+ /**
+ * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides <code>setPauseOnException</code> state.
+ */
+ silent?: boolean | undefined;
+ /**
+ * Whether the result is expected to be a JSON object which should be sent by value.
+ */
+ returnByValue?: boolean | undefined;
+ /**
+ * Whether preview should be generated for the result.
+ * @experimental
+ */
+ generatePreview?: boolean | undefined;
+ /**
+ * Whether execution should be treated as initiated by user in the UI.
+ */
+ userGesture?: boolean | undefined;
+ /**
+ * Whether execution should <code>await</code> for resulting value and return once awaited promise is resolved.
+ */
+ awaitPromise?: boolean | undefined;
+ /**
+ * Specifies execution context which global object will be used to call function on. Either executionContextId or objectId should be specified.
+ */
+ executionContextId?: ExecutionContextId | undefined;
+ /**
+ * Symbolic group name that can be used to release multiple objects. If objectGroup is not specified and objectId is, objectGroup will be inherited from object.
+ */
+ objectGroup?: string | undefined;
+ }
+ interface GetPropertiesParameterType {
+ /**
+ * Identifier of the object to return properties for.
+ */
+ objectId: RemoteObjectId;
+ /**
+ * If true, returns properties belonging only to the element itself, not to its prototype chain.
+ */
+ ownProperties?: boolean | undefined;
+ /**
+ * If true, returns accessor properties (with getter/setter) only; internal properties are not returned either.
+ * @experimental
+ */
+ accessorPropertiesOnly?: boolean | undefined;
+ /**
+ * Whether preview should be generated for the results.
+ * @experimental
+ */
+ generatePreview?: boolean | undefined;
+ }
+ interface ReleaseObjectParameterType {
+ /**
+ * Identifier of the object to release.
+ */
+ objectId: RemoteObjectId;
+ }
+ interface ReleaseObjectGroupParameterType {
+ /**
+ * Symbolic object group name.
+ */
+ objectGroup: string;
+ }
+ interface SetCustomObjectFormatterEnabledParameterType {
+ enabled: boolean;
+ }
+ interface CompileScriptParameterType {
+ /**
+ * Expression to compile.
+ */
+ expression: string;
+ /**
+ * Source url to be set for the script.
+ */
+ sourceURL: string;
+ /**
+ * Specifies whether the compiled script should be persisted.
+ */
+ persistScript: boolean;
+ /**
+ * Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page.
+ */
+ executionContextId?: ExecutionContextId | undefined;
+ }
+ interface RunScriptParameterType {
+ /**
+ * Id of the script to run.
+ */
+ scriptId: ScriptId;
+ /**
+ * Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page.
+ */
+ executionContextId?: ExecutionContextId | undefined;
+ /**
+ * Symbolic group name that can be used to release multiple objects.
+ */
+ objectGroup?: string | undefined;
+ /**
+ * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides <code>setPauseOnException</code> state.
+ */
+ silent?: boolean | undefined;
+ /**
+ * Determines whether Command Line API should be available during the evaluation.
+ */
+ includeCommandLineAPI?: boolean | undefined;
+ /**
+ * Whether the result is expected to be a JSON object which should be sent by value.
+ */
+ returnByValue?: boolean | undefined;
+ /**
+ * Whether preview should be generated for the result.
+ */
+ generatePreview?: boolean | undefined;
+ /**
+ * Whether execution should <code>await</code> for resulting value and return once awaited promise is resolved.
+ */
+ awaitPromise?: boolean | undefined;
+ }
+ interface QueryObjectsParameterType {
+ /**
+ * Identifier of the prototype to return objects for.
+ */
+ prototypeObjectId: RemoteObjectId;
+ }
+ interface GlobalLexicalScopeNamesParameterType {
+ /**
+ * Specifies in which execution context to lookup global scope variables.
+ */
+ executionContextId?: ExecutionContextId | undefined;
+ }
+ interface EvaluateReturnType {
+ /**
+ * Evaluation result.
+ */
+ result: RemoteObject;
+ /**
+ * Exception details.
+ */
+ exceptionDetails?: ExceptionDetails | undefined;
+ }
+ interface AwaitPromiseReturnType {
+ /**
+ * Promise result. Will contain rejected value if promise was rejected.
+ */
+ result: RemoteObject;
+ /**
+ * Exception details if stack strace is available.
+ */
+ exceptionDetails?: ExceptionDetails | undefined;
+ }
+ interface CallFunctionOnReturnType {
+ /**
+ * Call result.
+ */
+ result: RemoteObject;
+ /**
+ * Exception details.
+ */
+ exceptionDetails?: ExceptionDetails | undefined;
+ }
+ interface GetPropertiesReturnType {
+ /**
+ * Object properties.
+ */
+ result: PropertyDescriptor[];
+ /**
+ * Internal object properties (only of the element itself).
+ */
+ internalProperties?: InternalPropertyDescriptor[] | undefined;
+ /**
+ * Exception details.
+ */
+ exceptionDetails?: ExceptionDetails | undefined;
+ }
+ interface CompileScriptReturnType {
+ /**
+ * Id of the script.
+ */
+ scriptId?: ScriptId | undefined;
+ /**
+ * Exception details.
+ */
+ exceptionDetails?: ExceptionDetails | undefined;
+ }
+ interface RunScriptReturnType {
+ /**
+ * Run result.
+ */
+ result: RemoteObject;
+ /**
+ * Exception details.
+ */
+ exceptionDetails?: ExceptionDetails | undefined;
+ }
+ interface QueryObjectsReturnType {
+ /**
+ * Array with objects.
+ */
+ objects: RemoteObject;
+ }
+ interface GlobalLexicalScopeNamesReturnType {
+ names: string[];
+ }
+ interface ExecutionContextCreatedEventDataType {
+ /**
+ * A newly created execution context.
+ */
+ context: ExecutionContextDescription;
+ }
+ interface ExecutionContextDestroyedEventDataType {
+ /**
+ * Id of the destroyed context
+ */
+ executionContextId: ExecutionContextId;
+ }
+ interface ExceptionThrownEventDataType {
+ /**
+ * Timestamp of the exception.
+ */
+ timestamp: Timestamp;
+ exceptionDetails: ExceptionDetails;
+ }
+ interface ExceptionRevokedEventDataType {
+ /**
+ * Reason describing why exception was revoked.
+ */
+ reason: string;
+ /**
+ * The id of revoked exception, as reported in <code>exceptionThrown</code>.
+ */
+ exceptionId: number;
+ }
+ interface ConsoleAPICalledEventDataType {
+ /**
+ * Type of the call.
+ */
+ type: string;
+ /**
+ * Call arguments.
+ */
+ args: RemoteObject[];
+ /**
+ * Identifier of the context where the call was made.
+ */
+ executionContextId: ExecutionContextId;
+ /**
+ * Call timestamp.
+ */
+ timestamp: Timestamp;
+ /**
+ * Stack trace captured when the call was made.
+ */
+ stackTrace?: StackTrace | undefined;
+ /**
+ * Console context descriptor for calls on non-default console context (not console.*): 'anonymous#unique-logger-id' for call on unnamed context, 'name#unique-logger-id' for call on named context.
+ * @experimental
+ */
+ context?: string | undefined;
+ }
+ interface InspectRequestedEventDataType {
+ object: RemoteObject;
+ hints: {};
+ }
+ }
+ namespace Debugger {
+ /**
+ * Breakpoint identifier.
+ */
+ type BreakpointId = string;
+ /**
+ * Call frame identifier.
+ */
+ type CallFrameId = string;
+ /**
+ * Location in the source code.
+ */
+ interface Location {
+ /**
+ * Script identifier as reported in the <code>Debugger.scriptParsed</code>.
+ */
+ scriptId: Runtime.ScriptId;
+ /**
+ * Line number in the script (0-based).
+ */
+ lineNumber: number;
+ /**
+ * Column number in the script (0-based).
+ */
+ columnNumber?: number | undefined;
+ }
+ /**
+ * Location in the source code.
+ * @experimental
+ */
+ interface ScriptPosition {
+ lineNumber: number;
+ columnNumber: number;
+ }
+ /**
+ * JavaScript call frame. Array of call frames form the call stack.
+ */
+ interface CallFrame {
+ /**
+ * Call frame identifier. This identifier is only valid while the virtual machine is paused.
+ */
+ callFrameId: CallFrameId;
+ /**
+ * Name of the JavaScript function called on this call frame.
+ */
+ functionName: string;
+ /**
+ * Location in the source code.
+ */
+ functionLocation?: Location | undefined;
+ /**
+ * Location in the source code.
+ */
+ location: Location;
+ /**
+ * JavaScript script name or url.
+ */
+ url: string;
+ /**
+ * Scope chain for this call frame.
+ */
+ scopeChain: Scope[];
+ /**
+ * <code>this</code> object for this call frame.
+ */
+ this: Runtime.RemoteObject;
+ /**
+ * The value being returned, if the function is at return point.
+ */
+ returnValue?: Runtime.RemoteObject | undefined;
+ }
+ /**
+ * Scope description.
+ */
+ interface Scope {
+ /**
+ * Scope type.
+ */
+ type: string;
+ /**
+ * Object representing the scope. For <code>global</code> and <code>with</code> scopes it represents the actual object; for the rest of the scopes, it is artificial transient object enumerating scope variables as its properties.
+ */
+ object: Runtime.RemoteObject;
+ name?: string | undefined;
+ /**
+ * Location in the source code where scope starts
+ */
+ startLocation?: Location | undefined;
+ /**
+ * Location in the source code where scope ends
+ */
+ endLocation?: Location | undefined;
+ }
+ /**
+ * Search match for resource.
+ */
+ interface SearchMatch {
+ /**
+ * Line number in resource content.
+ */
+ lineNumber: number;
+ /**
+ * Line with match content.
+ */
+ lineContent: string;
+ }
+ interface BreakLocation {
+ /**
+ * Script identifier as reported in the <code>Debugger.scriptParsed</code>.
+ */
+ scriptId: Runtime.ScriptId;
+ /**
+ * Line number in the script (0-based).
+ */
+ lineNumber: number;
+ /**
+ * Column number in the script (0-based).
+ */
+ columnNumber?: number | undefined;
+ type?: string | undefined;
+ }
+ interface SetBreakpointsActiveParameterType {
+ /**
+ * New value for breakpoints active state.
+ */
+ active: boolean;
+ }
+ interface SetSkipAllPausesParameterType {
+ /**
+ * New value for skip pauses state.
+ */
+ skip: boolean;
+ }
+ interface SetBreakpointByUrlParameterType {
+ /**
+ * Line number to set breakpoint at.
+ */
+ lineNumber: number;
+ /**
+ * URL of the resources to set breakpoint on.
+ */
+ url?: string | undefined;
+ /**
+ * Regex pattern for the URLs of the resources to set breakpoints on. Either <code>url</code> or <code>urlRegex</code> must be specified.
+ */
+ urlRegex?: string | undefined;
+ /**
+ * Script hash of the resources to set breakpoint on.
+ */
+ scriptHash?: string | undefined;
+ /**
+ * Offset in the line to set breakpoint at.
+ */
+ columnNumber?: number | undefined;
+ /**
+ * Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true.
+ */
+ condition?: string | undefined;
+ }
+ interface SetBreakpointParameterType {
+ /**
+ * Location to set breakpoint in.
+ */
+ location: Location;
+ /**
+ * Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true.
+ */
+ condition?: string | undefined;
+ }
+ interface RemoveBreakpointParameterType {
+ breakpointId: BreakpointId;
+ }
+ interface GetPossibleBreakpointsParameterType {
+ /**
+ * Start of range to search possible breakpoint locations in.
+ */
+ start: Location;
+ /**
+ * End of range to search possible breakpoint locations in (excluding). When not specified, end of scripts is used as end of range.
+ */
+ end?: Location | undefined;
+ /**
+ * Only consider locations which are in the same (non-nested) function as start.
+ */
+ restrictToFunction?: boolean | undefined;
+ }
+ interface ContinueToLocationParameterType {
+ /**
+ * Location to continue to.
+ */
+ location: Location;
+ targetCallFrames?: string | undefined;
+ }
+ interface PauseOnAsyncCallParameterType {
+ /**
+ * Debugger will pause when async call with given stack trace is started.
+ */
+ parentStackTraceId: Runtime.StackTraceId;
+ }
+ interface StepIntoParameterType {
+ /**
+ * Debugger will issue additional Debugger.paused notification if any async task is scheduled before next pause.
+ * @experimental
+ */
+ breakOnAsyncCall?: boolean | undefined;
+ }
+ interface GetStackTraceParameterType {
+ stackTraceId: Runtime.StackTraceId;
+ }
+ interface SearchInContentParameterType {
+ /**
+ * Id of the script to search in.
+ */
+ scriptId: Runtime.ScriptId;
+ /**
+ * String to search for.
+ */
+ query: string;
+ /**
+ * If true, search is case sensitive.
+ */
+ caseSensitive?: boolean | undefined;
+ /**
+ * If true, treats string parameter as regex.
+ */
+ isRegex?: boolean | undefined;
+ }
+ interface SetScriptSourceParameterType {
+ /**
+ * Id of the script to edit.
+ */
+ scriptId: Runtime.ScriptId;
+ /**
+ * New content of the script.
+ */
+ scriptSource: string;
+ /**
+ * If true the change will not actually be applied. Dry run may be used to get result description without actually modifying the code.
+ */
+ dryRun?: boolean | undefined;
+ }
+ interface RestartFrameParameterType {
+ /**
+ * Call frame identifier to evaluate on.
+ */
+ callFrameId: CallFrameId;
+ }
+ interface GetScriptSourceParameterType {
+ /**
+ * Id of the script to get source for.
+ */
+ scriptId: Runtime.ScriptId;
+ }
+ interface SetPauseOnExceptionsParameterType {
+ /**
+ * Pause on exceptions mode.
+ */
+ state: string;
+ }
+ interface EvaluateOnCallFrameParameterType {
+ /**
+ * Call frame identifier to evaluate on.
+ */
+ callFrameId: CallFrameId;
+ /**
+ * Expression to evaluate.
+ */
+ expression: string;
+ /**
+ * String object group name to put result into (allows rapid releasing resulting object handles using <code>releaseObjectGroup</code>).
+ */
+ objectGroup?: string | undefined;
+ /**
+ * Specifies whether command line API should be available to the evaluated expression, defaults to false.
+ */
+ includeCommandLineAPI?: boolean | undefined;
+ /**
+ * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides <code>setPauseOnException</code> state.
+ */
+ silent?: boolean | undefined;
+ /**
+ * Whether the result is expected to be a JSON object that should be sent by value.
+ */
+ returnByValue?: boolean | undefined;
+ /**
+ * Whether preview should be generated for the result.
+ * @experimental
+ */
+ generatePreview?: boolean | undefined;
+ /**
+ * Whether to throw an exception if side effect cannot be ruled out during evaluation.
+ */
+ throwOnSideEffect?: boolean | undefined;
+ }
+ interface SetVariableValueParameterType {
+ /**
+ * 0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch' scope types are allowed. Other scopes could be manipulated manually.
+ */
+ scopeNumber: number;
+ /**
+ * Variable name.
+ */
+ variableName: string;
+ /**
+ * New variable value.
+ */
+ newValue: Runtime.CallArgument;
+ /**
+ * Id of callframe that holds variable.
+ */
+ callFrameId: CallFrameId;
+ }
+ interface SetReturnValueParameterType {
+ /**
+ * New return value.
+ */
+ newValue: Runtime.CallArgument;
+ }
+ interface SetAsyncCallStackDepthParameterType {
+ /**
+ * Maximum depth of async call stacks. Setting to <code>0</code> will effectively disable collecting async call stacks (default).
+ */
+ maxDepth: number;
+ }
+ interface SetBlackboxPatternsParameterType {
+ /**
+ * Array of regexps that will be used to check script url for blackbox state.
+ */
+ patterns: string[];
+ }
+ interface SetBlackboxedRangesParameterType {
+ /**
+ * Id of the script.
+ */
+ scriptId: Runtime.ScriptId;
+ positions: ScriptPosition[];
+ }
+ interface EnableReturnType {
+ /**
+ * Unique identifier of the debugger.
+ * @experimental
+ */
+ debuggerId: Runtime.UniqueDebuggerId;
+ }
+ interface SetBreakpointByUrlReturnType {
+ /**
+ * Id of the created breakpoint for further reference.
+ */
+ breakpointId: BreakpointId;
+ /**
+ * List of the locations this breakpoint resolved into upon addition.
+ */
+ locations: Location[];
+ }
+ interface SetBreakpointReturnType {
+ /**
+ * Id of the created breakpoint for further reference.
+ */
+ breakpointId: BreakpointId;
+ /**
+ * Location this breakpoint resolved into.
+ */
+ actualLocation: Location;
+ }
+ interface GetPossibleBreakpointsReturnType {
+ /**
+ * List of the possible breakpoint locations.
+ */
+ locations: BreakLocation[];
+ }
+ interface GetStackTraceReturnType {
+ stackTrace: Runtime.StackTrace;
+ }
+ interface SearchInContentReturnType {
+ /**
+ * List of search matches.
+ */
+ result: SearchMatch[];
+ }
+ interface SetScriptSourceReturnType {
+ /**
+ * New stack trace in case editing has happened while VM was stopped.
+ */
+ callFrames?: CallFrame[] | undefined;
+ /**
+ * Whether current call stack was modified after applying the changes.
+ */
+ stackChanged?: boolean | undefined;
+ /**
+ * Async stack trace, if any.
+ */
+ asyncStackTrace?: Runtime.StackTrace | undefined;
+ /**
+ * Async stack trace, if any.
+ * @experimental
+ */
+ asyncStackTraceId?: Runtime.StackTraceId | undefined;
+ /**
+ * Exception details if any.
+ */
+ exceptionDetails?: Runtime.ExceptionDetails | undefined;
+ }
+ interface RestartFrameReturnType {
+ /**
+ * New stack trace.
+ */
+ callFrames: CallFrame[];
+ /**
+ * Async stack trace, if any.
+ */
+ asyncStackTrace?: Runtime.StackTrace | undefined;
+ /**
+ * Async stack trace, if any.
+ * @experimental
+ */
+ asyncStackTraceId?: Runtime.StackTraceId | undefined;
+ }
+ interface GetScriptSourceReturnType {
+ /**
+ * Script source.
+ */
+ scriptSource: string;
+ }
+ interface EvaluateOnCallFrameReturnType {
+ /**
+ * Object wrapper for the evaluation result.
+ */
+ result: Runtime.RemoteObject;
+ /**
+ * Exception details.
+ */
+ exceptionDetails?: Runtime.ExceptionDetails | undefined;
+ }
+ interface ScriptParsedEventDataType {
+ /**
+ * Identifier of the script parsed.
+ */
+ scriptId: Runtime.ScriptId;
+ /**
+ * URL or name of the script parsed (if any).
+ */
+ url: string;
+ /**
+ * Line offset of the script within the resource with given URL (for script tags).
+ */
+ startLine: number;
+ /**
+ * Column offset of the script within the resource with given URL.
+ */
+ startColumn: number;
+ /**
+ * Last line of the script.
+ */
+ endLine: number;
+ /**
+ * Length of the last line of the script.
+ */
+ endColumn: number;
+ /**
+ * Specifies script creation context.
+ */
+ executionContextId: Runtime.ExecutionContextId;
+ /**
+ * Content hash of the script.
+ */
+ hash: string;
+ /**
+ * Embedder-specific auxiliary data.
+ */
+ executionContextAuxData?: {} | undefined;
+ /**
+ * True, if this script is generated as a result of the live edit operation.
+ * @experimental
+ */
+ isLiveEdit?: boolean | undefined;
+ /**
+ * URL of source map associated with script (if any).
+ */
+ sourceMapURL?: string | undefined;
+ /**
+ * True, if this script has sourceURL.
+ */
+ hasSourceURL?: boolean | undefined;
+ /**
+ * True, if this script is ES6 module.
+ */
+ isModule?: boolean | undefined;
+ /**
+ * This script length.
+ */
+ length?: number | undefined;
+ /**
+ * JavaScript top stack frame of where the script parsed event was triggered if available.
+ * @experimental
+ */
+ stackTrace?: Runtime.StackTrace | undefined;
+ }
+ interface ScriptFailedToParseEventDataType {
+ /**
+ * Identifier of the script parsed.
+ */
+ scriptId: Runtime.ScriptId;
+ /**
+ * URL or name of the script parsed (if any).
+ */
+ url: string;
+ /**
+ * Line offset of the script within the resource with given URL (for script tags).
+ */
+ startLine: number;
+ /**
+ * Column offset of the script within the resource with given URL.
+ */
+ startColumn: number;
+ /**
+ * Last line of the script.
+ */
+ endLine: number;
+ /**
+ * Length of the last line of the script.
+ */
+ endColumn: number;
+ /**
+ * Specifies script creation context.
+ */
+ executionContextId: Runtime.ExecutionContextId;
+ /**
+ * Content hash of the script.
+ */
+ hash: string;
+ /**
+ * Embedder-specific auxiliary data.
+ */
+ executionContextAuxData?: {} | undefined;
+ /**
+ * URL of source map associated with script (if any).
+ */
+ sourceMapURL?: string | undefined;
+ /**
+ * True, if this script has sourceURL.
+ */
+ hasSourceURL?: boolean | undefined;
+ /**
+ * True, if this script is ES6 module.
+ */
+ isModule?: boolean | undefined;
+ /**
+ * This script length.
+ */
+ length?: number | undefined;
+ /**
+ * JavaScript top stack frame of where the script parsed event was triggered if available.
+ * @experimental
+ */
+ stackTrace?: Runtime.StackTrace | undefined;
+ }
+ interface BreakpointResolvedEventDataType {
+ /**
+ * Breakpoint unique identifier.
+ */
+ breakpointId: BreakpointId;
+ /**
+ * Actual breakpoint location.
+ */
+ location: Location;
+ }
+ interface PausedEventDataType {
+ /**
+ * Call stack the virtual machine stopped on.
+ */
+ callFrames: CallFrame[];
+ /**
+ * Pause reason.
+ */
+ reason: string;
+ /**
+ * Object containing break-specific auxiliary properties.
+ */
+ data?: {} | undefined;
+ /**
+ * Hit breakpoints IDs
+ */
+ hitBreakpoints?: string[] | undefined;
+ /**
+ * Async stack trace, if any.
+ */
+ asyncStackTrace?: Runtime.StackTrace | undefined;
+ /**
+ * Async stack trace, if any.
+ * @experimental
+ */
+ asyncStackTraceId?: Runtime.StackTraceId | undefined;
+ /**
+ * Just scheduled async call will have this stack trace as parent stack during async execution. This field is available only after <code>Debugger.stepInto</code> call with <code>breakOnAsynCall</code> flag.
+ * @experimental
+ */
+ asyncCallStackTraceId?: Runtime.StackTraceId | undefined;
+ }
+ }
+ namespace Console {
+ /**
+ * Console message.
+ */
+ interface ConsoleMessage {
+ /**
+ * Message source.
+ */
+ source: string;
+ /**
+ * Message severity.
+ */
+ level: string;
+ /**
+ * Message text.
+ */
+ text: string;
+ /**
+ * URL of the message origin.
+ */
+ url?: string | undefined;
+ /**
+ * Line number in the resource that generated this message (1-based).
+ */
+ line?: number | undefined;
+ /**
+ * Column number in the resource that generated this message (1-based).
+ */
+ column?: number | undefined;
+ }
+ interface MessageAddedEventDataType {
+ /**
+ * Console message that has been added.
+ */
+ message: ConsoleMessage;
+ }
+ }
+ namespace Profiler {
+ /**
+ * Profile node. Holds callsite information, execution statistics and child nodes.
+ */
+ interface ProfileNode {
+ /**
+ * Unique id of the node.
+ */
+ id: number;
+ /**
+ * Function location.
+ */
+ callFrame: Runtime.CallFrame;
+ /**
+ * Number of samples where this node was on top of the call stack.
+ */
+ hitCount?: number | undefined;
+ /**
+ * Child node ids.
+ */
+ children?: number[] | undefined;
+ /**
+ * The reason of being not optimized. The function may be deoptimized or marked as don't optimize.
+ */
+ deoptReason?: string | undefined;
+ /**
+ * An array of source position ticks.
+ */
+ positionTicks?: PositionTickInfo[] | undefined;
+ }
+ /**
+ * Profile.
+ */
+ interface Profile {
+ /**
+ * The list of profile nodes. First item is the root node.
+ */
+ nodes: ProfileNode[];
+ /**
+ * Profiling start timestamp in microseconds.
+ */
+ startTime: number;
+ /**
+ * Profiling end timestamp in microseconds.
+ */
+ endTime: number;
+ /**
+ * Ids of samples top nodes.
+ */
+ samples?: number[] | undefined;
+ /**
+ * Time intervals between adjacent samples in microseconds. The first delta is relative to the profile startTime.
+ */
+ timeDeltas?: number[] | undefined;
+ }
+ /**
+ * Specifies a number of samples attributed to a certain source position.
+ */
+ interface PositionTickInfo {
+ /**
+ * Source line number (1-based).
+ */
+ line: number;
+ /**
+ * Number of samples attributed to the source line.
+ */
+ ticks: number;
+ }
+ /**
+ * Coverage data for a source range.
+ */
+ interface CoverageRange {
+ /**
+ * JavaScript script source offset for the range start.
+ */
+ startOffset: number;
+ /**
+ * JavaScript script source offset for the range end.
+ */
+ endOffset: number;
+ /**
+ * Collected execution count of the source range.
+ */
+ count: number;
+ }
+ /**
+ * Coverage data for a JavaScript function.
+ */
+ interface FunctionCoverage {
+ /**
+ * JavaScript function name.
+ */
+ functionName: string;
+ /**
+ * Source ranges inside the function with coverage data.
+ */
+ ranges: CoverageRange[];
+ /**
+ * Whether coverage data for this function has block granularity.
+ */
+ isBlockCoverage: boolean;
+ }
+ /**
+ * Coverage data for a JavaScript script.
+ */
+ interface ScriptCoverage {
+ /**
+ * JavaScript script id.
+ */
+ scriptId: Runtime.ScriptId;
+ /**
+ * JavaScript script name or url.
+ */
+ url: string;
+ /**
+ * Functions contained in the script that has coverage data.
+ */
+ functions: FunctionCoverage[];
+ }
+ /**
+ * Describes a type collected during runtime.
+ * @experimental
+ */
+ interface TypeObject {
+ /**
+ * Name of a type collected with type profiling.
+ */
+ name: string;
+ }
+ /**
+ * Source offset and types for a parameter or return value.
+ * @experimental
+ */
+ interface TypeProfileEntry {
+ /**
+ * Source offset of the parameter or end of function for return values.
+ */
+ offset: number;
+ /**
+ * The types for this parameter or return value.
+ */
+ types: TypeObject[];
+ }
+ /**
+ * Type profile data collected during runtime for a JavaScript script.
+ * @experimental
+ */
+ interface ScriptTypeProfile {
+ /**
+ * JavaScript script id.
+ */
+ scriptId: Runtime.ScriptId;
+ /**
+ * JavaScript script name or url.
+ */
+ url: string;
+ /**
+ * Type profile entries for parameters and return values of the functions in the script.
+ */
+ entries: TypeProfileEntry[];
+ }
+ interface SetSamplingIntervalParameterType {
+ /**
+ * New sampling interval in microseconds.
+ */
+ interval: number;
+ }
+ interface StartPreciseCoverageParameterType {
+ /**
+ * Collect accurate call counts beyond simple 'covered' or 'not covered'.
+ */
+ callCount?: boolean | undefined;
+ /**
+ * Collect block-based coverage.
+ */
+ detailed?: boolean | undefined;
+ }
+ interface StopReturnType {
+ /**
+ * Recorded profile.
+ */
+ profile: Profile;
+ }
+ interface TakePreciseCoverageReturnType {
+ /**
+ * Coverage data for the current isolate.
+ */
+ result: ScriptCoverage[];
+ }
+ interface GetBestEffortCoverageReturnType {
+ /**
+ * Coverage data for the current isolate.
+ */
+ result: ScriptCoverage[];
+ }
+ interface TakeTypeProfileReturnType {
+ /**
+ * Type profile for all scripts since startTypeProfile() was turned on.
+ */
+ result: ScriptTypeProfile[];
+ }
+ interface ConsoleProfileStartedEventDataType {
+ id: string;
+ /**
+ * Location of console.profile().
+ */
+ location: Debugger.Location;
+ /**
+ * Profile title passed as an argument to console.profile().
+ */
+ title?: string | undefined;
+ }
+ interface ConsoleProfileFinishedEventDataType {
+ id: string;
+ /**
+ * Location of console.profileEnd().
+ */
+ location: Debugger.Location;
+ profile: Profile;
+ /**
+ * Profile title passed as an argument to console.profile().
+ */
+ title?: string | undefined;
+ }
+ }
+ namespace HeapProfiler {
+ /**
+ * Heap snapshot object id.
+ */
+ type HeapSnapshotObjectId = string;
+ /**
+ * Sampling Heap Profile node. Holds callsite information, allocation statistics and child nodes.
+ */
+ interface SamplingHeapProfileNode {
+ /**
+ * Function location.
+ */
+ callFrame: Runtime.CallFrame;
+ /**
+ * Allocations size in bytes for the node excluding children.
+ */
+ selfSize: number;
+ /**
+ * Child nodes.
+ */
+ children: SamplingHeapProfileNode[];
+ }
+ /**
+ * Profile.
+ */
+ interface SamplingHeapProfile {
+ head: SamplingHeapProfileNode;
+ }
+ interface StartTrackingHeapObjectsParameterType {
+ trackAllocations?: boolean | undefined;
+ }
+ interface StopTrackingHeapObjectsParameterType {
+ /**
+ * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken when the tracking is stopped.
+ */
+ reportProgress?: boolean | undefined;
+ }
+ interface TakeHeapSnapshotParameterType {
+ /**
+ * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken.
+ */
+ reportProgress?: boolean | undefined;
+ }
+ interface GetObjectByHeapObjectIdParameterType {
+ objectId: HeapSnapshotObjectId;
+ /**
+ * Symbolic group name that can be used to release multiple objects.
+ */
+ objectGroup?: string | undefined;
+ }
+ interface AddInspectedHeapObjectParameterType {
+ /**
+ * Heap snapshot object id to be accessible by means of $x command line API.
+ */
+ heapObjectId: HeapSnapshotObjectId;
+ }
+ interface GetHeapObjectIdParameterType {
+ /**
+ * Identifier of the object to get heap object id for.
+ */
+ objectId: Runtime.RemoteObjectId;
+ }
+ interface StartSamplingParameterType {
+ /**
+ * Average sample interval in bytes. Poisson distribution is used for the intervals. The default value is 32768 bytes.
+ */
+ samplingInterval?: number | undefined;
+ }
+ interface GetObjectByHeapObjectIdReturnType {
+ /**
+ * Evaluation result.
+ */
+ result: Runtime.RemoteObject;
+ }
+ interface GetHeapObjectIdReturnType {
+ /**
+ * Id of the heap snapshot object corresponding to the passed remote object id.
+ */
+ heapSnapshotObjectId: HeapSnapshotObjectId;
+ }
+ interface StopSamplingReturnType {
+ /**
+ * Recorded sampling heap profile.
+ */
+ profile: SamplingHeapProfile;
+ }
+ interface GetSamplingProfileReturnType {
+ /**
+ * Return the sampling profile being collected.
+ */
+ profile: SamplingHeapProfile;
+ }
+ interface AddHeapSnapshotChunkEventDataType {
+ chunk: string;
+ }
+ interface ReportHeapSnapshotProgressEventDataType {
+ done: number;
+ total: number;
+ finished?: boolean | undefined;
+ }
+ interface LastSeenObjectIdEventDataType {
+ lastSeenObjectId: number;
+ timestamp: number;
+ }
+ interface HeapStatsUpdateEventDataType {
+ /**
+ * An array of triplets. Each triplet describes a fragment. The first integer is the fragment index, the second integer is a total count of objects for the fragment, the third integer is a total size of the objects for the fragment.
+ */
+ statsUpdate: number[];
+ }
+ }
+ namespace NodeTracing {
+ interface TraceConfig {
+ /**
+ * Controls how the trace buffer stores data.
+ */
+ recordMode?: string | undefined;
+ /**
+ * Included category filters.
+ */
+ includedCategories: string[];
+ }
+ interface StartParameterType {
+ traceConfig: TraceConfig;
+ }
+ interface GetCategoriesReturnType {
+ /**
+ * A list of supported tracing categories.
+ */
+ categories: string[];
+ }
+ interface DataCollectedEventDataType {
+ value: Array<{}>;
+ }
+ }
+ namespace NodeWorker {
+ type WorkerID = string;
+ /**
+ * Unique identifier of attached debugging session.
+ */
+ type SessionID = string;
+ interface WorkerInfo {
+ workerId: WorkerID;
+ type: string;
+ title: string;
+ url: string;
+ }
+ interface SendMessageToWorkerParameterType {
+ message: string;
+ /**
+ * Identifier of the session.
+ */
+ sessionId: SessionID;
+ }
+ interface EnableParameterType {
+ /**
+ * Whether to new workers should be paused until the frontend sends `Runtime.runIfWaitingForDebugger`
+ * message to run them.
+ */
+ waitForDebuggerOnStart: boolean;
+ }
+ interface DetachParameterType {
+ sessionId: SessionID;
+ }
+ interface AttachedToWorkerEventDataType {
+ /**
+ * Identifier assigned to the session used to send/receive messages.
+ */
+ sessionId: SessionID;
+ workerInfo: WorkerInfo;
+ waitingForDebugger: boolean;
+ }
+ interface DetachedFromWorkerEventDataType {
+ /**
+ * Detached session identifier.
+ */
+ sessionId: SessionID;
+ }
+ interface ReceivedMessageFromWorkerEventDataType {
+ /**
+ * Identifier of a session which sends a message.
+ */
+ sessionId: SessionID;
+ message: string;
+ }
+ }
+ namespace NodeRuntime {
+ interface NotifyWhenWaitingForDisconnectParameterType {
+ enabled: boolean;
+ }
+ }
+ /**
+ * The `inspector.Session` is used for dispatching messages to the V8 inspector
+ * back-end and receiving message responses and notifications.
+ */
+ class Session extends EventEmitter {
+ /**
+ * Create a new instance of the inspector.Session class.
+ * The inspector session needs to be connected through session.connect() before the messages can be dispatched to the inspector backend.
+ */
+ constructor();
+ /**
+ * Connects a session to the inspector back-end.
+ * @since v8.0.0
+ */
+ connect(): void;
+ /**
+ * Immediately close the session. All pending message callbacks will be called
+ * with an error. `session.connect()` will need to be called to be able to send
+ * messages again. Reconnected session will lose all inspector state, such as
+ * enabled agents or configured breakpoints.
+ * @since v8.0.0
+ */
+ disconnect(): void;
+ /**
+ * Posts a message to the inspector back-end. `callback` will be notified when
+ * a response is received. `callback` is a function that accepts two optional
+ * arguments: error and message-specific result.
+ *
+ * ```js
+ * session.post('Runtime.evaluate', { expression: '2 + 2' },
+ * (error, { result }) => console.log(result));
+ * // Output: { type: 'number', value: 4, description: '4' }
+ * ```
+ *
+ * The latest version of the V8 inspector protocol is published on the [Chrome DevTools Protocol Viewer](https://chromedevtools.github.io/devtools-protocol/v8/).
+ *
+ * Node.js inspector supports all the Chrome DevTools Protocol domains declared
+ * by V8\. Chrome DevTools Protocol domain provides an interface for interacting
+ * with one of the runtime agents used to inspect the application state and listen
+ * to the run-time events.
+ *
+ * ## Example usage
+ *
+ * Apart from the debugger, various V8 Profilers are available through the DevTools
+ * protocol.
+ * @since v8.0.0
+ */
+ post(method: string, params?: {}, callback?: (err: Error | null, params?: {}) => void): void;
+ post(method: string, callback?: (err: Error | null, params?: {}) => void): void;
+ /**
+ * Returns supported domains.
+ */
+ post(method: 'Schema.getDomains', callback?: (err: Error | null, params: Schema.GetDomainsReturnType) => void): void;
+ /**
+ * Evaluates expression on global object.
+ */
+ post(method: 'Runtime.evaluate', params?: Runtime.EvaluateParameterType, callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void;
+ post(method: 'Runtime.evaluate', callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void;
+ /**
+ * Add handler to promise with given promise object id.
+ */
+ post(method: 'Runtime.awaitPromise', params?: Runtime.AwaitPromiseParameterType, callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void;
+ post(method: 'Runtime.awaitPromise', callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void;
+ /**
+ * Calls function with given declaration on the given object. Object group of the result is inherited from the target object.
+ */
+ post(method: 'Runtime.callFunctionOn', params?: Runtime.CallFunctionOnParameterType, callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void;
+ post(method: 'Runtime.callFunctionOn', callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void;
+ /**
+ * Returns properties of a given object. Object group of the result is inherited from the target object.
+ */
+ post(method: 'Runtime.getProperties', params?: Runtime.GetPropertiesParameterType, callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void;
+ post(method: 'Runtime.getProperties', callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void;
+ /**
+ * Releases remote object with given id.
+ */
+ post(method: 'Runtime.releaseObject', params?: Runtime.ReleaseObjectParameterType, callback?: (err: Error | null) => void): void;
+ post(method: 'Runtime.releaseObject', callback?: (err: Error | null) => void): void;
+ /**
+ * Releases all remote objects that belong to a given group.
+ */
+ post(method: 'Runtime.releaseObjectGroup', params?: Runtime.ReleaseObjectGroupParameterType, callback?: (err: Error | null) => void): void;
+ post(method: 'Runtime.releaseObjectGroup', callback?: (err: Error | null) => void): void;
+ /**
+ * Tells inspected instance to run if it was waiting for debugger to attach.
+ */
+ post(method: 'Runtime.runIfWaitingForDebugger', callback?: (err: Error | null) => void): void;
+ /**
+ * Enables reporting of execution contexts creation by means of <code>executionContextCreated</code> event. When the reporting gets enabled the event will be sent immediately for each existing execution context.
+ */
+ post(method: 'Runtime.enable', callback?: (err: Error | null) => void): void;
+ /**
+ * Disables reporting of execution contexts creation.
+ */
+ post(method: 'Runtime.disable', callback?: (err: Error | null) => void): void;
+ /**
+ * Discards collected exceptions and console API calls.
+ */
+ post(method: 'Runtime.discardConsoleEntries', callback?: (err: Error | null) => void): void;
+ /**
+ * @experimental
+ */
+ post(method: 'Runtime.setCustomObjectFormatterEnabled', params?: Runtime.SetCustomObjectFormatterEnabledParameterType, callback?: (err: Error | null) => void): void;
+ post(method: 'Runtime.setCustomObjectFormatterEnabled', callback?: (err: Error | null) => void): void;
+ /**
+ * Compiles expression.
+ */
+ post(method: 'Runtime.compileScript', params?: Runtime.CompileScriptParameterType, callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void;
+ post(method: 'Runtime.compileScript', callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void;
+ /**
+ * Runs script with given id in a given context.
+ */
+ post(method: 'Runtime.runScript', params?: Runtime.RunScriptParameterType, callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void;
+ post(method: 'Runtime.runScript', callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void;
+ post(method: 'Runtime.queryObjects', params?: Runtime.QueryObjectsParameterType, callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void;
+ post(method: 'Runtime.queryObjects', callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void;
+ /**
+ * Returns all let, const and class variables from global scope.
+ */
+ post(
+ method: 'Runtime.globalLexicalScopeNames',
+ params?: Runtime.GlobalLexicalScopeNamesParameterType,
+ callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void
+ ): void;
+ post(method: 'Runtime.globalLexicalScopeNames', callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void): void;
+ /**
+ * Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received.
+ */
+ post(method: 'Debugger.enable', callback?: (err: Error | null, params: Debugger.EnableReturnType) => void): void;
+ /**
+ * Disables debugger for given page.
+ */
+ post(method: 'Debugger.disable', callback?: (err: Error | null) => void): void;
+ /**
+ * Activates / deactivates all breakpoints on the page.
+ */
+ post(method: 'Debugger.setBreakpointsActive', params?: Debugger.SetBreakpointsActiveParameterType, callback?: (err: Error | null) => void): void;
+ post(method: 'Debugger.setBreakpointsActive', callback?: (err: Error | null) => void): void;
+ /**
+ * Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc).
+ */
+ post(method: 'Debugger.setSkipAllPauses', params?: Debugger.SetSkipAllPausesParameterType, callback?: (err: Error | null) => void): void;
+ post(method: 'Debugger.setSkipAllPauses', callback?: (err: Error | null) => void): void;
+ /**
+ * Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this command is issued, all existing parsed scripts will have breakpoints resolved and returned in <code>locations</code> property. Further matching script parsing will result in subsequent <code>breakpointResolved</code> events issued. This logical breakpoint will survive page reloads.
+ */
+ post(method: 'Debugger.setBreakpointByUrl', params?: Debugger.SetBreakpointByUrlParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void;
+ post(method: 'Debugger.setBreakpointByUrl', callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void;
+ /**
+ * Sets JavaScript breakpoint at a given location.
+ */
+ post(method: 'Debugger.setBreakpoint', params?: Debugger.SetBreakpointParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void;
+ post(method: 'Debugger.setBreakpoint', callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void;
+ /**
+ * Removes JavaScript breakpoint.
+ */
+ post(method: 'Debugger.removeBreakpoint', params?: Debugger.RemoveBreakpointParameterType, callback?: (err: Error | null) => void): void;
+ post(method: 'Debugger.removeBreakpoint', callback?: (err: Error | null) => void): void;
+ /**
+ * Returns possible locations for breakpoint. scriptId in start and end range locations should be the same.
+ */
+ post(
+ method: 'Debugger.getPossibleBreakpoints',
+ params?: Debugger.GetPossibleBreakpointsParameterType,
+ callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void
+ ): void;
+ post(method: 'Debugger.getPossibleBreakpoints', callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void): void;
+ /**
+ * Continues execution until specific location is reached.
+ */
+ post(method: 'Debugger.continueToLocation', params?: Debugger.ContinueToLocationParameterType, callback?: (err: Error | null) => void): void;
+ post(method: 'Debugger.continueToLocation', callback?: (err: Error | null) => void): void;
+ /**
+ * @experimental
+ */
+ post(method: 'Debugger.pauseOnAsyncCall', params?: Debugger.PauseOnAsyncCallParameterType, callback?: (err: Error | null) => void): void;
+ post(method: 'Debugger.pauseOnAsyncCall', callback?: (err: Error | null) => void): void;
+ /**
+ * Steps over the statement.
+ */
+ post(method: 'Debugger.stepOver', callback?: (err: Error | null) => void): void;
+ /**
+ * Steps into the function call.
+ */
+ post(method: 'Debugger.stepInto', params?: Debugger.StepIntoParameterType, callback?: (err: Error | null) => void): void;
+ post(method: 'Debugger.stepInto', callback?: (err: Error | null) => void): void;
+ /**
+ * Steps out of the function call.
+ */
+ post(method: 'Debugger.stepOut', callback?: (err: Error | null) => void): void;
+ /**
+ * Stops on the next JavaScript statement.
+ */
+ post(method: 'Debugger.pause', callback?: (err: Error | null) => void): void;
+ /**
+ * This method is deprecated - use Debugger.stepInto with breakOnAsyncCall and Debugger.pauseOnAsyncTask instead. Steps into next scheduled async task if any is scheduled before next pause. Returns success when async task is actually scheduled, returns error if no task were scheduled or another scheduleStepIntoAsync was called.
+ * @experimental
+ */
+ post(method: 'Debugger.scheduleStepIntoAsync', callback?: (err: Error | null) => void): void;
+ /**
+ * Resumes JavaScript execution.
+ */
+ post(method: 'Debugger.resume', callback?: (err: Error | null) => void): void;
+ /**
+ * Returns stack trace with given <code>stackTraceId</code>.
+ * @experimental
+ */
+ post(method: 'Debugger.getStackTrace', params?: Debugger.GetStackTraceParameterType, callback?: (err: Error | null, params: Debugger.GetStackTraceReturnType) => void): void;
+ post(method: 'Debugger.getStackTrace', callback?: (err: Error | null, params: Debugger.GetStackTraceReturnType) => void): void;
+ /**
+ * Searches for given string in script content.
+ */
+ post(method: 'Debugger.searchInContent', params?: Debugger.SearchInContentParameterType, callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void;
+ post(method: 'Debugger.searchInContent', callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void;
+ /**
+ * Edits JavaScript source live.
+ */
+ post(method: 'Debugger.setScriptSource', params?: Debugger.SetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void;
+ post(method: 'Debugger.setScriptSource', callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void;
+ /**
+ * Restarts particular call frame from the beginning.
+ */
+ post(method: 'Debugger.restartFrame', params?: Debugger.RestartFrameParameterType, callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void;
+ post(method: 'Debugger.restartFrame', callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void;
+ /**
+ * Returns source for the script with given id.
+ */
+ post(method: 'Debugger.getScriptSource', params?: Debugger.GetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void;
+ post(method: 'Debugger.getScriptSource', callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void;
+ /**
+ * Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or no exceptions. Initial pause on exceptions state is <code>none</code>.
+ */
+ post(method: 'Debugger.setPauseOnExceptions', params?: Debugger.SetPauseOnExceptionsParameterType, callback?: (err: Error | null) => void): void;
+ post(method: 'Debugger.setPauseOnExceptions', callback?: (err: Error | null) => void): void;
+ /**
+ * Evaluates expression on a given call frame.
+ */
+ post(method: 'Debugger.evaluateOnCallFrame', params?: Debugger.EvaluateOnCallFrameParameterType, callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void;
+ post(method: 'Debugger.evaluateOnCallFrame', callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void;
+ /**
+ * Changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually.
+ */
+ post(method: 'Debugger.setVariableValue', params?: Debugger.SetVariableValueParameterType, callback?: (err: Error | null) => void): void;
+ post(method: 'Debugger.setVariableValue', callback?: (err: Error | null) => void): void;
+ /**
+ * Changes return value in top frame. Available only at return break position.
+ * @experimental
+ */
+ post(method: 'Debugger.setReturnValue', params?: Debugger.SetReturnValueParameterType, callback?: (err: Error | null) => void): void;
+ post(method: 'Debugger.setReturnValue', callback?: (err: Error | null) => void): void;
+ /**
+ * Enables or disables async call stacks tracking.
+ */
+ post(method: 'Debugger.setAsyncCallStackDepth', params?: Debugger.SetAsyncCallStackDepthParameterType, callback?: (err: Error | null) => void): void;
+ post(method: 'Debugger.setAsyncCallStackDepth', callback?: (err: Error | null) => void): void;
+ /**
+ * Replace previous blackbox patterns with passed ones. Forces backend to skip stepping/pausing in scripts with url matching one of the patterns. VM will try to leave blackboxed script by performing 'step in' several times, finally resorting to 'step out' if unsuccessful.
+ * @experimental
+ */
+ post(method: 'Debugger.setBlackboxPatterns', params?: Debugger.SetBlackboxPatternsParameterType, callback?: (err: Error | null) => void): void;
+ post(method: 'Debugger.setBlackboxPatterns', callback?: (err: Error | null) => void): void;
+ /**
+ * Makes backend skip steps in the script in blackboxed ranges. VM will try leave blacklisted scripts by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. Positions array contains positions where blackbox state is changed. First interval isn't blackboxed. Array should be sorted.
+ * @experimental
+ */
+ post(method: 'Debugger.setBlackboxedRanges', params?: Debugger.SetBlackboxedRangesParameterType, callback?: (err: Error | null) => void): void;
+ post(method: 'Debugger.setBlackboxedRanges', callback?: (err: Error | null) => void): void;
+ /**
+ * Enables console domain, sends the messages collected so far to the client by means of the <code>messageAdded</code> notification.
+ */
+ post(method: 'Console.enable', callback?: (err: Error | null) => void): void;
+ /**
+ * Disables console domain, prevents further console messages from being reported to the client.
+ */
+ post(method: 'Console.disable', callback?: (err: Error | null) => void): void;
+ /**
+ * Does nothing.
+ */
+ post(method: 'Console.clearMessages', callback?: (err: Error | null) => void): void;
+ post(method: 'Profiler.enable', callback?: (err: Error | null) => void): void;
+ post(method: 'Profiler.disable', callback?: (err: Error | null) => void): void;
+ /**
+ * Changes CPU profiler sampling interval. Must be called before CPU profiles recording started.
+ */
+ post(method: 'Profiler.setSamplingInterval', params?: Profiler.SetSamplingIntervalParameterType, callback?: (err: Error | null) => void): void;
+ post(method: 'Profiler.setSamplingInterval', callback?: (err: Error | null) => void): void;
+ post(method: 'Profiler.start', callback?: (err: Error | null) => void): void;
+ post(method: 'Profiler.stop', callback?: (err: Error | null, params: Profiler.StopReturnType) => void): void;
+ /**
+ * Enable precise code coverage. Coverage data for JavaScript executed before enabling precise code coverage may be incomplete. Enabling prevents running optimized code and resets execution counters.
+ */
+ post(method: 'Profiler.startPreciseCoverage', params?: Profiler.StartPreciseCoverageParameterType, callback?: (err: Error | null) => void): void;
+ post(method: 'Profiler.startPreciseCoverage', callback?: (err: Error | null) => void): void;
+ /**
+ * Disable precise code coverage. Disabling releases unnecessary execution count records and allows executing optimized code.
+ */
+ post(method: 'Profiler.stopPreciseCoverage', callback?: (err: Error | null) => void): void;
+ /**
+ * Collect coverage data for the current isolate, and resets execution counters. Precise code coverage needs to have started.
+ */
+ post(method: 'Profiler.takePreciseCoverage', callback?: (err: Error | null, params: Profiler.TakePreciseCoverageReturnType) => void): void;
+ /**
+ * Collect coverage data for the current isolate. The coverage data may be incomplete due to garbage collection.
+ */
+ post(method: 'Profiler.getBestEffortCoverage', callback?: (err: Error | null, params: Profiler.GetBestEffortCoverageReturnType) => void): void;
+ /**
+ * Enable type profile.
+ * @experimental
+ */
+ post(method: 'Profiler.startTypeProfile', callback?: (err: Error | null) => void): void;
+ /**
+ * Disable type profile. Disabling releases type profile data collected so far.
+ * @experimental
+ */
+ post(method: 'Profiler.stopTypeProfile', callback?: (err: Error | null) => void): void;
+ /**
+ * Collect type profile.
+ * @experimental
+ */
+ post(method: 'Profiler.takeTypeProfile', callback?: (err: Error | null, params: Profiler.TakeTypeProfileReturnType) => void): void;
+ post(method: 'HeapProfiler.enable', callback?: (err: Error | null) => void): void;
+ post(method: 'HeapProfiler.disable', callback?: (err: Error | null) => void): void;
+ post(method: 'HeapProfiler.startTrackingHeapObjects', params?: HeapProfiler.StartTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void;
+ post(method: 'HeapProfiler.startTrackingHeapObjects', callback?: (err: Error | null) => void): void;
+ post(method: 'HeapProfiler.stopTrackingHeapObjects', params?: HeapProfiler.StopTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void;
+ post(method: 'HeapProfiler.stopTrackingHeapObjects', callback?: (err: Error | null) => void): void;
+ post(method: 'HeapProfiler.takeHeapSnapshot', params?: HeapProfiler.TakeHeapSnapshotParameterType, callback?: (err: Error | null) => void): void;
+ post(method: 'HeapProfiler.takeHeapSnapshot', callback?: (err: Error | null) => void): void;
+ post(method: 'HeapProfiler.collectGarbage', callback?: (err: Error | null) => void): void;
+ post(
+ method: 'HeapProfiler.getObjectByHeapObjectId',
+ params?: HeapProfiler.GetObjectByHeapObjectIdParameterType,
+ callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void
+ ): void;
+ post(method: 'HeapProfiler.getObjectByHeapObjectId', callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void): void;
+ /**
+ * Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions).
+ */
+ post(method: 'HeapProfiler.addInspectedHeapObject', params?: HeapProfiler.AddInspectedHeapObjectParameterType, callback?: (err: Error | null) => void): void;
+ post(method: 'HeapProfiler.addInspectedHeapObject', callback?: (err: Error | null) => void): void;
+ post(method: 'HeapProfiler.getHeapObjectId', params?: HeapProfiler.GetHeapObjectIdParameterType, callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void;
+ post(method: 'HeapProfiler.getHeapObjectId', callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void;
+ post(method: 'HeapProfiler.startSampling', params?: HeapProfiler.StartSamplingParameterType, callback?: (err: Error | null) => void): void;
+ post(method: 'HeapProfiler.startSampling', callback?: (err: Error | null) => void): void;
+ post(method: 'HeapProfiler.stopSampling', callback?: (err: Error | null, params: HeapProfiler.StopSamplingReturnType) => void): void;
+ post(method: 'HeapProfiler.getSamplingProfile', callback?: (err: Error | null, params: HeapProfiler.GetSamplingProfileReturnType) => void): void;
+ /**
+ * Gets supported tracing categories.
+ */
+ post(method: 'NodeTracing.getCategories', callback?: (err: Error | null, params: NodeTracing.GetCategoriesReturnType) => void): void;
+ /**
+ * Start trace events collection.
+ */
+ post(method: 'NodeTracing.start', params?: NodeTracing.StartParameterType, callback?: (err: Error | null) => void): void;
+ post(method: 'NodeTracing.start', callback?: (err: Error | null) => void): void;
+ /**
+ * Stop trace events collection. Remaining collected events will be sent as a sequence of
+ * dataCollected events followed by tracingComplete event.
+ */
+ post(method: 'NodeTracing.stop', callback?: (err: Error | null) => void): void;
+ /**
+ * Sends protocol message over session with given id.
+ */
+ post(method: 'NodeWorker.sendMessageToWorker', params?: NodeWorker.SendMessageToWorkerParameterType, callback?: (err: Error | null) => void): void;
+ post(method: 'NodeWorker.sendMessageToWorker', callback?: (err: Error | null) => void): void;
+ /**
+ * Instructs the inspector to attach to running workers. Will also attach to new workers
+ * as they start
+ */
+ post(method: 'NodeWorker.enable', params?: NodeWorker.EnableParameterType, callback?: (err: Error | null) => void): void;
+ post(method: 'NodeWorker.enable', callback?: (err: Error | null) => void): void;
+ /**
+ * Detaches from all running workers and disables attaching to new workers as they are started.
+ */
+ post(method: 'NodeWorker.disable', callback?: (err: Error | null) => void): void;
+ /**
+ * Detached from the worker with given sessionId.
+ */
+ post(method: 'NodeWorker.detach', params?: NodeWorker.DetachParameterType, callback?: (err: Error | null) => void): void;
+ post(method: 'NodeWorker.detach', callback?: (err: Error | null) => void): void;
+ /**
+ * Enable the `NodeRuntime.waitingForDisconnect`.
+ */
+ post(method: 'NodeRuntime.notifyWhenWaitingForDisconnect', params?: NodeRuntime.NotifyWhenWaitingForDisconnectParameterType, callback?: (err: Error | null) => void): void;
+ post(method: 'NodeRuntime.notifyWhenWaitingForDisconnect', callback?: (err: Error | null) => void): void;
+ // Events
+ addListener(event: string, listener: (...args: any[]) => void): this;
+ /**
+ * Emitted when any notification from the V8 Inspector is received.
+ */
+ addListener(event: 'inspectorNotification', listener: (message: InspectorNotification<{}>) => void): this;
+ /**
+ * Issued when new execution context is created.
+ */
+ addListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification<Runtime.ExecutionContextCreatedEventDataType>) => void): this;
+ /**
+ * Issued when execution context is destroyed.
+ */
+ addListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification<Runtime.ExecutionContextDestroyedEventDataType>) => void): this;
+ /**
+ * Issued when all executionContexts were cleared in browser
+ */
+ addListener(event: 'Runtime.executionContextsCleared', listener: () => void): this;
+ /**
+ * Issued when exception was thrown and unhandled.
+ */
+ addListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification<Runtime.ExceptionThrownEventDataType>) => void): this;
+ /**
+ * Issued when unhandled exception was revoked.
+ */
+ addListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification<Runtime.ExceptionRevokedEventDataType>) => void): this;
+ /**
+ * Issued when console API was called.
+ */
+ addListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification<Runtime.ConsoleAPICalledEventDataType>) => void): this;
+ /**
+ * Issued when object should be inspected (for example, as a result of inspect() command line API call).
+ */
+ addListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification<Runtime.InspectRequestedEventDataType>) => void): this;
+ /**
+ * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger.
+ */
+ addListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification<Debugger.ScriptParsedEventDataType>) => void): this;
+ /**
+ * Fired when virtual machine fails to parse the script.
+ */
+ addListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification<Debugger.ScriptFailedToParseEventDataType>) => void): this;
+ /**
+ * Fired when breakpoint is resolved to an actual script and location.
+ */
+ addListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification<Debugger.BreakpointResolvedEventDataType>) => void): this;
+ /**
+ * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.
+ */
+ addListener(event: 'Debugger.paused', listener: (message: InspectorNotification<Debugger.PausedEventDataType>) => void): this;
+ /**
+ * Fired when the virtual machine resumed execution.
+ */
+ addListener(event: 'Debugger.resumed', listener: () => void): this;
+ /**
+ * Issued when new console message is added.
+ */
+ addListener(event: 'Console.messageAdded', listener: (message: InspectorNotification<Console.MessageAddedEventDataType>) => void): this;
+ /**
+ * Sent when new profile recording is started using console.profile() call.
+ */
+ addListener(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification<Profiler.ConsoleProfileStartedEventDataType>) => void): this;
+ addListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification<Profiler.ConsoleProfileFinishedEventDataType>) => void): this;
+ addListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification<HeapProfiler.AddHeapSnapshotChunkEventDataType>) => void): this;
+ addListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this;
+ addListener(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification<HeapProfiler.ReportHeapSnapshotProgressEventDataType>) => void): this;
+ /**
+ * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event.
+ */
+ addListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification<HeapProfiler.LastSeenObjectIdEventDataType>) => void): this;
+ /**
+ * If heap objects tracking has been started then backend may send update for one or more fragments
+ */
+ addListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification<HeapProfiler.HeapStatsUpdateEventDataType>) => void): this;
+ /**
+ * Contains an bucket of collected trace events.
+ */
+ addListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification<NodeTracing.DataCollectedEventDataType>) => void): this;
+ /**
+ * Signals that tracing is stopped and there is no trace buffers pending flush, all data were
+ * delivered via dataCollected events.
+ */
+ addListener(event: 'NodeTracing.tracingComplete', listener: () => void): this;
+ /**
+ * Issued when attached to a worker.
+ */
+ addListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification<NodeWorker.AttachedToWorkerEventDataType>) => void): this;
+ /**
+ * Issued when detached from the worker.
+ */
+ addListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification<NodeWorker.DetachedFromWorkerEventDataType>) => void): this;
+ /**
+ * Notifies about a new protocol message received from the session
+ * (session ID is provided in attachedToWorker notification).
+ */
+ addListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification<NodeWorker.ReceivedMessageFromWorkerEventDataType>) => void): this;
+ /**
+ * This event is fired instead of `Runtime.executionContextDestroyed` when
+ * enabled.
+ * It is fired when the Node process finished all code execution and is
+ * waiting for all frontends to disconnect.
+ */
+ addListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this;
+ emit(event: string | symbol, ...args: any[]): boolean;
+ emit(event: 'inspectorNotification', message: InspectorNotification<{}>): boolean;
+ emit(event: 'Runtime.executionContextCreated', message: InspectorNotification<Runtime.ExecutionContextCreatedEventDataType>): boolean;
+ emit(event: 'Runtime.executionContextDestroyed', message: InspectorNotification<Runtime.ExecutionContextDestroyedEventDataType>): boolean;
+ emit(event: 'Runtime.executionContextsCleared'): boolean;
+ emit(event: 'Runtime.exceptionThrown', message: InspectorNotification<Runtime.ExceptionThrownEventDataType>): boolean;
+ emit(event: 'Runtime.exceptionRevoked', message: InspectorNotification<Runtime.ExceptionRevokedEventDataType>): boolean;
+ emit(event: 'Runtime.consoleAPICalled', message: InspectorNotification<Runtime.ConsoleAPICalledEventDataType>): boolean;
+ emit(event: 'Runtime.inspectRequested', message: InspectorNotification<Runtime.InspectRequestedEventDataType>): boolean;
+ emit(event: 'Debugger.scriptParsed', message: InspectorNotification<Debugger.ScriptParsedEventDataType>): boolean;
+ emit(event: 'Debugger.scriptFailedToParse', message: InspectorNotification<Debugger.ScriptFailedToParseEventDataType>): boolean;
+ emit(event: 'Debugger.breakpointResolved', message: InspectorNotification<Debugger.BreakpointResolvedEventDataType>): boolean;
+ emit(event: 'Debugger.paused', message: InspectorNotification<Debugger.PausedEventDataType>): boolean;
+ emit(event: 'Debugger.resumed'): boolean;
+ emit(event: 'Console.messageAdded', message: InspectorNotification<Console.MessageAddedEventDataType>): boolean;
+ emit(event: 'Profiler.consoleProfileStarted', message: InspectorNotification<Profiler.ConsoleProfileStartedEventDataType>): boolean;
+ emit(event: 'Profiler.consoleProfileFinished', message: InspectorNotification<Profiler.ConsoleProfileFinishedEventDataType>): boolean;
+ emit(event: 'HeapProfiler.addHeapSnapshotChunk', message: InspectorNotification<HeapProfiler.AddHeapSnapshotChunkEventDataType>): boolean;
+ emit(event: 'HeapProfiler.resetProfiles'): boolean;
+ emit(event: 'HeapProfiler.reportHeapSnapshotProgress', message: InspectorNotification<HeapProfiler.ReportHeapSnapshotProgressEventDataType>): boolean;
+ emit(event: 'HeapProfiler.lastSeenObjectId', message: InspectorNotification<HeapProfiler.LastSeenObjectIdEventDataType>): boolean;
+ emit(event: 'HeapProfiler.heapStatsUpdate', message: InspectorNotification<HeapProfiler.HeapStatsUpdateEventDataType>): boolean;
+ emit(event: 'NodeTracing.dataCollected', message: InspectorNotification<NodeTracing.DataCollectedEventDataType>): boolean;
+ emit(event: 'NodeTracing.tracingComplete'): boolean;
+ emit(event: 'NodeWorker.attachedToWorker', message: InspectorNotification<NodeWorker.AttachedToWorkerEventDataType>): boolean;
+ emit(event: 'NodeWorker.detachedFromWorker', message: InspectorNotification<NodeWorker.DetachedFromWorkerEventDataType>): boolean;
+ emit(event: 'NodeWorker.receivedMessageFromWorker', message: InspectorNotification<NodeWorker.ReceivedMessageFromWorkerEventDataType>): boolean;
+ emit(event: 'NodeRuntime.waitingForDisconnect'): boolean;
+ on(event: string, listener: (...args: any[]) => void): this;
+ /**
+ * Emitted when any notification from the V8 Inspector is received.
+ */
+ on(event: 'inspectorNotification', listener: (message: InspectorNotification<{}>) => void): this;
+ /**
+ * Issued when new execution context is created.
+ */
+ on(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification<Runtime.ExecutionContextCreatedEventDataType>) => void): this;
+ /**
+ * Issued when execution context is destroyed.
+ */
+ on(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification<Runtime.ExecutionContextDestroyedEventDataType>) => void): this;
+ /**
+ * Issued when all executionContexts were cleared in browser
+ */
+ on(event: 'Runtime.executionContextsCleared', listener: () => void): this;
+ /**
+ * Issued when exception was thrown and unhandled.
+ */
+ on(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification<Runtime.ExceptionThrownEventDataType>) => void): this;
+ /**
+ * Issued when unhandled exception was revoked.
+ */
+ on(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification<Runtime.ExceptionRevokedEventDataType>) => void): this;
+ /**
+ * Issued when console API was called.
+ */
+ on(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification<Runtime.ConsoleAPICalledEventDataType>) => void): this;
+ /**
+ * Issued when object should be inspected (for example, as a result of inspect() command line API call).
+ */
+ on(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification<Runtime.InspectRequestedEventDataType>) => void): this;
+ /**
+ * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger.
+ */
+ on(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification<Debugger.ScriptParsedEventDataType>) => void): this;
+ /**
+ * Fired when virtual machine fails to parse the script.
+ */
+ on(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification<Debugger.ScriptFailedToParseEventDataType>) => void): this;
+ /**
+ * Fired when breakpoint is resolved to an actual script and location.
+ */
+ on(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification<Debugger.BreakpointResolvedEventDataType>) => void): this;
+ /**
+ * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.
+ */
+ on(event: 'Debugger.paused', listener: (message: InspectorNotification<Debugger.PausedEventDataType>) => void): this;
+ /**
+ * Fired when the virtual machine resumed execution.
+ */
+ on(event: 'Debugger.resumed', listener: () => void): this;
+ /**
+ * Issued when new console message is added.
+ */
+ on(event: 'Console.messageAdded', listener: (message: InspectorNotification<Console.MessageAddedEventDataType>) => void): this;
+ /**
+ * Sent when new profile recording is started using console.profile() call.
+ */
+ on(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification<Profiler.ConsoleProfileStartedEventDataType>) => void): this;
+ on(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification<Profiler.ConsoleProfileFinishedEventDataType>) => void): this;
+ on(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification<HeapProfiler.AddHeapSnapshotChunkEventDataType>) => void): this;
+ on(event: 'HeapProfiler.resetProfiles', listener: () => void): this;
+ on(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification<HeapProfiler.ReportHeapSnapshotProgressEventDataType>) => void): this;
+ /**
+ * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event.
+ */
+ on(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification<HeapProfiler.LastSeenObjectIdEventDataType>) => void): this;
+ /**
+ * If heap objects tracking has been started then backend may send update for one or more fragments
+ */
+ on(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification<HeapProfiler.HeapStatsUpdateEventDataType>) => void): this;
+ /**
+ * Contains an bucket of collected trace events.
+ */
+ on(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification<NodeTracing.DataCollectedEventDataType>) => void): this;
+ /**
+ * Signals that tracing is stopped and there is no trace buffers pending flush, all data were
+ * delivered via dataCollected events.
+ */
+ on(event: 'NodeTracing.tracingComplete', listener: () => void): this;
+ /**
+ * Issued when attached to a worker.
+ */
+ on(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification<NodeWorker.AttachedToWorkerEventDataType>) => void): this;
+ /**
+ * Issued when detached from the worker.
+ */
+ on(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification<NodeWorker.DetachedFromWorkerEventDataType>) => void): this;
+ /**
+ * Notifies about a new protocol message received from the session
+ * (session ID is provided in attachedToWorker notification).
+ */
+ on(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification<NodeWorker.ReceivedMessageFromWorkerEventDataType>) => void): this;
+ /**
+ * This event is fired instead of `Runtime.executionContextDestroyed` when
+ * enabled.
+ * It is fired when the Node process finished all code execution and is
+ * waiting for all frontends to disconnect.
+ */
+ on(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this;
+ once(event: string, listener: (...args: any[]) => void): this;
+ /**
+ * Emitted when any notification from the V8 Inspector is received.
+ */
+ once(event: 'inspectorNotification', listener: (message: InspectorNotification<{}>) => void): this;
+ /**
+ * Issued when new execution context is created.
+ */
+ once(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification<Runtime.ExecutionContextCreatedEventDataType>) => void): this;
+ /**
+ * Issued when execution context is destroyed.
+ */
+ once(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification<Runtime.ExecutionContextDestroyedEventDataType>) => void): this;
+ /**
+ * Issued when all executionContexts were cleared in browser
+ */
+ once(event: 'Runtime.executionContextsCleared', listener: () => void): this;
+ /**
+ * Issued when exception was thrown and unhandled.
+ */
+ once(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification<Runtime.ExceptionThrownEventDataType>) => void): this;
+ /**
+ * Issued when unhandled exception was revoked.
+ */
+ once(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification<Runtime.ExceptionRevokedEventDataType>) => void): this;
+ /**
+ * Issued when console API was called.
+ */
+ once(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification<Runtime.ConsoleAPICalledEventDataType>) => void): this;
+ /**
+ * Issued when object should be inspected (for example, as a result of inspect() command line API call).
+ */
+ once(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification<Runtime.InspectRequestedEventDataType>) => void): this;
+ /**
+ * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger.
+ */
+ once(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification<Debugger.ScriptParsedEventDataType>) => void): this;
+ /**
+ * Fired when virtual machine fails to parse the script.
+ */
+ once(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification<Debugger.ScriptFailedToParseEventDataType>) => void): this;
+ /**
+ * Fired when breakpoint is resolved to an actual script and location.
+ */
+ once(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification<Debugger.BreakpointResolvedEventDataType>) => void): this;
+ /**
+ * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.
+ */
+ once(event: 'Debugger.paused', listener: (message: InspectorNotification<Debugger.PausedEventDataType>) => void): this;
+ /**
+ * Fired when the virtual machine resumed execution.
+ */
+ once(event: 'Debugger.resumed', listener: () => void): this;
+ /**
+ * Issued when new console message is added.
+ */
+ once(event: 'Console.messageAdded', listener: (message: InspectorNotification<Console.MessageAddedEventDataType>) => void): this;
+ /**
+ * Sent when new profile recording is started using console.profile() call.
+ */
+ once(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification<Profiler.ConsoleProfileStartedEventDataType>) => void): this;
+ once(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification<Profiler.ConsoleProfileFinishedEventDataType>) => void): this;
+ once(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification<HeapProfiler.AddHeapSnapshotChunkEventDataType>) => void): this;
+ once(event: 'HeapProfiler.resetProfiles', listener: () => void): this;
+ once(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification<HeapProfiler.ReportHeapSnapshotProgressEventDataType>) => void): this;
+ /**
+ * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event.
+ */
+ once(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification<HeapProfiler.LastSeenObjectIdEventDataType>) => void): this;
+ /**
+ * If heap objects tracking has been started then backend may send update for one or more fragments
+ */
+ once(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification<HeapProfiler.HeapStatsUpdateEventDataType>) => void): this;
+ /**
+ * Contains an bucket of collected trace events.
+ */
+ once(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification<NodeTracing.DataCollectedEventDataType>) => void): this;
+ /**
+ * Signals that tracing is stopped and there is no trace buffers pending flush, all data were
+ * delivered via dataCollected events.
+ */
+ once(event: 'NodeTracing.tracingComplete', listener: () => void): this;
+ /**
+ * Issued when attached to a worker.
+ */
+ once(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification<NodeWorker.AttachedToWorkerEventDataType>) => void): this;
+ /**
+ * Issued when detached from the worker.
+ */
+ once(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification<NodeWorker.DetachedFromWorkerEventDataType>) => void): this;
+ /**
+ * Notifies about a new protocol message received from the session
+ * (session ID is provided in attachedToWorker notification).
+ */
+ once(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification<NodeWorker.ReceivedMessageFromWorkerEventDataType>) => void): this;
+ /**
+ * This event is fired instead of `Runtime.executionContextDestroyed` when
+ * enabled.
+ * It is fired when the Node process finished all code execution and is
+ * waiting for all frontends to disconnect.
+ */
+ once(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this;
+ prependListener(event: string, listener: (...args: any[]) => void): this;
+ /**
+ * Emitted when any notification from the V8 Inspector is received.
+ */
+ prependListener(event: 'inspectorNotification', listener: (message: InspectorNotification<{}>) => void): this;
+ /**
+ * Issued when new execution context is created.
+ */
+ prependListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification<Runtime.ExecutionContextCreatedEventDataType>) => void): this;
+ /**
+ * Issued when execution context is destroyed.
+ */
+ prependListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification<Runtime.ExecutionContextDestroyedEventDataType>) => void): this;
+ /**
+ * Issued when all executionContexts were cleared in browser
+ */
+ prependListener(event: 'Runtime.executionContextsCleared', listener: () => void): this;
+ /**
+ * Issued when exception was thrown and unhandled.
+ */
+ prependListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification<Runtime.ExceptionThrownEventDataType>) => void): this;
+ /**
+ * Issued when unhandled exception was revoked.
+ */
+ prependListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification<Runtime.ExceptionRevokedEventDataType>) => void): this;
+ /**
+ * Issued when console API was called.
+ */
+ prependListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification<Runtime.ConsoleAPICalledEventDataType>) => void): this;
+ /**
+ * Issued when object should be inspected (for example, as a result of inspect() command line API call).
+ */
+ prependListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification<Runtime.InspectRequestedEventDataType>) => void): this;
+ /**
+ * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger.
+ */
+ prependListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification<Debugger.ScriptParsedEventDataType>) => void): this;
+ /**
+ * Fired when virtual machine fails to parse the script.
+ */
+ prependListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification<Debugger.ScriptFailedToParseEventDataType>) => void): this;
+ /**
+ * Fired when breakpoint is resolved to an actual script and location.
+ */
+ prependListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification<Debugger.BreakpointResolvedEventDataType>) => void): this;
+ /**
+ * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.
+ */
+ prependListener(event: 'Debugger.paused', listener: (message: InspectorNotification<Debugger.PausedEventDataType>) => void): this;
+ /**
+ * Fired when the virtual machine resumed execution.
+ */
+ prependListener(event: 'Debugger.resumed', listener: () => void): this;
+ /**
+ * Issued when new console message is added.
+ */
+ prependListener(event: 'Console.messageAdded', listener: (message: InspectorNotification<Console.MessageAddedEventDataType>) => void): this;
+ /**
+ * Sent when new profile recording is started using console.profile() call.
+ */
+ prependListener(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification<Profiler.ConsoleProfileStartedEventDataType>) => void): this;
+ prependListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification<Profiler.ConsoleProfileFinishedEventDataType>) => void): this;
+ prependListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification<HeapProfiler.AddHeapSnapshotChunkEventDataType>) => void): this;
+ prependListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this;
+ prependListener(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification<HeapProfiler.ReportHeapSnapshotProgressEventDataType>) => void): this;
+ /**
+ * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event.
+ */
+ prependListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification<HeapProfiler.LastSeenObjectIdEventDataType>) => void): this;
+ /**
+ * If heap objects tracking has been started then backend may send update for one or more fragments
+ */
+ prependListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification<HeapProfiler.HeapStatsUpdateEventDataType>) => void): this;
+ /**
+ * Contains an bucket of collected trace events.
+ */
+ prependListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification<NodeTracing.DataCollectedEventDataType>) => void): this;
+ /**
+ * Signals that tracing is stopped and there is no trace buffers pending flush, all data were
+ * delivered via dataCollected events.
+ */
+ prependListener(event: 'NodeTracing.tracingComplete', listener: () => void): this;
+ /**
+ * Issued when attached to a worker.
+ */
+ prependListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification<NodeWorker.AttachedToWorkerEventDataType>) => void): this;
+ /**
+ * Issued when detached from the worker.
+ */
+ prependListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification<NodeWorker.DetachedFromWorkerEventDataType>) => void): this;
+ /**
+ * Notifies about a new protocol message received from the session
+ * (session ID is provided in attachedToWorker notification).
+ */
+ prependListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification<NodeWorker.ReceivedMessageFromWorkerEventDataType>) => void): this;
+ /**
+ * This event is fired instead of `Runtime.executionContextDestroyed` when
+ * enabled.
+ * It is fired when the Node process finished all code execution and is
+ * waiting for all frontends to disconnect.
+ */
+ prependListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this;
+ prependOnceListener(event: string, listener: (...args: any[]) => void): this;
+ /**
+ * Emitted when any notification from the V8 Inspector is received.
+ */
+ prependOnceListener(event: 'inspectorNotification', listener: (message: InspectorNotification<{}>) => void): this;
+ /**
+ * Issued when new execution context is created.
+ */
+ prependOnceListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification<Runtime.ExecutionContextCreatedEventDataType>) => void): this;
+ /**
+ * Issued when execution context is destroyed.
+ */
+ prependOnceListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification<Runtime.ExecutionContextDestroyedEventDataType>) => void): this;
+ /**
+ * Issued when all executionContexts were cleared in browser
+ */
+ prependOnceListener(event: 'Runtime.executionContextsCleared', listener: () => void): this;
+ /**
+ * Issued when exception was thrown and unhandled.
+ */
+ prependOnceListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification<Runtime.ExceptionThrownEventDataType>) => void): this;
+ /**
+ * Issued when unhandled exception was revoked.
+ */
+ prependOnceListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification<Runtime.ExceptionRevokedEventDataType>) => void): this;
+ /**
+ * Issued when console API was called.
+ */
+ prependOnceListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification<Runtime.ConsoleAPICalledEventDataType>) => void): this;
+ /**
+ * Issued when object should be inspected (for example, as a result of inspect() command line API call).
+ */
+ prependOnceListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification<Runtime.InspectRequestedEventDataType>) => void): this;
+ /**
+ * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger.
+ */
+ prependOnceListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification<Debugger.ScriptParsedEventDataType>) => void): this;
+ /**
+ * Fired when virtual machine fails to parse the script.
+ */
+ prependOnceListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification<Debugger.ScriptFailedToParseEventDataType>) => void): this;
+ /**
+ * Fired when breakpoint is resolved to an actual script and location.
+ */
+ prependOnceListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification<Debugger.BreakpointResolvedEventDataType>) => void): this;
+ /**
+ * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.
+ */
+ prependOnceListener(event: 'Debugger.paused', listener: (message: InspectorNotification<Debugger.PausedEventDataType>) => void): this;
+ /**
+ * Fired when the virtual machine resumed execution.
+ */
+ prependOnceListener(event: 'Debugger.resumed', listener: () => void): this;
+ /**
+ * Issued when new console message is added.
+ */
+ prependOnceListener(event: 'Console.messageAdded', listener: (message: InspectorNotification<Console.MessageAddedEventDataType>) => void): this;
+ /**
+ * Sent when new profile recording is started using console.profile() call.
+ */
+ prependOnceListener(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification<Profiler.ConsoleProfileStartedEventDataType>) => void): this;
+ prependOnceListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification<Profiler.ConsoleProfileFinishedEventDataType>) => void): this;
+ prependOnceListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification<HeapProfiler.AddHeapSnapshotChunkEventDataType>) => void): this;
+ prependOnceListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this;
+ prependOnceListener(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification<HeapProfiler.ReportHeapSnapshotProgressEventDataType>) => void): this;
+ /**
+ * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event.
+ */
+ prependOnceListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification<HeapProfiler.LastSeenObjectIdEventDataType>) => void): this;
+ /**
+ * If heap objects tracking has been started then backend may send update for one or more fragments
+ */
+ prependOnceListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification<HeapProfiler.HeapStatsUpdateEventDataType>) => void): this;
+ /**
+ * Contains an bucket of collected trace events.
+ */
+ prependOnceListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification<NodeTracing.DataCollectedEventDataType>) => void): this;
+ /**
+ * Signals that tracing is stopped and there is no trace buffers pending flush, all data were
+ * delivered via dataCollected events.
+ */
+ prependOnceListener(event: 'NodeTracing.tracingComplete', listener: () => void): this;
+ /**
+ * Issued when attached to a worker.
+ */
+ prependOnceListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification<NodeWorker.AttachedToWorkerEventDataType>) => void): this;
+ /**
+ * Issued when detached from the worker.
+ */
+ prependOnceListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification<NodeWorker.DetachedFromWorkerEventDataType>) => void): this;
+ /**
+ * Notifies about a new protocol message received from the session
+ * (session ID is provided in attachedToWorker notification).
+ */
+ prependOnceListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification<NodeWorker.ReceivedMessageFromWorkerEventDataType>) => void): this;
+ /**
+ * This event is fired instead of `Runtime.executionContextDestroyed` when
+ * enabled.
+ * It is fired when the Node process finished all code execution and is
+ * waiting for all frontends to disconnect.
+ */
+ prependOnceListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this;
+ }
+ /**
+ * Activate inspector on host and port. Equivalent to`node --inspect=[[host:]port]`, but can be done programmatically after node has
+ * started.
+ *
+ * If wait is `true`, will block until a client has connected to the inspect port
+ * and flow control has been passed to the debugger client.
+ *
+ * See the `security warning` regarding the `host`parameter usage.
+ * @param [port='what was specified on the CLI'] Port to listen on for inspector connections. Optional.
+ * @param [host='what was specified on the CLI'] Host to listen on for inspector connections. Optional.
+ * @param [wait=false] Block until a client has connected. Optional.
+ */
+ function open(port?: number, host?: string, wait?: boolean): void;
+ /**
+ * Deactivate the inspector. Blocks until there are no active connections.
+ */
+ function close(): void;
+ /**
+ * Return the URL of the active inspector, or `undefined` if there is none.
+ *
+ * ```console
+ * $ node --inspect -p 'inspector.url()'
+ * Debugger listening on ws://127.0.0.1:9229/166e272e-7a30-4d09-97ce-f1c012b43c34
+ * For help, see: https://nodejs.org/en/docs/inspector
+ * ws://127.0.0.1:9229/166e272e-7a30-4d09-97ce-f1c012b43c34
+ *
+ * $ node --inspect=localhost:3000 -p 'inspector.url()'
+ * Debugger listening on ws://localhost:3000/51cf8d0e-3c36-4c59-8efd-54519839e56a
+ * For help, see: https://nodejs.org/en/docs/inspector
+ * ws://localhost:3000/51cf8d0e-3c36-4c59-8efd-54519839e56a
+ *
+ * $ node -p 'inspector.url()'
+ * undefined
+ * ```
+ */
+ function url(): string | undefined;
+ /**
+ * Blocks until a client (existing or connected later) has sent`Runtime.runIfWaitingForDebugger` command.
+ *
+ * An exception will be thrown if there is no active inspector.
+ * @since v12.7.0
+ */
+ function waitForDebugger(): void;
+}
+/**
+ * The inspector module provides an API for interacting with the V8 inspector.
+ */
+declare module 'node:inspector' {
+ import inspector = require('inspector');
+ export = inspector;
+}
diff --git a/client/node_modules/@types/node/module.d.ts b/client/node_modules/@types/node/module.d.ts
new file mode 100644
index 0000000..9e6e414
--- /dev/null
+++ b/client/node_modules/@types/node/module.d.ts
@@ -0,0 +1,262 @@
+/**
+ * @since v0.3.7
+ */
+declare module "module" {
+ import { URL } from "node:url";
+ import { MessagePort } from "node:worker_threads";
+ namespace Module {
+ /**
+ * The `module.syncBuiltinESMExports()` method updates all the live bindings for
+ * builtin `ES Modules` to match the properties of the `CommonJS` exports. It
+ * does not add or remove exported names from the `ES Modules`.
+ *
+ * ```js
+ * const fs = require('fs');
+ * const assert = require('assert');
+ * const { syncBuiltinESMExports } = require('module');
+ *
+ * fs.readFile = newAPI;
+ *
+ * delete fs.readFileSync;
+ *
+ * function newAPI() {
+ * // ...
+ * }
+ *
+ * fs.newAPI = newAPI;
+ *
+ * syncBuiltinESMExports();
+ *
+ * import('fs').then((esmFS) => {
+ * // It syncs the existing readFile property with the new value
+ * assert.strictEqual(esmFS.readFile, newAPI);
+ * // readFileSync has been deleted from the required fs
+ * assert.strictEqual('readFileSync' in fs, false);
+ * // syncBuiltinESMExports() does not remove readFileSync from esmFS
+ * assert.strictEqual('readFileSync' in esmFS, true);
+ * // syncBuiltinESMExports() does not add names
+ * assert.strictEqual(esmFS.newAPI, undefined);
+ * });
+ * ```
+ * @since v12.12.0
+ */
+ function syncBuiltinESMExports(): void;
+ /**
+ * `path` is the resolved path for the file for which a corresponding source map
+ * should be fetched.
+ * @since v13.7.0, v12.17.0
+ */
+ function findSourceMap(path: string, error?: Error): SourceMap;
+ interface SourceMapPayload {
+ file: string;
+ version: number;
+ sources: string[];
+ sourcesContent: string[];
+ names: string[];
+ mappings: string;
+ sourceRoot: string;
+ }
+ interface SourceMapping {
+ generatedLine: number;
+ generatedColumn: number;
+ originalSource: string;
+ originalLine: number;
+ originalColumn: number;
+ }
+ interface SourceOrigin {
+ /**
+ * The name of the range in the source map, if one was provided
+ */
+ name?: string;
+ /**
+ * The file name of the original source, as reported in the SourceMap
+ */
+ fileName: string;
+ /**
+ * The 1-indexed lineNumber of the corresponding call site in the original source
+ */
+ lineNumber: number;
+ /**
+ * The 1-indexed columnNumber of the corresponding call site in the original source
+ */
+ columnNumber: number;
+ }
+ /**
+ * @since v13.7.0, v12.17.0
+ */
+ class SourceMap {
+ /**
+ * Getter for the payload used to construct the `SourceMap` instance.
+ */
+ readonly payload: SourceMapPayload;
+ constructor(payload: SourceMapPayload);
+ /**
+ * Given a line offset and column offset in the generated source
+ * file, returns an object representing the SourceMap range in the
+ * original file if found, or an empty object if not.
+ *
+ * The object returned contains the following keys:
+ *
+ * The returned value represents the raw range as it appears in the
+ * SourceMap, based on zero-indexed offsets, _not_ 1-indexed line and
+ * column numbers as they appear in Error messages and CallSite
+ * objects.
+ *
+ * To get the corresponding 1-indexed line and column numbers from a
+ * lineNumber and columnNumber as they are reported by Error stacks
+ * and CallSite objects, use `sourceMap.findOrigin(lineNumber, columnNumber)`
+ * @param lineOffset The zero-indexed line number offset in the generated source
+ * @param columnOffset The zero-indexed column number offset in the generated source
+ */
+ findEntry(lineOffset: number, columnOffset: number): SourceMapping;
+ /**
+ * Given a 1-indexed `lineNumber` and `columnNumber` from a call site in the generated source,
+ * find the corresponding call site location in the original source.
+ *
+ * If the `lineNumber` and `columnNumber` provided are not found in any source map,
+ * then an empty object is returned.
+ * @param lineNumber The 1-indexed line number of the call site in the generated source
+ * @param columnNumber The 1-indexed column number of the call site in the generated source
+ */
+ findOrigin(lineNumber: number, columnNumber: number): SourceOrigin | {};
+ }
+ interface ImportAssertions extends NodeJS.Dict<string> {
+ type?: string | undefined;
+ }
+ type ModuleFormat = "builtin" | "commonjs" | "json" | "module" | "wasm";
+ type ModuleSource = string | ArrayBuffer | NodeJS.TypedArray;
+ interface GlobalPreloadContext {
+ port: MessagePort;
+ }
+ /**
+ * Sometimes it might be necessary to run some code inside of the same global scope that the application runs in.
+ * This hook allows the return of a string that is run as a sloppy-mode script on startup.
+ *
+ * @param context Information to assist the preload code
+ * @return Code to run before application startup
+ */
+ type GlobalPreloadHook = (context: GlobalPreloadContext) => string;
+ interface ResolveHookContext {
+ /**
+ * Export conditions of the relevant `package.json`
+ */
+ conditions: string[];
+ /**
+ * An object whose key-value pairs represent the assertions for the module to import
+ */
+ importAssertions: ImportAssertions;
+ /**
+ * The module importing this one, or undefined if this is the Node.js entry point
+ */
+ parentURL: string | undefined;
+ }
+ interface ResolveFnOutput {
+ /**
+ * A hint to the load hook (it might be ignored)
+ */
+ format?: ModuleFormat | null | undefined;
+ /**
+ * The import assertions to use when caching the module (optional; if excluded the input will be used)
+ */
+ importAssertions?: ImportAssertions | undefined;
+ /**
+ * A signal that this hook intends to terminate the chain of `resolve` hooks.
+ * @default false
+ */
+ shortCircuit?: boolean | undefined;
+ /**
+ * The absolute URL to which this input resolves
+ */
+ url: string;
+ }
+ /**
+ * The `resolve` hook chain is responsible for resolving file URL for a given module specifier and parent URL, and optionally its format (such as `'module'`) as a hint to the `load` hook.
+ * If a format is specified, the load hook is ultimately responsible for providing the final `format` value (and it is free to ignore the hint provided by `resolve`);
+ * if `resolve` provides a format, a custom `load` hook is required even if only to pass the value to the Node.js default `load` hook.
+ *
+ * @param specifier The specified URL path of the module to be resolved
+ * @param context
+ * @param nextResolve The subsequent `resolve` hook in the chain, or the Node.js default `resolve` hook after the last user-supplied resolve hook
+ */
+ type ResolveHook = (
+ specifier: string,
+ context: ResolveHookContext,
+ nextResolve: (
+ specifier: string,
+ context?: ResolveHookContext,
+ ) => ResolveFnOutput | Promise<ResolveFnOutput>,
+ ) => ResolveFnOutput | Promise<ResolveFnOutput>;
+ interface LoadHookContext {
+ /**
+ * Export conditions of the relevant `package.json`
+ */
+ conditions: string[];
+ /**
+ * The format optionally supplied by the `resolve` hook chain
+ */
+ format: ModuleFormat;
+ /**
+ * An object whose key-value pairs represent the assertions for the module to import
+ */
+ importAssertions: ImportAssertions;
+ }
+ interface LoadFnOutput {
+ format: ModuleFormat;
+ /**
+ * A signal that this hook intends to terminate the chain of `resolve` hooks.
+ * @default false
+ */
+ shortCircuit?: boolean | undefined;
+ /**
+ * The source for Node.js to evaluate
+ */
+ source?: ModuleSource;
+ }
+ /**
+ * The `load` hook provides a way to define a custom method of determining how a URL should be interpreted, retrieved, and parsed.
+ * It is also in charge of validating the import assertion.
+ *
+ * @param url The URL/path of the module to be loaded
+ * @param context Metadata about the module
+ * @param nextLoad The subsequent `load` hook in the chain, or the Node.js default `load` hook after the last user-supplied `load` hook
+ */
+ type LoadHook = (
+ url: string,
+ context: LoadHookContext,
+ nextLoad: (url: string, context?: LoadHookContext) => LoadFnOutput | Promise<LoadFnOutput>,
+ ) => LoadFnOutput | Promise<LoadFnOutput>;
+ }
+ interface Module extends NodeModule {}
+ class Module {
+ static runMain(): void;
+ static wrap(code: string): string;
+ static createRequire(path: string | URL): NodeRequire;
+ static builtinModules: string[];
+ static isBuiltin(moduleName: string): boolean;
+ static Module: typeof Module;
+ constructor(id: string, parent?: Module);
+ }
+ global {
+ interface ImportMeta {
+ url: string;
+ /**
+ * @experimental
+ * This feature is only available with the `--experimental-import-meta-resolve`
+ * command flag enabled.
+ *
+ * Provides a module-relative resolution function scoped to each module, returning
+ * the URL string.
+ *
+ * @param specified The module specifier to resolve relative to `parent`.
+ * @param parent The absolute parent module URL to resolve from. If none
+ * is specified, the value of `import.meta.url` is used as the default.
+ */
+ resolve?(specified: string, parent?: string | URL): Promise<string>;
+ }
+ }
+ export = Module;
+}
+declare module "node:module" {
+ import module = require("module");
+ export = module;
+}
diff --git a/client/node_modules/@types/node/net.d.ts b/client/node_modules/@types/node/net.d.ts
new file mode 100644
index 0000000..782b891
--- /dev/null
+++ b/client/node_modules/@types/node/net.d.ts
@@ -0,0 +1,913 @@
+/**
+ * > Stability: 2 - Stable
+ *
+ * The `net` module provides an asynchronous network API for creating stream-based
+ * TCP or `IPC` servers ({@link createServer}) and clients
+ * ({@link createConnection}).
+ *
+ * It can be accessed using:
+ *
+ * ```js
+ * const net = require('net');
+ * ```
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/net.js)
+ */
+declare module "net" {
+ import * as stream from "node:stream";
+ import { Abortable, EventEmitter } from "node:events";
+ import * as dns from "node:dns";
+ type LookupFunction = (
+ hostname: string,
+ options: dns.LookupOneOptions,
+ callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void,
+ ) => void;
+ interface AddressInfo {
+ address: string;
+ family: string;
+ port: number;
+ }
+ interface SocketConstructorOpts {
+ fd?: number | undefined;
+ allowHalfOpen?: boolean | undefined;
+ readable?: boolean | undefined;
+ writable?: boolean | undefined;
+ signal?: AbortSignal;
+ }
+ interface OnReadOpts {
+ buffer: Uint8Array | (() => Uint8Array);
+ /**
+ * This function is called for every chunk of incoming data.
+ * Two arguments are passed to it: the number of bytes written to buffer and a reference to buffer.
+ * Return false from this function to implicitly pause() the socket.
+ */
+ callback(bytesWritten: number, buf: Uint8Array): boolean;
+ }
+ interface ConnectOpts {
+ /**
+ * If specified, incoming data is stored in a single buffer and passed to the supplied callback when data arrives on the socket.
+ * Note: this will cause the streaming functionality to not provide any data, however events like 'error', 'end', and 'close' will
+ * still be emitted as normal and methods like pause() and resume() will also behave as expected.
+ */
+ onread?: OnReadOpts | undefined;
+ }
+ interface TcpSocketConnectOpts extends ConnectOpts {
+ port: number;
+ host?: string | undefined;
+ localAddress?: string | undefined;
+ localPort?: number | undefined;
+ hints?: number | undefined;
+ family?: number | undefined;
+ lookup?: LookupFunction | undefined;
+ noDelay?: boolean | undefined;
+ keepAlive?: boolean | undefined;
+ keepAliveInitialDelay?: number | undefined;
+ /**
+ * @since v18.13.0
+ */
+ autoSelectFamily?: boolean | undefined;
+ /**
+ * @since v18.13.0
+ */
+ autoSelectFamilyAttemptTimeout?: number | undefined;
+ }
+ interface IpcSocketConnectOpts extends ConnectOpts {
+ path: string;
+ }
+ type SocketConnectOpts = TcpSocketConnectOpts | IpcSocketConnectOpts;
+ type SocketReadyState = "opening" | "open" | "readOnly" | "writeOnly" | "closed";
+ /**
+ * This class is an abstraction of a TCP socket or a streaming `IPC` endpoint
+ * (uses named pipes on Windows, and Unix domain sockets otherwise). It is also
+ * an `EventEmitter`.
+ *
+ * A `net.Socket` can be created by the user and used directly to interact with
+ * a server. For example, it is returned by {@link createConnection},
+ * so the user can use it to talk to the server.
+ *
+ * It can also be created by Node.js and passed to the user when a connection
+ * is received. For example, it is passed to the listeners of a `'connection'` event emitted on a {@link Server}, so the user can use
+ * it to interact with the client.
+ * @since v0.3.4
+ */
+ class Socket extends stream.Duplex {
+ constructor(options?: SocketConstructorOpts);
+ /**
+ * Destroys the socket after all data is written. If the `finish` event was already emitted the socket is destroyed immediately.
+ * If the socket is still writable it implicitly calls `socket.end()`.
+ * @since v0.3.4
+ */
+ destroySoon(): void;
+ /**
+ * Sends data on the socket. The second parameter specifies the encoding in the
+ * case of a string. It defaults to UTF8 encoding.
+ *
+ * Returns `true` if the entire data was flushed successfully to the kernel
+ * buffer. Returns `false` if all or part of the data was queued in user memory.`'drain'` will be emitted when the buffer is again free.
+ *
+ * The optional `callback` parameter will be executed when the data is finally
+ * written out, which may not be immediately.
+ *
+ * See `Writable` stream `write()` method for more
+ * information.
+ * @since v0.1.90
+ * @param [encoding='utf8'] Only used when data is `string`.
+ */
+ write(buffer: Uint8Array | string, cb?: (err?: Error) => void): boolean;
+ write(str: Uint8Array | string, encoding?: BufferEncoding, cb?: (err?: Error) => void): boolean;
+ /**
+ * Initiate a connection on a given socket.
+ *
+ * Possible signatures:
+ *
+ * * `socket.connect(options[, connectListener])`
+ * * `socket.connect(path[, connectListener])` for `IPC` connections.
+ * * `socket.connect(port[, host][, connectListener])` for TCP connections.
+ * * Returns: `net.Socket` The socket itself.
+ *
+ * This function is asynchronous. When the connection is established, the `'connect'` event will be emitted. If there is a problem connecting,
+ * instead of a `'connect'` event, an `'error'` event will be emitted with
+ * the error passed to the `'error'` listener.
+ * The last parameter `connectListener`, if supplied, will be added as a listener
+ * for the `'connect'` event **once**.
+ *
+ * This function should only be used for reconnecting a socket after`'close'` has been emitted or otherwise it may lead to undefined
+ * behavior.
+ */
+ connect(options: SocketConnectOpts, connectionListener?: () => void): this;
+ connect(port: number, host: string, connectionListener?: () => void): this;
+ connect(port: number, connectionListener?: () => void): this;
+ connect(path: string, connectionListener?: () => void): this;
+ /**
+ * Set the encoding for the socket as a `Readable Stream`. See `readable.setEncoding()` for more information.
+ * @since v0.1.90
+ * @return The socket itself.
+ */
+ setEncoding(encoding?: BufferEncoding): this;
+ /**
+ * Pauses the reading of data. That is, `'data'` events will not be emitted.
+ * Useful to throttle back an upload.
+ * @return The socket itself.
+ */
+ pause(): this;
+ /**
+ * Close the TCP connection by sending an RST packet and destroy the stream.
+ * If this TCP socket is in connecting status, it will send an RST packet
+ * and destroy this TCP socket once it is connected. Otherwise, it will call
+ * `socket.destroy` with an `ERR_SOCKET_CLOSED` Error. If this is not a TCP socket
+ * (for example, a pipe), calling this method will immediately throw
+ * an `ERR_INVALID_HANDLE_TYPE` Error.
+ * @since v18.3.0
+ * @return The socket itself.
+ */
+ resetAndDestroy(): this;
+ /**
+ * Resumes reading after a call to `socket.pause()`.
+ * @return The socket itself.
+ */
+ resume(): this;
+ /**
+ * Sets the socket to timeout after `timeout` milliseconds of inactivity on
+ * the socket. By default `net.Socket` do not have a timeout.
+ *
+ * When an idle timeout is triggered the socket will receive a `'timeout'` event but the connection will not be severed. The user must manually call `socket.end()` or `socket.destroy()` to
+ * end the connection.
+ *
+ * ```js
+ * socket.setTimeout(3000);
+ * socket.on('timeout', () => {
+ * console.log('socket timeout');
+ * socket.end();
+ * });
+ * ```
+ *
+ * If `timeout` is 0, then the existing idle timeout is disabled.
+ *
+ * The optional `callback` parameter will be added as a one-time listener for the `'timeout'` event.
+ * @since v0.1.90
+ * @return The socket itself.
+ */
+ setTimeout(timeout: number, callback?: () => void): this;
+ /**
+ * Enable/disable the use of Nagle's algorithm.
+ *
+ * When a TCP connection is created, it will have Nagle's algorithm enabled.
+ *
+ * Nagle's algorithm delays data before it is sent via the network. It attempts
+ * to optimize throughput at the expense of latency.
+ *
+ * Passing `true` for `noDelay` or not passing an argument will disable Nagle's
+ * algorithm for the socket. Passing `false` for `noDelay` will enable Nagle's
+ * algorithm.
+ * @since v0.1.90
+ * @param [noDelay=true]
+ * @return The socket itself.
+ */
+ setNoDelay(noDelay?: boolean): this;
+ /**
+ * Enable/disable keep-alive functionality, and optionally set the initial
+ * delay before the first keepalive probe is sent on an idle socket.
+ *
+ * Set `initialDelay` (in milliseconds) to set the delay between the last
+ * data packet received and the first keepalive probe. Setting `0` for`initialDelay` will leave the value unchanged from the default
+ * (or previous) setting.
+ *
+ * Enabling the keep-alive functionality will set the following socket options:
+ *
+ * * `SO_KEEPALIVE=1`
+ * * `TCP_KEEPIDLE=initialDelay`
+ * * `TCP_KEEPCNT=10`
+ * * `TCP_KEEPINTVL=1`
+ * @since v0.1.92
+ * @param [enable=false]
+ * @param [initialDelay=0]
+ * @return The socket itself.
+ */
+ setKeepAlive(enable?: boolean, initialDelay?: number): this;
+ /**
+ * Returns the bound `address`, the address `family` name and `port` of the
+ * socket as reported by the operating system:`{ port: 12346, family: 'IPv4', address: '127.0.0.1' }`
+ * @since v0.1.90
+ */
+ address(): AddressInfo | {};
+ /**
+ * Calling `unref()` on a socket will allow the program to exit if this is the only
+ * active socket in the event system. If the socket is already `unref`ed calling`unref()` again will have no effect.
+ * @since v0.9.1
+ * @return The socket itself.
+ */
+ unref(): this;
+ /**
+ * Opposite of `unref()`, calling `ref()` on a previously `unref`ed socket will _not_ let the program exit if it's the only socket left (the default behavior).
+ * If the socket is `ref`ed calling `ref` again will have no effect.
+ * @since v0.9.1
+ * @return The socket itself.
+ */
+ ref(): this;
+ /**
+ * This property shows the number of characters buffered for writing. The buffer
+ * may contain strings whose length after encoding is not yet known. So this number
+ * is only an approximation of the number of bytes in the buffer.
+ *
+ * `net.Socket` has the property that `socket.write()` always works. This is to
+ * help users get up and running quickly. The computer cannot always keep up
+ * with the amount of data that is written to a socket. The network connection
+ * simply might be too slow. Node.js will internally queue up the data written to a
+ * socket and send it out over the wire when it is possible.
+ *
+ * The consequence of this internal buffering is that memory may grow.
+ * Users who experience large or growing `bufferSize` should attempt to
+ * "throttle" the data flows in their program with `socket.pause()` and `socket.resume()`.
+ * @since v0.3.8
+ * @deprecated Since v14.6.0 - Use `writableLength` instead.
+ */
+ readonly bufferSize: number;
+ /**
+ * The amount of received bytes.
+ * @since v0.5.3
+ */
+ readonly bytesRead: number;
+ /**
+ * The amount of bytes sent.
+ * @since v0.5.3
+ */
+ readonly bytesWritten: number;
+ /**
+ * If `true`,`socket.connect(options[, connectListener])` was
+ * called and has not yet finished. It will stay `true` until the socket becomes
+ * connected, then it is set to `false` and the `'connect'` event is emitted. Note
+ * that the `socket.connect(options[, connectListener])` callback is a listener for the `'connect'` event.
+ * @since v6.1.0
+ */
+ readonly connecting: boolean;
+ /**
+ * This is `true` if the socket is not connected yet, either because `.connect()`
+ * has not yet been called or because it is still in the process of connecting (see `socket.connecting`).
+ * @since v10.16.0
+ */
+ readonly pending: boolean;
+ /**
+ * See `writable.destroyed` for further details.
+ */
+ readonly destroyed: boolean;
+ /**
+ * The string representation of the local IP address the remote client is
+ * connecting on. For example, in a server listening on `'0.0.0.0'`, if a client
+ * connects on `'192.168.1.1'`, the value of `socket.localAddress` would be`'192.168.1.1'`.
+ * @since v0.9.6
+ */
+ readonly localAddress?: string;
+ /**
+ * The numeric representation of the local port. For example, `80` or `21`.
+ * @since v0.9.6
+ */
+ readonly localPort?: number;
+ /**
+ * The string representation of the local IP family. `'IPv4'` or `'IPv6'`.
+ * @since v18.8.0
+ */
+ readonly localFamily?: string;
+ /**
+ * This property represents the state of the connection as a string.
+ * @see {https://nodejs.org/api/net.html#socketreadystate}
+ * @since v0.5.0
+ */
+ readonly readyState: SocketReadyState;
+ /**
+ * The string representation of the remote IP address. For example,`'74.125.127.100'` or `'2001:4860:a005::68'`. Value may be `undefined` if
+ * the socket is destroyed (for example, if the client disconnected).
+ * @since v0.5.10
+ */
+ readonly remoteAddress?: string | undefined;
+ /**
+ * The string representation of the remote IP family. `'IPv4'` or `'IPv6'`.
+ * @since v0.11.14
+ */
+ readonly remoteFamily?: string | undefined;
+ /**
+ * The numeric representation of the remote port. For example, `80` or `21`.
+ * @since v0.5.10
+ */
+ readonly remotePort?: number | undefined;
+ /**
+ * The socket timeout in milliseconds as set by socket.setTimeout(). It is undefined if a timeout has not been set.
+ * @since v10.7.0
+ */
+ readonly timeout?: number | undefined;
+ /**
+ * Half-closes the socket. i.e., it sends a FIN packet. It is possible the
+ * server will still send some data.
+ *
+ * See `writable.end()` for further details.
+ * @since v0.1.90
+ * @param [encoding='utf8'] Only used when data is `string`.
+ * @param callback Optional callback for when the socket is finished.
+ * @return The socket itself.
+ */
+ end(callback?: () => void): this;
+ end(buffer: Uint8Array | string, callback?: () => void): this;
+ end(str: Uint8Array | string, encoding?: BufferEncoding, callback?: () => void): this;
+ /**
+ * events.EventEmitter
+ * 1. close
+ * 2. connect
+ * 3. data
+ * 4. drain
+ * 5. end
+ * 6. error
+ * 7. lookup
+ * 8. ready
+ * 9. timeout
+ */
+ addListener(event: string, listener: (...args: any[]) => void): this;
+ addListener(event: "close", listener: (hadError: boolean) => void): this;
+ addListener(event: "connect", listener: () => void): this;
+ addListener(event: "data", listener: (data: Buffer) => void): this;
+ addListener(event: "drain", listener: () => void): this;
+ addListener(event: "end", listener: () => void): this;
+ addListener(event: "error", listener: (err: Error) => void): this;
+ addListener(
+ event: "lookup",
+ listener: (err: Error, address: string, family: string | number, host: string) => void,
+ ): this;
+ addListener(event: "ready", listener: () => void): this;
+ addListener(event: "timeout", listener: () => void): this;
+ emit(event: string | symbol, ...args: any[]): boolean;
+ emit(event: "close", hadError: boolean): boolean;
+ emit(event: "connect"): boolean;
+ emit(event: "data", data: Buffer): boolean;
+ emit(event: "drain"): boolean;
+ emit(event: "end"): boolean;
+ emit(event: "error", err: Error): boolean;
+ emit(event: "lookup", err: Error, address: string, family: string | number, host: string): boolean;
+ emit(event: "ready"): boolean;
+ emit(event: "timeout"): boolean;
+ on(event: string, listener: (...args: any[]) => void): this;
+ on(event: "close", listener: (hadError: boolean) => void): this;
+ on(event: "connect", listener: () => void): this;
+ on(event: "data", listener: (data: Buffer) => void): this;
+ on(event: "drain", listener: () => void): this;
+ on(event: "end", listener: () => void): this;
+ on(event: "error", listener: (err: Error) => void): this;
+ on(
+ event: "lookup",
+ listener: (err: Error, address: string, family: string | number, host: string) => void,
+ ): this;
+ on(event: "ready", listener: () => void): this;
+ on(event: "timeout", listener: () => void): this;
+ once(event: string, listener: (...args: any[]) => void): this;
+ once(event: "close", listener: (hadError: boolean) => void): this;
+ once(event: "connect", listener: () => void): this;
+ once(event: "data", listener: (data: Buffer) => void): this;
+ once(event: "drain", listener: () => void): this;
+ once(event: "end", listener: () => void): this;
+ once(event: "error", listener: (err: Error) => void): this;
+ once(
+ event: "lookup",
+ listener: (err: Error, address: string, family: string | number, host: string) => void,
+ ): this;
+ once(event: "ready", listener: () => void): this;
+ once(event: "timeout", listener: () => void): this;
+ prependListener(event: string, listener: (...args: any[]) => void): this;
+ prependListener(event: "close", listener: (hadError: boolean) => void): this;
+ prependListener(event: "connect", listener: () => void): this;
+ prependListener(event: "data", listener: (data: Buffer) => void): this;
+ prependListener(event: "drain", listener: () => void): this;
+ prependListener(event: "end", listener: () => void): this;
+ prependListener(event: "error", listener: (err: Error) => void): this;
+ prependListener(
+ event: "lookup",
+ listener: (err: Error, address: string, family: string | number, host: string) => void,
+ ): this;
+ prependListener(event: "ready", listener: () => void): this;
+ prependListener(event: "timeout", listener: () => void): this;
+ prependOnceListener(event: string, listener: (...args: any[]) => void): this;
+ prependOnceListener(event: "close", listener: (hadError: boolean) => void): this;
+ prependOnceListener(event: "connect", listener: () => void): this;
+ prependOnceListener(event: "data", listener: (data: Buffer) => void): this;
+ prependOnceListener(event: "drain", listener: () => void): this;
+ prependOnceListener(event: "end", listener: () => void): this;
+ prependOnceListener(event: "error", listener: (err: Error) => void): this;
+ prependOnceListener(
+ event: "lookup",
+ listener: (err: Error, address: string, family: string | number, host: string) => void,
+ ): this;
+ prependOnceListener(event: "ready", listener: () => void): this;
+ prependOnceListener(event: "timeout", listener: () => void): this;
+ }
+ interface ListenOptions extends Abortable {
+ port?: number | undefined;
+ host?: string | undefined;
+ backlog?: number | undefined;
+ path?: string | undefined;
+ exclusive?: boolean | undefined;
+ readableAll?: boolean | undefined;
+ writableAll?: boolean | undefined;
+ /**
+ * @default false
+ */
+ ipv6Only?: boolean | undefined;
+ }
+ interface ServerOpts {
+ /**
+ * Indicates whether half-opened TCP connections are allowed.
+ * @default false
+ */
+ allowHalfOpen?: boolean | undefined;
+ /**
+ * Indicates whether the socket should be paused on incoming connections.
+ * @default false
+ */
+ pauseOnConnect?: boolean | undefined;
+ /**
+ * If set to `true`, it disables the use of Nagle's algorithm immediately after a new incoming connection is received.
+ * @default false
+ * @since v16.5.0
+ */
+ noDelay?: boolean | undefined;
+ /**
+ * If set to `true`, it enables keep-alive functionality on the socket immediately after a new incoming connection is received,
+ * similarly on what is done in `socket.setKeepAlive([enable][, initialDelay])`.
+ * @default false
+ * @since v16.5.0
+ */
+ keepAlive?: boolean | undefined;
+ /**
+ * If set to a positive number, it sets the initial delay before the first keepalive probe is sent on an idle socket.
+ * @default 0
+ * @since v16.5.0
+ */
+ keepAliveInitialDelay?: number | undefined;
+ }
+ interface DropArgument {
+ localAddress?: string;
+ localPort?: number;
+ localFamily?: string;
+ remoteAddress?: string;
+ remotePort?: number;
+ remoteFamily?: string;
+ }
+ /**
+ * This class is used to create a TCP or `IPC` server.
+ * @since v0.1.90
+ */
+ class Server extends EventEmitter {
+ constructor(connectionListener?: (socket: Socket) => void);
+ constructor(options?: ServerOpts, connectionListener?: (socket: Socket) => void);
+ /**
+ * Start a server listening for connections. A `net.Server` can be a TCP or
+ * an `IPC` server depending on what it listens to.
+ *
+ * Possible signatures:
+ *
+ * * `server.listen(handle[, backlog][, callback])`
+ * * `server.listen(options[, callback])`
+ * * `server.listen(path[, backlog][, callback])` for `IPC` servers
+ * * `server.listen([port[, host[, backlog]]][, callback])` for TCP servers
+ *
+ * This function is asynchronous. When the server starts listening, the `'listening'` event will be emitted. The last parameter `callback`will be added as a listener for the `'listening'`
+ * event.
+ *
+ * All `listen()` methods can take a `backlog` parameter to specify the maximum
+ * length of the queue of pending connections. The actual length will be determined
+ * by the OS through sysctl settings such as `tcp_max_syn_backlog` and `somaxconn`on Linux. The default value of this parameter is 511 (not 512).
+ *
+ * All {@link Socket} are set to `SO_REUSEADDR` (see [`socket(7)`](https://man7.org/linux/man-pages/man7/socket.7.html) for
+ * details).
+ *
+ * The `server.listen()` method can be called again if and only if there was an
+ * error during the first `server.listen()` call or `server.close()` has been
+ * called. Otherwise, an `ERR_SERVER_ALREADY_LISTEN` error will be thrown.
+ *
+ * One of the most common errors raised when listening is `EADDRINUSE`.
+ * This happens when another server is already listening on the requested`port`/`path`/`handle`. One way to handle this would be to retry
+ * after a certain amount of time:
+ *
+ * ```js
+ * server.on('error', (e) => {
+ * if (e.code === 'EADDRINUSE') {
+ * console.log('Address in use, retrying...');
+ * setTimeout(() => {
+ * server.close();
+ * server.listen(PORT, HOST);
+ * }, 1000);
+ * }
+ * });
+ * ```
+ */
+ listen(port?: number, hostname?: string, backlog?: number, listeningListener?: () => void): this;
+ listen(port?: number, hostname?: string, listeningListener?: () => void): this;
+ listen(port?: number, backlog?: number, listeningListener?: () => void): this;
+ listen(port?: number, listeningListener?: () => void): this;
+ listen(path: string, backlog?: number, listeningListener?: () => void): this;
+ listen(path: string, listeningListener?: () => void): this;
+ listen(options: ListenOptions, listeningListener?: () => void): this;
+ listen(handle: any, backlog?: number, listeningListener?: () => void): this;
+ listen(handle: any, listeningListener?: () => void): this;
+ /**
+ * Stops the server from accepting new connections and keeps existing
+ * connections. This function is asynchronous, the server is finally closed
+ * when all connections are ended and the server emits a `'close'` event.
+ * The optional `callback` will be called once the `'close'` event occurs. Unlike
+ * that event, it will be called with an `Error` as its only argument if the server
+ * was not open when it was closed.
+ * @since v0.1.90
+ * @param callback Called when the server is closed.
+ */
+ close(callback?: (err?: Error) => void): this;
+ /**
+ * Returns the bound `address`, the address `family` name, and `port` of the server
+ * as reported by the operating system if listening on an IP socket
+ * (useful to find which port was assigned when getting an OS-assigned address):`{ port: 12346, family: 'IPv4', address: '127.0.0.1' }`.
+ *
+ * For a server listening on a pipe or Unix domain socket, the name is returned
+ * as a string.
+ *
+ * ```js
+ * const server = net.createServer((socket) => {
+ * socket.end('goodbye\n');
+ * }).on('error', (err) => {
+ * // Handle errors here.
+ * throw err;
+ * });
+ *
+ * // Grab an arbitrary unused port.
+ * server.listen(() => {
+ * console.log('opened server on', server.address());
+ * });
+ * ```
+ *
+ * `server.address()` returns `null` before the `'listening'` event has been
+ * emitted or after calling `server.close()`.
+ * @since v0.1.90
+ */
+ address(): AddressInfo | string | null;
+ /**
+ * Asynchronously get the number of concurrent connections on the server. Works
+ * when sockets were sent to forks.
+ *
+ * Callback should take two arguments `err` and `count`.
+ * @since v0.9.7
+ */
+ getConnections(cb: (error: Error | null, count: number) => void): void;
+ /**
+ * Opposite of `unref()`, calling `ref()` on a previously `unref`ed server will _not_ let the program exit if it's the only server left (the default behavior).
+ * If the server is `ref`ed calling `ref()` again will have no effect.
+ * @since v0.9.1
+ */
+ ref(): this;
+ /**
+ * Calling `unref()` on a server will allow the program to exit if this is the only
+ * active server in the event system. If the server is already `unref`ed calling`unref()` again will have no effect.
+ * @since v0.9.1
+ */
+ unref(): this;
+ /**
+ * Set this property to reject connections when the server's connection count gets
+ * high.
+ *
+ * It is not recommended to use this option once a socket has been sent to a child
+ * with `child_process.fork()`.
+ * @since v0.2.0
+ */
+ maxConnections: number;
+ connections: number;
+ /**
+ * Indicates whether or not the server is listening for connections.
+ * @since v5.7.0
+ */
+ listening: boolean;
+ /**
+ * events.EventEmitter
+ * 1. close
+ * 2. connection
+ * 3. error
+ * 4. listening
+ * 5. drop
+ */
+ addListener(event: string, listener: (...args: any[]) => void): this;
+ addListener(event: "close", listener: () => void): this;
+ addListener(event: "connection", listener: (socket: Socket) => void): this;
+ addListener(event: "error", listener: (err: Error) => void): this;
+ addListener(event: "listening", listener: () => void): this;
+ addListener(event: "drop", listener: (data?: DropArgument) => void): this;
+ emit(event: string | symbol, ...args: any[]): boolean;
+ emit(event: "close"): boolean;
+ emit(event: "connection", socket: Socket): boolean;
+ emit(event: "error", err: Error): boolean;
+ emit(event: "listening"): boolean;
+ emit(event: "drop", data?: DropArgument): boolean;
+ on(event: string, listener: (...args: any[]) => void): this;
+ on(event: "close", listener: () => void): this;
+ on(event: "connection", listener: (socket: Socket) => void): this;
+ on(event: "error", listener: (err: Error) => void): this;
+ on(event: "listening", listener: () => void): this;
+ on(event: "drop", listener: (data?: DropArgument) => void): this;
+ once(event: string, listener: (...args: any[]) => void): this;
+ once(event: "close", listener: () => void): this;
+ once(event: "connection", listener: (socket: Socket) => void): this;
+ once(event: "error", listener: (err: Error) => void): this;
+ once(event: "listening", listener: () => void): this;
+ once(event: "drop", listener: (data?: DropArgument) => void): this;
+ prependListener(event: string, listener: (...args: any[]) => void): this;
+ prependListener(event: "close", listener: () => void): this;
+ prependListener(event: "connection", listener: (socket: Socket) => void): this;
+ prependListener(event: "error", listener: (err: Error) => void): this;
+ prependListener(event: "listening", listener: () => void): this;
+ prependListener(event: "drop", listener: (data?: DropArgument) => void): this;
+ prependOnceListener(event: string, listener: (...args: any[]) => void): this;
+ prependOnceListener(event: "close", listener: () => void): this;
+ prependOnceListener(event: "connection", listener: (socket: Socket) => void): this;
+ prependOnceListener(event: "error", listener: (err: Error) => void): this;
+ prependOnceListener(event: "listening", listener: () => void): this;
+ prependOnceListener(event: "drop", listener: (data?: DropArgument) => void): this;
+ /**
+ * Calls {@link Server.close()} and returns a promise that fulfills when the server has closed.
+ * @since v18.18.0
+ */
+ [Symbol.asyncDispose](): Promise<void>;
+ }
+ type IPVersion = "ipv4" | "ipv6";
+ /**
+ * The `BlockList` object can be used with some network APIs to specify rules for
+ * disabling inbound or outbound access to specific IP addresses, IP ranges, or
+ * IP subnets.
+ * @since v15.0.0, v14.18.0
+ */
+ class BlockList {
+ /**
+ * Adds a rule to block the given IP address.
+ * @since v15.0.0, v14.18.0
+ * @param address An IPv4 or IPv6 address.
+ * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`.
+ */
+ addAddress(address: string, type?: IPVersion): void;
+ addAddress(address: SocketAddress): void;
+ /**
+ * Adds a rule to block a range of IP addresses from `start` (inclusive) to`end` (inclusive).
+ * @since v15.0.0, v14.18.0
+ * @param start The starting IPv4 or IPv6 address in the range.
+ * @param end The ending IPv4 or IPv6 address in the range.
+ * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`.
+ */
+ addRange(start: string, end: string, type?: IPVersion): void;
+ addRange(start: SocketAddress, end: SocketAddress): void;
+ /**
+ * Adds a rule to block a range of IP addresses specified as a subnet mask.
+ * @since v15.0.0, v14.18.0
+ * @param net The network IPv4 or IPv6 address.
+ * @param prefix The number of CIDR prefix bits. For IPv4, this must be a value between `0` and `32`. For IPv6, this must be between `0` and `128`.
+ * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`.
+ */
+ addSubnet(net: SocketAddress, prefix: number): void;
+ addSubnet(net: string, prefix: number, type?: IPVersion): void;
+ /**
+ * Returns `true` if the given IP address matches any of the rules added to the`BlockList`.
+ *
+ * ```js
+ * const blockList = new net.BlockList();
+ * blockList.addAddress('123.123.123.123');
+ * blockList.addRange('10.0.0.1', '10.0.0.10');
+ * blockList.addSubnet('8592:757c:efae:4e45::', 64, 'ipv6');
+ *
+ * console.log(blockList.check('123.123.123.123')); // Prints: true
+ * console.log(blockList.check('10.0.0.3')); // Prints: true
+ * console.log(blockList.check('222.111.111.222')); // Prints: false
+ *
+ * // IPv6 notation for IPv4 addresses works:
+ * console.log(blockList.check('::ffff:7b7b:7b7b', 'ipv6')); // Prints: true
+ * console.log(blockList.check('::ffff:123.123.123.123', 'ipv6')); // Prints: true
+ * ```
+ * @since v15.0.0, v14.18.0
+ * @param address The IP address to check
+ * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`.
+ */
+ check(address: SocketAddress): boolean;
+ check(address: string, type?: IPVersion): boolean;
+ }
+ interface TcpNetConnectOpts extends TcpSocketConnectOpts, SocketConstructorOpts {
+ timeout?: number | undefined;
+ }
+ interface IpcNetConnectOpts extends IpcSocketConnectOpts, SocketConstructorOpts {
+ timeout?: number | undefined;
+ }
+ type NetConnectOpts = TcpNetConnectOpts | IpcNetConnectOpts;
+ /**
+ * Creates a new TCP or `IPC` server.
+ *
+ * If `allowHalfOpen` is set to `true`, when the other end of the socket
+ * signals the end of transmission, the server will only send back the end of
+ * transmission when `socket.end()` is explicitly called. For example, in the
+ * context of TCP, when a FIN packed is received, a FIN packed is sent
+ * back only when `socket.end()` is explicitly called. Until then the
+ * connection is half-closed (non-readable but still writable). See `'end'` event and [RFC 1122](https://tools.ietf.org/html/rfc1122) (section 4.2.2.13) for more information.
+ *
+ * If `pauseOnConnect` is set to `true`, then the socket associated with each
+ * incoming connection will be paused, and no data will be read from its handle.
+ * This allows connections to be passed between processes without any data being
+ * read by the original process. To begin reading data from a paused socket, call `socket.resume()`.
+ *
+ * The server can be a TCP server or an `IPC` server, depending on what it `listen()` to.
+ *
+ * Here is an example of a TCP echo server which listens for connections
+ * on port 8124:
+ *
+ * ```js
+ * const net = require('net');
+ * const server = net.createServer((c) => {
+ * // 'connection' listener.
+ * console.log('client connected');
+ * c.on('end', () => {
+ * console.log('client disconnected');
+ * });
+ * c.write('hello\r\n');
+ * c.pipe(c);
+ * });
+ * server.on('error', (err) => {
+ * throw err;
+ * });
+ * server.listen(8124, () => {
+ * console.log('server bound');
+ * });
+ * ```
+ *
+ * Test this by using `telnet`:
+ *
+ * ```console
+ * $ telnet localhost 8124
+ * ```
+ *
+ * To listen on the socket `/tmp/echo.sock`:
+ *
+ * ```js
+ * server.listen('/tmp/echo.sock', () => {
+ * console.log('server bound');
+ * });
+ * ```
+ *
+ * Use `nc` to connect to a Unix domain socket server:
+ *
+ * ```console
+ * $ nc -U /tmp/echo.sock
+ * ```
+ * @since v0.5.0
+ * @param connectionListener Automatically set as a listener for the {@link 'connection'} event.
+ */
+ function createServer(connectionListener?: (socket: Socket) => void): Server;
+ function createServer(options?: ServerOpts, connectionListener?: (socket: Socket) => void): Server;
+ /**
+ * Aliases to {@link createConnection}.
+ *
+ * Possible signatures:
+ *
+ * * {@link connect}
+ * * {@link connect} for `IPC` connections.
+ * * {@link connect} for TCP connections.
+ */
+ function connect(options: NetConnectOpts, connectionListener?: () => void): Socket;
+ function connect(port: number, host?: string, connectionListener?: () => void): Socket;
+ function connect(path: string, connectionListener?: () => void): Socket;
+ /**
+ * A factory function, which creates a new {@link Socket},
+ * immediately initiates connection with `socket.connect()`,
+ * then returns the `net.Socket` that starts the connection.
+ *
+ * When the connection is established, a `'connect'` event will be emitted
+ * on the returned socket. The last parameter `connectListener`, if supplied,
+ * will be added as a listener for the `'connect'` event **once**.
+ *
+ * Possible signatures:
+ *
+ * * {@link createConnection}
+ * * {@link createConnection} for `IPC` connections.
+ * * {@link createConnection} for TCP connections.
+ *
+ * The {@link connect} function is an alias to this function.
+ */
+ function createConnection(options: NetConnectOpts, connectionListener?: () => void): Socket;
+ function createConnection(port: number, host?: string, connectionListener?: () => void): Socket;
+ function createConnection(path: string, connectionListener?: () => void): Socket;
+ /**
+ * Returns `6` if `input` is an IPv6 address. Returns `4` if `input` is an IPv4
+ * address in [dot-decimal notation](https://en.wikipedia.org/wiki/Dot-decimal_notation) with no leading zeroes. Otherwise, returns`0`.
+ *
+ * ```js
+ * net.isIP('::1'); // returns 6
+ * net.isIP('127.0.0.1'); // returns 4
+ * net.isIP('127.000.000.001'); // returns 0
+ * net.isIP('127.0.0.1/24'); // returns 0
+ * net.isIP('fhqwhgads'); // returns 0
+ * ```
+ * @since v0.3.0
+ */
+ function isIP(input: string): number;
+ /**
+ * Returns `true` if `input` is an IPv4 address in [dot-decimal notation](https://en.wikipedia.org/wiki/Dot-decimal_notation) with no
+ * leading zeroes. Otherwise, returns `false`.
+ *
+ * ```js
+ * net.isIPv4('127.0.0.1'); // returns true
+ * net.isIPv4('127.000.000.001'); // returns false
+ * net.isIPv4('127.0.0.1/24'); // returns false
+ * net.isIPv4('fhqwhgads'); // returns false
+ * ```
+ * @since v0.3.0
+ */
+ function isIPv4(input: string): boolean;
+ /**
+ * Returns `true` if `input` is an IPv6 address. Otherwise, returns `false`.
+ *
+ * ```js
+ * net.isIPv6('::1'); // returns true
+ * net.isIPv6('fhqwhgads'); // returns false
+ * ```
+ * @since v0.3.0
+ */
+ function isIPv6(input: string): boolean;
+ interface SocketAddressInitOptions {
+ /**
+ * The network address as either an IPv4 or IPv6 string.
+ * @default 127.0.0.1
+ */
+ address?: string | undefined;
+ /**
+ * @default `'ipv4'`
+ */
+ family?: IPVersion | undefined;
+ /**
+ * An IPv6 flow-label used only if `family` is `'ipv6'`.
+ * @default 0
+ */
+ flowlabel?: number | undefined;
+ /**
+ * An IP port.
+ * @default 0
+ */
+ port?: number | undefined;
+ }
+ /**
+ * @since v15.14.0, v14.18.0
+ */
+ class SocketAddress {
+ constructor(options: SocketAddressInitOptions);
+ /**
+ * @since v15.14.0, v14.18.0
+ */
+ readonly address: string;
+ /**
+ * Either \`'ipv4'\` or \`'ipv6'\`.
+ * @since v15.14.0, v14.18.0
+ */
+ readonly family: IPVersion;
+ /**
+ * @since v15.14.0, v14.18.0
+ */
+ readonly port: number;
+ /**
+ * @since v15.14.0, v14.18.0
+ */
+ readonly flowlabel: number;
+ }
+}
+declare module "node:net" {
+ export * from "net";
+}
diff --git a/client/node_modules/@types/node/os.d.ts b/client/node_modules/@types/node/os.d.ts
new file mode 100644
index 0000000..00d0373
--- /dev/null
+++ b/client/node_modules/@types/node/os.d.ts
@@ -0,0 +1,473 @@
+/**
+ * The `os` module provides operating system-related utility methods and
+ * properties. It can be accessed using:
+ *
+ * ```js
+ * const os = require('os');
+ * ```
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/os.js)
+ */
+declare module "os" {
+ interface CpuInfo {
+ model: string;
+ speed: number;
+ times: {
+ user: number;
+ nice: number;
+ sys: number;
+ idle: number;
+ irq: number;
+ };
+ }
+ interface NetworkInterfaceBase {
+ address: string;
+ netmask: string;
+ mac: string;
+ internal: boolean;
+ cidr: string | null;
+ }
+ interface NetworkInterfaceInfoIPv4 extends NetworkInterfaceBase {
+ family: "IPv4";
+ scopeid?: undefined;
+ }
+ interface NetworkInterfaceInfoIPv6 extends NetworkInterfaceBase {
+ family: "IPv6";
+ scopeid: number;
+ }
+ interface UserInfo<T> {
+ username: T;
+ uid: number;
+ gid: number;
+ shell: T | null;
+ homedir: T;
+ }
+ type NetworkInterfaceInfo = NetworkInterfaceInfoIPv4 | NetworkInterfaceInfoIPv6;
+ /**
+ * Returns the host name of the operating system as a string.
+ * @since v0.3.3
+ */
+ function hostname(): string;
+ /**
+ * Returns an array containing the 1, 5, and 15 minute load averages.
+ *
+ * The load average is a measure of system activity calculated by the operating
+ * system and expressed as a fractional number.
+ *
+ * The load average is a Unix-specific concept. On Windows, the return value is
+ * always `[0, 0, 0]`.
+ * @since v0.3.3
+ */
+ function loadavg(): number[];
+ /**
+ * Returns the system uptime in number of seconds.
+ * @since v0.3.3
+ */
+ function uptime(): number;
+ /**
+ * Returns the amount of free system memory in bytes as an integer.
+ * @since v0.3.3
+ */
+ function freemem(): number;
+ /**
+ * Returns the total amount of system memory in bytes as an integer.
+ * @since v0.3.3
+ */
+ function totalmem(): number;
+ /**
+ * Returns an array of objects containing information about each logical CPU core.
+ *
+ * The properties included on each object include:
+ *
+ * ```js
+ * [
+ * {
+ * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',
+ * speed: 2926,
+ * times: {
+ * user: 252020,
+ * nice: 0,
+ * sys: 30340,
+ * idle: 1070356870,
+ * irq: 0
+ * }
+ * },
+ * {
+ * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',
+ * speed: 2926,
+ * times: {
+ * user: 306960,
+ * nice: 0,
+ * sys: 26980,
+ * idle: 1071569080,
+ * irq: 0
+ * }
+ * },
+ * {
+ * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',
+ * speed: 2926,
+ * times: {
+ * user: 248450,
+ * nice: 0,
+ * sys: 21750,
+ * idle: 1070919370,
+ * irq: 0
+ * }
+ * },
+ * {
+ * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',
+ * speed: 2926,
+ * times: {
+ * user: 256880,
+ * nice: 0,
+ * sys: 19430,
+ * idle: 1070905480,
+ * irq: 20
+ * }
+ * },
+ * ]
+ * ```
+ *
+ * `nice` values are POSIX-only. On Windows, the `nice` values of all processors
+ * are always 0.
+ * @since v0.3.3
+ */
+ function cpus(): CpuInfo[];
+ /**
+ * Returns an estimate of the default amount of parallelism a program should use. Always returns a value greater than zero.
+ *
+ * This function is a small wrapper about libuv's [`uv_available_parallelism()`](https://docs.libuv.org/en/v1.x/misc.html#c.uv_available_parallelism).
+ * @since 18.4.0
+ */
+ function availableParallelism(): number;
+ /**
+ * Returns the operating system name as returned by [`uname(3)`](https://linux.die.net/man/3/uname). For example, it
+ * returns `'Linux'` on Linux, `'Darwin'` on macOS, and `'Windows_NT'` on Windows.
+ *
+ * See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for additional information
+ * about the output of running [`uname(3)`](https://linux.die.net/man/3/uname) on various operating systems.
+ * @since v0.3.3
+ */
+ function type(): string;
+ /**
+ * Returns the operating system as a string.
+ *
+ * On POSIX systems, the operating system release is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `GetVersionExW()` is used. See
+ * [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information.
+ * @since v0.3.3
+ */
+ function release(): string;
+ /**
+ * Returns an object containing network interfaces that have been assigned a
+ * network address.
+ *
+ * Each key on the returned object identifies a network interface. The associated
+ * value is an array of objects that each describe an assigned network address.
+ *
+ * The properties available on the assigned network address object include:
+ *
+ * ```js
+ * {
+ * lo: [
+ * {
+ * address: '127.0.0.1',
+ * netmask: '255.0.0.0',
+ * family: 'IPv4',
+ * mac: '00:00:00:00:00:00',
+ * internal: true,
+ * cidr: '127.0.0.1/8'
+ * },
+ * {
+ * address: '::1',
+ * netmask: 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff',
+ * family: 'IPv6',
+ * mac: '00:00:00:00:00:00',
+ * scopeid: 0,
+ * internal: true,
+ * cidr: '::1/128'
+ * }
+ * ],
+ * eth0: [
+ * {
+ * address: '192.168.1.108',
+ * netmask: '255.255.255.0',
+ * family: 'IPv4',
+ * mac: '01:02:03:0a:0b:0c',
+ * internal: false,
+ * cidr: '192.168.1.108/24'
+ * },
+ * {
+ * address: 'fe80::a00:27ff:fe4e:66a1',
+ * netmask: 'ffff:ffff:ffff:ffff::',
+ * family: 'IPv6',
+ * mac: '01:02:03:0a:0b:0c',
+ * scopeid: 1,
+ * internal: false,
+ * cidr: 'fe80::a00:27ff:fe4e:66a1/64'
+ * }
+ * ]
+ * }
+ * ```
+ * @since v0.6.0
+ */
+ function networkInterfaces(): NodeJS.Dict<NetworkInterfaceInfo[]>;
+ /**
+ * Returns the string path of the current user's home directory.
+ *
+ * On POSIX, it uses the `$HOME` environment variable if defined. Otherwise it
+ * uses the [effective UID](https://en.wikipedia.org/wiki/User_identifier#Effective_user_ID) to look up the user's home directory.
+ *
+ * On Windows, it uses the `USERPROFILE` environment variable if defined.
+ * Otherwise it uses the path to the profile directory of the current user.
+ * @since v2.3.0
+ */
+ function homedir(): string;
+ /**
+ * Returns information about the currently effective user. On POSIX platforms,
+ * this is typically a subset of the password file. The returned object includes
+ * the `username`, `uid`, `gid`, `shell`, and `homedir`. On Windows, the `uid` and`gid` fields are `-1`, and `shell` is `null`.
+ *
+ * The value of `homedir` returned by `os.userInfo()` is provided by the operating
+ * system. This differs from the result of `os.homedir()`, which queries
+ * environment variables for the home directory before falling back to the
+ * operating system response.
+ *
+ * Throws a `SystemError` if a user has no `username` or `homedir`.
+ * @since v6.0.0
+ */
+ function userInfo(options: { encoding: "buffer" }): UserInfo<Buffer>;
+ function userInfo(options?: { encoding: BufferEncoding }): UserInfo<string>;
+ type SignalConstants = {
+ [key in NodeJS.Signals]: number;
+ };
+ namespace constants {
+ const UV_UDP_REUSEADDR: number;
+ namespace signals {}
+ const signals: SignalConstants;
+ namespace errno {
+ const E2BIG: number;
+ const EACCES: number;
+ const EADDRINUSE: number;
+ const EADDRNOTAVAIL: number;
+ const EAFNOSUPPORT: number;
+ const EAGAIN: number;
+ const EALREADY: number;
+ const EBADF: number;
+ const EBADMSG: number;
+ const EBUSY: number;
+ const ECANCELED: number;
+ const ECHILD: number;
+ const ECONNABORTED: number;
+ const ECONNREFUSED: number;
+ const ECONNRESET: number;
+ const EDEADLK: number;
+ const EDESTADDRREQ: number;
+ const EDOM: number;
+ const EDQUOT: number;
+ const EEXIST: number;
+ const EFAULT: number;
+ const EFBIG: number;
+ const EHOSTUNREACH: number;
+ const EIDRM: number;
+ const EILSEQ: number;
+ const EINPROGRESS: number;
+ const EINTR: number;
+ const EINVAL: number;
+ const EIO: number;
+ const EISCONN: number;
+ const EISDIR: number;
+ const ELOOP: number;
+ const EMFILE: number;
+ const EMLINK: number;
+ const EMSGSIZE: number;
+ const EMULTIHOP: number;
+ const ENAMETOOLONG: number;
+ const ENETDOWN: number;
+ const ENETRESET: number;
+ const ENETUNREACH: number;
+ const ENFILE: number;
+ const ENOBUFS: number;
+ const ENODATA: number;
+ const ENODEV: number;
+ const ENOENT: number;
+ const ENOEXEC: number;
+ const ENOLCK: number;
+ const ENOLINK: number;
+ const ENOMEM: number;
+ const ENOMSG: number;
+ const ENOPROTOOPT: number;
+ const ENOSPC: number;
+ const ENOSR: number;
+ const ENOSTR: number;
+ const ENOSYS: number;
+ const ENOTCONN: number;
+ const ENOTDIR: number;
+ const ENOTEMPTY: number;
+ const ENOTSOCK: number;
+ const ENOTSUP: number;
+ const ENOTTY: number;
+ const ENXIO: number;
+ const EOPNOTSUPP: number;
+ const EOVERFLOW: number;
+ const EPERM: number;
+ const EPIPE: number;
+ const EPROTO: number;
+ const EPROTONOSUPPORT: number;
+ const EPROTOTYPE: number;
+ const ERANGE: number;
+ const EROFS: number;
+ const ESPIPE: number;
+ const ESRCH: number;
+ const ESTALE: number;
+ const ETIME: number;
+ const ETIMEDOUT: number;
+ const ETXTBSY: number;
+ const EWOULDBLOCK: number;
+ const EXDEV: number;
+ const WSAEINTR: number;
+ const WSAEBADF: number;
+ const WSAEACCES: number;
+ const WSAEFAULT: number;
+ const WSAEINVAL: number;
+ const WSAEMFILE: number;
+ const WSAEWOULDBLOCK: number;
+ const WSAEINPROGRESS: number;
+ const WSAEALREADY: number;
+ const WSAENOTSOCK: number;
+ const WSAEDESTADDRREQ: number;
+ const WSAEMSGSIZE: number;
+ const WSAEPROTOTYPE: number;
+ const WSAENOPROTOOPT: number;
+ const WSAEPROTONOSUPPORT: number;
+ const WSAESOCKTNOSUPPORT: number;
+ const WSAEOPNOTSUPP: number;
+ const WSAEPFNOSUPPORT: number;
+ const WSAEAFNOSUPPORT: number;
+ const WSAEADDRINUSE: number;
+ const WSAEADDRNOTAVAIL: number;
+ const WSAENETDOWN: number;
+ const WSAENETUNREACH: number;
+ const WSAENETRESET: number;
+ const WSAECONNABORTED: number;
+ const WSAECONNRESET: number;
+ const WSAENOBUFS: number;
+ const WSAEISCONN: number;
+ const WSAENOTCONN: number;
+ const WSAESHUTDOWN: number;
+ const WSAETOOMANYREFS: number;
+ const WSAETIMEDOUT: number;
+ const WSAECONNREFUSED: number;
+ const WSAELOOP: number;
+ const WSAENAMETOOLONG: number;
+ const WSAEHOSTDOWN: number;
+ const WSAEHOSTUNREACH: number;
+ const WSAENOTEMPTY: number;
+ const WSAEPROCLIM: number;
+ const WSAEUSERS: number;
+ const WSAEDQUOT: number;
+ const WSAESTALE: number;
+ const WSAEREMOTE: number;
+ const WSASYSNOTREADY: number;
+ const WSAVERNOTSUPPORTED: number;
+ const WSANOTINITIALISED: number;
+ const WSAEDISCON: number;
+ const WSAENOMORE: number;
+ const WSAECANCELLED: number;
+ const WSAEINVALIDPROCTABLE: number;
+ const WSAEINVALIDPROVIDER: number;
+ const WSAEPROVIDERFAILEDINIT: number;
+ const WSASYSCALLFAILURE: number;
+ const WSASERVICE_NOT_FOUND: number;
+ const WSATYPE_NOT_FOUND: number;
+ const WSA_E_NO_MORE: number;
+ const WSA_E_CANCELLED: number;
+ const WSAEREFUSED: number;
+ }
+ namespace priority {
+ const PRIORITY_LOW: number;
+ const PRIORITY_BELOW_NORMAL: number;
+ const PRIORITY_NORMAL: number;
+ const PRIORITY_ABOVE_NORMAL: number;
+ const PRIORITY_HIGH: number;
+ const PRIORITY_HIGHEST: number;
+ }
+ }
+ const devNull: string;
+ const EOL: string;
+ /**
+ * Returns the operating system CPU architecture for which the Node.js binary was
+ * compiled. Possible values are `'arm'`, `'arm64'`, `'ia32'`, `'mips'`,`'mipsel'`, `'ppc'`, `'ppc64'`, `'s390'`, `'s390x'`, and `'x64'`.
+ *
+ * The return value is equivalent to `process.arch`.
+ * @since v0.5.0
+ */
+ function arch(): string;
+ /**
+ * Returns a string identifying the kernel version.
+ *
+ * On POSIX systems, the operating system release is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `RtlGetVersion()` is used, and if it is not
+ * available, `GetVersionExW()` will be used. See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information.
+ * @since v13.11.0, v12.17.0
+ */
+ function version(): string;
+ /**
+ * Returns a string identifying the operating system platform for which
+ * the Node.js binary was compiled. The value is set at compile time.
+ * Possible values are `'aix'`, `'darwin'`, `'freebsd'`,`'linux'`,`'openbsd'`, `'sunos'`, and `'win32'`.
+ *
+ * The return value is equivalent to `process.platform`.
+ *
+ * The value `'android'` may also be returned if Node.js is built on the Android
+ * operating system. [Android support is experimental](https://github.com/nodejs/node/blob/HEAD/BUILDING.md#androidandroid-based-devices-eg-firefox-os).
+ * @since v0.5.0
+ */
+ function platform(): NodeJS.Platform;
+ /**
+ * Returns the machine type as a string, such as arm, aarch64, mips, mips64, ppc64, ppc64le, s390, s390x, i386, i686, x86_64.
+ *
+ * On POSIX systems, the machine type is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname).
+ * On Windows, `RtlGetVersion()` is used, and if it is not available, `GetVersionExW()` will be used.
+ * See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information.
+ * @since v18.9.0
+ */
+ function machine(): string;
+ /**
+ * Returns the operating system's default directory for temporary files as a
+ * string.
+ * @since v0.9.9
+ */
+ function tmpdir(): string;
+ /**
+ * Returns a string identifying the endianness of the CPU for which the Node.js
+ * binary was compiled.
+ *
+ * Possible values are `'BE'` for big endian and `'LE'` for little endian.
+ * @since v0.9.4
+ */
+ function endianness(): "BE" | "LE";
+ /**
+ * Returns the scheduling priority for the process specified by `pid`. If `pid` is
+ * not provided or is `0`, the priority of the current process is returned.
+ * @since v10.10.0
+ * @param [pid=0] The process ID to retrieve scheduling priority for.
+ */
+ function getPriority(pid?: number): number;
+ /**
+ * Attempts to set the scheduling priority for the process specified by `pid`. If`pid` is not provided or is `0`, the process ID of the current process is used.
+ *
+ * The `priority` input must be an integer between `-20` (high priority) and `19`(low priority). Due to differences between Unix priority levels and Windows
+ * priority classes, `priority` is mapped to one of six priority constants in`os.constants.priority`. When retrieving a process priority level, this range
+ * mapping may cause the return value to be slightly different on Windows. To avoid
+ * confusion, set `priority` to one of the priority constants.
+ *
+ * On Windows, setting priority to `PRIORITY_HIGHEST` requires elevated user
+ * privileges. Otherwise the set priority will be silently reduced to`PRIORITY_HIGH`.
+ * @since v10.10.0
+ * @param [pid=0] The process ID to set scheduling priority for.
+ * @param priority The scheduling priority to assign to the process.
+ */
+ function setPriority(priority: number): void;
+ function setPriority(pid: number, priority: number): void;
+}
+declare module "node:os" {
+ export * from "os";
+}
diff --git a/client/node_modules/@types/node/package.json b/client/node_modules/@types/node/package.json
new file mode 100644
index 0000000..7869b52
--- /dev/null
+++ b/client/node_modules/@types/node/package.json
@@ -0,0 +1,235 @@
+{
+ "name": "@types/node",
+ "version": "18.18.12",
+ "description": "TypeScript definitions for node",
+ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
+ "license": "MIT",
+ "contributors": [
+ {
+ "name": "Microsoft TypeScript",
+ "githubUsername": "Microsoft",
+ "url": "https://github.com/Microsoft"
+ },
+ {
+ "name": "Alberto Schiabel",
+ "githubUsername": "jkomyno",
+ "url": "https://github.com/jkomyno"
+ },
+ {
+ "name": "Alvis HT Tang",
+ "githubUsername": "alvis",
+ "url": "https://github.com/alvis"
+ },
+ {
+ "name": "Andrew Makarov",
+ "githubUsername": "r3nya",
+ "url": "https://github.com/r3nya"
+ },
+ {
+ "name": "Benjamin Toueg",
+ "githubUsername": "btoueg",
+ "url": "https://github.com/btoueg"
+ },
+ {
+ "name": "Chigozirim C.",
+ "githubUsername": "smac89",
+ "url": "https://github.com/smac89"
+ },
+ {
+ "name": "David Junger",
+ "githubUsername": "touffy",
+ "url": "https://github.com/touffy"
+ },
+ {
+ "name": "Deividas Bakanas",
+ "githubUsername": "DeividasBakanas",
+ "url": "https://github.com/DeividasBakanas"
+ },
+ {
+ "name": "Eugene Y. Q. Shen",
+ "githubUsername": "eyqs",
+ "url": "https://github.com/eyqs"
+ },
+ {
+ "name": "Hannes Magnusson",
+ "githubUsername": "Hannes-Magnusson-CK",
+ "url": "https://github.com/Hannes-Magnusson-CK"
+ },
+ {
+ "name": "Huw",
+ "githubUsername": "hoo29",
+ "url": "https://github.com/hoo29"
+ },
+ {
+ "name": "Kelvin Jin",
+ "githubUsername": "kjin",
+ "url": "https://github.com/kjin"
+ },
+ {
+ "name": "Klaus Meinhardt",
+ "githubUsername": "ajafff",
+ "url": "https://github.com/ajafff"
+ },
+ {
+ "name": "Lishude",
+ "githubUsername": "islishude",
+ "url": "https://github.com/islishude"
+ },
+ {
+ "name": "Mariusz Wiktorczyk",
+ "githubUsername": "mwiktorczyk",
+ "url": "https://github.com/mwiktorczyk"
+ },
+ {
+ "name": "Mohsen Azimi",
+ "githubUsername": "mohsen1",
+ "url": "https://github.com/mohsen1"
+ },
+ {
+ "name": "Nicolas Even",
+ "githubUsername": "n-e",
+ "url": "https://github.com/n-e"
+ },
+ {
+ "name": "Nikita Galkin",
+ "githubUsername": "galkin",
+ "url": "https://github.com/galkin"
+ },
+ {
+ "name": "Parambir Singh",
+ "githubUsername": "parambirs",
+ "url": "https://github.com/parambirs"
+ },
+ {
+ "name": "Sebastian Silbermann",
+ "githubUsername": "eps1lon",
+ "url": "https://github.com/eps1lon"
+ },
+ {
+ "name": "Simon Schick",
+ "githubUsername": "SimonSchick",
+ "url": "https://github.com/SimonSchick"
+ },
+ {
+ "name": "Thomas den Hollander",
+ "githubUsername": "ThomasdenH",
+ "url": "https://github.com/ThomasdenH"
+ },
+ {
+ "name": "Wilco Bakker",
+ "githubUsername": "WilcoBakker",
+ "url": "https://github.com/WilcoBakker"
+ },
+ {
+ "name": "wwwy3y3",
+ "githubUsername": "wwwy3y3",
+ "url": "https://github.com/wwwy3y3"
+ },
+ {
+ "name": "Samuel Ainsworth",
+ "githubUsername": "samuela",
+ "url": "https://github.com/samuela"
+ },
+ {
+ "name": "Kyle Uehlein",
+ "githubUsername": "kuehlein",
+ "url": "https://github.com/kuehlein"
+ },
+ {
+ "name": "Thanik Bhongbhibhat",
+ "githubUsername": "bhongy",
+ "url": "https://github.com/bhongy"
+ },
+ {
+ "name": "Marcin Kopacz",
+ "githubUsername": "chyzwar",
+ "url": "https://github.com/chyzwar"
+ },
+ {
+ "name": "Trivikram Kamat",
+ "githubUsername": "trivikr",
+ "url": "https://github.com/trivikr"
+ },
+ {
+ "name": "Junxiao Shi",
+ "githubUsername": "yoursunny",
+ "url": "https://github.com/yoursunny"
+ },
+ {
+ "name": "Ilia Baryshnikov",
+ "githubUsername": "qwelias",
+ "url": "https://github.com/qwelias"
+ },
+ {
+ "name": "ExE Boss",
+ "githubUsername": "ExE-Boss",
+ "url": "https://github.com/ExE-Boss"
+ },
+ {
+ "name": "Piotr Błażejewicz",
+ "githubUsername": "peterblazejewicz",
+ "url": "https://github.com/peterblazejewicz"
+ },
+ {
+ "name": "Anna Henningsen",
+ "githubUsername": "addaleax",
+ "url": "https://github.com/addaleax"
+ },
+ {
+ "name": "Victor Perin",
+ "githubUsername": "victorperin",
+ "url": "https://github.com/victorperin"
+ },
+ {
+ "name": "Yongsheng Zhang",
+ "githubUsername": "ZYSzys",
+ "url": "https://github.com/ZYSzys"
+ },
+ {
+ "name": "NodeJS Contributors",
+ "githubUsername": "NodeJS",
+ "url": "https://github.com/NodeJS"
+ },
+ {
+ "name": "Linus Unnebäck",
+ "githubUsername": "LinusU",
+ "url": "https://github.com/LinusU"
+ },
+ {
+ "name": "wafuwafu13",
+ "githubUsername": "wafuwafu13",
+ "url": "https://github.com/wafuwafu13"
+ },
+ {
+ "name": "Matteo Collina",
+ "githubUsername": "mcollina",
+ "url": "https://github.com/mcollina"
+ },
+ {
+ "name": "Dmitry Semigradsky",
+ "githubUsername": "Semigradsky",
+ "url": "https://github.com/Semigradsky"
+ }
+ ],
+ "main": "",
+ "types": "index.d.ts",
+ "typesVersions": {
+ "<=4.8": {
+ "*": [
+ "ts4.8/*"
+ ]
+ }
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
+ "directory": "types/node"
+ },
+ "scripts": {},
+ "dependencies": {
+ "undici-types": "~5.26.4"
+ },
+ "typesPublisherContentHash": "2fa3455ed91224979461178d2ac99888c6c16ea5096afe60d5785fecf7f00911",
+ "typeScriptVersion": "4.5",
+ "nonNpm": true
+} \ No newline at end of file
diff --git a/client/node_modules/@types/node/path.d.ts b/client/node_modules/@types/node/path.d.ts
new file mode 100644
index 0000000..1465c38
--- /dev/null
+++ b/client/node_modules/@types/node/path.d.ts
@@ -0,0 +1,191 @@
+declare module "path/posix" {
+ import path = require("path");
+ export = path;
+}
+declare module "path/win32" {
+ import path = require("path");
+ export = path;
+}
+/**
+ * The `path` module provides utilities for working with file and directory paths.
+ * It can be accessed using:
+ *
+ * ```js
+ * const path = require('path');
+ * ```
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/path.js)
+ */
+declare module "path" {
+ namespace path {
+ /**
+ * A parsed path object generated by path.parse() or consumed by path.format().
+ */
+ interface ParsedPath {
+ /**
+ * The root of the path such as '/' or 'c:\'
+ */
+ root: string;
+ /**
+ * The full directory path such as '/home/user/dir' or 'c:\path\dir'
+ */
+ dir: string;
+ /**
+ * The file name including extension (if any) such as 'index.html'
+ */
+ base: string;
+ /**
+ * The file extension (if any) such as '.html'
+ */
+ ext: string;
+ /**
+ * The file name without extension (if any) such as 'index'
+ */
+ name: string;
+ }
+ interface FormatInputPathObject {
+ /**
+ * The root of the path such as '/' or 'c:\'
+ */
+ root?: string | undefined;
+ /**
+ * The full directory path such as '/home/user/dir' or 'c:\path\dir'
+ */
+ dir?: string | undefined;
+ /**
+ * The file name including extension (if any) such as 'index.html'
+ */
+ base?: string | undefined;
+ /**
+ * The file extension (if any) such as '.html'
+ */
+ ext?: string | undefined;
+ /**
+ * The file name without extension (if any) such as 'index'
+ */
+ name?: string | undefined;
+ }
+ interface PlatformPath {
+ /**
+ * Normalize a string path, reducing '..' and '.' parts.
+ * When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used.
+ *
+ * @param path string path to normalize.
+ * @throws {TypeError} if `path` is not a string.
+ */
+ normalize(path: string): string;
+ /**
+ * Join all arguments together and normalize the resulting path.
+ *
+ * @param paths paths to join.
+ * @throws {TypeError} if any of the path segments is not a string.
+ */
+ join(...paths: string[]): string;
+ /**
+ * The right-most parameter is considered {to}. Other parameters are considered an array of {from}.
+ *
+ * Starting from leftmost {from} parameter, resolves {to} to an absolute path.
+ *
+ * If {to} isn't already absolute, {from} arguments are prepended in right to left order,
+ * until an absolute path is found. If after using all {from} paths still no absolute path is found,
+ * the current working directory is used as well. The resulting path is normalized,
+ * and trailing slashes are removed unless the path gets resolved to the root directory.
+ *
+ * @param paths A sequence of paths or path segments.
+ * @throws {TypeError} if any of the arguments is not a string.
+ */
+ resolve(...paths: string[]): string;
+ /**
+ * Determines whether {path} is an absolute path. An absolute path will always resolve to the same location, regardless of the working directory.
+ *
+ * If the given {path} is a zero-length string, `false` will be returned.
+ *
+ * @param path path to test.
+ * @throws {TypeError} if `path` is not a string.
+ */
+ isAbsolute(path: string): boolean;
+ /**
+ * Solve the relative path from {from} to {to} based on the current working directory.
+ * At times we have two absolute paths, and we need to derive the relative path from one to the other. This is actually the reverse transform of path.resolve.
+ *
+ * @throws {TypeError} if either `from` or `to` is not a string.
+ */
+ relative(from: string, to: string): string;
+ /**
+ * Return the directory name of a path. Similar to the Unix dirname command.
+ *
+ * @param path the path to evaluate.
+ * @throws {TypeError} if `path` is not a string.
+ */
+ dirname(path: string): string;
+ /**
+ * Return the last portion of a path. Similar to the Unix basename command.
+ * Often used to extract the file name from a fully qualified path.
+ *
+ * @param path the path to evaluate.
+ * @param suffix optionally, an extension to remove from the result.
+ * @throws {TypeError} if `path` is not a string or if `ext` is given and is not a string.
+ */
+ basename(path: string, suffix?: string): string;
+ /**
+ * Return the extension of the path, from the last '.' to end of string in the last portion of the path.
+ * If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string.
+ *
+ * @param path the path to evaluate.
+ * @throws {TypeError} if `path` is not a string.
+ */
+ extname(path: string): string;
+ /**
+ * The platform-specific file separator. '\\' or '/'.
+ */
+ readonly sep: "\\" | "/";
+ /**
+ * The platform-specific file delimiter. ';' or ':'.
+ */
+ readonly delimiter: ";" | ":";
+ /**
+ * Returns an object from a path string - the opposite of format().
+ *
+ * @param path path to evaluate.
+ * @throws {TypeError} if `path` is not a string.
+ */
+ parse(path: string): ParsedPath;
+ /**
+ * Returns a path string from an object - the opposite of parse().
+ *
+ * @param pathObject path to evaluate.
+ */
+ format(pathObject: FormatInputPathObject): string;
+ /**
+ * On Windows systems only, returns an equivalent namespace-prefixed path for the given path.
+ * If path is not a string, path will be returned without modifications.
+ * This method is meaningful only on Windows system.
+ * On POSIX systems, the method is non-operational and always returns path without modifications.
+ */
+ toNamespacedPath(path: string): string;
+ /**
+ * Posix specific pathing.
+ * Same as parent object on posix.
+ */
+ readonly posix: PlatformPath;
+ /**
+ * Windows specific pathing.
+ * Same as parent object on windows
+ */
+ readonly win32: PlatformPath;
+ }
+ }
+ const path: path.PlatformPath;
+ export = path;
+}
+declare module "node:path" {
+ import path = require("path");
+ export = path;
+}
+declare module "node:path/posix" {
+ import path = require("path/posix");
+ export = path;
+}
+declare module "node:path/win32" {
+ import path = require("path/win32");
+ export = path;
+}
diff --git a/client/node_modules/@types/node/perf_hooks.d.ts b/client/node_modules/@types/node/perf_hooks.d.ts
new file mode 100644
index 0000000..9ad41b9
--- /dev/null
+++ b/client/node_modules/@types/node/perf_hooks.d.ts
@@ -0,0 +1,626 @@
+/**
+ * This module provides an implementation of a subset of the W3C [Web Performance APIs](https://w3c.github.io/perf-timing-primer/) as well as additional APIs for
+ * Node.js-specific performance measurements.
+ *
+ * Node.js supports the following [Web Performance APIs](https://w3c.github.io/perf-timing-primer/):
+ *
+ * * [High Resolution Time](https://www.w3.org/TR/hr-time-2)
+ * * [Performance Timeline](https://w3c.github.io/performance-timeline/)
+ * * [User Timing](https://www.w3.org/TR/user-timing/)
+ *
+ * ```js
+ * const { PerformanceObserver, performance } = require('perf_hooks');
+ *
+ * const obs = new PerformanceObserver((items) => {
+ * console.log(items.getEntries()[0].duration);
+ * performance.clearMarks();
+ * });
+ * obs.observe({ type: 'measure' });
+ * performance.measure('Start to Now');
+ *
+ * performance.mark('A');
+ * doSomeLongRunningProcess(() => {
+ * performance.measure('A to Now', 'A');
+ *
+ * performance.mark('B');
+ * performance.measure('A to B', 'A', 'B');
+ * });
+ * ```
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/perf_hooks.js)
+ */
+declare module "perf_hooks" {
+ import { AsyncResource } from "node:async_hooks";
+ type EntryType = "node" | "mark" | "measure" | "gc" | "function" | "http2" | "http" | "dns";
+ interface NodeGCPerformanceDetail {
+ /**
+ * When `performanceEntry.entryType` is equal to 'gc', `the performance.kind` property identifies
+ * the type of garbage collection operation that occurred.
+ * See perf_hooks.constants for valid values.
+ */
+ readonly kind?: number | undefined;
+ /**
+ * When `performanceEntry.entryType` is equal to 'gc', the `performance.flags`
+ * property contains additional information about garbage collection operation.
+ * See perf_hooks.constants for valid values.
+ */
+ readonly flags?: number | undefined;
+ }
+ /**
+ * @since v8.5.0
+ */
+ class PerformanceEntry {
+ protected constructor();
+ /**
+ * The total number of milliseconds elapsed for this entry. This value will not
+ * be meaningful for all Performance Entry types.
+ * @since v8.5.0
+ */
+ readonly duration: number;
+ /**
+ * The name of the performance entry.
+ * @since v8.5.0
+ */
+ readonly name: string;
+ /**
+ * The high resolution millisecond timestamp marking the starting time of the
+ * Performance Entry.
+ * @since v8.5.0
+ */
+ readonly startTime: number;
+ /**
+ * The type of the performance entry. It may be one of:
+ *
+ * * `'node'` (Node.js only)
+ * * `'mark'` (available on the Web)
+ * * `'measure'` (available on the Web)
+ * * `'gc'` (Node.js only)
+ * * `'function'` (Node.js only)
+ * * `'http2'` (Node.js only)
+ * * `'http'` (Node.js only)
+ * @since v8.5.0
+ */
+ readonly entryType: EntryType;
+ /**
+ * Additional detail specific to the `entryType`.
+ * @since v16.0.0
+ */
+ readonly detail?: NodeGCPerformanceDetail | unknown | undefined; // TODO: Narrow this based on entry type.
+ toJSON(): any;
+ }
+ class PerformanceMark extends PerformanceEntry {
+ readonly duration: 0;
+ readonly entryType: "mark";
+ }
+ class PerformanceMeasure extends PerformanceEntry {
+ readonly entryType: "measure";
+ }
+ /**
+ * _This property is an extension by Node.js. It is not available in Web browsers._
+ *
+ * Provides timing details for Node.js itself. The constructor of this class
+ * is not exposed to users.
+ * @since v8.5.0
+ */
+ class PerformanceNodeTiming extends PerformanceEntry {
+ /**
+ * The high resolution millisecond timestamp at which the Node.js process
+ * completed bootstrapping. If bootstrapping has not yet finished, the property
+ * has the value of -1.
+ * @since v8.5.0
+ */
+ readonly bootstrapComplete: number;
+ /**
+ * The high resolution millisecond timestamp at which the Node.js environment was
+ * initialized.
+ * @since v8.5.0
+ */
+ readonly environment: number;
+ /**
+ * The high resolution millisecond timestamp of the amount of time the event loop
+ * has been idle within the event loop's event provider (e.g. `epoll_wait`). This
+ * does not take CPU usage into consideration. If the event loop has not yet
+ * started (e.g., in the first tick of the main script), the property has the
+ * value of 0.
+ * @since v14.10.0, v12.19.0
+ */
+ readonly idleTime: number;
+ /**
+ * The high resolution millisecond timestamp at which the Node.js event loop
+ * exited. If the event loop has not yet exited, the property has the value of -1\.
+ * It can only have a value of not -1 in a handler of the `'exit'` event.
+ * @since v8.5.0
+ */
+ readonly loopExit: number;
+ /**
+ * The high resolution millisecond timestamp at which the Node.js event loop
+ * started. If the event loop has not yet started (e.g., in the first tick of the
+ * main script), the property has the value of -1.
+ * @since v8.5.0
+ */
+ readonly loopStart: number;
+ /**
+ * The high resolution millisecond timestamp at which the V8 platform was
+ * initialized.
+ * @since v8.5.0
+ */
+ readonly v8Start: number;
+ }
+ interface EventLoopUtilization {
+ idle: number;
+ active: number;
+ utilization: number;
+ }
+ /**
+ * @param util1 The result of a previous call to eventLoopUtilization()
+ * @param util2 The result of a previous call to eventLoopUtilization() prior to util1
+ */
+ type EventLoopUtilityFunction = (
+ util1?: EventLoopUtilization,
+ util2?: EventLoopUtilization,
+ ) => EventLoopUtilization;
+ interface MarkOptions {
+ /**
+ * Additional optional detail to include with the mark.
+ */
+ detail?: unknown | undefined;
+ /**
+ * An optional timestamp to be used as the mark time.
+ * @default `performance.now()`.
+ */
+ startTime?: number | undefined;
+ }
+ interface MeasureOptions {
+ /**
+ * Additional optional detail to include with the mark.
+ */
+ detail?: unknown | undefined;
+ /**
+ * Duration between start and end times.
+ */
+ duration?: number | undefined;
+ /**
+ * Timestamp to be used as the end time, or a string identifying a previously recorded mark.
+ */
+ end?: number | string | undefined;
+ /**
+ * Timestamp to be used as the start time, or a string identifying a previously recorded mark.
+ */
+ start?: number | string | undefined;
+ }
+ interface TimerifyOptions {
+ /**
+ * A histogram object created using
+ * `perf_hooks.createHistogram()` that will record runtime durations in
+ * nanoseconds.
+ */
+ histogram?: RecordableHistogram | undefined;
+ }
+ interface Performance {
+ /**
+ * If name is not provided, removes all PerformanceMark objects from the Performance Timeline.
+ * If name is provided, removes only the named mark.
+ * @param name
+ */
+ clearMarks(name?: string): void;
+ /**
+ * If name is not provided, removes all PerformanceMeasure objects from the Performance Timeline.
+ * If name is provided, removes only the named measure.
+ * @param name
+ * @since v16.7.0
+ */
+ clearMeasures(name?: string): void;
+ /**
+ * Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime`.
+ * If you are only interested in performance entries of certain types or that have certain names, see
+ * `performance.getEntriesByType()` and `performance.getEntriesByName()`.
+ * @since v16.7.0
+ */
+ getEntries(): PerformanceEntry[];
+ /**
+ * Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime`
+ * whose `performanceEntry.name` is equal to `name`, and optionally, whose `performanceEntry.entryType` is equal to `type`.
+ * @param name
+ * @param type
+ * @since v16.7.0
+ */
+ getEntriesByName(name: string, type?: EntryType): PerformanceEntry[];
+ /**
+ * Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime`
+ * whose `performanceEntry.entryType` is equal to `type`.
+ * @param type
+ * @since v16.7.0
+ */
+ getEntriesByType(type: EntryType): PerformanceEntry[];
+ /**
+ * Creates a new PerformanceMark entry in the Performance Timeline.
+ * A PerformanceMark is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'mark',
+ * and whose performanceEntry.duration is always 0.
+ * Performance marks are used to mark specific significant moments in the Performance Timeline.
+ * @param name
+ * @return The PerformanceMark entry that was created
+ */
+ mark(name?: string, options?: MarkOptions): PerformanceMark;
+ /**
+ * Creates a new PerformanceMeasure entry in the Performance Timeline.
+ * A PerformanceMeasure is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'measure',
+ * and whose performanceEntry.duration measures the number of milliseconds elapsed since startMark and endMark.
+ *
+ * The startMark argument may identify any existing PerformanceMark in the the Performance Timeline, or may identify
+ * any of the timestamp properties provided by the PerformanceNodeTiming class. If the named startMark does not exist,
+ * then startMark is set to timeOrigin by default.
+ *
+ * The endMark argument must identify any existing PerformanceMark in the the Performance Timeline or any of the timestamp
+ * properties provided by the PerformanceNodeTiming class. If the named endMark does not exist, an error will be thrown.
+ * @param name
+ * @param startMark
+ * @param endMark
+ * @return The PerformanceMeasure entry that was created
+ */
+ measure(name: string, startMark?: string, endMark?: string): PerformanceMeasure;
+ measure(name: string, options: MeasureOptions): PerformanceMeasure;
+ /**
+ * An instance of the PerformanceNodeTiming class that provides performance metrics for specific Node.js operational milestones.
+ */
+ readonly nodeTiming: PerformanceNodeTiming;
+ /**
+ * @return the current high resolution millisecond timestamp
+ */
+ now(): number;
+ /**
+ * The timeOrigin specifies the high resolution millisecond timestamp from which all performance metric durations are measured.
+ */
+ readonly timeOrigin: number;
+ /**
+ * Wraps a function within a new function that measures the running time of the wrapped function.
+ * A PerformanceObserver must be subscribed to the 'function' event type in order for the timing details to be accessed.
+ * @param fn
+ */
+ timerify<T extends (...params: any[]) => any>(fn: T, options?: TimerifyOptions): T;
+ /**
+ * eventLoopUtilization is similar to CPU utilization except that it is calculated using high precision wall-clock time.
+ * It represents the percentage of time the event loop has spent outside the event loop's event provider (e.g. epoll_wait).
+ * No other CPU idle time is taken into consideration.
+ */
+ eventLoopUtilization: EventLoopUtilityFunction;
+ }
+ interface PerformanceObserverEntryList {
+ /**
+ * Returns a list of `PerformanceEntry` objects in chronological order
+ * with respect to `performanceEntry.startTime`.
+ *
+ * ```js
+ * const {
+ * performance,
+ * PerformanceObserver
+ * } = require('perf_hooks');
+ *
+ * const obs = new PerformanceObserver((perfObserverList, observer) => {
+ * console.log(perfObserverList.getEntries());
+ *
+ * * [
+ * * PerformanceEntry {
+ * * name: 'test',
+ * * entryType: 'mark',
+ * * startTime: 81.465639,
+ * * duration: 0
+ * * },
+ * * PerformanceEntry {
+ * * name: 'meow',
+ * * entryType: 'mark',
+ * * startTime: 81.860064,
+ * * duration: 0
+ * * }
+ * * ]
+ *
+ * performance.clearMarks();
+ * performance.clearMeasures();
+ * observer.disconnect();
+ * });
+ * obs.observe({ type: 'mark' });
+ *
+ * performance.mark('test');
+ * performance.mark('meow');
+ * ```
+ * @since v8.5.0
+ */
+ getEntries(): PerformanceEntry[];
+ /**
+ * Returns a list of `PerformanceEntry` objects in chronological order
+ * with respect to `performanceEntry.startTime` whose `performanceEntry.name` is
+ * equal to `name`, and optionally, whose `performanceEntry.entryType` is equal to`type`.
+ *
+ * ```js
+ * const {
+ * performance,
+ * PerformanceObserver
+ * } = require('perf_hooks');
+ *
+ * const obs = new PerformanceObserver((perfObserverList, observer) => {
+ * console.log(perfObserverList.getEntriesByName('meow'));
+ *
+ * * [
+ * * PerformanceEntry {
+ * * name: 'meow',
+ * * entryType: 'mark',
+ * * startTime: 98.545991,
+ * * duration: 0
+ * * }
+ * * ]
+ *
+ * console.log(perfObserverList.getEntriesByName('nope')); // []
+ *
+ * console.log(perfObserverList.getEntriesByName('test', 'mark'));
+ *
+ * * [
+ * * PerformanceEntry {
+ * * name: 'test',
+ * * entryType: 'mark',
+ * * startTime: 63.518931,
+ * * duration: 0
+ * * }
+ * * ]
+ *
+ * console.log(perfObserverList.getEntriesByName('test', 'measure')); // []
+ *
+ * performance.clearMarks();
+ * performance.clearMeasures();
+ * observer.disconnect();
+ * });
+ * obs.observe({ entryTypes: ['mark', 'measure'] });
+ *
+ * performance.mark('test');
+ * performance.mark('meow');
+ * ```
+ * @since v8.5.0
+ */
+ getEntriesByName(name: string, type?: EntryType): PerformanceEntry[];
+ /**
+ * Returns a list of `PerformanceEntry` objects in chronological order
+ * with respect to `performanceEntry.startTime` whose `performanceEntry.entryType`is equal to `type`.
+ *
+ * ```js
+ * const {
+ * performance,
+ * PerformanceObserver
+ * } = require('perf_hooks');
+ *
+ * const obs = new PerformanceObserver((perfObserverList, observer) => {
+ * console.log(perfObserverList.getEntriesByType('mark'));
+ *
+ * * [
+ * * PerformanceEntry {
+ * * name: 'test',
+ * * entryType: 'mark',
+ * * startTime: 55.897834,
+ * * duration: 0
+ * * },
+ * * PerformanceEntry {
+ * * name: 'meow',
+ * * entryType: 'mark',
+ * * startTime: 56.350146,
+ * * duration: 0
+ * * }
+ * * ]
+ *
+ * performance.clearMarks();
+ * performance.clearMeasures();
+ * observer.disconnect();
+ * });
+ * obs.observe({ type: 'mark' });
+ *
+ * performance.mark('test');
+ * performance.mark('meow');
+ * ```
+ * @since v8.5.0
+ */
+ getEntriesByType(type: EntryType): PerformanceEntry[];
+ }
+ type PerformanceObserverCallback = (list: PerformanceObserverEntryList, observer: PerformanceObserver) => void;
+ class PerformanceObserver extends AsyncResource {
+ constructor(callback: PerformanceObserverCallback);
+ /**
+ * Disconnects the `PerformanceObserver` instance from all notifications.
+ * @since v8.5.0
+ */
+ disconnect(): void;
+ /**
+ * Subscribes the `PerformanceObserver` instance to notifications of new `PerformanceEntry` instances identified either by `options.entryTypes`or `options.type`:
+ *
+ * ```js
+ * const {
+ * performance,
+ * PerformanceObserver
+ * } = require('perf_hooks');
+ *
+ * const obs = new PerformanceObserver((list, observer) => {
+ * // Called once asynchronously. `list` contains three items.
+ * });
+ * obs.observe({ type: 'mark' });
+ *
+ * for (let n = 0; n < 3; n++)
+ * performance.mark(`test${n}`);
+ * ```
+ * @since v8.5.0
+ */
+ observe(
+ options:
+ | {
+ entryTypes: readonly EntryType[];
+ buffered?: boolean | undefined;
+ }
+ | {
+ type: EntryType;
+ buffered?: boolean | undefined;
+ },
+ ): void;
+ }
+ namespace constants {
+ const NODE_PERFORMANCE_GC_MAJOR: number;
+ const NODE_PERFORMANCE_GC_MINOR: number;
+ const NODE_PERFORMANCE_GC_INCREMENTAL: number;
+ const NODE_PERFORMANCE_GC_WEAKCB: number;
+ const NODE_PERFORMANCE_GC_FLAGS_NO: number;
+ const NODE_PERFORMANCE_GC_FLAGS_CONSTRUCT_RETAINED: number;
+ const NODE_PERFORMANCE_GC_FLAGS_FORCED: number;
+ const NODE_PERFORMANCE_GC_FLAGS_SYNCHRONOUS_PHANTOM_PROCESSING: number;
+ const NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE: number;
+ const NODE_PERFORMANCE_GC_FLAGS_ALL_EXTERNAL_MEMORY: number;
+ const NODE_PERFORMANCE_GC_FLAGS_SCHEDULE_IDLE: number;
+ }
+ const performance: Performance;
+ interface EventLoopMonitorOptions {
+ /**
+ * The sampling rate in milliseconds.
+ * Must be greater than zero.
+ * @default 10
+ */
+ resolution?: number | undefined;
+ }
+ interface Histogram {
+ /**
+ * Returns a `Map` object detailing the accumulated percentile distribution.
+ * @since v11.10.0
+ */
+ readonly percentiles: Map<number, number>;
+ /**
+ * The number of times the event loop delay exceeded the maximum 1 hour event
+ * loop delay threshold.
+ * @since v11.10.0
+ */
+ readonly exceeds: number;
+ /**
+ * The minimum recorded event loop delay.
+ * @since v11.10.0
+ */
+ readonly min: number;
+ /**
+ * The maximum recorded event loop delay.
+ * @since v11.10.0
+ */
+ readonly max: number;
+ /**
+ * The mean of the recorded event loop delays.
+ * @since v11.10.0
+ */
+ readonly mean: number;
+ /**
+ * The standard deviation of the recorded event loop delays.
+ * @since v11.10.0
+ */
+ readonly stddev: number;
+ /**
+ * Resets the collected histogram data.
+ * @since v11.10.0
+ */
+ reset(): void;
+ /**
+ * Returns the value at the given percentile.
+ * @since v11.10.0
+ * @param percentile A percentile value in the range (0, 100].
+ */
+ percentile(percentile: number): number;
+ }
+ interface IntervalHistogram extends Histogram {
+ /**
+ * Enables the update interval timer. Returns `true` if the timer was
+ * started, `false` if it was already started.
+ * @since v11.10.0
+ */
+ enable(): boolean;
+ /**
+ * Disables the update interval timer. Returns `true` if the timer was
+ * stopped, `false` if it was already stopped.
+ * @since v11.10.0
+ */
+ disable(): boolean;
+ }
+ interface RecordableHistogram extends Histogram {
+ /**
+ * @since v15.9.0, v14.18.0
+ * @param val The amount to record in the histogram.
+ */
+ record(val: number | bigint): void;
+ /**
+ * Calculates the amount of time (in nanoseconds) that has passed since the
+ * previous call to `recordDelta()` and records that amount in the histogram.
+ *
+ * ## Examples
+ * @since v15.9.0, v14.18.0
+ */
+ recordDelta(): void;
+ /**
+ * Adds the values from other to this histogram.
+ * @since v17.4.0, v16.14.0
+ * @param other Recordable Histogram to combine with
+ */
+ add(other: RecordableHistogram): void;
+ }
+ /**
+ * _This property is an extension by Node.js. It is not available in Web browsers._
+ *
+ * Creates an `IntervalHistogram` object that samples and reports the event loop
+ * delay over time. The delays will be reported in nanoseconds.
+ *
+ * Using a timer to detect approximate event loop delay works because the
+ * execution of timers is tied specifically to the lifecycle of the libuv
+ * event loop. That is, a delay in the loop will cause a delay in the execution
+ * of the timer, and those delays are specifically what this API is intended to
+ * detect.
+ *
+ * ```js
+ * const { monitorEventLoopDelay } = require('perf_hooks');
+ * const h = monitorEventLoopDelay({ resolution: 20 });
+ * h.enable();
+ * // Do something.
+ * h.disable();
+ * console.log(h.min);
+ * console.log(h.max);
+ * console.log(h.mean);
+ * console.log(h.stddev);
+ * console.log(h.percentiles);
+ * console.log(h.percentile(50));
+ * console.log(h.percentile(99));
+ * ```
+ * @since v11.10.0
+ */
+ function monitorEventLoopDelay(options?: EventLoopMonitorOptions): IntervalHistogram;
+ interface CreateHistogramOptions {
+ /**
+ * The minimum recordable value. Must be an integer value greater than 0.
+ * @default 1
+ */
+ min?: number | bigint | undefined;
+ /**
+ * The maximum recordable value. Must be an integer value greater than min.
+ * @default Number.MAX_SAFE_INTEGER
+ */
+ max?: number | bigint | undefined;
+ /**
+ * The number of accuracy digits. Must be a number between 1 and 5.
+ * @default 3
+ */
+ figures?: number | undefined;
+ }
+ /**
+ * Returns a `RecordableHistogram`.
+ * @since v15.9.0, v14.18.0
+ */
+ function createHistogram(options?: CreateHistogramOptions): RecordableHistogram;
+
+ import { performance as _performance } from "perf_hooks";
+ global {
+ /**
+ * `performance` is a global reference for `require('perf_hooks').performance`
+ * https://nodejs.org/api/globals.html#performance
+ * @since v16.0.0
+ */
+ var performance: typeof globalThis extends {
+ onmessage: any;
+ performance: infer T;
+ } ? T
+ : typeof _performance;
+ }
+}
+declare module "node:perf_hooks" {
+ export * from "perf_hooks";
+}
diff --git a/client/node_modules/@types/node/process.d.ts b/client/node_modules/@types/node/process.d.ts
new file mode 100644
index 0000000..e71ff8e
--- /dev/null
+++ b/client/node_modules/@types/node/process.d.ts
@@ -0,0 +1,1518 @@
+declare module "process" {
+ import * as tty from "node:tty";
+ import { Worker } from "node:worker_threads";
+ global {
+ var process: NodeJS.Process;
+ namespace NodeJS {
+ // this namespace merge is here because these are specifically used
+ // as the type for process.stdin, process.stdout, and process.stderr.
+ // they can't live in tty.d.ts because we need to disambiguate the imported name.
+ interface ReadStream extends tty.ReadStream {}
+ interface WriteStream extends tty.WriteStream {}
+ interface MemoryUsageFn {
+ /**
+ * The `process.memoryUsage()` method iterate over each page to gather informations about memory
+ * usage which can be slow depending on the program memory allocations.
+ */
+ (): MemoryUsage;
+ /**
+ * method returns an integer representing the Resident Set Size (RSS) in bytes.
+ */
+ rss(): number;
+ }
+ interface MemoryUsage {
+ rss: number;
+ heapTotal: number;
+ heapUsed: number;
+ external: number;
+ arrayBuffers: number;
+ }
+ interface CpuUsage {
+ user: number;
+ system: number;
+ }
+ interface ProcessRelease {
+ name: string;
+ sourceUrl?: string | undefined;
+ headersUrl?: string | undefined;
+ libUrl?: string | undefined;
+ lts?: string | undefined;
+ }
+ interface ProcessVersions extends Dict<string> {
+ http_parser: string;
+ node: string;
+ v8: string;
+ ares: string;
+ uv: string;
+ zlib: string;
+ modules: string;
+ openssl: string;
+ }
+ type Platform =
+ | "aix"
+ | "android"
+ | "darwin"
+ | "freebsd"
+ | "haiku"
+ | "linux"
+ | "openbsd"
+ | "sunos"
+ | "win32"
+ | "cygwin"
+ | "netbsd";
+ type Architecture =
+ | "arm"
+ | "arm64"
+ | "ia32"
+ | "mips"
+ | "mipsel"
+ | "ppc"
+ | "ppc64"
+ | "s390"
+ | "s390x"
+ | "x64";
+ type Signals =
+ | "SIGABRT"
+ | "SIGALRM"
+ | "SIGBUS"
+ | "SIGCHLD"
+ | "SIGCONT"
+ | "SIGFPE"
+ | "SIGHUP"
+ | "SIGILL"
+ | "SIGINT"
+ | "SIGIO"
+ | "SIGIOT"
+ | "SIGKILL"
+ | "SIGPIPE"
+ | "SIGPOLL"
+ | "SIGPROF"
+ | "SIGPWR"
+ | "SIGQUIT"
+ | "SIGSEGV"
+ | "SIGSTKFLT"
+ | "SIGSTOP"
+ | "SIGSYS"
+ | "SIGTERM"
+ | "SIGTRAP"
+ | "SIGTSTP"
+ | "SIGTTIN"
+ | "SIGTTOU"
+ | "SIGUNUSED"
+ | "SIGURG"
+ | "SIGUSR1"
+ | "SIGUSR2"
+ | "SIGVTALRM"
+ | "SIGWINCH"
+ | "SIGXCPU"
+ | "SIGXFSZ"
+ | "SIGBREAK"
+ | "SIGLOST"
+ | "SIGINFO";
+ type UncaughtExceptionOrigin = "uncaughtException" | "unhandledRejection";
+ type MultipleResolveType = "resolve" | "reject";
+ type BeforeExitListener = (code: number) => void;
+ type DisconnectListener = () => void;
+ type ExitListener = (code: number) => void;
+ type RejectionHandledListener = (promise: Promise<unknown>) => void;
+ type UncaughtExceptionListener = (error: Error, origin: UncaughtExceptionOrigin) => void;
+ /**
+ * Most of the time the unhandledRejection will be an Error, but this should not be relied upon
+ * as *anything* can be thrown/rejected, it is therefore unsafe to assume that the value is an Error.
+ */
+ type UnhandledRejectionListener = (reason: unknown, promise: Promise<unknown>) => void;
+ type WarningListener = (warning: Error) => void;
+ type MessageListener = (message: unknown, sendHandle: unknown) => void;
+ type SignalsListener = (signal: Signals) => void;
+ type MultipleResolveListener = (
+ type: MultipleResolveType,
+ promise: Promise<unknown>,
+ value: unknown,
+ ) => void;
+ type WorkerListener = (worker: Worker) => void;
+ interface Socket extends ReadWriteStream {
+ isTTY?: true | undefined;
+ }
+ // Alias for compatibility
+ interface ProcessEnv extends Dict<string> {
+ /**
+ * Can be used to change the default timezone at runtime
+ */
+ TZ?: string;
+ }
+ interface HRTime {
+ (time?: [number, number]): [number, number];
+ bigint(): bigint;
+ }
+ interface ProcessReport {
+ /**
+ * Directory where the report is written.
+ * working directory of the Node.js process.
+ * @default '' indicating that reports are written to the current
+ */
+ directory: string;
+ /**
+ * Filename where the report is written.
+ * The default value is the empty string.
+ * @default '' the output filename will be comprised of a timestamp,
+ * PID, and sequence number.
+ */
+ filename: string;
+ /**
+ * Returns a JSON-formatted diagnostic report for the running process.
+ * The report's JavaScript stack trace is taken from err, if present.
+ */
+ getReport(err?: Error): string;
+ /**
+ * If true, a diagnostic report is generated on fatal errors,
+ * such as out of memory errors or failed C++ assertions.
+ * @default false
+ */
+ reportOnFatalError: boolean;
+ /**
+ * If true, a diagnostic report is generated when the process
+ * receives the signal specified by process.report.signal.
+ * @default false
+ */
+ reportOnSignal: boolean;
+ /**
+ * If true, a diagnostic report is generated on uncaught exception.
+ * @default false
+ */
+ reportOnUncaughtException: boolean;
+ /**
+ * The signal used to trigger the creation of a diagnostic report.
+ * @default 'SIGUSR2'
+ */
+ signal: Signals;
+ /**
+ * Writes a diagnostic report to a file. If filename is not provided, the default filename
+ * includes the date, time, PID, and a sequence number.
+ * The report's JavaScript stack trace is taken from err, if present.
+ *
+ * @param fileName Name of the file where the report is written.
+ * This should be a relative path, that will be appended to the directory specified in
+ * `process.report.directory`, or the current working directory of the Node.js process,
+ * if unspecified.
+ * @param error A custom error used for reporting the JavaScript stack.
+ * @return Filename of the generated report.
+ */
+ writeReport(fileName?: string): string;
+ writeReport(error?: Error): string;
+ writeReport(fileName?: string, err?: Error): string;
+ }
+ interface ResourceUsage {
+ fsRead: number;
+ fsWrite: number;
+ involuntaryContextSwitches: number;
+ ipcReceived: number;
+ ipcSent: number;
+ majorPageFault: number;
+ maxRSS: number;
+ minorPageFault: number;
+ sharedMemorySize: number;
+ signalsCount: number;
+ swappedOut: number;
+ systemCPUTime: number;
+ unsharedDataSize: number;
+ unsharedStackSize: number;
+ userCPUTime: number;
+ voluntaryContextSwitches: number;
+ }
+ interface EmitWarningOptions {
+ /**
+ * When `warning` is a `string`, `type` is the name to use for the _type_ of warning being emitted.
+ *
+ * @default 'Warning'
+ */
+ type?: string | undefined;
+ /**
+ * A unique identifier for the warning instance being emitted.
+ */
+ code?: string | undefined;
+ /**
+ * When `warning` is a `string`, `ctor` is an optional function used to limit the generated stack trace.
+ *
+ * @default process.emitWarning
+ */
+ ctor?: Function | undefined;
+ /**
+ * Additional text to include with the error.
+ */
+ detail?: string | undefined;
+ }
+ interface ProcessConfig {
+ readonly target_defaults: {
+ readonly cflags: any[];
+ readonly default_configuration: string;
+ readonly defines: string[];
+ readonly include_dirs: string[];
+ readonly libraries: string[];
+ };
+ readonly variables: {
+ readonly clang: number;
+ readonly host_arch: string;
+ readonly node_install_npm: boolean;
+ readonly node_install_waf: boolean;
+ readonly node_prefix: string;
+ readonly node_shared_openssl: boolean;
+ readonly node_shared_v8: boolean;
+ readonly node_shared_zlib: boolean;
+ readonly node_use_dtrace: boolean;
+ readonly node_use_etw: boolean;
+ readonly node_use_openssl: boolean;
+ readonly target_arch: string;
+ readonly v8_no_strict_aliasing: number;
+ readonly v8_use_snapshot: boolean;
+ readonly visibility: string;
+ };
+ }
+ interface Process extends EventEmitter {
+ /**
+ * The `process.stdout` property returns a stream connected to`stdout` (fd `1`). It is a `net.Socket` (which is a `Duplex` stream) unless fd `1` refers to a file, in which case it is
+ * a `Writable` stream.
+ *
+ * For example, to copy `process.stdin` to `process.stdout`:
+ *
+ * ```js
+ * import { stdin, stdout } from 'process';
+ *
+ * stdin.pipe(stdout);
+ * ```
+ *
+ * `process.stdout` differs from other Node.js streams in important ways. See `note on process I/O` for more information.
+ */
+ stdout: WriteStream & {
+ fd: 1;
+ };
+ /**
+ * The `process.stderr` property returns a stream connected to`stderr` (fd `2`). It is a `net.Socket` (which is a `Duplex` stream) unless fd `2` refers to a file, in which case it is
+ * a `Writable` stream.
+ *
+ * `process.stderr` differs from other Node.js streams in important ways. See `note on process I/O` for more information.
+ */
+ stderr: WriteStream & {
+ fd: 2;
+ };
+ /**
+ * The `process.stdin` property returns a stream connected to`stdin` (fd `0`). It is a `net.Socket` (which is a `Duplex` stream) unless fd `0` refers to a file, in which case it is
+ * a `Readable` stream.
+ *
+ * For details of how to read from `stdin` see `readable.read()`.
+ *
+ * As a `Duplex` stream, `process.stdin` can also be used in "old" mode that
+ * is compatible with scripts written for Node.js prior to v0.10\.
+ * For more information see `Stream compatibility`.
+ *
+ * In "old" streams mode the `stdin` stream is paused by default, so one
+ * must call `process.stdin.resume()` to read from it. Note also that calling`process.stdin.resume()` itself would switch stream to "old" mode.
+ */
+ stdin: ReadStream & {
+ fd: 0;
+ };
+ openStdin(): Socket;
+ /**
+ * The `process.argv` property returns an array containing the command-line
+ * arguments passed when the Node.js process was launched. The first element will
+ * be {@link execPath}. See `process.argv0` if access to the original value
+ * of `argv[0]` is needed. The second element will be the path to the JavaScript
+ * file being executed. The remaining elements will be any additional command-line
+ * arguments.
+ *
+ * For example, assuming the following script for `process-args.js`:
+ *
+ * ```js
+ * import { argv } from 'process';
+ *
+ * // print process.argv
+ * argv.forEach((val, index) => {
+ * console.log(`${index}: ${val}`);
+ * });
+ * ```
+ *
+ * Launching the Node.js process as:
+ *
+ * ```console
+ * $ node process-args.js one two=three four
+ * ```
+ *
+ * Would generate the output:
+ *
+ * ```text
+ * 0: /usr/local/bin/node
+ * 1: /Users/mjr/work/node/process-args.js
+ * 2: one
+ * 3: two=three
+ * 4: four
+ * ```
+ * @since v0.1.27
+ */
+ argv: string[];
+ /**
+ * The `process.argv0` property stores a read-only copy of the original value of`argv[0]` passed when Node.js starts.
+ *
+ * ```console
+ * $ bash -c 'exec -a customArgv0 ./node'
+ * > process.argv[0]
+ * '/Volumes/code/external/node/out/Release/node'
+ * > process.argv0
+ * 'customArgv0'
+ * ```
+ * @since v6.4.0
+ */
+ argv0: string;
+ /**
+ * The `process.execArgv` property returns the set of Node.js-specific command-line
+ * options passed when the Node.js process was launched. These options do not
+ * appear in the array returned by the {@link argv} property, and do not
+ * include the Node.js executable, the name of the script, or any options following
+ * the script name. These options are useful in order to spawn child processes with
+ * the same execution environment as the parent.
+ *
+ * ```console
+ * $ node --harmony script.js --version
+ * ```
+ *
+ * Results in `process.execArgv`:
+ *
+ * ```js
+ * ['--harmony']
+ * ```
+ *
+ * And `process.argv`:
+ *
+ * ```js
+ * ['/usr/local/bin/node', 'script.js', '--version']
+ * ```
+ *
+ * Refer to `Worker constructor` for the detailed behavior of worker
+ * threads with this property.
+ * @since v0.7.7
+ */
+ execArgv: string[];
+ /**
+ * The `process.execPath` property returns the absolute pathname of the executable
+ * that started the Node.js process. Symbolic links, if any, are resolved.
+ *
+ * ```js
+ * '/usr/local/bin/node'
+ * ```
+ * @since v0.1.100
+ */
+ execPath: string;
+ /**
+ * The `process.abort()` method causes the Node.js process to exit immediately and
+ * generate a core file.
+ *
+ * This feature is not available in `Worker` threads.
+ * @since v0.7.0
+ */
+ abort(): never;
+ /**
+ * The `process.chdir()` method changes the current working directory of the
+ * Node.js process or throws an exception if doing so fails (for instance, if
+ * the specified `directory` does not exist).
+ *
+ * ```js
+ * import { chdir, cwd } from 'process';
+ *
+ * console.log(`Starting directory: ${cwd()}`);
+ * try {
+ * chdir('/tmp');
+ * console.log(`New directory: ${cwd()}`);
+ * } catch (err) {
+ * console.error(`chdir: ${err}`);
+ * }
+ * ```
+ *
+ * This feature is not available in `Worker` threads.
+ * @since v0.1.17
+ */
+ chdir(directory: string): void;
+ /**
+ * The `process.cwd()` method returns the current working directory of the Node.js
+ * process.
+ *
+ * ```js
+ * import { cwd } from 'process';
+ *
+ * console.log(`Current directory: ${cwd()}`);
+ * ```
+ * @since v0.1.8
+ */
+ cwd(): string;
+ /**
+ * The port used by the Node.js debugger when enabled.
+ *
+ * ```js
+ * import process from 'process';
+ *
+ * process.debugPort = 5858;
+ * ```
+ * @since v0.7.2
+ */
+ debugPort: number;
+ /**
+ * The `process.emitWarning()` method can be used to emit custom or application
+ * specific process warnings. These can be listened for by adding a handler to the `'warning'` event.
+ *
+ * ```js
+ * import { emitWarning } from 'process';
+ *
+ * // Emit a warning with a code and additional detail.
+ * emitWarning('Something happened!', {
+ * code: 'MY_WARNING',
+ * detail: 'This is some additional information'
+ * });
+ * // Emits:
+ * // (node:56338) [MY_WARNING] Warning: Something happened!
+ * // This is some additional information
+ * ```
+ *
+ * In this example, an `Error` object is generated internally by`process.emitWarning()` and passed through to the `'warning'` handler.
+ *
+ * ```js
+ * import process from 'process';
+ *
+ * process.on('warning', (warning) => {
+ * console.warn(warning.name); // 'Warning'
+ * console.warn(warning.message); // 'Something happened!'
+ * console.warn(warning.code); // 'MY_WARNING'
+ * console.warn(warning.stack); // Stack trace
+ * console.warn(warning.detail); // 'This is some additional information'
+ * });
+ * ```
+ *
+ * If `warning` is passed as an `Error` object, the `options` argument is ignored.
+ * @since v8.0.0
+ * @param warning The warning to emit.
+ */
+ emitWarning(warning: string | Error, ctor?: Function): void;
+ emitWarning(warning: string | Error, type?: string, ctor?: Function): void;
+ emitWarning(warning: string | Error, type?: string, code?: string, ctor?: Function): void;
+ emitWarning(warning: string | Error, options?: EmitWarningOptions): void;
+ /**
+ * The `process.env` property returns an object containing the user environment.
+ * See [`environ(7)`](http://man7.org/linux/man-pages/man7/environ.7.html).
+ *
+ * An example of this object looks like:
+ *
+ * ```js
+ * {
+ * TERM: 'xterm-256color',
+ * SHELL: '/usr/local/bin/bash',
+ * USER: 'maciej',
+ * PATH: '~/.bin/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin',
+ * PWD: '/Users/maciej',
+ * EDITOR: 'vim',
+ * SHLVL: '1',
+ * HOME: '/Users/maciej',
+ * LOGNAME: 'maciej',
+ * _: '/usr/local/bin/node'
+ * }
+ * ```
+ *
+ * It is possible to modify this object, but such modifications will not be
+ * reflected outside the Node.js process, or (unless explicitly requested)
+ * to other `Worker` threads.
+ * In other words, the following example would not work:
+ *
+ * ```console
+ * $ node -e 'process.env.foo = "bar"' &#x26;&#x26; echo $foo
+ * ```
+ *
+ * While the following will:
+ *
+ * ```js
+ * import { env } from 'process';
+ *
+ * env.foo = 'bar';
+ * console.log(env.foo);
+ * ```
+ *
+ * Assigning a property on `process.env` will implicitly convert the value
+ * to a string. **This behavior is deprecated.** Future versions of Node.js may
+ * throw an error when the value is not a string, number, or boolean.
+ *
+ * ```js
+ * import { env } from 'process';
+ *
+ * env.test = null;
+ * console.log(env.test);
+ * // => 'null'
+ * env.test = undefined;
+ * console.log(env.test);
+ * // => 'undefined'
+ * ```
+ *
+ * Use `delete` to delete a property from `process.env`.
+ *
+ * ```js
+ * import { env } from 'process';
+ *
+ * env.TEST = 1;
+ * delete env.TEST;
+ * console.log(env.TEST);
+ * // => undefined
+ * ```
+ *
+ * On Windows operating systems, environment variables are case-insensitive.
+ *
+ * ```js
+ * import { env } from 'process';
+ *
+ * env.TEST = 1;
+ * console.log(env.test);
+ * // => 1
+ * ```
+ *
+ * Unless explicitly specified when creating a `Worker` instance,
+ * each `Worker` thread has its own copy of `process.env`, based on its
+ * parent thread’s `process.env`, or whatever was specified as the `env` option
+ * to the `Worker` constructor. Changes to `process.env` will not be visible
+ * across `Worker` threads, and only the main thread can make changes that
+ * are visible to the operating system or to native add-ons.
+ * @since v0.1.27
+ */
+ env: ProcessEnv;
+ /**
+ * The `process.exit()` method instructs Node.js to terminate the process
+ * synchronously with an exit status of `code`. If `code` is omitted, exit uses
+ * either the 'success' code `0` or the value of `process.exitCode` if it has been
+ * set. Node.js will not terminate until all the `'exit'` event listeners are
+ * called.
+ *
+ * To exit with a 'failure' code:
+ *
+ * ```js
+ * import { exit } from 'process';
+ *
+ * exit(1);
+ * ```
+ *
+ * The shell that executed Node.js should see the exit code as `1`.
+ *
+ * Calling `process.exit()` will force the process to exit as quickly as possible
+ * even if there are still asynchronous operations pending that have not yet
+ * completed fully, including I/O operations to `process.stdout` and`process.stderr`.
+ *
+ * In most situations, it is not actually necessary to call `process.exit()`explicitly. The Node.js process will exit on its own _if there is no additional_
+ * _work pending_ in the event loop. The `process.exitCode` property can be set to
+ * tell the process which exit code to use when the process exits gracefully.
+ *
+ * For instance, the following example illustrates a _misuse_ of the`process.exit()` method that could lead to data printed to stdout being
+ * truncated and lost:
+ *
+ * ```js
+ * import { exit } from 'process';
+ *
+ * // This is an example of what *not* to do:
+ * if (someConditionNotMet()) {
+ * printUsageToStdout();
+ * exit(1);
+ * }
+ * ```
+ *
+ * The reason this is problematic is because writes to `process.stdout` in Node.js
+ * are sometimes _asynchronous_ and may occur over multiple ticks of the Node.js
+ * event loop. Calling `process.exit()`, however, forces the process to exit _before_ those additional writes to `stdout` can be performed.
+ *
+ * Rather than calling `process.exit()` directly, the code _should_ set the`process.exitCode` and allow the process to exit naturally by avoiding
+ * scheduling any additional work for the event loop:
+ *
+ * ```js
+ * import process from 'process';
+ *
+ * // How to properly set the exit code while letting
+ * // the process exit gracefully.
+ * if (someConditionNotMet()) {
+ * printUsageToStdout();
+ * process.exitCode = 1;
+ * }
+ * ```
+ *
+ * If it is necessary to terminate the Node.js process due to an error condition,
+ * throwing an _uncaught_ error and allowing the process to terminate accordingly
+ * is safer than calling `process.exit()`.
+ *
+ * In `Worker` threads, this function stops the current thread rather
+ * than the current process.
+ * @since v0.1.13
+ * @param [code=0] The exit code.
+ */
+ exit(code?: number): never;
+ /**
+ * A number which will be the process exit code, when the process either
+ * exits gracefully, or is exited via {@link exit} without specifying
+ * a code.
+ *
+ * Specifying a code to {@link exit} will override any
+ * previous setting of `process.exitCode`.
+ * @since v0.11.8
+ */
+ exitCode?: number | undefined;
+ /**
+ * The `process.getgid()` method returns the numerical group identity of the
+ * process. (See [`getgid(2)`](http://man7.org/linux/man-pages/man2/getgid.2.html).)
+ *
+ * ```js
+ * import process from 'process';
+ *
+ * if (process.getgid) {
+ * console.log(`Current gid: ${process.getgid()}`);
+ * }
+ * ```
+ *
+ * This function is only available on POSIX platforms (i.e. not Windows or
+ * Android).
+ * @since v0.1.31
+ */
+ getgid?: () => number;
+ /**
+ * The `process.setgid()` method sets the group identity of the process. (See [`setgid(2)`](http://man7.org/linux/man-pages/man2/setgid.2.html).) The `id` can be passed as either a
+ * numeric ID or a group name
+ * string. If a group name is specified, this method blocks while resolving the
+ * associated numeric ID.
+ *
+ * ```js
+ * import process from 'process';
+ *
+ * if (process.getgid &#x26;&#x26; process.setgid) {
+ * console.log(`Current gid: ${process.getgid()}`);
+ * try {
+ * process.setgid(501);
+ * console.log(`New gid: ${process.getgid()}`);
+ * } catch (err) {
+ * console.log(`Failed to set gid: ${err}`);
+ * }
+ * }
+ * ```
+ *
+ * This function is only available on POSIX platforms (i.e. not Windows or
+ * Android).
+ * This feature is not available in `Worker` threads.
+ * @since v0.1.31
+ * @param id The group name or ID
+ */
+ setgid?: (id: number | string) => void;
+ /**
+ * The `process.getuid()` method returns the numeric user identity of the process.
+ * (See [`getuid(2)`](http://man7.org/linux/man-pages/man2/getuid.2.html).)
+ *
+ * ```js
+ * import process from 'process';
+ *
+ * if (process.getuid) {
+ * console.log(`Current uid: ${process.getuid()}`);
+ * }
+ * ```
+ *
+ * This function is only available on POSIX platforms (i.e. not Windows or
+ * Android).
+ * @since v0.1.28
+ */
+ getuid?: () => number;
+ /**
+ * The `process.setuid(id)` method sets the user identity of the process. (See [`setuid(2)`](http://man7.org/linux/man-pages/man2/setuid.2.html).) The `id` can be passed as either a
+ * numeric ID or a username string.
+ * If a username is specified, the method blocks while resolving the associated
+ * numeric ID.
+ *
+ * ```js
+ * import process from 'process';
+ *
+ * if (process.getuid &#x26;&#x26; process.setuid) {
+ * console.log(`Current uid: ${process.getuid()}`);
+ * try {
+ * process.setuid(501);
+ * console.log(`New uid: ${process.getuid()}`);
+ * } catch (err) {
+ * console.log(`Failed to set uid: ${err}`);
+ * }
+ * }
+ * ```
+ *
+ * This function is only available on POSIX platforms (i.e. not Windows or
+ * Android).
+ * This feature is not available in `Worker` threads.
+ * @since v0.1.28
+ */
+ setuid?: (id: number | string) => void;
+ /**
+ * The `process.geteuid()` method returns the numerical effective user identity of
+ * the process. (See [`geteuid(2)`](http://man7.org/linux/man-pages/man2/geteuid.2.html).)
+ *
+ * ```js
+ * import process from 'process';
+ *
+ * if (process.geteuid) {
+ * console.log(`Current uid: ${process.geteuid()}`);
+ * }
+ * ```
+ *
+ * This function is only available on POSIX platforms (i.e. not Windows or
+ * Android).
+ * @since v2.0.0
+ */
+ geteuid?: () => number;
+ /**
+ * The `process.seteuid()` method sets the effective user identity of the process.
+ * (See [`seteuid(2)`](http://man7.org/linux/man-pages/man2/seteuid.2.html).) The `id` can be passed as either a numeric ID or a username
+ * string. If a username is specified, the method blocks while resolving the
+ * associated numeric ID.
+ *
+ * ```js
+ * import process from 'process';
+ *
+ * if (process.geteuid &#x26;&#x26; process.seteuid) {
+ * console.log(`Current uid: ${process.geteuid()}`);
+ * try {
+ * process.seteuid(501);
+ * console.log(`New uid: ${process.geteuid()}`);
+ * } catch (err) {
+ * console.log(`Failed to set uid: ${err}`);
+ * }
+ * }
+ * ```
+ *
+ * This function is only available on POSIX platforms (i.e. not Windows or
+ * Android).
+ * This feature is not available in `Worker` threads.
+ * @since v2.0.0
+ * @param id A user name or ID
+ */
+ seteuid?: (id: number | string) => void;
+ /**
+ * The `process.getegid()` method returns the numerical effective group identity
+ * of the Node.js process. (See [`getegid(2)`](http://man7.org/linux/man-pages/man2/getegid.2.html).)
+ *
+ * ```js
+ * import process from 'process';
+ *
+ * if (process.getegid) {
+ * console.log(`Current gid: ${process.getegid()}`);
+ * }
+ * ```
+ *
+ * This function is only available on POSIX platforms (i.e. not Windows or
+ * Android).
+ * @since v2.0.0
+ */
+ getegid?: () => number;
+ /**
+ * The `process.setegid()` method sets the effective group identity of the process.
+ * (See [`setegid(2)`](http://man7.org/linux/man-pages/man2/setegid.2.html).) The `id` can be passed as either a numeric ID or a group
+ * name string. If a group name is specified, this method blocks while resolving
+ * the associated a numeric ID.
+ *
+ * ```js
+ * import process from 'process';
+ *
+ * if (process.getegid &#x26;&#x26; process.setegid) {
+ * console.log(`Current gid: ${process.getegid()}`);
+ * try {
+ * process.setegid(501);
+ * console.log(`New gid: ${process.getegid()}`);
+ * } catch (err) {
+ * console.log(`Failed to set gid: ${err}`);
+ * }
+ * }
+ * ```
+ *
+ * This function is only available on POSIX platforms (i.e. not Windows or
+ * Android).
+ * This feature is not available in `Worker` threads.
+ * @since v2.0.0
+ * @param id A group name or ID
+ */
+ setegid?: (id: number | string) => void;
+ /**
+ * The `process.getgroups()` method returns an array with the supplementary group
+ * IDs. POSIX leaves it unspecified if the effective group ID is included but
+ * Node.js ensures it always is.
+ *
+ * ```js
+ * import process from 'process';
+ *
+ * if (process.getgroups) {
+ * console.log(process.getgroups()); // [ 16, 21, 297 ]
+ * }
+ * ```
+ *
+ * This function is only available on POSIX platforms (i.e. not Windows or
+ * Android).
+ * @since v0.9.4
+ */
+ getgroups?: () => number[];
+ /**
+ * The `process.setgroups()` method sets the supplementary group IDs for the
+ * Node.js process. This is a privileged operation that requires the Node.js
+ * process to have `root` or the `CAP_SETGID` capability.
+ *
+ * The `groups` array can contain numeric group IDs, group names, or both.
+ *
+ * ```js
+ * import process from 'process';
+ *
+ * if (process.getgroups &#x26;&#x26; process.setgroups) {
+ * try {
+ * process.setgroups([501]);
+ * console.log(process.getgroups()); // new groups
+ * } catch (err) {
+ * console.log(`Failed to set groups: ${err}`);
+ * }
+ * }
+ * ```
+ *
+ * This function is only available on POSIX platforms (i.e. not Windows or
+ * Android).
+ * This feature is not available in `Worker` threads.
+ * @since v0.9.4
+ */
+ setgroups?: (groups: ReadonlyArray<string | number>) => void;
+ /**
+ * The `process.setUncaughtExceptionCaptureCallback()` function sets a function
+ * that will be invoked when an uncaught exception occurs, which will receive the
+ * exception value itself as its first argument.
+ *
+ * If such a function is set, the `'uncaughtException'` event will
+ * not be emitted. If `--abort-on-uncaught-exception` was passed from the
+ * command line or set through `v8.setFlagsFromString()`, the process will
+ * not abort. Actions configured to take place on exceptions such as report
+ * generations will be affected too
+ *
+ * To unset the capture function,`process.setUncaughtExceptionCaptureCallback(null)` may be used. Calling this
+ * method with a non-`null` argument while another capture function is set will
+ * throw an error.
+ *
+ * Using this function is mutually exclusive with using the deprecated `domain` built-in module.
+ * @since v9.3.0
+ */
+ setUncaughtExceptionCaptureCallback(cb: ((err: Error) => void) | null): void;
+ /**
+ * Indicates whether a callback has been set using {@link setUncaughtExceptionCaptureCallback}.
+ * @since v9.3.0
+ */
+ hasUncaughtExceptionCaptureCallback(): boolean;
+ /**
+ * The `process.version` property contains the Node.js version string.
+ *
+ * ```js
+ * import { version } from 'process';
+ *
+ * console.log(`Version: ${version}`);
+ * // Version: v14.8.0
+ * ```
+ *
+ * To get the version string without the prepended _v_, use`process.versions.node`.
+ * @since v0.1.3
+ */
+ readonly version: string;
+ /**
+ * The `process.versions` property returns an object listing the version strings of
+ * Node.js and its dependencies. `process.versions.modules` indicates the current
+ * ABI version, which is increased whenever a C++ API changes. Node.js will refuse
+ * to load modules that were compiled against a different module ABI version.
+ *
+ * ```js
+ * import { versions } from 'process';
+ *
+ * console.log(versions);
+ * ```
+ *
+ * Will generate an object similar to:
+ *
+ * ```console
+ * { node: '11.13.0',
+ * v8: '7.0.276.38-node.18',
+ * uv: '1.27.0',
+ * zlib: '1.2.11',
+ * brotli: '1.0.7',
+ * ares: '1.15.0',
+ * modules: '67',
+ * nghttp2: '1.34.0',
+ * napi: '4',
+ * llhttp: '1.1.1',
+ * openssl: '1.1.1b',
+ * cldr: '34.0',
+ * icu: '63.1',
+ * tz: '2018e',
+ * unicode: '11.0' }
+ * ```
+ * @since v0.2.0
+ */
+ readonly versions: ProcessVersions;
+ /**
+ * The `process.config` property returns an `Object` containing the JavaScript
+ * representation of the configure options used to compile the current Node.js
+ * executable. This is the same as the `config.gypi` file that was produced when
+ * running the `./configure` script.
+ *
+ * An example of the possible output looks like:
+ *
+ * ```js
+ * {
+ * target_defaults:
+ * { cflags: [],
+ * default_configuration: 'Release',
+ * defines: [],
+ * include_dirs: [],
+ * libraries: [] },
+ * variables:
+ * {
+ * host_arch: 'x64',
+ * napi_build_version: 5,
+ * node_install_npm: 'true',
+ * node_prefix: '',
+ * node_shared_cares: 'false',
+ * node_shared_http_parser: 'false',
+ * node_shared_libuv: 'false',
+ * node_shared_zlib: 'false',
+ * node_use_dtrace: 'false',
+ * node_use_openssl: 'true',
+ * node_shared_openssl: 'false',
+ * strict_aliasing: 'true',
+ * target_arch: 'x64',
+ * v8_use_snapshot: 1
+ * }
+ * }
+ * ```
+ *
+ * The `process.config` property is **not** read-only and there are existing
+ * modules in the ecosystem that are known to extend, modify, or entirely replace
+ * the value of `process.config`.
+ *
+ * Modifying the `process.config` property, or any child-property of the`process.config` object has been deprecated. The `process.config` will be made
+ * read-only in a future release.
+ * @since v0.7.7
+ */
+ readonly config: ProcessConfig;
+ /**
+ * The `process.kill()` method sends the `signal` to the process identified by`pid`.
+ *
+ * Signal names are strings such as `'SIGINT'` or `'SIGHUP'`. See `Signal Events` and [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) for more information.
+ *
+ * This method will throw an error if the target `pid` does not exist. As a special
+ * case, a signal of `0` can be used to test for the existence of a process.
+ * Windows platforms will throw an error if the `pid` is used to kill a process
+ * group.
+ *
+ * Even though the name of this function is `process.kill()`, it is really just a
+ * signal sender, like the `kill` system call. The signal sent may do something
+ * other than kill the target process.
+ *
+ * ```js
+ * import process, { kill } from 'process';
+ *
+ * process.on('SIGHUP', () => {
+ * console.log('Got SIGHUP signal.');
+ * });
+ *
+ * setTimeout(() => {
+ * console.log('Exiting.');
+ * process.exit(0);
+ * }, 100);
+ *
+ * kill(process.pid, 'SIGHUP');
+ * ```
+ *
+ * When `SIGUSR1` is received by a Node.js process, Node.js will start the
+ * debugger. See `Signal Events`.
+ * @since v0.0.6
+ * @param pid A process ID
+ * @param [signal='SIGTERM'] The signal to send, either as a string or number.
+ */
+ kill(pid: number, signal?: string | number): true;
+ /**
+ * The `process.pid` property returns the PID of the process.
+ *
+ * ```js
+ * import { pid } from 'process';
+ *
+ * console.log(`This process is pid ${pid}`);
+ * ```
+ * @since v0.1.15
+ */
+ readonly pid: number;
+ /**
+ * The `process.ppid` property returns the PID of the parent of the
+ * current process.
+ *
+ * ```js
+ * import { ppid } from 'process';
+ *
+ * console.log(`The parent process is pid ${ppid}`);
+ * ```
+ * @since v9.2.0, v8.10.0, v6.13.0
+ */
+ readonly ppid: number;
+ /**
+ * The `process.title` property returns the current process title (i.e. returns
+ * the current value of `ps`). Assigning a new value to `process.title` modifies
+ * the current value of `ps`.
+ *
+ * When a new value is assigned, different platforms will impose different maximum
+ * length restrictions on the title. Usually such restrictions are quite limited.
+ * For instance, on Linux and macOS, `process.title` is limited to the size of the
+ * binary name plus the length of the command-line arguments because setting the`process.title` overwrites the `argv` memory of the process. Node.js v0.8
+ * allowed for longer process title strings by also overwriting the `environ`memory but that was potentially insecure and confusing in some (rather obscure)
+ * cases.
+ *
+ * Assigning a value to `process.title` might not result in an accurate label
+ * within process manager applications such as macOS Activity Monitor or Windows
+ * Services Manager.
+ * @since v0.1.104
+ */
+ title: string;
+ /**
+ * The operating system CPU architecture for which the Node.js binary was compiled.
+ * Possible values are: `'arm'`, `'arm64'`, `'ia32'`, `'mips'`,`'mipsel'`, `'ppc'`,`'ppc64'`, `'s390'`, `'s390x'`, and `'x64'`.
+ *
+ * ```js
+ * import { arch } from 'process';
+ *
+ * console.log(`This processor architecture is ${arch}`);
+ * ```
+ * @since v0.5.0
+ */
+ readonly arch: Architecture;
+ /**
+ * The `process.platform` property returns a string identifying the operating
+ * system platform for which the Node.js binary was compiled.
+ *
+ * Currently possible values are:
+ *
+ * * `'aix'`
+ * * `'darwin'`
+ * * `'freebsd'`
+ * * `'linux'`
+ * * `'openbsd'`
+ * * `'sunos'`
+ * * `'win32'`
+ *
+ * ```js
+ * import { platform } from 'process';
+ *
+ * console.log(`This platform is ${platform}`);
+ * ```
+ *
+ * The value `'android'` may also be returned if the Node.js is built on the
+ * Android operating system. However, Android support in Node.js [is experimental](https://github.com/nodejs/node/blob/HEAD/BUILDING.md#androidandroid-based-devices-eg-firefox-os).
+ * @since v0.1.16
+ */
+ readonly platform: Platform;
+ /**
+ * The `process.mainModule` property provides an alternative way of retrieving `require.main`. The difference is that if the main module changes at
+ * runtime, `require.main` may still refer to the original main module in
+ * modules that were required before the change occurred. Generally, it's
+ * safe to assume that the two refer to the same module.
+ *
+ * As with `require.main`, `process.mainModule` will be `undefined` if there
+ * is no entry script.
+ * @since v0.1.17
+ * @deprecated Since v14.0.0 - Use `main` instead.
+ */
+ mainModule?: Module | undefined;
+ memoryUsage: MemoryUsageFn;
+ /**
+ * Gets the amount of memory available to the process (in bytes) based on
+ * limits imposed by the OS. If there is no such constraint, or the constraint
+ * is unknown, `undefined` is returned.
+ */
+ constrainedMemory(): number | undefined;
+ /**
+ * The `process.cpuUsage()` method returns the user and system CPU time usage of
+ * the current process, in an object with properties `user` and `system`, whose
+ * values are microsecond values (millionth of a second). These values measure time
+ * spent in user and system code respectively, and may end up being greater than
+ * actual elapsed time if multiple CPU cores are performing work for this process.
+ *
+ * The result of a previous call to `process.cpuUsage()` can be passed as the
+ * argument to the function, to get a diff reading.
+ *
+ * ```js
+ * import { cpuUsage } from 'process';
+ *
+ * const startUsage = cpuUsage();
+ * // { user: 38579, system: 6986 }
+ *
+ * // spin the CPU for 500 milliseconds
+ * const now = Date.now();
+ * while (Date.now() - now < 500);
+ *
+ * console.log(cpuUsage(startUsage));
+ * // { user: 514883, system: 11226 }
+ * ```
+ * @since v6.1.0
+ * @param previousValue A previous return value from calling `process.cpuUsage()`
+ */
+ cpuUsage(previousValue?: CpuUsage): CpuUsage;
+ /**
+ * `process.nextTick()` adds `callback` to the "next tick queue". This queue is
+ * fully drained after the current operation on the JavaScript stack runs to
+ * completion and before the event loop is allowed to continue. It's possible to
+ * create an infinite loop if one were to recursively call `process.nextTick()`.
+ * See the [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#process-nexttick) guide for more background.
+ *
+ * ```js
+ * import { nextTick } from 'process';
+ *
+ * console.log('start');
+ * nextTick(() => {
+ * console.log('nextTick callback');
+ * });
+ * console.log('scheduled');
+ * // Output:
+ * // start
+ * // scheduled
+ * // nextTick callback
+ * ```
+ *
+ * This is important when developing APIs in order to give users the opportunity
+ * to assign event handlers _after_ an object has been constructed but before any
+ * I/O has occurred:
+ *
+ * ```js
+ * import { nextTick } from 'process';
+ *
+ * function MyThing(options) {
+ * this.setupOptions(options);
+ *
+ * nextTick(() => {
+ * this.startDoingStuff();
+ * });
+ * }
+ *
+ * const thing = new MyThing();
+ * thing.getReadyForStuff();
+ *
+ * // thing.startDoingStuff() gets called now, not before.
+ * ```
+ *
+ * It is very important for APIs to be either 100% synchronous or 100%
+ * asynchronous. Consider this example:
+ *
+ * ```js
+ * // WARNING! DO NOT USE! BAD UNSAFE HAZARD!
+ * function maybeSync(arg, cb) {
+ * if (arg) {
+ * cb();
+ * return;
+ * }
+ *
+ * fs.stat('file', cb);
+ * }
+ * ```
+ *
+ * This API is hazardous because in the following case:
+ *
+ * ```js
+ * const maybeTrue = Math.random() > 0.5;
+ *
+ * maybeSync(maybeTrue, () => {
+ * foo();
+ * });
+ *
+ * bar();
+ * ```
+ *
+ * It is not clear whether `foo()` or `bar()` will be called first.
+ *
+ * The following approach is much better:
+ *
+ * ```js
+ * import { nextTick } from 'process';
+ *
+ * function definitelyAsync(arg, cb) {
+ * if (arg) {
+ * nextTick(cb);
+ * return;
+ * }
+ *
+ * fs.stat('file', cb);
+ * }
+ * ```
+ * @since v0.1.26
+ * @param args Additional arguments to pass when invoking the `callback`
+ */
+ nextTick(callback: Function, ...args: any[]): void;
+ /**
+ * The `process.release` property returns an `Object` containing metadata related
+ * to the current release, including URLs for the source tarball and headers-only
+ * tarball.
+ *
+ * `process.release` contains the following properties:
+ *
+ * ```js
+ * {
+ * name: 'node',
+ * lts: 'Erbium',
+ * sourceUrl: 'https://nodejs.org/download/release/v12.18.1/node-v12.18.1.tar.gz',
+ * headersUrl: 'https://nodejs.org/download/release/v12.18.1/node-v12.18.1-headers.tar.gz',
+ * libUrl: 'https://nodejs.org/download/release/v12.18.1/win-x64/node.lib'
+ * }
+ * ```
+ *
+ * In custom builds from non-release versions of the source tree, only the`name` property may be present. The additional properties should not be
+ * relied upon to exist.
+ * @since v3.0.0
+ */
+ readonly release: ProcessRelease;
+ features: {
+ inspector: boolean;
+ debug: boolean;
+ uv: boolean;
+ ipv6: boolean;
+ tls_alpn: boolean;
+ tls_sni: boolean;
+ tls_ocsp: boolean;
+ tls: boolean;
+ };
+ /**
+ * `process.umask()` returns the Node.js process's file mode creation mask. Child
+ * processes inherit the mask from the parent process.
+ * @since v0.1.19
+ * @deprecated Calling `process.umask()` with no argument causes the process-wide umask to be written twice. This introduces a race condition between threads, and is a potential *
+ * security vulnerability. There is no safe, cross-platform alternative API.
+ */
+ umask(): number;
+ /**
+ * Can only be set if not in worker thread.
+ */
+ umask(mask: string | number): number;
+ /**
+ * The `process.uptime()` method returns the number of seconds the current Node.js
+ * process has been running.
+ *
+ * The return value includes fractions of a second. Use `Math.floor()` to get whole
+ * seconds.
+ * @since v0.5.0
+ */
+ uptime(): number;
+ hrtime: HRTime;
+ /**
+ * If Node.js is spawned with an IPC channel, the `process.send()` method can be
+ * used to send messages to the parent process. Messages will be received as a `'message'` event on the parent's `ChildProcess` object.
+ *
+ * If Node.js was not spawned with an IPC channel, `process.send` will be `undefined`.
+ *
+ * The message goes through serialization and parsing. The resulting message might
+ * not be the same as what is originally sent.
+ * @since v0.5.9
+ * @param options used to parameterize the sending of certain types of handles.`options` supports the following properties:
+ */
+ send?(
+ message: any,
+ sendHandle?: any,
+ options?: {
+ swallowErrors?: boolean | undefined;
+ },
+ callback?: (error: Error | null) => void,
+ ): boolean;
+ /**
+ * If the Node.js process is spawned with an IPC channel (see the `Child Process` and `Cluster` documentation), the `process.disconnect()` method will close the
+ * IPC channel to the parent process, allowing the child process to exit gracefully
+ * once there are no other connections keeping it alive.
+ *
+ * The effect of calling `process.disconnect()` is the same as calling `ChildProcess.disconnect()` from the parent process.
+ *
+ * If the Node.js process was not spawned with an IPC channel,`process.disconnect()` will be `undefined`.
+ * @since v0.7.2
+ */
+ disconnect(): void;
+ /**
+ * If the Node.js process is spawned with an IPC channel (see the `Child Process` and `Cluster` documentation), the `process.connected` property will return`true` so long as the IPC
+ * channel is connected and will return `false` after`process.disconnect()` is called.
+ *
+ * Once `process.connected` is `false`, it is no longer possible to send messages
+ * over the IPC channel using `process.send()`.
+ * @since v0.7.2
+ */
+ connected: boolean;
+ /**
+ * The `process.allowedNodeEnvironmentFlags` property is a special,
+ * read-only `Set` of flags allowable within the `NODE_OPTIONS` environment variable.
+ *
+ * `process.allowedNodeEnvironmentFlags` extends `Set`, but overrides`Set.prototype.has` to recognize several different possible flag
+ * representations. `process.allowedNodeEnvironmentFlags.has()` will
+ * return `true` in the following cases:
+ *
+ * * Flags may omit leading single (`-`) or double (`--`) dashes; e.g.,`inspect-brk` for `--inspect-brk`, or `r` for `-r`.
+ * * Flags passed through to V8 (as listed in `--v8-options`) may replace
+ * one or more _non-leading_ dashes for an underscore, or vice-versa;
+ * e.g., `--perf_basic_prof`, `--perf-basic-prof`, `--perf_basic-prof`,
+ * etc.
+ * * Flags may contain one or more equals (`=`) characters; all
+ * characters after and including the first equals will be ignored;
+ * e.g., `--stack-trace-limit=100`.
+ * * Flags _must_ be allowable within `NODE_OPTIONS`.
+ *
+ * When iterating over `process.allowedNodeEnvironmentFlags`, flags will
+ * appear only _once_; each will begin with one or more dashes. Flags
+ * passed through to V8 will contain underscores instead of non-leading
+ * dashes:
+ *
+ * ```js
+ * import { allowedNodeEnvironmentFlags } from 'process';
+ *
+ * allowedNodeEnvironmentFlags.forEach((flag) => {
+ * // -r
+ * // --inspect-brk
+ * // --abort_on_uncaught_exception
+ * // ...
+ * });
+ * ```
+ *
+ * The methods `add()`, `clear()`, and `delete()` of`process.allowedNodeEnvironmentFlags` do nothing, and will fail
+ * silently.
+ *
+ * If Node.js was compiled _without_ `NODE_OPTIONS` support (shown in {@link config}), `process.allowedNodeEnvironmentFlags` will
+ * contain what _would have_ been allowable.
+ * @since v10.10.0
+ */
+ allowedNodeEnvironmentFlags: ReadonlySet<string>;
+ /**
+ * `process.report` is an object whose methods are used to generate diagnostic
+ * reports for the current process. Additional documentation is available in the `report documentation`.
+ * @since v11.8.0
+ */
+ report?: ProcessReport | undefined;
+ /**
+ * ```js
+ * import { resourceUsage } from 'process';
+ *
+ * console.log(resourceUsage());
+ * /*
+ * Will output:
+ * {
+ * userCPUTime: 82872,
+ * systemCPUTime: 4143,
+ * maxRSS: 33164,
+ * sharedMemorySize: 0,
+ * unsharedDataSize: 0,
+ * unsharedStackSize: 0,
+ * minorPageFault: 2469,
+ * majorPageFault: 0,
+ * swappedOut: 0,
+ * fsRead: 0,
+ * fsWrite: 8,
+ * ipcSent: 0,
+ * ipcReceived: 0,
+ * signalsCount: 0,
+ * voluntaryContextSwitches: 79,
+ * involuntaryContextSwitches: 1
+ * }
+ *
+ * ```
+ * @since v12.6.0
+ * @return the resource usage for the current process. All of these values come from the `uv_getrusage` call which returns a [`uv_rusage_t` struct][uv_rusage_t].
+ */
+ resourceUsage(): ResourceUsage;
+ /**
+ * The `process.traceDeprecation` property indicates whether the`--trace-deprecation` flag is set on the current Node.js process. See the
+ * documentation for the `'warning' event` and the `emitWarning() method` for more information about this
+ * flag's behavior.
+ * @since v0.8.0
+ */
+ traceDeprecation: boolean;
+ /* EventEmitter */
+ addListener(event: "beforeExit", listener: BeforeExitListener): this;
+ addListener(event: "disconnect", listener: DisconnectListener): this;
+ addListener(event: "exit", listener: ExitListener): this;
+ addListener(event: "rejectionHandled", listener: RejectionHandledListener): this;
+ addListener(event: "uncaughtException", listener: UncaughtExceptionListener): this;
+ addListener(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this;
+ addListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this;
+ addListener(event: "warning", listener: WarningListener): this;
+ addListener(event: "message", listener: MessageListener): this;
+ addListener(event: Signals, listener: SignalsListener): this;
+ addListener(event: "multipleResolves", listener: MultipleResolveListener): this;
+ addListener(event: "worker", listener: WorkerListener): this;
+ emit(event: "beforeExit", code: number): boolean;
+ emit(event: "disconnect"): boolean;
+ emit(event: "exit", code: number): boolean;
+ emit(event: "rejectionHandled", promise: Promise<unknown>): boolean;
+ emit(event: "uncaughtException", error: Error): boolean;
+ emit(event: "uncaughtExceptionMonitor", error: Error): boolean;
+ emit(event: "unhandledRejection", reason: unknown, promise: Promise<unknown>): boolean;
+ emit(event: "warning", warning: Error): boolean;
+ emit(event: "message", message: unknown, sendHandle: unknown): this;
+ emit(event: Signals, signal?: Signals): boolean;
+ emit(
+ event: "multipleResolves",
+ type: MultipleResolveType,
+ promise: Promise<unknown>,
+ value: unknown,
+ ): this;
+ emit(event: "worker", listener: WorkerListener): this;
+ on(event: "beforeExit", listener: BeforeExitListener): this;
+ on(event: "disconnect", listener: DisconnectListener): this;
+ on(event: "exit", listener: ExitListener): this;
+ on(event: "rejectionHandled", listener: RejectionHandledListener): this;
+ on(event: "uncaughtException", listener: UncaughtExceptionListener): this;
+ on(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this;
+ on(event: "unhandledRejection", listener: UnhandledRejectionListener): this;
+ on(event: "warning", listener: WarningListener): this;
+ on(event: "message", listener: MessageListener): this;
+ on(event: Signals, listener: SignalsListener): this;
+ on(event: "multipleResolves", listener: MultipleResolveListener): this;
+ on(event: "worker", listener: WorkerListener): this;
+ on(event: string | symbol, listener: (...args: any[]) => void): this;
+ once(event: "beforeExit", listener: BeforeExitListener): this;
+ once(event: "disconnect", listener: DisconnectListener): this;
+ once(event: "exit", listener: ExitListener): this;
+ once(event: "rejectionHandled", listener: RejectionHandledListener): this;
+ once(event: "uncaughtException", listener: UncaughtExceptionListener): this;
+ once(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this;
+ once(event: "unhandledRejection", listener: UnhandledRejectionListener): this;
+ once(event: "warning", listener: WarningListener): this;
+ once(event: "message", listener: MessageListener): this;
+ once(event: Signals, listener: SignalsListener): this;
+ once(event: "multipleResolves", listener: MultipleResolveListener): this;
+ once(event: "worker", listener: WorkerListener): this;
+ once(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependListener(event: "beforeExit", listener: BeforeExitListener): this;
+ prependListener(event: "disconnect", listener: DisconnectListener): this;
+ prependListener(event: "exit", listener: ExitListener): this;
+ prependListener(event: "rejectionHandled", listener: RejectionHandledListener): this;
+ prependListener(event: "uncaughtException", listener: UncaughtExceptionListener): this;
+ prependListener(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this;
+ prependListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this;
+ prependListener(event: "warning", listener: WarningListener): this;
+ prependListener(event: "message", listener: MessageListener): this;
+ prependListener(event: Signals, listener: SignalsListener): this;
+ prependListener(event: "multipleResolves", listener: MultipleResolveListener): this;
+ prependListener(event: "worker", listener: WorkerListener): this;
+ prependOnceListener(event: "beforeExit", listener: BeforeExitListener): this;
+ prependOnceListener(event: "disconnect", listener: DisconnectListener): this;
+ prependOnceListener(event: "exit", listener: ExitListener): this;
+ prependOnceListener(event: "rejectionHandled", listener: RejectionHandledListener): this;
+ prependOnceListener(event: "uncaughtException", listener: UncaughtExceptionListener): this;
+ prependOnceListener(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this;
+ prependOnceListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this;
+ prependOnceListener(event: "warning", listener: WarningListener): this;
+ prependOnceListener(event: "message", listener: MessageListener): this;
+ prependOnceListener(event: Signals, listener: SignalsListener): this;
+ prependOnceListener(event: "multipleResolves", listener: MultipleResolveListener): this;
+ prependOnceListener(event: "worker", listener: WorkerListener): this;
+ listeners(event: "beforeExit"): BeforeExitListener[];
+ listeners(event: "disconnect"): DisconnectListener[];
+ listeners(event: "exit"): ExitListener[];
+ listeners(event: "rejectionHandled"): RejectionHandledListener[];
+ listeners(event: "uncaughtException"): UncaughtExceptionListener[];
+ listeners(event: "uncaughtExceptionMonitor"): UncaughtExceptionListener[];
+ listeners(event: "unhandledRejection"): UnhandledRejectionListener[];
+ listeners(event: "warning"): WarningListener[];
+ listeners(event: "message"): MessageListener[];
+ listeners(event: Signals): SignalsListener[];
+ listeners(event: "multipleResolves"): MultipleResolveListener[];
+ listeners(event: "worker"): WorkerListener[];
+ }
+ }
+ }
+ export = process;
+}
+declare module "node:process" {
+ import process = require("process");
+ export = process;
+}
diff --git a/client/node_modules/@types/node/punycode.d.ts b/client/node_modules/@types/node/punycode.d.ts
new file mode 100644
index 0000000..cfe559b
--- /dev/null
+++ b/client/node_modules/@types/node/punycode.d.ts
@@ -0,0 +1,117 @@
+/**
+ * **The version of the punycode module bundled in Node.js is being deprecated.**In a future major version of Node.js this module will be removed. Users
+ * currently depending on the `punycode` module should switch to using the
+ * userland-provided [Punycode.js](https://github.com/bestiejs/punycode.js) module instead. For punycode-based URL
+ * encoding, see `url.domainToASCII` or, more generally, the `WHATWG URL API`.
+ *
+ * The `punycode` module is a bundled version of the [Punycode.js](https://github.com/bestiejs/punycode.js) module. It
+ * can be accessed using:
+ *
+ * ```js
+ * const punycode = require('punycode');
+ * ```
+ *
+ * [Punycode](https://tools.ietf.org/html/rfc3492) is a character encoding scheme defined by RFC 3492 that is
+ * primarily intended for use in Internationalized Domain Names. Because host
+ * names in URLs are limited to ASCII characters only, Domain Names that contain
+ * non-ASCII characters must be converted into ASCII using the Punycode scheme.
+ * For instance, the Japanese character that translates into the English word,`'example'` is `'例'`. The Internationalized Domain Name, `'例.com'` (equivalent
+ * to `'example.com'`) is represented by Punycode as the ASCII string`'xn--fsq.com'`.
+ *
+ * The `punycode` module provides a simple implementation of the Punycode standard.
+ *
+ * The `punycode` module is a third-party dependency used by Node.js and
+ * made available to developers as a convenience. Fixes or other modifications to
+ * the module must be directed to the [Punycode.js](https://github.com/bestiejs/punycode.js) project.
+ * @deprecated Since v7.0.0 - Deprecated
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/punycode.js)
+ */
+declare module "punycode" {
+ /**
+ * The `punycode.decode()` method converts a [Punycode](https://tools.ietf.org/html/rfc3492) string of ASCII-only
+ * characters to the equivalent string of Unicode codepoints.
+ *
+ * ```js
+ * punycode.decode('maana-pta'); // 'mañana'
+ * punycode.decode('--dqo34k'); // '☃-⌘'
+ * ```
+ * @since v0.5.1
+ */
+ function decode(string: string): string;
+ /**
+ * The `punycode.encode()` method converts a string of Unicode codepoints to a [Punycode](https://tools.ietf.org/html/rfc3492) string of ASCII-only characters.
+ *
+ * ```js
+ * punycode.encode('mañana'); // 'maana-pta'
+ * punycode.encode('☃-⌘'); // '--dqo34k'
+ * ```
+ * @since v0.5.1
+ */
+ function encode(string: string): string;
+ /**
+ * The `punycode.toUnicode()` method converts a string representing a domain name
+ * containing [Punycode](https://tools.ietf.org/html/rfc3492) encoded characters into Unicode. Only the [Punycode](https://tools.ietf.org/html/rfc3492) encoded parts of the domain name are be
+ * converted.
+ *
+ * ```js
+ * // decode domain names
+ * punycode.toUnicode('xn--maana-pta.com'); // 'mañana.com'
+ * punycode.toUnicode('xn----dqo34k.com'); // '☃-⌘.com'
+ * punycode.toUnicode('example.com'); // 'example.com'
+ * ```
+ * @since v0.6.1
+ */
+ function toUnicode(domain: string): string;
+ /**
+ * The `punycode.toASCII()` method converts a Unicode string representing an
+ * Internationalized Domain Name to [Punycode](https://tools.ietf.org/html/rfc3492). Only the non-ASCII parts of the
+ * domain name will be converted. Calling `punycode.toASCII()` on a string that
+ * already only contains ASCII characters will have no effect.
+ *
+ * ```js
+ * // encode domain names
+ * punycode.toASCII('mañana.com'); // 'xn--maana-pta.com'
+ * punycode.toASCII('☃-⌘.com'); // 'xn----dqo34k.com'
+ * punycode.toASCII('example.com'); // 'example.com'
+ * ```
+ * @since v0.6.1
+ */
+ function toASCII(domain: string): string;
+ /**
+ * @deprecated since v7.0.0
+ * The version of the punycode module bundled in Node.js is being deprecated.
+ * In a future major version of Node.js this module will be removed.
+ * Users currently depending on the punycode module should switch to using
+ * the userland-provided Punycode.js module instead.
+ */
+ const ucs2: ucs2;
+ interface ucs2 {
+ /**
+ * @deprecated since v7.0.0
+ * The version of the punycode module bundled in Node.js is being deprecated.
+ * In a future major version of Node.js this module will be removed.
+ * Users currently depending on the punycode module should switch to using
+ * the userland-provided Punycode.js module instead.
+ */
+ decode(string: string): number[];
+ /**
+ * @deprecated since v7.0.0
+ * The version of the punycode module bundled in Node.js is being deprecated.
+ * In a future major version of Node.js this module will be removed.
+ * Users currently depending on the punycode module should switch to using
+ * the userland-provided Punycode.js module instead.
+ */
+ encode(codePoints: readonly number[]): string;
+ }
+ /**
+ * @deprecated since v7.0.0
+ * The version of the punycode module bundled in Node.js is being deprecated.
+ * In a future major version of Node.js this module will be removed.
+ * Users currently depending on the punycode module should switch to using
+ * the userland-provided Punycode.js module instead.
+ */
+ const version: string;
+}
+declare module "node:punycode" {
+ export * from "punycode";
+}
diff --git a/client/node_modules/@types/node/querystring.d.ts b/client/node_modules/@types/node/querystring.d.ts
new file mode 100644
index 0000000..1837171
--- /dev/null
+++ b/client/node_modules/@types/node/querystring.d.ts
@@ -0,0 +1,141 @@
+/**
+ * The `querystring` module provides utilities for parsing and formatting URL
+ * query strings. It can be accessed using:
+ *
+ * ```js
+ * const querystring = require('querystring');
+ * ```
+ *
+ * `querystring` is more performant than `URLSearchParams` but is not a
+ * standardized API. Use `URLSearchParams` when performance is not critical
+ * or when compatibility with browser code is desirable.
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/querystring.js)
+ */
+declare module "querystring" {
+ interface StringifyOptions {
+ encodeURIComponent?: ((str: string) => string) | undefined;
+ }
+ interface ParseOptions {
+ maxKeys?: number | undefined;
+ decodeURIComponent?: ((str: string) => string) | undefined;
+ }
+ interface ParsedUrlQuery extends NodeJS.Dict<string | string[]> {}
+ interface ParsedUrlQueryInput extends
+ NodeJS.Dict<
+ | string
+ | number
+ | boolean
+ | readonly string[]
+ | readonly number[]
+ | readonly boolean[]
+ | null
+ >
+ {}
+ /**
+ * The `querystring.stringify()` method produces a URL query string from a
+ * given `obj` by iterating through the object's "own properties".
+ *
+ * It serializes the following types of values passed in `obj`:[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) |
+ * [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) |
+ * [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) |
+ * [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) |
+ * [string\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) |
+ * [number\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) |
+ * [bigint\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) |
+ * [boolean\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) The numeric values must be finite. Any other input values will be coerced to
+ * empty strings.
+ *
+ * ```js
+ * querystring.stringify({ foo: 'bar', baz: ['qux', 'quux'], corge: '' });
+ * // Returns 'foo=bar&#x26;baz=qux&#x26;baz=quux&#x26;corge='
+ *
+ * querystring.stringify({ foo: 'bar', baz: 'qux' }, ';', ':');
+ * // Returns 'foo:bar;baz:qux'
+ * ```
+ *
+ * By default, characters requiring percent-encoding within the query string will
+ * be encoded as UTF-8\. If an alternative encoding is required, then an alternative`encodeURIComponent` option will need to be specified:
+ *
+ * ```js
+ * // Assuming gbkEncodeURIComponent function already exists,
+ *
+ * querystring.stringify({ w: '中文', foo: 'bar' }, null, null,
+ * { encodeURIComponent: gbkEncodeURIComponent });
+ * ```
+ * @since v0.1.25
+ * @param obj The object to serialize into a URL query string
+ * @param [sep='&'] The substring used to delimit key and value pairs in the query string.
+ * @param [eq='='] . The substring used to delimit keys and values in the query string.
+ */
+ function stringify(obj?: ParsedUrlQueryInput, sep?: string, eq?: string, options?: StringifyOptions): string;
+ /**
+ * The `querystring.parse()` method parses a URL query string (`str`) into a
+ * collection of key and value pairs.
+ *
+ * For example, the query string `'foo=bar&#x26;abc=xyz&#x26;abc=123'` is parsed into:
+ *
+ * ```js
+ * {
+ * foo: 'bar',
+ * abc: ['xyz', '123']
+ * }
+ * ```
+ *
+ * The object returned by the `querystring.parse()` method _does not_prototypically inherit from the JavaScript `Object`. This means that typical`Object` methods such as `obj.toString()`,
+ * `obj.hasOwnProperty()`, and others
+ * are not defined and _will not work_.
+ *
+ * By default, percent-encoded characters within the query string will be assumed
+ * to use UTF-8 encoding. If an alternative character encoding is used, then an
+ * alternative `decodeURIComponent` option will need to be specified:
+ *
+ * ```js
+ * // Assuming gbkDecodeURIComponent function already exists...
+ *
+ * querystring.parse('w=%D6%D0%CE%C4&#x26;foo=bar', null, null,
+ * { decodeURIComponent: gbkDecodeURIComponent });
+ * ```
+ * @since v0.1.25
+ * @param str The URL query string to parse
+ * @param [sep='&'] The substring used to delimit key and value pairs in the query string.
+ * @param [eq='='] . The substring used to delimit keys and values in the query string.
+ */
+ function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): ParsedUrlQuery;
+ /**
+ * The querystring.encode() function is an alias for querystring.stringify().
+ */
+ const encode: typeof stringify;
+ /**
+ * The querystring.decode() function is an alias for querystring.parse().
+ */
+ const decode: typeof parse;
+ /**
+ * The `querystring.escape()` method performs URL percent-encoding on the given`str` in a manner that is optimized for the specific requirements of URL
+ * query strings.
+ *
+ * The `querystring.escape()` method is used by `querystring.stringify()` and is
+ * generally not expected to be used directly. It is exported primarily to allow
+ * application code to provide a replacement percent-encoding implementation if
+ * necessary by assigning `querystring.escape` to an alternative function.
+ * @since v0.1.25
+ */
+ function escape(str: string): string;
+ /**
+ * The `querystring.unescape()` method performs decoding of URL percent-encoded
+ * characters on the given `str`.
+ *
+ * The `querystring.unescape()` method is used by `querystring.parse()` and is
+ * generally not expected to be used directly. It is exported primarily to allow
+ * application code to provide a replacement decoding implementation if
+ * necessary by assigning `querystring.unescape` to an alternative function.
+ *
+ * By default, the `querystring.unescape()` method will attempt to use the
+ * JavaScript built-in `decodeURIComponent()` method to decode. If that fails,
+ * a safer equivalent that does not throw on malformed URLs will be used.
+ * @since v0.1.25
+ */
+ function unescape(str: string): string;
+}
+declare module "node:querystring" {
+ export * from "querystring";
+}
diff --git a/client/node_modules/@types/node/readline.d.ts b/client/node_modules/@types/node/readline.d.ts
new file mode 100644
index 0000000..60ccb8e
--- /dev/null
+++ b/client/node_modules/@types/node/readline.d.ts
@@ -0,0 +1,666 @@
+/**
+ * The `readline` module provides an interface for reading data from a `Readable` stream (such as `process.stdin`) one line at a time.
+ *
+ * To use the promise-based APIs:
+ *
+ * ```js
+ * import * as readline from 'node:readline/promises';
+ * ```
+ *
+ * To use the callback and sync APIs:
+ *
+ * ```js
+ * import * as readline from 'node:readline';
+ * ```
+ *
+ * The following simple example illustrates the basic use of the `readline` module.
+ *
+ * ```js
+ * import * as readline from 'node:readline/promises';
+ * import { stdin as input, stdout as output } from 'node:process';
+ *
+ * const rl = readline.createInterface({ input, output });
+ *
+ * const answer = await rl.question('What do you think of Node.js? ');
+ *
+ * console.log(`Thank you for your valuable feedback: ${answer}`);
+ *
+ * rl.close();
+ * ```
+ *
+ * Once this code is invoked, the Node.js application will not terminate until the`readline.Interface` is closed because the interface waits for data to be
+ * received on the `input` stream.
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/readline.js)
+ */
+declare module "readline" {
+ import { Abortable, EventEmitter } from "node:events";
+ import * as promises from "node:readline/promises";
+
+ export { promises };
+ export interface Key {
+ sequence?: string | undefined;
+ name?: string | undefined;
+ ctrl?: boolean | undefined;
+ meta?: boolean | undefined;
+ shift?: boolean | undefined;
+ }
+ /**
+ * Instances of the `readline.Interface` class are constructed using the`readline.createInterface()` method. Every instance is associated with a
+ * single `input` `Readable` stream and a single `output` `Writable` stream.
+ * The `output` stream is used to print prompts for user input that arrives on,
+ * and is read from, the `input` stream.
+ * @since v0.1.104
+ */
+ export class Interface extends EventEmitter {
+ readonly terminal: boolean;
+ /**
+ * The current input data being processed by node.
+ *
+ * This can be used when collecting input from a TTY stream to retrieve the
+ * current value that has been processed thus far, prior to the `line` event
+ * being emitted. Once the `line` event has been emitted, this property will
+ * be an empty string.
+ *
+ * Be aware that modifying the value during the instance runtime may have
+ * unintended consequences if `rl.cursor` is not also controlled.
+ *
+ * **If not using a TTY stream for input, use the `'line'` event.**
+ *
+ * One possible use case would be as follows:
+ *
+ * ```js
+ * const values = ['lorem ipsum', 'dolor sit amet'];
+ * const rl = readline.createInterface(process.stdin);
+ * const showResults = debounce(() => {
+ * console.log(
+ * '\n',
+ * values.filter((val) => val.startsWith(rl.line)).join(' ')
+ * );
+ * }, 300);
+ * process.stdin.on('keypress', (c, k) => {
+ * showResults();
+ * });
+ * ```
+ * @since v0.1.98
+ */
+ readonly line: string;
+ /**
+ * The cursor position relative to `rl.line`.
+ *
+ * This will track where the current cursor lands in the input string, when
+ * reading input from a TTY stream. The position of cursor determines the
+ * portion of the input string that will be modified as input is processed,
+ * as well as the column where the terminal caret will be rendered.
+ * @since v0.1.98
+ */
+ readonly cursor: number;
+ /**
+ * NOTE: According to the documentation:
+ *
+ * > Instances of the `readline.Interface` class are constructed using the
+ * > `readline.createInterface()` method.
+ *
+ * @see https://nodejs.org/dist/latest-v10.x/docs/api/readline.html#readline_class_interface
+ */
+ protected constructor(
+ input: NodeJS.ReadableStream,
+ output?: NodeJS.WritableStream,
+ completer?: Completer | AsyncCompleter,
+ terminal?: boolean,
+ );
+ /**
+ * NOTE: According to the documentation:
+ *
+ * > Instances of the `readline.Interface` class are constructed using the
+ * > `readline.createInterface()` method.
+ *
+ * @see https://nodejs.org/dist/latest-v10.x/docs/api/readline.html#readline_class_interface
+ */
+ protected constructor(options: ReadLineOptions);
+ /**
+ * The `rl.getPrompt()` method returns the current prompt used by `rl.prompt()`.
+ * @since v15.3.0
+ * @return the current prompt string
+ */
+ getPrompt(): string;
+ /**
+ * The `rl.setPrompt()` method sets the prompt that will be written to `output`whenever `rl.prompt()` is called.
+ * @since v0.1.98
+ */
+ setPrompt(prompt: string): void;
+ /**
+ * The `rl.prompt()` method writes the `readline.Interface` instances configured`prompt` to a new line in `output` in order to provide a user with a new
+ * location at which to provide input.
+ *
+ * When called, `rl.prompt()` will resume the `input` stream if it has been
+ * paused.
+ *
+ * If the `readline.Interface` was created with `output` set to `null` or`undefined` the prompt is not written.
+ * @since v0.1.98
+ * @param preserveCursor If `true`, prevents the cursor placement from being reset to `0`.
+ */
+ prompt(preserveCursor?: boolean): void;
+ /**
+ * The `rl.question()` method displays the `query` by writing it to the `output`,
+ * waits for user input to be provided on `input`, then invokes the `callback`function passing the provided input as the first argument.
+ *
+ * When called, `rl.question()` will resume the `input` stream if it has been
+ * paused.
+ *
+ * If the `readline.Interface` was created with `output` set to `null` or`undefined` the `query` is not written.
+ *
+ * The `callback` function passed to `rl.question()` does not follow the typical
+ * pattern of accepting an `Error` object or `null` as the first argument.
+ * The `callback` is called with the provided answer as the only argument.
+ *
+ * Example usage:
+ *
+ * ```js
+ * rl.question('What is your favorite food? ', (answer) => {
+ * console.log(`Oh, so your favorite food is ${answer}`);
+ * });
+ * ```
+ *
+ * Using an `AbortController` to cancel a question.
+ *
+ * ```js
+ * const ac = new AbortController();
+ * const signal = ac.signal;
+ *
+ * rl.question('What is your favorite food? ', { signal }, (answer) => {
+ * console.log(`Oh, so your favorite food is ${answer}`);
+ * });
+ *
+ * signal.addEventListener('abort', () => {
+ * console.log('The food question timed out');
+ * }, { once: true });
+ *
+ * setTimeout(() => ac.abort(), 10000);
+ * ```
+ *
+ * If this method is invoked as it's util.promisify()ed version, it returns a
+ * Promise that fulfills with the answer. If the question is canceled using
+ * an `AbortController` it will reject with an `AbortError`.
+ *
+ * ```js
+ * const util = require('util');
+ * const question = util.promisify(rl.question).bind(rl);
+ *
+ * async function questionExample() {
+ * try {
+ * const answer = await question('What is you favorite food? ');
+ * console.log(`Oh, so your favorite food is ${answer}`);
+ * } catch (err) {
+ * console.error('Question rejected', err);
+ * }
+ * }
+ * questionExample();
+ * ```
+ * @since v0.3.3
+ * @param query A statement or query to write to `output`, prepended to the prompt.
+ * @param callback A callback function that is invoked with the user's input in response to the `query`.
+ */
+ question(query: string, callback: (answer: string) => void): void;
+ question(query: string, options: Abortable, callback: (answer: string) => void): void;
+ /**
+ * The `rl.pause()` method pauses the `input` stream, allowing it to be resumed
+ * later if necessary.
+ *
+ * Calling `rl.pause()` does not immediately pause other events (including`'line'`) from being emitted by the `readline.Interface` instance.
+ * @since v0.3.4
+ */
+ pause(): this;
+ /**
+ * The `rl.resume()` method resumes the `input` stream if it has been paused.
+ * @since v0.3.4
+ */
+ resume(): this;
+ /**
+ * The `rl.close()` method closes the `readline.Interface` instance and
+ * relinquishes control over the `input` and `output` streams. When called,
+ * the `'close'` event will be emitted.
+ *
+ * Calling `rl.close()` does not immediately stop other events (including `'line'`)
+ * from being emitted by the `readline.Interface` instance.
+ * @since v0.1.98
+ */
+ close(): void;
+ /**
+ * The `rl.write()` method will write either `data` or a key sequence identified
+ * by `key` to the `output`. The `key` argument is supported only if `output` is
+ * a `TTY` text terminal. See `TTY keybindings` for a list of key
+ * combinations.
+ *
+ * If `key` is specified, `data` is ignored.
+ *
+ * When called, `rl.write()` will resume the `input` stream if it has been
+ * paused.
+ *
+ * If the `readline.Interface` was created with `output` set to `null` or`undefined` the `data` and `key` are not written.
+ *
+ * ```js
+ * rl.write('Delete this!');
+ * // Simulate Ctrl+U to delete the line written previously
+ * rl.write(null, { ctrl: true, name: 'u' });
+ * ```
+ *
+ * The `rl.write()` method will write the data to the `readline` `Interface`'s`input`_as if it were provided by the user_.
+ * @since v0.1.98
+ */
+ write(data: string | Buffer, key?: Key): void;
+ write(data: undefined | null | string | Buffer, key: Key): void;
+ /**
+ * Returns the real position of the cursor in relation to the input
+ * prompt + string. Long input (wrapping) strings, as well as multiple
+ * line prompts are included in the calculations.
+ * @since v13.5.0, v12.16.0
+ */
+ getCursorPos(): CursorPos;
+ /**
+ * events.EventEmitter
+ * 1. close
+ * 2. line
+ * 3. pause
+ * 4. resume
+ * 5. SIGCONT
+ * 6. SIGINT
+ * 7. SIGTSTP
+ * 8. history
+ */
+ addListener(event: string, listener: (...args: any[]) => void): this;
+ addListener(event: "close", listener: () => void): this;
+ addListener(event: "line", listener: (input: string) => void): this;
+ addListener(event: "pause", listener: () => void): this;
+ addListener(event: "resume", listener: () => void): this;
+ addListener(event: "SIGCONT", listener: () => void): this;
+ addListener(event: "SIGINT", listener: () => void): this;
+ addListener(event: "SIGTSTP", listener: () => void): this;
+ addListener(event: "history", listener: (history: string[]) => void): this;
+ emit(event: string | symbol, ...args: any[]): boolean;
+ emit(event: "close"): boolean;
+ emit(event: "line", input: string): boolean;
+ emit(event: "pause"): boolean;
+ emit(event: "resume"): boolean;
+ emit(event: "SIGCONT"): boolean;
+ emit(event: "SIGINT"): boolean;
+ emit(event: "SIGTSTP"): boolean;
+ emit(event: "history", history: string[]): boolean;
+ on(event: string, listener: (...args: any[]) => void): this;
+ on(event: "close", listener: () => void): this;
+ on(event: "line", listener: (input: string) => void): this;
+ on(event: "pause", listener: () => void): this;
+ on(event: "resume", listener: () => void): this;
+ on(event: "SIGCONT", listener: () => void): this;
+ on(event: "SIGINT", listener: () => void): this;
+ on(event: "SIGTSTP", listener: () => void): this;
+ on(event: "history", listener: (history: string[]) => void): this;
+ once(event: string, listener: (...args: any[]) => void): this;
+ once(event: "close", listener: () => void): this;
+ once(event: "line", listener: (input: string) => void): this;
+ once(event: "pause", listener: () => void): this;
+ once(event: "resume", listener: () => void): this;
+ once(event: "SIGCONT", listener: () => void): this;
+ once(event: "SIGINT", listener: () => void): this;
+ once(event: "SIGTSTP", listener: () => void): this;
+ once(event: "history", listener: (history: string[]) => void): this;
+ prependListener(event: string, listener: (...args: any[]) => void): this;
+ prependListener(event: "close", listener: () => void): this;
+ prependListener(event: "line", listener: (input: string) => void): this;
+ prependListener(event: "pause", listener: () => void): this;
+ prependListener(event: "resume", listener: () => void): this;
+ prependListener(event: "SIGCONT", listener: () => void): this;
+ prependListener(event: "SIGINT", listener: () => void): this;
+ prependListener(event: "SIGTSTP", listener: () => void): this;
+ prependListener(event: "history", listener: (history: string[]) => void): this;
+ prependOnceListener(event: string, listener: (...args: any[]) => void): this;
+ prependOnceListener(event: "close", listener: () => void): this;
+ prependOnceListener(event: "line", listener: (input: string) => void): this;
+ prependOnceListener(event: "pause", listener: () => void): this;
+ prependOnceListener(event: "resume", listener: () => void): this;
+ prependOnceListener(event: "SIGCONT", listener: () => void): this;
+ prependOnceListener(event: "SIGINT", listener: () => void): this;
+ prependOnceListener(event: "SIGTSTP", listener: () => void): this;
+ prependOnceListener(event: "history", listener: (history: string[]) => void): this;
+ [Symbol.asyncIterator](): AsyncIterableIterator<string>;
+ }
+ export type ReadLine = Interface; // type forwarded for backwards compatibility
+ export type Completer = (line: string) => CompleterResult;
+ export type AsyncCompleter = (
+ line: string,
+ callback: (err?: null | Error, result?: CompleterResult) => void,
+ ) => void;
+ export type CompleterResult = [string[], string];
+ export interface ReadLineOptions {
+ input: NodeJS.ReadableStream;
+ output?: NodeJS.WritableStream | undefined;
+ completer?: Completer | AsyncCompleter | undefined;
+ terminal?: boolean | undefined;
+ /**
+ * Initial list of history lines. This option makes sense
+ * only if `terminal` is set to `true` by the user or by an internal `output`
+ * check, otherwise the history caching mechanism is not initialized at all.
+ * @default []
+ */
+ history?: string[] | undefined;
+ historySize?: number | undefined;
+ prompt?: string | undefined;
+ crlfDelay?: number | undefined;
+ /**
+ * If `true`, when a new input line added
+ * to the history list duplicates an older one, this removes the older line
+ * from the list.
+ * @default false
+ */
+ removeHistoryDuplicates?: boolean | undefined;
+ escapeCodeTimeout?: number | undefined;
+ tabSize?: number | undefined;
+ }
+ /**
+ * The `readline.createInterface()` method creates a new `readline.Interface`instance.
+ *
+ * ```js
+ * const readline = require('readline');
+ * const rl = readline.createInterface({
+ * input: process.stdin,
+ * output: process.stdout
+ * });
+ * ```
+ *
+ * Once the `readline.Interface` instance is created, the most common case is to
+ * listen for the `'line'` event:
+ *
+ * ```js
+ * rl.on('line', (line) => {
+ * console.log(`Received: ${line}`);
+ * });
+ * ```
+ *
+ * If `terminal` is `true` for this instance then the `output` stream will get
+ * the best compatibility if it defines an `output.columns` property and emits
+ * a `'resize'` event on the `output` if or when the columns ever change
+ * (`process.stdout` does this automatically when it is a TTY).
+ *
+ * When creating a `readline.Interface` using `stdin` as input, the program
+ * will not terminate until it receives `EOF` (Ctrl+D on
+ * Linux/macOS, Ctrl+Z followed by Return on
+ * Windows).
+ * If you want your application to exit without waiting for user input, you can `unref()` the standard input stream:
+ *
+ * ```js
+ * process.stdin.unref();
+ * ```
+ * @since v0.1.98
+ */
+ export function createInterface(
+ input: NodeJS.ReadableStream,
+ output?: NodeJS.WritableStream,
+ completer?: Completer | AsyncCompleter,
+ terminal?: boolean,
+ ): Interface;
+ export function createInterface(options: ReadLineOptions): Interface;
+ /**
+ * The `readline.emitKeypressEvents()` method causes the given `Readable` stream to begin emitting `'keypress'` events corresponding to received input.
+ *
+ * Optionally, `interface` specifies a `readline.Interface` instance for which
+ * autocompletion is disabled when copy-pasted input is detected.
+ *
+ * If the `stream` is a `TTY`, then it must be in raw mode.
+ *
+ * This is automatically called by any readline instance on its `input` if the`input` is a terminal. Closing the `readline` instance does not stop
+ * the `input` from emitting `'keypress'` events.
+ *
+ * ```js
+ * readline.emitKeypressEvents(process.stdin);
+ * if (process.stdin.isTTY)
+ * process.stdin.setRawMode(true);
+ * ```
+ *
+ * ## Example: Tiny CLI
+ *
+ * The following example illustrates the use of `readline.Interface` class to
+ * implement a small command-line interface:
+ *
+ * ```js
+ * const readline = require('readline');
+ * const rl = readline.createInterface({
+ * input: process.stdin,
+ * output: process.stdout,
+ * prompt: 'OHAI> '
+ * });
+ *
+ * rl.prompt();
+ *
+ * rl.on('line', (line) => {
+ * switch (line.trim()) {
+ * case 'hello':
+ * console.log('world!');
+ * break;
+ * default:
+ * console.log(`Say what? I might have heard '${line.trim()}'`);
+ * break;
+ * }
+ * rl.prompt();
+ * }).on('close', () => {
+ * console.log('Have a great day!');
+ * process.exit(0);
+ * });
+ * ```
+ *
+ * ## Example: Read file stream line-by-Line
+ *
+ * A common use case for `readline` is to consume an input file one line at a
+ * time. The easiest way to do so is leveraging the `fs.ReadStream` API as
+ * well as a `for await...of` loop:
+ *
+ * ```js
+ * const fs = require('fs');
+ * const readline = require('readline');
+ *
+ * async function processLineByLine() {
+ * const fileStream = fs.createReadStream('input.txt');
+ *
+ * const rl = readline.createInterface({
+ * input: fileStream,
+ * crlfDelay: Infinity
+ * });
+ * // Note: we use the crlfDelay option to recognize all instances of CR LF
+ * // ('\r\n') in input.txt as a single line break.
+ *
+ * for await (const line of rl) {
+ * // Each line in input.txt will be successively available here as `line`.
+ * console.log(`Line from file: ${line}`);
+ * }
+ * }
+ *
+ * processLineByLine();
+ * ```
+ *
+ * Alternatively, one could use the `'line'` event:
+ *
+ * ```js
+ * const fs = require('fs');
+ * const readline = require('readline');
+ *
+ * const rl = readline.createInterface({
+ * input: fs.createReadStream('sample.txt'),
+ * crlfDelay: Infinity
+ * });
+ *
+ * rl.on('line', (line) => {
+ * console.log(`Line from file: ${line}`);
+ * });
+ * ```
+ *
+ * Currently, `for await...of` loop can be a bit slower. If `async` / `await`flow and speed are both essential, a mixed approach can be applied:
+ *
+ * ```js
+ * const { once } = require('events');
+ * const { createReadStream } = require('fs');
+ * const { createInterface } = require('readline');
+ *
+ * (async function processLineByLine() {
+ * try {
+ * const rl = createInterface({
+ * input: createReadStream('big-file.txt'),
+ * crlfDelay: Infinity
+ * });
+ *
+ * rl.on('line', (line) => {
+ * // Process the line.
+ * });
+ *
+ * await once(rl, 'close');
+ *
+ * console.log('File processed.');
+ * } catch (err) {
+ * console.error(err);
+ * }
+ * })();
+ * ```
+ * @since v0.7.7
+ */
+ export function emitKeypressEvents(stream: NodeJS.ReadableStream, readlineInterface?: Interface): void;
+ export type Direction = -1 | 0 | 1;
+ export interface CursorPos {
+ rows: number;
+ cols: number;
+ }
+ /**
+ * The `readline.clearLine()` method clears current line of given `TTY` stream
+ * in a specified direction identified by `dir`.
+ * @since v0.7.7
+ * @param callback Invoked once the operation completes.
+ * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
+ */
+ export function clearLine(stream: NodeJS.WritableStream, dir: Direction, callback?: () => void): boolean;
+ /**
+ * The `readline.clearScreenDown()` method clears the given `TTY` stream from
+ * the current position of the cursor down.
+ * @since v0.7.7
+ * @param callback Invoked once the operation completes.
+ * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
+ */
+ export function clearScreenDown(stream: NodeJS.WritableStream, callback?: () => void): boolean;
+ /**
+ * The `readline.cursorTo()` method moves cursor to the specified position in a
+ * given `TTY` `stream`.
+ * @since v0.7.7
+ * @param callback Invoked once the operation completes.
+ * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
+ */
+ export function cursorTo(stream: NodeJS.WritableStream, x: number, y?: number, callback?: () => void): boolean;
+ /**
+ * The `readline.moveCursor()` method moves the cursor _relative_ to its current
+ * position in a given `TTY` `stream`.
+ *
+ * ## Example: Tiny CLI
+ *
+ * The following example illustrates the use of `readline.Interface` class to
+ * implement a small command-line interface:
+ *
+ * ```js
+ * const readline = require('readline');
+ * const rl = readline.createInterface({
+ * input: process.stdin,
+ * output: process.stdout,
+ * prompt: 'OHAI> '
+ * });
+ *
+ * rl.prompt();
+ *
+ * rl.on('line', (line) => {
+ * switch (line.trim()) {
+ * case 'hello':
+ * console.log('world!');
+ * break;
+ * default:
+ * console.log(`Say what? I might have heard '${line.trim()}'`);
+ * break;
+ * }
+ * rl.prompt();
+ * }).on('close', () => {
+ * console.log('Have a great day!');
+ * process.exit(0);
+ * });
+ * ```
+ *
+ * ## Example: Read file stream line-by-Line
+ *
+ * A common use case for `readline` is to consume an input file one line at a
+ * time. The easiest way to do so is leveraging the `fs.ReadStream` API as
+ * well as a `for await...of` loop:
+ *
+ * ```js
+ * const fs = require('fs');
+ * const readline = require('readline');
+ *
+ * async function processLineByLine() {
+ * const fileStream = fs.createReadStream('input.txt');
+ *
+ * const rl = readline.createInterface({
+ * input: fileStream,
+ * crlfDelay: Infinity
+ * });
+ * // Note: we use the crlfDelay option to recognize all instances of CR LF
+ * // ('\r\n') in input.txt as a single line break.
+ *
+ * for await (const line of rl) {
+ * // Each line in input.txt will be successively available here as `line`.
+ * console.log(`Line from file: ${line}`);
+ * }
+ * }
+ *
+ * processLineByLine();
+ * ```
+ *
+ * Alternatively, one could use the `'line'` event:
+ *
+ * ```js
+ * const fs = require('fs');
+ * const readline = require('readline');
+ *
+ * const rl = readline.createInterface({
+ * input: fs.createReadStream('sample.txt'),
+ * crlfDelay: Infinity
+ * });
+ *
+ * rl.on('line', (line) => {
+ * console.log(`Line from file: ${line}`);
+ * });
+ * ```
+ *
+ * Currently, `for await...of` loop can be a bit slower. If `async` / `await`flow and speed are both essential, a mixed approach can be applied:
+ *
+ * ```js
+ * const { once } = require('events');
+ * const { createReadStream } = require('fs');
+ * const { createInterface } = require('readline');
+ *
+ * (async function processLineByLine() {
+ * try {
+ * const rl = createInterface({
+ * input: createReadStream('big-file.txt'),
+ * crlfDelay: Infinity
+ * });
+ *
+ * rl.on('line', (line) => {
+ * // Process the line.
+ * });
+ *
+ * await once(rl, 'close');
+ *
+ * console.log('File processed.');
+ * } catch (err) {
+ * console.error(err);
+ * }
+ * })();
+ * ```
+ * @since v0.7.7
+ * @param callback Invoked once the operation completes.
+ * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
+ */
+ export function moveCursor(stream: NodeJS.WritableStream, dx: number, dy: number, callback?: () => void): boolean;
+}
+declare module "node:readline" {
+ export * from "readline";
+}
diff --git a/client/node_modules/@types/node/readline/promises.d.ts b/client/node_modules/@types/node/readline/promises.d.ts
new file mode 100644
index 0000000..ba603ef
--- /dev/null
+++ b/client/node_modules/@types/node/readline/promises.d.ts
@@ -0,0 +1,143 @@
+/**
+ * The `readline/promise` module provides an API for reading lines of input from a Readable stream one line at a time.
+ *
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/readline/promises.js)
+ * @since v17.0.0
+ */
+declare module "readline/promises" {
+ import { AsyncCompleter, Completer, Direction, Interface as _Interface, ReadLineOptions } from "node:readline";
+ import { Abortable } from "node:events";
+
+ class Interface extends _Interface {
+ /**
+ * The rl.question() method displays the query by writing it to the output, waits for user input to be provided on input,
+ * then invokes the callback function passing the provided input as the first argument.
+ *
+ * When called, rl.question() will resume the input stream if it has been paused.
+ *
+ * If the readlinePromises.Interface was created with output set to null or undefined the query is not written.
+ *
+ * If the question is called after rl.close(), it returns a rejected promise.
+ *
+ * Example usage:
+ *
+ * ```js
+ * const answer = await rl.question('What is your favorite food? ');
+ * console.log(`Oh, so your favorite food is ${answer}`);
+ * ```
+ *
+ * Using an AbortSignal to cancel a question.
+ *
+ * ```js
+ * const signal = AbortSignal.timeout(10_000);
+ *
+ * signal.addEventListener('abort', () => {
+ * console.log('The food question timed out');
+ * }, { once: true });
+ *
+ * const answer = await rl.question('What is your favorite food? ', { signal });
+ * console.log(`Oh, so your favorite food is ${answer}`);
+ * ```
+ *
+ * @since v17.0.0
+ * @param query A statement or query to write to output, prepended to the prompt.
+ */
+ question(query: string): Promise<string>;
+ question(query: string, options: Abortable): Promise<string>;
+ }
+
+ class Readline {
+ /**
+ * @param stream A TTY stream.
+ */
+ constructor(stream: NodeJS.WritableStream, options?: { autoCommit?: boolean });
+ /**
+ * The `rl.clearLine()` method adds to the internal list of pending action an action that clears current line of the associated `stream` in a specified direction identified by `dir`.
+ * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` was passed to the constructor.
+ */
+ clearLine(dir: Direction): this;
+ /**
+ * The `rl.clearScreenDown()` method adds to the internal list of pending action an action that clears the associated `stream` from the current position of the cursor down.
+ * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` was passed to the constructor.
+ */
+ clearScreenDown(): this;
+ /**
+ * The `rl.commit()` method sends all the pending actions to the associated `stream` and clears the internal list of pending actions.
+ */
+ commit(): Promise<void>;
+ /**
+ * The `rl.cursorTo()` method adds to the internal list of pending action an action that moves cursor to the specified position in the associated `stream`.
+ * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` was passed to the constructor.
+ */
+ cursorTo(x: number, y?: number): this;
+ /**
+ * The `rl.moveCursor()` method adds to the internal list of pending action an action that moves the cursor relative to its current position in the associated `stream`.
+ * Call `rl.commit()` to see the effect of this method, unless autoCommit: true was passed to the constructor.
+ */
+ moveCursor(dx: number, dy: number): this;
+ /**
+ * The `rl.rollback()` method clears the internal list of pending actions without sending it to the associated `stream`.
+ */
+ rollback(): this;
+ }
+
+ /**
+ * The `readlinePromises.createInterface()` method creates a new `readlinePromises.Interface` instance.
+ *
+ * ```js
+ * const readlinePromises = require('node:readline/promises');
+ * const rl = readlinePromises.createInterface({
+ * input: process.stdin,
+ * output: process.stdout
+ * });
+ * ```
+ *
+ * Once the `readlinePromises.Interface` instance is created, the most common case is to listen for the `'line'` event:
+ *
+ * ```js
+ * rl.on('line', (line) => {
+ * console.log(`Received: ${line}`);
+ * });
+ * ```
+ *
+ * If `terminal` is `true` for this instance then the `output` stream will get the best compatibility if it defines an `output.columns` property,
+ * and emits a `'resize'` event on the `output`, if or when the columns ever change (`process.stdout` does this automatically when it is a TTY).
+ *
+ * ## Use of the `completer` function
+ *
+ * The `completer` function takes the current line entered by the user as an argument, and returns an `Array` with 2 entries:
+ *
+ * - An Array with matching entries for the completion.
+ * - The substring that was used for the matching.
+ *
+ * For instance: `[[substr1, substr2, ...], originalsubstring]`.
+ *
+ * ```js
+ * function completer(line) {
+ * const completions = '.help .error .exit .quit .q'.split(' ');
+ * const hits = completions.filter((c) => c.startsWith(line));
+ * // Show all completions if none found
+ * return [hits.length ? hits : completions, line];
+ * }
+ * ```
+ *
+ * The `completer` function can also returns a `Promise`, or be asynchronous:
+ *
+ * ```js
+ * async function completer(linePartial) {
+ * await someAsyncWork();
+ * return [['123'], linePartial];
+ * }
+ * ```
+ */
+ function createInterface(
+ input: NodeJS.ReadableStream,
+ output?: NodeJS.WritableStream,
+ completer?: Completer | AsyncCompleter,
+ terminal?: boolean,
+ ): Interface;
+ function createInterface(options: ReadLineOptions): Interface;
+}
+declare module "node:readline/promises" {
+ export * from "readline/promises";
+}
diff --git a/client/node_modules/@types/node/repl.d.ts b/client/node_modules/@types/node/repl.d.ts
new file mode 100644
index 0000000..7ed370b
--- /dev/null
+++ b/client/node_modules/@types/node/repl.d.ts
@@ -0,0 +1,430 @@
+/**
+ * The `repl` module provides a Read-Eval-Print-Loop (REPL) implementation that
+ * is available both as a standalone program or includible in other applications.
+ * It can be accessed using:
+ *
+ * ```js
+ * const repl = require('repl');
+ * ```
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/repl.js)
+ */
+declare module "repl" {
+ import { AsyncCompleter, Completer, Interface } from "node:readline";
+ import { Context } from "node:vm";
+ import { InspectOptions } from "node:util";
+ interface ReplOptions {
+ /**
+ * The input prompt to display.
+ * @default "> "
+ */
+ prompt?: string | undefined;
+ /**
+ * The `Readable` stream from which REPL input will be read.
+ * @default process.stdin
+ */
+ input?: NodeJS.ReadableStream | undefined;
+ /**
+ * The `Writable` stream to which REPL output will be written.
+ * @default process.stdout
+ */
+ output?: NodeJS.WritableStream | undefined;
+ /**
+ * If `true`, specifies that the output should be treated as a TTY terminal, and have
+ * ANSI/VT100 escape codes written to it.
+ * Default: checking the value of the `isTTY` property on the output stream upon
+ * instantiation.
+ */
+ terminal?: boolean | undefined;
+ /**
+ * The function to be used when evaluating each given line of input.
+ * Default: an async wrapper for the JavaScript `eval()` function. An `eval` function can
+ * error with `repl.Recoverable` to indicate the input was incomplete and prompt for
+ * additional lines.
+ *
+ * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_default_evaluation
+ * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_custom_evaluation_functions
+ */
+ eval?: REPLEval | undefined;
+ /**
+ * Defines if the repl prints output previews or not.
+ * @default `true` Always `false` in case `terminal` is falsy.
+ */
+ preview?: boolean | undefined;
+ /**
+ * If `true`, specifies that the default `writer` function should include ANSI color
+ * styling to REPL output. If a custom `writer` function is provided then this has no
+ * effect.
+ * Default: the REPL instance's `terminal` value.
+ */
+ useColors?: boolean | undefined;
+ /**
+ * If `true`, specifies that the default evaluation function will use the JavaScript
+ * `global` as the context as opposed to creating a new separate context for the REPL
+ * instance. The node CLI REPL sets this value to `true`.
+ * Default: `false`.
+ */
+ useGlobal?: boolean | undefined;
+ /**
+ * If `true`, specifies that the default writer will not output the return value of a
+ * command if it evaluates to `undefined`.
+ * Default: `false`.
+ */
+ ignoreUndefined?: boolean | undefined;
+ /**
+ * The function to invoke to format the output of each command before writing to `output`.
+ * Default: a wrapper for `util.inspect`.
+ *
+ * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_customizing_repl_output
+ */
+ writer?: REPLWriter | undefined;
+ /**
+ * An optional function used for custom Tab auto completion.
+ *
+ * @see https://nodejs.org/dist/latest-v11.x/docs/api/readline.html#readline_use_of_the_completer_function
+ */
+ completer?: Completer | AsyncCompleter | undefined;
+ /**
+ * A flag that specifies whether the default evaluator executes all JavaScript commands in
+ * strict mode or default (sloppy) mode.
+ * Accepted values are:
+ * - `repl.REPL_MODE_SLOPPY` - evaluates expressions in sloppy mode.
+ * - `repl.REPL_MODE_STRICT` - evaluates expressions in strict mode. This is equivalent to
+ * prefacing every repl statement with `'use strict'`.
+ */
+ replMode?: typeof REPL_MODE_SLOPPY | typeof REPL_MODE_STRICT | undefined;
+ /**
+ * Stop evaluating the current piece of code when `SIGINT` is received, i.e. `Ctrl+C` is
+ * pressed. This cannot be used together with a custom `eval` function.
+ * Default: `false`.
+ */
+ breakEvalOnSigint?: boolean | undefined;
+ }
+ type REPLEval = (
+ this: REPLServer,
+ evalCmd: string,
+ context: Context,
+ file: string,
+ cb: (err: Error | null, result: any) => void,
+ ) => void;
+ type REPLWriter = (this: REPLServer, obj: any) => string;
+ /**
+ * This is the default "writer" value, if none is passed in the REPL options,
+ * and it can be overridden by custom print functions.
+ */
+ const writer: REPLWriter & {
+ options: InspectOptions;
+ };
+ type REPLCommandAction = (this: REPLServer, text: string) => void;
+ interface REPLCommand {
+ /**
+ * Help text to be displayed when `.help` is entered.
+ */
+ help?: string | undefined;
+ /**
+ * The function to execute, optionally accepting a single string argument.
+ */
+ action: REPLCommandAction;
+ }
+ /**
+ * Instances of `repl.REPLServer` are created using the {@link start} method
+ * or directly using the JavaScript `new` keyword.
+ *
+ * ```js
+ * const repl = require('repl');
+ *
+ * const options = { useColors: true };
+ *
+ * const firstInstance = repl.start(options);
+ * const secondInstance = new repl.REPLServer(options);
+ * ```
+ * @since v0.1.91
+ */
+ class REPLServer extends Interface {
+ /**
+ * The `vm.Context` provided to the `eval` function to be used for JavaScript
+ * evaluation.
+ */
+ readonly context: Context;
+ /**
+ * @deprecated since v14.3.0 - Use `input` instead.
+ */
+ readonly inputStream: NodeJS.ReadableStream;
+ /**
+ * @deprecated since v14.3.0 - Use `output` instead.
+ */
+ readonly outputStream: NodeJS.WritableStream;
+ /**
+ * The `Readable` stream from which REPL input will be read.
+ */
+ readonly input: NodeJS.ReadableStream;
+ /**
+ * The `Writable` stream to which REPL output will be written.
+ */
+ readonly output: NodeJS.WritableStream;
+ /**
+ * The commands registered via `replServer.defineCommand()`.
+ */
+ readonly commands: NodeJS.ReadOnlyDict<REPLCommand>;
+ /**
+ * A value indicating whether the REPL is currently in "editor mode".
+ *
+ * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_commands_and_special_keys
+ */
+ readonly editorMode: boolean;
+ /**
+ * A value indicating whether the `_` variable has been assigned.
+ *
+ * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
+ */
+ readonly underscoreAssigned: boolean;
+ /**
+ * The last evaluation result from the REPL (assigned to the `_` variable inside of the REPL).
+ *
+ * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
+ */
+ readonly last: any;
+ /**
+ * A value indicating whether the `_error` variable has been assigned.
+ *
+ * @since v9.8.0
+ * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
+ */
+ readonly underscoreErrAssigned: boolean;
+ /**
+ * The last error raised inside the REPL (assigned to the `_error` variable inside of the REPL).
+ *
+ * @since v9.8.0
+ * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
+ */
+ readonly lastError: any;
+ /**
+ * Specified in the REPL options, this is the function to be used when evaluating each
+ * given line of input. If not specified in the REPL options, this is an async wrapper
+ * for the JavaScript `eval()` function.
+ */
+ readonly eval: REPLEval;
+ /**
+ * Specified in the REPL options, this is a value indicating whether the default
+ * `writer` function should include ANSI color styling to REPL output.
+ */
+ readonly useColors: boolean;
+ /**
+ * Specified in the REPL options, this is a value indicating whether the default `eval`
+ * function will use the JavaScript `global` as the context as opposed to creating a new
+ * separate context for the REPL instance.
+ */
+ readonly useGlobal: boolean;
+ /**
+ * Specified in the REPL options, this is a value indicating whether the default `writer`
+ * function should output the result of a command if it evaluates to `undefined`.
+ */
+ readonly ignoreUndefined: boolean;
+ /**
+ * Specified in the REPL options, this is the function to invoke to format the output of
+ * each command before writing to `outputStream`. If not specified in the REPL options,
+ * this will be a wrapper for `util.inspect`.
+ */
+ readonly writer: REPLWriter;
+ /**
+ * Specified in the REPL options, this is the function to use for custom Tab auto-completion.
+ */
+ readonly completer: Completer | AsyncCompleter;
+ /**
+ * Specified in the REPL options, this is a flag that specifies whether the default `eval`
+ * function should execute all JavaScript commands in strict mode or default (sloppy) mode.
+ * Possible values are:
+ * - `repl.REPL_MODE_SLOPPY` - evaluates expressions in sloppy mode.
+ * - `repl.REPL_MODE_STRICT` - evaluates expressions in strict mode. This is equivalent to
+ * prefacing every repl statement with `'use strict'`.
+ */
+ readonly replMode: typeof REPL_MODE_SLOPPY | typeof REPL_MODE_STRICT;
+ /**
+ * NOTE: According to the documentation:
+ *
+ * > Instances of `repl.REPLServer` are created using the `repl.start()` method and
+ * > _should not_ be created directly using the JavaScript `new` keyword.
+ *
+ * `REPLServer` cannot be subclassed due to implementation specifics in NodeJS.
+ *
+ * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_class_replserver
+ */
+ private constructor();
+ /**
+ * The `replServer.defineCommand()` method is used to add new `.`\-prefixed commands
+ * to the REPL instance. Such commands are invoked by typing a `.` followed by the`keyword`. The `cmd` is either a `Function` or an `Object` with the following
+ * properties:
+ *
+ * The following example shows two new commands added to the REPL instance:
+ *
+ * ```js
+ * const repl = require('repl');
+ *
+ * const replServer = repl.start({ prompt: '> ' });
+ * replServer.defineCommand('sayhello', {
+ * help: 'Say hello',
+ * action(name) {
+ * this.clearBufferedCommand();
+ * console.log(`Hello, ${name}!`);
+ * this.displayPrompt();
+ * }
+ * });
+ * replServer.defineCommand('saybye', function saybye() {
+ * console.log('Goodbye!');
+ * this.close();
+ * });
+ * ```
+ *
+ * The new commands can then be used from within the REPL instance:
+ *
+ * ```console
+ * > .sayhello Node.js User
+ * Hello, Node.js User!
+ * > .saybye
+ * Goodbye!
+ * ```
+ * @since v0.3.0
+ * @param keyword The command keyword (_without_ a leading `.` character).
+ * @param cmd The function to invoke when the command is processed.
+ */
+ defineCommand(keyword: string, cmd: REPLCommandAction | REPLCommand): void;
+ /**
+ * The `replServer.displayPrompt()` method readies the REPL instance for input
+ * from the user, printing the configured `prompt` to a new line in the `output`and resuming the `input` to accept new input.
+ *
+ * When multi-line input is being entered, an ellipsis is printed rather than the
+ * 'prompt'.
+ *
+ * When `preserveCursor` is `true`, the cursor placement will not be reset to `0`.
+ *
+ * The `replServer.displayPrompt` method is primarily intended to be called from
+ * within the action function for commands registered using the`replServer.defineCommand()` method.
+ * @since v0.1.91
+ */
+ displayPrompt(preserveCursor?: boolean): void;
+ /**
+ * The `replServer.clearBufferedCommand()` method clears any command that has been
+ * buffered but not yet executed. This method is primarily intended to be
+ * called from within the action function for commands registered using the`replServer.defineCommand()` method.
+ * @since v9.0.0
+ */
+ clearBufferedCommand(): void;
+ /**
+ * Initializes a history log file for the REPL instance. When executing the
+ * Node.js binary and using the command-line REPL, a history file is initialized
+ * by default. However, this is not the case when creating a REPL
+ * programmatically. Use this method to initialize a history log file when working
+ * with REPL instances programmatically.
+ * @since v11.10.0
+ * @param historyPath the path to the history file
+ * @param callback called when history writes are ready or upon error
+ */
+ setupHistory(path: string, callback: (err: Error | null, repl: this) => void): void;
+ /**
+ * events.EventEmitter
+ * 1. close - inherited from `readline.Interface`
+ * 2. line - inherited from `readline.Interface`
+ * 3. pause - inherited from `readline.Interface`
+ * 4. resume - inherited from `readline.Interface`
+ * 5. SIGCONT - inherited from `readline.Interface`
+ * 6. SIGINT - inherited from `readline.Interface`
+ * 7. SIGTSTP - inherited from `readline.Interface`
+ * 8. exit
+ * 9. reset
+ */
+ addListener(event: string, listener: (...args: any[]) => void): this;
+ addListener(event: "close", listener: () => void): this;
+ addListener(event: "line", listener: (input: string) => void): this;
+ addListener(event: "pause", listener: () => void): this;
+ addListener(event: "resume", listener: () => void): this;
+ addListener(event: "SIGCONT", listener: () => void): this;
+ addListener(event: "SIGINT", listener: () => void): this;
+ addListener(event: "SIGTSTP", listener: () => void): this;
+ addListener(event: "exit", listener: () => void): this;
+ addListener(event: "reset", listener: (context: Context) => void): this;
+ emit(event: string | symbol, ...args: any[]): boolean;
+ emit(event: "close"): boolean;
+ emit(event: "line", input: string): boolean;
+ emit(event: "pause"): boolean;
+ emit(event: "resume"): boolean;
+ emit(event: "SIGCONT"): boolean;
+ emit(event: "SIGINT"): boolean;
+ emit(event: "SIGTSTP"): boolean;
+ emit(event: "exit"): boolean;
+ emit(event: "reset", context: Context): boolean;
+ on(event: string, listener: (...args: any[]) => void): this;
+ on(event: "close", listener: () => void): this;
+ on(event: "line", listener: (input: string) => void): this;
+ on(event: "pause", listener: () => void): this;
+ on(event: "resume", listener: () => void): this;
+ on(event: "SIGCONT", listener: () => void): this;
+ on(event: "SIGINT", listener: () => void): this;
+ on(event: "SIGTSTP", listener: () => void): this;
+ on(event: "exit", listener: () => void): this;
+ on(event: "reset", listener: (context: Context) => void): this;
+ once(event: string, listener: (...args: any[]) => void): this;
+ once(event: "close", listener: () => void): this;
+ once(event: "line", listener: (input: string) => void): this;
+ once(event: "pause", listener: () => void): this;
+ once(event: "resume", listener: () => void): this;
+ once(event: "SIGCONT", listener: () => void): this;
+ once(event: "SIGINT", listener: () => void): this;
+ once(event: "SIGTSTP", listener: () => void): this;
+ once(event: "exit", listener: () => void): this;
+ once(event: "reset", listener: (context: Context) => void): this;
+ prependListener(event: string, listener: (...args: any[]) => void): this;
+ prependListener(event: "close", listener: () => void): this;
+ prependListener(event: "line", listener: (input: string) => void): this;
+ prependListener(event: "pause", listener: () => void): this;
+ prependListener(event: "resume", listener: () => void): this;
+ prependListener(event: "SIGCONT", listener: () => void): this;
+ prependListener(event: "SIGINT", listener: () => void): this;
+ prependListener(event: "SIGTSTP", listener: () => void): this;
+ prependListener(event: "exit", listener: () => void): this;
+ prependListener(event: "reset", listener: (context: Context) => void): this;
+ prependOnceListener(event: string, listener: (...args: any[]) => void): this;
+ prependOnceListener(event: "close", listener: () => void): this;
+ prependOnceListener(event: "line", listener: (input: string) => void): this;
+ prependOnceListener(event: "pause", listener: () => void): this;
+ prependOnceListener(event: "resume", listener: () => void): this;
+ prependOnceListener(event: "SIGCONT", listener: () => void): this;
+ prependOnceListener(event: "SIGINT", listener: () => void): this;
+ prependOnceListener(event: "SIGTSTP", listener: () => void): this;
+ prependOnceListener(event: "exit", listener: () => void): this;
+ prependOnceListener(event: "reset", listener: (context: Context) => void): this;
+ }
+ /**
+ * A flag passed in the REPL options. Evaluates expressions in sloppy mode.
+ */
+ const REPL_MODE_SLOPPY: unique symbol;
+ /**
+ * A flag passed in the REPL options. Evaluates expressions in strict mode.
+ * This is equivalent to prefacing every repl statement with `'use strict'`.
+ */
+ const REPL_MODE_STRICT: unique symbol;
+ /**
+ * The `repl.start()` method creates and starts a {@link REPLServer} instance.
+ *
+ * If `options` is a string, then it specifies the input prompt:
+ *
+ * ```js
+ * const repl = require('repl');
+ *
+ * // a Unix style prompt
+ * repl.start('$ ');
+ * ```
+ * @since v0.1.91
+ */
+ function start(options?: string | ReplOptions): REPLServer;
+ /**
+ * Indicates a recoverable error that a `REPLServer` can use to support multi-line input.
+ *
+ * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_recoverable_errors
+ */
+ class Recoverable extends SyntaxError {
+ err: Error;
+ constructor(err: Error);
+ }
+}
+declare module "node:repl" {
+ export * from "repl";
+}
diff --git a/client/node_modules/@types/node/stream.d.ts b/client/node_modules/@types/node/stream.d.ts
new file mode 100644
index 0000000..c1b8a25
--- /dev/null
+++ b/client/node_modules/@types/node/stream.d.ts
@@ -0,0 +1,1731 @@
+/**
+ * A stream is an abstract interface for working with streaming data in Node.js.
+ * The `stream` module provides an API for implementing the stream interface.
+ *
+ * There are many stream objects provided by Node.js. For instance, a `request to an HTTP server` and `process.stdout` are both stream instances.
+ *
+ * Streams can be readable, writable, or both. All streams are instances of `EventEmitter`.
+ *
+ * To access the `stream` module:
+ *
+ * ```js
+ * const stream = require('stream');
+ * ```
+ *
+ * The `stream` module is useful for creating new types of stream instances. It is
+ * usually not necessary to use the `stream` module to consume streams.
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/stream.js)
+ */
+declare module "stream" {
+ import { Abortable, EventEmitter } from "node:events";
+ import { Blob as NodeBlob } from "node:buffer";
+ import * as streamPromises from "node:stream/promises";
+ import * as streamConsumers from "node:stream/consumers";
+ import * as streamWeb from "node:stream/web";
+
+ type ComposeFnParam = (source: any) => void;
+
+ class internal extends EventEmitter {
+ pipe<T extends NodeJS.WritableStream>(
+ destination: T,
+ options?: {
+ end?: boolean | undefined;
+ },
+ ): T;
+ compose<T extends NodeJS.ReadableStream>(
+ stream: T | ComposeFnParam | Iterable<T> | AsyncIterable<T>,
+ options?: { signal: AbortSignal },
+ ): T;
+ }
+ namespace internal {
+ class Stream extends internal {
+ constructor(opts?: ReadableOptions);
+ }
+ interface StreamOptions<T extends Stream> extends Abortable {
+ emitClose?: boolean | undefined;
+ highWaterMark?: number | undefined;
+ objectMode?: boolean | undefined;
+ construct?(this: T, callback: (error?: Error | null) => void): void;
+ destroy?(this: T, error: Error | null, callback: (error: Error | null) => void): void;
+ autoDestroy?: boolean | undefined;
+ }
+ interface ReadableOptions extends StreamOptions<Readable> {
+ encoding?: BufferEncoding | undefined;
+ read?(this: Readable, size: number): void;
+ }
+ interface ArrayOptions {
+ /** the maximum concurrent invocations of `fn` to call on the stream at once. **Default: 1**. */
+ concurrency?: number;
+ /** allows destroying the stream if the signal is aborted. */
+ signal?: AbortSignal;
+ }
+ /**
+ * @since v0.9.4
+ */
+ class Readable extends Stream implements NodeJS.ReadableStream {
+ /**
+ * A utility method for creating Readable Streams out of iterators.
+ */
+ static from(iterable: Iterable<any> | AsyncIterable<any>, options?: ReadableOptions): Readable;
+ /**
+ * A utility method for creating a `Readable` from a web `ReadableStream`.
+ * @since v17.0.0
+ * @experimental
+ */
+ static fromWeb(
+ readableStream: streamWeb.ReadableStream,
+ options?: Pick<ReadableOptions, "encoding" | "highWaterMark" | "objectMode" | "signal">,
+ ): Readable;
+ /**
+ * Returns whether the stream has been read from or cancelled.
+ * @since v16.8.0
+ */
+ static isDisturbed(stream: Readable | NodeJS.ReadableStream): boolean;
+ /**
+ * A utility method for creating a web `ReadableStream` from a `Readable`.
+ * @since v17.0.0
+ * @experimental
+ */
+ static toWeb(streamReadable: Readable): streamWeb.ReadableStream;
+ /**
+ * Returns whether the stream was destroyed or errored before emitting `'end'`.
+ * @since v16.8.0
+ * @experimental
+ */
+ readonly readableAborted: boolean;
+ /**
+ * Is `true` if it is safe to call `readable.read()`, which means
+ * the stream has not been destroyed or emitted `'error'` or `'end'`.
+ * @since v11.4.0
+ */
+ readable: boolean;
+ /**
+ * Returns whether `'data'` has been emitted.
+ * @since v16.7.0, v14.18.0
+ * @experimental
+ */
+ readonly readableDidRead: boolean;
+ /**
+ * Getter for the property `encoding` of a given `Readable` stream. The `encoding`property can be set using the `readable.setEncoding()` method.
+ * @since v12.7.0
+ */
+ readonly readableEncoding: BufferEncoding | null;
+ /**
+ * Becomes `true` when `'end'` event is emitted.
+ * @since v12.9.0
+ */
+ readonly readableEnded: boolean;
+ /**
+ * This property reflects the current state of a `Readable` stream as described
+ * in the `Three states` section.
+ * @since v9.4.0
+ */
+ readonly readableFlowing: boolean | null;
+ /**
+ * Returns the value of `highWaterMark` passed when creating this `Readable`.
+ * @since v9.3.0
+ */
+ readonly readableHighWaterMark: number;
+ /**
+ * This property contains the number of bytes (or objects) in the queue
+ * ready to be read. The value provides introspection data regarding
+ * the status of the `highWaterMark`.
+ * @since v9.4.0
+ */
+ readonly readableLength: number;
+ /**
+ * Getter for the property `objectMode` of a given `Readable` stream.
+ * @since v12.3.0
+ */
+ readonly readableObjectMode: boolean;
+ /**
+ * Is `true` after `readable.destroy()` has been called.
+ * @since v8.0.0
+ */
+ destroyed: boolean;
+ /**
+ * Is true after 'close' has been emitted.
+ * @since v18.0.0
+ */
+ readonly closed: boolean;
+ /**
+ * Returns error if the stream has been destroyed with an error.
+ * @since v18.0.0
+ */
+ readonly errored: Error | null;
+ constructor(opts?: ReadableOptions);
+ _construct?(callback: (error?: Error | null) => void): void;
+ _read(size: number): void;
+ /**
+ * The `readable.read()` method reads data out of the internal buffer and
+ * returns it. If no data is available to be read, `null` is returned. By default,
+ * the data is returned as a `Buffer` object unless an encoding has been
+ * specified using the `readable.setEncoding()` method or the stream is operating
+ * in object mode.
+ *
+ * The optional `size` argument specifies a specific number of bytes to read. If`size` bytes are not available to be read, `null` will be returned _unless_the stream has ended, in which
+ * case all of the data remaining in the internal
+ * buffer will be returned.
+ *
+ * If the `size` argument is not specified, all of the data contained in the
+ * internal buffer will be returned.
+ *
+ * The `size` argument must be less than or equal to 1 GiB.
+ *
+ * The `readable.read()` method should only be called on `Readable` streams
+ * operating in paused mode. In flowing mode, `readable.read()` is called
+ * automatically until the internal buffer is fully drained.
+ *
+ * ```js
+ * const readable = getReadableStreamSomehow();
+ *
+ * // 'readable' may be triggered multiple times as data is buffered in
+ * readable.on('readable', () => {
+ * let chunk;
+ * console.log('Stream is readable (new data received in buffer)');
+ * // Use a loop to make sure we read all currently available data
+ * while (null !== (chunk = readable.read())) {
+ * console.log(`Read ${chunk.length} bytes of data...`);
+ * }
+ * });
+ *
+ * // 'end' will be triggered once when there is no more data available
+ * readable.on('end', () => {
+ * console.log('Reached end of stream.');
+ * });
+ * ```
+ *
+ * Each call to `readable.read()` returns a chunk of data, or `null`. The chunks
+ * are not concatenated. A `while` loop is necessary to consume all data
+ * currently in the buffer. When reading a large file `.read()` may return `null`,
+ * having consumed all buffered content so far, but there is still more data to
+ * come not yet buffered. In this case a new `'readable'` event will be emitted
+ * when there is more data in the buffer. Finally the `'end'` event will be
+ * emitted when there is no more data to come.
+ *
+ * Therefore to read a file's whole contents from a `readable`, it is necessary
+ * to collect chunks across multiple `'readable'` events:
+ *
+ * ```js
+ * const chunks = [];
+ *
+ * readable.on('readable', () => {
+ * let chunk;
+ * while (null !== (chunk = readable.read())) {
+ * chunks.push(chunk);
+ * }
+ * });
+ *
+ * readable.on('end', () => {
+ * const content = chunks.join('');
+ * });
+ * ```
+ *
+ * A `Readable` stream in object mode will always return a single item from
+ * a call to `readable.read(size)`, regardless of the value of the`size` argument.
+ *
+ * If the `readable.read()` method returns a chunk of data, a `'data'` event will
+ * also be emitted.
+ *
+ * Calling {@link read} after the `'end'` event has
+ * been emitted will return `null`. No runtime error will be raised.
+ * @since v0.9.4
+ * @param size Optional argument to specify how much data to read.
+ */
+ read(size?: number): any;
+ /**
+ * The `readable.setEncoding()` method sets the character encoding for
+ * data read from the `Readable` stream.
+ *
+ * By default, no encoding is assigned and stream data will be returned as`Buffer` objects. Setting an encoding causes the stream data
+ * to be returned as strings of the specified encoding rather than as `Buffer`objects. For instance, calling `readable.setEncoding('utf8')` will cause the
+ * output data to be interpreted as UTF-8 data, and passed as strings. Calling`readable.setEncoding('hex')` will cause the data to be encoded in hexadecimal
+ * string format.
+ *
+ * The `Readable` stream will properly handle multi-byte characters delivered
+ * through the stream that would otherwise become improperly decoded if simply
+ * pulled from the stream as `Buffer` objects.
+ *
+ * ```js
+ * const readable = getReadableStreamSomehow();
+ * readable.setEncoding('utf8');
+ * readable.on('data', (chunk) => {
+ * assert.equal(typeof chunk, 'string');
+ * console.log('Got %d characters of string data:', chunk.length);
+ * });
+ * ```
+ * @since v0.9.4
+ * @param encoding The encoding to use.
+ */
+ setEncoding(encoding: BufferEncoding): this;
+ /**
+ * The `readable.pause()` method will cause a stream in flowing mode to stop
+ * emitting `'data'` events, switching out of flowing mode. Any data that
+ * becomes available will remain in the internal buffer.
+ *
+ * ```js
+ * const readable = getReadableStreamSomehow();
+ * readable.on('data', (chunk) => {
+ * console.log(`Received ${chunk.length} bytes of data.`);
+ * readable.pause();
+ * console.log('There will be no additional data for 1 second.');
+ * setTimeout(() => {
+ * console.log('Now data will start flowing again.');
+ * readable.resume();
+ * }, 1000);
+ * });
+ * ```
+ *
+ * The `readable.pause()` method has no effect if there is a `'readable'`event listener.
+ * @since v0.9.4
+ */
+ pause(): this;
+ /**
+ * The `readable.resume()` method causes an explicitly paused `Readable` stream to
+ * resume emitting `'data'` events, switching the stream into flowing mode.
+ *
+ * The `readable.resume()` method can be used to fully consume the data from a
+ * stream without actually processing any of that data:
+ *
+ * ```js
+ * getReadableStreamSomehow()
+ * .resume()
+ * .on('end', () => {
+ * console.log('Reached the end, but did not read anything.');
+ * });
+ * ```
+ *
+ * The `readable.resume()` method has no effect if there is a `'readable'`event listener.
+ * @since v0.9.4
+ */
+ resume(): this;
+ /**
+ * The `readable.isPaused()` method returns the current operating state of the`Readable`. This is used primarily by the mechanism that underlies the`readable.pipe()` method. In most
+ * typical cases, there will be no reason to
+ * use this method directly.
+ *
+ * ```js
+ * const readable = new stream.Readable();
+ *
+ * readable.isPaused(); // === false
+ * readable.pause();
+ * readable.isPaused(); // === true
+ * readable.resume();
+ * readable.isPaused(); // === false
+ * ```
+ * @since v0.11.14
+ */
+ isPaused(): boolean;
+ /**
+ * The `readable.unpipe()` method detaches a `Writable` stream previously attached
+ * using the {@link pipe} method.
+ *
+ * If the `destination` is not specified, then _all_ pipes are detached.
+ *
+ * If the `destination` is specified, but no pipe is set up for it, then
+ * the method does nothing.
+ *
+ * ```js
+ * const fs = require('fs');
+ * const readable = getReadableStreamSomehow();
+ * const writable = fs.createWriteStream('file.txt');
+ * // All the data from readable goes into 'file.txt',
+ * // but only for the first second.
+ * readable.pipe(writable);
+ * setTimeout(() => {
+ * console.log('Stop writing to file.txt.');
+ * readable.unpipe(writable);
+ * console.log('Manually close the file stream.');
+ * writable.end();
+ * }, 1000);
+ * ```
+ * @since v0.9.4
+ * @param destination Optional specific stream to unpipe
+ */
+ unpipe(destination?: NodeJS.WritableStream): this;
+ /**
+ * Passing `chunk` as `null` signals the end of the stream (EOF) and behaves the
+ * same as `readable.push(null)`, after which no more data can be written. The EOF
+ * signal is put at the end of the buffer and any buffered data will still be
+ * flushed.
+ *
+ * The `readable.unshift()` method pushes a chunk of data back into the internal
+ * buffer. This is useful in certain situations where a stream is being consumed by
+ * code that needs to "un-consume" some amount of data that it has optimistically
+ * pulled out of the source, so that the data can be passed on to some other party.
+ *
+ * The `stream.unshift(chunk)` method cannot be called after the `'end'` event
+ * has been emitted or a runtime error will be thrown.
+ *
+ * Developers using `stream.unshift()` often should consider switching to
+ * use of a `Transform` stream instead. See the `API for stream implementers` section for more information.
+ *
+ * ```js
+ * // Pull off a header delimited by \n\n.
+ * // Use unshift() if we get too much.
+ * // Call the callback with (error, header, stream).
+ * const { StringDecoder } = require('string_decoder');
+ * function parseHeader(stream, callback) {
+ * stream.on('error', callback);
+ * stream.on('readable', onReadable);
+ * const decoder = new StringDecoder('utf8');
+ * let header = '';
+ * function onReadable() {
+ * let chunk;
+ * while (null !== (chunk = stream.read())) {
+ * const str = decoder.write(chunk);
+ * if (str.includes('\n\n')) {
+ * // Found the header boundary.
+ * const split = str.split(/\n\n/);
+ * header += split.shift();
+ * const remaining = split.join('\n\n');
+ * const buf = Buffer.from(remaining, 'utf8');
+ * stream.removeListener('error', callback);
+ * // Remove the 'readable' listener before unshifting.
+ * stream.removeListener('readable', onReadable);
+ * if (buf.length)
+ * stream.unshift(buf);
+ * // Now the body of the message can be read from the stream.
+ * callback(null, header, stream);
+ * return;
+ * }
+ * // Still reading the header.
+ * header += str;
+ * }
+ * }
+ * }
+ * ```
+ *
+ * Unlike {@link push}, `stream.unshift(chunk)` will not
+ * end the reading process by resetting the internal reading state of the stream.
+ * This can cause unexpected results if `readable.unshift()` is called during a
+ * read (i.e. from within a {@link _read} implementation on a
+ * custom stream). Following the call to `readable.unshift()` with an immediate {@link push} will reset the reading state appropriately,
+ * however it is best to simply avoid calling `readable.unshift()` while in the
+ * process of performing a read.
+ * @since v0.9.11
+ * @param chunk Chunk of data to unshift onto the read queue. For streams not operating in object mode, `chunk` must be a string, `Buffer`, `Uint8Array` or `null`. For object mode
+ * streams, `chunk` may be any JavaScript value.
+ * @param encoding Encoding of string chunks. Must be a valid `Buffer` encoding, such as `'utf8'` or `'ascii'`.
+ */
+ unshift(chunk: any, encoding?: BufferEncoding): void;
+ /**
+ * Prior to Node.js 0.10, streams did not implement the entire `stream` module API
+ * as it is currently defined. (See `Compatibility` for more information.)
+ *
+ * When using an older Node.js library that emits `'data'` events and has a {@link pause} method that is advisory only, the`readable.wrap()` method can be used to create a `Readable`
+ * stream that uses
+ * the old stream as its data source.
+ *
+ * It will rarely be necessary to use `readable.wrap()` but the method has been
+ * provided as a convenience for interacting with older Node.js applications and
+ * libraries.
+ *
+ * ```js
+ * const { OldReader } = require('./old-api-module.js');
+ * const { Readable } = require('stream');
+ * const oreader = new OldReader();
+ * const myReader = new Readable().wrap(oreader);
+ *
+ * myReader.on('readable', () => {
+ * myReader.read(); // etc.
+ * });
+ * ```
+ * @since v0.9.4
+ * @param stream An "old style" readable stream
+ */
+ wrap(stream: NodeJS.ReadableStream): this;
+ push(chunk: any, encoding?: BufferEncoding): boolean;
+ /**
+ * The iterator created by this method gives users the option to cancel the destruction
+ * of the stream if the `for await...of` loop is exited by `return`, `break`, or `throw`,
+ * or if the iterator should destroy the stream if the stream emitted an error during iteration.
+ * @since v16.3.0
+ * @param options.destroyOnReturn When set to `false`, calling `return` on the async iterator,
+ * or exiting a `for await...of` iteration using a `break`, `return`, or `throw` will not destroy the stream.
+ * **Default: `true`**.
+ */
+ iterator(options?: { destroyOnReturn?: boolean }): AsyncIterableIterator<any>;
+ /**
+ * This method allows mapping over the stream. The *fn* function will be called for every chunk in the stream.
+ * If the *fn* function returns a promise - that promise will be `await`ed before being passed to the result stream.
+ * @since v17.4.0, v16.14.0
+ * @param fn a function to map over every chunk in the stream. Async or not.
+ * @returns a stream mapped with the function *fn*.
+ */
+ map(fn: (data: any, options?: Pick<ArrayOptions, "signal">) => any, options?: ArrayOptions): Readable;
+ /**
+ * This method allows filtering the stream. For each chunk in the stream the *fn* function will be called
+ * and if it returns a truthy value, the chunk will be passed to the result stream.
+ * If the *fn* function returns a promise - that promise will be `await`ed.
+ * @since v17.4.0, v16.14.0
+ * @param fn a function to filter chunks from the stream. Async or not.
+ * @returns a stream filtered with the predicate *fn*.
+ */
+ filter(
+ fn: (data: any, options?: Pick<ArrayOptions, "signal">) => boolean | Promise<boolean>,
+ options?: ArrayOptions,
+ ): Readable;
+ /**
+ * This method allows iterating a stream. For each chunk in the stream the *fn* function will be called.
+ * If the *fn* function returns a promise - that promise will be `await`ed.
+ *
+ * This method is different from `for await...of` loops in that it can optionally process chunks concurrently.
+ * In addition, a `forEach` iteration can only be stopped by having passed a `signal` option
+ * and aborting the related AbortController while `for await...of` can be stopped with `break` or `return`.
+ * In either case the stream will be destroyed.
+ *
+ * This method is different from listening to the `'data'` event in that it uses the `readable` event
+ * in the underlying machinary and can limit the number of concurrent *fn* calls.
+ * @since v17.5.0
+ * @param fn a function to call on each chunk of the stream. Async or not.
+ * @returns a promise for when the stream has finished.
+ */
+ forEach(
+ fn: (data: any, options?: Pick<ArrayOptions, "signal">) => void | Promise<void>,
+ options?: ArrayOptions,
+ ): Promise<void>;
+ /**
+ * This method allows easily obtaining the contents of a stream.
+ *
+ * As this method reads the entire stream into memory, it negates the benefits of streams. It's intended
+ * for interoperability and convenience, not as the primary way to consume streams.
+ * @since v17.5.0
+ * @returns a promise containing an array with the contents of the stream.
+ */
+ toArray(options?: Pick<ArrayOptions, "signal">): Promise<any[]>;
+ /**
+ * This method is similar to `Array.prototype.some` and calls *fn* on each chunk in the stream
+ * until the awaited return value is `true` (or any truthy value). Once an *fn* call on a chunk
+ * `await`ed return value is truthy, the stream is destroyed and the promise is fulfilled with `true`.
+ * If none of the *fn* calls on the chunks return a truthy value, the promise is fulfilled with `false`.
+ * @since v17.5.0
+ * @param fn a function to call on each chunk of the stream. Async or not.
+ * @returns a promise evaluating to `true` if *fn* returned a truthy value for at least one of the chunks.
+ */
+ some(
+ fn: (data: any, options?: Pick<ArrayOptions, "signal">) => boolean | Promise<boolean>,
+ options?: ArrayOptions,
+ ): Promise<boolean>;
+ /**
+ * This method is similar to `Array.prototype.find` and calls *fn* on each chunk in the stream
+ * to find a chunk with a truthy value for *fn*. Once an *fn* call's awaited return value is truthy,
+ * the stream is destroyed and the promise is fulfilled with value for which *fn* returned a truthy value.
+ * If all of the *fn* calls on the chunks return a falsy value, the promise is fulfilled with `undefined`.
+ * @since v17.5.0
+ * @param fn a function to call on each chunk of the stream. Async or not.
+ * @returns a promise evaluating to the first chunk for which *fn* evaluated with a truthy value,
+ * or `undefined` if no element was found.
+ */
+ find<T>(
+ fn: (data: any, options?: Pick<ArrayOptions, "signal">) => data is T,
+ options?: ArrayOptions,
+ ): Promise<T | undefined>;
+ find(
+ fn: (data: any, options?: Pick<ArrayOptions, "signal">) => boolean | Promise<boolean>,
+ options?: ArrayOptions,
+ ): Promise<any>;
+ /**
+ * This method is similar to `Array.prototype.every` and calls *fn* on each chunk in the stream
+ * to check if all awaited return values are truthy value for *fn*. Once an *fn* call on a chunk
+ * `await`ed return value is falsy, the stream is destroyed and the promise is fulfilled with `false`.
+ * If all of the *fn* calls on the chunks return a truthy value, the promise is fulfilled with `true`.
+ * @since v17.5.0
+ * @param fn a function to call on each chunk of the stream. Async or not.
+ * @returns a promise evaluating to `true` if *fn* returned a truthy value for every one of the chunks.
+ */
+ every(
+ fn: (data: any, options?: Pick<ArrayOptions, "signal">) => boolean | Promise<boolean>,
+ options?: ArrayOptions,
+ ): Promise<boolean>;
+ /**
+ * This method returns a new stream by applying the given callback to each chunk of the stream
+ * and then flattening the result.
+ *
+ * It is possible to return a stream or another iterable or async iterable from *fn* and the result streams
+ * will be merged (flattened) into the returned stream.
+ * @since v17.5.0
+ * @param fn a function to map over every chunk in the stream. May be async. May be a stream or generator.
+ * @returns a stream flat-mapped with the function *fn*.
+ */
+ flatMap(fn: (data: any, options?: Pick<ArrayOptions, "signal">) => any, options?: ArrayOptions): Readable;
+ /**
+ * This method returns a new stream with the first *limit* chunks dropped from the start.
+ * @since v17.5.0
+ * @param limit the number of chunks to drop from the readable.
+ * @returns a stream with *limit* chunks dropped from the start.
+ */
+ drop(limit: number, options?: Pick<ArrayOptions, "signal">): Readable;
+ /**
+ * This method returns a new stream with the first *limit* chunks.
+ * @since v17.5.0
+ * @param limit the number of chunks to take from the readable.
+ * @returns a stream with *limit* chunks taken.
+ */
+ take(limit: number, options?: Pick<ArrayOptions, "signal">): Readable;
+ /**
+ * This method returns a new stream with chunks of the underlying stream paired with a counter
+ * in the form `[index, chunk]`. The first index value is `0` and it increases by 1 for each chunk produced.
+ * @since v17.5.0
+ * @returns a stream of indexed pairs.
+ */
+ asIndexedPairs(options?: Pick<ArrayOptions, "signal">): Readable;
+ /**
+ * This method calls *fn* on each chunk of the stream in order, passing it the result from the calculation
+ * on the previous element. It returns a promise for the final value of the reduction.
+ *
+ * If no *initial* value is supplied the first chunk of the stream is used as the initial value.
+ * If the stream is empty, the promise is rejected with a `TypeError` with the `ERR_INVALID_ARGS` code property.
+ *
+ * The reducer function iterates the stream element-by-element which means that there is no *concurrency* parameter
+ * or parallelism. To perform a reduce concurrently, you can extract the async function to `readable.map` method.
+ * @since v17.5.0
+ * @param fn a reducer function to call over every chunk in the stream. Async or not.
+ * @param initial the initial value to use in the reduction.
+ * @returns a promise for the final value of the reduction.
+ */
+ reduce<T = any>(
+ fn: (previous: any, data: any, options?: Pick<ArrayOptions, "signal">) => T,
+ initial?: undefined,
+ options?: Pick<ArrayOptions, "signal">,
+ ): Promise<T>;
+ reduce<T = any>(
+ fn: (previous: T, data: any, options?: Pick<ArrayOptions, "signal">) => T,
+ initial: T,
+ options?: Pick<ArrayOptions, "signal">,
+ ): Promise<T>;
+ _destroy(error: Error | null, callback: (error?: Error | null) => void): void;
+ /**
+ * Destroy the stream. Optionally emit an `'error'` event, and emit a `'close'`event (unless `emitClose` is set to `false`). After this call, the readable
+ * stream will release any internal resources and subsequent calls to `push()`will be ignored.
+ *
+ * Once `destroy()` has been called any further calls will be a no-op and no
+ * further errors except from `_destroy()` may be emitted as `'error'`.
+ *
+ * Implementors should not override this method, but instead implement `readable._destroy()`.
+ * @since v8.0.0
+ * @param error Error which will be passed as payload in `'error'` event
+ */
+ destroy(error?: Error): this;
+ /**
+ * Event emitter
+ * The defined events on documents including:
+ * 1. close
+ * 2. data
+ * 3. end
+ * 4. error
+ * 5. pause
+ * 6. readable
+ * 7. resume
+ */
+ addListener(event: "close", listener: () => void): this;
+ addListener(event: "data", listener: (chunk: any) => void): this;
+ addListener(event: "end", listener: () => void): this;
+ addListener(event: "error", listener: (err: Error) => void): this;
+ addListener(event: "pause", listener: () => void): this;
+ addListener(event: "readable", listener: () => void): this;
+ addListener(event: "resume", listener: () => void): this;
+ addListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ emit(event: "close"): boolean;
+ emit(event: "data", chunk: any): boolean;
+ emit(event: "end"): boolean;
+ emit(event: "error", err: Error): boolean;
+ emit(event: "pause"): boolean;
+ emit(event: "readable"): boolean;
+ emit(event: "resume"): boolean;
+ emit(event: string | symbol, ...args: any[]): boolean;
+ on(event: "close", listener: () => void): this;
+ on(event: "data", listener: (chunk: any) => void): this;
+ on(event: "end", listener: () => void): this;
+ on(event: "error", listener: (err: Error) => void): this;
+ on(event: "pause", listener: () => void): this;
+ on(event: "readable", listener: () => void): this;
+ on(event: "resume", listener: () => void): this;
+ on(event: string | symbol, listener: (...args: any[]) => void): this;
+ once(event: "close", listener: () => void): this;
+ once(event: "data", listener: (chunk: any) => void): this;
+ once(event: "end", listener: () => void): this;
+ once(event: "error", listener: (err: Error) => void): this;
+ once(event: "pause", listener: () => void): this;
+ once(event: "readable", listener: () => void): this;
+ once(event: "resume", listener: () => void): this;
+ once(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependListener(event: "close", listener: () => void): this;
+ prependListener(event: "data", listener: (chunk: any) => void): this;
+ prependListener(event: "end", listener: () => void): this;
+ prependListener(event: "error", listener: (err: Error) => void): this;
+ prependListener(event: "pause", listener: () => void): this;
+ prependListener(event: "readable", listener: () => void): this;
+ prependListener(event: "resume", listener: () => void): this;
+ prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependOnceListener(event: "close", listener: () => void): this;
+ prependOnceListener(event: "data", listener: (chunk: any) => void): this;
+ prependOnceListener(event: "end", listener: () => void): this;
+ prependOnceListener(event: "error", listener: (err: Error) => void): this;
+ prependOnceListener(event: "pause", listener: () => void): this;
+ prependOnceListener(event: "readable", listener: () => void): this;
+ prependOnceListener(event: "resume", listener: () => void): this;
+ prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ removeListener(event: "close", listener: () => void): this;
+ removeListener(event: "data", listener: (chunk: any) => void): this;
+ removeListener(event: "end", listener: () => void): this;
+ removeListener(event: "error", listener: (err: Error) => void): this;
+ removeListener(event: "pause", listener: () => void): this;
+ removeListener(event: "readable", listener: () => void): this;
+ removeListener(event: "resume", listener: () => void): this;
+ removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ [Symbol.asyncIterator](): AsyncIterableIterator<any>;
+ /**
+ * Calls `readable.destroy()` with an `AbortError` and returns a promise that fulfills when the stream is finished.
+ * @since v18.18.0
+ */
+ [Symbol.asyncDispose](): Promise<void>;
+ }
+ interface WritableOptions extends StreamOptions<Writable> {
+ decodeStrings?: boolean | undefined;
+ defaultEncoding?: BufferEncoding | undefined;
+ write?(
+ this: Writable,
+ chunk: any,
+ encoding: BufferEncoding,
+ callback: (error?: Error | null) => void,
+ ): void;
+ writev?(
+ this: Writable,
+ chunks: Array<{
+ chunk: any;
+ encoding: BufferEncoding;
+ }>,
+ callback: (error?: Error | null) => void,
+ ): void;
+ final?(this: Writable, callback: (error?: Error | null) => void): void;
+ }
+ /**
+ * @since v0.9.4
+ */
+ class Writable extends Stream implements NodeJS.WritableStream {
+ /**
+ * A utility method for creating a `Writable` from a web `WritableStream`.
+ * @since v17.0.0
+ * @experimental
+ */
+ static fromWeb(
+ writableStream: streamWeb.WritableStream,
+ options?: Pick<WritableOptions, "decodeStrings" | "highWaterMark" | "objectMode" | "signal">,
+ ): Writable;
+ /**
+ * A utility method for creating a web `WritableStream` from a `Writable`.
+ * @since v17.0.0
+ * @experimental
+ */
+ static toWeb(streamWritable: Writable): streamWeb.WritableStream;
+ /**
+ * Is `true` if it is safe to call `writable.write()`, which means
+ * the stream has not been destroyed, errored or ended.
+ * @since v11.4.0
+ */
+ readonly writable: boolean;
+ /**
+ * Is `true` after `writable.end()` has been called. This property
+ * does not indicate whether the data has been flushed, for this use `writable.writableFinished` instead.
+ * @since v12.9.0
+ */
+ readonly writableEnded: boolean;
+ /**
+ * Is set to `true` immediately before the `'finish'` event is emitted.
+ * @since v12.6.0
+ */
+ readonly writableFinished: boolean;
+ /**
+ * Return the value of `highWaterMark` passed when creating this `Writable`.
+ * @since v9.3.0
+ */
+ readonly writableHighWaterMark: number;
+ /**
+ * This property contains the number of bytes (or objects) in the queue
+ * ready to be written. The value provides introspection data regarding
+ * the status of the `highWaterMark`.
+ * @since v9.4.0
+ */
+ readonly writableLength: number;
+ /**
+ * Getter for the property `objectMode` of a given `Writable` stream.
+ * @since v12.3.0
+ */
+ readonly writableObjectMode: boolean;
+ /**
+ * Number of times `writable.uncork()` needs to be
+ * called in order to fully uncork the stream.
+ * @since v13.2.0, v12.16.0
+ */
+ readonly writableCorked: number;
+ /**
+ * Is `true` after `writable.destroy()` has been called.
+ * @since v8.0.0
+ */
+ destroyed: boolean;
+ /**
+ * Is true after 'close' has been emitted.
+ * @since v18.0.0
+ */
+ readonly closed: boolean;
+ /**
+ * Returns error if the stream has been destroyed with an error.
+ * @since v18.0.0
+ */
+ readonly errored: Error | null;
+ /**
+ * Is `true` if the stream's buffer has been full and stream will emit 'drain'.
+ * @since v15.2.0, v14.17.0
+ */
+ readonly writableNeedDrain: boolean;
+ constructor(opts?: WritableOptions);
+ _write(chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void;
+ _writev?(
+ chunks: Array<{
+ chunk: any;
+ encoding: BufferEncoding;
+ }>,
+ callback: (error?: Error | null) => void,
+ ): void;
+ _construct?(callback: (error?: Error | null) => void): void;
+ _destroy(error: Error | null, callback: (error?: Error | null) => void): void;
+ _final(callback: (error?: Error | null) => void): void;
+ /**
+ * The `writable.write()` method writes some data to the stream, and calls the
+ * supplied `callback` once the data has been fully handled. If an error
+ * occurs, the `callback` will be called with the error as its
+ * first argument. The `callback` is called asynchronously and before `'error'` is
+ * emitted.
+ *
+ * The return value is `true` if the internal buffer is less than the`highWaterMark` configured when the stream was created after admitting `chunk`.
+ * If `false` is returned, further attempts to write data to the stream should
+ * stop until the `'drain'` event is emitted.
+ *
+ * While a stream is not draining, calls to `write()` will buffer `chunk`, and
+ * return false. Once all currently buffered chunks are drained (accepted for
+ * delivery by the operating system), the `'drain'` event will be emitted.
+ * Once `write()` returns false, do not write more chunks
+ * until the `'drain'` event is emitted. While calling `write()` on a stream that
+ * is not draining is allowed, Node.js will buffer all written chunks until
+ * maximum memory usage occurs, at which point it will abort unconditionally.
+ * Even before it aborts, high memory usage will cause poor garbage collector
+ * performance and high RSS (which is not typically released back to the system,
+ * even after the memory is no longer required). Since TCP sockets may never
+ * drain if the remote peer does not read the data, writing a socket that is
+ * not draining may lead to a remotely exploitable vulnerability.
+ *
+ * Writing data while the stream is not draining is particularly
+ * problematic for a `Transform`, because the `Transform` streams are paused
+ * by default until they are piped or a `'data'` or `'readable'` event handler
+ * is added.
+ *
+ * If the data to be written can be generated or fetched on demand, it is
+ * recommended to encapsulate the logic into a `Readable` and use {@link pipe}. However, if calling `write()` is preferred, it is
+ * possible to respect backpressure and avoid memory issues using the `'drain'` event:
+ *
+ * ```js
+ * function write(data, cb) {
+ * if (!stream.write(data)) {
+ * stream.once('drain', cb);
+ * } else {
+ * process.nextTick(cb);
+ * }
+ * }
+ *
+ * // Wait for cb to be called before doing any other write.
+ * write('hello', () => {
+ * console.log('Write completed, do more writes now.');
+ * });
+ * ```
+ *
+ * A `Writable` stream in object mode will always ignore the `encoding` argument.
+ * @since v0.9.4
+ * @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a string, `Buffer` or `Uint8Array`. For object mode streams, `chunk` may be any
+ * JavaScript value other than `null`.
+ * @param [encoding='utf8'] The encoding, if `chunk` is a string.
+ * @param callback Callback for when this chunk of data is flushed.
+ * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
+ */
+ write(chunk: any, callback?: (error: Error | null | undefined) => void): boolean;
+ write(chunk: any, encoding: BufferEncoding, callback?: (error: Error | null | undefined) => void): boolean;
+ /**
+ * The `writable.setDefaultEncoding()` method sets the default `encoding` for a `Writable` stream.
+ * @since v0.11.15
+ * @param encoding The new default encoding
+ */
+ setDefaultEncoding(encoding: BufferEncoding): this;
+ /**
+ * Calling the `writable.end()` method signals that no more data will be written
+ * to the `Writable`. The optional `chunk` and `encoding` arguments allow one
+ * final additional chunk of data to be written immediately before closing the
+ * stream.
+ *
+ * Calling the {@link write} method after calling {@link end} will raise an error.
+ *
+ * ```js
+ * // Write 'hello, ' and then end with 'world!'.
+ * const fs = require('fs');
+ * const file = fs.createWriteStream('example.txt');
+ * file.write('hello, ');
+ * file.end('world!');
+ * // Writing more now is not allowed!
+ * ```
+ * @since v0.9.4
+ * @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a string, `Buffer` or `Uint8Array`. For object mode streams, `chunk` may be any
+ * JavaScript value other than `null`.
+ * @param encoding The encoding if `chunk` is a string
+ * @param callback Callback for when the stream is finished.
+ */
+ end(cb?: () => void): this;
+ end(chunk: any, cb?: () => void): this;
+ end(chunk: any, encoding: BufferEncoding, cb?: () => void): this;
+ /**
+ * The `writable.cork()` method forces all written data to be buffered in memory.
+ * The buffered data will be flushed when either the {@link uncork} or {@link end} methods are called.
+ *
+ * The primary intent of `writable.cork()` is to accommodate a situation in which
+ * several small chunks are written to the stream in rapid succession. Instead of
+ * immediately forwarding them to the underlying destination, `writable.cork()`buffers all the chunks until `writable.uncork()` is called, which will pass them
+ * all to `writable._writev()`, if present. This prevents a head-of-line blocking
+ * situation where data is being buffered while waiting for the first small chunk
+ * to be processed. However, use of `writable.cork()` without implementing`writable._writev()` may have an adverse effect on throughput.
+ *
+ * See also: `writable.uncork()`, `writable._writev()`.
+ * @since v0.11.2
+ */
+ cork(): void;
+ /**
+ * The `writable.uncork()` method flushes all data buffered since {@link cork} was called.
+ *
+ * When using `writable.cork()` and `writable.uncork()` to manage the buffering
+ * of writes to a stream, defer calls to `writable.uncork()` using`process.nextTick()`. Doing so allows batching of all`writable.write()` calls that occur within a given Node.js event
+ * loop phase.
+ *
+ * ```js
+ * stream.cork();
+ * stream.write('some ');
+ * stream.write('data ');
+ * process.nextTick(() => stream.uncork());
+ * ```
+ *
+ * If the `writable.cork()` method is called multiple times on a stream, the
+ * same number of calls to `writable.uncork()` must be called to flush the buffered
+ * data.
+ *
+ * ```js
+ * stream.cork();
+ * stream.write('some ');
+ * stream.cork();
+ * stream.write('data ');
+ * process.nextTick(() => {
+ * stream.uncork();
+ * // The data will not be flushed until uncork() is called a second time.
+ * stream.uncork();
+ * });
+ * ```
+ *
+ * See also: `writable.cork()`.
+ * @since v0.11.2
+ */
+ uncork(): void;
+ /**
+ * Destroy the stream. Optionally emit an `'error'` event, and emit a `'close'`event (unless `emitClose` is set to `false`). After this call, the writable
+ * stream has ended and subsequent calls to `write()` or `end()` will result in
+ * an `ERR_STREAM_DESTROYED` error.
+ * This is a destructive and immediate way to destroy a stream. Previous calls to`write()` may not have drained, and may trigger an `ERR_STREAM_DESTROYED` error.
+ * Use `end()` instead of destroy if data should flush before close, or wait for
+ * the `'drain'` event before destroying the stream.
+ *
+ * Once `destroy()` has been called any further calls will be a no-op and no
+ * further errors except from `_destroy()` may be emitted as `'error'`.
+ *
+ * Implementors should not override this method,
+ * but instead implement `writable._destroy()`.
+ * @since v8.0.0
+ * @param error Optional, an error to emit with `'error'` event.
+ */
+ destroy(error?: Error): this;
+ /**
+ * Event emitter
+ * The defined events on documents including:
+ * 1. close
+ * 2. drain
+ * 3. error
+ * 4. finish
+ * 5. pipe
+ * 6. unpipe
+ */
+ addListener(event: "close", listener: () => void): this;
+ addListener(event: "drain", listener: () => void): this;
+ addListener(event: "error", listener: (err: Error) => void): this;
+ addListener(event: "finish", listener: () => void): this;
+ addListener(event: "pipe", listener: (src: Readable) => void): this;
+ addListener(event: "unpipe", listener: (src: Readable) => void): this;
+ addListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ emit(event: "close"): boolean;
+ emit(event: "drain"): boolean;
+ emit(event: "error", err: Error): boolean;
+ emit(event: "finish"): boolean;
+ emit(event: "pipe", src: Readable): boolean;
+ emit(event: "unpipe", src: Readable): boolean;
+ emit(event: string | symbol, ...args: any[]): boolean;
+ on(event: "close", listener: () => void): this;
+ on(event: "drain", listener: () => void): this;
+ on(event: "error", listener: (err: Error) => void): this;
+ on(event: "finish", listener: () => void): this;
+ on(event: "pipe", listener: (src: Readable) => void): this;
+ on(event: "unpipe", listener: (src: Readable) => void): this;
+ on(event: string | symbol, listener: (...args: any[]) => void): this;
+ once(event: "close", listener: () => void): this;
+ once(event: "drain", listener: () => void): this;
+ once(event: "error", listener: (err: Error) => void): this;
+ once(event: "finish", listener: () => void): this;
+ once(event: "pipe", listener: (src: Readable) => void): this;
+ once(event: "unpipe", listener: (src: Readable) => void): this;
+ once(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependListener(event: "close", listener: () => void): this;
+ prependListener(event: "drain", listener: () => void): this;
+ prependListener(event: "error", listener: (err: Error) => void): this;
+ prependListener(event: "finish", listener: () => void): this;
+ prependListener(event: "pipe", listener: (src: Readable) => void): this;
+ prependListener(event: "unpipe", listener: (src: Readable) => void): this;
+ prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependOnceListener(event: "close", listener: () => void): this;
+ prependOnceListener(event: "drain", listener: () => void): this;
+ prependOnceListener(event: "error", listener: (err: Error) => void): this;
+ prependOnceListener(event: "finish", listener: () => void): this;
+ prependOnceListener(event: "pipe", listener: (src: Readable) => void): this;
+ prependOnceListener(event: "unpipe", listener: (src: Readable) => void): this;
+ prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ removeListener(event: "close", listener: () => void): this;
+ removeListener(event: "drain", listener: () => void): this;
+ removeListener(event: "error", listener: (err: Error) => void): this;
+ removeListener(event: "finish", listener: () => void): this;
+ removeListener(event: "pipe", listener: (src: Readable) => void): this;
+ removeListener(event: "unpipe", listener: (src: Readable) => void): this;
+ removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ }
+ interface DuplexOptions extends ReadableOptions, WritableOptions {
+ allowHalfOpen?: boolean | undefined;
+ readableObjectMode?: boolean | undefined;
+ writableObjectMode?: boolean | undefined;
+ readableHighWaterMark?: number | undefined;
+ writableHighWaterMark?: number | undefined;
+ writableCorked?: number | undefined;
+ construct?(this: Duplex, callback: (error?: Error | null) => void): void;
+ read?(this: Duplex, size: number): void;
+ write?(this: Duplex, chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void;
+ writev?(
+ this: Duplex,
+ chunks: Array<{
+ chunk: any;
+ encoding: BufferEncoding;
+ }>,
+ callback: (error?: Error | null) => void,
+ ): void;
+ final?(this: Duplex, callback: (error?: Error | null) => void): void;
+ destroy?(this: Duplex, error: Error | null, callback: (error: Error | null) => void): void;
+ }
+ /**
+ * Duplex streams are streams that implement both the `Readable` and `Writable` interfaces.
+ *
+ * Examples of `Duplex` streams include:
+ *
+ * * `TCP sockets`
+ * * `zlib streams`
+ * * `crypto streams`
+ * @since v0.9.4
+ */
+ class Duplex extends Readable implements Writable {
+ readonly writable: boolean;
+ readonly writableEnded: boolean;
+ readonly writableFinished: boolean;
+ readonly writableHighWaterMark: number;
+ readonly writableLength: number;
+ readonly writableObjectMode: boolean;
+ readonly writableCorked: number;
+ readonly writableNeedDrain: boolean;
+ readonly closed: boolean;
+ readonly errored: Error | null;
+ /**
+ * If `false` then the stream will automatically end the writable side when the
+ * readable side ends. Set initially by the `allowHalfOpen` constructor option,
+ * which defaults to `false`.
+ *
+ * This can be changed manually to change the half-open behavior of an existing`Duplex` stream instance, but must be changed before the `'end'` event is
+ * emitted.
+ * @since v0.9.4
+ */
+ allowHalfOpen: boolean;
+ constructor(opts?: DuplexOptions);
+ /**
+ * A utility method for creating duplex streams.
+ *
+ * - `Stream` converts writable stream into writable `Duplex` and readable stream
+ * to `Duplex`.
+ * - `Blob` converts into readable `Duplex`.
+ * - `string` converts into readable `Duplex`.
+ * - `ArrayBuffer` converts into readable `Duplex`.
+ * - `AsyncIterable` converts into a readable `Duplex`. Cannot yield `null`.
+ * - `AsyncGeneratorFunction` converts into a readable/writable transform
+ * `Duplex`. Must take a source `AsyncIterable` as first parameter. Cannot yield
+ * `null`.
+ * - `AsyncFunction` converts into a writable `Duplex`. Must return
+ * either `null` or `undefined`
+ * - `Object ({ writable, readable })` converts `readable` and
+ * `writable` into `Stream` and then combines them into `Duplex` where the
+ * `Duplex` will write to the `writable` and read from the `readable`.
+ * - `Promise` converts into readable `Duplex`. Value `null` is ignored.
+ *
+ * @since v16.8.0
+ */
+ static from(
+ src:
+ | Stream
+ | NodeBlob
+ | ArrayBuffer
+ | string
+ | Iterable<any>
+ | AsyncIterable<any>
+ | AsyncGeneratorFunction
+ | Promise<any>
+ | Object,
+ ): Duplex;
+ _write(chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void;
+ _writev?(
+ chunks: Array<{
+ chunk: any;
+ encoding: BufferEncoding;
+ }>,
+ callback: (error?: Error | null) => void,
+ ): void;
+ _destroy(error: Error | null, callback: (error: Error | null) => void): void;
+ _final(callback: (error?: Error | null) => void): void;
+ write(chunk: any, encoding?: BufferEncoding, cb?: (error: Error | null | undefined) => void): boolean;
+ write(chunk: any, cb?: (error: Error | null | undefined) => void): boolean;
+ setDefaultEncoding(encoding: BufferEncoding): this;
+ end(cb?: () => void): this;
+ end(chunk: any, cb?: () => void): this;
+ end(chunk: any, encoding?: BufferEncoding, cb?: () => void): this;
+ cork(): void;
+ uncork(): void;
+ /**
+ * Event emitter
+ * The defined events on documents including:
+ * 1. close
+ * 2. data
+ * 3. drain
+ * 4. end
+ * 5. error
+ * 6. finish
+ * 7. pause
+ * 8. pipe
+ * 9. readable
+ * 10. resume
+ * 11. unpipe
+ */
+ addListener(event: "close", listener: () => void): this;
+ addListener(event: "data", listener: (chunk: any) => void): this;
+ addListener(event: "drain", listener: () => void): this;
+ addListener(event: "end", listener: () => void): this;
+ addListener(event: "error", listener: (err: Error) => void): this;
+ addListener(event: "finish", listener: () => void): this;
+ addListener(event: "pause", listener: () => void): this;
+ addListener(event: "pipe", listener: (src: Readable) => void): this;
+ addListener(event: "readable", listener: () => void): this;
+ addListener(event: "resume", listener: () => void): this;
+ addListener(event: "unpipe", listener: (src: Readable) => void): this;
+ addListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ emit(event: "close"): boolean;
+ emit(event: "data", chunk: any): boolean;
+ emit(event: "drain"): boolean;
+ emit(event: "end"): boolean;
+ emit(event: "error", err: Error): boolean;
+ emit(event: "finish"): boolean;
+ emit(event: "pause"): boolean;
+ emit(event: "pipe", src: Readable): boolean;
+ emit(event: "readable"): boolean;
+ emit(event: "resume"): boolean;
+ emit(event: "unpipe", src: Readable): boolean;
+ emit(event: string | symbol, ...args: any[]): boolean;
+ on(event: "close", listener: () => void): this;
+ on(event: "data", listener: (chunk: any) => void): this;
+ on(event: "drain", listener: () => void): this;
+ on(event: "end", listener: () => void): this;
+ on(event: "error", listener: (err: Error) => void): this;
+ on(event: "finish", listener: () => void): this;
+ on(event: "pause", listener: () => void): this;
+ on(event: "pipe", listener: (src: Readable) => void): this;
+ on(event: "readable", listener: () => void): this;
+ on(event: "resume", listener: () => void): this;
+ on(event: "unpipe", listener: (src: Readable) => void): this;
+ on(event: string | symbol, listener: (...args: any[]) => void): this;
+ once(event: "close", listener: () => void): this;
+ once(event: "data", listener: (chunk: any) => void): this;
+ once(event: "drain", listener: () => void): this;
+ once(event: "end", listener: () => void): this;
+ once(event: "error", listener: (err: Error) => void): this;
+ once(event: "finish", listener: () => void): this;
+ once(event: "pause", listener: () => void): this;
+ once(event: "pipe", listener: (src: Readable) => void): this;
+ once(event: "readable", listener: () => void): this;
+ once(event: "resume", listener: () => void): this;
+ once(event: "unpipe", listener: (src: Readable) => void): this;
+ once(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependListener(event: "close", listener: () => void): this;
+ prependListener(event: "data", listener: (chunk: any) => void): this;
+ prependListener(event: "drain", listener: () => void): this;
+ prependListener(event: "end", listener: () => void): this;
+ prependListener(event: "error", listener: (err: Error) => void): this;
+ prependListener(event: "finish", listener: () => void): this;
+ prependListener(event: "pause", listener: () => void): this;
+ prependListener(event: "pipe", listener: (src: Readable) => void): this;
+ prependListener(event: "readable", listener: () => void): this;
+ prependListener(event: "resume", listener: () => void): this;
+ prependListener(event: "unpipe", listener: (src: Readable) => void): this;
+ prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependOnceListener(event: "close", listener: () => void): this;
+ prependOnceListener(event: "data", listener: (chunk: any) => void): this;
+ prependOnceListener(event: "drain", listener: () => void): this;
+ prependOnceListener(event: "end", listener: () => void): this;
+ prependOnceListener(event: "error", listener: (err: Error) => void): this;
+ prependOnceListener(event: "finish", listener: () => void): this;
+ prependOnceListener(event: "pause", listener: () => void): this;
+ prependOnceListener(event: "pipe", listener: (src: Readable) => void): this;
+ prependOnceListener(event: "readable", listener: () => void): this;
+ prependOnceListener(event: "resume", listener: () => void): this;
+ prependOnceListener(event: "unpipe", listener: (src: Readable) => void): this;
+ prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ removeListener(event: "close", listener: () => void): this;
+ removeListener(event: "data", listener: (chunk: any) => void): this;
+ removeListener(event: "drain", listener: () => void): this;
+ removeListener(event: "end", listener: () => void): this;
+ removeListener(event: "error", listener: (err: Error) => void): this;
+ removeListener(event: "finish", listener: () => void): this;
+ removeListener(event: "pause", listener: () => void): this;
+ removeListener(event: "pipe", listener: (src: Readable) => void): this;
+ removeListener(event: "readable", listener: () => void): this;
+ removeListener(event: "resume", listener: () => void): this;
+ removeListener(event: "unpipe", listener: (src: Readable) => void): this;
+ removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ }
+ type TransformCallback = (error?: Error | null, data?: any) => void;
+ interface TransformOptions extends DuplexOptions {
+ construct?(this: Transform, callback: (error?: Error | null) => void): void;
+ read?(this: Transform, size: number): void;
+ write?(
+ this: Transform,
+ chunk: any,
+ encoding: BufferEncoding,
+ callback: (error?: Error | null) => void,
+ ): void;
+ writev?(
+ this: Transform,
+ chunks: Array<{
+ chunk: any;
+ encoding: BufferEncoding;
+ }>,
+ callback: (error?: Error | null) => void,
+ ): void;
+ final?(this: Transform, callback: (error?: Error | null) => void): void;
+ destroy?(this: Transform, error: Error | null, callback: (error: Error | null) => void): void;
+ transform?(this: Transform, chunk: any, encoding: BufferEncoding, callback: TransformCallback): void;
+ flush?(this: Transform, callback: TransformCallback): void;
+ }
+ /**
+ * Transform streams are `Duplex` streams where the output is in some way
+ * related to the input. Like all `Duplex` streams, `Transform` streams
+ * implement both the `Readable` and `Writable` interfaces.
+ *
+ * Examples of `Transform` streams include:
+ *
+ * * `zlib streams`
+ * * `crypto streams`
+ * @since v0.9.4
+ */
+ class Transform extends Duplex {
+ constructor(opts?: TransformOptions);
+ _transform(chunk: any, encoding: BufferEncoding, callback: TransformCallback): void;
+ _flush(callback: TransformCallback): void;
+ }
+ /**
+ * The `stream.PassThrough` class is a trivial implementation of a `Transform` stream that simply passes the input bytes across to the output. Its purpose is
+ * primarily for examples and testing, but there are some use cases where`stream.PassThrough` is useful as a building block for novel sorts of streams.
+ */
+ class PassThrough extends Transform {}
+ /**
+ * Attaches an AbortSignal to a readable or writeable stream. This lets code
+ * control stream destruction using an `AbortController`.
+ *
+ * Calling `abort` on the `AbortController` corresponding to the passed`AbortSignal` will behave the same way as calling `.destroy(new AbortError())`on the stream.
+ *
+ * ```js
+ * const fs = require('fs');
+ *
+ * const controller = new AbortController();
+ * const read = addAbortSignal(
+ * controller.signal,
+ * fs.createReadStream(('object.json'))
+ * );
+ * // Later, abort the operation closing the stream
+ * controller.abort();
+ * ```
+ *
+ * Or using an `AbortSignal` with a readable stream as an async iterable:
+ *
+ * ```js
+ * const controller = new AbortController();
+ * setTimeout(() => controller.abort(), 10_000); // set a timeout
+ * const stream = addAbortSignal(
+ * controller.signal,
+ * fs.createReadStream(('object.json'))
+ * );
+ * (async () => {
+ * try {
+ * for await (const chunk of stream) {
+ * await process(chunk);
+ * }
+ * } catch (e) {
+ * if (e.name === 'AbortError') {
+ * // The operation was cancelled
+ * } else {
+ * throw e;
+ * }
+ * }
+ * })();
+ * ```
+ * @since v15.4.0
+ * @param signal A signal representing possible cancellation
+ * @param stream a stream to attach a signal to
+ */
+ function addAbortSignal<T extends Stream>(signal: AbortSignal, stream: T): T;
+ /**
+ * Returns the default highWaterMark used by streams.
+ * Defaults to `16384` (16 KiB), or `16` for `objectMode`.
+ * @since v18.17.0
+ * @param objectMode
+ */
+ function getDefaultHighWaterMark(objectMode: boolean): number;
+ /**
+ * Sets the default highWaterMark used by streams.
+ * @since v18.17.0
+ * @param objectMode
+ * @param value highWaterMark value
+ */
+ function setDefaultHighWaterMark(objectMode: boolean, value: number): void;
+ interface FinishedOptions extends Abortable {
+ error?: boolean | undefined;
+ readable?: boolean | undefined;
+ writable?: boolean | undefined;
+ }
+ /**
+ * A function to get notified when a stream is no longer readable, writable
+ * or has experienced an error or a premature close event.
+ *
+ * ```js
+ * const { finished } = require('stream');
+ *
+ * const rs = fs.createReadStream('archive.tar');
+ *
+ * finished(rs, (err) => {
+ * if (err) {
+ * console.error('Stream failed.', err);
+ * } else {
+ * console.log('Stream is done reading.');
+ * }
+ * });
+ *
+ * rs.resume(); // Drain the stream.
+ * ```
+ *
+ * Especially useful in error handling scenarios where a stream is destroyed
+ * prematurely (like an aborted HTTP request), and will not emit `'end'`or `'finish'`.
+ *
+ * The `finished` API provides promise version:
+ *
+ * ```js
+ * const { finished } = require('stream/promises');
+ *
+ * const rs = fs.createReadStream('archive.tar');
+ *
+ * async function run() {
+ * await finished(rs);
+ * console.log('Stream is done reading.');
+ * }
+ *
+ * run().catch(console.error);
+ * rs.resume(); // Drain the stream.
+ * ```
+ *
+ * `stream.finished()` leaves dangling event listeners (in particular`'error'`, `'end'`, `'finish'` and `'close'`) after `callback` has been
+ * invoked. The reason for this is so that unexpected `'error'` events (due to
+ * incorrect stream implementations) do not cause unexpected crashes.
+ * If this is unwanted behavior then the returned cleanup function needs to be
+ * invoked in the callback:
+ *
+ * ```js
+ * const cleanup = finished(rs, (err) => {
+ * cleanup();
+ * // ...
+ * });
+ * ```
+ * @since v10.0.0
+ * @param stream A readable and/or writable stream.
+ * @param callback A callback function that takes an optional error argument.
+ * @return A cleanup function which removes all registered listeners.
+ */
+ function finished(
+ stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream,
+ options: FinishedOptions,
+ callback: (err?: NodeJS.ErrnoException | null) => void,
+ ): () => void;
+ function finished(
+ stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream,
+ callback: (err?: NodeJS.ErrnoException | null) => void,
+ ): () => void;
+ namespace finished {
+ function __promisify__(
+ stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream,
+ options?: FinishedOptions,
+ ): Promise<void>;
+ }
+ type PipelineSourceFunction<T> = () => Iterable<T> | AsyncIterable<T>;
+ type PipelineSource<T> = Iterable<T> | AsyncIterable<T> | NodeJS.ReadableStream | PipelineSourceFunction<T>;
+ type PipelineTransform<S extends PipelineTransformSource<any>, U> =
+ | NodeJS.ReadWriteStream
+ | ((
+ source: S extends (...args: any[]) => Iterable<infer ST> | AsyncIterable<infer ST> ? AsyncIterable<ST>
+ : S,
+ ) => AsyncIterable<U>);
+ type PipelineTransformSource<T> = PipelineSource<T> | PipelineTransform<any, T>;
+ type PipelineDestinationIterableFunction<T> = (source: AsyncIterable<T>) => AsyncIterable<any>;
+ type PipelineDestinationPromiseFunction<T, P> = (source: AsyncIterable<T>) => Promise<P>;
+ type PipelineDestination<S extends PipelineTransformSource<any>, P> = S extends
+ PipelineTransformSource<infer ST> ?
+ | NodeJS.WritableStream
+ | PipelineDestinationIterableFunction<ST>
+ | PipelineDestinationPromiseFunction<ST, P>
+ : never;
+ type PipelineCallback<S extends PipelineDestination<any, any>> = S extends
+ PipelineDestinationPromiseFunction<any, infer P> ? (err: NodeJS.ErrnoException | null, value: P) => void
+ : (err: NodeJS.ErrnoException | null) => void;
+ type PipelinePromise<S extends PipelineDestination<any, any>> = S extends
+ PipelineDestinationPromiseFunction<any, infer P> ? Promise<P> : Promise<void>;
+ interface PipelineOptions {
+ signal?: AbortSignal | undefined;
+ end?: boolean | undefined;
+ }
+ /**
+ * A module method to pipe between streams and generators forwarding errors and
+ * properly cleaning up and provide a callback when the pipeline is complete.
+ *
+ * ```js
+ * const { pipeline } = require('stream');
+ * const fs = require('fs');
+ * const zlib = require('zlib');
+ *
+ * // Use the pipeline API to easily pipe a series of streams
+ * // together and get notified when the pipeline is fully done.
+ *
+ * // A pipeline to gzip a potentially huge tar file efficiently:
+ *
+ * pipeline(
+ * fs.createReadStream('archive.tar'),
+ * zlib.createGzip(),
+ * fs.createWriteStream('archive.tar.gz'),
+ * (err) => {
+ * if (err) {
+ * console.error('Pipeline failed.', err);
+ * } else {
+ * console.log('Pipeline succeeded.');
+ * }
+ * }
+ * );
+ * ```
+ *
+ * The `pipeline` API provides a promise version, which can also
+ * receive an options argument as the last parameter with a`signal` `AbortSignal` property. When the signal is aborted,`destroy` will be called on the underlying pipeline, with
+ * an`AbortError`.
+ *
+ * ```js
+ * const { pipeline } = require('stream/promises');
+ *
+ * async function run() {
+ * await pipeline(
+ * fs.createReadStream('archive.tar'),
+ * zlib.createGzip(),
+ * fs.createWriteStream('archive.tar.gz')
+ * );
+ * console.log('Pipeline succeeded.');
+ * }
+ *
+ * run().catch(console.error);
+ * ```
+ *
+ * To use an `AbortSignal`, pass it inside an options object,
+ * as the last argument:
+ *
+ * ```js
+ * const { pipeline } = require('stream/promises');
+ *
+ * async function run() {
+ * const ac = new AbortController();
+ * const signal = ac.signal;
+ *
+ * setTimeout(() => ac.abort(), 1);
+ * await pipeline(
+ * fs.createReadStream('archive.tar'),
+ * zlib.createGzip(),
+ * fs.createWriteStream('archive.tar.gz'),
+ * { signal },
+ * );
+ * }
+ *
+ * run().catch(console.error); // AbortError
+ * ```
+ *
+ * The `pipeline` API also supports async generators:
+ *
+ * ```js
+ * const { pipeline } = require('stream/promises');
+ * const fs = require('fs');
+ *
+ * async function run() {
+ * await pipeline(
+ * fs.createReadStream('lowercase.txt'),
+ * async function* (source, { signal }) {
+ * source.setEncoding('utf8'); // Work with strings rather than `Buffer`s.
+ * for await (const chunk of source) {
+ * yield await processChunk(chunk, { signal });
+ * }
+ * },
+ * fs.createWriteStream('uppercase.txt')
+ * );
+ * console.log('Pipeline succeeded.');
+ * }
+ *
+ * run().catch(console.error);
+ * ```
+ *
+ * Remember to handle the `signal` argument passed into the async generator.
+ * Especially in the case where the async generator is the source for the
+ * pipeline (i.e. first argument) or the pipeline will never complete.
+ *
+ * ```js
+ * const { pipeline } = require('stream/promises');
+ * const fs = require('fs');
+ *
+ * async function run() {
+ * await pipeline(
+ * async function* ({ signal }) {
+ * await someLongRunningfn({ signal });
+ * yield 'asd';
+ * },
+ * fs.createWriteStream('uppercase.txt')
+ * );
+ * console.log('Pipeline succeeded.');
+ * }
+ *
+ * run().catch(console.error);
+ * ```
+ *
+ * `stream.pipeline()` will call `stream.destroy(err)` on all streams except:
+ *
+ * * `Readable` streams which have emitted `'end'` or `'close'`.
+ * * `Writable` streams which have emitted `'finish'` or `'close'`.
+ *
+ * `stream.pipeline()` leaves dangling event listeners on the streams
+ * after the `callback` has been invoked. In the case of reuse of streams after
+ * failure, this can cause event listener leaks and swallowed errors. If the last
+ * stream is readable, dangling event listeners will be removed so that the last
+ * stream can be consumed later.
+ *
+ * `stream.pipeline()` closes all the streams when an error is raised.
+ * The `IncomingRequest` usage with `pipeline` could lead to an unexpected behavior
+ * once it would destroy the socket without sending the expected response.
+ * See the example below:
+ *
+ * ```js
+ * const fs = require('fs');
+ * const http = require('http');
+ * const { pipeline } = require('stream');
+ *
+ * const server = http.createServer((req, res) => {
+ * const fileStream = fs.createReadStream('./fileNotExist.txt');
+ * pipeline(fileStream, res, (err) => {
+ * if (err) {
+ * console.log(err); // No such file
+ * // this message can't be sent once `pipeline` already destroyed the socket
+ * return res.end('error!!!');
+ * }
+ * });
+ * });
+ * ```
+ * @since v10.0.0
+ * @param callback Called when the pipeline is fully done.
+ */
+ function pipeline<A extends PipelineSource<any>, B extends PipelineDestination<A, any>>(
+ source: A,
+ destination: B,
+ callback?: PipelineCallback<B>,
+ ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream;
+ function pipeline<
+ A extends PipelineSource<any>,
+ T1 extends PipelineTransform<A, any>,
+ B extends PipelineDestination<T1, any>,
+ >(
+ source: A,
+ transform1: T1,
+ destination: B,
+ callback?: PipelineCallback<B>,
+ ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream;
+ function pipeline<
+ A extends PipelineSource<any>,
+ T1 extends PipelineTransform<A, any>,
+ T2 extends PipelineTransform<T1, any>,
+ B extends PipelineDestination<T2, any>,
+ >(
+ source: A,
+ transform1: T1,
+ transform2: T2,
+ destination: B,
+ callback?: PipelineCallback<B>,
+ ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream;
+ function pipeline<
+ A extends PipelineSource<any>,
+ T1 extends PipelineTransform<A, any>,
+ T2 extends PipelineTransform<T1, any>,
+ T3 extends PipelineTransform<T2, any>,
+ B extends PipelineDestination<T3, any>,
+ >(
+ source: A,
+ transform1: T1,
+ transform2: T2,
+ transform3: T3,
+ destination: B,
+ callback?: PipelineCallback<B>,
+ ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream;
+ function pipeline<
+ A extends PipelineSource<any>,
+ T1 extends PipelineTransform<A, any>,
+ T2 extends PipelineTransform<T1, any>,
+ T3 extends PipelineTransform<T2, any>,
+ T4 extends PipelineTransform<T3, any>,
+ B extends PipelineDestination<T4, any>,
+ >(
+ source: A,
+ transform1: T1,
+ transform2: T2,
+ transform3: T3,
+ transform4: T4,
+ destination: B,
+ callback?: PipelineCallback<B>,
+ ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream;
+ function pipeline(
+ streams: ReadonlyArray<NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream>,
+ callback?: (err: NodeJS.ErrnoException | null) => void,
+ ): NodeJS.WritableStream;
+ function pipeline(
+ stream1: NodeJS.ReadableStream,
+ stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream,
+ ...streams: Array<
+ NodeJS.ReadWriteStream | NodeJS.WritableStream | ((err: NodeJS.ErrnoException | null) => void)
+ >
+ ): NodeJS.WritableStream;
+ namespace pipeline {
+ function __promisify__<A extends PipelineSource<any>, B extends PipelineDestination<A, any>>(
+ source: A,
+ destination: B,
+ options?: PipelineOptions,
+ ): PipelinePromise<B>;
+ function __promisify__<
+ A extends PipelineSource<any>,
+ T1 extends PipelineTransform<A, any>,
+ B extends PipelineDestination<T1, any>,
+ >(
+ source: A,
+ transform1: T1,
+ destination: B,
+ options?: PipelineOptions,
+ ): PipelinePromise<B>;
+ function __promisify__<
+ A extends PipelineSource<any>,
+ T1 extends PipelineTransform<A, any>,
+ T2 extends PipelineTransform<T1, any>,
+ B extends PipelineDestination<T2, any>,
+ >(
+ source: A,
+ transform1: T1,
+ transform2: T2,
+ destination: B,
+ options?: PipelineOptions,
+ ): PipelinePromise<B>;
+ function __promisify__<
+ A extends PipelineSource<any>,
+ T1 extends PipelineTransform<A, any>,
+ T2 extends PipelineTransform<T1, any>,
+ T3 extends PipelineTransform<T2, any>,
+ B extends PipelineDestination<T3, any>,
+ >(
+ source: A,
+ transform1: T1,
+ transform2: T2,
+ transform3: T3,
+ destination: B,
+ options?: PipelineOptions,
+ ): PipelinePromise<B>;
+ function __promisify__<
+ A extends PipelineSource<any>,
+ T1 extends PipelineTransform<A, any>,
+ T2 extends PipelineTransform<T1, any>,
+ T3 extends PipelineTransform<T2, any>,
+ T4 extends PipelineTransform<T3, any>,
+ B extends PipelineDestination<T4, any>,
+ >(
+ source: A,
+ transform1: T1,
+ transform2: T2,
+ transform3: T3,
+ transform4: T4,
+ destination: B,
+ options?: PipelineOptions,
+ ): PipelinePromise<B>;
+ function __promisify__(
+ streams: ReadonlyArray<NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream>,
+ options?: PipelineOptions,
+ ): Promise<void>;
+ function __promisify__(
+ stream1: NodeJS.ReadableStream,
+ stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream,
+ ...streams: Array<NodeJS.ReadWriteStream | NodeJS.WritableStream | PipelineOptions>
+ ): Promise<void>;
+ }
+ interface Pipe {
+ close(): void;
+ hasRef(): boolean;
+ ref(): void;
+ unref(): void;
+ }
+
+ /**
+ * Returns whether the stream has encountered an error.
+ * @since v17.3.0
+ */
+ function isErrored(stream: Readable | Writable | NodeJS.ReadableStream | NodeJS.WritableStream): boolean;
+
+ /**
+ * Returns whether the stream is readable.
+ * @since v17.4.0
+ */
+ function isReadable(stream: Readable | NodeJS.ReadableStream): boolean;
+
+ const promises: typeof streamPromises;
+ const consumers: typeof streamConsumers;
+ }
+ export = internal;
+}
+declare module "node:stream" {
+ import stream = require("stream");
+ export = stream;
+}
diff --git a/client/node_modules/@types/node/stream/consumers.d.ts b/client/node_modules/@types/node/stream/consumers.d.ts
new file mode 100644
index 0000000..5ad9cba
--- /dev/null
+++ b/client/node_modules/@types/node/stream/consumers.d.ts
@@ -0,0 +1,12 @@
+declare module "stream/consumers" {
+ import { Blob as NodeBlob } from "node:buffer";
+ import { Readable } from "node:stream";
+ function buffer(stream: NodeJS.ReadableStream | Readable | AsyncIterable<any>): Promise<Buffer>;
+ function text(stream: NodeJS.ReadableStream | Readable | AsyncIterable<any>): Promise<string>;
+ function arrayBuffer(stream: NodeJS.ReadableStream | Readable | AsyncIterable<any>): Promise<ArrayBuffer>;
+ function blob(stream: NodeJS.ReadableStream | Readable | AsyncIterable<any>): Promise<NodeBlob>;
+ function json(stream: NodeJS.ReadableStream | Readable | AsyncIterable<any>): Promise<unknown>;
+}
+declare module "node:stream/consumers" {
+ export * from "stream/consumers";
+}
diff --git a/client/node_modules/@types/node/stream/promises.d.ts b/client/node_modules/@types/node/stream/promises.d.ts
new file mode 100644
index 0000000..6eac5b7
--- /dev/null
+++ b/client/node_modules/@types/node/stream/promises.d.ts
@@ -0,0 +1,83 @@
+declare module "stream/promises" {
+ import {
+ FinishedOptions,
+ PipelineDestination,
+ PipelineOptions,
+ PipelinePromise,
+ PipelineSource,
+ PipelineTransform,
+ } from "node:stream";
+ function finished(
+ stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream,
+ options?: FinishedOptions,
+ ): Promise<void>;
+ function pipeline<A extends PipelineSource<any>, B extends PipelineDestination<A, any>>(
+ source: A,
+ destination: B,
+ options?: PipelineOptions,
+ ): PipelinePromise<B>;
+ function pipeline<
+ A extends PipelineSource<any>,
+ T1 extends PipelineTransform<A, any>,
+ B extends PipelineDestination<T1, any>,
+ >(
+ source: A,
+ transform1: T1,
+ destination: B,
+ options?: PipelineOptions,
+ ): PipelinePromise<B>;
+ function pipeline<
+ A extends PipelineSource<any>,
+ T1 extends PipelineTransform<A, any>,
+ T2 extends PipelineTransform<T1, any>,
+ B extends PipelineDestination<T2, any>,
+ >(
+ source: A,
+ transform1: T1,
+ transform2: T2,
+ destination: B,
+ options?: PipelineOptions,
+ ): PipelinePromise<B>;
+ function pipeline<
+ A extends PipelineSource<any>,
+ T1 extends PipelineTransform<A, any>,
+ T2 extends PipelineTransform<T1, any>,
+ T3 extends PipelineTransform<T2, any>,
+ B extends PipelineDestination<T3, any>,
+ >(
+ source: A,
+ transform1: T1,
+ transform2: T2,
+ transform3: T3,
+ destination: B,
+ options?: PipelineOptions,
+ ): PipelinePromise<B>;
+ function pipeline<
+ A extends PipelineSource<any>,
+ T1 extends PipelineTransform<A, any>,
+ T2 extends PipelineTransform<T1, any>,
+ T3 extends PipelineTransform<T2, any>,
+ T4 extends PipelineTransform<T3, any>,
+ B extends PipelineDestination<T4, any>,
+ >(
+ source: A,
+ transform1: T1,
+ transform2: T2,
+ transform3: T3,
+ transform4: T4,
+ destination: B,
+ options?: PipelineOptions,
+ ): PipelinePromise<B>;
+ function pipeline(
+ streams: ReadonlyArray<NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream>,
+ options?: PipelineOptions,
+ ): Promise<void>;
+ function pipeline(
+ stream1: NodeJS.ReadableStream,
+ stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream,
+ ...streams: Array<NodeJS.ReadWriteStream | NodeJS.WritableStream | PipelineOptions>
+ ): Promise<void>;
+}
+declare module "node:stream/promises" {
+ export * from "stream/promises";
+}
diff --git a/client/node_modules/@types/node/stream/web.d.ts b/client/node_modules/@types/node/stream/web.d.ts
new file mode 100644
index 0000000..634936e
--- /dev/null
+++ b/client/node_modules/@types/node/stream/web.d.ts
@@ -0,0 +1,336 @@
+declare module "stream/web" {
+ // stub module, pending copy&paste from .d.ts or manual impl
+ // copy from lib.dom.d.ts
+ interface ReadableWritablePair<R = any, W = any> {
+ readable: ReadableStream<R>;
+ /**
+ * Provides a convenient, chainable way of piping this readable stream
+ * through a transform stream (or any other { writable, readable }
+ * pair). It simply pipes the stream into the writable side of the
+ * supplied pair, and returns the readable side for further use.
+ *
+ * Piping a stream will lock it for the duration of the pipe, preventing
+ * any other consumer from acquiring a reader.
+ */
+ writable: WritableStream<W>;
+ }
+ interface StreamPipeOptions {
+ preventAbort?: boolean;
+ preventCancel?: boolean;
+ /**
+ * Pipes this readable stream to a given writable stream destination.
+ * The way in which the piping process behaves under various error
+ * conditions can be customized with a number of passed options. It
+ * returns a promise that fulfills when the piping process completes
+ * successfully, or rejects if any errors were encountered.
+ *
+ * Piping a stream will lock it for the duration of the pipe, preventing
+ * any other consumer from acquiring a reader.
+ *
+ * Errors and closures of the source and destination streams propagate
+ * as follows:
+ *
+ * An error in this source readable stream will abort destination,
+ * unless preventAbort is truthy. The returned promise will be rejected
+ * with the source's error, or with any error that occurs during
+ * aborting the destination.
+ *
+ * An error in destination will cancel this source readable stream,
+ * unless preventCancel is truthy. The returned promise will be rejected
+ * with the destination's error, or with any error that occurs during
+ * canceling the source.
+ *
+ * When this source readable stream closes, destination will be closed,
+ * unless preventClose is truthy. The returned promise will be fulfilled
+ * once this process completes, unless an error is encountered while
+ * closing the destination, in which case it will be rejected with that
+ * error.
+ *
+ * If destination starts out closed or closing, this source readable
+ * stream will be canceled, unless preventCancel is true. The returned
+ * promise will be rejected with an error indicating piping to a closed
+ * stream failed, or with any error that occurs during canceling the
+ * source.
+ *
+ * The signal option can be set to an AbortSignal to allow aborting an
+ * ongoing pipe operation via the corresponding AbortController. In this
+ * case, this source readable stream will be canceled, and destination
+ * aborted, unless the respective options preventCancel or preventAbort
+ * are set.
+ */
+ preventClose?: boolean;
+ signal?: AbortSignal;
+ }
+ interface ReadableStreamGenericReader {
+ readonly closed: Promise<undefined>;
+ cancel(reason?: any): Promise<void>;
+ }
+ interface ReadableStreamDefaultReadValueResult<T> {
+ done: false;
+ value: T;
+ }
+ interface ReadableStreamDefaultReadDoneResult {
+ done: true;
+ value?: undefined;
+ }
+ type ReadableStreamController<T> = ReadableStreamDefaultController<T>;
+ type ReadableStreamDefaultReadResult<T> =
+ | ReadableStreamDefaultReadValueResult<T>
+ | ReadableStreamDefaultReadDoneResult;
+ interface ReadableByteStreamControllerCallback {
+ (controller: ReadableByteStreamController): void | PromiseLike<void>;
+ }
+ interface UnderlyingSinkAbortCallback {
+ (reason?: any): void | PromiseLike<void>;
+ }
+ interface UnderlyingSinkCloseCallback {
+ (): void | PromiseLike<void>;
+ }
+ interface UnderlyingSinkStartCallback {
+ (controller: WritableStreamDefaultController): any;
+ }
+ interface UnderlyingSinkWriteCallback<W> {
+ (chunk: W, controller: WritableStreamDefaultController): void | PromiseLike<void>;
+ }
+ interface UnderlyingSourceCancelCallback {
+ (reason?: any): void | PromiseLike<void>;
+ }
+ interface UnderlyingSourcePullCallback<R> {
+ (controller: ReadableStreamController<R>): void | PromiseLike<void>;
+ }
+ interface UnderlyingSourceStartCallback<R> {
+ (controller: ReadableStreamController<R>): any;
+ }
+ interface TransformerFlushCallback<O> {
+ (controller: TransformStreamDefaultController<O>): void | PromiseLike<void>;
+ }
+ interface TransformerStartCallback<O> {
+ (controller: TransformStreamDefaultController<O>): any;
+ }
+ interface TransformerTransformCallback<I, O> {
+ (chunk: I, controller: TransformStreamDefaultController<O>): void | PromiseLike<void>;
+ }
+ interface UnderlyingByteSource {
+ autoAllocateChunkSize?: number;
+ cancel?: ReadableStreamErrorCallback;
+ pull?: ReadableByteStreamControllerCallback;
+ start?: ReadableByteStreamControllerCallback;
+ type: "bytes";
+ }
+ interface UnderlyingSource<R = any> {
+ cancel?: UnderlyingSourceCancelCallback;
+ pull?: UnderlyingSourcePullCallback<R>;
+ start?: UnderlyingSourceStartCallback<R>;
+ type?: undefined;
+ }
+ interface UnderlyingSink<W = any> {
+ abort?: UnderlyingSinkAbortCallback;
+ close?: UnderlyingSinkCloseCallback;
+ start?: UnderlyingSinkStartCallback;
+ type?: undefined;
+ write?: UnderlyingSinkWriteCallback<W>;
+ }
+ interface ReadableStreamErrorCallback {
+ (reason: any): void | PromiseLike<void>;
+ }
+ /** This Streams API interface represents a readable stream of byte data. */
+ interface ReadableStream<R = any> {
+ readonly locked: boolean;
+ cancel(reason?: any): Promise<void>;
+ getReader(): ReadableStreamDefaultReader<R>;
+ pipeThrough<T>(transform: ReadableWritablePair<T, R>, options?: StreamPipeOptions): ReadableStream<T>;
+ pipeTo(destination: WritableStream<R>, options?: StreamPipeOptions): Promise<void>;
+ tee(): [ReadableStream<R>, ReadableStream<R>];
+ values(options?: { preventCancel?: boolean }): AsyncIterableIterator<R>;
+ [Symbol.asyncIterator](): AsyncIterableIterator<R>;
+ }
+ const ReadableStream: {
+ prototype: ReadableStream;
+ new(underlyingSource: UnderlyingByteSource, strategy?: QueuingStrategy<Uint8Array>): ReadableStream<Uint8Array>;
+ new<R = any>(underlyingSource?: UnderlyingSource<R>, strategy?: QueuingStrategy<R>): ReadableStream<R>;
+ };
+ interface ReadableStreamDefaultReader<R = any> extends ReadableStreamGenericReader {
+ read(): Promise<ReadableStreamDefaultReadResult<R>>;
+ releaseLock(): void;
+ }
+ const ReadableStreamDefaultReader: {
+ prototype: ReadableStreamDefaultReader;
+ new<R = any>(stream: ReadableStream<R>): ReadableStreamDefaultReader<R>;
+ };
+ const ReadableStreamBYOBReader: any;
+ const ReadableStreamBYOBRequest: any;
+ interface ReadableByteStreamController {
+ readonly byobRequest: undefined;
+ readonly desiredSize: number | null;
+ close(): void;
+ enqueue(chunk: ArrayBufferView): void;
+ error(error?: any): void;
+ }
+ const ReadableByteStreamController: {
+ prototype: ReadableByteStreamController;
+ new(): ReadableByteStreamController;
+ };
+ interface ReadableStreamDefaultController<R = any> {
+ readonly desiredSize: number | null;
+ close(): void;
+ enqueue(chunk?: R): void;
+ error(e?: any): void;
+ }
+ const ReadableStreamDefaultController: {
+ prototype: ReadableStreamDefaultController;
+ new(): ReadableStreamDefaultController;
+ };
+ interface Transformer<I = any, O = any> {
+ flush?: TransformerFlushCallback<O>;
+ readableType?: undefined;
+ start?: TransformerStartCallback<O>;
+ transform?: TransformerTransformCallback<I, O>;
+ writableType?: undefined;
+ }
+ interface TransformStream<I = any, O = any> {
+ readonly readable: ReadableStream<O>;
+ readonly writable: WritableStream<I>;
+ }
+ const TransformStream: {
+ prototype: TransformStream;
+ new<I = any, O = any>(
+ transformer?: Transformer<I, O>,
+ writableStrategy?: QueuingStrategy<I>,
+ readableStrategy?: QueuingStrategy<O>,
+ ): TransformStream<I, O>;
+ };
+ interface TransformStreamDefaultController<O = any> {
+ readonly desiredSize: number | null;
+ enqueue(chunk?: O): void;
+ error(reason?: any): void;
+ terminate(): void;
+ }
+ const TransformStreamDefaultController: {
+ prototype: TransformStreamDefaultController;
+ new(): TransformStreamDefaultController;
+ };
+ /**
+ * This Streams API interface provides a standard abstraction for writing
+ * streaming data to a destination, known as a sink. This object comes with
+ * built-in back pressure and queuing.
+ */
+ interface WritableStream<W = any> {
+ readonly locked: boolean;
+ abort(reason?: any): Promise<void>;
+ close(): Promise<void>;
+ getWriter(): WritableStreamDefaultWriter<W>;
+ }
+ const WritableStream: {
+ prototype: WritableStream;
+ new<W = any>(underlyingSink?: UnderlyingSink<W>, strategy?: QueuingStrategy<W>): WritableStream<W>;
+ };
+ /**
+ * This Streams API interface is the object returned by
+ * WritableStream.getWriter() and once created locks the < writer to the
+ * WritableStream ensuring that no other streams can write to the underlying
+ * sink.
+ */
+ interface WritableStreamDefaultWriter<W = any> {
+ readonly closed: Promise<undefined>;
+ readonly desiredSize: number | null;
+ readonly ready: Promise<undefined>;
+ abort(reason?: any): Promise<void>;
+ close(): Promise<void>;
+ releaseLock(): void;
+ write(chunk?: W): Promise<void>;
+ }
+ const WritableStreamDefaultWriter: {
+ prototype: WritableStreamDefaultWriter;
+ new<W = any>(stream: WritableStream<W>): WritableStreamDefaultWriter<W>;
+ };
+ /**
+ * This Streams API interface represents a controller allowing control of a
+ * WritableStream's state. When constructing a WritableStream, the
+ * underlying sink is given a corresponding WritableStreamDefaultController
+ * instance to manipulate.
+ */
+ interface WritableStreamDefaultController {
+ error(e?: any): void;
+ }
+ const WritableStreamDefaultController: {
+ prototype: WritableStreamDefaultController;
+ new(): WritableStreamDefaultController;
+ };
+ interface QueuingStrategy<T = any> {
+ highWaterMark?: number;
+ size?: QueuingStrategySize<T>;
+ }
+ interface QueuingStrategySize<T = any> {
+ (chunk?: T): number;
+ }
+ interface QueuingStrategyInit {
+ /**
+ * Creates a new ByteLengthQueuingStrategy with the provided high water
+ * mark.
+ *
+ * Note that the provided high water mark will not be validated ahead of
+ * time. Instead, if it is negative, NaN, or not a number, the resulting
+ * ByteLengthQueuingStrategy will cause the corresponding stream
+ * constructor to throw.
+ */
+ highWaterMark: number;
+ }
+ /**
+ * This Streams API interface provides a built-in byte length queuing
+ * strategy that can be used when constructing streams.
+ */
+ interface ByteLengthQueuingStrategy extends QueuingStrategy<ArrayBufferView> {
+ readonly highWaterMark: number;
+ readonly size: QueuingStrategySize<ArrayBufferView>;
+ }
+ const ByteLengthQueuingStrategy: {
+ prototype: ByteLengthQueuingStrategy;
+ new(init: QueuingStrategyInit): ByteLengthQueuingStrategy;
+ };
+ /**
+ * This Streams API interface provides a built-in byte length queuing
+ * strategy that can be used when constructing streams.
+ */
+ interface CountQueuingStrategy extends QueuingStrategy {
+ readonly highWaterMark: number;
+ readonly size: QueuingStrategySize;
+ }
+ const CountQueuingStrategy: {
+ prototype: CountQueuingStrategy;
+ new(init: QueuingStrategyInit): CountQueuingStrategy;
+ };
+ interface TextEncoderStream {
+ /** Returns "utf-8". */
+ readonly encoding: "utf-8";
+ readonly readable: ReadableStream<Uint8Array>;
+ readonly writable: WritableStream<string>;
+ readonly [Symbol.toStringTag]: string;
+ }
+ const TextEncoderStream: {
+ prototype: TextEncoderStream;
+ new(): TextEncoderStream;
+ };
+ interface TextDecoderOptions {
+ fatal?: boolean;
+ ignoreBOM?: boolean;
+ }
+ type BufferSource = ArrayBufferView | ArrayBuffer;
+ interface TextDecoderStream {
+ /** Returns encoding's name, lower cased. */
+ readonly encoding: string;
+ /** Returns `true` if error mode is "fatal", and `false` otherwise. */
+ readonly fatal: boolean;
+ /** Returns `true` if ignore BOM flag is set, and `false` otherwise. */
+ readonly ignoreBOM: boolean;
+ readonly readable: ReadableStream<string>;
+ readonly writable: WritableStream<BufferSource>;
+ readonly [Symbol.toStringTag]: string;
+ }
+ const TextDecoderStream: {
+ prototype: TextDecoderStream;
+ new(label?: string, options?: TextDecoderOptions): TextDecoderStream;
+ };
+}
+declare module "node:stream/web" {
+ export * from "stream/web";
+}
diff --git a/client/node_modules/@types/node/string_decoder.d.ts b/client/node_modules/@types/node/string_decoder.d.ts
new file mode 100644
index 0000000..e9a8cc2
--- /dev/null
+++ b/client/node_modules/@types/node/string_decoder.d.ts
@@ -0,0 +1,67 @@
+/**
+ * The `string_decoder` module provides an API for decoding `Buffer` objects into
+ * strings in a manner that preserves encoded multi-byte UTF-8 and UTF-16
+ * characters. It can be accessed using:
+ *
+ * ```js
+ * const { StringDecoder } = require('string_decoder');
+ * ```
+ *
+ * The following example shows the basic use of the `StringDecoder` class.
+ *
+ * ```js
+ * const { StringDecoder } = require('string_decoder');
+ * const decoder = new StringDecoder('utf8');
+ *
+ * const cent = Buffer.from([0xC2, 0xA2]);
+ * console.log(decoder.write(cent));
+ *
+ * const euro = Buffer.from([0xE2, 0x82, 0xAC]);
+ * console.log(decoder.write(euro));
+ * ```
+ *
+ * When a `Buffer` instance is written to the `StringDecoder` instance, an
+ * internal buffer is used to ensure that the decoded string does not contain
+ * any incomplete multibyte characters. These are held in the buffer until the
+ * next call to `stringDecoder.write()` or until `stringDecoder.end()` is called.
+ *
+ * In the following example, the three UTF-8 encoded bytes of the European Euro
+ * symbol (`€`) are written over three separate operations:
+ *
+ * ```js
+ * const { StringDecoder } = require('string_decoder');
+ * const decoder = new StringDecoder('utf8');
+ *
+ * decoder.write(Buffer.from([0xE2]));
+ * decoder.write(Buffer.from([0x82]));
+ * console.log(decoder.end(Buffer.from([0xAC])));
+ * ```
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/string_decoder.js)
+ */
+declare module "string_decoder" {
+ class StringDecoder {
+ constructor(encoding?: BufferEncoding);
+ /**
+ * Returns a decoded string, ensuring that any incomplete multibyte characters at
+ * the end of the `Buffer`, or `TypedArray`, or `DataView` are omitted from the
+ * returned string and stored in an internal buffer for the next call to`stringDecoder.write()` or `stringDecoder.end()`.
+ * @since v0.1.99
+ * @param buffer A `Buffer`, or `TypedArray`, or `DataView` containing the bytes to decode.
+ */
+ write(buffer: Buffer): string;
+ /**
+ * Returns any remaining input stored in the internal buffer as a string. Bytes
+ * representing incomplete UTF-8 and UTF-16 characters will be replaced with
+ * substitution characters appropriate for the character encoding.
+ *
+ * If the `buffer` argument is provided, one final call to `stringDecoder.write()`is performed before returning the remaining input.
+ * After `end()` is called, the `stringDecoder` object can be reused for new input.
+ * @since v0.9.3
+ * @param buffer A `Buffer`, or `TypedArray`, or `DataView` containing the bytes to decode.
+ */
+ end(buffer?: Buffer): string;
+ }
+}
+declare module "node:string_decoder" {
+ export * from "string_decoder";
+}
diff --git a/client/node_modules/@types/node/test.d.ts b/client/node_modules/@types/node/test.d.ts
new file mode 100644
index 0000000..99b9cce
--- /dev/null
+++ b/client/node_modules/@types/node/test.d.ts
@@ -0,0 +1,974 @@
+/**
+ * The `node:test` module provides a standalone testing module.
+ * @see [source](https://github.com/nodejs/node/blob/v18.x/lib/test.js)
+ */
+declare module "node:test" {
+ import { AsyncResource } from "node:async_hooks";
+ /**
+ * Programmatically start the test runner.
+ * @since v18.9.0
+ * @param options Configuration options for running tests.
+ * @returns A {@link TestsStream} that emits events about the test execution.
+ */
+ function run(options?: RunOptions): TestsStream;
+ /**
+ * The `test()` function is the value imported from the test module. Each invocation of this
+ * function results in reporting the test to the {@link TestsStream}.
+ *
+ * The {@link TestContext} object passed to the fn argument can be used to perform actions
+ * related to the current test. Examples include skipping the test, adding additional
+ * diagnostic information, or creating subtests.
+ *
+ * `test()` returns a {@link Promise} that resolves once the test completes. The return value
+ * can usually be discarded for top level tests. However, the return value from subtests should
+ * be used to prevent the parent test from finishing first and cancelling the subtest as shown
+ * in the following example.
+ *
+ * ```js
+ * test('top level test', async (t) => {
+ * // The setTimeout() in the following subtest would cause it to outlive its
+ * // parent test if 'await' is removed on the next line. Once the parent test
+ * // completes, it will cancel any outstanding subtests.
+ * await t.test('longer running subtest', async (t) => {
+ * return new Promise((resolve, reject) => {
+ * setTimeout(resolve, 1000);
+ * });
+ * });
+ * });
+ * ```
+ * @since v18.0.0
+ * @param name The name of the test, which is displayed when reporting test results.
+ * Default: The `name` property of fn, or `'<anonymous>'` if `fn` does not have a name.
+ * @param options Configuration options for the test
+ * @param fn The function under test. The first argument to this function is a
+ * {@link TestContext} object. If the test uses callbacks, the callback function is
+ * passed as the second argument. Default: A no-op function.
+ * @returns A {@link Promise} resolved with `undefined` once the test completes.
+ */
+ function test(name?: string, fn?: TestFn): Promise<void>;
+ function test(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
+ function test(options?: TestOptions, fn?: TestFn): Promise<void>;
+ function test(fn?: TestFn): Promise<void>;
+ namespace test {
+ export { after, afterEach, before, beforeEach, describe, it, mock, only, run, skip, test, todo };
+ }
+ /**
+ * @since v18.6.0
+ * @param name The name of the suite, which is displayed when reporting suite results.
+ * Default: The `name` property of fn, or `'<anonymous>'` if `fn` does not have a name.
+ * @param options Configuration options for the suite
+ * @param fn The function under suite. Default: A no-op function.
+ */
+ function describe(name?: string, options?: TestOptions, fn?: SuiteFn): Promise<void>;
+ function describe(name?: string, fn?: SuiteFn): Promise<void>;
+ function describe(options?: TestOptions, fn?: SuiteFn): Promise<void>;
+ function describe(fn?: SuiteFn): Promise<void>;
+ namespace describe {
+ /**
+ * Shorthand for skipping a suite, same as `describe([name], { skip: true }[, fn])`.
+ */
+ function skip(name?: string, options?: TestOptions, fn?: SuiteFn): Promise<void>;
+ function skip(name?: string, fn?: SuiteFn): Promise<void>;
+ function skip(options?: TestOptions, fn?: SuiteFn): Promise<void>;
+ function skip(fn?: SuiteFn): Promise<void>;
+ /**
+ * Shorthand for marking a suite as `TODO`, same as `describe([name], { todo: true }[, fn])`.
+ */
+ function todo(name?: string, options?: TestOptions, fn?: SuiteFn): Promise<void>;
+ function todo(name?: string, fn?: SuiteFn): Promise<void>;
+ function todo(options?: TestOptions, fn?: SuiteFn): Promise<void>;
+ function todo(fn?: SuiteFn): Promise<void>;
+ /**
+ * Shorthand for marking a suite as `only`, same as `describe([name], { only: true }[, fn])`.
+ * @since v18.15.0
+ */
+ function only(name?: string, options?: TestOptions, fn?: SuiteFn): Promise<void>;
+ function only(name?: string, fn?: SuiteFn): Promise<void>;
+ function only(options?: TestOptions, fn?: SuiteFn): Promise<void>;
+ function only(fn?: SuiteFn): Promise<void>;
+ }
+
+ /**
+ * @since v18.6.0
+ * @param name The name of the test, which is displayed when reporting test results.
+ * Default: The `name` property of fn, or `'<anonymous>'` if `fn` does not have a name.
+ * @param options Configuration options for the test
+ * @param fn The function under test. If the test uses callbacks, the callback function is
+ * passed as the second argument. Default: A no-op function.
+ */
+ function it(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
+ function it(name?: string, fn?: TestFn): Promise<void>;
+ function it(options?: TestOptions, fn?: TestFn): Promise<void>;
+ function it(fn?: TestFn): Promise<void>;
+ namespace it {
+ /**
+ * Shorthand for skipping a test, same as `it([name], { skip: true }[, fn])`.
+ */
+ function skip(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
+ function skip(name?: string, fn?: TestFn): Promise<void>;
+ function skip(options?: TestOptions, fn?: TestFn): Promise<void>;
+ function skip(fn?: TestFn): Promise<void>;
+ /**
+ * Shorthand for marking a test as `TODO`, same as `it([name], { todo: true }[, fn])`.
+ */
+ function todo(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
+ function todo(name?: string, fn?: TestFn): Promise<void>;
+ function todo(options?: TestOptions, fn?: TestFn): Promise<void>;
+ function todo(fn?: TestFn): Promise<void>;
+ /**
+ * Shorthand for marking a test as `only`, same as `it([name], { only: true }[, fn])`.
+ * @since v18.15.0
+ */
+ function only(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
+ function only(name?: string, fn?: TestFn): Promise<void>;
+ function only(options?: TestOptions, fn?: TestFn): Promise<void>;
+ function only(fn?: TestFn): Promise<void>;
+ }
+ /**
+ * Shorthand for skipping a test, same as `test([name], { skip: true }[, fn])`.
+ * @since v18.17.0
+ */
+ function skip(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
+ function skip(name?: string, fn?: TestFn): Promise<void>;
+ function skip(options?: TestOptions, fn?: TestFn): Promise<void>;
+ function skip(fn?: TestFn): Promise<void>;
+ /**
+ * Shorthand for marking a test as `TODO`, same as `test([name], { todo: true }[, fn])`.
+ * @since v18.17.0
+ */
+ function todo(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
+ function todo(name?: string, fn?: TestFn): Promise<void>;
+ function todo(options?: TestOptions, fn?: TestFn): Promise<void>;
+ function todo(fn?: TestFn): Promise<void>;
+ /**
+ * Shorthand for marking a test as `only`, same as `test([name], { only: true }[, fn])`.
+ * @since v18.17.0
+ */
+ function only(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
+ function only(name?: string, fn?: TestFn): Promise<void>;
+ function only(options?: TestOptions, fn?: TestFn): Promise<void>;
+ function only(fn?: TestFn): Promise<void>;
+
+ /**
+ * The type of a function under test. The first argument to this function is a
+ * {@link TestContext} object. If the test uses callbacks, the callback function is passed as
+ * the second argument.
+ */
+ type TestFn = (t: TestContext, done: (result?: any) => void) => any;
+
+ /**
+ * The type of a function under Suite.
+ */
+ type SuiteFn = (s: SuiteContext) => void | Promise<void>;
+
+ interface RunOptions {
+ /**
+ * If a number is provided, then that many files would run in parallel.
+ * If truthy, it would run (number of cpu cores - 1) files in parallel.
+ * If falsy, it would only run one file at a time.
+ * If unspecified, subtests inherit this value from their parent.
+ * @default true
+ */
+ concurrency?: number | boolean | undefined;
+
+ /**
+ * An array containing the list of files to run.
+ * If unspecified, the test runner execution model will be used.
+ */
+ files?: readonly string[] | undefined;
+
+ /**
+ * Allows aborting an in-progress test execution.
+ * @default undefined
+ */
+ signal?: AbortSignal | undefined;
+
+ /**
+ * A number of milliseconds the test will fail after.
+ * If unspecified, subtests inherit this value from their parent.
+ * @default Infinity
+ */
+ timeout?: number | undefined;
+
+ /**
+ * Sets inspector port of test child process.
+ * If a nullish value is provided, each process gets its own port,
+ * incremented from the primary's `process.debugPort`.
+ */
+ inspectPort?: number | (() => number) | undefined;
+ /**
+ * That can be used to only run tests whose name matches the provided pattern.
+ * Test name patterns are interpreted as JavaScript regular expressions.
+ * For each test that is executed, any corresponding test hooks, such as `beforeEach()`, are also run.
+ */
+ testNamePatterns?: string | RegExp | string[] | RegExp[];
+ /**
+ * A function that accepts the TestsStream instance and can be used to setup listeners before any tests are run.
+ */
+ setup?: (root: Test) => void | Promise<void>;
+ /**
+ * Whether to run in watch mode or not.
+ * @default false
+ */
+ watch?: boolean | undefined;
+ }
+ class Test extends AsyncResource {
+ concurrency: number;
+ nesting: number;
+ only: boolean;
+ reporter: TestsStream;
+ runOnlySubtests: boolean;
+ testNumber: number;
+ timeout: number | null;
+ }
+
+ /**
+ * A successful call of the `run()` method will return a new `TestsStream` object,
+ * streaming a series of events representing the execution of the tests.
+ * `TestsStream` will emit events in the order of the tests' definitions.
+ * @since v18.9.0
+ */
+ interface TestsStream extends NodeJS.ReadableStream {
+ addListener(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this;
+ addListener(event: "test:fail", listener: (data: TestFail) => void): this;
+ addListener(event: "test:pass", listener: (data: TestPass) => void): this;
+ addListener(event: "test:plan", listener: (data: TestPlan) => void): this;
+ addListener(event: "test:start", listener: (data: TestStart) => void): this;
+ addListener(event: "test:stderr", listener: (data: TestStderr) => void): this;
+ addListener(event: "test:stdout", listener: (data: TestStdout) => void): this;
+ addListener(event: string, listener: (...args: any[]) => void): this;
+ emit(event: "test:diagnostic", data: DiagnosticData): boolean;
+ emit(event: "test:fail", data: TestFail): boolean;
+ emit(event: "test:pass", data: TestPass): boolean;
+ emit(event: "test:plan", data: TestPlan): boolean;
+ emit(event: "test:start", data: TestStart): boolean;
+ emit(event: "test:stderr", data: TestStderr): boolean;
+ emit(event: "test:stdout", data: TestStdout): boolean;
+ emit(event: string | symbol, ...args: any[]): boolean;
+ on(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this;
+ on(event: "test:fail", listener: (data: TestFail) => void): this;
+ on(event: "test:pass", listener: (data: TestPass) => void): this;
+ on(event: "test:plan", listener: (data: TestPlan) => void): this;
+ on(event: "test:start", listener: (data: TestStart) => void): this;
+ on(event: "test:stderr", listener: (data: TestStderr) => void): this;
+ on(event: "test:stdout", listener: (data: TestStdout) => void): this;
+ on(event: string, listener: (...args: any[]) => void): this;
+ once(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this;
+ once(event: "test:fail", listener: (data: TestFail) => void): this;
+ once(event: "test:pass", listener: (data: TestPass) => void): this;
+ once(event: "test:plan", listener: (data: TestPlan) => void): this;
+ once(event: "test:start", listener: (data: TestStart) => void): this;
+ once(event: "test:stderr", listener: (data: TestStderr) => void): this;
+ once(event: "test:stdout", listener: (data: TestStdout) => void): this;
+ once(event: string, listener: (...args: any[]) => void): this;
+ prependListener(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this;
+ prependListener(event: "test:fail", listener: (data: TestFail) => void): this;
+ prependListener(event: "test:pass", listener: (data: TestPass) => void): this;
+ prependListener(event: "test:plan", listener: (data: TestPlan) => void): this;
+ prependListener(event: "test:start", listener: (data: TestStart) => void): this;
+ prependListener(event: "test:stderr", listener: (data: TestStderr) => void): this;
+ prependListener(event: "test:stdout", listener: (data: TestStdout) => void): this;
+ prependListener(event: string, listener: (...args: any[]) => void): this;
+ prependOnceListener(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this;
+ prependOnceListener(event: "test:fail", listener: (data: TestFail) => void): this;
+ prependOnceListener(event: "test:pass", listener: (data: TestPass) => void): this;
+ prependOnceListener(event: "test:plan", listener: (data: TestPlan) => void): this;
+ prependOnceListener(event: "test:start", listener: (data: TestStart) => void): this;
+ prependOnceListener(event: "test:stderr", listener: (data: TestStderr) => void): this;
+ prependOnceListener(event: "test:stdout", listener: (data: TestStdout) => void): this;
+ prependOnceListener(event: string, listener: (...args: any[]) => void): this;
+ }
+
+ /**
+ * An instance of `TestContext` is passed to each test function in order to interact with the
+ * test runner. However, the `TestContext` constructor is not exposed as part of the API.
+ * @since v18.0.0
+ */
+ interface TestContext {
+ /**
+ * This function is used to create a hook running before subtest of the current test.
+ * @param fn The hook function. If the hook uses callbacks, the callback function is passed as
+ * the second argument. Default: A no-op function.
+ * @param options Configuration options for the hook.
+ * @since v18.17.0
+ */
+ before: typeof before;
+
+ /**
+ * This function is used to create a hook running before each subtest of the current test.
+ * @param fn The hook function. If the hook uses callbacks, the callback function is passed as
+ * the second argument. Default: A no-op function.
+ * @param options Configuration options for the hook.
+ * @since v18.8.0
+ */
+ beforeEach: typeof beforeEach;
+
+ /**
+ * This function is used to create a hook that runs after the current test finishes.
+ * @param fn The hook function. If the hook uses callbacks, the callback function is passed as
+ * the second argument. Default: A no-op function.
+ * @param options Configuration options for the hook.
+ * @since v18.13.0
+ */
+ after: typeof after;
+
+ /**
+ * This function is used to create a hook running after each subtest of the current test.
+ * @param fn The hook function. If the hook uses callbacks, the callback function is passed as
+ * the second argument. Default: A no-op function.
+ * @param options Configuration options for the hook.
+ * @since v18.8.0
+ */
+ afterEach: typeof afterEach;
+
+ /**
+ * This function is used to write diagnostics to the output. Any diagnostic information is
+ * included at the end of the test's results. This function does not return a value.
+ * @param message Message to be reported.
+ * @since v18.0.0
+ */
+ diagnostic(message: string): void;
+
+ /**
+ * The name of the test.
+ * @since v18.8.0
+ */
+ readonly name: string;
+
+ /**
+ * If `shouldRunOnlyTests` is truthy, the test context will only run tests that have the `only`
+ * option set. Otherwise, all tests are run. If Node.js was not started with the `--test-only`
+ * command-line option, this function is a no-op.
+ * @param shouldRunOnlyTests Whether or not to run `only` tests.
+ * @since v18.0.0
+ */
+ runOnly(shouldRunOnlyTests: boolean): void;
+
+ /**
+ * Can be used to abort test subtasks when the test has been aborted.
+ * @since v18.7.0
+ */
+ readonly signal: AbortSignal;
+
+ /**
+ * This function causes the test's output to indicate the test as skipped. If `message` is
+ * provided, it is included in the output. Calling `skip()` does not terminate execution of
+ * the test function. This function does not return a value.
+ * @param message Optional skip message.
+ * @since v18.0.0
+ */
+ skip(message?: string): void;
+
+ /**
+ * This function adds a `TODO` directive to the test's output. If `message` is provided, it is
+ * included in the output. Calling `todo()` does not terminate execution of the test
+ * function. This function does not return a value.
+ * @param message Optional `TODO` message.
+ * @since v18.0.0
+ */
+ todo(message?: string): void;
+
+ /**
+ * This function is used to create subtests under the current test. This function behaves in
+ * the same fashion as the top level {@link test} function.
+ * @since v18.0.0
+ * @param name The name of the test, which is displayed when reporting test results.
+ * Default: The `name` property of fn, or `'<anonymous>'` if `fn` does not have a name.
+ * @param options Configuration options for the test
+ * @param fn The function under test. This first argument to this function is a
+ * {@link TestContext} object. If the test uses callbacks, the callback function is
+ * passed as the second argument. Default: A no-op function.
+ * @returns A {@link Promise} resolved with `undefined` once the test completes.
+ */
+ test: typeof test;
+ /**
+ * Each test provides its own MockTracker instance.
+ */
+ readonly mock: MockTracker;
+ }
+
+ /**
+ * An instance of `SuiteContext` is passed to each suite function in order to
+ * interact with the test runner. However, the `SuiteContext` constructor is not
+ * exposed as part of the API.
+ * @since v18.7.0, v16.17.0
+ */
+ class SuiteContext {
+ /**
+ * The name of the suite.
+ * @since v18.8.0, v16.18.0
+ */
+ readonly name: string;
+ /**
+ * Can be used to abort test subtasks when the test has been aborted.
+ * @since v18.7.0, v16.17.0
+ */
+ readonly signal: AbortSignal;
+ }
+ interface TestOptions {
+ /**
+ * If a number is provided, then that many tests would run in parallel.
+ * If truthy, it would run (number of cpu cores - 1) tests in parallel.
+ * For subtests, it will be `Infinity` tests in parallel.
+ * If falsy, it would only run one test at a time.
+ * If unspecified, subtests inherit this value from their parent.
+ * @default false
+ */
+ concurrency?: number | boolean | undefined;
+
+ /**
+ * If truthy, and the test context is configured to run `only` tests, then this test will be
+ * run. Otherwise, the test is skipped.
+ * @default false
+ */
+ only?: boolean | undefined;
+
+ /**
+ * Allows aborting an in-progress test.
+ * @since v18.8.0
+ */
+ signal?: AbortSignal | undefined;
+
+ /**
+ * If truthy, the test is skipped. If a string is provided, that string is displayed in the
+ * test results as the reason for skipping the test.
+ * @default false
+ */
+ skip?: boolean | string | undefined;
+
+ /**
+ * A number of milliseconds the test will fail after. If unspecified, subtests inherit this
+ * value from their parent.
+ * @default Infinity
+ * @since v18.7.0
+ */
+ timeout?: number | undefined;
+
+ /**
+ * If truthy, the test marked as `TODO`. If a string is provided, that string is displayed in
+ * the test results as the reason why the test is `TODO`.
+ * @default false
+ */
+ todo?: boolean | string | undefined;
+ }
+
+ /**
+ * This function is used to create a hook running before running a suite.
+ * @param fn The hook function. If the hook uses callbacks, the callback function is passed as
+ * the second argument. Default: A no-op function.
+ * @param options Configuration options for the hook.
+ * @since v18.8.0
+ */
+ function before(fn?: HookFn, options?: HookOptions): void;
+
+ /**
+ * This function is used to create a hook running after running a suite.
+ * @param fn The hook function. If the hook uses callbacks, the callback function is passed as
+ * the second argument. Default: A no-op function.
+ * @param options Configuration options for the hook.
+ * @since v18.8.0
+ */
+ function after(fn?: HookFn, options?: HookOptions): void;
+
+ /**
+ * This function is used to create a hook running before each subtest of the current suite.
+ * @param fn The hook function. If the hook uses callbacks, the callback function is passed as
+ * the second argument. Default: A no-op function.
+ * @param options Configuration options for the hook.
+ * @since v18.8.0
+ */
+ function beforeEach(fn?: HookFn, options?: HookOptions): void;
+
+ /**
+ * This function is used to create a hook running after each subtest of the current test.
+ * @param fn The hook function. If the hook uses callbacks, the callback function is passed as
+ * the second argument. Default: A no-op function.
+ * @param options Configuration options for the hook.
+ * @since v18.8.0
+ */
+ function afterEach(fn?: HookFn, options?: HookOptions): void;
+
+ /**
+ * The hook function. If the hook uses callbacks, the callback function is passed as the
+ * second argument.
+ */
+ type HookFn = (s: SuiteContext, done: (result?: any) => void) => any;
+
+ /**
+ * Configuration options for hooks.
+ * @since v18.8.0
+ */
+ interface HookOptions {
+ /**
+ * Allows aborting an in-progress hook.
+ */
+ signal?: AbortSignal | undefined;
+
+ /**
+ * A number of milliseconds the hook will fail after. If unspecified, subtests inherit this
+ * value from their parent.
+ * @default Infinity
+ */
+ timeout?: number | undefined;
+ }
+
+ interface MockFunctionOptions {
+ /**
+ * The number of times that the mock will use the behavior of `implementation`.
+ * Once the mock function has been called `times` times,
+ * it will automatically restore the behavior of `original`.
+ * This value must be an integer greater than zero.
+ * @default Infinity
+ */
+ times?: number | undefined;
+ }
+
+ interface MockMethodOptions extends MockFunctionOptions {
+ /**
+ * If `true`, `object[methodName]` is treated as a getter.
+ * This option cannot be used with the `setter` option.
+ */
+ getter?: boolean | undefined;
+
+ /**
+ * If `true`, `object[methodName]` is treated as a setter.
+ * This option cannot be used with the `getter` option.
+ */
+ setter?: boolean | undefined;
+ }
+
+ type Mock<F extends Function> = F & {
+ mock: MockFunctionContext<F>;
+ };
+
+ type NoOpFunction = (...args: any[]) => undefined;
+
+ type FunctionPropertyNames<T> = {
+ [K in keyof T]: T[K] extends Function ? K : never;
+ }[keyof T];
+
+ interface MockTracker {
+ /**
+ * This function is used to create a mock function.
+ * @param original An optional function to create a mock on.
+ * @param implementation An optional function used as the mock implementation for `original`.
+ * This is useful for creating mocks that exhibit one behavior for a specified number of calls and then restore the behavior of `original`.
+ * @param options Optional configuration options for the mock function.
+ */
+ fn<F extends Function = NoOpFunction>(original?: F, options?: MockFunctionOptions): Mock<F>;
+ fn<F extends Function = NoOpFunction, Implementation extends Function = F>(
+ original?: F,
+ implementation?: Implementation,
+ options?: MockFunctionOptions,
+ ): Mock<F | Implementation>;
+
+ /**
+ * This function is used to create a mock on an existing object method.
+ * @param object The object whose method is being mocked.
+ * @param methodName The identifier of the method on `object` to mock. If `object[methodName]` is not a function, an error is thrown.
+ * @param implementation An optional function used as the mock implementation for `object[methodName]`.
+ * @param options Optional configuration options for the mock method.
+ */
+ method<
+ MockedObject extends object,
+ MethodName extends FunctionPropertyNames<MockedObject>,
+ >(
+ object: MockedObject,
+ methodName: MethodName,
+ options?: MockFunctionOptions,
+ ): MockedObject[MethodName] extends Function ? Mock<MockedObject[MethodName]>
+ : never;
+ method<
+ MockedObject extends object,
+ MethodName extends FunctionPropertyNames<MockedObject>,
+ Implementation extends Function,
+ >(
+ object: MockedObject,
+ methodName: MethodName,
+ implementation: Implementation,
+ options?: MockFunctionOptions,
+ ): MockedObject[MethodName] extends Function ? Mock<MockedObject[MethodName] | Implementation>
+ : never;
+ method<MockedObject extends object>(
+ object: MockedObject,
+ methodName: keyof MockedObject,
+ options: MockMethodOptions,
+ ): Mock<Function>;
+ method<MockedObject extends object>(
+ object: MockedObject,
+ methodName: keyof MockedObject,
+ implementation: Function,
+ options: MockMethodOptions,
+ ): Mock<Function>;
+
+ /**
+ * This function is syntax sugar for {@link MockTracker.method} with `options.getter` set to `true`.
+ */
+ getter<
+ MockedObject extends object,
+ MethodName extends keyof MockedObject,
+ >(
+ object: MockedObject,
+ methodName: MethodName,
+ options?: MockFunctionOptions,
+ ): Mock<() => MockedObject[MethodName]>;
+ getter<
+ MockedObject extends object,
+ MethodName extends keyof MockedObject,
+ Implementation extends Function,
+ >(
+ object: MockedObject,
+ methodName: MethodName,
+ implementation?: Implementation,
+ options?: MockFunctionOptions,
+ ): Mock<(() => MockedObject[MethodName]) | Implementation>;
+
+ /**
+ * This function is syntax sugar for {@link MockTracker.method} with `options.setter` set to `true`.
+ */
+ setter<
+ MockedObject extends object,
+ MethodName extends keyof MockedObject,
+ >(
+ object: MockedObject,
+ methodName: MethodName,
+ options?: MockFunctionOptions,
+ ): Mock<(value: MockedObject[MethodName]) => void>;
+ setter<
+ MockedObject extends object,
+ MethodName extends keyof MockedObject,
+ Implementation extends Function,
+ >(
+ object: MockedObject,
+ methodName: MethodName,
+ implementation?: Implementation,
+ options?: MockFunctionOptions,
+ ): Mock<((value: MockedObject[MethodName]) => void) | Implementation>;
+
+ /**
+ * This function restores the default behavior of all mocks that were previously created by this `MockTracker`
+ * and disassociates the mocks from the `MockTracker` instance. Once disassociated, the mocks can still be used,
+ * but the `MockTracker` instance can no longer be used to reset their behavior or otherwise interact with them.
+ *
+ * After each test completes, this function is called on the test context's `MockTracker`.
+ * If the global `MockTracker` is used extensively, calling this function manually is recommended.
+ */
+ reset(): void;
+
+ /**
+ * This function restores the default behavior of all mocks that were previously created by this `MockTracker`.
+ * Unlike `mock.reset()`, `mock.restoreAll()` does not disassociate the mocks from the `MockTracker` instance.
+ */
+ restoreAll(): void;
+ }
+
+ const mock: MockTracker;
+
+ interface MockFunctionCall<
+ F extends Function,
+ ReturnType = F extends (...args: any) => infer T ? T
+ : F extends abstract new(...args: any) => infer T ? T
+ : unknown,
+ Args = F extends (...args: infer Y) => any ? Y
+ : F extends abstract new(...args: infer Y) => any ? Y
+ : unknown[],
+ > {
+ /**
+ * An array of the arguments passed to the mock function.
+ */
+ arguments: Args;
+ /**
+ * If the mocked function threw then this property contains the thrown value.
+ */
+ error: unknown | undefined;
+ /**
+ * The value returned by the mocked function.
+ *
+ * If the mocked function threw, it will be `undefined`.
+ */
+ result: ReturnType | undefined;
+ /**
+ * An `Error` object whose stack can be used to determine the callsite of the mocked function invocation.
+ */
+ stack: Error;
+ /**
+ * If the mocked function is a constructor, this field contains the class being constructed.
+ * Otherwise this will be `undefined`.
+ */
+ target: F extends abstract new(...args: any) => any ? F : undefined;
+ /**
+ * The mocked function's `this` value.
+ */
+ this: unknown;
+ }
+
+ interface MockFunctionContext<F extends Function> {
+ /**
+ * A getter that returns a copy of the internal array used to track calls to the mock.
+ */
+ readonly calls: Array<MockFunctionCall<F>>;
+
+ /**
+ * This function returns the number of times that this mock has been invoked.
+ * This function is more efficient than checking `ctx.calls.length`
+ * because `ctx.calls` is a getter that creates a copy of the internal call tracking array.
+ */
+ callCount(): number;
+
+ /**
+ * This function is used to change the behavior of an existing mock.
+ * @param implementation The function to be used as the mock's new implementation.
+ */
+ mockImplementation(implementation: Function): void;
+
+ /**
+ * This function is used to change the behavior of an existing mock for a single invocation.
+ * Once invocation `onCall` has occurred, the mock will revert to whatever behavior
+ * it would have used had `mockImplementationOnce()` not been called.
+ * @param implementation The function to be used as the mock's implementation for the invocation number specified by `onCall`.
+ * @param onCall The invocation number that will use `implementation`.
+ * If the specified invocation has already occurred then an exception is thrown.
+ */
+ mockImplementationOnce(implementation: Function, onCall?: number): void;
+
+ /**
+ * Resets the call history of the mock function.
+ */
+ resetCalls(): void;
+
+ /**
+ * Resets the implementation of the mock function to its original behavior.
+ * The mock can still be used after calling this function.
+ */
+ restore(): void;
+ }
+
+ export { after, afterEach, before, beforeEach, describe, it, mock, run, test, test as default };
+}
+
+interface DiagnosticData {
+ /**
+ * The diagnostic message.
+ */
+ message: string;
+ /**
+ * The nesting level of the test.
+ */
+ nesting: number;
+ /**
+ * The path of the test file, undefined if test is not ran through a file.
+ */
+ file?: string;
+}
+interface TestFail {
+ /**
+ * Additional execution metadata.
+ */
+ details: {
+ /**
+ * The duration of the test in milliseconds.
+ */
+ duration_ms: number;
+ /**
+ * The error thrown by the test.
+ */
+ error: Error;
+ /**
+ * The type of the test, used to denote whether this is a suite.
+ * @since 18.17.0
+ */
+ type?: "suite";
+ };
+ /**
+ * The test name.
+ */
+ name: string;
+ /**
+ * The nesting level of the test.
+ */
+ nesting: number;
+ /**
+ * The ordinal number of the test.
+ */
+ testNumber: number;
+ /**
+ * Present if `context.todo` is called.
+ */
+ todo?: string | boolean;
+ /**
+ * Present if `context.skip` is called.
+ */
+ skip?: string | boolean;
+ /**
+ * The path of the test file, undefined if test is not ran through a file.
+ */
+ file?: string;
+}
+interface TestPass {
+ /**
+ * Additional execution metadata.
+ */
+ details: {
+ /**
+ * The duration of the test in milliseconds.
+ */
+ duration_ms: number;
+ /**
+ * The type of the test, used to denote whether this is a suite.
+ * @since 18.17.0
+ */
+ type?: "suite";
+ };
+ /**
+ * The test name.
+ */
+ name: string;
+ /**
+ * The nesting level of the test.
+ */
+ nesting: number;
+ /**
+ * The ordinal number of the test.
+ */
+ testNumber: number;
+ /**
+ * Present if `context.todo` is called.
+ */
+ todo?: string | boolean;
+ /**
+ * Present if `context.skip` is called.
+ */
+ skip?: string | boolean;
+ /**
+ * The path of the test file, undefined if test is not ran through a file.
+ */
+ file?: string;
+}
+interface TestPlan {
+ /**
+ * The nesting level of the test.
+ */
+ nesting: number;
+ /**
+ * The number of subtests that have ran.
+ */
+ count: number;
+ /**
+ * The path of the test file, undefined if test is not ran through a file.
+ */
+ file?: string;
+}
+interface TestStart {
+ /**
+ * The test name.
+ */
+ name: string;
+ /**
+ * The nesting level of the test.
+ */
+ nesting: number;
+ /**
+ * The path of the test file, undefined if test is not ran through a file.
+ */
+ file?: string;
+}
+interface TestStderr {
+ /**
+ * The path of the test file, undefined if test is not ran through a file.
+ */
+ file?: string;
+ /**
+ * The message written to `stderr`
+ */
+ message: string;
+}
+interface TestStdout {
+ /**
+ * The path of the test file, undefined if test is not ran through a file.
+ */
+ file?: string;
+ /**
+ * The message written to `stdout`
+ */
+ message: string;
+}
+interface TestEnqueue {
+ /**
+ * The test name
+ */
+ name: string;
+ /**
+ * The path of the test file, undefined if test is not ran through a file.
+ */
+ file?: string;
+ /**
+ * The nesting level of the test.
+ */
+ nesting: number;
+}
+interface TestDequeue {
+ /**
+ * The test name
+ */
+ name: string;
+ /**
+ * The path of the test file, undefined if test is not ran through a file.
+ */
+ file?: string;
+ /**
+ * The nesting level of the test.
+ */
+ nesting: number;
+}
+
+/**
+ * The `node:test/reporters` module exposes the builtin-reporters for `node:test`.
+ * To access it:
+ *
+ * ```js
+ * import test from 'node:test/reporters';
+ * ```
+ *
+ * This module is only available under the `node:` scheme. The following will not
+ * work:
+ *
+ * ```js
+ * import test from 'test/reporters';
+ * ```
+ * @since v18.17.0
+ * @see [source](https://github.com/nodejs/node/blob/v18.17.0/lib/test/reporters.js)
+ */
+declare module "node:test/reporters" {
+ import { Transform } from "node:stream";
+
+ type TestEvent =
+ | { type: "test:diagnostic"; data: DiagnosticData }
+ | { type: "test:fail"; data: TestFail }
+ | { type: "test:pass"; data: TestPass }
+ | { type: "test:plan"; data: TestPlan }
+ | { type: "test:start"; data: TestStart }
+ | { type: "test:stderr"; data: TestStderr }
+ | { type: "test:stdout"; data: TestStdout }
+ | { type: "test:enqueue"; data: TestEnqueue }
+ | { type: "test:dequeue"; data: TestDequeue }
+ | { type: "test:watch:drained" };
+ type TestEventGenerator = AsyncGenerator<TestEvent, void>;
+
+ /**
+ * The `dot` reporter outputs the test results in a compact format,
+ * where each passing test is represented by a `.`,
+ * and each failing test is represented by a `X`.
+ */
+ function dot(source: TestEventGenerator): AsyncGenerator<"\n" | "." | "X", void>;
+ /**
+ * The `tap` reporter outputs the test results in the [TAP](https://testanything.org/) format.
+ */
+ function tap(source: TestEventGenerator): AsyncGenerator<string, void>;
+ /**
+ * The `spec` reporter outputs the test results in a human-readable format.
+ */
+ class Spec extends Transform {
+ constructor();
+ }
+ export { dot, Spec as spec, tap, TestEvent };
+}
diff --git a/client/node_modules/@types/node/timers.d.ts b/client/node_modules/@types/node/timers.d.ts
new file mode 100644
index 0000000..0d1beed
--- /dev/null
+++ b/client/node_modules/@types/node/timers.d.ts
@@ -0,0 +1,126 @@
+/**
+ * The `timer` module exposes a global API for scheduling functions to
+ * be called at some future period of time. Because the timer functions are
+ * globals, there is no need to call `require('timers')` to use the API.
+ *
+ * The timer functions within Node.js implement a similar API as the timers API
+ * provided by Web Browsers but use a different internal implementation that is
+ * built around the Node.js [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#setimmediate-vs-settimeout).
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/timers.js)
+ */
+declare module "timers" {
+ import { Abortable } from "node:events";
+ import {
+ setImmediate as setImmediatePromise,
+ setInterval as setIntervalPromise,
+ setTimeout as setTimeoutPromise,
+ } from "node:timers/promises";
+ interface TimerOptions extends Abortable {
+ /**
+ * Set to `false` to indicate that the scheduled `Timeout`
+ * should not require the Node.js event loop to remain active.
+ * @default true
+ */
+ ref?: boolean | undefined;
+ }
+ let setTimeout: typeof global.setTimeout;
+ let clearTimeout: typeof global.clearTimeout;
+ let setInterval: typeof global.setInterval;
+ let clearInterval: typeof global.clearInterval;
+ let setImmediate: typeof global.setImmediate;
+ let clearImmediate: typeof global.clearImmediate;
+ global {
+ namespace NodeJS {
+ // compatibility with older typings
+ interface Timer extends RefCounted {
+ hasRef(): boolean;
+ refresh(): this;
+ [Symbol.toPrimitive](): number;
+ }
+ interface Immediate extends RefCounted {
+ /**
+ * If true, the `Immediate` object will keep the Node.js event loop active.
+ * @since v11.0.0
+ */
+ hasRef(): boolean;
+ _onImmediate: Function; // to distinguish it from the Timeout class
+ /**
+ * Cancels the immediate. This is similar to calling `clearImmediate()`.
+ * @since v18.18.0
+ */
+ [Symbol.dispose](): void;
+ }
+ interface Timeout extends Timer {
+ /**
+ * If true, the `Timeout` object will keep the Node.js event loop active.
+ * @since v11.0.0
+ */
+ hasRef(): boolean;
+ /**
+ * Sets the timer's start time to the current time, and reschedules the timer to
+ * call its callback at the previously specified duration adjusted to the current
+ * time. This is useful for refreshing a timer without allocating a new
+ * JavaScript object.
+ *
+ * Using this on a timer that has already called its callback will reactivate the
+ * timer.
+ * @since v10.2.0
+ * @return a reference to `timeout`
+ */
+ refresh(): this;
+ [Symbol.toPrimitive](): number;
+ /**
+ * Cancels the timeout.
+ * @since v18.18.0
+ */
+ [Symbol.dispose](): void;
+ }
+ }
+ /**
+ * Schedules execution of a one-time `callback` after `delay` milliseconds. The `callback` will likely not be invoked in precisely `delay` milliseconds.
+ * Node.js makes no guarantees about the exact timing of when callbacks will fire, nor of their ordering. The callback will be called as close as possible to the time specified.
+ * When `delay` is larger than `2147483647` or less than `1`, the `delay` will be set to `1`. Non-integer delays are truncated to an integer.
+ * If `callback` is not a function, a [TypeError](https://nodejs.org/api/errors.html#class-typeerror) will be thrown.
+ * @since v0.0.1
+ */
+ function setTimeout<TArgs extends any[]>(
+ callback: (...args: TArgs) => void,
+ ms?: number,
+ ...args: TArgs
+ ): NodeJS.Timeout;
+ // util.promisify no rest args compability
+ // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
+ function setTimeout(callback: (args: void) => void, ms?: number): NodeJS.Timeout;
+ namespace setTimeout {
+ const __promisify__: typeof setTimeoutPromise;
+ }
+ function clearTimeout(timeoutId: NodeJS.Timeout | string | number | undefined): void;
+ function setInterval<TArgs extends any[]>(
+ callback: (...args: TArgs) => void,
+ ms?: number,
+ ...args: TArgs
+ ): NodeJS.Timeout;
+ // util.promisify no rest args compability
+ // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
+ function setInterval(callback: (args: void) => void, ms?: number): NodeJS.Timeout;
+ namespace setInterval {
+ const __promisify__: typeof setIntervalPromise;
+ }
+ function clearInterval(intervalId: NodeJS.Timeout | string | number | undefined): void;
+ function setImmediate<TArgs extends any[]>(
+ callback: (...args: TArgs) => void,
+ ...args: TArgs
+ ): NodeJS.Immediate;
+ // util.promisify no rest args compability
+ // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
+ function setImmediate(callback: (args: void) => void): NodeJS.Immediate;
+ namespace setImmediate {
+ const __promisify__: typeof setImmediatePromise;
+ }
+ function clearImmediate(immediateId: NodeJS.Immediate | undefined): void;
+ function queueMicrotask(callback: () => void): void;
+ }
+}
+declare module "node:timers" {
+ export * from "timers";
+}
diff --git a/client/node_modules/@types/node/timers/promises.d.ts b/client/node_modules/@types/node/timers/promises.d.ts
new file mode 100644
index 0000000..abb5b42
--- /dev/null
+++ b/client/node_modules/@types/node/timers/promises.d.ts
@@ -0,0 +1,93 @@
+/**
+ * The `timers/promises` API provides an alternative set of timer functions
+ * that return `Promise` objects. The API is accessible via`require('timers/promises')`.
+ *
+ * ```js
+ * import {
+ * setTimeout,
+ * setImmediate,
+ * setInterval,
+ * } from 'timers/promises';
+ * ```
+ * @since v15.0.0
+ */
+declare module "timers/promises" {
+ import { TimerOptions } from "node:timers";
+ /**
+ * ```js
+ * import {
+ * setTimeout,
+ * } from 'timers/promises';
+ *
+ * const res = await setTimeout(100, 'result');
+ *
+ * console.log(res); // Prints 'result'
+ * ```
+ * @since v15.0.0
+ * @param [delay=1] The number of milliseconds to wait before fulfilling the promise.
+ * @param value A value with which the promise is fulfilled.
+ */
+ function setTimeout<T = void>(delay?: number, value?: T, options?: TimerOptions): Promise<T>;
+ /**
+ * ```js
+ * import {
+ * setImmediate,
+ * } from 'timers/promises';
+ *
+ * const res = await setImmediate('result');
+ *
+ * console.log(res); // Prints 'result'
+ * ```
+ * @since v15.0.0
+ * @param value A value with which the promise is fulfilled.
+ */
+ function setImmediate<T = void>(value?: T, options?: TimerOptions): Promise<T>;
+ /**
+ * Returns an async iterator that generates values in an interval of `delay` ms.
+ *
+ * ```js
+ * import {
+ * setInterval,
+ * } from 'timers/promises';
+ *
+ * const interval = 100;
+ * for await (const startTime of setInterval(interval, Date.now())) {
+ * const now = Date.now();
+ * console.log(now);
+ * if ((now - startTime) > 1000)
+ * break;
+ * }
+ * console.log(Date.now());
+ * ```
+ * @since v15.9.0
+ */
+ function setInterval<T = void>(delay?: number, value?: T, options?: TimerOptions): AsyncIterable<T>;
+
+ interface Scheduler {
+ /**
+ * ```js
+ * import { scheduler } from 'node:timers/promises';
+ *
+ * await scheduler.wait(1000); // Wait one second before continuing
+ * ```
+ * An experimental API defined by the Scheduling APIs draft specification being developed as a standard Web Platform API.
+ * Calling timersPromises.scheduler.wait(delay, options) is roughly equivalent to calling timersPromises.setTimeout(delay, undefined, options) except that the ref option is not supported.
+ * @since v16.14.0
+ * @experimental
+ * @param [delay=1] The number of milliseconds to wait before fulfilling the promise.
+ */
+ wait: (delay?: number, options?: TimerOptions) => Promise<void>;
+ /**
+ * An experimental API defined by the Scheduling APIs draft specification being developed as a standard Web Platform API.
+ * Calling timersPromises.scheduler.yield() is equivalent to calling timersPromises.setImmediate() with no arguments.
+ * @since v16.14.0
+ * @experimental
+ */
+ yield: () => Promise<void>;
+ }
+
+ const scheduler: Scheduler;
+}
+declare module "node:timers/promises" {
+ export * from "timers/promises";
+}
diff --git a/client/node_modules/@types/node/tls.d.ts b/client/node_modules/@types/node/tls.d.ts
new file mode 100644
index 0000000..5b2fe7f
--- /dev/null
+++ b/client/node_modules/@types/node/tls.d.ts
@@ -0,0 +1,1191 @@
+/**
+ * The `tls` module provides an implementation of the Transport Layer Security
+ * (TLS) and Secure Socket Layer (SSL) protocols that is built on top of OpenSSL.
+ * The module can be accessed using:
+ *
+ * ```js
+ * const tls = require('tls');
+ * ```
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/tls.js)
+ */
+declare module "tls" {
+ import { X509Certificate } from "node:crypto";
+ import * as net from "node:net";
+ import * as stream from "stream";
+ const CLIENT_RENEG_LIMIT: number;
+ const CLIENT_RENEG_WINDOW: number;
+ interface Certificate {
+ /**
+ * Country code.
+ */
+ C: string;
+ /**
+ * Street.
+ */
+ ST: string;
+ /**
+ * Locality.
+ */
+ L: string;
+ /**
+ * Organization.
+ */
+ O: string;
+ /**
+ * Organizational unit.
+ */
+ OU: string;
+ /**
+ * Common name.
+ */
+ CN: string;
+ }
+ interface PeerCertificate {
+ /**
+ * `true` if a Certificate Authority (CA), `false` otherwise.
+ * @since v18.13.0
+ */
+ ca: boolean;
+ /**
+ * The DER encoded X.509 certificate data.
+ */
+ raw: Buffer;
+ /**
+ * The certificate subject.
+ */
+ subject: Certificate;
+ /**
+ * The certificate issuer, described in the same terms as the `subject`.
+ */
+ issuer: Certificate;
+ /**
+ * The date-time the certificate is valid from.
+ */
+ valid_from: string;
+ /**
+ * The date-time the certificate is valid to.
+ */
+ valid_to: string;
+ /**
+ * The certificate serial number, as a hex string.
+ */
+ serialNumber: string;
+ /**
+ * The SHA-1 digest of the DER encoded certificate.
+ * It is returned as a `:` separated hexadecimal string.
+ */
+ fingerprint: string;
+ /**
+ * The SHA-256 digest of the DER encoded certificate.
+ * It is returned as a `:` separated hexadecimal string.
+ */
+ fingerprint256: string;
+ /**
+ * The SHA-512 digest of the DER encoded certificate.
+ * It is returned as a `:` separated hexadecimal string.
+ */
+ fingerprint512: string;
+ /**
+ * The extended key usage, a set of OIDs.
+ */
+ ext_key_usage?: string[];
+ /**
+ * A string containing concatenated names for the subject,
+ * an alternative to the `subject` names.
+ */
+ subjectaltname?: string;
+ /**
+ * An array describing the AuthorityInfoAccess, used with OCSP.
+ */
+ infoAccess?: NodeJS.Dict<string[]>;
+ /**
+ * For RSA keys: The RSA bit size.
+ *
+ * For EC keys: The key size in bits.
+ */
+ bits?: number;
+ /**
+ * The RSA exponent, as a string in hexadecimal number notation.
+ */
+ exponent?: string;
+ /**
+ * The RSA modulus, as a hexadecimal string.
+ */
+ modulus?: string;
+ /**
+ * The public key.
+ */
+ pubkey?: Buffer;
+ /**
+ * The ASN.1 name of the OID of the elliptic curve.
+ * Well-known curves are identified by an OID.
+ * While it is unusual, it is possible that the curve
+ * is identified by its mathematical properties,
+ * in which case it will not have an OID.
+ */
+ asn1Curve?: string;
+ /**
+ * The NIST name for the elliptic curve,if it has one
+ * (not all well-known curves have been assigned names by NIST).
+ */
+ nistCurve?: string;
+ }
+ interface DetailedPeerCertificate extends PeerCertificate {
+ /**
+ * The issuer certificate object.
+ * For self-signed certificates, this may be a circular reference.
+ */
+ issuerCertificate: DetailedPeerCertificate;
+ }
+ interface CipherNameAndProtocol {
+ /**
+ * The cipher name.
+ */
+ name: string;
+ /**
+ * SSL/TLS protocol version.
+ */
+ version: string;
+ /**
+ * IETF name for the cipher suite.
+ */
+ standardName: string;
+ }
+ interface EphemeralKeyInfo {
+ /**
+ * The supported types are 'DH' and 'ECDH'.
+ */
+ type: string;
+ /**
+ * The name property is available only when type is 'ECDH'.
+ */
+ name?: string | undefined;
+ /**
+ * The size of parameter of an ephemeral key exchange.
+ */
+ size: number;
+ }
+ interface KeyObject {
+ /**
+ * Private keys in PEM format.
+ */
+ pem: string | Buffer;
+ /**
+ * Optional passphrase.
+ */
+ passphrase?: string | undefined;
+ }
+ interface PxfObject {
+ /**
+ * PFX or PKCS12 encoded private key and certificate chain.
+ */
+ buf: string | Buffer;
+ /**
+ * Optional passphrase.
+ */
+ passphrase?: string | undefined;
+ }
+ interface TLSSocketOptions extends SecureContextOptions, CommonConnectionOptions {
+ /**
+ * If true the TLS socket will be instantiated in server-mode.
+ * Defaults to false.
+ */
+ isServer?: boolean | undefined;
+ /**
+ * An optional net.Server instance.
+ */
+ server?: net.Server | undefined;
+ /**
+ * An optional Buffer instance containing a TLS session.
+ */
+ session?: Buffer | undefined;
+ /**
+ * If true, specifies that the OCSP status request extension will be
+ * added to the client hello and an 'OCSPResponse' event will be
+ * emitted on the socket before establishing a secure communication
+ */
+ requestOCSP?: boolean | undefined;
+ }
+ /**
+ * Performs transparent encryption of written data and all required TLS
+ * negotiation.
+ *
+ * Instances of `tls.TLSSocket` implement the duplex `Stream` interface.
+ *
+ * Methods that return TLS connection metadata (e.g.{@link TLSSocket.getPeerCertificate} will only return data while the
+ * connection is open.
+ * @since v0.11.4
+ */
+ class TLSSocket extends net.Socket {
+ /**
+ * Construct a new tls.TLSSocket object from an existing TCP socket.
+ */
+ constructor(socket: net.Socket, options?: TLSSocketOptions);
+ /**
+ * This property is `true` if the peer certificate was signed by one of the CAs
+ * specified when creating the `tls.TLSSocket` instance, otherwise `false`.
+ * @since v0.11.4
+ */
+ authorized: boolean;
+ /**
+ * Returns the reason why the peer's certificate was not been verified. This
+ * property is set only when `tlsSocket.authorized === false`.
+ * @since v0.11.4
+ */
+ authorizationError: Error;
+ /**
+ * Always returns `true`. This may be used to distinguish TLS sockets from regular`net.Socket` instances.
+ * @since v0.11.4
+ */
+ encrypted: true;
+ /**
+ * String containing the selected ALPN protocol.
+ * Before a handshake has completed, this value is always null.
+ * When a handshake is completed but not ALPN protocol was selected, tlsSocket.alpnProtocol equals false.
+ */
+ alpnProtocol: string | false | null;
+ /**
+ * Returns an object representing the local certificate. The returned object has
+ * some properties corresponding to the fields of the certificate.
+ *
+ * See {@link TLSSocket.getPeerCertificate} for an example of the certificate
+ * structure.
+ *
+ * If there is no local certificate, an empty object will be returned. If the
+ * socket has been destroyed, `null` will be returned.
+ * @since v11.2.0
+ */
+ getCertificate(): PeerCertificate | object | null;
+ /**
+ * Returns an object containing information on the negotiated cipher suite.
+ *
+ * For example:
+ *
+ * ```json
+ * {
+ * "name": "AES128-SHA256",
+ * "standardName": "TLS_RSA_WITH_AES_128_CBC_SHA256",
+ * "version": "TLSv1.2"
+ * }
+ * ```
+ *
+ * See [SSL\_CIPHER\_get\_name](https://www.openssl.org/docs/man1.1.1/man3/SSL_CIPHER_get_name.html) for more information.
+ * @since v0.11.4
+ */
+ getCipher(): CipherNameAndProtocol;
+ /**
+ * Returns an object representing the type, name, and size of parameter of
+ * an ephemeral key exchange in `perfect forward secrecy` on a client
+ * connection. It returns an empty object when the key exchange is not
+ * ephemeral. As this is only supported on a client socket; `null` is returned
+ * if called on a server socket. The supported types are `'DH'` and `'ECDH'`. The`name` property is available only when type is `'ECDH'`.
+ *
+ * For example: `{ type: 'ECDH', name: 'prime256v1', size: 256 }`.
+ * @since v5.0.0
+ */
+ getEphemeralKeyInfo(): EphemeralKeyInfo | object | null;
+ /**
+ * As the `Finished` messages are message digests of the complete handshake
+ * (with a total of 192 bits for TLS 1.0 and more for SSL 3.0), they can
+ * be used for external authentication procedures when the authentication
+ * provided by SSL/TLS is not desired or is not enough.
+ *
+ * Corresponds to the `SSL_get_finished` routine in OpenSSL and may be used
+ * to implement the `tls-unique` channel binding from [RFC 5929](https://tools.ietf.org/html/rfc5929).
+ * @since v9.9.0
+ * @return The latest `Finished` message that has been sent to the socket as part of a SSL/TLS handshake, or `undefined` if no `Finished` message has been sent yet.
+ */
+ getFinished(): Buffer | undefined;
+ /**
+ * Returns an object representing the peer's certificate. If the peer does not
+ * provide a certificate, an empty object will be returned. If the socket has been
+ * destroyed, `null` will be returned.
+ *
+ * If the full certificate chain was requested, each certificate will include an`issuerCertificate` property containing an object representing its issuer's
+ * certificate.
+ * @since v0.11.4
+ * @param detailed Include the full certificate chain if `true`, otherwise include just the peer's certificate.
+ * @return A certificate object.
+ */
+ getPeerCertificate(detailed: true): DetailedPeerCertificate;
+ getPeerCertificate(detailed?: false): PeerCertificate;
+ getPeerCertificate(detailed?: boolean): PeerCertificate | DetailedPeerCertificate;
+ /**
+ * As the `Finished` messages are message digests of the complete handshake
+ * (with a total of 192 bits for TLS 1.0 and more for SSL 3.0), they can
+ * be used for external authentication procedures when the authentication
+ * provided by SSL/TLS is not desired or is not enough.
+ *
+ * Corresponds to the `SSL_get_peer_finished` routine in OpenSSL and may be used
+ * to implement the `tls-unique` channel binding from [RFC 5929](https://tools.ietf.org/html/rfc5929).
+ * @since v9.9.0
+ * @return The latest `Finished` message that is expected or has actually been received from the socket as part of a SSL/TLS handshake, or `undefined` if there is no `Finished` message so
+ * far.
+ */
+ getPeerFinished(): Buffer | undefined;
+ /**
+ * Returns a string containing the negotiated SSL/TLS protocol version of the
+ * current connection. The value `'unknown'` will be returned for connected
+ * sockets that have not completed the handshaking process. The value `null` will
+ * be returned for server sockets or disconnected client sockets.
+ *
+ * Protocol versions are:
+ *
+ * * `'SSLv3'`
+ * * `'TLSv1'`
+ * * `'TLSv1.1'`
+ * * `'TLSv1.2'`
+ * * `'TLSv1.3'`
+ *
+ * See the OpenSSL [`SSL_get_version`](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html) documentation for more information.
+ * @since v5.7.0
+ */
+ getProtocol(): string | null;
+ /**
+ * Returns the TLS session data or `undefined` if no session was
+ * negotiated. On the client, the data can be provided to the `session` option of {@link connect} to resume the connection. On the server, it may be useful
+ * for debugging.
+ *
+ * See `Session Resumption` for more information.
+ *
+ * Note: `getSession()` works only for TLSv1.2 and below. For TLSv1.3, applications
+ * must use the `'session'` event (it also works for TLSv1.2 and below).
+ * @since v0.11.4
+ */
+ getSession(): Buffer | undefined;
+ /**
+ * See [SSL\_get\_shared\_sigalgs](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_shared_sigalgs.html) for more information.
+ * @since v12.11.0
+ * @return List of signature algorithms shared between the server and the client in the order of decreasing preference.
+ */
+ getSharedSigalgs(): string[];
+ /**
+ * For a client, returns the TLS session ticket if one is available, or`undefined`. For a server, always returns `undefined`.
+ *
+ * It may be useful for debugging.
+ *
+ * See `Session Resumption` for more information.
+ * @since v0.11.4
+ */
+ getTLSTicket(): Buffer | undefined;
+ /**
+ * See `Session Resumption` for more information.
+ * @since v0.5.6
+ * @return `true` if the session was reused, `false` otherwise.
+ */
+ isSessionReused(): boolean;
+ /**
+ * The `tlsSocket.renegotiate()` method initiates a TLS renegotiation process.
+ * Upon completion, the `callback` function will be passed a single argument
+ * that is either an `Error` (if the request failed) or `null`.
+ *
+ * This method can be used to request a peer's certificate after the secure
+ * connection has been established.
+ *
+ * When running as the server, the socket will be destroyed with an error after`handshakeTimeout` timeout.
+ *
+ * For TLSv1.3, renegotiation cannot be initiated, it is not supported by the
+ * protocol.
+ * @since v0.11.8
+ * @param callback If `renegotiate()` returned `true`, callback is attached once to the `'secure'` event. If `renegotiate()` returned `false`, `callback` will be called in the next tick with
+ * an error, unless the `tlsSocket` has been destroyed, in which case `callback` will not be called at all.
+ * @return `true` if renegotiation was initiated, `false` otherwise.
+ */
+ renegotiate(
+ options: {
+ rejectUnauthorized?: boolean | undefined;
+ requestCert?: boolean | undefined;
+ },
+ callback: (err: Error | null) => void,
+ ): undefined | boolean;
+ /**
+ * The `tlsSocket.setMaxSendFragment()` method sets the maximum TLS fragment size.
+ * Returns `true` if setting the limit succeeded; `false` otherwise.
+ *
+ * Smaller fragment sizes decrease the buffering latency on the client: larger
+ * fragments are buffered by the TLS layer until the entire fragment is received
+ * and its integrity is verified; large fragments can span multiple roundtrips
+ * and their processing can be delayed due to packet loss or reordering. However,
+ * smaller fragments add extra TLS framing bytes and CPU overhead, which may
+ * decrease overall server throughput.
+ * @since v0.11.11
+ * @param [size=16384] The maximum TLS fragment size. The maximum value is `16384`.
+ */
+ setMaxSendFragment(size: number): boolean;
+ /**
+ * Disables TLS renegotiation for this `TLSSocket` instance. Once called, attempts
+ * to renegotiate will trigger an `'error'` event on the `TLSSocket`.
+ * @since v8.4.0
+ */
+ disableRenegotiation(): void;
+ /**
+ * When enabled, TLS packet trace information is written to `stderr`. This can be
+ * used to debug TLS connection problems.
+ *
+ * The format of the output is identical to the output of`openssl s_client -trace` or `openssl s_server -trace`. While it is produced by
+ * OpenSSL's `SSL_trace()` function, the format is undocumented, can change
+ * without notice, and should not be relied on.
+ * @since v12.2.0
+ */
+ enableTrace(): void;
+ /**
+ * Returns the peer certificate as an `X509Certificate` object.
+ *
+ * If there is no peer certificate, or the socket has been destroyed,`undefined` will be returned.
+ * @since v15.9.0
+ */
+ getPeerX509Certificate(): X509Certificate | undefined;
+ /**
+ * Returns the local certificate as an `X509Certificate` object.
+ *
+ * If there is no local certificate, or the socket has been destroyed,`undefined` will be returned.
+ * @since v15.9.0
+ */
+ getX509Certificate(): X509Certificate | undefined;
+ /**
+ * Keying material is used for validations to prevent different kind of attacks in
+ * network protocols, for example in the specifications of IEEE 802.1X.
+ *
+ * Example
+ *
+ * ```js
+ * const keyingMaterial = tlsSocket.exportKeyingMaterial(
+ * 128,
+ * 'client finished');
+ *
+ * /*
+ * Example return value of keyingMaterial:
+ * <Buffer 76 26 af 99 c5 56 8e 42 09 91 ef 9f 93 cb ad 6c 7b 65 f8 53 f1 d8 d9
+ * 12 5a 33 b8 b5 25 df 7b 37 9f e0 e2 4f b8 67 83 a3 2f cd 5d 41 42 4c 91
+ * 74 ef 2c ... 78 more bytes>
+ *
+ * ```
+ *
+ * See the OpenSSL [`SSL_export_keying_material`](https://www.openssl.org/docs/man1.1.1/man3/SSL_export_keying_material.html) documentation for more
+ * information.
+ * @since v13.10.0, v12.17.0
+ * @param length number of bytes to retrieve from keying material
+ * @param label an application specific label, typically this will be a value from the [IANA Exporter Label
+ * Registry](https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#exporter-labels).
+ * @param context Optionally provide a context.
+ * @return requested bytes of the keying material
+ */
+ exportKeyingMaterial(length: number, label: string, context: Buffer): Buffer;
+ addListener(event: string, listener: (...args: any[]) => void): this;
+ addListener(event: "OCSPResponse", listener: (response: Buffer) => void): this;
+ addListener(event: "secureConnect", listener: () => void): this;
+ addListener(event: "session", listener: (session: Buffer) => void): this;
+ addListener(event: "keylog", listener: (line: Buffer) => void): this;
+ emit(event: string | symbol, ...args: any[]): boolean;
+ emit(event: "OCSPResponse", response: Buffer): boolean;
+ emit(event: "secureConnect"): boolean;
+ emit(event: "session", session: Buffer): boolean;
+ emit(event: "keylog", line: Buffer): boolean;
+ on(event: string, listener: (...args: any[]) => void): this;
+ on(event: "OCSPResponse", listener: (response: Buffer) => void): this;
+ on(event: "secureConnect", listener: () => void): this;
+ on(event: "session", listener: (session: Buffer) => void): this;
+ on(event: "keylog", listener: (line: Buffer) => void): this;
+ once(event: string, listener: (...args: any[]) => void): this;
+ once(event: "OCSPResponse", listener: (response: Buffer) => void): this;
+ once(event: "secureConnect", listener: () => void): this;
+ once(event: "session", listener: (session: Buffer) => void): this;
+ once(event: "keylog", listener: (line: Buffer) => void): this;
+ prependListener(event: string, listener: (...args: any[]) => void): this;
+ prependListener(event: "OCSPResponse", listener: (response: Buffer) => void): this;
+ prependListener(event: "secureConnect", listener: () => void): this;
+ prependListener(event: "session", listener: (session: Buffer) => void): this;
+ prependListener(event: "keylog", listener: (line: Buffer) => void): this;
+ prependOnceListener(event: string, listener: (...args: any[]) => void): this;
+ prependOnceListener(event: "OCSPResponse", listener: (response: Buffer) => void): this;
+ prependOnceListener(event: "secureConnect", listener: () => void): this;
+ prependOnceListener(event: "session", listener: (session: Buffer) => void): this;
+ prependOnceListener(event: "keylog", listener: (line: Buffer) => void): this;
+ }
+ interface CommonConnectionOptions {
+ /**
+ * An optional TLS context object from tls.createSecureContext()
+ */
+ secureContext?: SecureContext | undefined;
+ /**
+ * When enabled, TLS packet trace information is written to `stderr`. This can be
+ * used to debug TLS connection problems.
+ * @default false
+ */
+ enableTrace?: boolean | undefined;
+ /**
+ * If true the server will request a certificate from clients that
+ * connect and attempt to verify that certificate. Defaults to
+ * false.
+ */
+ requestCert?: boolean | undefined;
+ /**
+ * An array of strings or a Buffer naming possible ALPN protocols.
+ * (Protocols should be ordered by their priority.)
+ */
+ ALPNProtocols?: string[] | Uint8Array[] | Uint8Array | undefined;
+ /**
+ * SNICallback(servername, cb) <Function> A function that will be
+ * called if the client supports SNI TLS extension. Two arguments
+ * will be passed when called: servername and cb. SNICallback should
+ * invoke cb(null, ctx), where ctx is a SecureContext instance.
+ * (tls.createSecureContext(...) can be used to get a proper
+ * SecureContext.) If SNICallback wasn't provided the default callback
+ * with high-level API will be used (see below).
+ */
+ SNICallback?: ((servername: string, cb: (err: Error | null, ctx?: SecureContext) => void) => void) | undefined;
+ /**
+ * If true the server will reject any connection which is not
+ * authorized with the list of supplied CAs. This option only has an
+ * effect if requestCert is true.
+ * @default true
+ */
+ rejectUnauthorized?: boolean | undefined;
+ }
+ interface TlsOptions extends SecureContextOptions, CommonConnectionOptions, net.ServerOpts {
+ /**
+ * Abort the connection if the SSL/TLS handshake does not finish in the
+ * specified number of milliseconds. A 'tlsClientError' is emitted on
+ * the tls.Server object whenever a handshake times out. Default:
+ * 120000 (120 seconds).
+ */
+ handshakeTimeout?: number | undefined;
+ /**
+ * The number of seconds after which a TLS session created by the
+ * server will no longer be resumable. See Session Resumption for more
+ * information. Default: 300.
+ */
+ sessionTimeout?: number | undefined;
+ /**
+ * 48-bytes of cryptographically strong pseudo-random data.
+ */
+ ticketKeys?: Buffer | undefined;
+ /**
+ * @param socket
+ * @param identity identity parameter sent from the client.
+ * @return pre-shared key that must either be
+ * a buffer or `null` to stop the negotiation process. Returned PSK must be
+ * compatible with the selected cipher's digest.
+ *
+ * When negotiating TLS-PSK (pre-shared keys), this function is called
+ * with the identity provided by the client.
+ * If the return value is `null` the negotiation process will stop and an
+ * "unknown_psk_identity" alert message will be sent to the other party.
+ * If the server wishes to hide the fact that the PSK identity was not known,
+ * the callback must provide some random data as `psk` to make the connection
+ * fail with "decrypt_error" before negotiation is finished.
+ * PSK ciphers are disabled by default, and using TLS-PSK thus
+ * requires explicitly specifying a cipher suite with the `ciphers` option.
+ * More information can be found in the RFC 4279.
+ */
+ pskCallback?(socket: TLSSocket, identity: string): DataView | NodeJS.TypedArray | null;
+ /**
+ * hint to send to a client to help
+ * with selecting the identity during TLS-PSK negotiation. Will be ignored
+ * in TLS 1.3. Upon failing to set pskIdentityHint `tlsClientError` will be
+ * emitted with `ERR_TLS_PSK_SET_IDENTIY_HINT_FAILED` code.
+ */
+ pskIdentityHint?: string | undefined;
+ }
+ interface PSKCallbackNegotation {
+ psk: DataView | NodeJS.TypedArray;
+ identity: string;
+ }
+ interface ConnectionOptions extends SecureContextOptions, CommonConnectionOptions {
+ host?: string | undefined;
+ port?: number | undefined;
+ path?: string | undefined; // Creates unix socket connection to path. If this option is specified, `host` and `port` are ignored.
+ socket?: stream.Duplex | undefined; // Establish secure connection on a given socket rather than creating a new socket
+ checkServerIdentity?: typeof checkServerIdentity | undefined;
+ servername?: string | undefined; // SNI TLS Extension
+ session?: Buffer | undefined;
+ minDHSize?: number | undefined;
+ lookup?: net.LookupFunction | undefined;
+ timeout?: number | undefined;
+ /**
+ * When negotiating TLS-PSK (pre-shared keys), this function is called
+ * with optional identity `hint` provided by the server or `null`
+ * in case of TLS 1.3 where `hint` was removed.
+ * It will be necessary to provide a custom `tls.checkServerIdentity()`
+ * for the connection as the default one will try to check hostname/IP
+ * of the server against the certificate but that's not applicable for PSK
+ * because there won't be a certificate present.
+ * More information can be found in the RFC 4279.
+ *
+ * @param hint message sent from the server to help client
+ * decide which identity to use during negotiation.
+ * Always `null` if TLS 1.3 is used.
+ * @returns Return `null` to stop the negotiation process. `psk` must be
+ * compatible with the selected cipher's digest.
+ * `identity` must use UTF-8 encoding.
+ */
+ pskCallback?(hint: string | null): PSKCallbackNegotation | null;
+ }
+ /**
+ * Accepts encrypted connections using TLS or SSL.
+ * @since v0.3.2
+ */
+ class Server extends net.Server {
+ constructor(secureConnectionListener?: (socket: TLSSocket) => void);
+ constructor(options: TlsOptions, secureConnectionListener?: (socket: TLSSocket) => void);
+ /**
+ * The `server.addContext()` method adds a secure context that will be used if
+ * the client request's SNI name matches the supplied `hostname` (or wildcard).
+ *
+ * When there are multiple matching contexts, the most recently added one is
+ * used.
+ * @since v0.5.3
+ * @param hostname A SNI host name or wildcard (e.g. `'*'`)
+ * @param context An object containing any of the possible properties from the {@link createSecureContext} `options` arguments (e.g. `key`, `cert`, `ca`, etc).
+ */
+ addContext(hostname: string, context: SecureContextOptions): void;
+ /**
+ * Returns the session ticket keys.
+ *
+ * See `Session Resumption` for more information.
+ * @since v3.0.0
+ * @return A 48-byte buffer containing the session ticket keys.
+ */
+ getTicketKeys(): Buffer;
+ /**
+ * The `server.setSecureContext()` method replaces the secure context of an
+ * existing server. Existing connections to the server are not interrupted.
+ * @since v11.0.0
+ * @param options An object containing any of the possible properties from the {@link createSecureContext} `options` arguments (e.g. `key`, `cert`, `ca`, etc).
+ */
+ setSecureContext(options: SecureContextOptions): void;
+ /**
+ * Sets the session ticket keys.
+ *
+ * Changes to the ticket keys are effective only for future server connections.
+ * Existing or currently pending server connections will use the previous keys.
+ *
+ * See `Session Resumption` for more information.
+ * @since v3.0.0
+ * @param keys A 48-byte buffer containing the session ticket keys.
+ */
+ setTicketKeys(keys: Buffer): void;
+ /**
+ * events.EventEmitter
+ * 1. tlsClientError
+ * 2. newSession
+ * 3. OCSPRequest
+ * 4. resumeSession
+ * 5. secureConnection
+ * 6. keylog
+ */
+ addListener(event: string, listener: (...args: any[]) => void): this;
+ addListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
+ addListener(
+ event: "newSession",
+ listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void,
+ ): this;
+ addListener(
+ event: "OCSPRequest",
+ listener: (
+ certificate: Buffer,
+ issuer: Buffer,
+ callback: (err: Error | null, resp: Buffer) => void,
+ ) => void,
+ ): this;
+ addListener(
+ event: "resumeSession",
+ listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void,
+ ): this;
+ addListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
+ addListener(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
+ emit(event: string | symbol, ...args: any[]): boolean;
+ emit(event: "tlsClientError", err: Error, tlsSocket: TLSSocket): boolean;
+ emit(event: "newSession", sessionId: Buffer, sessionData: Buffer, callback: () => void): boolean;
+ emit(
+ event: "OCSPRequest",
+ certificate: Buffer,
+ issuer: Buffer,
+ callback: (err: Error | null, resp: Buffer) => void,
+ ): boolean;
+ emit(
+ event: "resumeSession",
+ sessionId: Buffer,
+ callback: (err: Error | null, sessionData: Buffer | null) => void,
+ ): boolean;
+ emit(event: "secureConnection", tlsSocket: TLSSocket): boolean;
+ emit(event: "keylog", line: Buffer, tlsSocket: TLSSocket): boolean;
+ on(event: string, listener: (...args: any[]) => void): this;
+ on(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
+ on(event: "newSession", listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this;
+ on(
+ event: "OCSPRequest",
+ listener: (
+ certificate: Buffer,
+ issuer: Buffer,
+ callback: (err: Error | null, resp: Buffer) => void,
+ ) => void,
+ ): this;
+ on(
+ event: "resumeSession",
+ listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void,
+ ): this;
+ on(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
+ on(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
+ once(event: string, listener: (...args: any[]) => void): this;
+ once(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
+ once(
+ event: "newSession",
+ listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void,
+ ): this;
+ once(
+ event: "OCSPRequest",
+ listener: (
+ certificate: Buffer,
+ issuer: Buffer,
+ callback: (err: Error | null, resp: Buffer) => void,
+ ) => void,
+ ): this;
+ once(
+ event: "resumeSession",
+ listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void,
+ ): this;
+ once(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
+ once(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
+ prependListener(event: string, listener: (...args: any[]) => void): this;
+ prependListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
+ prependListener(
+ event: "newSession",
+ listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void,
+ ): this;
+ prependListener(
+ event: "OCSPRequest",
+ listener: (
+ certificate: Buffer,
+ issuer: Buffer,
+ callback: (err: Error | null, resp: Buffer) => void,
+ ) => void,
+ ): this;
+ prependListener(
+ event: "resumeSession",
+ listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void,
+ ): this;
+ prependListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
+ prependListener(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
+ prependOnceListener(event: string, listener: (...args: any[]) => void): this;
+ prependOnceListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
+ prependOnceListener(
+ event: "newSession",
+ listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void,
+ ): this;
+ prependOnceListener(
+ event: "OCSPRequest",
+ listener: (
+ certificate: Buffer,
+ issuer: Buffer,
+ callback: (err: Error | null, resp: Buffer) => void,
+ ) => void,
+ ): this;
+ prependOnceListener(
+ event: "resumeSession",
+ listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void,
+ ): this;
+ prependOnceListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
+ prependOnceListener(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
+ }
+ /**
+ * @deprecated since v0.11.3 Use `tls.TLSSocket` instead.
+ */
+ interface SecurePair {
+ encrypted: TLSSocket;
+ cleartext: TLSSocket;
+ }
+ type SecureVersion = "TLSv1.3" | "TLSv1.2" | "TLSv1.1" | "TLSv1";
+ interface SecureContextOptions {
+ /**
+ * Optionally override the trusted CA certificates. Default is to trust
+ * the well-known CAs curated by Mozilla. Mozilla's CAs are completely
+ * replaced when CAs are explicitly specified using this option.
+ */
+ ca?: string | Buffer | Array<string | Buffer> | undefined;
+ /**
+ * Cert chains in PEM format. One cert chain should be provided per
+ * private key. Each cert chain should consist of the PEM formatted
+ * certificate for a provided private key, followed by the PEM
+ * formatted intermediate certificates (if any), in order, and not
+ * including the root CA (the root CA must be pre-known to the peer,
+ * see ca). When providing multiple cert chains, they do not have to
+ * be in the same order as their private keys in key. If the
+ * intermediate certificates are not provided, the peer will not be
+ * able to validate the certificate, and the handshake will fail.
+ */
+ cert?: string | Buffer | Array<string | Buffer> | undefined;
+ /**
+ * Colon-separated list of supported signature algorithms. The list
+ * can contain digest algorithms (SHA256, MD5 etc.), public key
+ * algorithms (RSA-PSS, ECDSA etc.), combination of both (e.g
+ * 'RSA+SHA384') or TLS v1.3 scheme names (e.g. rsa_pss_pss_sha512).
+ */
+ sigalgs?: string | undefined;
+ /**
+ * Cipher suite specification, replacing the default. For more
+ * information, see modifying the default cipher suite. Permitted
+ * ciphers can be obtained via tls.getCiphers(). Cipher names must be
+ * uppercased in order for OpenSSL to accept them.
+ */
+ ciphers?: string | undefined;
+ /**
+ * Name of an OpenSSL engine which can provide the client certificate.
+ */
+ clientCertEngine?: string | undefined;
+ /**
+ * PEM formatted CRLs (Certificate Revocation Lists).
+ */
+ crl?: string | Buffer | Array<string | Buffer> | undefined;
+ /**
+ * `'auto'` or custom Diffie-Hellman parameters, required for non-ECDHE perfect forward secrecy.
+ * If omitted or invalid, the parameters are silently discarded and DHE ciphers will not be available.
+ * ECDHE-based perfect forward secrecy will still be available.
+ */
+ dhparam?: string | Buffer | undefined;
+ /**
+ * A string describing a named curve or a colon separated list of curve
+ * NIDs or names, for example P-521:P-384:P-256, to use for ECDH key
+ * agreement. Set to auto to select the curve automatically. Use
+ * crypto.getCurves() to obtain a list of available curve names. On
+ * recent releases, openssl ecparam -list_curves will also display the
+ * name and description of each available elliptic curve. Default:
+ * tls.DEFAULT_ECDH_CURVE.
+ */
+ ecdhCurve?: string | undefined;
+ /**
+ * Attempt to use the server's cipher suite preferences instead of the
+ * client's. When true, causes SSL_OP_CIPHER_SERVER_PREFERENCE to be
+ * set in secureOptions
+ */
+ honorCipherOrder?: boolean | undefined;
+ /**
+ * Private keys in PEM format. PEM allows the option of private keys
+ * being encrypted. Encrypted keys will be decrypted with
+ * options.passphrase. Multiple keys using different algorithms can be
+ * provided either as an array of unencrypted key strings or buffers,
+ * or an array of objects in the form {pem: <string|buffer>[,
+ * passphrase: <string>]}. The object form can only occur in an array.
+ * object.passphrase is optional. Encrypted keys will be decrypted with
+ * object.passphrase if provided, or options.passphrase if it is not.
+ */
+ key?: string | Buffer | Array<string | Buffer | KeyObject> | undefined;
+ /**
+ * Name of an OpenSSL engine to get private key from. Should be used
+ * together with privateKeyIdentifier.
+ */
+ privateKeyEngine?: string | undefined;
+ /**
+ * Identifier of a private key managed by an OpenSSL engine. Should be
+ * used together with privateKeyEngine. Should not be set together with
+ * key, because both options define a private key in different ways.
+ */
+ privateKeyIdentifier?: string | undefined;
+ /**
+ * Optionally set the maximum TLS version to allow. One
+ * of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the
+ * `secureProtocol` option, use one or the other.
+ * **Default:** `'TLSv1.3'`, unless changed using CLI options. Using
+ * `--tls-max-v1.2` sets the default to `'TLSv1.2'`. Using `--tls-max-v1.3` sets the default to
+ * `'TLSv1.3'`. If multiple of the options are provided, the highest maximum is used.
+ */
+ maxVersion?: SecureVersion | undefined;
+ /**
+ * Optionally set the minimum TLS version to allow. One
+ * of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the
+ * `secureProtocol` option, use one or the other. It is not recommended to use
+ * less than TLSv1.2, but it may be required for interoperability.
+ * **Default:** `'TLSv1.2'`, unless changed using CLI options. Using
+ * `--tls-v1.0` sets the default to `'TLSv1'`. Using `--tls-v1.1` sets the default to
+ * `'TLSv1.1'`. Using `--tls-min-v1.3` sets the default to
+ * 'TLSv1.3'. If multiple of the options are provided, the lowest minimum is used.
+ */
+ minVersion?: SecureVersion | undefined;
+ /**
+ * Shared passphrase used for a single private key and/or a PFX.
+ */
+ passphrase?: string | undefined;
+ /**
+ * PFX or PKCS12 encoded private key and certificate chain. pfx is an
+ * alternative to providing key and cert individually. PFX is usually
+ * encrypted, if it is, passphrase will be used to decrypt it. Multiple
+ * PFX can be provided either as an array of unencrypted PFX buffers,
+ * or an array of objects in the form {buf: <string|buffer>[,
+ * passphrase: <string>]}. The object form can only occur in an array.
+ * object.passphrase is optional. Encrypted PFX will be decrypted with
+ * object.passphrase if provided, or options.passphrase if it is not.
+ */
+ pfx?: string | Buffer | Array<string | Buffer | PxfObject> | undefined;
+ /**
+ * Optionally affect the OpenSSL protocol behavior, which is not
+ * usually necessary. This should be used carefully if at all! Value is
+ * a numeric bitmask of the SSL_OP_* options from OpenSSL Options
+ */
+ secureOptions?: number | undefined; // Value is a numeric bitmask of the `SSL_OP_*` options
+ /**
+ * Legacy mechanism to select the TLS protocol version to use, it does
+ * not support independent control of the minimum and maximum version,
+ * and does not support limiting the protocol to TLSv1.3. Use
+ * minVersion and maxVersion instead. The possible values are listed as
+ * SSL_METHODS, use the function names as strings. For example, use
+ * 'TLSv1_1_method' to force TLS version 1.1, or 'TLS_method' to allow
+ * any TLS protocol version up to TLSv1.3. It is not recommended to use
+ * TLS versions less than 1.2, but it may be required for
+ * interoperability. Default: none, see minVersion.
+ */
+ secureProtocol?: string | undefined;
+ /**
+ * Opaque identifier used by servers to ensure session state is not
+ * shared between applications. Unused by clients.
+ */
+ sessionIdContext?: string | undefined;
+ /**
+ * 48-bytes of cryptographically strong pseudo-random data.
+ * See Session Resumption for more information.
+ */
+ ticketKeys?: Buffer | undefined;
+ /**
+ * The number of seconds after which a TLS session created by the
+ * server will no longer be resumable. See Session Resumption for more
+ * information. Default: 300.
+ */
+ sessionTimeout?: number | undefined;
+ }
+ interface SecureContext {
+ context: any;
+ }
+ /**
+ * Verifies the certificate `cert` is issued to `hostname`.
+ *
+ * Returns [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object, populating it with `reason`, `host`, and `cert` on
+ * failure. On success, returns [undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Undefined_type).
+ *
+ * This function is intended to be used in combination with the`checkServerIdentity` option that can be passed to {@link connect} and as
+ * such operates on a `certificate object`. For other purposes, consider using `x509.checkHost()` instead.
+ *
+ * This function can be overwritten by providing an alternative function as the`options.checkServerIdentity` option that is passed to `tls.connect()`. The
+ * overwriting function can call `tls.checkServerIdentity()` of course, to augment
+ * the checks done with additional verification.
+ *
+ * This function is only called if the certificate passed all other checks, such as
+ * being issued by trusted CA (`options.ca`).
+ *
+ * Earlier versions of Node.js incorrectly accepted certificates for a given`hostname` if a matching `uniformResourceIdentifier` subject alternative name
+ * was present (see [CVE-2021-44531](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-44531)). Applications that wish to accept`uniformResourceIdentifier` subject alternative names can use
+ * a custom`options.checkServerIdentity` function that implements the desired behavior.
+ * @since v0.8.4
+ * @param hostname The host name or IP address to verify the certificate against.
+ * @param cert A `certificate object` representing the peer's certificate.
+ */
+ function checkServerIdentity(hostname: string, cert: PeerCertificate): Error | undefined;
+ /**
+ * Creates a new {@link Server}. The `secureConnectionListener`, if provided, is
+ * automatically set as a listener for the `'secureConnection'` event.
+ *
+ * The `ticketKeys` options is automatically shared between `cluster` module
+ * workers.
+ *
+ * The following illustrates a simple echo server:
+ *
+ * ```js
+ * const tls = require('tls');
+ * const fs = require('fs');
+ *
+ * const options = {
+ * key: fs.readFileSync('server-key.pem'),
+ * cert: fs.readFileSync('server-cert.pem'),
+ *
+ * // This is necessary only if using client certificate authentication.
+ * requestCert: true,
+ *
+ * // This is necessary only if the client uses a self-signed certificate.
+ * ca: [ fs.readFileSync('client-cert.pem') ]
+ * };
+ *
+ * const server = tls.createServer(options, (socket) => {
+ * console.log('server connected',
+ * socket.authorized ? 'authorized' : 'unauthorized');
+ * socket.write('welcome!\n');
+ * socket.setEncoding('utf8');
+ * socket.pipe(socket);
+ * });
+ * server.listen(8000, () => {
+ * console.log('server bound');
+ * });
+ * ```
+ *
+ * The server can be tested by connecting to it using the example client from {@link connect}.
+ * @since v0.3.2
+ */
+ function createServer(secureConnectionListener?: (socket: TLSSocket) => void): Server;
+ function createServer(options: TlsOptions, secureConnectionListener?: (socket: TLSSocket) => void): Server;
+ /**
+ * The `callback` function, if specified, will be added as a listener for the `'secureConnect'` event.
+ *
+ * `tls.connect()` returns a {@link TLSSocket} object.
+ *
+ * Unlike the `https` API, `tls.connect()` does not enable the
+ * SNI (Server Name Indication) extension by default, which may cause some
+ * servers to return an incorrect certificate or reject the connection
+ * altogether. To enable SNI, set the `servername` option in addition
+ * to `host`.
+ *
+ * The following illustrates a client for the echo server example from {@link createServer}:
+ *
+ * ```js
+ * // Assumes an echo server that is listening on port 8000.
+ * const tls = require('tls');
+ * const fs = require('fs');
+ *
+ * const options = {
+ * // Necessary only if the server requires client certificate authentication.
+ * key: fs.readFileSync('client-key.pem'),
+ * cert: fs.readFileSync('client-cert.pem'),
+ *
+ * // Necessary only if the server uses a self-signed certificate.
+ * ca: [ fs.readFileSync('server-cert.pem') ],
+ *
+ * // Necessary only if the server's cert isn't for "localhost".
+ * checkServerIdentity: () => { return null; },
+ * };
+ *
+ * const socket = tls.connect(8000, options, () => {
+ * console.log('client connected',
+ * socket.authorized ? 'authorized' : 'unauthorized');
+ * process.stdin.pipe(socket);
+ * process.stdin.resume();
+ * });
+ * socket.setEncoding('utf8');
+ * socket.on('data', (data) => {
+ * console.log(data);
+ * });
+ * socket.on('end', () => {
+ * console.log('server ends connection');
+ * });
+ * ```
+ * @since v0.11.3
+ */
+ function connect(options: ConnectionOptions, secureConnectListener?: () => void): TLSSocket;
+ function connect(
+ port: number,
+ host?: string,
+ options?: ConnectionOptions,
+ secureConnectListener?: () => void,
+ ): TLSSocket;
+ function connect(port: number, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket;
+ /**
+ * Creates a new secure pair object with two streams, one of which reads and writes
+ * the encrypted data and the other of which reads and writes the cleartext data.
+ * Generally, the encrypted stream is piped to/from an incoming encrypted data
+ * stream and the cleartext one is used as a replacement for the initial encrypted
+ * stream.
+ *
+ * `tls.createSecurePair()` returns a `tls.SecurePair` object with `cleartext` and`encrypted` stream properties.
+ *
+ * Using `cleartext` has the same API as {@link TLSSocket}.
+ *
+ * The `tls.createSecurePair()` method is now deprecated in favor of`tls.TLSSocket()`. For example, the code:
+ *
+ * ```js
+ * pair = tls.createSecurePair(// ... );
+ * pair.encrypted.pipe(socket);
+ * socket.pipe(pair.encrypted);
+ * ```
+ *
+ * can be replaced by:
+ *
+ * ```js
+ * secureSocket = tls.TLSSocket(socket, options);
+ * ```
+ *
+ * where `secureSocket` has the same API as `pair.cleartext`.
+ * @since v0.3.2
+ * @deprecated Since v0.11.3 - Use {@link TLSSocket} instead.
+ * @param context A secure context object as returned by `tls.createSecureContext()`
+ * @param isServer `true` to specify that this TLS connection should be opened as a server.
+ * @param requestCert `true` to specify whether a server should request a certificate from a connecting client. Only applies when `isServer` is `true`.
+ * @param rejectUnauthorized If not `false` a server automatically reject clients with invalid certificates. Only applies when `isServer` is `true`.
+ */
+ function createSecurePair(
+ context?: SecureContext,
+ isServer?: boolean,
+ requestCert?: boolean,
+ rejectUnauthorized?: boolean,
+ ): SecurePair;
+ /**
+ * {@link createServer} sets the default value of the `honorCipherOrder` option
+ * to `true`, other APIs that create secure contexts leave it unset.
+ *
+ * {@link createServer} uses a 128 bit truncated SHA1 hash value generated
+ * from `process.argv` as the default value of the `sessionIdContext` option, other
+ * APIs that create secure contexts have no default value.
+ *
+ * The `tls.createSecureContext()` method creates a `SecureContext` object. It is
+ * usable as an argument to several `tls` APIs, such as {@link createServer} and `server.addContext()`, but has no public methods.
+ *
+ * A key is _required_ for ciphers that use certificates. Either `key` or`pfx` can be used to provide it.
+ *
+ * If the `ca` option is not given, then Node.js will default to using [Mozilla's publicly trusted list of
+ * CAs](https://hg.mozilla.org/mozilla-central/raw-file/tip/security/nss/lib/ckfw/builtins/certdata.txt).
+ * @since v0.11.13
+ */
+ function createSecureContext(options?: SecureContextOptions): SecureContext;
+ /**
+ * Returns an array with the names of the supported TLS ciphers. The names are
+ * lower-case for historical reasons, but must be uppercased to be used in
+ * the `ciphers` option of {@link createSecureContext}.
+ *
+ * Not all supported ciphers are enabled by default. See `Modifying the default TLS cipher suite`.
+ *
+ * Cipher names that start with `'tls_'` are for TLSv1.3, all the others are for
+ * TLSv1.2 and below.
+ *
+ * ```js
+ * console.log(tls.getCiphers()); // ['aes128-gcm-sha256', 'aes128-sha', ...]
+ * ```
+ * @since v0.10.2
+ */
+ function getCiphers(): string[];
+ /**
+ * The default curve name to use for ECDH key agreement in a tls server.
+ * The default value is 'auto'. See tls.createSecureContext() for further
+ * information.
+ */
+ let DEFAULT_ECDH_CURVE: string;
+ /**
+ * The default value of the maxVersion option of
+ * tls.createSecureContext(). It can be assigned any of the supported TLS
+ * protocol versions, 'TLSv1.3', 'TLSv1.2', 'TLSv1.1', or 'TLSv1'. Default:
+ * 'TLSv1.3', unless changed using CLI options. Using --tls-max-v1.2 sets
+ * the default to 'TLSv1.2'. Using --tls-max-v1.3 sets the default to
+ * 'TLSv1.3'. If multiple of the options are provided, the highest maximum
+ * is used.
+ */
+ let DEFAULT_MAX_VERSION: SecureVersion;
+ /**
+ * The default value of the minVersion option of tls.createSecureContext().
+ * It can be assigned any of the supported TLS protocol versions,
+ * 'TLSv1.3', 'TLSv1.2', 'TLSv1.1', or 'TLSv1'. Default: 'TLSv1.2', unless
+ * changed using CLI options. Using --tls-min-v1.0 sets the default to
+ * 'TLSv1'. Using --tls-min-v1.1 sets the default to 'TLSv1.1'. Using
+ * --tls-min-v1.3 sets the default to 'TLSv1.3'. If multiple of the options
+ * are provided, the lowest minimum is used.
+ */
+ let DEFAULT_MIN_VERSION: SecureVersion;
+ /**
+ * The default value of the ciphers option of tls.createSecureContext().
+ * It can be assigned any of the supported OpenSSL ciphers.
+ * Defaults to the content of crypto.constants.defaultCoreCipherList, unless
+ * changed using CLI options using --tls-default-ciphers.
+ */
+ let DEFAULT_CIPHERS: string;
+ /**
+ * An immutable array of strings representing the root certificates (in PEM
+ * format) used for verifying peer certificates. This is the default value
+ * of the ca option to tls.createSecureContext().
+ */
+ const rootCertificates: readonly string[];
+}
+declare module "node:tls" {
+ export * from "tls";
+}
diff --git a/client/node_modules/@types/node/trace_events.d.ts b/client/node_modules/@types/node/trace_events.d.ts
new file mode 100644
index 0000000..7f0fe55
--- /dev/null
+++ b/client/node_modules/@types/node/trace_events.d.ts
@@ -0,0 +1,171 @@
+/**
+ * The `trace_events` module provides a mechanism to centralize tracing information
+ * generated by V8, Node.js core, and userspace code.
+ *
+ * Tracing can be enabled with the `--trace-event-categories` command-line flag
+ * or by using the `trace_events` module. The `--trace-event-categories` flag
+ * accepts a list of comma-separated category names.
+ *
+ * The available categories are:
+ *
+ * * `node`: An empty placeholder.
+ * * `node.async_hooks`: Enables capture of detailed `async_hooks` trace data.
+ * The `async_hooks` events have a unique `asyncId` and a special `triggerId` `triggerAsyncId` property.
+ * * `node.bootstrap`: Enables capture of Node.js bootstrap milestones.
+ * * `node.console`: Enables capture of `console.time()` and `console.count()`output.
+ * * `node.dns.native`: Enables capture of trace data for DNS queries.
+ * * `node.environment`: Enables capture of Node.js Environment milestones.
+ * * `node.fs.sync`: Enables capture of trace data for file system sync methods.
+ * * `node.perf`: Enables capture of `Performance API` measurements.
+ * * `node.perf.usertiming`: Enables capture of only Performance API User Timing
+ * measures and marks.
+ * * `node.perf.timerify`: Enables capture of only Performance API timerify
+ * measurements.
+ * * `node.promises.rejections`: Enables capture of trace data tracking the number
+ * of unhandled Promise rejections and handled-after-rejections.
+ * * `node.vm.script`: Enables capture of trace data for the `vm` module's`runInNewContext()`, `runInContext()`, and `runInThisContext()` methods.
+ * * `v8`: The `V8` events are GC, compiling, and execution related.
+ *
+ * By default the `node`, `node.async_hooks`, and `v8` categories are enabled.
+ *
+ * ```bash
+ * node --trace-event-categories v8,node,node.async_hooks server.js
+ * ```
+ *
+ * Prior versions of Node.js required the use of the `--trace-events-enabled`flag to enable trace events. This requirement has been removed. However, the`--trace-events-enabled` flag _may_ still be
+ * used and will enable the`node`, `node.async_hooks`, and `v8` trace event categories by default.
+ *
+ * ```bash
+ * node --trace-events-enabled
+ *
+ * # is equivalent to
+ *
+ * node --trace-event-categories v8,node,node.async_hooks
+ * ```
+ *
+ * Alternatively, trace events may be enabled using the `trace_events` module:
+ *
+ * ```js
+ * const trace_events = require('trace_events');
+ * const tracing = trace_events.createTracing({ categories: ['node.perf'] });
+ * tracing.enable(); // Enable trace event capture for the 'node.perf' category
+ *
+ * // do work
+ *
+ * tracing.disable(); // Disable trace event capture for the 'node.perf' category
+ * ```
+ *
+ * Running Node.js with tracing enabled will produce log files that can be opened
+ * in the [`chrome://tracing`](https://www.chromium.org/developers/how-tos/trace-event-profiling-tool) tab of Chrome.
+ *
+ * The logging file is by default called `node_trace.${rotation}.log`, where`${rotation}` is an incrementing log-rotation id. The filepath pattern can
+ * be specified with `--trace-event-file-pattern` that accepts a template
+ * string that supports `${rotation}` and `${pid}`:
+ *
+ * ```bash
+ * node --trace-event-categories v8 --trace-event-file-pattern '${pid}-${rotation}.log' server.js
+ * ```
+ *
+ * To guarantee that the log file is properly generated after signal events like`SIGINT`, `SIGTERM`, or `SIGBREAK`, make sure to have the appropriate handlers
+ * in your code, such as:
+ *
+ * ```js
+ * process.on('SIGINT', function onSigint() {
+ * console.info('Received SIGINT.');
+ * process.exit(130); // Or applicable exit code depending on OS and signal
+ * });
+ * ```
+ *
+ * The tracing system uses the same time source
+ * as the one used by `process.hrtime()`.
+ * However the trace-event timestamps are expressed in microseconds,
+ * unlike `process.hrtime()` which returns nanoseconds.
+ *
+ * The features from this module are not available in `Worker` threads.
+ * @experimental
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/trace_events.js)
+ */
+declare module "trace_events" {
+ /**
+ * The `Tracing` object is used to enable or disable tracing for sets of
+ * categories. Instances are created using the
+ * `trace_events.createTracing()` method.
+ *
+ * When created, the `Tracing` object is disabled. Calling the
+ * `tracing.enable()` method adds the categories to the set of enabled trace
+ * event categories. Calling `tracing.disable()` will remove the categories
+ * from the set of enabled trace event categories.
+ */
+ interface Tracing {
+ /**
+ * A comma-separated list of the trace event categories covered by this
+ * `Tracing` object.
+ */
+ readonly categories: string;
+ /**
+ * Disables this `Tracing` object.
+ *
+ * Only trace event categories _not_ covered by other enabled `Tracing`
+ * objects and _not_ specified by the `--trace-event-categories` flag
+ * will be disabled.
+ */
+ disable(): void;
+ /**
+ * Enables this `Tracing` object for the set of categories covered by
+ * the `Tracing` object.
+ */
+ enable(): void;
+ /**
+ * `true` only if the `Tracing` object has been enabled.
+ */
+ readonly enabled: boolean;
+ }
+ interface CreateTracingOptions {
+ /**
+ * An array of trace category names. Values included in the array are
+ * coerced to a string when possible. An error will be thrown if the
+ * value cannot be coerced.
+ */
+ categories: string[];
+ }
+ /**
+ * Creates and returns a `Tracing` object for the given set of `categories`.
+ *
+ * ```js
+ * const trace_events = require('trace_events');
+ * const categories = ['node.perf', 'node.async_hooks'];
+ * const tracing = trace_events.createTracing({ categories });
+ * tracing.enable();
+ * // do stuff
+ * tracing.disable();
+ * ```
+ * @since v10.0.0
+ * @return .
+ */
+ function createTracing(options: CreateTracingOptions): Tracing;
+ /**
+ * Returns a comma-separated list of all currently-enabled trace event
+ * categories. The current set of enabled trace event categories is determined
+ * by the _union_ of all currently-enabled `Tracing` objects and any categories
+ * enabled using the `--trace-event-categories` flag.
+ *
+ * Given the file `test.js` below, the command`node --trace-event-categories node.perf test.js` will print`'node.async_hooks,node.perf'` to the console.
+ *
+ * ```js
+ * const trace_events = require('trace_events');
+ * const t1 = trace_events.createTracing({ categories: ['node.async_hooks'] });
+ * const t2 = trace_events.createTracing({ categories: ['node.perf'] });
+ * const t3 = trace_events.createTracing({ categories: ['v8'] });
+ *
+ * t1.enable();
+ * t2.enable();
+ *
+ * console.log(trace_events.getEnabledCategories());
+ * ```
+ * @since v10.0.0
+ */
+ function getEnabledCategories(): string | undefined;
+}
+declare module "node:trace_events" {
+ export * from "trace_events";
+}
diff --git a/client/node_modules/@types/node/ts4.8/assert.d.ts b/client/node_modules/@types/node/ts4.8/assert.d.ts
new file mode 100644
index 0000000..e4a8a78
--- /dev/null
+++ b/client/node_modules/@types/node/ts4.8/assert.d.ts
@@ -0,0 +1,985 @@
+/**
+ * The `assert` module provides a set of assertion functions for verifying
+ * invariants.
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/assert.js)
+ */
+declare module "assert" {
+ /**
+ * An alias of {@link ok}.
+ * @since v0.5.9
+ * @param value The input that is checked for being truthy.
+ */
+ function assert(value: unknown, message?: string | Error): asserts value;
+ namespace assert {
+ /**
+ * Indicates the failure of an assertion. All errors thrown by the `assert` module
+ * will be instances of the `AssertionError` class.
+ */
+ class AssertionError extends Error {
+ actual: unknown;
+ expected: unknown;
+ operator: string;
+ generatedMessage: boolean;
+ code: "ERR_ASSERTION";
+ constructor(options?: {
+ /** If provided, the error message is set to this value. */
+ message?: string | undefined;
+ /** The `actual` property on the error instance. */
+ actual?: unknown | undefined;
+ /** The `expected` property on the error instance. */
+ expected?: unknown | undefined;
+ /** The `operator` property on the error instance. */
+ operator?: string | undefined;
+ /** If provided, the generated stack trace omits frames before this function. */
+ // eslint-disable-next-line @typescript-eslint/ban-types
+ stackStartFn?: Function | undefined;
+ });
+ }
+ /**
+ * This feature is currently experimental and behavior might still change.
+ * @since v14.2.0, v12.19.0
+ * @experimental
+ */
+ class CallTracker {
+ /**
+ * The wrapper function is expected to be called exactly `exact` times. If the
+ * function has not been called exactly `exact` times when `tracker.verify()` is called, then `tracker.verify()` will throw an
+ * error.
+ *
+ * ```js
+ * import assert from 'assert';
+ *
+ * // Creates call tracker.
+ * const tracker = new assert.CallTracker();
+ *
+ * function func() {}
+ *
+ * // Returns a function that wraps func() that must be called exact times
+ * // before tracker.verify().
+ * const callsfunc = tracker.calls(func);
+ * ```
+ * @since v14.2.0, v12.19.0
+ * @param [fn='A no-op function']
+ * @param [exact=1]
+ * @return that wraps `fn`.
+ */
+ calls(exact?: number): () => void;
+ 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: this, arguments: [1, 2, 3 ] }]);
+ * ```
+ *
+ * @since v18.8.0, v16.18.0
+ * @param fn
+ * @returns An Array with the calls to a tracked function.
+ */
+ getCalls(fn: Function): CallTrackerCall[];
+ /**
+ * 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.
+ *
+ * ```js
+ * import assert from 'assert';
+ *
+ * // Creates call tracker.
+ * const tracker = new assert.CallTracker();
+ *
+ * function func() {}
+ *
+ * function foo() {}
+ *
+ * // Returns a function that wraps func() that must be called exact times
+ * // before tracker.verify().
+ * const callsfunc = tracker.calls(func, 2);
+ *
+ * // Returns an array containing information on callsfunc()
+ * tracker.report();
+ * // [
+ * // {
+ * // message: 'Expected the func function to be executed 2 time(s) but was
+ * // executed 0 time(s).',
+ * // actual: 0,
+ * // expected: 2,
+ * // operator: 'func',
+ * // stack: stack trace
+ * // }
+ * // ]
+ * ```
+ * @since v14.2.0, v12.19.0
+ * @return of objects containing information about the wrapper functions returned by `calls`.
+ */
+ 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
+ * tracker.getCalls(callsfunc).length === 1;
+ *
+ * tracker.reset(callsfunc);
+ * 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
+ * have not been called the expected number of times.
+ *
+ * ```js
+ * import assert from 'assert';
+ *
+ * // Creates call tracker.
+ * const tracker = new assert.CallTracker();
+ *
+ * function func() {}
+ *
+ * // Returns a function that wraps func() that must be called exact times
+ * // before tracker.verify().
+ * const callsfunc = tracker.calls(func, 2);
+ *
+ * callsfunc();
+ *
+ * // Will throw an error since callsfunc() was only called once.
+ * tracker.verify();
+ * ```
+ * @since v14.2.0, v12.19.0
+ */
+ verify(): void;
+ }
+ interface CallTrackerCall {
+ thisArg: object;
+ arguments: unknown[];
+ }
+ interface CallTrackerReportInformation {
+ message: string;
+ /** The actual number of times the function was called. */
+ actual: number;
+ /** The number of times the function was expected to be called. */
+ expected: number;
+ /** The name of the function that is wrapped. */
+ operator: string;
+ /** A stack trace of the function. */
+ stack: object;
+ }
+ type AssertPredicate = RegExp | (new() => object) | ((thrown: unknown) => boolean) | object | Error;
+ /**
+ * Throws an `AssertionError` with the provided error message or a default
+ * error message. If the `message` parameter is an instance of an `Error` then
+ * it will be thrown instead of the `AssertionError`.
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * assert.fail();
+ * // AssertionError [ERR_ASSERTION]: Failed
+ *
+ * assert.fail('boom');
+ * // AssertionError [ERR_ASSERTION]: boom
+ *
+ * assert.fail(new TypeError('need array'));
+ * // TypeError: need array
+ * ```
+ *
+ * Using `assert.fail()` with more than two arguments is possible but deprecated.
+ * See below for further details.
+ * @since v0.1.21
+ * @param [message='Failed']
+ */
+ function fail(message?: string | Error): never;
+ /** @deprecated since v10.0.0 - use fail([message]) or other assert functions instead. */
+ function fail(
+ actual: unknown,
+ expected: unknown,
+ message?: string | Error,
+ operator?: string,
+ // eslint-disable-next-line @typescript-eslint/ban-types
+ stackStartFn?: Function,
+ ): never;
+ /**
+ * Tests if `value` is truthy. It is equivalent to`assert.equal(!!value, true, message)`.
+ *
+ * If `value` is not truthy, an `AssertionError` is thrown with a `message`property set equal to the value of the `message` parameter. If the `message`parameter is `undefined`, a default
+ * error message is assigned. If the `message`parameter is an instance of an `Error` then it will be thrown instead of the`AssertionError`.
+ * If no arguments are passed in at all `message` will be set to the string:`` 'No value argument passed to `assert.ok()`' ``.
+ *
+ * Be aware that in the `repl` the error message will be different to the one
+ * thrown in a file! See below for further details.
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * assert.ok(true);
+ * // OK
+ * assert.ok(1);
+ * // OK
+ *
+ * assert.ok();
+ * // AssertionError: No value argument passed to `assert.ok()`
+ *
+ * assert.ok(false, 'it\'s false');
+ * // AssertionError: it's false
+ *
+ * // In the repl:
+ * assert.ok(typeof 123 === 'string');
+ * // AssertionError: false == true
+ *
+ * // In a file (e.g. test.js):
+ * assert.ok(typeof 123 === 'string');
+ * // AssertionError: The expression evaluated to a falsy value:
+ * //
+ * // assert.ok(typeof 123 === 'string')
+ *
+ * assert.ok(false);
+ * // AssertionError: The expression evaluated to a falsy value:
+ * //
+ * // assert.ok(false)
+ *
+ * assert.ok(0);
+ * // AssertionError: The expression evaluated to a falsy value:
+ * //
+ * // assert.ok(0)
+ * ```
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * // Using `assert()` works the same:
+ * assert(0);
+ * // AssertionError: The expression evaluated to a falsy value:
+ * //
+ * // assert(0)
+ * ```
+ * @since v0.1.21
+ */
+ function ok(value: unknown, message?: string | Error): asserts value;
+ /**
+ * **Strict assertion mode**
+ *
+ * An alias of {@link strictEqual}.
+ *
+ * **Legacy assertion mode**
+ *
+ * > Stability: 3 - Legacy: Use {@link strictEqual} instead.
+ *
+ * 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
+ * and treated as being identical if both sides are `NaN`.
+ *
+ * ```js
+ * import assert from 'assert';
+ *
+ * assert.equal(1, 1);
+ * // OK, 1 == 1
+ * assert.equal(1, '1');
+ * // OK, 1 == '1'
+ * assert.equal(NaN, NaN);
+ * // OK
+ *
+ * assert.equal(1, 2);
+ * // AssertionError: 1 == 2
+ * assert.equal({ a: { b: 1 } }, { a: { b: 1 } });
+ * // AssertionError: { a: { b: 1 } } == { a: { b: 1 } }
+ * ```
+ *
+ * If the values are not equal, an `AssertionError` is thrown with a `message`property set equal to the value of the `message` parameter. If the `message`parameter is undefined, a default
+ * error message is assigned. If the `message`parameter is an instance of an `Error` then it will be thrown instead of the`AssertionError`.
+ * @since v0.1.21
+ */
+ function equal(actual: unknown, expected: unknown, message?: string | Error): void;
+ /**
+ * **Strict assertion mode**
+ *
+ * An alias of {@link notStrictEqual}.
+ *
+ * **Legacy assertion mode**
+ *
+ * > 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
+ * specially handled and treated as being identical if both sides are `NaN`.
+ *
+ * ```js
+ * import assert from 'assert';
+ *
+ * assert.notEqual(1, 2);
+ * // OK
+ *
+ * assert.notEqual(1, 1);
+ * // AssertionError: 1 != 1
+ *
+ * assert.notEqual(1, '1');
+ * // AssertionError: 1 != '1'
+ * ```
+ *
+ * If the values are equal, an `AssertionError` is thrown with a `message`property set equal to the value of the `message` parameter. If the `message`parameter is undefined, a default error
+ * message is assigned. If the `message`parameter is an instance of an `Error` then it will be thrown instead of the`AssertionError`.
+ * @since v0.1.21
+ */
+ function notEqual(actual: unknown, expected: unknown, message?: string | Error): void;
+ /**
+ * **Strict assertion mode**
+ *
+ * An alias of {@link deepStrictEqual}.
+ *
+ * **Legacy assertion mode**
+ *
+ * > Stability: 3 - Legacy: Use {@link deepStrictEqual} instead.
+ *
+ * Tests for deep equality between the `actual` and `expected` parameters. Consider
+ * using {@link deepStrictEqual} instead. {@link deepEqual} can have
+ * surprising results.
+ *
+ * _Deep equality_ means that the enumerable "own" properties of child objects
+ * are also recursively evaluated by the following rules.
+ * @since v0.1.21
+ */
+ function deepEqual(actual: unknown, expected: unknown, message?: string | Error): void;
+ /**
+ * **Strict assertion mode**
+ *
+ * An alias of {@link notDeepStrictEqual}.
+ *
+ * **Legacy assertion mode**
+ *
+ * > Stability: 3 - Legacy: Use {@link notDeepStrictEqual} instead.
+ *
+ * Tests for any deep inequality. Opposite of {@link deepEqual}.
+ *
+ * ```js
+ * import assert from 'assert';
+ *
+ * const obj1 = {
+ * a: {
+ * b: 1
+ * }
+ * };
+ * const obj2 = {
+ * a: {
+ * b: 2
+ * }
+ * };
+ * const obj3 = {
+ * a: {
+ * b: 1
+ * }
+ * };
+ * const obj4 = Object.create(obj1);
+ *
+ * assert.notDeepEqual(obj1, obj1);
+ * // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } }
+ *
+ * assert.notDeepEqual(obj1, obj2);
+ * // OK
+ *
+ * assert.notDeepEqual(obj1, obj3);
+ * // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } }
+ *
+ * assert.notDeepEqual(obj1, obj4);
+ * // OK
+ * ```
+ *
+ * If the values are deeply equal, an `AssertionError` is thrown with a`message` property set equal to the value of the `message` parameter. If the`message` parameter is undefined, a default
+ * error message is assigned. If the`message` parameter is an instance of an `Error` then it will be thrown
+ * instead of the `AssertionError`.
+ * @since v0.1.21
+ */
+ function notDeepEqual(actual: unknown, expected: unknown, message?: string | Error): void;
+ /**
+ * 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).
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * assert.strictEqual(1, 2);
+ * // AssertionError [ERR_ASSERTION]: Expected inputs to be strictly equal:
+ * //
+ * // 1 !== 2
+ *
+ * assert.strictEqual(1, 1);
+ * // OK
+ *
+ * assert.strictEqual('Hello foobar', 'Hello World!');
+ * // AssertionError [ERR_ASSERTION]: Expected inputs to be strictly equal:
+ * // + actual - expected
+ * //
+ * // + 'Hello foobar'
+ * // - 'Hello World!'
+ * // ^
+ *
+ * const apples = 1;
+ * const oranges = 2;
+ * assert.strictEqual(apples, oranges, `apples ${apples} !== oranges ${oranges}`);
+ * // AssertionError [ERR_ASSERTION]: apples 1 !== oranges 2
+ *
+ * assert.strictEqual(1, '1', new TypeError('Inputs are not identical'));
+ * // TypeError: Inputs are not identical
+ * ```
+ *
+ * If the values are not strictly equal, an `AssertionError` is thrown with a`message` property set equal to the value of the `message` parameter. If the`message` parameter is undefined, a
+ * default error message is assigned. If the`message` parameter is an instance of an `Error` then it will be thrown
+ * instead of the `AssertionError`.
+ * @since v0.1.21
+ */
+ function strictEqual<T>(actual: unknown, expected: T, message?: string | Error): asserts actual is T;
+ /**
+ * 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).
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * assert.notStrictEqual(1, 2);
+ * // OK
+ *
+ * assert.notStrictEqual(1, 1);
+ * // AssertionError [ERR_ASSERTION]: Expected "actual" to be strictly unequal to:
+ * //
+ * // 1
+ *
+ * assert.notStrictEqual(1, '1');
+ * // OK
+ * ```
+ *
+ * If the values are strictly equal, an `AssertionError` is thrown with a`message` property set equal to the value of the `message` parameter. If the`message` parameter is undefined, a
+ * default error message is assigned. If the`message` parameter is an instance of an `Error` then it will be thrown
+ * instead of the `AssertionError`.
+ * @since v0.1.21
+ */
+ function notStrictEqual(actual: unknown, expected: unknown, message?: string | Error): void;
+ /**
+ * Tests for deep equality between the `actual` and `expected` parameters.
+ * "Deep" equality means that the enumerable "own" properties of child objects
+ * are recursively evaluated also by the following rules.
+ * @since v1.2.0
+ */
+ function deepStrictEqual<T>(actual: unknown, expected: T, message?: string | Error): asserts actual is T;
+ /**
+ * Tests for deep strict inequality. Opposite of {@link deepStrictEqual}.
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * assert.notDeepStrictEqual({ a: 1 }, { a: '1' });
+ * // OK
+ * ```
+ *
+ * If the values are deeply and strictly equal, an `AssertionError` is thrown
+ * with a `message` property set equal to the value of the `message` parameter. If
+ * the `message` parameter is undefined, a default error message is assigned. If
+ * the `message` parameter is an instance of an `Error` then it will be thrown
+ * instead of the `AssertionError`.
+ * @since v1.2.0
+ */
+ function notDeepStrictEqual(actual: unknown, expected: unknown, message?: string | Error): void;
+ /**
+ * Expects the function `fn` to throw an error.
+ *
+ * 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), a validation function,
+ * a validation object where each property will be tested for strict deep equality,
+ * or an instance of error where each property will be tested for strict deep
+ * equality including the non-enumerable `message` and `name` properties. When
+ * using an object, it is also possible to use a regular expression, when
+ * validating against a string property. See below for examples.
+ *
+ * If specified, `message` will be appended to the message provided by the`AssertionError` if the `fn` call fails to throw or in case the error validation
+ * fails.
+ *
+ * Custom validation object/error instance:
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * const err = new TypeError('Wrong value');
+ * err.code = 404;
+ * err.foo = 'bar';
+ * err.info = {
+ * nested: true,
+ * baz: 'text'
+ * };
+ * err.reg = /abc/i;
+ *
+ * assert.throws(
+ * () => {
+ * throw err;
+ * },
+ * {
+ * name: 'TypeError',
+ * message: 'Wrong value',
+ * info: {
+ * nested: true,
+ * baz: 'text'
+ * }
+ * // Only properties on the validation object will be tested for.
+ * // Using nested objects requires all properties to be present. Otherwise
+ * // the validation is going to fail.
+ * }
+ * );
+ *
+ * // Using regular expressions to validate error properties:
+ * throws(
+ * () => {
+ * throw err;
+ * },
+ * {
+ * // The `name` and `message` properties are strings and using regular
+ * // expressions on those will match against the string. If they fail, an
+ * // error is thrown.
+ * name: /^TypeError$/,
+ * message: /Wrong/,
+ * foo: 'bar',
+ * info: {
+ * nested: true,
+ * // It is not possible to use regular expressions for nested properties!
+ * baz: 'text'
+ * },
+ * // The `reg` property contains a regular expression and only if the
+ * // validation object contains an identical regular expression, it is going
+ * // to pass.
+ * reg: /abc/i
+ * }
+ * );
+ *
+ * // Fails due to the different `message` and `name` properties:
+ * throws(
+ * () => {
+ * const otherErr = new Error('Not found');
+ * // Copy all enumerable properties from `err` to `otherErr`.
+ * for (const [key, value] of Object.entries(err)) {
+ * otherErr[key] = value;
+ * }
+ * throw otherErr;
+ * },
+ * // The error's `message` and `name` properties will also be checked when using
+ * // an error as validation object.
+ * err
+ * );
+ * ```
+ *
+ * Validate instanceof using constructor:
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * assert.throws(
+ * () => {
+ * throw new Error('Wrong value');
+ * },
+ * Error
+ * );
+ * ```
+ *
+ * Validate error message using [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions):
+ *
+ * Using a regular expression runs `.toString` on the error object, and will
+ * therefore also include the error name.
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * assert.throws(
+ * () => {
+ * throw new Error('Wrong value');
+ * },
+ * /^Error: Wrong value$/
+ * );
+ * ```
+ *
+ * Custom error validation:
+ *
+ * The function must return `true` to indicate all internal validations passed.
+ * It will otherwise fail with an `AssertionError`.
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * assert.throws(
+ * () => {
+ * throw new Error('Wrong value');
+ * },
+ * (err) => {
+ * assert(err instanceof Error);
+ * assert(/value/.test(err));
+ * // Avoid returning anything from validation functions besides `true`.
+ * // Otherwise, it's not clear what part of the validation failed. Instead,
+ * // throw an error about the specific validation that failed (as done in this
+ * // example) and add as much helpful debugging information to that error as
+ * // possible.
+ * return true;
+ * },
+ * 'unexpected error'
+ * );
+ * ```
+ *
+ * `error` cannot be a string. If a string is provided as the second
+ * argument, then `error` is assumed to be omitted and the string will be used for`message` instead. This can lead to easy-to-miss mistakes. Using the same
+ * message as the thrown error message is going to result in an`ERR_AMBIGUOUS_ARGUMENT` error. Please read the example below carefully if using
+ * a string as the second argument gets considered:
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * function throwingFirst() {
+ * throw new Error('First');
+ * }
+ *
+ * function throwingSecond() {
+ * throw new Error('Second');
+ * }
+ *
+ * function notThrowing() {}
+ *
+ * // The second argument is a string and the input function threw an Error.
+ * // The first case will not throw as it does not match for the error message
+ * // thrown by the input function!
+ * assert.throws(throwingFirst, 'Second');
+ * // In the next example the message has no benefit over the message from the
+ * // error and since it is not clear if the user intended to actually match
+ * // against the error message, Node.js throws an `ERR_AMBIGUOUS_ARGUMENT` error.
+ * assert.throws(throwingSecond, 'Second');
+ * // TypeError [ERR_AMBIGUOUS_ARGUMENT]
+ *
+ * // The string is only used (as message) in case the function does not throw:
+ * assert.throws(notThrowing, 'Second');
+ * // AssertionError [ERR_ASSERTION]: Missing expected exception: Second
+ *
+ * // If it was intended to match for the error message do this instead:
+ * // It does not throw because the error messages match.
+ * assert.throws(throwingSecond, /Second$/);
+ *
+ * // If the error message does not match, an AssertionError is thrown.
+ * assert.throws(throwingFirst, /Second$/);
+ * // AssertionError [ERR_ASSERTION]
+ * ```
+ *
+ * Due to the confusing error-prone notation, avoid a string as the second
+ * argument.
+ * @since v0.1.21
+ */
+ function throws(block: () => unknown, message?: string | Error): void;
+ function throws(block: () => unknown, error: AssertPredicate, message?: string | Error): void;
+ /**
+ * Asserts that the function `fn` does not throw an error.
+ *
+ * Using `assert.doesNotThrow()` is actually not useful because there
+ * is no benefit in catching an error and then rethrowing it. Instead, consider
+ * adding a comment next to the specific code path that should not throw and keep
+ * error messages as expressive as possible.
+ *
+ * When `assert.doesNotThrow()` is called, it will immediately call the `fn`function.
+ *
+ * If an error is thrown and it is the same type as that specified by the `error`parameter, then an `AssertionError` is thrown. If the error is of a
+ * different type, or if the `error` parameter is undefined, the error is
+ * propagated back to the caller.
+ *
+ * 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
+ * function. See {@link throws} for more details.
+ *
+ * The following, for instance, will throw the `TypeError` because there is no
+ * matching error type in the assertion:
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * assert.doesNotThrow(
+ * () => {
+ * throw new TypeError('Wrong value');
+ * },
+ * SyntaxError
+ * );
+ * ```
+ *
+ * However, the following will result in an `AssertionError` with the message
+ * 'Got unwanted exception...':
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * assert.doesNotThrow(
+ * () => {
+ * throw new TypeError('Wrong value');
+ * },
+ * 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:
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * assert.doesNotThrow(
+ * () => {
+ * throw new TypeError('Wrong value');
+ * },
+ * /Wrong value/,
+ * 'Whoops'
+ * );
+ * // Throws: AssertionError: Got unwanted exception: Whoops
+ * ```
+ * @since v0.1.21
+ */
+ function doesNotThrow(block: () => unknown, message?: string | Error): void;
+ function doesNotThrow(block: () => unknown, error: AssertPredicate, message?: string | Error): void;
+ /**
+ * Throws `value` if `value` is not `undefined` or `null`. This is useful when
+ * testing the `error` argument in callbacks. The stack trace contains all frames
+ * from the error passed to `ifError()` including the potential new frames for`ifError()` itself.
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * assert.ifError(null);
+ * // OK
+ * assert.ifError(0);
+ * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: 0
+ * assert.ifError('error');
+ * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: 'error'
+ * assert.ifError(new Error());
+ * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: Error
+ *
+ * // Create some random error frames.
+ * let err;
+ * (function errorFrame() {
+ * err = new Error('test error');
+ * })();
+ *
+ * (function ifErrorFrame() {
+ * assert.ifError(err);
+ * })();
+ * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: test error
+ * // at ifErrorFrame
+ * // at errorFrame
+ * ```
+ * @since v0.1.97
+ */
+ function ifError(value: unknown): asserts value is null | undefined;
+ /**
+ * Awaits the `asyncFn` promise or, if `asyncFn` is a function, immediately
+ * calls the function and awaits the returned promise to complete. It will then
+ * check that the promise is rejected.
+ *
+ * If `asyncFn` is a function and it throws an error synchronously,`assert.rejects()` will return a rejected `Promise` with that error. If the
+ * function does not return a promise, `assert.rejects()` will return a rejected`Promise` with an `ERR_INVALID_RETURN_VALUE` error. In both cases the error
+ * handler is skipped.
+ *
+ * Besides the async nature to await the completion behaves identically to {@link throws}.
+ *
+ * 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), a validation function,
+ * an object where each property will be tested for, or an instance of error where
+ * each property will be tested for including the non-enumerable `message` and`name` properties.
+ *
+ * If specified, `message` will be the message provided by the `AssertionError` if the `asyncFn` fails to reject.
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * await assert.rejects(
+ * async () => {
+ * throw new TypeError('Wrong value');
+ * },
+ * {
+ * name: 'TypeError',
+ * message: 'Wrong value'
+ * }
+ * );
+ * ```
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * await assert.rejects(
+ * async () => {
+ * throw new TypeError('Wrong value');
+ * },
+ * (err) => {
+ * assert.strictEqual(err.name, 'TypeError');
+ * assert.strictEqual(err.message, 'Wrong value');
+ * return true;
+ * }
+ * );
+ * ```
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * assert.rejects(
+ * Promise.reject(new Error('Wrong value')),
+ * Error
+ * ).then(() => {
+ * // ...
+ * });
+ * ```
+ *
+ * `error` cannot be a string. If a string is provided as the second
+ * argument, then `error` is assumed to be omitted and the string will be used for`message` instead. This can lead to easy-to-miss mistakes. Please read the
+ * example in {@link throws} carefully if using a string as the second
+ * argument gets considered.
+ * @since v10.0.0
+ */
+ function rejects(block: (() => Promise<unknown>) | Promise<unknown>, message?: string | Error): Promise<void>;
+ function rejects(
+ block: (() => Promise<unknown>) | Promise<unknown>,
+ error: AssertPredicate,
+ message?: string | Error,
+ ): Promise<void>;
+ /**
+ * Awaits the `asyncFn` promise or, if `asyncFn` is a function, immediately
+ * calls the function and awaits the returned promise to complete. It will then
+ * check that the promise is not rejected.
+ *
+ * If `asyncFn` is a function and it throws an error synchronously,`assert.doesNotReject()` will return a rejected `Promise` with that error. If
+ * the function does not return a promise, `assert.doesNotReject()` will return a
+ * rejected `Promise` with an `ERR_INVALID_RETURN_VALUE` error. In both cases
+ * the error handler is skipped.
+ *
+ * Using `assert.doesNotReject()` is actually not useful because there is little
+ * benefit in catching a rejection and then rejecting it again. Instead, consider
+ * adding a comment next to the specific code path that should not reject and keep
+ * error messages as expressive as possible.
+ *
+ * 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
+ * function. See {@link throws} for more details.
+ *
+ * Besides the async nature to await the completion behaves identically to {@link doesNotThrow}.
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * await assert.doesNotReject(
+ * async () => {
+ * throw new TypeError('Wrong value');
+ * },
+ * SyntaxError
+ * );
+ * ```
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * assert.doesNotReject(Promise.reject(new TypeError('Wrong value')))
+ * .then(() => {
+ * // ...
+ * });
+ * ```
+ * @since v10.0.0
+ */
+ function doesNotReject(
+ block: (() => Promise<unknown>) | Promise<unknown>,
+ 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.
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * assert.match('I will fail', /pass/);
+ * // AssertionError [ERR_ASSERTION]: The input did not match the regular ...
+ *
+ * assert.match(123, /pass/);
+ * // AssertionError [ERR_ASSERTION]: The "string" argument must be of type string.
+ *
+ * assert.match('I will pass', /pass/);
+ * // OK
+ * ```
+ *
+ * If the values do not match, or if the `string` argument is of another type than`string`, an `AssertionError` is thrown with a `message` property set equal
+ * to the value of the `message` parameter. If the `message` parameter is
+ * undefined, a default error message is assigned. If the `message` parameter is an
+ * instance of an `Error` then it will be thrown instead of the `AssertionError`.
+ * @since v13.6.0, v12.16.0
+ */
+ function match(value: string, regExp: RegExp, message?: string | Error): void;
+ /**
+ * Expects the `string` input not to match the regular expression.
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * assert.doesNotMatch('I will fail', /fail/);
+ * // AssertionError [ERR_ASSERTION]: The input was expected to not match the ...
+ *
+ * assert.doesNotMatch(123, /pass/);
+ * // AssertionError [ERR_ASSERTION]: The "string" argument must be of type string.
+ *
+ * assert.doesNotMatch('I will pass', /different/);
+ * // OK
+ * ```
+ *
+ * If the values do match, or if the `string` argument is of another type than`string`, an `AssertionError` is thrown with a `message` property set equal
+ * to the value of the `message` parameter. If the `message` parameter is
+ * undefined, a default error message is assigned. If the `message` parameter is an
+ * instance of an `Error` then it will be thrown instead of the `AssertionError`.
+ * @since v13.6.0, v12.16.0
+ */
+ function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void;
+ const strict:
+ & Omit<
+ typeof assert,
+ | "equal"
+ | "notEqual"
+ | "deepEqual"
+ | "notDeepEqual"
+ | "ok"
+ | "strictEqual"
+ | "deepStrictEqual"
+ | "ifError"
+ | "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;
+}
+declare module "node:assert" {
+ import assert = require("assert");
+ export = assert;
+}
diff --git a/client/node_modules/@types/node/ts4.8/assert/strict.d.ts b/client/node_modules/@types/node/ts4.8/assert/strict.d.ts
new file mode 100644
index 0000000..f333913
--- /dev/null
+++ b/client/node_modules/@types/node/ts4.8/assert/strict.d.ts
@@ -0,0 +1,8 @@
+declare module "assert/strict" {
+ import { strict } from "node:assert";
+ export = strict;
+}
+declare module "node:assert/strict" {
+ import { strict } from "node:assert";
+ export = strict;
+}
diff --git a/client/node_modules/@types/node/ts4.8/async_hooks.d.ts b/client/node_modules/@types/node/ts4.8/async_hooks.d.ts
new file mode 100644
index 0000000..1ae6885
--- /dev/null
+++ b/client/node_modules/@types/node/ts4.8/async_hooks.d.ts
@@ -0,0 +1,522 @@
+/**
+ * The `async_hooks` module provides an API to track asynchronous resources. It
+ * can be accessed using:
+ *
+ * ```js
+ * import async_hooks from 'async_hooks';
+ * ```
+ * @experimental
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/async_hooks.js)
+ */
+declare module "async_hooks" {
+ /**
+ * ```js
+ * import { executionAsyncId } from 'async_hooks';
+ *
+ * console.log(executionAsyncId()); // 1 - bootstrap
+ * fs.open(path, 'r', (err, fd) => {
+ * console.log(executionAsyncId()); // 6 - open()
+ * });
+ * ```
+ *
+ * The ID returned from `executionAsyncId()` is related to execution timing, not
+ * causality (which is covered by `triggerAsyncId()`):
+ *
+ * ```js
+ * const server = net.createServer((conn) => {
+ * // Returns the ID of the server, not of the new connection, because the
+ * // callback runs in the execution scope of the server's MakeCallback().
+ * async_hooks.executionAsyncId();
+ *
+ * }).listen(port, () => {
+ * // Returns the ID of a TickObject (process.nextTick()) because all
+ * // callbacks passed to .listen() are wrapped in a nextTick().
+ * async_hooks.executionAsyncId();
+ * });
+ * ```
+ *
+ * Promise contexts may not get precise `executionAsyncIds` by default.
+ * See the section on `promise execution tracking`.
+ * @since v8.1.0
+ * @return The `asyncId` of the current execution context. Useful to track when something calls.
+ */
+ function executionAsyncId(): number;
+ /**
+ * Resource objects returned by `executionAsyncResource()` are most often internal
+ * Node.js handle objects with undocumented APIs. Using any functions or properties
+ * on the object is likely to crash your application and should be avoided.
+ *
+ * Using `executionAsyncResource()` in the top-level execution context will
+ * return an empty object as there is no handle or request object to use,
+ * but having an object representing the top-level can be helpful.
+ *
+ * ```js
+ * import { open } from 'fs';
+ * import { executionAsyncId, executionAsyncResource } from 'async_hooks';
+ *
+ * console.log(executionAsyncId(), executionAsyncResource()); // 1 {}
+ * open(new URL(import.meta.url), 'r', (err, fd) => {
+ * console.log(executionAsyncId(), executionAsyncResource()); // 7 FSReqWrap
+ * });
+ * ```
+ *
+ * This can be used to implement continuation local storage without the
+ * use of a tracking `Map` to store the metadata:
+ *
+ * ```js
+ * import { createServer } from 'http';
+ * import {
+ * executionAsyncId,
+ * executionAsyncResource,
+ * createHook
+ * } from 'async_hooks';
+ * const sym = Symbol('state'); // Private symbol to avoid pollution
+ *
+ * createHook({
+ * init(asyncId, type, triggerAsyncId, resource) {
+ * const cr = executionAsyncResource();
+ * if (cr) {
+ * resource[sym] = cr[sym];
+ * }
+ * }
+ * }).enable();
+ *
+ * const server = createServer((req, res) => {
+ * executionAsyncResource()[sym] = { state: req.url };
+ * setTimeout(function() {
+ * res.end(JSON.stringify(executionAsyncResource()[sym]));
+ * }, 100);
+ * }).listen(3000);
+ * ```
+ * @since v13.9.0, v12.17.0
+ * @return The resource representing the current execution. Useful to store data within the resource.
+ */
+ function executionAsyncResource(): object;
+ /**
+ * ```js
+ * const server = net.createServer((conn) => {
+ * // The resource that caused (or triggered) this callback to be called
+ * // was that of the new connection. Thus the return value of triggerAsyncId()
+ * // is the asyncId of "conn".
+ * async_hooks.triggerAsyncId();
+ *
+ * }).listen(port, () => {
+ * // Even though all callbacks passed to .listen() are wrapped in a nextTick()
+ * // the callback itself exists because the call to the server's .listen()
+ * // was made. So the return value would be the ID of the server.
+ * async_hooks.triggerAsyncId();
+ * });
+ * ```
+ *
+ * Promise contexts may not get valid `triggerAsyncId`s by default. See
+ * the section on `promise execution tracking`.
+ * @return The ID of the resource responsible for calling the callback that is currently being executed.
+ */
+ function triggerAsyncId(): number;
+ interface HookCallbacks {
+ /**
+ * Called when a class is constructed that has the possibility to emit an asynchronous event.
+ * @param asyncId a unique ID for the async resource
+ * @param type the type of the async resource
+ * @param triggerAsyncId the unique ID of the async resource in whose execution context this async resource was created
+ * @param resource reference to the resource representing the async operation, needs to be released during destroy
+ */
+ init?(asyncId: number, type: string, triggerAsyncId: number, resource: object): void;
+ /**
+ * When an asynchronous operation is initiated or completes a callback is called to notify the user.
+ * The before callback is called just before said callback is executed.
+ * @param asyncId the unique identifier assigned to the resource about to execute the callback.
+ */
+ before?(asyncId: number): void;
+ /**
+ * Called immediately after the callback specified in before is completed.
+ * @param asyncId the unique identifier assigned to the resource which has executed the callback.
+ */
+ after?(asyncId: number): void;
+ /**
+ * Called when a promise has resolve() called. This may not be in the same execution id
+ * as the promise itself.
+ * @param asyncId the unique id for the promise that was resolve()d.
+ */
+ promiseResolve?(asyncId: number): void;
+ /**
+ * Called after the resource corresponding to asyncId is destroyed
+ * @param asyncId a unique ID for the async resource
+ */
+ destroy?(asyncId: number): void;
+ }
+ interface AsyncHook {
+ /**
+ * Enable the callbacks for a given AsyncHook instance. If no callbacks are provided enabling is a noop.
+ */
+ enable(): this;
+ /**
+ * Disable the callbacks for a given AsyncHook instance from the global pool of AsyncHook callbacks to be executed. Once a hook has been disabled it will not be called again until enabled.
+ */
+ disable(): this;
+ }
+ /**
+ * Registers functions to be called for different lifetime events of each async
+ * operation.
+ *
+ * The callbacks `init()`/`before()`/`after()`/`destroy()` are called for the
+ * respective asynchronous event during a resource's lifetime.
+ *
+ * All callbacks are optional. For example, if only resource cleanup needs to
+ * be tracked, then only the `destroy` callback needs to be passed. The
+ * specifics of all functions that can be passed to `callbacks` is in the `Hook Callbacks` section.
+ *
+ * ```js
+ * import { createHook } from 'async_hooks';
+ *
+ * const asyncHook = createHook({
+ * init(asyncId, type, triggerAsyncId, resource) { },
+ * destroy(asyncId) { }
+ * });
+ * ```
+ *
+ * The callbacks will be inherited via the prototype chain:
+ *
+ * ```js
+ * class MyAsyncCallbacks {
+ * init(asyncId, type, triggerAsyncId, resource) { }
+ * destroy(asyncId) {}
+ * }
+ *
+ * class MyAddedCallbacks extends MyAsyncCallbacks {
+ * before(asyncId) { }
+ * after(asyncId) { }
+ * }
+ *
+ * const asyncHook = async_hooks.createHook(new MyAddedCallbacks());
+ * ```
+ *
+ * Because promises are asynchronous resources whose lifecycle is tracked
+ * via the async hooks mechanism, the `init()`, `before()`, `after()`, and`destroy()` callbacks _must not_ be async functions that return promises.
+ * @since v8.1.0
+ * @param callbacks The `Hook Callbacks` to register
+ * @return Instance used for disabling and enabling hooks
+ */
+ function createHook(callbacks: HookCallbacks): AsyncHook;
+ interface AsyncResourceOptions {
+ /**
+ * The ID of the execution context that created this async event.
+ * @default executionAsyncId()
+ */
+ triggerAsyncId?: number | undefined;
+ /**
+ * Disables automatic `emitDestroy` when the object is garbage collected.
+ * This usually does not need to be set (even if `emitDestroy` is called
+ * manually), unless the resource's `asyncId` is retrieved and the
+ * sensitive API's `emitDestroy` is called with it.
+ * @default false
+ */
+ requireManualDestroy?: boolean | undefined;
+ }
+ /**
+ * The class `AsyncResource` is designed to be extended by the embedder's async
+ * resources. Using this, users can easily trigger the lifetime events of their
+ * own resources.
+ *
+ * The `init` hook will trigger when an `AsyncResource` is instantiated.
+ *
+ * The following is an overview of the `AsyncResource` API.
+ *
+ * ```js
+ * import { AsyncResource, executionAsyncId } from 'async_hooks';
+ *
+ * // AsyncResource() is meant to be extended. Instantiating a
+ * // new AsyncResource() also triggers init. If triggerAsyncId is omitted then
+ * // async_hook.executionAsyncId() is used.
+ * const asyncResource = new AsyncResource(
+ * type, { triggerAsyncId: executionAsyncId(), requireManualDestroy: false }
+ * );
+ *
+ * // Run a function in the execution context of the resource. This will
+ * // * establish the context of the resource
+ * // * trigger the AsyncHooks before callbacks
+ * // * call the provided function `fn` with the supplied arguments
+ * // * trigger the AsyncHooks after callbacks
+ * // * restore the original execution context
+ * asyncResource.runInAsyncScope(fn, thisArg, ...args);
+ *
+ * // Call AsyncHooks destroy callbacks.
+ * asyncResource.emitDestroy();
+ *
+ * // Return the unique ID assigned to the AsyncResource instance.
+ * asyncResource.asyncId();
+ *
+ * // Return the trigger ID for the AsyncResource instance.
+ * asyncResource.triggerAsyncId();
+ * ```
+ */
+ class AsyncResource {
+ /**
+ * AsyncResource() is meant to be extended. Instantiating a
+ * new AsyncResource() also triggers init. If triggerAsyncId is omitted then
+ * async_hook.executionAsyncId() is used.
+ * @param type The type of async event.
+ * @param triggerAsyncId The ID of the execution context that created
+ * this async event (default: `executionAsyncId()`), or an
+ * AsyncResourceOptions object (since v9.3.0)
+ */
+ constructor(type: string, triggerAsyncId?: number | AsyncResourceOptions);
+ /**
+ * 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
+ * @param fn The function to bind to the current execution context.
+ * @param type An optional name to associate with the underlying `AsyncResource`.
+ */
+ static bind<Func extends (this: ThisArg, ...args: any[]) => any, ThisArg>(
+ fn: Func,
+ type?: string,
+ thisArg?: ThisArg,
+ ): Func & {
+ asyncResource: AsyncResource;
+ };
+ /**
+ * 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
+ * @param fn The function to bind to the current `AsyncResource`.
+ */
+ bind<Func extends (...args: any[]) => any>(
+ fn: Func,
+ ): Func & {
+ asyncResource: AsyncResource;
+ };
+ /**
+ * Call the provided function with the provided arguments in the execution context
+ * of the async resource. This will establish the context, trigger the AsyncHooks
+ * before callbacks, call the function, trigger the AsyncHooks after callbacks, and
+ * then restore the original execution context.
+ * @since v9.6.0
+ * @param fn The function to call in the execution context of this async resource.
+ * @param thisArg The receiver to be used for the function call.
+ * @param args Optional arguments to pass to the function.
+ */
+ runInAsyncScope<This, 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
+ * 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.
+ * @return A reference to `asyncResource`.
+ */
+ emitDestroy(): this;
+ /**
+ * @return The unique `asyncId` assigned to the resource.
+ */
+ asyncId(): number;
+ /**
+ * @return The same `triggerAsyncId` that is passed to the `AsyncResource` constructor.
+ */
+ triggerAsyncId(): number;
+ }
+ /**
+ * This class creates stores that stay coherent through asynchronous operations.
+ *
+ * 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
+ * implementation that involves significant optimizations that are non-obvious to
+ * implement.
+ *
+ * The following example uses `AsyncLocalStorage` to build a simple logger
+ * that assigns IDs to incoming HTTP requests and includes them in messages
+ * logged within each request.
+ *
+ * ```js
+ * import http from 'http';
+ * import { AsyncLocalStorage } from 'async_hooks';
+ *
+ * const asyncLocalStorage = new AsyncLocalStorage();
+ *
+ * function logWithId(msg) {
+ * const id = asyncLocalStorage.getStore();
+ * console.log(`${id !== undefined ? id : '-'}:`, msg);
+ * }
+ *
+ * let idSeq = 0;
+ * http.createServer((req, res) => {
+ * asyncLocalStorage.run(idSeq++, () => {
+ * logWithId('start');
+ * // Imagine any chain of async operations here
+ * setImmediate(() => {
+ * logWithId('finish');
+ * res.end();
+ * });
+ * });
+ * }).listen(8080);
+ *
+ * http.get('http://localhost:8080');
+ * http.get('http://localhost:8080');
+ * // Prints:
+ * // 0: start
+ * // 1: start
+ * // 0: finish
+ * // 1: finish
+ * ```
+ *
+ * Each instance of `AsyncLocalStorage` maintains an independent storage context.
+ * Multiple instances can safely exist simultaneously without risk of interfering
+ * with each other's data.
+ * @since v13.10.0, v12.17.0
+ */
+ class AsyncLocalStorage<T> {
+ /**
+ * Binds the given function to the current execution context.
+ * @since v18.16.0
+ * @param fn The function to bind to the current execution context.
+ * @returns A new function that calls `fn` within the captured execution context.
+ */
+ static bind<Func extends (...args: any[]) => any>(fn: Func): Func & {
+ asyncResource: AsyncResource;
+ };
+ /**
+ * 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.
+ * @since v18.16.0
+ */
+ static snapshot(): (<R, TArgs extends any[]>(fn: (...args: TArgs) => R, ...args: TArgs) => R) & {
+ asyncResource: AsyncResource;
+ };
+ /**
+ * Disables the instance of `AsyncLocalStorage`. All subsequent calls
+ * to `asyncLocalStorage.getStore()` will return `undefined` until`asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()` is called again.
+ *
+ * When calling `asyncLocalStorage.disable()`, all current contexts linked to the
+ * instance will be exited.
+ *
+ * Calling `asyncLocalStorage.disable()` is required before the`asyncLocalStorage` can be garbage collected. This does not apply to stores
+ * provided by the `asyncLocalStorage`, as those objects are garbage collected
+ * along with the corresponding async resources.
+ *
+ * Use this method when the `asyncLocalStorage` is not in use anymore
+ * in the current process.
+ * @since v13.10.0, v12.17.0
+ * @experimental
+ */
+ disable(): void;
+ /**
+ * Returns the current store.
+ * If called outside of an asynchronous context initialized by
+ * calling `asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()`, it
+ * returns `undefined`.
+ * @since v13.10.0, v12.17.0
+ */
+ getStore(): T | undefined;
+ /**
+ * Runs a function synchronously within a context and returns its
+ * return value. The store is not accessible outside of the callback function.
+ * The store is accessible to any asynchronous operations created within the
+ * callback.
+ *
+ * The optional `args` are passed to the callback function.
+ *
+ * If the callback function throws an error, the error is thrown by `run()` too.
+ * The stacktrace is not impacted by this call and the context is exited.
+ *
+ * Example:
+ *
+ * ```js
+ * const store = { id: 2 };
+ * try {
+ * asyncLocalStorage.run(store, () => {
+ * asyncLocalStorage.getStore(); // Returns the store object
+ * setTimeout(() => {
+ * asyncLocalStorage.getStore(); // Returns the store object
+ * }, 200);
+ * throw new Error();
+ * });
+ * } catch (e) {
+ * asyncLocalStorage.getStore(); // Returns undefined
+ * // The error will be caught here
+ * }
+ * ```
+ * @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;
+ /**
+ * Runs a function synchronously outside of a context and returns its
+ * return value. The store is not accessible within the callback function or
+ * the asynchronous operations created within the callback. Any `getStore()`call done within the callback function will always return `undefined`.
+ *
+ * The optional `args` are passed to the callback function.
+ *
+ * If the callback function throws an error, the error is thrown by `exit()` too.
+ * The stacktrace is not impacted by this call and the context is re-entered.
+ *
+ * Example:
+ *
+ * ```js
+ * // Within a call to run
+ * try {
+ * asyncLocalStorage.getStore(); // Returns the store object or value
+ * asyncLocalStorage.exit(() => {
+ * asyncLocalStorage.getStore(); // Returns undefined
+ * throw new Error();
+ * });
+ * } catch (e) {
+ * asyncLocalStorage.getStore(); // Returns the same object or value
+ * // The error will be caught here
+ * }
+ * ```
+ * @since v13.10.0, v12.17.0
+ * @experimental
+ */
+ exit<R, TArgs extends any[]>(callback: (...args: TArgs) => R, ...args: TArgs): R;
+ /**
+ * Transitions into the context for the remainder of the current
+ * synchronous execution and then persists the store through any following
+ * asynchronous calls.
+ *
+ * Example:
+ *
+ * ```js
+ * const store = { id: 1 };
+ * // Replaces previous store with the given store object
+ * asyncLocalStorage.enterWith(store);
+ * asyncLocalStorage.getStore(); // Returns the store object
+ * someAsyncOperation(() => {
+ * asyncLocalStorage.getStore(); // Returns the same object
+ * });
+ * ```
+ *
+ * This transition will continue for the _entire_ synchronous execution.
+ * This means that if, for example, the context is entered within an event
+ * handler subsequent event handlers will also run within that context unless
+ * specifically bound to another context with an `AsyncResource`. That is why`run()` should be preferred over `enterWith()` unless there are strong reasons
+ * to use the latter method.
+ *
+ * ```js
+ * const store = { id: 1 };
+ *
+ * emitter.on('my-event', () => {
+ * asyncLocalStorage.enterWith(store);
+ * });
+ * emitter.on('my-event', () => {
+ * asyncLocalStorage.getStore(); // Returns the same object
+ * });
+ *
+ * asyncLocalStorage.getStore(); // Returns undefined
+ * emitter.emit('my-event');
+ * asyncLocalStorage.getStore(); // Returns the same object
+ * ```
+ * @since v13.11.0, v12.17.0
+ * @experimental
+ */
+ enterWith(store: T): void;
+ }
+}
+declare module "node:async_hooks" {
+ export * from "async_hooks";
+}
diff --git a/client/node_modules/@types/node/ts4.8/buffer.d.ts b/client/node_modules/@types/node/ts4.8/buffer.d.ts
new file mode 100644
index 0000000..cfc1f39
--- /dev/null
+++ b/client/node_modules/@types/node/ts4.8/buffer.d.ts
@@ -0,0 +1,2321 @@
+/**
+ * `Buffer` objects are used to represent a fixed-length sequence of bytes. Many
+ * Node.js APIs support `Buffer`s.
+ *
+ * The `Buffer` class is a subclass of JavaScript's [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) class and
+ * extends it with methods that cover additional use cases. Node.js APIs accept
+ * plain [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) s wherever `Buffer`s are supported as well.
+ *
+ * While the `Buffer` class is available within the global scope, it is still
+ * recommended to explicitly reference it via an import or require statement.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * // Creates a zero-filled Buffer of length 10.
+ * const buf1 = Buffer.alloc(10);
+ *
+ * // Creates a Buffer of length 10,
+ * // filled with bytes which all have the value `1`.
+ * const buf2 = Buffer.alloc(10, 1);
+ *
+ * // Creates an uninitialized buffer of length 10.
+ * // This is faster than calling Buffer.alloc() but the returned
+ * // Buffer instance might contain old data that needs to be
+ * // overwritten using fill(), write(), or other functions that fill the Buffer's
+ * // contents.
+ * const buf3 = Buffer.allocUnsafe(10);
+ *
+ * // Creates a Buffer containing the bytes [1, 2, 3].
+ * const buf4 = Buffer.from([1, 2, 3]);
+ *
+ * // Creates a Buffer containing the bytes [1, 1, 1, 1] – the entries
+ * // are all truncated using `(value &#x26; 255)` to fit into the range 0–255.
+ * const buf5 = Buffer.from([257, 257.5, -255, '1']);
+ *
+ * // Creates a Buffer containing the UTF-8-encoded bytes for the string 'tést':
+ * // [0x74, 0xc3, 0xa9, 0x73, 0x74] (in hexadecimal notation)
+ * // [116, 195, 169, 115, 116] (in decimal notation)
+ * const buf6 = Buffer.from('tést');
+ *
+ * // Creates a Buffer containing the Latin-1 bytes [0x74, 0xe9, 0x73, 0x74].
+ * const buf7 = Buffer.from('tést', 'latin1');
+ * ```
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/buffer.js)
+ */
+declare module "buffer" {
+ import { BinaryLike } from "node:crypto";
+ import { ReadableStream as WebReadableStream } from "node:stream/web";
+ export function isUtf8(input: Buffer | ArrayBuffer | NodeJS.TypedArray): boolean;
+ export function isAscii(input: Buffer | ArrayBuffer | NodeJS.TypedArray): boolean;
+ export const INSPECT_MAX_BYTES: number;
+ export const kMaxLength: number;
+ export const kStringMaxLength: number;
+ export const constants: {
+ MAX_LENGTH: number;
+ MAX_STRING_LENGTH: number;
+ };
+ export type TranscodeEncoding = "ascii" | "utf8" | "utf16le" | "ucs2" | "latin1" | "binary";
+ /**
+ * Re-encodes the given `Buffer` or `Uint8Array` instance from one character
+ * encoding to another. Returns a new `Buffer` instance.
+ *
+ * Throws if the `fromEnc` or `toEnc` specify invalid character encodings or if
+ * conversion from `fromEnc` to `toEnc` is not permitted.
+ *
+ * Encodings supported by `buffer.transcode()` are: `'ascii'`, `'utf8'`,`'utf16le'`, `'ucs2'`, `'latin1'`, and `'binary'`.
+ *
+ * The transcoding process will use substitution characters if a given byte
+ * sequence cannot be adequately represented in the target encoding. For instance:
+ *
+ * ```js
+ * import { Buffer, transcode } from 'buffer';
+ *
+ * const newBuf = transcode(Buffer.from('€'), 'utf8', 'ascii');
+ * console.log(newBuf.toString('ascii'));
+ * // Prints: '?'
+ * ```
+ *
+ * Because the Euro (`€`) sign is not representable in US-ASCII, it is replaced
+ * with `?` in the transcoded `Buffer`.
+ * @since v7.1.0
+ * @param source A `Buffer` or `Uint8Array` instance.
+ * @param fromEnc The current encoding.
+ * @param toEnc To target encoding.
+ */
+ export function transcode(source: Uint8Array, fromEnc: TranscodeEncoding, toEnc: TranscodeEncoding): Buffer;
+ export const SlowBuffer: {
+ /** @deprecated since v6.0.0, use `Buffer.allocUnsafeSlow()` */
+ new(size: number): Buffer;
+ prototype: Buffer;
+ };
+ /**
+ * Resolves a `'blob:nodedata:...'` an associated `Blob` object registered using
+ * a prior call to `URL.createObjectURL()`.
+ * @since v16.7.0
+ * @experimental
+ * @param id A `'blob:nodedata:...` URL string returned by a prior call to `URL.createObjectURL()`.
+ */
+ export function resolveObjectURL(id: string): Blob | undefined;
+ export { Buffer };
+ /**
+ * @experimental
+ */
+ export interface BlobOptions {
+ /**
+ * @default 'utf8'
+ */
+ encoding?: BufferEncoding | undefined;
+ /**
+ * The Blob content-type. The intent is for `type` to convey
+ * the MIME media type of the data, however no validation of the type format
+ * is performed.
+ */
+ type?: string | undefined;
+ }
+ /**
+ * A [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) encapsulates immutable, raw data that can be safely shared across
+ * multiple worker threads.
+ * @since v15.7.0, v14.18.0
+ */
+ export class Blob {
+ /**
+ * The total size of the `Blob` in bytes.
+ * @since v15.7.0, v14.18.0
+ */
+ readonly size: number;
+ /**
+ * The content-type of the `Blob`.
+ * @since v15.7.0, v14.18.0
+ */
+ readonly type: string;
+ /**
+ * Creates a new `Blob` object containing a concatenation of the given sources.
+ *
+ * {ArrayBuffer}, {TypedArray}, {DataView}, and {Buffer} sources are copied into
+ * the 'Blob' and can therefore be safely modified after the 'Blob' is created.
+ *
+ * String sources are also copied into the `Blob`.
+ */
+ constructor(sources: Array<BinaryLike | Blob>, options?: BlobOptions);
+ /**
+ * Returns a promise that fulfills with an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) containing a copy of
+ * the `Blob` data.
+ * @since v15.7.0, v14.18.0
+ */
+ arrayBuffer(): Promise<ArrayBuffer>;
+ /**
+ * Creates and returns a new `Blob` containing a subset of this `Blob` objects
+ * data. The original `Blob` is not altered.
+ * @since v15.7.0, v14.18.0
+ * @param start The starting index.
+ * @param end The ending index.
+ * @param type The content-type for the new `Blob`
+ */
+ slice(start?: number, end?: number, type?: string): Blob;
+ /**
+ * Returns a promise that fulfills with the contents of the `Blob` decoded as a
+ * UTF-8 string.
+ * @since v15.7.0, v14.18.0
+ */
+ text(): Promise<string>;
+ /**
+ * Returns a new (WHATWG) `ReadableStream` that allows the content of the `Blob` to be read.
+ * @since v16.7.0
+ */
+ stream(): WebReadableStream;
+ }
+ export interface FileOptions {
+ /**
+ * One of either `'transparent'` or `'native'`. When set to `'native'`, line endings in string source parts will be
+ * converted to the platform native line-ending as specified by `require('node:os').EOL`.
+ */
+ endings?: "native" | "transparent";
+ /** The File content-type. */
+ type?: string;
+ /** The last modified date of the file. `Default`: Date.now(). */
+ lastModified?: number;
+ }
+ /**
+ * A [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File) provides information about files.
+ * @experimental
+ * @since v18.13.0
+ */
+ export class File extends Blob {
+ constructor(sources: Array<BinaryLike | Blob>, fileName: string, options?: FileOptions);
+ /**
+ * The name of the `File`.
+ * @since v18.13.0
+ */
+ readonly name: string;
+ /**
+ * The last modified date of the `File`.
+ * @since v18.13.0
+ */
+ readonly lastModified: number;
+ }
+ export import atob = globalThis.atob;
+ export import btoa = globalThis.btoa;
+
+ import { Blob as NodeBlob } from "buffer";
+ // This conditional type will be the existing global Blob in a browser, or
+ // the copy below in a Node environment.
+ type __Blob = typeof globalThis extends { onmessage: any; Blob: any } ? {} : NodeBlob;
+ global {
+ namespace NodeJS {
+ export { BufferEncoding };
+ }
+ // Buffer class
+ type BufferEncoding =
+ | "ascii"
+ | "utf8"
+ | "utf-8"
+ | "utf16le"
+ | "ucs2"
+ | "ucs-2"
+ | "base64"
+ | "base64url"
+ | "latin1"
+ | "binary"
+ | "hex";
+ type WithImplicitCoercion<T> =
+ | T
+ | {
+ valueOf(): T;
+ };
+ /**
+ * Raw data is stored in instances of the Buffer class.
+ * A Buffer is similar to an array of integers but corresponds to a raw memory allocation outside the V8 heap. A Buffer cannot be resized.
+ * Valid string encodings: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'base64url'|'binary'(deprecated)|'hex'
+ */
+ interface BufferConstructor {
+ /**
+ * Allocates a new buffer containing the given {str}.
+ *
+ * @param str String to store in buffer.
+ * @param encoding encoding to use, optional. Default is 'utf8'
+ * @deprecated since v10.0.0 - Use `Buffer.from(string[, encoding])` instead.
+ */
+ new(str: string, encoding?: BufferEncoding): Buffer;
+ /**
+ * Allocates a new buffer of {size} octets.
+ *
+ * @param size count of octets to allocate.
+ * @deprecated since v10.0.0 - Use `Buffer.alloc()` instead (also see `Buffer.allocUnsafe()`).
+ */
+ new(size: number): Buffer;
+ /**
+ * Allocates a new buffer containing the given {array} of octets.
+ *
+ * @param array The octets to store.
+ * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead.
+ */
+ new(array: Uint8Array): Buffer;
+ /**
+ * Produces a Buffer backed by the same allocated memory as
+ * the given {ArrayBuffer}/{SharedArrayBuffer}.
+ *
+ * @param arrayBuffer The ArrayBuffer with which to share memory.
+ * @deprecated since v10.0.0 - Use `Buffer.from(arrayBuffer[, byteOffset[, length]])` instead.
+ */
+ new(arrayBuffer: ArrayBuffer | SharedArrayBuffer): Buffer;
+ /**
+ * Allocates a new buffer containing the given {array} of octets.
+ *
+ * @param array The octets to store.
+ * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead.
+ */
+ new(array: readonly any[]): Buffer;
+ /**
+ * Copies the passed {buffer} data onto a new {Buffer} instance.
+ *
+ * @param buffer The buffer to copy.
+ * @deprecated since v10.0.0 - Use `Buffer.from(buffer)` instead.
+ */
+ new(buffer: Buffer): Buffer;
+ /**
+ * Allocates a new `Buffer` using an `array` of bytes in the range `0` – `255`.
+ * Array entries outside that range will be truncated to fit into it.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * // Creates a new Buffer containing the UTF-8 bytes of the string 'buffer'.
+ * const buf = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]);
+ * ```
+ *
+ * A `TypeError` will be thrown if `array` is not an `Array` or another type
+ * appropriate for `Buffer.from()` variants.
+ *
+ * `Buffer.from(array)` and `Buffer.from(string)` may also use the internal`Buffer` pool like `Buffer.allocUnsafe()` does.
+ * @since v5.10.0
+ */
+ from(
+ arrayBuffer: WithImplicitCoercion<ArrayBuffer | SharedArrayBuffer>,
+ byteOffset?: number,
+ length?: number,
+ ): Buffer;
+ /**
+ * Creates a new Buffer using the passed {data}
+ * @param data data to create a new Buffer
+ */
+ from(data: Uint8Array | readonly number[]): Buffer;
+ from(data: WithImplicitCoercion<Uint8Array | readonly number[] | string>): Buffer;
+ /**
+ * Creates a new Buffer containing the given JavaScript string {str}.
+ * If provided, the {encoding} parameter identifies the character encoding.
+ * If not provided, {encoding} defaults to 'utf8'.
+ */
+ from(
+ str:
+ | WithImplicitCoercion<string>
+ | {
+ [Symbol.toPrimitive](hint: "string"): string;
+ },
+ encoding?: BufferEncoding,
+ ): Buffer;
+ /**
+ * Creates a new Buffer using the passed {data}
+ * @param values to create a new Buffer
+ */
+ of(...items: number[]): Buffer;
+ /**
+ * Returns `true` if `obj` is a `Buffer`, `false` otherwise.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * Buffer.isBuffer(Buffer.alloc(10)); // true
+ * Buffer.isBuffer(Buffer.from('foo')); // true
+ * Buffer.isBuffer('a string'); // false
+ * Buffer.isBuffer([]); // false
+ * Buffer.isBuffer(new Uint8Array(1024)); // false
+ * ```
+ * @since v0.1.101
+ */
+ isBuffer(obj: any): obj is Buffer;
+ /**
+ * Returns `true` if `encoding` is the name of a supported character encoding,
+ * or `false` otherwise.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * console.log(Buffer.isEncoding('utf8'));
+ * // Prints: true
+ *
+ * console.log(Buffer.isEncoding('hex'));
+ * // Prints: true
+ *
+ * console.log(Buffer.isEncoding('utf/8'));
+ * // Prints: false
+ *
+ * console.log(Buffer.isEncoding(''));
+ * // Prints: false
+ * ```
+ * @since v0.9.1
+ * @param encoding A character encoding name to check.
+ */
+ isEncoding(encoding: string): encoding is BufferEncoding;
+ /**
+ * Returns the byte length of a string when encoded using `encoding`.
+ * This is not the same as [`String.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length), which does not account
+ * for the encoding that is used to convert the string into bytes.
+ *
+ * For `'base64'`, `'base64url'`, and `'hex'`, this function assumes valid input.
+ * For strings that contain non-base64/hex-encoded data (e.g. whitespace), the
+ * return value might be greater than the length of a `Buffer` created from the
+ * string.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const str = '\u00bd + \u00bc = \u00be';
+ *
+ * console.log(`${str}: ${str.length} characters, ` +
+ * `${Buffer.byteLength(str, 'utf8')} bytes`);
+ * // Prints: ½ + ¼ = ¾: 9 characters, 12 bytes
+ * ```
+ *
+ * When `string` is a
+ * `Buffer`/[`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView)/[`TypedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/-
+ * Reference/Global_Objects/TypedArray)/[`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)/[`SharedArrayBuffer`](https://develop-
+ * er.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer), the byte length as reported by `.byteLength`is returned.
+ * @since v0.1.90
+ * @param string A value to calculate the length of.
+ * @param [encoding='utf8'] If `string` is a string, this is its encoding.
+ * @return The number of bytes contained within `string`.
+ */
+ byteLength(
+ string: string | NodeJS.ArrayBufferView | ArrayBuffer | SharedArrayBuffer,
+ encoding?: BufferEncoding,
+ ): number;
+ /**
+ * Returns a new `Buffer` which is the result of concatenating all the `Buffer`instances in the `list` together.
+ *
+ * If the list has no items, or if the `totalLength` is 0, then a new zero-length`Buffer` is returned.
+ *
+ * If `totalLength` is not provided, it is calculated from the `Buffer` instances
+ * in `list` by adding their lengths.
+ *
+ * If `totalLength` is provided, it is coerced to an unsigned integer. If the
+ * combined length of the `Buffer`s in `list` exceeds `totalLength`, the result is
+ * truncated to `totalLength`.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * // Create a single `Buffer` from a list of three `Buffer` instances.
+ *
+ * const buf1 = Buffer.alloc(10);
+ * const buf2 = Buffer.alloc(14);
+ * const buf3 = Buffer.alloc(18);
+ * const totalLength = buf1.length + buf2.length + buf3.length;
+ *
+ * console.log(totalLength);
+ * // Prints: 42
+ *
+ * const bufA = Buffer.concat([buf1, buf2, buf3], totalLength);
+ *
+ * console.log(bufA);
+ * // Prints: <Buffer 00 00 00 00 ...>
+ * console.log(bufA.length);
+ * // Prints: 42
+ * ```
+ *
+ * `Buffer.concat()` may also use the internal `Buffer` pool like `Buffer.allocUnsafe()` does.
+ * @since v0.7.11
+ * @param list List of `Buffer` or {@link Uint8Array} instances to concatenate.
+ * @param totalLength Total length of the `Buffer` instances in `list` when concatenated.
+ */
+ concat(list: readonly Uint8Array[], totalLength?: number): Buffer;
+ /**
+ * Copies the underlying memory of `view` into a new `Buffer`.
+ * @since v18.16.0
+ * @param view The `TypedArray` to copy.
+ * @param offset The starting offset within `view`.
+ * @param length The number of elements from `view` to copy.
+ */
+ copyBytesFrom(view: NodeJS.TypedArray, offset?: number, length?: number): Buffer;
+ /**
+ * Compares `buf1` to `buf2`, typically for the purpose of sorting arrays of`Buffer` instances. This is equivalent to calling `buf1.compare(buf2)`.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf1 = Buffer.from('1234');
+ * const buf2 = Buffer.from('0123');
+ * const arr = [buf1, buf2];
+ *
+ * console.log(arr.sort(Buffer.compare));
+ * // Prints: [ <Buffer 30 31 32 33>, <Buffer 31 32 33 34> ]
+ * // (This result is equal to: [buf2, buf1].)
+ * ```
+ * @since v0.11.13
+ * @return Either `-1`, `0`, or `1`, depending on the result of the comparison. See `compare` for details.
+ */
+ compare(buf1: Uint8Array, buf2: Uint8Array): -1 | 0 | 1;
+ /**
+ * Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the`Buffer` will be zero-filled.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.alloc(5);
+ *
+ * console.log(buf);
+ * // Prints: <Buffer 00 00 00 00 00>
+ * ```
+ *
+ * If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_INVALID_ARG_VALUE` is thrown.
+ *
+ * If `fill` is specified, the allocated `Buffer` will be initialized by calling `buf.fill(fill)`.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.alloc(5, 'a');
+ *
+ * console.log(buf);
+ * // Prints: <Buffer 61 61 61 61 61>
+ * ```
+ *
+ * If both `fill` and `encoding` are specified, the allocated `Buffer` will be
+ * initialized by calling `buf.fill(fill, encoding)`.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64');
+ *
+ * console.log(buf);
+ * // Prints: <Buffer 68 65 6c 6c 6f 20 77 6f 72 6c 64>
+ * ```
+ *
+ * Calling `Buffer.alloc()` can be measurably slower than the alternative `Buffer.allocUnsafe()` but ensures that the newly created `Buffer` instance
+ * contents will never contain sensitive data from previous allocations, including
+ * data that might not have been allocated for `Buffer`s.
+ *
+ * A `TypeError` will be thrown if `size` is not a number.
+ * @since v5.10.0
+ * @param size The desired length of the new `Buffer`.
+ * @param [fill=0] A value to pre-fill the new `Buffer` with.
+ * @param [encoding='utf8'] If `fill` is a string, this is its encoding.
+ */
+ alloc(size: number, fill?: string | Uint8Array | number, encoding?: BufferEncoding): Buffer;
+ /**
+ * Allocates a new `Buffer` of `size` bytes. If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_INVALID_ARG_VALUE` is thrown.
+ *
+ * The underlying memory for `Buffer` instances created in this way is _not_
+ * _initialized_. The contents of the newly created `Buffer` are unknown and _may contain sensitive data_. Use `Buffer.alloc()` instead to initialize`Buffer` instances with zeroes.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(10);
+ *
+ * console.log(buf);
+ * // Prints (contents may vary): <Buffer a0 8b 28 3f 01 00 00 00 50 32>
+ *
+ * buf.fill(0);
+ *
+ * console.log(buf);
+ * // Prints: <Buffer 00 00 00 00 00 00 00 00 00 00>
+ * ```
+ *
+ * A `TypeError` will be thrown if `size` is not a number.
+ *
+ * The `Buffer` module pre-allocates an internal `Buffer` instance of
+ * size `Buffer.poolSize` that is used as a pool for the fast allocation of new`Buffer` instances created using `Buffer.allocUnsafe()`,`Buffer.from(array)`, `Buffer.concat()`, and the
+ * deprecated`new Buffer(size)` constructor only when `size` is less than or equal
+ * to `Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two).
+ *
+ * Use of this pre-allocated internal memory pool is a key difference between
+ * calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`.
+ * Specifically, `Buffer.alloc(size, fill)` will _never_ use the internal `Buffer`pool, while `Buffer.allocUnsafe(size).fill(fill)`_will_ use the internal`Buffer` pool if `size` is less
+ * than or equal to half `Buffer.poolSize`. The
+ * difference is subtle but can be important when an application requires the
+ * additional performance that `Buffer.allocUnsafe()` provides.
+ * @since v5.10.0
+ * @param size The desired length of the new `Buffer`.
+ */
+ allocUnsafe(size: number): Buffer;
+ /**
+ * Allocates a new `Buffer` of `size` bytes. If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_INVALID_ARG_VALUE` is thrown. A zero-length `Buffer` is created
+ * if `size` is 0.
+ *
+ * The underlying memory for `Buffer` instances created in this way is _not_
+ * _initialized_. The contents of the newly created `Buffer` are unknown and _may contain sensitive data_. Use `buf.fill(0)` to initialize
+ * such `Buffer` instances with zeroes.
+ *
+ * When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances,
+ * allocations under 4 KB are sliced from a single pre-allocated `Buffer`. This
+ * allows applications to avoid the garbage collection overhead of creating many
+ * individually allocated `Buffer` instances. This approach improves both
+ * performance and memory usage by eliminating the need to track and clean up as
+ * many individual `ArrayBuffer` objects.
+ *
+ * However, in the case where a developer may need to retain a small chunk of
+ * memory from a pool for an indeterminate amount of time, it may be appropriate
+ * to create an un-pooled `Buffer` instance using `Buffer.allocUnsafeSlow()` and
+ * then copying out the relevant bits.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * // Need to keep around a few small chunks of memory.
+ * const store = [];
+ *
+ * socket.on('readable', () => {
+ * let data;
+ * while (null !== (data = readable.read())) {
+ * // Allocate for retained data.
+ * const sb = Buffer.allocUnsafeSlow(10);
+ *
+ * // Copy the data into the new allocation.
+ * data.copy(sb, 0, 0, 10);
+ *
+ * store.push(sb);
+ * }
+ * });
+ * ```
+ *
+ * A `TypeError` will be thrown if `size` is not a number.
+ * @since v5.12.0
+ * @param size The desired length of the new `Buffer`.
+ */
+ allocUnsafeSlow(size: number): Buffer;
+ /**
+ * This is the size (in bytes) of pre-allocated internal `Buffer` instances used
+ * for pooling. This value may be modified.
+ * @since v0.11.3
+ */
+ poolSize: number;
+ }
+ interface Buffer extends Uint8Array {
+ /**
+ * Writes `string` to `buf` at `offset` according to the character encoding in`encoding`. The `length` parameter is the number of bytes to write. If `buf` did
+ * not contain enough space to fit the entire string, only part of `string` will be
+ * written. However, partially encoded characters will not be written.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.alloc(256);
+ *
+ * const len = buf.write('\u00bd + \u00bc = \u00be', 0);
+ *
+ * console.log(`${len} bytes: ${buf.toString('utf8', 0, len)}`);
+ * // Prints: 12 bytes: ½ + ¼ = ¾
+ *
+ * const buffer = Buffer.alloc(10);
+ *
+ * const length = buffer.write('abcd', 8);
+ *
+ * console.log(`${length} bytes: ${buffer.toString('utf8', 8, 10)}`);
+ * // Prints: 2 bytes : ab
+ * ```
+ * @since v0.1.90
+ * @param string String to write to `buf`.
+ * @param [offset=0] Number of bytes to skip before starting to write `string`.
+ * @param [length=buf.length - offset] Maximum number of bytes to write (written bytes will not exceed `buf.length - offset`).
+ * @param [encoding='utf8'] The character encoding of `string`.
+ * @return Number of bytes written.
+ */
+ write(string: string, encoding?: BufferEncoding): number;
+ write(string: string, offset: number, encoding?: BufferEncoding): number;
+ write(string: string, offset: number, length: number, encoding?: BufferEncoding): number;
+ /**
+ * Decodes `buf` to a string according to the specified character encoding in`encoding`. `start` and `end` may be passed to decode only a subset of `buf`.
+ *
+ * If `encoding` is `'utf8'` and a byte sequence in the input is not valid UTF-8,
+ * then each invalid byte is replaced with the replacement character `U+FFFD`.
+ *
+ * The maximum length of a string instance (in UTF-16 code units) is available
+ * as {@link constants.MAX_STRING_LENGTH}.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf1 = Buffer.allocUnsafe(26);
+ *
+ * for (let i = 0; i < 26; i++) {
+ * // 97 is the decimal ASCII value for 'a'.
+ * buf1[i] = i + 97;
+ * }
+ *
+ * console.log(buf1.toString('utf8'));
+ * // Prints: abcdefghijklmnopqrstuvwxyz
+ * console.log(buf1.toString('utf8', 0, 5));
+ * // Prints: abcde
+ *
+ * const buf2 = Buffer.from('tést');
+ *
+ * console.log(buf2.toString('hex'));
+ * // Prints: 74c3a97374
+ * console.log(buf2.toString('utf8', 0, 3));
+ * // Prints: té
+ * console.log(buf2.toString(undefined, 0, 3));
+ * // Prints: té
+ * ```
+ * @since v0.1.90
+ * @param [encoding='utf8'] The character encoding to use.
+ * @param [start=0] The byte offset to start decoding at.
+ * @param [end=buf.length] The byte offset to stop decoding at (not inclusive).
+ */
+ toString(encoding?: BufferEncoding, start?: number, end?: number): string;
+ /**
+ * Returns a JSON representation of `buf`. [`JSON.stringify()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) implicitly calls
+ * this function when stringifying a `Buffer` instance.
+ *
+ * `Buffer.from()` accepts objects in the format returned from this method.
+ * In particular, `Buffer.from(buf.toJSON())` works like `Buffer.from(buf)`.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5]);
+ * const json = JSON.stringify(buf);
+ *
+ * console.log(json);
+ * // Prints: {"type":"Buffer","data":[1,2,3,4,5]}
+ *
+ * const copy = JSON.parse(json, (key, value) => {
+ * return value &#x26;&#x26; value.type === 'Buffer' ?
+ * Buffer.from(value) :
+ * value;
+ * });
+ *
+ * console.log(copy);
+ * // Prints: <Buffer 01 02 03 04 05>
+ * ```
+ * @since v0.9.2
+ */
+ toJSON(): {
+ type: "Buffer";
+ data: number[];
+ };
+ /**
+ * Returns `true` if both `buf` and `otherBuffer` have exactly the same bytes,`false` otherwise. Equivalent to `buf.compare(otherBuffer) === 0`.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf1 = Buffer.from('ABC');
+ * const buf2 = Buffer.from('414243', 'hex');
+ * const buf3 = Buffer.from('ABCD');
+ *
+ * console.log(buf1.equals(buf2));
+ * // Prints: true
+ * console.log(buf1.equals(buf3));
+ * // Prints: false
+ * ```
+ * @since v0.11.13
+ * @param otherBuffer A `Buffer` or {@link Uint8Array} with which to compare `buf`.
+ */
+ equals(otherBuffer: Uint8Array): boolean;
+ /**
+ * Compares `buf` with `target` and returns a number indicating whether `buf`comes before, after, or is the same as `target` in sort order.
+ * Comparison is based on the actual sequence of bytes in each `Buffer`.
+ *
+ * * `0` is returned if `target` is the same as `buf`
+ * * `1` is returned if `target` should come _before_`buf` when sorted.
+ * * `-1` is returned if `target` should come _after_`buf` when sorted.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf1 = Buffer.from('ABC');
+ * const buf2 = Buffer.from('BCD');
+ * const buf3 = Buffer.from('ABCD');
+ *
+ * console.log(buf1.compare(buf1));
+ * // Prints: 0
+ * console.log(buf1.compare(buf2));
+ * // Prints: -1
+ * console.log(buf1.compare(buf3));
+ * // Prints: -1
+ * console.log(buf2.compare(buf1));
+ * // Prints: 1
+ * console.log(buf2.compare(buf3));
+ * // Prints: 1
+ * console.log([buf1, buf2, buf3].sort(Buffer.compare));
+ * // Prints: [ <Buffer 41 42 43>, <Buffer 41 42 43 44>, <Buffer 42 43 44> ]
+ * // (This result is equal to: [buf1, buf3, buf2].)
+ * ```
+ *
+ * The optional `targetStart`, `targetEnd`, `sourceStart`, and `sourceEnd`arguments can be used to limit the comparison to specific ranges within `target`and `buf` respectively.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf1 = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8, 9]);
+ * const buf2 = Buffer.from([5, 6, 7, 8, 9, 1, 2, 3, 4]);
+ *
+ * console.log(buf1.compare(buf2, 5, 9, 0, 4));
+ * // Prints: 0
+ * console.log(buf1.compare(buf2, 0, 6, 4));
+ * // Prints: -1
+ * console.log(buf1.compare(buf2, 5, 6, 5));
+ * // Prints: 1
+ * ```
+ *
+ * `ERR_OUT_OF_RANGE` is thrown if `targetStart < 0`, `sourceStart < 0`,`targetEnd > target.byteLength`, or `sourceEnd > source.byteLength`.
+ * @since v0.11.13
+ * @param target A `Buffer` or {@link Uint8Array} with which to compare `buf`.
+ * @param [targetStart=0] The offset within `target` at which to begin comparison.
+ * @param [targetEnd=target.length] The offset within `target` at which to end comparison (not inclusive).
+ * @param [sourceStart=0] The offset within `buf` at which to begin comparison.
+ * @param [sourceEnd=buf.length] The offset within `buf` at which to end comparison (not inclusive).
+ */
+ compare(
+ target: Uint8Array,
+ targetStart?: number,
+ targetEnd?: number,
+ sourceStart?: number,
+ sourceEnd?: number,
+ ): -1 | 0 | 1;
+ /**
+ * Copies data from a region of `buf` to a region in `target`, even if the `target`memory region overlaps with `buf`.
+ *
+ * [`TypedArray.prototype.set()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) performs the same operation, and is available
+ * for all TypedArrays, including Node.js `Buffer`s, although it takes
+ * different function arguments.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * // Create two `Buffer` instances.
+ * const buf1 = Buffer.allocUnsafe(26);
+ * const buf2 = Buffer.allocUnsafe(26).fill('!');
+ *
+ * for (let i = 0; i < 26; i++) {
+ * // 97 is the decimal ASCII value for 'a'.
+ * buf1[i] = i + 97;
+ * }
+ *
+ * // Copy `buf1` bytes 16 through 19 into `buf2` starting at byte 8 of `buf2`.
+ * buf1.copy(buf2, 8, 16, 20);
+ * // This is equivalent to:
+ * // buf2.set(buf1.subarray(16, 20), 8);
+ *
+ * console.log(buf2.toString('ascii', 0, 25));
+ * // Prints: !!!!!!!!qrst!!!!!!!!!!!!!
+ * ```
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * // Create a `Buffer` and copy data from one region to an overlapping region
+ * // within the same `Buffer`.
+ *
+ * const buf = Buffer.allocUnsafe(26);
+ *
+ * for (let i = 0; i < 26; i++) {
+ * // 97 is the decimal ASCII value for 'a'.
+ * buf[i] = i + 97;
+ * }
+ *
+ * buf.copy(buf, 0, 4, 10);
+ *
+ * console.log(buf.toString());
+ * // Prints: efghijghijklmnopqrstuvwxyz
+ * ```
+ * @since v0.1.90
+ * @param target A `Buffer` or {@link Uint8Array} to copy into.
+ * @param [targetStart=0] The offset within `target` at which to begin writing.
+ * @param [sourceStart=0] The offset within `buf` from which to begin copying.
+ * @param [sourceEnd=buf.length] The offset within `buf` at which to stop copying (not inclusive).
+ * @return The number of bytes copied.
+ */
+ copy(target: Uint8Array, targetStart?: number, sourceStart?: number, sourceEnd?: number): number;
+ /**
+ * Returns a new `Buffer` that references the same memory as the original, but
+ * offset and cropped by the `start` and `end` indices.
+ *
+ * This method is not compatible with the `Uint8Array.prototype.slice()`,
+ * which is a superclass of `Buffer`. To copy the slice, use`Uint8Array.prototype.slice()`.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from('buffer');
+ *
+ * const copiedBuf = Uint8Array.prototype.slice.call(buf);
+ * copiedBuf[0]++;
+ * console.log(copiedBuf.toString());
+ * // Prints: cuffer
+ *
+ * console.log(buf.toString());
+ * // Prints: buffer
+ *
+ * // With buf.slice(), the original buffer is modified.
+ * const notReallyCopiedBuf = buf.slice();
+ * notReallyCopiedBuf[0]++;
+ * console.log(notReallyCopiedBuf.toString());
+ * // Prints: cuffer
+ * console.log(buf.toString());
+ * // Also prints: cuffer (!)
+ * ```
+ * @since v0.3.0
+ * @deprecated Use `subarray` instead.
+ * @param [start=0] Where the new `Buffer` will start.
+ * @param [end=buf.length] Where the new `Buffer` will end (not inclusive).
+ */
+ slice(start?: number, end?: number): Buffer;
+ /**
+ * Returns a new `Buffer` that references the same memory as the original, but
+ * offset and cropped by the `start` and `end` indices.
+ *
+ * Specifying `end` greater than `buf.length` will return the same result as
+ * that of `end` equal to `buf.length`.
+ *
+ * This method is inherited from [`TypedArray.prototype.subarray()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray).
+ *
+ * Modifying the new `Buffer` slice will modify the memory in the original `Buffer`because the allocated memory of the two objects overlap.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * // Create a `Buffer` with the ASCII alphabet, take a slice, and modify one byte
+ * // from the original `Buffer`.
+ *
+ * const buf1 = Buffer.allocUnsafe(26);
+ *
+ * for (let i = 0; i < 26; i++) {
+ * // 97 is the decimal ASCII value for 'a'.
+ * buf1[i] = i + 97;
+ * }
+ *
+ * const buf2 = buf1.subarray(0, 3);
+ *
+ * console.log(buf2.toString('ascii', 0, buf2.length));
+ * // Prints: abc
+ *
+ * buf1[0] = 33;
+ *
+ * console.log(buf2.toString('ascii', 0, buf2.length));
+ * // Prints: !bc
+ * ```
+ *
+ * Specifying negative indexes causes the slice to be generated relative to the
+ * end of `buf` rather than the beginning.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from('buffer');
+ *
+ * console.log(buf.subarray(-6, -1).toString());
+ * // Prints: buffe
+ * // (Equivalent to buf.subarray(0, 5).)
+ *
+ * console.log(buf.subarray(-6, -2).toString());
+ * // Prints: buff
+ * // (Equivalent to buf.subarray(0, 4).)
+ *
+ * console.log(buf.subarray(-5, -2).toString());
+ * // Prints: uff
+ * // (Equivalent to buf.subarray(1, 4).)
+ * ```
+ * @since v3.0.0
+ * @param [start=0] Where the new `Buffer` will start.
+ * @param [end=buf.length] Where the new `Buffer` will end (not inclusive).
+ */
+ subarray(start?: number, end?: number): Buffer;
+ /**
+ * Writes `value` to `buf` at the specified `offset` as big-endian.
+ *
+ * `value` is interpreted and written as a two's complement signed integer.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(8);
+ *
+ * buf.writeBigInt64BE(0x0102030405060708n, 0);
+ *
+ * console.log(buf);
+ * // Prints: <Buffer 01 02 03 04 05 06 07 08>
+ * ```
+ * @since v12.0.0, v10.20.0
+ * @param value Number to be written to `buf`.
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeBigInt64BE(value: bigint, offset?: number): number;
+ /**
+ * Writes `value` to `buf` at the specified `offset` as little-endian.
+ *
+ * `value` is interpreted and written as a two's complement signed integer.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(8);
+ *
+ * buf.writeBigInt64LE(0x0102030405060708n, 0);
+ *
+ * console.log(buf);
+ * // Prints: <Buffer 08 07 06 05 04 03 02 01>
+ * ```
+ * @since v12.0.0, v10.20.0
+ * @param value Number to be written to `buf`.
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeBigInt64LE(value: bigint, offset?: number): number;
+ /**
+ * Writes `value` to `buf` at the specified `offset` as big-endian.
+ *
+ * This function is also available under the `writeBigUint64BE` alias.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(8);
+ *
+ * buf.writeBigUInt64BE(0xdecafafecacefaden, 0);
+ *
+ * console.log(buf);
+ * // Prints: <Buffer de ca fa fe ca ce fa de>
+ * ```
+ * @since v12.0.0, v10.20.0
+ * @param value Number to be written to `buf`.
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeBigUInt64BE(value: bigint, offset?: number): number;
+ /**
+ * @alias Buffer.writeBigUInt64BE
+ * @since v14.10.0, v12.19.0
+ */
+ writeBigUint64BE(value: bigint, offset?: number): number;
+ /**
+ * Writes `value` to `buf` at the specified `offset` as little-endian
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(8);
+ *
+ * buf.writeBigUInt64LE(0xdecafafecacefaden, 0);
+ *
+ * console.log(buf);
+ * // Prints: <Buffer de fa ce ca fe fa ca de>
+ * ```
+ *
+ * This function is also available under the `writeBigUint64LE` alias.
+ * @since v12.0.0, v10.20.0
+ * @param value Number to be written to `buf`.
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeBigUInt64LE(value: bigint, offset?: number): number;
+ /**
+ * @alias Buffer.writeBigUInt64LE
+ * @since v14.10.0, v12.19.0
+ */
+ writeBigUint64LE(value: bigint, offset?: number): number;
+ /**
+ * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as little-endian. Supports up to 48 bits of accuracy. Behavior is undefined
+ * when `value` is anything other than an unsigned integer.
+ *
+ * This function is also available under the `writeUintLE` alias.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(6);
+ *
+ * buf.writeUIntLE(0x1234567890ab, 0, 6);
+ *
+ * console.log(buf);
+ * // Prints: <Buffer ab 90 78 56 34 12>
+ * ```
+ * @since v0.5.5
+ * @param value Number to be written to `buf`.
+ * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`.
+ * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeUIntLE(value: number, offset: number, byteLength: number): number;
+ /**
+ * @alias Buffer.writeUIntLE
+ * @since v14.9.0, v12.19.0
+ */
+ writeUintLE(value: number, offset: number, byteLength: number): number;
+ /**
+ * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as big-endian. Supports up to 48 bits of accuracy. Behavior is undefined
+ * when `value` is anything other than an unsigned integer.
+ *
+ * This function is also available under the `writeUintBE` alias.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(6);
+ *
+ * buf.writeUIntBE(0x1234567890ab, 0, 6);
+ *
+ * console.log(buf);
+ * // Prints: <Buffer 12 34 56 78 90 ab>
+ * ```
+ * @since v0.5.5
+ * @param value Number to be written to `buf`.
+ * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`.
+ * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeUIntBE(value: number, offset: number, byteLength: number): number;
+ /**
+ * @alias Buffer.writeUIntBE
+ * @since v14.9.0, v12.19.0
+ */
+ writeUintBE(value: number, offset: number, byteLength: number): number;
+ /**
+ * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as little-endian. Supports up to 48 bits of accuracy. Behavior is undefined
+ * when `value` is anything other than a signed integer.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(6);
+ *
+ * buf.writeIntLE(0x1234567890ab, 0, 6);
+ *
+ * console.log(buf);
+ * // Prints: <Buffer ab 90 78 56 34 12>
+ * ```
+ * @since v0.11.15
+ * @param value Number to be written to `buf`.
+ * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`.
+ * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeIntLE(value: number, offset: number, byteLength: number): number;
+ /**
+ * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as big-endian. Supports up to 48 bits of accuracy. Behavior is undefined when`value` is anything other than a
+ * signed integer.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(6);
+ *
+ * buf.writeIntBE(0x1234567890ab, 0, 6);
+ *
+ * console.log(buf);
+ * // Prints: <Buffer 12 34 56 78 90 ab>
+ * ```
+ * @since v0.11.15
+ * @param value Number to be written to `buf`.
+ * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`.
+ * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeIntBE(value: number, offset: number, byteLength: number): number;
+ /**
+ * Reads an unsigned, big-endian 64-bit integer from `buf` at the specified`offset`.
+ *
+ * This function is also available under the `readBigUint64BE` alias.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]);
+ *
+ * console.log(buf.readBigUInt64BE(0));
+ * // Prints: 4294967295n
+ * ```
+ * @since v12.0.0, v10.20.0
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`.
+ */
+ readBigUInt64BE(offset?: number): bigint;
+ /**
+ * @alias Buffer.readBigUInt64BE
+ * @since v14.10.0, v12.19.0
+ */
+ readBigUint64BE(offset?: number): bigint;
+ /**
+ * Reads an unsigned, little-endian 64-bit integer from `buf` at the specified`offset`.
+ *
+ * This function is also available under the `readBigUint64LE` alias.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]);
+ *
+ * console.log(buf.readBigUInt64LE(0));
+ * // Prints: 18446744069414584320n
+ * ```
+ * @since v12.0.0, v10.20.0
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`.
+ */
+ readBigUInt64LE(offset?: number): bigint;
+ /**
+ * @alias Buffer.readBigUInt64LE
+ * @since v14.10.0, v12.19.0
+ */
+ readBigUint64LE(offset?: number): bigint;
+ /**
+ * Reads a signed, big-endian 64-bit integer from `buf` at the specified `offset`.
+ *
+ * Integers read from a `Buffer` are interpreted as two's complement signed
+ * values.
+ * @since v12.0.0, v10.20.0
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`.
+ */
+ readBigInt64BE(offset?: number): bigint;
+ /**
+ * Reads a signed, little-endian 64-bit integer from `buf` at the specified`offset`.
+ *
+ * Integers read from a `Buffer` are interpreted as two's complement signed
+ * values.
+ * @since v12.0.0, v10.20.0
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`.
+ */
+ readBigInt64LE(offset?: number): bigint;
+ /**
+ * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as an unsigned, little-endian integer supporting
+ * up to 48 bits of accuracy.
+ *
+ * This function is also available under the `readUintLE` alias.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);
+ *
+ * console.log(buf.readUIntLE(0, 6).toString(16));
+ * // Prints: ab9078563412
+ * ```
+ * @since v0.11.15
+ * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`.
+ * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`.
+ */
+ readUIntLE(offset: number, byteLength: number): number;
+ /**
+ * @alias Buffer.readUIntLE
+ * @since v14.9.0, v12.19.0
+ */
+ readUintLE(offset: number, byteLength: number): number;
+ /**
+ * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as an unsigned big-endian integer supporting
+ * up to 48 bits of accuracy.
+ *
+ * This function is also available under the `readUintBE` alias.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);
+ *
+ * console.log(buf.readUIntBE(0, 6).toString(16));
+ * // Prints: 1234567890ab
+ * console.log(buf.readUIntBE(1, 6).toString(16));
+ * // Throws ERR_OUT_OF_RANGE.
+ * ```
+ * @since v0.11.15
+ * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`.
+ * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`.
+ */
+ readUIntBE(offset: number, byteLength: number): number;
+ /**
+ * @alias Buffer.readUIntBE
+ * @since v14.9.0, v12.19.0
+ */
+ readUintBE(offset: number, byteLength: number): number;
+ /**
+ * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as a little-endian, two's complement signed value
+ * supporting up to 48 bits of accuracy.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);
+ *
+ * console.log(buf.readIntLE(0, 6).toString(16));
+ * // Prints: -546f87a9cbee
+ * ```
+ * @since v0.11.15
+ * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`.
+ * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`.
+ */
+ readIntLE(offset: number, byteLength: number): number;
+ /**
+ * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as a big-endian, two's complement signed value
+ * supporting up to 48 bits of accuracy.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);
+ *
+ * console.log(buf.readIntBE(0, 6).toString(16));
+ * // Prints: 1234567890ab
+ * console.log(buf.readIntBE(1, 6).toString(16));
+ * // Throws ERR_OUT_OF_RANGE.
+ * console.log(buf.readIntBE(1, 0).toString(16));
+ * // Throws ERR_OUT_OF_RANGE.
+ * ```
+ * @since v0.11.15
+ * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`.
+ * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`.
+ */
+ readIntBE(offset: number, byteLength: number): number;
+ /**
+ * Reads an unsigned 8-bit integer from `buf` at the specified `offset`.
+ *
+ * This function is also available under the `readUint8` alias.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([1, -2]);
+ *
+ * console.log(buf.readUInt8(0));
+ * // Prints: 1
+ * console.log(buf.readUInt8(1));
+ * // Prints: 254
+ * console.log(buf.readUInt8(2));
+ * // Throws ERR_OUT_OF_RANGE.
+ * ```
+ * @since v0.5.0
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 1`.
+ */
+ readUInt8(offset?: number): number;
+ /**
+ * @alias Buffer.readUInt8
+ * @since v14.9.0, v12.19.0
+ */
+ readUint8(offset?: number): number;
+ /**
+ * Reads an unsigned, little-endian 16-bit integer from `buf` at the specified`offset`.
+ *
+ * This function is also available under the `readUint16LE` alias.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([0x12, 0x34, 0x56]);
+ *
+ * console.log(buf.readUInt16LE(0).toString(16));
+ * // Prints: 3412
+ * console.log(buf.readUInt16LE(1).toString(16));
+ * // Prints: 5634
+ * console.log(buf.readUInt16LE(2).toString(16));
+ * // Throws ERR_OUT_OF_RANGE.
+ * ```
+ * @since v0.5.5
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`.
+ */
+ readUInt16LE(offset?: number): number;
+ /**
+ * @alias Buffer.readUInt16LE
+ * @since v14.9.0, v12.19.0
+ */
+ readUint16LE(offset?: number): number;
+ /**
+ * Reads an unsigned, big-endian 16-bit integer from `buf` at the specified`offset`.
+ *
+ * This function is also available under the `readUint16BE` alias.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([0x12, 0x34, 0x56]);
+ *
+ * console.log(buf.readUInt16BE(0).toString(16));
+ * // Prints: 1234
+ * console.log(buf.readUInt16BE(1).toString(16));
+ * // Prints: 3456
+ * ```
+ * @since v0.5.5
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`.
+ */
+ readUInt16BE(offset?: number): number;
+ /**
+ * @alias Buffer.readUInt16BE
+ * @since v14.9.0, v12.19.0
+ */
+ readUint16BE(offset?: number): number;
+ /**
+ * Reads an unsigned, little-endian 32-bit integer from `buf` at the specified`offset`.
+ *
+ * This function is also available under the `readUint32LE` alias.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]);
+ *
+ * console.log(buf.readUInt32LE(0).toString(16));
+ * // Prints: 78563412
+ * console.log(buf.readUInt32LE(1).toString(16));
+ * // Throws ERR_OUT_OF_RANGE.
+ * ```
+ * @since v0.5.5
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.
+ */
+ readUInt32LE(offset?: number): number;
+ /**
+ * @alias Buffer.readUInt32LE
+ * @since v14.9.0, v12.19.0
+ */
+ readUint32LE(offset?: number): number;
+ /**
+ * Reads an unsigned, big-endian 32-bit integer from `buf` at the specified`offset`.
+ *
+ * This function is also available under the `readUint32BE` alias.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]);
+ *
+ * console.log(buf.readUInt32BE(0).toString(16));
+ * // Prints: 12345678
+ * ```
+ * @since v0.5.5
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.
+ */
+ readUInt32BE(offset?: number): number;
+ /**
+ * @alias Buffer.readUInt32BE
+ * @since v14.9.0, v12.19.0
+ */
+ readUint32BE(offset?: number): number;
+ /**
+ * Reads a signed 8-bit integer from `buf` at the specified `offset`.
+ *
+ * Integers read from a `Buffer` are interpreted as two's complement signed values.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([-1, 5]);
+ *
+ * console.log(buf.readInt8(0));
+ * // Prints: -1
+ * console.log(buf.readInt8(1));
+ * // Prints: 5
+ * console.log(buf.readInt8(2));
+ * // Throws ERR_OUT_OF_RANGE.
+ * ```
+ * @since v0.5.0
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 1`.
+ */
+ readInt8(offset?: number): number;
+ /**
+ * Reads a signed, little-endian 16-bit integer from `buf` at the specified`offset`.
+ *
+ * Integers read from a `Buffer` are interpreted as two's complement signed values.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([0, 5]);
+ *
+ * console.log(buf.readInt16LE(0));
+ * // Prints: 1280
+ * console.log(buf.readInt16LE(1));
+ * // Throws ERR_OUT_OF_RANGE.
+ * ```
+ * @since v0.5.5
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`.
+ */
+ readInt16LE(offset?: number): number;
+ /**
+ * Reads a signed, big-endian 16-bit integer from `buf` at the specified `offset`.
+ *
+ * Integers read from a `Buffer` are interpreted as two's complement signed values.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([0, 5]);
+ *
+ * console.log(buf.readInt16BE(0));
+ * // Prints: 5
+ * ```
+ * @since v0.5.5
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`.
+ */
+ readInt16BE(offset?: number): number;
+ /**
+ * Reads a signed, little-endian 32-bit integer from `buf` at the specified`offset`.
+ *
+ * Integers read from a `Buffer` are interpreted as two's complement signed values.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([0, 0, 0, 5]);
+ *
+ * console.log(buf.readInt32LE(0));
+ * // Prints: 83886080
+ * console.log(buf.readInt32LE(1));
+ * // Throws ERR_OUT_OF_RANGE.
+ * ```
+ * @since v0.5.5
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.
+ */
+ readInt32LE(offset?: number): number;
+ /**
+ * Reads a signed, big-endian 32-bit integer from `buf` at the specified `offset`.
+ *
+ * Integers read from a `Buffer` are interpreted as two's complement signed values.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([0, 0, 0, 5]);
+ *
+ * console.log(buf.readInt32BE(0));
+ * // Prints: 5
+ * ```
+ * @since v0.5.5
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.
+ */
+ readInt32BE(offset?: number): number;
+ /**
+ * Reads a 32-bit, little-endian float from `buf` at the specified `offset`.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([1, 2, 3, 4]);
+ *
+ * console.log(buf.readFloatLE(0));
+ * // Prints: 1.539989614439558e-36
+ * console.log(buf.readFloatLE(1));
+ * // Throws ERR_OUT_OF_RANGE.
+ * ```
+ * @since v0.11.15
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.
+ */
+ readFloatLE(offset?: number): number;
+ /**
+ * Reads a 32-bit, big-endian float from `buf` at the specified `offset`.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([1, 2, 3, 4]);
+ *
+ * console.log(buf.readFloatBE(0));
+ * // Prints: 2.387939260590663e-38
+ * ```
+ * @since v0.11.15
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.
+ */
+ readFloatBE(offset?: number): number;
+ /**
+ * Reads a 64-bit, little-endian double from `buf` at the specified `offset`.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]);
+ *
+ * console.log(buf.readDoubleLE(0));
+ * // Prints: 5.447603722011605e-270
+ * console.log(buf.readDoubleLE(1));
+ * // Throws ERR_OUT_OF_RANGE.
+ * ```
+ * @since v0.11.15
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 8`.
+ */
+ readDoubleLE(offset?: number): number;
+ /**
+ * Reads a 64-bit, big-endian double from `buf` at the specified `offset`.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]);
+ *
+ * console.log(buf.readDoubleBE(0));
+ * // Prints: 8.20788039913184e-304
+ * ```
+ * @since v0.11.15
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 8`.
+ */
+ readDoubleBE(offset?: number): number;
+ reverse(): this;
+ /**
+ * Interprets `buf` as an array of unsigned 16-bit integers and swaps the
+ * byte order _in-place_. Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 2.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]);
+ *
+ * console.log(buf1);
+ * // Prints: <Buffer 01 02 03 04 05 06 07 08>
+ *
+ * buf1.swap16();
+ *
+ * console.log(buf1);
+ * // Prints: <Buffer 02 01 04 03 06 05 08 07>
+ *
+ * const buf2 = Buffer.from([0x1, 0x2, 0x3]);
+ *
+ * buf2.swap16();
+ * // Throws ERR_INVALID_BUFFER_SIZE.
+ * ```
+ *
+ * One convenient use of `buf.swap16()` is to perform a fast in-place conversion
+ * between UTF-16 little-endian and UTF-16 big-endian:
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from('This is little-endian UTF-16', 'utf16le');
+ * buf.swap16(); // Convert to big-endian UTF-16 text.
+ * ```
+ * @since v5.10.0
+ * @return A reference to `buf`.
+ */
+ swap16(): Buffer;
+ /**
+ * Interprets `buf` as an array of unsigned 32-bit integers and swaps the
+ * byte order _in-place_. Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 4.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]);
+ *
+ * console.log(buf1);
+ * // Prints: <Buffer 01 02 03 04 05 06 07 08>
+ *
+ * buf1.swap32();
+ *
+ * console.log(buf1);
+ * // Prints: <Buffer 04 03 02 01 08 07 06 05>
+ *
+ * const buf2 = Buffer.from([0x1, 0x2, 0x3]);
+ *
+ * buf2.swap32();
+ * // Throws ERR_INVALID_BUFFER_SIZE.
+ * ```
+ * @since v5.10.0
+ * @return A reference to `buf`.
+ */
+ swap32(): Buffer;
+ /**
+ * Interprets `buf` as an array of 64-bit numbers and swaps byte order _in-place_.
+ * Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 8.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]);
+ *
+ * console.log(buf1);
+ * // Prints: <Buffer 01 02 03 04 05 06 07 08>
+ *
+ * buf1.swap64();
+ *
+ * console.log(buf1);
+ * // Prints: <Buffer 08 07 06 05 04 03 02 01>
+ *
+ * const buf2 = Buffer.from([0x1, 0x2, 0x3]);
+ *
+ * buf2.swap64();
+ * // Throws ERR_INVALID_BUFFER_SIZE.
+ * ```
+ * @since v6.3.0
+ * @return A reference to `buf`.
+ */
+ swap64(): Buffer;
+ /**
+ * Writes `value` to `buf` at the specified `offset`. `value` must be a
+ * valid unsigned 8-bit integer. Behavior is undefined when `value` is anything
+ * other than an unsigned 8-bit integer.
+ *
+ * This function is also available under the `writeUint8` alias.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(4);
+ *
+ * buf.writeUInt8(0x3, 0);
+ * buf.writeUInt8(0x4, 1);
+ * buf.writeUInt8(0x23, 2);
+ * buf.writeUInt8(0x42, 3);
+ *
+ * console.log(buf);
+ * // Prints: <Buffer 03 04 23 42>
+ * ```
+ * @since v0.5.0
+ * @param value Number to be written to `buf`.
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 1`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeUInt8(value: number, offset?: number): number;
+ /**
+ * @alias Buffer.writeUInt8
+ * @since v14.9.0, v12.19.0
+ */
+ writeUint8(value: number, offset?: number): number;
+ /**
+ * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid unsigned 16-bit integer. Behavior is undefined when `value` is
+ * anything other than an unsigned 16-bit integer.
+ *
+ * This function is also available under the `writeUint16LE` alias.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(4);
+ *
+ * buf.writeUInt16LE(0xdead, 0);
+ * buf.writeUInt16LE(0xbeef, 2);
+ *
+ * console.log(buf);
+ * // Prints: <Buffer ad de ef be>
+ * ```
+ * @since v0.5.5
+ * @param value Number to be written to `buf`.
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeUInt16LE(value: number, offset?: number): number;
+ /**
+ * @alias Buffer.writeUInt16LE
+ * @since v14.9.0, v12.19.0
+ */
+ writeUint16LE(value: number, offset?: number): number;
+ /**
+ * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid unsigned 16-bit integer. Behavior is undefined when `value`is anything other than an
+ * unsigned 16-bit integer.
+ *
+ * This function is also available under the `writeUint16BE` alias.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(4);
+ *
+ * buf.writeUInt16BE(0xdead, 0);
+ * buf.writeUInt16BE(0xbeef, 2);
+ *
+ * console.log(buf);
+ * // Prints: <Buffer de ad be ef>
+ * ```
+ * @since v0.5.5
+ * @param value Number to be written to `buf`.
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeUInt16BE(value: number, offset?: number): number;
+ /**
+ * @alias Buffer.writeUInt16BE
+ * @since v14.9.0, v12.19.0
+ */
+ writeUint16BE(value: number, offset?: number): number;
+ /**
+ * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid unsigned 32-bit integer. Behavior is undefined when `value` is
+ * anything other than an unsigned 32-bit integer.
+ *
+ * This function is also available under the `writeUint32LE` alias.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(4);
+ *
+ * buf.writeUInt32LE(0xfeedface, 0);
+ *
+ * console.log(buf);
+ * // Prints: <Buffer ce fa ed fe>
+ * ```
+ * @since v0.5.5
+ * @param value Number to be written to `buf`.
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeUInt32LE(value: number, offset?: number): number;
+ /**
+ * @alias Buffer.writeUInt32LE
+ * @since v14.9.0, v12.19.0
+ */
+ writeUint32LE(value: number, offset?: number): number;
+ /**
+ * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid unsigned 32-bit integer. Behavior is undefined when `value`is anything other than an
+ * unsigned 32-bit integer.
+ *
+ * This function is also available under the `writeUint32BE` alias.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(4);
+ *
+ * buf.writeUInt32BE(0xfeedface, 0);
+ *
+ * console.log(buf);
+ * // Prints: <Buffer fe ed fa ce>
+ * ```
+ * @since v0.5.5
+ * @param value Number to be written to `buf`.
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeUInt32BE(value: number, offset?: number): number;
+ /**
+ * @alias Buffer.writeUInt32BE
+ * @since v14.9.0, v12.19.0
+ */
+ writeUint32BE(value: number, offset?: number): number;
+ /**
+ * Writes `value` to `buf` at the specified `offset`. `value` must be a valid
+ * signed 8-bit integer. Behavior is undefined when `value` is anything other than
+ * a signed 8-bit integer.
+ *
+ * `value` is interpreted and written as a two's complement signed integer.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(2);
+ *
+ * buf.writeInt8(2, 0);
+ * buf.writeInt8(-2, 1);
+ *
+ * console.log(buf);
+ * // Prints: <Buffer 02 fe>
+ * ```
+ * @since v0.5.0
+ * @param value Number to be written to `buf`.
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 1`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeInt8(value: number, offset?: number): number;
+ /**
+ * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid signed 16-bit integer. Behavior is undefined when `value` is
+ * anything other than a signed 16-bit integer.
+ *
+ * The `value` is interpreted and written as a two's complement signed integer.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(2);
+ *
+ * buf.writeInt16LE(0x0304, 0);
+ *
+ * console.log(buf);
+ * // Prints: <Buffer 04 03>
+ * ```
+ * @since v0.5.5
+ * @param value Number to be written to `buf`.
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeInt16LE(value: number, offset?: number): number;
+ /**
+ * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid signed 16-bit integer. Behavior is undefined when `value` is
+ * anything other than a signed 16-bit integer.
+ *
+ * The `value` is interpreted and written as a two's complement signed integer.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(2);
+ *
+ * buf.writeInt16BE(0x0102, 0);
+ *
+ * console.log(buf);
+ * // Prints: <Buffer 01 02>
+ * ```
+ * @since v0.5.5
+ * @param value Number to be written to `buf`.
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeInt16BE(value: number, offset?: number): number;
+ /**
+ * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid signed 32-bit integer. Behavior is undefined when `value` is
+ * anything other than a signed 32-bit integer.
+ *
+ * The `value` is interpreted and written as a two's complement signed integer.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(4);
+ *
+ * buf.writeInt32LE(0x05060708, 0);
+ *
+ * console.log(buf);
+ * // Prints: <Buffer 08 07 06 05>
+ * ```
+ * @since v0.5.5
+ * @param value Number to be written to `buf`.
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeInt32LE(value: number, offset?: number): number;
+ /**
+ * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid signed 32-bit integer. Behavior is undefined when `value` is
+ * anything other than a signed 32-bit integer.
+ *
+ * The `value` is interpreted and written as a two's complement signed integer.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(4);
+ *
+ * buf.writeInt32BE(0x01020304, 0);
+ *
+ * console.log(buf);
+ * // Prints: <Buffer 01 02 03 04>
+ * ```
+ * @since v0.5.5
+ * @param value Number to be written to `buf`.
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeInt32BE(value: number, offset?: number): number;
+ /**
+ * Writes `value` to `buf` at the specified `offset` as little-endian. Behavior is
+ * undefined when `value` is anything other than a JavaScript number.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(4);
+ *
+ * buf.writeFloatLE(0xcafebabe, 0);
+ *
+ * console.log(buf);
+ * // Prints: <Buffer bb fe 4a 4f>
+ * ```
+ * @since v0.11.15
+ * @param value Number to be written to `buf`.
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeFloatLE(value: number, offset?: number): number;
+ /**
+ * Writes `value` to `buf` at the specified `offset` as big-endian. Behavior is
+ * undefined when `value` is anything other than a JavaScript number.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(4);
+ *
+ * buf.writeFloatBE(0xcafebabe, 0);
+ *
+ * console.log(buf);
+ * // Prints: <Buffer 4f 4a fe bb>
+ * ```
+ * @since v0.11.15
+ * @param value Number to be written to `buf`.
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeFloatBE(value: number, offset?: number): number;
+ /**
+ * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a JavaScript number. Behavior is undefined when `value` is anything
+ * other than a JavaScript number.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(8);
+ *
+ * buf.writeDoubleLE(123.456, 0);
+ *
+ * console.log(buf);
+ * // Prints: <Buffer 77 be 9f 1a 2f dd 5e 40>
+ * ```
+ * @since v0.11.15
+ * @param value Number to be written to `buf`.
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 8`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeDoubleLE(value: number, offset?: number): number;
+ /**
+ * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a JavaScript number. Behavior is undefined when `value` is anything
+ * other than a JavaScript number.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(8);
+ *
+ * buf.writeDoubleBE(123.456, 0);
+ *
+ * console.log(buf);
+ * // Prints: <Buffer 40 5e dd 2f 1a 9f be 77>
+ * ```
+ * @since v0.11.15
+ * @param value Number to be written to `buf`.
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 8`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeDoubleBE(value: number, offset?: number): number;
+ /**
+ * Fills `buf` with the specified `value`. If the `offset` and `end` are not given,
+ * the entire `buf` will be filled:
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * // Fill a `Buffer` with the ASCII character 'h'.
+ *
+ * const b = Buffer.allocUnsafe(50).fill('h');
+ *
+ * console.log(b.toString());
+ * // Prints: hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
+ * ```
+ *
+ * `value` is coerced to a `uint32` value if it is not a string, `Buffer`, or
+ * integer. If the resulting integer is greater than `255` (decimal), `buf` will be
+ * filled with `value &#x26; 255`.
+ *
+ * If the final write of a `fill()` operation falls on a multi-byte character,
+ * then only the bytes of that character that fit into `buf` are written:
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * // Fill a `Buffer` with character that takes up two bytes in UTF-8.
+ *
+ * console.log(Buffer.allocUnsafe(5).fill('\u0222'));
+ * // Prints: <Buffer c8 a2 c8 a2 c8>
+ * ```
+ *
+ * If `value` contains invalid characters, it is truncated; if no valid
+ * fill data remains, an exception is thrown:
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(5);
+ *
+ * console.log(buf.fill('a'));
+ * // Prints: <Buffer 61 61 61 61 61>
+ * console.log(buf.fill('aazz', 'hex'));
+ * // Prints: <Buffer aa aa aa aa aa>
+ * console.log(buf.fill('zz', 'hex'));
+ * // Throws an exception.
+ * ```
+ * @since v0.5.0
+ * @param value The value with which to fill `buf`.
+ * @param [offset=0] Number of bytes to skip before starting to fill `buf`.
+ * @param [end=buf.length] Where to stop filling `buf` (not inclusive).
+ * @param [encoding='utf8'] The encoding for `value` if `value` is a string.
+ * @return A reference to `buf`.
+ */
+ fill(value: string | Uint8Array | number, offset?: number, end?: number, encoding?: BufferEncoding): this;
+ /**
+ * If `value` is:
+ *
+ * * a string, `value` is interpreted according to the character encoding in`encoding`.
+ * * a `Buffer` or [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array), `value` will be used in its entirety.
+ * To compare a partial `Buffer`, use `buf.subarray`.
+ * * a number, `value` will be interpreted as an unsigned 8-bit integer
+ * value between `0` and `255`.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from('this is a buffer');
+ *
+ * console.log(buf.indexOf('this'));
+ * // Prints: 0
+ * console.log(buf.indexOf('is'));
+ * // Prints: 2
+ * console.log(buf.indexOf(Buffer.from('a buffer')));
+ * // Prints: 8
+ * console.log(buf.indexOf(97));
+ * // Prints: 8 (97 is the decimal ASCII value for 'a')
+ * console.log(buf.indexOf(Buffer.from('a buffer example')));
+ * // Prints: -1
+ * console.log(buf.indexOf(Buffer.from('a buffer example').slice(0, 8)));
+ * // Prints: 8
+ *
+ * const utf16Buffer = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'utf16le');
+ *
+ * console.log(utf16Buffer.indexOf('\u03a3', 0, 'utf16le'));
+ * // Prints: 4
+ * console.log(utf16Buffer.indexOf('\u03a3', -4, 'utf16le'));
+ * // Prints: 6
+ * ```
+ *
+ * If `value` is not a string, number, or `Buffer`, this method will throw a`TypeError`. If `value` is a number, it will be coerced to a valid byte value,
+ * an integer between 0 and 255.
+ *
+ * If `byteOffset` is not a number, it will be coerced to a number. If the result
+ * of coercion is `NaN` or `0`, then the entire buffer will be searched. This
+ * behavior matches [`String.prototype.indexOf()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf).
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const b = Buffer.from('abcdef');
+ *
+ * // Passing a value that's a number, but not a valid byte.
+ * // Prints: 2, equivalent to searching for 99 or 'c'.
+ * console.log(b.indexOf(99.9));
+ * console.log(b.indexOf(256 + 99));
+ *
+ * // Passing a byteOffset that coerces to NaN or 0.
+ * // Prints: 1, searching the whole buffer.
+ * console.log(b.indexOf('b', undefined));
+ * console.log(b.indexOf('b', {}));
+ * console.log(b.indexOf('b', null));
+ * console.log(b.indexOf('b', []));
+ * ```
+ *
+ * If `value` is an empty string or empty `Buffer` and `byteOffset` is less
+ * than `buf.length`, `byteOffset` will be returned. If `value` is empty and`byteOffset` is at least `buf.length`, `buf.length` will be returned.
+ * @since v1.5.0
+ * @param value What to search for.
+ * @param [byteOffset=0] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`.
+ * @param [encoding='utf8'] If `value` is a string, this is the encoding used to determine the binary representation of the string that will be searched for in `buf`.
+ * @return The index of the first occurrence of `value` in `buf`, or `-1` if `buf` does not contain `value`.
+ */
+ indexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number;
+ /**
+ * Identical to `buf.indexOf()`, except the last occurrence of `value` is found
+ * rather than the first occurrence.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from('this buffer is a buffer');
+ *
+ * console.log(buf.lastIndexOf('this'));
+ * // Prints: 0
+ * console.log(buf.lastIndexOf('buffer'));
+ * // Prints: 17
+ * console.log(buf.lastIndexOf(Buffer.from('buffer')));
+ * // Prints: 17
+ * console.log(buf.lastIndexOf(97));
+ * // Prints: 15 (97 is the decimal ASCII value for 'a')
+ * console.log(buf.lastIndexOf(Buffer.from('yolo')));
+ * // Prints: -1
+ * console.log(buf.lastIndexOf('buffer', 5));
+ * // Prints: 5
+ * console.log(buf.lastIndexOf('buffer', 4));
+ * // Prints: -1
+ *
+ * const utf16Buffer = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'utf16le');
+ *
+ * console.log(utf16Buffer.lastIndexOf('\u03a3', undefined, 'utf16le'));
+ * // Prints: 6
+ * console.log(utf16Buffer.lastIndexOf('\u03a3', -5, 'utf16le'));
+ * // Prints: 4
+ * ```
+ *
+ * If `value` is not a string, number, or `Buffer`, this method will throw a`TypeError`. If `value` is a number, it will be coerced to a valid byte value,
+ * an integer between 0 and 255.
+ *
+ * If `byteOffset` is not a number, it will be coerced to a number. Any arguments
+ * that coerce to `NaN`, like `{}` or `undefined`, will search the whole buffer.
+ * This behavior matches [`String.prototype.lastIndexOf()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf).
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const b = Buffer.from('abcdef');
+ *
+ * // Passing a value that's a number, but not a valid byte.
+ * // Prints: 2, equivalent to searching for 99 or 'c'.
+ * console.log(b.lastIndexOf(99.9));
+ * console.log(b.lastIndexOf(256 + 99));
+ *
+ * // Passing a byteOffset that coerces to NaN.
+ * // Prints: 1, searching the whole buffer.
+ * console.log(b.lastIndexOf('b', undefined));
+ * console.log(b.lastIndexOf('b', {}));
+ *
+ * // Passing a byteOffset that coerces to 0.
+ * // Prints: -1, equivalent to passing 0.
+ * console.log(b.lastIndexOf('b', null));
+ * console.log(b.lastIndexOf('b', []));
+ * ```
+ *
+ * If `value` is an empty string or empty `Buffer`, `byteOffset` will be returned.
+ * @since v6.0.0
+ * @param value What to search for.
+ * @param [byteOffset=buf.length - 1] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`.
+ * @param [encoding='utf8'] If `value` is a string, this is the encoding used to determine the binary representation of the string that will be searched for in `buf`.
+ * @return The index of the last occurrence of `value` in `buf`, or `-1` if `buf` does not contain `value`.
+ */
+ lastIndexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number;
+ /**
+ * Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) of `[index, byte]` pairs from the contents
+ * of `buf`.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * // Log the entire contents of a `Buffer`.
+ *
+ * const buf = Buffer.from('buffer');
+ *
+ * for (const pair of buf.entries()) {
+ * console.log(pair);
+ * }
+ * // Prints:
+ * // [0, 98]
+ * // [1, 117]
+ * // [2, 102]
+ * // [3, 102]
+ * // [4, 101]
+ * // [5, 114]
+ * ```
+ * @since v1.1.0
+ */
+ entries(): IterableIterator<[number, number]>;
+ /**
+ * Equivalent to `buf.indexOf() !== -1`.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from('this is a buffer');
+ *
+ * console.log(buf.includes('this'));
+ * // Prints: true
+ * console.log(buf.includes('is'));
+ * // Prints: true
+ * console.log(buf.includes(Buffer.from('a buffer')));
+ * // Prints: true
+ * console.log(buf.includes(97));
+ * // Prints: true (97 is the decimal ASCII value for 'a')
+ * console.log(buf.includes(Buffer.from('a buffer example')));
+ * // Prints: false
+ * console.log(buf.includes(Buffer.from('a buffer example').slice(0, 8)));
+ * // Prints: true
+ * console.log(buf.includes('this', 4));
+ * // Prints: false
+ * ```
+ * @since v5.3.0
+ * @param value What to search for.
+ * @param [byteOffset=0] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`.
+ * @param [encoding='utf8'] If `value` is a string, this is its encoding.
+ * @return `true` if `value` was found in `buf`, `false` otherwise.
+ */
+ includes(value: string | number | Buffer, byteOffset?: number, encoding?: BufferEncoding): boolean;
+ /**
+ * Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) of `buf` keys (indices).
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from('buffer');
+ *
+ * for (const key of buf.keys()) {
+ * console.log(key);
+ * }
+ * // Prints:
+ * // 0
+ * // 1
+ * // 2
+ * // 3
+ * // 4
+ * // 5
+ * ```
+ * @since v1.1.0
+ */
+ keys(): IterableIterator<number>;
+ /**
+ * Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) for `buf` values (bytes). This function is
+ * called automatically when a `Buffer` is used in a `for..of` statement.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from('buffer');
+ *
+ * for (const value of buf.values()) {
+ * console.log(value);
+ * }
+ * // Prints:
+ * // 98
+ * // 117
+ * // 102
+ * // 102
+ * // 101
+ * // 114
+ *
+ * for (const value of buf) {
+ * console.log(value);
+ * }
+ * // Prints:
+ * // 98
+ * // 117
+ * // 102
+ * // 102
+ * // 101
+ * // 114
+ * ```
+ * @since v1.1.0
+ */
+ values(): IterableIterator<number>;
+ }
+ var Buffer: BufferConstructor;
+ /**
+ * Decodes a string of Base64-encoded data into bytes, and encodes those bytes
+ * into a string using Latin-1 (ISO-8859-1).
+ *
+ * The `data` may be any JavaScript-value that can be coerced into a string.
+ *
+ * **This function is only provided for compatibility with legacy web platform APIs**
+ * **and should never be used in new code, because they use strings to represent**
+ * **binary data and predate the introduction of typed arrays in JavaScript.**
+ * **For code running using Node.js APIs, converting between base64-encoded strings**
+ * **and binary data should be performed using `Buffer.from(str, 'base64')` and`buf.toString('base64')`.**
+ * @since v15.13.0, v14.17.0
+ * @legacy Use `Buffer.from(data, 'base64')` instead.
+ * @param data The Base64-encoded input string.
+ */
+ function atob(data: string): string;
+ /**
+ * Decodes a string into bytes using Latin-1 (ISO-8859), and encodes those bytes
+ * into a string using Base64.
+ *
+ * The `data` may be any JavaScript-value that can be coerced into a string.
+ *
+ * **This function is only provided for compatibility with legacy web platform APIs**
+ * **and should never be used in new code, because they use strings to represent**
+ * **binary data and predate the introduction of typed arrays in JavaScript.**
+ * **For code running using Node.js APIs, converting between base64-encoded strings**
+ * **and binary data should be performed using `Buffer.from(str, 'base64')` and`buf.toString('base64')`.**
+ * @since v15.13.0, v14.17.0
+ * @legacy Use `buf.toString('base64')` instead.
+ * @param data An ASCII (Latin1) string.
+ */
+ function btoa(data: string): string;
+
+ interface Blob extends __Blob {}
+ /**
+ * `Blob` class is a global reference for `require('node:buffer').Blob`
+ * https://nodejs.org/api/buffer.html#class-blob
+ * @since v18.0.0
+ */
+ var Blob: typeof globalThis extends {
+ onmessage: any;
+ Blob: infer T;
+ } ? T
+ : typeof NodeBlob;
+ }
+}
+declare module "node:buffer" {
+ export * from "buffer";
+}
diff --git a/client/node_modules/@types/node/ts4.8/child_process.d.ts b/client/node_modules/@types/node/ts4.8/child_process.d.ts
new file mode 100644
index 0000000..6c7a2c1
--- /dev/null
+++ b/client/node_modules/@types/node/ts4.8/child_process.d.ts
@@ -0,0 +1,1544 @@
+/**
+ * The `child_process` module provides the ability to spawn subprocesses in
+ * a manner that is similar, but not identical, to [`popen(3)`](http://man7.org/linux/man-pages/man3/popen.3.html). This capability
+ * is primarily provided by the {@link spawn} function:
+ *
+ * ```js
+ * const { spawn } = require('child_process');
+ * const ls = spawn('ls', ['-lh', '/usr']);
+ *
+ * ls.stdout.on('data', (data) => {
+ * console.log(`stdout: ${data}`);
+ * });
+ *
+ * ls.stderr.on('data', (data) => {
+ * console.error(`stderr: ${data}`);
+ * });
+ *
+ * ls.on('close', (code) => {
+ * console.log(`child process exited with code ${code}`);
+ * });
+ * ```
+ *
+ * By default, pipes for `stdin`, `stdout`, and `stderr` are established between
+ * the parent Node.js process and the spawned subprocess. These pipes have
+ * limited (and platform-specific) capacity. If the subprocess writes to
+ * stdout in excess of that limit without the output being captured, the
+ * subprocess blocks waiting for the pipe buffer to accept more data. This is
+ * identical to the behavior of pipes in the shell. Use the `{ stdio: 'ignore' }`option if the output will not be consumed.
+ *
+ * The command lookup is performed using the `options.env.PATH` environment
+ * variable if `env` is in the `options` object. Otherwise, `process.env.PATH` is
+ * used. If `options.env` is set without `PATH`, lookup on Unix is performed
+ * on a default search path search of `/usr/bin:/bin` (see your operating system's
+ * manual for execvpe/execvp), on Windows the current processes environment
+ * variable `PATH` is used.
+ *
+ * On Windows, environment variables are case-insensitive. Node.js
+ * lexicographically sorts the `env` keys and uses the first one that
+ * case-insensitively matches. Only first (in lexicographic order) entry will be
+ * passed to the subprocess. This might lead to issues on Windows when passing
+ * objects to the `env` option that have multiple variants of the same key, such as`PATH` and `Path`.
+ *
+ * The {@link spawn} method spawns the child process asynchronously,
+ * without blocking the Node.js event loop. The {@link spawnSync} function provides equivalent functionality in a synchronous manner that blocks
+ * the event loop until the spawned process either exits or is terminated.
+ *
+ * For convenience, the `child_process` module provides a handful of synchronous
+ * and asynchronous alternatives to {@link spawn} and {@link spawnSync}. Each of these alternatives are implemented on
+ * top of {@link spawn} or {@link spawnSync}.
+ *
+ * * {@link exec}: spawns a shell and runs a command within that
+ * shell, passing the `stdout` and `stderr` to a callback function when
+ * complete.
+ * * {@link execFile}: similar to {@link exec} except
+ * that it spawns the command directly without first spawning a shell by
+ * default.
+ * * {@link fork}: spawns a new Node.js process and invokes a
+ * specified module with an IPC communication channel established that allows
+ * sending messages between parent and child.
+ * * {@link execSync}: a synchronous version of {@link exec} that will block the Node.js event loop.
+ * * {@link execFileSync}: a synchronous version of {@link execFile} that will block the Node.js event loop.
+ *
+ * For certain use cases, such as automating shell scripts, the `synchronous counterparts` may be more convenient. In many cases, however,
+ * the synchronous methods can have significant impact on performance due to
+ * stalling the event loop while spawned processes complete.
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/child_process.js)
+ */
+declare module "child_process" {
+ import { ObjectEncodingOptions } from "node:fs";
+ import { Abortable, EventEmitter } from "node:events";
+ import * as net from "node:net";
+ import { Pipe, Readable, Stream, Writable } from "node:stream";
+ import { URL } from "node:url";
+ type Serializable = string | object | number | boolean | bigint;
+ type SendHandle = net.Socket | net.Server;
+ /**
+ * Instances of the `ChildProcess` represent spawned child processes.
+ *
+ * Instances of `ChildProcess` are not intended to be created directly. Rather,
+ * use the {@link spawn}, {@link exec},{@link execFile}, or {@link fork} methods to create
+ * instances of `ChildProcess`.
+ * @since v2.2.0
+ */
+ class ChildProcess extends EventEmitter {
+ /**
+ * A `Writable Stream` that represents the child process's `stdin`.
+ *
+ * If a child process waits to read all of its input, the child will not continue
+ * until this stream has been closed via `end()`.
+ *
+ * If the child was spawned with `stdio[0]` set to anything other than `'pipe'`,
+ * then this will be `null`.
+ *
+ * `subprocess.stdin` is an alias for `subprocess.stdio[0]`. Both properties will
+ * refer to the same value.
+ *
+ * The `subprocess.stdin` property can be `undefined` if the child process could
+ * not be successfully spawned.
+ * @since v0.1.90
+ */
+ stdin: Writable | null;
+ /**
+ * A `Readable Stream` that represents the child process's `stdout`.
+ *
+ * If the child was spawned with `stdio[1]` set to anything other than `'pipe'`,
+ * then this will be `null`.
+ *
+ * `subprocess.stdout` is an alias for `subprocess.stdio[1]`. Both properties will
+ * refer to the same value.
+ *
+ * ```js
+ * const { spawn } = require('child_process');
+ *
+ * const subprocess = spawn('ls');
+ *
+ * subprocess.stdout.on('data', (data) => {
+ * console.log(`Received chunk ${data}`);
+ * });
+ * ```
+ *
+ * The `subprocess.stdout` property can be `null` if the child process could
+ * not be successfully spawned.
+ * @since v0.1.90
+ */
+ stdout: Readable | null;
+ /**
+ * A `Readable Stream` that represents the child process's `stderr`.
+ *
+ * If the child was spawned with `stdio[2]` set to anything other than `'pipe'`,
+ * then this will be `null`.
+ *
+ * `subprocess.stderr` is an alias for `subprocess.stdio[2]`. Both properties will
+ * refer to the same value.
+ *
+ * The `subprocess.stderr` property can be `null` if the child process could
+ * not be successfully spawned.
+ * @since v0.1.90
+ */
+ stderr: Readable | null;
+ /**
+ * The `subprocess.channel` property is a reference to the child's IPC channel. If
+ * no IPC channel currently exists, this property is `undefined`.
+ * @since v7.1.0
+ */
+ readonly channel?: Pipe | null | undefined;
+ /**
+ * A sparse array of pipes to the child process, corresponding with positions in
+ * the `stdio` option passed to {@link spawn} that have been set
+ * to the value `'pipe'`. `subprocess.stdio[0]`, `subprocess.stdio[1]`, and`subprocess.stdio[2]` are also available as `subprocess.stdin`,`subprocess.stdout`, and `subprocess.stderr`,
+ * respectively.
+ *
+ * In the following example, only the child's fd `1` (stdout) is configured as a
+ * pipe, so only the parent's `subprocess.stdio[1]` is a stream, all other values
+ * in the array are `null`.
+ *
+ * ```js
+ * const assert = require('assert');
+ * const fs = require('fs');
+ * const child_process = require('child_process');
+ *
+ * const subprocess = child_process.spawn('ls', {
+ * stdio: [
+ * 0, // Use parent's stdin for child.
+ * 'pipe', // Pipe child's stdout to parent.
+ * fs.openSync('err.out', 'w'), // Direct child's stderr to a file.
+ * ]
+ * });
+ *
+ * assert.strictEqual(subprocess.stdio[0], null);
+ * assert.strictEqual(subprocess.stdio[0], subprocess.stdin);
+ *
+ * assert(subprocess.stdout);
+ * assert.strictEqual(subprocess.stdio[1], subprocess.stdout);
+ *
+ * assert.strictEqual(subprocess.stdio[2], null);
+ * assert.strictEqual(subprocess.stdio[2], subprocess.stderr);
+ * ```
+ *
+ * The `subprocess.stdio` property can be `undefined` if the child process could
+ * not be successfully spawned.
+ * @since v0.7.10
+ */
+ readonly stdio: [
+ Writable | null,
+ // stdin
+ Readable | null,
+ // stdout
+ Readable | null,
+ // stderr
+ Readable | Writable | null | undefined,
+ // extra
+ Readable | Writable | null | undefined, // extra
+ ];
+ /**
+ * The `subprocess.killed` property indicates whether the child process
+ * successfully received a signal from `subprocess.kill()`. The `killed` property
+ * does not indicate that the child process has been terminated.
+ * @since v0.5.10
+ */
+ readonly killed: boolean;
+ /**
+ * Returns the process identifier (PID) of the child process. If the child process
+ * fails to spawn due to errors, then the value is `undefined` and `error` is
+ * emitted.
+ *
+ * ```js
+ * const { spawn } = require('child_process');
+ * const grep = spawn('grep', ['ssh']);
+ *
+ * console.log(`Spawned child pid: ${grep.pid}`);
+ * grep.stdin.end();
+ * ```
+ * @since v0.1.90
+ */
+ readonly pid?: number | undefined;
+ /**
+ * The `subprocess.connected` property indicates whether it is still possible to
+ * send and receive messages from a child process. When `subprocess.connected` is`false`, it is no longer possible to send or receive messages.
+ * @since v0.7.2
+ */
+ readonly connected: boolean;
+ /**
+ * The `subprocess.exitCode` property indicates the exit code of the child process.
+ * If the child process is still running, the field will be `null`.
+ */
+ readonly exitCode: number | null;
+ /**
+ * The `subprocess.signalCode` property indicates the signal received by
+ * the child process if any, else `null`.
+ */
+ readonly signalCode: NodeJS.Signals | null;
+ /**
+ * The `subprocess.spawnargs` property represents the full list of command-line
+ * arguments the child process was launched with.
+ */
+ readonly spawnargs: string[];
+ /**
+ * The `subprocess.spawnfile` property indicates the executable file name of
+ * the child process that is launched.
+ *
+ * For {@link fork}, its value will be equal to `process.execPath`.
+ * For {@link spawn}, its value will be the name of
+ * the executable file.
+ * For {@link exec}, its value will be the name of the shell
+ * in which the child process is launched.
+ */
+ readonly spawnfile: string;
+ /**
+ * The `subprocess.kill()` method sends a signal to the child process. If no
+ * argument is given, the process will be sent the `'SIGTERM'` signal. See [`signal(7)`](http://man7.org/linux/man-pages/man7/signal.7.html) for a list of available signals. This function
+ * returns `true` if [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) succeeds, and `false` otherwise.
+ *
+ * ```js
+ * const { spawn } = require('child_process');
+ * const grep = spawn('grep', ['ssh']);
+ *
+ * grep.on('close', (code, signal) => {
+ * console.log(
+ * `child process terminated due to receipt of signal ${signal}`);
+ * });
+ *
+ * // Send SIGHUP to process.
+ * grep.kill('SIGHUP');
+ * ```
+ *
+ * The `ChildProcess` object may emit an `'error'` event if the signal
+ * cannot be delivered. Sending a signal to a child process that has already exited
+ * is not an error but may have unforeseen consequences. Specifically, if the
+ * process identifier (PID) has been reassigned to another process, the signal will
+ * be delivered to that process instead which can have unexpected results.
+ *
+ * While the function is called `kill`, the signal delivered to the child process
+ * may not actually terminate the process.
+ *
+ * See [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) for reference.
+ *
+ * On Windows, where POSIX signals do not exist, the `signal` argument will be
+ * ignored, and the process will be killed forcefully and abruptly (similar to`'SIGKILL'`).
+ * See `Signal Events` for more details.
+ *
+ * On Linux, child processes of child processes will not be terminated
+ * when attempting to kill their parent. This is likely to happen when running a
+ * new process in a shell or with the use of the `shell` option of `ChildProcess`:
+ *
+ * ```js
+ * 'use strict';
+ * const { spawn } = require('child_process');
+ *
+ * const subprocess = spawn(
+ * 'sh',
+ * [
+ * '-c',
+ * `node -e "setInterval(() => {
+ * console.log(process.pid, 'is alive')
+ * }, 500);"`,
+ * ], {
+ * stdio: ['inherit', 'inherit', 'inherit']
+ * }
+ * );
+ *
+ * setTimeout(() => {
+ * subprocess.kill(); // Does not terminate the Node.js process in the shell.
+ * }, 2000);
+ * ```
+ * @since v0.1.90
+ */
+ kill(signal?: NodeJS.Signals | number): boolean;
+ /**
+ * Calls {@link ChildProcess.kill} with `'SIGTERM'`.
+ * @since v18.18.0
+ */
+ [Symbol.dispose](): void;
+ /**
+ * When an IPC channel has been established between the parent and child (
+ * i.e. when using {@link fork}), the `subprocess.send()` method can
+ * be used to send messages to the child process. When the child process is a
+ * Node.js instance, these messages can be received via the `'message'` event.
+ *
+ * The message goes through serialization and parsing. The resulting
+ * message might not be the same as what is originally sent.
+ *
+ * For example, in the parent script:
+ *
+ * ```js
+ * const cp = require('child_process');
+ * const n = cp.fork(`${__dirname}/sub.js`);
+ *
+ * n.on('message', (m) => {
+ * console.log('PARENT got message:', m);
+ * });
+ *
+ * // Causes the child to print: CHILD got message: { hello: 'world' }
+ * n.send({ hello: 'world' });
+ * ```
+ *
+ * And then the child script, `'sub.js'` might look like this:
+ *
+ * ```js
+ * process.on('message', (m) => {
+ * console.log('CHILD got message:', m);
+ * });
+ *
+ * // Causes the parent to print: PARENT got message: { foo: 'bar', baz: null }
+ * process.send({ foo: 'bar', baz: NaN });
+ * ```
+ *
+ * Child Node.js processes will have a `process.send()` method of their own
+ * that allows the child to send messages back to the parent.
+ *
+ * There is a special case when sending a `{cmd: 'NODE_foo'}` message. Messages
+ * containing a `NODE_` prefix in the `cmd` property are reserved for use within
+ * Node.js core and will not be emitted in the child's `'message'` event. Rather, such messages are emitted using the`'internalMessage'` event and are consumed internally by Node.js.
+ * Applications should avoid using such messages or listening for`'internalMessage'` events as it is subject to change without notice.
+ *
+ * The optional `sendHandle` argument that may be passed to `subprocess.send()` is
+ * for passing a TCP server or socket object to the child process. The child will
+ * receive the object as the second argument passed to the callback function
+ * registered on the `'message'` event. Any data that is received
+ * and buffered in the socket will not be sent to the child.
+ *
+ * The optional `callback` is a function that is invoked after the message is
+ * sent but before the child may have received it. The function is called with a
+ * single argument: `null` on success, or an `Error` object on failure.
+ *
+ * If no `callback` function is provided and the message cannot be sent, an`'error'` event will be emitted by the `ChildProcess` object. This can
+ * happen, for instance, when the child process has already exited.
+ *
+ * `subprocess.send()` will return `false` if the channel has closed or when the
+ * backlog of unsent messages exceeds a threshold that makes it unwise to send
+ * more. Otherwise, the method returns `true`. The `callback` function can be
+ * used to implement flow control.
+ *
+ * #### Example: sending a server object
+ *
+ * The `sendHandle` argument can be used, for instance, to pass the handle of
+ * a TCP server object to the child process as illustrated in the example below:
+ *
+ * ```js
+ * const subprocess = require('child_process').fork('subprocess.js');
+ *
+ * // Open up the server object and send the handle.
+ * const server = require('net').createServer();
+ * server.on('connection', (socket) => {
+ * socket.end('handled by parent');
+ * });
+ * server.listen(1337, () => {
+ * subprocess.send('server', server);
+ * });
+ * ```
+ *
+ * The child would then receive the server object as:
+ *
+ * ```js
+ * process.on('message', (m, server) => {
+ * if (m === 'server') {
+ * server.on('connection', (socket) => {
+ * socket.end('handled by child');
+ * });
+ * }
+ * });
+ * ```
+ *
+ * Once the server is now shared between the parent and child, some connections
+ * can be handled by the parent and some by the child.
+ *
+ * While the example above uses a server created using the `net` module, `dgram`module servers use exactly the same workflow with the exceptions of listening on
+ * a `'message'` event instead of `'connection'` and using `server.bind()` instead
+ * of `server.listen()`. This is, however, currently only supported on Unix
+ * platforms.
+ *
+ * #### Example: sending a socket object
+ *
+ * Similarly, the `sendHandler` argument can be used to pass the handle of a
+ * socket to the child process. The example below spawns two children that each
+ * handle connections with "normal" or "special" priority:
+ *
+ * ```js
+ * const { fork } = require('child_process');
+ * const normal = fork('subprocess.js', ['normal']);
+ * const special = fork('subprocess.js', ['special']);
+ *
+ * // Open up the server and send sockets to child. Use pauseOnConnect to prevent
+ * // the sockets from being read before they are sent to the child process.
+ * const server = require('net').createServer({ pauseOnConnect: true });
+ * server.on('connection', (socket) => {
+ *
+ * // If this is special priority...
+ * if (socket.remoteAddress === '74.125.127.100') {
+ * special.send('socket', socket);
+ * return;
+ * }
+ * // This is normal priority.
+ * normal.send('socket', socket);
+ * });
+ * server.listen(1337);
+ * ```
+ *
+ * The `subprocess.js` would receive the socket handle as the second argument
+ * passed to the event callback function:
+ *
+ * ```js
+ * process.on('message', (m, socket) => {
+ * if (m === 'socket') {
+ * if (socket) {
+ * // Check that the client socket exists.
+ * // It is possible for the socket to be closed between the time it is
+ * // sent and the time it is received in the child process.
+ * socket.end(`Request handled with ${process.argv[2]} priority`);
+ * }
+ * }
+ * });
+ * ```
+ *
+ * Do not use `.maxConnections` on a socket that has been passed to a subprocess.
+ * The parent cannot track when the socket is destroyed.
+ *
+ * Any `'message'` handlers in the subprocess should verify that `socket` exists,
+ * as the connection may have been closed during the time it takes to send the
+ * connection to the child.
+ * @since v0.5.9
+ * @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: Serializable, callback?: (error: Error | null) => void): boolean;
+ send(message: Serializable, sendHandle?: SendHandle, callback?: (error: Error | null) => void): boolean;
+ send(
+ message: Serializable,
+ sendHandle?: SendHandle,
+ options?: MessageOptions,
+ callback?: (error: Error | null) => void,
+ ): boolean;
+ /**
+ * Closes the IPC channel between parent and child, allowing the child to exit
+ * gracefully once there are no other connections keeping it alive. After calling
+ * this method the `subprocess.connected` and `process.connected` properties in
+ * both the parent and child (respectively) will be set to `false`, and it will be
+ * no longer possible to pass messages between the processes.
+ *
+ * The `'disconnect'` event will be emitted when there are no messages in the
+ * process of being received. This will most often be triggered immediately after
+ * calling `subprocess.disconnect()`.
+ *
+ * When the child process is a Node.js instance (e.g. spawned using {@link fork}), the `process.disconnect()` method can be invoked
+ * within the child process to close the IPC channel as well.
+ * @since v0.7.2
+ */
+ disconnect(): void;
+ /**
+ * By default, the parent will wait for the detached child to exit. To prevent the
+ * parent from waiting for a given `subprocess` to exit, use the`subprocess.unref()` method. Doing so will cause the parent's event loop to not
+ * include the child in its reference count, allowing the parent to exit
+ * independently of the child, unless there is an established IPC channel between
+ * the child and the parent.
+ *
+ * ```js
+ * const { spawn } = require('child_process');
+ *
+ * const subprocess = spawn(process.argv[0], ['child_program.js'], {
+ * detached: true,
+ * stdio: 'ignore'
+ * });
+ *
+ * subprocess.unref();
+ * ```
+ * @since v0.7.10
+ */
+ unref(): void;
+ /**
+ * Calling `subprocess.ref()` after making a call to `subprocess.unref()` will
+ * restore the removed reference count for the child process, forcing the parent
+ * to wait for the child to exit before exiting itself.
+ *
+ * ```js
+ * const { spawn } = require('child_process');
+ *
+ * const subprocess = spawn(process.argv[0], ['child_program.js'], {
+ * detached: true,
+ * stdio: 'ignore'
+ * });
+ *
+ * subprocess.unref();
+ * subprocess.ref();
+ * ```
+ * @since v0.7.10
+ */
+ ref(): void;
+ /**
+ * events.EventEmitter
+ * 1. close
+ * 2. disconnect
+ * 3. error
+ * 4. exit
+ * 5. message
+ * 6. spawn
+ */
+ addListener(event: string, listener: (...args: any[]) => void): this;
+ addListener(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
+ addListener(event: "disconnect", listener: () => void): this;
+ addListener(event: "error", listener: (err: Error) => void): this;
+ addListener(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
+ addListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
+ addListener(event: "spawn", listener: () => void): this;
+ emit(event: string | symbol, ...args: any[]): boolean;
+ emit(event: "close", code: number | null, signal: NodeJS.Signals | null): boolean;
+ emit(event: "disconnect"): boolean;
+ emit(event: "error", err: Error): boolean;
+ emit(event: "exit", code: number | null, signal: NodeJS.Signals | null): boolean;
+ emit(event: "message", message: Serializable, sendHandle: SendHandle): boolean;
+ emit(event: "spawn", listener: () => void): boolean;
+ on(event: string, listener: (...args: any[]) => void): this;
+ on(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
+ on(event: "disconnect", listener: () => void): this;
+ on(event: "error", listener: (err: Error) => void): this;
+ on(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
+ on(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
+ on(event: "spawn", listener: () => void): this;
+ once(event: string, listener: (...args: any[]) => void): this;
+ once(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
+ once(event: "disconnect", listener: () => void): this;
+ once(event: "error", listener: (err: Error) => void): this;
+ once(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
+ once(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
+ once(event: "spawn", listener: () => void): this;
+ prependListener(event: string, listener: (...args: any[]) => void): this;
+ prependListener(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
+ prependListener(event: "disconnect", listener: () => void): this;
+ prependListener(event: "error", listener: (err: Error) => void): this;
+ prependListener(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
+ prependListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
+ prependListener(event: "spawn", listener: () => void): this;
+ prependOnceListener(event: string, listener: (...args: any[]) => void): this;
+ prependOnceListener(
+ event: "close",
+ listener: (code: number | null, signal: NodeJS.Signals | null) => void,
+ ): this;
+ prependOnceListener(event: "disconnect", listener: () => void): this;
+ prependOnceListener(event: "error", listener: (err: Error) => void): this;
+ prependOnceListener(
+ event: "exit",
+ listener: (code: number | null, signal: NodeJS.Signals | null) => void,
+ ): this;
+ prependOnceListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
+ prependOnceListener(event: "spawn", listener: () => void): this;
+ }
+ // return this object when stdio option is undefined or not specified
+ interface ChildProcessWithoutNullStreams extends ChildProcess {
+ stdin: Writable;
+ stdout: Readable;
+ stderr: Readable;
+ readonly stdio: [
+ Writable,
+ Readable,
+ Readable,
+ // stderr
+ Readable | Writable | null | undefined,
+ // extra, no modification
+ Readable | Writable | null | undefined, // extra, no modification
+ ];
+ }
+ // return this object when stdio option is a tuple of 3
+ interface ChildProcessByStdio<I extends null | Writable, O extends null | Readable, E extends null | Readable>
+ extends ChildProcess
+ {
+ stdin: I;
+ stdout: O;
+ stderr: E;
+ readonly stdio: [
+ I,
+ O,
+ E,
+ Readable | Writable | null | undefined,
+ // extra, no modification
+ Readable | Writable | null | undefined, // extra, no modification
+ ];
+ }
+ interface MessageOptions {
+ keepOpen?: boolean | undefined;
+ }
+ type IOType = "overlapped" | "pipe" | "ignore" | "inherit";
+ type StdioOptions = IOType | Array<IOType | "ipc" | Stream | number | null | undefined>;
+ type SerializationType = "json" | "advanced";
+ interface MessagingOptions extends Abortable {
+ /**
+ * Specify the kind of serialization used for sending messages between processes.
+ * @default 'json'
+ */
+ serialization?: SerializationType | undefined;
+ /**
+ * The signal value to be used when the spawned process will be killed by the abort signal.
+ * @default 'SIGTERM'
+ */
+ killSignal?: NodeJS.Signals | number | undefined;
+ /**
+ * In milliseconds the maximum amount of time the process is allowed to run.
+ */
+ timeout?: number | undefined;
+ }
+ interface ProcessEnvOptions {
+ uid?: number | undefined;
+ gid?: number | undefined;
+ cwd?: string | URL | undefined;
+ env?: NodeJS.ProcessEnv | undefined;
+ }
+ interface CommonOptions extends ProcessEnvOptions {
+ /**
+ * @default false
+ */
+ windowsHide?: boolean | undefined;
+ /**
+ * @default 0
+ */
+ timeout?: number | undefined;
+ }
+ interface CommonSpawnOptions extends CommonOptions, MessagingOptions, Abortable {
+ argv0?: string | undefined;
+ /**
+ * Can be set to 'pipe', 'inherit', 'overlapped', or 'ignore', or an array of these strings.
+ * If passed as an array, the first element is used for `stdin`, the second for
+ * `stdout`, and the third for `stderr`. A fourth element can be used to
+ * specify the `stdio` behavior beyond the standard streams. See
+ * {@link ChildProcess.stdio} for more information.
+ *
+ * @default 'pipe'
+ */
+ stdio?: StdioOptions | undefined;
+ shell?: boolean | string | undefined;
+ windowsVerbatimArguments?: boolean | undefined;
+ }
+ interface SpawnOptions extends CommonSpawnOptions {
+ detached?: boolean | undefined;
+ }
+ interface SpawnOptionsWithoutStdio extends SpawnOptions {
+ stdio?: StdioPipeNamed | StdioPipe[] | undefined;
+ }
+ type StdioNull = "inherit" | "ignore" | Stream;
+ type StdioPipeNamed = "pipe" | "overlapped";
+ type StdioPipe = undefined | null | StdioPipeNamed;
+ interface SpawnOptionsWithStdioTuple<
+ Stdin extends StdioNull | StdioPipe,
+ Stdout extends StdioNull | StdioPipe,
+ Stderr extends StdioNull | StdioPipe,
+ > extends SpawnOptions {
+ stdio: [Stdin, Stdout, Stderr];
+ }
+ /**
+ * The `child_process.spawn()` method spawns a new process using the given`command`, with command-line arguments in `args`. If omitted, `args` defaults
+ * to an empty array.
+ *
+ * **If the `shell` option is enabled, do not pass unsanitized user input to this**
+ * **function. Any input containing shell metacharacters may be used to trigger**
+ * **arbitrary command execution.**
+ *
+ * A third argument may be used to specify additional options, with these defaults:
+ *
+ * ```js
+ * const defaults = {
+ * cwd: undefined,
+ * env: process.env
+ * };
+ * ```
+ *
+ * Use `cwd` to specify the working directory from which the process is spawned.
+ * If not given, the default is to inherit the current working directory. If given,
+ * but the path does not exist, the child process emits an `ENOENT` error
+ * and exits immediately. `ENOENT` is also emitted when the command
+ * does not exist.
+ *
+ * Use `env` to specify environment variables that will be visible to the new
+ * process, the default is `process.env`.
+ *
+ * `undefined` values in `env` will be ignored.
+ *
+ * Example of running `ls -lh /usr`, capturing `stdout`, `stderr`, and the
+ * exit code:
+ *
+ * ```js
+ * const { spawn } = require('child_process');
+ * const ls = spawn('ls', ['-lh', '/usr']);
+ *
+ * ls.stdout.on('data', (data) => {
+ * console.log(`stdout: ${data}`);
+ * });
+ *
+ * ls.stderr.on('data', (data) => {
+ * console.error(`stderr: ${data}`);
+ * });
+ *
+ * ls.on('close', (code) => {
+ * console.log(`child process exited with code ${code}`);
+ * });
+ * ```
+ *
+ * Example: A very elaborate way to run `ps ax | grep ssh`
+ *
+ * ```js
+ * const { spawn } = require('child_process');
+ * const ps = spawn('ps', ['ax']);
+ * const grep = spawn('grep', ['ssh']);
+ *
+ * ps.stdout.on('data', (data) => {
+ * grep.stdin.write(data);
+ * });
+ *
+ * ps.stderr.on('data', (data) => {
+ * console.error(`ps stderr: ${data}`);
+ * });
+ *
+ * ps.on('close', (code) => {
+ * if (code !== 0) {
+ * console.log(`ps process exited with code ${code}`);
+ * }
+ * grep.stdin.end();
+ * });
+ *
+ * grep.stdout.on('data', (data) => {
+ * console.log(data.toString());
+ * });
+ *
+ * grep.stderr.on('data', (data) => {
+ * console.error(`grep stderr: ${data}`);
+ * });
+ *
+ * grep.on('close', (code) => {
+ * if (code !== 0) {
+ * console.log(`grep process exited with code ${code}`);
+ * }
+ * });
+ * ```
+ *
+ * Example of checking for failed `spawn`:
+ *
+ * ```js
+ * const { spawn } = require('child_process');
+ * const subprocess = spawn('bad_command');
+ *
+ * subprocess.on('error', (err) => {
+ * console.error('Failed to start subprocess.');
+ * });
+ * ```
+ *
+ * Certain platforms (macOS, Linux) will use the value of `argv[0]` for the process
+ * title while others (Windows, SunOS) will use `command`.
+ *
+ * Node.js currently overwrites `argv[0]` with `process.execPath` on startup, so`process.argv[0]` in a Node.js child process will not match the `argv0`parameter passed to `spawn` from the parent,
+ * retrieve it with the`process.argv0` property instead.
+ *
+ * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except
+ * the error passed to the callback will be an `AbortError`:
+ *
+ * ```js
+ * const { spawn } = require('child_process');
+ * const controller = new AbortController();
+ * const { signal } = controller;
+ * const grep = spawn('grep', ['ssh'], { signal });
+ * grep.on('error', (err) => {
+ * // This will be called with err being an AbortError if the controller aborts
+ * });
+ * controller.abort(); // Stops the child process
+ * ```
+ * @since v0.1.90
+ * @param command The command to run.
+ * @param args List of string arguments.
+ */
+ function spawn(command: string, options?: SpawnOptionsWithoutStdio): ChildProcessWithoutNullStreams;
+ function spawn(
+ command: string,
+ options: SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioPipe>,
+ ): ChildProcessByStdio<Writable, Readable, Readable>;
+ function spawn(
+ command: string,
+ options: SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioNull>,
+ ): ChildProcessByStdio<Writable, Readable, null>;
+ function spawn(
+ command: string,
+ options: SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioPipe>,
+ ): ChildProcessByStdio<Writable, null, Readable>;
+ function spawn(
+ command: string,
+ options: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioPipe>,
+ ): ChildProcessByStdio<null, Readable, Readable>;
+ function spawn(
+ command: string,
+ options: SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioNull>,
+ ): ChildProcessByStdio<Writable, null, null>;
+ function spawn(
+ command: string,
+ options: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioNull>,
+ ): ChildProcessByStdio<null, Readable, null>;
+ function spawn(
+ command: string,
+ options: SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioPipe>,
+ ): ChildProcessByStdio<null, null, Readable>;
+ function spawn(
+ command: string,
+ options: SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioNull>,
+ ): ChildProcessByStdio<null, null, null>;
+ function spawn(command: string, options: SpawnOptions): ChildProcess;
+ // overloads of spawn with 'args'
+ function spawn(
+ command: string,
+ args?: readonly string[],
+ options?: SpawnOptionsWithoutStdio,
+ ): ChildProcessWithoutNullStreams;
+ function spawn(
+ command: string,
+ args: readonly string[],
+ options: SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioPipe>,
+ ): ChildProcessByStdio<Writable, Readable, Readable>;
+ function spawn(
+ command: string,
+ args: readonly string[],
+ options: SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioNull>,
+ ): ChildProcessByStdio<Writable, Readable, null>;
+ function spawn(
+ command: string,
+ args: readonly string[],
+ options: SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioPipe>,
+ ): ChildProcessByStdio<Writable, null, Readable>;
+ function spawn(
+ command: string,
+ args: readonly string[],
+ options: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioPipe>,
+ ): ChildProcessByStdio<null, Readable, Readable>;
+ function spawn(
+ command: string,
+ args: readonly string[],
+ options: SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioNull>,
+ ): ChildProcessByStdio<Writable, null, null>;
+ function spawn(
+ command: string,
+ args: readonly string[],
+ options: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioNull>,
+ ): ChildProcessByStdio<null, Readable, null>;
+ function spawn(
+ command: string,
+ args: readonly string[],
+ options: SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioPipe>,
+ ): ChildProcessByStdio<null, null, Readable>;
+ function spawn(
+ command: string,
+ args: readonly string[],
+ options: SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioNull>,
+ ): ChildProcessByStdio<null, null, null>;
+ function spawn(command: string, args: readonly string[], options: SpawnOptions): ChildProcess;
+ interface ExecOptions extends CommonOptions {
+ shell?: string | undefined;
+ signal?: AbortSignal | undefined;
+ maxBuffer?: number | undefined;
+ killSignal?: NodeJS.Signals | number | undefined;
+ }
+ interface ExecOptionsWithStringEncoding extends ExecOptions {
+ encoding: BufferEncoding;
+ }
+ interface ExecOptionsWithBufferEncoding extends ExecOptions {
+ encoding: BufferEncoding | null; // specify `null`.
+ }
+ interface ExecException extends Error {
+ cmd?: string | undefined;
+ killed?: boolean | undefined;
+ code?: number | undefined;
+ signal?: NodeJS.Signals | undefined;
+ }
+ /**
+ * Spawns a shell then executes the `command` within that shell, buffering any
+ * generated output. The `command` string passed to the exec function is processed
+ * directly by the shell and special characters (vary based on [shell](https://en.wikipedia.org/wiki/List_of_command-line_interpreters))
+ * need to be dealt with accordingly:
+ *
+ * ```js
+ * const { exec } = require('child_process');
+ *
+ * exec('"/path/to/test file/test.sh" arg1 arg2');
+ * // Double quotes are used so that the space in the path is not interpreted as
+ * // a delimiter of multiple arguments.
+ *
+ * exec('echo "The \\$HOME variable is $HOME"');
+ * // The $HOME variable is escaped in the first instance, but not in the second.
+ * ```
+ *
+ * **Never pass unsanitized user input to this function. Any input containing shell**
+ * **metacharacters may be used to trigger arbitrary command execution.**
+ *
+ * If a `callback` function is provided, it is called with the arguments`(error, stdout, stderr)`. On success, `error` will be `null`. On error,`error` will be an instance of `Error`. The
+ * `error.code` property will be
+ * the exit code of the process. By convention, any exit code other than `0`indicates an error. `error.signal` will be the signal that terminated the
+ * process.
+ *
+ * The `stdout` and `stderr` arguments passed to the callback will contain the
+ * stdout and stderr output of the child process. By default, Node.js will decode
+ * the output as UTF-8 and pass strings to the callback. The `encoding` option
+ * can be used to specify the character encoding used to decode the stdout and
+ * stderr output. If `encoding` is `'buffer'`, or an unrecognized character
+ * encoding, `Buffer` objects will be passed to the callback instead.
+ *
+ * ```js
+ * const { exec } = require('child_process');
+ * exec('cat *.js missing_file | wc -l', (error, stdout, stderr) => {
+ * if (error) {
+ * console.error(`exec error: ${error}`);
+ * return;
+ * }
+ * console.log(`stdout: ${stdout}`);
+ * console.error(`stderr: ${stderr}`);
+ * });
+ * ```
+ *
+ * If `timeout` is greater than `0`, the parent will send the signal
+ * identified by the `killSignal` property (the default is `'SIGTERM'`) if the
+ * child runs longer than `timeout` milliseconds.
+ *
+ * Unlike the [`exec(3)`](http://man7.org/linux/man-pages/man3/exec.3.html) POSIX system call, `child_process.exec()` does not replace
+ * the existing process and uses a shell to execute the command.
+ *
+ * If this method is invoked as its `util.promisify()` ed version, it returns
+ * a `Promise` for an `Object` with `stdout` and `stderr` properties. The returned`ChildProcess` instance is attached to the `Promise` as a `child` property. In
+ * case of an error (including any error resulting in an exit code other than 0), a
+ * rejected promise is returned, with the same `error` object given in the
+ * callback, but with two additional properties `stdout` and `stderr`.
+ *
+ * ```js
+ * const util = require('util');
+ * const exec = util.promisify(require('child_process').exec);
+ *
+ * async function lsExample() {
+ * const { stdout, stderr } = await exec('ls');
+ * console.log('stdout:', stdout);
+ * console.error('stderr:', stderr);
+ * }
+ * lsExample();
+ * ```
+ *
+ * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except
+ * the error passed to the callback will be an `AbortError`:
+ *
+ * ```js
+ * const { exec } = require('child_process');
+ * const controller = new AbortController();
+ * const { signal } = controller;
+ * const child = exec('grep ssh', { signal }, (error) => {
+ * console.log(error); // an AbortError
+ * });
+ * controller.abort();
+ * ```
+ * @since v0.1.90
+ * @param command The command to run, with space-separated arguments.
+ * @param callback called with the output when process terminates.
+ */
+ function exec(
+ command: string,
+ callback?: (error: ExecException | null, stdout: string, stderr: string) => void,
+ ): ChildProcess;
+ // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`.
+ function exec(
+ command: string,
+ options: {
+ encoding: "buffer" | null;
+ } & ExecOptions,
+ callback?: (error: ExecException | null, stdout: Buffer, stderr: Buffer) => void,
+ ): ChildProcess;
+ // `options` with well known `encoding` means stdout/stderr are definitely `string`.
+ function exec(
+ command: string,
+ options: {
+ encoding: BufferEncoding;
+ } & ExecOptions,
+ callback?: (error: ExecException | null, stdout: string, stderr: string) => void,
+ ): ChildProcess;
+ // `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`.
+ // There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`.
+ function exec(
+ command: string,
+ options: {
+ encoding: BufferEncoding;
+ } & ExecOptions,
+ callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
+ ): ChildProcess;
+ // `options` without an `encoding` means stdout/stderr are definitely `string`.
+ function exec(
+ command: string,
+ options: ExecOptions,
+ callback?: (error: ExecException | null, stdout: string, stderr: string) => void,
+ ): ChildProcess;
+ // fallback if nothing else matches. Worst case is always `string | Buffer`.
+ function exec(
+ command: string,
+ options: (ObjectEncodingOptions & ExecOptions) | undefined | null,
+ callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
+ ): ChildProcess;
+ interface PromiseWithChild<T> extends Promise<T> {
+ child: ChildProcess;
+ }
+ namespace exec {
+ function __promisify__(command: string): PromiseWithChild<{
+ stdout: string;
+ stderr: string;
+ }>;
+ function __promisify__(
+ command: string,
+ options: {
+ encoding: "buffer" | null;
+ } & ExecOptions,
+ ): PromiseWithChild<{
+ stdout: Buffer;
+ stderr: Buffer;
+ }>;
+ function __promisify__(
+ command: string,
+ options: {
+ encoding: BufferEncoding;
+ } & ExecOptions,
+ ): PromiseWithChild<{
+ stdout: string;
+ stderr: string;
+ }>;
+ function __promisify__(
+ command: string,
+ options: ExecOptions,
+ ): PromiseWithChild<{
+ stdout: string;
+ stderr: string;
+ }>;
+ function __promisify__(
+ command: string,
+ options?: (ObjectEncodingOptions & ExecOptions) | null,
+ ): PromiseWithChild<{
+ stdout: string | Buffer;
+ stderr: string | Buffer;
+ }>;
+ }
+ interface ExecFileOptions extends CommonOptions, Abortable {
+ maxBuffer?: number | undefined;
+ killSignal?: NodeJS.Signals | number | undefined;
+ windowsVerbatimArguments?: boolean | undefined;
+ shell?: boolean | string | undefined;
+ signal?: AbortSignal | undefined;
+ }
+ interface ExecFileOptionsWithStringEncoding extends ExecFileOptions {
+ encoding: BufferEncoding;
+ }
+ interface ExecFileOptionsWithBufferEncoding extends ExecFileOptions {
+ encoding: "buffer" | null;
+ }
+ interface ExecFileOptionsWithOtherEncoding extends ExecFileOptions {
+ encoding: BufferEncoding;
+ }
+ type ExecFileException =
+ & Omit<ExecException, "code">
+ & Omit<NodeJS.ErrnoException, "code">
+ & { code?: string | number | undefined | null };
+ /**
+ * The `child_process.execFile()` function is similar to {@link exec} except that it does not spawn a shell by default. Rather, the specified
+ * executable `file` is spawned directly as a new process making it slightly more
+ * efficient than {@link exec}.
+ *
+ * The same options as {@link exec} are supported. Since a shell is
+ * not spawned, behaviors such as I/O redirection and file globbing are not
+ * supported.
+ *
+ * ```js
+ * const { execFile } = require('child_process');
+ * const child = execFile('node', ['--version'], (error, stdout, stderr) => {
+ * if (error) {
+ * throw error;
+ * }
+ * console.log(stdout);
+ * });
+ * ```
+ *
+ * The `stdout` and `stderr` arguments passed to the callback will contain the
+ * stdout and stderr output of the child process. By default, Node.js will decode
+ * the output as UTF-8 and pass strings to the callback. The `encoding` option
+ * can be used to specify the character encoding used to decode the stdout and
+ * stderr output. If `encoding` is `'buffer'`, or an unrecognized character
+ * encoding, `Buffer` objects will be passed to the callback instead.
+ *
+ * If this method is invoked as its `util.promisify()` ed version, it returns
+ * a `Promise` for an `Object` with `stdout` and `stderr` properties. The returned`ChildProcess` instance is attached to the `Promise` as a `child` property. In
+ * case of an error (including any error resulting in an exit code other than 0), a
+ * rejected promise is returned, with the same `error` object given in the
+ * callback, but with two additional properties `stdout` and `stderr`.
+ *
+ * ```js
+ * const util = require('util');
+ * const execFile = util.promisify(require('child_process').execFile);
+ * async function getVersion() {
+ * const { stdout } = await execFile('node', ['--version']);
+ * console.log(stdout);
+ * }
+ * getVersion();
+ * ```
+ *
+ * **If the `shell` option is enabled, do not pass unsanitized user input to this**
+ * **function. Any input containing shell metacharacters may be used to trigger**
+ * **arbitrary command execution.**
+ *
+ * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except
+ * the error passed to the callback will be an `AbortError`:
+ *
+ * ```js
+ * const { execFile } = require('child_process');
+ * const controller = new AbortController();
+ * const { signal } = controller;
+ * const child = execFile('node', ['--version'], { signal }, (error) => {
+ * console.log(error); // an AbortError
+ * });
+ * controller.abort();
+ * ```
+ * @since v0.1.91
+ * @param file The name or path of the executable file to run.
+ * @param args List of string arguments.
+ * @param callback Called with the output when process terminates.
+ */
+ function execFile(file: string): ChildProcess;
+ function execFile(
+ file: string,
+ options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
+ ): ChildProcess;
+ function execFile(file: string, args?: readonly string[] | null): ChildProcess;
+ function execFile(
+ file: string,
+ args: readonly string[] | undefined | null,
+ options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
+ ): ChildProcess;
+ // no `options` definitely means stdout/stderr are `string`.
+ function execFile(
+ file: string,
+ callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
+ ): ChildProcess;
+ function execFile(
+ file: string,
+ args: readonly string[] | undefined | null,
+ callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
+ ): ChildProcess;
+ // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`.
+ function execFile(
+ file: string,
+ options: ExecFileOptionsWithBufferEncoding,
+ callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void,
+ ): ChildProcess;
+ function execFile(
+ file: string,
+ args: readonly string[] | undefined | null,
+ options: ExecFileOptionsWithBufferEncoding,
+ callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void,
+ ): ChildProcess;
+ // `options` with well known `encoding` means stdout/stderr are definitely `string`.
+ function execFile(
+ file: string,
+ options: ExecFileOptionsWithStringEncoding,
+ callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
+ ): ChildProcess;
+ function execFile(
+ file: string,
+ args: readonly string[] | undefined | null,
+ options: ExecFileOptionsWithStringEncoding,
+ callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
+ ): ChildProcess;
+ // `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`.
+ // There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`.
+ function execFile(
+ file: string,
+ options: ExecFileOptionsWithOtherEncoding,
+ callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
+ ): ChildProcess;
+ function execFile(
+ file: string,
+ args: readonly string[] | undefined | null,
+ options: ExecFileOptionsWithOtherEncoding,
+ callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
+ ): ChildProcess;
+ // `options` without an `encoding` means stdout/stderr are definitely `string`.
+ function execFile(
+ file: string,
+ options: ExecFileOptions,
+ callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
+ ): ChildProcess;
+ function execFile(
+ file: string,
+ args: readonly string[] | undefined | null,
+ options: ExecFileOptions,
+ callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
+ ): ChildProcess;
+ // fallback if nothing else matches. Worst case is always `string | Buffer`.
+ function execFile(
+ file: string,
+ options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
+ callback:
+ | ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void)
+ | undefined
+ | null,
+ ): ChildProcess;
+ function execFile(
+ file: string,
+ args: readonly string[] | undefined | null,
+ options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
+ callback:
+ | ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void)
+ | undefined
+ | null,
+ ): ChildProcess;
+ namespace execFile {
+ function __promisify__(file: string): PromiseWithChild<{
+ stdout: string;
+ stderr: string;
+ }>;
+ function __promisify__(
+ file: string,
+ args: readonly string[] | undefined | null,
+ ): PromiseWithChild<{
+ stdout: string;
+ stderr: string;
+ }>;
+ function __promisify__(
+ file: string,
+ options: ExecFileOptionsWithBufferEncoding,
+ ): PromiseWithChild<{
+ stdout: Buffer;
+ stderr: Buffer;
+ }>;
+ function __promisify__(
+ file: string,
+ args: readonly string[] | undefined | null,
+ options: ExecFileOptionsWithBufferEncoding,
+ ): PromiseWithChild<{
+ stdout: Buffer;
+ stderr: Buffer;
+ }>;
+ function __promisify__(
+ file: string,
+ options: ExecFileOptionsWithStringEncoding,
+ ): PromiseWithChild<{
+ stdout: string;
+ stderr: string;
+ }>;
+ function __promisify__(
+ file: string,
+ args: readonly string[] | undefined | null,
+ options: ExecFileOptionsWithStringEncoding,
+ ): PromiseWithChild<{
+ stdout: string;
+ stderr: string;
+ }>;
+ function __promisify__(
+ file: string,
+ options: ExecFileOptionsWithOtherEncoding,
+ ): PromiseWithChild<{
+ stdout: string | Buffer;
+ stderr: string | Buffer;
+ }>;
+ function __promisify__(
+ file: string,
+ args: readonly string[] | undefined | null,
+ options: ExecFileOptionsWithOtherEncoding,
+ ): PromiseWithChild<{
+ stdout: string | Buffer;
+ stderr: string | Buffer;
+ }>;
+ function __promisify__(
+ file: string,
+ options: ExecFileOptions,
+ ): PromiseWithChild<{
+ stdout: string;
+ stderr: string;
+ }>;
+ function __promisify__(
+ file: string,
+ args: readonly string[] | undefined | null,
+ options: ExecFileOptions,
+ ): PromiseWithChild<{
+ stdout: string;
+ stderr: string;
+ }>;
+ function __promisify__(
+ file: string,
+ options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
+ ): PromiseWithChild<{
+ stdout: string | Buffer;
+ stderr: string | Buffer;
+ }>;
+ function __promisify__(
+ file: string,
+ args: readonly string[] | undefined | null,
+ options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
+ ): PromiseWithChild<{
+ stdout: string | Buffer;
+ stderr: string | Buffer;
+ }>;
+ }
+ interface ForkOptions extends ProcessEnvOptions, MessagingOptions, Abortable {
+ execPath?: string | undefined;
+ execArgv?: string[] | undefined;
+ silent?: boolean | undefined;
+ /**
+ * Can be set to 'pipe', 'inherit', 'overlapped', or 'ignore', or an array of these strings.
+ * If passed as an array, the first element is used for `stdin`, the second for
+ * `stdout`, and the third for `stderr`. A fourth element can be used to
+ * specify the `stdio` behavior beyond the standard streams. See
+ * {@link ChildProcess.stdio} for more information.
+ *
+ * @default 'pipe'
+ */
+ stdio?: StdioOptions | undefined;
+ detached?: boolean | undefined;
+ windowsVerbatimArguments?: boolean | undefined;
+ }
+ /**
+ * The `child_process.fork()` method is a special case of {@link spawn} used specifically to spawn new Node.js processes.
+ * Like {@link spawn}, a `ChildProcess` object is returned. The
+ * returned `ChildProcess` will have an additional communication channel
+ * built-in that allows messages to be passed back and forth between the parent and
+ * child. See `subprocess.send()` for details.
+ *
+ * Keep in mind that spawned Node.js child processes are
+ * independent of the parent with exception of the IPC communication channel
+ * that is established between the two. Each process has its own memory, with
+ * their own V8 instances. Because of the additional resource allocations
+ * required, spawning a large number of child Node.js processes is not
+ * recommended.
+ *
+ * By default, `child_process.fork()` will spawn new Node.js instances using the `process.execPath` of the parent process. The `execPath` property in the`options` object allows for an alternative
+ * execution path to be used.
+ *
+ * Node.js processes launched with a custom `execPath` will communicate with the
+ * parent process using the file descriptor (fd) identified using the
+ * environment variable `NODE_CHANNEL_FD` on the child process.
+ *
+ * Unlike the [`fork(2)`](http://man7.org/linux/man-pages/man2/fork.2.html) POSIX system call, `child_process.fork()` does not clone the
+ * current process.
+ *
+ * The `shell` option available in {@link spawn} is not supported by`child_process.fork()` and will be ignored if set.
+ *
+ * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except
+ * the error passed to the callback will be an `AbortError`:
+ *
+ * ```js
+ * if (process.argv[2] === 'child') {
+ * setTimeout(() => {
+ * console.log(`Hello from ${process.argv[2]}!`);
+ * }, 1_000);
+ * } else {
+ * const { fork } = require('child_process');
+ * const controller = new AbortController();
+ * const { signal } = controller;
+ * const child = fork(__filename, ['child'], { signal });
+ * child.on('error', (err) => {
+ * // This will be called with err being an AbortError if the controller aborts
+ * });
+ * controller.abort(); // Stops the child process
+ * }
+ * ```
+ * @since v0.5.0
+ * @param modulePath The module to run in the child.
+ * @param args List of string arguments.
+ */
+ function fork(modulePath: string, options?: ForkOptions): ChildProcess;
+ function fork(modulePath: string, args?: readonly string[], options?: ForkOptions): ChildProcess;
+ interface SpawnSyncOptions extends CommonSpawnOptions {
+ input?: string | NodeJS.ArrayBufferView | undefined;
+ maxBuffer?: number | undefined;
+ encoding?: BufferEncoding | "buffer" | null | undefined;
+ }
+ interface SpawnSyncOptionsWithStringEncoding extends SpawnSyncOptions {
+ encoding: BufferEncoding;
+ }
+ interface SpawnSyncOptionsWithBufferEncoding extends SpawnSyncOptions {
+ encoding?: "buffer" | null | undefined;
+ }
+ interface SpawnSyncReturns<T> {
+ pid: number;
+ output: Array<T | null>;
+ stdout: T;
+ stderr: T;
+ status: number | null;
+ signal: NodeJS.Signals | null;
+ error?: Error | undefined;
+ }
+ /**
+ * The `child_process.spawnSync()` method is generally identical to {@link spawn} with the exception that the function will not return
+ * until the child process has fully closed. When a timeout has been encountered
+ * and `killSignal` is sent, the method won't return until the process has
+ * completely exited. If the process intercepts and handles the `SIGTERM` signal
+ * and doesn't exit, the parent process will wait until the child process has
+ * exited.
+ *
+ * **If the `shell` option is enabled, do not pass unsanitized user input to this**
+ * **function. Any input containing shell metacharacters may be used to trigger**
+ * **arbitrary command execution.**
+ * @since v0.11.12
+ * @param command The command to run.
+ * @param args List of string arguments.
+ */
+ function spawnSync(command: string): SpawnSyncReturns<Buffer>;
+ function spawnSync(command: string, options: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns<string>;
+ function spawnSync(command: string, options: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns<Buffer>;
+ function spawnSync(command: string, options?: SpawnSyncOptions): SpawnSyncReturns<string | Buffer>;
+ function spawnSync(command: string, args: readonly string[]): SpawnSyncReturns<Buffer>;
+ function spawnSync(
+ command: string,
+ args: readonly string[],
+ options: SpawnSyncOptionsWithStringEncoding,
+ ): SpawnSyncReturns<string>;
+ function spawnSync(
+ command: string,
+ args: readonly string[],
+ options: SpawnSyncOptionsWithBufferEncoding,
+ ): SpawnSyncReturns<Buffer>;
+ function spawnSync(
+ command: string,
+ args?: readonly string[],
+ options?: SpawnSyncOptions,
+ ): SpawnSyncReturns<string | Buffer>;
+ interface CommonExecOptions extends CommonOptions {
+ input?: string | NodeJS.ArrayBufferView | undefined;
+ /**
+ * Can be set to 'pipe', 'inherit', 'overlapped', or 'ignore', or an array of these strings.
+ * If passed as an array, the first element is used for `stdin`, the second for
+ * `stdout`, and the third for `stderr`. A fourth element can be used to
+ * specify the `stdio` behavior beyond the standard streams. See
+ * {@link ChildProcess.stdio} for more information.
+ *
+ * @default 'pipe'
+ */
+ stdio?: StdioOptions | undefined;
+ killSignal?: NodeJS.Signals | number | undefined;
+ maxBuffer?: number | undefined;
+ encoding?: BufferEncoding | "buffer" | null | undefined;
+ }
+ interface ExecSyncOptions extends CommonExecOptions {
+ shell?: string | undefined;
+ }
+ interface ExecSyncOptionsWithStringEncoding extends ExecSyncOptions {
+ encoding: BufferEncoding;
+ }
+ interface ExecSyncOptionsWithBufferEncoding extends ExecSyncOptions {
+ encoding?: "buffer" | null | undefined;
+ }
+ /**
+ * The `child_process.execSync()` method is generally identical to {@link exec} with the exception that the method will not return
+ * until the child process has fully closed. When a timeout has been encountered
+ * and `killSignal` is sent, the method won't return until the process has
+ * completely exited. If the child process intercepts and handles the `SIGTERM`signal and doesn't exit, the parent process will wait until the child process
+ * has exited.
+ *
+ * If the process times out or has a non-zero exit code, this method will throw.
+ * The `Error` object will contain the entire result from {@link spawnSync}.
+ *
+ * **Never pass unsanitized user input to this function. Any input containing shell**
+ * **metacharacters may be used to trigger arbitrary command execution.**
+ * @since v0.11.12
+ * @param command The command to run.
+ * @return The stdout from the command.
+ */
+ function execSync(command: string): Buffer;
+ function execSync(command: string, options: ExecSyncOptionsWithStringEncoding): string;
+ function execSync(command: string, options: ExecSyncOptionsWithBufferEncoding): Buffer;
+ function execSync(command: string, options?: ExecSyncOptions): string | Buffer;
+ interface ExecFileSyncOptions extends CommonExecOptions {
+ shell?: boolean | string | undefined;
+ }
+ interface ExecFileSyncOptionsWithStringEncoding extends ExecFileSyncOptions {
+ encoding: BufferEncoding;
+ }
+ interface ExecFileSyncOptionsWithBufferEncoding extends ExecFileSyncOptions {
+ encoding?: "buffer" | null; // specify `null`.
+ }
+ /**
+ * The `child_process.execFileSync()` method is generally identical to {@link execFile} with the exception that the method will not
+ * return until the child process has fully closed. When a timeout has been
+ * encountered and `killSignal` is sent, the method won't return until the process
+ * has completely exited.
+ *
+ * If the child process intercepts and handles the `SIGTERM` signal and
+ * does not exit, the parent process will still wait until the child process has
+ * exited.
+ *
+ * If the process times out or has a non-zero exit code, this method will throw an `Error` that will include the full result of the underlying {@link spawnSync}.
+ *
+ * **If the `shell` option is enabled, do not pass unsanitized user input to this**
+ * **function. Any input containing shell metacharacters may be used to trigger**
+ * **arbitrary command execution.**
+ * @since v0.11.12
+ * @param file The name or path of the executable file to run.
+ * @param args List of string arguments.
+ * @return The stdout from the command.
+ */
+ function execFileSync(file: string): Buffer;
+ function execFileSync(file: string, options: ExecFileSyncOptionsWithStringEncoding): string;
+ function execFileSync(file: string, options: ExecFileSyncOptionsWithBufferEncoding): Buffer;
+ function execFileSync(file: string, options?: ExecFileSyncOptions): string | Buffer;
+ function execFileSync(file: string, args: readonly string[]): Buffer;
+ function execFileSync(
+ file: string,
+ args: readonly string[],
+ options: ExecFileSyncOptionsWithStringEncoding,
+ ): string;
+ function execFileSync(
+ file: string,
+ args: readonly string[],
+ options: ExecFileSyncOptionsWithBufferEncoding,
+ ): Buffer;
+ function execFileSync(file: string, args?: readonly string[], options?: ExecFileSyncOptions): string | Buffer;
+}
+declare module "node:child_process" {
+ export * from "child_process";
+}
diff --git a/client/node_modules/@types/node/ts4.8/cluster.d.ts b/client/node_modules/@types/node/ts4.8/cluster.d.ts
new file mode 100644
index 0000000..e33eab7
--- /dev/null
+++ b/client/node_modules/@types/node/ts4.8/cluster.d.ts
@@ -0,0 +1,432 @@
+/**
+ * Clusters of Node.js processes can be used to run multiple instances of Node.js
+ * that can distribute workloads among their application threads. When process
+ * isolation is not needed, use the `worker_threads` module instead, which
+ * allows running multiple application threads within a single Node.js instance.
+ *
+ * The cluster module allows easy creation of child processes that all share
+ * server ports.
+ *
+ * ```js
+ * import cluster from 'cluster';
+ * import http from 'http';
+ * import { cpus } from 'os';
+ * import process from 'process';
+ *
+ * const numCPUs = cpus().length;
+ *
+ * if (cluster.isPrimary) {
+ * console.log(`Primary ${process.pid} is running`);
+ *
+ * // Fork workers.
+ * for (let i = 0; i < numCPUs; i++) {
+ * cluster.fork();
+ * }
+ *
+ * cluster.on('exit', (worker, code, signal) => {
+ * console.log(`worker ${worker.process.pid} died`);
+ * });
+ * } else {
+ * // Workers can share any TCP connection
+ * // In this case it is an HTTP server
+ * http.createServer((req, res) => {
+ * res.writeHead(200);
+ * res.end('hello world\n');
+ * }).listen(8000);
+ *
+ * console.log(`Worker ${process.pid} started`);
+ * }
+ * ```
+ *
+ * Running Node.js will now share port 8000 between the workers:
+ *
+ * ```console
+ * $ node server.js
+ * Primary 3596 is running
+ * Worker 4324 started
+ * Worker 4520 started
+ * Worker 6056 started
+ * Worker 5644 started
+ * ```
+ *
+ * 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/v18.0.0/lib/cluster.js)
+ */
+declare module "cluster" {
+ import * as child from "node:child_process";
+ import EventEmitter = require("node:events");
+ import * as net from "node:net";
+ type SerializationType = "json" | "advanced";
+ export interface ClusterSettings {
+ execArgv?: string[] | undefined; // default: process.execArgv
+ exec?: string | undefined;
+ args?: string[] | undefined;
+ silent?: boolean | undefined;
+ stdio?: any[] | undefined;
+ uid?: number | undefined;
+ gid?: number | undefined;
+ inspectPort?: number | (() => number) | undefined;
+ serialization?: SerializationType | undefined;
+ cwd?: string | undefined;
+ windowsHide?: boolean | undefined;
+ }
+ export interface Address {
+ address: string;
+ port: number;
+ addressType: number | "udp4" | "udp6"; // 4, 6, -1, "udp4", "udp6"
+ }
+ /**
+ * A `Worker` object contains all public information and method about a worker.
+ * In the primary it can be obtained using `cluster.workers`. In a worker
+ * it can be obtained using `cluster.worker`.
+ * @since v0.7.0
+ */
+ export class Worker extends EventEmitter {
+ /**
+ * Each new worker is given its own unique id, this id is stored in the`id`.
+ *
+ * While a worker is alive, this is the key that indexes it in`cluster.workers`.
+ * @since v0.8.0
+ */
+ id: number;
+ /**
+ * All workers are created using `child_process.fork()`, the returned object
+ * from this function is stored as `.process`. In a worker, the global `process`is stored.
+ *
+ * See: `Child Process module`.
+ *
+ * Workers will call `process.exit(0)` if the `'disconnect'` event occurs
+ * on `process` and `.exitedAfterDisconnect` is not `true`. This protects against
+ * accidental disconnection.
+ * @since v0.7.0
+ */
+ process: child.ChildProcess;
+ /**
+ * 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 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:
+ *
+ * ```js
+ * if (cluster.isPrimary) {
+ * const worker = cluster.fork();
+ * worker.send('hi there');
+ *
+ * } else if (cluster.isWorker) {
+ * process.on('message', (msg) => {
+ * process.send(msg);
+ * });
+ * }
+ * ```
+ * @since v0.7.0
+ * @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,
+ 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
+ * disconnecting the `worker.process`, and once disconnected, killing with`signal`. In the worker, it does it by killing the process with `signal`.
+ *
+ * The `kill()` function kills the worker process without waiting for a graceful
+ * disconnect, it has the same behavior as `worker.process.kill()`.
+ *
+ * This method is aliased as `worker.destroy()` for backwards compatibility.
+ *
+ * In a worker, `process.kill()` exists, but it is not this function;
+ * it is `kill()`.
+ * @since v0.9.12
+ * @param [signal='SIGTERM'] Name of the kill signal to send to the worker process.
+ */
+ kill(signal?: string): void;
+ destroy(signal?: string): void;
+ /**
+ * In a worker, this function will close all servers, wait for the `'close'` event
+ * on those servers, and then disconnect the IPC channel.
+ *
+ * In the primary, an internal message is sent to the worker causing it to call`.disconnect()` on itself.
+ *
+ * Causes `.exitedAfterDisconnect` to be set.
+ *
+ * After a server is closed, it will no longer accept new connections,
+ * but connections may be accepted by any other listening worker. Existing
+ * connections will be allowed to close as usual. When no more connections exist,
+ * see `server.close()`, the IPC channel to the worker will close allowing it
+ * to die gracefully.
+ *
+ * The above applies _only_ to server connections, client connections are not
+ * automatically closed by workers, and disconnect does not wait for them to close
+ * before exiting.
+ *
+ * In a worker, `process.disconnect` exists, but it is not this function;
+ * it is `disconnect()`.
+ *
+ * Because long living server connections may block workers from disconnecting, it
+ * may be useful to send a message, so application specific actions may be taken to
+ * close them. It also may be useful to implement a timeout, killing a worker if
+ * the `'disconnect'` event has not been emitted after some time.
+ *
+ * ```js
+ * if (cluster.isPrimary) {
+ * const worker = cluster.fork();
+ * let timeout;
+ *
+ * worker.on('listening', (address) => {
+ * worker.send('shutdown');
+ * worker.disconnect();
+ * timeout = setTimeout(() => {
+ * worker.kill();
+ * }, 2000);
+ * });
+ *
+ * worker.on('disconnect', () => {
+ * clearTimeout(timeout);
+ * });
+ *
+ * } else if (cluster.isWorker) {
+ * const net = require('net');
+ * const server = net.createServer((socket) => {
+ * // Connections never end
+ * });
+ *
+ * server.listen(8000);
+ *
+ * process.on('message', (msg) => {
+ * if (msg === 'shutdown') {
+ * // Initiate graceful close of any connections to server
+ * }
+ * });
+ * }
+ * ```
+ * @since v0.7.7
+ * @return A reference to `worker`.
+ */
+ disconnect(): void;
+ /**
+ * This function returns `true` if the worker is connected to its primary via its
+ * IPC channel, `false` otherwise. A worker is connected to its primary after it
+ * has been created. It is disconnected after the `'disconnect'` event is emitted.
+ * @since v0.11.14
+ */
+ isConnected(): boolean;
+ /**
+ * This function returns `true` if the worker's process has terminated (either
+ * because of exiting or being signaled). Otherwise, it returns `false`.
+ *
+ * ```js
+ * import cluster from 'cluster';
+ * import http from 'http';
+ * import { cpus } from 'os';
+ * import process from 'process';
+ *
+ * const numCPUs = cpus().length;
+ *
+ * if (cluster.isPrimary) {
+ * console.log(`Primary ${process.pid} is running`);
+ *
+ * // Fork workers.
+ * for (let i = 0; i < numCPUs; i++) {
+ * cluster.fork();
+ * }
+ *
+ * cluster.on('fork', (worker) => {
+ * console.log('worker is dead:', worker.isDead());
+ * });
+ *
+ * cluster.on('exit', (worker, code, signal) => {
+ * console.log('worker is dead:', worker.isDead());
+ * });
+ * } else {
+ * // Workers can share any TCP connection. In this case, it is an HTTP server.
+ * http.createServer((req, res) => {
+ * res.writeHead(200);
+ * res.end(`Current process\n ${process.pid}`);
+ * process.kill(process.pid);
+ * }).listen(8000);
+ * }
+ * ```
+ * @since v0.11.14
+ */
+ isDead(): boolean;
+ /**
+ * This property is `true` if the worker exited due to `.disconnect()`.
+ * If the worker exited any other way, it is `false`. If the
+ * worker has not exited, it is `undefined`.
+ *
+ * The boolean `worker.exitedAfterDisconnect` allows distinguishing between
+ * voluntary and accidental exit, the primary may choose not to respawn a worker
+ * based on this value.
+ *
+ * ```js
+ * cluster.on('exit', (worker, code, signal) => {
+ * if (worker.exitedAfterDisconnect === true) {
+ * console.log('Oh, it was just voluntary – no need to worry');
+ * }
+ * });
+ *
+ * // kill worker
+ * worker.kill();
+ * ```
+ * @since v6.0.0
+ */
+ exitedAfterDisconnect: boolean;
+ /**
+ * events.EventEmitter
+ * 1. disconnect
+ * 2. error
+ * 3. exit
+ * 4. listening
+ * 5. message
+ * 6. online
+ */
+ addListener(event: string, listener: (...args: any[]) => void): this;
+ addListener(event: "disconnect", listener: () => void): this;
+ addListener(event: "error", listener: (error: Error) => void): this;
+ addListener(event: "exit", listener: (code: number, signal: string) => 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: "online", listener: () => void): this;
+ emit(event: string | symbol, ...args: any[]): boolean;
+ emit(event: "disconnect"): boolean;
+ emit(event: "error", error: Error): boolean;
+ emit(event: "exit", code: number, signal: string): boolean;
+ emit(event: "listening", address: Address): boolean;
+ emit(event: "message", message: any, handle: net.Socket | net.Server): boolean;
+ emit(event: "online"): boolean;
+ on(event: string, listener: (...args: any[]) => void): this;
+ on(event: "disconnect", listener: () => void): this;
+ on(event: "error", listener: (error: Error) => void): this;
+ on(event: "exit", listener: (code: number, signal: string) => 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: "online", listener: () => void): this;
+ once(event: string, listener: (...args: any[]) => void): this;
+ once(event: "disconnect", listener: () => void): this;
+ once(event: "error", listener: (error: Error) => void): this;
+ once(event: "exit", listener: (code: number, signal: string) => 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: "online", listener: () => void): this;
+ prependListener(event: string, listener: (...args: any[]) => void): this;
+ prependListener(event: "disconnect", listener: () => void): this;
+ prependListener(event: "error", listener: (error: Error) => void): this;
+ prependListener(event: "exit", listener: (code: number, signal: string) => 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: "online", listener: () => void): this;
+ prependOnceListener(event: string, listener: (...args: any[]) => void): this;
+ prependOnceListener(event: "disconnect", listener: () => void): this;
+ prependOnceListener(event: "error", listener: (error: Error) => void): this;
+ prependOnceListener(event: "exit", listener: (code: number, signal: string) => 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: "online", listener: () => void): this;
+ }
+ export interface Cluster extends EventEmitter {
+ disconnect(callback?: () => void): void;
+ fork(env?: any): Worker;
+ /** @deprecated since v16.0.0 - use isPrimary. */
+ readonly isMaster: boolean;
+ readonly isPrimary: boolean;
+ readonly isWorker: boolean;
+ schedulingPolicy: number;
+ readonly settings: ClusterSettings;
+ /** @deprecated since v16.0.0 - use setupPrimary. */
+ setupMaster(settings?: ClusterSettings): void;
+ /**
+ * `setupPrimary` is used to change the default 'fork' behavior. Once called, the settings will be present in cluster.settings.
+ */
+ setupPrimary(settings?: ClusterSettings): void;
+ readonly worker?: Worker | undefined;
+ readonly workers?: NodeJS.Dict<Worker> | undefined;
+ readonly SCHED_NONE: number;
+ readonly SCHED_RR: number;
+ /**
+ * events.EventEmitter
+ * 1. disconnect
+ * 2. exit
+ * 3. fork
+ * 4. listening
+ * 5. message
+ * 6. online
+ * 7. setup
+ */
+ addListener(event: string, listener: (...args: any[]) => void): this;
+ addListener(event: "disconnect", listener: (worker: Worker) => void): this;
+ addListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
+ addListener(event: "fork", listener: (worker: Worker) => void): this;
+ addListener(event: "listening", listener: (worker: Worker, address: Address) => void): this;
+ 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.
+ 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: "disconnect", worker: Worker): boolean;
+ emit(event: "exit", worker: Worker, code: number, signal: string): boolean;
+ emit(event: "fork", worker: Worker): boolean;
+ emit(event: "listening", worker: Worker, address: Address): boolean;
+ emit(event: "message", worker: Worker, message: any, handle: net.Socket | net.Server): boolean;
+ emit(event: "online", worker: Worker): boolean;
+ emit(event: "setup", settings: ClusterSettings): boolean;
+ on(event: string, listener: (...args: any[]) => void): this;
+ on(event: "disconnect", listener: (worker: Worker) => void): this;
+ on(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
+ on(event: "fork", listener: (worker: Worker) => 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: "online", listener: (worker: Worker) => void): this;
+ on(event: "setup", listener: (settings: ClusterSettings) => void): this;
+ once(event: string, listener: (...args: any[]) => void): this;
+ once(event: "disconnect", listener: (worker: Worker) => void): this;
+ once(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
+ once(event: "fork", listener: (worker: Worker) => 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: "online", listener: (worker: Worker) => void): this;
+ once(event: "setup", listener: (settings: ClusterSettings) => void): this;
+ prependListener(event: string, listener: (...args: any[]) => void): this;
+ prependListener(event: "disconnect", listener: (worker: Worker) => void): this;
+ prependListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
+ prependListener(event: "fork", listener: (worker: Worker) => void): this;
+ prependListener(event: "listening", listener: (worker: Worker, address: Address) => void): this;
+ // the handle is a net.Socket or net.Server object, or undefined.
+ prependListener(
+ event: "message",
+ listener: (worker: Worker, message: any, handle?: net.Socket | net.Server) => void,
+ ): 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: "disconnect", listener: (worker: Worker) => void): this;
+ prependOnceListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
+ prependOnceListener(event: "fork", listener: (worker: Worker) => void): this;
+ prependOnceListener(event: "listening", listener: (worker: Worker, address: Address) => void): this;
+ // the handle is a net.Socket or net.Server object, or undefined.
+ prependOnceListener(
+ event: "message",
+ listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void,
+ ): this;
+ prependOnceListener(event: "online", listener: (worker: Worker) => void): this;
+ prependOnceListener(event: "setup", listener: (settings: ClusterSettings) => void): this;
+ }
+ const cluster: Cluster;
+ export default cluster;
+}
+declare module "node:cluster" {
+ export * from "cluster";
+ export { default as default } from "cluster";
+}
diff --git a/client/node_modules/@types/node/ts4.8/console.d.ts b/client/node_modules/@types/node/ts4.8/console.d.ts
new file mode 100644
index 0000000..c627daf
--- /dev/null
+++ b/client/node_modules/@types/node/ts4.8/console.d.ts
@@ -0,0 +1,412 @@
+/**
+ * The `console` module provides a simple debugging console that is similar to the
+ * JavaScript console mechanism provided by web browsers.
+ *
+ * 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 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
+ * synchronous like the browser APIs they resemble, nor are they consistently
+ * asynchronous like all other Node.js streams. See the `note on process I/O` for
+ * more information.
+ *
+ * Example using the global `console`:
+ *
+ * ```js
+ * console.log('hello world');
+ * // Prints: hello world, to stdout
+ * console.log('hello %s', 'world');
+ * // Prints: hello world, to stdout
+ * console.error(new Error('Whoops, something bad happened'));
+ * // Prints error message and stack trace to stderr:
+ * // Error: Whoops, something bad happened
+ * // at [eval]:5:15
+ * // at Script.runInThisContext (node:vm:132:18)
+ * // at Object.runInThisContext (node:vm:309:38)
+ * // at node:internal/process/execution:77:19
+ * // at [eval]-wrapper:6:22
+ * // at evalScript (node:internal/process/execution:76:60)
+ * // at node:internal/main/eval_string:23:3
+ *
+ * const name = 'Will Robinson';
+ * console.warn(`Danger ${name}! Danger!`);
+ * // Prints: Danger Will Robinson! Danger!, to stderr
+ * ```
+ *
+ * Example using the `Console` class:
+ *
+ * ```js
+ * const out = getStreamSomehow();
+ * const err = getStreamSomehow();
+ * const myConsole = new console.Console(out, err);
+ *
+ * myConsole.log('hello world');
+ * // Prints: hello world, to out
+ * myConsole.log('hello %s', 'world');
+ * // Prints: hello world, to out
+ * myConsole.error(new Error('Whoops, something bad happened'));
+ * // Prints: [Error: Whoops, something bad happened], to err
+ *
+ * const name = 'Will Robinson';
+ * myConsole.warn(`Danger ${name}! Danger!`);
+ * // Prints: Danger Will Robinson! Danger!, to err
+ * ```
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/console.js)
+ */
+declare module "console" {
+ import console = require("node:console");
+ export = console;
+}
+declare module "node:console" {
+ import { InspectOptions } from "node:util";
+ global {
+ // This needs to be global to avoid TS2403 in case lib.dom.d.ts is present in the same build
+ interface Console {
+ Console: console.ConsoleConstructor;
+ /**
+ * `console.assert()` writes a message if `value` is [falsy](https://developer.mozilla.org/en-US/docs/Glossary/Falsy) or omitted. It only
+ * writes a message and does not otherwise affect execution. The output always
+ * starts with `"Assertion failed"`. If provided, `message` is formatted using `util.format()`.
+ *
+ * If `value` is [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy), nothing happens.
+ *
+ * ```js
+ * console.assert(true, 'does nothing');
+ *
+ * console.assert(false, 'Whoops %s work', 'didn\'t');
+ * // Assertion failed: Whoops didn't work
+ *
+ * console.assert();
+ * // Assertion failed
+ * ```
+ * @since v0.1.101
+ * @param value The value tested for being truthy.
+ * @param message All arguments besides `value` are used as error message.
+ */
+ assert(value: any, message?: string, ...optionalParams: any[]): void;
+ /**
+ * When `stdout` is a TTY, calling `console.clear()` will attempt to clear the
+ * TTY. When `stdout` is not a TTY, this method does nothing.
+ *
+ * The specific operation of `console.clear()` can vary across operating systems
+ * and terminal types. For most Linux operating systems, `console.clear()`operates similarly to the `clear` shell command. On Windows, `console.clear()`will clear only the output in the
+ * current terminal viewport for the Node.js
+ * binary.
+ * @since v8.3.0
+ */
+ clear(): void;
+ /**
+ * Maintains an internal counter specific to `label` and outputs to `stdout` the
+ * number of times `console.count()` has been called with the given `label`.
+ *
+ * ```js
+ * > console.count()
+ * default: 1
+ * undefined
+ * > console.count('default')
+ * default: 2
+ * undefined
+ * > console.count('abc')
+ * abc: 1
+ * undefined
+ * > console.count('xyz')
+ * xyz: 1
+ * undefined
+ * > console.count('abc')
+ * abc: 2
+ * undefined
+ * > console.count()
+ * default: 3
+ * undefined
+ * >
+ * ```
+ * @since v8.3.0
+ * @param label The display label for the counter.
+ */
+ count(label?: string): void;
+ /**
+ * Resets the internal counter specific to `label`.
+ *
+ * ```js
+ * > console.count('abc');
+ * abc: 1
+ * undefined
+ * > console.countReset('abc');
+ * undefined
+ * > console.count('abc');
+ * abc: 1
+ * undefined
+ * >
+ * ```
+ * @since v8.3.0
+ * @param label The display label for the counter.
+ */
+ countReset(label?: string): void;
+ /**
+ * The `console.debug()` function is an alias for {@link log}.
+ * @since v8.0.0
+ */
+ debug(message?: any, ...optionalParams: any[]): void;
+ /**
+ * Uses `util.inspect()` on `obj` and prints the resulting string to `stdout`.
+ * This function bypasses any custom `inspect()` function defined on `obj`.
+ * @since v0.1.101
+ */
+ dir(obj: any, options?: InspectOptions): void;
+ /**
+ * This method calls `console.log()` passing it the arguments received.
+ * This method does not produce any XML formatting.
+ * @since v8.0.0
+ */
+ dirxml(...data: any[]): void;
+ /**
+ * Prints to `stderr` with newline. Multiple arguments can be passed, with the
+ * first used as the primary message and all additional used as substitution
+ * values similar to [`printf(3)`](http://man7.org/linux/man-pages/man3/printf.3.html) (the arguments are all passed to `util.format()`).
+ *
+ * ```js
+ * const code = 5;
+ * console.error('error #%d', code);
+ * // Prints: error #5, to stderr
+ * console.error('error', code);
+ * // Prints: error 5, to stderr
+ * ```
+ *
+ * If formatting elements (e.g. `%d`) are not found in the first string then `util.inspect()` is called on each argument and the resulting string
+ * values are concatenated. See `util.format()` for more information.
+ * @since v0.1.100
+ */
+ error(message?: any, ...optionalParams: any[]): void;
+ /**
+ * Increases indentation of subsequent lines by spaces for `groupIndentation`length.
+ *
+ * If one or more `label`s are provided, those are printed first without the
+ * additional indentation.
+ * @since v8.5.0
+ */
+ group(...label: any[]): void;
+ /**
+ * An alias for {@link group}.
+ * @since v8.5.0
+ */
+ groupCollapsed(...label: any[]): void;
+ /**
+ * Decreases indentation of subsequent lines by spaces for `groupIndentation`length.
+ * @since v8.5.0
+ */
+ groupEnd(): void;
+ /**
+ * The `console.info()` function is an alias for {@link log}.
+ * @since v0.1.100
+ */
+ info(message?: any, ...optionalParams: any[]): void;
+ /**
+ * Prints to `stdout` with newline. Multiple arguments can be passed, with the
+ * first used as the primary message and all additional used as substitution
+ * values similar to [`printf(3)`](http://man7.org/linux/man-pages/man3/printf.3.html) (the arguments are all passed to `util.format()`).
+ *
+ * ```js
+ * const count = 5;
+ * console.log('count: %d', count);
+ * // Prints: count: 5, to stdout
+ * console.log('count:', count);
+ * // Prints: count: 5, to stdout
+ * ```
+ *
+ * See `util.format()` for more information.
+ * @since v0.1.100
+ */
+ 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
+ * logging the argument if it can’t be parsed as tabular.
+ *
+ * ```js
+ * // These can't be parsed as tabular data
+ * console.table(Symbol());
+ * // Symbol()
+ *
+ * console.table(undefined);
+ * // undefined
+ *
+ * console.table([{ a: 1, b: 'Y' }, { a: 'Z', b: 2 }]);
+ * // ┌─────────┬─────┬─────┐
+ * // │ (index) │ a │ b │
+ * // ├─────────┼─────┼─────┤
+ * // │ 0 │ 1 │ 'Y' │
+ * // │ 1 │ 'Z' │ 2 │
+ * // └─────────┴─────┴─────┘
+ *
+ * console.table([{ a: 1, b: 'Y' }, { a: 'Z', b: 2 }], ['a']);
+ * // ┌─────────┬─────┐
+ * // │ (index) │ a │
+ * // ├─────────┼─────┤
+ * // │ 0 │ 1 │
+ * // │ 1 │ 'Z' │
+ * // └─────────┴─────┘
+ * ```
+ * @since v10.0.0
+ * @param properties Alternate properties for constructing the table.
+ */
+ table(tabularData: any, properties?: readonly string[]): void;
+ /**
+ * Starts a timer that can be used to compute the duration of an operation. Timers
+ * are identified by a unique `label`. Use the same `label` when calling {@link timeEnd} to stop the timer and output the elapsed time in
+ * suitable time units to `stdout`. For example, if the elapsed
+ * time is 3869ms, `console.timeEnd()` displays "3.869s".
+ * @since v0.1.104
+ */
+ time(label?: string): void;
+ /**
+ * Stops a timer that was previously started by calling {@link time} and
+ * prints the result to `stdout`:
+ *
+ * ```js
+ * console.time('100-elements');
+ * for (let i = 0; i < 100; i++) {}
+ * console.timeEnd('100-elements');
+ * // prints 100-elements: 225.438ms
+ * ```
+ * @since v0.1.104
+ */
+ timeEnd(label?: string): void;
+ /**
+ * For a timer that was previously started by calling {@link time}, prints
+ * the elapsed time and other `data` arguments to `stdout`:
+ *
+ * ```js
+ * console.time('process');
+ * const value = expensiveProcess1(); // Returns 42
+ * console.timeLog('process', value);
+ * // Prints "process: 365.227ms 42".
+ * doExpensiveProcess2(value);
+ * console.timeEnd('process');
+ * ```
+ * @since v10.7.0
+ */
+ timeLog(label?: string, ...data: any[]): void;
+ /**
+ * Prints to `stderr` the string `'Trace: '`, followed by the `util.format()` formatted message and stack trace to the current position in the code.
+ *
+ * ```js
+ * console.trace('Show me');
+ * // Prints: (stack trace will vary based on where trace is called)
+ * // Trace: Show me
+ * // at repl:2:9
+ * // at REPLServer.defaultEval (repl.js:248:27)
+ * // at bound (domain.js:287:14)
+ * // at REPLServer.runBound [as eval] (domain.js:300:12)
+ * // at REPLServer.<anonymous> (repl.js:412:12)
+ * // at emitOne (events.js:82:20)
+ * // at REPLServer.emit (events.js:169:7)
+ * // at REPLServer.Interface._onLine (readline.js:210:10)
+ * // at REPLServer.Interface._line (readline.js:549:8)
+ * // at REPLServer.Interface._ttyWrite (readline.js:826:14)
+ * ```
+ * @since v0.1.104
+ */
+ trace(message?: any, ...optionalParams: any[]): void;
+ /**
+ * The `console.warn()` function is an alias for {@link error}.
+ * @since v0.1.100
+ */
+ warn(message?: any, ...optionalParams: any[]): void;
+ // --- Inspector mode only ---
+ /**
+ * This method does not display anything unless used in the inspector.
+ * Starts a JavaScript CPU profile with an optional label.
+ */
+ profile(label?: string): void;
+ /**
+ * This method does not display anything unless used in the inspector.
+ * Stops the current JavaScript CPU profiling session if one has been started and prints the report to the Profiles panel of the inspector.
+ */
+ profileEnd(label?: string): void;
+ /**
+ * This method does not display anything unless used in the inspector.
+ * Adds an event with the label `label` to the Timeline panel of the inspector.
+ */
+ timeStamp(label?: string): void;
+ }
+ /**
+ * The `console` module provides a simple debugging console that is similar to the
+ * JavaScript console mechanism provided by web browsers.
+ *
+ * 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 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
+ * synchronous like the browser APIs they resemble, nor are they consistently
+ * asynchronous like all other Node.js streams. See the `note on process I/O` for
+ * more information.
+ *
+ * Example using the global `console`:
+ *
+ * ```js
+ * console.log('hello world');
+ * // Prints: hello world, to stdout
+ * console.log('hello %s', 'world');
+ * // Prints: hello world, to stdout
+ * console.error(new Error('Whoops, something bad happened'));
+ * // Prints error message and stack trace to stderr:
+ * // Error: Whoops, something bad happened
+ * // at [eval]:5:15
+ * // at Script.runInThisContext (node:vm:132:18)
+ * // at Object.runInThisContext (node:vm:309:38)
+ * // at node:internal/process/execution:77:19
+ * // at [eval]-wrapper:6:22
+ * // at evalScript (node:internal/process/execution:76:60)
+ * // at node:internal/main/eval_string:23:3
+ *
+ * const name = 'Will Robinson';
+ * console.warn(`Danger ${name}! Danger!`);
+ * // Prints: Danger Will Robinson! Danger!, to stderr
+ * ```
+ *
+ * Example using the `Console` class:
+ *
+ * ```js
+ * const out = getStreamSomehow();
+ * const err = getStreamSomehow();
+ * const myConsole = new console.Console(out, err);
+ *
+ * myConsole.log('hello world');
+ * // Prints: hello world, to out
+ * myConsole.log('hello %s', 'world');
+ * // Prints: hello world, to out
+ * myConsole.error(new Error('Whoops, something bad happened'));
+ * // Prints: [Error: Whoops, something bad happened], to err
+ *
+ * const name = 'Will Robinson';
+ * myConsole.warn(`Danger ${name}! Danger!`);
+ * // Prints: Danger Will Robinson! Danger!, to err
+ * ```
+ * @see [source](https://github.com/nodejs/node/blob/v16.4.2/lib/console.js)
+ */
+ namespace console {
+ interface ConsoleConstructorOptions {
+ stdout: NodeJS.WritableStream;
+ stderr?: NodeJS.WritableStream | undefined;
+ ignoreErrors?: boolean | undefined;
+ colorMode?: boolean | "auto" | undefined;
+ inspectOptions?: InspectOptions | undefined;
+ /**
+ * Set group indentation
+ * @default 2
+ */
+ groupIndentation?: number | undefined;
+ }
+ interface ConsoleConstructor {
+ prototype: Console;
+ new(stdout: NodeJS.WritableStream, stderr?: NodeJS.WritableStream, ignoreErrors?: boolean): Console;
+ new(options: ConsoleConstructorOptions): Console;
+ }
+ }
+ var console: Console;
+ }
+ export = globalThis.console;
+}
diff --git a/client/node_modules/@types/node/ts4.8/constants.d.ts b/client/node_modules/@types/node/ts4.8/constants.d.ts
new file mode 100644
index 0000000..c3ac2b8
--- /dev/null
+++ b/client/node_modules/@types/node/ts4.8/constants.d.ts
@@ -0,0 +1,19 @@
+/** @deprecated since v6.3.0 - use constants property exposed by the relevant module instead. */
+declare module "constants" {
+ import { constants as osConstants, SignalConstants } from "node:os";
+ import { constants as cryptoConstants } from "node:crypto";
+ import { constants as fsConstants } from "node:fs";
+
+ const exp:
+ & typeof osConstants.errno
+ & typeof osConstants.priority
+ & SignalConstants
+ & typeof cryptoConstants
+ & typeof fsConstants;
+ export = exp;
+}
+
+declare module "node:constants" {
+ import constants = require("constants");
+ export = constants;
+}
diff --git a/client/node_modules/@types/node/ts4.8/crypto.d.ts b/client/node_modules/@types/node/ts4.8/crypto.d.ts
new file mode 100644
index 0000000..0da5e28
--- /dev/null
+++ b/client/node_modules/@types/node/ts4.8/crypto.d.ts
@@ -0,0 +1,4450 @@
+/**
+ * The `crypto` module provides cryptographic functionality that includes a set of
+ * wrappers for OpenSSL's hash, HMAC, cipher, decipher, sign, and verify functions.
+ *
+ * ```js
+ * const { createHmac } = await import('crypto');
+ *
+ * const secret = 'abcdefg';
+ * const hash = createHmac('sha256', secret)
+ * .update('I love cupcakes')
+ * .digest('hex');
+ * console.log(hash);
+ * // Prints:
+ * // c0fa1bc00531bd78ef38c628449c5102aeabd49b5dc3a2a516ea6ea959d6658e
+ * ```
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/crypto.js)
+ */
+declare module "crypto" {
+ import * as stream from "node:stream";
+ import { PeerCertificate } from "node:tls";
+ /**
+ * SPKAC is a Certificate Signing Request mechanism originally implemented by
+ * Netscape and was specified formally as part of [HTML5's `keygen` element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/keygen).
+ *
+ * `<keygen>` is deprecated since [HTML 5.2](https://www.w3.org/TR/html52/changes.html#features-removed) and new projects
+ * should not use this element anymore.
+ *
+ * The `crypto` module provides the `Certificate` class for working with SPKAC
+ * data. The most common usage is handling output generated by the HTML5`<keygen>` element. Node.js uses [OpenSSL's SPKAC
+ * implementation](https://www.openssl.org/docs/man1.1.0/apps/openssl-spkac.html) internally.
+ * @since v0.11.8
+ */
+ class Certificate {
+ /**
+ * ```js
+ * const { Certificate } = await import('crypto');
+ * const spkac = getSpkacSomehow();
+ * const challenge = Certificate.exportChallenge(spkac);
+ * console.log(challenge.toString('utf8'));
+ * // Prints: the challenge as a UTF8 string
+ * ```
+ * @since v9.0.0
+ * @param encoding The `encoding` of the `spkac` string.
+ * @return The challenge component of the `spkac` data structure, which includes a public key and a challenge.
+ */
+ static exportChallenge(spkac: BinaryLike): Buffer;
+ /**
+ * ```js
+ * const { Certificate } = await import('crypto');
+ * const spkac = getSpkacSomehow();
+ * const publicKey = Certificate.exportPublicKey(spkac);
+ * console.log(publicKey);
+ * // Prints: the public key as <Buffer ...>
+ * ```
+ * @since v9.0.0
+ * @param encoding The `encoding` of the `spkac` string.
+ * @return The public key component of the `spkac` data structure, which includes a public key and a challenge.
+ */
+ static exportPublicKey(spkac: BinaryLike, encoding?: string): Buffer;
+ /**
+ * ```js
+ * import { Buffer } from 'buffer';
+ * const { Certificate } = await import('crypto');
+ *
+ * const spkac = getSpkacSomehow();
+ * console.log(Certificate.verifySpkac(Buffer.from(spkac)));
+ * // Prints: true or false
+ * ```
+ * @since v9.0.0
+ * @param encoding The `encoding` of the `spkac` string.
+ * @return `true` if the given `spkac` data structure is valid, `false` otherwise.
+ */
+ static verifySpkac(spkac: NodeJS.ArrayBufferView): boolean;
+ /**
+ * @deprecated
+ * @param spkac
+ * @returns The challenge component of the `spkac` data structure,
+ * which includes a public key and a challenge.
+ */
+ exportChallenge(spkac: BinaryLike): Buffer;
+ /**
+ * @deprecated
+ * @param spkac
+ * @param encoding The encoding of the spkac string.
+ * @returns The public key component of the `spkac` data structure,
+ * which includes a public key and a challenge.
+ */
+ exportPublicKey(spkac: BinaryLike, encoding?: string): Buffer;
+ /**
+ * @deprecated
+ * @param spkac
+ * @returns `true` if the given `spkac` data structure is valid,
+ * `false` otherwise.
+ */
+ verifySpkac(spkac: NodeJS.ArrayBufferView): boolean;
+ }
+ namespace constants {
+ // https://nodejs.org/dist/latest-v10.x/docs/api/crypto.html#crypto_crypto_constants
+ const OPENSSL_VERSION_NUMBER: number;
+ /** Applies multiple bug workarounds within OpenSSL. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html for detail. */
+ const SSL_OP_ALL: number;
+ /** Allows legacy insecure renegotiation between OpenSSL and unpatched clients or servers. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html. */
+ const SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION: number;
+ /** Attempts to use the server's preferences instead of the client's when selecting a cipher. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html. */
+ const SSL_OP_CIPHER_SERVER_PREFERENCE: number;
+ /** Instructs OpenSSL to use Cisco's "speshul" version of DTLS_BAD_VER. */
+ const SSL_OP_CISCO_ANYCONNECT: number;
+ /** Instructs OpenSSL to turn on cookie exchange. */
+ const SSL_OP_COOKIE_EXCHANGE: number;
+ /** Instructs OpenSSL to add server-hello extension from an early version of the cryptopro draft. */
+ const SSL_OP_CRYPTOPRO_TLSEXT_BUG: number;
+ /** Instructs OpenSSL to disable a SSL 3.0/TLS 1.0 vulnerability workaround added in OpenSSL 0.9.6d. */
+ const SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS: number;
+ /** Instructs OpenSSL to always use the tmp_rsa key when performing RSA operations. */
+ const SSL_OP_EPHEMERAL_RSA: number;
+ /** Allows initial connection to servers that do not support RI. */
+ const SSL_OP_LEGACY_SERVER_CONNECT: number;
+ const SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER: number;
+ const SSL_OP_MICROSOFT_SESS_ID_BUG: number;
+ /** Instructs OpenSSL to disable the workaround for a man-in-the-middle protocol-version vulnerability in the SSL 2.0 server implementation. */
+ const SSL_OP_MSIE_SSLV2_RSA_PADDING: number;
+ const SSL_OP_NETSCAPE_CA_DN_BUG: number;
+ const SSL_OP_NETSCAPE_CHALLENGE_BUG: number;
+ const SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG: number;
+ const SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG: number;
+ /** Instructs OpenSSL to disable support for SSL/TLS compression. */
+ const SSL_OP_NO_COMPRESSION: number;
+ const SSL_OP_NO_QUERY_MTU: number;
+ /** Instructs OpenSSL to always start a new session when performing renegotiation. */
+ const SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION: number;
+ const SSL_OP_NO_SSLv2: number;
+ const SSL_OP_NO_SSLv3: number;
+ const SSL_OP_NO_TICKET: number;
+ const SSL_OP_NO_TLSv1: number;
+ const SSL_OP_NO_TLSv1_1: number;
+ const SSL_OP_NO_TLSv1_2: number;
+ const SSL_OP_PKCS1_CHECK_1: number;
+ const SSL_OP_PKCS1_CHECK_2: number;
+ /** Instructs OpenSSL to always create a new key when using temporary/ephemeral DH parameters. */
+ const SSL_OP_SINGLE_DH_USE: number;
+ /** Instructs OpenSSL to always create a new key when using temporary/ephemeral ECDH parameters. */
+ const SSL_OP_SINGLE_ECDH_USE: number;
+ const SSL_OP_SSLEAY_080_CLIENT_DH_BUG: number;
+ const SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG: number;
+ const SSL_OP_TLS_BLOCK_PADDING_BUG: number;
+ const SSL_OP_TLS_D5_BUG: number;
+ /** Instructs OpenSSL to disable version rollback attack detection. */
+ const SSL_OP_TLS_ROLLBACK_BUG: number;
+ const ENGINE_METHOD_RSA: number;
+ const ENGINE_METHOD_DSA: number;
+ const ENGINE_METHOD_DH: number;
+ const ENGINE_METHOD_RAND: number;
+ const ENGINE_METHOD_EC: number;
+ const ENGINE_METHOD_CIPHERS: number;
+ const ENGINE_METHOD_DIGESTS: number;
+ const ENGINE_METHOD_PKEY_METHS: number;
+ const ENGINE_METHOD_PKEY_ASN1_METHS: number;
+ const ENGINE_METHOD_ALL: number;
+ const ENGINE_METHOD_NONE: number;
+ const DH_CHECK_P_NOT_SAFE_PRIME: number;
+ const DH_CHECK_P_NOT_PRIME: number;
+ const DH_UNABLE_TO_CHECK_GENERATOR: number;
+ const DH_NOT_SUITABLE_GENERATOR: number;
+ const ALPN_ENABLED: number;
+ const RSA_PKCS1_PADDING: number;
+ const RSA_SSLV23_PADDING: number;
+ const RSA_NO_PADDING: number;
+ const RSA_PKCS1_OAEP_PADDING: number;
+ const RSA_X931_PADDING: number;
+ const RSA_PKCS1_PSS_PADDING: number;
+ /** Sets the salt length for RSA_PKCS1_PSS_PADDING to the digest size when signing or verifying. */
+ const RSA_PSS_SALTLEN_DIGEST: number;
+ /** Sets the salt length for RSA_PKCS1_PSS_PADDING to the maximum permissible value when signing data. */
+ const RSA_PSS_SALTLEN_MAX_SIGN: number;
+ /** Causes the salt length for RSA_PKCS1_PSS_PADDING to be determined automatically when verifying a signature. */
+ const RSA_PSS_SALTLEN_AUTO: number;
+ const POINT_CONVERSION_COMPRESSED: number;
+ const POINT_CONVERSION_UNCOMPRESSED: number;
+ const POINT_CONVERSION_HYBRID: number;
+ /** Specifies the built-in default cipher list used by Node.js (colon-separated values). */
+ const defaultCoreCipherList: string;
+ /** Specifies the active default cipher list used by the current Node.js process (colon-separated values). */
+ const defaultCipherList: string;
+ }
+ interface HashOptions extends stream.TransformOptions {
+ /**
+ * For XOF hash functions such as `shake256`, the
+ * outputLength option can be used to specify the desired output length in bytes.
+ */
+ outputLength?: number | undefined;
+ }
+ /** @deprecated since v10.0.0 */
+ const fips: boolean;
+ /**
+ * Creates and returns a `Hash` object that can be used to generate hash digests
+ * using the given `algorithm`. Optional `options` argument controls stream
+ * behavior. For XOF hash functions such as `'shake256'`, the `outputLength` option
+ * can be used to specify the desired output length in bytes.
+ *
+ * The `algorithm` is dependent on the available algorithms supported by the
+ * version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc.
+ * On recent releases of OpenSSL, `openssl list -digest-algorithms` will
+ * display the available digest algorithms.
+ *
+ * Example: generating the sha256 sum of a file
+ *
+ * ```js
+ * import {
+ * createReadStream
+ * } from 'fs';
+ * import { argv } from 'process';
+ * const {
+ * createHash
+ * } = await import('crypto');
+ *
+ * const filename = argv[2];
+ *
+ * const hash = createHash('sha256');
+ *
+ * const input = createReadStream(filename);
+ * input.on('readable', () => {
+ * // Only one element is going to be produced by the
+ * // hash stream.
+ * const data = input.read();
+ * if (data)
+ * hash.update(data);
+ * else {
+ * console.log(`${hash.digest('hex')} ${filename}`);
+ * }
+ * });
+ * ```
+ * @since v0.1.92
+ * @param options `stream.transform` options
+ */
+ function createHash(algorithm: string, options?: HashOptions): Hash;
+ /**
+ * Creates and returns an `Hmac` object that uses the given `algorithm` and `key`.
+ * Optional `options` argument controls stream behavior.
+ *
+ * The `algorithm` is dependent on the available algorithms supported by the
+ * version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc.
+ * On recent releases of OpenSSL, `openssl list -digest-algorithms` will
+ * display the available digest algorithms.
+ *
+ * The `key` is the HMAC key used to generate the cryptographic HMAC hash. If it is
+ * a `KeyObject`, its type must be `secret`.
+ *
+ * Example: generating the sha256 HMAC of a file
+ *
+ * ```js
+ * import {
+ * createReadStream
+ * } from 'fs';
+ * import { argv } from 'process';
+ * const {
+ * createHmac
+ * } = await import('crypto');
+ *
+ * const filename = argv[2];
+ *
+ * const hmac = createHmac('sha256', 'a secret');
+ *
+ * const input = createReadStream(filename);
+ * input.on('readable', () => {
+ * // Only one element is going to be produced by the
+ * // hash stream.
+ * const data = input.read();
+ * if (data)
+ * hmac.update(data);
+ * else {
+ * console.log(`${hmac.digest('hex')} ${filename}`);
+ * }
+ * });
+ * ```
+ * @since v0.1.94
+ * @param options `stream.transform` options
+ */
+ function createHmac(algorithm: string, key: BinaryLike | KeyObject, options?: stream.TransformOptions): Hmac;
+ // https://nodejs.org/api/buffer.html#buffer_buffers_and_character_encodings
+ type BinaryToTextEncoding = "base64" | "base64url" | "hex" | "binary";
+ type CharacterEncoding = "utf8" | "utf-8" | "utf16le" | "latin1";
+ type LegacyCharacterEncoding = "ascii" | "binary" | "ucs2" | "ucs-2";
+ type Encoding = BinaryToTextEncoding | CharacterEncoding | LegacyCharacterEncoding;
+ type ECDHKeyFormat = "compressed" | "uncompressed" | "hybrid";
+ /**
+ * The `Hash` class is a utility for creating hash digests of data. It can be
+ * used in one of two ways:
+ *
+ * * As a `stream` that is both readable and writable, where data is written
+ * to produce a computed hash digest on the readable side, or
+ * * Using the `hash.update()` and `hash.digest()` methods to produce the
+ * computed hash.
+ *
+ * The {@link createHash} method is used to create `Hash` instances. `Hash`objects are not to be created directly using the `new` keyword.
+ *
+ * Example: Using `Hash` objects as streams:
+ *
+ * ```js
+ * const {
+ * createHash
+ * } = await import('crypto');
+ *
+ * const hash = createHash('sha256');
+ *
+ * hash.on('readable', () => {
+ * // Only one element is going to be produced by the
+ * // hash stream.
+ * const data = hash.read();
+ * if (data) {
+ * console.log(data.toString('hex'));
+ * // Prints:
+ * // 6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50
+ * }
+ * });
+ *
+ * hash.write('some data to hash');
+ * hash.end();
+ * ```
+ *
+ * Example: Using `Hash` and piped streams:
+ *
+ * ```js
+ * import { createReadStream } from 'fs';
+ * import { stdout } from 'process';
+ * const { createHash } = await import('crypto');
+ *
+ * const hash = createHash('sha256');
+ *
+ * const input = createReadStream('test.js');
+ * input.pipe(hash).setEncoding('hex').pipe(stdout);
+ * ```
+ *
+ * Example: Using the `hash.update()` and `hash.digest()` methods:
+ *
+ * ```js
+ * const {
+ * createHash
+ * } = await import('crypto');
+ *
+ * const hash = createHash('sha256');
+ *
+ * hash.update('some data to hash');
+ * console.log(hash.digest('hex'));
+ * // Prints:
+ * // 6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50
+ * ```
+ * @since v0.1.92
+ */
+ class Hash extends stream.Transform {
+ private constructor();
+ /**
+ * Creates a new `Hash` object that contains a deep copy of the internal state
+ * of the current `Hash` object.
+ *
+ * The optional `options` argument controls stream behavior. For XOF hash
+ * functions such as `'shake256'`, the `outputLength` option can be used to
+ * specify the desired output length in bytes.
+ *
+ * An error is thrown when an attempt is made to copy the `Hash` object after
+ * its `hash.digest()` method has been called.
+ *
+ * ```js
+ * // Calculate a rolling hash.
+ * const {
+ * createHash
+ * } = await import('crypto');
+ *
+ * const hash = createHash('sha256');
+ *
+ * hash.update('one');
+ * console.log(hash.copy().digest('hex'));
+ *
+ * hash.update('two');
+ * console.log(hash.copy().digest('hex'));
+ *
+ * hash.update('three');
+ * console.log(hash.copy().digest('hex'));
+ *
+ * // Etc.
+ * ```
+ * @since v13.1.0
+ * @param options `stream.transform` options
+ */
+ copy(options?: stream.TransformOptions): Hash;
+ /**
+ * Updates the hash content with the given `data`, the encoding of which
+ * is given in `inputEncoding`.
+ * If `encoding` is not provided, and the `data` is a string, an
+ * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored.
+ *
+ * This can be called many times with new data as it is streamed.
+ * @since v0.1.92
+ * @param inputEncoding The `encoding` of the `data` string.
+ */
+ update(data: BinaryLike): Hash;
+ update(data: string, inputEncoding: Encoding): Hash;
+ /**
+ * Calculates the digest of all of the data passed to be hashed (using the `hash.update()` method).
+ * If `encoding` is provided a string will be returned; otherwise
+ * a `Buffer` is returned.
+ *
+ * The `Hash` object can not be used again after `hash.digest()` method has been
+ * called. Multiple calls will cause an error to be thrown.
+ * @since v0.1.92
+ * @param encoding The `encoding` of the return value.
+ */
+ digest(): Buffer;
+ digest(encoding: BinaryToTextEncoding): string;
+ }
+ /**
+ * The `Hmac` class is a utility for creating cryptographic HMAC digests. It can
+ * be used in one of two ways:
+ *
+ * * As a `stream` that is both readable and writable, where data is written
+ * to produce a computed HMAC digest on the readable side, or
+ * * Using the `hmac.update()` and `hmac.digest()` methods to produce the
+ * computed HMAC digest.
+ *
+ * The {@link createHmac} method is used to create `Hmac` instances. `Hmac`objects are not to be created directly using the `new` keyword.
+ *
+ * Example: Using `Hmac` objects as streams:
+ *
+ * ```js
+ * const {
+ * createHmac
+ * } = await import('crypto');
+ *
+ * const hmac = createHmac('sha256', 'a secret');
+ *
+ * hmac.on('readable', () => {
+ * // Only one element is going to be produced by the
+ * // hash stream.
+ * const data = hmac.read();
+ * if (data) {
+ * console.log(data.toString('hex'));
+ * // Prints:
+ * // 7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e
+ * }
+ * });
+ *
+ * hmac.write('some data to hash');
+ * hmac.end();
+ * ```
+ *
+ * Example: Using `Hmac` and piped streams:
+ *
+ * ```js
+ * import { createReadStream } from 'fs';
+ * import { stdout } from 'process';
+ * const {
+ * createHmac
+ * } = await import('crypto');
+ *
+ * const hmac = createHmac('sha256', 'a secret');
+ *
+ * const input = createReadStream('test.js');
+ * input.pipe(hmac).pipe(stdout);
+ * ```
+ *
+ * Example: Using the `hmac.update()` and `hmac.digest()` methods:
+ *
+ * ```js
+ * const {
+ * createHmac
+ * } = await import('crypto');
+ *
+ * const hmac = createHmac('sha256', 'a secret');
+ *
+ * hmac.update('some data to hash');
+ * console.log(hmac.digest('hex'));
+ * // Prints:
+ * // 7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e
+ * ```
+ * @since v0.1.94
+ */
+ class Hmac extends stream.Transform {
+ private constructor();
+ /**
+ * Updates the `Hmac` content with the given `data`, the encoding of which
+ * is given in `inputEncoding`.
+ * If `encoding` is not provided, and the `data` is a string, an
+ * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored.
+ *
+ * This can be called many times with new data as it is streamed.
+ * @since v0.1.94
+ * @param inputEncoding The `encoding` of the `data` string.
+ */
+ update(data: BinaryLike): Hmac;
+ update(data: string, inputEncoding: Encoding): Hmac;
+ /**
+ * Calculates the HMAC digest of all of the data passed using `hmac.update()`.
+ * If `encoding` is
+ * provided a string is returned; otherwise a `Buffer` is returned;
+ *
+ * The `Hmac` object can not be used again after `hmac.digest()` has been
+ * called. Multiple calls to `hmac.digest()` will result in an error being thrown.
+ * @since v0.1.94
+ * @param encoding The `encoding` of the return value.
+ */
+ digest(): Buffer;
+ digest(encoding: BinaryToTextEncoding): string;
+ }
+ type KeyObjectType = "secret" | "public" | "private";
+ interface KeyExportOptions<T extends KeyFormat> {
+ type: "pkcs1" | "spki" | "pkcs8" | "sec1";
+ format: T;
+ cipher?: string | undefined;
+ passphrase?: string | Buffer | undefined;
+ }
+ interface JwkKeyExportOptions {
+ format: "jwk";
+ }
+ interface JsonWebKey {
+ crv?: string | undefined;
+ d?: string | undefined;
+ dp?: string | undefined;
+ dq?: string | undefined;
+ e?: string | undefined;
+ k?: string | undefined;
+ kty?: string | undefined;
+ n?: string | undefined;
+ p?: string | undefined;
+ q?: string | undefined;
+ qi?: string | undefined;
+ x?: string | undefined;
+ y?: string | undefined;
+ [key: string]: unknown;
+ }
+ interface AsymmetricKeyDetails {
+ /**
+ * Key size in bits (RSA, DSA).
+ */
+ modulusLength?: number | undefined;
+ /**
+ * Public exponent (RSA).
+ */
+ publicExponent?: bigint | undefined;
+ /**
+ * Name of the message digest (RSA-PSS).
+ */
+ hashAlgorithm?: string | undefined;
+ /**
+ * Name of the message digest used by MGF1 (RSA-PSS).
+ */
+ mgf1HashAlgorithm?: string | undefined;
+ /**
+ * Minimal salt length in bytes (RSA-PSS).
+ */
+ saltLength?: number | undefined;
+ /**
+ * Size of q in bits (DSA).
+ */
+ divisorLength?: number | undefined;
+ /**
+ * Name of the curve (EC).
+ */
+ namedCurve?: string | undefined;
+ }
+ /**
+ * Node.js uses a `KeyObject` class to represent a symmetric or asymmetric key,
+ * and each kind of key exposes different functions. The {@link createSecretKey}, {@link createPublicKey} and {@link createPrivateKey} methods are used to create `KeyObject`instances. `KeyObject`
+ * objects are not to be created directly using the `new`keyword.
+ *
+ * Most applications should consider using the new `KeyObject` API instead of
+ * passing keys as strings or `Buffer`s due to improved security features.
+ *
+ * `KeyObject` instances can be passed to other threads via `postMessage()`.
+ * The receiver obtains a cloned `KeyObject`, and the `KeyObject` does not need to
+ * be listed in the `transferList` argument.
+ * @since v11.6.0
+ */
+ class KeyObject {
+ private constructor();
+ /**
+ * Example: Converting a `CryptoKey` instance to a `KeyObject`:
+ *
+ * ```js
+ * const { webcrypto, KeyObject } = await import('crypto');
+ * const { subtle } = webcrypto;
+ *
+ * const key = await subtle.generateKey({
+ * name: 'HMAC',
+ * hash: 'SHA-256',
+ * length: 256
+ * }, true, ['sign', 'verify']);
+ *
+ * const keyObject = KeyObject.from(key);
+ * console.log(keyObject.symmetricKeySize);
+ * // Prints: 32 (symmetric key size in bytes)
+ * ```
+ * @since v15.0.0
+ */
+ static from(key: webcrypto.CryptoKey): KeyObject;
+ /**
+ * For asymmetric keys, this property represents the type of the key. Supported key
+ * types are:
+ *
+ * * `'rsa'` (OID 1.2.840.113549.1.1.1)
+ * * `'rsa-pss'` (OID 1.2.840.113549.1.1.10)
+ * * `'dsa'` (OID 1.2.840.10040.4.1)
+ * * `'ec'` (OID 1.2.840.10045.2.1)
+ * * `'x25519'` (OID 1.3.101.110)
+ * * `'x448'` (OID 1.3.101.111)
+ * * `'ed25519'` (OID 1.3.101.112)
+ * * `'ed448'` (OID 1.3.101.113)
+ * * `'dh'` (OID 1.2.840.113549.1.3.1)
+ *
+ * This property is `undefined` for unrecognized `KeyObject` types and symmetric
+ * keys.
+ * @since v11.6.0
+ */
+ asymmetricKeyType?: KeyType | undefined;
+ /**
+ * For asymmetric keys, this property represents the size of the embedded key in
+ * bytes. This property is `undefined` for symmetric keys.
+ */
+ asymmetricKeySize?: number | undefined;
+ /**
+ * This property exists only on asymmetric keys. Depending on the type of the key,
+ * this object contains information about the key. None of the information obtained
+ * through this property can be used to uniquely identify a key or to compromise
+ * the security of the key.
+ *
+ * For RSA-PSS keys, if the key material contains a `RSASSA-PSS-params` sequence,
+ * the `hashAlgorithm`, `mgf1HashAlgorithm`, and `saltLength` properties will be
+ * set.
+ *
+ * Other key details might be exposed via this API using additional attributes.
+ * @since v15.7.0
+ */
+ asymmetricKeyDetails?: AsymmetricKeyDetails | undefined;
+ /**
+ * For symmetric keys, the following encoding options can be used:
+ *
+ * For public keys, the following encoding options can be used:
+ *
+ * For private keys, the following encoding options can be used:
+ *
+ * The result type depends on the selected encoding format, when PEM the
+ * result is a string, when DER it will be a buffer containing the data
+ * encoded as DER, when [JWK](https://tools.ietf.org/html/rfc7517) it will be an object.
+ *
+ * When [JWK](https://tools.ietf.org/html/rfc7517) encoding format was selected, all other encoding options are
+ * ignored.
+ *
+ * PKCS#1, SEC1, and PKCS#8 type keys can be encrypted by using a combination of
+ * the `cipher` and `format` options. The PKCS#8 `type` can be used with any`format` to encrypt any key algorithm (RSA, EC, or DH) by specifying a`cipher`. PKCS#1 and SEC1 can only be
+ * encrypted by specifying a `cipher`when the PEM `format` is used. For maximum compatibility, use PKCS#8 for
+ * encrypted private keys. Since PKCS#8 defines its own
+ * encryption mechanism, PEM-level encryption is not supported when encrypting
+ * a PKCS#8 key. See [RFC 5208](https://www.rfc-editor.org/rfc/rfc5208.txt) for PKCS#8 encryption and [RFC 1421](https://www.rfc-editor.org/rfc/rfc1421.txt) for
+ * PKCS#1 and SEC1 encryption.
+ * @since v11.6.0
+ */
+ export(options: KeyExportOptions<"pem">): string | Buffer;
+ export(options?: KeyExportOptions<"der">): Buffer;
+ export(options?: JwkKeyExportOptions): JsonWebKey;
+ /**
+ * For secret keys, this property represents the size of the key in bytes. This
+ * property is `undefined` for asymmetric keys.
+ * @since v11.6.0
+ */
+ symmetricKeySize?: number | undefined;
+ /**
+ * Depending on the type of this `KeyObject`, this property is either`'secret'` for secret (symmetric) keys, `'public'` for public (asymmetric) keys
+ * or `'private'` for private (asymmetric) keys.
+ * @since v11.6.0
+ */
+ type: KeyObjectType;
+ }
+ type CipherCCMTypes = "aes-128-ccm" | "aes-192-ccm" | "aes-256-ccm" | "chacha20-poly1305";
+ type CipherGCMTypes = "aes-128-gcm" | "aes-192-gcm" | "aes-256-gcm";
+ type CipherOCBTypes = "aes-128-ocb" | "aes-192-ocb" | "aes-256-ocb";
+ type BinaryLike = string | NodeJS.ArrayBufferView;
+ type CipherKey = BinaryLike | KeyObject;
+ interface CipherCCMOptions extends stream.TransformOptions {
+ authTagLength: number;
+ }
+ interface CipherGCMOptions extends stream.TransformOptions {
+ authTagLength?: number | undefined;
+ }
+ interface CipherOCBOptions extends stream.TransformOptions {
+ authTagLength: number;
+ }
+ /**
+ * Creates and returns a `Cipher` object that uses the given `algorithm` and`password`.
+ *
+ * The `options` argument controls stream behavior and is optional except when a
+ * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the
+ * authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength`option is not required but can be used to set the length of the authentication
+ * tag that will be returned by `getAuthTag()` and defaults to 16 bytes.
+ * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes.
+ *
+ * The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On
+ * recent OpenSSL releases, `openssl list -cipher-algorithms` will
+ * display the available cipher algorithms.
+ *
+ * The `password` is used to derive the cipher key and initialization vector (IV).
+ * The value must be either a `'latin1'` encoded string, a `Buffer`, a`TypedArray`, or a `DataView`.
+ *
+ * The implementation of `crypto.createCipher()` derives keys using the OpenSSL
+ * function [`EVP_BytesToKey`](https://www.openssl.org/docs/man1.1.0/crypto/EVP_BytesToKey.html) with the digest algorithm set to MD5, one
+ * iteration, and no salt. The lack of salt allows dictionary attacks as the same
+ * password always creates the same key. The low iteration count and
+ * non-cryptographically secure hash algorithm allow passwords to be tested very
+ * rapidly.
+ *
+ * In line with OpenSSL's recommendation to use a more modern algorithm instead of [`EVP_BytesToKey`](https://www.openssl.org/docs/man1.1.0/crypto/EVP_BytesToKey.html) it is recommended that
+ * developers derive a key and IV on
+ * their own using {@link scrypt} and to use {@link createCipheriv} to create the `Cipher` object. Users should not use ciphers with counter mode
+ * (e.g. CTR, GCM, or CCM) in `crypto.createCipher()`. A warning is emitted when
+ * they are used in order to avoid the risk of IV reuse that causes
+ * vulnerabilities. For the case when IV is reused in GCM, see [Nonce-Disrespecting Adversaries](https://github.com/nonce-disrespect/nonce-disrespect) for details.
+ * @since v0.1.94
+ * @deprecated Since v10.0.0 - Use {@link createCipheriv} instead.
+ * @param options `stream.transform` options
+ */
+ function createCipher(algorithm: CipherCCMTypes, password: BinaryLike, options: CipherCCMOptions): CipherCCM;
+ /** @deprecated since v10.0.0 use `createCipheriv()` */
+ function createCipher(algorithm: CipherGCMTypes, password: BinaryLike, options?: CipherGCMOptions): CipherGCM;
+ /** @deprecated since v10.0.0 use `createCipheriv()` */
+ function createCipher(algorithm: string, password: BinaryLike, options?: stream.TransformOptions): Cipher;
+ /**
+ * Creates and returns a `Cipher` object, with the given `algorithm`, `key` and
+ * initialization vector (`iv`).
+ *
+ * The `options` argument controls stream behavior and is optional except when a
+ * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the
+ * authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength`option is not required but can be used to set the length of the authentication
+ * tag that will be returned by `getAuthTag()` and defaults to 16 bytes.
+ * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes.
+ *
+ * The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On
+ * recent OpenSSL releases, `openssl list -cipher-algorithms` will
+ * display the available cipher algorithms.
+ *
+ * The `key` is the raw key used by the `algorithm` and `iv` is an [initialization vector](https://en.wikipedia.org/wiki/Initialization_vector). Both arguments must be `'utf8'` encoded
+ * strings,`Buffers`, `TypedArray`, or `DataView`s. The `key` may optionally be
+ * a `KeyObject` of type `secret`. If the cipher does not need
+ * an initialization vector, `iv` may be `null`.
+ *
+ * When passing strings for `key` or `iv`, please consider `caveats when using strings as inputs to cryptographic APIs`.
+ *
+ * Initialization vectors should be unpredictable and unique; ideally, they will be
+ * cryptographically random. They do not have to be secret: IVs are typically just
+ * added to ciphertext messages unencrypted. It may sound contradictory that
+ * something has to be unpredictable and unique, but does not have to be secret;
+ * remember that an attacker must not be able to predict ahead of time what a
+ * given IV will be.
+ * @since v0.1.94
+ * @param options `stream.transform` options
+ */
+ function createCipheriv(
+ algorithm: CipherCCMTypes,
+ key: CipherKey,
+ iv: BinaryLike,
+ options: CipherCCMOptions,
+ ): CipherCCM;
+ function createCipheriv(
+ algorithm: CipherOCBTypes,
+ key: CipherKey,
+ iv: BinaryLike,
+ options: CipherOCBOptions,
+ ): CipherOCB;
+ function createCipheriv(
+ algorithm: CipherGCMTypes,
+ key: CipherKey,
+ iv: BinaryLike,
+ options?: CipherGCMOptions,
+ ): CipherGCM;
+ function createCipheriv(
+ algorithm: string,
+ key: CipherKey,
+ iv: BinaryLike | null,
+ options?: stream.TransformOptions,
+ ): Cipher;
+ /**
+ * Instances of the `Cipher` class are used to encrypt data. The class can be
+ * used in one of two ways:
+ *
+ * * As a `stream` that is both readable and writable, where plain unencrypted
+ * data is written to produce encrypted data on the readable side, or
+ * * Using the `cipher.update()` and `cipher.final()` methods to produce
+ * the encrypted data.
+ *
+ * The {@link createCipher} or {@link createCipheriv} methods are
+ * used to create `Cipher` instances. `Cipher` objects are not to be created
+ * directly using the `new` keyword.
+ *
+ * Example: Using `Cipher` objects as streams:
+ *
+ * ```js
+ * const {
+ * scrypt,
+ * randomFill,
+ * createCipheriv
+ * } = await import('crypto');
+ *
+ * const algorithm = 'aes-192-cbc';
+ * const password = 'Password used to generate key';
+ *
+ * // First, we'll generate the key. The key length is dependent on the algorithm.
+ * // In this case for aes192, it is 24 bytes (192 bits).
+ * scrypt(password, 'salt', 24, (err, key) => {
+ * if (err) throw err;
+ * // Then, we'll generate a random initialization vector
+ * randomFill(new Uint8Array(16), (err, iv) => {
+ * if (err) throw err;
+ *
+ * // Once we have the key and iv, we can create and use the cipher...
+ * const cipher = createCipheriv(algorithm, key, iv);
+ *
+ * let encrypted = '';
+ * cipher.setEncoding('hex');
+ *
+ * cipher.on('data', (chunk) => encrypted += chunk);
+ * cipher.on('end', () => console.log(encrypted));
+ *
+ * cipher.write('some clear text data');
+ * cipher.end();
+ * });
+ * });
+ * ```
+ *
+ * Example: Using `Cipher` and piped streams:
+ *
+ * ```js
+ * import {
+ * createReadStream,
+ * createWriteStream,
+ * } from 'fs';
+ *
+ * import {
+ * pipeline
+ * } from 'stream';
+ *
+ * const {
+ * scrypt,
+ * randomFill,
+ * createCipheriv
+ * } = await import('crypto');
+ *
+ * const algorithm = 'aes-192-cbc';
+ * const password = 'Password used to generate key';
+ *
+ * // First, we'll generate the key. The key length is dependent on the algorithm.
+ * // In this case for aes192, it is 24 bytes (192 bits).
+ * scrypt(password, 'salt', 24, (err, key) => {
+ * if (err) throw err;
+ * // Then, we'll generate a random initialization vector
+ * randomFill(new Uint8Array(16), (err, iv) => {
+ * if (err) throw err;
+ *
+ * const cipher = createCipheriv(algorithm, key, iv);
+ *
+ * const input = createReadStream('test.js');
+ * const output = createWriteStream('test.enc');
+ *
+ * pipeline(input, cipher, output, (err) => {
+ * if (err) throw err;
+ * });
+ * });
+ * });
+ * ```
+ *
+ * Example: Using the `cipher.update()` and `cipher.final()` methods:
+ *
+ * ```js
+ * const {
+ * scrypt,
+ * randomFill,
+ * createCipheriv
+ * } = await import('crypto');
+ *
+ * const algorithm = 'aes-192-cbc';
+ * const password = 'Password used to generate key';
+ *
+ * // First, we'll generate the key. The key length is dependent on the algorithm.
+ * // In this case for aes192, it is 24 bytes (192 bits).
+ * scrypt(password, 'salt', 24, (err, key) => {
+ * if (err) throw err;
+ * // Then, we'll generate a random initialization vector
+ * randomFill(new Uint8Array(16), (err, iv) => {
+ * if (err) throw err;
+ *
+ * const cipher = createCipheriv(algorithm, key, iv);
+ *
+ * let encrypted = cipher.update('some clear text data', 'utf8', 'hex');
+ * encrypted += cipher.final('hex');
+ * console.log(encrypted);
+ * });
+ * });
+ * ```
+ * @since v0.1.94
+ */
+ class Cipher extends stream.Transform {
+ private constructor();
+ /**
+ * Updates the cipher with `data`. If the `inputEncoding` argument is given,
+ * the `data`argument is a string using the specified encoding. If the `inputEncoding`argument is not given, `data` must be a `Buffer`, `TypedArray`, or`DataView`. If `data` is a `Buffer`,
+ * `TypedArray`, or `DataView`, then`inputEncoding` is ignored.
+ *
+ * The `outputEncoding` specifies the output format of the enciphered
+ * data. If the `outputEncoding`is specified, a string using the specified encoding is returned. If no`outputEncoding` is provided, a `Buffer` is returned.
+ *
+ * The `cipher.update()` method can be called multiple times with new data until `cipher.final()` is called. Calling `cipher.update()` after `cipher.final()` will result in an error being
+ * thrown.
+ * @since v0.1.94
+ * @param inputEncoding The `encoding` of the data.
+ * @param outputEncoding The `encoding` of the return value.
+ */
+ update(data: BinaryLike): Buffer;
+ update(data: string, inputEncoding: Encoding): Buffer;
+ update(data: NodeJS.ArrayBufferView, inputEncoding: undefined, outputEncoding: Encoding): string;
+ update(data: string, inputEncoding: Encoding | undefined, outputEncoding: Encoding): string;
+ /**
+ * Once the `cipher.final()` method has been called, the `Cipher` object can no
+ * longer be used to encrypt data. Attempts to call `cipher.final()` more than
+ * once will result in an error being thrown.
+ * @since v0.1.94
+ * @param outputEncoding The `encoding` of the return value.
+ * @return Any remaining enciphered contents. If `outputEncoding` is specified, a string is returned. If an `outputEncoding` is not provided, a {@link Buffer} is returned.
+ */
+ final(): Buffer;
+ final(outputEncoding: BufferEncoding): string;
+ /**
+ * When using block encryption algorithms, the `Cipher` class will automatically
+ * add padding to the input data to the appropriate block size. To disable the
+ * default padding call `cipher.setAutoPadding(false)`.
+ *
+ * When `autoPadding` is `false`, the length of the entire input data must be a
+ * multiple of the cipher's block size or `cipher.final()` will throw an error.
+ * Disabling automatic padding is useful for non-standard padding, for instance
+ * using `0x0` instead of PKCS padding.
+ *
+ * The `cipher.setAutoPadding()` method must be called before `cipher.final()`.
+ * @since v0.7.1
+ * @param [autoPadding=true]
+ * @return for method chaining.
+ */
+ setAutoPadding(autoPadding?: boolean): this;
+ }
+ interface CipherCCM extends Cipher {
+ setAAD(
+ buffer: NodeJS.ArrayBufferView,
+ options: {
+ plaintextLength: number;
+ },
+ ): this;
+ getAuthTag(): Buffer;
+ }
+ interface CipherGCM extends Cipher {
+ setAAD(
+ buffer: NodeJS.ArrayBufferView,
+ options?: {
+ plaintextLength: number;
+ },
+ ): this;
+ getAuthTag(): Buffer;
+ }
+ interface CipherOCB extends Cipher {
+ setAAD(
+ buffer: NodeJS.ArrayBufferView,
+ options?: {
+ plaintextLength: number;
+ },
+ ): this;
+ getAuthTag(): Buffer;
+ }
+ /**
+ * Creates and returns a `Decipher` object that uses the given `algorithm` and`password` (key).
+ *
+ * The `options` argument controls stream behavior and is optional except when a
+ * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the
+ * authentication tag in bytes, see `CCM mode`.
+ * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes.
+ *
+ * The implementation of `crypto.createDecipher()` derives keys using the OpenSSL
+ * function [`EVP_BytesToKey`](https://www.openssl.org/docs/man1.1.0/crypto/EVP_BytesToKey.html) with the digest algorithm set to MD5, one
+ * iteration, and no salt. The lack of salt allows dictionary attacks as the same
+ * password always creates the same key. The low iteration count and
+ * non-cryptographically secure hash algorithm allow passwords to be tested very
+ * rapidly.
+ *
+ * In line with OpenSSL's recommendation to use a more modern algorithm instead of [`EVP_BytesToKey`](https://www.openssl.org/docs/man1.1.0/crypto/EVP_BytesToKey.html) it is recommended that
+ * developers derive a key and IV on
+ * their own using {@link scrypt} and to use {@link createDecipheriv} to create the `Decipher` object.
+ * @since v0.1.94
+ * @deprecated Since v10.0.0 - Use {@link createDecipheriv} instead.
+ * @param options `stream.transform` options
+ */
+ function createDecipher(algorithm: CipherCCMTypes, password: BinaryLike, options: CipherCCMOptions): DecipherCCM;
+ /** @deprecated since v10.0.0 use `createDecipheriv()` */
+ function createDecipher(algorithm: CipherGCMTypes, password: BinaryLike, options?: CipherGCMOptions): DecipherGCM;
+ /** @deprecated since v10.0.0 use `createDecipheriv()` */
+ function createDecipher(algorithm: string, password: BinaryLike, options?: stream.TransformOptions): Decipher;
+ /**
+ * Creates and returns a `Decipher` object that uses the given `algorithm`, `key`and initialization vector (`iv`).
+ *
+ * The `options` argument controls stream behavior and is optional except when a
+ * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the
+ * authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength`option is not required but can be used to restrict accepted authentication tags
+ * to those with the specified length.
+ * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes.
+ *
+ * The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On
+ * recent OpenSSL releases, `openssl list -cipher-algorithms` will
+ * display the available cipher algorithms.
+ *
+ * The `key` is the raw key used by the `algorithm` and `iv` is an [initialization vector](https://en.wikipedia.org/wiki/Initialization_vector). Both arguments must be `'utf8'` encoded
+ * strings,`Buffers`, `TypedArray`, or `DataView`s. The `key` may optionally be
+ * a `KeyObject` of type `secret`. If the cipher does not need
+ * an initialization vector, `iv` may be `null`.
+ *
+ * When passing strings for `key` or `iv`, please consider `caveats when using strings as inputs to cryptographic APIs`.
+ *
+ * Initialization vectors should be unpredictable and unique; ideally, they will be
+ * cryptographically random. They do not have to be secret: IVs are typically just
+ * added to ciphertext messages unencrypted. It may sound contradictory that
+ * something has to be unpredictable and unique, but does not have to be secret;
+ * remember that an attacker must not be able to predict ahead of time what a given
+ * IV will be.
+ * @since v0.1.94
+ * @param options `stream.transform` options
+ */
+ function createDecipheriv(
+ algorithm: CipherCCMTypes,
+ key: CipherKey,
+ iv: BinaryLike,
+ options: CipherCCMOptions,
+ ): DecipherCCM;
+ function createDecipheriv(
+ algorithm: CipherOCBTypes,
+ key: CipherKey,
+ iv: BinaryLike,
+ options: CipherOCBOptions,
+ ): DecipherOCB;
+ function createDecipheriv(
+ algorithm: CipherGCMTypes,
+ key: CipherKey,
+ iv: BinaryLike,
+ options?: CipherGCMOptions,
+ ): DecipherGCM;
+ function createDecipheriv(
+ algorithm: string,
+ key: CipherKey,
+ iv: BinaryLike | null,
+ options?: stream.TransformOptions,
+ ): Decipher;
+ /**
+ * Instances of the `Decipher` class are used to decrypt data. The class can be
+ * used in one of two ways:
+ *
+ * * As a `stream` that is both readable and writable, where plain encrypted
+ * data is written to produce unencrypted data on the readable side, or
+ * * Using the `decipher.update()` and `decipher.final()` methods to
+ * produce the unencrypted data.
+ *
+ * The {@link createDecipher} or {@link createDecipheriv} methods are
+ * used to create `Decipher` instances. `Decipher` objects are not to be created
+ * directly using the `new` keyword.
+ *
+ * Example: Using `Decipher` objects as streams:
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ * const {
+ * scryptSync,
+ * createDecipheriv
+ * } = await import('crypto');
+ *
+ * const algorithm = 'aes-192-cbc';
+ * const password = 'Password used to generate key';
+ * // Key length is dependent on the algorithm. In this case for aes192, it is
+ * // 24 bytes (192 bits).
+ * // Use the async `crypto.scrypt()` instead.
+ * const key = scryptSync(password, 'salt', 24);
+ * // The IV is usually passed along with the ciphertext.
+ * const iv = Buffer.alloc(16, 0); // Initialization vector.
+ *
+ * const decipher = createDecipheriv(algorithm, key, iv);
+ *
+ * let decrypted = '';
+ * decipher.on('readable', () => {
+ * while (null !== (chunk = decipher.read())) {
+ * decrypted += chunk.toString('utf8');
+ * }
+ * });
+ * decipher.on('end', () => {
+ * console.log(decrypted);
+ * // Prints: some clear text data
+ * });
+ *
+ * // Encrypted with same algorithm, key and iv.
+ * const encrypted =
+ * 'e5f79c5915c02171eec6b212d5520d44480993d7d622a7c4c2da32f6efda0ffa';
+ * decipher.write(encrypted, 'hex');
+ * decipher.end();
+ * ```
+ *
+ * Example: Using `Decipher` and piped streams:
+ *
+ * ```js
+ * import {
+ * createReadStream,
+ * createWriteStream,
+ * } from 'fs';
+ * import { Buffer } from 'buffer';
+ * const {
+ * scryptSync,
+ * createDecipheriv
+ * } = await import('crypto');
+ *
+ * const algorithm = 'aes-192-cbc';
+ * const password = 'Password used to generate key';
+ * // Use the async `crypto.scrypt()` instead.
+ * const key = scryptSync(password, 'salt', 24);
+ * // The IV is usually passed along with the ciphertext.
+ * const iv = Buffer.alloc(16, 0); // Initialization vector.
+ *
+ * const decipher = createDecipheriv(algorithm, key, iv);
+ *
+ * const input = createReadStream('test.enc');
+ * const output = createWriteStream('test.js');
+ *
+ * input.pipe(decipher).pipe(output);
+ * ```
+ *
+ * Example: Using the `decipher.update()` and `decipher.final()` methods:
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ * const {
+ * scryptSync,
+ * createDecipheriv
+ * } = await import('crypto');
+ *
+ * const algorithm = 'aes-192-cbc';
+ * const password = 'Password used to generate key';
+ * // Use the async `crypto.scrypt()` instead.
+ * const key = scryptSync(password, 'salt', 24);
+ * // The IV is usually passed along with the ciphertext.
+ * const iv = Buffer.alloc(16, 0); // Initialization vector.
+ *
+ * const decipher = createDecipheriv(algorithm, key, iv);
+ *
+ * // Encrypted using same algorithm, key and iv.
+ * const encrypted =
+ * 'e5f79c5915c02171eec6b212d5520d44480993d7d622a7c4c2da32f6efda0ffa';
+ * let decrypted = decipher.update(encrypted, 'hex', 'utf8');
+ * decrypted += decipher.final('utf8');
+ * console.log(decrypted);
+ * // Prints: some clear text data
+ * ```
+ * @since v0.1.94
+ */
+ class Decipher extends stream.Transform {
+ private constructor();
+ /**
+ * Updates the decipher with `data`. If the `inputEncoding` argument is given,
+ * the `data`argument is a string using the specified encoding. If the `inputEncoding`argument is not given, `data` must be a `Buffer`. If `data` is a `Buffer` then `inputEncoding` is
+ * ignored.
+ *
+ * The `outputEncoding` specifies the output format of the enciphered
+ * data. If the `outputEncoding`is specified, a string using the specified encoding is returned. If no`outputEncoding` is provided, a `Buffer` is returned.
+ *
+ * The `decipher.update()` method can be called multiple times with new data until `decipher.final()` is called. Calling `decipher.update()` after `decipher.final()` will result in an error
+ * being thrown.
+ * @since v0.1.94
+ * @param inputEncoding The `encoding` of the `data` string.
+ * @param outputEncoding The `encoding` of the return value.
+ */
+ update(data: NodeJS.ArrayBufferView): Buffer;
+ update(data: string, inputEncoding: Encoding): Buffer;
+ update(data: NodeJS.ArrayBufferView, inputEncoding: undefined, outputEncoding: Encoding): string;
+ update(data: string, inputEncoding: Encoding | undefined, outputEncoding: Encoding): string;
+ /**
+ * Once the `decipher.final()` method has been called, the `Decipher` object can
+ * no longer be used to decrypt data. Attempts to call `decipher.final()` more
+ * than once will result in an error being thrown.
+ * @since v0.1.94
+ * @param outputEncoding The `encoding` of the return value.
+ * @return Any remaining deciphered contents. If `outputEncoding` is specified, a string is returned. If an `outputEncoding` is not provided, a {@link Buffer} is returned.
+ */
+ final(): Buffer;
+ final(outputEncoding: BufferEncoding): string;
+ /**
+ * When data has been encrypted without standard block padding, calling`decipher.setAutoPadding(false)` will disable automatic padding to prevent `decipher.final()` from checking for and
+ * removing padding.
+ *
+ * Turning auto padding off will only work if the input data's length is a
+ * multiple of the ciphers block size.
+ *
+ * The `decipher.setAutoPadding()` method must be called before `decipher.final()`.
+ * @since v0.7.1
+ * @param [autoPadding=true]
+ * @return for method chaining.
+ */
+ setAutoPadding(auto_padding?: boolean): this;
+ }
+ interface DecipherCCM extends Decipher {
+ setAuthTag(buffer: NodeJS.ArrayBufferView): this;
+ setAAD(
+ buffer: NodeJS.ArrayBufferView,
+ options: {
+ plaintextLength: number;
+ },
+ ): this;
+ }
+ interface DecipherGCM extends Decipher {
+ setAuthTag(buffer: NodeJS.ArrayBufferView): this;
+ setAAD(
+ buffer: NodeJS.ArrayBufferView,
+ options?: {
+ plaintextLength: number;
+ },
+ ): this;
+ }
+ interface DecipherOCB extends Decipher {
+ setAuthTag(buffer: NodeJS.ArrayBufferView): this;
+ setAAD(
+ buffer: NodeJS.ArrayBufferView,
+ options?: {
+ plaintextLength: number;
+ },
+ ): this;
+ }
+ interface PrivateKeyInput {
+ key: string | Buffer;
+ format?: KeyFormat | undefined;
+ type?: "pkcs1" | "pkcs8" | "sec1" | undefined;
+ passphrase?: string | Buffer | undefined;
+ encoding?: string | undefined;
+ }
+ interface PublicKeyInput {
+ key: string | Buffer;
+ format?: KeyFormat | undefined;
+ type?: "pkcs1" | "spki" | undefined;
+ encoding?: string | undefined;
+ }
+ /**
+ * Asynchronously generates a new random secret key of the given `length`. The`type` will determine which validations will be performed on the `length`.
+ *
+ * ```js
+ * const {
+ * generateKey
+ * } = await import('crypto');
+ *
+ * generateKey('hmac', { length: 64 }, (err, key) => {
+ * if (err) throw err;
+ * console.log(key.export().toString('hex')); // 46e..........620
+ * });
+ * ```
+ * @since v15.0.0
+ * @param type The intended use of the generated secret key. Currently accepted values are `'hmac'` and `'aes'`.
+ */
+ function generateKey(
+ type: "hmac" | "aes",
+ options: {
+ length: number;
+ },
+ callback: (err: Error | null, key: KeyObject) => void,
+ ): void;
+ /**
+ * Synchronously generates a new random secret key of the given `length`. The`type` will determine which validations will be performed on the `length`.
+ *
+ * ```js
+ * const {
+ * generateKeySync
+ * } = await import('crypto');
+ *
+ * const key = generateKeySync('hmac', { length: 64 });
+ * console.log(key.export().toString('hex')); // e89..........41e
+ * ```
+ * @since v15.0.0
+ * @param type The intended use of the generated secret key. Currently accepted values are `'hmac'` and `'aes'`.
+ */
+ function generateKeySync(
+ type: "hmac" | "aes",
+ options: {
+ length: number;
+ },
+ ): KeyObject;
+ interface JsonWebKeyInput {
+ key: JsonWebKey;
+ format: "jwk";
+ }
+ /**
+ * Creates and returns a new key object containing a private key. If `key` is a
+ * string or `Buffer`, `format` is assumed to be `'pem'`; otherwise, `key`must be an object with the properties described above.
+ *
+ * If the private key is encrypted, a `passphrase` must be specified. The length
+ * of the passphrase is limited to 1024 bytes.
+ * @since v11.6.0
+ */
+ function createPrivateKey(key: PrivateKeyInput | string | Buffer | JsonWebKeyInput): KeyObject;
+ /**
+ * Creates and returns a new key object containing a public key. If `key` is a
+ * string or `Buffer`, `format` is assumed to be `'pem'`; if `key` is a `KeyObject`with type `'private'`, the public key is derived from the given private key;
+ * otherwise, `key` must be an object with the properties described above.
+ *
+ * If the format is `'pem'`, the `'key'` may also be an X.509 certificate.
+ *
+ * Because public keys can be derived from private keys, a private key may be
+ * passed instead of a public key. In that case, this function behaves as if {@link createPrivateKey} had been called, except that the type of the
+ * returned `KeyObject` will be `'public'` and that the private key cannot be
+ * extracted from the returned `KeyObject`. Similarly, if a `KeyObject` with type`'private'` is given, a new `KeyObject` with type `'public'` will be returned
+ * and it will be impossible to extract the private key from the returned object.
+ * @since v11.6.0
+ */
+ function createPublicKey(key: PublicKeyInput | string | Buffer | KeyObject | JsonWebKeyInput): KeyObject;
+ /**
+ * Creates and returns a new key object containing a secret key for symmetric
+ * encryption or `Hmac`.
+ * @since v11.6.0
+ * @param encoding The string encoding when `key` is a string.
+ */
+ function createSecretKey(key: NodeJS.ArrayBufferView): KeyObject;
+ function createSecretKey(key: string, encoding: BufferEncoding): KeyObject;
+ /**
+ * Creates and returns a `Sign` object that uses the given `algorithm`. Use {@link getHashes} to obtain the names of the available digest algorithms.
+ * Optional `options` argument controls the `stream.Writable` behavior.
+ *
+ * In some cases, a `Sign` instance can be created using the name of a signature
+ * algorithm, such as `'RSA-SHA256'`, instead of a digest algorithm. This will use
+ * the corresponding digest algorithm. This does not work for all signature
+ * algorithms, such as `'ecdsa-with-SHA256'`, so it is best to always use digest
+ * algorithm names.
+ * @since v0.1.92
+ * @param options `stream.Writable` options
+ */
+ function createSign(algorithm: string, options?: stream.WritableOptions): Sign;
+ type DSAEncoding = "der" | "ieee-p1363";
+ interface SigningOptions {
+ /**
+ * @see crypto.constants.RSA_PKCS1_PADDING
+ */
+ padding?: number | undefined;
+ saltLength?: number | undefined;
+ dsaEncoding?: DSAEncoding | undefined;
+ }
+ interface SignPrivateKeyInput extends PrivateKeyInput, SigningOptions {}
+ interface SignKeyObjectInput extends SigningOptions {
+ key: KeyObject;
+ }
+ interface VerifyPublicKeyInput extends PublicKeyInput, SigningOptions {}
+ interface VerifyKeyObjectInput extends SigningOptions {
+ key: KeyObject;
+ }
+ interface VerifyJsonWebKeyInput extends JsonWebKeyInput, SigningOptions {}
+ type KeyLike = string | Buffer | KeyObject;
+ /**
+ * The `Sign` class is a utility for generating signatures. It can be used in one
+ * of two ways:
+ *
+ * * As a writable `stream`, where data to be signed is written and the `sign.sign()` method is used to generate and return the signature, or
+ * * Using the `sign.update()` and `sign.sign()` methods to produce the
+ * signature.
+ *
+ * The {@link createSign} method is used to create `Sign` instances. The
+ * argument is the string name of the hash function to use. `Sign` objects are not
+ * to be created directly using the `new` keyword.
+ *
+ * Example: Using `Sign` and `Verify` objects as streams:
+ *
+ * ```js
+ * const {
+ * generateKeyPairSync,
+ * createSign,
+ * createVerify
+ * } = await import('crypto');
+ *
+ * const { privateKey, publicKey } = generateKeyPairSync('ec', {
+ * namedCurve: 'sect239k1'
+ * });
+ *
+ * const sign = createSign('SHA256');
+ * sign.write('some data to sign');
+ * sign.end();
+ * const signature = sign.sign(privateKey, 'hex');
+ *
+ * const verify = createVerify('SHA256');
+ * verify.write('some data to sign');
+ * verify.end();
+ * console.log(verify.verify(publicKey, signature, 'hex'));
+ * // Prints: true
+ * ```
+ *
+ * Example: Using the `sign.update()` and `verify.update()` methods:
+ *
+ * ```js
+ * const {
+ * generateKeyPairSync,
+ * createSign,
+ * createVerify
+ * } = await import('crypto');
+ *
+ * const { privateKey, publicKey } = generateKeyPairSync('rsa', {
+ * modulusLength: 2048,
+ * });
+ *
+ * const sign = createSign('SHA256');
+ * sign.update('some data to sign');
+ * sign.end();
+ * const signature = sign.sign(privateKey);
+ *
+ * const verify = createVerify('SHA256');
+ * verify.update('some data to sign');
+ * verify.end();
+ * console.log(verify.verify(publicKey, signature));
+ * // Prints: true
+ * ```
+ * @since v0.1.92
+ */
+ class Sign extends stream.Writable {
+ private constructor();
+ /**
+ * Updates the `Sign` content with the given `data`, the encoding of which
+ * is given in `inputEncoding`.
+ * If `encoding` is not provided, and the `data` is a string, an
+ * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored.
+ *
+ * This can be called many times with new data as it is streamed.
+ * @since v0.1.92
+ * @param inputEncoding The `encoding` of the `data` string.
+ */
+ update(data: BinaryLike): this;
+ update(data: string, inputEncoding: Encoding): this;
+ /**
+ * Calculates the signature on all the data passed through using either `sign.update()` or `sign.write()`.
+ *
+ * If `privateKey` is not a `KeyObject`, this function behaves as if`privateKey` had been passed to {@link createPrivateKey}. If it is an
+ * object, the following additional properties can be passed:
+ *
+ * If `outputEncoding` is provided a string is returned; otherwise a `Buffer` is returned.
+ *
+ * The `Sign` object can not be again used after `sign.sign()` method has been
+ * called. Multiple calls to `sign.sign()` will result in an error being thrown.
+ * @since v0.1.92
+ */
+ sign(privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput): Buffer;
+ sign(
+ privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput,
+ outputFormat: BinaryToTextEncoding,
+ ): string;
+ }
+ /**
+ * Creates and returns a `Verify` object that uses the given algorithm.
+ * Use {@link getHashes} to obtain an array of names of the available
+ * signing algorithms. Optional `options` argument controls the`stream.Writable` behavior.
+ *
+ * In some cases, a `Verify` instance can be created using the name of a signature
+ * algorithm, such as `'RSA-SHA256'`, instead of a digest algorithm. This will use
+ * the corresponding digest algorithm. This does not work for all signature
+ * algorithms, such as `'ecdsa-with-SHA256'`, so it is best to always use digest
+ * algorithm names.
+ * @since v0.1.92
+ * @param options `stream.Writable` options
+ */
+ function createVerify(algorithm: string, options?: stream.WritableOptions): Verify;
+ /**
+ * The `Verify` class is a utility for verifying signatures. It can be used in one
+ * of two ways:
+ *
+ * * As a writable `stream` where written data is used to validate against the
+ * supplied signature, or
+ * * Using the `verify.update()` and `verify.verify()` methods to verify
+ * the signature.
+ *
+ * The {@link createVerify} method is used to create `Verify` instances.`Verify` objects are not to be created directly using the `new` keyword.
+ *
+ * See `Sign` for examples.
+ * @since v0.1.92
+ */
+ class Verify extends stream.Writable {
+ private constructor();
+ /**
+ * Updates the `Verify` content with the given `data`, the encoding of which
+ * is given in `inputEncoding`.
+ * If `inputEncoding` is not provided, and the `data` is a string, an
+ * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored.
+ *
+ * This can be called many times with new data as it is streamed.
+ * @since v0.1.92
+ * @param inputEncoding The `encoding` of the `data` string.
+ */
+ update(data: BinaryLike): Verify;
+ update(data: string, inputEncoding: Encoding): Verify;
+ /**
+ * Verifies the provided data using the given `object` and `signature`.
+ *
+ * If `object` is not a `KeyObject`, this function behaves as if`object` had been passed to {@link createPublicKey}. If it is an
+ * object, the following additional properties can be passed:
+ *
+ * The `signature` argument is the previously calculated signature for the data, in
+ * the `signatureEncoding`.
+ * If a `signatureEncoding` is specified, the `signature` is expected to be a
+ * string; otherwise `signature` is expected to be a `Buffer`,`TypedArray`, or `DataView`.
+ *
+ * The `verify` object can not be used again after `verify.verify()` has been
+ * called. Multiple calls to `verify.verify()` will result in an error being
+ * thrown.
+ *
+ * Because public keys can be derived from private keys, a private key may
+ * be passed instead of a public key.
+ * @since v0.1.92
+ */
+ verify(
+ object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput,
+ signature: NodeJS.ArrayBufferView,
+ ): boolean;
+ verify(
+ object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput,
+ signature: string,
+ signature_format?: BinaryToTextEncoding,
+ ): boolean;
+ }
+ /**
+ * Creates a `DiffieHellman` key exchange object using the supplied `prime` and an
+ * optional specific `generator`.
+ *
+ * The `generator` argument can be a number, string, or `Buffer`. If`generator` is not specified, the value `2` is used.
+ *
+ * If `primeEncoding` is specified, `prime` is expected to be a string; otherwise
+ * a `Buffer`, `TypedArray`, or `DataView` is expected.
+ *
+ * If `generatorEncoding` is specified, `generator` is expected to be a string;
+ * otherwise a number, `Buffer`, `TypedArray`, or `DataView` is expected.
+ * @since v0.11.12
+ * @param primeEncoding The `encoding` of the `prime` string.
+ * @param [generator=2]
+ * @param generatorEncoding The `encoding` of the `generator` string.
+ */
+ function createDiffieHellman(primeLength: number, generator?: number): DiffieHellman;
+ function createDiffieHellman(
+ prime: ArrayBuffer | NodeJS.ArrayBufferView,
+ generator?: number | ArrayBuffer | NodeJS.ArrayBufferView,
+ ): DiffieHellman;
+ function createDiffieHellman(
+ prime: ArrayBuffer | NodeJS.ArrayBufferView,
+ generator: string,
+ generatorEncoding: BinaryToTextEncoding,
+ ): DiffieHellman;
+ function createDiffieHellman(
+ prime: string,
+ primeEncoding: BinaryToTextEncoding,
+ generator?: number | ArrayBuffer | NodeJS.ArrayBufferView,
+ ): DiffieHellman;
+ function createDiffieHellman(
+ prime: string,
+ primeEncoding: BinaryToTextEncoding,
+ generator: string,
+ generatorEncoding: BinaryToTextEncoding,
+ ): DiffieHellman;
+ /**
+ * The `DiffieHellman` class is a utility for creating Diffie-Hellman key
+ * exchanges.
+ *
+ * Instances of the `DiffieHellman` class can be created using the {@link createDiffieHellman} function.
+ *
+ * ```js
+ * import assert from 'assert';
+ *
+ * const {
+ * createDiffieHellman
+ * } = await import('crypto');
+ *
+ * // Generate Alice's keys...
+ * const alice = createDiffieHellman(2048);
+ * const aliceKey = alice.generateKeys();
+ *
+ * // Generate Bob's keys...
+ * const bob = createDiffieHellman(alice.getPrime(), alice.getGenerator());
+ * const bobKey = bob.generateKeys();
+ *
+ * // Exchange and generate the secret...
+ * const aliceSecret = alice.computeSecret(bobKey);
+ * const bobSecret = bob.computeSecret(aliceKey);
+ *
+ * // OK
+ * assert.strictEqual(aliceSecret.toString('hex'), bobSecret.toString('hex'));
+ * ```
+ * @since v0.5.0
+ */
+ class DiffieHellman {
+ private constructor();
+ /**
+ * Generates private and public Diffie-Hellman key values, and returns
+ * the public key in the specified `encoding`. This key should be
+ * transferred to the other party.
+ * If `encoding` is provided a string is returned; otherwise a `Buffer` is returned.
+ * @since v0.5.0
+ * @param encoding The `encoding` of the return value.
+ */
+ generateKeys(): Buffer;
+ generateKeys(encoding: BinaryToTextEncoding): string;
+ /**
+ * Computes the shared secret using `otherPublicKey` as the other
+ * party's public key and returns the computed shared secret. The supplied
+ * key is interpreted using the specified `inputEncoding`, and secret is
+ * encoded using specified `outputEncoding`.
+ * If the `inputEncoding` is not
+ * provided, `otherPublicKey` is expected to be a `Buffer`,`TypedArray`, or `DataView`.
+ *
+ * If `outputEncoding` is given a string is returned; otherwise, a `Buffer` is returned.
+ * @since v0.5.0
+ * @param inputEncoding The `encoding` of an `otherPublicKey` string.
+ * @param outputEncoding The `encoding` of the return value.
+ */
+ computeSecret(otherPublicKey: NodeJS.ArrayBufferView, inputEncoding?: null, outputEncoding?: null): Buffer;
+ computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding, outputEncoding?: null): Buffer;
+ computeSecret(
+ otherPublicKey: NodeJS.ArrayBufferView,
+ inputEncoding: null,
+ outputEncoding: BinaryToTextEncoding,
+ ): string;
+ computeSecret(
+ otherPublicKey: string,
+ inputEncoding: BinaryToTextEncoding,
+ outputEncoding: BinaryToTextEncoding,
+ ): string;
+ /**
+ * Returns the Diffie-Hellman prime in the specified `encoding`.
+ * If `encoding` is provided a string is
+ * returned; otherwise a `Buffer` is returned.
+ * @since v0.5.0
+ * @param encoding The `encoding` of the return value.
+ */
+ getPrime(): Buffer;
+ getPrime(encoding: BinaryToTextEncoding): string;
+ /**
+ * Returns the Diffie-Hellman generator in the specified `encoding`.
+ * If `encoding` is provided a string is
+ * returned; otherwise a `Buffer` is returned.
+ * @since v0.5.0
+ * @param encoding The `encoding` of the return value.
+ */
+ getGenerator(): Buffer;
+ getGenerator(encoding: BinaryToTextEncoding): string;
+ /**
+ * Returns the Diffie-Hellman public key in the specified `encoding`.
+ * If `encoding` is provided a
+ * string is returned; otherwise a `Buffer` is returned.
+ * @since v0.5.0
+ * @param encoding The `encoding` of the return value.
+ */
+ getPublicKey(): Buffer;
+ getPublicKey(encoding: BinaryToTextEncoding): string;
+ /**
+ * Returns the Diffie-Hellman private key in the specified `encoding`.
+ * If `encoding` is provided a
+ * string is returned; otherwise a `Buffer` is returned.
+ * @since v0.5.0
+ * @param encoding The `encoding` of the return value.
+ */
+ getPrivateKey(): Buffer;
+ getPrivateKey(encoding: BinaryToTextEncoding): string;
+ /**
+ * Sets the Diffie-Hellman public key. If the `encoding` argument is provided,`publicKey` is expected
+ * to be a string. If no `encoding` is provided, `publicKey` is expected
+ * to be a `Buffer`, `TypedArray`, or `DataView`.
+ * @since v0.5.0
+ * @param encoding The `encoding` of the `publicKey` string.
+ */
+ setPublicKey(publicKey: NodeJS.ArrayBufferView): void;
+ setPublicKey(publicKey: string, encoding: BufferEncoding): void;
+ /**
+ * Sets the Diffie-Hellman private key. If the `encoding` argument is provided,`privateKey` is expected
+ * to be a string. If no `encoding` is provided, `privateKey` is expected
+ * to be a `Buffer`, `TypedArray`, or `DataView`.
+ * @since v0.5.0
+ * @param encoding The `encoding` of the `privateKey` string.
+ */
+ setPrivateKey(privateKey: NodeJS.ArrayBufferView): void;
+ setPrivateKey(privateKey: string, encoding: BufferEncoding): void;
+ /**
+ * A bit field containing any warnings and/or errors resulting from a check
+ * performed during initialization of the `DiffieHellman` object.
+ *
+ * The following values are valid for this property (as defined in `constants`module):
+ *
+ * * `DH_CHECK_P_NOT_SAFE_PRIME`
+ * * `DH_CHECK_P_NOT_PRIME`
+ * * `DH_UNABLE_TO_CHECK_GENERATOR`
+ * * `DH_NOT_SUITABLE_GENERATOR`
+ * @since v0.11.12
+ */
+ verifyError: number;
+ }
+ /**
+ * The `DiffieHellmanGroup` class takes a well-known modp group as its argument.
+ * It works the same as `DiffieHellman`, except that it does not allow changing its keys after creation.
+ * In other words, it does not implement `setPublicKey()` or `setPrivateKey()` methods.
+ *
+ * ```js
+ * const { createDiffieHellmanGroup } = await import('node:crypto');
+ * const dh = createDiffieHellmanGroup('modp1');
+ * ```
+ * The name (e.g. `'modp1'`) is taken from [RFC 2412](https://www.rfc-editor.org/rfc/rfc2412.txt) (modp1 and 2) and [RFC 3526](https://www.rfc-editor.org/rfc/rfc3526.txt):
+ * ```bash
+ * $ perl -ne 'print "$1\n" if /"(modp\d+)"/' src/node_crypto_groups.h
+ * modp1 # 768 bits
+ * modp2 # 1024 bits
+ * modp5 # 1536 bits
+ * modp14 # 2048 bits
+ * modp15 # etc.
+ * modp16
+ * modp17
+ * modp18
+ * ```
+ * @since v0.7.5
+ */
+ const DiffieHellmanGroup: DiffieHellmanGroupConstructor;
+ interface DiffieHellmanGroupConstructor {
+ new(name: string): DiffieHellmanGroup;
+ (name: string): DiffieHellmanGroup;
+ readonly prototype: DiffieHellmanGroup;
+ }
+ type DiffieHellmanGroup = Omit<DiffieHellman, "setPublicKey" | "setPrivateKey">;
+ /**
+ * Creates a predefined `DiffieHellmanGroup` key exchange object. The
+ * supported groups are: `'modp1'`, `'modp2'`, `'modp5'` (defined in [RFC 2412](https://www.rfc-editor.org/rfc/rfc2412.txt), but see `Caveats`) and `'modp14'`, `'modp15'`,`'modp16'`, `'modp17'`,
+ * `'modp18'` (defined in [RFC 3526](https://www.rfc-editor.org/rfc/rfc3526.txt)). The
+ * returned object mimics the interface of objects created by {@link createDiffieHellman}, but will not allow changing
+ * the keys (with `diffieHellman.setPublicKey()`, for example). The
+ * advantage of using this method is that the parties do not have to
+ * generate nor exchange a group modulus beforehand, saving both processor
+ * and communication time.
+ *
+ * Example (obtaining a shared secret):
+ *
+ * ```js
+ * const {
+ * getDiffieHellman
+ * } = await import('crypto');
+ * const alice = getDiffieHellman('modp14');
+ * const bob = getDiffieHellman('modp14');
+ *
+ * alice.generateKeys();
+ * bob.generateKeys();
+ *
+ * const aliceSecret = alice.computeSecret(bob.getPublicKey(), null, 'hex');
+ * const bobSecret = bob.computeSecret(alice.getPublicKey(), null, 'hex');
+ *
+ * // aliceSecret and bobSecret should be the same
+ * console.log(aliceSecret === bobSecret);
+ * ```
+ * @since v0.7.5
+ */
+ function getDiffieHellman(groupName: string): DiffieHellmanGroup;
+ /**
+ * An alias for {@link getDiffieHellman}
+ * @since v0.9.3
+ */
+ function createDiffieHellmanGroup(name: string): DiffieHellmanGroup;
+ /**
+ * Provides an asynchronous Password-Based Key Derivation Function 2 (PBKDF2)
+ * implementation. A selected HMAC digest algorithm specified by `digest` is
+ * applied to derive a key of the requested byte length (`keylen`) from the`password`, `salt` and `iterations`.
+ *
+ * The supplied `callback` function is called with two arguments: `err` and`derivedKey`. If an error occurs while deriving the key, `err` will be set;
+ * otherwise `err` will be `null`. By default, the successfully generated`derivedKey` will be passed to the callback as a `Buffer`. An error will be
+ * thrown if any of the input arguments specify invalid values or types.
+ *
+ * If `digest` is `null`, `'sha1'` will be used. This behavior is deprecated,
+ * please specify a `digest` explicitly.
+ *
+ * The `iterations` argument must be a number set as high as possible. The
+ * higher the number of iterations, the more secure the derived key will be,
+ * but will take a longer amount of time to complete.
+ *
+ * The `salt` should be as unique as possible. It is recommended that a salt is
+ * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details.
+ *
+ * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`.
+ *
+ * ```js
+ * const {
+ * pbkdf2
+ * } = await import('crypto');
+ *
+ * pbkdf2('secret', 'salt', 100000, 64, 'sha512', (err, derivedKey) => {
+ * if (err) throw err;
+ * console.log(derivedKey.toString('hex')); // '3745e48...08d59ae'
+ * });
+ * ```
+ *
+ * The `crypto.DEFAULT_ENCODING` property can be used to change the way the`derivedKey` is passed to the callback. This property, however, has been
+ * deprecated and use should be avoided.
+ *
+ * ```js
+ * import crypto from 'crypto';
+ * crypto.DEFAULT_ENCODING = 'hex';
+ * crypto.pbkdf2('secret', 'salt', 100000, 512, 'sha512', (err, derivedKey) => {
+ * if (err) throw err;
+ * console.log(derivedKey); // '3745e48...aa39b34'
+ * });
+ * ```
+ *
+ * An array of supported digest functions can be retrieved using {@link getHashes}.
+ *
+ * This API uses libuv's threadpool, which can have surprising and
+ * negative performance implications for some applications; see the `UV_THREADPOOL_SIZE` documentation for more information.
+ * @since v0.5.5
+ */
+ function pbkdf2(
+ password: BinaryLike,
+ salt: BinaryLike,
+ iterations: number,
+ keylen: number,
+ digest: string,
+ callback: (err: Error | null, derivedKey: Buffer) => void,
+ ): void;
+ /**
+ * Provides a synchronous Password-Based Key Derivation Function 2 (PBKDF2)
+ * implementation. A selected HMAC digest algorithm specified by `digest` is
+ * applied to derive a key of the requested byte length (`keylen`) from the`password`, `salt` and `iterations`.
+ *
+ * If an error occurs an `Error` will be thrown, otherwise the derived key will be
+ * returned as a `Buffer`.
+ *
+ * If `digest` is `null`, `'sha1'` will be used. This behavior is deprecated,
+ * please specify a `digest` explicitly.
+ *
+ * The `iterations` argument must be a number set as high as possible. The
+ * higher the number of iterations, the more secure the derived key will be,
+ * but will take a longer amount of time to complete.
+ *
+ * The `salt` should be as unique as possible. It is recommended that a salt is
+ * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details.
+ *
+ * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`.
+ *
+ * ```js
+ * const {
+ * pbkdf2Sync
+ * } = await import('crypto');
+ *
+ * const key = pbkdf2Sync('secret', 'salt', 100000, 64, 'sha512');
+ * console.log(key.toString('hex')); // '3745e48...08d59ae'
+ * ```
+ *
+ * The `crypto.DEFAULT_ENCODING` property may be used to change the way the`derivedKey` is returned. This property, however, is deprecated and use
+ * should be avoided.
+ *
+ * ```js
+ * import crypto from 'crypto';
+ * crypto.DEFAULT_ENCODING = 'hex';
+ * const key = crypto.pbkdf2Sync('secret', 'salt', 100000, 512, 'sha512');
+ * console.log(key); // '3745e48...aa39b34'
+ * ```
+ *
+ * An array of supported digest functions can be retrieved using {@link getHashes}.
+ * @since v0.9.3
+ */
+ function pbkdf2Sync(
+ password: BinaryLike,
+ salt: BinaryLike,
+ iterations: number,
+ keylen: number,
+ digest: string,
+ ): Buffer;
+ /**
+ * Generates cryptographically strong pseudorandom data. The `size` argument
+ * is a number indicating the number of bytes to generate.
+ *
+ * If a `callback` function is provided, the bytes are generated asynchronously
+ * and the `callback` function is invoked with two arguments: `err` and `buf`.
+ * If an error occurs, `err` will be an `Error` object; otherwise it is `null`. The`buf` argument is a `Buffer` containing the generated bytes.
+ *
+ * ```js
+ * // Asynchronous
+ * const {
+ * randomBytes
+ * } = await import('crypto');
+ *
+ * randomBytes(256, (err, buf) => {
+ * if (err) throw err;
+ * console.log(`${buf.length} bytes of random data: ${buf.toString('hex')}`);
+ * });
+ * ```
+ *
+ * If the `callback` function is not provided, the random bytes are generated
+ * synchronously and returned as a `Buffer`. An error will be thrown if
+ * there is a problem generating the bytes.
+ *
+ * ```js
+ * // Synchronous
+ * const {
+ * randomBytes
+ * } = await import('crypto');
+ *
+ * const buf = randomBytes(256);
+ * console.log(
+ * `${buf.length} bytes of random data: ${buf.toString('hex')}`);
+ * ```
+ *
+ * The `crypto.randomBytes()` method will not complete until there is
+ * sufficient entropy available.
+ * This should normally never take longer than a few milliseconds. The only time
+ * when generating the random bytes may conceivably block for a longer period of
+ * time is right after boot, when the whole system is still low on entropy.
+ *
+ * This API uses libuv's threadpool, which can have surprising and
+ * negative performance implications for some applications; see the `UV_THREADPOOL_SIZE` documentation for more information.
+ *
+ * The asynchronous version of `crypto.randomBytes()` is carried out in a single
+ * threadpool request. To minimize threadpool task length variation, partition
+ * large `randomBytes` requests when doing so as part of fulfilling a client
+ * request.
+ * @since v0.5.8
+ * @param size The number of bytes to generate. The `size` must not be larger than `2**31 - 1`.
+ * @return if the `callback` function is not provided.
+ */
+ function randomBytes(size: number): Buffer;
+ function randomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void;
+ function pseudoRandomBytes(size: number): Buffer;
+ function pseudoRandomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void;
+ /**
+ * Return a random integer `n` such that `min <= n < max`. This
+ * implementation avoids [modulo bias](https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#Modulo_bias).
+ *
+ * The range (`max - min`) must be less than 2^48. `min` and `max` must
+ * be [safe integers](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger).
+ *
+ * If the `callback` function is not provided, the random integer is
+ * generated synchronously.
+ *
+ * ```js
+ * // Asynchronous
+ * const {
+ * randomInt
+ * } = await import('crypto');
+ *
+ * randomInt(3, (err, n) => {
+ * if (err) throw err;
+ * console.log(`Random number chosen from (0, 1, 2): ${n}`);
+ * });
+ * ```
+ *
+ * ```js
+ * // Synchronous
+ * const {
+ * randomInt
+ * } = await import('crypto');
+ *
+ * const n = randomInt(3);
+ * console.log(`Random number chosen from (0, 1, 2): ${n}`);
+ * ```
+ *
+ * ```js
+ * // With `min` argument
+ * const {
+ * randomInt
+ * } = await import('crypto');
+ *
+ * const n = randomInt(1, 7);
+ * console.log(`The dice rolled: ${n}`);
+ * ```
+ * @since v14.10.0, v12.19.0
+ * @param [min=0] Start of random range (inclusive).
+ * @param max End of random range (exclusive).
+ * @param callback `function(err, n) {}`.
+ */
+ function randomInt(max: number): number;
+ function randomInt(min: number, max: number): number;
+ function randomInt(max: number, callback: (err: Error | null, value: number) => void): void;
+ function randomInt(min: number, max: number, callback: (err: Error | null, value: number) => void): void;
+ /**
+ * Synchronous version of {@link randomFill}.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ * const { randomFillSync } = await import('crypto');
+ *
+ * const buf = Buffer.alloc(10);
+ * console.log(randomFillSync(buf).toString('hex'));
+ *
+ * randomFillSync(buf, 5);
+ * console.log(buf.toString('hex'));
+ *
+ * // The above is equivalent to the following:
+ * randomFillSync(buf, 5, 5);
+ * console.log(buf.toString('hex'));
+ * ```
+ *
+ * Any `ArrayBuffer`, `TypedArray` or `DataView` instance may be passed as`buffer`.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ * const { randomFillSync } = await import('crypto');
+ *
+ * const a = new Uint32Array(10);
+ * console.log(Buffer.from(randomFillSync(a).buffer,
+ * a.byteOffset, a.byteLength).toString('hex'));
+ *
+ * const b = new DataView(new ArrayBuffer(10));
+ * console.log(Buffer.from(randomFillSync(b).buffer,
+ * b.byteOffset, b.byteLength).toString('hex'));
+ *
+ * const c = new ArrayBuffer(10);
+ * console.log(Buffer.from(randomFillSync(c)).toString('hex'));
+ * ```
+ * @since v7.10.0, v6.13.0
+ * @param buffer Must be supplied. The size of the provided `buffer` must not be larger than `2**31 - 1`.
+ * @param [offset=0]
+ * @param [size=buffer.length - offset]
+ * @return The object passed as `buffer` argument.
+ */
+ function randomFillSync<T extends NodeJS.ArrayBufferView>(buffer: T, offset?: number, size?: number): T;
+ /**
+ * This function is similar to {@link randomBytes} but requires the first
+ * argument to be a `Buffer` that will be filled. It also
+ * requires that a callback is passed in.
+ *
+ * If the `callback` function is not provided, an error will be thrown.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ * const { randomFill } = await import('crypto');
+ *
+ * const buf = Buffer.alloc(10);
+ * randomFill(buf, (err, buf) => {
+ * if (err) throw err;
+ * console.log(buf.toString('hex'));
+ * });
+ *
+ * randomFill(buf, 5, (err, buf) => {
+ * if (err) throw err;
+ * console.log(buf.toString('hex'));
+ * });
+ *
+ * // The above is equivalent to the following:
+ * randomFill(buf, 5, 5, (err, buf) => {
+ * if (err) throw err;
+ * console.log(buf.toString('hex'));
+ * });
+ * ```
+ *
+ * Any `ArrayBuffer`, `TypedArray`, or `DataView` instance may be passed as`buffer`.
+ *
+ * While this includes instances of `Float32Array` and `Float64Array`, this
+ * function should not be used to generate random floating-point numbers. The
+ * result may contain `+Infinity`, `-Infinity`, and `NaN`, and even if the array
+ * contains finite numbers only, they are not drawn from a uniform random
+ * distribution and have no meaningful lower or upper bounds.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ * const { randomFill } = await import('crypto');
+ *
+ * const a = new Uint32Array(10);
+ * randomFill(a, (err, buf) => {
+ * if (err) throw err;
+ * console.log(Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength)
+ * .toString('hex'));
+ * });
+ *
+ * const b = new DataView(new ArrayBuffer(10));
+ * randomFill(b, (err, buf) => {
+ * if (err) throw err;
+ * console.log(Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength)
+ * .toString('hex'));
+ * });
+ *
+ * const c = new ArrayBuffer(10);
+ * randomFill(c, (err, buf) => {
+ * if (err) throw err;
+ * console.log(Buffer.from(buf).toString('hex'));
+ * });
+ * ```
+ *
+ * This API uses libuv's threadpool, which can have surprising and
+ * negative performance implications for some applications; see the `UV_THREADPOOL_SIZE` documentation for more information.
+ *
+ * The asynchronous version of `crypto.randomFill()` is carried out in a single
+ * threadpool request. To minimize threadpool task length variation, partition
+ * large `randomFill` requests when doing so as part of fulfilling a client
+ * request.
+ * @since v7.10.0, v6.13.0
+ * @param buffer Must be supplied. The size of the provided `buffer` must not be larger than `2**31 - 1`.
+ * @param [offset=0]
+ * @param [size=buffer.length - offset]
+ * @param callback `function(err, buf) {}`.
+ */
+ function randomFill<T extends NodeJS.ArrayBufferView>(
+ buffer: T,
+ callback: (err: Error | null, buf: T) => void,
+ ): void;
+ function randomFill<T extends NodeJS.ArrayBufferView>(
+ buffer: T,
+ offset: number,
+ callback: (err: Error | null, buf: T) => void,
+ ): void;
+ function randomFill<T extends NodeJS.ArrayBufferView>(
+ buffer: T,
+ offset: number,
+ size: number,
+ callback: (err: Error | null, buf: T) => void,
+ ): void;
+ interface ScryptOptions {
+ cost?: number | undefined;
+ blockSize?: number | undefined;
+ parallelization?: number | undefined;
+ N?: number | undefined;
+ r?: number | undefined;
+ p?: number | undefined;
+ maxmem?: number | undefined;
+ }
+ /**
+ * Provides an asynchronous [scrypt](https://en.wikipedia.org/wiki/Scrypt) implementation. Scrypt is a password-based
+ * key derivation function that is designed to be expensive computationally and
+ * memory-wise in order to make brute-force attacks unrewarding.
+ *
+ * The `salt` should be as unique as possible. It is recommended that a salt is
+ * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details.
+ *
+ * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`.
+ *
+ * The `callback` function is called with two arguments: `err` and `derivedKey`.`err` is an exception object when key derivation fails, otherwise `err` is`null`. `derivedKey` is passed to the
+ * callback as a `Buffer`.
+ *
+ * An exception is thrown when any of the input arguments specify invalid values
+ * or types.
+ *
+ * ```js
+ * const {
+ * scrypt
+ * } = await import('crypto');
+ *
+ * // Using the factory defaults.
+ * scrypt('password', 'salt', 64, (err, derivedKey) => {
+ * if (err) throw err;
+ * console.log(derivedKey.toString('hex')); // '3745e48...08d59ae'
+ * });
+ * // Using a custom N parameter. Must be a power of two.
+ * scrypt('password', 'salt', 64, { N: 1024 }, (err, derivedKey) => {
+ * if (err) throw err;
+ * console.log(derivedKey.toString('hex')); // '3745e48...aa39b34'
+ * });
+ * ```
+ * @since v10.5.0
+ */
+ function scrypt(
+ password: BinaryLike,
+ salt: BinaryLike,
+ keylen: number,
+ callback: (err: Error | null, derivedKey: Buffer) => void,
+ ): void;
+ function scrypt(
+ password: BinaryLike,
+ salt: BinaryLike,
+ keylen: number,
+ options: ScryptOptions,
+ callback: (err: Error | null, derivedKey: Buffer) => void,
+ ): void;
+ /**
+ * Provides a synchronous [scrypt](https://en.wikipedia.org/wiki/Scrypt) implementation. Scrypt is a password-based
+ * key derivation function that is designed to be expensive computationally and
+ * memory-wise in order to make brute-force attacks unrewarding.
+ *
+ * The `salt` should be as unique as possible. It is recommended that a salt is
+ * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details.
+ *
+ * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`.
+ *
+ * An exception is thrown when key derivation fails, otherwise the derived key is
+ * returned as a `Buffer`.
+ *
+ * An exception is thrown when any of the input arguments specify invalid values
+ * or types.
+ *
+ * ```js
+ * const {
+ * scryptSync
+ * } = await import('crypto');
+ * // Using the factory defaults.
+ *
+ * const key1 = scryptSync('password', 'salt', 64);
+ * console.log(key1.toString('hex')); // '3745e48...08d59ae'
+ * // Using a custom N parameter. Must be a power of two.
+ * const key2 = scryptSync('password', 'salt', 64, { N: 1024 });
+ * console.log(key2.toString('hex')); // '3745e48...aa39b34'
+ * ```
+ * @since v10.5.0
+ */
+ function scryptSync(password: BinaryLike, salt: BinaryLike, keylen: number, options?: ScryptOptions): Buffer;
+ interface RsaPublicKey {
+ key: KeyLike;
+ padding?: number | undefined;
+ }
+ interface RsaPrivateKey {
+ key: KeyLike;
+ passphrase?: string | undefined;
+ /**
+ * @default 'sha1'
+ */
+ oaepHash?: string | undefined;
+ oaepLabel?: NodeJS.TypedArray | undefined;
+ padding?: number | undefined;
+ }
+ /**
+ * Encrypts the content of `buffer` with `key` and returns a new `Buffer` with encrypted content. The returned data can be decrypted using
+ * the corresponding private key, for example using {@link privateDecrypt}.
+ *
+ * If `key` is not a `KeyObject`, this function behaves as if`key` had been passed to {@link createPublicKey}. If it is an
+ * object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_OAEP_PADDING`.
+ *
+ * Because RSA public keys can be derived from private keys, a private key may
+ * be passed instead of a public key.
+ * @since v0.11.14
+ */
+ function publicEncrypt(key: RsaPublicKey | RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer;
+ /**
+ * Decrypts `buffer` with `key`.`buffer` was previously encrypted using
+ * the corresponding private key, for example using {@link privateEncrypt}.
+ *
+ * If `key` is not a `KeyObject`, this function behaves as if`key` had been passed to {@link createPublicKey}. If it is an
+ * object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_PADDING`.
+ *
+ * Because RSA public keys can be derived from private keys, a private key may
+ * be passed instead of a public key.
+ * @since v1.1.0
+ */
+ function publicDecrypt(key: RsaPublicKey | RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer;
+ /**
+ * Decrypts `buffer` with `privateKey`. `buffer` was previously encrypted using
+ * the corresponding public key, for example using {@link publicEncrypt}.
+ *
+ * If `privateKey` is not a `KeyObject`, this function behaves as if`privateKey` had been passed to {@link createPrivateKey}. If it is an
+ * object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_OAEP_PADDING`.
+ * @since v0.11.14
+ */
+ function privateDecrypt(privateKey: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer;
+ /**
+ * Encrypts `buffer` with `privateKey`. The returned data can be decrypted using
+ * the corresponding public key, for example using {@link publicDecrypt}.
+ *
+ * If `privateKey` is not a `KeyObject`, this function behaves as if`privateKey` had been passed to {@link createPrivateKey}. If it is an
+ * object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_PADDING`.
+ * @since v1.1.0
+ */
+ function privateEncrypt(privateKey: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer;
+ /**
+ * ```js
+ * const {
+ * getCiphers
+ * } = await import('crypto');
+ *
+ * console.log(getCiphers()); // ['aes-128-cbc', 'aes-128-ccm', ...]
+ * ```
+ * @since v0.9.3
+ * @return An array with the names of the supported cipher algorithms.
+ */
+ function getCiphers(): string[];
+ /**
+ * ```js
+ * const {
+ * getCurves
+ * } = await import('crypto');
+ *
+ * console.log(getCurves()); // ['Oakley-EC2N-3', 'Oakley-EC2N-4', ...]
+ * ```
+ * @since v2.3.0
+ * @return An array with the names of the supported elliptic curves.
+ */
+ function getCurves(): string[];
+ /**
+ * @since v10.0.0
+ * @return `1` if and only if a FIPS compliant crypto provider is currently in use, `0` otherwise. A future semver-major release may change the return type of this API to a {boolean}.
+ */
+ function getFips(): 1 | 0;
+ /**
+ * Enables the FIPS compliant crypto provider in a FIPS-enabled Node.js build. Throws an error if FIPS mode is not available.
+ * @since v10.0.0
+ * @param bool `true` to enable FIPS mode.
+ */
+ function setFips(bool: boolean): void;
+ /**
+ * ```js
+ * const {
+ * getHashes
+ * } = await import('crypto');
+ *
+ * console.log(getHashes()); // ['DSA', 'DSA-SHA', 'DSA-SHA1', ...]
+ * ```
+ * @since v0.9.3
+ * @return An array of the names of the supported hash algorithms, such as `'RSA-SHA256'`. Hash algorithms are also called "digest" algorithms.
+ */
+ function getHashes(): string[];
+ /**
+ * The `ECDH` class is a utility for creating Elliptic Curve Diffie-Hellman (ECDH)
+ * key exchanges.
+ *
+ * Instances of the `ECDH` class can be created using the {@link createECDH} function.
+ *
+ * ```js
+ * import assert from 'assert';
+ *
+ * const {
+ * createECDH
+ * } = await import('crypto');
+ *
+ * // Generate Alice's keys...
+ * const alice = createECDH('secp521r1');
+ * const aliceKey = alice.generateKeys();
+ *
+ * // Generate Bob's keys...
+ * const bob = createECDH('secp521r1');
+ * const bobKey = bob.generateKeys();
+ *
+ * // Exchange and generate the secret...
+ * const aliceSecret = alice.computeSecret(bobKey);
+ * const bobSecret = bob.computeSecret(aliceKey);
+ *
+ * assert.strictEqual(aliceSecret.toString('hex'), bobSecret.toString('hex'));
+ * // OK
+ * ```
+ * @since v0.11.14
+ */
+ class ECDH {
+ private constructor();
+ /**
+ * Converts the EC Diffie-Hellman public key specified by `key` and `curve` to the
+ * format specified by `format`. The `format` argument specifies point encoding
+ * and can be `'compressed'`, `'uncompressed'` or `'hybrid'`. The supplied key is
+ * interpreted using the specified `inputEncoding`, and the returned key is encoded
+ * using the specified `outputEncoding`.
+ *
+ * Use {@link getCurves} to obtain a list of available curve names.
+ * On recent OpenSSL releases, `openssl ecparam -list_curves` will also display
+ * the name and description of each available elliptic curve.
+ *
+ * If `format` is not specified the point will be returned in `'uncompressed'`format.
+ *
+ * If the `inputEncoding` is not provided, `key` is expected to be a `Buffer`,`TypedArray`, or `DataView`.
+ *
+ * Example (uncompressing a key):
+ *
+ * ```js
+ * const {
+ * createECDH,
+ * ECDH
+ * } = await import('crypto');
+ *
+ * const ecdh = createECDH('secp256k1');
+ * ecdh.generateKeys();
+ *
+ * const compressedKey = ecdh.getPublicKey('hex', 'compressed');
+ *
+ * const uncompressedKey = ECDH.convertKey(compressedKey,
+ * 'secp256k1',
+ * 'hex',
+ * 'hex',
+ * 'uncompressed');
+ *
+ * // The converted key and the uncompressed public key should be the same
+ * console.log(uncompressedKey === ecdh.getPublicKey('hex'));
+ * ```
+ * @since v10.0.0
+ * @param inputEncoding The `encoding` of the `key` string.
+ * @param outputEncoding The `encoding` of the return value.
+ * @param [format='uncompressed']
+ */
+ static convertKey(
+ key: BinaryLike,
+ curve: string,
+ inputEncoding?: BinaryToTextEncoding,
+ outputEncoding?: "latin1" | "hex" | "base64" | "base64url",
+ format?: "uncompressed" | "compressed" | "hybrid",
+ ): Buffer | string;
+ /**
+ * Generates private and public EC Diffie-Hellman key values, and returns
+ * the public key in the specified `format` and `encoding`. This key should be
+ * transferred to the other party.
+ *
+ * The `format` argument specifies point encoding and can be `'compressed'` or`'uncompressed'`. If `format` is not specified, the point will be returned in`'uncompressed'` format.
+ *
+ * If `encoding` is provided a string is returned; otherwise a `Buffer` is returned.
+ * @since v0.11.14
+ * @param encoding The `encoding` of the return value.
+ * @param [format='uncompressed']
+ */
+ generateKeys(): Buffer;
+ generateKeys(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string;
+ /**
+ * Computes the shared secret using `otherPublicKey` as the other
+ * party's public key and returns the computed shared secret. The supplied
+ * key is interpreted using specified `inputEncoding`, and the returned secret
+ * is encoded using the specified `outputEncoding`.
+ * If the `inputEncoding` is not
+ * provided, `otherPublicKey` is expected to be a `Buffer`, `TypedArray`, or`DataView`.
+ *
+ * If `outputEncoding` is given a string will be returned; otherwise a `Buffer` is returned.
+ *
+ * `ecdh.computeSecret` will throw an`ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY` error when `otherPublicKey`lies outside of the elliptic curve. Since `otherPublicKey` is
+ * usually supplied from a remote user over an insecure network,
+ * be sure to handle this exception accordingly.
+ * @since v0.11.14
+ * @param inputEncoding The `encoding` of the `otherPublicKey` string.
+ * @param outputEncoding The `encoding` of the return value.
+ */
+ computeSecret(otherPublicKey: NodeJS.ArrayBufferView): Buffer;
+ computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding): Buffer;
+ computeSecret(otherPublicKey: NodeJS.ArrayBufferView, outputEncoding: BinaryToTextEncoding): string;
+ computeSecret(
+ otherPublicKey: string,
+ inputEncoding: BinaryToTextEncoding,
+ outputEncoding: BinaryToTextEncoding,
+ ): string;
+ /**
+ * If `encoding` is specified, a string is returned; otherwise a `Buffer` is
+ * returned.
+ * @since v0.11.14
+ * @param encoding The `encoding` of the return value.
+ * @return The EC Diffie-Hellman in the specified `encoding`.
+ */
+ getPrivateKey(): Buffer;
+ getPrivateKey(encoding: BinaryToTextEncoding): string;
+ /**
+ * The `format` argument specifies point encoding and can be `'compressed'` or`'uncompressed'`. If `format` is not specified the point will be returned in`'uncompressed'` format.
+ *
+ * If `encoding` is specified, a string is returned; otherwise a `Buffer` is
+ * returned.
+ * @since v0.11.14
+ * @param [encoding] The `encoding` of the return value.
+ * @param [format='uncompressed']
+ * @return The EC Diffie-Hellman public key in the specified `encoding` and `format`.
+ */
+ getPublicKey(encoding?: null, format?: ECDHKeyFormat): Buffer;
+ getPublicKey(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string;
+ /**
+ * Sets the EC Diffie-Hellman private key.
+ * If `encoding` is provided, `privateKey` is expected
+ * to be a string; otherwise `privateKey` is expected to be a `Buffer`,`TypedArray`, or `DataView`.
+ *
+ * If `privateKey` is not valid for the curve specified when the `ECDH` object was
+ * created, an error is thrown. Upon setting the private key, the associated
+ * public point (key) is also generated and set in the `ECDH` object.
+ * @since v0.11.14
+ * @param encoding The `encoding` of the `privateKey` string.
+ */
+ setPrivateKey(privateKey: NodeJS.ArrayBufferView): void;
+ setPrivateKey(privateKey: string, encoding: BinaryToTextEncoding): void;
+ }
+ /**
+ * Creates an Elliptic Curve Diffie-Hellman (`ECDH`) key exchange object using a
+ * predefined curve specified by the `curveName` string. Use {@link getCurves} to obtain a list of available curve names. On recent
+ * OpenSSL releases, `openssl ecparam -list_curves` will also display the name
+ * and description of each available elliptic curve.
+ * @since v0.11.14
+ */
+ function createECDH(curveName: string): ECDH;
+ /**
+ * This function is based on a constant-time algorithm.
+ * Returns true if `a` is equal to `b`, without leaking timing information that
+ * would allow an attacker to guess one of the values. This is suitable for
+ * comparing HMAC digests or secret values like authentication cookies or [capability urls](https://www.w3.org/TR/capability-urls/).
+ *
+ * `a` and `b` must both be `Buffer`s, `TypedArray`s, or `DataView`s, and they
+ * must have the same byte length. An error is thrown if `a` and `b` have
+ * different byte lengths.
+ *
+ * If at least one of `a` and `b` is a `TypedArray` with more than one byte per
+ * entry, such as `Uint16Array`, the result will be computed using the platform
+ * byte order.
+ *
+ * Use of `crypto.timingSafeEqual` does not guarantee that the _surrounding_ code
+ * is timing-safe. Care should be taken to ensure that the surrounding code does
+ * not introduce timing vulnerabilities.
+ * @since v6.6.0
+ */
+ function timingSafeEqual(a: NodeJS.ArrayBufferView, b: NodeJS.ArrayBufferView): boolean;
+ /** @deprecated since v10.0.0 */
+ const DEFAULT_ENCODING: BufferEncoding;
+ type KeyType = "rsa" | "rsa-pss" | "dsa" | "ec" | "ed25519" | "ed448" | "x25519" | "x448";
+ type KeyFormat = "pem" | "der" | "jwk";
+ interface BasePrivateKeyEncodingOptions<T extends KeyFormat> {
+ format: T;
+ cipher?: string | undefined;
+ passphrase?: string | undefined;
+ }
+ interface KeyPairKeyObjectResult {
+ publicKey: KeyObject;
+ privateKey: KeyObject;
+ }
+ interface ED25519KeyPairKeyObjectOptions {}
+ interface ED448KeyPairKeyObjectOptions {}
+ interface X25519KeyPairKeyObjectOptions {}
+ interface X448KeyPairKeyObjectOptions {}
+ interface ECKeyPairKeyObjectOptions {
+ /**
+ * Name of the curve to use
+ */
+ namedCurve: string;
+ }
+ interface RSAKeyPairKeyObjectOptions {
+ /**
+ * Key size in bits
+ */
+ modulusLength: number;
+ /**
+ * Public exponent
+ * @default 0x10001
+ */
+ publicExponent?: number | undefined;
+ }
+ interface RSAPSSKeyPairKeyObjectOptions {
+ /**
+ * Key size in bits
+ */
+ modulusLength: number;
+ /**
+ * Public exponent
+ * @default 0x10001
+ */
+ publicExponent?: number | undefined;
+ /**
+ * Name of the message digest
+ */
+ hashAlgorithm?: string;
+ /**
+ * Name of the message digest used by MGF1
+ */
+ mgf1HashAlgorithm?: string;
+ /**
+ * Minimal salt length in bytes
+ */
+ saltLength?: string;
+ }
+ interface DSAKeyPairKeyObjectOptions {
+ /**
+ * Key size in bits
+ */
+ modulusLength: number;
+ /**
+ * Size of q in bits
+ */
+ divisorLength: number;
+ }
+ interface RSAKeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
+ /**
+ * Key size in bits
+ */
+ modulusLength: number;
+ /**
+ * Public exponent
+ * @default 0x10001
+ */
+ publicExponent?: number | undefined;
+ publicKeyEncoding: {
+ type: "pkcs1" | "spki";
+ format: PubF;
+ };
+ privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
+ type: "pkcs1" | "pkcs8";
+ };
+ }
+ interface RSAPSSKeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
+ /**
+ * Key size in bits
+ */
+ modulusLength: number;
+ /**
+ * Public exponent
+ * @default 0x10001
+ */
+ publicExponent?: number | undefined;
+ /**
+ * Name of the message digest
+ */
+ hashAlgorithm?: string;
+ /**
+ * Name of the message digest used by MGF1
+ */
+ mgf1HashAlgorithm?: string;
+ /**
+ * Minimal salt length in bytes
+ */
+ saltLength?: string;
+ publicKeyEncoding: {
+ type: "spki";
+ format: PubF;
+ };
+ privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
+ type: "pkcs8";
+ };
+ }
+ interface DSAKeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
+ /**
+ * Key size in bits
+ */
+ modulusLength: number;
+ /**
+ * Size of q in bits
+ */
+ divisorLength: number;
+ publicKeyEncoding: {
+ type: "spki";
+ format: PubF;
+ };
+ privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
+ type: "pkcs8";
+ };
+ }
+ interface ECKeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
+ /**
+ * Name of the curve to use.
+ */
+ namedCurve: string;
+ publicKeyEncoding: {
+ type: "pkcs1" | "spki";
+ format: PubF;
+ };
+ privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
+ type: "sec1" | "pkcs8";
+ };
+ }
+ interface ED25519KeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
+ publicKeyEncoding: {
+ type: "spki";
+ format: PubF;
+ };
+ privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
+ type: "pkcs8";
+ };
+ }
+ interface ED448KeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
+ publicKeyEncoding: {
+ type: "spki";
+ format: PubF;
+ };
+ privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
+ type: "pkcs8";
+ };
+ }
+ interface X25519KeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
+ publicKeyEncoding: {
+ type: "spki";
+ format: PubF;
+ };
+ privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
+ type: "pkcs8";
+ };
+ }
+ interface X448KeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
+ publicKeyEncoding: {
+ type: "spki";
+ format: PubF;
+ };
+ privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
+ type: "pkcs8";
+ };
+ }
+ interface KeyPairSyncResult<T1 extends string | Buffer, T2 extends string | Buffer> {
+ publicKey: T1;
+ privateKey: T2;
+ }
+ /**
+ * Generates a new asymmetric key pair of the given `type`. RSA, RSA-PSS, DSA, EC,
+ * Ed25519, Ed448, X25519, X448, and DH are currently supported.
+ *
+ * If a `publicKeyEncoding` or `privateKeyEncoding` was specified, this function
+ * behaves as if `keyObject.export()` had been called on its result. Otherwise,
+ * the respective part of the key is returned as a `KeyObject`.
+ *
+ * When encoding public keys, it is recommended to use `'spki'`. When encoding
+ * private keys, it is recommended to use `'pkcs8'` with a strong passphrase,
+ * and to keep the passphrase confidential.
+ *
+ * ```js
+ * const {
+ * generateKeyPairSync
+ * } = await import('crypto');
+ *
+ * const {
+ * publicKey,
+ * privateKey,
+ * } = generateKeyPairSync('rsa', {
+ * modulusLength: 4096,
+ * publicKeyEncoding: {
+ * type: 'spki',
+ * format: 'pem'
+ * },
+ * privateKeyEncoding: {
+ * type: 'pkcs8',
+ * format: 'pem',
+ * cipher: 'aes-256-cbc',
+ * passphrase: 'top secret'
+ * }
+ * });
+ * ```
+ *
+ * The return value `{ publicKey, privateKey }` represents the generated key pair.
+ * When PEM encoding was selected, the respective key will be a string, otherwise
+ * it will be a buffer containing the data encoded as DER.
+ * @since v10.12.0
+ * @param type Must be `'rsa'`, `'rsa-pss'`, `'dsa'`, `'ec'`, `'ed25519'`, `'ed448'`, `'x25519'`, `'x448'`, or `'dh'`.
+ */
+ function generateKeyPairSync(
+ type: "rsa",
+ options: RSAKeyPairOptions<"pem", "pem">,
+ ): KeyPairSyncResult<string, string>;
+ function generateKeyPairSync(
+ type: "rsa",
+ options: RSAKeyPairOptions<"pem", "der">,
+ ): KeyPairSyncResult<string, Buffer>;
+ function generateKeyPairSync(
+ type: "rsa",
+ options: RSAKeyPairOptions<"der", "pem">,
+ ): KeyPairSyncResult<Buffer, string>;
+ function generateKeyPairSync(
+ type: "rsa",
+ options: RSAKeyPairOptions<"der", "der">,
+ ): KeyPairSyncResult<Buffer, Buffer>;
+ function generateKeyPairSync(type: "rsa", options: RSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
+ function generateKeyPairSync(
+ type: "rsa-pss",
+ options: RSAPSSKeyPairOptions<"pem", "pem">,
+ ): KeyPairSyncResult<string, string>;
+ function generateKeyPairSync(
+ type: "rsa-pss",
+ options: RSAPSSKeyPairOptions<"pem", "der">,
+ ): KeyPairSyncResult<string, Buffer>;
+ function generateKeyPairSync(
+ type: "rsa-pss",
+ options: RSAPSSKeyPairOptions<"der", "pem">,
+ ): KeyPairSyncResult<Buffer, string>;
+ function generateKeyPairSync(
+ type: "rsa-pss",
+ options: RSAPSSKeyPairOptions<"der", "der">,
+ ): KeyPairSyncResult<Buffer, Buffer>;
+ function generateKeyPairSync(type: "rsa-pss", options: RSAPSSKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
+ function generateKeyPairSync(
+ type: "dsa",
+ options: DSAKeyPairOptions<"pem", "pem">,
+ ): KeyPairSyncResult<string, string>;
+ function generateKeyPairSync(
+ type: "dsa",
+ options: DSAKeyPairOptions<"pem", "der">,
+ ): KeyPairSyncResult<string, Buffer>;
+ function generateKeyPairSync(
+ type: "dsa",
+ options: DSAKeyPairOptions<"der", "pem">,
+ ): KeyPairSyncResult<Buffer, string>;
+ function generateKeyPairSync(
+ type: "dsa",
+ options: DSAKeyPairOptions<"der", "der">,
+ ): KeyPairSyncResult<Buffer, Buffer>;
+ function generateKeyPairSync(type: "dsa", options: DSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
+ function generateKeyPairSync(
+ type: "ec",
+ options: ECKeyPairOptions<"pem", "pem">,
+ ): KeyPairSyncResult<string, string>;
+ function generateKeyPairSync(
+ type: "ec",
+ options: ECKeyPairOptions<"pem", "der">,
+ ): KeyPairSyncResult<string, Buffer>;
+ function generateKeyPairSync(
+ type: "ec",
+ options: ECKeyPairOptions<"der", "pem">,
+ ): KeyPairSyncResult<Buffer, string>;
+ function generateKeyPairSync(
+ type: "ec",
+ options: ECKeyPairOptions<"der", "der">,
+ ): KeyPairSyncResult<Buffer, Buffer>;
+ function generateKeyPairSync(type: "ec", options: ECKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
+ function generateKeyPairSync(
+ type: "ed25519",
+ options: ED25519KeyPairOptions<"pem", "pem">,
+ ): KeyPairSyncResult<string, string>;
+ function generateKeyPairSync(
+ type: "ed25519",
+ options: ED25519KeyPairOptions<"pem", "der">,
+ ): KeyPairSyncResult<string, Buffer>;
+ function generateKeyPairSync(
+ type: "ed25519",
+ options: ED25519KeyPairOptions<"der", "pem">,
+ ): KeyPairSyncResult<Buffer, string>;
+ function generateKeyPairSync(
+ type: "ed25519",
+ options: ED25519KeyPairOptions<"der", "der">,
+ ): KeyPairSyncResult<Buffer, Buffer>;
+ function generateKeyPairSync(type: "ed25519", options?: ED25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
+ function generateKeyPairSync(
+ type: "ed448",
+ options: ED448KeyPairOptions<"pem", "pem">,
+ ): KeyPairSyncResult<string, string>;
+ function generateKeyPairSync(
+ type: "ed448",
+ options: ED448KeyPairOptions<"pem", "der">,
+ ): KeyPairSyncResult<string, Buffer>;
+ function generateKeyPairSync(
+ type: "ed448",
+ options: ED448KeyPairOptions<"der", "pem">,
+ ): KeyPairSyncResult<Buffer, string>;
+ function generateKeyPairSync(
+ type: "ed448",
+ options: ED448KeyPairOptions<"der", "der">,
+ ): KeyPairSyncResult<Buffer, Buffer>;
+ function generateKeyPairSync(type: "ed448", options?: ED448KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
+ function generateKeyPairSync(
+ type: "x25519",
+ options: X25519KeyPairOptions<"pem", "pem">,
+ ): KeyPairSyncResult<string, string>;
+ function generateKeyPairSync(
+ type: "x25519",
+ options: X25519KeyPairOptions<"pem", "der">,
+ ): KeyPairSyncResult<string, Buffer>;
+ function generateKeyPairSync(
+ type: "x25519",
+ options: X25519KeyPairOptions<"der", "pem">,
+ ): KeyPairSyncResult<Buffer, string>;
+ function generateKeyPairSync(
+ type: "x25519",
+ options: X25519KeyPairOptions<"der", "der">,
+ ): KeyPairSyncResult<Buffer, Buffer>;
+ function generateKeyPairSync(type: "x25519", options?: X25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
+ function generateKeyPairSync(
+ type: "x448",
+ options: X448KeyPairOptions<"pem", "pem">,
+ ): KeyPairSyncResult<string, string>;
+ function generateKeyPairSync(
+ type: "x448",
+ options: X448KeyPairOptions<"pem", "der">,
+ ): KeyPairSyncResult<string, Buffer>;
+ function generateKeyPairSync(
+ type: "x448",
+ options: X448KeyPairOptions<"der", "pem">,
+ ): KeyPairSyncResult<Buffer, string>;
+ function generateKeyPairSync(
+ type: "x448",
+ options: X448KeyPairOptions<"der", "der">,
+ ): KeyPairSyncResult<Buffer, Buffer>;
+ function generateKeyPairSync(type: "x448", options?: X448KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
+ /**
+ * Generates a new asymmetric key pair of the given `type`. RSA, RSA-PSS, DSA, EC,
+ * Ed25519, Ed448, X25519, X448, and DH are currently supported.
+ *
+ * If a `publicKeyEncoding` or `privateKeyEncoding` was specified, this function
+ * behaves as if `keyObject.export()` had been called on its result. Otherwise,
+ * the respective part of the key is returned as a `KeyObject`.
+ *
+ * It is recommended to encode public keys as `'spki'` and private keys as`'pkcs8'` with encryption for long-term storage:
+ *
+ * ```js
+ * const {
+ * generateKeyPair
+ * } = await import('crypto');
+ *
+ * generateKeyPair('rsa', {
+ * modulusLength: 4096,
+ * publicKeyEncoding: {
+ * type: 'spki',
+ * format: 'pem'
+ * },
+ * privateKeyEncoding: {
+ * type: 'pkcs8',
+ * format: 'pem',
+ * cipher: 'aes-256-cbc',
+ * passphrase: 'top secret'
+ * }
+ * }, (err, publicKey, privateKey) => {
+ * // Handle errors and use the generated key pair.
+ * });
+ * ```
+ *
+ * On completion, `callback` will be called with `err` set to `undefined` and`publicKey` / `privateKey` representing the generated key pair.
+ *
+ * If this method is invoked as its `util.promisify()` ed version, it returns
+ * a `Promise` for an `Object` with `publicKey` and `privateKey` properties.
+ * @since v10.12.0
+ * @param type Must be `'rsa'`, `'rsa-pss'`, `'dsa'`, `'ec'`, `'ed25519'`, `'ed448'`, `'x25519'`, `'x448'`, or `'dh'`.
+ */
+ function generateKeyPair(
+ type: "rsa",
+ options: RSAKeyPairOptions<"pem", "pem">,
+ callback: (err: Error | null, publicKey: string, privateKey: string) => void,
+ ): void;
+ function generateKeyPair(
+ type: "rsa",
+ options: RSAKeyPairOptions<"pem", "der">,
+ callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
+ ): void;
+ function generateKeyPair(
+ type: "rsa",
+ options: RSAKeyPairOptions<"der", "pem">,
+ callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
+ ): void;
+ function generateKeyPair(
+ type: "rsa",
+ options: RSAKeyPairOptions<"der", "der">,
+ callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
+ ): void;
+ function generateKeyPair(
+ type: "rsa",
+ options: RSAKeyPairKeyObjectOptions,
+ callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
+ ): void;
+ function generateKeyPair(
+ type: "rsa-pss",
+ options: RSAPSSKeyPairOptions<"pem", "pem">,
+ callback: (err: Error | null, publicKey: string, privateKey: string) => void,
+ ): void;
+ function generateKeyPair(
+ type: "rsa-pss",
+ options: RSAPSSKeyPairOptions<"pem", "der">,
+ callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
+ ): void;
+ function generateKeyPair(
+ type: "rsa-pss",
+ options: RSAPSSKeyPairOptions<"der", "pem">,
+ callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
+ ): void;
+ function generateKeyPair(
+ type: "rsa-pss",
+ options: RSAPSSKeyPairOptions<"der", "der">,
+ callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
+ ): void;
+ function generateKeyPair(
+ type: "rsa-pss",
+ options: RSAPSSKeyPairKeyObjectOptions,
+ callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
+ ): void;
+ function generateKeyPair(
+ type: "dsa",
+ options: DSAKeyPairOptions<"pem", "pem">,
+ callback: (err: Error | null, publicKey: string, privateKey: string) => void,
+ ): void;
+ function generateKeyPair(
+ type: "dsa",
+ options: DSAKeyPairOptions<"pem", "der">,
+ callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
+ ): void;
+ function generateKeyPair(
+ type: "dsa",
+ options: DSAKeyPairOptions<"der", "pem">,
+ callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
+ ): void;
+ function generateKeyPair(
+ type: "dsa",
+ options: DSAKeyPairOptions<"der", "der">,
+ callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
+ ): void;
+ function generateKeyPair(
+ type: "dsa",
+ options: DSAKeyPairKeyObjectOptions,
+ callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
+ ): void;
+ function generateKeyPair(
+ type: "ec",
+ options: ECKeyPairOptions<"pem", "pem">,
+ callback: (err: Error | null, publicKey: string, privateKey: string) => void,
+ ): void;
+ function generateKeyPair(
+ type: "ec",
+ options: ECKeyPairOptions<"pem", "der">,
+ callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
+ ): void;
+ function generateKeyPair(
+ type: "ec",
+ options: ECKeyPairOptions<"der", "pem">,
+ callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
+ ): void;
+ function generateKeyPair(
+ type: "ec",
+ options: ECKeyPairOptions<"der", "der">,
+ callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
+ ): void;
+ function generateKeyPair(
+ type: "ec",
+ options: ECKeyPairKeyObjectOptions,
+ callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
+ ): void;
+ function generateKeyPair(
+ type: "ed25519",
+ options: ED25519KeyPairOptions<"pem", "pem">,
+ callback: (err: Error | null, publicKey: string, privateKey: string) => void,
+ ): void;
+ function generateKeyPair(
+ type: "ed25519",
+ options: ED25519KeyPairOptions<"pem", "der">,
+ callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
+ ): void;
+ function generateKeyPair(
+ type: "ed25519",
+ options: ED25519KeyPairOptions<"der", "pem">,
+ callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
+ ): void;
+ function generateKeyPair(
+ type: "ed25519",
+ options: ED25519KeyPairOptions<"der", "der">,
+ callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
+ ): void;
+ function generateKeyPair(
+ type: "ed25519",
+ options: ED25519KeyPairKeyObjectOptions | undefined,
+ callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
+ ): void;
+ function generateKeyPair(
+ type: "ed448",
+ options: ED448KeyPairOptions<"pem", "pem">,
+ callback: (err: Error | null, publicKey: string, privateKey: string) => void,
+ ): void;
+ function generateKeyPair(
+ type: "ed448",
+ options: ED448KeyPairOptions<"pem", "der">,
+ callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
+ ): void;
+ function generateKeyPair(
+ type: "ed448",
+ options: ED448KeyPairOptions<"der", "pem">,
+ callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
+ ): void;
+ function generateKeyPair(
+ type: "ed448",
+ options: ED448KeyPairOptions<"der", "der">,
+ callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
+ ): void;
+ function generateKeyPair(
+ type: "ed448",
+ options: ED448KeyPairKeyObjectOptions | undefined,
+ callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
+ ): void;
+ function generateKeyPair(
+ type: "x25519",
+ options: X25519KeyPairOptions<"pem", "pem">,
+ callback: (err: Error | null, publicKey: string, privateKey: string) => void,
+ ): void;
+ function generateKeyPair(
+ type: "x25519",
+ options: X25519KeyPairOptions<"pem", "der">,
+ callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
+ ): void;
+ function generateKeyPair(
+ type: "x25519",
+ options: X25519KeyPairOptions<"der", "pem">,
+ callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
+ ): void;
+ function generateKeyPair(
+ type: "x25519",
+ options: X25519KeyPairOptions<"der", "der">,
+ callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
+ ): void;
+ function generateKeyPair(
+ type: "x25519",
+ options: X25519KeyPairKeyObjectOptions | undefined,
+ callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
+ ): void;
+ function generateKeyPair(
+ type: "x448",
+ options: X448KeyPairOptions<"pem", "pem">,
+ callback: (err: Error | null, publicKey: string, privateKey: string) => void,
+ ): void;
+ function generateKeyPair(
+ type: "x448",
+ options: X448KeyPairOptions<"pem", "der">,
+ callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
+ ): void;
+ function generateKeyPair(
+ type: "x448",
+ options: X448KeyPairOptions<"der", "pem">,
+ callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
+ ): void;
+ function generateKeyPair(
+ type: "x448",
+ options: X448KeyPairOptions<"der", "der">,
+ callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
+ ): void;
+ function generateKeyPair(
+ type: "x448",
+ options: X448KeyPairKeyObjectOptions | undefined,
+ callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
+ ): void;
+ namespace generateKeyPair {
+ function __promisify__(
+ type: "rsa",
+ options: RSAKeyPairOptions<"pem", "pem">,
+ ): Promise<{
+ publicKey: string;
+ privateKey: string;
+ }>;
+ function __promisify__(
+ type: "rsa",
+ options: RSAKeyPairOptions<"pem", "der">,
+ ): Promise<{
+ publicKey: string;
+ privateKey: Buffer;
+ }>;
+ function __promisify__(
+ type: "rsa",
+ options: RSAKeyPairOptions<"der", "pem">,
+ ): Promise<{
+ publicKey: Buffer;
+ privateKey: string;
+ }>;
+ function __promisify__(
+ type: "rsa",
+ options: RSAKeyPairOptions<"der", "der">,
+ ): Promise<{
+ publicKey: Buffer;
+ privateKey: Buffer;
+ }>;
+ function __promisify__(type: "rsa", options: RSAKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
+ function __promisify__(
+ type: "rsa-pss",
+ options: RSAPSSKeyPairOptions<"pem", "pem">,
+ ): Promise<{
+ publicKey: string;
+ privateKey: string;
+ }>;
+ function __promisify__(
+ type: "rsa-pss",
+ options: RSAPSSKeyPairOptions<"pem", "der">,
+ ): Promise<{
+ publicKey: string;
+ privateKey: Buffer;
+ }>;
+ function __promisify__(
+ type: "rsa-pss",
+ options: RSAPSSKeyPairOptions<"der", "pem">,
+ ): Promise<{
+ publicKey: Buffer;
+ privateKey: string;
+ }>;
+ function __promisify__(
+ type: "rsa-pss",
+ options: RSAPSSKeyPairOptions<"der", "der">,
+ ): Promise<{
+ publicKey: Buffer;
+ privateKey: Buffer;
+ }>;
+ function __promisify__(
+ type: "rsa-pss",
+ options: RSAPSSKeyPairKeyObjectOptions,
+ ): Promise<KeyPairKeyObjectResult>;
+ function __promisify__(
+ type: "dsa",
+ options: DSAKeyPairOptions<"pem", "pem">,
+ ): Promise<{
+ publicKey: string;
+ privateKey: string;
+ }>;
+ function __promisify__(
+ type: "dsa",
+ options: DSAKeyPairOptions<"pem", "der">,
+ ): Promise<{
+ publicKey: string;
+ privateKey: Buffer;
+ }>;
+ function __promisify__(
+ type: "dsa",
+ options: DSAKeyPairOptions<"der", "pem">,
+ ): Promise<{
+ publicKey: Buffer;
+ privateKey: string;
+ }>;
+ function __promisify__(
+ type: "dsa",
+ options: DSAKeyPairOptions<"der", "der">,
+ ): Promise<{
+ publicKey: Buffer;
+ privateKey: Buffer;
+ }>;
+ function __promisify__(type: "dsa", options: DSAKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
+ function __promisify__(
+ type: "ec",
+ options: ECKeyPairOptions<"pem", "pem">,
+ ): Promise<{
+ publicKey: string;
+ privateKey: string;
+ }>;
+ function __promisify__(
+ type: "ec",
+ options: ECKeyPairOptions<"pem", "der">,
+ ): Promise<{
+ publicKey: string;
+ privateKey: Buffer;
+ }>;
+ function __promisify__(
+ type: "ec",
+ options: ECKeyPairOptions<"der", "pem">,
+ ): Promise<{
+ publicKey: Buffer;
+ privateKey: string;
+ }>;
+ function __promisify__(
+ type: "ec",
+ options: ECKeyPairOptions<"der", "der">,
+ ): Promise<{
+ publicKey: Buffer;
+ privateKey: Buffer;
+ }>;
+ function __promisify__(type: "ec", options: ECKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
+ function __promisify__(
+ type: "ed25519",
+ options: ED25519KeyPairOptions<"pem", "pem">,
+ ): Promise<{
+ publicKey: string;
+ privateKey: string;
+ }>;
+ function __promisify__(
+ type: "ed25519",
+ options: ED25519KeyPairOptions<"pem", "der">,
+ ): Promise<{
+ publicKey: string;
+ privateKey: Buffer;
+ }>;
+ function __promisify__(
+ type: "ed25519",
+ options: ED25519KeyPairOptions<"der", "pem">,
+ ): Promise<{
+ publicKey: Buffer;
+ privateKey: string;
+ }>;
+ function __promisify__(
+ type: "ed25519",
+ options: ED25519KeyPairOptions<"der", "der">,
+ ): Promise<{
+ publicKey: Buffer;
+ privateKey: Buffer;
+ }>;
+ function __promisify__(
+ type: "ed25519",
+ options?: ED25519KeyPairKeyObjectOptions,
+ ): Promise<KeyPairKeyObjectResult>;
+ function __promisify__(
+ type: "ed448",
+ options: ED448KeyPairOptions<"pem", "pem">,
+ ): Promise<{
+ publicKey: string;
+ privateKey: string;
+ }>;
+ function __promisify__(
+ type: "ed448",
+ options: ED448KeyPairOptions<"pem", "der">,
+ ): Promise<{
+ publicKey: string;
+ privateKey: Buffer;
+ }>;
+ function __promisify__(
+ type: "ed448",
+ options: ED448KeyPairOptions<"der", "pem">,
+ ): Promise<{
+ publicKey: Buffer;
+ privateKey: string;
+ }>;
+ function __promisify__(
+ type: "ed448",
+ options: ED448KeyPairOptions<"der", "der">,
+ ): Promise<{
+ publicKey: Buffer;
+ privateKey: Buffer;
+ }>;
+ function __promisify__(type: "ed448", options?: ED448KeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
+ function __promisify__(
+ type: "x25519",
+ options: X25519KeyPairOptions<"pem", "pem">,
+ ): Promise<{
+ publicKey: string;
+ privateKey: string;
+ }>;
+ function __promisify__(
+ type: "x25519",
+ options: X25519KeyPairOptions<"pem", "der">,
+ ): Promise<{
+ publicKey: string;
+ privateKey: Buffer;
+ }>;
+ function __promisify__(
+ type: "x25519",
+ options: X25519KeyPairOptions<"der", "pem">,
+ ): Promise<{
+ publicKey: Buffer;
+ privateKey: string;
+ }>;
+ function __promisify__(
+ type: "x25519",
+ options: X25519KeyPairOptions<"der", "der">,
+ ): Promise<{
+ publicKey: Buffer;
+ privateKey: Buffer;
+ }>;
+ function __promisify__(
+ type: "x25519",
+ options?: X25519KeyPairKeyObjectOptions,
+ ): Promise<KeyPairKeyObjectResult>;
+ function __promisify__(
+ type: "x448",
+ options: X448KeyPairOptions<"pem", "pem">,
+ ): Promise<{
+ publicKey: string;
+ privateKey: string;
+ }>;
+ function __promisify__(
+ type: "x448",
+ options: X448KeyPairOptions<"pem", "der">,
+ ): Promise<{
+ publicKey: string;
+ privateKey: Buffer;
+ }>;
+ function __promisify__(
+ type: "x448",
+ options: X448KeyPairOptions<"der", "pem">,
+ ): Promise<{
+ publicKey: Buffer;
+ privateKey: string;
+ }>;
+ function __promisify__(
+ type: "x448",
+ options: X448KeyPairOptions<"der", "der">,
+ ): Promise<{
+ publicKey: Buffer;
+ privateKey: Buffer;
+ }>;
+ function __promisify__(type: "x448", options?: X448KeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
+ }
+ /**
+ * Calculates and returns the signature for `data` using the given private key and
+ * algorithm. If `algorithm` is `null` or `undefined`, then the algorithm is
+ * dependent upon the key type (especially Ed25519 and Ed448).
+ *
+ * If `key` is not a `KeyObject`, this function behaves as if `key` had been
+ * passed to {@link createPrivateKey}. If it is an object, the following
+ * additional properties can be passed:
+ *
+ * If the `callback` function is provided this function uses libuv's threadpool.
+ * @since v12.0.0
+ */
+ function sign(
+ algorithm: string | null | undefined,
+ data: NodeJS.ArrayBufferView,
+ key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput,
+ ): Buffer;
+ function sign(
+ algorithm: string | null | undefined,
+ data: NodeJS.ArrayBufferView,
+ key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput,
+ callback: (error: Error | null, data: Buffer) => void,
+ ): void;
+ /**
+ * Verifies the given signature for `data` using the given key and algorithm. If`algorithm` is `null` or `undefined`, then the algorithm is dependent upon the
+ * key type (especially Ed25519 and Ed448).
+ *
+ * If `key` is not a `KeyObject`, this function behaves as if `key` had been
+ * passed to {@link createPublicKey}. If it is an object, the following
+ * additional properties can be passed:
+ *
+ * The `signature` argument is the previously calculated signature for the `data`.
+ *
+ * Because public keys can be derived from private keys, a private key or a public
+ * key may be passed for `key`.
+ *
+ * If the `callback` function is provided this function uses libuv's threadpool.
+ * @since v12.0.0
+ */
+ function verify(
+ algorithm: string | null | undefined,
+ data: NodeJS.ArrayBufferView,
+ key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput,
+ signature: NodeJS.ArrayBufferView,
+ ): boolean;
+ function verify(
+ algorithm: string | null | undefined,
+ data: NodeJS.ArrayBufferView,
+ key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput,
+ signature: NodeJS.ArrayBufferView,
+ callback: (error: Error | null, result: boolean) => void,
+ ): void;
+ /**
+ * Computes the Diffie-Hellman secret based on a `privateKey` and a `publicKey`.
+ * Both keys must have the same `asymmetricKeyType`, which must be one of `'dh'`(for Diffie-Hellman), `'ec'` (for ECDH), `'x448'`, or `'x25519'` (for ECDH-ES).
+ * @since v13.9.0, v12.17.0
+ */
+ function diffieHellman(options: { privateKey: KeyObject; publicKey: KeyObject }): Buffer;
+ type CipherMode = "cbc" | "ccm" | "cfb" | "ctr" | "ecb" | "gcm" | "ocb" | "ofb" | "stream" | "wrap" | "xts";
+ interface CipherInfoOptions {
+ /**
+ * A test key length.
+ */
+ keyLength?: number | undefined;
+ /**
+ * A test IV length.
+ */
+ ivLength?: number | undefined;
+ }
+ interface CipherInfo {
+ /**
+ * The name of the cipher.
+ */
+ name: string;
+ /**
+ * The nid of the cipher.
+ */
+ nid: number;
+ /**
+ * The block size of the cipher in bytes.
+ * This property is omitted when mode is 'stream'.
+ */
+ blockSize?: number | undefined;
+ /**
+ * The expected or default initialization vector length in bytes.
+ * This property is omitted if the cipher does not use an initialization vector.
+ */
+ ivLength?: number | undefined;
+ /**
+ * The expected or default key length in bytes.
+ */
+ keyLength: number;
+ /**
+ * The cipher mode.
+ */
+ mode: CipherMode;
+ }
+ /**
+ * Returns information about a given cipher.
+ *
+ * Some ciphers accept variable length keys and initialization vectors. By default,
+ * the `crypto.getCipherInfo()` method will return the default values for these
+ * ciphers. To test if a given key length or iv length is acceptable for given
+ * cipher, use the `keyLength` and `ivLength` options. If the given values are
+ * unacceptable, `undefined` will be returned.
+ * @since v15.0.0
+ * @param nameOrNid The name or nid of the cipher to query.
+ */
+ function getCipherInfo(nameOrNid: string | number, options?: CipherInfoOptions): CipherInfo | undefined;
+ /**
+ * HKDF is a simple key derivation function defined in RFC 5869\. The given `ikm`,`salt` and `info` are used with the `digest` to derive a key of `keylen` bytes.
+ *
+ * The supplied `callback` function is called with two arguments: `err` and`derivedKey`. If an errors occurs while deriving the key, `err` will be set;
+ * otherwise `err` will be `null`. The successfully generated `derivedKey` will
+ * be passed to the callback as an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). An error will be thrown if any
+ * of the input arguments specify invalid values or types.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ * const {
+ * hkdf
+ * } = await import('crypto');
+ *
+ * hkdf('sha512', 'key', 'salt', 'info', 64, (err, derivedKey) => {
+ * if (err) throw err;
+ * console.log(Buffer.from(derivedKey).toString('hex')); // '24156e2...5391653'
+ * });
+ * ```
+ * @since v15.0.0
+ * @param digest The digest algorithm to use.
+ * @param ikm The input keying material. It must be at least one byte in length.
+ * @param salt The salt value. Must be provided but can be zero-length.
+ * @param info Additional info value. Must be provided but can be zero-length, and cannot be more than 1024 bytes.
+ * @param keylen The length of the key to generate. Must be greater than 0. The maximum allowable value is `255` times the number of bytes produced by the selected digest function (e.g. `sha512`
+ * generates 64-byte hashes, making the maximum HKDF output 16320 bytes).
+ */
+ function hkdf(
+ digest: string,
+ irm: BinaryLike | KeyObject,
+ salt: BinaryLike,
+ info: BinaryLike,
+ keylen: number,
+ callback: (err: Error | null, derivedKey: ArrayBuffer) => void,
+ ): void;
+ /**
+ * Provides a synchronous HKDF key derivation function as defined in RFC 5869\. The
+ * given `ikm`, `salt` and `info` are used with the `digest` to derive a key of`keylen` bytes.
+ *
+ * The successfully generated `derivedKey` will be returned as an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer).
+ *
+ * An error will be thrown if any of the input arguments specify invalid values or
+ * types, or if the derived key cannot be generated.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ * const {
+ * hkdfSync
+ * } = await import('crypto');
+ *
+ * const derivedKey = hkdfSync('sha512', 'key', 'salt', 'info', 64);
+ * console.log(Buffer.from(derivedKey).toString('hex')); // '24156e2...5391653'
+ * ```
+ * @since v15.0.0
+ * @param digest The digest algorithm to use.
+ * @param ikm The input keying material. It must be at least one byte in length.
+ * @param salt The salt value. Must be provided but can be zero-length.
+ * @param info Additional info value. Must be provided but can be zero-length, and cannot be more than 1024 bytes.
+ * @param keylen The length of the key to generate. Must be greater than 0. The maximum allowable value is `255` times the number of bytes produced by the selected digest function (e.g. `sha512`
+ * generates 64-byte hashes, making the maximum HKDF output 16320 bytes).
+ */
+ function hkdfSync(
+ digest: string,
+ ikm: BinaryLike | KeyObject,
+ salt: BinaryLike,
+ info: BinaryLike,
+ keylen: number,
+ ): ArrayBuffer;
+ interface SecureHeapUsage {
+ /**
+ * The total allocated secure heap size as specified using the `--secure-heap=n` command-line flag.
+ */
+ total: number;
+ /**
+ * The minimum allocation from the secure heap as specified using the `--secure-heap-min` command-line flag.
+ */
+ min: number;
+ /**
+ * The total number of bytes currently allocated from the secure heap.
+ */
+ used: number;
+ /**
+ * The calculated ratio of `used` to `total` allocated bytes.
+ */
+ utilization: number;
+ }
+ /**
+ * @since v15.6.0
+ */
+ function secureHeapUsed(): SecureHeapUsage;
+ interface RandomUUIDOptions {
+ /**
+ * By default, to improve performance,
+ * Node.js will pre-emptively generate and persistently cache enough
+ * random data to generate up to 128 random UUIDs. To generate a UUID
+ * without using the cache, set `disableEntropyCache` to `true`.
+ *
+ * @default `false`
+ */
+ disableEntropyCache?: boolean | undefined;
+ }
+ /**
+ * Generates a random [RFC 4122](https://www.rfc-editor.org/rfc/rfc4122.txt) version 4 UUID. The UUID is generated using a
+ * cryptographic pseudorandom number generator.
+ * @since v15.6.0, v14.17.0
+ */
+ function randomUUID(options?: RandomUUIDOptions): string;
+ interface X509CheckOptions {
+ /**
+ * @default 'always'
+ */
+ subject?: "always" | "default" | "never";
+ /**
+ * @default true
+ */
+ wildcards?: boolean;
+ /**
+ * @default true
+ */
+ partialWildcards?: boolean;
+ /**
+ * @default false
+ */
+ multiLabelWildcards?: boolean;
+ /**
+ * @default false
+ */
+ singleLabelSubdomains?: boolean;
+ }
+ /**
+ * Encapsulates an X509 certificate and provides read-only access to
+ * its information.
+ *
+ * ```js
+ * const { X509Certificate } = await import('crypto');
+ *
+ * const x509 = new X509Certificate('{... pem encoded cert ...}');
+ *
+ * console.log(x509.subject);
+ * ```
+ * @since v15.6.0
+ */
+ class X509Certificate {
+ /**
+ * Will be \`true\` if this is a Certificate Authority (CA) certificate.
+ * @since v15.6.0
+ */
+ readonly ca: boolean;
+ /**
+ * The SHA-1 fingerprint of this certificate.
+ *
+ * Because SHA-1 is cryptographically broken and because the security of SHA-1 is
+ * significantly worse than that of algorithms that are commonly used to sign
+ * certificates, consider using `x509.fingerprint256` instead.
+ * @since v15.6.0
+ */
+ readonly fingerprint: string;
+ /**
+ * The SHA-256 fingerprint of this certificate.
+ * @since v15.6.0
+ */
+ readonly fingerprint256: string;
+ /**
+ * The SHA-512 fingerprint of this certificate.
+ * @since v16.14.0
+ */
+ readonly fingerprint512: string;
+ /**
+ * The complete subject of this certificate.
+ * @since v15.6.0
+ */
+ readonly subject: string;
+ /**
+ * The subject alternative name specified for this certificate or `undefined`
+ * if not available.
+ * @since v15.6.0
+ */
+ readonly subjectAltName: string | undefined;
+ /**
+ * The information access content of this certificate or `undefined` if not
+ * available.
+ * @since v15.6.0
+ */
+ readonly infoAccess: string | undefined;
+ /**
+ * An array detailing the key usages for this certificate.
+ * @since v15.6.0
+ */
+ readonly keyUsage: string[];
+ /**
+ * The issuer identification included in this certificate.
+ * @since v15.6.0
+ */
+ readonly issuer: string;
+ /**
+ * The issuer certificate or `undefined` if the issuer certificate is not
+ * available.
+ * @since v15.9.0
+ */
+ readonly issuerCertificate?: X509Certificate | undefined;
+ /**
+ * The public key `KeyObject` for this certificate.
+ * @since v15.6.0
+ */
+ readonly publicKey: KeyObject;
+ /**
+ * A `Buffer` containing the DER encoding of this certificate.
+ * @since v15.6.0
+ */
+ readonly raw: Buffer;
+ /**
+ * The serial number of this certificate.
+ *
+ * Serial numbers are assigned by certificate authorities and do not uniquely
+ * identify certificates. Consider using `x509.fingerprint256` as a unique
+ * identifier instead.
+ * @since v15.6.0
+ */
+ readonly serialNumber: string;
+ /**
+ * The date/time from which this certificate is considered valid.
+ * @since v15.6.0
+ */
+ readonly validFrom: string;
+ /**
+ * The date/time until which this certificate is considered valid.
+ * @since v15.6.0
+ */
+ readonly validTo: string;
+ constructor(buffer: BinaryLike);
+ /**
+ * Checks whether the certificate matches the given email address.
+ *
+ * If the `'subject'` option is undefined or set to `'default'`, the certificate
+ * subject is only considered if the subject alternative name extension either does
+ * not exist or does not contain any email addresses.
+ *
+ * If the `'subject'` option is set to `'always'` and if the subject alternative
+ * name extension either does not exist or does not contain a matching email
+ * address, the certificate subject is considered.
+ *
+ * If the `'subject'` option is set to `'never'`, the certificate subject is never
+ * considered, even if the certificate contains no subject alternative names.
+ * @since v15.6.0
+ * @return Returns `email` if the certificate matches, `undefined` if it does not.
+ */
+ checkEmail(email: string, options?: Pick<X509CheckOptions, "subject">): string | undefined;
+ /**
+ * Checks whether the certificate matches the given host name.
+ *
+ * If the certificate matches the given host name, the matching subject name is
+ * returned. The returned name might be an exact match (e.g., `foo.example.com`)
+ * or it might contain wildcards (e.g., `*.example.com`). Because host name
+ * comparisons are case-insensitive, the returned subject name might also differ
+ * from the given `name` in capitalization.
+ *
+ * If the `'subject'` option is undefined or set to `'default'`, the certificate
+ * subject is only considered if the subject alternative name extension either does
+ * not exist or does not contain any DNS names. This behavior is consistent with [RFC 2818](https://www.rfc-editor.org/rfc/rfc2818.txt) ("HTTP Over TLS").
+ *
+ * If the `'subject'` option is set to `'always'` and if the subject alternative
+ * name extension either does not exist or does not contain a matching DNS name,
+ * the certificate subject is considered.
+ *
+ * If the `'subject'` option is set to `'never'`, the certificate subject is never
+ * considered, even if the certificate contains no subject alternative names.
+ * @since v15.6.0
+ * @return Returns a subject name that matches `name`, or `undefined` if no subject name matches `name`.
+ */
+ checkHost(name: string, options?: X509CheckOptions): string | undefined;
+ /**
+ * Checks whether the certificate matches the given IP address (IPv4 or IPv6).
+ *
+ * Only [RFC 5280](https://www.rfc-editor.org/rfc/rfc5280.txt) `iPAddress` subject alternative names are considered, and they
+ * must match the given `ip` address exactly. Other subject alternative names as
+ * well as the subject field of the certificate are ignored.
+ * @since v15.6.0
+ * @return Returns `ip` if the certificate matches, `undefined` if it does not.
+ */
+ checkIP(ip: string): string | undefined;
+ /**
+ * Checks whether this certificate was issued by the given `otherCert`.
+ * @since v15.6.0
+ */
+ checkIssued(otherCert: X509Certificate): boolean;
+ /**
+ * Checks whether the public key for this certificate is consistent with
+ * the given private key.
+ * @since v15.6.0
+ * @param privateKey A private key.
+ */
+ checkPrivateKey(privateKey: KeyObject): boolean;
+ /**
+ * There is no standard JSON encoding for X509 certificates. The`toJSON()` method returns a string containing the PEM encoded
+ * certificate.
+ * @since v15.6.0
+ */
+ toJSON(): string;
+ /**
+ * Returns information about this certificate using the legacy `certificate object` encoding.
+ * @since v15.6.0
+ */
+ toLegacyObject(): PeerCertificate;
+ /**
+ * Returns the PEM-encoded certificate.
+ * @since v15.6.0
+ */
+ toString(): string;
+ /**
+ * Verifies that this certificate was signed by the given public key.
+ * Does not perform any other validation checks on the certificate.
+ * @since v15.6.0
+ * @param publicKey A public key.
+ */
+ verify(publicKey: KeyObject): boolean;
+ }
+ type LargeNumberLike = NodeJS.ArrayBufferView | SharedArrayBuffer | ArrayBuffer | bigint;
+ interface GeneratePrimeOptions {
+ add?: LargeNumberLike | undefined;
+ rem?: LargeNumberLike | undefined;
+ /**
+ * @default false
+ */
+ safe?: boolean | undefined;
+ bigint?: boolean | undefined;
+ }
+ interface GeneratePrimeOptionsBigInt extends GeneratePrimeOptions {
+ bigint: true;
+ }
+ interface GeneratePrimeOptionsArrayBuffer extends GeneratePrimeOptions {
+ bigint?: false | undefined;
+ }
+ /**
+ * Generates a pseudorandom prime of `size` bits.
+ *
+ * If `options.safe` is `true`, the prime will be a safe prime -- that is,`(prime - 1) / 2` will also be a prime.
+ *
+ * The `options.add` and `options.rem` parameters can be used to enforce additional
+ * requirements, e.g., for Diffie-Hellman:
+ *
+ * * If `options.add` and `options.rem` are both set, the prime will satisfy the
+ * condition that `prime % add = rem`.
+ * * If only `options.add` is set and `options.safe` is not `true`, the prime will
+ * satisfy the condition that `prime % add = 1`.
+ * * If only `options.add` is set and `options.safe` is set to `true`, the prime
+ * will instead satisfy the condition that `prime % add = 3`. This is necessary
+ * because `prime % add = 1` for `options.add > 2` would contradict the condition
+ * enforced by `options.safe`.
+ * * `options.rem` is ignored if `options.add` is not given.
+ *
+ * Both `options.add` and `options.rem` must be encoded as big-endian sequences
+ * if given as an `ArrayBuffer`, `SharedArrayBuffer`, `TypedArray`, `Buffer`, or`DataView`.
+ *
+ * By default, the prime is encoded as a big-endian sequence of octets
+ * in an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). If the `bigint` option is `true`, then a
+ * [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) is provided.
+ * @since v15.8.0
+ * @param size The size (in bits) of the prime to generate.
+ */
+ function generatePrime(size: number, callback: (err: Error | null, prime: ArrayBuffer) => void): void;
+ function generatePrime(
+ size: number,
+ options: GeneratePrimeOptionsBigInt,
+ callback: (err: Error | null, prime: bigint) => void,
+ ): void;
+ function generatePrime(
+ size: number,
+ options: GeneratePrimeOptionsArrayBuffer,
+ callback: (err: Error | null, prime: ArrayBuffer) => void,
+ ): void;
+ function generatePrime(
+ size: number,
+ options: GeneratePrimeOptions,
+ callback: (err: Error | null, prime: ArrayBuffer | bigint) => void,
+ ): void;
+ /**
+ * Generates a pseudorandom prime of `size` bits.
+ *
+ * If `options.safe` is `true`, the prime will be a safe prime -- that is,`(prime - 1) / 2` will also be a prime.
+ *
+ * The `options.add` and `options.rem` parameters can be used to enforce additional
+ * requirements, e.g., for Diffie-Hellman:
+ *
+ * * If `options.add` and `options.rem` are both set, the prime will satisfy the
+ * condition that `prime % add = rem`.
+ * * If only `options.add` is set and `options.safe` is not `true`, the prime will
+ * satisfy the condition that `prime % add = 1`.
+ * * If only `options.add` is set and `options.safe` is set to `true`, the prime
+ * will instead satisfy the condition that `prime % add = 3`. This is necessary
+ * because `prime % add = 1` for `options.add > 2` would contradict the condition
+ * enforced by `options.safe`.
+ * * `options.rem` is ignored if `options.add` is not given.
+ *
+ * Both `options.add` and `options.rem` must be encoded as big-endian sequences
+ * if given as an `ArrayBuffer`, `SharedArrayBuffer`, `TypedArray`, `Buffer`, or`DataView`.
+ *
+ * By default, the prime is encoded as a big-endian sequence of octets
+ * in an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). If the `bigint` option is `true`, then a
+ * [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) is provided.
+ * @since v15.8.0
+ * @param size The size (in bits) of the prime to generate.
+ */
+ function generatePrimeSync(size: number): ArrayBuffer;
+ function generatePrimeSync(size: number, options: GeneratePrimeOptionsBigInt): bigint;
+ function generatePrimeSync(size: number, options: GeneratePrimeOptionsArrayBuffer): ArrayBuffer;
+ function generatePrimeSync(size: number, options: GeneratePrimeOptions): ArrayBuffer | bigint;
+ interface CheckPrimeOptions {
+ /**
+ * The number of Miller-Rabin probabilistic primality iterations to perform.
+ * When the value is 0 (zero), a number of checks is used that yields a false positive rate of at most `2**-64` for random input.
+ * Care must be used when selecting a number of checks.
+ * Refer to the OpenSSL documentation for the BN_is_prime_ex function nchecks options for more details.
+ *
+ * @default 0
+ */
+ checks?: number | undefined;
+ }
+ /**
+ * Checks the primality of the `candidate`.
+ * @since v15.8.0
+ * @param candidate A possible prime encoded as a sequence of big endian octets of arbitrary length.
+ */
+ function checkPrime(value: LargeNumberLike, callback: (err: Error | null, result: boolean) => void): void;
+ function checkPrime(
+ value: LargeNumberLike,
+ options: CheckPrimeOptions,
+ callback: (err: Error | null, result: boolean) => void,
+ ): void;
+ /**
+ * Checks the primality of the `candidate`.
+ * @since v15.8.0
+ * @param candidate A possible prime encoded as a sequence of big endian octets of arbitrary length.
+ * @return `true` if the candidate is a prime with an error probability less than `0.25 ** options.checks`.
+ */
+ function checkPrimeSync(candidate: LargeNumberLike, options?: CheckPrimeOptions): boolean;
+ /**
+ * Load and set the `engine` for some or all OpenSSL functions (selected by flags).
+ *
+ * `engine` could be either an id or a path to the engine's shared library.
+ *
+ * The optional `flags` argument uses `ENGINE_METHOD_ALL` by default.
+ * The `flags` is a bit field taking one of or a mix of the following flags (defined in `crypto.constants`):
+ *
+ * - `crypto.constants.ENGINE_METHOD_RSA`
+ * - `crypto.constants.ENGINE_METHOD_DSA`
+ * - `crypto.constants.ENGINE_METHOD_DH`
+ * - `crypto.constants.ENGINE_METHOD_RAND`
+ * - `crypto.constants.ENGINE_METHOD_EC`
+ * - `crypto.constants.ENGINE_METHOD_CIPHERS`
+ * - `crypto.constants.ENGINE_METHOD_DIGESTS`
+ * - `crypto.constants.ENGINE_METHOD_PKEY_METHS`
+ * - `crypto.constants.ENGINE_METHOD_PKEY_ASN1_METHS`
+ * - `crypto.constants.ENGINE_METHOD_ALL`
+ * - `crypto.constants.ENGINE_METHOD_NONE`
+ *
+ * The flags below are deprecated in OpenSSL-1.1.0.
+ *
+ * - `crypto.constants.ENGINE_METHOD_ECDH`
+ * - `crypto.constants.ENGINE_METHOD_ECDSA`
+ * - `crypto.constants.ENGINE_METHOD_STORE`
+ * @since v0.11.11
+ * @param [flags=crypto.constants.ENGINE_METHOD_ALL]
+ */
+ function setEngine(engine: string, flags?: number): void;
+ /**
+ * A convenient alias for `crypto.webcrypto.getRandomValues()`.
+ * This implementation is not compliant with the Web Crypto spec,
+ * to write web-compatible code use `crypto.webcrypto.getRandomValues()` instead.
+ * @since v17.4.0
+ * @returns Returns `typedArray`.
+ */
+ function getRandomValues<T extends webcrypto.BufferSource>(typedArray: T): T;
+ /**
+ * A convenient alias for `crypto.webcrypto.subtle`.
+ * @since v17.4.0
+ */
+ const subtle: webcrypto.SubtleCrypto;
+ /**
+ * An implementation of the Web Crypto API standard.
+ *
+ * See the {@link https://nodejs.org/docs/latest/api/webcrypto.html Web Crypto API documentation} for details.
+ * @since v15.0.0
+ */
+ const webcrypto: webcrypto.Crypto;
+ namespace webcrypto {
+ type BufferSource = ArrayBufferView | ArrayBuffer;
+ type KeyFormat = "jwk" | "pkcs8" | "raw" | "spki";
+ type KeyType = "private" | "public" | "secret";
+ type KeyUsage =
+ | "decrypt"
+ | "deriveBits"
+ | "deriveKey"
+ | "encrypt"
+ | "sign"
+ | "unwrapKey"
+ | "verify"
+ | "wrapKey";
+ type AlgorithmIdentifier = Algorithm | string;
+ type HashAlgorithmIdentifier = AlgorithmIdentifier;
+ type NamedCurve = string;
+ type BigInteger = Uint8Array;
+ interface AesCbcParams extends Algorithm {
+ iv: BufferSource;
+ }
+ interface AesCtrParams extends Algorithm {
+ counter: BufferSource;
+ length: number;
+ }
+ interface AesDerivedKeyParams extends Algorithm {
+ length: number;
+ }
+ interface AesGcmParams extends Algorithm {
+ additionalData?: BufferSource;
+ iv: BufferSource;
+ tagLength?: number;
+ }
+ interface AesKeyAlgorithm extends KeyAlgorithm {
+ length: number;
+ }
+ interface AesKeyGenParams extends Algorithm {
+ length: number;
+ }
+ interface Algorithm {
+ name: string;
+ }
+ interface EcKeyAlgorithm extends KeyAlgorithm {
+ namedCurve: NamedCurve;
+ }
+ interface EcKeyGenParams extends Algorithm {
+ namedCurve: NamedCurve;
+ }
+ interface EcKeyImportParams extends Algorithm {
+ namedCurve: NamedCurve;
+ }
+ interface EcdhKeyDeriveParams extends Algorithm {
+ public: CryptoKey;
+ }
+ interface EcdsaParams extends Algorithm {
+ hash: HashAlgorithmIdentifier;
+ }
+ interface Ed448Params extends Algorithm {
+ context?: BufferSource;
+ }
+ interface HkdfParams extends Algorithm {
+ hash: HashAlgorithmIdentifier;
+ info: BufferSource;
+ salt: BufferSource;
+ }
+ interface HmacImportParams extends Algorithm {
+ hash: HashAlgorithmIdentifier;
+ length?: number;
+ }
+ interface HmacKeyAlgorithm extends KeyAlgorithm {
+ hash: KeyAlgorithm;
+ length: number;
+ }
+ interface HmacKeyGenParams extends Algorithm {
+ hash: HashAlgorithmIdentifier;
+ length?: number;
+ }
+ interface JsonWebKey {
+ alg?: string;
+ crv?: string;
+ d?: string;
+ dp?: string;
+ dq?: string;
+ e?: string;
+ ext?: boolean;
+ k?: string;
+ key_ops?: string[];
+ kty?: string;
+ n?: string;
+ oth?: RsaOtherPrimesInfo[];
+ p?: string;
+ q?: string;
+ qi?: string;
+ use?: string;
+ x?: string;
+ y?: string;
+ }
+ interface KeyAlgorithm {
+ name: string;
+ }
+ interface Pbkdf2Params extends Algorithm {
+ hash: HashAlgorithmIdentifier;
+ iterations: number;
+ salt: BufferSource;
+ }
+ interface RsaHashedImportParams extends Algorithm {
+ hash: HashAlgorithmIdentifier;
+ }
+ interface RsaHashedKeyAlgorithm extends RsaKeyAlgorithm {
+ hash: KeyAlgorithm;
+ }
+ interface RsaHashedKeyGenParams extends RsaKeyGenParams {
+ hash: HashAlgorithmIdentifier;
+ }
+ interface RsaKeyAlgorithm extends KeyAlgorithm {
+ modulusLength: number;
+ publicExponent: BigInteger;
+ }
+ interface RsaKeyGenParams extends Algorithm {
+ modulusLength: number;
+ publicExponent: BigInteger;
+ }
+ interface RsaOaepParams extends Algorithm {
+ label?: BufferSource;
+ }
+ interface RsaOtherPrimesInfo {
+ d?: string;
+ r?: string;
+ t?: string;
+ }
+ interface RsaPssParams extends Algorithm {
+ saltLength: number;
+ }
+ /**
+ * Calling `require('node:crypto').webcrypto` returns an instance of the `Crypto` class.
+ * `Crypto` is a singleton that provides access to the remainder of the crypto API.
+ * @since v15.0.0
+ */
+ interface Crypto {
+ /**
+ * Provides access to the `SubtleCrypto` API.
+ * @since v15.0.0
+ */
+ readonly subtle: SubtleCrypto;
+ /**
+ * Generates cryptographically strong random values.
+ * The given `typedArray` is filled with random values, and a reference to `typedArray` is returned.
+ *
+ * The given `typedArray` must be an integer-based instance of {@link NodeJS.TypedArray}, i.e. `Float32Array` and `Float64Array` are not accepted.
+ *
+ * An error will be thrown if the given `typedArray` is larger than 65,536 bytes.
+ * @since v15.0.0
+ */
+ getRandomValues<T extends Exclude<NodeJS.TypedArray, Float32Array | Float64Array>>(typedArray: T): T;
+ /**
+ * Generates a random {@link https://www.rfc-editor.org/rfc/rfc4122.txt RFC 4122} version 4 UUID.
+ * The UUID is generated using a cryptographic pseudorandom number generator.
+ * @since v16.7.0
+ */
+ randomUUID(): string;
+ CryptoKey: CryptoKeyConstructor;
+ }
+ // This constructor throws ILLEGAL_CONSTRUCTOR so it should not be newable.
+ interface CryptoKeyConstructor {
+ /** Illegal constructor */
+ (_: { readonly _: unique symbol }): never; // Allows instanceof to work but not be callable by the user.
+ readonly length: 0;
+ readonly name: "CryptoKey";
+ readonly prototype: CryptoKey;
+ }
+ /**
+ * @since v15.0.0
+ */
+ interface CryptoKey {
+ /**
+ * An object detailing the algorithm for which the key can be used along with additional algorithm-specific parameters.
+ * @since v15.0.0
+ */
+ readonly algorithm: KeyAlgorithm;
+ /**
+ * When `true`, the {@link CryptoKey} can be extracted using either `subtleCrypto.exportKey()` or `subtleCrypto.wrapKey()`.
+ * @since v15.0.0
+ */
+ readonly extractable: boolean;
+ /**
+ * A string identifying whether the key is a symmetric (`'secret'`) or asymmetric (`'private'` or `'public'`) key.
+ * @since v15.0.0
+ */
+ readonly type: KeyType;
+ /**
+ * An array of strings identifying the operations for which the key may be used.
+ *
+ * The possible usages are:
+ * - `'encrypt'` - The key may be used to encrypt data.
+ * - `'decrypt'` - The key may be used to decrypt data.
+ * - `'sign'` - The key may be used to generate digital signatures.
+ * - `'verify'` - The key may be used to verify digital signatures.
+ * - `'deriveKey'` - The key may be used to derive a new key.
+ * - `'deriveBits'` - The key may be used to derive bits.
+ * - `'wrapKey'` - The key may be used to wrap another key.
+ * - `'unwrapKey'` - The key may be used to unwrap another key.
+ *
+ * Valid key usages depend on the key algorithm (identified by `cryptokey.algorithm.name`).
+ * @since v15.0.0
+ */
+ readonly usages: KeyUsage[];
+ }
+ /**
+ * The `CryptoKeyPair` is a simple dictionary object with `publicKey` and `privateKey` properties, representing an asymmetric key pair.
+ * @since v15.0.0
+ */
+ interface CryptoKeyPair {
+ /**
+ * A {@link CryptoKey} whose type will be `'private'`.
+ * @since v15.0.0
+ */
+ privateKey: CryptoKey;
+ /**
+ * A {@link CryptoKey} whose type will be `'public'`.
+ * @since v15.0.0
+ */
+ publicKey: CryptoKey;
+ }
+ /**
+ * @since v15.0.0
+ */
+ interface SubtleCrypto {
+ /**
+ * Using the method and parameters specified in `algorithm` and the keying material provided by `key`,
+ * `subtle.decrypt()` attempts to decipher the provided `data`. If successful,
+ * the returned promise will be resolved with an `<ArrayBuffer>` containing the plaintext result.
+ *
+ * The algorithms currently supported include:
+ *
+ * - `'RSA-OAEP'`
+ * - `'AES-CTR'`
+ * - `'AES-CBC'`
+ * - `'AES-GCM'`
+ * @since v15.0.0
+ */
+ decrypt(
+ algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams,
+ key: CryptoKey,
+ data: BufferSource,
+ ): Promise<ArrayBuffer>;
+ /**
+ * Using the method and parameters specified in `algorithm` and the keying material provided by `baseKey`,
+ * `subtle.deriveBits()` attempts to generate `length` bits.
+ * The Node.js implementation requires that when `length` is a number it must be multiple of `8`.
+ * When `length` is `null` the maximum number of bits for a given algorithm is generated. This is allowed
+ * for the `'ECDH'`, `'X25519'`, and `'X448'` algorithms.
+ * If successful, the returned promise will be resolved with an `<ArrayBuffer>` containing the generated data.
+ *
+ * The algorithms currently supported include:
+ *
+ * - `'ECDH'`
+ * - `'X25519'`
+ * - `'X448'`
+ * - `'HKDF'`
+ * - `'PBKDF2'`
+ * @since v15.0.0
+ */
+ deriveBits(algorithm: EcdhKeyDeriveParams, baseKey: CryptoKey, length: number | null): Promise<ArrayBuffer>;
+ deriveBits(
+ algorithm: AlgorithmIdentifier | HkdfParams | Pbkdf2Params,
+ baseKey: CryptoKey,
+ length: number,
+ ): Promise<ArrayBuffer>;
+ /**
+ * Using the method and parameters specified in `algorithm`, and the keying material provided by `baseKey`,
+ * `subtle.deriveKey()` attempts to generate a new <CryptoKey>` based on the method and parameters in `derivedKeyAlgorithm`.
+ *
+ * Calling `subtle.deriveKey()` is equivalent to calling `subtle.deriveBits()` to generate raw keying material,
+ * then passing the result into the `subtle.importKey()` method using the `deriveKeyAlgorithm`, `extractable`, and `keyUsages` parameters as input.
+ *
+ * The algorithms currently supported include:
+ *
+ * - `'ECDH'`
+ * - `'X25519'`
+ * - `'X448'`
+ * - `'HKDF'`
+ * - `'PBKDF2'`
+ * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}.
+ * @since v15.0.0
+ */
+ deriveKey(
+ algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params,
+ baseKey: CryptoKey,
+ derivedKeyAlgorithm:
+ | AlgorithmIdentifier
+ | AesDerivedKeyParams
+ | HmacImportParams
+ | HkdfParams
+ | Pbkdf2Params,
+ extractable: boolean,
+ keyUsages: readonly KeyUsage[],
+ ): Promise<CryptoKey>;
+ /**
+ * Using the method identified by `algorithm`, `subtle.digest()` attempts to generate a digest of `data`.
+ * If successful, the returned promise is resolved with an `<ArrayBuffer>` containing the computed digest.
+ *
+ * If `algorithm` is provided as a `<string>`, it must be one of:
+ *
+ * - `'SHA-1'`
+ * - `'SHA-256'`
+ * - `'SHA-384'`
+ * - `'SHA-512'`
+ *
+ * If `algorithm` is provided as an `<Object>`, it must have a `name` property whose value is one of the above.
+ * @since v15.0.0
+ */
+ digest(algorithm: AlgorithmIdentifier, data: BufferSource): Promise<ArrayBuffer>;
+ /**
+ * Using the method and parameters specified by `algorithm` and the keying material provided by `key`,
+ * `subtle.encrypt()` attempts to encipher `data`. If successful,
+ * the returned promise is resolved with an `<ArrayBuffer>` containing the encrypted result.
+ *
+ * The algorithms currently supported include:
+ *
+ * - `'RSA-OAEP'`
+ * - `'AES-CTR'`
+ * - `'AES-CBC'`
+ * - `'AES-GCM'`
+ * @since v15.0.0
+ */
+ encrypt(
+ algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams,
+ key: CryptoKey,
+ data: BufferSource,
+ ): Promise<ArrayBuffer>;
+ /**
+ * Exports the given key into the specified format, if supported.
+ *
+ * If the `<CryptoKey>` is not extractable, the returned promise will reject.
+ *
+ * When `format` is either `'pkcs8'` or `'spki'` and the export is successful,
+ * the returned promise will be resolved with an `<ArrayBuffer>` containing the exported key data.
+ *
+ * When `format` is `'jwk'` and the export is successful, the returned promise will be resolved with a
+ * JavaScript object conforming to the {@link https://tools.ietf.org/html/rfc7517 JSON Web Key} specification.
+ * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`.
+ * @returns `<Promise>` containing `<ArrayBuffer>`.
+ * @since v15.0.0
+ */
+ exportKey(format: "jwk", key: CryptoKey): Promise<JsonWebKey>;
+ exportKey(format: Exclude<KeyFormat, "jwk">, key: CryptoKey): Promise<ArrayBuffer>;
+ /**
+ * Using the method and parameters provided in `algorithm`,
+ * `subtle.generateKey()` attempts to generate new keying material.
+ * Depending the method used, the method may generate either a single `<CryptoKey>` or a `<CryptoKeyPair>`.
+ *
+ * The `<CryptoKeyPair>` (public and private key) generating algorithms supported include:
+ *
+ * - `'RSASSA-PKCS1-v1_5'`
+ * - `'RSA-PSS'`
+ * - `'RSA-OAEP'`
+ * - `'ECDSA'`
+ * - `'Ed25519'`
+ * - `'Ed448'`
+ * - `'ECDH'`
+ * - `'X25519'`
+ * - `'X448'`
+ * The `<CryptoKey>` (secret key) generating algorithms supported include:
+ *
+ * - `'HMAC'`
+ * - `'AES-CTR'`
+ * - `'AES-CBC'`
+ * - `'AES-GCM'`
+ * - `'AES-KW'`
+ * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}.
+ * @since v15.0.0
+ */
+ generateKey(
+ algorithm: RsaHashedKeyGenParams | EcKeyGenParams,
+ extractable: boolean,
+ keyUsages: readonly KeyUsage[],
+ ): Promise<CryptoKeyPair>;
+ generateKey(
+ algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params,
+ extractable: boolean,
+ keyUsages: readonly KeyUsage[],
+ ): Promise<CryptoKey>;
+ generateKey(
+ algorithm: AlgorithmIdentifier,
+ extractable: boolean,
+ keyUsages: KeyUsage[],
+ ): Promise<CryptoKeyPair | CryptoKey>;
+ /**
+ * The `subtle.importKey()` method attempts to interpret the provided `keyData` as the given `format`
+ * to create a `<CryptoKey>` instance using the provided `algorithm`, `extractable`, and `keyUsages` arguments.
+ * If the import is successful, the returned promise will be resolved with the created `<CryptoKey>`.
+ *
+ * If importing a `'PBKDF2'` key, `extractable` must be `false`.
+ * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`.
+ * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}.
+ * @since v15.0.0
+ */
+ importKey(
+ format: "jwk",
+ keyData: JsonWebKey,
+ algorithm:
+ | AlgorithmIdentifier
+ | RsaHashedImportParams
+ | EcKeyImportParams
+ | HmacImportParams
+ | AesKeyAlgorithm,
+ extractable: boolean,
+ keyUsages: readonly KeyUsage[],
+ ): Promise<CryptoKey>;
+ importKey(
+ format: Exclude<KeyFormat, "jwk">,
+ keyData: BufferSource,
+ algorithm:
+ | AlgorithmIdentifier
+ | RsaHashedImportParams
+ | EcKeyImportParams
+ | HmacImportParams
+ | AesKeyAlgorithm,
+ extractable: boolean,
+ keyUsages: KeyUsage[],
+ ): Promise<CryptoKey>;
+ /**
+ * Using the method and parameters given by `algorithm` and the keying material provided by `key`,
+ * `subtle.sign()` attempts to generate a cryptographic signature of `data`. If successful,
+ * the returned promise is resolved with an `<ArrayBuffer>` containing the generated signature.
+ *
+ * The algorithms currently supported include:
+ *
+ * - `'RSASSA-PKCS1-v1_5'`
+ * - `'RSA-PSS'`
+ * - `'ECDSA'`
+ * - `'Ed25519'`
+ * - `'Ed448'`
+ * - `'HMAC'`
+ * @since v15.0.0
+ */
+ sign(
+ algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | Ed448Params,
+ key: CryptoKey,
+ data: BufferSource,
+ ): Promise<ArrayBuffer>;
+ /**
+ * In cryptography, "wrapping a key" refers to exporting and then encrypting the keying material.
+ * The `subtle.unwrapKey()` method attempts to decrypt a wrapped key and create a `<CryptoKey>` instance.
+ * It is equivalent to calling `subtle.decrypt()` first on the encrypted key data (using the `wrappedKey`, `unwrapAlgo`, and `unwrappingKey` arguments as input)
+ * then passing the results in to the `subtle.importKey()` method using the `unwrappedKeyAlgo`, `extractable`, and `keyUsages` arguments as inputs.
+ * If successful, the returned promise is resolved with a `<CryptoKey>` object.
+ *
+ * The wrapping algorithms currently supported include:
+ *
+ * - `'RSA-OAEP'`
+ * - `'AES-CTR'`
+ * - `'AES-CBC'`
+ * - `'AES-GCM'`
+ * - `'AES-KW'`
+ *
+ * The unwrapped key algorithms supported include:
+ *
+ * - `'RSASSA-PKCS1-v1_5'`
+ * - `'RSA-PSS'`
+ * - `'RSA-OAEP'`
+ * - `'ECDSA'`
+ * - `'Ed25519'`
+ * - `'Ed448'`
+ * - `'ECDH'`
+ * - `'X25519'`
+ * - `'X448'`
+ * - `'HMAC'`
+ * - `'AES-CTR'`
+ * - `'AES-CBC'`
+ * - `'AES-GCM'`
+ * - `'AES-KW'`
+ * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`.
+ * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}.
+ * @since v15.0.0
+ */
+ unwrapKey(
+ format: KeyFormat,
+ wrappedKey: BufferSource,
+ unwrappingKey: CryptoKey,
+ unwrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams,
+ unwrappedKeyAlgorithm:
+ | AlgorithmIdentifier
+ | RsaHashedImportParams
+ | EcKeyImportParams
+ | HmacImportParams
+ | AesKeyAlgorithm,
+ extractable: boolean,
+ keyUsages: KeyUsage[],
+ ): Promise<CryptoKey>;
+ /**
+ * Using the method and parameters given in `algorithm` and the keying material provided by `key`,
+ * `subtle.verify()` attempts to verify that `signature` is a valid cryptographic signature of `data`.
+ * The returned promise is resolved with either `true` or `false`.
+ *
+ * The algorithms currently supported include:
+ *
+ * - `'RSASSA-PKCS1-v1_5'`
+ * - `'RSA-PSS'`
+ * - `'ECDSA'`
+ * - `'Ed25519'`
+ * - `'Ed448'`
+ * - `'HMAC'`
+ * @since v15.0.0
+ */
+ verify(
+ algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | Ed448Params,
+ key: CryptoKey,
+ signature: BufferSource,
+ data: BufferSource,
+ ): Promise<boolean>;
+ /**
+ * In cryptography, "wrapping a key" refers to exporting and then encrypting the keying material.
+ * The `subtle.wrapKey()` method exports the keying material into the format identified by `format`,
+ * then encrypts it using the method and parameters specified by `wrapAlgo` and the keying material provided by `wrappingKey`.
+ * It is the equivalent to calling `subtle.exportKey()` using `format` and `key` as the arguments,
+ * then passing the result to the `subtle.encrypt()` method using `wrappingKey` and `wrapAlgo` as inputs.
+ * If successful, the returned promise will be resolved with an `<ArrayBuffer>` containing the encrypted key data.
+ *
+ * The wrapping algorithms currently supported include:
+ *
+ * - `'RSA-OAEP'`
+ * - `'AES-CTR'`
+ * - `'AES-CBC'`
+ * - `'AES-GCM'`
+ * - `'AES-KW'`
+ * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`.
+ * @since v15.0.0
+ */
+ wrapKey(
+ format: KeyFormat,
+ key: CryptoKey,
+ wrappingKey: CryptoKey,
+ wrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams,
+ ): Promise<ArrayBuffer>;
+ }
+ }
+}
+declare module "node:crypto" {
+ export * from "crypto";
+}
diff --git a/client/node_modules/@types/node/ts4.8/dgram.d.ts b/client/node_modules/@types/node/ts4.8/dgram.d.ts
new file mode 100644
index 0000000..c50162c
--- /dev/null
+++ b/client/node_modules/@types/node/ts4.8/dgram.d.ts
@@ -0,0 +1,586 @@
+/**
+ * The `dgram` module provides an implementation of UDP datagram sockets.
+ *
+ * ```js
+ * import dgram from 'dgram';
+ *
+ * const server = dgram.createSocket('udp4');
+ *
+ * server.on('error', (err) => {
+ * console.log(`server error:\n${err.stack}`);
+ * server.close();
+ * });
+ *
+ * server.on('message', (msg, rinfo) => {
+ * console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`);
+ * });
+ *
+ * server.on('listening', () => {
+ * const address = server.address();
+ * console.log(`server listening ${address.address}:${address.port}`);
+ * });
+ *
+ * server.bind(41234);
+ * // Prints: server listening 0.0.0.0:41234
+ * ```
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/dgram.js)
+ */
+declare module "dgram" {
+ import { AddressInfo } from "node:net";
+ import * as dns from "node:dns";
+ import { Abortable, EventEmitter } from "node:events";
+ interface RemoteInfo {
+ address: string;
+ family: "IPv4" | "IPv6";
+ port: number;
+ size: number;
+ }
+ interface BindOptions {
+ port?: number | undefined;
+ address?: string | undefined;
+ exclusive?: boolean | undefined;
+ fd?: number | undefined;
+ }
+ type SocketType = "udp4" | "udp6";
+ interface SocketOptions extends Abortable {
+ type: SocketType;
+ reuseAddr?: boolean | undefined;
+ /**
+ * @default false
+ */
+ ipv6Only?: boolean | undefined;
+ recvBufferSize?: number | undefined;
+ sendBufferSize?: number | undefined;
+ lookup?:
+ | ((
+ 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
+ * messages. When `address` and `port` are not passed to `socket.bind()` the
+ * method will bind the socket to the "all interfaces" address on a random port
+ * (it does the right thing for both `udp4` and `udp6` sockets). The bound address
+ * and port can be retrieved using `socket.address().address` and `socket.address().port`.
+ *
+ * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.close()` on the socket:
+ *
+ * ```js
+ * const controller = new AbortController();
+ * const { signal } = controller;
+ * const server = dgram.createSocket({ type: 'udp4', signal });
+ * server.on('message', (msg, rinfo) => {
+ * console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`);
+ * });
+ * // Later, when you want to close the server.
+ * controller.abort();
+ * ```
+ * @since v0.11.13
+ * @param options Available options are:
+ * @param callback Attached as a listener for `'message'` events. Optional.
+ */
+ function createSocket(type: SocketType, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket;
+ function createSocket(options: SocketOptions, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket;
+ /**
+ * Encapsulates the datagram functionality.
+ *
+ * New instances of `dgram.Socket` are created using {@link createSocket}.
+ * The `new` keyword is not to be used to create `dgram.Socket` instances.
+ * @since v0.1.99
+ */
+ class Socket extends EventEmitter {
+ /**
+ * Tells the kernel to join a multicast group at the given `multicastAddress` and`multicastInterface` using the `IP_ADD_MEMBERSHIP` socket option. If the`multicastInterface` argument is not
+ * specified, the operating system will choose
+ * one interface and will add membership to it. To add membership to every
+ * available interface, call `addMembership` multiple times, once per interface.
+ *
+ * When called on an unbound socket, this method will implicitly bind to a random
+ * port, listening on all interfaces.
+ *
+ * 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
+ * import cluster from 'cluster';
+ * import dgram from 'dgram';
+ *
+ * if (cluster.isPrimary) {
+ * cluster.fork(); // Works ok.
+ * cluster.fork(); // Fails with EADDRINUSE.
+ * } else {
+ * const s = dgram.createSocket('udp4');
+ * s.bind(1234, () => {
+ * s.addMembership('224.0.0.114');
+ * });
+ * }
+ * ```
+ * @since v0.6.9
+ */
+ addMembership(multicastAddress: string, multicastInterface?: string): void;
+ /**
+ * Returns an object containing the address information for a socket.
+ * For UDP sockets, this object will contain `address`, `family` and `port`properties.
+ *
+ * This method throws `EBADF` if called on an unbound socket.
+ * @since v0.1.99
+ */
+ address(): AddressInfo;
+ /**
+ * For UDP sockets, causes the `dgram.Socket` to listen for datagram
+ * messages on a named `port` and optional `address`. If `port` is not
+ * specified or is `0`, the operating system will attempt to bind to a
+ * random port. If `address` is not specified, the operating system will
+ * attempt to listen on all addresses. Once binding is complete, a`'listening'` event is emitted and the optional `callback` function is
+ * called.
+ *
+ * Specifying both a `'listening'` event listener and passing a`callback` to the `socket.bind()` method is not harmful but not very
+ * useful.
+ *
+ * A bound datagram socket keeps the Node.js process running to receive
+ * datagram messages.
+ *
+ * If binding fails, an `'error'` event is generated. In rare case (e.g.
+ * attempting to bind with a closed socket), an `Error` may be thrown.
+ *
+ * Example of a UDP server listening on port 41234:
+ *
+ * ```js
+ * import dgram from 'dgram';
+ *
+ * const server = dgram.createSocket('udp4');
+ *
+ * server.on('error', (err) => {
+ * console.log(`server error:\n${err.stack}`);
+ * server.close();
+ * });
+ *
+ * server.on('message', (msg, rinfo) => {
+ * console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`);
+ * });
+ *
+ * server.on('listening', () => {
+ * const address = server.address();
+ * console.log(`server listening ${address.address}:${address.port}`);
+ * });
+ *
+ * server.bind(41234);
+ * // Prints: server listening 0.0.0.0:41234
+ * ```
+ * @since v0.1.99
+ * @param callback with no parameters. Called when binding is complete.
+ */
+ bind(port?: number, address?: string, callback?: () => void): this;
+ bind(port?: number, callback?: () => void): this;
+ bind(callback?: () => void): this;
+ bind(options: BindOptions, callback?: () => void): this;
+ /**
+ * Close the underlying socket and stop listening for data on it. If a callback is
+ * provided, it is added as a listener for the `'close'` event.
+ * @since v0.1.99
+ * @param callback Called when the socket has been closed.
+ */
+ close(callback?: () => void): this;
+ /**
+ * Associates the `dgram.Socket` to a remote address and port. Every
+ * message sent by this handle is automatically sent to that destination. Also,
+ * the socket will only receive messages from that remote peer.
+ * Trying to call `connect()` on an already connected socket will result
+ * in an `ERR_SOCKET_DGRAM_IS_CONNECTED` exception. If `address` is not
+ * provided, `'127.0.0.1'` (for `udp4` sockets) or `'::1'` (for `udp6` sockets)
+ * will be used by default. Once the connection is complete, a `'connect'` event
+ * is emitted and the optional `callback` function is called. In case of failure,
+ * the `callback` is called or, failing this, an `'error'` event is emitted.
+ * @since v12.0.0
+ * @param callback Called when the connection is completed or on error.
+ */
+ connect(port: number, address?: string, callback?: () => void): void;
+ connect(port: number, callback: () => void): void;
+ /**
+ * A synchronous function that disassociates a connected `dgram.Socket` from
+ * its remote address. Trying to call `disconnect()` on an unbound or already
+ * disconnected socket will result in an `ERR_SOCKET_DGRAM_NOT_CONNECTED` exception.
+ * @since v12.0.0
+ */
+ disconnect(): void;
+ /**
+ * Instructs the kernel to leave a multicast group at `multicastAddress` using the`IP_DROP_MEMBERSHIP` socket option. This method is automatically called by the
+ * kernel when the socket is closed or the process terminates, so most apps will
+ * never have reason to call this.
+ *
+ * If `multicastInterface` is not specified, the operating system will attempt to
+ * drop membership on all valid interfaces.
+ * @since v0.6.9
+ */
+ dropMembership(multicastAddress: string, multicastInterface?: string): void;
+ /**
+ * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket.
+ * @since v8.7.0
+ * @return the `SO_RCVBUF` socket receive buffer size in bytes.
+ */
+ getRecvBufferSize(): number;
+ /**
+ * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket.
+ * @since v8.7.0
+ * @return the `SO_SNDBUF` socket send buffer size in bytes.
+ */
+ getSendBufferSize(): number;
+ /**
+ * By default, binding a socket will cause it to block the Node.js process from
+ * exiting as long as the socket is open. The `socket.unref()` method can be used
+ * to exclude the socket from the reference counting that keeps the Node.js
+ * process active. The `socket.ref()` method adds the socket back to the reference
+ * counting and restores the default behavior.
+ *
+ * Calling `socket.ref()` multiples times will have no additional effect.
+ *
+ * The `socket.ref()` method returns a reference to the socket so calls can be
+ * chained.
+ * @since v0.9.1
+ */
+ ref(): this;
+ /**
+ * Returns an object containing the `address`, `family`, and `port` of the remote
+ * endpoint. This method throws an `ERR_SOCKET_DGRAM_NOT_CONNECTED` exception
+ * if the socket is not connected.
+ * @since v12.0.0
+ */
+ remoteAddress(): AddressInfo;
+ /**
+ * Broadcasts a datagram on the socket.
+ * For connectionless sockets, the destination `port` and `address` must be
+ * specified. Connected sockets, on the other hand, will use their associated
+ * remote endpoint, so the `port` and `address` arguments must not be set.
+ *
+ * The `msg` argument contains the message to be sent.
+ * Depending on its type, different behavior can apply. If `msg` is a `Buffer`,
+ * any `TypedArray` or a `DataView`,
+ * the `offset` and `length` specify the offset within the `Buffer` where the
+ * message begins and the number of bytes in the message, respectively.
+ * If `msg` is a `String`, then it is automatically converted to a `Buffer`with `'utf8'` encoding. With messages that
+ * contain multi-byte characters, `offset` and `length` will be calculated with
+ * respect to `byte length` and not the character position.
+ * If `msg` is an array, `offset` and `length` must not be specified.
+ *
+ * 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
+ * provided or otherwise nullish, `'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
+ * is assigned a random port number and is bound to the "all interfaces" address
+ * (`'0.0.0.0'` for `udp4` sockets, `'::0'` for `udp6` sockets.)
+ *
+ * An optional `callback` function may be specified to as a way of reporting
+ * DNS errors or for determining when it is safe to reuse the `buf` object.
+ * DNS lookups delay the time to send for at least one tick of the
+ * Node.js event loop.
+ *
+ * The only way to know for sure that the datagram has been sent is by using a`callback`. If an error occurs and a `callback` is given, the error will be
+ * passed as the first argument to the `callback`. If a `callback` is not given,
+ * the error is emitted as an `'error'` event on the `socket` object.
+ *
+ * Offset and length are optional but both _must_ be set if either are used.
+ * They are supported only when the first argument is a `Buffer`, a `TypedArray`,
+ * or a `DataView`.
+ *
+ * This method throws `ERR_SOCKET_BAD_PORT` if called on an unbound socket.
+ *
+ * Example of sending a UDP packet to a port on `localhost`;
+ *
+ * ```js
+ * import dgram from 'dgram';
+ * import { Buffer } from 'buffer';
+ *
+ * const message = Buffer.from('Some bytes');
+ * const client = dgram.createSocket('udp4');
+ * client.send(message, 41234, 'localhost', (err) => {
+ * client.close();
+ * });
+ * ```
+ *
+ * Example of sending a UDP packet composed of multiple buffers to a port on`127.0.0.1`;
+ *
+ * ```js
+ * import dgram from 'dgram';
+ * import { Buffer } from 'buffer';
+ *
+ * const buf1 = Buffer.from('Some ');
+ * const buf2 = Buffer.from('bytes');
+ * const client = dgram.createSocket('udp4');
+ * client.send([buf1, buf2], 41234, (err) => {
+ * client.close();
+ * });
+ * ```
+ *
+ * Sending multiple buffers might be faster or slower depending on the
+ * application and operating system. Run benchmarks to
+ * determine the optimal strategy on a case-by-case basis. Generally speaking,
+ * however, sending multiple buffers is faster.
+ *
+ * Example of sending a UDP packet using a socket connected to a port on`localhost`:
+ *
+ * ```js
+ * import dgram from 'dgram';
+ * import { Buffer } from 'buffer';
+ *
+ * const message = Buffer.from('Some bytes');
+ * const client = dgram.createSocket('udp4');
+ * client.connect(41234, 'localhost', (err) => {
+ * client.send(message, (err) => {
+ * client.close();
+ * });
+ * });
+ * ```
+ * @since v0.1.99
+ * @param msg Message to be sent.
+ * @param offset Offset in the buffer where the message starts.
+ * @param length Number of bytes in the message.
+ * @param port Destination port.
+ * @param address Destination host name or IP address.
+ * @param callback Called when the message has been sent.
+ */
+ send(
+ msg: string | Uint8Array | readonly any[],
+ port?: number,
+ address?: string,
+ callback?: (error: Error | null, bytes: number) => void,
+ ): void;
+ send(
+ msg: string | Uint8Array | readonly any[],
+ port?: number,
+ callback?: (error: Error | null, bytes: number) => void,
+ ): void;
+ send(
+ msg: string | Uint8Array | readonly 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
+ * packets may be sent to a local interface's broadcast address.
+ *
+ * This method throws `EBADF` if called on an unbound socket.
+ * @since v0.6.9
+ */
+ setBroadcast(flag: boolean): void;
+ /**
+ * _All references to scope in this section are referring to [IPv6 Zone Indices](https://en.wikipedia.org/wiki/IPv6_address#Scoped_literal_IPv6_addresses), which are defined by [RFC
+ * 4007](https://tools.ietf.org/html/rfc4007). In string form, an IP_
+ * _with a scope index is written as `'IP%scope'` where scope is an interface name_
+ * _or interface number._
+ *
+ * Sets the default outgoing multicast interface of the socket to a chosen
+ * interface or back to system interface selection. The `multicastInterface` must
+ * be a valid string representation of an IP from the socket's family.
+ *
+ * For IPv4 sockets, this should be the IP configured for the desired physical
+ * interface. All packets sent to multicast on the socket will be sent on the
+ * interface determined by the most recent successful use of this call.
+ *
+ * For IPv6 sockets, `multicastInterface` should include a scope to indicate the
+ * interface as in the examples that follow. In IPv6, individual `send` calls can
+ * also use explicit scope in addresses, so only packets sent to a multicast
+ * address without specifying an explicit scope are affected by the most recent
+ * successful use of this call.
+ *
+ * This method throws `EBADF` if called on an unbound socket.
+ *
+ * #### Example: IPv6 outgoing multicast interface
+ *
+ * On most systems, where scope format uses the interface name:
+ *
+ * ```js
+ * const socket = dgram.createSocket('udp6');
+ *
+ * socket.bind(1234, () => {
+ * socket.setMulticastInterface('::%eth1');
+ * });
+ * ```
+ *
+ * On Windows, where scope format uses an interface number:
+ *
+ * ```js
+ * const socket = dgram.createSocket('udp6');
+ *
+ * socket.bind(1234, () => {
+ * socket.setMulticastInterface('::%2');
+ * });
+ * ```
+ *
+ * #### Example: IPv4 outgoing multicast interface
+ *
+ * All systems use an IP of the host on the desired physical interface:
+ *
+ * ```js
+ * const socket = dgram.createSocket('udp4');
+ *
+ * socket.bind(1234, () => {
+ * socket.setMulticastInterface('10.0.0.2');
+ * });
+ * ```
+ * @since v8.6.0
+ */
+ setMulticastInterface(multicastInterface: string): void;
+ /**
+ * Sets or clears the `IP_MULTICAST_LOOP` socket option. When set to `true`,
+ * multicast packets will also be received on the local interface.
+ *
+ * This method throws `EBADF` if called on an unbound socket.
+ * @since v0.3.8
+ */
+ setMulticastLoopback(flag: boolean): boolean;
+ /**
+ * Sets the `IP_MULTICAST_TTL` socket option. While TTL generally stands for
+ * "Time to Live", in this context it specifies the number of IP hops that a
+ * packet is allowed to travel through, specifically for multicast traffic. Each
+ * router or gateway that forwards a packet decrements the TTL. If the TTL is
+ * decremented to 0 by a router, it will not be forwarded.
+ *
+ * The `ttl` argument may be between 0 and 255\. The default on most systems is `1`.
+ *
+ * This method throws `EBADF` if called on an unbound socket.
+ * @since v0.3.8
+ */
+ setMulticastTTL(ttl: number): number;
+ /**
+ * Sets the `SO_RCVBUF` socket option. Sets the maximum socket receive buffer
+ * in bytes.
+ *
+ * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket.
+ * @since v8.7.0
+ */
+ setRecvBufferSize(size: number): void;
+ /**
+ * Sets the `SO_SNDBUF` socket option. Sets the maximum socket send buffer
+ * in bytes.
+ *
+ * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket.
+ * @since v8.7.0
+ */
+ setSendBufferSize(size: number): void;
+ /**
+ * Sets the `IP_TTL` socket option. While TTL generally stands for "Time to Live",
+ * in this context it specifies the number of IP hops that a packet is allowed to
+ * travel through. Each router or gateway that forwards a packet decrements the
+ * 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.
+ *
+ * The `ttl` argument may be between 1 and 255\. The default on most systems
+ * is 64.
+ *
+ * This method throws `EBADF` if called on an unbound socket.
+ * @since v0.1.101
+ */
+ setTTL(ttl: number): number;
+ /**
+ * By default, binding a socket will cause it to block the Node.js process from
+ * exiting as long as the socket is open. The `socket.unref()` method can be used
+ * to exclude the socket from the reference counting that keeps the Node.js
+ * process active, allowing the process to exit even if the socket is still
+ * listening.
+ *
+ * Calling `socket.unref()` multiple times will have no addition effect.
+ *
+ * The `socket.unref()` method returns a reference to the socket so calls can be
+ * chained.
+ * @since v0.9.1
+ */
+ unref(): this;
+ /**
+ * Tells the kernel to join a source-specific multicast channel at the given`sourceAddress` and `groupAddress`, using the `multicastInterface` with the`IP_ADD_SOURCE_MEMBERSHIP` socket
+ * option. If the `multicastInterface` argument
+ * is not specified, the operating system will choose one interface and will add
+ * membership to it. To add membership to every available interface, call`socket.addSourceSpecificMembership()` multiple times, once per interface.
+ *
+ * When called on an unbound socket, this method will implicitly bind to a random
+ * port, listening on all interfaces.
+ * @since v13.1.0, v12.16.0
+ */
+ addSourceSpecificMembership(sourceAddress: string, groupAddress: string, multicastInterface?: string): void;
+ /**
+ * Instructs the kernel to leave a source-specific multicast channel at the given`sourceAddress` and `groupAddress` using the `IP_DROP_SOURCE_MEMBERSHIP`socket option. This method is
+ * automatically called by the kernel when the
+ * socket is closed or the process terminates, so most apps will never have
+ * reason to call this.
+ *
+ * If `multicastInterface` is not specified, the operating system will attempt to
+ * drop membership on all valid interfaces.
+ * @since v13.1.0, v12.16.0
+ */
+ dropSourceSpecificMembership(sourceAddress: string, groupAddress: string, multicastInterface?: string): void;
+ /**
+ * events.EventEmitter
+ * 1. close
+ * 2. connect
+ * 3. error
+ * 4. listening
+ * 5. message
+ */
+ addListener(event: string, listener: (...args: any[]) => void): this;
+ addListener(event: "close", listener: () => void): this;
+ addListener(event: "connect", listener: () => void): this;
+ addListener(event: "error", listener: (err: Error) => void): this;
+ addListener(event: "listening", listener: () => void): this;
+ addListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
+ emit(event: string | symbol, ...args: any[]): boolean;
+ emit(event: "close"): boolean;
+ emit(event: "connect"): boolean;
+ emit(event: "error", err: Error): boolean;
+ emit(event: "listening"): boolean;
+ emit(event: "message", msg: Buffer, rinfo: RemoteInfo): boolean;
+ on(event: string, listener: (...args: any[]) => void): this;
+ on(event: "close", listener: () => void): this;
+ on(event: "connect", listener: () => void): this;
+ on(event: "error", listener: (err: Error) => void): this;
+ on(event: "listening", listener: () => void): this;
+ on(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
+ once(event: string, listener: (...args: any[]) => void): this;
+ once(event: "close", listener: () => void): this;
+ once(event: "connect", listener: () => void): this;
+ once(event: "error", listener: (err: Error) => void): this;
+ once(event: "listening", listener: () => void): this;
+ once(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
+ prependListener(event: string, listener: (...args: any[]) => void): this;
+ prependListener(event: "close", listener: () => void): this;
+ prependListener(event: "connect", listener: () => void): this;
+ prependListener(event: "error", listener: (err: Error) => void): this;
+ prependListener(event: "listening", listener: () => void): this;
+ prependListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
+ prependOnceListener(event: string, listener: (...args: any[]) => void): this;
+ prependOnceListener(event: "close", listener: () => void): this;
+ prependOnceListener(event: "connect", listener: () => void): this;
+ prependOnceListener(event: "error", listener: (err: Error) => void): this;
+ prependOnceListener(event: "listening", listener: () => 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 v18.18.0
+ */
+ [Symbol.asyncDispose](): Promise<void>;
+ }
+}
+declare module "node:dgram" {
+ export * from "dgram";
+}
diff --git a/client/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts b/client/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts
new file mode 100644
index 0000000..f0cb779
--- /dev/null
+++ b/client/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts
@@ -0,0 +1,192 @@
+/**
+ * The `diagnostics_channel` module provides an API to create named channels
+ * to report arbitrary message data for diagnostics purposes.
+ *
+ * It can be accessed using:
+ *
+ * ```js
+ * import diagnostics_channel from 'diagnostics_channel';
+ * ```
+ *
+ * It is intended that a module writer wanting to report diagnostics messages
+ * will create one or many top-level channels to report messages through.
+ * Channels may also be acquired at runtime but it is not encouraged
+ * due to the additional overhead of doing so. Channels may be exported for
+ * convenience, but as long as the name is known it can be acquired anywhere.
+ *
+ * If you intend for your module to produce diagnostics data for others to
+ * consume it is recommended that you include documentation of what named
+ * 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
+ * other modules.
+ * @experimental
+ * @see [source](https://github.com/nodejs/node/blob/v18.7.0/lib/diagnostics_channel.js)
+ */
+declare module "diagnostics_channel" {
+ /**
+ * 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.
+ *
+ * This API is optional but helpful when trying to publish messages from very
+ * performance-sensitive code.
+ *
+ * ```js
+ * import diagnostics_channel from 'diagnostics_channel';
+ *
+ * if (diagnostics_channel.hasSubscribers('my-channel')) {
+ * // There are subscribers, prepare and publish message
+ * }
+ * ```
+ * @since v15.1.0, v14.17.0
+ * @param name The channel name
+ * @return If there are active subscribers
+ */
+ function hasSubscribers(name: string | symbol): boolean;
+ /**
+ * 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
+ * publish time as much as possible.
+ *
+ * ```js
+ * import diagnostics_channel from 'diagnostics_channel';
+ *
+ * const channel = diagnostics_channel.channel('my-channel');
+ * ```
+ * @since v15.1.0, v14.17.0
+ * @param name The channel name
+ * @return The named channel object
+ */
+ function channel(name: string | symbol): Channel;
+ type ChannelListener = (message: unknown, name: string | symbol) => 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 '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 diagnostics_channel.subscribe(name, onMessage).
+ *
+ * ```js
+ * import diagnostics_channel from '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
+ * @returns `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
+ * 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
+ * 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
+ * with `new Channel(name)` is not supported.
+ * @since v15.1.0, v14.17.0
+ */
+ class Channel {
+ readonly name: string | symbol;
+ /**
+ * Check if there are active subscribers to this channel. This is helpful if
+ * the message you want to send might be expensive to prepare.
+ *
+ * This API is optional but helpful when trying to publish messages from very
+ * performance-sensitive code.
+ *
+ * ```js
+ * import diagnostics_channel from 'diagnostics_channel';
+ *
+ * const channel = diagnostics_channel.channel('my-channel');
+ *
+ * if (channel.hasSubscribers) {
+ * // There are subscribers, prepare and publish message
+ * }
+ * ```
+ * @since v15.1.0, v14.17.0
+ */
+ readonly hasSubscribers: boolean;
+ private constructor(name: string | symbol);
+ /**
+ * 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 '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
+ * 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 'diagnostics_channel';
+ *
+ * const channel = diagnostics_channel.channel('my-channel');
+ *
+ * channel.subscribe((message, name) => {
+ * // Received data
+ * });
+ * ```
+ * @since v15.1.0, v14.17.0
+ * @param onMessage The handler to receive channel messages
+ */
+ subscribe(onMessage: ChannelListener): void;
+ /**
+ * Remove a message handler previously registered to this channel with `channel.subscribe(onMessage)`.
+ *
+ * ```js
+ * import diagnostics_channel from 'diagnostics_channel';
+ *
+ * const channel = diagnostics_channel.channel('my-channel');
+ *
+ * function onMessage(message, name) {
+ * // Received data
+ * }
+ *
+ * channel.subscribe(onMessage);
+ *
+ * channel.unsubscribe(onMessage);
+ * ```
+ * @since v15.1.0, v14.17.0
+ * @param onMessage The previous subscribed handler to remove
+ * @return `true` if the handler was found, `false` otherwise.
+ */
+ unsubscribe(onMessage: ChannelListener): void;
+ }
+}
+declare module "node:diagnostics_channel" {
+ export * from "diagnostics_channel";
+}
diff --git a/client/node_modules/@types/node/ts4.8/dns.d.ts b/client/node_modules/@types/node/ts4.8/dns.d.ts
new file mode 100644
index 0000000..104dd76
--- /dev/null
+++ b/client/node_modules/@types/node/ts4.8/dns.d.ts
@@ -0,0 +1,809 @@
+/**
+ * The `dns` module enables name resolution. For example, use it to look up IP
+ * 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
+ * DNS protocol for lookups. {@link lookup} uses the operating system
+ * facilities to perform name resolution. It may not need to perform any network
+ * communication. To perform name resolution the way other applications on the same
+ * system do, use {@link lookup}.
+ *
+ * ```js
+ * const dns = require('dns');
+ *
+ * dns.lookup('example.org', (err, address, family) => {
+ * console.log('address: %j family: IPv%s', address, family);
+ * });
+ * // address: "93.184.216.34" family: IPv4
+ * ```
+ *
+ * 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
+ * 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.
+ *
+ * ```js
+ * const dns = require('dns');
+ *
+ * dns.resolve4('archive.org', (err, addresses) => {
+ * if (err) throw err;
+ *
+ * console.log(`addresses: ${JSON.stringify(addresses)}`);
+ *
+ * addresses.forEach((a) => {
+ * dns.reverse(a, (err, hostnames) => {
+ * if (err) {
+ * throw err;
+ * }
+ * console.log(`reverse for ${a}: ${JSON.stringify(hostnames)}`);
+ * });
+ * });
+ * });
+ * ```
+ *
+ * See the `Implementation considerations section` for more information.
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/dns.js)
+ */
+declare module "dns" {
+ import * as dnsPromises from "node:dns/promises";
+ // Supported getaddrinfo flags.
+ export const ADDRCONFIG: number;
+ export const V4MAPPED: number;
+ /**
+ * If `dns.V4MAPPED` is specified, return resolved IPv6 addresses as
+ * well as IPv4 mapped IPv6 addresses.
+ */
+ export const ALL: number;
+ export interface LookupOptions {
+ family?: number | undefined;
+ hints?: number | undefined;
+ all?: boolean | undefined;
+ /**
+ * @default true
+ */
+ verbatim?: boolean | undefined;
+ }
+ export interface LookupOneOptions extends LookupOptions {
+ all?: false | undefined;
+ }
+ export interface LookupAllOptions extends LookupOptions {
+ all: true;
+ }
+ export interface LookupAddress {
+ address: string;
+ family: number;
+ }
+ /**
+ * 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
+ * integer, then it must be `4` or `6` – if `options` is not provided, then IPv4
+ * 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
+ * properties `address` and `family`.
+ *
+ * On error, `err` is an `Error` object, where `err.code` is the error code.
+ * Keep in mind that `err.code` will be set to `'ENOTFOUND'` not only when
+ * the host name does not exist but also when the lookup fails in other ways
+ * such as no available file descriptors.
+ *
+ * `dns.lookup()` does not necessarily have anything to do with the DNS protocol.
+ * The implementation uses an operating system facility that can associate names
+ * with addresses, and vice versa. This implementation can have subtle but
+ * important consequences on the behavior of any Node.js program. Please take some
+ * time to consult the `Implementation considerations section` before using`dns.lookup()`.
+ *
+ * Example usage:
+ *
+ * ```js
+ * const dns = require('dns');
+ * const options = {
+ * family: 6,
+ * hints: dns.ADDRCONFIG | dns.V4MAPPED,
+ * };
+ * dns.lookup('example.com', options, (err, address, family) =>
+ * console.log('address: %j family: IPv%s', address, family));
+ * // address: "2606:2800:220:1:248:1893:25c8:1946" family: IPv6
+ *
+ * // When options.all is true, the result will be an Array.
+ * options.all = true;
+ * dns.lookup('example.com', options, (err, addresses) =>
+ * console.log('addresses: %j', addresses));
+ * // addresses: [{"address":"2606:2800:220:1:248:1893:25c8:1946","family":6}]
+ * ```
+ *
+ * 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
+ */
+ export function lookup(
+ hostname: string,
+ family: number,
+ 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 {
+ function __promisify__(hostname: string, options: LookupAllOptions): Promise<LookupAddress[]>;
+ function __promisify__(hostname: string, options?: LookupOneOptions | number): Promise<LookupAddress>;
+ function __promisify__(hostname: string, options: LookupOptions): Promise<LookupAddress | LookupAddress[]>;
+ }
+ /**
+ * Resolves the given `address` and `port` into a host name and service using
+ * the operating system's underlying `getnameinfo` implementation.
+ *
+ * If `address` is not a valid IP address, a `TypeError` will be thrown.
+ * The `port` will be coerced to a number. If it is not a legal port, a `TypeError`will be thrown.
+ *
+ * On an error, `err` is an `Error` object, where `err.code` is the error code.
+ *
+ * ```js
+ * const dns = require('dns');
+ * dns.lookupService('127.0.0.1', 22, (err, hostname, service) => {
+ * console.log(hostname, service);
+ * // Prints: localhost ssh
+ * });
+ * ```
+ *
+ * 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
+ */
+ export function lookupService(
+ address: string,
+ port: number,
+ callback: (err: NodeJS.ErrnoException | null, hostname: string, service: string) => void,
+ ): void;
+ export namespace lookupService {
+ function __promisify__(
+ address: string,
+ port: number,
+ ): Promise<{
+ hostname: string;
+ service: string;
+ }>;
+ }
+ export interface ResolveOptions {
+ ttl: boolean;
+ }
+ export interface ResolveWithTtlOptions extends ResolveOptions {
+ ttl: true;
+ }
+ export interface RecordWithTtl {
+ address: string;
+ ttl: number;
+ }
+ /** @deprecated Use `AnyARecord` or `AnyAaaaRecord` instead. */
+ export type AnyRecordWithTtl = AnyARecord | AnyAaaaRecord;
+ export interface AnyARecord extends RecordWithTtl {
+ type: "A";
+ }
+ export interface AnyAaaaRecord extends RecordWithTtl {
+ type: "AAAA";
+ }
+ export interface CaaRecord {
+ critical: number;
+ issue?: string | undefined;
+ issuewild?: string | undefined;
+ iodef?: string | undefined;
+ contactemail?: string | undefined;
+ contactphone?: string | undefined;
+ }
+ export interface MxRecord {
+ priority: number;
+ exchange: string;
+ }
+ export interface AnyMxRecord extends MxRecord {
+ type: "MX";
+ }
+ export interface NaptrRecord {
+ flags: string;
+ service: string;
+ regexp: string;
+ replacement: string;
+ order: number;
+ preference: number;
+ }
+ export interface AnyNaptrRecord extends NaptrRecord {
+ type: "NAPTR";
+ }
+ export interface SoaRecord {
+ nsname: string;
+ hostmaster: string;
+ serial: number;
+ refresh: number;
+ retry: number;
+ expire: number;
+ minttl: number;
+ }
+ export interface AnySoaRecord extends SoaRecord {
+ type: "SOA";
+ }
+ export interface SrvRecord {
+ priority: number;
+ weight: number;
+ port: number;
+ name: string;
+ }
+ export interface AnySrvRecord extends SrvRecord {
+ type: "SRV";
+ }
+ export interface AnyTxtRecord {
+ type: "TXT";
+ entries: string[];
+ }
+ export interface AnyNsRecord {
+ type: "NS";
+ value: string;
+ }
+ export interface AnyPtrRecord {
+ type: "PTR";
+ value: string;
+ }
+ export interface AnyCnameRecord {
+ type: "CNAME";
+ value: string;
+ }
+ export type AnyRecord =
+ | 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
+ * of the resource records. The `callback` function has arguments`(err, records)`. When successful, `records` will be an array of resource
+ * records. The type and structure of individual results varies based on `rrtype`:
+ *
+ * <omitted>
+ *
+ * On error, `err` is an `Error` object, where `err.code` is one of the `DNS error codes`.
+ * @since v0.1.27
+ * @param hostname Host name to resolve.
+ * @param [rrtype='A'] Resource record type.
+ */
+ export function resolve(
+ hostname: string,
+ callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
+ ): void;
+ export function resolve(
+ hostname: string,
+ rrtype: "A",
+ callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
+ ): void;
+ export function resolve(
+ hostname: string,
+ rrtype: "AAAA",
+ 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(
+ hostname: string,
+ rrtype: string,
+ callback: (
+ err: NodeJS.ErrnoException | null,
+ addresses: string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[],
+ ) => void,
+ ): void;
+ export namespace resolve {
+ 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: "MX"): Promise<MxRecord[]>;
+ function __promisify__(hostname: string, rrtype: "NAPTR"): Promise<NaptrRecord[]>;
+ function __promisify__(hostname: string, rrtype: "SOA"): Promise<SoaRecord>;
+ function __promisify__(hostname: string, rrtype: "SRV"): Promise<SrvRecord[]>;
+ function __promisify__(hostname: string, rrtype: "TXT"): Promise<string[][]>;
+ function __promisify__(
+ 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
+ * will contain an array of IPv4 addresses (e.g.`['74.125.79.104', '74.125.79.105', '74.125.79.106']`).
+ * @since v0.1.16
+ * @param hostname Host name to resolve.
+ */
+ export function resolve4(
+ hostname: string,
+ callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => 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 {
+ function __promisify__(hostname: string): Promise<string[]>;
+ function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise<RecordWithTtl[]>;
+ function __promisify__(hostname: string, options?: ResolveOptions): Promise<string[] | RecordWithTtl[]>;
+ }
+ /**
+ * 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.
+ * @since v0.1.16
+ * @param hostname Host name to resolve.
+ */
+ export function resolve6(
+ hostname: string,
+ callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => 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 {
+ function __promisify__(hostname: string): Promise<string[]>;
+ function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise<RecordWithTtl[]>;
+ function __promisify__(hostname: string, options?: ResolveOptions): Promise<string[] | RecordWithTtl[]>;
+ }
+ /**
+ * Uses the DNS protocol to resolve `CNAME` records for the `hostname`. The`addresses` argument passed to the `callback` function
+ * will contain an array of canonical name records available for the `hostname`(e.g. `['bar.example.com']`).
+ * @since v0.3.2
+ */
+ export function resolveCname(
+ hostname: string,
+ callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
+ ): void;
+ export namespace resolveCname {
+ function __promisify__(hostname: string): Promise<string[]>;
+ }
+ /**
+ * 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
+ * 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
+ */
+ export function resolveCaa(
+ hostname: string,
+ callback: (err: NodeJS.ErrnoException | null, records: CaaRecord[]) => void,
+ ): void;
+ export namespace resolveCaa {
+ function __promisify__(hostname: string): Promise<CaaRecord[]>;
+ }
+ /**
+ * Uses the DNS protocol to resolve mail exchange records (`MX` records) for the`hostname`. The `addresses` argument passed to the `callback` function will
+ * contain an array of objects containing both a `priority` and `exchange`property (e.g. `[{priority: 10, exchange: 'mx.example.com'}, ...]`).
+ * @since v0.1.27
+ */
+ export function resolveMx(
+ hostname: string,
+ callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void,
+ ): void;
+ export namespace resolveMx {
+ 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
+ * objects with the following properties:
+ *
+ * * `flags`
+ * * `service`
+ * * `regexp`
+ * * `replacement`
+ * * `order`
+ * * `preference`
+ *
+ * ```js
+ * {
+ * flags: 's',
+ * service: 'SIP+D2U',
+ * regexp: '',
+ * replacement: '_sip._udp.example.com',
+ * order: 30,
+ * preference: 100
+ * }
+ * ```
+ * @since v0.9.12
+ */
+ export function resolveNaptr(
+ hostname: string,
+ callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void,
+ ): void;
+ export namespace resolveNaptr {
+ function __promisify__(hostname: string): Promise<NaptrRecord[]>;
+ }
+ /**
+ * Uses the DNS protocol to resolve name server records (`NS` records) for the`hostname`. The `addresses` argument passed to the `callback` function will
+ * contain an array of name server records available for `hostname`(e.g. `['ns1.example.com', 'ns2.example.com']`).
+ * @since v0.1.90
+ */
+ export function resolveNs(
+ hostname: string,
+ callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
+ ): void;
+ export namespace resolveNs {
+ function __promisify__(hostname: string): Promise<string[]>;
+ }
+ /**
+ * Uses the DNS protocol to resolve pointer records (`PTR` records) for the`hostname`. The `addresses` argument passed to the `callback` function will
+ * be an array of strings containing the reply records.
+ * @since v6.0.0
+ */
+ export function resolvePtr(
+ hostname: string,
+ callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
+ ): void;
+ export namespace resolvePtr {
+ function __promisify__(hostname: string): Promise<string[]>;
+ }
+ /**
+ * Uses the DNS protocol to resolve a start of authority record (`SOA` record) for
+ * the `hostname`. The `address` argument passed to the `callback` function will
+ * be an object with the following properties:
+ *
+ * * `nsname`
+ * * `hostmaster`
+ * * `serial`
+ * * `refresh`
+ * * `retry`
+ * * `expire`
+ * * `minttl`
+ *
+ * ```js
+ * {
+ * nsname: 'ns.example.com',
+ * hostmaster: 'root.example.com',
+ * serial: 2013101809,
+ * refresh: 10000,
+ * retry: 2400,
+ * expire: 604800,
+ * minttl: 3600
+ * }
+ * ```
+ * @since v0.11.10
+ */
+ export function resolveSoa(
+ hostname: string,
+ callback: (err: NodeJS.ErrnoException | null, address: SoaRecord) => void,
+ ): void;
+ export namespace resolveSoa {
+ function __promisify__(hostname: string): Promise<SoaRecord>;
+ }
+ /**
+ * Uses the DNS protocol to resolve service records (`SRV` records) for the`hostname`. The `addresses` argument passed to the `callback` function will
+ * be an array of objects with the following properties:
+ *
+ * * `priority`
+ * * `weight`
+ * * `port`
+ * * `name`
+ *
+ * ```js
+ * {
+ * priority: 10,
+ * weight: 5,
+ * port: 21223,
+ * name: 'service.example.com'
+ * }
+ * ```
+ * @since v0.1.27
+ */
+ export function resolveSrv(
+ hostname: string,
+ callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void,
+ ): void;
+ export namespace resolveSrv {
+ function __promisify__(hostname: string): Promise<SrvRecord[]>;
+ }
+ /**
+ * Uses the DNS protocol to resolve text queries (`TXT` records) for the`hostname`. The `records` argument passed to the `callback` function is a
+ * two-dimensional array of the text records available for `hostname` (e.g.`[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]`). Each sub-array contains TXT chunks of
+ * one record. Depending on the use case, these could be either joined together or
+ * treated separately.
+ * @since v0.1.27
+ */
+ export function resolveTxt(
+ hostname: string,
+ callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void,
+ ): void;
+ export namespace resolveTxt {
+ function __promisify__(hostname: string): Promise<string[][]>;
+ }
+ /**
+ * Uses the DNS protocol to resolve all records (also known as `ANY` or `*` query).
+ * The `ret` argument passed to the `callback` function will be an array containing
+ * various types of records. Each object has a property `type` that indicates the
+ * type of the current record. And depending on the `type`, additional properties
+ * will be present on the object:
+ *
+ * <omitted>
+ *
+ * Here is an example of the `ret` object passed to the callback:
+ *
+ * ```js
+ * [ { type: 'A', address: '127.0.0.1', ttl: 299 },
+ * { type: 'CNAME', value: 'example.com' },
+ * { type: 'MX', exchange: 'alt4.aspmx.l.example.com', priority: 50 },
+ * { type: 'NS', value: 'ns1.example.com' },
+ * { type: 'TXT', entries: [ 'v=spf1 include:_spf.example.com ~all' ] },
+ * { type: 'SOA',
+ * nsname: 'ns1.example.com',
+ * hostmaster: 'admin.example.com',
+ * serial: 156696742,
+ * refresh: 900,
+ * retry: 900,
+ * expire: 1800,
+ * minttl: 60 } ]
+ * ```
+ *
+ * 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).
+ */
+ export function resolveAny(
+ hostname: string,
+ callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void,
+ ): void;
+ export namespace resolveAny {
+ function __promisify__(hostname: string): Promise<AnyRecord[]>;
+ }
+ /**
+ * Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an
+ * array of host names.
+ *
+ * On error, `err` is an `Error` object, where `err.code` is
+ * one of the `DNS error codes`.
+ * @since v0.1.16
+ */
+ export function reverse(
+ 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 v18.17.0
+ */
+ export function getDefaultResultOrder(): "ipv4first" | "verbatim";
+ /**
+ * 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
+ * addresses. If the port is the IANA default DNS port (53) it can be omitted.
+ *
+ * ```js
+ * dns.setServers([
+ * '4.4.4.4',
+ * '[2001:4860:4860::8888]',
+ * '4.4.4.4:1053',
+ * '[2001:4860:4860::8888]:1053',
+ * ]);
+ * ```
+ *
+ * An error will be thrown if an invalid address is provided.
+ *
+ * The `dns.setServers()` method must not be called while a DNS query is in
+ * progress.
+ *
+ * The {@link setServers} method affects only {@link resolve},`dns.resolve*()` and {@link reverse} (and specifically _not_ {@link lookup}).
+ *
+ * This method works much like [resolve.conf](https://man7.org/linux/man-pages/man5/resolv.conf.5.html).
+ * That is, if attempting to resolve with the first server provided results in a`NOTFOUND` error, the `resolve()` method will _not_ attempt to resolve with
+ * subsequent servers provided. Fallback DNS servers will only be used if the
+ * earlier ones time out or result in some other error.
+ * @since v0.11.3
+ * @param servers array of `RFC 5952` formatted addresses
+ */
+ export function setServers(servers: readonly string[]): void;
+ /**
+ * 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
+ * section if a custom port is used.
+ *
+ * ```js
+ * [
+ * '4.4.4.4',
+ * '2001:4860:4860::8888',
+ * '4.4.4.4:1053',
+ * '[2001:4860:4860::8888]:1053',
+ * ]
+ * ```
+ * @since v0.11.3
+ */
+ export function getServers(): string[];
+ /**
+ * Set the default value of `verbatim` in {@link lookup} and `dnsPromises.lookup()`. The value could be:
+ *
+ * * `ipv4first`: sets default `verbatim` `false`.
+ * * `verbatim`: sets default `verbatim` `true`.
+ *
+ * The default is `ipv4first` and {@link setDefaultResultOrder} have higher
+ * 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;
+ // Error codes
+ export const NODATA: string;
+ export const FORMERR: string;
+ export const SERVFAIL: string;
+ export const NOTFOUND: string;
+ export const NOTIMP: string;
+ export const REFUSED: string;
+ export const BADQUERY: string;
+ export const BADNAME: string;
+ export const BADFAMILY: string;
+ export const BADRESP: string;
+ export const CONNREFUSED: string;
+ export const TIMEOUT: string;
+ export const EOF: string;
+ export const FILE: string;
+ export const NOMEM: string;
+ export const DESTRUCTION: string;
+ export const BADSTR: string;
+ export const BADFLAGS: string;
+ export const NONAME: string;
+ export const BADHINTS: string;
+ export const NOTINITIALIZED: string;
+ export const LOADIPHLPAPI: string;
+ export const ADDRGETNETWORKPARAMS: string;
+ export const CANCELLED: string;
+ export interface ResolverOptions {
+ timeout?: number | undefined;
+ /**
+ * @default 4
+ */
+ tries?: number;
+ }
+ /**
+ * 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('dns');
+ * 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', (err, addresses) => {
+ * // ...
+ * });
+ * ```
+ *
+ * The following methods from the `dns` module 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 v8.3.0
+ */
+ export class Resolver {
+ constructor(options?: ResolverOptions);
+ /**
+ * Cancel all outstanding DNS queries made by this resolver. The corresponding
+ * callbacks will be called with an error with code `ECANCELLED`.
+ * @since v8.3.0
+ */
+ cancel(): void;
+ getServers: typeof getServers;
+ resolve: typeof resolve;
+ resolve4: typeof resolve4;
+ resolve6: typeof resolve6;
+ resolveAny: typeof resolveAny;
+ resolveCaa: typeof resolveCaa;
+ resolveCname: typeof resolveCname;
+ resolveMx: typeof resolveMx;
+ resolveNaptr: typeof resolveNaptr;
+ resolveNs: typeof resolveNs;
+ resolvePtr: typeof resolvePtr;
+ resolveSoa: typeof resolveSoa;
+ resolveSrv: typeof resolveSrv;
+ resolveTxt: typeof resolveTxt;
+ reverse: typeof reverse;
+ /**
+ * The resolver instance will send its requests from the specified IP address.
+ * This allows programs to specify outbound interfaces when used on multi-homed
+ * systems.
+ *
+ * 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.
+ *
+ * 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.
+ * The `rrtype` of resolution requests has no impact on the local address used.
+ * @since v15.1.0, v14.17.0
+ * @param [ipv4='0.0.0.0'] A string representation of an IPv4 address.
+ * @param [ipv6='::0'] A string representation of an IPv6 address.
+ */
+ setLocalAddress(ipv4?: string, ipv6?: string): void;
+ setServers: typeof setServers;
+ }
+ export { dnsPromises as promises };
+}
+declare module "node:dns" {
+ export * from "dns";
+}
diff --git a/client/node_modules/@types/node/ts4.8/dns/promises.d.ts b/client/node_modules/@types/node/ts4.8/dns/promises.d.ts
new file mode 100644
index 0000000..282ec72
--- /dev/null
+++ b/client/node_modules/@types/node/ts4.8/dns/promises.d.ts
@@ -0,0 +1,381 @@
+/**
+ * The `dns.promises` API provides an alternative set of asynchronous DNS methods
+ * that return `Promise` objects rather than using callbacks. The API is accessible
+ * via `require('dns').promises` or `require('dns/promises')`.
+ * @since v10.6.0
+ */
+declare module "dns/promises" {
+ import {
+ AnyRecord,
+ CaaRecord,
+ LookupAddress,
+ LookupAllOptions,
+ LookupOneOptions,
+ LookupOptions,
+ MxRecord,
+ NaptrRecord,
+ RecordWithTtl,
+ ResolveOptions,
+ ResolverOptions,
+ ResolveWithTtlOptions,
+ 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),
+ * that are currently configured for DNS resolution. A string will include a port
+ * section if a custom port is used.
+ *
+ * ```js
+ * [
+ * '4.4.4.4',
+ * '2001:4860:4860::8888',
+ * '4.4.4.4:1053',
+ * '[2001:4860:4860::8888]:1053',
+ * ]
+ * ```
+ * @since v10.6.0
+ */
+ function getServers(): string[];
+ /**
+ * 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
+ * integer, then it must be `4` or `6` – if `options` is not provided, then IPv4
+ * and IPv6 addresses are both returned if found.
+ *
+ * With the `all` option set to `true`, the `Promise` is resolved with `addresses`being an array of objects with the properties `address` and `family`.
+ *
+ * On error, the `Promise` is rejected with an `Error` object, where `err.code`is the error code.
+ * Keep in mind that `err.code` will be set to `'ENOTFOUND'` not only when
+ * the host name does not exist but also when the lookup fails in other ways
+ * such as no available file descriptors.
+ *
+ * `dnsPromises.lookup()` does not necessarily have anything to do with the DNS
+ * protocol. The implementation uses an operating system facility that can
+ * associate names with addresses, and vice versa. This implementation can have
+ * subtle but important consequences on the behavior of any Node.js program. Please
+ * take some time to consult the `Implementation considerations section` before
+ * using `dnsPromises.lookup()`.
+ *
+ * Example usage:
+ *
+ * ```js
+ * const dns = require('dns');
+ * const dnsPromises = dns.promises;
+ * const options = {
+ * family: 6,
+ * hints: dns.ADDRCONFIG | dns.V4MAPPED,
+ * };
+ *
+ * dnsPromises.lookup('example.com', options).then((result) => {
+ * console.log('address: %j family: IPv%s', result.address, result.family);
+ * // address: "2606:2800:220:1:248:1893:25c8:1946" family: IPv6
+ * });
+ *
+ * // When options.all is true, the result will be an Array.
+ * options.all = true;
+ * dnsPromises.lookup('example.com', options).then((result) => {
+ * console.log('addresses: %j', result);
+ * // addresses: [{"address":"2606:2800:220:1:248:1893:25c8:1946","family":6}]
+ * });
+ * ```
+ * @since v10.6.0
+ */
+ function lookup(hostname: string, family: number): Promise<LookupAddress>;
+ function lookup(hostname: string, options: LookupOneOptions): Promise<LookupAddress>;
+ function lookup(hostname: string, options: LookupAllOptions): Promise<LookupAddress[]>;
+ function lookup(hostname: string, options: LookupOptions): Promise<LookupAddress | LookupAddress[]>;
+ function lookup(hostname: string): Promise<LookupAddress>;
+ /**
+ * Resolves the given `address` and `port` into a host name and service using
+ * the operating system's underlying `getnameinfo` implementation.
+ *
+ * If `address` is not a valid IP address, a `TypeError` will be thrown.
+ * The `port` will be coerced to a number. If it is not a legal port, a `TypeError`will be thrown.
+ *
+ * On error, the `Promise` is rejected with an `Error` object, where `err.code`is the error code.
+ *
+ * ```js
+ * const dnsPromises = require('dns').promises;
+ * dnsPromises.lookupService('127.0.0.1', 22).then((result) => {
+ * console.log(result.hostname, result.service);
+ * // Prints: localhost ssh
+ * });
+ * ```
+ * @since v10.6.0
+ */
+ function lookupService(
+ address: string,
+ port: number,
+ ): Promise<{
+ hostname: string;
+ service: string;
+ }>;
+ /**
+ * Uses the DNS protocol to resolve a host name (e.g. `'nodejs.org'`) into an array
+ * of the resource records. When successful, the `Promise` is resolved with an
+ * array of resource records. The type and structure of individual results vary
+ * based on `rrtype`:
+ *
+ * <omitted>
+ *
+ * On error, the `Promise` is rejected with an `Error` object, where `err.code`is one of the `DNS error codes`.
+ * @since v10.6.0
+ * @param hostname Host name to resolve.
+ * @param [rrtype='A'] Resource record type.
+ */
+ function resolve(hostname: string): Promise<string[]>;
+ function resolve(hostname: string, rrtype: "A"): Promise<string[]>;
+ function resolve(hostname: string, rrtype: "AAAA"): Promise<string[]>;
+ function resolve(hostname: string, rrtype: "ANY"): Promise<AnyRecord[]>;
+ function resolve(hostname: string, rrtype: "CAA"): Promise<CaaRecord[]>;
+ function resolve(hostname: string, rrtype: "CNAME"): Promise<string[]>;
+ function resolve(hostname: string, rrtype: "MX"): Promise<MxRecord[]>;
+ function resolve(hostname: string, rrtype: "NAPTR"): Promise<NaptrRecord[]>;
+ function resolve(hostname: string, rrtype: "NS"): Promise<string[]>;
+ function resolve(hostname: string, rrtype: "PTR"): Promise<string[]>;
+ function resolve(hostname: string, rrtype: "SOA"): Promise<SoaRecord>;
+ function resolve(hostname: string, rrtype: "SRV"): Promise<SrvRecord[]>;
+ function resolve(hostname: string, rrtype: "TXT"): Promise<string[][]>;
+ function resolve(
+ 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
+ * addresses (e.g. `['74.125.79.104', '74.125.79.105', '74.125.79.106']`).
+ * @since v10.6.0
+ * @param hostname Host name to resolve.
+ */
+ function resolve4(hostname: string): Promise<string[]>;
+ function resolve4(hostname: string, options: ResolveWithTtlOptions): Promise<RecordWithTtl[]>;
+ function resolve4(hostname: string, options: ResolveOptions): Promise<string[] | RecordWithTtl[]>;
+ /**
+ * Uses the DNS protocol to resolve IPv6 addresses (`AAAA` records) for the`hostname`. On success, the `Promise` is resolved with an array of IPv6
+ * addresses.
+ * @since v10.6.0
+ * @param hostname Host name to resolve.
+ */
+ function resolve6(hostname: string): Promise<string[]>;
+ function resolve6(hostname: string, options: ResolveWithTtlOptions): Promise<RecordWithTtl[]>;
+ function resolve6(hostname: string, options: ResolveOptions): Promise<string[] | RecordWithTtl[]>;
+ /**
+ * Uses the DNS protocol to resolve all records (also known as `ANY` or `*` query).
+ * On success, the `Promise` is resolved with an array containing various types of
+ * records. Each object has a property `type` that indicates the type of the
+ * current record. And depending on the `type`, additional properties will be
+ * present on the object:
+ *
+ * <omitted>
+ *
+ * Here is an example of the result object:
+ *
+ * ```js
+ * [ { type: 'A', address: '127.0.0.1', ttl: 299 },
+ * { type: 'CNAME', value: 'example.com' },
+ * { type: 'MX', exchange: 'alt4.aspmx.l.example.com', priority: 50 },
+ * { type: 'NS', value: 'ns1.example.com' },
+ * { type: 'TXT', entries: [ 'v=spf1 include:_spf.example.com ~all' ] },
+ * { type: 'SOA',
+ * nsname: 'ns1.example.com',
+ * hostmaster: 'admin.example.com',
+ * serial: 156696742,
+ * refresh: 900,
+ * retry: 900,
+ * expire: 1800,
+ * minttl: 60 } ]
+ * ```
+ * @since v10.6.0
+ */
+ function resolveAny(hostname: string): Promise<AnyRecord[]>;
+ /**
+ * Uses the DNS protocol to resolve `CAA` records for the `hostname`. On success,
+ * 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'}]`).
+ * @since v15.0.0, v14.17.0
+ */
+ function resolveCaa(hostname: string): Promise<CaaRecord[]>;
+ /**
+ * Uses the DNS protocol to resolve `CNAME` records for the `hostname`. On success,
+ * the `Promise` is resolved with an array of canonical name records available for
+ * the `hostname` (e.g. `['bar.example.com']`).
+ * @since v10.6.0
+ */
+ function resolveCname(hostname: string): Promise<string[]>;
+ /**
+ * Uses the DNS protocol to resolve mail exchange records (`MX` records) for the`hostname`. On success, the `Promise` is resolved with an array of objects
+ * containing both a `priority` and `exchange` property (e.g.`[{priority: 10, exchange: 'mx.example.com'}, ...]`).
+ * @since v10.6.0
+ */
+ 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
+ * of objects with the following properties:
+ *
+ * * `flags`
+ * * `service`
+ * * `regexp`
+ * * `replacement`
+ * * `order`
+ * * `preference`
+ *
+ * ```js
+ * {
+ * flags: 's',
+ * service: 'SIP+D2U',
+ * regexp: '',
+ * replacement: '_sip._udp.example.com',
+ * order: 30,
+ * preference: 100
+ * }
+ * ```
+ * @since v10.6.0
+ */
+ function resolveNaptr(hostname: string): Promise<NaptrRecord[]>;
+ /**
+ * Uses the DNS protocol to resolve name server records (`NS` records) for the`hostname`. On success, the `Promise` is resolved with an array of name server
+ * records available for `hostname` (e.g.`['ns1.example.com', 'ns2.example.com']`).
+ * @since v10.6.0
+ */
+ function resolveNs(hostname: string): Promise<string[]>;
+ /**
+ * Uses the DNS protocol to resolve pointer records (`PTR` records) for the`hostname`. On success, the `Promise` is resolved with an array of strings
+ * containing the reply records.
+ * @since v10.6.0
+ */
+ function resolvePtr(hostname: string): Promise<string[]>;
+ /**
+ * Uses the DNS protocol to resolve a start of authority record (`SOA` record) for
+ * the `hostname`. On success, the `Promise` is resolved with an object with the
+ * following properties:
+ *
+ * * `nsname`
+ * * `hostmaster`
+ * * `serial`
+ * * `refresh`
+ * * `retry`
+ * * `expire`
+ * * `minttl`
+ *
+ * ```js
+ * {
+ * nsname: 'ns.example.com',
+ * hostmaster: 'root.example.com',
+ * serial: 2013101809,
+ * refresh: 10000,
+ * retry: 2400,
+ * expire: 604800,
+ * minttl: 3600
+ * }
+ * ```
+ * @since v10.6.0
+ */
+ function resolveSoa(hostname: string): Promise<SoaRecord>;
+ /**
+ * Uses the DNS protocol to resolve service records (`SRV` records) for the`hostname`. On success, the `Promise` is resolved with an array of objects with
+ * the following properties:
+ *
+ * * `priority`
+ * * `weight`
+ * * `port`
+ * * `name`
+ *
+ * ```js
+ * {
+ * priority: 10,
+ * weight: 5,
+ * port: 21223,
+ * name: 'service.example.com'
+ * }
+ * ```
+ * @since v10.6.0
+ */
+ function resolveSrv(hostname: string): Promise<SrvRecord[]>;
+ /**
+ * Uses the DNS protocol to resolve text queries (`TXT` records) for the`hostname`. On success, the `Promise` is resolved with a two-dimensional array
+ * of the text records available for `hostname` (e.g.`[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]`). Each sub-array contains TXT chunks of
+ * one record. Depending on the use case, these could be either joined together or
+ * treated separately.
+ * @since v10.6.0
+ */
+ function resolveTxt(hostname: string): Promise<string[][]>;
+ /**
+ * Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an
+ * array of host names.
+ *
+ * On error, the `Promise` is rejected with an `Error` object, where `err.code`is one of the `DNS error codes`.
+ * @since v10.6.0
+ */
+ function reverse(ip: string): Promise<string[]>;
+ /**
+ * 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 v18.17.0
+ */
+ function getDefaultResultOrder(): "ipv4first" | "verbatim";
+ /**
+ * 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
+ * addresses. If the port is the IANA default DNS port (53) it can be omitted.
+ *
+ * ```js
+ * dnsPromises.setServers([
+ * '4.4.4.4',
+ * '[2001:4860:4860::8888]',
+ * '4.4.4.4:1053',
+ * '[2001:4860:4860::8888]:1053',
+ * ]);
+ * ```
+ *
+ * An error will be thrown if an invalid address is provided.
+ *
+ * The `dnsPromises.setServers()` method must not be called while a DNS query is in
+ * progress.
+ *
+ * This method works much like [resolve.conf](https://man7.org/linux/man-pages/man5/resolv.conf.5.html).
+ * That is, if attempting to resolve with the first server provided results in a`NOTFOUND` error, the `resolve()` method will _not_ attempt to resolve with
+ * subsequent servers provided. Fallback DNS servers will only be used if the
+ * earlier ones time out or result in some other error.
+ * @since v10.6.0
+ * @param servers array of `RFC 5952` formatted addresses
+ */
+ function setServers(servers: readonly string[]): void;
+ /**
+ * Set the default value of `verbatim` in `dns.lookup()` and `dnsPromises.lookup()`. The value could be:
+ *
+ * * `ipv4first`: sets default `verbatim` `false`.
+ * * `verbatim`: sets default `verbatim` `true`.
+ *
+ * The default is `ipv4first` and `dnsPromises.setDefaultResultOrder()` have
+ * 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;
+ class Resolver {
+ constructor(options?: ResolverOptions);
+ cancel(): void;
+ getServers: typeof getServers;
+ resolve: typeof resolve;
+ resolve4: typeof resolve4;
+ resolve6: typeof resolve6;
+ resolveAny: typeof resolveAny;
+ resolveCname: typeof resolveCname;
+ resolveMx: typeof resolveMx;
+ resolveNaptr: typeof resolveNaptr;
+ resolveNs: typeof resolveNs;
+ resolvePtr: typeof resolvePtr;
+ resolveSoa: typeof resolveSoa;
+ resolveSrv: typeof resolveSrv;
+ resolveTxt: typeof resolveTxt;
+ reverse: typeof reverse;
+ setLocalAddress(ipv4?: string, ipv6?: string): void;
+ setServers: typeof setServers;
+ }
+}
+declare module "node:dns/promises" {
+ export * from "dns/promises";
+}
diff --git a/client/node_modules/@types/node/ts4.8/dom-events.d.ts b/client/node_modules/@types/node/ts4.8/dom-events.d.ts
new file mode 100644
index 0000000..147a7b6
--- /dev/null
+++ b/client/node_modules/@types/node/ts4.8/dom-events.d.ts
@@ -0,0 +1,122 @@
+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;
+ };
+}
diff --git a/client/node_modules/@types/node/ts4.8/domain.d.ts b/client/node_modules/@types/node/ts4.8/domain.d.ts
new file mode 100644
index 0000000..ca8728f
--- /dev/null
+++ b/client/node_modules/@types/node/ts4.8/domain.d.ts
@@ -0,0 +1,170 @@
+/**
+ * **This module is pending deprecation.** Once a replacement API has been
+ * finalized, this module will be fully deprecated. Most developers should
+ * **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
+ * but should expect to have to migrate to a different solution
+ * in the future.
+ *
+ * Domains provide a way to handle multiple different IO operations as a
+ * single group. If any of the event emitters or callbacks registered to a
+ * domain emit an `'error'` event, or throw an error, then the domain object
+ * 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.
+ * @deprecated Since v1.4.2 - Deprecated
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/domain.js)
+ */
+declare module "domain" {
+ import EventEmitter = require("node:events");
+ /**
+ * The `Domain` class encapsulates the functionality of routing errors and
+ * uncaught exceptions to the active `Domain` object.
+ *
+ * To handle the errors that it catches, listen to its `'error'` event.
+ */
+ class Domain extends EventEmitter {
+ /**
+ * An array of timers and event emitters that have been explicitly added
+ * to the domain.
+ */
+ members: Array<EventEmitter | NodeJS.Timer>;
+ /**
+ * The `enter()` method is plumbing used by the `run()`, `bind()`, and`intercept()` methods to set the active domain. It sets `domain.active` and`process.domain` to the domain, and implicitly
+ * pushes the domain onto the domain
+ * stack managed by the domain module (see {@link exit} for details on the
+ * domain stack). The call to `enter()` delimits the beginning of a chain of
+ * asynchronous calls and I/O operations bound to a domain.
+ *
+ * Calling `enter()` changes only the active domain, and does not alter the domain
+ * itself. `enter()` and `exit()` can be called an arbitrary number of times on a
+ * single domain.
+ */
+ enter(): void;
+ /**
+ * The `exit()` method exits the current domain, popping it off the domain stack.
+ * Any time execution is going to switch to the context of a different chain of
+ * asynchronous calls, it's important to ensure that the current domain is exited.
+ * The call to `exit()` delimits either the end of or an interruption to the chain
+ * of asynchronous calls and I/O operations bound to a domain.
+ *
+ * If there are multiple, nested domains bound to the current execution context,`exit()` will exit any domains nested within this domain.
+ *
+ * Calling `exit()` changes only the active domain, and does not alter the domain
+ * itself. `enter()` and `exit()` can be called an arbitrary number of times on a
+ * single domain.
+ */
+ exit(): void;
+ /**
+ * Run the supplied function in the context of the domain, implicitly
+ * binding all event emitters, timers, and lowlevel requests that are
+ * created in that context. Optionally, arguments can be passed to
+ * the function.
+ *
+ * This is the most basic way to use a domain.
+ *
+ * ```js
+ * const domain = require('domain');
+ * const fs = require('fs');
+ * const d = domain.create();
+ * d.on('error', (er) => {
+ * console.error('Caught error!', er);
+ * });
+ * d.run(() => {
+ * process.nextTick(() => {
+ * setTimeout(() => { // Simulating some various async stuff
+ * fs.open('non-existent file', 'r', (er, fd) => {
+ * if (er) throw er;
+ * // proceed...
+ * });
+ * }, 100);
+ * });
+ * });
+ * ```
+ *
+ * In this example, the `d.on('error')` handler will be triggered, rather
+ * than crashing the program.
+ */
+ run<T>(fn: (...args: any[]) => T, ...args: any[]): T;
+ /**
+ * Explicitly adds an emitter to the domain. If any event handlers called by
+ * the emitter throw an error, or if the emitter emits an `'error'` event, it
+ * will be routed to the domain's `'error'` event, just like with implicit
+ * binding.
+ *
+ * This also works with timers that are returned from `setInterval()` and `setTimeout()`. If their callback function throws, it will be caught by
+ * the domain `'error'` handler.
+ *
+ * If the Timer or `EventEmitter` was already bound to a domain, it is removed
+ * from that one, and bound to this one instead.
+ * @param emitter emitter or timer to be added to the domain
+ */
+ add(emitter: EventEmitter | NodeJS.Timer): void;
+ /**
+ * The opposite of {@link add}. Removes domain handling from the
+ * specified emitter.
+ * @param emitter emitter or timer to be removed from the domain
+ */
+ remove(emitter: EventEmitter | NodeJS.Timer): void;
+ /**
+ * The returned function will be a wrapper around the supplied callback
+ * function. When the returned function is called, any errors that are
+ * thrown will be routed to the domain's `'error'` event.
+ *
+ * ```js
+ * const d = domain.create();
+ *
+ * function readSomeFile(filename, cb) {
+ * fs.readFile(filename, 'utf8', d.bind((er, data) => {
+ * // If this throws, it will also be passed to the domain.
+ * return cb(er, data ? JSON.parse(data) : null);
+ * }));
+ * }
+ *
+ * d.on('error', (er) => {
+ * // An error occurred somewhere. If we throw it now, it will crash the program
+ * // with the normal line number and stack message.
+ * });
+ * ```
+ * @param callback The callback function
+ * @return The bound function
+ */
+ bind<T extends Function>(callback: T): T;
+ /**
+ * This method is almost identical to {@link bind}. However, in
+ * addition to catching thrown errors, it will also intercept `Error` objects sent as the first argument to the function.
+ *
+ * In this way, the common `if (err) return callback(err);` pattern can be replaced
+ * with a single error handler in a single place.
+ *
+ * ```js
+ * const d = domain.create();
+ *
+ * function readSomeFile(filename, cb) {
+ * fs.readFile(filename, 'utf8', d.intercept((data) => {
+ * // Note, the first argument is never passed to the
+ * // callback since it is assumed to be the 'Error' argument
+ * // and thus intercepted by the domain.
+ *
+ * // If this throws, it will also be passed to the domain
+ * // so the error-handling logic can be moved to the 'error'
+ * // event on the domain instead of being repeated throughout
+ * // the program.
+ * return cb(null, JSON.parse(data));
+ * }));
+ * }
+ *
+ * d.on('error', (er) => {
+ * // An error occurred somewhere. If we throw it now, it will crash the program
+ * // with the normal line number and stack message.
+ * });
+ * ```
+ * @param callback The callback function
+ * @return The intercepted function
+ */
+ intercept<T extends Function>(callback: T): T;
+ }
+ function create(): Domain;
+}
+declare module "node:domain" {
+ export * from "domain";
+}
diff --git a/client/node_modules/@types/node/ts4.8/events.d.ts b/client/node_modules/@types/node/ts4.8/events.d.ts
new file mode 100644
index 0000000..bcdf24f
--- /dev/null
+++ b/client/node_modules/@types/node/ts4.8/events.d.ts
@@ -0,0 +1,754 @@
+/**
+ * Much of the Node.js core API is built around an idiomatic asynchronous
+ * event-driven architecture in which certain kinds of objects (called "emitters")
+ * emit named events that cause `Function` objects ("listeners") to be called.
+ *
+ * For instance: a `net.Server` object emits an event each time a peer
+ * connects to it; a `fs.ReadStream` emits an event when the file is opened;
+ * a `stream` emits an event whenever data is available to be read.
+ *
+ * All objects that emit events are instances of the `EventEmitter` class. These
+ * objects expose an `eventEmitter.on()` function that allows one or more
+ * functions to be attached to named events emitted by the object. Typically,
+ * event names are camel-cased strings but any valid JavaScript property key
+ * can be used.
+ *
+ * When the `EventEmitter` object emits an event, all of the functions attached
+ * to that specific event are called _synchronously_. Any values returned by the
+ * called listeners are _ignored_ and discarded.
+ *
+ * The following example shows a simple `EventEmitter` instance with a single
+ * listener. The `eventEmitter.on()` method is used to register listeners, while
+ * the `eventEmitter.emit()` method is used to trigger the event.
+ *
+ * ```js
+ * const EventEmitter = require('events');
+ *
+ * class MyEmitter extends EventEmitter {}
+ *
+ * const myEmitter = new MyEmitter();
+ * myEmitter.on('event', () => {
+ * console.log('an event occurred!');
+ * });
+ * myEmitter.emit('event');
+ * ```
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/events.js)
+ */
+declare module "events" {
+ // 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 {
+ /**
+ * Enables automatic capturing of promise rejection.
+ */
+ captureRejections?: boolean | undefined;
+ }
+ // Any EventTarget with a Node-style `once` function
+ interface _NodeEventTarget {
+ once(eventName: string | symbol, listener: (...args: any[]) => void): this;
+ }
+ // Any EventTarget with a DOM-style `addEventListener`
+ interface _DOMEventTarget {
+ addEventListener(
+ eventName: string,
+ listener: (...args: any[]) => void,
+ opts?: {
+ once: boolean;
+ },
+ ): any;
+ }
+ interface StaticEventEmitterOptions {
+ signal?: AbortSignal | undefined;
+ }
+ interface EventEmitter extends NodeJS.EventEmitter {}
+ /**
+ * The `EventEmitter` class is defined and exposed by the `events` module:
+ *
+ * ```js
+ * const EventEmitter = require('events');
+ * ```
+ *
+ * All `EventEmitter`s emit the event `'newListener'` when new listeners are
+ * added and `'removeListener'` when existing listeners are removed.
+ *
+ * It supports the following option:
+ * @since v0.1.26
+ */
+ class EventEmitter {
+ constructor(options?: EventEmitterOptions);
+ /**
+ * Creates a `Promise` that is fulfilled when the `EventEmitter` emits the given
+ * event or that is rejected if the `EventEmitter` emits `'error'` while waiting.
+ * The `Promise` will resolve with an array of all the arguments emitted to the
+ * given event.
+ *
+ * This method is intentionally generic and works with the web platform [EventTarget](https://dom.spec.whatwg.org/#interface-eventtarget) interface, which has no special`'error'` event
+ * semantics and does not listen to the `'error'` event.
+ *
+ * ```js
+ * const { once, EventEmitter } = require('events');
+ *
+ * async function run() {
+ * const ee = new EventEmitter();
+ *
+ * process.nextTick(() => {
+ * ee.emit('myevent', 42);
+ * });
+ *
+ * const [value] = await once(ee, 'myevent');
+ * console.log(value);
+ *
+ * const err = new Error('kaboom');
+ * process.nextTick(() => {
+ * ee.emit('error', err);
+ * });
+ *
+ * try {
+ * await once(ee, 'myevent');
+ * } catch (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
+ * '`error'` event itself, then it is treated as any other kind of event without
+ * special handling:
+ *
+ * ```js
+ * const { EventEmitter, once } = require('events');
+ *
+ * const ee = new EventEmitter();
+ *
+ * once(ee, 'error')
+ * .then(([err]) => console.log('ok', err.message))
+ * .catch((err) => console.log('error', err.message));
+ *
+ * ee.emit('error', new Error('boom'));
+ *
+ * // Prints: ok boom
+ * ```
+ *
+ * An `AbortSignal` can be used to cancel waiting for the event:
+ *
+ * ```js
+ * const { EventEmitter, once } = require('events');
+ *
+ * const ee = new EventEmitter();
+ * const ac = new AbortController();
+ *
+ * async function foo(emitter, event, signal) {
+ * try {
+ * await once(emitter, event, { signal });
+ * console.log('event emitted!');
+ * } catch (error) {
+ * if (error.name === 'AbortError') {
+ * console.error('Waiting for the event was canceled!');
+ * } else {
+ * console.error('There was an error', error.message);
+ * }
+ * }
+ * }
+ *
+ * foo(ee, 'foo', ac.signal);
+ * ac.abort(); // Abort waiting for the event
+ * ee.emit('foo'); // Prints: Waiting for the event was canceled!
+ * ```
+ * @since v11.13.0, v10.16.0
+ */
+ static once(
+ emitter: _NodeEventTarget,
+ eventName: string | symbol,
+ options?: StaticEventEmitterOptions,
+ ): Promise<any[]>;
+ static once(emitter: _DOMEventTarget, eventName: string, options?: StaticEventEmitterOptions): Promise<any[]>;
+ /**
+ * ```js
+ * const { on, EventEmitter } = require('events');
+ *
+ * (async () => {
+ * const ee = new EventEmitter();
+ *
+ * // Emit later on
+ * process.nextTick(() => {
+ * ee.emit('foo', 'bar');
+ * ee.emit('foo', 42);
+ * });
+ *
+ * for await (const event of on(ee, 'foo')) {
+ * // The execution of this inner block is synchronous and it
+ * // processes one event at a time (even with await). Do not use
+ * // if concurrent execution is required.
+ * console.log(event); // prints ['bar'] [42]
+ * }
+ * // Unreachable here
+ * })();
+ * ```
+ *
+ * Returns an `AsyncIterator` that iterates `eventName` events. It will throw
+ * if the `EventEmitter` emits `'error'`. It removes all listeners when
+ * exiting the loop. The `value` returned by each iteration is an array
+ * composed of the emitted event arguments.
+ *
+ * An `AbortSignal` can be used to cancel waiting on events:
+ *
+ * ```js
+ * const { on, EventEmitter } = require('events');
+ * const ac = new AbortController();
+ *
+ * (async () => {
+ * const ee = new EventEmitter();
+ *
+ * // Emit later on
+ * process.nextTick(() => {
+ * ee.emit('foo', 'bar');
+ * ee.emit('foo', 42);
+ * });
+ *
+ * for await (const event of on(ee, 'foo', { signal: ac.signal })) {
+ * // The execution of this inner block is synchronous and it
+ * // processes one event at a time (even with await). Do not use
+ * // if concurrent execution is required.
+ * console.log(event); // prints ['bar'] [42]
+ * }
+ * // Unreachable here
+ * })();
+ *
+ * process.nextTick(() => ac.abort());
+ * ```
+ * @since v13.6.0, v12.16.0
+ * @param eventName The name of the event being listened for
+ * @return that iterates `eventName` events emitted by the `emitter`
+ */
+ static on(
+ 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`.
+ *
+ * ```js
+ * const { EventEmitter, listenerCount } = require('events');
+ * const myEmitter = new EventEmitter();
+ * myEmitter.on('event', () => {});
+ * myEmitter.on('event', () => {});
+ * console.log(listenerCount(myEmitter, 'event'));
+ * // Prints: 2
+ * ```
+ * @since v0.9.12
+ * @deprecated Since v3.2.0 - Use `listenerCount` instead.
+ * @param emitter The emitter to query
+ * @param eventName The event name
+ */
+ static listenerCount(emitter: NodeJS.EventEmitter, eventName: string | symbol): number;
+ /**
+ * Returns a copy of the array of listeners for the event named `eventName`.
+ *
+ * For `EventEmitter`s this behaves exactly the same as calling `.listeners` on
+ * the emitter.
+ *
+ * For `EventTarget`s this is the only way to get the event listeners for the
+ * event target. This is useful for debugging and diagnostic purposes.
+ *
+ * ```js
+ * const { getEventListeners, EventEmitter } = require('events');
+ *
+ * {
+ * const ee = new EventEmitter();
+ * const listener = () => console.log('Events are fun');
+ * ee.on('foo', listener);
+ * getEventListeners(ee, 'foo'); // [listener]
+ * }
+ * {
+ * const et = new EventTarget();
+ * const listener = () => console.log('Events are fun');
+ * et.addEventListener('foo', listener);
+ * getEventListeners(et, 'foo'); // [listener]
+ * }
+ * ```
+ * @since v15.2.0, v14.17.0
+ */
+ static getEventListeners(emitter: _DOMEventTarget | NodeJS.EventEmitter, name: string | symbol): Function[];
+ /**
+ * Returns the currently set max amount of listeners.
+ *
+ * For `EventEmitter`s this behaves exactly the same as calling `.getMaxListeners` on
+ * the emitter.
+ *
+ * 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 v18.17.0
+ */
+ static getMaxListeners(emitter: _DOMEventTarget | NodeJS.EventEmitter): number;
+ /**
+ * ```js
+ * const {
+ * setMaxListeners,
+ * EventEmitter
+ * } = require('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 v18.18.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.
+ */
+ static readonly errorMonitor: unique symbol;
+ static readonly captureRejectionSymbol: unique symbol;
+ /**
+ * Sets or gets the default captureRejection value for all emitters.
+ */
+ // TODO: These should be described using static getter/setter pairs:
+ static captureRejections: boolean;
+ static defaultMaxListeners: number;
+ }
+ import internal = require("node:events");
+ namespace EventEmitter {
+ // Should just be `export { EventEmitter }`, but that doesn't work in TypeScript 3.4
+ export { internal as EventEmitter };
+ export interface Abortable {
+ /**
+ * When provided the corresponding `AbortController` can be used to cancel an asynchronous action.
+ */
+ signal?: AbortSignal | undefined;
+ }
+ }
+ global {
+ namespace NodeJS {
+ interface EventEmitter {
+ /**
+ * Alias for `emitter.on(eventName, listener)`.
+ * @since v0.1.26
+ */
+ addListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
+ /**
+ * Adds the `listener` function to the end of the listeners array for the
+ * event named `eventName`. No checks are made to see if the `listener` has
+ * already been added. Multiple calls passing the same combination of `eventName`and `listener` will result in the `listener` being added, and called, multiple
+ * times.
+ *
+ * ```js
+ * server.on('connection', (stream) => {
+ * console.log('someone connected!');
+ * });
+ * ```
+ *
+ * Returns a reference to the `EventEmitter`, so that calls can be chained.
+ *
+ * By default, event listeners are invoked in the order they are added. The`emitter.prependListener()` method can be used as an alternative to add the
+ * event listener to the beginning of the listeners array.
+ *
+ * ```js
+ * const myEE = new EventEmitter();
+ * myEE.on('foo', () => console.log('a'));
+ * myEE.prependListener('foo', () => console.log('b'));
+ * myEE.emit('foo');
+ * // Prints:
+ * // b
+ * // a
+ * ```
+ * @since v0.1.101
+ * @param eventName The name of the event.
+ * @param listener The callback function
+ */
+ on(eventName: string | symbol, listener: (...args: any[]) => void): this;
+ /**
+ * Adds a **one-time**`listener` function for the event named `eventName`. The
+ * next time `eventName` is triggered, this listener is removed and then invoked.
+ *
+ * ```js
+ * server.once('connection', (stream) => {
+ * console.log('Ah, we have our first user!');
+ * });
+ * ```
+ *
+ * Returns a reference to the `EventEmitter`, so that calls can be chained.
+ *
+ * By default, event listeners are invoked in the order they are added. The`emitter.prependOnceListener()` method can be used as an alternative to add the
+ * event listener to the beginning of the listeners array.
+ *
+ * ```js
+ * const myEE = new EventEmitter();
+ * myEE.once('foo', () => console.log('a'));
+ * myEE.prependOnceListener('foo', () => console.log('b'));
+ * myEE.emit('foo');
+ * // Prints:
+ * // b
+ * // a
+ * ```
+ * @since v0.3.0
+ * @param eventName The name of the event.
+ * @param listener The callback function
+ */
+ once(eventName: string | symbol, listener: (...args: any[]) => void): this;
+ /**
+ * Removes the specified `listener` from the listener array for the event named`eventName`.
+ *
+ * ```js
+ * const callback = (stream) => {
+ * console.log('someone connected!');
+ * };
+ * server.on('connection', callback);
+ * // ...
+ * server.removeListener('connection', callback);
+ * ```
+ *
+ * `removeListener()` will remove, at most, one instance of a listener from the
+ * listener array. If any single listener has been added multiple times to the
+ * listener array for the specified `eventName`, then `removeListener()` must be
+ * called multiple times to remove each instance.
+ *
+ * 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
+ * will not remove them from`emit()` in progress. Subsequent events behave as expected.
+ *
+ * ```js
+ * const myEmitter = new MyEmitter();
+ *
+ * const callbackA = () => {
+ * console.log('A');
+ * myEmitter.removeListener('event', callbackB);
+ * };
+ *
+ * const callbackB = () => {
+ * console.log('B');
+ * };
+ *
+ * myEmitter.on('event', callbackA);
+ *
+ * myEmitter.on('event', callbackB);
+ *
+ * // callbackA removes listener callbackB but it will still be called.
+ * // Internal listener array at time of emit [callbackA, callbackB]
+ * myEmitter.emit('event');
+ * // Prints:
+ * // A
+ * // B
+ *
+ * // callbackB is now removed.
+ * // Internal listener array [callbackA]
+ * myEmitter.emit('event');
+ * // Prints:
+ * // A
+ * ```
+ *
+ * Because listeners are managed using an internal array, calling this will
+ * change the position indices of any listener registered _after_ the listener
+ * being removed. This will not impact the order in which listeners are called,
+ * but it means that any copies of the listener array as returned by
+ * the `emitter.listeners()` method will need to be recreated.
+ *
+ * When a single function has been added as a handler multiple times for a single
+ * event (as in the example below), `removeListener()` will remove the most
+ * recently added instance. In the example the `once('ping')`listener is removed:
+ *
+ * ```js
+ * const ee = new EventEmitter();
+ *
+ * function pong() {
+ * console.log('pong');
+ * }
+ *
+ * ee.on('ping', pong);
+ * ee.once('ping', pong);
+ * ee.removeListener('ping', pong);
+ *
+ * ee.emit('ping');
+ * ee.emit('ping');
+ * ```
+ *
+ * Returns a reference to the `EventEmitter`, so that calls can be chained.
+ * @since v0.1.26
+ */
+ removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
+ /**
+ * Alias for `emitter.removeListener()`.
+ * @since v10.0.0
+ */
+ off(eventName: string | symbol, listener: (...args: any[]) => void): this;
+ /**
+ * Removes all listeners, or those of the specified `eventName`.
+ *
+ * It is bad practice to remove listeners added elsewhere in the code,
+ * particularly when the `EventEmitter` instance was created by some other
+ * component or module (e.g. sockets or file streams).
+ *
+ * Returns a reference to the `EventEmitter`, so that calls can be chained.
+ * @since v0.1.26
+ */
+ removeAllListeners(event?: string | symbol): this;
+ /**
+ * By default `EventEmitter`s will print a warning if more than `10` listeners are
+ * added for a particular event. This is a useful default that helps finding
+ * memory leaks. The `emitter.setMaxListeners()` method allows the limit to be
+ * modified for this specific `EventEmitter` instance. The value can be set to`Infinity` (or `0`) to indicate an unlimited number of listeners.
+ *
+ * Returns a reference to the `EventEmitter`, so that calls can be chained.
+ * @since v0.3.5
+ */
+ setMaxListeners(n: number): this;
+ /**
+ * Returns the current max listener value for the `EventEmitter` which is either
+ * set by `emitter.setMaxListeners(n)` or defaults to {@link defaultMaxListeners}.
+ * @since v1.0.0
+ */
+ getMaxListeners(): number;
+ /**
+ * Returns a copy of the array of listeners for the event named `eventName`.
+ *
+ * ```js
+ * server.on('connection', (stream) => {
+ * console.log('someone connected!');
+ * });
+ * console.log(util.inspect(server.listeners('connection')));
+ * // Prints: [ [Function] ]
+ * ```
+ * @since v0.1.26
+ */
+ listeners(eventName: string | symbol): Function[];
+ /**
+ * Returns a copy of the array of listeners for the event named `eventName`,
+ * including any wrappers (such as those created by `.once()`).
+ *
+ * ```js
+ * const emitter = new EventEmitter();
+ * emitter.once('log', () => console.log('log once'));
+ *
+ * // Returns a new Array with a function `onceWrapper` which has a property
+ * // `listener` which contains the original listener bound above
+ * const listeners = emitter.rawListeners('log');
+ * const logFnWrapper = listeners[0];
+ *
+ * // Logs "log once" to the console and does not unbind the `once` event
+ * logFnWrapper.listener();
+ *
+ * // Logs "log once" to the console and removes the listener
+ * logFnWrapper();
+ *
+ * emitter.on('log', () => console.log('log persistently'));
+ * // Will return a new Array with a single function bound by `.on()` above
+ * const newListeners = emitter.rawListeners('log');
+ *
+ * // Logs "log persistently" twice
+ * newListeners[0]();
+ * emitter.emit('log');
+ * ```
+ * @since v9.4.0
+ */
+ rawListeners(eventName: string | symbol): Function[];
+ /**
+ * Synchronously calls each of the listeners registered for the event named`eventName`, in the order they were registered, passing the supplied arguments
+ * to each.
+ *
+ * Returns `true` if the event had listeners, `false` otherwise.
+ *
+ * ```js
+ * const EventEmitter = require('events');
+ * const myEmitter = new EventEmitter();
+ *
+ * // First listener
+ * myEmitter.on('event', function firstListener() {
+ * console.log('Helloooo! first listener');
+ * });
+ * // Second listener
+ * myEmitter.on('event', function secondListener(arg1, arg2) {
+ * console.log(`event with parameters ${arg1}, ${arg2} in second listener`);
+ * });
+ * // Third listener
+ * myEmitter.on('event', function thirdListener(...args) {
+ * const parameters = args.join(', ');
+ * console.log(`event with parameters ${parameters} in third listener`);
+ * });
+ *
+ * console.log(myEmitter.listeners('event'));
+ *
+ * myEmitter.emit('event', 1, 2, 3, 4, 5);
+ *
+ * // Prints:
+ * // [
+ * // [Function: firstListener],
+ * // [Function: secondListener],
+ * // [Function: thirdListener]
+ * // ]
+ * // Helloooo! first listener
+ * // event with parameters 1, 2 in second listener
+ * // event with parameters 1, 2, 3, 4, 5 in third listener
+ * ```
+ * @since v0.1.26
+ */
+ emit(eventName: string | symbol, ...args: any[]): boolean;
+ /**
+ * 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
+ * @param eventName The name of the event being listened for
+ * @param listener The event handler function
+ */
+ listenerCount(eventName: string | symbol, listener?: Function): number;
+ /**
+ * 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
+ * already been added. Multiple calls passing the same combination of `eventName`and `listener` will result in the `listener` being added, and called, multiple
+ * times.
+ *
+ * ```js
+ * server.prependListener('connection', (stream) => {
+ * console.log('someone connected!');
+ * });
+ * ```
+ *
+ * Returns a reference to the `EventEmitter`, so that calls can be chained.
+ * @since v6.0.0
+ * @param eventName The name of the event.
+ * @param listener The callback function
+ */
+ 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
+ * listener is removed, and then invoked.
+ *
+ * ```js
+ * server.prependOnceListener('connection', (stream) => {
+ * console.log('Ah, we have our first user!');
+ * });
+ * ```
+ *
+ * Returns a reference to the `EventEmitter`, so that calls can be chained.
+ * @since v6.0.0
+ * @param eventName The name of the event.
+ * @param listener The callback function
+ */
+ prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
+ /**
+ * Returns an array listing the events for which the emitter has registered
+ * listeners. The values in the array are strings or `Symbol`s.
+ *
+ * ```js
+ * const EventEmitter = require('events');
+ * const myEE = new EventEmitter();
+ * myEE.on('foo', () => {});
+ * myEE.on('bar', () => {});
+ *
+ * const sym = Symbol('symbol');
+ * myEE.on(sym, () => {});
+ *
+ * console.log(myEE.eventNames());
+ * // Prints: [ 'foo', 'bar', Symbol(symbol) ]
+ * ```
+ * @since v6.0.0
+ */
+ eventNames(): Array<string | symbol>;
+ }
+ }
+ }
+ export = EventEmitter;
+}
+declare module "node:events" {
+ import events = require("events");
+ export = events;
+}
diff --git a/client/node_modules/@types/node/ts4.8/fs.d.ts b/client/node_modules/@types/node/ts4.8/fs.d.ts
new file mode 100644
index 0000000..1d7be30
--- /dev/null
+++ b/client/node_modules/@types/node/ts4.8/fs.d.ts
@@ -0,0 +1,4211 @@
+/**
+ * The `fs` module enables interacting with the file system in a
+ * way modeled on standard POSIX functions.
+ *
+ * To use the promise-based APIs:
+ *
+ * ```js
+ * import * as fs from 'fs/promises';
+ * ```
+ *
+ * To use the callback and sync APIs:
+ *
+ * ```js
+ * import * as fs from 'fs';
+ * ```
+ *
+ * All file system operations have synchronous, callback, and promise-based
+ * forms, and are accessible using both CommonJS syntax and ES6 Modules (ESM).
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/fs.js)
+ */
+declare module "fs" {
+ import * as stream from "node:stream";
+ import { Abortable, EventEmitter } from "node:events";
+ import { URL } from "node:url";
+ import * as promises from "node:fs/promises";
+ export { promises };
+ /**
+ * Valid types for path values in "fs".
+ */
+ export type PathLike = string | Buffer | URL;
+ export type PathOrFileDescriptor = PathLike | number;
+ export type TimeLike = string | number | Date;
+ export type NoParamCallback = (err: NodeJS.ErrnoException | null) => void;
+ export type BufferEncodingOption =
+ | "buffer"
+ | {
+ encoding: "buffer";
+ };
+ export interface ObjectEncodingOptions {
+ encoding?: BufferEncoding | null | undefined;
+ }
+ export type EncodingOption = ObjectEncodingOptions | BufferEncoding | undefined | null;
+ export type OpenMode = number | string;
+ export type Mode = number | string;
+ export interface StatsBase<T> {
+ isFile(): boolean;
+ isDirectory(): boolean;
+ isBlockDevice(): boolean;
+ isCharacterDevice(): boolean;
+ isSymbolicLink(): boolean;
+ isFIFO(): boolean;
+ isSocket(): boolean;
+ dev: T;
+ ino: T;
+ mode: T;
+ nlink: T;
+ uid: T;
+ gid: T;
+ rdev: T;
+ size: T;
+ blksize: T;
+ blocks: T;
+ atimeMs: T;
+ mtimeMs: T;
+ ctimeMs: T;
+ birthtimeMs: T;
+ atime: Date;
+ mtime: Date;
+ ctime: Date;
+ birthtime: Date;
+ }
+ export interface Stats extends StatsBase<number> {}
+ /**
+ * A `fs.Stats` object provides information about a file.
+ *
+ * Objects returned from {@link stat}, {@link lstat} and {@link fstat} and
+ * their synchronous counterparts are of this type.
+ * If `bigint` in the `options` passed to those methods is true, the numeric values
+ * will be `bigint` instead of `number`, and the object will contain additional
+ * nanosecond-precision properties suffixed with `Ns`.
+ *
+ * ```console
+ * Stats {
+ * dev: 2114,
+ * ino: 48064969,
+ * mode: 33188,
+ * nlink: 1,
+ * uid: 85,
+ * gid: 100,
+ * rdev: 0,
+ * size: 527,
+ * blksize: 4096,
+ * blocks: 8,
+ * atimeMs: 1318289051000.1,
+ * mtimeMs: 1318289051000.1,
+ * ctimeMs: 1318289051000.1,
+ * birthtimeMs: 1318289051000.1,
+ * atime: Mon, 10 Oct 2011 23:24:11 GMT,
+ * mtime: Mon, 10 Oct 2011 23:24:11 GMT,
+ * ctime: Mon, 10 Oct 2011 23:24:11 GMT,
+ * birthtime: Mon, 10 Oct 2011 23:24:11 GMT }
+ * ```
+ *
+ * `bigint` version:
+ *
+ * ```console
+ * BigIntStats {
+ * dev: 2114n,
+ * ino: 48064969n,
+ * mode: 33188n,
+ * nlink: 1n,
+ * uid: 85n,
+ * gid: 100n,
+ * rdev: 0n,
+ * size: 527n,
+ * blksize: 4096n,
+ * blocks: 8n,
+ * atimeMs: 1318289051000n,
+ * mtimeMs: 1318289051000n,
+ * ctimeMs: 1318289051000n,
+ * birthtimeMs: 1318289051000n,
+ * atimeNs: 1318289051000000000n,
+ * mtimeNs: 1318289051000000000n,
+ * ctimeNs: 1318289051000000000n,
+ * birthtimeNs: 1318289051000000000n,
+ * atime: Mon, 10 Oct 2011 23:24:11 GMT,
+ * mtime: Mon, 10 Oct 2011 23:24:11 GMT,
+ * ctime: Mon, 10 Oct 2011 23:24:11 GMT,
+ * birthtime: Mon, 10 Oct 2011 23:24:11 GMT }
+ * ```
+ * @since v0.1.21
+ */
+ export class Stats {}
+
+ export interface StatsFsBase<T> {
+ /** Type of file system. */
+ type: T;
+ /** Optimal transfer block size. */
+ bsize: T;
+ /** Total data blocks in file system. */
+ blocks: T;
+ /** Free blocks in file system. */
+ bfree: T;
+ /** Available blocks for unprivileged users */
+ bavail: T;
+ /** Total file nodes in file system. */
+ files: T;
+ /** Free file nodes in file system. */
+ ffree: T;
+ }
+
+ export interface StatsFs extends StatsFsBase<number> {}
+
+ /**
+ * Provides information about a mounted file system
+ *
+ * Objects returned from {@link statfs} and {@link statfsSync} are of this type.
+ * If `bigint` in the `options` passed to those methods is true, the numeric values
+ * will be `bigint` instead of `number`.
+ * @since v18.15.0
+ */
+ export class StatsFs {}
+
+ export interface BigIntStatsFs extends StatsFsBase<bigint> {}
+
+ export interface StatFsOptions {
+ bigint?: boolean | undefined;
+ }
+
+ /**
+ * A representation of a directory entry, which can be a file or a subdirectory
+ * within the directory, as returned by reading from an `fs.Dir`. The
+ * directory entry is a combination of the file name and file type pairs.
+ *
+ * Additionally, when {@link readdir} or {@link readdirSync} is called with
+ * the `withFileTypes` option set to `true`, the resulting array is filled with `fs.Dirent` objects, rather than strings or `Buffer` s.
+ * @since v10.10.0
+ */
+ export class Dirent {
+ /**
+ * Returns `true` if the `fs.Dirent` object describes a regular file.
+ * @since v10.10.0
+ */
+ isFile(): boolean;
+ /**
+ * Returns `true` if the `fs.Dirent` object describes a file system
+ * directory.
+ * @since v10.10.0
+ */
+ isDirectory(): boolean;
+ /**
+ * Returns `true` if the `fs.Dirent` object describes a block device.
+ * @since v10.10.0
+ */
+ isBlockDevice(): boolean;
+ /**
+ * Returns `true` if the `fs.Dirent` object describes a character device.
+ * @since v10.10.0
+ */
+ isCharacterDevice(): boolean;
+ /**
+ * Returns `true` if the `fs.Dirent` object describes a symbolic link.
+ * @since v10.10.0
+ */
+ isSymbolicLink(): boolean;
+ /**
+ * Returns `true` if the `fs.Dirent` object describes a first-in-first-out
+ * (FIFO) pipe.
+ * @since v10.10.0
+ */
+ isFIFO(): boolean;
+ /**
+ * Returns `true` if the `fs.Dirent` object describes a socket.
+ * @since v10.10.0
+ */
+ isSocket(): boolean;
+ /**
+ * The file name that this `fs.Dirent` object refers to. The type of this
+ * value is determined by the `options.encoding` passed to {@link readdir} or {@link readdirSync}.
+ * @since v10.10.0
+ */
+ name: string;
+ /**
+ * The base path that this `fs.Dirent` object refers to.
+ * @since v18.17.0
+ */
+ path: string;
+ }
+ /**
+ * A class representing a directory stream.
+ *
+ * Created by {@link opendir}, {@link opendirSync}, or `fsPromises.opendir()`.
+ *
+ * ```js
+ * import { opendir } from 'fs/promises';
+ *
+ * try {
+ * const dir = await opendir('./');
+ * for await (const dirent of dir)
+ * console.log(dirent.name);
+ * } catch (err) {
+ * console.error(err);
+ * }
+ * ```
+ *
+ * When using the async iterator, the `fs.Dir` object will be automatically
+ * closed after the iterator exits.
+ * @since v12.12.0
+ */
+ export class Dir implements AsyncIterable<Dirent> {
+ /**
+ * The read-only path of this directory as was provided to {@link opendir},{@link opendirSync}, or `fsPromises.opendir()`.
+ * @since v12.12.0
+ */
+ readonly path: string;
+ /**
+ * Asynchronously iterates over the directory via `readdir(3)` until all entries have been read.
+ */
+ [Symbol.asyncIterator](): AsyncIterableIterator<Dirent>;
+ /**
+ * Asynchronously close the directory's underlying resource handle.
+ * Subsequent reads will result in errors.
+ *
+ * A promise is returned that will be resolved after the resource has been
+ * closed.
+ * @since v12.12.0
+ */
+ close(): Promise<void>;
+ close(cb: NoParamCallback): void;
+ /**
+ * Synchronously close the directory's underlying resource handle.
+ * Subsequent reads will result in errors.
+ * @since v12.12.0
+ */
+ closeSync(): void;
+ /**
+ * Asynchronously read the next directory entry via [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) as an `fs.Dirent`.
+ *
+ * A promise is returned that will be resolved with an `fs.Dirent`, or `null`if there are no more directory entries to read.
+ *
+ * Directory entries returned by this function are in no particular order as
+ * provided by the operating system's underlying directory mechanisms.
+ * Entries added or removed while iterating over the directory might not be
+ * included in the iteration results.
+ * @since v12.12.0
+ * @return containing {fs.Dirent|null}
+ */
+ read(): Promise<Dirent | null>;
+ read(cb: (err: NodeJS.ErrnoException | null, dirEnt: Dirent | null) => void): void;
+ /**
+ * Synchronously read the next directory entry as an `fs.Dirent`. See the
+ * POSIX [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) documentation for more detail.
+ *
+ * If there are no more directory entries to read, `null` will be returned.
+ *
+ * Directory entries returned by this function are in no particular order as
+ * provided by the operating system's underlying directory mechanisms.
+ * Entries added or removed while iterating over the directory might not be
+ * included in the iteration results.
+ * @since v12.12.0
+ */
+ readSync(): Dirent | null;
+ }
+ /**
+ * Class: fs.StatWatcher
+ * @since v14.3.0, v12.20.0
+ * Extends `EventEmitter`
+ * A successful call to {@link watchFile} method will return a new fs.StatWatcher object.
+ */
+ export interface StatWatcher extends EventEmitter {
+ /**
+ * When called, requests that the Node.js event loop _not_ exit so long as the `fs.StatWatcher` is active. Calling `watcher.ref()` multiple times will have
+ * no effect.
+ *
+ * By default, all `fs.StatWatcher` objects are "ref'ed", making it normally
+ * unnecessary to call `watcher.ref()` unless `watcher.unref()` had been
+ * called previously.
+ * @since v14.3.0, v12.20.0
+ */
+ ref(): this;
+ /**
+ * When called, the active `fs.StatWatcher` object will not require the Node.js
+ * event loop to remain active. If there is no other activity keeping the
+ * event loop running, the process may exit before the `fs.StatWatcher` object's
+ * callback is invoked. Calling `watcher.unref()` multiple times will have
+ * no effect.
+ * @since v14.3.0, v12.20.0
+ */
+ unref(): this;
+ }
+ export interface FSWatcher extends EventEmitter {
+ /**
+ * Stop watching for changes on the given `fs.FSWatcher`. Once stopped, the `fs.FSWatcher` object is no longer usable.
+ * @since v0.5.8
+ */
+ close(): void;
+ /**
+ * events.EventEmitter
+ * 1. change
+ * 2. error
+ */
+ addListener(event: string, listener: (...args: any[]) => void): this;
+ addListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this;
+ addListener(event: "error", listener: (error: Error) => void): this;
+ addListener(event: "close", listener: () => void): this;
+ on(event: string, listener: (...args: any[]) => void): this;
+ on(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this;
+ on(event: "error", listener: (error: Error) => void): this;
+ on(event: "close", listener: () => void): this;
+ once(event: string, listener: (...args: any[]) => void): this;
+ once(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this;
+ once(event: "error", listener: (error: Error) => void): this;
+ once(event: "close", listener: () => void): this;
+ prependListener(event: string, listener: (...args: any[]) => void): this;
+ prependListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this;
+ prependListener(event: "error", listener: (error: Error) => void): this;
+ prependListener(event: "close", listener: () => void): this;
+ prependOnceListener(event: string, listener: (...args: any[]) => void): this;
+ prependOnceListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this;
+ prependOnceListener(event: "error", listener: (error: Error) => void): this;
+ prependOnceListener(event: "close", listener: () => void): this;
+ }
+ /**
+ * Instances of `fs.ReadStream` are created and returned using the {@link createReadStream} function.
+ * @since v0.1.93
+ */
+ export class ReadStream extends stream.Readable {
+ close(callback?: (err?: NodeJS.ErrnoException | null) => void): void;
+ /**
+ * The number of bytes that have been read so far.
+ * @since v6.4.0
+ */
+ bytesRead: number;
+ /**
+ * The path to the file the stream is reading from as specified in the first
+ * argument to `fs.createReadStream()`. If `path` is passed as a string, then`readStream.path` will be a string. If `path` is passed as a `Buffer`, then`readStream.path` will be a
+ * `Buffer`. If `fd` is specified, then`readStream.path` will be `undefined`.
+ * @since v0.1.93
+ */
+ path: string | Buffer;
+ /**
+ * This property is `true` if the underlying file has not been opened yet,
+ * i.e. before the `'ready'` event is emitted.
+ * @since v11.2.0, v10.16.0
+ */
+ pending: boolean;
+ /**
+ * events.EventEmitter
+ * 1. open
+ * 2. close
+ * 3. ready
+ */
+ addListener(event: "close", listener: () => void): this;
+ addListener(event: "data", listener: (chunk: Buffer | string) => void): this;
+ addListener(event: "end", listener: () => void): this;
+ addListener(event: "error", listener: (err: Error) => void): this;
+ addListener(event: "open", listener: (fd: number) => void): this;
+ addListener(event: "pause", listener: () => void): this;
+ addListener(event: "readable", listener: () => void): this;
+ addListener(event: "ready", listener: () => void): this;
+ addListener(event: "resume", listener: () => void): this;
+ addListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ on(event: "close", listener: () => void): this;
+ on(event: "data", listener: (chunk: Buffer | string) => void): this;
+ on(event: "end", listener: () => void): this;
+ on(event: "error", listener: (err: Error) => void): this;
+ on(event: "open", listener: (fd: number) => void): this;
+ on(event: "pause", listener: () => void): this;
+ on(event: "readable", listener: () => void): this;
+ on(event: "ready", listener: () => void): this;
+ on(event: "resume", listener: () => void): this;
+ on(event: string | symbol, listener: (...args: any[]) => void): this;
+ once(event: "close", listener: () => void): this;
+ once(event: "data", listener: (chunk: Buffer | string) => void): this;
+ once(event: "end", listener: () => void): this;
+ once(event: "error", listener: (err: Error) => void): this;
+ once(event: "open", listener: (fd: number) => void): this;
+ once(event: "pause", listener: () => void): this;
+ once(event: "readable", listener: () => void): this;
+ once(event: "ready", listener: () => void): this;
+ once(event: "resume", listener: () => void): this;
+ once(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependListener(event: "close", listener: () => void): this;
+ prependListener(event: "data", listener: (chunk: Buffer | string) => void): this;
+ prependListener(event: "end", listener: () => void): this;
+ prependListener(event: "error", listener: (err: Error) => void): this;
+ prependListener(event: "open", listener: (fd: number) => void): this;
+ prependListener(event: "pause", listener: () => void): this;
+ prependListener(event: "readable", listener: () => void): this;
+ prependListener(event: "ready", listener: () => void): this;
+ prependListener(event: "resume", listener: () => void): this;
+ prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependOnceListener(event: "close", listener: () => void): this;
+ prependOnceListener(event: "data", listener: (chunk: Buffer | string) => void): this;
+ prependOnceListener(event: "end", listener: () => void): this;
+ prependOnceListener(event: "error", listener: (err: Error) => void): this;
+ prependOnceListener(event: "open", listener: (fd: number) => void): this;
+ prependOnceListener(event: "pause", listener: () => void): this;
+ prependOnceListener(event: "readable", listener: () => void): this;
+ prependOnceListener(event: "ready", listener: () => void): this;
+ prependOnceListener(event: "resume", listener: () => void): this;
+ prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ }
+ /**
+ * * Extends `stream.Writable`
+ *
+ * Instances of `fs.WriteStream` are created and returned using the {@link createWriteStream} function.
+ * @since v0.1.93
+ */
+ export class WriteStream extends stream.Writable {
+ /**
+ * Closes `writeStream`. Optionally accepts a
+ * callback that will be executed once the `writeStream`is closed.
+ * @since v0.9.4
+ */
+ close(callback?: (err?: NodeJS.ErrnoException | null) => void): void;
+ /**
+ * The number of bytes written so far. Does not include data that is still queued
+ * for writing.
+ * @since v0.4.7
+ */
+ bytesWritten: number;
+ /**
+ * The path to the file the stream is writing to as specified in the first
+ * argument to {@link createWriteStream}. If `path` is passed as a string, then`writeStream.path` will be a string. If `path` is passed as a `Buffer`, then`writeStream.path` will be a
+ * `Buffer`.
+ * @since v0.1.93
+ */
+ path: string | Buffer;
+ /**
+ * This property is `true` if the underlying file has not been opened yet,
+ * i.e. before the `'ready'` event is emitted.
+ * @since v11.2.0
+ */
+ pending: boolean;
+ /**
+ * events.EventEmitter
+ * 1. open
+ * 2. close
+ * 3. ready
+ */
+ addListener(event: "close", listener: () => void): this;
+ addListener(event: "drain", listener: () => void): this;
+ addListener(event: "error", listener: (err: Error) => void): this;
+ addListener(event: "finish", listener: () => void): this;
+ addListener(event: "open", listener: (fd: number) => void): this;
+ addListener(event: "pipe", listener: (src: stream.Readable) => void): this;
+ addListener(event: "ready", listener: () => void): this;
+ addListener(event: "unpipe", listener: (src: stream.Readable) => void): this;
+ addListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ on(event: "close", listener: () => void): this;
+ on(event: "drain", listener: () => void): this;
+ on(event: "error", listener: (err: Error) => void): this;
+ on(event: "finish", listener: () => void): this;
+ on(event: "open", listener: (fd: number) => void): this;
+ on(event: "pipe", listener: (src: stream.Readable) => void): this;
+ on(event: "ready", listener: () => void): this;
+ on(event: "unpipe", listener: (src: stream.Readable) => void): this;
+ on(event: string | symbol, listener: (...args: any[]) => void): this;
+ once(event: "close", listener: () => void): this;
+ once(event: "drain", listener: () => void): this;
+ once(event: "error", listener: (err: Error) => void): this;
+ once(event: "finish", listener: () => void): this;
+ once(event: "open", listener: (fd: number) => void): this;
+ once(event: "pipe", listener: (src: stream.Readable) => void): this;
+ once(event: "ready", listener: () => void): this;
+ once(event: "unpipe", listener: (src: stream.Readable) => void): this;
+ once(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependListener(event: "close", listener: () => void): this;
+ prependListener(event: "drain", listener: () => void): this;
+ prependListener(event: "error", listener: (err: Error) => void): this;
+ prependListener(event: "finish", listener: () => void): this;
+ prependListener(event: "open", listener: (fd: number) => void): this;
+ prependListener(event: "pipe", listener: (src: stream.Readable) => void): this;
+ prependListener(event: "ready", listener: () => void): this;
+ prependListener(event: "unpipe", listener: (src: stream.Readable) => void): this;
+ prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependOnceListener(event: "close", listener: () => void): this;
+ prependOnceListener(event: "drain", listener: () => void): this;
+ prependOnceListener(event: "error", listener: (err: Error) => void): this;
+ prependOnceListener(event: "finish", listener: () => void): this;
+ prependOnceListener(event: "open", listener: (fd: number) => void): this;
+ prependOnceListener(event: "pipe", listener: (src: stream.Readable) => void): this;
+ prependOnceListener(event: "ready", listener: () => void): this;
+ prependOnceListener(event: "unpipe", listener: (src: stream.Readable) => void): this;
+ prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ }
+ /**
+ * Asynchronously rename file at `oldPath` to the pathname provided
+ * as `newPath`. In the case that `newPath` already exists, it will
+ * be overwritten. If there is a directory at `newPath`, an error will
+ * be raised instead. No arguments other than a possible exception are
+ * given to the completion callback.
+ *
+ * See also: [`rename(2)`](http://man7.org/linux/man-pages/man2/rename.2.html).
+ *
+ * ```js
+ * import { rename } from 'fs';
+ *
+ * rename('oldFile.txt', 'newFile.txt', (err) => {
+ * if (err) throw err;
+ * console.log('Rename complete!');
+ * });
+ * ```
+ * @since v0.0.2
+ */
+ export function rename(oldPath: PathLike, newPath: PathLike, callback: NoParamCallback): void;
+ export namespace rename {
+ /**
+ * Asynchronous rename(2) - Change the name or location of a file or directory.
+ * @param oldPath A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * URL support is _experimental_.
+ * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * URL support is _experimental_.
+ */
+ function __promisify__(oldPath: PathLike, newPath: PathLike): Promise<void>;
+ }
+ /**
+ * Renames the file from `oldPath` to `newPath`. Returns `undefined`.
+ *
+ * See the POSIX [`rename(2)`](http://man7.org/linux/man-pages/man2/rename.2.html) documentation for more details.
+ * @since v0.1.21
+ */
+ export function renameSync(oldPath: PathLike, newPath: PathLike): void;
+ /**
+ * Truncates the file. No arguments other than a possible exception are
+ * given to the completion callback. A file descriptor can also be passed as the
+ * first argument. In this case, `fs.ftruncate()` is called.
+ *
+ * ```js
+ * import { truncate } from 'fs';
+ * // Assuming that 'path/file.txt' is a regular file.
+ * truncate('path/file.txt', (err) => {
+ * if (err) throw err;
+ * console.log('path/file.txt was truncated');
+ * });
+ * ```
+ *
+ * Passing a file descriptor is deprecated and may result in an error being thrown
+ * in the future.
+ *
+ * See the POSIX [`truncate(2)`](http://man7.org/linux/man-pages/man2/truncate.2.html) documentation for more details.
+ * @since v0.8.6
+ * @param [len=0]
+ */
+ export function truncate(path: PathLike, len: number | undefined | null, callback: NoParamCallback): void;
+ /**
+ * Asynchronous truncate(2) - Truncate a file to a specified length.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ */
+ export function truncate(path: PathLike, callback: NoParamCallback): void;
+ export namespace truncate {
+ /**
+ * Asynchronous truncate(2) - Truncate a file to a specified length.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * @param len If not specified, defaults to `0`.
+ */
+ function __promisify__(path: PathLike, len?: number | null): Promise<void>;
+ }
+ /**
+ * Truncates the file. Returns `undefined`. A file descriptor can also be
+ * passed as the first argument. In this case, `fs.ftruncateSync()` is called.
+ *
+ * Passing a file descriptor is deprecated and may result in an error being thrown
+ * in the future.
+ * @since v0.8.6
+ * @param [len=0]
+ */
+ export function truncateSync(path: PathLike, len?: number | null): void;
+ /**
+ * Truncates the file descriptor. No arguments other than a possible exception are
+ * given to the completion callback.
+ *
+ * See the POSIX [`ftruncate(2)`](http://man7.org/linux/man-pages/man2/ftruncate.2.html) documentation for more detail.
+ *
+ * If the file referred to by the file descriptor was larger than `len` bytes, only
+ * the first `len` bytes will be retained in the file.
+ *
+ * For example, the following program retains only the first four bytes of the
+ * file:
+ *
+ * ```js
+ * import { open, close, ftruncate } from 'fs';
+ *
+ * function closeFd(fd) {
+ * close(fd, (err) => {
+ * if (err) throw err;
+ * });
+ * }
+ *
+ * open('temp.txt', 'r+', (err, fd) => {
+ * if (err) throw err;
+ *
+ * try {
+ * ftruncate(fd, 4, (err) => {
+ * closeFd(fd);
+ * if (err) throw err;
+ * });
+ * } catch (err) {
+ * closeFd(fd);
+ * if (err) throw err;
+ * }
+ * });
+ * ```
+ *
+ * If the file previously was shorter than `len` bytes, it is extended, and the
+ * extended part is filled with null bytes (`'\0'`):
+ *
+ * If `len` is negative then `0` will be used.
+ * @since v0.8.6
+ * @param [len=0]
+ */
+ export function ftruncate(fd: number, len: number | undefined | null, callback: NoParamCallback): void;
+ /**
+ * Asynchronous ftruncate(2) - Truncate a file to a specified length.
+ * @param fd A file descriptor.
+ */
+ export function ftruncate(fd: number, callback: NoParamCallback): void;
+ export namespace ftruncate {
+ /**
+ * Asynchronous ftruncate(2) - Truncate a file to a specified length.
+ * @param fd A file descriptor.
+ * @param len If not specified, defaults to `0`.
+ */
+ function __promisify__(fd: number, len?: number | null): Promise<void>;
+ }
+ /**
+ * Truncates the file descriptor. Returns `undefined`.
+ *
+ * For detailed information, see the documentation of the asynchronous version of
+ * this API: {@link ftruncate}.
+ * @since v0.8.6
+ * @param [len=0]
+ */
+ export function ftruncateSync(fd: number, len?: number | null): void;
+ /**
+ * Asynchronously changes owner and group of a file. No arguments other than a
+ * possible exception are given to the completion callback.
+ *
+ * See the POSIX [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html) documentation for more detail.
+ * @since v0.1.97
+ */
+ export function chown(path: PathLike, uid: number, gid: number, callback: NoParamCallback): void;
+ export namespace chown {
+ /**
+ * Asynchronous chown(2) - Change ownership of a file.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ */
+ function __promisify__(path: PathLike, uid: number, gid: number): Promise<void>;
+ }
+ /**
+ * Synchronously changes owner and group of a file. Returns `undefined`.
+ * This is the synchronous version of {@link chown}.
+ *
+ * See the POSIX [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html) documentation for more detail.
+ * @since v0.1.97
+ */
+ export function chownSync(path: PathLike, uid: number, gid: number): void;
+ /**
+ * Sets the owner of the file. No arguments other than a possible exception are
+ * given to the completion callback.
+ *
+ * See the POSIX [`fchown(2)`](http://man7.org/linux/man-pages/man2/fchown.2.html) documentation for more detail.
+ * @since v0.4.7
+ */
+ export function fchown(fd: number, uid: number, gid: number, callback: NoParamCallback): void;
+ export namespace fchown {
+ /**
+ * Asynchronous fchown(2) - Change ownership of a file.
+ * @param fd A file descriptor.
+ */
+ function __promisify__(fd: number, uid: number, gid: number): Promise<void>;
+ }
+ /**
+ * Sets the owner of the file. Returns `undefined`.
+ *
+ * See the POSIX [`fchown(2)`](http://man7.org/linux/man-pages/man2/fchown.2.html) documentation for more detail.
+ * @since v0.4.7
+ * @param uid The file's new owner's user id.
+ * @param gid The file's new group's group id.
+ */
+ export function fchownSync(fd: number, uid: number, gid: number): void;
+ /**
+ * Set the owner of the symbolic link. No arguments other than a possible
+ * exception are given to the completion callback.
+ *
+ * See the POSIX [`lchown(2)`](http://man7.org/linux/man-pages/man2/lchown.2.html) documentation for more detail.
+ */
+ export function lchown(path: PathLike, uid: number, gid: number, callback: NoParamCallback): void;
+ export namespace lchown {
+ /**
+ * Asynchronous lchown(2) - Change ownership of a file. Does not dereference symbolic links.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ */
+ function __promisify__(path: PathLike, uid: number, gid: number): Promise<void>;
+ }
+ /**
+ * Set the owner for the path. Returns `undefined`.
+ *
+ * See the POSIX [`lchown(2)`](http://man7.org/linux/man-pages/man2/lchown.2.html) documentation for more details.
+ * @param uid The file's new owner's user id.
+ * @param gid The file's new group's group id.
+ */
+ export function lchownSync(path: PathLike, uid: number, gid: number): void;
+ /**
+ * Changes the access and modification times of a file in the same way as {@link utimes}, with the difference that if the path refers to a symbolic
+ * link, then the link is not dereferenced: instead, the timestamps of the
+ * symbolic link itself are changed.
+ *
+ * No arguments other than a possible exception are given to the completion
+ * callback.
+ * @since v14.5.0, v12.19.0
+ */
+ export function lutimes(path: PathLike, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void;
+ export namespace lutimes {
+ /**
+ * Changes the access and modification times of a file in the same way as `fsPromises.utimes()`,
+ * with the difference that if the path refers to a symbolic link, then the link is not
+ * dereferenced: instead, the timestamps of the symbolic link itself are changed.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * @param atime The last access time. If a string is provided, it will be coerced to number.
+ * @param mtime The last modified time. If a string is provided, it will be coerced to number.
+ */
+ function __promisify__(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise<void>;
+ }
+ /**
+ * Change the file system timestamps of the symbolic link referenced by `path`.
+ * Returns `undefined`, or throws an exception when parameters are incorrect or
+ * the operation fails. This is the synchronous version of {@link lutimes}.
+ * @since v14.5.0, v12.19.0
+ */
+ export function lutimesSync(path: PathLike, atime: TimeLike, mtime: TimeLike): void;
+ /**
+ * Asynchronously changes the permissions of a file. No arguments other than a
+ * possible exception are given to the completion callback.
+ *
+ * See the POSIX [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html) documentation for more detail.
+ *
+ * ```js
+ * import { chmod } from 'fs';
+ *
+ * chmod('my_file.txt', 0o775, (err) => {
+ * if (err) throw err;
+ * console.log('The permissions for file "my_file.txt" have been changed!');
+ * });
+ * ```
+ * @since v0.1.30
+ */
+ export function chmod(path: PathLike, mode: Mode, callback: NoParamCallback): void;
+ export namespace chmod {
+ /**
+ * Asynchronous chmod(2) - Change permissions of a file.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * @param mode A file mode. If a string is passed, it is parsed as an octal integer.
+ */
+ function __promisify__(path: PathLike, mode: Mode): Promise<void>;
+ }
+ /**
+ * For detailed information, see the documentation of the asynchronous version of
+ * this API: {@link chmod}.
+ *
+ * See the POSIX [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html) documentation for more detail.
+ * @since v0.6.7
+ */
+ export function chmodSync(path: PathLike, mode: Mode): void;
+ /**
+ * Sets the permissions on the file. No arguments other than a possible exception
+ * are given to the completion callback.
+ *
+ * See the POSIX [`fchmod(2)`](http://man7.org/linux/man-pages/man2/fchmod.2.html) documentation for more detail.
+ * @since v0.4.7
+ */
+ export function fchmod(fd: number, mode: Mode, callback: NoParamCallback): void;
+ export namespace fchmod {
+ /**
+ * Asynchronous fchmod(2) - Change permissions of a file.
+ * @param fd A file descriptor.
+ * @param mode A file mode. If a string is passed, it is parsed as an octal integer.
+ */
+ function __promisify__(fd: number, mode: Mode): Promise<void>;
+ }
+ /**
+ * Sets the permissions on the file. Returns `undefined`.
+ *
+ * See the POSIX [`fchmod(2)`](http://man7.org/linux/man-pages/man2/fchmod.2.html) documentation for more detail.
+ * @since v0.4.7
+ */
+ export function fchmodSync(fd: number, mode: Mode): void;
+ /**
+ * Changes the permissions on a symbolic link. No arguments other than a possible
+ * exception are given to the completion callback.
+ *
+ * This method is only implemented on macOS.
+ *
+ * See the POSIX [`lchmod(2)`](https://www.freebsd.org/cgi/man.cgi?query=lchmod&sektion=2) documentation for more detail.
+ * @deprecated Since v0.4.7
+ */
+ export function lchmod(path: PathLike, mode: Mode, callback: NoParamCallback): void;
+ /** @deprecated */
+ export namespace lchmod {
+ /**
+ * Asynchronous lchmod(2) - Change permissions of a file. Does not dereference symbolic links.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * @param mode A file mode. If a string is passed, it is parsed as an octal integer.
+ */
+ function __promisify__(path: PathLike, mode: Mode): Promise<void>;
+ }
+ /**
+ * Changes the permissions on a symbolic link. Returns `undefined`.
+ *
+ * This method is only implemented on macOS.
+ *
+ * See the POSIX [`lchmod(2)`](https://www.freebsd.org/cgi/man.cgi?query=lchmod&sektion=2) documentation for more detail.
+ * @deprecated Since v0.4.7
+ */
+ export function lchmodSync(path: PathLike, mode: Mode): void;
+ /**
+ * Asynchronous [`stat(2)`](http://man7.org/linux/man-pages/man2/stat.2.html). The callback gets two arguments `(err, stats)` where`stats` is an `fs.Stats` object.
+ *
+ * In case of an error, the `err.code` will be one of `Common System Errors`.
+ *
+ * Using `fs.stat()` to check for the existence of a file before calling`fs.open()`, `fs.readFile()` or `fs.writeFile()` is not recommended.
+ * Instead, user code should open/read/write the file directly and handle the
+ * error raised if the file is not available.
+ *
+ * To check if a file exists without manipulating it afterwards, {@link access} is recommended.
+ *
+ * For example, given the following directory structure:
+ *
+ * ```text
+ * - txtDir
+ * -- file.txt
+ * - app.js
+ * ```
+ *
+ * The next program will check for the stats of the given paths:
+ *
+ * ```js
+ * import { stat } from 'fs';
+ *
+ * const pathsToCheck = ['./txtDir', './txtDir/file.txt'];
+ *
+ * for (let i = 0; i < pathsToCheck.length; i++) {
+ * stat(pathsToCheck[i], (err, stats) => {
+ * console.log(stats.isDirectory());
+ * console.log(stats);
+ * });
+ * }
+ * ```
+ *
+ * The resulting output will resemble:
+ *
+ * ```console
+ * true
+ * Stats {
+ * dev: 16777220,
+ * mode: 16877,
+ * nlink: 3,
+ * uid: 501,
+ * gid: 20,
+ * rdev: 0,
+ * blksize: 4096,
+ * ino: 14214262,
+ * size: 96,
+ * blocks: 0,
+ * atimeMs: 1561174653071.963,
+ * mtimeMs: 1561174614583.3518,
+ * ctimeMs: 1561174626623.5366,
+ * birthtimeMs: 1561174126937.2893,
+ * atime: 2019-06-22T03:37:33.072Z,
+ * mtime: 2019-06-22T03:36:54.583Z,
+ * ctime: 2019-06-22T03:37:06.624Z,
+ * birthtime: 2019-06-22T03:28:46.937Z
+ * }
+ * false
+ * Stats {
+ * dev: 16777220,
+ * mode: 33188,
+ * nlink: 1,
+ * uid: 501,
+ * gid: 20,
+ * rdev: 0,
+ * blksize: 4096,
+ * ino: 14214074,
+ * size: 8,
+ * blocks: 8,
+ * atimeMs: 1561174616618.8555,
+ * mtimeMs: 1561174614584,
+ * ctimeMs: 1561174614583.8145,
+ * birthtimeMs: 1561174007710.7478,
+ * atime: 2019-06-22T03:36:56.619Z,
+ * mtime: 2019-06-22T03:36:54.584Z,
+ * ctime: 2019-06-22T03:36:54.584Z,
+ * birthtime: 2019-06-22T03:26:47.711Z
+ * }
+ * ```
+ * @since v0.0.2
+ */
+ export function stat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void;
+ export function stat(
+ path: PathLike,
+ options:
+ | (StatOptions & {
+ bigint?: false | undefined;
+ })
+ | undefined,
+ callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void,
+ ): void;
+ export function stat(
+ path: PathLike,
+ options: StatOptions & {
+ bigint: true;
+ },
+ callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void,
+ ): void;
+ export function stat(
+ path: PathLike,
+ options: StatOptions | undefined,
+ callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void,
+ ): void;
+ export namespace stat {
+ /**
+ * Asynchronous stat(2) - Get file status.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ */
+ function __promisify__(
+ path: PathLike,
+ options?: StatOptions & {
+ bigint?: false | undefined;
+ },
+ ): Promise<Stats>;
+ function __promisify__(
+ path: PathLike,
+ options: StatOptions & {
+ bigint: true;
+ },
+ ): Promise<BigIntStats>;
+ function __promisify__(path: PathLike, options?: StatOptions): Promise<Stats | BigIntStats>;
+ }
+ export interface StatSyncFn extends Function {
+ (path: PathLike, options?: undefined): Stats;
+ (
+ path: PathLike,
+ options?: StatSyncOptions & {
+ bigint?: false | undefined;
+ throwIfNoEntry: false;
+ },
+ ): Stats | undefined;
+ (
+ path: PathLike,
+ options: StatSyncOptions & {
+ bigint: true;
+ throwIfNoEntry: false;
+ },
+ ): BigIntStats | undefined;
+ (
+ path: PathLike,
+ options?: StatSyncOptions & {
+ bigint?: false | undefined;
+ },
+ ): Stats;
+ (
+ path: PathLike,
+ options: StatSyncOptions & {
+ bigint: true;
+ },
+ ): BigIntStats;
+ (
+ path: PathLike,
+ options: StatSyncOptions & {
+ bigint: boolean;
+ throwIfNoEntry?: false | undefined;
+ },
+ ): Stats | BigIntStats;
+ (path: PathLike, options?: StatSyncOptions): Stats | BigIntStats | undefined;
+ }
+ /**
+ * Synchronous stat(2) - Get file status.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ */
+ export const statSync: StatSyncFn;
+ /**
+ * Invokes the callback with the `fs.Stats` for the file descriptor.
+ *
+ * See the POSIX [`fstat(2)`](http://man7.org/linux/man-pages/man2/fstat.2.html) documentation for more detail.
+ * @since v0.1.95
+ */
+ export function fstat(fd: number, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void;
+ export function fstat(
+ fd: number,
+ options:
+ | (StatOptions & {
+ bigint?: false | undefined;
+ })
+ | undefined,
+ callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void,
+ ): void;
+ export function fstat(
+ fd: number,
+ options: StatOptions & {
+ bigint: true;
+ },
+ callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void,
+ ): void;
+ export function fstat(
+ fd: number,
+ options: StatOptions | undefined,
+ callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void,
+ ): void;
+ export namespace fstat {
+ /**
+ * Asynchronous fstat(2) - Get file status.
+ * @param fd A file descriptor.
+ */
+ function __promisify__(
+ fd: number,
+ options?: StatOptions & {
+ bigint?: false | undefined;
+ },
+ ): Promise<Stats>;
+ function __promisify__(
+ fd: number,
+ options: StatOptions & {
+ bigint: true;
+ },
+ ): Promise<BigIntStats>;
+ function __promisify__(fd: number, options?: StatOptions): Promise<Stats | BigIntStats>;
+ }
+ /**
+ * Retrieves the `fs.Stats` for the file descriptor.
+ *
+ * See the POSIX [`fstat(2)`](http://man7.org/linux/man-pages/man2/fstat.2.html) documentation for more detail.
+ * @since v0.1.95
+ */
+ export function fstatSync(
+ fd: number,
+ options?: StatOptions & {
+ bigint?: false | undefined;
+ },
+ ): Stats;
+ export function fstatSync(
+ fd: number,
+ options: StatOptions & {
+ bigint: true;
+ },
+ ): BigIntStats;
+ export function fstatSync(fd: number, options?: StatOptions): Stats | BigIntStats;
+ /**
+ * Retrieves the `fs.Stats` for the symbolic link referred to by the path.
+ * The callback gets two arguments `(err, stats)` where `stats` is a `fs.Stats` object. `lstat()` is identical to `stat()`, except that if `path` is a symbolic
+ * link, then the link itself is stat-ed, not the file that it refers to.
+ *
+ * See the POSIX [`lstat(2)`](http://man7.org/linux/man-pages/man2/lstat.2.html) documentation for more details.
+ * @since v0.1.30
+ */
+ export function lstat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void;
+ export function lstat(
+ path: PathLike,
+ options:
+ | (StatOptions & {
+ bigint?: false | undefined;
+ })
+ | undefined,
+ callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void,
+ ): void;
+ export function lstat(
+ path: PathLike,
+ options: StatOptions & {
+ bigint: true;
+ },
+ callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void,
+ ): void;
+ export function lstat(
+ path: PathLike,
+ options: StatOptions | undefined,
+ callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void,
+ ): void;
+ export namespace lstat {
+ /**
+ * Asynchronous lstat(2) - Get file status. Does not dereference symbolic links.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ */
+ function __promisify__(
+ path: PathLike,
+ options?: StatOptions & {
+ bigint?: false | undefined;
+ },
+ ): Promise<Stats>;
+ function __promisify__(
+ path: PathLike,
+ options: StatOptions & {
+ bigint: true;
+ },
+ ): Promise<BigIntStats>;
+ function __promisify__(path: PathLike, options?: StatOptions): Promise<Stats | BigIntStats>;
+ }
+ /**
+ * Asynchronous statfs(2). Returns information about the mounted file system which contains path. The callback gets two arguments (err, stats) where stats is an <fs.StatFs> object.
+ * In case of an error, the err.code will be one of Common System Errors.
+ * @param path A path to an existing file or directory on the file system to be queried.
+ * @param callback
+ */
+ export function statfs(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: StatsFs) => void): void;
+ export function statfs(
+ path: PathLike,
+ options:
+ | (StatFsOptions & {
+ bigint?: false | undefined;
+ })
+ | undefined,
+ callback: (err: NodeJS.ErrnoException | null, stats: StatsFs) => void,
+ ): void;
+ export function statfs(
+ path: PathLike,
+ options: StatFsOptions & {
+ bigint: true;
+ },
+ callback: (err: NodeJS.ErrnoException | null, stats: BigIntStatsFs) => void,
+ ): void;
+ export function statfs(
+ path: PathLike,
+ options: StatFsOptions | undefined,
+ callback: (err: NodeJS.ErrnoException | null, stats: StatsFs | BigIntStatsFs) => void,
+ ): void;
+ export namespace statfs {
+ /**
+ * Asynchronous statfs(2) - Returns information about the mounted file system which contains path. The callback gets two arguments (err, stats) where stats is an <fs.StatFs> object.
+ * @param path A path to an existing file or directory on the file system to be queried.
+ */
+ function __promisify__(
+ path: PathLike,
+ options?: StatFsOptions & {
+ bigint?: false | undefined;
+ },
+ ): Promise<StatsFs>;
+ function __promisify__(
+ path: PathLike,
+ options: StatFsOptions & {
+ bigint: true;
+ },
+ ): Promise<BigIntStatsFs>;
+ function __promisify__(path: PathLike, options?: StatFsOptions): Promise<StatsFs | BigIntStatsFs>;
+ }
+
+ /**
+ * Synchronous statfs(2). Returns information about the mounted file system which contains path. The callback gets two arguments (err, stats) where stats is an <fs.StatFs> object.
+ * In case of an error, the err.code will be one of Common System Errors.
+ * @param path A path to an existing file or directory on the file system to be queried.
+ * @param callback
+ */
+ export function statfsSync(
+ path: PathLike,
+ options?: StatFsOptions & {
+ bigint?: false | undefined;
+ },
+ ): StatsFs;
+ export function statfsSync(
+ path: PathLike,
+ options: StatFsOptions & {
+ bigint: true;
+ },
+ ): BigIntStatsFs;
+
+ export function statfsSync(path: PathLike, options?: StatFsOptions): StatsFs | BigIntStatsFs;
+ /**
+ * Synchronous lstat(2) - Get file status. Does not dereference symbolic links.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ */
+ export const lstatSync: StatSyncFn;
+ /**
+ * 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. No arguments other than
+ * a possible
+ * exception are given to the completion callback.
+ * @since v0.1.31
+ */
+ export function link(existingPath: PathLike, newPath: PathLike, callback: NoParamCallback): void;
+ export namespace link {
+ /**
+ * Asynchronous link(2) - Create a new link (also known as a hard link) to an existing file.
+ * @param existingPath A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol.
+ */
+ function __promisify__(existingPath: PathLike, newPath: PathLike): Promise<void>;
+ }
+ /**
+ * 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. Returns `undefined`.
+ * @since v0.1.31
+ */
+ export function linkSync(existingPath: PathLike, newPath: PathLike): void;
+ /**
+ * Creates the link called `path` pointing to `target`. No arguments other than a
+ * possible exception are given to the completion callback.
+ *
+ * See the POSIX [`symlink(2)`](http://man7.org/linux/man-pages/man2/symlink.2.html) documentation for more details.
+ *
+ * The `type` argument is only available on Windows and ignored on other platforms.
+ * It can be set to `'dir'`, `'file'`, or `'junction'`. If the `type` argument is
+ * not set, Node.js will autodetect `target` type and use `'file'` or `'dir'`. If
+ * the `target` does not exist, `'file'` will be used. Windows junction points
+ * require the destination path to be absolute. When using `'junction'`, the`target` argument will automatically be normalized to absolute path.
+ *
+ * Relative targets are relative to the link’s parent directory.
+ *
+ * ```js
+ * import { symlink } from 'fs';
+ *
+ * symlink('./mew', './mewtwo', callback);
+ * ```
+ *
+ * The above example creates a symbolic link `mewtwo` which points to `mew` in the
+ * same directory:
+ *
+ * ```bash
+ * $ tree .
+ * .
+ * ├── mew
+ * └── mewtwo -> ./mew
+ * ```
+ * @since v0.1.31
+ */
+ export function symlink(
+ target: PathLike,
+ path: PathLike,
+ type: symlink.Type | undefined | null,
+ callback: NoParamCallback,
+ ): void;
+ /**
+ * Asynchronous symlink(2) - Create a new symbolic link to an existing file.
+ * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol.
+ * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol.
+ */
+ export function symlink(target: PathLike, path: PathLike, callback: NoParamCallback): void;
+ export namespace symlink {
+ /**
+ * Asynchronous symlink(2) - Create a new symbolic link to an existing file.
+ * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol.
+ * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol.
+ * @param type May be set to `'dir'`, `'file'`, or `'junction'` (default is `'file'`) and is only available on Windows (ignored on other platforms).
+ * When using `'junction'`, the `target` argument will automatically be normalized to an absolute path.
+ */
+ function __promisify__(target: PathLike, path: PathLike, type?: string | null): Promise<void>;
+ type Type = "dir" | "file" | "junction";
+ }
+ /**
+ * Returns `undefined`.
+ *
+ * For detailed information, see the documentation of the asynchronous version of
+ * this API: {@link symlink}.
+ * @since v0.1.31
+ */
+ export function symlinkSync(target: PathLike, path: PathLike, type?: symlink.Type | null): void;
+ /**
+ * Reads the contents of the symbolic link referred to by `path`. The callback gets
+ * two arguments `(err, linkString)`.
+ *
+ * See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more details.
+ *
+ * The optional `options` argument can be a string specifying an encoding, or an
+ * object with an `encoding` property specifying the character encoding to use for
+ * the link path passed to the callback. If the `encoding` is set to `'buffer'`,
+ * the link path returned will be passed as a `Buffer` object.
+ * @since v0.1.31
+ */
+ export function readlink(
+ path: PathLike,
+ options: EncodingOption,
+ callback: (err: NodeJS.ErrnoException | null, linkString: string) => void,
+ ): void;
+ /**
+ * Asynchronous readlink(2) - read value of a symbolic link.
+ * @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.
+ */
+ export function readlink(
+ path: PathLike,
+ options: BufferEncodingOption,
+ callback: (err: NodeJS.ErrnoException | null, linkString: Buffer) => void,
+ ): void;
+ /**
+ * Asynchronous readlink(2) - read value of a symbolic link.
+ * @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.
+ */
+ export function readlink(
+ path: PathLike,
+ options: EncodingOption,
+ callback: (err: NodeJS.ErrnoException | null, linkString: string | Buffer) => void,
+ ): void;
+ /**
+ * Asynchronous readlink(2) - read value of a symbolic link.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ */
+ export function readlink(
+ path: PathLike,
+ callback: (err: NodeJS.ErrnoException | null, linkString: string) => void,
+ ): void;
+ export namespace readlink {
+ /**
+ * Asynchronous readlink(2) - read value of a symbolic link.
+ * @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.
+ */
+ function __promisify__(path: PathLike, options?: EncodingOption): Promise<string>;
+ /**
+ * Asynchronous readlink(2) - read value of a symbolic link.
+ * @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.
+ */
+ function __promisify__(path: PathLike, options: BufferEncodingOption): Promise<Buffer>;
+ /**
+ * Asynchronous readlink(2) - read value of a symbolic link.
+ * @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.
+ */
+ function __promisify__(path: PathLike, options?: EncodingOption): Promise<string | Buffer>;
+ }
+ /**
+ * Returns the symbolic link's string value.
+ *
+ * See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more details.
+ *
+ * The optional `options` argument can be a string specifying an encoding, or an
+ * object with an `encoding` property specifying the character encoding to use for
+ * the link path returned. If the `encoding` is set to `'buffer'`,
+ * the link path returned will be passed as a `Buffer` object.
+ * @since v0.1.31
+ */
+ export function readlinkSync(path: PathLike, options?: EncodingOption): string;
+ /**
+ * Synchronous readlink(2) - read value of a symbolic link.
+ * @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.
+ */
+ export function readlinkSync(path: PathLike, options: BufferEncodingOption): Buffer;
+ /**
+ * Synchronous readlink(2) - read value of a symbolic link.
+ * @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.
+ */
+ export function readlinkSync(path: PathLike, options?: EncodingOption): string | Buffer;
+ /**
+ * Asynchronously computes the canonical pathname by resolving `.`, `..` and
+ * symbolic links.
+ *
+ * A canonical pathname is not necessarily unique. Hard links and bind mounts can
+ * expose a file system entity through many pathnames.
+ *
+ * This function behaves like [`realpath(3)`](http://man7.org/linux/man-pages/man3/realpath.3.html), with some exceptions:
+ *
+ * 1. No case conversion is performed on case-insensitive file systems.
+ * 2. The maximum number of symbolic links is platform-independent and generally
+ * (much) higher than what the native [`realpath(3)`](http://man7.org/linux/man-pages/man3/realpath.3.html) implementation supports.
+ *
+ * The `callback` gets two arguments `(err, resolvedPath)`. May use `process.cwd`to resolve relative paths.
+ *
+ * Only paths that can be converted to UTF8 strings are supported.
+ *
+ * The optional `options` argument can be a string specifying an encoding, or an
+ * object with an `encoding` property specifying the character encoding to use for
+ * the path passed to the callback. If the `encoding` is set to `'buffer'`,
+ * the path returned will be passed as a `Buffer` object.
+ *
+ * If `path` resolves to a socket or a pipe, the function will return a system
+ * dependent name for that object.
+ * @since v0.1.31
+ */
+ export function realpath(
+ path: PathLike,
+ options: EncodingOption,
+ callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void,
+ ): void;
+ /**
+ * Asynchronous realpath(3) - return the canonicalized absolute pathname.
+ * @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.
+ */
+ export function realpath(
+ path: PathLike,
+ options: BufferEncodingOption,
+ callback: (err: NodeJS.ErrnoException | null, resolvedPath: Buffer) => void,
+ ): void;
+ /**
+ * Asynchronous realpath(3) - return the canonicalized absolute pathname.
+ * @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.
+ */
+ export function realpath(
+ path: PathLike,
+ options: EncodingOption,
+ callback: (err: NodeJS.ErrnoException | null, resolvedPath: string | Buffer) => void,
+ ): void;
+ /**
+ * Asynchronous realpath(3) - return the canonicalized absolute pathname.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ */
+ export function realpath(
+ path: PathLike,
+ callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void,
+ ): void;
+ export namespace realpath {
+ /**
+ * Asynchronous realpath(3) - return the canonicalized absolute pathname.
+ * @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.
+ */
+ function __promisify__(path: PathLike, options?: EncodingOption): Promise<string>;
+ /**
+ * Asynchronous realpath(3) - return the canonicalized absolute pathname.
+ * @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.
+ */
+ function __promisify__(path: PathLike, options: BufferEncodingOption): Promise<Buffer>;
+ /**
+ * Asynchronous realpath(3) - return the canonicalized absolute pathname.
+ * @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.
+ */
+ function __promisify__(path: PathLike, options?: EncodingOption): Promise<string | Buffer>;
+ /**
+ * Asynchronous [`realpath(3)`](http://man7.org/linux/man-pages/man3/realpath.3.html).
+ *
+ * The `callback` gets two arguments `(err, resolvedPath)`.
+ *
+ * Only paths that can be converted to UTF8 strings are supported.
+ *
+ * The optional `options` argument can be a string specifying an encoding, or an
+ * object with an `encoding` property specifying the character encoding to use for
+ * the path passed to the callback. If the `encoding` is set to `'buffer'`,
+ * the path returned will be passed as a `Buffer` object.
+ *
+ * On Linux, when Node.js is linked against musl libc, the procfs file system must
+ * be mounted on `/proc` in order for this function to work. Glibc does not have
+ * this restriction.
+ * @since v9.2.0
+ */
+ function native(
+ path: PathLike,
+ options: EncodingOption,
+ callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void,
+ ): void;
+ function native(
+ path: PathLike,
+ options: BufferEncodingOption,
+ callback: (err: NodeJS.ErrnoException | null, resolvedPath: Buffer) => void,
+ ): void;
+ function native(
+ path: PathLike,
+ options: EncodingOption,
+ callback: (err: NodeJS.ErrnoException | null, resolvedPath: string | Buffer) => void,
+ ): void;
+ function native(
+ path: PathLike,
+ callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void,
+ ): void;
+ }
+ /**
+ * Returns the resolved pathname.
+ *
+ * For detailed information, see the documentation of the asynchronous version of
+ * this API: {@link realpath}.
+ * @since v0.1.31
+ */
+ export function realpathSync(path: PathLike, options?: EncodingOption): string;
+ /**
+ * Synchronous realpath(3) - return the canonicalized absolute pathname.
+ * @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.
+ */
+ export function realpathSync(path: PathLike, options: BufferEncodingOption): Buffer;
+ /**
+ * Synchronous realpath(3) - return the canonicalized absolute pathname.
+ * @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.
+ */
+ export function realpathSync(path: PathLike, options?: EncodingOption): string | Buffer;
+ export namespace realpathSync {
+ function native(path: PathLike, options?: EncodingOption): string;
+ function native(path: PathLike, options: BufferEncodingOption): Buffer;
+ function native(path: PathLike, options?: EncodingOption): string | Buffer;
+ }
+ /**
+ * Asynchronously removes a file or symbolic link. No arguments other than a
+ * possible exception are given to the completion callback.
+ *
+ * ```js
+ * import { unlink } from 'fs';
+ * // Assuming that 'path/file.txt' is a regular file.
+ * unlink('path/file.txt', (err) => {
+ * if (err) throw err;
+ * console.log('path/file.txt was deleted');
+ * });
+ * ```
+ *
+ * `fs.unlink()` will not work on a directory, empty or otherwise. To remove a
+ * directory, use {@link rmdir}.
+ *
+ * See the POSIX [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html) documentation for more details.
+ * @since v0.0.2
+ */
+ export function unlink(path: PathLike, callback: NoParamCallback): void;
+ export namespace unlink {
+ /**
+ * Asynchronous unlink(2) - delete a name and possibly the file it refers to.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ */
+ function __promisify__(path: PathLike): Promise<void>;
+ }
+ /**
+ * Synchronous [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html). Returns `undefined`.
+ * @since v0.1.21
+ */
+ export function unlinkSync(path: PathLike): void;
+ export interface RmDirOptions {
+ /**
+ * If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or
+ * `EPERM` error is encountered, Node.js will retry the operation with a linear
+ * backoff wait of `retryDelay` ms longer on each try. This option represents the
+ * number of retries. This option is ignored if the `recursive` option is not
+ * `true`.
+ * @default 0
+ */
+ maxRetries?: number | undefined;
+ /**
+ * @deprecated since v14.14.0 In future versions of Node.js and will trigger a warning
+ * `fs.rmdir(path, { recursive: true })` will throw if `path` does not exist or is a file.
+ * Use `fs.rm(path, { recursive: true, force: true })` instead.
+ *
+ * If `true`, perform a recursive directory removal. In
+ * recursive mode, operations are retried on failure.
+ * @default false
+ */
+ recursive?: boolean | undefined;
+ /**
+ * The amount of time in milliseconds to wait between retries.
+ * This option is ignored if the `recursive` option is not `true`.
+ * @default 100
+ */
+ retryDelay?: number | undefined;
+ }
+ /**
+ * Asynchronous [`rmdir(2)`](http://man7.org/linux/man-pages/man2/rmdir.2.html). No arguments other than a possible exception are given
+ * to the completion callback.
+ *
+ * Using `fs.rmdir()` on a file (not a directory) results in an `ENOENT` error on
+ * Windows and an `ENOTDIR` error on POSIX.
+ *
+ * To get a behavior similar to the `rm -rf` Unix command, use {@link rm} with options `{ recursive: true, force: true }`.
+ * @since v0.0.2
+ */
+ export function rmdir(path: PathLike, callback: NoParamCallback): void;
+ export function rmdir(path: PathLike, options: RmDirOptions, callback: NoParamCallback): void;
+ export namespace rmdir {
+ /**
+ * Asynchronous rmdir(2) - delete a directory.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ */
+ function __promisify__(path: PathLike, options?: RmDirOptions): Promise<void>;
+ }
+ /**
+ * Synchronous [`rmdir(2)`](http://man7.org/linux/man-pages/man2/rmdir.2.html). Returns `undefined`.
+ *
+ * Using `fs.rmdirSync()` on a file (not a directory) results in an `ENOENT` error
+ * on Windows and an `ENOTDIR` error on POSIX.
+ *
+ * To get a behavior similar to the `rm -rf` Unix command, use {@link rmSync} with options `{ recursive: true, force: true }`.
+ * @since v0.1.21
+ */
+ export function rmdirSync(path: PathLike, options?: RmDirOptions): void;
+ export interface RmOptions {
+ /**
+ * When `true`, exceptions will be ignored if `path` does not exist.
+ * @default false
+ */
+ force?: boolean | undefined;
+ /**
+ * If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or
+ * `EPERM` error is encountered, Node.js will retry the operation with a linear
+ * backoff wait of `retryDelay` ms longer on each try. This option represents the
+ * number of retries. This option is ignored if the `recursive` option is not
+ * `true`.
+ * @default 0
+ */
+ maxRetries?: number | undefined;
+ /**
+ * If `true`, perform a recursive directory removal. In
+ * recursive mode, operations are retried on failure.
+ * @default false
+ */
+ recursive?: boolean | undefined;
+ /**
+ * The amount of time in milliseconds to wait between retries.
+ * This option is ignored if the `recursive` option is not `true`.
+ * @default 100
+ */
+ retryDelay?: number | undefined;
+ }
+ /**
+ * Asynchronously removes files and directories (modeled on the standard POSIX `rm`utility). No arguments other than a possible exception are given to the
+ * completion callback.
+ * @since v14.14.0
+ */
+ export function rm(path: PathLike, callback: NoParamCallback): void;
+ export function rm(path: PathLike, options: RmOptions, callback: NoParamCallback): void;
+ export namespace rm {
+ /**
+ * Asynchronously removes files and directories (modeled on the standard POSIX `rm` utility).
+ */
+ function __promisify__(path: PathLike, options?: RmOptions): Promise<void>;
+ }
+ /**
+ * Synchronously removes files and directories (modeled on the standard POSIX `rm`utility). Returns `undefined`.
+ * @since v14.14.0
+ */
+ export function rmSync(path: PathLike, options?: RmOptions): void;
+ export interface MakeDirectoryOptions {
+ /**
+ * Indicates whether parent folders should be created.
+ * If a folder was created, the path to the first created folder will be returned.
+ * @default false
+ */
+ recursive?: boolean | undefined;
+ /**
+ * A file mode. If a string is passed, it is parsed as an octal integer. If not specified
+ * @default 0o777
+ */
+ mode?: Mode | undefined;
+ }
+ /**
+ * Asynchronously creates a directory.
+ *
+ * The callback is given a possible exception and, if `recursive` is `true`, the
+ * first directory path created, `(err[, path])`.`path` can still be `undefined` when `recursive` is `true`, if no directory was
+ * created.
+ *
+ * The optional `options` argument can be an integer specifying `mode` (permission
+ * and sticky bits), or an object with a `mode` property and a `recursive`property indicating whether parent directories should be created. Calling`fs.mkdir()` when `path` is a directory that
+ * exists results in an error only
+ * when `recursive` is false.
+ *
+ * ```js
+ * import { mkdir } from 'fs';
+ *
+ * // Creates /tmp/a/apple, regardless of whether `/tmp` and /tmp/a exist.
+ * mkdir('/tmp/a/apple', { recursive: true }, (err) => {
+ * if (err) throw err;
+ * });
+ * ```
+ *
+ * On Windows, using `fs.mkdir()` on the root directory even with recursion will
+ * result in an error:
+ *
+ * ```js
+ * import { mkdir } from 'fs';
+ *
+ * mkdir('/', { recursive: true }, (err) => {
+ * // => [Error: EPERM: operation not permitted, mkdir 'C:\']
+ * });
+ * ```
+ *
+ * See the POSIX [`mkdir(2)`](http://man7.org/linux/man-pages/man2/mkdir.2.html) documentation for more details.
+ * @since v0.1.8
+ */
+ export function mkdir(
+ path: PathLike,
+ options: MakeDirectoryOptions & {
+ recursive: true;
+ },
+ callback: (err: NodeJS.ErrnoException | null, path?: string) => void,
+ ): void;
+ /**
+ * Asynchronous mkdir(2) - create a directory.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
+ * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
+ */
+ export function mkdir(
+ path: PathLike,
+ options:
+ | Mode
+ | (MakeDirectoryOptions & {
+ recursive?: false | undefined;
+ })
+ | null
+ | undefined,
+ callback: NoParamCallback,
+ ): void;
+ /**
+ * Asynchronous mkdir(2) - create a directory.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
+ * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
+ */
+ export function mkdir(
+ path: PathLike,
+ options: Mode | MakeDirectoryOptions | null | undefined,
+ callback: (err: NodeJS.ErrnoException | null, path?: string) => void,
+ ): void;
+ /**
+ * Asynchronous mkdir(2) - create a directory with a mode of `0o777`.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ */
+ export function mkdir(path: PathLike, callback: NoParamCallback): void;
+ export namespace mkdir {
+ /**
+ * Asynchronous mkdir(2) - create a directory.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
+ * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
+ */
+ function __promisify__(
+ path: PathLike,
+ options: MakeDirectoryOptions & {
+ recursive: true;
+ },
+ ): Promise<string | undefined>;
+ /**
+ * Asynchronous mkdir(2) - create a directory.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
+ * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
+ */
+ function __promisify__(
+ path: PathLike,
+ options?:
+ | Mode
+ | (MakeDirectoryOptions & {
+ recursive?: false | undefined;
+ })
+ | null,
+ ): Promise<void>;
+ /**
+ * Asynchronous mkdir(2) - create a directory.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
+ * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
+ */
+ function __promisify__(
+ path: PathLike,
+ options?: Mode | MakeDirectoryOptions | null,
+ ): Promise<string | undefined>;
+ }
+ /**
+ * Synchronously creates a directory. Returns `undefined`, or if `recursive` is`true`, the first directory path created.
+ * This is the synchronous version of {@link mkdir}.
+ *
+ * See the POSIX [`mkdir(2)`](http://man7.org/linux/man-pages/man2/mkdir.2.html) documentation for more details.
+ * @since v0.1.21
+ */
+ export function mkdirSync(
+ path: PathLike,
+ options: MakeDirectoryOptions & {
+ recursive: true;
+ },
+ ): string | undefined;
+ /**
+ * Synchronous mkdir(2) - create a directory.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
+ * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
+ */
+ export function mkdirSync(
+ path: PathLike,
+ options?:
+ | Mode
+ | (MakeDirectoryOptions & {
+ recursive?: false | undefined;
+ })
+ | null,
+ ): void;
+ /**
+ * Synchronous mkdir(2) - create a directory.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
+ * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
+ */
+ export function mkdirSync(path: PathLike, options?: Mode | MakeDirectoryOptions | null): string | undefined;
+ /**
+ * Creates a unique temporary directory.
+ *
+ * Generates six random characters to be appended behind a required`prefix` to create a unique temporary directory. Due to platform
+ * inconsistencies, avoid trailing `X` characters in `prefix`. Some platforms,
+ * notably the BSDs, can return more than six random characters, and replace
+ * trailing `X` characters in `prefix` with random characters.
+ *
+ * The created directory path is passed as a string to the callback's second
+ * parameter.
+ *
+ * The optional `options` argument can be a string specifying an encoding, or an
+ * object with an `encoding` property specifying the character encoding to use.
+ *
+ * ```js
+ * import { mkdtemp } from 'fs';
+ *
+ * mkdtemp(path.join(os.tmpdir(), 'foo-'), (err, directory) => {
+ * if (err) throw err;
+ * console.log(directory);
+ * // Prints: /tmp/foo-itXde2 or C:\Users\...\AppData\Local\Temp\foo-itXde2
+ * });
+ * ```
+ *
+ * The `fs.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 platform-specific path separator
+ * (`require('path').sep`).
+ *
+ * ```js
+ * import { tmpdir } from 'os';
+ * import { mkdtemp } from 'fs';
+ *
+ * // The parent directory for the new temporary directory
+ * const tmpDir = tmpdir();
+ *
+ * // This method is *INCORRECT*:
+ * mkdtemp(tmpDir, (err, directory) => {
+ * if (err) throw err;
+ * console.log(directory);
+ * // Will print something similar to `/tmpabc123`.
+ * // A new temporary directory is created at the file system root
+ * // rather than *within* the /tmp directory.
+ * });
+ *
+ * // This method is *CORRECT*:
+ * import { sep } from 'path';
+ * mkdtemp(`${tmpDir}${sep}`, (err, directory) => {
+ * if (err) throw err;
+ * console.log(directory);
+ * // Will print something similar to `/tmp/abc123`.
+ * // A new temporary directory is created within
+ * // the /tmp directory.
+ * });
+ * ```
+ * @since v5.10.0
+ */
+ export function mkdtemp(
+ prefix: string,
+ options: EncodingOption,
+ callback: (err: NodeJS.ErrnoException | null, folder: string) => void,
+ ): void;
+ /**
+ * Asynchronously creates a unique temporary directory.
+ * Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
+ * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+ */
+ export function mkdtemp(
+ prefix: string,
+ options:
+ | "buffer"
+ | {
+ encoding: "buffer";
+ },
+ callback: (err: NodeJS.ErrnoException | null, folder: Buffer) => void,
+ ): void;
+ /**
+ * Asynchronously creates a unique temporary directory.
+ * Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
+ * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+ */
+ export function mkdtemp(
+ prefix: string,
+ options: EncodingOption,
+ callback: (err: NodeJS.ErrnoException | null, folder: string | Buffer) => void,
+ ): void;
+ /**
+ * Asynchronously creates a unique temporary directory.
+ * Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
+ */
+ export function mkdtemp(
+ prefix: string,
+ callback: (err: NodeJS.ErrnoException | null, folder: string) => void,
+ ): void;
+ export namespace mkdtemp {
+ /**
+ * Asynchronously creates a unique temporary directory.
+ * Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
+ * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+ */
+ function __promisify__(prefix: string, options?: EncodingOption): Promise<string>;
+ /**
+ * Asynchronously creates a unique temporary directory.
+ * Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
+ * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+ */
+ function __promisify__(prefix: string, options: BufferEncodingOption): Promise<Buffer>;
+ /**
+ * Asynchronously creates a unique temporary directory.
+ * Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
+ * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+ */
+ function __promisify__(prefix: string, options?: EncodingOption): Promise<string | Buffer>;
+ }
+ /**
+ * Returns the created directory path.
+ *
+ * For detailed information, see the documentation of the asynchronous version of
+ * this API: {@link mkdtemp}.
+ *
+ * The optional `options` argument can be a string specifying an encoding, or an
+ * object with an `encoding` property specifying the character encoding to use.
+ * @since v5.10.0
+ */
+ export function mkdtempSync(prefix: string, options?: EncodingOption): string;
+ /**
+ * Synchronously creates a unique temporary directory.
+ * Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
+ * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+ */
+ export function mkdtempSync(prefix: string, options: BufferEncodingOption): Buffer;
+ /**
+ * Synchronously creates a unique temporary directory.
+ * Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
+ * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+ */
+ export function mkdtempSync(prefix: string, options?: EncodingOption): string | Buffer;
+ /**
+ * Reads the contents of a directory. The callback gets two arguments `(err, files)`where `files` is an array of the names of the files in the directory excluding`'.'` and `'..'`.
+ *
+ * See the POSIX [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) documentation for more details.
+ *
+ * The optional `options` argument can be a string specifying an encoding, or an
+ * object with an `encoding` property specifying the character encoding to use for
+ * the filenames passed to the callback. If the `encoding` is set to `'buffer'`,
+ * the filenames returned will be passed as `Buffer` objects.
+ *
+ * If `options.withFileTypes` is set to `true`, the `files` array will contain `fs.Dirent` objects.
+ * @since v0.1.8
+ */
+ export function readdir(
+ path: PathLike,
+ options:
+ | {
+ encoding: BufferEncoding | null;
+ withFileTypes?: false | undefined;
+ recursive?: boolean | undefined;
+ }
+ | BufferEncoding
+ | undefined
+ | null,
+ callback: (err: NodeJS.ErrnoException | null, files: string[]) => void,
+ ): void;
+ /**
+ * Asynchronous readdir(3) - read a directory.
+ * @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.
+ */
+ export function readdir(
+ path: PathLike,
+ options:
+ | {
+ encoding: "buffer";
+ withFileTypes?: false | undefined;
+ recursive?: boolean | undefined;
+ }
+ | "buffer",
+ callback: (err: NodeJS.ErrnoException | null, files: Buffer[]) => void,
+ ): void;
+ /**
+ * Asynchronous readdir(3) - read a directory.
+ * @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.
+ */
+ export function readdir(
+ path: PathLike,
+ options:
+ | (ObjectEncodingOptions & {
+ withFileTypes?: false | undefined;
+ recursive?: boolean | undefined;
+ })
+ | BufferEncoding
+ | undefined
+ | null,
+ callback: (err: NodeJS.ErrnoException | null, files: string[] | Buffer[]) => void,
+ ): void;
+ /**
+ * Asynchronous readdir(3) - read a directory.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ */
+ export function readdir(
+ path: PathLike,
+ callback: (err: NodeJS.ErrnoException | null, files: string[]) => void,
+ ): void;
+ /**
+ * Asynchronous readdir(3) - read a directory.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * @param options If called with `withFileTypes: true` the result data will be an array of Dirent.
+ */
+ export function readdir(
+ path: PathLike,
+ options: ObjectEncodingOptions & {
+ withFileTypes: true;
+ recursive?: boolean | undefined;
+ },
+ callback: (err: NodeJS.ErrnoException | null, files: Dirent[]) => void,
+ ): void;
+ export namespace readdir {
+ /**
+ * Asynchronous readdir(3) - read a directory.
+ * @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.
+ */
+ function __promisify__(
+ path: PathLike,
+ options?:
+ | {
+ encoding: BufferEncoding | null;
+ withFileTypes?: false | undefined;
+ recursive?: boolean | undefined;
+ }
+ | BufferEncoding
+ | null,
+ ): Promise<string[]>;
+ /**
+ * Asynchronous readdir(3) - read a directory.
+ * @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.
+ */
+ function __promisify__(
+ path: PathLike,
+ options:
+ | "buffer"
+ | {
+ encoding: "buffer";
+ withFileTypes?: false | undefined;
+ recursive?: boolean | undefined;
+ },
+ ): Promise<Buffer[]>;
+ /**
+ * Asynchronous readdir(3) - read a directory.
+ * @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.
+ */
+ function __promisify__(
+ path: PathLike,
+ options?:
+ | (ObjectEncodingOptions & {
+ withFileTypes?: false | undefined;
+ recursive?: boolean | undefined;
+ })
+ | BufferEncoding
+ | null,
+ ): Promise<string[] | Buffer[]>;
+ /**
+ * Asynchronous readdir(3) - read a directory.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * @param options If called with `withFileTypes: true` the result data will be an array of Dirent
+ */
+ function __promisify__(
+ path: PathLike,
+ options: ObjectEncodingOptions & {
+ withFileTypes: true;
+ recursive?: boolean | undefined;
+ },
+ ): Promise<Dirent[]>;
+ }
+ /**
+ * Reads the contents of the directory.
+ *
+ * See the POSIX [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) documentation for more details.
+ *
+ * The optional `options` argument can be a string specifying an encoding, or an
+ * object with an `encoding` property specifying the character encoding to use for
+ * the filenames returned. If the `encoding` is set to `'buffer'`,
+ * the filenames returned will be passed as `Buffer` objects.
+ *
+ * If `options.withFileTypes` is set to `true`, the result will contain `fs.Dirent` objects.
+ * @since v0.1.21
+ */
+ export function readdirSync(
+ path: PathLike,
+ options?:
+ | {
+ encoding: BufferEncoding | null;
+ withFileTypes?: false | undefined;
+ recursive?: boolean | undefined;
+ }
+ | BufferEncoding
+ | null,
+ ): string[];
+ /**
+ * Synchronous readdir(3) - read a directory.
+ * @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.
+ */
+ export function readdirSync(
+ path: PathLike,
+ options:
+ | {
+ encoding: "buffer";
+ withFileTypes?: false | undefined;
+ recursive?: boolean | undefined;
+ }
+ | "buffer",
+ ): Buffer[];
+ /**
+ * Synchronous readdir(3) - read a directory.
+ * @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.
+ */
+ export function readdirSync(
+ path: PathLike,
+ options?:
+ | (ObjectEncodingOptions & {
+ withFileTypes?: false | undefined;
+ recursive?: boolean | undefined;
+ })
+ | BufferEncoding
+ | null,
+ ): string[] | Buffer[];
+ /**
+ * Synchronous readdir(3) - read a directory.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * @param options If called with `withFileTypes: true` the result data will be an array of Dirent.
+ */
+ export function readdirSync(
+ path: PathLike,
+ options: ObjectEncodingOptions & {
+ withFileTypes: true;
+ recursive?: boolean | undefined;
+ },
+ ): Dirent[];
+ /**
+ * Closes the file descriptor. No arguments other than a possible exception are
+ * given to the completion callback.
+ *
+ * Calling `fs.close()` on any file descriptor (`fd`) that is currently in use
+ * through any other `fs` operation may lead to undefined behavior.
+ *
+ * See the POSIX [`close(2)`](http://man7.org/linux/man-pages/man2/close.2.html) documentation for more detail.
+ * @since v0.0.2
+ */
+ export function close(fd: number, callback?: NoParamCallback): void;
+ export namespace close {
+ /**
+ * Asynchronous close(2) - close a file descriptor.
+ * @param fd A file descriptor.
+ */
+ function __promisify__(fd: number): Promise<void>;
+ }
+ /**
+ * Closes the file descriptor. Returns `undefined`.
+ *
+ * Calling `fs.closeSync()` on any file descriptor (`fd`) that is currently in use
+ * through any other `fs` operation may lead to undefined behavior.
+ *
+ * See the POSIX [`close(2)`](http://man7.org/linux/man-pages/man2/close.2.html) documentation for more detail.
+ * @since v0.1.21
+ */
+ export function closeSync(fd: number): void;
+ /**
+ * Asynchronous file open. See the POSIX [`open(2)`](http://man7.org/linux/man-pages/man2/open.2.html) documentation for more details.
+ *
+ * `mode` sets the file mode (permission and sticky bits), but only if the file was
+ * created. On Windows, only the write permission can be manipulated; see {@link chmod}.
+ *
+ * The callback gets two arguments `(err, fd)`.
+ *
+ * Some characters (`< > : " / \ | ? *`) are reserved under Windows as documented
+ * by [Naming Files, Paths, and Namespaces](https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file). Under NTFS, if the filename contains
+ * a colon, Node.js will open a file system stream, as described by [this MSDN page](https://docs.microsoft.com/en-us/windows/desktop/FileIO/using-streams).
+ *
+ * Functions based on `fs.open()` exhibit this behavior as well:`fs.writeFile()`, `fs.readFile()`, etc.
+ * @since v0.0.2
+ * @param [flags='r'] See `support of file system `flags``.
+ * @param [mode=0o666]
+ */
+ export function open(
+ path: PathLike,
+ flags: OpenMode | undefined,
+ mode: Mode | undefined | null,
+ callback: (err: NodeJS.ErrnoException | null, fd: number) => void,
+ ): void;
+ /**
+ * Asynchronous open(2) - open and possibly create a file. If the file is created, its mode will be `0o666`.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * @param [flags='r'] See `support of file system `flags``.
+ */
+ export function open(
+ path: PathLike,
+ flags: OpenMode | undefined,
+ callback: (err: NodeJS.ErrnoException | null, fd: number) => void,
+ ): void;
+ /**
+ * Asynchronous open(2) - open and possibly create a file. If the file is created, its mode will be `0o666`.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ */
+ export function open(path: PathLike, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void;
+
+ export namespace open {
+ /**
+ * Asynchronous open(2) - open and possibly create a file.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not supplied, defaults to `0o666`.
+ */
+ function __promisify__(path: PathLike, flags: OpenMode, mode?: Mode | null): Promise<number>;
+ }
+ /**
+ * Returns an integer representing the file descriptor.
+ *
+ * For detailed information, see the documentation of the asynchronous version of
+ * this API: {@link open}.
+ * @since v0.1.21
+ * @param [flags='r']
+ * @param [mode=0o666]
+ */
+ export function openSync(path: PathLike, flags: OpenMode, mode?: Mode | null): number;
+ /**
+ * Change the file system timestamps of the object referenced by `path`.
+ *
+ * The `atime` and `mtime` arguments follow these rules:
+ *
+ * * Values can be either numbers representing Unix epoch time in seconds,`Date`s, or a 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.
+ * @since v0.4.2
+ */
+ export function utimes(path: PathLike, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void;
+ export namespace utimes {
+ /**
+ * Asynchronously change file timestamps of the file referenced by the supplied path.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * @param atime The last access time. If a string is provided, it will be coerced to number.
+ * @param mtime The last modified time. If a string is provided, it will be coerced to number.
+ */
+ function __promisify__(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise<void>;
+ }
+ /**
+ * Returns `undefined`.
+ *
+ * For detailed information, see the documentation of the asynchronous version of
+ * this API: {@link utimes}.
+ * @since v0.4.2
+ */
+ export function utimesSync(path: PathLike, atime: TimeLike, mtime: TimeLike): void;
+ /**
+ * Change the file system timestamps of the object referenced by the supplied file
+ * descriptor. See {@link utimes}.
+ * @since v0.4.2
+ */
+ export function futimes(fd: number, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void;
+ export namespace futimes {
+ /**
+ * Asynchronously change file timestamps of the file referenced by the supplied file descriptor.
+ * @param fd A file descriptor.
+ * @param atime The last access time. If a string is provided, it will be coerced to number.
+ * @param mtime The last modified time. If a string is provided, it will be coerced to number.
+ */
+ function __promisify__(fd: number, atime: TimeLike, mtime: TimeLike): Promise<void>;
+ }
+ /**
+ * Synchronous version of {@link futimes}. Returns `undefined`.
+ * @since v0.4.2
+ */
+ export function futimesSync(fd: number, atime: TimeLike, mtime: TimeLike): void;
+ /**
+ * Request that all data for the open file descriptor is flushed to the storage
+ * 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. No arguments other
+ * than a possible exception are given to the completion callback.
+ * @since v0.1.96
+ */
+ export function fsync(fd: number, callback: NoParamCallback): void;
+ export namespace fsync {
+ /**
+ * Asynchronous fsync(2) - synchronize a file's in-core state with the underlying storage device.
+ * @param fd A file descriptor.
+ */
+ function __promisify__(fd: number): Promise<void>;
+ }
+ /**
+ * Request that all data for the open file descriptor is flushed to the storage
+ * 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. Returns `undefined`.
+ * @since v0.1.96
+ */
+ export function fsyncSync(fd: number): void;
+ /**
+ * Write `buffer` to the file specified by `fd`.
+ *
+ * `offset` determines the part of the buffer to be written, and `length` is
+ * an integer specifying the number of bytes to write.
+ *
+ * `position` refers to the offset from the beginning of the file where this data
+ * should be written. If `typeof position !== 'number'`, the data will be written
+ * at the current position. See [`pwrite(2)`](http://man7.org/linux/man-pages/man2/pwrite.2.html).
+ *
+ * The callback will be given three arguments `(err, bytesWritten, buffer)` where`bytesWritten` specifies how many _bytes_ were written from `buffer`.
+ *
+ * If this method is invoked as its `util.promisify()` ed version, it returns
+ * a promise for an `Object` with `bytesWritten` and `buffer` properties.
+ *
+ * It is unsafe to use `fs.write()` multiple times on the same file without waiting
+ * for the callback. For this scenario, {@link createWriteStream} is
+ * recommended.
+ *
+ * On Linux, positional writes don't work when the file is opened in append mode.
+ * The kernel ignores the position argument and always appends the data to
+ * the end of the file.
+ * @since v0.0.2
+ */
+ export function write<TBuffer extends NodeJS.ArrayBufferView>(
+ fd: number,
+ buffer: TBuffer,
+ offset: number | undefined | null,
+ length: number | undefined | null,
+ position: number | undefined | null,
+ callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void,
+ ): void;
+ /**
+ * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor.
+ * @param fd A file descriptor.
+ * @param offset The part of the buffer to be written. If not supplied, defaults to `0`.
+ * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`.
+ */
+ export function write<TBuffer extends NodeJS.ArrayBufferView>(
+ fd: number,
+ buffer: TBuffer,
+ offset: number | undefined | null,
+ length: number | undefined | null,
+ callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void,
+ ): void;
+ /**
+ * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor.
+ * @param fd A file descriptor.
+ * @param offset The part of the buffer to be written. If not supplied, defaults to `0`.
+ */
+ export function write<TBuffer extends NodeJS.ArrayBufferView>(
+ fd: number,
+ buffer: TBuffer,
+ offset: number | undefined | null,
+ callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void,
+ ): void;
+ /**
+ * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor.
+ * @param fd A file descriptor.
+ */
+ export function write<TBuffer extends NodeJS.ArrayBufferView>(
+ fd: number,
+ buffer: TBuffer,
+ callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void,
+ ): void;
+ /**
+ * Asynchronously writes `string` to the file referenced by the supplied file descriptor.
+ * @param fd A file descriptor.
+ * @param string A string to write.
+ * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
+ * @param encoding The expected string encoding.
+ */
+ export function write(
+ fd: number,
+ string: string,
+ position: number | undefined | null,
+ encoding: BufferEncoding | undefined | null,
+ callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void,
+ ): void;
+ /**
+ * Asynchronously writes `string` to the file referenced by the supplied file descriptor.
+ * @param fd A file descriptor.
+ * @param string A string to write.
+ * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
+ */
+ export function write(
+ fd: number,
+ string: string,
+ position: number | undefined | null,
+ callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void,
+ ): void;
+ /**
+ * Asynchronously writes `string` to the file referenced by the supplied file descriptor.
+ * @param fd A file descriptor.
+ * @param string A string to write.
+ */
+ export function write(
+ fd: number,
+ string: string,
+ callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void,
+ ): void;
+ export namespace write {
+ /**
+ * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor.
+ * @param fd A file descriptor.
+ * @param offset The part of the buffer to be written. If not supplied, defaults to `0`.
+ * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`.
+ * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
+ */
+ function __promisify__<TBuffer extends NodeJS.ArrayBufferView>(
+ fd: number,
+ buffer?: TBuffer,
+ offset?: number,
+ length?: number,
+ position?: number | null,
+ ): Promise<{
+ bytesWritten: number;
+ buffer: TBuffer;
+ }>;
+ /**
+ * Asynchronously writes `string` to the file referenced by the supplied file descriptor.
+ * @param fd A file descriptor.
+ * @param string A string to write.
+ * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
+ * @param encoding The expected string encoding.
+ */
+ function __promisify__(
+ fd: number,
+ string: string,
+ position?: number | null,
+ encoding?: BufferEncoding | null,
+ ): Promise<{
+ bytesWritten: number;
+ buffer: string;
+ }>;
+ }
+ /**
+ * For detailed information, see the documentation of the asynchronous version of
+ * this API: {@link write}.
+ * @since v0.1.21
+ * @return The number of bytes written.
+ */
+ export function writeSync(
+ fd: number,
+ buffer: NodeJS.ArrayBufferView,
+ offset?: number | null,
+ length?: number | null,
+ position?: number | null,
+ ): number;
+ /**
+ * Synchronously writes `string` to the file referenced by the supplied file descriptor, returning the number of bytes written.
+ * @param fd A file descriptor.
+ * @param string A string to write.
+ * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
+ * @param encoding The expected string encoding.
+ */
+ export function writeSync(
+ fd: number,
+ string: string,
+ position?: number | null,
+ encoding?: BufferEncoding | null,
+ ): number;
+ export type ReadPosition = number | bigint;
+ export interface ReadSyncOptions {
+ /**
+ * @default 0
+ */
+ offset?: number | undefined;
+ /**
+ * @default `length of buffer`
+ */
+ length?: number | undefined;
+ /**
+ * @default null
+ */
+ position?: ReadPosition | null | undefined;
+ }
+ export interface ReadAsyncOptions<TBuffer extends NodeJS.ArrayBufferView> extends ReadSyncOptions {
+ buffer?: TBuffer;
+ }
+ /**
+ * Read data from the file specified by `fd`.
+ *
+ * The callback is given the three arguments, `(err, bytesRead, buffer)`.
+ *
+ * If the file is not modified concurrently, the end-of-file is reached when the
+ * number of bytes read is zero.
+ *
+ * If this method is invoked as its `util.promisify()` ed version, it returns
+ * a promise for an `Object` with `bytesRead` and `buffer` properties.
+ * @since v0.0.2
+ * @param buffer The buffer that the data will be written to.
+ * @param offset The position in `buffer` to write the data to.
+ * @param length The number of bytes to read.
+ * @param position Specifies where to begin reading from in the file. If `position` is `null` or `-1 `, data will be read from the current file position, and the file position will be updated. If
+ * `position` is an integer, the file position will be unchanged.
+ */
+ export function read<TBuffer extends NodeJS.ArrayBufferView>(
+ fd: number,
+ buffer: TBuffer,
+ offset: number,
+ length: number,
+ position: ReadPosition | null,
+ callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void,
+ ): void;
+ /**
+ * Similar to the above `fs.read` function, this version takes an optional `options` object.
+ * If not otherwise specified in an `options` object,
+ * `buffer` defaults to `Buffer.alloc(16384)`,
+ * `offset` defaults to `0`,
+ * `length` defaults to `buffer.byteLength`, `- offset` as of Node 17.6.0
+ * `position` defaults to `null`
+ * @since v12.17.0, 13.11.0
+ */
+ export function read<TBuffer extends NodeJS.ArrayBufferView>(
+ fd: number,
+ options: ReadAsyncOptions<TBuffer>,
+ callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void,
+ ): void;
+ export function read(
+ fd: number,
+ callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: NodeJS.ArrayBufferView) => void,
+ ): void;
+ export namespace read {
+ /**
+ * @param fd A file descriptor.
+ * @param buffer The buffer that the data will be written to.
+ * @param offset The offset in the buffer at which to start writing.
+ * @param length The number of bytes to read.
+ * @param position The offset from the beginning of the file from which data should be read. If `null`, data will be read from the current position.
+ */
+ function __promisify__<TBuffer extends NodeJS.ArrayBufferView>(
+ fd: number,
+ buffer: TBuffer,
+ offset: number,
+ length: number,
+ position: number | null,
+ ): Promise<{
+ bytesRead: number;
+ buffer: TBuffer;
+ }>;
+ function __promisify__<TBuffer extends NodeJS.ArrayBufferView>(
+ fd: number,
+ options: ReadAsyncOptions<TBuffer>,
+ ): Promise<{
+ bytesRead: number;
+ buffer: TBuffer;
+ }>;
+ function __promisify__(fd: number): Promise<{
+ bytesRead: number;
+ buffer: NodeJS.ArrayBufferView;
+ }>;
+ }
+ /**
+ * Returns the number of `bytesRead`.
+ *
+ * For detailed information, see the documentation of the asynchronous version of
+ * this API: {@link read}.
+ * @since v0.1.21
+ */
+ export function readSync(
+ fd: number,
+ buffer: NodeJS.ArrayBufferView,
+ offset: number,
+ length: number,
+ position: ReadPosition | null,
+ ): number;
+ /**
+ * Similar to the above `fs.readSync` function, this version takes an optional `options` object.
+ * If no `options` object is specified, it will default with the above values.
+ */
+ export function readSync(fd: number, buffer: NodeJS.ArrayBufferView, opts?: ReadSyncOptions): number;
+ /**
+ * Asynchronously reads the entire contents of a file.
+ *
+ * ```js
+ * import { readFile } from 'fs';
+ *
+ * readFile('/etc/passwd', (err, data) => {
+ * if (err) throw err;
+ * console.log(data);
+ * });
+ * ```
+ *
+ * The callback is passed two arguments `(err, data)`, where `data` is the
+ * contents of the file.
+ *
+ * If no encoding is specified, then the raw buffer is returned.
+ *
+ * If `options` is a string, then it specifies the encoding:
+ *
+ * ```js
+ * import { readFile } from 'fs';
+ *
+ * readFile('/etc/passwd', 'utf8', callback);
+ * ```
+ *
+ * When the path is a directory, the behavior of `fs.readFile()` and {@link readFileSync} is platform-specific. On macOS, Linux, and Windows, an
+ * error will be returned. On FreeBSD, a representation of the directory's contents
+ * will be returned.
+ *
+ * ```js
+ * import { readFile } from 'fs';
+ *
+ * // macOS, Linux, and Windows
+ * readFile('<directory>', (err, data) => {
+ * // => [Error: EISDIR: illegal operation on a directory, read <directory>]
+ * });
+ *
+ * // FreeBSD
+ * readFile('<directory>', (err, data) => {
+ * // => null, <data>
+ * });
+ * ```
+ *
+ * It is possible to abort an ongoing request using an `AbortSignal`. If a
+ * request is aborted the callback is called with an `AbortError`:
+ *
+ * ```js
+ * import { readFile } from 'fs';
+ *
+ * const controller = new AbortController();
+ * const signal = controller.signal;
+ * readFile(fileInfo[0].name, { signal }, (err, buf) => {
+ * // ...
+ * });
+ * // When you want to abort the request
+ * controller.abort();
+ * ```
+ *
+ * The `fs.readFile()` function buffers the entire file. To minimize memory costs,
+ * when possible prefer streaming via `fs.createReadStream()`.
+ *
+ * Aborting an ongoing request does not abort individual operating
+ * system requests but rather the internal buffering `fs.readFile` performs.
+ * @since v0.1.29
+ * @param path filename or file descriptor
+ */
+ export function readFile(
+ path: PathOrFileDescriptor,
+ options:
+ | ({
+ encoding?: null | undefined;
+ flag?: string | undefined;
+ } & Abortable)
+ | undefined
+ | null,
+ callback: (err: NodeJS.ErrnoException | null, data: Buffer) => void,
+ ): void;
+ /**
+ * Asynchronously reads the entire contents of a file.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
+ * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag.
+ * If a flag is not provided, it defaults to `'r'`.
+ */
+ export function readFile(
+ path: PathOrFileDescriptor,
+ options:
+ | ({
+ encoding: BufferEncoding;
+ flag?: string | undefined;
+ } & Abortable)
+ | BufferEncoding,
+ callback: (err: NodeJS.ErrnoException | null, data: string) => void,
+ ): void;
+ /**
+ * Asynchronously reads the entire contents of a file.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
+ * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag.
+ * If a flag is not provided, it defaults to `'r'`.
+ */
+ export function readFile(
+ path: PathOrFileDescriptor,
+ options:
+ | (ObjectEncodingOptions & {
+ flag?: string | undefined;
+ } & Abortable)
+ | BufferEncoding
+ | undefined
+ | null,
+ callback: (err: NodeJS.ErrnoException | null, data: string | Buffer) => void,
+ ): void;
+ /**
+ * Asynchronously reads the entire contents of a file.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
+ */
+ export function readFile(
+ path: PathOrFileDescriptor,
+ callback: (err: NodeJS.ErrnoException | null, data: Buffer) => void,
+ ): void;
+ export namespace readFile {
+ /**
+ * Asynchronously reads the entire contents of a file.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
+ * @param options An object that may contain an optional flag.
+ * If a flag is not provided, it defaults to `'r'`.
+ */
+ function __promisify__(
+ path: PathOrFileDescriptor,
+ options?: {
+ encoding?: null | undefined;
+ flag?: string | undefined;
+ } | null,
+ ): Promise<Buffer>;
+ /**
+ * Asynchronously reads the entire contents of a file.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * URL support is _experimental_.
+ * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
+ * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag.
+ * If a flag is not provided, it defaults to `'r'`.
+ */
+ function __promisify__(
+ path: PathOrFileDescriptor,
+ options:
+ | {
+ encoding: BufferEncoding;
+ flag?: string | undefined;
+ }
+ | BufferEncoding,
+ ): Promise<string>;
+ /**
+ * Asynchronously reads the entire contents of a file.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * URL support is _experimental_.
+ * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
+ * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag.
+ * If a flag is not provided, it defaults to `'r'`.
+ */
+ function __promisify__(
+ path: PathOrFileDescriptor,
+ options?:
+ | (ObjectEncodingOptions & {
+ flag?: string | undefined;
+ })
+ | BufferEncoding
+ | null,
+ ): Promise<string | Buffer>;
+ }
+ /**
+ * Returns the contents of the `path`.
+ *
+ * For detailed information, see the documentation of the asynchronous version of
+ * this API: {@link readFile}.
+ *
+ * If the `encoding` option is specified then this function returns a
+ * string. Otherwise it returns a buffer.
+ *
+ * Similar to {@link readFile}, when the path is a directory, the behavior of`fs.readFileSync()` is platform-specific.
+ *
+ * ```js
+ * import { readFileSync } from 'fs';
+ *
+ * // macOS, Linux, and Windows
+ * readFileSync('<directory>');
+ * // => [Error: EISDIR: illegal operation on a directory, read <directory>]
+ *
+ * // FreeBSD
+ * readFileSync('<directory>'); // => <data>
+ * ```
+ * @since v0.1.8
+ * @param path filename or file descriptor
+ */
+ export function readFileSync(
+ path: PathOrFileDescriptor,
+ options?: {
+ encoding?: null | undefined;
+ flag?: string | undefined;
+ } | null,
+ ): Buffer;
+ /**
+ * Synchronously reads the entire contents of a file.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
+ * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag.
+ * If a flag is not provided, it defaults to `'r'`.
+ */
+ export function readFileSync(
+ path: PathOrFileDescriptor,
+ options:
+ | {
+ encoding: BufferEncoding;
+ flag?: string | undefined;
+ }
+ | BufferEncoding,
+ ): string;
+ /**
+ * Synchronously reads the entire contents of a file.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
+ * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag.
+ * If a flag is not provided, it defaults to `'r'`.
+ */
+ export function readFileSync(
+ path: PathOrFileDescriptor,
+ options?:
+ | (ObjectEncodingOptions & {
+ flag?: string | undefined;
+ })
+ | BufferEncoding
+ | null,
+ ): string | Buffer;
+ export type WriteFileOptions =
+ | (
+ & ObjectEncodingOptions
+ & Abortable
+ & {
+ mode?: Mode | undefined;
+ flag?: string | undefined;
+ }
+ )
+ | BufferEncoding
+ | null;
+ /**
+ * When `file` is a filename, asynchronously writes data to the file, replacing the
+ * file if it already exists. `data` can be a string or a buffer.
+ *
+ * When `file` is a file descriptor, the behavior is similar to calling`fs.write()` directly (which is recommended). See the notes below on using
+ * a file descriptor.
+ *
+ * The `encoding` option is ignored if `data` is a buffer.
+ *
+ * The `mode` option only affects the newly created file. See {@link open} for more details.
+ *
+ * ```js
+ * import { writeFile } from 'fs';
+ * import { Buffer } from 'buffer';
+ *
+ * const data = new Uint8Array(Buffer.from('Hello Node.js'));
+ * writeFile('message.txt', data, (err) => {
+ * if (err) throw err;
+ * console.log('The file has been saved!');
+ * });
+ * ```
+ *
+ * If `options` is a string, then it specifies the encoding:
+ *
+ * ```js
+ * import { writeFile } from 'fs';
+ *
+ * writeFile('message.txt', 'Hello Node.js', 'utf8', callback);
+ * ```
+ *
+ * It is unsafe to use `fs.writeFile()` multiple times on the same file without
+ * waiting for the callback. For this scenario, {@link createWriteStream} is
+ * recommended.
+ *
+ * Similarly to `fs.readFile` \- `fs.writeFile` is a convenience method that
+ * performs multiple `write` calls internally to write the buffer passed to it.
+ * For performance sensitive code consider using {@link createWriteStream}.
+ *
+ * It is possible to use an `AbortSignal` to cancel an `fs.writeFile()`.
+ * Cancelation is "best effort", and some amount of data is likely still
+ * to be written.
+ *
+ * ```js
+ * import { writeFile } from 'fs';
+ * import { Buffer } from 'buffer';
+ *
+ * const controller = new AbortController();
+ * const { signal } = controller;
+ * const data = new Uint8Array(Buffer.from('Hello Node.js'));
+ * writeFile('message.txt', data, { signal }, (err) => {
+ * // When a request is aborted - the callback is called with an AbortError
+ * });
+ * // When the request should be aborted
+ * controller.abort();
+ * ```
+ *
+ * Aborting an ongoing request does not abort individual operating
+ * system requests but rather the internal buffering `fs.writeFile` performs.
+ * @since v0.1.29
+ * @param file filename or file descriptor
+ */
+ export function writeFile(
+ file: PathOrFileDescriptor,
+ data: string | NodeJS.ArrayBufferView,
+ options: WriteFileOptions,
+ callback: NoParamCallback,
+ ): void;
+ /**
+ * Asynchronously writes data to a file, replacing the file if it already exists.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
+ * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string.
+ */
+ export function writeFile(
+ path: PathOrFileDescriptor,
+ data: string | NodeJS.ArrayBufferView,
+ callback: NoParamCallback,
+ ): void;
+ export namespace writeFile {
+ /**
+ * Asynchronously writes data to a file, replacing the file if it already exists.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * URL support is _experimental_.
+ * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
+ * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string.
+ * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag.
+ * If `encoding` is not supplied, the default of `'utf8'` is used.
+ * If `mode` is not supplied, the default of `0o666` is used.
+ * If `mode` is a string, it is parsed as an octal integer.
+ * If `flag` is not supplied, the default of `'w'` is used.
+ */
+ function __promisify__(
+ path: PathOrFileDescriptor,
+ data: string | NodeJS.ArrayBufferView,
+ options?: WriteFileOptions,
+ ): Promise<void>;
+ }
+ /**
+ * Returns `undefined`.
+ *
+ * The `mode` option only affects the newly created file. See {@link open} for more details.
+ *
+ * For detailed information, see the documentation of the asynchronous version of
+ * this API: {@link writeFile}.
+ * @since v0.1.29
+ * @param file filename or file descriptor
+ */
+ export function writeFileSync(
+ file: PathOrFileDescriptor,
+ data: string | NodeJS.ArrayBufferView,
+ options?: WriteFileOptions,
+ ): void;
+ /**
+ * Asynchronously append data to a file, creating the file if it does not yet
+ * exist. `data` can be a string or a `Buffer`.
+ *
+ * The `mode` option only affects the newly created file. See {@link open} for more details.
+ *
+ * ```js
+ * import { appendFile } from 'fs';
+ *
+ * appendFile('message.txt', 'data to append', (err) => {
+ * if (err) throw err;
+ * console.log('The "data to append" was appended to file!');
+ * });
+ * ```
+ *
+ * If `options` is a string, then it specifies the encoding:
+ *
+ * ```js
+ * import { appendFile } from 'fs';
+ *
+ * appendFile('message.txt', 'data to append', 'utf8', callback);
+ * ```
+ *
+ * The `path` may be specified as a numeric file descriptor that has been opened
+ * for appending (using `fs.open()` or `fs.openSync()`). The file descriptor will
+ * not be closed automatically.
+ *
+ * ```js
+ * import { open, close, appendFile } from 'fs';
+ *
+ * function closeFd(fd) {
+ * close(fd, (err) => {
+ * if (err) throw err;
+ * });
+ * }
+ *
+ * open('message.txt', 'a', (err, fd) => {
+ * if (err) throw err;
+ *
+ * try {
+ * appendFile(fd, 'data to append', 'utf8', (err) => {
+ * closeFd(fd);
+ * if (err) throw err;
+ * });
+ * } catch (err) {
+ * closeFd(fd);
+ * throw err;
+ * }
+ * });
+ * ```
+ * @since v0.6.7
+ * @param path filename or file descriptor
+ */
+ export function appendFile(
+ path: PathOrFileDescriptor,
+ data: string | Uint8Array,
+ options: WriteFileOptions,
+ callback: NoParamCallback,
+ ): void;
+ /**
+ * Asynchronously append data to a file, creating the file if it does not exist.
+ * @param file A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
+ * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string.
+ */
+ export function appendFile(file: PathOrFileDescriptor, data: string | Uint8Array, callback: NoParamCallback): void;
+ export namespace appendFile {
+ /**
+ * Asynchronously append data to a file, creating the file if it does not exist.
+ * @param file A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * URL support is _experimental_.
+ * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
+ * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string.
+ * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag.
+ * If `encoding` is not supplied, the default of `'utf8'` is used.
+ * If `mode` is not supplied, the default of `0o666` is used.
+ * If `mode` is a string, it is parsed as an octal integer.
+ * If `flag` is not supplied, the default of `'a'` is used.
+ */
+ function __promisify__(
+ file: PathOrFileDescriptor,
+ data: string | Uint8Array,
+ options?: WriteFileOptions,
+ ): Promise<void>;
+ }
+ /**
+ * Synchronously append data to a file, creating the file if it does not yet
+ * exist. `data` can be a string or a `Buffer`.
+ *
+ * The `mode` option only affects the newly created file. See {@link open} for more details.
+ *
+ * ```js
+ * import { appendFileSync } from 'fs';
+ *
+ * try {
+ * appendFileSync('message.txt', 'data to append');
+ * console.log('The "data to append" was appended to file!');
+ * } catch (err) {
+ * // Handle the error
+ * }
+ * ```
+ *
+ * If `options` is a string, then it specifies the encoding:
+ *
+ * ```js
+ * import { appendFileSync } from 'fs';
+ *
+ * appendFileSync('message.txt', 'data to append', 'utf8');
+ * ```
+ *
+ * The `path` may be specified as a numeric file descriptor that has been opened
+ * for appending (using `fs.open()` or `fs.openSync()`). The file descriptor will
+ * not be closed automatically.
+ *
+ * ```js
+ * import { openSync, closeSync, appendFileSync } from 'fs';
+ *
+ * let fd;
+ *
+ * try {
+ * fd = openSync('message.txt', 'a');
+ * appendFileSync(fd, 'data to append', 'utf8');
+ * } catch (err) {
+ * // Handle the error
+ * } finally {
+ * if (fd !== undefined)
+ * closeSync(fd);
+ * }
+ * ```
+ * @since v0.6.7
+ * @param path filename or file descriptor
+ */
+ export function appendFileSync(
+ path: PathOrFileDescriptor,
+ data: string | Uint8Array,
+ options?: WriteFileOptions,
+ ): void;
+ /**
+ * Watch for changes on `filename`. The callback `listener` will be called each
+ * time the file is accessed.
+ *
+ * The `options` argument may be omitted. If provided, it should be an object. The`options` object may contain a boolean named `persistent` that indicates
+ * whether the process should continue to run as long as files are being watched.
+ * The `options` object may specify an `interval` property indicating how often the
+ * target should be polled in milliseconds.
+ *
+ * The `listener` gets two arguments the current stat object and the previous
+ * stat object:
+ *
+ * ```js
+ * import { watchFile } from 'fs';
+ *
+ * watchFile('message.text', (curr, prev) => {
+ * console.log(`the current mtime is: ${curr.mtime}`);
+ * console.log(`the previous mtime was: ${prev.mtime}`);
+ * });
+ * ```
+ *
+ * These stat objects are instances of `fs.Stat`. If the `bigint` option is `true`,
+ * the numeric values in these objects are specified as `BigInt`s.
+ *
+ * To be notified when the file was modified, not just accessed, it is necessary
+ * to compare `curr.mtimeMs` and `prev.mtimeMs`.
+ *
+ * When an `fs.watchFile` operation results in an `ENOENT` error, it
+ * will invoke the listener once, with all the fields zeroed (or, for dates, the
+ * Unix Epoch). If the file is created later on, the listener will be called
+ * again, with the latest stat objects. This is a change in functionality since
+ * v0.10.
+ *
+ * Using {@link watch} is more efficient than `fs.watchFile` and`fs.unwatchFile`. `fs.watch` should be used instead of `fs.watchFile` and`fs.unwatchFile` when possible.
+ *
+ * When a file being watched by `fs.watchFile()` disappears and reappears,
+ * then the contents of `previous` in the second callback event (the file's
+ * reappearance) will be the same as the contents of `previous` in the first
+ * callback event (its disappearance).
+ *
+ * This happens when:
+ *
+ * * the file is deleted, followed by a restore
+ * * the file is renamed and then renamed a second time back to its original name
+ * @since v0.1.31
+ */
+ export interface WatchFileOptions {
+ bigint?: boolean | undefined;
+ persistent?: boolean | undefined;
+ interval?: number | undefined;
+ }
+ /**
+ * Watch for changes on `filename`. The callback `listener` will be called each
+ * time the file is accessed.
+ *
+ * The `options` argument may be omitted. If provided, it should be an object. The`options` object may contain a boolean named `persistent` that indicates
+ * whether the process should continue to run as long as files are being watched.
+ * The `options` object may specify an `interval` property indicating how often the
+ * target should be polled in milliseconds.
+ *
+ * The `listener` gets two arguments the current stat object and the previous
+ * stat object:
+ *
+ * ```js
+ * import { watchFile } from 'fs';
+ *
+ * watchFile('message.text', (curr, prev) => {
+ * console.log(`the current mtime is: ${curr.mtime}`);
+ * console.log(`the previous mtime was: ${prev.mtime}`);
+ * });
+ * ```
+ *
+ * These stat objects are instances of `fs.Stat`. If the `bigint` option is `true`,
+ * the numeric values in these objects are specified as `BigInt`s.
+ *
+ * To be notified when the file was modified, not just accessed, it is necessary
+ * to compare `curr.mtimeMs` and `prev.mtimeMs`.
+ *
+ * When an `fs.watchFile` operation results in an `ENOENT` error, it
+ * will invoke the listener once, with all the fields zeroed (or, for dates, the
+ * Unix Epoch). If the file is created later on, the listener will be called
+ * again, with the latest stat objects. This is a change in functionality since
+ * v0.10.
+ *
+ * Using {@link watch} is more efficient than `fs.watchFile` and`fs.unwatchFile`. `fs.watch` should be used instead of `fs.watchFile` and`fs.unwatchFile` when possible.
+ *
+ * When a file being watched by `fs.watchFile()` disappears and reappears,
+ * then the contents of `previous` in the second callback event (the file's
+ * reappearance) will be the same as the contents of `previous` in the first
+ * callback event (its disappearance).
+ *
+ * This happens when:
+ *
+ * * the file is deleted, followed by a restore
+ * * the file is renamed and then renamed a second time back to its original name
+ * @since v0.1.31
+ */
+ export function watchFile(
+ filename: PathLike,
+ options:
+ | (WatchFileOptions & {
+ bigint?: false | undefined;
+ })
+ | undefined,
+ listener: StatsListener,
+ ): StatWatcher;
+ export function watchFile(
+ filename: PathLike,
+ options:
+ | (WatchFileOptions & {
+ bigint: true;
+ })
+ | undefined,
+ listener: BigIntStatsListener,
+ ): StatWatcher;
+ /**
+ * Watch for changes on `filename`. The callback `listener` will be called each time the file is accessed.
+ * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
+ * @param listener The callback listener will be called each time the file is accessed.
+ */
+ export function watchFile(filename: PathLike, listener: StatsListener): StatWatcher;
+ /**
+ * Stop watching for changes on `filename`. If `listener` is specified, only that
+ * particular listener is removed. Otherwise, _all_ listeners are removed,
+ * effectively stopping watching of `filename`.
+ *
+ * Calling `fs.unwatchFile()` with a filename that is not being watched is a
+ * no-op, not an error.
+ *
+ * Using {@link watch} is more efficient than `fs.watchFile()` and`fs.unwatchFile()`. `fs.watch()` should be used instead of `fs.watchFile()`and `fs.unwatchFile()` when possible.
+ * @since v0.1.31
+ * @param listener Optional, a listener previously attached using `fs.watchFile()`
+ */
+ export function unwatchFile(filename: PathLike, listener?: StatsListener): void;
+ export function unwatchFile(filename: PathLike, listener?: BigIntStatsListener): void;
+ export interface WatchOptions extends Abortable {
+ encoding?: BufferEncoding | "buffer" | undefined;
+ persistent?: boolean | undefined;
+ recursive?: boolean | undefined;
+ }
+ export type WatchEventType = "rename" | "change";
+ export type WatchListener<T> = (event: WatchEventType, filename: T | null) => void;
+ export type StatsListener = (curr: Stats, prev: Stats) => void;
+ export type BigIntStatsListener = (curr: BigIntStats, prev: BigIntStats) => void;
+ /**
+ * Watch for changes on `filename`, where `filename` is either a file or a
+ * directory.
+ *
+ * The second argument is optional. If `options` is provided as a string, it
+ * specifies the `encoding`. Otherwise `options` should be passed as an object.
+ *
+ * The listener callback gets two arguments `(eventType, filename)`. `eventType`is either `'rename'` or `'change'`, and `filename` is the name of the file
+ * which triggered the event.
+ *
+ * On most platforms, `'rename'` is emitted whenever a filename appears or
+ * disappears in the directory.
+ *
+ * The listener callback is attached to the `'change'` event fired by `fs.FSWatcher`, but it is not the same thing as the `'change'` value of`eventType`.
+ *
+ * If a `signal` is passed, aborting the corresponding AbortController will close
+ * the returned `fs.FSWatcher`.
+ * @since v0.5.10
+ * @param listener
+ */
+ export function watch(
+ filename: PathLike,
+ options:
+ | (WatchOptions & {
+ encoding: "buffer";
+ })
+ | "buffer",
+ listener?: WatchListener<Buffer>,
+ ): FSWatcher;
+ /**
+ * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`.
+ * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
+ * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options.
+ * If `encoding` is not supplied, the default of `'utf8'` is used.
+ * If `persistent` is not supplied, the default of `true` is used.
+ * If `recursive` is not supplied, the default of `false` is used.
+ */
+ export function watch(
+ filename: PathLike,
+ options?: WatchOptions | BufferEncoding | null,
+ listener?: WatchListener<string>,
+ ): FSWatcher;
+ /**
+ * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`.
+ * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
+ * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options.
+ * If `encoding` is not supplied, the default of `'utf8'` is used.
+ * If `persistent` is not supplied, the default of `true` is used.
+ * If `recursive` is not supplied, the default of `false` is used.
+ */
+ export function watch(
+ filename: PathLike,
+ options: WatchOptions | string,
+ listener?: WatchListener<string | Buffer>,
+ ): FSWatcher;
+ /**
+ * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`.
+ * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
+ */
+ export function watch(filename: PathLike, listener?: WatchListener<string>): FSWatcher;
+ /**
+ * Test whether or not the given path exists by checking with the file system.
+ * Then call the `callback` argument with either true or false:
+ *
+ * ```js
+ * import { exists } from 'fs';
+ *
+ * exists('/etc/passwd', (e) => {
+ * console.log(e ? 'it exists' : 'no passwd!');
+ * });
+ * ```
+ *
+ * **The parameters for this callback are not consistent with other Node.js**
+ * **callbacks.** Normally, the first parameter to a Node.js callback is an `err`parameter, optionally followed by other parameters. The `fs.exists()` callback
+ * has only one boolean parameter. This is one reason `fs.access()` is recommended
+ * instead of `fs.exists()`.
+ *
+ * Using `fs.exists()` to check for the existence of a file before calling`fs.open()`, `fs.readFile()` or `fs.writeFile()` is not recommended. Doing
+ * so introduces a race condition, since other processes may change the file's
+ * state between the two calls. Instead, user code should open/read/write the
+ * file directly and handle the error raised if the file does not exist.
+ *
+ * **write (NOT RECOMMENDED)**
+ *
+ * ```js
+ * import { exists, open, close } from 'fs';
+ *
+ * exists('myfile', (e) => {
+ * if (e) {
+ * console.error('myfile already exists');
+ * } else {
+ * open('myfile', 'wx', (err, fd) => {
+ * if (err) throw err;
+ *
+ * try {
+ * writeMyData(fd);
+ * } finally {
+ * close(fd, (err) => {
+ * if (err) throw err;
+ * });
+ * }
+ * });
+ * }
+ * });
+ * ```
+ *
+ * **write (RECOMMENDED)**
+ *
+ * ```js
+ * import { open, close } from 'fs';
+ * open('myfile', 'wx', (err, fd) => {
+ * if (err) {
+ * if (err.code === 'EEXIST') {
+ * console.error('myfile already exists');
+ * return;
+ * }
+ *
+ * throw err;
+ * }
+ *
+ * try {
+ * writeMyData(fd);
+ * } finally {
+ * close(fd, (err) => {
+ * if (err) throw err;
+ * });
+ * }
+ * });
+ * ```
+ *
+ * **read (NOT RECOMMENDED)**
+ *
+ * ```js
+ * import { open, close, exists } from 'fs';
+ *
+ * exists('myfile', (e) => {
+ * if (e) {
+ * open('myfile', 'r', (err, fd) => {
+ * if (err) throw err;
+ *
+ * try {
+ * readMyData(fd);
+ * } finally {
+ * close(fd, (err) => {
+ * if (err) throw err;
+ * });
+ * }
+ * });
+ * } else {
+ * console.error('myfile does not exist');
+ * }
+ * });
+ * ```
+ *
+ * **read (RECOMMENDED)**
+ *
+ * ```js
+ * import { open, close } from 'fs';
+ *
+ * open('myfile', 'r', (err, fd) => {
+ * if (err) {
+ * if (err.code === 'ENOENT') {
+ * console.error('myfile does not exist');
+ * return;
+ * }
+ *
+ * throw err;
+ * }
+ *
+ * try {
+ * readMyData(fd);
+ * } finally {
+ * close(fd, (err) => {
+ * if (err) throw err;
+ * });
+ * }
+ * });
+ * ```
+ *
+ * The "not recommended" examples above check for existence and then use the
+ * file; the "recommended" examples are better because they use the file directly
+ * and handle the error, if any.
+ *
+ * In general, check for the existence of a file only if the file won’t be
+ * used directly, for example when its existence is a signal from another
+ * process.
+ * @since v0.0.2
+ * @deprecated Since v1.0.0 - Use {@link stat} or {@link access} instead.
+ */
+ export function exists(path: PathLike, callback: (exists: boolean) => void): void;
+ /** @deprecated */
+ export namespace exists {
+ /**
+ * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
+ * URL support is _experimental_.
+ */
+ function __promisify__(path: PathLike): Promise<boolean>;
+ }
+ /**
+ * Returns `true` if the path exists, `false` otherwise.
+ *
+ * For detailed information, see the documentation of the asynchronous version of
+ * this API: {@link exists}.
+ *
+ * `fs.exists()` is deprecated, but `fs.existsSync()` is not. The `callback`parameter to `fs.exists()` accepts parameters that are inconsistent with other
+ * Node.js callbacks. `fs.existsSync()` does not use a callback.
+ *
+ * ```js
+ * import { existsSync } from 'fs';
+ *
+ * if (existsSync('/etc/passwd'))
+ * console.log('The path exists.');
+ * ```
+ * @since v0.1.21
+ */
+ export function existsSync(path: PathLike): boolean;
+ export namespace constants {
+ // File Access Constants
+ /** Constant for fs.access(). File is visible to the calling process. */
+ const F_OK: number;
+ /** Constant for fs.access(). File can be read by the calling process. */
+ const R_OK: number;
+ /** Constant for fs.access(). File can be written by the calling process. */
+ const W_OK: number;
+ /** Constant for fs.access(). File can be executed by the calling process. */
+ const X_OK: number;
+ // File Copy Constants
+ /** Constant for fs.copyFile. Flag indicating the destination file should not be overwritten if it already exists. */
+ const COPYFILE_EXCL: number;
+ /**
+ * Constant for fs.copyFile. copy operation will attempt to create a copy-on-write reflink.
+ * If the underlying platform does not support copy-on-write, then a fallback copy mechanism is used.
+ */
+ const COPYFILE_FICLONE: number;
+ /**
+ * Constant for fs.copyFile. Copy operation will attempt to create a copy-on-write reflink.
+ * If the underlying platform does not support copy-on-write, then the operation will fail with an error.
+ */
+ const COPYFILE_FICLONE_FORCE: number;
+ // File Open Constants
+ /** Constant for fs.open(). Flag indicating to open a file for read-only access. */
+ const O_RDONLY: number;
+ /** Constant for fs.open(). Flag indicating to open a file for write-only access. */
+ const O_WRONLY: number;
+ /** Constant for fs.open(). Flag indicating to open a file for read-write access. */
+ const O_RDWR: number;
+ /** Constant for fs.open(). Flag indicating to create the file if it does not already exist. */
+ const O_CREAT: number;
+ /** Constant for fs.open(). Flag indicating that opening a file should fail if the O_CREAT flag is set and the file already exists. */
+ const O_EXCL: number;
+ /**
+ * Constant for fs.open(). Flag indicating that if path identifies a terminal device,
+ * opening the path shall not cause that terminal to become the controlling terminal for the process
+ * (if the process does not already have one).
+ */
+ const O_NOCTTY: number;
+ /** Constant for fs.open(). Flag indicating that if the file exists and is a regular file, and the file is opened successfully for write access, its length shall be truncated to zero. */
+ const O_TRUNC: number;
+ /** Constant for fs.open(). Flag indicating that data will be appended to the end of the file. */
+ const O_APPEND: number;
+ /** Constant for fs.open(). Flag indicating that the open should fail if the path is not a directory. */
+ const O_DIRECTORY: number;
+ /**
+ * constant for fs.open().
+ * Flag indicating reading accesses to the file system will no longer result in
+ * an update to the atime information associated with the file.
+ * This flag is available on Linux operating systems only.
+ */
+ const O_NOATIME: number;
+ /** Constant for fs.open(). Flag indicating that the open should fail if the path is a symbolic link. */
+ const O_NOFOLLOW: number;
+ /** Constant for fs.open(). Flag indicating that the file is opened for synchronous I/O. */
+ const O_SYNC: number;
+ /** Constant for fs.open(). Flag indicating that the file is opened for synchronous I/O with write operations waiting for data integrity. */
+ const O_DSYNC: number;
+ /** Constant for fs.open(). Flag indicating to open the symbolic link itself rather than the resource it is pointing to. */
+ const O_SYMLINK: number;
+ /** Constant for fs.open(). When set, an attempt will be made to minimize caching effects of file I/O. */
+ const O_DIRECT: number;
+ /** Constant for fs.open(). Flag indicating to open the file in nonblocking mode when possible. */
+ const O_NONBLOCK: number;
+ // File Type Constants
+ /** Constant for fs.Stats mode property for determining a file's type. Bit mask used to extract the file type code. */
+ const S_IFMT: number;
+ /** Constant for fs.Stats mode property for determining a file's type. File type constant for a regular file. */
+ const S_IFREG: number;
+ /** Constant for fs.Stats mode property for determining a file's type. File type constant for a directory. */
+ const S_IFDIR: number;
+ /** Constant for fs.Stats mode property for determining a file's type. File type constant for a character-oriented device file. */
+ const S_IFCHR: number;
+ /** Constant for fs.Stats mode property for determining a file's type. File type constant for a block-oriented device file. */
+ const S_IFBLK: number;
+ /** Constant for fs.Stats mode property for determining a file's type. File type constant for a FIFO/pipe. */
+ const S_IFIFO: number;
+ /** Constant for fs.Stats mode property for determining a file's type. File type constant for a symbolic link. */
+ const S_IFLNK: number;
+ /** Constant for fs.Stats mode property for determining a file's type. File type constant for a socket. */
+ const S_IFSOCK: number;
+ // File Mode Constants
+ /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by owner. */
+ const S_IRWXU: number;
+ /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by owner. */
+ const S_IRUSR: number;
+ /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by owner. */
+ const S_IWUSR: number;
+ /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by owner. */
+ const S_IXUSR: number;
+ /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by group. */
+ const S_IRWXG: number;
+ /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by group. */
+ const S_IRGRP: number;
+ /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by group. */
+ const S_IWGRP: number;
+ /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by group. */
+ const S_IXGRP: number;
+ /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by others. */
+ const S_IRWXO: number;
+ /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by others. */
+ const S_IROTH: number;
+ /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by others. */
+ const S_IWOTH: number;
+ /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by others. */
+ const S_IXOTH: number;
+ /**
+ * When set, a memory file mapping is used to access the file. This flag
+ * is available on Windows operating systems only. On other operating systems,
+ * this flag is ignored.
+ */
+ const UV_FS_O_FILEMAP: number;
+ }
+ /**
+ * Tests a user's permissions for the file or directory specified by `path`.
+ * 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`
+ * (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for
+ * possible values of `mode`.
+ *
+ * The final argument, `callback`, is a callback function that is invoked with
+ * a possible error argument. If any of the accessibility checks fail, the error
+ * argument will be an `Error` object. The following examples check if`package.json` exists, and if it is readable or writable.
+ *
+ * ```js
+ * import { access, constants } from 'fs';
+ *
+ * const file = 'package.json';
+ *
+ * // Check if the file exists in the current directory.
+ * access(file, constants.F_OK, (err) => {
+ * console.log(`${file} ${err ? 'does not exist' : 'exists'}`);
+ * });
+ *
+ * // Check if the file is readable.
+ * access(file, constants.R_OK, (err) => {
+ * console.log(`${file} ${err ? 'is not readable' : 'is readable'}`);
+ * });
+ *
+ * // Check if the file is writable.
+ * access(file, constants.W_OK, (err) => {
+ * console.log(`${file} ${err ? 'is not writable' : 'is writable'}`);
+ * });
+ *
+ * // Check if the file is readable and writable.
+ * access(file, constants.R_OK | constants.W_OK, (err) => {
+ * console.log(`${file} ${err ? 'is not' : 'is'} readable and writable`);
+ * });
+ * ```
+ *
+ * Do not use `fs.access()` to check for the accessibility of a file before calling`fs.open()`, `fs.readFile()` or `fs.writeFile()`. Doing
+ * so introduces a race condition, since other processes may change the file's
+ * state between the two calls. Instead, user code should open/read/write the
+ * file directly and handle the error raised if the file is not accessible.
+ *
+ * **write (NOT RECOMMENDED)**
+ *
+ * ```js
+ * import { access, open, close } from 'fs';
+ *
+ * access('myfile', (err) => {
+ * if (!err) {
+ * console.error('myfile already exists');
+ * return;
+ * }
+ *
+ * open('myfile', 'wx', (err, fd) => {
+ * if (err) throw err;
+ *
+ * try {
+ * writeMyData(fd);
+ * } finally {
+ * close(fd, (err) => {
+ * if (err) throw err;
+ * });
+ * }
+ * });
+ * });
+ * ```
+ *
+ * **write (RECOMMENDED)**
+ *
+ * ```js
+ * import { open, close } from 'fs';
+ *
+ * open('myfile', 'wx', (err, fd) => {
+ * if (err) {
+ * if (err.code === 'EEXIST') {
+ * console.error('myfile already exists');
+ * return;
+ * }
+ *
+ * throw err;
+ * }
+ *
+ * try {
+ * writeMyData(fd);
+ * } finally {
+ * close(fd, (err) => {
+ * if (err) throw err;
+ * });
+ * }
+ * });
+ * ```
+ *
+ * **read (NOT RECOMMENDED)**
+ *
+ * ```js
+ * import { access, open, close } from 'fs';
+ * access('myfile', (err) => {
+ * if (err) {
+ * if (err.code === 'ENOENT') {
+ * console.error('myfile does not exist');
+ * return;
+ * }
+ *
+ * throw err;
+ * }
+ *
+ * open('myfile', 'r', (err, fd) => {
+ * if (err) throw err;
+ *
+ * try {
+ * readMyData(fd);
+ * } finally {
+ * close(fd, (err) => {
+ * if (err) throw err;
+ * });
+ * }
+ * });
+ * });
+ * ```
+ *
+ * **read (RECOMMENDED)**
+ *
+ * ```js
+ * import { open, close } from 'fs';
+ *
+ * open('myfile', 'r', (err, fd) => {
+ * if (err) {
+ * if (err.code === 'ENOENT') {
+ * console.error('myfile does not exist');
+ * return;
+ * }
+ *
+ * throw err;
+ * }
+ *
+ * try {
+ * readMyData(fd);
+ * } finally {
+ * close(fd, (err) => {
+ * if (err) throw err;
+ * });
+ * }
+ * });
+ * ```
+ *
+ * The "not recommended" examples above check for accessibility and then use the
+ * file; the "recommended" examples are better because they use the file directly
+ * and handle the error, if any.
+ *
+ * In general, check for the accessibility of a file only if the file will not be
+ * used directly, for example when its accessibility is a signal from another
+ * process.
+ *
+ * On Windows, access-control policies (ACLs) on a directory may limit access to
+ * a file or directory. The `fs.access()` function, however, does not check the
+ * ACL and therefore may report that a path is accessible even if the ACL restricts
+ * the user from reading or writing to it.
+ * @since v0.11.15
+ * @param [mode=fs.constants.F_OK]
+ */
+ export function access(path: PathLike, mode: number | undefined, callback: NoParamCallback): void;
+ /**
+ * Asynchronously tests a user's permissions for the file specified by path.
+ * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
+ */
+ export function access(path: PathLike, callback: NoParamCallback): void;
+ export namespace access {
+ /**
+ * Asynchronously tests a user's permissions for the file specified by path.
+ * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
+ * URL support is _experimental_.
+ */
+ function __promisify__(path: PathLike, mode?: number): Promise<void>;
+ }
+ /**
+ * Synchronously tests a user's permissions for the file or directory specified
+ * by `path`. 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` (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for
+ * possible values of `mode`.
+ *
+ * If any of the accessibility checks fail, an `Error` will be thrown. Otherwise,
+ * the method will return `undefined`.
+ *
+ * ```js
+ * import { accessSync, constants } from 'fs';
+ *
+ * try {
+ * accessSync('etc/passwd', constants.R_OK | constants.W_OK);
+ * console.log('can read/write');
+ * } catch (err) {
+ * console.error('no access!');
+ * }
+ * ```
+ * @since v0.11.15
+ * @param [mode=fs.constants.F_OK]
+ */
+ export function accessSync(path: PathLike, mode?: number): void;
+ interface StreamOptions {
+ flags?: string | undefined;
+ encoding?: BufferEncoding | undefined;
+ fd?: number | promises.FileHandle | undefined;
+ mode?: number | undefined;
+ autoClose?: boolean | undefined;
+ emitClose?: boolean | undefined;
+ start?: number | undefined;
+ highWaterMark?: number | undefined;
+ }
+ interface FSImplementation {
+ open?: (...args: any[]) => any;
+ close?: (...args: any[]) => any;
+ }
+ interface CreateReadStreamFSImplementation extends FSImplementation {
+ read: (...args: any[]) => any;
+ }
+ interface CreateWriteStreamFSImplementation extends FSImplementation {
+ write: (...args: any[]) => any;
+ writev?: (...args: any[]) => any;
+ }
+ interface ReadStreamOptions extends StreamOptions {
+ fs?: CreateReadStreamFSImplementation | null | undefined;
+ end?: number | undefined;
+ }
+ interface WriteStreamOptions extends StreamOptions {
+ fs?: CreateWriteStreamFSImplementation | null | undefined;
+ }
+ /**
+ * Unlike the 16 kb default `highWaterMark` for a `stream.Readable`, the stream
+ * 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
+ * the file instead of the entire file. Both `start` and `end` are inclusive and
+ * start counting at 0, 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. If `fd` is specified and `start` is
+ * omitted or `undefined`, `fs.createReadStream()` reads sequentially from the
+ * current file position. The `encoding` can be any one of those accepted by `Buffer`.
+ *
+ * If `fd` is specified, `ReadStream` will ignore the `path` argument and will use
+ * the specified file descriptor. This means that no `'open'` event will be
+ * emitted. `fd` should be blocking; non-blocking `fd`s should be passed to `net.Socket`.
+ *
+ * If `fd` points to a character device that only supports blocking reads
+ * (such as keyboard or sound card), read operations do not finish until data is
+ * available. This can prevent the process from exiting and the stream from
+ * closing naturally.
+ *
+ * By default, the stream will emit a `'close'` event after it has been
+ * destroyed. Set the `emitClose` option to `false` to change this behavior.
+ *
+ * By providing the `fs` option, it is possible to override the corresponding `fs`implementations for `open`, `read`, and `close`. When providing the `fs` option,
+ * an override for `read` is required. If no `fd` is provided, an override for`open` is also required. If `autoClose` is `true`, an override for `close` is
+ * also required.
+ *
+ * ```js
+ * import { createReadStream } from 'fs';
+ *
+ * // Create a stream from some character device.
+ * const stream = createReadStream('/dev/input/event0');
+ * setTimeout(() => {
+ * stream.close(); // This may not close the stream.
+ * // Artificially marking end-of-stream, as if the underlying resource had
+ * // indicated end-of-file by itself, allows the stream to close.
+ * // This does not cancel pending read operations, and if there is such an
+ * // operation, the process may still not be able to exit successfully
+ * // until it finishes.
+ * stream.push(null);
+ * stream.read(0);
+ * }, 100);
+ * ```
+ *
+ * If `autoClose` is false, then the file descriptor won't be closed, even if
+ * there's an error. It is the application's responsibility to close it and make
+ * sure there's no file descriptor leak. If `autoClose` is set to true (default
+ * behavior), on `'error'` or `'end'` the file descriptor will be closed
+ * automatically.
+ *
+ * `mode` sets the file mode (permission and sticky bits), but only if the
+ * file was created.
+ *
+ * An example to read the last 10 bytes of a file which is 100 bytes long:
+ *
+ * ```js
+ * import { createReadStream } from 'fs';
+ *
+ * createReadStream('sample.txt', { start: 90, end: 99 });
+ * ```
+ *
+ * If `options` is a string, then it specifies the encoding.
+ * @since v0.1.31
+ */
+ export function createReadStream(path: PathLike, options?: BufferEncoding | ReadStreamOptions): ReadStream;
+ /**
+ * `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
+ * \[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 it may require the `flags` option to be set to `r+` rather than the
+ * default `w`. 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,
+ * then the file descriptor won't be closed, even if there's an error.
+ * It is the application's responsibility to close it and make sure there's no
+ * file descriptor leak.
+ *
+ * By default, the stream will emit a `'close'` event after it has been
+ * destroyed. Set the `emitClose` option to `false` to change this behavior.
+ *
+ * By providing the `fs` option it is possible to override the corresponding `fs`implementations for `open`, `write`, `writev` and `close`. Overriding `write()`without `writev()` can reduce
+ * performance as some optimizations (`_writev()`)
+ * will be disabled. When providing the `fs` option, overrides for at least one of`write` and `writev` are required. If no `fd` option is supplied, an override
+ * for `open` is also required. If `autoClose` is `true`, an override for `close`is also required.
+ *
+ * Like `fs.ReadStream`, if `fd` is specified, `fs.WriteStream` will ignore the`path` argument and will use the specified file descriptor. This means that no`'open'` event will be
+ * emitted. `fd` should be blocking; non-blocking `fd`s
+ * should be passed to `net.Socket`.
+ *
+ * If `options` is a string, then it specifies the encoding.
+ * @since v0.1.31
+ */
+ export function createWriteStream(path: PathLike, options?: BufferEncoding | WriteStreamOptions): WriteStream;
+ /**
+ * Forces all currently queued I/O operations associated with the file to the
+ * operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. No arguments other
+ * than a possible
+ * exception are given to the completion callback.
+ * @since v0.1.96
+ */
+ export function fdatasync(fd: number, callback: NoParamCallback): void;
+ export namespace fdatasync {
+ /**
+ * Asynchronous fdatasync(2) - synchronize a file's in-core state with storage device.
+ * @param fd A file descriptor.
+ */
+ function __promisify__(fd: number): Promise<void>;
+ }
+ /**
+ * Forces all currently queued I/O operations associated with the file to the
+ * operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. Returns `undefined`.
+ * @since v0.1.96
+ */
+ export function fdatasyncSync(fd: number): void;
+ /**
+ * Asynchronously copies `src` to `dest`. By default, `dest` is overwritten if it
+ * already exists. No arguments other than a possible exception are given to the
+ * callback function. Node.js makes no guarantees about the atomicity of the copy
+ * operation. If an error occurs after the destination file has been opened for
+ * writing, Node.js will attempt to remove the destination.
+ *
+ * `mode` is an optional integer that specifies the behavior
+ * of the copy operation. It is possible to create a mask consisting of the bitwise
+ * OR of two or more values (e.g.`fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`).
+ *
+ * * `fs.constants.COPYFILE_EXCL`: The copy operation will fail if `dest` already
+ * exists.
+ * * `fs.constants.COPYFILE_FICLONE`: The copy operation will attempt to create a
+ * copy-on-write reflink. If the platform does not support copy-on-write, then a
+ * fallback copy mechanism is used.
+ * * `fs.constants.COPYFILE_FICLONE_FORCE`: The copy operation will attempt to
+ * create a copy-on-write reflink. If the platform does not support
+ * copy-on-write, then the operation will fail.
+ *
+ * ```js
+ * import { copyFile, constants } from 'fs';
+ *
+ * function callback(err) {
+ * if (err) throw err;
+ * console.log('source.txt was copied to destination.txt');
+ * }
+ *
+ * // destination.txt will be created or overwritten by default.
+ * copyFile('source.txt', 'destination.txt', callback);
+ *
+ * // By using COPYFILE_EXCL, the operation will fail if destination.txt exists.
+ * copyFile('source.txt', 'destination.txt', constants.COPYFILE_EXCL, callback);
+ * ```
+ * @since v8.5.0
+ * @param src source filename to copy
+ * @param dest destination filename of the copy operation
+ * @param [mode=0] modifiers for copy operation.
+ */
+ export function copyFile(src: PathLike, dest: PathLike, callback: NoParamCallback): void;
+ export function copyFile(src: PathLike, dest: PathLike, mode: number, callback: NoParamCallback): void;
+ export namespace copyFile {
+ function __promisify__(src: PathLike, dst: PathLike, mode?: number): Promise<void>;
+ }
+ /**
+ * Synchronously copies `src` to `dest`. By default, `dest` is overwritten if it
+ * already exists. Returns `undefined`. Node.js makes no guarantees about the
+ * atomicity of the copy operation. If an error occurs after the destination file
+ * has been opened for writing, Node.js will attempt to remove the destination.
+ *
+ * `mode` is an optional integer that specifies the behavior
+ * of the copy operation. It is possible to create a mask consisting of the bitwise
+ * OR of two or more values (e.g.`fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`).
+ *
+ * * `fs.constants.COPYFILE_EXCL`: The copy operation will fail if `dest` already
+ * exists.
+ * * `fs.constants.COPYFILE_FICLONE`: The copy operation will attempt to create a
+ * copy-on-write reflink. If the platform does not support copy-on-write, then a
+ * fallback copy mechanism is used.
+ * * `fs.constants.COPYFILE_FICLONE_FORCE`: The copy operation will attempt to
+ * create a copy-on-write reflink. If the platform does not support
+ * copy-on-write, then the operation will fail.
+ *
+ * ```js
+ * import { copyFileSync, constants } from 'fs';
+ *
+ * // destination.txt will be created or overwritten by default.
+ * copyFileSync('source.txt', 'destination.txt');
+ * console.log('source.txt was copied to destination.txt');
+ *
+ * // By using COPYFILE_EXCL, the operation will fail if destination.txt exists.
+ * copyFileSync('source.txt', 'destination.txt', constants.COPYFILE_EXCL);
+ * ```
+ * @since v8.5.0
+ * @param src source filename to copy
+ * @param dest destination filename of the copy operation
+ * @param [mode=0] modifiers for copy operation.
+ */
+ export function copyFileSync(src: PathLike, dest: PathLike, mode?: number): void;
+ /**
+ * Write an array of `ArrayBufferView`s to the file specified by `fd` using`writev()`.
+ *
+ * `position` is the offset from the beginning of the file where this data
+ * should be written. If `typeof position !== 'number'`, the data will be written
+ * at the current position.
+ *
+ * The callback will be given three arguments: `err`, `bytesWritten`, and`buffers`. `bytesWritten` is how many bytes were written from `buffers`.
+ *
+ * If this method is `util.promisify()` ed, it returns a promise for an`Object` with `bytesWritten` and `buffers` properties.
+ *
+ * It is unsafe to use `fs.writev()` multiple times on the same file without
+ * waiting for the callback. For this scenario, use {@link createWriteStream}.
+ *
+ * On Linux, positional writes don't work when the file is opened in append mode.
+ * The kernel ignores the position argument and always appends the data to
+ * the end of the file.
+ * @since v12.9.0
+ */
+ export function writev(
+ fd: number,
+ buffers: readonly NodeJS.ArrayBufferView[],
+ cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => void,
+ ): void;
+ export function writev(
+ fd: number,
+ buffers: readonly NodeJS.ArrayBufferView[],
+ position: number,
+ cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => void,
+ ): void;
+ export interface WriteVResult {
+ bytesWritten: number;
+ buffers: NodeJS.ArrayBufferView[];
+ }
+ export namespace writev {
+ function __promisify__(
+ fd: number,
+ buffers: readonly NodeJS.ArrayBufferView[],
+ position?: number,
+ ): Promise<WriteVResult>;
+ }
+ /**
+ * For detailed information, see the documentation of the asynchronous version of
+ * this API: {@link writev}.
+ * @since v12.9.0
+ * @return The number of bytes written.
+ */
+ export function writevSync(fd: number, buffers: readonly NodeJS.ArrayBufferView[], position?: number): number;
+ /**
+ * Read from a file specified by `fd` and write to an array of `ArrayBufferView`s
+ * using `readv()`.
+ *
+ * `position` is the offset from the beginning of the file from where data
+ * should be read. If `typeof position !== 'number'`, the data will be read
+ * from the current position.
+ *
+ * The callback will be given three arguments: `err`, `bytesRead`, and`buffers`. `bytesRead` is how many bytes were read from the file.
+ *
+ * If this method is invoked as its `util.promisify()` ed version, it returns
+ * a promise for an `Object` with `bytesRead` and `buffers` properties.
+ * @since v13.13.0, v12.17.0
+ */
+ export function readv(
+ fd: number,
+ buffers: readonly NodeJS.ArrayBufferView[],
+ cb: (err: NodeJS.ErrnoException | null, bytesRead: number, buffers: NodeJS.ArrayBufferView[]) => void,
+ ): void;
+ export function readv(
+ fd: number,
+ buffers: readonly NodeJS.ArrayBufferView[],
+ position: number,
+ cb: (err: NodeJS.ErrnoException | null, bytesRead: number, buffers: NodeJS.ArrayBufferView[]) => void,
+ ): void;
+ export interface ReadVResult {
+ bytesRead: number;
+ buffers: NodeJS.ArrayBufferView[];
+ }
+ export namespace readv {
+ function __promisify__(
+ fd: number,
+ buffers: readonly NodeJS.ArrayBufferView[],
+ position?: number,
+ ): Promise<ReadVResult>;
+ }
+ /**
+ * For detailed information, see the documentation of the asynchronous version of
+ * this API: {@link readv}.
+ * @since v13.13.0, v12.17.0
+ * @return The number of bytes read.
+ */
+ export function readvSync(fd: number, buffers: readonly NodeJS.ArrayBufferView[], position?: number): number;
+ export interface OpenDirOptions {
+ encoding?: BufferEncoding | undefined;
+ /**
+ * Number of directory entries that are buffered
+ * internally when reading from the directory. Higher values lead to better
+ * performance but higher memory usage.
+ * @default 32
+ */
+ bufferSize?: number | undefined;
+ }
+ /**
+ * Synchronously open a directory. See [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html).
+ *
+ * Creates an `fs.Dir`, which contains all further functions for reading from
+ * and cleaning up the directory.
+ *
+ * The `encoding` option sets the encoding for the `path` while opening the
+ * directory and subsequent read operations.
+ * @since v12.12.0
+ */
+ export function opendirSync(path: PathLike, options?: OpenDirOptions): Dir;
+ /**
+ * Asynchronously open a directory. See the POSIX [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html) documentation for
+ * more details.
+ *
+ * Creates an `fs.Dir`, which contains all further functions for reading from
+ * and cleaning up the directory.
+ *
+ * The `encoding` option sets the encoding for the `path` while opening the
+ * directory and subsequent read operations.
+ * @since v12.12.0
+ */
+ export function opendir(path: PathLike, cb: (err: NodeJS.ErrnoException | null, dir: Dir) => void): void;
+ export function opendir(
+ path: PathLike,
+ options: OpenDirOptions,
+ cb: (err: NodeJS.ErrnoException | null, dir: Dir) => void,
+ ): void;
+ export namespace opendir {
+ function __promisify__(path: PathLike, options?: OpenDirOptions): Promise<Dir>;
+ }
+ export interface BigIntStats extends StatsBase<bigint> {
+ atimeNs: bigint;
+ mtimeNs: bigint;
+ ctimeNs: bigint;
+ birthtimeNs: bigint;
+ }
+ export interface BigIntOptions {
+ bigint: true;
+ }
+ export interface StatOptions {
+ bigint?: boolean | undefined;
+ }
+ export interface StatSyncOptions extends StatOptions {
+ throwIfNoEntry?: boolean | undefined;
+ }
+ interface CopyOptionsBase {
+ /**
+ * Dereference symlinks
+ * @default false
+ */
+ dereference?: boolean;
+ /**
+ * When `force` is `false`, and the destination
+ * exists, throw an error.
+ * @default false
+ */
+ errorOnExist?: boolean;
+ /**
+ * Overwrite existing file or directory. _The copy
+ * operation will ignore errors if you set this to false and the destination
+ * exists. Use the `errorOnExist` option to change this behavior.
+ * @default true
+ */
+ force?: boolean;
+ /**
+ * Modifiers for copy operation. See `mode` flag of {@link copyFileSync()}
+ */
+ mode?: number;
+ /**
+ * When `true` timestamps from `src` will
+ * be preserved.
+ * @default false
+ */
+ preserveTimestamps?: boolean;
+ /**
+ * Copy directories recursively.
+ * @default false
+ */
+ recursive?: boolean;
+ /**
+ * When true, path resolution for symlinks will be skipped
+ * @default false
+ */
+ verbatimSymlinks?: boolean;
+ }
+ export interface CopyOptions extends CopyOptionsBase {
+ /**
+ * Function to filter copied files/directories. Return
+ * `true` to copy the item, `false` to ignore it.
+ */
+ filter?(source: string, destination: string): boolean | Promise<boolean>;
+ }
+ export interface CopySyncOptions extends CopyOptionsBase {
+ /**
+ * Function to filter copied files/directories. Return
+ * `true` to copy the item, `false` to ignore it.
+ */
+ filter?(source: string, destination: string): boolean;
+ }
+ /**
+ * Asynchronously copies the entire directory structure from `src` to `dest`,
+ * including subdirectories and files.
+ *
+ * When copying a directory to another directory, globs are not supported and
+ * behavior is similar to `cp dir1/ dir2/`.
+ * @since v16.7.0
+ * @experimental
+ * @param src source path to copy.
+ * @param dest destination path to copy to.
+ */
+ export function cp(
+ source: string | URL,
+ destination: string | URL,
+ callback: (err: NodeJS.ErrnoException | null) => void,
+ ): void;
+ export function cp(
+ source: string | URL,
+ destination: string | URL,
+ opts: CopyOptions,
+ callback: (err: NodeJS.ErrnoException | null) => void,
+ ): void;
+ /**
+ * Synchronously copies the entire directory structure from `src` to `dest`,
+ * including subdirectories and files.
+ *
+ * When copying a directory to another directory, globs are not supported and
+ * behavior is similar to `cp dir1/ dir2/`.
+ * @since v16.7.0
+ * @experimental
+ * @param src source path to copy.
+ * @param dest destination path to copy to.
+ */
+ export function cpSync(source: string | URL, destination: string | URL, opts?: CopySyncOptions): void;
+}
+declare module "node:fs" {
+ export * from "fs";
+}
diff --git a/client/node_modules/@types/node/ts4.8/fs/promises.d.ts b/client/node_modules/@types/node/ts4.8/fs/promises.d.ts
new file mode 100644
index 0000000..7e55f89
--- /dev/null
+++ b/client/node_modules/@types/node/ts4.8/fs/promises.d.ts
@@ -0,0 +1,1205 @@
+/**
+ * The `fs/promises` API provides asynchronous file system methods that return
+ * promises.
+ *
+ * The promise APIs use the underlying Node.js threadpool to perform file
+ * system operations off the event loop thread. These operations are not
+ * synchronized or threadsafe. Care must be taken when performing multiple
+ * concurrent modifications on the same file or data corruption may occur.
+ * @since v10.0.0
+ */
+declare module "fs/promises" {
+ import { Abortable } from "node:events";
+ import { Stream } from "node:stream";
+ import { ReadableStream } from "node:stream/web";
+ import {
+ BigIntStats,
+ BigIntStatsFs,
+ BufferEncodingOption,
+ constants as fsConstants,
+ CopyOptions,
+ Dir,
+ Dirent,
+ MakeDirectoryOptions,
+ Mode,
+ ObjectEncodingOptions,
+ OpenDirOptions,
+ OpenMode,
+ PathLike,
+ ReadStream,
+ ReadVResult,
+ RmDirOptions,
+ RmOptions,
+ StatFsOptions,
+ StatOptions,
+ Stats,
+ StatsFs,
+ TimeLike,
+ WatchEventType,
+ WatchOptions,
+ WriteStream,
+ WriteVResult,
+ } from "node:fs";
+ import { Interface as ReadlineInterface } from "node:readline";
+
+ interface FileChangeInfo<T extends string | Buffer> {
+ eventType: WatchEventType;
+ filename: T | null;
+ }
+ interface FlagAndOpenMode {
+ mode?: Mode | undefined;
+ flag?: OpenMode | undefined;
+ }
+ interface FileReadResult<T extends NodeJS.ArrayBufferView> {
+ bytesRead: number;
+ buffer: T;
+ }
+ interface FileReadOptions<T extends NodeJS.ArrayBufferView = Buffer> {
+ /**
+ * @default `Buffer.alloc(0xffff)`
+ */
+ buffer?: T;
+ /**
+ * @default 0
+ */
+ offset?: number | null;
+ /**
+ * @default `buffer.byteLength`
+ */
+ length?: number | null;
+ position?: number | null;
+ }
+ interface CreateReadStreamOptions {
+ encoding?: BufferEncoding | null | undefined;
+ autoClose?: boolean | undefined;
+ emitClose?: boolean | undefined;
+ start?: number | undefined;
+ end?: number | undefined;
+ highWaterMark?: number | undefined;
+ }
+ interface CreateWriteStreamOptions {
+ encoding?: BufferEncoding | null | undefined;
+ autoClose?: boolean | undefined;
+ emitClose?: boolean | undefined;
+ start?: number | undefined;
+ highWaterMark?: number | undefined;
+ }
+ interface ReadableWebStreamOptions {
+ /**
+ * Whether to open a normal or a `'bytes'` stream.
+ * @since v18.17.0
+ */
+ type?: "bytes" | undefined;
+ }
+ // TODO: Add `EventEmitter` close
+ interface FileHandle {
+ /**
+ * The numeric file descriptor managed by the {FileHandle} object.
+ * @since v10.0.0
+ */
+ readonly fd: number;
+ /**
+ * Alias of `filehandle.writeFile()`.
+ *
+ * When operating on file handles, the mode cannot be changed from what it was set
+ * to with `fsPromises.open()`. Therefore, this is equivalent to `filehandle.writeFile()`.
+ * @since v10.0.0
+ * @return Fulfills with `undefined` upon success.
+ */
+ appendFile(
+ 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).
+ * @since v10.0.0
+ * @param uid The file's new owner's user id.
+ * @param gid The file's new group's group id.
+ * @return Fulfills with `undefined` upon success.
+ */
+ chown(uid: number, gid: number): Promise<void>;
+ /**
+ * Modifies the permissions on the file. See [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html).
+ * @since v10.0.0
+ * @param mode the file mode bit mask.
+ * @return Fulfills with `undefined` upon success.
+ */
+ chmod(mode: Mode): Promise<void>;
+ /**
+ * Unlike the 16 kb default `highWaterMark` for a `stream.Readable`, the stream
+ * 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
+ * the file instead of the entire file. Both `start` and `end` are inclusive and
+ * start counting at 0, 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. If `start` is
+ * omitted or `undefined`, `filehandle.createReadStream()` reads sequentially from
+ * the current file position. The `encoding` can be any one of those accepted by `Buffer`.
+ *
+ * If the `FileHandle` points to a character device that only supports blocking
+ * reads (such as keyboard or sound card), read operations do not finish until data
+ * is available. This can prevent the process from exiting and the stream from
+ * closing naturally.
+ *
+ * By default, the stream will emit a `'close'` event after it has been
+ * destroyed. Set the `emitClose` option to `false` to change this behavior.
+ *
+ * ```js
+ * import { open } from 'fs/promises';
+ *
+ * const fd = await open('/dev/input/event0');
+ * // Create a stream from some character device.
+ * const stream = fd.createReadStream();
+ * setTimeout(() => {
+ * stream.close(); // This may not close the stream.
+ * // Artificially marking end-of-stream, as if the underlying resource had
+ * // indicated end-of-file by itself, allows the stream to close.
+ * // This does not cancel pending read operations, and if there is such an
+ * // operation, the process may still not be able to exit successfully
+ * // until it finishes.
+ * stream.push(null);
+ * stream.read(0);
+ * }, 100);
+ * ```
+ *
+ * If `autoClose` is false, then the file descriptor won't be closed, even if
+ * there's an error. It is the application's responsibility to close it and make
+ * sure there's no file descriptor leak. If `autoClose` is set to true (default
+ * behavior), on `'error'` or `'end'` the file descriptor will be closed
+ * automatically.
+ *
+ * An example to read the last 10 bytes of a file which is 100 bytes long:
+ *
+ * ```js
+ * import { open } from 'fs/promises';
+ *
+ * const fd = await open('sample.txt');
+ * fd.createReadStream({ start: 90, end: 99 });
+ * ```
+ * @since v16.11.0
+ */
+ createReadStream(options?: CreateReadStreamOptions): ReadStream;
+ /**
+ * `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
+ * \[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 it may require the `flags` `open` option to be set to `r+` rather than
+ * the 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,
+ * then the file descriptor won't be closed, even if there's an error.
+ * It is the application's responsibility to close it and make sure there's no
+ * file descriptor leak.
+ *
+ * By default, the stream will emit a `'close'` event after it has been
+ * destroyed. Set the `emitClose` option to `false` to change this behavior.
+ * @since v16.11.0
+ */
+ createWriteStream(options?: CreateWriteStreamOptions): WriteStream;
+ /**
+ * Forces all currently queued I/O operations associated with the file to the
+ * operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details.
+ *
+ * Unlike `filehandle.sync` this method does not flush modified metadata.
+ * @since v10.0.0
+ * @return Fulfills with `undefined` upon success.
+ */
+ datasync(): Promise<void>;
+ /**
+ * Request that all data for the open file descriptor is flushed to the storage
+ * 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.
+ * @since v10.0.0
+ * @return Fufills with `undefined` upon success.
+ */
+ sync(): Promise<void>;
+ /**
+ * Reads data from the file and stores that in the given buffer.
+ *
+ * If the file is not modified concurrently, the end-of-file is reached when the
+ * number of bytes read is zero.
+ * @since v10.0.0
+ * @param buffer A buffer that will be filled with the file data read.
+ * @param offset The location in the buffer at which to start filling.
+ * @param length The number of bytes to read.
+ * @param position The location where to begin reading data from the file. If `null`, data will be read from the current file position, and the position will be updated. If `position` is an
+ * integer, the current file position will remain unchanged.
+ * @return Fulfills upon success with an object with two properties:
+ */
+ read<T extends NodeJS.ArrayBufferView>(
+ buffer: 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.
+ *
+ * If `options` is a string, then it specifies the `encoding`.
+ *
+ * The `FileHandle` has to support reading.
+ *
+ * If one or more `filehandle.read()` calls are made on a file handle and then a`filehandle.readFile()` call is made, the data will be read from the current
+ * position till the end of the file. It doesn't always read from the beginning
+ * of the file.
+ * @since v10.0.0
+ * @return Fulfills upon a successful read with the contents of the file. If no encoding is specified (using `options.encoding`), the data is returned as a {Buffer} object. Otherwise, the
+ * data will be a string.
+ */
+ readFile(
+ options?: {
+ encoding?: null | undefined;
+ flag?: OpenMode | undefined;
+ } | null,
+ ): Promise<Buffer>;
+ /**
+ * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically.
+ * The `FileHandle` must have been opened for reading.
+ * @param options An object that may contain an optional flag.
+ * If a flag is not provided, it defaults to `'r'`.
+ */
+ readFile(
+ options:
+ | {
+ encoding: BufferEncoding;
+ flag?: OpenMode | undefined;
+ }
+ | BufferEncoding,
+ ): Promise<string>;
+ /**
+ * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically.
+ * The `FileHandle` must have been opened for reading.
+ * @param options An object that may contain an optional flag.
+ * If a flag is not provided, it defaults to `'r'`.
+ */
+ readFile(
+ options?:
+ | (ObjectEncodingOptions & {
+ flag?: OpenMode | undefined;
+ })
+ | BufferEncoding
+ | null,
+ ): Promise<string | Buffer>;
+ /**
+ * Convenience method to create a `readline` interface and stream over the file. For example:
+ *
+ * ```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
+ * @param options See `filehandle.createReadStream()` for the options.
+ */
+ readLines(options?: CreateReadStreamOptions): ReadlineInterface;
+ /**
+ * @since v10.0.0
+ * @return Fulfills with an {fs.Stats} for the file.
+ */
+ stat(
+ opts?: StatOptions & {
+ bigint?: false | undefined;
+ },
+ ): Promise<Stats>;
+ stat(
+ opts: StatOptions & {
+ bigint: true;
+ },
+ ): Promise<BigIntStats>;
+ stat(opts?: StatOptions): Promise<Stats | BigIntStats>;
+ /**
+ * Truncates the file.
+ *
+ * If the file was larger than `len` bytes, only the first `len` bytes will be
+ * retained in the file.
+ *
+ * The following example retains only the first four bytes of the file:
+ *
+ * ```js
+ * import { open } from 'fs/promises';
+ *
+ * let filehandle = null;
+ * try {
+ * filehandle = await open('temp.txt', 'r+');
+ * await filehandle.truncate(4);
+ * } finally {
+ * await filehandle?.close();
+ * }
+ * ```
+ *
+ * If the file previously was shorter than `len` bytes, it is extended, and the
+ * extended part is filled with null bytes (`'\0'`):
+ *
+ * If `len` is negative then `0` will be used.
+ * @since v10.0.0
+ * @param [len=0]
+ * @return Fulfills with `undefined` upon success.
+ */
+ truncate(len?: number): Promise<void>;
+ /**
+ * 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
+ */
+ utimes(atime: TimeLike, mtime: TimeLike): Promise<void>;
+ /**
+ * 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
+ * [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol) object.
+ * The promise is resolved with no arguments upon success.
+ *
+ * If `options` is a string, then it specifies the `encoding`.
+ *
+ * The `FileHandle` has to support writing.
+ *
+ * It is unsafe to use `filehandle.writeFile()` multiple times on the same file
+ * without waiting for the promise to be resolved (or rejected).
+ *
+ * If one or more `filehandle.write()` calls are made on a file handle and then a`filehandle.writeFile()` call is made, the data will be written from the
+ * current position till the end of the file. It doesn't always write from the
+ * beginning of the file.
+ * @since v10.0.0
+ */
+ writeFile(
+ data: string | Uint8Array,
+ options?: (ObjectEncodingOptions & FlagAndOpenMode & Abortable) | BufferEncoding | null,
+ ): Promise<void>;
+ /**
+ * Write `buffer` to the file.
+ *
+ * The promise is resolved with an object containing two properties:
+ *
+ * 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
+ * scenario, use `filehandle.createWriteStream()`.
+ *
+ * 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 end of the file.
+ * @since v10.0.0
+ * @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 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.
+ * See the POSIX pwrite(2) documentation for more detail.
+ */
+ write<TBuffer extends Uint8Array>(
+ buffer: TBuffer,
+ offset?: number | null,
+ length?: number | null,
+ position?: number | null,
+ ): Promise<{
+ bytesWritten: number;
+ buffer: TBuffer;
+ }>;
+ write(
+ data: string,
+ position?: number | null,
+ encoding?: BufferEncoding | null,
+ ): Promise<{
+ bytesWritten: number;
+ buffer: string;
+ }>;
+ /**
+ * Write an array of [ArrayBufferView](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView) s to the file.
+ *
+ * The promise is resolved with an object containing a two properties:
+ *
+ * It is unsafe to call `writev()` multiple times on the same file without waiting
+ * for the promise to be resolved (or rejected).
+ *
+ * On Linux, positional writes don't work when the file is opened in append mode.
+ * The kernel ignores the position argument and always appends the data to
+ * the end of the file.
+ * @since v12.9.0
+ * @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.
+ */
+ writev(buffers: readonly 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
+ * @since v13.13.0, v12.17.0
+ * @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:
+ */
+ readv(buffers: readonly NodeJS.ArrayBufferView[], position?: number): Promise<ReadVResult>;
+ /**
+ * Closes the file handle after waiting for any pending operation on the handle to
+ * complete.
+ *
+ * ```js
+ * import { open } from 'fs/promises';
+ *
+ * let filehandle;
+ * try {
+ * filehandle = await open('thefile.txt', 'r');
+ * } finally {
+ * await filehandle?.close();
+ * }
+ * ```
+ * @since v10.0.0
+ * @return Fulfills with `undefined` upon success.
+ */
+ close(): Promise<void>;
+ /**
+ * An alias for {@link FileHandle.close()}.
+ * @since v18.18.0
+ */
+ [Symbol.asyncDispose](): Promise<void>;
+ }
+
+ const constants: typeof fsConstants;
+
+ /**
+ * Tests a user's permissions for the file or directory specified by `path`.
+ * 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`
+ * (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for
+ * possible values of `mode`.
+ *
+ * If the accessibility check is successful, the promise is resolved with no
+ * value. If any of the accessibility checks fail, the promise is rejected
+ * with an [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object. The following example checks if the file`/etc/passwd` can be read and
+ * written by the current process.
+ *
+ * ```js
+ * import { access } from 'fs/promises';
+ * import { constants } from 'fs';
+ *
+ * try {
+ * await access('/etc/passwd', constants.R_OK | constants.W_OK);
+ * console.log('can access');
+ * } catch {
+ * console.error('cannot access');
+ * }
+ * ```
+ *
+ * Using `fsPromises.access()` to check for the accessibility of a file before
+ * calling `fsPromises.open()` is not recommended. Doing so introduces a race
+ * condition, since other processes may change the file's state between the two
+ * calls. Instead, user code should open/read/write the file directly and handle
+ * the error raised if the file is not accessible.
+ * @since v10.0.0
+ * @param [mode=fs.constants.F_OK]
+ * @return Fulfills with `undefined` upon success.
+ */
+ function access(path: PathLike, mode?: number): Promise<void>;
+ /**
+ * Asynchronously copies `src` to `dest`. By default, `dest` is overwritten if it
+ * already exists.
+ *
+ * No guarantees are made about the atomicity of the copy operation. If an
+ * error occurs after the destination file has been opened for writing, an attempt
+ * will be made to remove the destination.
+ *
+ * ```js
+ * import { constants } from 'fs';
+ * import { copyFile } from 'fs/promises';
+ *
+ * try {
+ * await copyFile('source.txt', 'destination.txt');
+ * console.log('source.txt was copied to destination.txt');
+ * } catch {
+ * console.log('The file could not be copied');
+ * }
+ *
+ * // By using COPYFILE_EXCL, the operation will fail if destination.txt exists.
+ * try {
+ * await copyFile('source.txt', 'destination.txt', constants.COPYFILE_EXCL);
+ * console.log('source.txt was copied to destination.txt');
+ * } catch {
+ * console.log('The file could not be copied');
+ * }
+ * ```
+ * @since v10.0.0
+ * @param src source filename to copy
+ * @param dest destination filename of the copy operation
+ * @param [mode=0] Optional modifiers that specify the behavior of the copy operation. It is possible to create a mask consisting of the bitwise OR of two or more values (e.g.
+ * `fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`)
+ * @return Fulfills with `undefined` upon success.
+ */
+ function copyFile(src: PathLike, dest: PathLike, mode?: number): Promise<void>;
+ /**
+ * Opens a `FileHandle`.
+ *
+ * Refer to the POSIX [`open(2)`](http://man7.org/linux/man-pages/man2/open.2.html) documentation for more detail.
+ *
+ * Some characters (`< > : " / \ | ? *`) are reserved under Windows as documented
+ * by [Naming Files, Paths, and Namespaces](https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file). Under NTFS, if the filename contains
+ * a colon, Node.js will open a file system stream, as described by [this MSDN page](https://docs.microsoft.com/en-us/windows/desktop/FileIO/using-streams).
+ * @since v10.0.0
+ * @param [flags='r'] See `support of file system `flags``.
+ * @param [mode=0o666] Sets the file mode (permission and sticky bits) if the file is created.
+ * @return Fulfills with a {FileHandle} object.
+ */
+ function open(path: PathLike, flags?: string | number, mode?: Mode): Promise<FileHandle>;
+ /**
+ * Renames `oldPath` to `newPath`.
+ * @since v10.0.0
+ * @return Fulfills with `undefined` upon success.
+ */
+ function rename(oldPath: PathLike, newPath: PathLike): Promise<void>;
+ /**
+ * Truncates (shortens or extends the length) of the content at `path` to `len`bytes.
+ * @since v10.0.0
+ * @param [len=0]
+ * @return Fulfills with `undefined` upon success.
+ */
+ function truncate(path: PathLike, len?: number): Promise<void>;
+ /**
+ * Removes the directory identified by `path`.
+ *
+ * Using `fsPromises.rmdir()` on a file (not a directory) results in the
+ * promise being rejected with an `ENOENT` error on Windows and an `ENOTDIR`error on POSIX.
+ *
+ * To get a behavior similar to the `rm -rf` Unix command, use `fsPromises.rm()` with options `{ recursive: true, force: true }`.
+ * @since v10.0.0
+ * @return Fulfills with `undefined` upon success.
+ */
+ function rmdir(path: PathLike, options?: RmDirOptions): Promise<void>;
+ /**
+ * Removes files and directories (modeled on the standard POSIX `rm` utility).
+ * @since v14.14.0
+ * @return Fulfills with `undefined` upon success.
+ */
+ function rm(path: PathLike, options?: RmOptions): Promise<void>;
+ /**
+ * Asynchronously creates a directory.
+ *
+ * The optional `options` argument can be an integer specifying `mode` (permission
+ * 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
+ * rejection only when `recursive` is false.
+ * @since v10.0.0
+ * @return Upon success, fulfills with `undefined` if `recursive` is `false`, or the first directory path created if `recursive` is `true`.
+ */
+ function mkdir(
+ path: PathLike,
+ options: MakeDirectoryOptions & {
+ recursive: true;
+ },
+ ): Promise<string | undefined>;
+ /**
+ * Asynchronous mkdir(2) - create a directory.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
+ * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
+ */
+ function mkdir(
+ path: PathLike,
+ options?:
+ | Mode
+ | (MakeDirectoryOptions & {
+ recursive?: false | undefined;
+ })
+ | null,
+ ): Promise<void>;
+ /**
+ * Asynchronous mkdir(2) - create a directory.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
+ * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
+ */
+ function mkdir(path: PathLike, options?: Mode | MakeDirectoryOptions | null): Promise<string | undefined>;
+ /**
+ * Reads the contents of a directory.
+ *
+ * The optional `options` argument can be a string specifying an encoding, or an
+ * object with an `encoding` property specifying the character encoding to use for
+ * the filenames. If the `encoding` is set to `'buffer'`, the filenames returned
+ * will be passed as `Buffer` objects.
+ *
+ * If `options.withFileTypes` is set to `true`, the resolved array will contain `fs.Dirent` objects.
+ *
+ * ```js
+ * import { readdir } from 'fs/promises';
+ *
+ * try {
+ * const files = await readdir(path);
+ * for (const file of files)
+ * console.log(file);
+ * } catch (err) {
+ * console.error(err);
+ * }
+ * ```
+ * @since v10.0.0
+ * @return Fulfills with an array of the names of the files in the directory excluding `'.'` and `'..'`.
+ */
+ function readdir(
+ path: PathLike,
+ options?:
+ | (ObjectEncodingOptions & {
+ withFileTypes?: false | undefined;
+ recursive?: boolean | undefined;
+ })
+ | BufferEncoding
+ | null,
+ ): Promise<string[]>;
+ /**
+ * Asynchronous readdir(3) - read a directory.
+ * @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.
+ */
+ function readdir(
+ path: PathLike,
+ options:
+ | {
+ encoding: "buffer";
+ withFileTypes?: false | undefined;
+ recursive?: boolean | undefined;
+ }
+ | "buffer",
+ ): Promise<Buffer[]>;
+ /**
+ * Asynchronous readdir(3) - read a directory.
+ * @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.
+ */
+ function readdir(
+ path: PathLike,
+ options?:
+ | (ObjectEncodingOptions & {
+ withFileTypes?: false | undefined;
+ recursive?: boolean | undefined;
+ })
+ | BufferEncoding
+ | null,
+ ): Promise<string[] | Buffer[]>;
+ /**
+ * Asynchronous readdir(3) - read a directory.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * @param options If called with `withFileTypes: true` the result data will be an array of Dirent.
+ */
+ function readdir(
+ path: PathLike,
+ options: ObjectEncodingOptions & {
+ withFileTypes: true;
+ recursive?: boolean | undefined;
+ },
+ ): 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
+ * resolved with the`linkString` upon success.
+ *
+ * The optional `options` argument can be a string specifying an encoding, or an
+ * object with an `encoding` property specifying the character encoding to use for
+ * the link path returned. If the `encoding` is set to `'buffer'`, the link path
+ * returned will be passed as a `Buffer` object.
+ * @since v10.0.0
+ * @return Fulfills with the `linkString` upon success.
+ */
+ function readlink(path: PathLike, options?: ObjectEncodingOptions | BufferEncoding | null): Promise<string>;
+ /**
+ * Asynchronous readlink(2) - read value of a symbolic link.
+ * @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.
+ */
+ function readlink(path: PathLike, options: BufferEncodingOption): Promise<Buffer>;
+ /**
+ * Asynchronous readlink(2) - read value of a symbolic link.
+ * @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.
+ */
+ function readlink(path: PathLike, options?: ObjectEncodingOptions | string | null): Promise<string | Buffer>;
+ /**
+ * Creates a symbolic link.
+ *
+ * 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
+ * to be absolute. When using `'junction'`, the `target` argument will
+ * automatically be normalized to absolute path.
+ * @since v10.0.0
+ * @param [type='file']
+ * @return Fulfills with `undefined` upon success.
+ */
+ function symlink(target: PathLike, path: PathLike, type?: string | null): Promise<void>;
+ /**
+ * Equivalent to `fsPromises.stat()` unless `path` refers to a symbolic link,
+ * in which case the link itself is stat-ed, not the file that it refers to.
+ * Refer to the POSIX [`lstat(2)`](http://man7.org/linux/man-pages/man2/lstat.2.html) document for more detail.
+ * @since v10.0.0
+ * @return Fulfills with the {fs.Stats} object for the given symbolic link `path`.
+ */
+ function lstat(
+ path: PathLike,
+ opts?: StatOptions & {
+ bigint?: false | undefined;
+ },
+ ): Promise<Stats>;
+ function lstat(
+ path: PathLike,
+ opts: StatOptions & {
+ bigint: true;
+ },
+ ): Promise<BigIntStats>;
+ function lstat(path: PathLike, opts?: StatOptions): Promise<Stats | BigIntStats>;
+ /**
+ * @since v10.0.0
+ * @return Fulfills with the {fs.Stats} object for the given `path`.
+ */
+ function stat(
+ path: PathLike,
+ opts?: StatOptions & {
+ bigint?: false | undefined;
+ },
+ ): Promise<Stats>;
+ function stat(
+ path: PathLike,
+ opts: StatOptions & {
+ bigint: true;
+ },
+ ): Promise<BigIntStats>;
+ function stat(path: PathLike, opts?: StatOptions): Promise<Stats | BigIntStats>;
+ /**
+ * @since v18.15.0
+ * @return Fulfills with an {fs.StatFs} for the file system.
+ */
+ 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.
+ * @since v10.0.0
+ * @return Fulfills with `undefined` upon success.
+ */
+ function link(existingPath: PathLike, newPath: PathLike): Promise<void>;
+ /**
+ * If `path` refers to a symbolic link, then the link is removed without affecting
+ * the file or directory to which that link refers. If the `path` refers to a file
+ * path that is not a symbolic link, the file is deleted. See the POSIX [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html) documentation for more detail.
+ * @since v10.0.0
+ * @return Fulfills with `undefined` upon success.
+ */
+ function unlink(path: PathLike): Promise<void>;
+ /**
+ * Changes the permissions of a file.
+ * @since v10.0.0
+ * @return Fulfills with `undefined` upon success.
+ */
+ function chmod(path: PathLike, mode: Mode): Promise<void>;
+ /**
+ * Changes the permissions on a symbolic link.
+ *
+ * This method is only implemented on macOS.
+ * @deprecated Since v10.0.0
+ * @return Fulfills with `undefined` upon success.
+ */
+ function lchmod(path: PathLike, mode: Mode): Promise<void>;
+ /**
+ * Changes the ownership on a symbolic link.
+ * @since v10.0.0
+ * @return Fulfills with `undefined` upon success.
+ */
+ function lchown(path: PathLike, uid: number, gid: number): Promise<void>;
+ /**
+ * Changes the access and modification times of a file in the same way as `fsPromises.utimes()`, with the difference that if the path refers to a
+ * symbolic link, then the link is not dereferenced: instead, the timestamps of
+ * the symbolic link itself are changed.
+ * @since v14.5.0, v12.19.0
+ * @return Fulfills with `undefined` upon success.
+ */
+ function lutimes(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise<void>;
+ /**
+ * Changes the ownership of a file.
+ * @since v10.0.0
+ * @return Fulfills with `undefined` upon success.
+ */
+ function chown(path: PathLike, uid: number, gid: number): Promise<void>;
+ /**
+ * Change the file system timestamps of the object referenced by `path`.
+ *
+ * The `atime` and `mtime` arguments follow these rules:
+ *
+ * * Values can be either numbers representing Unix epoch time, `Date`s, or a
+ * 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.
+ * @since v10.0.0
+ * @return Fulfills with `undefined` upon success.
+ */
+ function utimes(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise<void>;
+ /**
+ * Determines the actual location of `path` using the same semantics as the`fs.realpath.native()` function.
+ *
+ * Only paths that can be converted to UTF8 strings are supported.
+ *
+ * The optional `options` argument can be a string specifying an encoding, or an
+ * object with an `encoding` property specifying the character encoding to use for
+ * the path. If the `encoding` is set to `'buffer'`, the path returned will be
+ * passed as a `Buffer` object.
+ *
+ * On Linux, when Node.js is linked against musl libc, the procfs file system must
+ * be mounted on `/proc` in order for this function to work. Glibc does not have
+ * this restriction.
+ * @since v10.0.0
+ * @return Fulfills with the resolved path upon success.
+ */
+ function realpath(path: PathLike, options?: ObjectEncodingOptions | BufferEncoding | null): Promise<string>;
+ /**
+ * Asynchronous realpath(3) - return the canonicalized absolute pathname.
+ * @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.
+ */
+ function realpath(path: PathLike, options: BufferEncodingOption): Promise<Buffer>;
+ /**
+ * Asynchronous realpath(3) - return the canonicalized absolute pathname.
+ * @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.
+ */
+ function realpath(
+ path: PathLike,
+ options?: ObjectEncodingOptions | BufferEncoding | null,
+ ): Promise<string | Buffer>;
+ /**
+ * 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
+ * platform inconsistencies, avoid trailing `X` characters in `prefix`. Some
+ * platforms, notably the BSDs, can return more than six random characters, and
+ * replace trailing `X` characters in `prefix` with random characters.
+ *
+ * The optional `options` argument can be a string specifying an encoding, or an
+ * object with an `encoding` property specifying the character encoding to use.
+ *
+ * ```js
+ * import { mkdtemp } from 'fs/promises';
+ *
+ * try {
+ * await mkdtemp(path.join(os.tmpdir(), 'foo-'));
+ * } catch (err) {
+ * console.error(err);
+ * }
+ * ```
+ *
+ * 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
+ * platform-specific path separator
+ * (`require('path').sep`).
+ * @since v10.0.0
+ * @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>;
+ /**
+ * Asynchronously creates a unique temporary directory.
+ * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory.
+ * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+ */
+ function mkdtemp(prefix: string, options: BufferEncodingOption): Promise<Buffer>;
+ /**
+ * Asynchronously creates a unique temporary directory.
+ * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory.
+ * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+ */
+ 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
+ * [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.
+ *
+ * The `encoding` option is ignored if `data` is a buffer.
+ *
+ * If `options` is a string, then it specifies the encoding.
+ *
+ * The `mode` option only affects the newly created file. See `fs.open()` for more details.
+ *
+ * Any specified `FileHandle` has to support writing.
+ *
+ * It is unsafe to use `fsPromises.writeFile()` multiple times on the same file
+ * without waiting for the promise to be settled.
+ *
+ * Similarly to `fsPromises.readFile` \- `fsPromises.writeFile` is a convenience
+ * 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()`.
+ *
+ * It is possible to use an `AbortSignal` to cancel an `fsPromises.writeFile()`.
+ * Cancelation is "best effort", and some amount of data is likely still
+ * to be written.
+ *
+ * ```js
+ * import { writeFile } from 'fs/promises';
+ * import { Buffer } from 'buffer';
+ *
+ * try {
+ * const controller = new AbortController();
+ * const { signal } = controller;
+ * const data = new Uint8Array(Buffer.from('Hello Node.js'));
+ * const promise = writeFile('message.txt', data, { signal });
+ *
+ * // Abort the request before the promise settles.
+ * controller.abort();
+ *
+ * await promise;
+ * } catch (err) {
+ * // When a request is aborted - err is an AbortError
+ * console.error(err);
+ * }
+ * ```
+ *
+ * Aborting an ongoing request does not abort individual operating
+ * system requests but rather the internal buffering `fs.writeFile` performs.
+ * @since v10.0.0
+ * @param file filename or `FileHandle`
+ * @return Fulfills with `undefined` upon success.
+ */
+ function writeFile(
+ file: PathLike | FileHandle,
+ data:
+ | string
+ | NodeJS.ArrayBufferView
+ | Iterable<string | NodeJS.ArrayBufferView>
+ | AsyncIterable<string | NodeJS.ArrayBufferView>
+ | Stream,
+ options?:
+ | (ObjectEncodingOptions & {
+ mode?: Mode | undefined;
+ flag?: OpenMode | undefined;
+ } & Abortable)
+ | BufferEncoding
+ | null,
+ ): Promise<void>;
+ /**
+ * Asynchronously append data to a file, creating the file if it does not yet
+ * exist. `data` can be a string or a `Buffer`.
+ *
+ * If `options` is a string, then it specifies the `encoding`.
+ *
+ * The `mode` option only affects the newly created file. See `fs.open()` for more details.
+ *
+ * The `path` may be specified as a `FileHandle` that has been opened
+ * for appending (using `fsPromises.open()`).
+ * @since v10.0.0
+ * @param path filename or {FileHandle}
+ * @return Fulfills with `undefined` upon success.
+ */
+ function appendFile(
+ path: PathLike | FileHandle,
+ data: string | Uint8Array,
+ options?: (ObjectEncodingOptions & FlagAndOpenMode) | BufferEncoding | null,
+ ): Promise<void>;
+ /**
+ * Asynchronously reads the entire contents of a file.
+ *
+ * If no encoding is specified (using `options.encoding`), the data is returned
+ * as a `Buffer` object. Otherwise, the data will be a string.
+ *
+ * If `options` is a string, then it specifies the encoding.
+ *
+ * When the `path` is a directory, the behavior of `fsPromises.readFile()` is
+ * platform-specific. On macOS, Linux, and Windows, the promise will be rejected
+ * with an error. On FreeBSD, a representation of the directory's contents will be
+ * returned.
+ *
+ * It is possible to abort an ongoing `readFile` using an `AbortSignal`. If a
+ * request is aborted the promise returned is rejected with an `AbortError`:
+ *
+ * ```js
+ * import { readFile } from 'fs/promises';
+ *
+ * try {
+ * const controller = new AbortController();
+ * const { signal } = controller;
+ * const promise = readFile(fileName, { signal });
+ *
+ * // Abort the request before the promise settles.
+ * controller.abort();
+ *
+ * await promise;
+ * } catch (err) {
+ * // When a request is aborted - err is an AbortError
+ * console.error(err);
+ * }
+ * ```
+ *
+ * Aborting an ongoing request does not abort individual operating
+ * system requests but rather the internal buffering `fs.readFile` performs.
+ *
+ * Any specified `FileHandle` has to support reading.
+ * @since v10.0.0
+ * @param path filename or `FileHandle`
+ * @return Fulfills with the contents of the file.
+ */
+ function readFile(
+ path: PathLike | FileHandle,
+ options?:
+ | ({
+ encoding?: null | undefined;
+ flag?: OpenMode | undefined;
+ } & Abortable)
+ | null,
+ ): Promise<Buffer>;
+ /**
+ * Asynchronously reads the entire contents of a file.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically.
+ * @param options An object that may contain an optional flag.
+ * If a flag is not provided, it defaults to `'r'`.
+ */
+ function readFile(
+ path: PathLike | FileHandle,
+ options:
+ | ({
+ encoding: BufferEncoding;
+ flag?: OpenMode | undefined;
+ } & Abortable)
+ | BufferEncoding,
+ ): Promise<string>;
+ /**
+ * Asynchronously reads the entire contents of a file.
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+ * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically.
+ * @param options An object that may contain an optional flag.
+ * If a flag is not provided, it defaults to `'r'`.
+ */
+ function readFile(
+ path: PathLike | FileHandle,
+ options?:
+ | (
+ & ObjectEncodingOptions
+ & Abortable
+ & {
+ flag?: OpenMode | undefined;
+ }
+ )
+ | BufferEncoding
+ | null,
+ ): 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.
+ *
+ * Creates an `fs.Dir`, which contains all further functions for reading from
+ * and cleaning up the directory.
+ *
+ * The `encoding` option sets the encoding for the `path` while opening the
+ * directory and subsequent read operations.
+ *
+ * Example using async iteration:
+ *
+ * ```js
+ * import { opendir } from 'fs/promises';
+ *
+ * try {
+ * const dir = await opendir('./');
+ * for await (const dirent of dir)
+ * console.log(dirent.name);
+ * } catch (err) {
+ * console.error(err);
+ * }
+ * ```
+ *
+ * When using the async iterator, the `fs.Dir` object will be automatically
+ * closed after the iterator exits.
+ * @since v12.12.0
+ * @return Fulfills with an {fs.Dir}.
+ */
+ function opendir(path: PathLike, options?: OpenDirOptions): Promise<Dir>;
+ /**
+ * Returns an async iterator that watches for changes on `filename`, where `filename`is either a file or a directory.
+ *
+ * ```js
+ * const { watch } = require('fs/promises');
+ *
+ * const ac = new AbortController();
+ * const { signal } = ac;
+ * setTimeout(() => ac.abort(), 10000);
+ *
+ * (async () => {
+ * try {
+ * const watcher = watch(__filename, { signal });
+ * for await (const event of watcher)
+ * console.log(event);
+ * } catch (err) {
+ * if (err.name === 'AbortError')
+ * return;
+ * throw err;
+ * }
+ * })();
+ * ```
+ *
+ * On most platforms, `'rename'` is emitted whenever a filename appears or
+ * disappears in the directory.
+ *
+ * All the `caveats` for `fs.watch()` also apply to `fsPromises.watch()`.
+ * @since v15.9.0, v14.18.0
+ * @return of objects with the properties:
+ */
+ function watch(
+ filename: PathLike,
+ options:
+ | (WatchOptions & {
+ encoding: "buffer";
+ })
+ | "buffer",
+ ): AsyncIterable<FileChangeInfo<Buffer>>;
+ /**
+ * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`.
+ * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
+ * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options.
+ * If `encoding` is not supplied, the default of `'utf8'` is used.
+ * If `persistent` is not supplied, the default of `true` is used.
+ * If `recursive` is not supplied, the default of `false` is used.
+ */
+ function watch(filename: PathLike, options?: WatchOptions | BufferEncoding): AsyncIterable<FileChangeInfo<string>>;
+ /**
+ * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`.
+ * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
+ * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options.
+ * If `encoding` is not supplied, the default of `'utf8'` is used.
+ * If `persistent` is not supplied, the default of `true` is used.
+ * If `recursive` is not supplied, the default of `false` is used.
+ */
+ function watch(
+ filename: PathLike,
+ options: WatchOptions | string,
+ ): AsyncIterable<FileChangeInfo<string>> | AsyncIterable<FileChangeInfo<Buffer>>;
+ /**
+ * Asynchronously copies the entire directory structure from `src` to `dest`,
+ * including subdirectories and files.
+ *
+ * When copying a directory to another directory, globs are not supported and
+ * behavior is similar to `cp dir1/ dir2/`.
+ * @since v16.7.0
+ * @experimental
+ * @param src source path to copy.
+ * @param dest destination path to copy to.
+ * @return Fulfills with `undefined` upon success.
+ */
+ function cp(source: string | URL, destination: string | URL, opts?: CopyOptions): Promise<void>;
+}
+declare module "node:fs/promises" {
+ export * from "fs/promises";
+}
diff --git a/client/node_modules/@types/node/ts4.8/globals.d.ts b/client/node_modules/@types/node/ts4.8/globals.d.ts
new file mode 100644
index 0000000..3a449e4
--- /dev/null
+++ b/client/node_modules/@types/node/ts4.8/globals.d.ts
@@ -0,0 +1,381 @@
+// Declare "static" methods in Error
+interface ErrorConstructor {
+ /** Create .stack property on a target object */
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
+
+ /**
+ * Optional override for formatting stack traces
+ *
+ * @see https://v8.dev/docs/stack-trace-api#customizing-stack-traces
+ */
+ prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
+
+ stackTraceLimit: number;
+}
+
+/*-----------------------------------------------*
+ * *
+ * GLOBAL *
+ * *
+ ------------------------------------------------*/
+
+// For backwards compability
+interface NodeRequire extends NodeJS.Require {}
+interface RequireResolve extends NodeJS.RequireResolve {}
+interface NodeModule extends NodeJS.Module {}
+
+declare var process: NodeJS.Process;
+declare var console: Console;
+
+declare var __filename: string;
+declare var __dirname: string;
+
+declare var require: NodeRequire;
+declare var module: NodeModule;
+
+// Same as module.exports
+declare var exports: any;
+
+/**
+ * Only available if `--expose-gc` is passed to the process.
+ */
+declare var gc: undefined | (() => void);
+
+// #region borrowed
+// 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. */
+interface AbortController {
+ /**
+ * Returns the AbortSignal object associated with this object.
+ */
+
+ readonly signal: AbortSignal;
+ /**
+ * 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;
+}
+
+/** 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 {
+ /**
+ * Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise.
+ */
+ 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
+ : {
+ prototype: AbortController;
+ new(): AbortController;
+ };
+
+declare var AbortSignal: typeof globalThis extends { onmessage: any; AbortSignal: infer T } ? T
+ : {
+ prototype: AbortSignal;
+ new(): AbortSignal;
+ abort(reason?: any): AbortSignal;
+ timeout(milliseconds: number): AbortSignal;
+ };
+// #endregion borrowed
+
+// #region Disposable
+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> {
+ /**
+ * Takes an integer value and returns the item at that index,
+ * allowing for positive and negative integers.
+ * Negative integers count back from the last item in the array.
+ */
+ at(index: number): T | undefined;
+}
+interface String extends RelativeIndexable<string> {}
+interface Array<T> extends RelativeIndexable<T> {}
+interface ReadonlyArray<T> extends RelativeIndexable<T> {}
+interface Int8Array extends RelativeIndexable<number> {}
+interface Uint8Array extends RelativeIndexable<number> {}
+interface Uint8ClampedArray extends RelativeIndexable<number> {}
+interface Int16Array extends RelativeIndexable<number> {}
+interface Uint16Array extends RelativeIndexable<number> {}
+interface Int32Array extends RelativeIndexable<number> {}
+interface Uint32Array extends RelativeIndexable<number> {}
+interface Float32Array extends RelativeIndexable<number> {}
+interface Float64Array extends RelativeIndexable<number> {}
+interface BigInt64Array extends RelativeIndexable<bigint> {}
+interface BigUint64Array extends RelativeIndexable<bigint> {}
+// #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;
+
+/*----------------------------------------------*
+* *
+* GLOBAL INTERFACES *
+* *
+*-----------------------------------------------*/
+declare namespace NodeJS {
+ interface CallSite {
+ /**
+ * Value of "this"
+ */
+ getThis(): unknown;
+
+ /**
+ * Type of "this" as a string.
+ * This is the name of the function stored in the constructor field of
+ * "this", if available. Otherwise the object's [[Class]] internal
+ * property.
+ */
+ getTypeName(): string | null;
+
+ /**
+ * Current function
+ */
+ getFunction(): Function | undefined;
+
+ /**
+ * Name of the current function, typically its name property.
+ * If a name property is not available an attempt will be made to try
+ * to infer a name from the function's context.
+ */
+ getFunctionName(): string | null;
+
+ /**
+ * Name of the property [of "this" or one of its prototypes] that holds
+ * the current function
+ */
+ getMethodName(): string | null;
+
+ /**
+ * Name of the script [if this function was defined in a script]
+ */
+ getFileName(): string | undefined;
+
+ /**
+ * Current line number [if this function was defined in a script]
+ */
+ getLineNumber(): number | null;
+
+ /**
+ * Current column number [if this function was defined in a script]
+ */
+ getColumnNumber(): number | null;
+
+ /**
+ * A call site object representing the location where eval was called
+ * [if this function was created using a call to eval]
+ */
+ getEvalOrigin(): string | undefined;
+
+ /**
+ * Is this a toplevel invocation, that is, is "this" the global object?
+ */
+ isToplevel(): boolean;
+
+ /**
+ * Does this call take place in code defined by a call to eval?
+ */
+ isEval(): boolean;
+
+ /**
+ * Is this call in native V8 code?
+ */
+ isNative(): boolean;
+
+ /**
+ * Is this a constructor call?
+ */
+ isConstructor(): boolean;
+ }
+
+ interface ErrnoException extends Error {
+ errno?: number | undefined;
+ code?: string | undefined;
+ path?: string | undefined;
+ syscall?: string | undefined;
+ }
+
+ interface ReadableStream extends EventEmitter {
+ readable: boolean;
+ read(size?: number): string | Buffer;
+ setEncoding(encoding: BufferEncoding): this;
+ pause(): this;
+ resume(): this;
+ isPaused(): boolean;
+ pipe<T extends WritableStream>(destination: T, options?: { end?: boolean | undefined }): T;
+ unpipe(destination?: WritableStream): this;
+ unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void;
+ wrap(oldStream: ReadableStream): this;
+ [Symbol.asyncIterator](): AsyncIterableIterator<string | Buffer>;
+ }
+
+ interface WritableStream extends EventEmitter {
+ writable: boolean;
+ write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean;
+ write(str: string, encoding?: BufferEncoding, cb?: (err?: Error | null) => void): boolean;
+ end(cb?: () => void): this;
+ end(data: string | Uint8Array, cb?: () => void): this;
+ end(str: string, encoding?: BufferEncoding, cb?: () => void): this;
+ }
+
+ interface ReadWriteStream extends ReadableStream, WritableStream {}
+
+ interface RefCounted {
+ ref(): this;
+ unref(): this;
+ }
+
+ type TypedArray =
+ | Uint8Array
+ | Uint8ClampedArray
+ | Uint16Array
+ | Uint32Array
+ | Int8Array
+ | Int16Array
+ | Int32Array
+ | BigUint64Array
+ | BigInt64Array
+ | Float32Array
+ | Float64Array;
+ type ArrayBufferView = TypedArray | DataView;
+
+ interface Require {
+ (id: string): any;
+ resolve: RequireResolve;
+ cache: Dict<NodeModule>;
+ /**
+ * @deprecated
+ */
+ extensions: RequireExtensions;
+ main: Module | undefined;
+ }
+
+ interface RequireResolve {
+ (id: string, options?: { paths?: string[] | undefined }): string;
+ paths(request: string): string[] | null;
+ }
+
+ interface RequireExtensions extends Dict<(m: Module, filename: string) => any> {
+ ".js": (m: Module, filename: string) => any;
+ ".json": (m: Module, filename: string) => any;
+ ".node": (m: Module, filename: string) => any;
+ }
+ interface Module {
+ /**
+ * `true` if the module is running during the Node.js preload
+ */
+ isPreloading: boolean;
+ exports: any;
+ require: Require;
+ id: string;
+ filename: string;
+ loaded: boolean;
+ /** @deprecated since v14.6.0 Please use `require.main` and `module.children` instead. */
+ parent: Module | null | undefined;
+ children: Module[];
+ /**
+ * @since v11.14.0
+ *
+ * The directory name of the module. This is usually the same as the path.dirname() of the module.id.
+ */
+ path: string;
+ paths: string[];
+ }
+
+ interface Dict<T> {
+ [key: string]: T | undefined;
+ }
+
+ interface ReadOnlyDict<T> {
+ 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;
diff --git a/client/node_modules/@types/node/ts4.8/globals.global.d.ts b/client/node_modules/@types/node/ts4.8/globals.global.d.ts
new file mode 100644
index 0000000..ef1198c
--- /dev/null
+++ b/client/node_modules/@types/node/ts4.8/globals.global.d.ts
@@ -0,0 +1 @@
+declare var global: typeof globalThis;
diff --git a/client/node_modules/@types/node/ts4.8/http.d.ts b/client/node_modules/@types/node/ts4.8/http.d.ts
new file mode 100644
index 0000000..73fd70a
--- /dev/null
+++ b/client/node_modules/@types/node/ts4.8/http.d.ts
@@ -0,0 +1,1801 @@
+/**
+ * To use the HTTP server and client one must `require('http')`.
+ *
+ * The HTTP interfaces in Node.js are designed to support many features
+ * of the protocol which have been traditionally difficult to use.
+ * In particular, large, possibly chunk-encoded, messages. The interface is
+ * careful to never buffer entire requests or responses, so the
+ * user is able to stream data.
+ *
+ * HTTP message headers are represented by an object like this:
+ *
+ * ```js
+ * { 'content-length': '123',
+ * 'content-type': 'text/plain',
+ * 'connection': 'keep-alive',
+ * 'host': 'example.com',
+ * 'accept': '*' }
+ * ```
+ *
+ * Keys are lowercased. Values are not modified.
+ *
+ * In order to support the full spectrum of possible HTTP applications, the Node.js
+ * HTTP API is very low-level. It deals with stream handling and message
+ * parsing only. It parses a message into headers and body but it does not
+ * parse the actual headers or the body.
+ *
+ * See `message.headers` for details on how duplicate headers are handled.
+ *
+ * The raw headers as they were received are retained in the `rawHeaders`property, which is an array of `[key, value, key2, value2, ...]`. For
+ * example, the previous message header object might have a `rawHeaders`list like the following:
+ *
+ * ```js
+ * [ 'ConTent-Length', '123456',
+ * 'content-LENGTH', '123',
+ * 'content-type', 'text/plain',
+ * 'CONNECTION', 'keep-alive',
+ * 'Host', 'example.com',
+ * 'accepT', '*' ]
+ * ```
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/http.js)
+ */
+declare module "http" {
+ import * as stream from "node:stream";
+ import { URL } from "node:url";
+ import { EventEmitter } from "node:events";
+ import { LookupOptions } from "node:dns";
+ import { LookupFunction, Server as NetServer, Socket, TcpSocketConnectOpts } from "node:net";
+ // incoming headers will never contain number
+ interface IncomingHttpHeaders extends NodeJS.Dict<string | string[]> {
+ accept?: string | undefined;
+ "accept-language"?: string | undefined;
+ "accept-patch"?: string | undefined;
+ "accept-ranges"?: string | undefined;
+ "access-control-allow-credentials"?: string | undefined;
+ "access-control-allow-headers"?: string | undefined;
+ "access-control-allow-methods"?: string | undefined;
+ "access-control-allow-origin"?: string | undefined;
+ "access-control-expose-headers"?: string | undefined;
+ "access-control-max-age"?: string | undefined;
+ "access-control-request-headers"?: string | undefined;
+ "access-control-request-method"?: string | undefined;
+ age?: string | undefined;
+ allow?: string | undefined;
+ "alt-svc"?: string | undefined;
+ authorization?: string | undefined;
+ "cache-control"?: string | undefined;
+ connection?: string | undefined;
+ "content-disposition"?: string | undefined;
+ "content-encoding"?: string | undefined;
+ "content-language"?: string | undefined;
+ "content-length"?: string | undefined;
+ "content-location"?: string | undefined;
+ "content-range"?: string | undefined;
+ "content-type"?: string | undefined;
+ cookie?: string | undefined;
+ date?: string | undefined;
+ etag?: string | undefined;
+ expect?: string | undefined;
+ expires?: string | undefined;
+ forwarded?: string | undefined;
+ from?: string | undefined;
+ host?: string | undefined;
+ "if-match"?: string | undefined;
+ "if-modified-since"?: string | undefined;
+ "if-none-match"?: string | undefined;
+ "if-unmodified-since"?: string | undefined;
+ "last-modified"?: string | undefined;
+ location?: string | undefined;
+ origin?: string | undefined;
+ pragma?: string | undefined;
+ "proxy-authenticate"?: string | undefined;
+ "proxy-authorization"?: string | undefined;
+ "public-key-pins"?: string | undefined;
+ range?: string | undefined;
+ referer?: string | undefined;
+ "retry-after"?: string | undefined;
+ "sec-websocket-accept"?: string | undefined;
+ "sec-websocket-extensions"?: string | undefined;
+ "sec-websocket-key"?: string | undefined;
+ "sec-websocket-protocol"?: string | undefined;
+ "sec-websocket-version"?: string | undefined;
+ "set-cookie"?: string[] | undefined;
+ "strict-transport-security"?: string | undefined;
+ tk?: string | undefined;
+ trailer?: string | undefined;
+ "transfer-encoding"?: string | undefined;
+ upgrade?: string | undefined;
+ "user-agent"?: string | undefined;
+ vary?: string | undefined;
+ via?: string | undefined;
+ warning?: string | undefined;
+ "www-authenticate"?: string | undefined;
+ }
+ // outgoing headers allows numbers (as they are converted internally to strings)
+ type OutgoingHttpHeader = number | string | string[];
+ interface OutgoingHttpHeaders extends NodeJS.Dict<OutgoingHttpHeader> {
+ accept?: string | string[] | undefined;
+ "accept-charset"?: string | string[] | undefined;
+ "accept-encoding"?: string | string[] | undefined;
+ "accept-language"?: string | string[] | undefined;
+ "accept-ranges"?: string | undefined;
+ "access-control-allow-credentials"?: string | undefined;
+ "access-control-allow-headers"?: string | undefined;
+ "access-control-allow-methods"?: string | undefined;
+ "access-control-allow-origin"?: string | undefined;
+ "access-control-expose-headers"?: string | undefined;
+ "access-control-max-age"?: string | undefined;
+ "access-control-request-headers"?: string | undefined;
+ "access-control-request-method"?: string | undefined;
+ age?: string | undefined;
+ allow?: string | undefined;
+ authorization?: string | undefined;
+ "cache-control"?: string | undefined;
+ "cdn-cache-control"?: string | undefined;
+ connection?: string | string[] | undefined;
+ "content-disposition"?: string | undefined;
+ "content-encoding"?: string | undefined;
+ "content-language"?: string | undefined;
+ "content-length"?: string | number | undefined;
+ "content-location"?: string | undefined;
+ "content-range"?: string | undefined;
+ "content-security-policy"?: string | undefined;
+ "content-security-policy-report-only"?: string | undefined;
+ cookie?: string | string[] | undefined;
+ dav?: string | string[] | undefined;
+ dnt?: string | undefined;
+ date?: string | undefined;
+ etag?: string | undefined;
+ expect?: string | undefined;
+ expires?: string | undefined;
+ forwarded?: string | undefined;
+ from?: string | undefined;
+ host?: string | undefined;
+ "if-match"?: string | undefined;
+ "if-modified-since"?: string | undefined;
+ "if-none-match"?: string | undefined;
+ "if-range"?: string | undefined;
+ "if-unmodified-since"?: string | undefined;
+ "last-modified"?: string | undefined;
+ link?: string | string[] | undefined;
+ location?: string | undefined;
+ "max-forwards"?: string | undefined;
+ origin?: string | undefined;
+ prgama?: string | string[] | undefined;
+ "proxy-authenticate"?: string | string[] | undefined;
+ "proxy-authorization"?: string | undefined;
+ "public-key-pins"?: string | undefined;
+ "public-key-pins-report-only"?: string | undefined;
+ range?: string | undefined;
+ referer?: string | undefined;
+ "referrer-policy"?: string | undefined;
+ refresh?: string | undefined;
+ "retry-after"?: string | undefined;
+ "sec-websocket-accept"?: string | undefined;
+ "sec-websocket-extensions"?: string | string[] | undefined;
+ "sec-websocket-key"?: string | undefined;
+ "sec-websocket-protocol"?: string | string[] | undefined;
+ "sec-websocket-version"?: string | undefined;
+ server?: string | undefined;
+ "set-cookie"?: string | string[] | undefined;
+ "strict-transport-security"?: string | undefined;
+ te?: string | undefined;
+ trailer?: string | undefined;
+ "transfer-encoding"?: string | undefined;
+ "user-agent"?: string | undefined;
+ upgrade?: string | undefined;
+ "upgrade-insecure-requests"?: string | undefined;
+ vary?: string | undefined;
+ via?: string | string[] | undefined;
+ warning?: string | undefined;
+ "www-authenticate"?: string | string[] | undefined;
+ "x-content-type-options"?: string | undefined;
+ "x-dns-prefetch-control"?: string | undefined;
+ "x-frame-options"?: string | undefined;
+ "x-xss-protection"?: string | undefined;
+ }
+ interface ClientRequestArgs {
+ _defaultAgent?: Agent | undefined;
+ agent?: Agent | boolean | undefined;
+ auth?: string | null | undefined;
+ // https://github.com/nodejs/node/blob/master/lib/_http_client.js#L278
+ createConnection?:
+ | ((options: ClientRequestArgs, oncreate: (err: Error, socket: Socket) => void) => Socket)
+ | undefined;
+ defaultPort?: number | string | undefined;
+ family?: number | undefined;
+ headers?: OutgoingHttpHeaders | undefined;
+ hints?: LookupOptions["hints"];
+ host?: string | null | undefined;
+ hostname?: string | null | undefined;
+ insecureHTTPParser?: boolean | undefined;
+ localAddress?: string | undefined;
+ localPort?: number | undefined;
+ lookup?: LookupFunction | undefined;
+ /**
+ * @default 16384
+ */
+ maxHeaderSize?: number | undefined;
+ method?: string | undefined;
+ path?: string | null | undefined;
+ port?: number | string | null | undefined;
+ protocol?: string | null | undefined;
+ setHost?: boolean | undefined;
+ signal?: AbortSignal | undefined;
+ socketPath?: string | undefined;
+ timeout?: number | undefined;
+ uniqueHeaders?: Array<string | string[]> | undefined;
+ joinDuplicateHeaders?: boolean;
+ }
+ interface ServerOptions<
+ Request extends typeof IncomingMessage = typeof IncomingMessage,
+ Response extends typeof ServerResponse = typeof ServerResponse,
+ > {
+ /**
+ * Specifies the `IncomingMessage` class to be used. Useful for extending the original `IncomingMessage`.
+ */
+ IncomingMessage?: Request | undefined;
+ /**
+ * Specifies the `ServerResponse` class to be used. Useful for extending the original `ServerResponse`.
+ */
+ ServerResponse?: Response | undefined;
+ /**
+ * Sets the timeout value in milliseconds for receiving the entire request from the client.
+ * @see Server.requestTimeout for more information.
+ * @default 300000
+ * @since v18.0.0
+ */
+ requestTimeout?: number | undefined;
+ /**
+ * It joins the field line values of multiple headers in a request with `, ` instead of discarding the duplicates.
+ * @default false
+ * @since v18.14.0
+ */
+ joinDuplicateHeaders?: boolean;
+ /**
+ * The number of milliseconds of inactivity a server needs to wait for additional incoming data,
+ * after it has finished writing the last response, before a socket will be destroyed.
+ * @see Server.keepAliveTimeout for more information.
+ * @default 5000
+ * @since v18.0.0
+ */
+ keepAliveTimeout?: number | undefined;
+ /**
+ * Sets the interval value in milliseconds to check for request and headers timeout in incomplete requests.
+ * @default 30000
+ */
+ connectionsCheckingInterval?: number | undefined;
+ /**
+ * Optionally overrides all `socket`s' `readableHighWaterMark` and `writableHighWaterMark`.
+ * This affects `highWaterMark` property of both `IncomingMessage` and `ServerResponse`.
+ * Default: @see stream.getDefaultHighWaterMark().
+ * @since v18.17.0
+ */
+ highWaterMark?: number | undefined;
+ /**
+ * Use an insecure HTTP parser that accepts invalid HTTP headers when `true`.
+ * Using the insecure parser should be avoided.
+ * See --insecure-http-parser for more information.
+ * @default false
+ */
+ insecureHTTPParser?: boolean | undefined;
+ /**
+ * Optionally overrides the value of
+ * `--max-http-header-size` for requests received by this server, i.e.
+ * the maximum length of request headers in bytes.
+ * @default 16384
+ * @since v13.3.0
+ */
+ maxHeaderSize?: number | undefined;
+ /**
+ * If set to `true`, it disables the use of Nagle's algorithm immediately after a new incoming connection is received.
+ * @default true
+ * @since v16.5.0
+ */
+ noDelay?: boolean | undefined;
+ /**
+ * If set to `true`, it enables keep-alive functionality on the socket immediately after a new incoming connection is received,
+ * similarly on what is done in `socket.setKeepAlive([enable][, initialDelay])`.
+ * @default false
+ * @since v16.5.0
+ */
+ keepAlive?: boolean | undefined;
+ /**
+ * If set to a positive number, it sets the initial delay before the first keepalive probe is sent on an idle socket.
+ * @default 0
+ * @since v16.5.0
+ */
+ keepAliveInitialDelay?: number | undefined;
+ /**
+ * A list of response headers that should be sent only once.
+ * If the header's value is an array, the items will be joined using `; `.
+ */
+ uniqueHeaders?: Array<string | string[]> | undefined;
+ }
+ type RequestListener<
+ Request extends typeof IncomingMessage = typeof IncomingMessage,
+ Response extends typeof ServerResponse = typeof ServerResponse,
+ > = (req: InstanceType<Request>, res: InstanceType<Response> & { req: InstanceType<Request> }) => void;
+ /**
+ * @since v0.1.17
+ */
+ class Server<
+ Request extends typeof IncomingMessage = typeof IncomingMessage,
+ Response extends typeof ServerResponse = typeof ServerResponse,
+ > extends NetServer {
+ constructor(requestListener?: RequestListener<Request, Response>);
+ constructor(options: ServerOptions<Request, Response>, requestListener?: RequestListener<Request, Response>);
+ /**
+ * Sets the timeout value for sockets, and emits a `'timeout'` event on
+ * the Server object, passing the socket as an argument, if a timeout
+ * occurs.
+ *
+ * If there is a `'timeout'` event listener on the Server object, then it
+ * will be called with the timed-out socket as an argument.
+ *
+ * By default, the Server does not timeout sockets. However, if a callback
+ * is assigned to the Server's `'timeout'` event, timeouts must be handled
+ * explicitly.
+ * @since v0.9.12
+ * @param [msecs=0 (no timeout)]
+ */
+ setTimeout(msecs?: number, callback?: () => void): this;
+ setTimeout(callback: () => void): this;
+ /**
+ * Limits maximum incoming headers count. If set to 0, no limit will be applied.
+ * @since v0.7.0
+ */
+ maxHeadersCount: number | null;
+ /**
+ * The maximum number of requests socket can handle
+ * before closing keep alive connection.
+ *
+ * A value of `0` will disable the limit.
+ *
+ * When the limit is reached it will set the `Connection` header value to `close`,
+ * but will not actually close the connection, subsequent requests sent
+ * after the limit is reached will get `503 Service Unavailable` as a response.
+ * @since v16.10.0
+ */
+ maxRequestsPerSocket: number | null;
+ /**
+ * The number of milliseconds of inactivity before a socket is presumed
+ * to have timed out.
+ *
+ * A value of `0` will disable the timeout behavior on incoming connections.
+ *
+ * The socket timeout logic is set up on connection, so changing this
+ * value only affects new connections to the server, not any existing connections.
+ * @since v0.9.12
+ */
+ timeout: number;
+ /**
+ * Limit the amount of time the parser will wait to receive the complete HTTP
+ * headers.
+ *
+ * If the timeout expires, the server responds with status 408 without
+ * forwarding the request to the request listener and then closes the connection.
+ *
+ * It must be set to a non-zero value (e.g. 120 seconds) to protect against
+ * potential Denial-of-Service attacks in case the server is deployed without a
+ * reverse proxy in front.
+ * @since v11.3.0, v10.14.0
+ */
+ headersTimeout: number;
+ /**
+ * The number of milliseconds of inactivity a server needs to wait for additional
+ * incoming data, after it has finished writing the last response, before a socket
+ * will be destroyed. If the server receives new data before the keep-alive
+ * timeout has fired, it will reset the regular inactivity timeout, i.e.,`server.timeout`.
+ *
+ * A value of `0` will disable the keep-alive timeout behavior on incoming
+ * connections.
+ * A value of `0` makes the http server behave similarly to Node.js versions prior
+ * to 8.0.0, which did not have a keep-alive timeout.
+ *
+ * The socket timeout logic is set up on connection, so changing this value only
+ * affects new connections to the server, not any existing connections.
+ * @since v8.0.0
+ */
+ keepAliveTimeout: number;
+ /**
+ * Sets the timeout value in milliseconds for receiving the entire request from
+ * the client.
+ *
+ * If the timeout expires, the server responds with status 408 without
+ * forwarding the request to the request listener and then closes the connection.
+ *
+ * It must be set to a non-zero value (e.g. 120 seconds) to protect against
+ * potential Denial-of-Service attacks in case the server is deployed without a
+ * reverse proxy in front.
+ * @since v14.11.0
+ */
+ requestTimeout: number;
+ /**
+ * Closes all connections connected to this server.
+ * @since v18.2.0
+ */
+ closeAllConnections(): void;
+ /**
+ * Closes all connections connected to this server which are not sending a request or waiting for a response.
+ * @since v18.2.0
+ */
+ closeIdleConnections(): void;
+ addListener(event: string, listener: (...args: any[]) => void): this;
+ addListener(event: "close", listener: () => void): this;
+ addListener(event: "connection", listener: (socket: Socket) => void): this;
+ addListener(event: "error", listener: (err: Error) => void): this;
+ addListener(event: "listening", listener: () => void): this;
+ addListener(event: "checkContinue", listener: RequestListener<Request, Response>): this;
+ addListener(event: "checkExpectation", listener: RequestListener<Request, Response>): this;
+ addListener(event: "clientError", listener: (err: Error, socket: stream.Duplex) => void): this;
+ addListener(
+ event: "connect",
+ listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void,
+ ): this;
+ addListener(event: "dropRequest", listener: (req: InstanceType<Request>, socket: stream.Duplex) => void): this;
+ addListener(event: "request", listener: RequestListener<Request, Response>): this;
+ addListener(
+ event: "upgrade",
+ listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void,
+ ): this;
+ emit(event: string, ...args: any[]): boolean;
+ emit(event: "close"): boolean;
+ emit(event: "connection", socket: Socket): boolean;
+ emit(event: "error", err: Error): boolean;
+ emit(event: "listening"): boolean;
+ emit(
+ event: "checkContinue",
+ req: InstanceType<Request>,
+ res: InstanceType<Response> & { req: InstanceType<Request> },
+ ): boolean;
+ emit(
+ event: "checkExpectation",
+ req: InstanceType<Request>,
+ res: InstanceType<Response> & { req: InstanceType<Request> },
+ ): boolean;
+ emit(event: "clientError", err: Error, socket: stream.Duplex): boolean;
+ emit(event: "connect", req: InstanceType<Request>, socket: stream.Duplex, head: Buffer): boolean;
+ emit(event: "dropRequest", req: InstanceType<Request>, socket: stream.Duplex): boolean;
+ emit(
+ event: "request",
+ req: InstanceType<Request>,
+ res: InstanceType<Response> & { req: InstanceType<Request> },
+ ): boolean;
+ emit(event: "upgrade", req: InstanceType<Request>, socket: stream.Duplex, head: Buffer): boolean;
+ on(event: string, listener: (...args: any[]) => void): this;
+ on(event: "close", listener: () => void): this;
+ on(event: "connection", listener: (socket: Socket) => void): this;
+ on(event: "error", listener: (err: Error) => void): this;
+ on(event: "listening", listener: () => void): this;
+ on(event: "checkContinue", listener: RequestListener<Request, Response>): this;
+ on(event: "checkExpectation", listener: RequestListener<Request, Response>): this;
+ on(event: "clientError", listener: (err: Error, socket: stream.Duplex) => void): this;
+ on(event: "connect", listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void): this;
+ on(event: "dropRequest", listener: (req: InstanceType<Request>, socket: stream.Duplex) => void): this;
+ on(event: "request", listener: RequestListener<Request, Response>): this;
+ on(event: "upgrade", listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void): this;
+ once(event: string, listener: (...args: any[]) => void): this;
+ once(event: "close", listener: () => void): this;
+ once(event: "connection", listener: (socket: Socket) => void): this;
+ once(event: "error", listener: (err: Error) => void): this;
+ once(event: "listening", listener: () => void): this;
+ once(event: "checkContinue", listener: RequestListener<Request, Response>): this;
+ once(event: "checkExpectation", listener: RequestListener<Request, Response>): this;
+ once(event: "clientError", listener: (err: Error, socket: stream.Duplex) => void): this;
+ once(
+ event: "connect",
+ listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void,
+ ): this;
+ once(event: "dropRequest", listener: (req: InstanceType<Request>, socket: stream.Duplex) => void): this;
+ once(event: "request", listener: RequestListener<Request, Response>): this;
+ once(
+ event: "upgrade",
+ listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void,
+ ): this;
+ prependListener(event: string, listener: (...args: any[]) => void): this;
+ prependListener(event: "close", listener: () => void): this;
+ prependListener(event: "connection", listener: (socket: Socket) => void): this;
+ prependListener(event: "error", listener: (err: Error) => void): this;
+ prependListener(event: "listening", listener: () => void): this;
+ prependListener(event: "checkContinue", listener: RequestListener<Request, Response>): this;
+ prependListener(event: "checkExpectation", listener: RequestListener<Request, Response>): this;
+ prependListener(event: "clientError", listener: (err: Error, socket: stream.Duplex) => void): this;
+ prependListener(
+ event: "connect",
+ listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void,
+ ): this;
+ prependListener(
+ event: "dropRequest",
+ listener: (req: InstanceType<Request>, socket: stream.Duplex) => void,
+ ): this;
+ prependListener(event: "request", listener: RequestListener<Request, Response>): this;
+ prependListener(
+ event: "upgrade",
+ listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void,
+ ): this;
+ prependOnceListener(event: string, listener: (...args: any[]) => void): this;
+ prependOnceListener(event: "close", listener: () => void): this;
+ prependOnceListener(event: "connection", listener: (socket: Socket) => void): this;
+ prependOnceListener(event: "error", listener: (err: Error) => void): this;
+ prependOnceListener(event: "listening", listener: () => void): this;
+ prependOnceListener(event: "checkContinue", listener: RequestListener<Request, Response>): this;
+ prependOnceListener(event: "checkExpectation", listener: RequestListener<Request, Response>): this;
+ prependOnceListener(event: "clientError", listener: (err: Error, socket: stream.Duplex) => void): this;
+ prependOnceListener(
+ event: "connect",
+ listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void,
+ ): this;
+ prependOnceListener(
+ event: "dropRequest",
+ listener: (req: InstanceType<Request>, socket: stream.Duplex) => void,
+ ): this;
+ prependOnceListener(event: "request", listener: RequestListener<Request, Response>): this;
+ prependOnceListener(
+ event: "upgrade",
+ listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void,
+ ): this;
+ }
+ /**
+ * This class serves as the parent class of {@link ClientRequest} and {@link ServerResponse}. It is an abstract of outgoing message from
+ * the perspective of the participants of HTTP transaction.
+ * @since v0.1.17
+ */
+ class OutgoingMessage<Request extends IncomingMessage = IncomingMessage> extends stream.Writable {
+ readonly req: Request;
+ chunkedEncoding: boolean;
+ shouldKeepAlive: boolean;
+ useChunkedEncodingByDefault: boolean;
+ sendDate: boolean;
+ /**
+ * @deprecated Use `writableEnded` instead.
+ */
+ finished: boolean;
+ /**
+ * Read-only. `true` if the headers were sent, otherwise `false`.
+ * @since v0.9.3
+ */
+ readonly headersSent: boolean;
+ /**
+ * Aliases of `outgoingMessage.socket`
+ * @since v0.3.0
+ * @deprecated Since v15.12.0,v14.17.1 - Use `socket` instead.
+ */
+ readonly connection: Socket | null;
+ /**
+ * Reference to the underlying socket. Usually, users will not want to access
+ * this property.
+ *
+ * After calling `outgoingMessage.end()`, this property will be nulled.
+ * @since v0.3.0
+ */
+ readonly socket: Socket | null;
+ constructor();
+ /**
+ * Once a socket is associated with the message and is connected,`socket.setTimeout()` will be called with `msecs` as the first parameter.
+ * @since v0.9.12
+ * @param callback Optional function to be called when a timeout occurs. Same as binding to the `timeout` event.
+ */
+ setTimeout(msecs: number, callback?: () => void): this;
+ /**
+ * Sets a single header value for the header object.
+ * If the header already exists in the to-be-sent headers, its value will be replaced. Use an array of strings to send multiple headers with the same name.
+ * @since v0.4.0
+ * @param name Header name
+ * @param value Header value
+ */
+ setHeader(name: string, value: number | string | readonly string[]): this;
+ /**
+ * Append a single header value for the header object.
+ *
+ * If the value is an array, this is equivalent of calling this method multiple times.
+ *
+ * If there were no previous value for the header, this is equivalent of calling `outgoingMessage.setHeader(name, value)`.
+ *
+ * Depending of the value of `options.uniqueHeaders` when the client request or the server were created,
+ * this will end up in the header being sent multiple times or a single time with values joined using `; `.
+ * @since v18.3.0, v16.17.0
+ * @param name Header name
+ * @param value Header value
+ */
+ appendHeader(name: string, value: string | readonly string[]): this;
+ /**
+ * Gets the value of HTTP header with the given name. If such a name doesn't
+ * exist in message, it will be `undefined`.
+ * @since v0.4.0
+ * @param name Name of header
+ */
+ getHeader(name: string): number | string | string[] | undefined;
+ /**
+ * Returns a shallow copy of the current outgoing headers. Since a shallow
+ * copy is used, array values may be mutated without additional calls to
+ * various header-related HTTP module methods. The keys of the returned
+ * object are the header names and the values are the respective header
+ * values. All header names are lowercase.
+ *
+ * The object returned by the `outgoingMessage.getHeaders()` method does
+ * not prototypically inherit from the JavaScript Object. This means that
+ * typical Object methods such as `obj.toString()`, `obj.hasOwnProperty()`,
+ * and others are not defined and will not work.
+ *
+ * ```js
+ * outgoingMessage.setHeader('Foo', 'bar');
+ * outgoingMessage.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']);
+ *
+ * const headers = outgoingMessage.getHeaders();
+ * // headers === { foo: 'bar', 'set-cookie': ['foo=bar', 'bar=baz'] }
+ * ```
+ * @since v7.7.0
+ */
+ getHeaders(): OutgoingHttpHeaders;
+ /**
+ * Returns an array of names of headers of the outgoing outgoingMessage. All
+ * names are lowercase.
+ * @since v7.7.0
+ */
+ getHeaderNames(): string[];
+ /**
+ * Returns `true` if the header identified by `name` is currently set in the
+ * outgoing headers. The header name is case-insensitive.
+ *
+ * ```js
+ * const hasContentType = outgoingMessage.hasHeader('content-type');
+ * ```
+ * @since v7.7.0
+ */
+ hasHeader(name: string): boolean;
+ /**
+ * Removes a header that is queued for implicit sending.
+ *
+ * ```js
+ * outgoingMessage.removeHeader('Content-Encoding');
+ * ```
+ * @since v0.4.0
+ * @param name Header name
+ */
+ removeHeader(name: string): void;
+ /**
+ * Adds HTTP trailers (headers but at the end of the message) to the message.
+ *
+ * Trailers are **only** be emitted if the message is chunked encoded. If not,
+ * the trailer will be silently discarded.
+ *
+ * HTTP requires the `Trailer` header to be sent to emit trailers,
+ * with a list of header fields in its value, e.g.
+ *
+ * ```js
+ * message.writeHead(200, { 'Content-Type': 'text/plain',
+ * 'Trailer': 'Content-MD5' });
+ * message.write(fileData);
+ * message.addTrailers({ 'Content-MD5': '7895bf4b8828b55ceaf47747b4bca667' });
+ * message.end();
+ * ```
+ *
+ * Attempting to set a header field name or value that contains invalid characters
+ * will result in a `TypeError` being thrown.
+ * @since v0.3.0
+ */
+ addTrailers(headers: OutgoingHttpHeaders | ReadonlyArray<[string, string]>): void;
+ /**
+ * Compulsorily flushes the message headers
+ *
+ * For efficiency reason, Node.js normally buffers the message headers
+ * until `outgoingMessage.end()` is called or the first chunk of message data
+ * is written. It then tries to pack the headers and data into a single TCP
+ * packet.
+ *
+ * It is usually desired (it saves a TCP round-trip), but not when the first
+ * data is not sent until possibly much later. `outgoingMessage.flushHeaders()`bypasses the optimization and kickstarts the request.
+ * @since v1.6.0
+ */
+ flushHeaders(): void;
+ }
+ /**
+ * This object is created internally by an HTTP server, not by the user. It is
+ * passed as the second parameter to the `'request'` event.
+ * @since v0.1.17
+ */
+ class ServerResponse<Request extends IncomingMessage = IncomingMessage> extends OutgoingMessage<Request> {
+ /**
+ * When using implicit headers (not calling `response.writeHead()` explicitly),
+ * this property controls the status code that will be sent to the client when
+ * the headers get flushed.
+ *
+ * ```js
+ * response.statusCode = 404;
+ * ```
+ *
+ * After response header was sent to the client, this property indicates the
+ * status code which was sent out.
+ * @since v0.4.0
+ */
+ statusCode: number;
+ /**
+ * When using implicit headers (not calling `response.writeHead()` explicitly),
+ * this property controls the status message that will be sent to the client when
+ * the headers get flushed. If this is left as `undefined` then the standard
+ * message for the status code will be used.
+ *
+ * ```js
+ * response.statusMessage = 'Not found';
+ * ```
+ *
+ * After response header was sent to the client, this property indicates the
+ * status message which was sent out.
+ * @since v0.11.8
+ */
+ statusMessage: string;
+ /**
+ * If set to `true`, Node.js will check whether the `Content-Length` header value
+ * and the size of the body, in bytes, are equal. Mismatching the
+ * `Content-Length` header value will result in an `Error` being thrown,
+ * identified by `code: 'ERR_HTTP_CONTENT_LENGTH_MISMATCH'`.
+ * @since v18.10.0, v16.18.0
+ */
+ strictContentLength: boolean;
+ constructor(req: Request);
+ assignSocket(socket: Socket): void;
+ detachSocket(socket: Socket): void;
+ /**
+ * Sends an HTTP/1.1 100 Continue message to the client, indicating that
+ * the request body should be sent. See the `'checkContinue'` event on`Server`.
+ * @since v0.3.0
+ */
+ writeContinue(callback?: () => void): void;
+ /**
+ * Sends an HTTP/1.1 103 Early Hints message to the client with a Link header,
+ * indicating that the user agent can preload/preconnect the linked resources.
+ * The `hints` is an object containing the values of headers to be sent with
+ * early hints message. The optional `callback` argument will be called when
+ * the response message has been written.
+ *
+ * Example:
+ *
+ * ```js
+ * const earlyHintsLink = '</styles.css>; rel=preload; as=style';
+ * response.writeEarlyHints({
+ * 'link': earlyHintsLink,
+ * });
+ *
+ * const earlyHintsLinks = [
+ * '</styles.css>; rel=preload; as=style',
+ * '</scripts.js>; rel=preload; as=script',
+ * ];
+ * response.writeEarlyHints({
+ * 'link': earlyHintsLinks,
+ * 'x-trace-id': 'id for diagnostics'
+ * });
+ *
+ * const earlyHintsCallback = () => console.log('early hints message sent');
+ * response.writeEarlyHints({
+ * 'link': earlyHintsLinks
+ * }, earlyHintsCallback);
+ * ```
+ *
+ * @since v18.11.0
+ * @param hints An object containing the values of headers
+ * @param callback Will be called when the response message has been written
+ */
+ writeEarlyHints(hints: Record<string, string | string[]>, callback?: () => void): void;
+ /**
+ * Sends a response header to the request. The status code is a 3-digit HTTP
+ * status code, like `404`. The last argument, `headers`, are the response headers.
+ * Optionally one can give a human-readable `statusMessage` as the second
+ * argument.
+ *
+ * `headers` may be an `Array` where the keys and values are in the same list.
+ * It is _not_ a list of tuples. So, the even-numbered offsets are key values,
+ * and the odd-numbered offsets are the associated values. The array is in the same
+ * format as `request.rawHeaders`.
+ *
+ * Returns a reference to the `ServerResponse`, so that calls can be chained.
+ *
+ * ```js
+ * const body = 'hello world';
+ * response
+ * .writeHead(200, {
+ * 'Content-Length': Buffer.byteLength(body),
+ * 'Content-Type': 'text/plain'
+ * })
+ * .end(body);
+ * ```
+ *
+ * This method must only be called once on a message and it must
+ * be called before `response.end()` is called.
+ *
+ * If `response.write()` or `response.end()` are called before calling
+ * this, the implicit/mutable headers will be calculated and call this function.
+ *
+ * When headers have been set with `response.setHeader()`, they will be merged
+ * with any headers passed to `response.writeHead()`, with the headers passed
+ * to `response.writeHead()` given precedence.
+ *
+ * If this method is called and `response.setHeader()` has not been called,
+ * it will directly write the supplied header values onto the network channel
+ * without caching internally, and the `response.getHeader()` on the header
+ * will not yield the expected result. If progressive population of headers is
+ * desired with potential future retrieval and modification, use `response.setHeader()` instead.
+ *
+ * ```js
+ * // Returns content-type = text/plain
+ * const server = http.createServer((req, res) => {
+ * res.setHeader('Content-Type', 'text/html');
+ * res.setHeader('X-Foo', 'bar');
+ * res.writeHead(200, { 'Content-Type': 'text/plain' });
+ * res.end('ok');
+ * });
+ * ```
+ *
+ * `Content-Length` is given in bytes, not characters. Use `Buffer.byteLength()` to determine the length of the body in bytes. Node.js
+ * does not check whether `Content-Length` and the length of the body which has
+ * been transmitted are equal or not.
+ *
+ * Attempting to set a header field name or value that contains invalid characters
+ * will result in a `TypeError` being thrown.
+ * @since v0.1.30
+ */
+ writeHead(
+ statusCode: number,
+ statusMessage?: string,
+ headers?: OutgoingHttpHeaders | OutgoingHttpHeader[],
+ ): this;
+ writeHead(statusCode: number, headers?: OutgoingHttpHeaders | OutgoingHttpHeader[]): this;
+ /**
+ * Sends an HTTP/1.1 102 Processing message to the client, indicating that
+ * the request body should be sent.
+ * @since v10.0.0
+ */
+ writeProcessing(): void;
+ }
+ interface InformationEvent {
+ statusCode: number;
+ statusMessage: string;
+ httpVersion: string;
+ httpVersionMajor: number;
+ httpVersionMinor: number;
+ headers: IncomingHttpHeaders;
+ rawHeaders: string[];
+ }
+ /**
+ * This object is created internally and returned from {@link request}. It
+ * represents an _in-progress_ request whose header has already been queued. The
+ * header is still mutable using the `setHeader(name, value)`,`getHeader(name)`, `removeHeader(name)` API. The actual header will
+ * be sent along with the first data chunk or when calling `request.end()`.
+ *
+ * To get the response, add a listener for `'response'` to the request object.`'response'` will be emitted from the request object when the response
+ * headers have been received. The `'response'` event is executed with one
+ * argument which is an instance of {@link IncomingMessage}.
+ *
+ * During the `'response'` event, one can add listeners to the
+ * response object; particularly to listen for the `'data'` event.
+ *
+ * If no `'response'` handler is added, then the response will be
+ * entirely discarded. However, if a `'response'` event handler is added,
+ * then the data from the response object **must** be consumed, either by
+ * calling `response.read()` whenever there is a `'readable'` event, or
+ * by adding a `'data'` handler, or by calling the `.resume()` method.
+ * Until the data is consumed, the `'end'` event will not fire. Also, until
+ * the data is read it will consume memory that can eventually lead to a
+ * 'process out of memory' error.
+ *
+ * For backward compatibility, `res` will only emit `'error'` if there is an`'error'` listener registered.
+ *
+ * Node.js does not check whether Content-Length and the length of the
+ * body which has been transmitted are equal or not.
+ * @since v0.1.17
+ */
+ class ClientRequest extends OutgoingMessage {
+ /**
+ * The `request.aborted` property will be `true` if the request has
+ * been aborted.
+ * @since v0.11.14
+ * @deprecated Since v17.0.0,v16.12.0 - Check `destroyed` instead.
+ */
+ aborted: boolean;
+ /**
+ * The request host.
+ * @since v14.5.0, v12.19.0
+ */
+ host: string;
+ /**
+ * The request protocol.
+ * @since v14.5.0, v12.19.0
+ */
+ protocol: string;
+ /**
+ * When sending request through a keep-alive enabled agent, the underlying socket
+ * might be reused. But if server closes connection at unfortunate time, client
+ * may run into a 'ECONNRESET' error.
+ *
+ * ```js
+ * const http = require('http');
+ *
+ * // Server has a 5 seconds keep-alive timeout by default
+ * http
+ * .createServer((req, res) => {
+ * res.write('hello\n');
+ * res.end();
+ * })
+ * .listen(3000);
+ *
+ * setInterval(() => {
+ * // Adapting a keep-alive agent
+ * http.get('http://localhost:3000', { agent }, (res) => {
+ * res.on('data', (data) => {
+ * // Do nothing
+ * });
+ * });
+ * }, 5000); // Sending request on 5s interval so it's easy to hit idle timeout
+ * ```
+ *
+ * By marking a request whether it reused socket or not, we can do
+ * automatic error retry base on it.
+ *
+ * ```js
+ * const http = require('http');
+ * const agent = new http.Agent({ keepAlive: true });
+ *
+ * function retriableRequest() {
+ * const req = http
+ * .get('http://localhost:3000', { agent }, (res) => {
+ * // ...
+ * })
+ * .on('error', (err) => {
+ * // Check if retry is needed
+ * if (req.reusedSocket &#x26;&#x26; err.code === 'ECONNRESET') {
+ * retriableRequest();
+ * }
+ * });
+ * }
+ *
+ * retriableRequest();
+ * ```
+ * @since v13.0.0, v12.16.0
+ */
+ reusedSocket: boolean;
+ /**
+ * Limits maximum response headers count. If set to 0, no limit will be applied.
+ */
+ maxHeadersCount: number;
+ constructor(url: string | URL | ClientRequestArgs, cb?: (res: IncomingMessage) => void);
+ /**
+ * The request method.
+ * @since v0.1.97
+ */
+ method: string;
+ /**
+ * The request path.
+ * @since v0.4.0
+ */
+ path: string;
+ /**
+ * Marks the request as aborting. Calling this will cause remaining data
+ * in the response to be dropped and the socket to be destroyed.
+ * @since v0.3.8
+ * @deprecated Since v14.1.0,v13.14.0 - Use `destroy` instead.
+ */
+ abort(): void;
+ onSocket(socket: Socket): void;
+ /**
+ * Once a socket is assigned to this request and is connected `socket.setTimeout()` will be called.
+ * @since v0.5.9
+ * @param timeout Milliseconds before a request times out.
+ * @param callback Optional function to be called when a timeout occurs. Same as binding to the `'timeout'` event.
+ */
+ setTimeout(timeout: number, callback?: () => void): this;
+ /**
+ * Once a socket is assigned to this request and is connected `socket.setNoDelay()` will be called.
+ * @since v0.5.9
+ */
+ setNoDelay(noDelay?: boolean): void;
+ /**
+ * Once a socket is assigned to this request and is connected `socket.setKeepAlive()` will be called.
+ * @since v0.5.9
+ */
+ setSocketKeepAlive(enable?: boolean, initialDelay?: number): void;
+ /**
+ * Returns an array containing the unique names of the current outgoing raw
+ * headers. Header names are returned with their exact casing being set.
+ *
+ * ```js
+ * request.setHeader('Foo', 'bar');
+ * request.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']);
+ *
+ * const headerNames = request.getRawHeaderNames();
+ * // headerNames === ['Foo', 'Set-Cookie']
+ * ```
+ * @since v15.13.0, v14.17.0
+ */
+ getRawHeaderNames(): string[];
+ /**
+ * @deprecated
+ */
+ addListener(event: "abort", listener: () => void): this;
+ addListener(
+ event: "connect",
+ listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void,
+ ): this;
+ addListener(event: "continue", listener: () => void): this;
+ addListener(event: "information", listener: (info: InformationEvent) => void): this;
+ addListener(event: "response", listener: (response: IncomingMessage) => void): this;
+ addListener(event: "socket", listener: (socket: Socket) => void): this;
+ addListener(event: "timeout", listener: () => void): this;
+ addListener(
+ event: "upgrade",
+ listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void,
+ ): this;
+ addListener(event: "close", listener: () => void): this;
+ addListener(event: "drain", listener: () => void): this;
+ addListener(event: "error", listener: (err: Error) => void): this;
+ addListener(event: "finish", listener: () => void): this;
+ addListener(event: "pipe", listener: (src: stream.Readable) => void): this;
+ addListener(event: "unpipe", listener: (src: stream.Readable) => void): this;
+ addListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ /**
+ * @deprecated
+ */
+ on(event: "abort", listener: () => void): this;
+ on(event: "connect", listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this;
+ on(event: "continue", listener: () => void): this;
+ on(event: "information", listener: (info: InformationEvent) => void): this;
+ on(event: "response", listener: (response: IncomingMessage) => void): this;
+ on(event: "socket", listener: (socket: Socket) => void): this;
+ on(event: "timeout", listener: () => void): this;
+ on(event: "upgrade", listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this;
+ on(event: "close", listener: () => void): this;
+ on(event: "drain", listener: () => void): this;
+ on(event: "error", listener: (err: Error) => void): this;
+ on(event: "finish", listener: () => void): this;
+ on(event: "pipe", listener: (src: stream.Readable) => void): this;
+ on(event: "unpipe", listener: (src: stream.Readable) => void): this;
+ on(event: string | symbol, listener: (...args: any[]) => void): this;
+ /**
+ * @deprecated
+ */
+ once(event: "abort", listener: () => void): this;
+ once(event: "connect", listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this;
+ once(event: "continue", listener: () => void): this;
+ once(event: "information", listener: (info: InformationEvent) => void): this;
+ once(event: "response", listener: (response: IncomingMessage) => void): this;
+ once(event: "socket", listener: (socket: Socket) => void): this;
+ once(event: "timeout", listener: () => void): this;
+ once(event: "upgrade", listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this;
+ once(event: "close", listener: () => void): this;
+ once(event: "drain", listener: () => void): this;
+ once(event: "error", listener: (err: Error) => void): this;
+ once(event: "finish", listener: () => void): this;
+ once(event: "pipe", listener: (src: stream.Readable) => void): this;
+ once(event: "unpipe", listener: (src: stream.Readable) => void): this;
+ once(event: string | symbol, listener: (...args: any[]) => void): this;
+ /**
+ * @deprecated
+ */
+ prependListener(event: "abort", listener: () => void): this;
+ prependListener(
+ event: "connect",
+ listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void,
+ ): this;
+ prependListener(event: "continue", listener: () => void): this;
+ prependListener(event: "information", listener: (info: InformationEvent) => void): this;
+ prependListener(event: "response", listener: (response: IncomingMessage) => void): this;
+ prependListener(event: "socket", listener: (socket: Socket) => void): this;
+ prependListener(event: "timeout", listener: () => void): this;
+ prependListener(
+ event: "upgrade",
+ listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void,
+ ): this;
+ prependListener(event: "close", listener: () => void): this;
+ prependListener(event: "drain", listener: () => void): this;
+ prependListener(event: "error", listener: (err: Error) => void): this;
+ prependListener(event: "finish", listener: () => void): this;
+ prependListener(event: "pipe", listener: (src: stream.Readable) => void): this;
+ prependListener(event: "unpipe", listener: (src: stream.Readable) => void): this;
+ prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ /**
+ * @deprecated
+ */
+ prependOnceListener(event: "abort", listener: () => void): this;
+ prependOnceListener(
+ event: "connect",
+ listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void,
+ ): this;
+ prependOnceListener(event: "continue", listener: () => void): this;
+ prependOnceListener(event: "information", listener: (info: InformationEvent) => void): this;
+ prependOnceListener(event: "response", listener: (response: IncomingMessage) => void): this;
+ prependOnceListener(event: "socket", listener: (socket: Socket) => void): this;
+ prependOnceListener(event: "timeout", listener: () => void): this;
+ prependOnceListener(
+ event: "upgrade",
+ listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void,
+ ): this;
+ prependOnceListener(event: "close", listener: () => void): this;
+ prependOnceListener(event: "drain", listener: () => void): this;
+ prependOnceListener(event: "error", listener: (err: Error) => void): this;
+ prependOnceListener(event: "finish", listener: () => void): this;
+ prependOnceListener(event: "pipe", listener: (src: stream.Readable) => void): this;
+ prependOnceListener(event: "unpipe", listener: (src: stream.Readable) => void): this;
+ prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ }
+ /**
+ * An `IncomingMessage` object is created by {@link Server} or {@link ClientRequest} and passed as the first argument to the `'request'` and `'response'` event respectively. It may be used to
+ * access response
+ * status, headers and data.
+ *
+ * Different from its `socket` value which is a subclass of `stream.Duplex`, the`IncomingMessage` itself extends `stream.Readable` and is created separately to
+ * parse and emit the incoming HTTP headers and payload, as the underlying socket
+ * may be reused multiple times in case of keep-alive.
+ * @since v0.1.17
+ */
+ class IncomingMessage extends stream.Readable {
+ constructor(socket: Socket);
+ /**
+ * The `message.aborted` property will be `true` if the request has
+ * been aborted.
+ * @since v10.1.0
+ * @deprecated Since v17.0.0,v16.12.0 - Check `message.destroyed` from <a href="stream.html#class-streamreadable" class="type">stream.Readable</a>.
+ */
+ aborted: boolean;
+ /**
+ * In case of server request, the HTTP version sent by the client. In the case of
+ * client response, the HTTP version of the connected-to server.
+ * Probably either `'1.1'` or `'1.0'`.
+ *
+ * Also `message.httpVersionMajor` is the first integer and`message.httpVersionMinor` is the second.
+ * @since v0.1.1
+ */
+ httpVersion: string;
+ httpVersionMajor: number;
+ httpVersionMinor: number;
+ /**
+ * The `message.complete` property will be `true` if a complete HTTP message has
+ * been received and successfully parsed.
+ *
+ * This property is particularly useful as a means of determining if a client or
+ * server fully transmitted a message before a connection was terminated:
+ *
+ * ```js
+ * const req = http.request({
+ * host: '127.0.0.1',
+ * port: 8080,
+ * method: 'POST'
+ * }, (res) => {
+ * res.resume();
+ * res.on('end', () => {
+ * if (!res.complete)
+ * console.error(
+ * 'The connection was terminated while the message was still being sent');
+ * });
+ * });
+ * ```
+ * @since v0.3.0
+ */
+ complete: boolean;
+ /**
+ * Alias for `message.socket`.
+ * @since v0.1.90
+ * @deprecated Since v16.0.0 - Use `socket`.
+ */
+ connection: Socket;
+ /**
+ * The `net.Socket` object associated with the connection.
+ *
+ * With HTTPS support, use `request.socket.getPeerCertificate()` to obtain the
+ * client's authentication details.
+ *
+ * This property is guaranteed to be an instance of the `net.Socket` class,
+ * a subclass of `stream.Duplex`, unless the user specified a socket
+ * type other than `net.Socket` or internally nulled.
+ * @since v0.3.0
+ */
+ socket: Socket;
+ /**
+ * The request/response headers object.
+ *
+ * Key-value pairs of header names and values. Header names are lower-cased.
+ *
+ * ```js
+ * // Prints something like:
+ * //
+ * // { 'user-agent': 'curl/7.22.0',
+ * // host: '127.0.0.1:8000',
+ * // accept: '*' }
+ * console.log(request.getHeaders());
+ * ```
+ *
+ * Duplicates in raw headers are handled in the following ways, depending on the
+ * header name:
+ *
+ * * Duplicates of `age`, `authorization`, `content-length`, `content-type`,`etag`, `expires`, `from`, `host`, `if-modified-since`, `if-unmodified-since`,`last-modified`, `location`,
+ * `max-forwards`, `proxy-authorization`, `referer`,`retry-after`, `server`, or `user-agent` are discarded.
+ * * `set-cookie` is always an array. Duplicates are added to the array.
+ * * For duplicate `cookie` headers, the values are joined together with '; '.
+ * * For all other headers, the values are joined together with ', '.
+ * @since v0.1.5
+ */
+ headers: IncomingHttpHeaders;
+ /**
+ * Similar to `message.headers`, but there is no join logic and the values are always arrays of strings, even for headers received just once.
+ *
+ * ```js
+ * // Prints something like:
+ * //
+ * // { 'user-agent': ['curl/7.22.0'],
+ * // host: ['127.0.0.1:8000'],
+ * // accept: ['*'] }
+ * console.log(request.headersDistinct);
+ * ```
+ * @since v18.3.0, v16.17.0
+ */
+ headersDistinct: NodeJS.Dict<string[]>;
+ /**
+ * The raw request/response headers list exactly as they were received.
+ *
+ * The keys and values are in the same list. It is _not_ a
+ * list of tuples. So, the even-numbered offsets are key values, and the
+ * odd-numbered offsets are the associated values.
+ *
+ * Header names are not lowercased, and duplicates are not merged.
+ *
+ * ```js
+ * // Prints something like:
+ * //
+ * // [ 'user-agent',
+ * // 'this is invalid because there can be only one',
+ * // 'User-Agent',
+ * // 'curl/7.22.0',
+ * // 'Host',
+ * // '127.0.0.1:8000',
+ * // 'ACCEPT',
+ * // '*' ]
+ * console.log(request.rawHeaders);
+ * ```
+ * @since v0.11.6
+ */
+ rawHeaders: string[];
+ /**
+ * The request/response trailers object. Only populated at the `'end'` event.
+ * @since v0.3.0
+ */
+ trailers: NodeJS.Dict<string>;
+ /**
+ * Similar to `message.trailers`, but there is no join logic and the values are always arrays of strings, even for headers received just once.
+ * Only populated at the `'end'` event.
+ * @since v18.3.0, v16.17.0
+ */
+ trailersDistinct: NodeJS.Dict<string[]>;
+ /**
+ * The raw request/response trailer keys and values exactly as they were
+ * received. Only populated at the `'end'` event.
+ * @since v0.11.6
+ */
+ rawTrailers: string[];
+ /**
+ * Calls `message.socket.setTimeout(msecs, callback)`.
+ * @since v0.5.9
+ */
+ setTimeout(msecs: number, callback?: () => void): this;
+ /**
+ * **Only valid for request obtained from {@link Server}.**
+ *
+ * The request method as a string. Read only. Examples: `'GET'`, `'DELETE'`.
+ * @since v0.1.1
+ */
+ method?: string | undefined;
+ /**
+ * **Only valid for request obtained from {@link Server}.**
+ *
+ * Request URL string. This contains only the URL that is present in the actual
+ * HTTP request. Take the following request:
+ *
+ * ```http
+ * GET /status?name=ryan HTTP/1.1
+ * Accept: text/plain
+ * ```
+ *
+ * To parse the URL into its parts:
+ *
+ * ```js
+ * new URL(request.url, `http://${request.getHeaders().host}`);
+ * ```
+ *
+ * When `request.url` is `'/status?name=ryan'` and`request.getHeaders().host` is `'localhost:3000'`:
+ *
+ * ```console
+ * $ node
+ * > new URL(request.url, `http://${request.getHeaders().host}`)
+ * URL {
+ * href: 'http://localhost:3000/status?name=ryan',
+ * origin: 'http://localhost:3000',
+ * protocol: 'http:',
+ * username: '',
+ * password: '',
+ * host: 'localhost:3000',
+ * hostname: 'localhost',
+ * port: '3000',
+ * pathname: '/status',
+ * search: '?name=ryan',
+ * searchParams: URLSearchParams { 'name' => 'ryan' },
+ * hash: ''
+ * }
+ * ```
+ * @since v0.1.90
+ */
+ url?: string | undefined;
+ /**
+ * **Only valid for response obtained from {@link ClientRequest}.**
+ *
+ * The 3-digit HTTP response status code. E.G. `404`.
+ * @since v0.1.1
+ */
+ statusCode?: number | undefined;
+ /**
+ * **Only valid for response obtained from {@link ClientRequest}.**
+ *
+ * The HTTP response status message (reason phrase). E.G. `OK` or `Internal Server Error`.
+ * @since v0.11.10
+ */
+ statusMessage?: string | undefined;
+ /**
+ * Calls `destroy()` on the socket that received the `IncomingMessage`. If `error`is provided, an `'error'` event is emitted on the socket and `error` is passed
+ * as an argument to any listeners on the event.
+ * @since v0.3.0
+ */
+ destroy(error?: Error): this;
+ }
+ interface AgentOptions extends Partial<TcpSocketConnectOpts> {
+ /**
+ * Keep sockets around in a pool to be used by other requests in the future. Default = false
+ */
+ keepAlive?: boolean | undefined;
+ /**
+ * When using HTTP KeepAlive, how often to send TCP KeepAlive packets over sockets being kept alive. Default = 1000.
+ * Only relevant if keepAlive is set to true.
+ */
+ keepAliveMsecs?: number | undefined;
+ /**
+ * Maximum number of sockets to allow per host. Default for Node 0.10 is 5, default for Node 0.12 is Infinity
+ */
+ maxSockets?: number | undefined;
+ /**
+ * Maximum number of sockets allowed for all hosts in total. Each request will use a new socket until the maximum is reached. Default: Infinity.
+ */
+ maxTotalSockets?: number | undefined;
+ /**
+ * Maximum number of sockets to leave open in a free state. Only relevant if keepAlive is set to true. Default = 256.
+ */
+ maxFreeSockets?: number | undefined;
+ /**
+ * Socket timeout in milliseconds. This will set the timeout after the socket is connected.
+ */
+ timeout?: number | undefined;
+ /**
+ * Scheduling strategy to apply when picking the next free socket to use.
+ * @default `lifo`
+ */
+ scheduling?: "fifo" | "lifo" | undefined;
+ }
+ /**
+ * An `Agent` is responsible for managing connection persistence
+ * and reuse for HTTP clients. It maintains a queue of pending requests
+ * for a given host and port, reusing a single socket connection for each
+ * until the queue is empty, at which time the socket is either destroyed
+ * or put into a pool where it is kept to be used again for requests to the
+ * same host and port. Whether it is destroyed or pooled depends on the`keepAlive` `option`.
+ *
+ * Pooled connections have TCP Keep-Alive enabled for them, but servers may
+ * still close idle connections, in which case they will be removed from the
+ * pool and a new connection will be made when a new HTTP request is made for
+ * that host and port. Servers may also refuse to allow multiple requests
+ * over the same connection, in which case the connection will have to be
+ * remade for every request and cannot be pooled. The `Agent` will still make
+ * the requests to that server, but each one will occur over a new connection.
+ *
+ * When a connection is closed by the client or the server, it is removed
+ * from the pool. Any unused sockets in the pool will be unrefed so as not
+ * to keep the Node.js process running when there are no outstanding requests.
+ * (see `socket.unref()`).
+ *
+ * It is good practice, to `destroy()` an `Agent` instance when it is no
+ * longer in use, because unused sockets consume OS resources.
+ *
+ * Sockets are removed from an agent when the socket emits either
+ * a `'close'` event or an `'agentRemove'` event. When intending to keep one
+ * HTTP request open for a long time without keeping it in the agent, something
+ * like the following may be done:
+ *
+ * ```js
+ * http.get(options, (res) => {
+ * // Do stuff
+ * }).on('socket', (socket) => {
+ * socket.emit('agentRemove');
+ * });
+ * ```
+ *
+ * An agent may also be used for an individual request. By providing`{agent: false}` as an option to the `http.get()` or `http.request()`functions, a one-time use `Agent` with default options
+ * will be used
+ * for the client connection.
+ *
+ * `agent:false`:
+ *
+ * ```js
+ * http.get({
+ * hostname: 'localhost',
+ * port: 80,
+ * path: '/',
+ * agent: false // Create a new agent just for this one request
+ * }, (res) => {
+ * // Do stuff with response
+ * });
+ * ```
+ * @since v0.3.4
+ */
+ class Agent extends EventEmitter {
+ /**
+ * By default set to 256. For agents with `keepAlive` enabled, this
+ * sets the maximum number of sockets that will be left open in the free
+ * state.
+ * @since v0.11.7
+ */
+ maxFreeSockets: number;
+ /**
+ * By default set to `Infinity`. Determines how many concurrent sockets the agent
+ * can have open per origin. Origin is the returned value of `agent.getName()`.
+ * @since v0.3.6
+ */
+ maxSockets: number;
+ /**
+ * By default set to `Infinity`. Determines how many concurrent sockets the agent
+ * can have open. Unlike `maxSockets`, this parameter applies across all origins.
+ * @since v14.5.0, v12.19.0
+ */
+ maxTotalSockets: number;
+ /**
+ * An object which contains arrays of sockets currently awaiting use by
+ * the agent when `keepAlive` is enabled. Do not modify.
+ *
+ * Sockets in the `freeSockets` list will be automatically destroyed and
+ * removed from the array on `'timeout'`.
+ * @since v0.11.4
+ */
+ readonly freeSockets: NodeJS.ReadOnlyDict<Socket[]>;
+ /**
+ * An object which contains arrays of sockets currently in use by the
+ * agent. Do not modify.
+ * @since v0.3.6
+ */
+ readonly sockets: NodeJS.ReadOnlyDict<Socket[]>;
+ /**
+ * An object which contains queues of requests that have not yet been assigned to
+ * sockets. Do not modify.
+ * @since v0.5.9
+ */
+ readonly requests: NodeJS.ReadOnlyDict<IncomingMessage[]>;
+ constructor(opts?: AgentOptions);
+ /**
+ * Destroy any sockets that are currently in use by the agent.
+ *
+ * It is usually not necessary to do this. However, if using an
+ * agent with `keepAlive` enabled, then it is best to explicitly shut down
+ * the agent when it is no longer needed. Otherwise,
+ * sockets might stay open for quite a long time before the server
+ * terminates them.
+ * @since v0.11.4
+ */
+ destroy(): void;
+ }
+ const METHODS: string[];
+ const STATUS_CODES: {
+ [errorCode: number]: string | undefined;
+ [errorCode: string]: string | undefined;
+ };
+ /**
+ * Returns a new instance of {@link Server}.
+ *
+ * The `requestListener` is a function which is automatically
+ * added to the `'request'` event.
+ * @since v0.1.13
+ */
+ function createServer<
+ Request extends typeof IncomingMessage = typeof IncomingMessage,
+ Response extends typeof ServerResponse = typeof ServerResponse,
+ >(requestListener?: RequestListener<Request, Response>): Server<Request, Response>;
+ function createServer<
+ Request extends typeof IncomingMessage = typeof IncomingMessage,
+ Response extends typeof ServerResponse = typeof ServerResponse,
+ >(
+ options: ServerOptions<Request, Response>,
+ requestListener?: RequestListener<Request, Response>,
+ ): Server<Request, Response>;
+ // although RequestOptions are passed as ClientRequestArgs to ClientRequest directly,
+ // create interface RequestOptions would make the naming more clear to developers
+ interface RequestOptions extends ClientRequestArgs {}
+ /**
+ * `options` in `socket.connect()` are also supported.
+ *
+ * Node.js maintains several connections per server to make HTTP requests.
+ * This function allows one to transparently issue requests.
+ *
+ * `url` can be a string or a `URL` object. If `url` is a
+ * string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object.
+ *
+ * If both `url` and `options` are specified, the objects are merged, with the`options` properties taking precedence.
+ *
+ * The optional `callback` parameter will be added as a one-time listener for
+ * the `'response'` event.
+ *
+ * `http.request()` returns an instance of the {@link ClientRequest} class. The `ClientRequest` instance is a writable stream. If one needs to
+ * upload a file with a POST request, then write to the `ClientRequest` object.
+ *
+ * ```js
+ * const http = require('http');
+ *
+ * const postData = JSON.stringify({
+ * 'msg': 'Hello World!'
+ * });
+ *
+ * const options = {
+ * hostname: 'www.google.com',
+ * port: 80,
+ * path: '/upload',
+ * method: 'POST',
+ * headers: {
+ * 'Content-Type': 'application/json',
+ * 'Content-Length': Buffer.byteLength(postData)
+ * }
+ * };
+ *
+ * const req = http.request(options, (res) => {
+ * console.log(`STATUS: ${res.statusCode}`);
+ * console.log(`HEADERS: ${JSON.stringify(res.headers)}`);
+ * res.setEncoding('utf8');
+ * res.on('data', (chunk) => {
+ * console.log(`BODY: ${chunk}`);
+ * });
+ * res.on('end', () => {
+ * console.log('No more data in response.');
+ * });
+ * });
+ *
+ * req.on('error', (e) => {
+ * console.error(`problem with request: ${e.message}`);
+ * });
+ *
+ * // Write data to request body
+ * req.write(postData);
+ * req.end();
+ * ```
+ *
+ * In the example `req.end()` was called. With `http.request()` one
+ * must always call `req.end()` to signify the end of the request -
+ * even if there is no data being written to the request body.
+ *
+ * If any error is encountered during the request (be that with DNS resolution,
+ * TCP level errors, or actual HTTP parse errors) an `'error'` event is emitted
+ * on the returned request object. As with all `'error'` events, if no listeners
+ * are registered the error will be thrown.
+ *
+ * There are a few special headers that should be noted.
+ *
+ * * Sending a 'Connection: keep-alive' will notify Node.js that the connection to
+ * the server should be persisted until the next request.
+ * * Sending a 'Content-Length' header will disable the default chunked encoding.
+ * * Sending an 'Expect' header will immediately send the request headers.
+ * Usually, when sending 'Expect: 100-continue', both a timeout and a listener
+ * for the `'continue'` event should be set. See RFC 2616 Section 8.2.3 for more
+ * information.
+ * * Sending an Authorization header will override using the `auth` option
+ * to compute basic authentication.
+ *
+ * Example using a `URL` as `options`:
+ *
+ * ```js
+ * const options = new URL('http://abc:xyz@example.com');
+ *
+ * const req = http.request(options, (res) => {
+ * // ...
+ * });
+ * ```
+ *
+ * In a successful request, the following events will be emitted in the following
+ * order:
+ *
+ * * `'socket'`
+ * * `'response'`
+ * * `'data'` any number of times, on the `res` object
+ * (`'data'` will not be emitted at all if the response body is empty, for
+ * instance, in most redirects)
+ * * `'end'` on the `res` object
+ * * `'close'`
+ *
+ * In the case of a connection error, the following events will be emitted:
+ *
+ * * `'socket'`
+ * * `'error'`
+ * * `'close'`
+ *
+ * In the case of a premature connection close before the response is received,
+ * the following events will be emitted in the following order:
+ *
+ * * `'socket'`
+ * * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'`
+ * * `'close'`
+ *
+ * In the case of a premature connection close after the response is received,
+ * the following events will be emitted in the following order:
+ *
+ * * `'socket'`
+ * * `'response'`
+ * * `'data'` any number of times, on the `res` object
+ * * (connection closed here)
+ * * `'aborted'` on the `res` object
+ * * `'error'` on the `res` object with an error with message`'Error: aborted'` and code `'ECONNRESET'`.
+ * * `'close'`
+ * * `'close'` on the `res` object
+ *
+ * If `req.destroy()` is called before a socket is assigned, the following
+ * events will be emitted in the following order:
+ *
+ * * (`req.destroy()` called here)
+ * * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'`
+ * * `'close'`
+ *
+ * If `req.destroy()` is called before the connection succeeds, the following
+ * events will be emitted in the following order:
+ *
+ * * `'socket'`
+ * * (`req.destroy()` called here)
+ * * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'`
+ * * `'close'`
+ *
+ * If `req.destroy()` is called after the response is received, the following
+ * events will be emitted in the following order:
+ *
+ * * `'socket'`
+ * * `'response'`
+ * * `'data'` any number of times, on the `res` object
+ * * (`req.destroy()` called here)
+ * * `'aborted'` on the `res` object
+ * * `'error'` on the `res` object with an error with message`'Error: aborted'` and code `'ECONNRESET'`.
+ * * `'close'`
+ * * `'close'` on the `res` object
+ *
+ * If `req.abort()` is called before a socket is assigned, the following
+ * events will be emitted in the following order:
+ *
+ * * (`req.abort()` called here)
+ * * `'abort'`
+ * * `'close'`
+ *
+ * If `req.abort()` is called before the connection succeeds, the following
+ * events will be emitted in the following order:
+ *
+ * * `'socket'`
+ * * (`req.abort()` called here)
+ * * `'abort'`
+ * * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'`
+ * * `'close'`
+ *
+ * If `req.abort()` is called after the response is received, the following
+ * events will be emitted in the following order:
+ *
+ * * `'socket'`
+ * * `'response'`
+ * * `'data'` any number of times, on the `res` object
+ * * (`req.abort()` called here)
+ * * `'abort'`
+ * * `'aborted'` on the `res` object
+ * * `'error'` on the `res` object with an error with message`'Error: aborted'` and code `'ECONNRESET'`.
+ * * `'close'`
+ * * `'close'` on the `res` object
+ *
+ * Setting the `timeout` option or using the `setTimeout()` function will
+ * not abort the request or do anything besides add a `'timeout'` event.
+ *
+ * Passing an `AbortSignal` and then calling `abort` on the corresponding`AbortController` will behave the same way as calling `.destroy()` on the
+ * request itself.
+ * @since v0.3.6
+ */
+ function request(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest;
+ function request(
+ url: string | URL,
+ options: RequestOptions,
+ callback?: (res: IncomingMessage) => void,
+ ): ClientRequest;
+ /**
+ * Since most requests are GET requests without bodies, Node.js provides this
+ * convenience method. The only difference between this method and {@link request} is that it sets the method to GET and calls `req.end()`automatically. The callback must take care to consume the
+ * response
+ * data for reasons stated in {@link ClientRequest} section.
+ *
+ * The `callback` is invoked with a single argument that is an instance of {@link IncomingMessage}.
+ *
+ * JSON fetching example:
+ *
+ * ```js
+ * http.get('http://localhost:8000/', (res) => {
+ * const { statusCode } = res;
+ * const contentType = res.headers['content-type'];
+ *
+ * let error;
+ * // Any 2xx status code signals a successful response but
+ * // here we're only checking for 200.
+ * if (statusCode !== 200) {
+ * error = new Error('Request Failed.\n' +
+ * `Status Code: ${statusCode}`);
+ * } else if (!/^application\/json/.test(contentType)) {
+ * error = new Error('Invalid content-type.\n' +
+ * `Expected application/json but received ${contentType}`);
+ * }
+ * if (error) {
+ * console.error(error.message);
+ * // Consume response data to free up memory
+ * res.resume();
+ * return;
+ * }
+ *
+ * res.setEncoding('utf8');
+ * let rawData = '';
+ * res.on('data', (chunk) => { rawData += chunk; });
+ * res.on('end', () => {
+ * try {
+ * const parsedData = JSON.parse(rawData);
+ * console.log(parsedData);
+ * } catch (e) {
+ * console.error(e.message);
+ * }
+ * });
+ * }).on('error', (e) => {
+ * console.error(`Got error: ${e.message}`);
+ * });
+ *
+ * // Create a local server to receive data from
+ * const server = http.createServer((req, res) => {
+ * res.writeHead(200, { 'Content-Type': 'application/json' });
+ * res.end(JSON.stringify({
+ * data: 'Hello World!'
+ * }));
+ * });
+ *
+ * server.listen(8000);
+ * ```
+ * @since v0.3.6
+ * @param options Accepts the same `options` as {@link request}, with the `method` always set to `GET`. Properties that are inherited from the prototype are ignored.
+ */
+ function get(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest;
+ function get(url: string | URL, options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest;
+
+ /**
+ * Performs the low-level validations on the provided name that are done when `res.setHeader(name, value)` is called.
+ * Passing illegal value as name will result in a TypeError being thrown, identified by `code: 'ERR_INVALID_HTTP_TOKEN'`.
+ * @param name Header name
+ * @since v14.3.0
+ */
+ function validateHeaderName(name: string): void;
+ /**
+ * Performs the low-level validations on the provided value that are done when `res.setHeader(name, value)` is called.
+ * Passing illegal value as value will result in a TypeError being thrown.
+ * - Undefined value error is identified by `code: 'ERR_HTTP_INVALID_HEADER_VALUE'`.
+ * - Invalid value character error is identified by `code: 'ERR_INVALID_CHAR'`.
+ * @param name Header name
+ * @param value Header value
+ * @since v14.3.0
+ */
+ function validateHeaderValue(name: string, value: string): void;
+
+ /**
+ * Set the maximum number of idle HTTP parsers. Default: 1000.
+ * @param count
+ * @since v18.8.0, v16.18.0
+ */
+ function setMaxIdleHTTPParsers(count: number): void;
+
+ let globalAgent: Agent;
+ /**
+ * Read-only property specifying the maximum allowed size of HTTP headers in bytes.
+ * Defaults to 16KB. Configurable using the `--max-http-header-size` CLI option.
+ */
+ const maxHeaderSize: number;
+}
+declare module "node:http" {
+ export * from "http";
+}
diff --git a/client/node_modules/@types/node/ts4.8/http2.d.ts b/client/node_modules/@types/node/ts4.8/http2.d.ts
new file mode 100644
index 0000000..03e92ab
--- /dev/null
+++ b/client/node_modules/@types/node/ts4.8/http2.d.ts
@@ -0,0 +1,2386 @@
+/**
+ * The `http2` module provides an implementation of the [HTTP/2](https://tools.ietf.org/html/rfc7540) protocol. It
+ * can be accessed using:
+ *
+ * ```js
+ * const http2 = require('http2');
+ * ```
+ * @since v8.4.0
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/http2.js)
+ */
+declare module "http2" {
+ import EventEmitter = require("node:events");
+ import * as fs from "node:fs";
+ import * as net from "node:net";
+ import * as stream from "node:stream";
+ import * as tls from "node:tls";
+ import * as url from "node:url";
+ import {
+ IncomingHttpHeaders as Http1IncomingHttpHeaders,
+ IncomingMessage,
+ OutgoingHttpHeaders,
+ ServerResponse,
+ } from "node:http";
+ export { OutgoingHttpHeaders } from "node:http";
+ export interface IncomingHttpStatusHeader {
+ ":status"?: number | undefined;
+ }
+ export interface IncomingHttpHeaders extends Http1IncomingHttpHeaders {
+ ":path"?: string | undefined;
+ ":method"?: string | undefined;
+ ":authority"?: string | undefined;
+ ":scheme"?: string | undefined;
+ }
+ // Http2Stream
+ export interface StreamPriorityOptions {
+ exclusive?: boolean | undefined;
+ parent?: number | undefined;
+ weight?: number | undefined;
+ silent?: boolean | undefined;
+ }
+ export interface StreamState {
+ localWindowSize?: number | undefined;
+ state?: number | undefined;
+ localClose?: number | undefined;
+ remoteClose?: number | undefined;
+ sumDependencyWeight?: number | undefined;
+ weight?: number | undefined;
+ }
+ export interface ServerStreamResponseOptions {
+ endStream?: boolean | undefined;
+ waitForTrailers?: boolean | undefined;
+ }
+ export interface StatOptions {
+ offset: number;
+ length: number;
+ }
+ export interface ServerStreamFileResponseOptions {
+ // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
+ statCheck?(stats: fs.Stats, headers: OutgoingHttpHeaders, statOptions: StatOptions): void | boolean;
+ waitForTrailers?: boolean | undefined;
+ offset?: number | undefined;
+ length?: number | undefined;
+ }
+ export interface ServerStreamFileResponseOptionsWithError extends ServerStreamFileResponseOptions {
+ onError?(err: NodeJS.ErrnoException): void;
+ }
+ export interface Http2Stream extends stream.Duplex {
+ /**
+ * Set to `true` if the `Http2Stream` instance was aborted abnormally. When set,
+ * the `'aborted'` event will have been emitted.
+ * @since v8.4.0
+ */
+ readonly aborted: boolean;
+ /**
+ * This property shows the number of characters currently buffered to be written.
+ * See `net.Socket.bufferSize` for details.
+ * @since v11.2.0, v10.16.0
+ */
+ readonly bufferSize: number;
+ /**
+ * Set to `true` if the `Http2Stream` instance has been closed.
+ * @since v9.4.0
+ */
+ readonly closed: boolean;
+ /**
+ * Set to `true` if the `Http2Stream` instance has been destroyed and is no longer
+ * usable.
+ * @since v8.4.0
+ */
+ readonly destroyed: boolean;
+ /**
+ * Set to `true` if the `END_STREAM` flag was set in the request or response
+ * HEADERS frame received, indicating that no additional data should be received
+ * and the readable side of the `Http2Stream` will be closed.
+ * @since v10.11.0
+ */
+ readonly endAfterHeaders: boolean;
+ /**
+ * The numeric stream identifier of this `Http2Stream` instance. Set to `undefined`if the stream identifier has not yet been assigned.
+ * @since v8.4.0
+ */
+ readonly id?: number | undefined;
+ /**
+ * Set to `true` if the `Http2Stream` instance has not yet been assigned a
+ * numeric stream identifier.
+ * @since v9.4.0
+ */
+ readonly pending: boolean;
+ /**
+ * Set to the `RST_STREAM` `error code` reported when the `Http2Stream` is
+ * destroyed after either receiving an `RST_STREAM` frame from the connected peer,
+ * calling `http2stream.close()`, or `http2stream.destroy()`. Will be`undefined` if the `Http2Stream` has not been closed.
+ * @since v8.4.0
+ */
+ readonly rstCode: number;
+ /**
+ * An object containing the outbound headers sent for this `Http2Stream`.
+ * @since v9.5.0
+ */
+ readonly sentHeaders: OutgoingHttpHeaders;
+ /**
+ * An array of objects containing the outbound informational (additional) headers
+ * sent for this `Http2Stream`.
+ * @since v9.5.0
+ */
+ readonly sentInfoHeaders?: OutgoingHttpHeaders[] | undefined;
+ /**
+ * An object containing the outbound trailers sent for this `HttpStream`.
+ * @since v9.5.0
+ */
+ readonly sentTrailers?: OutgoingHttpHeaders | undefined;
+ /**
+ * A reference to the `Http2Session` instance that owns this `Http2Stream`. The
+ * value will be `undefined` after the `Http2Stream` instance is destroyed.
+ * @since v8.4.0
+ */
+ readonly session: Http2Session | undefined;
+ /**
+ * Provides miscellaneous information about the current state of the`Http2Stream`.
+ *
+ * A current state of this `Http2Stream`.
+ * @since v8.4.0
+ */
+ readonly state: StreamState;
+ /**
+ * Closes the `Http2Stream` instance by sending an `RST_STREAM` frame to the
+ * connected HTTP/2 peer.
+ * @since v8.4.0
+ * @param [code=http2.constants.NGHTTP2_NO_ERROR] Unsigned 32-bit integer identifying the error code.
+ * @param callback An optional function registered to listen for the `'close'` event.
+ */
+ close(code?: number, callback?: () => void): void;
+ /**
+ * Updates the priority for this `Http2Stream` instance.
+ * @since v8.4.0
+ */
+ priority(options: StreamPriorityOptions): void;
+ /**
+ * ```js
+ * const http2 = require('http2');
+ * const client = http2.connect('http://example.org:8000');
+ * const { NGHTTP2_CANCEL } = http2.constants;
+ * const req = client.request({ ':path': '/' });
+ *
+ * // Cancel the stream if there's no activity after 5 seconds
+ * req.setTimeout(5000, () => req.close(NGHTTP2_CANCEL));
+ * ```
+ * @since v8.4.0
+ */
+ setTimeout(msecs: number, callback?: () => void): void;
+ /**
+ * Sends a trailing `HEADERS` frame to the connected HTTP/2 peer. This method
+ * will cause the `Http2Stream` to be immediately closed and must only be
+ * called after the `'wantTrailers'` event has been emitted. When sending a
+ * request or sending a response, the `options.waitForTrailers` option must be set
+ * in order to keep the `Http2Stream` open after the final `DATA` frame so that
+ * trailers can be sent.
+ *
+ * ```js
+ * const http2 = require('http2');
+ * const server = http2.createServer();
+ * server.on('stream', (stream) => {
+ * stream.respond(undefined, { waitForTrailers: true });
+ * stream.on('wantTrailers', () => {
+ * stream.sendTrailers({ xyz: 'abc' });
+ * });
+ * stream.end('Hello World');
+ * });
+ * ```
+ *
+ * The HTTP/1 specification forbids trailers from containing HTTP/2 pseudo-header
+ * fields (e.g. `':method'`, `':path'`, etc).
+ * @since v10.0.0
+ */
+ sendTrailers(headers: OutgoingHttpHeaders): void;
+ addListener(event: "aborted", listener: () => void): this;
+ addListener(event: "close", listener: () => void): this;
+ addListener(event: "data", listener: (chunk: Buffer | string) => void): this;
+ addListener(event: "drain", listener: () => void): this;
+ addListener(event: "end", listener: () => void): this;
+ addListener(event: "error", listener: (err: Error) => void): this;
+ addListener(event: "finish", listener: () => void): this;
+ addListener(event: "frameError", listener: (frameType: number, errorCode: number) => void): this;
+ addListener(event: "pipe", listener: (src: stream.Readable) => void): this;
+ addListener(event: "unpipe", listener: (src: stream.Readable) => void): this;
+ addListener(event: "streamClosed", listener: (code: number) => void): this;
+ addListener(event: "timeout", listener: () => void): this;
+ addListener(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this;
+ addListener(event: "wantTrailers", listener: () => void): this;
+ addListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ emit(event: "aborted"): boolean;
+ emit(event: "close"): boolean;
+ emit(event: "data", chunk: Buffer | string): boolean;
+ emit(event: "drain"): boolean;
+ emit(event: "end"): boolean;
+ emit(event: "error", err: Error): boolean;
+ emit(event: "finish"): boolean;
+ emit(event: "frameError", frameType: number, errorCode: number): boolean;
+ emit(event: "pipe", src: stream.Readable): boolean;
+ emit(event: "unpipe", src: stream.Readable): boolean;
+ emit(event: "streamClosed", code: number): boolean;
+ emit(event: "timeout"): boolean;
+ emit(event: "trailers", trailers: IncomingHttpHeaders, flags: number): boolean;
+ emit(event: "wantTrailers"): boolean;
+ emit(event: string | symbol, ...args: any[]): boolean;
+ on(event: "aborted", listener: () => void): this;
+ on(event: "close", listener: () => void): this;
+ on(event: "data", listener: (chunk: Buffer | string) => void): this;
+ on(event: "drain", listener: () => void): this;
+ on(event: "end", listener: () => void): this;
+ on(event: "error", listener: (err: Error) => void): this;
+ on(event: "finish", listener: () => void): this;
+ on(event: "frameError", listener: (frameType: number, errorCode: number) => void): this;
+ on(event: "pipe", listener: (src: stream.Readable) => void): this;
+ on(event: "unpipe", listener: (src: stream.Readable) => void): this;
+ on(event: "streamClosed", listener: (code: number) => void): this;
+ on(event: "timeout", listener: () => void): this;
+ on(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this;
+ on(event: "wantTrailers", listener: () => void): this;
+ on(event: string | symbol, listener: (...args: any[]) => void): this;
+ once(event: "aborted", listener: () => void): this;
+ once(event: "close", listener: () => void): this;
+ once(event: "data", listener: (chunk: Buffer | string) => void): this;
+ once(event: "drain", listener: () => void): this;
+ once(event: "end", listener: () => void): this;
+ once(event: "error", listener: (err: Error) => void): this;
+ once(event: "finish", listener: () => void): this;
+ once(event: "frameError", listener: (frameType: number, errorCode: number) => void): this;
+ once(event: "pipe", listener: (src: stream.Readable) => void): this;
+ once(event: "unpipe", listener: (src: stream.Readable) => void): this;
+ once(event: "streamClosed", listener: (code: number) => void): this;
+ once(event: "timeout", listener: () => void): this;
+ once(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this;
+ once(event: "wantTrailers", listener: () => void): this;
+ once(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependListener(event: "aborted", listener: () => void): this;
+ prependListener(event: "close", listener: () => void): this;
+ prependListener(event: "data", listener: (chunk: Buffer | string) => void): this;
+ prependListener(event: "drain", listener: () => void): this;
+ prependListener(event: "end", listener: () => void): this;
+ prependListener(event: "error", listener: (err: Error) => void): this;
+ prependListener(event: "finish", listener: () => void): this;
+ prependListener(event: "frameError", listener: (frameType: number, errorCode: number) => void): this;
+ prependListener(event: "pipe", listener: (src: stream.Readable) => void): this;
+ prependListener(event: "unpipe", listener: (src: stream.Readable) => void): this;
+ prependListener(event: "streamClosed", listener: (code: number) => void): this;
+ prependListener(event: "timeout", listener: () => void): this;
+ prependListener(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this;
+ prependListener(event: "wantTrailers", listener: () => void): this;
+ prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependOnceListener(event: "aborted", listener: () => void): this;
+ prependOnceListener(event: "close", listener: () => void): this;
+ prependOnceListener(event: "data", listener: (chunk: Buffer | string) => void): this;
+ prependOnceListener(event: "drain", listener: () => void): this;
+ prependOnceListener(event: "end", listener: () => void): this;
+ prependOnceListener(event: "error", listener: (err: Error) => void): this;
+ prependOnceListener(event: "finish", listener: () => void): this;
+ prependOnceListener(event: "frameError", listener: (frameType: number, errorCode: number) => void): this;
+ prependOnceListener(event: "pipe", listener: (src: stream.Readable) => void): this;
+ prependOnceListener(event: "unpipe", listener: (src: stream.Readable) => void): this;
+ prependOnceListener(event: "streamClosed", listener: (code: number) => void): this;
+ prependOnceListener(event: "timeout", listener: () => void): this;
+ prependOnceListener(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this;
+ prependOnceListener(event: "wantTrailers", listener: () => void): this;
+ prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ }
+ export interface ClientHttp2Stream extends Http2Stream {
+ addListener(event: "continue", listener: () => {}): this;
+ addListener(
+ event: "headers",
+ listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void,
+ ): this;
+ addListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
+ addListener(
+ event: "response",
+ listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void,
+ ): this;
+ addListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ emit(event: "continue"): boolean;
+ emit(event: "headers", headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean;
+ emit(event: "push", headers: IncomingHttpHeaders, flags: number): boolean;
+ emit(event: "response", headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean;
+ emit(event: string | symbol, ...args: any[]): boolean;
+ on(event: "continue", listener: () => {}): this;
+ on(
+ event: "headers",
+ listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void,
+ ): this;
+ on(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
+ on(
+ event: "response",
+ listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void,
+ ): this;
+ on(event: string | symbol, listener: (...args: any[]) => void): this;
+ once(event: "continue", listener: () => {}): this;
+ once(
+ event: "headers",
+ listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void,
+ ): this;
+ once(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
+ once(
+ event: "response",
+ listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void,
+ ): this;
+ once(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependListener(event: "continue", listener: () => {}): this;
+ prependListener(
+ event: "headers",
+ listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void,
+ ): this;
+ prependListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
+ prependListener(
+ event: "response",
+ listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void,
+ ): this;
+ prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependOnceListener(event: "continue", listener: () => {}): this;
+ prependOnceListener(
+ event: "headers",
+ listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void,
+ ): this;
+ prependOnceListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
+ prependOnceListener(
+ event: "response",
+ listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void,
+ ): this;
+ prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ }
+ export interface ServerHttp2Stream extends Http2Stream {
+ /**
+ * True if headers were sent, false otherwise (read-only).
+ * @since v8.4.0
+ */
+ readonly headersSent: boolean;
+ /**
+ * Read-only property mapped to the `SETTINGS_ENABLE_PUSH` flag of the remote
+ * client's most recent `SETTINGS` frame. Will be `true` if the remote peer
+ * accepts push streams, `false` otherwise. Settings are the same for every`Http2Stream` in the same `Http2Session`.
+ * @since v8.4.0
+ */
+ readonly pushAllowed: boolean;
+ /**
+ * Sends an additional informational `HEADERS` frame to the connected HTTP/2 peer.
+ * @since v8.4.0
+ */
+ additionalHeaders(headers: OutgoingHttpHeaders): void;
+ /**
+ * Initiates a push stream. The callback is invoked with the new `Http2Stream`instance created for the push stream passed as the second argument, or an`Error` passed as the first argument.
+ *
+ * ```js
+ * const http2 = require('http2');
+ * const server = http2.createServer();
+ * server.on('stream', (stream) => {
+ * stream.respond({ ':status': 200 });
+ * stream.pushStream({ ':path': '/' }, (err, pushStream, headers) => {
+ * if (err) throw err;
+ * pushStream.respond({ ':status': 200 });
+ * pushStream.end('some pushed data');
+ * });
+ * stream.end('some data');
+ * });
+ * ```
+ *
+ * Setting the weight of a push stream is not allowed in the `HEADERS` frame. Pass
+ * a `weight` value to `http2stream.priority` with the `silent` option set to`true` to enable server-side bandwidth balancing between concurrent streams.
+ *
+ * Calling `http2stream.pushStream()` from within a pushed stream is not permitted
+ * and will throw an error.
+ * @since v8.4.0
+ * @param callback Callback that is called once the push stream has been initiated.
+ */
+ pushStream(
+ headers: OutgoingHttpHeaders,
+ callback?: (err: Error | null, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) => void,
+ ): void;
+ pushStream(
+ headers: OutgoingHttpHeaders,
+ options?: StreamPriorityOptions,
+ callback?: (err: Error | null, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) => void,
+ ): void;
+ /**
+ * ```js
+ * const http2 = require('http2');
+ * const server = http2.createServer();
+ * server.on('stream', (stream) => {
+ * stream.respond({ ':status': 200 });
+ * stream.end('some data');
+ * });
+ * ```
+ *
+ * When the `options.waitForTrailers` option is set, the `'wantTrailers'` event
+ * will be emitted immediately after queuing the last chunk of payload data to be
+ * sent. The `http2stream.sendTrailers()` method can then be used to sent trailing
+ * header fields to the peer.
+ *
+ * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically
+ * close when the final `DATA` frame is transmitted. User code must call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`.
+ *
+ * ```js
+ * const http2 = require('http2');
+ * const server = http2.createServer();
+ * server.on('stream', (stream) => {
+ * stream.respond({ ':status': 200 }, { waitForTrailers: true });
+ * stream.on('wantTrailers', () => {
+ * stream.sendTrailers({ ABC: 'some value to send' });
+ * });
+ * stream.end('some data');
+ * });
+ * ```
+ * @since v8.4.0
+ */
+ respond(headers?: OutgoingHttpHeaders, options?: ServerStreamResponseOptions): void;
+ /**
+ * Initiates a response whose data is read from the given file descriptor. No
+ * validation is performed on the given file descriptor. If an error occurs while
+ * attempting to read data using the file descriptor, the `Http2Stream` will be
+ * closed using an `RST_STREAM` frame using the standard `INTERNAL_ERROR` code.
+ *
+ * When used, the `Http2Stream` object's `Duplex` interface will be closed
+ * automatically.
+ *
+ * ```js
+ * const http2 = require('http2');
+ * const fs = require('fs');
+ *
+ * const server = http2.createServer();
+ * server.on('stream', (stream) => {
+ * const fd = fs.openSync('/some/file', 'r');
+ *
+ * const stat = fs.fstatSync(fd);
+ * const headers = {
+ * 'content-length': stat.size,
+ * 'last-modified': stat.mtime.toUTCString(),
+ * 'content-type': 'text/plain; charset=utf-8'
+ * };
+ * stream.respondWithFD(fd, headers);
+ * stream.on('close', () => fs.closeSync(fd));
+ * });
+ * ```
+ *
+ * The optional `options.statCheck` function may be specified to give user code
+ * an opportunity to set additional content headers based on the `fs.Stat` details
+ * of the given fd. If the `statCheck` function is provided, the`http2stream.respondWithFD()` method will perform an `fs.fstat()` call to
+ * collect details on the provided file descriptor.
+ *
+ * The `offset` and `length` options may be used to limit the response to a
+ * specific range subset. This can be used, for instance, to support HTTP Range
+ * requests.
+ *
+ * The file descriptor or `FileHandle` is not closed when the stream is closed,
+ * so it will need to be closed manually once it is no longer needed.
+ * Using the same file descriptor concurrently for multiple streams
+ * is not supported and may result in data loss. Re-using a file descriptor
+ * after a stream has finished is supported.
+ *
+ * When the `options.waitForTrailers` option is set, the `'wantTrailers'` event
+ * will be emitted immediately after queuing the last chunk of payload data to be
+ * sent. The `http2stream.sendTrailers()` method can then be used to sent trailing
+ * header fields to the peer.
+ *
+ * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically
+ * close when the final `DATA` frame is transmitted. User code _must_ call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`.
+ *
+ * ```js
+ * const http2 = require('http2');
+ * const fs = require('fs');
+ *
+ * const server = http2.createServer();
+ * server.on('stream', (stream) => {
+ * const fd = fs.openSync('/some/file', 'r');
+ *
+ * const stat = fs.fstatSync(fd);
+ * const headers = {
+ * 'content-length': stat.size,
+ * 'last-modified': stat.mtime.toUTCString(),
+ * 'content-type': 'text/plain; charset=utf-8'
+ * };
+ * stream.respondWithFD(fd, headers, { waitForTrailers: true });
+ * stream.on('wantTrailers', () => {
+ * stream.sendTrailers({ ABC: 'some value to send' });
+ * });
+ *
+ * stream.on('close', () => fs.closeSync(fd));
+ * });
+ * ```
+ * @since v8.4.0
+ * @param fd A readable file descriptor.
+ */
+ respondWithFD(
+ fd: number | fs.promises.FileHandle,
+ headers?: OutgoingHttpHeaders,
+ options?: ServerStreamFileResponseOptions,
+ ): void;
+ /**
+ * Sends a regular file as the response. The `path` must specify a regular file
+ * or an `'error'` event will be emitted on the `Http2Stream` object.
+ *
+ * When used, the `Http2Stream` object's `Duplex` interface will be closed
+ * automatically.
+ *
+ * The optional `options.statCheck` function may be specified to give user code
+ * an opportunity to set additional content headers based on the `fs.Stat` details
+ * of the given file:
+ *
+ * If an error occurs while attempting to read the file data, the `Http2Stream`will be closed using an `RST_STREAM` frame using the standard `INTERNAL_ERROR`code. If the `onError` callback is
+ * defined, then it will be called. Otherwise
+ * the stream will be destroyed.
+ *
+ * Example using a file path:
+ *
+ * ```js
+ * const http2 = require('http2');
+ * const server = http2.createServer();
+ * server.on('stream', (stream) => {
+ * function statCheck(stat, headers) {
+ * headers['last-modified'] = stat.mtime.toUTCString();
+ * }
+ *
+ * function onError(err) {
+ * // stream.respond() can throw if the stream has been destroyed by
+ * // the other side.
+ * try {
+ * if (err.code === 'ENOENT') {
+ * stream.respond({ ':status': 404 });
+ * } else {
+ * stream.respond({ ':status': 500 });
+ * }
+ * } catch (err) {
+ * // Perform actual error handling.
+ * console.log(err);
+ * }
+ * stream.end();
+ * }
+ *
+ * stream.respondWithFile('/some/file',
+ * { 'content-type': 'text/plain; charset=utf-8' },
+ * { statCheck, onError });
+ * });
+ * ```
+ *
+ * The `options.statCheck` function may also be used to cancel the send operation
+ * by returning `false`. For instance, a conditional request may check the stat
+ * results to determine if the file has been modified to return an appropriate`304` response:
+ *
+ * ```js
+ * const http2 = require('http2');
+ * const server = http2.createServer();
+ * server.on('stream', (stream) => {
+ * function statCheck(stat, headers) {
+ * // Check the stat here...
+ * stream.respond({ ':status': 304 });
+ * return false; // Cancel the send operation
+ * }
+ * stream.respondWithFile('/some/file',
+ * { 'content-type': 'text/plain; charset=utf-8' },
+ * { statCheck });
+ * });
+ * ```
+ *
+ * The `content-length` header field will be automatically set.
+ *
+ * The `offset` and `length` options may be used to limit the response to a
+ * specific range subset. This can be used, for instance, to support HTTP Range
+ * requests.
+ *
+ * The `options.onError` function may also be used to handle all the errors
+ * that could happen before the delivery of the file is initiated. The
+ * default behavior is to destroy the stream.
+ *
+ * When the `options.waitForTrailers` option is set, the `'wantTrailers'` event
+ * will be emitted immediately after queuing the last chunk of payload data to be
+ * sent. The `http2stream.sendTrailers()` method can then be used to sent trailing
+ * header fields to the peer.
+ *
+ * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically
+ * close when the final `DATA` frame is transmitted. User code must call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`.
+ *
+ * ```js
+ * const http2 = require('http2');
+ * const server = http2.createServer();
+ * server.on('stream', (stream) => {
+ * stream.respondWithFile('/some/file',
+ * { 'content-type': 'text/plain; charset=utf-8' },
+ * { waitForTrailers: true });
+ * stream.on('wantTrailers', () => {
+ * stream.sendTrailers({ ABC: 'some value to send' });
+ * });
+ * });
+ * ```
+ * @since v8.4.0
+ */
+ respondWithFile(
+ path: string,
+ headers?: OutgoingHttpHeaders,
+ options?: ServerStreamFileResponseOptionsWithError,
+ ): void;
+ }
+ // Http2Session
+ export interface Settings {
+ headerTableSize?: number | undefined;
+ enablePush?: boolean | undefined;
+ initialWindowSize?: number | undefined;
+ maxFrameSize?: number | undefined;
+ maxConcurrentStreams?: number | undefined;
+ maxHeaderListSize?: number | undefined;
+ enableConnectProtocol?: boolean | undefined;
+ }
+ export interface ClientSessionRequestOptions {
+ endStream?: boolean | undefined;
+ exclusive?: boolean | undefined;
+ parent?: number | undefined;
+ weight?: number | undefined;
+ waitForTrailers?: boolean | undefined;
+ signal?: AbortSignal | undefined;
+ }
+ export interface SessionState {
+ effectiveLocalWindowSize?: number | undefined;
+ effectiveRecvDataLength?: number | undefined;
+ nextStreamID?: number | undefined;
+ localWindowSize?: number | undefined;
+ lastProcStreamID?: number | undefined;
+ remoteWindowSize?: number | undefined;
+ outboundQueueSize?: number | undefined;
+ deflateDynamicTableSize?: number | undefined;
+ inflateDynamicTableSize?: number | undefined;
+ }
+ export interface Http2Session extends EventEmitter {
+ /**
+ * Value will be `undefined` if the `Http2Session` is not yet connected to a
+ * socket, `h2c` if the `Http2Session` is not connected to a `TLSSocket`, or
+ * will return the value of the connected `TLSSocket`'s own `alpnProtocol`property.
+ * @since v9.4.0
+ */
+ readonly alpnProtocol?: string | undefined;
+ /**
+ * Will be `true` if this `Http2Session` instance has been closed, otherwise`false`.
+ * @since v9.4.0
+ */
+ readonly closed: boolean;
+ /**
+ * Will be `true` if this `Http2Session` instance is still connecting, will be set
+ * to `false` before emitting `connect` event and/or calling the `http2.connect`callback.
+ * @since v10.0.0
+ */
+ readonly connecting: boolean;
+ /**
+ * Will be `true` if this `Http2Session` instance has been destroyed and must no
+ * longer be used, otherwise `false`.
+ * @since v8.4.0
+ */
+ readonly destroyed: boolean;
+ /**
+ * Value is `undefined` if the `Http2Session` session socket has not yet been
+ * connected, `true` if the `Http2Session` is connected with a `TLSSocket`,
+ * and `false` if the `Http2Session` is connected to any other kind of socket
+ * or stream.
+ * @since v9.4.0
+ */
+ readonly encrypted?: boolean | undefined;
+ /**
+ * A prototype-less object describing the current local settings of this`Http2Session`. The local settings are local to _this_`Http2Session` instance.
+ * @since v8.4.0
+ */
+ readonly localSettings: Settings;
+ /**
+ * If the `Http2Session` is connected to a `TLSSocket`, the `originSet` property
+ * will return an `Array` of origins for which the `Http2Session` may be
+ * considered authoritative.
+ *
+ * The `originSet` property is only available when using a secure TLS connection.
+ * @since v9.4.0
+ */
+ readonly originSet?: string[] | undefined;
+ /**
+ * Indicates whether the `Http2Session` is currently waiting for acknowledgment of
+ * a sent `SETTINGS` frame. Will be `true` after calling the`http2session.settings()` method. Will be `false` once all sent `SETTINGS`frames have been acknowledged.
+ * @since v8.4.0
+ */
+ readonly pendingSettingsAck: boolean;
+ /**
+ * A prototype-less object describing the current remote settings of this`Http2Session`. The remote settings are set by the _connected_ HTTP/2 peer.
+ * @since v8.4.0
+ */
+ readonly remoteSettings: Settings;
+ /**
+ * Returns a `Proxy` object that acts as a `net.Socket` (or `tls.TLSSocket`) but
+ * limits available methods to ones safe to use with HTTP/2.
+ *
+ * `destroy`, `emit`, `end`, `pause`, `read`, `resume`, and `write` will throw
+ * an error with code `ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for more information.
+ *
+ * `setTimeout` method will be called on this `Http2Session`.
+ *
+ * All other interactions will be routed directly to the socket.
+ * @since v8.4.0
+ */
+ readonly socket: net.Socket | tls.TLSSocket;
+ /**
+ * Provides miscellaneous information about the current state of the`Http2Session`.
+ *
+ * An object describing the current status of this `Http2Session`.
+ * @since v8.4.0
+ */
+ readonly state: SessionState;
+ /**
+ * The `http2session.type` will be equal to`http2.constants.NGHTTP2_SESSION_SERVER` if this `Http2Session` instance is a
+ * server, and `http2.constants.NGHTTP2_SESSION_CLIENT` if the instance is a
+ * client.
+ * @since v8.4.0
+ */
+ readonly type: number;
+ /**
+ * Gracefully closes the `Http2Session`, allowing any existing streams to
+ * complete on their own and preventing new `Http2Stream` instances from being
+ * created. Once closed, `http2session.destroy()`_might_ be called if there
+ * are no open `Http2Stream` instances.
+ *
+ * If specified, the `callback` function is registered as a handler for the`'close'` event.
+ * @since v9.4.0
+ */
+ close(callback?: () => void): void;
+ /**
+ * Immediately terminates the `Http2Session` and the associated `net.Socket` or`tls.TLSSocket`.
+ *
+ * Once destroyed, the `Http2Session` will emit the `'close'` event. If `error`is not undefined, an `'error'` event will be emitted immediately before the`'close'` event.
+ *
+ * If there are any remaining open `Http2Streams` associated with the`Http2Session`, those will also be destroyed.
+ * @since v8.4.0
+ * @param error An `Error` object if the `Http2Session` is being destroyed due to an error.
+ * @param code The HTTP/2 error code to send in the final `GOAWAY` frame. If unspecified, and `error` is not undefined, the default is `INTERNAL_ERROR`, otherwise defaults to `NO_ERROR`.
+ */
+ destroy(error?: Error, code?: number): void;
+ /**
+ * Transmits a `GOAWAY` frame to the connected peer _without_ shutting down the`Http2Session`.
+ * @since v9.4.0
+ * @param code An HTTP/2 error code
+ * @param lastStreamID The numeric ID of the last processed `Http2Stream`
+ * @param opaqueData A `TypedArray` or `DataView` instance containing additional data to be carried within the `GOAWAY` frame.
+ */
+ goaway(code?: number, lastStreamID?: number, opaqueData?: NodeJS.ArrayBufferView): void;
+ /**
+ * Sends a `PING` frame to the connected HTTP/2 peer. A `callback` function must
+ * be provided. The method will return `true` if the `PING` was sent, `false`otherwise.
+ *
+ * The maximum number of outstanding (unacknowledged) pings is determined by the`maxOutstandingPings` configuration option. The default maximum is 10.
+ *
+ * If provided, the `payload` must be a `Buffer`, `TypedArray`, or `DataView`containing 8 bytes of data that will be transmitted with the `PING` and
+ * returned with the ping acknowledgment.
+ *
+ * The callback will be invoked with three arguments: an error argument that will
+ * be `null` if the `PING` was successfully acknowledged, a `duration` argument
+ * that reports the number of milliseconds elapsed since the ping was sent and the
+ * acknowledgment was received, and a `Buffer` containing the 8-byte `PING`payload.
+ *
+ * ```js
+ * session.ping(Buffer.from('abcdefgh'), (err, duration, payload) => {
+ * if (!err) {
+ * console.log(`Ping acknowledged in ${duration} milliseconds`);
+ * console.log(`With payload '${payload.toString()}'`);
+ * }
+ * });
+ * ```
+ *
+ * If the `payload` argument is not specified, the default payload will be the
+ * 64-bit timestamp (little endian) marking the start of the `PING` duration.
+ * @since v8.9.3
+ * @param payload Optional ping payload.
+ */
+ ping(callback: (err: Error | null, duration: number, payload: Buffer) => void): boolean;
+ ping(
+ payload: NodeJS.ArrayBufferView,
+ callback: (err: Error | null, duration: number, payload: Buffer) => void,
+ ): boolean;
+ /**
+ * Calls `ref()` on this `Http2Session`instance's underlying `net.Socket`.
+ * @since v9.4.0
+ */
+ ref(): void;
+ /**
+ * Sets the local endpoint's window size.
+ * The `windowSize` is the total window size to set, not
+ * the delta.
+ *
+ * ```js
+ * const http2 = require('http2');
+ *
+ * const server = http2.createServer();
+ * const expectedWindowSize = 2 ** 20;
+ * server.on('connect', (session) => {
+ *
+ * // Set local window size to be 2 ** 20
+ * session.setLocalWindowSize(expectedWindowSize);
+ * });
+ * ```
+ * @since v15.3.0, v14.18.0
+ */
+ setLocalWindowSize(windowSize: number): void;
+ /**
+ * Used to set a callback function that is called when there is no activity on
+ * the `Http2Session` after `msecs` milliseconds. The given `callback` is
+ * registered as a listener on the `'timeout'` event.
+ * @since v8.4.0
+ */
+ setTimeout(msecs: number, callback?: () => void): void;
+ /**
+ * Updates the current local settings for this `Http2Session` and sends a new`SETTINGS` frame to the connected HTTP/2 peer.
+ *
+ * Once called, the `http2session.pendingSettingsAck` property will be `true`while the session is waiting for the remote peer to acknowledge the new
+ * settings.
+ *
+ * The new settings will not become effective until the `SETTINGS` acknowledgment
+ * is received and the `'localSettings'` event is emitted. It is possible to send
+ * multiple `SETTINGS` frames while acknowledgment is still pending.
+ * @since v8.4.0
+ * @param callback Callback that is called once the session is connected or right away if the session is already connected.
+ */
+ settings(
+ settings: Settings,
+ callback?: (err: Error | null, settings: Settings, duration: number) => void,
+ ): void;
+ /**
+ * Calls `unref()` on this `Http2Session`instance's underlying `net.Socket`.
+ * @since v9.4.0
+ */
+ unref(): void;
+ addListener(event: "close", listener: () => void): this;
+ addListener(event: "error", listener: (err: Error) => void): this;
+ addListener(
+ event: "frameError",
+ listener: (frameType: number, errorCode: number, streamID: number) => void,
+ ): this;
+ addListener(
+ event: "goaway",
+ listener: (errorCode: number, lastStreamID: number, opaqueData?: Buffer) => void,
+ ): this;
+ addListener(event: "localSettings", listener: (settings: Settings) => void): this;
+ addListener(event: "ping", listener: () => void): this;
+ addListener(event: "remoteSettings", listener: (settings: Settings) => void): this;
+ addListener(event: "timeout", listener: () => void): this;
+ addListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ emit(event: "close"): boolean;
+ emit(event: "error", err: Error): boolean;
+ emit(event: "frameError", frameType: number, errorCode: number, streamID: number): boolean;
+ emit(event: "goaway", errorCode: number, lastStreamID: number, opaqueData?: Buffer): boolean;
+ emit(event: "localSettings", settings: Settings): boolean;
+ emit(event: "ping"): boolean;
+ emit(event: "remoteSettings", settings: Settings): boolean;
+ emit(event: "timeout"): boolean;
+ emit(event: string | symbol, ...args: any[]): boolean;
+ on(event: "close", listener: () => void): this;
+ on(event: "error", listener: (err: Error) => void): this;
+ on(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this;
+ on(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData?: Buffer) => void): this;
+ on(event: "localSettings", listener: (settings: Settings) => void): this;
+ on(event: "ping", listener: () => void): this;
+ on(event: "remoteSettings", listener: (settings: Settings) => void): this;
+ on(event: "timeout", listener: () => void): this;
+ on(event: string | symbol, listener: (...args: any[]) => void): this;
+ once(event: "close", listener: () => void): this;
+ once(event: "error", listener: (err: Error) => void): this;
+ once(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this;
+ once(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData?: Buffer) => void): this;
+ once(event: "localSettings", listener: (settings: Settings) => void): this;
+ once(event: "ping", listener: () => void): this;
+ once(event: "remoteSettings", listener: (settings: Settings) => void): this;
+ once(event: "timeout", listener: () => void): this;
+ once(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependListener(event: "close", listener: () => void): this;
+ prependListener(event: "error", listener: (err: Error) => void): this;
+ prependListener(
+ event: "frameError",
+ listener: (frameType: number, errorCode: number, streamID: number) => void,
+ ): this;
+ prependListener(
+ event: "goaway",
+ listener: (errorCode: number, lastStreamID: number, opaqueData?: Buffer) => void,
+ ): this;
+ prependListener(event: "localSettings", listener: (settings: Settings) => void): this;
+ prependListener(event: "ping", listener: () => void): this;
+ prependListener(event: "remoteSettings", listener: (settings: Settings) => void): this;
+ prependListener(event: "timeout", listener: () => void): this;
+ prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependOnceListener(event: "close", listener: () => void): this;
+ prependOnceListener(event: "error", listener: (err: Error) => void): this;
+ prependOnceListener(
+ event: "frameError",
+ listener: (frameType: number, errorCode: number, streamID: number) => void,
+ ): this;
+ prependOnceListener(
+ event: "goaway",
+ listener: (errorCode: number, lastStreamID: number, opaqueData?: Buffer) => void,
+ ): this;
+ prependOnceListener(event: "localSettings", listener: (settings: Settings) => void): this;
+ prependOnceListener(event: "ping", listener: () => void): this;
+ prependOnceListener(event: "remoteSettings", listener: (settings: Settings) => void): this;
+ prependOnceListener(event: "timeout", listener: () => void): this;
+ prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ }
+ export interface ClientHttp2Session extends Http2Session {
+ /**
+ * For HTTP/2 Client `Http2Session` instances only, the `http2session.request()`creates and returns an `Http2Stream` instance that can be used to send an
+ * HTTP/2 request to the connected server.
+ *
+ * When a `ClientHttp2Session` is first created, the socket may not yet be
+ * connected. if `clienthttp2session.request()` is called during this time, the
+ * actual request will be deferred until the socket is ready to go.
+ * If the `session` is closed before the actual request be executed, an`ERR_HTTP2_GOAWAY_SESSION` is thrown.
+ *
+ * This method is only available if `http2session.type` is equal to`http2.constants.NGHTTP2_SESSION_CLIENT`.
+ *
+ * ```js
+ * const http2 = require('http2');
+ * const clientSession = http2.connect('https://localhost:1234');
+ * const {
+ * HTTP2_HEADER_PATH,
+ * HTTP2_HEADER_STATUS
+ * } = http2.constants;
+ *
+ * const req = clientSession.request({ [HTTP2_HEADER_PATH]: '/' });
+ * req.on('response', (headers) => {
+ * console.log(headers[HTTP2_HEADER_STATUS]);
+ * req.on('data', (chunk) => { // .. });
+ * req.on('end', () => { // .. });
+ * });
+ * ```
+ *
+ * When the `options.waitForTrailers` option is set, the `'wantTrailers'` event
+ * is emitted immediately after queuing the last chunk of payload data to be sent.
+ * The `http2stream.sendTrailers()` method can then be called to send trailing
+ * headers to the peer.
+ *
+ * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically
+ * close when the final `DATA` frame is transmitted. User code must call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`.
+ *
+ * When `options.signal` is set with an `AbortSignal` and then `abort` on the
+ * corresponding `AbortController` is called, the request will emit an `'error'`event with an `AbortError` error.
+ *
+ * The `:method` and `:path` pseudo-headers are not specified within `headers`,
+ * they respectively default to:
+ *
+ * * `:method` \= `'GET'`
+ * * `:path` \= `/`
+ * @since v8.4.0
+ */
+ request(headers?: OutgoingHttpHeaders, options?: ClientSessionRequestOptions): ClientHttp2Stream;
+ addListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this;
+ addListener(event: "origin", listener: (origins: string[]) => void): this;
+ addListener(
+ event: "connect",
+ listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void,
+ ): this;
+ addListener(
+ event: "stream",
+ listener: (
+ stream: ClientHttp2Stream,
+ headers: IncomingHttpHeaders & IncomingHttpStatusHeader,
+ flags: number,
+ ) => void,
+ ): this;
+ addListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ emit(event: "altsvc", alt: string, origin: string, stream: number): boolean;
+ emit(event: "origin", origins: readonly string[]): boolean;
+ emit(event: "connect", session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket): boolean;
+ emit(
+ event: "stream",
+ stream: ClientHttp2Stream,
+ headers: IncomingHttpHeaders & IncomingHttpStatusHeader,
+ flags: number,
+ ): boolean;
+ emit(event: string | symbol, ...args: any[]): boolean;
+ on(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this;
+ on(event: "origin", listener: (origins: string[]) => void): this;
+ on(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
+ on(
+ event: "stream",
+ listener: (
+ stream: ClientHttp2Stream,
+ headers: IncomingHttpHeaders & IncomingHttpStatusHeader,
+ flags: number,
+ ) => void,
+ ): this;
+ on(event: string | symbol, listener: (...args: any[]) => void): this;
+ once(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this;
+ once(event: "origin", listener: (origins: string[]) => void): this;
+ once(
+ event: "connect",
+ listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void,
+ ): this;
+ once(
+ event: "stream",
+ listener: (
+ stream: ClientHttp2Stream,
+ headers: IncomingHttpHeaders & IncomingHttpStatusHeader,
+ flags: number,
+ ) => void,
+ ): this;
+ once(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this;
+ prependListener(event: "origin", listener: (origins: string[]) => void): this;
+ prependListener(
+ event: "connect",
+ listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void,
+ ): this;
+ prependListener(
+ event: "stream",
+ listener: (
+ stream: ClientHttp2Stream,
+ headers: IncomingHttpHeaders & IncomingHttpStatusHeader,
+ flags: number,
+ ) => void,
+ ): this;
+ prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependOnceListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this;
+ prependOnceListener(event: "origin", listener: (origins: string[]) => void): this;
+ prependOnceListener(
+ event: "connect",
+ listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void,
+ ): this;
+ prependOnceListener(
+ event: "stream",
+ listener: (
+ stream: ClientHttp2Stream,
+ headers: IncomingHttpHeaders & IncomingHttpStatusHeader,
+ flags: number,
+ ) => void,
+ ): this;
+ prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ }
+ export interface AlternativeServiceOptions {
+ origin: number | string | url.URL;
+ }
+ export interface ServerHttp2Session extends Http2Session {
+ readonly server: Http2Server | Http2SecureServer;
+ /**
+ * Submits an `ALTSVC` frame (as defined by [RFC 7838](https://tools.ietf.org/html/rfc7838)) to the connected client.
+ *
+ * ```js
+ * const http2 = require('http2');
+ *
+ * const server = http2.createServer();
+ * server.on('session', (session) => {
+ * // Set altsvc for origin https://example.org:80
+ * session.altsvc('h2=":8000"', 'https://example.org:80');
+ * });
+ *
+ * server.on('stream', (stream) => {
+ * // Set altsvc for a specific stream
+ * stream.session.altsvc('h2=":8000"', stream.id);
+ * });
+ * ```
+ *
+ * Sending an `ALTSVC` frame with a specific stream ID indicates that the alternate
+ * service is associated with the origin of the given `Http2Stream`.
+ *
+ * The `alt` and origin string _must_ contain only ASCII bytes and are
+ * strictly interpreted as a sequence of ASCII bytes. The special value `'clear'`may be passed to clear any previously set alternative service for a given
+ * domain.
+ *
+ * When a string is passed for the `originOrStream` argument, it will be parsed as
+ * a URL and the origin will be derived. For instance, the origin for the
+ * HTTP URL `'https://example.org/foo/bar'` is the ASCII string`'https://example.org'`. An error will be thrown if either the given string
+ * cannot be parsed as a URL or if a valid origin cannot be derived.
+ *
+ * A `URL` object, or any object with an `origin` property, may be passed as`originOrStream`, in which case the value of the `origin` property will be
+ * used. The value of the `origin` property _must_ be a properly serialized
+ * ASCII origin.
+ * @since v9.4.0
+ * @param alt A description of the alternative service configuration as defined by `RFC 7838`.
+ * @param originOrStream Either a URL string specifying the origin (or an `Object` with an `origin` property) or the numeric identifier of an active `Http2Stream` as given by the
+ * `http2stream.id` property.
+ */
+ altsvc(alt: string, originOrStream: number | string | url.URL | AlternativeServiceOptions): void;
+ /**
+ * Submits an `ORIGIN` frame (as defined by [RFC 8336](https://tools.ietf.org/html/rfc8336)) to the connected client
+ * to advertise the set of origins for which the server is capable of providing
+ * authoritative responses.
+ *
+ * ```js
+ * const http2 = require('http2');
+ * const options = getSecureOptionsSomehow();
+ * const server = http2.createSecureServer(options);
+ * server.on('stream', (stream) => {
+ * stream.respond();
+ * stream.end('ok');
+ * });
+ * server.on('session', (session) => {
+ * session.origin('https://example.com', 'https://example.org');
+ * });
+ * ```
+ *
+ * When a string is passed as an `origin`, it will be parsed as a URL and the
+ * origin will be derived. For instance, the origin for the HTTP URL`'https://example.org/foo/bar'` is the ASCII string`'https://example.org'`. An error will be thrown if either the given
+ * string
+ * cannot be parsed as a URL or if a valid origin cannot be derived.
+ *
+ * A `URL` object, or any object with an `origin` property, may be passed as
+ * an `origin`, in which case the value of the `origin` property will be
+ * used. The value of the `origin` property _must_ be a properly serialized
+ * ASCII origin.
+ *
+ * Alternatively, the `origins` option may be used when creating a new HTTP/2
+ * server using the `http2.createSecureServer()` method:
+ *
+ * ```js
+ * const http2 = require('http2');
+ * const options = getSecureOptionsSomehow();
+ * options.origins = ['https://example.com', 'https://example.org'];
+ * const server = http2.createSecureServer(options);
+ * server.on('stream', (stream) => {
+ * stream.respond();
+ * stream.end('ok');
+ * });
+ * ```
+ * @since v10.12.0
+ * @param origins One or more URL Strings passed as separate arguments.
+ */
+ origin(
+ ...origins: Array<
+ | string
+ | url.URL
+ | {
+ origin: string;
+ }
+ >
+ ): void;
+ addListener(
+ event: "connect",
+ listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void,
+ ): this;
+ addListener(
+ event: "stream",
+ listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void,
+ ): this;
+ addListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ emit(event: "connect", session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket): boolean;
+ emit(event: "stream", stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean;
+ emit(event: string | symbol, ...args: any[]): boolean;
+ on(event: "connect", listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
+ on(
+ event: "stream",
+ listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void,
+ ): this;
+ on(event: string | symbol, listener: (...args: any[]) => void): this;
+ once(
+ event: "connect",
+ listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void,
+ ): this;
+ once(
+ event: "stream",
+ listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void,
+ ): this;
+ once(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependListener(
+ event: "connect",
+ listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void,
+ ): this;
+ prependListener(
+ event: "stream",
+ listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void,
+ ): this;
+ prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependOnceListener(
+ event: "connect",
+ listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void,
+ ): this;
+ prependOnceListener(
+ event: "stream",
+ listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void,
+ ): this;
+ prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ }
+ // Http2Server
+ export interface SessionOptions {
+ maxDeflateDynamicTableSize?: number | undefined;
+ maxSessionMemory?: number | undefined;
+ maxHeaderListPairs?: number | undefined;
+ maxOutstandingPings?: number | undefined;
+ maxSendHeaderBlockLength?: number | undefined;
+ paddingStrategy?: number | undefined;
+ peerMaxConcurrentStreams?: number | undefined;
+ settings?: Settings | undefined;
+ /**
+ * Specifies a timeout in milliseconds that
+ * a server should wait when an [`'unknownProtocol'`][] is emitted. If the
+ * socket has not been destroyed by that time the server will destroy it.
+ * @default 100000
+ */
+ unknownProtocolTimeout?: number | undefined;
+ selectPadding?(frameLen: number, maxFrameLen: number): number;
+ }
+ export interface ClientSessionOptions extends SessionOptions {
+ maxReservedRemoteStreams?: number | undefined;
+ createConnection?: ((authority: url.URL, option: SessionOptions) => stream.Duplex) | undefined;
+ protocol?: "http:" | "https:" | undefined;
+ }
+ export interface ServerSessionOptions extends SessionOptions {
+ Http1IncomingMessage?: typeof IncomingMessage | undefined;
+ Http1ServerResponse?: typeof ServerResponse | undefined;
+ Http2ServerRequest?: typeof Http2ServerRequest | undefined;
+ Http2ServerResponse?: typeof Http2ServerResponse | undefined;
+ }
+ export interface SecureClientSessionOptions extends ClientSessionOptions, tls.ConnectionOptions {}
+ export interface SecureServerSessionOptions extends ServerSessionOptions, tls.TlsOptions {}
+ export interface ServerOptions extends ServerSessionOptions {}
+ export interface SecureServerOptions extends SecureServerSessionOptions {
+ allowHTTP1?: boolean | undefined;
+ origins?: string[] | undefined;
+ }
+ interface HTTP2ServerCommon {
+ setTimeout(msec?: number, callback?: () => void): this;
+ /**
+ * Throws ERR_HTTP2_INVALID_SETTING_VALUE for invalid settings values.
+ * Throws ERR_INVALID_ARG_TYPE for invalid settings argument.
+ */
+ updateSettings(settings: Settings): void;
+ }
+ export interface Http2Server extends net.Server, HTTP2ServerCommon {
+ addListener(
+ event: "checkContinue",
+ listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
+ ): this;
+ addListener(
+ event: "request",
+ listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
+ ): this;
+ addListener(event: "session", listener: (session: ServerHttp2Session) => void): this;
+ addListener(event: "sessionError", listener: (err: Error) => void): this;
+ addListener(
+ event: "stream",
+ listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void,
+ ): this;
+ addListener(event: "timeout", listener: () => void): this;
+ addListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ emit(event: "checkContinue", request: Http2ServerRequest, response: Http2ServerResponse): boolean;
+ emit(event: "request", request: Http2ServerRequest, response: Http2ServerResponse): boolean;
+ emit(event: "session", session: ServerHttp2Session): boolean;
+ emit(event: "sessionError", err: Error): boolean;
+ emit(event: "stream", stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean;
+ emit(event: "timeout"): boolean;
+ emit(event: string | symbol, ...args: any[]): boolean;
+ on(
+ event: "checkContinue",
+ listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
+ ): this;
+ on(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
+ on(event: "session", listener: (session: ServerHttp2Session) => void): this;
+ on(event: "sessionError", listener: (err: Error) => void): this;
+ on(
+ event: "stream",
+ listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void,
+ ): this;
+ on(event: "timeout", listener: () => void): this;
+ on(event: string | symbol, listener: (...args: any[]) => void): this;
+ once(
+ event: "checkContinue",
+ listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
+ ): this;
+ once(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
+ once(event: "session", listener: (session: ServerHttp2Session) => void): this;
+ once(event: "sessionError", listener: (err: Error) => void): this;
+ once(
+ event: "stream",
+ listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void,
+ ): this;
+ once(event: "timeout", listener: () => void): this;
+ once(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependListener(
+ event: "checkContinue",
+ listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
+ ): this;
+ prependListener(
+ event: "request",
+ listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
+ ): this;
+ prependListener(event: "session", listener: (session: ServerHttp2Session) => void): this;
+ prependListener(event: "sessionError", listener: (err: Error) => void): this;
+ prependListener(
+ event: "stream",
+ listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void,
+ ): this;
+ prependListener(event: "timeout", listener: () => void): this;
+ prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependOnceListener(
+ event: "checkContinue",
+ listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
+ ): this;
+ prependOnceListener(
+ event: "request",
+ listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
+ ): this;
+ prependOnceListener(event: "session", listener: (session: ServerHttp2Session) => void): this;
+ prependOnceListener(event: "sessionError", listener: (err: Error) => void): this;
+ prependOnceListener(
+ event: "stream",
+ listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void,
+ ): this;
+ prependOnceListener(event: "timeout", listener: () => void): this;
+ prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ }
+ export interface Http2SecureServer extends tls.Server, HTTP2ServerCommon {
+ addListener(
+ event: "checkContinue",
+ listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
+ ): this;
+ addListener(
+ event: "request",
+ listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
+ ): this;
+ addListener(event: "session", listener: (session: ServerHttp2Session) => void): this;
+ addListener(event: "sessionError", listener: (err: Error) => void): this;
+ addListener(
+ event: "stream",
+ listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void,
+ ): this;
+ addListener(event: "timeout", listener: () => void): this;
+ addListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this;
+ addListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ emit(event: "checkContinue", request: Http2ServerRequest, response: Http2ServerResponse): boolean;
+ emit(event: "request", request: Http2ServerRequest, response: Http2ServerResponse): boolean;
+ emit(event: "session", session: ServerHttp2Session): boolean;
+ emit(event: "sessionError", err: Error): boolean;
+ emit(event: "stream", stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean;
+ emit(event: "timeout"): boolean;
+ emit(event: "unknownProtocol", socket: tls.TLSSocket): boolean;
+ emit(event: string | symbol, ...args: any[]): boolean;
+ on(
+ event: "checkContinue",
+ listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
+ ): this;
+ on(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
+ on(event: "session", listener: (session: ServerHttp2Session) => void): this;
+ on(event: "sessionError", listener: (err: Error) => void): this;
+ on(
+ event: "stream",
+ listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void,
+ ): this;
+ on(event: "timeout", listener: () => void): this;
+ on(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this;
+ on(event: string | symbol, listener: (...args: any[]) => void): this;
+ once(
+ event: "checkContinue",
+ listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
+ ): this;
+ once(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
+ once(event: "session", listener: (session: ServerHttp2Session) => void): this;
+ once(event: "sessionError", listener: (err: Error) => void): this;
+ once(
+ event: "stream",
+ listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void,
+ ): this;
+ once(event: "timeout", listener: () => void): this;
+ once(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this;
+ once(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependListener(
+ event: "checkContinue",
+ listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
+ ): this;
+ prependListener(
+ event: "request",
+ listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
+ ): this;
+ prependListener(event: "session", listener: (session: ServerHttp2Session) => void): this;
+ prependListener(event: "sessionError", listener: (err: Error) => void): this;
+ prependListener(
+ event: "stream",
+ listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void,
+ ): this;
+ prependListener(event: "timeout", listener: () => void): this;
+ prependListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this;
+ prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependOnceListener(
+ event: "checkContinue",
+ listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
+ ): this;
+ prependOnceListener(
+ event: "request",
+ listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
+ ): this;
+ prependOnceListener(event: "session", listener: (session: ServerHttp2Session) => void): this;
+ prependOnceListener(event: "sessionError", listener: (err: Error) => void): this;
+ prependOnceListener(
+ event: "stream",
+ listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void,
+ ): this;
+ prependOnceListener(event: "timeout", listener: () => void): this;
+ prependOnceListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this;
+ prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ }
+ /**
+ * A `Http2ServerRequest` object is created by {@link Server} or {@link SecureServer} and passed as the first argument to the `'request'` event. It may be used to access a request status,
+ * headers, and
+ * data.
+ * @since v8.4.0
+ */
+ export class Http2ServerRequest extends stream.Readable {
+ constructor(
+ stream: ServerHttp2Stream,
+ headers: IncomingHttpHeaders,
+ options: stream.ReadableOptions,
+ rawHeaders: readonly string[],
+ );
+ /**
+ * The `request.aborted` property will be `true` if the request has
+ * been aborted.
+ * @since v10.1.0
+ */
+ readonly aborted: boolean;
+ /**
+ * The request authority pseudo header field. Because HTTP/2 allows requests
+ * to set either `:authority` or `host`, this value is derived from`req.headers[':authority']` if present. Otherwise, it is derived from`req.headers['host']`.
+ * @since v8.4.0
+ */
+ readonly authority: string;
+ /**
+ * See `request.socket`.
+ * @since v8.4.0
+ * @deprecated Since v13.0.0 - Use `socket`.
+ */
+ readonly connection: net.Socket | tls.TLSSocket;
+ /**
+ * The `request.complete` property will be `true` if the request has
+ * been completed, aborted, or destroyed.
+ * @since v12.10.0
+ */
+ readonly complete: boolean;
+ /**
+ * The request/response headers object.
+ *
+ * Key-value pairs of header names and values. Header names are lower-cased.
+ *
+ * ```js
+ * // Prints something like:
+ * //
+ * // { 'user-agent': 'curl/7.22.0',
+ * // host: '127.0.0.1:8000',
+ * // accept: '*' }
+ * console.log(request.headers);
+ * ```
+ *
+ * See `HTTP/2 Headers Object`.
+ *
+ * In HTTP/2, the request path, host name, protocol, and method are represented as
+ * special headers prefixed with the `:` character (e.g. `':path'`). These special
+ * headers will be included in the `request.headers` object. Care must be taken not
+ * to inadvertently modify these special headers or errors may occur. For instance,
+ * removing all headers from the request will cause errors to occur:
+ *
+ * ```js
+ * removeAllHeaders(request.headers);
+ * assert(request.url); // Fails because the :path header has been removed
+ * ```
+ * @since v8.4.0
+ */
+ readonly headers: IncomingHttpHeaders;
+ /**
+ * In case of server request, the HTTP version sent by the client. In the case of
+ * client response, the HTTP version of the connected-to server. Returns`'2.0'`.
+ *
+ * Also `message.httpVersionMajor` is the first integer and`message.httpVersionMinor` is the second.
+ * @since v8.4.0
+ */
+ readonly httpVersion: string;
+ readonly httpVersionMinor: number;
+ readonly httpVersionMajor: number;
+ /**
+ * The request method as a string. Read-only. Examples: `'GET'`, `'DELETE'`.
+ * @since v8.4.0
+ */
+ readonly method: string;
+ /**
+ * The raw request/response headers list exactly as they were received.
+ *
+ * The keys and values are in the same list. It is _not_ a
+ * list of tuples. So, the even-numbered offsets are key values, and the
+ * odd-numbered offsets are the associated values.
+ *
+ * Header names are not lowercased, and duplicates are not merged.
+ *
+ * ```js
+ * // Prints something like:
+ * //
+ * // [ 'user-agent',
+ * // 'this is invalid because there can be only one',
+ * // 'User-Agent',
+ * // 'curl/7.22.0',
+ * // 'Host',
+ * // '127.0.0.1:8000',
+ * // 'ACCEPT',
+ * // '*' ]
+ * console.log(request.rawHeaders);
+ * ```
+ * @since v8.4.0
+ */
+ readonly rawHeaders: string[];
+ /**
+ * The raw request/response trailer keys and values exactly as they were
+ * received. Only populated at the `'end'` event.
+ * @since v8.4.0
+ */
+ readonly rawTrailers: string[];
+ /**
+ * The request scheme pseudo header field indicating the scheme
+ * portion of the target URL.
+ * @since v8.4.0
+ */
+ readonly scheme: string;
+ /**
+ * Returns a `Proxy` object that acts as a `net.Socket` (or `tls.TLSSocket`) but
+ * applies getters, setters, and methods based on HTTP/2 logic.
+ *
+ * `destroyed`, `readable`, and `writable` properties will be retrieved from and
+ * set on `request.stream`.
+ *
+ * `destroy`, `emit`, `end`, `on` and `once` methods will be called on`request.stream`.
+ *
+ * `setTimeout` method will be called on `request.stream.session`.
+ *
+ * `pause`, `read`, `resume`, and `write` will throw an error with code`ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for
+ * more information.
+ *
+ * All other interactions will be routed directly to the socket. With TLS support,
+ * use `request.socket.getPeerCertificate()` to obtain the client's
+ * authentication details.
+ * @since v8.4.0
+ */
+ readonly socket: net.Socket | tls.TLSSocket;
+ /**
+ * The `Http2Stream` object backing the request.
+ * @since v8.4.0
+ */
+ readonly stream: ServerHttp2Stream;
+ /**
+ * The request/response trailers object. Only populated at the `'end'` event.
+ * @since v8.4.0
+ */
+ readonly trailers: IncomingHttpHeaders;
+ /**
+ * Request URL string. This contains only the URL that is present in the actual
+ * HTTP request. If the request is:
+ *
+ * ```http
+ * GET /status?name=ryan HTTP/1.1
+ * Accept: text/plain
+ * ```
+ *
+ * Then `request.url` will be:
+ *
+ * ```js
+ * '/status?name=ryan'
+ * ```
+ *
+ * To parse the url into its parts, `new URL()` can be used:
+ *
+ * ```console
+ * $ node
+ * > new URL('/status?name=ryan', 'http://example.com')
+ * URL {
+ * href: 'http://example.com/status?name=ryan',
+ * origin: 'http://example.com',
+ * protocol: 'http:',
+ * username: '',
+ * password: '',
+ * host: 'example.com',
+ * hostname: 'example.com',
+ * port: '',
+ * pathname: '/status',
+ * search: '?name=ryan',
+ * searchParams: URLSearchParams { 'name' => 'ryan' },
+ * hash: ''
+ * }
+ * ```
+ * @since v8.4.0
+ */
+ url: string;
+ /**
+ * Sets the `Http2Stream`'s timeout value to `msecs`. If a callback is
+ * provided, then it is added as a listener on the `'timeout'` event on
+ * the response object.
+ *
+ * If no `'timeout'` listener is added to the request, the response, or
+ * the server, then `Http2Stream` s are destroyed when they time out. If a
+ * handler is assigned to the request, the response, or the server's `'timeout'`events, timed out sockets must be handled explicitly.
+ * @since v8.4.0
+ */
+ setTimeout(msecs: number, callback?: () => void): void;
+ read(size?: number): Buffer | string | null;
+ addListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this;
+ addListener(event: "close", listener: () => void): this;
+ addListener(event: "data", listener: (chunk: Buffer | string) => void): this;
+ addListener(event: "end", listener: () => void): this;
+ addListener(event: "readable", listener: () => void): this;
+ addListener(event: "error", listener: (err: Error) => void): this;
+ addListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ emit(event: "aborted", hadError: boolean, code: number): boolean;
+ emit(event: "close"): boolean;
+ emit(event: "data", chunk: Buffer | string): boolean;
+ emit(event: "end"): boolean;
+ emit(event: "readable"): boolean;
+ emit(event: "error", err: Error): boolean;
+ emit(event: string | symbol, ...args: any[]): boolean;
+ on(event: "aborted", listener: (hadError: boolean, code: number) => void): this;
+ on(event: "close", listener: () => void): this;
+ on(event: "data", listener: (chunk: Buffer | string) => void): this;
+ on(event: "end", listener: () => void): this;
+ on(event: "readable", listener: () => void): this;
+ on(event: "error", listener: (err: Error) => void): this;
+ on(event: string | symbol, listener: (...args: any[]) => void): this;
+ once(event: "aborted", listener: (hadError: boolean, code: number) => void): this;
+ once(event: "close", listener: () => void): this;
+ once(event: "data", listener: (chunk: Buffer | string) => void): this;
+ once(event: "end", listener: () => void): this;
+ once(event: "readable", listener: () => void): this;
+ once(event: "error", listener: (err: Error) => void): this;
+ once(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this;
+ prependListener(event: "close", listener: () => void): this;
+ prependListener(event: "data", listener: (chunk: Buffer | string) => void): this;
+ prependListener(event: "end", listener: () => void): this;
+ prependListener(event: "readable", listener: () => void): this;
+ prependListener(event: "error", listener: (err: Error) => void): this;
+ prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependOnceListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this;
+ prependOnceListener(event: "close", listener: () => void): this;
+ prependOnceListener(event: "data", listener: (chunk: Buffer | string) => void): this;
+ prependOnceListener(event: "end", listener: () => void): this;
+ prependOnceListener(event: "readable", listener: () => void): this;
+ prependOnceListener(event: "error", listener: (err: Error) => void): this;
+ prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ }
+ /**
+ * This object is created internally by an HTTP server, not by the user. It is
+ * passed as the second parameter to the `'request'` event.
+ * @since v8.4.0
+ */
+ export class Http2ServerResponse extends stream.Writable {
+ constructor(stream: ServerHttp2Stream);
+ /**
+ * See `response.socket`.
+ * @since v8.4.0
+ * @deprecated Since v13.0.0 - Use `socket`.
+ */
+ readonly connection: net.Socket | tls.TLSSocket;
+ /**
+ * Boolean value that indicates whether the response has completed. Starts
+ * as `false`. After `response.end()` executes, the value will be `true`.
+ * @since v8.4.0
+ * @deprecated Since v13.4.0,v12.16.0 - Use `writableEnded`.
+ */
+ readonly finished: boolean;
+ /**
+ * True if headers were sent, false otherwise (read-only).
+ * @since v8.4.0
+ */
+ readonly headersSent: boolean;
+ /**
+ * A reference to the original HTTP2 request object.
+ * @since v15.7.0
+ */
+ readonly req: Http2ServerRequest;
+ /**
+ * Returns a `Proxy` object that acts as a `net.Socket` (or `tls.TLSSocket`) but
+ * applies getters, setters, and methods based on HTTP/2 logic.
+ *
+ * `destroyed`, `readable`, and `writable` properties will be retrieved from and
+ * set on `response.stream`.
+ *
+ * `destroy`, `emit`, `end`, `on` and `once` methods will be called on`response.stream`.
+ *
+ * `setTimeout` method will be called on `response.stream.session`.
+ *
+ * `pause`, `read`, `resume`, and `write` will throw an error with code`ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for
+ * more information.
+ *
+ * All other interactions will be routed directly to the socket.
+ *
+ * ```js
+ * const http2 = require('http2');
+ * const server = http2.createServer((req, res) => {
+ * const ip = req.socket.remoteAddress;
+ * const port = req.socket.remotePort;
+ * res.end(`Your IP address is ${ip} and your source port is ${port}.`);
+ * }).listen(3000);
+ * ```
+ * @since v8.4.0
+ */
+ readonly socket: net.Socket | tls.TLSSocket;
+ /**
+ * The `Http2Stream` object backing the response.
+ * @since v8.4.0
+ */
+ readonly stream: ServerHttp2Stream;
+ /**
+ * When true, the Date header will be automatically generated and sent in
+ * the response if it is not already present in the headers. Defaults to true.
+ *
+ * This should only be disabled for testing; HTTP requires the Date header
+ * in responses.
+ * @since v8.4.0
+ */
+ sendDate: boolean;
+ /**
+ * When using implicit headers (not calling `response.writeHead()` explicitly),
+ * this property controls the status code that will be sent to the client when
+ * the headers get flushed.
+ *
+ * ```js
+ * response.statusCode = 404;
+ * ```
+ *
+ * After response header was sent to the client, this property indicates the
+ * status code which was sent out.
+ * @since v8.4.0
+ */
+ statusCode: number;
+ /**
+ * Status message is not supported by HTTP/2 (RFC 7540 8.1.2.4). It returns
+ * an empty string.
+ * @since v8.4.0
+ */
+ statusMessage: "";
+ /**
+ * This method adds HTTP trailing headers (a header but at the end of the
+ * message) to the response.
+ *
+ * Attempting to set a header field name or value that contains invalid characters
+ * will result in a `TypeError` being thrown.
+ * @since v8.4.0
+ */
+ addTrailers(trailers: OutgoingHttpHeaders): void;
+ /**
+ * This method signals to the server that all of the response headers and body
+ * have been sent; that server should consider this message complete.
+ * The method, `response.end()`, MUST be called on each response.
+ *
+ * If `data` is specified, it is equivalent to calling `response.write(data, encoding)` followed by `response.end(callback)`.
+ *
+ * If `callback` is specified, it will be called when the response stream
+ * is finished.
+ * @since v8.4.0
+ */
+ end(callback?: () => void): this;
+ end(data: string | Uint8Array, callback?: () => void): this;
+ end(data: string | Uint8Array, encoding: BufferEncoding, callback?: () => void): this;
+ /**
+ * Reads out a header that has already been queued but not sent to the client.
+ * The name is case-insensitive.
+ *
+ * ```js
+ * const contentType = response.getHeader('content-type');
+ * ```
+ * @since v8.4.0
+ */
+ getHeader(name: string): string;
+ /**
+ * Returns an array containing the unique names of the current outgoing headers.
+ * All header names are lowercase.
+ *
+ * ```js
+ * response.setHeader('Foo', 'bar');
+ * response.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']);
+ *
+ * const headerNames = response.getHeaderNames();
+ * // headerNames === ['foo', 'set-cookie']
+ * ```
+ * @since v8.4.0
+ */
+ getHeaderNames(): string[];
+ /**
+ * Returns a shallow copy of the current outgoing headers. Since a shallow copy
+ * is used, array values may be mutated without additional calls to various
+ * header-related http module methods. The keys of the returned object are the
+ * header names and the values are the respective header values. All header names
+ * are lowercase.
+ *
+ * The object returned by the `response.getHeaders()` method _does not_prototypically inherit from the JavaScript `Object`. This means that typical`Object` methods such as `obj.toString()`,
+ * `obj.hasOwnProperty()`, and others
+ * are not defined and _will not work_.
+ *
+ * ```js
+ * response.setHeader('Foo', 'bar');
+ * response.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']);
+ *
+ * const headers = response.getHeaders();
+ * // headers === { foo: 'bar', 'set-cookie': ['foo=bar', 'bar=baz'] }
+ * ```
+ * @since v8.4.0
+ */
+ getHeaders(): OutgoingHttpHeaders;
+ /**
+ * Returns `true` if the header identified by `name` is currently set in the
+ * outgoing headers. The header name matching is case-insensitive.
+ *
+ * ```js
+ * const hasContentType = response.hasHeader('content-type');
+ * ```
+ * @since v8.4.0
+ */
+ hasHeader(name: string): boolean;
+ /**
+ * Removes a header that has been queued for implicit sending.
+ *
+ * ```js
+ * response.removeHeader('Content-Encoding');
+ * ```
+ * @since v8.4.0
+ */
+ removeHeader(name: string): void;
+ /**
+ * Sets a single header value for implicit headers. If this header already exists
+ * in the to-be-sent headers, its value will be replaced. Use an array of strings
+ * here to send multiple headers with the same name.
+ *
+ * ```js
+ * response.setHeader('Content-Type', 'text/html; charset=utf-8');
+ * ```
+ *
+ * or
+ *
+ * ```js
+ * response.setHeader('Set-Cookie', ['type=ninja', 'language=javascript']);
+ * ```
+ *
+ * Attempting to set a header field name or value that contains invalid characters
+ * will result in a `TypeError` being thrown.
+ *
+ * When headers have been set with `response.setHeader()`, they will be merged
+ * with any headers passed to `response.writeHead()`, with the headers passed
+ * to `response.writeHead()` given precedence.
+ *
+ * ```js
+ * // Returns content-type = text/plain
+ * const server = http2.createServer((req, res) => {
+ * res.setHeader('Content-Type', 'text/html; charset=utf-8');
+ * res.setHeader('X-Foo', 'bar');
+ * res.writeHead(200, { 'Content-Type': 'text/plain; charset=utf-8' });
+ * res.end('ok');
+ * });
+ * ```
+ * @since v8.4.0
+ */
+ setHeader(name: string, value: number | string | readonly string[]): void;
+ /**
+ * Sets the `Http2Stream`'s timeout value to `msecs`. If a callback is
+ * provided, then it is added as a listener on the `'timeout'` event on
+ * the response object.
+ *
+ * If no `'timeout'` listener is added to the request, the response, or
+ * the server, then `Http2Stream` s are destroyed when they time out. If a
+ * handler is assigned to the request, the response, or the server's `'timeout'`events, timed out sockets must be handled explicitly.
+ * @since v8.4.0
+ */
+ setTimeout(msecs: number, callback?: () => void): void;
+ /**
+ * If this method is called and `response.writeHead()` has not been called,
+ * it will switch to implicit header mode and flush the implicit headers.
+ *
+ * This sends a chunk of the response body. This method may
+ * be called multiple times to provide successive parts of the body.
+ *
+ * In the `http` module, the response body is omitted when the
+ * request is a HEAD request. Similarly, the `204` and `304` responses _must not_ include a message body.
+ *
+ * `chunk` can be a string or a buffer. If `chunk` is a string,
+ * the second parameter specifies how to encode it into a byte stream.
+ * By default the `encoding` is `'utf8'`. `callback` will be called when this chunk
+ * of data is flushed.
+ *
+ * This is the raw HTTP body and has nothing to do with higher-level multi-part
+ * body encodings that may be used.
+ *
+ * The first time `response.write()` is called, it will send the buffered
+ * header information and the first chunk of the body to the client. The second
+ * time `response.write()` is called, Node.js assumes data will be streamed,
+ * and sends the new data separately. That is, the response is buffered up to the
+ * first chunk of the body.
+ *
+ * Returns `true` if the entire data was flushed successfully to the kernel
+ * buffer. Returns `false` if all or part of the data was queued in user memory.`'drain'` will be emitted when the buffer is free again.
+ * @since v8.4.0
+ */
+ write(chunk: string | Uint8Array, callback?: (err: Error) => void): boolean;
+ write(chunk: string | Uint8Array, encoding: BufferEncoding, callback?: (err: Error) => void): boolean;
+ /**
+ * Sends a status `100 Continue` to the client, indicating that the request body
+ * should be sent. See the `'checkContinue'` event on `Http2Server` and`Http2SecureServer`.
+ * @since v8.4.0
+ */
+ writeContinue(): void;
+ /**
+ * Sends a status `103 Early Hints` to the client with a Link header,
+ * indicating that the user agent can preload/preconnect the linked resources.
+ * The `hints` is an object containing the values of headers to be sent with
+ * early hints message.
+ *
+ * Example:
+ *
+ * ```js
+ * const earlyHintsLink = '</styles.css>; rel=preload; as=style';
+ * response.writeEarlyHints({
+ * 'link': earlyHintsLink,
+ * });
+ *
+ * const earlyHintsLinks = [
+ * '</styles.css>; rel=preload; as=style',
+ * '</scripts.js>; rel=preload; as=script',
+ * ];
+ * response.writeEarlyHints({
+ * 'link': earlyHintsLinks,
+ * 'x-trace-id': 'id for diagnostics'
+ * });
+ * ```
+ *
+ * @since v18.11.0
+ * @param hints An object containing the values of headers
+ */
+ writeEarlyHints(hints: Record<string, string | string[]>): void;
+ /**
+ * Sends a response header to the request. The status code is a 3-digit HTTP
+ * status code, like `404`. The last argument, `headers`, are the response headers.
+ *
+ * Returns a reference to the `Http2ServerResponse`, so that calls can be chained.
+ *
+ * For compatibility with `HTTP/1`, a human-readable `statusMessage` may be
+ * passed as the second argument. However, because the `statusMessage` has no
+ * meaning within HTTP/2, the argument will have no effect and a process warning
+ * will be emitted.
+ *
+ * ```js
+ * const body = 'hello world';
+ * response.writeHead(200, {
+ * 'Content-Length': Buffer.byteLength(body),
+ * 'Content-Type': 'text/plain; charset=utf-8',
+ * });
+ * ```
+ *
+ * `Content-Length` is given in bytes not characters. The`Buffer.byteLength()` API may be used to determine the number of bytes in a
+ * given encoding. On outbound messages, Node.js does not check if Content-Length
+ * and the length of the body being transmitted are equal or not. However, when
+ * receiving messages, Node.js will automatically reject messages when the`Content-Length` does not match the actual payload size.
+ *
+ * This method may be called at most one time on a message before `response.end()` is called.
+ *
+ * If `response.write()` or `response.end()` are called before calling
+ * this, the implicit/mutable headers will be calculated and call this function.
+ *
+ * When headers have been set with `response.setHeader()`, they will be merged
+ * with any headers passed to `response.writeHead()`, with the headers passed
+ * to `response.writeHead()` given precedence.
+ *
+ * ```js
+ * // Returns content-type = text/plain
+ * const server = http2.createServer((req, res) => {
+ * res.setHeader('Content-Type', 'text/html; charset=utf-8');
+ * res.setHeader('X-Foo', 'bar');
+ * res.writeHead(200, { 'Content-Type': 'text/plain; charset=utf-8' });
+ * res.end('ok');
+ * });
+ * ```
+ *
+ * Attempting to set a header field name or value that contains invalid characters
+ * will result in a `TypeError` being thrown.
+ * @since v8.4.0
+ */
+ writeHead(statusCode: number, headers?: OutgoingHttpHeaders): this;
+ writeHead(statusCode: number, statusMessage: string, headers?: OutgoingHttpHeaders): this;
+ /**
+ * Call `http2stream.pushStream()` with the given headers, and wrap the
+ * given `Http2Stream` on a newly created `Http2ServerResponse` as the callback
+ * parameter if successful. When `Http2ServerRequest` is closed, the callback is
+ * called with an error `ERR_HTTP2_INVALID_STREAM`.
+ * @since v8.4.0
+ * @param headers An object describing the headers
+ * @param callback Called once `http2stream.pushStream()` is finished, or either when the attempt to create the pushed `Http2Stream` has failed or has been rejected, or the state of
+ * `Http2ServerRequest` is closed prior to calling the `http2stream.pushStream()` method
+ */
+ createPushResponse(
+ headers: OutgoingHttpHeaders,
+ callback: (err: Error | null, res: Http2ServerResponse) => void,
+ ): void;
+ addListener(event: "close", listener: () => void): this;
+ addListener(event: "drain", listener: () => void): this;
+ addListener(event: "error", listener: (error: Error) => void): this;
+ addListener(event: "finish", listener: () => void): this;
+ addListener(event: "pipe", listener: (src: stream.Readable) => void): this;
+ addListener(event: "unpipe", listener: (src: stream.Readable) => void): this;
+ addListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ emit(event: "close"): boolean;
+ emit(event: "drain"): boolean;
+ emit(event: "error", error: Error): boolean;
+ emit(event: "finish"): boolean;
+ emit(event: "pipe", src: stream.Readable): boolean;
+ emit(event: "unpipe", src: stream.Readable): boolean;
+ emit(event: string | symbol, ...args: any[]): boolean;
+ on(event: "close", listener: () => void): this;
+ on(event: "drain", listener: () => void): this;
+ on(event: "error", listener: (error: Error) => void): this;
+ on(event: "finish", listener: () => void): this;
+ on(event: "pipe", listener: (src: stream.Readable) => void): this;
+ on(event: "unpipe", listener: (src: stream.Readable) => void): this;
+ on(event: string | symbol, listener: (...args: any[]) => void): this;
+ once(event: "close", listener: () => void): this;
+ once(event: "drain", listener: () => void): this;
+ once(event: "error", listener: (error: Error) => void): this;
+ once(event: "finish", listener: () => void): this;
+ once(event: "pipe", listener: (src: stream.Readable) => void): this;
+ once(event: "unpipe", listener: (src: stream.Readable) => void): this;
+ once(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependListener(event: "close", listener: () => void): this;
+ prependListener(event: "drain", listener: () => void): this;
+ prependListener(event: "error", listener: (error: Error) => void): this;
+ prependListener(event: "finish", listener: () => void): this;
+ prependListener(event: "pipe", listener: (src: stream.Readable) => void): this;
+ prependListener(event: "unpipe", listener: (src: stream.Readable) => void): this;
+ prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependOnceListener(event: "close", listener: () => void): this;
+ prependOnceListener(event: "drain", listener: () => void): this;
+ prependOnceListener(event: "error", listener: (error: Error) => void): this;
+ prependOnceListener(event: "finish", listener: () => void): this;
+ prependOnceListener(event: "pipe", listener: (src: stream.Readable) => void): this;
+ prependOnceListener(event: "unpipe", listener: (src: stream.Readable) => void): this;
+ prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ }
+ export namespace constants {
+ const NGHTTP2_SESSION_SERVER: number;
+ const NGHTTP2_SESSION_CLIENT: number;
+ const NGHTTP2_STREAM_STATE_IDLE: number;
+ const NGHTTP2_STREAM_STATE_OPEN: number;
+ const NGHTTP2_STREAM_STATE_RESERVED_LOCAL: number;
+ const NGHTTP2_STREAM_STATE_RESERVED_REMOTE: number;
+ const NGHTTP2_STREAM_STATE_HALF_CLOSED_LOCAL: number;
+ const NGHTTP2_STREAM_STATE_HALF_CLOSED_REMOTE: number;
+ const NGHTTP2_STREAM_STATE_CLOSED: number;
+ const NGHTTP2_NO_ERROR: number;
+ const NGHTTP2_PROTOCOL_ERROR: number;
+ const NGHTTP2_INTERNAL_ERROR: number;
+ const NGHTTP2_FLOW_CONTROL_ERROR: number;
+ const NGHTTP2_SETTINGS_TIMEOUT: number;
+ const NGHTTP2_STREAM_CLOSED: number;
+ const NGHTTP2_FRAME_SIZE_ERROR: number;
+ const NGHTTP2_REFUSED_STREAM: number;
+ const NGHTTP2_CANCEL: number;
+ const NGHTTP2_COMPRESSION_ERROR: number;
+ const NGHTTP2_CONNECT_ERROR: number;
+ const NGHTTP2_ENHANCE_YOUR_CALM: number;
+ const NGHTTP2_INADEQUATE_SECURITY: number;
+ const NGHTTP2_HTTP_1_1_REQUIRED: number;
+ const NGHTTP2_ERR_FRAME_SIZE_ERROR: number;
+ const NGHTTP2_FLAG_NONE: number;
+ const NGHTTP2_FLAG_END_STREAM: number;
+ const NGHTTP2_FLAG_END_HEADERS: number;
+ const NGHTTP2_FLAG_ACK: number;
+ const NGHTTP2_FLAG_PADDED: number;
+ const NGHTTP2_FLAG_PRIORITY: number;
+ const DEFAULT_SETTINGS_HEADER_TABLE_SIZE: number;
+ const DEFAULT_SETTINGS_ENABLE_PUSH: number;
+ const DEFAULT_SETTINGS_INITIAL_WINDOW_SIZE: number;
+ const DEFAULT_SETTINGS_MAX_FRAME_SIZE: number;
+ const MAX_MAX_FRAME_SIZE: number;
+ const MIN_MAX_FRAME_SIZE: number;
+ const MAX_INITIAL_WINDOW_SIZE: number;
+ const NGHTTP2_DEFAULT_WEIGHT: number;
+ const NGHTTP2_SETTINGS_HEADER_TABLE_SIZE: number;
+ const NGHTTP2_SETTINGS_ENABLE_PUSH: number;
+ const NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS: number;
+ const NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE: number;
+ const NGHTTP2_SETTINGS_MAX_FRAME_SIZE: number;
+ const NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE: number;
+ const PADDING_STRATEGY_NONE: number;
+ const PADDING_STRATEGY_MAX: number;
+ const PADDING_STRATEGY_CALLBACK: number;
+ const HTTP2_HEADER_STATUS: string;
+ const HTTP2_HEADER_METHOD: string;
+ const HTTP2_HEADER_AUTHORITY: string;
+ const HTTP2_HEADER_SCHEME: string;
+ const HTTP2_HEADER_PATH: string;
+ const HTTP2_HEADER_ACCEPT_CHARSET: string;
+ const HTTP2_HEADER_ACCEPT_ENCODING: string;
+ const HTTP2_HEADER_ACCEPT_LANGUAGE: string;
+ const HTTP2_HEADER_ACCEPT_RANGES: string;
+ const HTTP2_HEADER_ACCEPT: string;
+ const HTTP2_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN: string;
+ const HTTP2_HEADER_AGE: string;
+ const HTTP2_HEADER_ALLOW: string;
+ const HTTP2_HEADER_AUTHORIZATION: string;
+ const HTTP2_HEADER_CACHE_CONTROL: string;
+ const HTTP2_HEADER_CONNECTION: string;
+ const HTTP2_HEADER_CONTENT_DISPOSITION: string;
+ const HTTP2_HEADER_CONTENT_ENCODING: string;
+ const HTTP2_HEADER_CONTENT_LANGUAGE: string;
+ const HTTP2_HEADER_CONTENT_LENGTH: string;
+ const HTTP2_HEADER_CONTENT_LOCATION: string;
+ const HTTP2_HEADER_CONTENT_MD5: string;
+ const HTTP2_HEADER_CONTENT_RANGE: string;
+ const HTTP2_HEADER_CONTENT_TYPE: string;
+ const HTTP2_HEADER_COOKIE: string;
+ const HTTP2_HEADER_DATE: string;
+ const HTTP2_HEADER_ETAG: string;
+ const HTTP2_HEADER_EXPECT: string;
+ const HTTP2_HEADER_EXPIRES: string;
+ const HTTP2_HEADER_FROM: string;
+ const HTTP2_HEADER_HOST: string;
+ const HTTP2_HEADER_IF_MATCH: string;
+ const HTTP2_HEADER_IF_MODIFIED_SINCE: string;
+ const HTTP2_HEADER_IF_NONE_MATCH: string;
+ const HTTP2_HEADER_IF_RANGE: string;
+ const HTTP2_HEADER_IF_UNMODIFIED_SINCE: string;
+ const HTTP2_HEADER_LAST_MODIFIED: string;
+ const HTTP2_HEADER_LINK: string;
+ const HTTP2_HEADER_LOCATION: string;
+ const HTTP2_HEADER_MAX_FORWARDS: string;
+ const HTTP2_HEADER_PREFER: string;
+ const HTTP2_HEADER_PROXY_AUTHENTICATE: string;
+ const HTTP2_HEADER_PROXY_AUTHORIZATION: string;
+ const HTTP2_HEADER_RANGE: string;
+ const HTTP2_HEADER_REFERER: string;
+ const HTTP2_HEADER_REFRESH: string;
+ const HTTP2_HEADER_RETRY_AFTER: string;
+ const HTTP2_HEADER_SERVER: string;
+ const HTTP2_HEADER_SET_COOKIE: string;
+ const HTTP2_HEADER_STRICT_TRANSPORT_SECURITY: string;
+ const HTTP2_HEADER_TRANSFER_ENCODING: string;
+ const HTTP2_HEADER_TE: string;
+ const HTTP2_HEADER_UPGRADE: string;
+ const HTTP2_HEADER_USER_AGENT: string;
+ const HTTP2_HEADER_VARY: string;
+ const HTTP2_HEADER_VIA: string;
+ const HTTP2_HEADER_WWW_AUTHENTICATE: string;
+ const HTTP2_HEADER_HTTP2_SETTINGS: string;
+ const HTTP2_HEADER_KEEP_ALIVE: string;
+ const HTTP2_HEADER_PROXY_CONNECTION: string;
+ const HTTP2_METHOD_ACL: string;
+ const HTTP2_METHOD_BASELINE_CONTROL: string;
+ const HTTP2_METHOD_BIND: string;
+ const HTTP2_METHOD_CHECKIN: string;
+ const HTTP2_METHOD_CHECKOUT: string;
+ const HTTP2_METHOD_CONNECT: string;
+ const HTTP2_METHOD_COPY: string;
+ const HTTP2_METHOD_DELETE: string;
+ const HTTP2_METHOD_GET: string;
+ const HTTP2_METHOD_HEAD: string;
+ const HTTP2_METHOD_LABEL: string;
+ const HTTP2_METHOD_LINK: string;
+ const HTTP2_METHOD_LOCK: string;
+ const HTTP2_METHOD_MERGE: string;
+ const HTTP2_METHOD_MKACTIVITY: string;
+ const HTTP2_METHOD_MKCALENDAR: string;
+ const HTTP2_METHOD_MKCOL: string;
+ const HTTP2_METHOD_MKREDIRECTREF: string;
+ const HTTP2_METHOD_MKWORKSPACE: string;
+ const HTTP2_METHOD_MOVE: string;
+ const HTTP2_METHOD_OPTIONS: string;
+ const HTTP2_METHOD_ORDERPATCH: string;
+ const HTTP2_METHOD_PATCH: string;
+ const HTTP2_METHOD_POST: string;
+ const HTTP2_METHOD_PRI: string;
+ const HTTP2_METHOD_PROPFIND: string;
+ const HTTP2_METHOD_PROPPATCH: string;
+ const HTTP2_METHOD_PUT: string;
+ const HTTP2_METHOD_REBIND: string;
+ const HTTP2_METHOD_REPORT: string;
+ const HTTP2_METHOD_SEARCH: string;
+ const HTTP2_METHOD_TRACE: string;
+ const HTTP2_METHOD_UNBIND: string;
+ const HTTP2_METHOD_UNCHECKOUT: string;
+ const HTTP2_METHOD_UNLINK: string;
+ const HTTP2_METHOD_UNLOCK: string;
+ const HTTP2_METHOD_UPDATE: string;
+ const HTTP2_METHOD_UPDATEREDIRECTREF: string;
+ const HTTP2_METHOD_VERSION_CONTROL: string;
+ const HTTP_STATUS_CONTINUE: number;
+ const HTTP_STATUS_SWITCHING_PROTOCOLS: number;
+ const HTTP_STATUS_PROCESSING: number;
+ const HTTP_STATUS_OK: number;
+ const HTTP_STATUS_CREATED: number;
+ const HTTP_STATUS_ACCEPTED: number;
+ const HTTP_STATUS_NON_AUTHORITATIVE_INFORMATION: number;
+ const HTTP_STATUS_NO_CONTENT: number;
+ const HTTP_STATUS_RESET_CONTENT: number;
+ const HTTP_STATUS_PARTIAL_CONTENT: number;
+ const HTTP_STATUS_MULTI_STATUS: number;
+ const HTTP_STATUS_ALREADY_REPORTED: number;
+ const HTTP_STATUS_IM_USED: number;
+ const HTTP_STATUS_MULTIPLE_CHOICES: number;
+ const HTTP_STATUS_MOVED_PERMANENTLY: number;
+ const HTTP_STATUS_FOUND: number;
+ const HTTP_STATUS_SEE_OTHER: number;
+ const HTTP_STATUS_NOT_MODIFIED: number;
+ const HTTP_STATUS_USE_PROXY: number;
+ const HTTP_STATUS_TEMPORARY_REDIRECT: number;
+ const HTTP_STATUS_PERMANENT_REDIRECT: number;
+ const HTTP_STATUS_BAD_REQUEST: number;
+ const HTTP_STATUS_UNAUTHORIZED: number;
+ const HTTP_STATUS_PAYMENT_REQUIRED: number;
+ const HTTP_STATUS_FORBIDDEN: number;
+ const HTTP_STATUS_NOT_FOUND: number;
+ const HTTP_STATUS_METHOD_NOT_ALLOWED: number;
+ const HTTP_STATUS_NOT_ACCEPTABLE: number;
+ const HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED: number;
+ const HTTP_STATUS_REQUEST_TIMEOUT: number;
+ const HTTP_STATUS_CONFLICT: number;
+ const HTTP_STATUS_GONE: number;
+ const HTTP_STATUS_LENGTH_REQUIRED: number;
+ const HTTP_STATUS_PRECONDITION_FAILED: number;
+ const HTTP_STATUS_PAYLOAD_TOO_LARGE: number;
+ const HTTP_STATUS_URI_TOO_LONG: number;
+ const HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE: number;
+ const HTTP_STATUS_RANGE_NOT_SATISFIABLE: number;
+ const HTTP_STATUS_EXPECTATION_FAILED: number;
+ const HTTP_STATUS_TEAPOT: number;
+ const HTTP_STATUS_MISDIRECTED_REQUEST: number;
+ const HTTP_STATUS_UNPROCESSABLE_ENTITY: number;
+ const HTTP_STATUS_LOCKED: number;
+ const HTTP_STATUS_FAILED_DEPENDENCY: number;
+ const HTTP_STATUS_UNORDERED_COLLECTION: number;
+ const HTTP_STATUS_UPGRADE_REQUIRED: number;
+ const HTTP_STATUS_PRECONDITION_REQUIRED: number;
+ const HTTP_STATUS_TOO_MANY_REQUESTS: number;
+ const HTTP_STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE: number;
+ const HTTP_STATUS_UNAVAILABLE_FOR_LEGAL_REASONS: number;
+ const HTTP_STATUS_INTERNAL_SERVER_ERROR: number;
+ const HTTP_STATUS_NOT_IMPLEMENTED: number;
+ const HTTP_STATUS_BAD_GATEWAY: number;
+ const HTTP_STATUS_SERVICE_UNAVAILABLE: number;
+ const HTTP_STATUS_GATEWAY_TIMEOUT: number;
+ const HTTP_STATUS_HTTP_VERSION_NOT_SUPPORTED: number;
+ const HTTP_STATUS_VARIANT_ALSO_NEGOTIATES: number;
+ const HTTP_STATUS_INSUFFICIENT_STORAGE: number;
+ const HTTP_STATUS_LOOP_DETECTED: number;
+ const HTTP_STATUS_BANDWIDTH_LIMIT_EXCEEDED: number;
+ const HTTP_STATUS_NOT_EXTENDED: number;
+ const HTTP_STATUS_NETWORK_AUTHENTICATION_REQUIRED: number;
+ }
+ /**
+ * This symbol can be set as a property on the HTTP/2 headers object with
+ * an array value in order to provide a list of headers considered sensitive.
+ */
+ export const sensitiveHeaders: symbol;
+ /**
+ * Returns an object containing the default settings for an `Http2Session`instance. This method returns a new object instance every time it is called
+ * so instances returned may be safely modified for use.
+ * @since v8.4.0
+ */
+ export function getDefaultSettings(): Settings;
+ /**
+ * Returns a `Buffer` instance containing serialized representation of the given
+ * HTTP/2 settings as specified in the [HTTP/2](https://tools.ietf.org/html/rfc7540) specification. This is intended
+ * for use with the `HTTP2-Settings` header field.
+ *
+ * ```js
+ * const http2 = require('http2');
+ *
+ * const packed = http2.getPackedSettings({ enablePush: false });
+ *
+ * console.log(packed.toString('base64'));
+ * // Prints: AAIAAAAA
+ * ```
+ * @since v8.4.0
+ */
+ export function getPackedSettings(settings: Settings): Buffer;
+ /**
+ * Returns a `HTTP/2 Settings Object` containing the deserialized settings from
+ * the given `Buffer` as generated by `http2.getPackedSettings()`.
+ * @since v8.4.0
+ * @param buf The packed settings.
+ */
+ export function getUnpackedSettings(buf: Uint8Array): Settings;
+ /**
+ * Returns a `net.Server` instance that creates and manages `Http2Session`instances.
+ *
+ * Since there are no browsers known that support [unencrypted HTTP/2](https://http2.github.io/faq/#does-http2-require-encryption), the use of {@link createSecureServer} is necessary when
+ * communicating
+ * with browser clients.
+ *
+ * ```js
+ * const http2 = require('http2');
+ *
+ * // Create an unencrypted HTTP/2 server.
+ * // Since there are no browsers known that support
+ * // unencrypted HTTP/2, the use of `http2.createSecureServer()`
+ * // is necessary when communicating with browser clients.
+ * const server = http2.createServer();
+ *
+ * server.on('stream', (stream, headers) => {
+ * stream.respond({
+ * 'content-type': 'text/html; charset=utf-8',
+ * ':status': 200
+ * });
+ * stream.end('<h1>Hello World</h1>');
+ * });
+ *
+ * server.listen(80);
+ * ```
+ * @since v8.4.0
+ * @param onRequestHandler See `Compatibility API`
+ */
+ export function createServer(
+ onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
+ ): Http2Server;
+ export function createServer(
+ options: ServerOptions,
+ onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
+ ): Http2Server;
+ /**
+ * Returns a `tls.Server` instance that creates and manages `Http2Session`instances.
+ *
+ * ```js
+ * const http2 = require('http2');
+ * const fs = require('fs');
+ *
+ * const options = {
+ * key: fs.readFileSync('server-key.pem'),
+ * cert: fs.readFileSync('server-cert.pem')
+ * };
+ *
+ * // Create a secure HTTP/2 server
+ * const server = http2.createSecureServer(options);
+ *
+ * server.on('stream', (stream, headers) => {
+ * stream.respond({
+ * 'content-type': 'text/html; charset=utf-8',
+ * ':status': 200
+ * });
+ * stream.end('<h1>Hello World</h1>');
+ * });
+ *
+ * server.listen(80);
+ * ```
+ * @since v8.4.0
+ * @param onRequestHandler See `Compatibility API`
+ */
+ export function createSecureServer(
+ onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
+ ): Http2SecureServer;
+ export function createSecureServer(
+ options: SecureServerOptions,
+ onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void,
+ ): Http2SecureServer;
+ /**
+ * Returns a `ClientHttp2Session` instance.
+ *
+ * ```js
+ * const http2 = require('http2');
+ * const client = http2.connect('https://localhost:1234');
+ *
+ * // Use the client
+ *
+ * client.close();
+ * ```
+ * @since v8.4.0
+ * @param authority The remote HTTP/2 server to connect to. This must be in the form of a minimal, valid URL with the `http://` or `https://` prefix, host name, and IP port (if a non-default port
+ * is used). Userinfo (user ID and password), path, querystring, and fragment details in the URL will be ignored.
+ * @param listener Will be registered as a one-time listener of the {@link 'connect'} event.
+ */
+ export function connect(
+ authority: string | url.URL,
+ listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void,
+ ): ClientHttp2Session;
+ export function connect(
+ authority: string | url.URL,
+ options?: ClientSessionOptions | SecureClientSessionOptions,
+ listener?: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void,
+ ): ClientHttp2Session;
+}
+declare module "node:http2" {
+ export * from "http2";
+}
diff --git a/client/node_modules/@types/node/ts4.8/https.d.ts b/client/node_modules/@types/node/ts4.8/https.d.ts
new file mode 100644
index 0000000..2f06928
--- /dev/null
+++ b/client/node_modules/@types/node/ts4.8/https.d.ts
@@ -0,0 +1,544 @@
+/**
+ * HTTPS is the HTTP protocol over TLS/SSL. In Node.js this is implemented as a
+ * separate module.
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/https.js)
+ */
+declare module "https" {
+ import { Duplex } from "node:stream";
+ import * as tls from "node:tls";
+ import * as http from "node:http";
+ import { URL } from "node:url";
+ type ServerOptions<
+ Request extends typeof http.IncomingMessage = typeof http.IncomingMessage,
+ Response extends typeof http.ServerResponse = typeof http.ServerResponse,
+ > = tls.SecureContextOptions & tls.TlsOptions & http.ServerOptions<Request, Response>;
+ type RequestOptions =
+ & http.RequestOptions
+ & tls.SecureContextOptions
+ & {
+ checkServerIdentity?: typeof tls.checkServerIdentity | undefined;
+ rejectUnauthorized?: boolean | undefined; // Defaults to true
+ servername?: string | undefined; // SNI TLS Extension
+ };
+ interface AgentOptions extends http.AgentOptions, tls.ConnectionOptions {
+ rejectUnauthorized?: boolean | undefined;
+ maxCachedSessions?: number | undefined;
+ }
+ /**
+ * An `Agent` object for HTTPS similar to `http.Agent`. See {@link request} for more information.
+ * @since v0.4.5
+ */
+ class Agent extends http.Agent {
+ constructor(options?: AgentOptions);
+ options: AgentOptions;
+ }
+ interface Server<
+ Request extends typeof http.IncomingMessage = typeof http.IncomingMessage,
+ Response extends typeof http.ServerResponse = typeof http.ServerResponse,
+ > extends http.Server<Request, Response> {}
+ /**
+ * See `http.Server` for more information.
+ * @since v0.3.4
+ */
+ class Server<
+ Request extends typeof http.IncomingMessage = typeof http.IncomingMessage,
+ Response extends typeof http.ServerResponse = typeof http.ServerResponse,
+ > extends tls.Server {
+ constructor(requestListener?: http.RequestListener<Request, Response>);
+ constructor(
+ options: ServerOptions<Request, Response>,
+ requestListener?: http.RequestListener<Request, Response>,
+ );
+ /**
+ * Closes all connections connected to this server.
+ * @since v18.2.0
+ */
+ closeAllConnections(): void;
+ /**
+ * Closes all connections connected to this server which are not sending a request or waiting for a response.
+ * @since v18.2.0
+ */
+ closeIdleConnections(): void;
+ addListener(event: string, listener: (...args: any[]) => void): this;
+ addListener(event: "keylog", listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
+ addListener(
+ event: "newSession",
+ listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void,
+ ): this;
+ addListener(
+ event: "OCSPRequest",
+ listener: (
+ certificate: Buffer,
+ issuer: Buffer,
+ callback: (err: Error | null, resp: Buffer) => void,
+ ) => void,
+ ): this;
+ addListener(
+ event: "resumeSession",
+ listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void,
+ ): this;
+ addListener(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this;
+ addListener(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
+ addListener(event: "close", listener: () => void): this;
+ addListener(event: "connection", listener: (socket: Duplex) => void): this;
+ addListener(event: "error", listener: (err: Error) => void): this;
+ addListener(event: "listening", listener: () => void): this;
+ addListener(event: "checkContinue", listener: http.RequestListener<Request, Response>): this;
+ addListener(event: "checkExpectation", listener: http.RequestListener<Request, Response>): this;
+ addListener(event: "clientError", listener: (err: Error, socket: Duplex) => void): this;
+ addListener(
+ event: "connect",
+ listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void,
+ ): this;
+ addListener(event: "request", listener: http.RequestListener<Request, Response>): this;
+ addListener(
+ event: "upgrade",
+ listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void,
+ ): this;
+ emit(event: string, ...args: any[]): boolean;
+ emit(event: "keylog", line: Buffer, tlsSocket: tls.TLSSocket): boolean;
+ emit(
+ event: "newSession",
+ sessionId: Buffer,
+ sessionData: Buffer,
+ callback: (err: Error, resp: Buffer) => void,
+ ): boolean;
+ emit(
+ event: "OCSPRequest",
+ certificate: Buffer,
+ issuer: Buffer,
+ callback: (err: Error | null, resp: Buffer) => void,
+ ): boolean;
+ emit(event: "resumeSession", sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void): boolean;
+ emit(event: "secureConnection", tlsSocket: tls.TLSSocket): boolean;
+ emit(event: "tlsClientError", err: Error, tlsSocket: tls.TLSSocket): boolean;
+ emit(event: "close"): boolean;
+ emit(event: "connection", socket: Duplex): boolean;
+ emit(event: "error", err: Error): boolean;
+ emit(event: "listening"): boolean;
+ emit(
+ event: "checkContinue",
+ req: InstanceType<Request>,
+ res: InstanceType<Response> & { req: InstanceType<Request> },
+ ): boolean;
+ emit(
+ event: "checkExpectation",
+ req: InstanceType<Request>,
+ res: InstanceType<Response> & { req: InstanceType<Request> },
+ ): boolean;
+ emit(event: "clientError", err: Error, socket: Duplex): boolean;
+ emit(event: "connect", req: InstanceType<Request>, socket: Duplex, head: Buffer): boolean;
+ emit(
+ event: "request",
+ req: InstanceType<Request>,
+ res: InstanceType<Response> & { req: InstanceType<Request> },
+ ): boolean;
+ emit(event: "upgrade", req: InstanceType<Request>, socket: Duplex, head: Buffer): boolean;
+ on(event: string, listener: (...args: any[]) => void): this;
+ on(event: "keylog", listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
+ on(
+ event: "newSession",
+ listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void,
+ ): this;
+ on(
+ event: "OCSPRequest",
+ listener: (
+ certificate: Buffer,
+ issuer: Buffer,
+ callback: (err: Error | null, resp: Buffer) => void,
+ ) => void,
+ ): this;
+ on(
+ event: "resumeSession",
+ listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void,
+ ): this;
+ on(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this;
+ on(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
+ on(event: "close", listener: () => void): this;
+ on(event: "connection", listener: (socket: Duplex) => void): this;
+ on(event: "error", listener: (err: Error) => void): this;
+ on(event: "listening", listener: () => void): this;
+ on(event: "checkContinue", listener: http.RequestListener<Request, Response>): this;
+ on(event: "checkExpectation", listener: http.RequestListener<Request, Response>): this;
+ on(event: "clientError", listener: (err: Error, socket: Duplex) => void): this;
+ on(event: "connect", listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
+ on(event: "request", listener: http.RequestListener<Request, Response>): this;
+ on(event: "upgrade", listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
+ once(event: string, listener: (...args: any[]) => void): this;
+ once(event: "keylog", listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
+ once(
+ event: "newSession",
+ listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void,
+ ): this;
+ once(
+ event: "OCSPRequest",
+ listener: (
+ certificate: Buffer,
+ issuer: Buffer,
+ callback: (err: Error | null, resp: Buffer) => void,
+ ) => void,
+ ): this;
+ once(
+ event: "resumeSession",
+ listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void,
+ ): this;
+ once(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this;
+ once(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
+ once(event: "close", listener: () => void): this;
+ once(event: "connection", listener: (socket: Duplex) => void): this;
+ once(event: "error", listener: (err: Error) => void): this;
+ once(event: "listening", listener: () => void): this;
+ once(event: "checkContinue", listener: http.RequestListener<Request, Response>): this;
+ once(event: "checkExpectation", listener: http.RequestListener<Request, Response>): this;
+ once(event: "clientError", listener: (err: Error, socket: Duplex) => void): this;
+ once(event: "connect", listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
+ once(event: "request", listener: http.RequestListener<Request, Response>): this;
+ once(event: "upgrade", listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
+ prependListener(event: string, listener: (...args: any[]) => void): this;
+ prependListener(event: "keylog", listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
+ prependListener(
+ event: "newSession",
+ listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void,
+ ): this;
+ prependListener(
+ event: "OCSPRequest",
+ listener: (
+ certificate: Buffer,
+ issuer: Buffer,
+ callback: (err: Error | null, resp: Buffer) => void,
+ ) => void,
+ ): this;
+ prependListener(
+ event: "resumeSession",
+ listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void,
+ ): this;
+ prependListener(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this;
+ prependListener(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
+ prependListener(event: "close", listener: () => void): this;
+ prependListener(event: "connection", listener: (socket: Duplex) => void): this;
+ prependListener(event: "error", listener: (err: Error) => void): this;
+ prependListener(event: "listening", listener: () => void): this;
+ prependListener(event: "checkContinue", listener: http.RequestListener<Request, Response>): this;
+ prependListener(event: "checkExpectation", listener: http.RequestListener<Request, Response>): this;
+ prependListener(event: "clientError", listener: (err: Error, socket: Duplex) => void): this;
+ prependListener(
+ event: "connect",
+ listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void,
+ ): this;
+ prependListener(event: "request", listener: http.RequestListener<Request, Response>): this;
+ prependListener(
+ event: "upgrade",
+ listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void,
+ ): this;
+ prependOnceListener(event: string, listener: (...args: any[]) => void): this;
+ prependOnceListener(event: "keylog", listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
+ prependOnceListener(
+ event: "newSession",
+ listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void,
+ ): this;
+ prependOnceListener(
+ event: "OCSPRequest",
+ listener: (
+ certificate: Buffer,
+ issuer: Buffer,
+ callback: (err: Error | null, resp: Buffer) => void,
+ ) => void,
+ ): this;
+ prependOnceListener(
+ event: "resumeSession",
+ listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void,
+ ): this;
+ prependOnceListener(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this;
+ prependOnceListener(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
+ prependOnceListener(event: "close", listener: () => void): this;
+ prependOnceListener(event: "connection", listener: (socket: Duplex) => void): this;
+ prependOnceListener(event: "error", listener: (err: Error) => void): this;
+ prependOnceListener(event: "listening", listener: () => void): this;
+ prependOnceListener(event: "checkContinue", listener: http.RequestListener<Request, Response>): this;
+ prependOnceListener(event: "checkExpectation", listener: http.RequestListener<Request, Response>): this;
+ prependOnceListener(event: "clientError", listener: (err: Error, socket: Duplex) => void): this;
+ prependOnceListener(
+ event: "connect",
+ listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void,
+ ): this;
+ prependOnceListener(event: "request", listener: http.RequestListener<Request, Response>): this;
+ prependOnceListener(
+ event: "upgrade",
+ listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void,
+ ): this;
+ }
+ /**
+ * ```js
+ * // curl -k https://localhost:8000/
+ * const https = require('https');
+ * const fs = require('fs');
+ *
+ * const options = {
+ * key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'),
+ * cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem')
+ * };
+ *
+ * https.createServer(options, (req, res) => {
+ * res.writeHead(200);
+ * res.end('hello world\n');
+ * }).listen(8000);
+ * ```
+ *
+ * Or
+ *
+ * ```js
+ * const https = require('https');
+ * const fs = require('fs');
+ *
+ * const options = {
+ * pfx: fs.readFileSync('test/fixtures/test_cert.pfx'),
+ * passphrase: 'sample'
+ * };
+ *
+ * https.createServer(options, (req, res) => {
+ * res.writeHead(200);
+ * res.end('hello world\n');
+ * }).listen(8000);
+ * ```
+ * @since v0.3.4
+ * @param options Accepts `options` from `createServer`, `createSecureContext` and `createServer`.
+ * @param requestListener A listener to be added to the `'request'` event.
+ */
+ function createServer<
+ Request extends typeof http.IncomingMessage = typeof http.IncomingMessage,
+ Response extends typeof http.ServerResponse = typeof http.ServerResponse,
+ >(requestListener?: http.RequestListener<Request, Response>): Server<Request, Response>;
+ function createServer<
+ Request extends typeof http.IncomingMessage = typeof http.IncomingMessage,
+ Response extends typeof http.ServerResponse = typeof http.ServerResponse,
+ >(
+ options: ServerOptions<Request, Response>,
+ requestListener?: http.RequestListener<Request, Response>,
+ ): Server<Request, Response>;
+ /**
+ * Makes a request to a secure web server.
+ *
+ * The following additional `options` from `tls.connect()` are also accepted:`ca`, `cert`, `ciphers`, `clientCertEngine`, `crl`, `dhparam`, `ecdhCurve`,`honorCipherOrder`, `key`, `passphrase`,
+ * `pfx`, `rejectUnauthorized`,`secureOptions`, `secureProtocol`, `servername`, `sessionIdContext`,`highWaterMark`.
+ *
+ * `options` can be an object, a string, or a `URL` object. If `options` is a
+ * string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object.
+ *
+ * `https.request()` returns an instance of the `http.ClientRequest` class. The `ClientRequest` instance is a writable stream. If one needs to
+ * upload a file with a POST request, then write to the `ClientRequest` object.
+ *
+ * ```js
+ * const https = require('https');
+ *
+ * const options = {
+ * hostname: 'encrypted.google.com',
+ * port: 443,
+ * path: '/',
+ * method: 'GET'
+ * };
+ *
+ * const req = https.request(options, (res) => {
+ * console.log('statusCode:', res.statusCode);
+ * console.log('headers:', res.headers);
+ *
+ * res.on('data', (d) => {
+ * process.stdout.write(d);
+ * });
+ * });
+ *
+ * req.on('error', (e) => {
+ * console.error(e);
+ * });
+ * req.end();
+ * ```
+ *
+ * Example using options from `tls.connect()`:
+ *
+ * ```js
+ * const options = {
+ * hostname: 'encrypted.google.com',
+ * port: 443,
+ * path: '/',
+ * method: 'GET',
+ * key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'),
+ * cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem')
+ * };
+ * options.agent = new https.Agent(options);
+ *
+ * const req = https.request(options, (res) => {
+ * // ...
+ * });
+ * ```
+ *
+ * Alternatively, opt out of connection pooling by not using an `Agent`.
+ *
+ * ```js
+ * const options = {
+ * hostname: 'encrypted.google.com',
+ * port: 443,
+ * path: '/',
+ * method: 'GET',
+ * key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'),
+ * cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem'),
+ * agent: false
+ * };
+ *
+ * const req = https.request(options, (res) => {
+ * // ...
+ * });
+ * ```
+ *
+ * Example using a `URL` as `options`:
+ *
+ * ```js
+ * const options = new URL('https://abc:xyz@example.com');
+ *
+ * const req = https.request(options, (res) => {
+ * // ...
+ * });
+ * ```
+ *
+ * Example pinning on certificate fingerprint, or the public key (similar to`pin-sha256`):
+ *
+ * ```js
+ * const tls = require('tls');
+ * const https = require('https');
+ * const crypto = require('crypto');
+ *
+ * function sha256(s) {
+ * return crypto.createHash('sha256').update(s).digest('base64');
+ * }
+ * const options = {
+ * hostname: 'github.com',
+ * port: 443,
+ * path: '/',
+ * method: 'GET',
+ * checkServerIdentity: function(host, cert) {
+ * // Make sure the certificate is issued to the host we are connected to
+ * const err = tls.checkServerIdentity(host, cert);
+ * if (err) {
+ * return err;
+ * }
+ *
+ * // Pin the public key, similar to HPKP pin-sha25 pinning
+ * const pubkey256 = 'pL1+qb9HTMRZJmuC/bB/ZI9d302BYrrqiVuRyW+DGrU=';
+ * if (sha256(cert.pubkey) !== pubkey256) {
+ * const msg = 'Certificate verification error: ' +
+ * `The public key of '${cert.subject.CN}' ` +
+ * 'does not match our pinned fingerprint';
+ * return new Error(msg);
+ * }
+ *
+ * // Pin the exact certificate, rather than the pub key
+ * const cert256 = '25:FE:39:32:D9:63:8C:8A:FC:A1:9A:29:87:' +
+ * 'D8:3E:4C:1D:98:DB:71:E4:1A:48:03:98:EA:22:6A:BD:8B:93:16';
+ * if (cert.fingerprint256 !== cert256) {
+ * const msg = 'Certificate verification error: ' +
+ * `The certificate of '${cert.subject.CN}' ` +
+ * 'does not match our pinned fingerprint';
+ * return new Error(msg);
+ * }
+ *
+ * // This loop is informational only.
+ * // Print the certificate and public key fingerprints of all certs in the
+ * // chain. Its common to pin the public key of the issuer on the public
+ * // internet, while pinning the public key of the service in sensitive
+ * // environments.
+ * do {
+ * console.log('Subject Common Name:', cert.subject.CN);
+ * console.log(' Certificate SHA256 fingerprint:', cert.fingerprint256);
+ *
+ * hash = crypto.createHash('sha256');
+ * console.log(' Public key ping-sha256:', sha256(cert.pubkey));
+ *
+ * lastprint256 = cert.fingerprint256;
+ * cert = cert.issuerCertificate;
+ * } while (cert.fingerprint256 !== lastprint256);
+ *
+ * },
+ * };
+ *
+ * options.agent = new https.Agent(options);
+ * const req = https.request(options, (res) => {
+ * console.log('All OK. Server matched our pinned cert or public key');
+ * console.log('statusCode:', res.statusCode);
+ * // Print the HPKP values
+ * console.log('headers:', res.headers['public-key-pins']);
+ *
+ * res.on('data', (d) => {});
+ * });
+ *
+ * req.on('error', (e) => {
+ * console.error(e.message);
+ * });
+ * req.end();
+ * ```
+ *
+ * Outputs for example:
+ *
+ * ```text
+ * Subject Common Name: github.com
+ * Certificate SHA256 fingerprint: 25:FE:39:32:D9:63:8C:8A:FC:A1:9A:29:87:D8:3E:4C:1D:98:DB:71:E4:1A:48:03:98:EA:22:6A:BD:8B:93:16
+ * Public key ping-sha256: pL1+qb9HTMRZJmuC/bB/ZI9d302BYrrqiVuRyW+DGrU=
+ * Subject Common Name: DigiCert SHA2 Extended Validation Server CA
+ * Certificate SHA256 fingerprint: 40:3E:06:2A:26:53:05:91:13:28:5B:AF:80:A0:D4:AE:42:2C:84:8C:9F:78:FA:D0:1F:C9:4B:C5:B8:7F:EF:1A
+ * Public key ping-sha256: RRM1dGqnDFsCJXBTHky16vi1obOlCgFFn/yOhI/y+ho=
+ * Subject Common Name: DigiCert High Assurance EV Root CA
+ * Certificate SHA256 fingerprint: 74:31:E5:F4:C3:C1:CE:46:90:77:4F:0B:61:E0:54:40:88:3B:A9:A0:1E:D0:0B:A6:AB:D7:80:6E:D3:B1:18:CF
+ * Public key ping-sha256: WoiWRyIOVNa9ihaBciRSC7XHjliYS9VwUGOIud4PB18=
+ * All OK. Server matched our pinned cert or public key
+ * statusCode: 200
+ * headers: max-age=0; pin-sha256="WoiWRyIOVNa9ihaBciRSC7XHjliYS9VwUGOIud4PB18="; pin-sha256="RRM1dGqnDFsCJXBTHky16vi1obOlCgFFn/yOhI/y+ho=";
+ * pin-sha256="k2v657xBsOVe1PQRwOsHsw3bsGT2VzIqz5K+59sNQws="; pin-sha256="K87oWBWM9UZfyddvDfoxL+8lpNyoUB2ptGtn0fv6G2Q="; pin-sha256="IQBnNBEiFuhj+8x6X8XLgh01V9Ic5/V3IRQLNFFc7v4=";
+ * pin-sha256="iie1VXtL7HzAMF+/PVPR9xzT80kQxdZeJ+zduCB3uj0="; pin-sha256="LvRiGEjRqfzurezaWuj8Wie2gyHMrW5Q06LspMnox7A="; includeSubDomains
+ * ```
+ * @since v0.3.6
+ * @param options Accepts all `options` from `request`, with some differences in default values:
+ */
+ function request(
+ options: RequestOptions | string | URL,
+ callback?: (res: http.IncomingMessage) => void,
+ ): http.ClientRequest;
+ function request(
+ url: string | URL,
+ options: RequestOptions,
+ callback?: (res: http.IncomingMessage) => void,
+ ): http.ClientRequest;
+ /**
+ * Like `http.get()` but for HTTPS.
+ *
+ * `options` can be an object, a string, or a `URL` object. If `options` is a
+ * string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object.
+ *
+ * ```js
+ * const https = require('https');
+ *
+ * https.get('https://encrypted.google.com/', (res) => {
+ * console.log('statusCode:', res.statusCode);
+ * console.log('headers:', res.headers);
+ *
+ * res.on('data', (d) => {
+ * process.stdout.write(d);
+ * });
+ *
+ * }).on('error', (e) => {
+ * console.error(e);
+ * });
+ * ```
+ * @since v0.3.6
+ * @param options Accepts the same `options` as {@link request}, with the `method` always set to `GET`.
+ */
+ function get(
+ options: RequestOptions | string | URL,
+ callback?: (res: http.IncomingMessage) => void,
+ ): http.ClientRequest;
+ function get(
+ url: string | URL,
+ options: RequestOptions,
+ callback?: (res: http.IncomingMessage) => void,
+ ): http.ClientRequest;
+ let globalAgent: Agent;
+}
+declare module "node:https" {
+ export * from "https";
+}
diff --git a/client/node_modules/@types/node/ts4.8/index.d.ts b/client/node_modules/@types/node/ts4.8/index.d.ts
new file mode 100644
index 0000000..7c8b38c
--- /dev/null
+++ b/client/node_modules/@types/node/ts4.8/index.d.ts
@@ -0,0 +1,88 @@
+/**
+ * License for programmatically and manually incorporated
+ * documentation aka. `JSDoc` from https://github.com/nodejs/node/tree/master/doc
+ *
+ * Copyright Node.js contributors. All rights reserved.
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+// NOTE: These definitions support NodeJS and TypeScript 4.8 and earlier.
+
+// Reference required types from the default lib:
+/// <reference lib="es2020" />
+/// <reference lib="esnext.asynciterable" />
+/// <reference lib="esnext.intl" />
+/// <reference lib="esnext.bigint" />
+
+// Base definitions for all NodeJS modules that are not specific to any version of TypeScript:
+/// <reference path="assert.d.ts" />
+/// <reference path="assert/strict.d.ts" />
+/// <reference path="globals.d.ts" />
+/// <reference path="async_hooks.d.ts" />
+/// <reference path="buffer.d.ts" />
+/// <reference path="child_process.d.ts" />
+/// <reference path="cluster.d.ts" />
+/// <reference path="console.d.ts" />
+/// <reference path="constants.d.ts" />
+/// <reference path="crypto.d.ts" />
+/// <reference path="dgram.d.ts" />
+/// <reference path="diagnostics_channel.d.ts" />
+/// <reference path="dns.d.ts" />
+/// <reference path="dns/promises.d.ts" />
+/// <reference path="dns/promises.d.ts" />
+/// <reference path="domain.d.ts" />
+/// <reference path="dom-events.d.ts" />
+/// <reference path="events.d.ts" />
+/// <reference path="fs.d.ts" />
+/// <reference path="fs/promises.d.ts" />
+/// <reference path="http.d.ts" />
+/// <reference path="http2.d.ts" />
+/// <reference path="https.d.ts" />
+/// <reference path="inspector.d.ts" />
+/// <reference path="module.d.ts" />
+/// <reference path="net.d.ts" />
+/// <reference path="os.d.ts" />
+/// <reference path="path.d.ts" />
+/// <reference path="perf_hooks.d.ts" />
+/// <reference path="process.d.ts" />
+/// <reference path="punycode.d.ts" />
+/// <reference path="querystring.d.ts" />
+/// <reference path="readline.d.ts" />
+/// <reference path="readline/promises.d.ts" />
+/// <reference path="repl.d.ts" />
+/// <reference path="stream.d.ts" />
+/// <reference path="stream/promises.d.ts" />
+/// <reference path="stream/consumers.d.ts" />
+/// <reference path="stream/web.d.ts" />
+/// <reference path="string_decoder.d.ts" />
+/// <reference path="test.d.ts" />
+/// <reference path="timers.d.ts" />
+/// <reference path="timers/promises.d.ts" />
+/// <reference path="tls.d.ts" />
+/// <reference path="trace_events.d.ts" />
+/// <reference path="tty.d.ts" />
+/// <reference path="url.d.ts" />
+/// <reference path="util.d.ts" />
+/// <reference path="v8.d.ts" />
+/// <reference path="vm.d.ts" />
+/// <reference path="wasi.d.ts" />
+/// <reference path="worker_threads.d.ts" />
+/// <reference path="zlib.d.ts" />
+
+/// <reference path="globals.global.d.ts" />
diff --git a/client/node_modules/@types/node/ts4.8/inspector.d.ts b/client/node_modules/@types/node/ts4.8/inspector.d.ts
new file mode 100644
index 0000000..9022f38
--- /dev/null
+++ b/client/node_modules/@types/node/ts4.8/inspector.d.ts
@@ -0,0 +1,2739 @@
+// Type definitions for inspector
+
+// These definitions are auto-generated.
+// Please see https://github.com/DefinitelyTyped/DefinitelyTyped/pull/19330
+// for more information.
+
+
+/**
+ * The `inspector` module provides an API for interacting with the V8 inspector.
+ *
+ * It can be accessed using:
+ *
+ * ```js
+ * const inspector = require('inspector');
+ * ```
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/inspector.js)
+ */
+declare module 'inspector' {
+ import EventEmitter = require('node:events');
+ interface InspectorNotification<T> {
+ method: string;
+ params: T;
+ }
+ namespace Schema {
+ /**
+ * Description of the protocol domain.
+ */
+ interface Domain {
+ /**
+ * Domain name.
+ */
+ name: string;
+ /**
+ * Domain version.
+ */
+ version: string;
+ }
+ interface GetDomainsReturnType {
+ /**
+ * List of supported domains.
+ */
+ domains: Domain[];
+ }
+ }
+ namespace Runtime {
+ /**
+ * Unique script identifier.
+ */
+ type ScriptId = string;
+ /**
+ * Unique object identifier.
+ */
+ type RemoteObjectId = string;
+ /**
+ * Primitive value which cannot be JSON-stringified.
+ */
+ type UnserializableValue = string;
+ /**
+ * Mirror object referencing original JavaScript object.
+ */
+ interface RemoteObject {
+ /**
+ * Object type.
+ */
+ type: string;
+ /**
+ * Object subtype hint. Specified for <code>object</code> type values only.
+ */
+ subtype?: string | undefined;
+ /**
+ * Object class (constructor) name. Specified for <code>object</code> type values only.
+ */
+ className?: string | undefined;
+ /**
+ * Remote object value in case of primitive values or JSON values (if it was requested).
+ */
+ value?: any;
+ /**
+ * Primitive value which can not be JSON-stringified does not have <code>value</code>, but gets this property.
+ */
+ unserializableValue?: UnserializableValue | undefined;
+ /**
+ * String representation of the object.
+ */
+ description?: string | undefined;
+ /**
+ * Unique object identifier (for non-primitive values).
+ */
+ objectId?: RemoteObjectId | undefined;
+ /**
+ * Preview containing abbreviated property values. Specified for <code>object</code> type values only.
+ * @experimental
+ */
+ preview?: ObjectPreview | undefined;
+ /**
+ * @experimental
+ */
+ customPreview?: CustomPreview | undefined;
+ }
+ /**
+ * @experimental
+ */
+ interface CustomPreview {
+ header: string;
+ hasBody: boolean;
+ formatterObjectId: RemoteObjectId;
+ bindRemoteObjectFunctionId: RemoteObjectId;
+ configObjectId?: RemoteObjectId | undefined;
+ }
+ /**
+ * Object containing abbreviated remote object value.
+ * @experimental
+ */
+ interface ObjectPreview {
+ /**
+ * Object type.
+ */
+ type: string;
+ /**
+ * Object subtype hint. Specified for <code>object</code> type values only.
+ */
+ subtype?: string | undefined;
+ /**
+ * String representation of the object.
+ */
+ description?: string | undefined;
+ /**
+ * True iff some of the properties or entries of the original object did not fit.
+ */
+ overflow: boolean;
+ /**
+ * List of the properties.
+ */
+ properties: PropertyPreview[];
+ /**
+ * List of the entries. Specified for <code>map</code> and <code>set</code> subtype values only.
+ */
+ entries?: EntryPreview[] | undefined;
+ }
+ /**
+ * @experimental
+ */
+ interface PropertyPreview {
+ /**
+ * Property name.
+ */
+ name: string;
+ /**
+ * Object type. Accessor means that the property itself is an accessor property.
+ */
+ type: string;
+ /**
+ * User-friendly property value string.
+ */
+ value?: string | undefined;
+ /**
+ * Nested value preview.
+ */
+ valuePreview?: ObjectPreview | undefined;
+ /**
+ * Object subtype hint. Specified for <code>object</code> type values only.
+ */
+ subtype?: string | undefined;
+ }
+ /**
+ * @experimental
+ */
+ interface EntryPreview {
+ /**
+ * Preview of the key. Specified for map-like collection entries.
+ */
+ key?: ObjectPreview | undefined;
+ /**
+ * Preview of the value.
+ */
+ value: ObjectPreview;
+ }
+ /**
+ * Object property descriptor.
+ */
+ interface PropertyDescriptor {
+ /**
+ * Property name or symbol description.
+ */
+ name: string;
+ /**
+ * The value associated with the property.
+ */
+ value?: RemoteObject | undefined;
+ /**
+ * True if the value associated with the property may be changed (data descriptors only).
+ */
+ writable?: boolean | undefined;
+ /**
+ * A function which serves as a getter for the property, or <code>undefined</code> if there is no getter (accessor descriptors only).
+ */
+ get?: RemoteObject | undefined;
+ /**
+ * A function which serves as a setter for the property, or <code>undefined</code> if there is no setter (accessor descriptors only).
+ */
+ set?: RemoteObject | undefined;
+ /**
+ * True if the type of this property descriptor may be changed and if the property may be deleted from the corresponding object.
+ */
+ configurable: boolean;
+ /**
+ * True if this property shows up during enumeration of the properties on the corresponding object.
+ */
+ enumerable: boolean;
+ /**
+ * True if the result was thrown during the evaluation.
+ */
+ wasThrown?: boolean | undefined;
+ /**
+ * True if the property is owned for the object.
+ */
+ isOwn?: boolean | undefined;
+ /**
+ * Property symbol object, if the property is of the <code>symbol</code> type.
+ */
+ symbol?: RemoteObject | undefined;
+ }
+ /**
+ * Object internal property descriptor. This property isn't normally visible in JavaScript code.
+ */
+ interface InternalPropertyDescriptor {
+ /**
+ * Conventional property name.
+ */
+ name: string;
+ /**
+ * The value associated with the property.
+ */
+ value?: RemoteObject | undefined;
+ }
+ /**
+ * Represents function call argument. Either remote object id <code>objectId</code>, primitive <code>value</code>, unserializable primitive value or neither of (for undefined) them should be specified.
+ */
+ interface CallArgument {
+ /**
+ * Primitive value or serializable javascript object.
+ */
+ value?: any;
+ /**
+ * Primitive value which can not be JSON-stringified.
+ */
+ unserializableValue?: UnserializableValue | undefined;
+ /**
+ * Remote object handle.
+ */
+ objectId?: RemoteObjectId | undefined;
+ }
+ /**
+ * Id of an execution context.
+ */
+ type ExecutionContextId = number;
+ /**
+ * Description of an isolated world.
+ */
+ interface ExecutionContextDescription {
+ /**
+ * Unique id of the execution context. It can be used to specify in which execution context script evaluation should be performed.
+ */
+ id: ExecutionContextId;
+ /**
+ * Execution context origin.
+ */
+ origin: string;
+ /**
+ * Human readable name describing given context.
+ */
+ name: string;
+ /**
+ * Embedder-specific auxiliary data.
+ */
+ auxData?: {} | undefined;
+ }
+ /**
+ * Detailed information about exception (or error) that was thrown during script compilation or execution.
+ */
+ interface ExceptionDetails {
+ /**
+ * Exception id.
+ */
+ exceptionId: number;
+ /**
+ * Exception text, which should be used together with exception object when available.
+ */
+ text: string;
+ /**
+ * Line number of the exception location (0-based).
+ */
+ lineNumber: number;
+ /**
+ * Column number of the exception location (0-based).
+ */
+ columnNumber: number;
+ /**
+ * Script ID of the exception location.
+ */
+ scriptId?: ScriptId | undefined;
+ /**
+ * URL of the exception location, to be used when the script was not reported.
+ */
+ url?: string | undefined;
+ /**
+ * JavaScript stack trace if available.
+ */
+ stackTrace?: StackTrace | undefined;
+ /**
+ * Exception object if available.
+ */
+ exception?: RemoteObject | undefined;
+ /**
+ * Identifier of the context where exception happened.
+ */
+ executionContextId?: ExecutionContextId | undefined;
+ }
+ /**
+ * Number of milliseconds since epoch.
+ */
+ type Timestamp = number;
+ /**
+ * Stack entry for runtime errors and assertions.
+ */
+ interface CallFrame {
+ /**
+ * JavaScript function name.
+ */
+ functionName: string;
+ /**
+ * JavaScript script id.
+ */
+ scriptId: ScriptId;
+ /**
+ * JavaScript script name or url.
+ */
+ url: string;
+ /**
+ * JavaScript script line number (0-based).
+ */
+ lineNumber: number;
+ /**
+ * JavaScript script column number (0-based).
+ */
+ columnNumber: number;
+ }
+ /**
+ * Call frames for assertions or error messages.
+ */
+ interface StackTrace {
+ /**
+ * String label of this stack trace. For async traces this may be a name of the function that initiated the async call.
+ */
+ description?: string | undefined;
+ /**
+ * JavaScript function name.
+ */
+ callFrames: CallFrame[];
+ /**
+ * Asynchronous JavaScript stack trace that preceded this stack, if available.
+ */
+ parent?: StackTrace | undefined;
+ /**
+ * Asynchronous JavaScript stack trace that preceded this stack, if available.
+ * @experimental
+ */
+ parentId?: StackTraceId | undefined;
+ }
+ /**
+ * Unique identifier of current debugger.
+ * @experimental
+ */
+ type UniqueDebuggerId = string;
+ /**
+ * If <code>debuggerId</code> is set stack trace comes from another debugger and can be resolved there. This allows to track cross-debugger calls. See <code>Runtime.StackTrace</code> and <code>Debugger.paused</code> for usages.
+ * @experimental
+ */
+ interface StackTraceId {
+ id: string;
+ debuggerId?: UniqueDebuggerId | undefined;
+ }
+ interface EvaluateParameterType {
+ /**
+ * Expression to evaluate.
+ */
+ expression: string;
+ /**
+ * Symbolic group name that can be used to release multiple objects.
+ */
+ objectGroup?: string | undefined;
+ /**
+ * Determines whether Command Line API should be available during the evaluation.
+ */
+ includeCommandLineAPI?: boolean | undefined;
+ /**
+ * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides <code>setPauseOnException</code> state.
+ */
+ silent?: boolean | undefined;
+ /**
+ * Specifies in which execution context to perform evaluation. If the parameter is omitted the evaluation will be performed in the context of the inspected page.
+ */
+ contextId?: ExecutionContextId | undefined;
+ /**
+ * Whether the result is expected to be a JSON object that should be sent by value.
+ */
+ returnByValue?: boolean | undefined;
+ /**
+ * Whether preview should be generated for the result.
+ * @experimental
+ */
+ generatePreview?: boolean | undefined;
+ /**
+ * Whether execution should be treated as initiated by user in the UI.
+ */
+ userGesture?: boolean | undefined;
+ /**
+ * Whether execution should <code>await</code> for resulting value and return once awaited promise is resolved.
+ */
+ awaitPromise?: boolean | undefined;
+ }
+ interface AwaitPromiseParameterType {
+ /**
+ * Identifier of the promise.
+ */
+ promiseObjectId: RemoteObjectId;
+ /**
+ * Whether the result is expected to be a JSON object that should be sent by value.
+ */
+ returnByValue?: boolean | undefined;
+ /**
+ * Whether preview should be generated for the result.
+ */
+ generatePreview?: boolean | undefined;
+ }
+ interface CallFunctionOnParameterType {
+ /**
+ * Declaration of the function to call.
+ */
+ functionDeclaration: string;
+ /**
+ * Identifier of the object to call function on. Either objectId or executionContextId should be specified.
+ */
+ objectId?: RemoteObjectId | undefined;
+ /**
+ * Call arguments. All call arguments must belong to the same JavaScript world as the target object.
+ */
+ arguments?: CallArgument[] | undefined;
+ /**
+ * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides <code>setPauseOnException</code> state.
+ */
+ silent?: boolean | undefined;
+ /**
+ * Whether the result is expected to be a JSON object which should be sent by value.
+ */
+ returnByValue?: boolean | undefined;
+ /**
+ * Whether preview should be generated for the result.
+ * @experimental
+ */
+ generatePreview?: boolean | undefined;
+ /**
+ * Whether execution should be treated as initiated by user in the UI.
+ */
+ userGesture?: boolean | undefined;
+ /**
+ * Whether execution should <code>await</code> for resulting value and return once awaited promise is resolved.
+ */
+ awaitPromise?: boolean | undefined;
+ /**
+ * Specifies execution context which global object will be used to call function on. Either executionContextId or objectId should be specified.
+ */
+ executionContextId?: ExecutionContextId | undefined;
+ /**
+ * Symbolic group name that can be used to release multiple objects. If objectGroup is not specified and objectId is, objectGroup will be inherited from object.
+ */
+ objectGroup?: string | undefined;
+ }
+ interface GetPropertiesParameterType {
+ /**
+ * Identifier of the object to return properties for.
+ */
+ objectId: RemoteObjectId;
+ /**
+ * If true, returns properties belonging only to the element itself, not to its prototype chain.
+ */
+ ownProperties?: boolean | undefined;
+ /**
+ * If true, returns accessor properties (with getter/setter) only; internal properties are not returned either.
+ * @experimental
+ */
+ accessorPropertiesOnly?: boolean | undefined;
+ /**
+ * Whether preview should be generated for the results.
+ * @experimental
+ */
+ generatePreview?: boolean | undefined;
+ }
+ interface ReleaseObjectParameterType {
+ /**
+ * Identifier of the object to release.
+ */
+ objectId: RemoteObjectId;
+ }
+ interface ReleaseObjectGroupParameterType {
+ /**
+ * Symbolic object group name.
+ */
+ objectGroup: string;
+ }
+ interface SetCustomObjectFormatterEnabledParameterType {
+ enabled: boolean;
+ }
+ interface CompileScriptParameterType {
+ /**
+ * Expression to compile.
+ */
+ expression: string;
+ /**
+ * Source url to be set for the script.
+ */
+ sourceURL: string;
+ /**
+ * Specifies whether the compiled script should be persisted.
+ */
+ persistScript: boolean;
+ /**
+ * Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page.
+ */
+ executionContextId?: ExecutionContextId | undefined;
+ }
+ interface RunScriptParameterType {
+ /**
+ * Id of the script to run.
+ */
+ scriptId: ScriptId;
+ /**
+ * Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page.
+ */
+ executionContextId?: ExecutionContextId | undefined;
+ /**
+ * Symbolic group name that can be used to release multiple objects.
+ */
+ objectGroup?: string | undefined;
+ /**
+ * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides <code>setPauseOnException</code> state.
+ */
+ silent?: boolean | undefined;
+ /**
+ * Determines whether Command Line API should be available during the evaluation.
+ */
+ includeCommandLineAPI?: boolean | undefined;
+ /**
+ * Whether the result is expected to be a JSON object which should be sent by value.
+ */
+ returnByValue?: boolean | undefined;
+ /**
+ * Whether preview should be generated for the result.
+ */
+ generatePreview?: boolean | undefined;
+ /**
+ * Whether execution should <code>await</code> for resulting value and return once awaited promise is resolved.
+ */
+ awaitPromise?: boolean | undefined;
+ }
+ interface QueryObjectsParameterType {
+ /**
+ * Identifier of the prototype to return objects for.
+ */
+ prototypeObjectId: RemoteObjectId;
+ }
+ interface GlobalLexicalScopeNamesParameterType {
+ /**
+ * Specifies in which execution context to lookup global scope variables.
+ */
+ executionContextId?: ExecutionContextId | undefined;
+ }
+ interface EvaluateReturnType {
+ /**
+ * Evaluation result.
+ */
+ result: RemoteObject;
+ /**
+ * Exception details.
+ */
+ exceptionDetails?: ExceptionDetails | undefined;
+ }
+ interface AwaitPromiseReturnType {
+ /**
+ * Promise result. Will contain rejected value if promise was rejected.
+ */
+ result: RemoteObject;
+ /**
+ * Exception details if stack strace is available.
+ */
+ exceptionDetails?: ExceptionDetails | undefined;
+ }
+ interface CallFunctionOnReturnType {
+ /**
+ * Call result.
+ */
+ result: RemoteObject;
+ /**
+ * Exception details.
+ */
+ exceptionDetails?: ExceptionDetails | undefined;
+ }
+ interface GetPropertiesReturnType {
+ /**
+ * Object properties.
+ */
+ result: PropertyDescriptor[];
+ /**
+ * Internal object properties (only of the element itself).
+ */
+ internalProperties?: InternalPropertyDescriptor[] | undefined;
+ /**
+ * Exception details.
+ */
+ exceptionDetails?: ExceptionDetails | undefined;
+ }
+ interface CompileScriptReturnType {
+ /**
+ * Id of the script.
+ */
+ scriptId?: ScriptId | undefined;
+ /**
+ * Exception details.
+ */
+ exceptionDetails?: ExceptionDetails | undefined;
+ }
+ interface RunScriptReturnType {
+ /**
+ * Run result.
+ */
+ result: RemoteObject;
+ /**
+ * Exception details.
+ */
+ exceptionDetails?: ExceptionDetails | undefined;
+ }
+ interface QueryObjectsReturnType {
+ /**
+ * Array with objects.
+ */
+ objects: RemoteObject;
+ }
+ interface GlobalLexicalScopeNamesReturnType {
+ names: string[];
+ }
+ interface ExecutionContextCreatedEventDataType {
+ /**
+ * A newly created execution context.
+ */
+ context: ExecutionContextDescription;
+ }
+ interface ExecutionContextDestroyedEventDataType {
+ /**
+ * Id of the destroyed context
+ */
+ executionContextId: ExecutionContextId;
+ }
+ interface ExceptionThrownEventDataType {
+ /**
+ * Timestamp of the exception.
+ */
+ timestamp: Timestamp;
+ exceptionDetails: ExceptionDetails;
+ }
+ interface ExceptionRevokedEventDataType {
+ /**
+ * Reason describing why exception was revoked.
+ */
+ reason: string;
+ /**
+ * The id of revoked exception, as reported in <code>exceptionThrown</code>.
+ */
+ exceptionId: number;
+ }
+ interface ConsoleAPICalledEventDataType {
+ /**
+ * Type of the call.
+ */
+ type: string;
+ /**
+ * Call arguments.
+ */
+ args: RemoteObject[];
+ /**
+ * Identifier of the context where the call was made.
+ */
+ executionContextId: ExecutionContextId;
+ /**
+ * Call timestamp.
+ */
+ timestamp: Timestamp;
+ /**
+ * Stack trace captured when the call was made.
+ */
+ stackTrace?: StackTrace | undefined;
+ /**
+ * Console context descriptor for calls on non-default console context (not console.*): 'anonymous#unique-logger-id' for call on unnamed context, 'name#unique-logger-id' for call on named context.
+ * @experimental
+ */
+ context?: string | undefined;
+ }
+ interface InspectRequestedEventDataType {
+ object: RemoteObject;
+ hints: {};
+ }
+ }
+ namespace Debugger {
+ /**
+ * Breakpoint identifier.
+ */
+ type BreakpointId = string;
+ /**
+ * Call frame identifier.
+ */
+ type CallFrameId = string;
+ /**
+ * Location in the source code.
+ */
+ interface Location {
+ /**
+ * Script identifier as reported in the <code>Debugger.scriptParsed</code>.
+ */
+ scriptId: Runtime.ScriptId;
+ /**
+ * Line number in the script (0-based).
+ */
+ lineNumber: number;
+ /**
+ * Column number in the script (0-based).
+ */
+ columnNumber?: number | undefined;
+ }
+ /**
+ * Location in the source code.
+ * @experimental
+ */
+ interface ScriptPosition {
+ lineNumber: number;
+ columnNumber: number;
+ }
+ /**
+ * JavaScript call frame. Array of call frames form the call stack.
+ */
+ interface CallFrame {
+ /**
+ * Call frame identifier. This identifier is only valid while the virtual machine is paused.
+ */
+ callFrameId: CallFrameId;
+ /**
+ * Name of the JavaScript function called on this call frame.
+ */
+ functionName: string;
+ /**
+ * Location in the source code.
+ */
+ functionLocation?: Location | undefined;
+ /**
+ * Location in the source code.
+ */
+ location: Location;
+ /**
+ * JavaScript script name or url.
+ */
+ url: string;
+ /**
+ * Scope chain for this call frame.
+ */
+ scopeChain: Scope[];
+ /**
+ * <code>this</code> object for this call frame.
+ */
+ this: Runtime.RemoteObject;
+ /**
+ * The value being returned, if the function is at return point.
+ */
+ returnValue?: Runtime.RemoteObject | undefined;
+ }
+ /**
+ * Scope description.
+ */
+ interface Scope {
+ /**
+ * Scope type.
+ */
+ type: string;
+ /**
+ * Object representing the scope. For <code>global</code> and <code>with</code> scopes it represents the actual object; for the rest of the scopes, it is artificial transient object enumerating scope variables as its properties.
+ */
+ object: Runtime.RemoteObject;
+ name?: string | undefined;
+ /**
+ * Location in the source code where scope starts
+ */
+ startLocation?: Location | undefined;
+ /**
+ * Location in the source code where scope ends
+ */
+ endLocation?: Location | undefined;
+ }
+ /**
+ * Search match for resource.
+ */
+ interface SearchMatch {
+ /**
+ * Line number in resource content.
+ */
+ lineNumber: number;
+ /**
+ * Line with match content.
+ */
+ lineContent: string;
+ }
+ interface BreakLocation {
+ /**
+ * Script identifier as reported in the <code>Debugger.scriptParsed</code>.
+ */
+ scriptId: Runtime.ScriptId;
+ /**
+ * Line number in the script (0-based).
+ */
+ lineNumber: number;
+ /**
+ * Column number in the script (0-based).
+ */
+ columnNumber?: number | undefined;
+ type?: string | undefined;
+ }
+ interface SetBreakpointsActiveParameterType {
+ /**
+ * New value for breakpoints active state.
+ */
+ active: boolean;
+ }
+ interface SetSkipAllPausesParameterType {
+ /**
+ * New value for skip pauses state.
+ */
+ skip: boolean;
+ }
+ interface SetBreakpointByUrlParameterType {
+ /**
+ * Line number to set breakpoint at.
+ */
+ lineNumber: number;
+ /**
+ * URL of the resources to set breakpoint on.
+ */
+ url?: string | undefined;
+ /**
+ * Regex pattern for the URLs of the resources to set breakpoints on. Either <code>url</code> or <code>urlRegex</code> must be specified.
+ */
+ urlRegex?: string | undefined;
+ /**
+ * Script hash of the resources to set breakpoint on.
+ */
+ scriptHash?: string | undefined;
+ /**
+ * Offset in the line to set breakpoint at.
+ */
+ columnNumber?: number | undefined;
+ /**
+ * Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true.
+ */
+ condition?: string | undefined;
+ }
+ interface SetBreakpointParameterType {
+ /**
+ * Location to set breakpoint in.
+ */
+ location: Location;
+ /**
+ * Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true.
+ */
+ condition?: string | undefined;
+ }
+ interface RemoveBreakpointParameterType {
+ breakpointId: BreakpointId;
+ }
+ interface GetPossibleBreakpointsParameterType {
+ /**
+ * Start of range to search possible breakpoint locations in.
+ */
+ start: Location;
+ /**
+ * End of range to search possible breakpoint locations in (excluding). When not specified, end of scripts is used as end of range.
+ */
+ end?: Location | undefined;
+ /**
+ * Only consider locations which are in the same (non-nested) function as start.
+ */
+ restrictToFunction?: boolean | undefined;
+ }
+ interface ContinueToLocationParameterType {
+ /**
+ * Location to continue to.
+ */
+ location: Location;
+ targetCallFrames?: string | undefined;
+ }
+ interface PauseOnAsyncCallParameterType {
+ /**
+ * Debugger will pause when async call with given stack trace is started.
+ */
+ parentStackTraceId: Runtime.StackTraceId;
+ }
+ interface StepIntoParameterType {
+ /**
+ * Debugger will issue additional Debugger.paused notification if any async task is scheduled before next pause.
+ * @experimental
+ */
+ breakOnAsyncCall?: boolean | undefined;
+ }
+ interface GetStackTraceParameterType {
+ stackTraceId: Runtime.StackTraceId;
+ }
+ interface SearchInContentParameterType {
+ /**
+ * Id of the script to search in.
+ */
+ scriptId: Runtime.ScriptId;
+ /**
+ * String to search for.
+ */
+ query: string;
+ /**
+ * If true, search is case sensitive.
+ */
+ caseSensitive?: boolean | undefined;
+ /**
+ * If true, treats string parameter as regex.
+ */
+ isRegex?: boolean | undefined;
+ }
+ interface SetScriptSourceParameterType {
+ /**
+ * Id of the script to edit.
+ */
+ scriptId: Runtime.ScriptId;
+ /**
+ * New content of the script.
+ */
+ scriptSource: string;
+ /**
+ * If true the change will not actually be applied. Dry run may be used to get result description without actually modifying the code.
+ */
+ dryRun?: boolean | undefined;
+ }
+ interface RestartFrameParameterType {
+ /**
+ * Call frame identifier to evaluate on.
+ */
+ callFrameId: CallFrameId;
+ }
+ interface GetScriptSourceParameterType {
+ /**
+ * Id of the script to get source for.
+ */
+ scriptId: Runtime.ScriptId;
+ }
+ interface SetPauseOnExceptionsParameterType {
+ /**
+ * Pause on exceptions mode.
+ */
+ state: string;
+ }
+ interface EvaluateOnCallFrameParameterType {
+ /**
+ * Call frame identifier to evaluate on.
+ */
+ callFrameId: CallFrameId;
+ /**
+ * Expression to evaluate.
+ */
+ expression: string;
+ /**
+ * String object group name to put result into (allows rapid releasing resulting object handles using <code>releaseObjectGroup</code>).
+ */
+ objectGroup?: string | undefined;
+ /**
+ * Specifies whether command line API should be available to the evaluated expression, defaults to false.
+ */
+ includeCommandLineAPI?: boolean | undefined;
+ /**
+ * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides <code>setPauseOnException</code> state.
+ */
+ silent?: boolean | undefined;
+ /**
+ * Whether the result is expected to be a JSON object that should be sent by value.
+ */
+ returnByValue?: boolean | undefined;
+ /**
+ * Whether preview should be generated for the result.
+ * @experimental
+ */
+ generatePreview?: boolean | undefined;
+ /**
+ * Whether to throw an exception if side effect cannot be ruled out during evaluation.
+ */
+ throwOnSideEffect?: boolean | undefined;
+ }
+ interface SetVariableValueParameterType {
+ /**
+ * 0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch' scope types are allowed. Other scopes could be manipulated manually.
+ */
+ scopeNumber: number;
+ /**
+ * Variable name.
+ */
+ variableName: string;
+ /**
+ * New variable value.
+ */
+ newValue: Runtime.CallArgument;
+ /**
+ * Id of callframe that holds variable.
+ */
+ callFrameId: CallFrameId;
+ }
+ interface SetReturnValueParameterType {
+ /**
+ * New return value.
+ */
+ newValue: Runtime.CallArgument;
+ }
+ interface SetAsyncCallStackDepthParameterType {
+ /**
+ * Maximum depth of async call stacks. Setting to <code>0</code> will effectively disable collecting async call stacks (default).
+ */
+ maxDepth: number;
+ }
+ interface SetBlackboxPatternsParameterType {
+ /**
+ * Array of regexps that will be used to check script url for blackbox state.
+ */
+ patterns: string[];
+ }
+ interface SetBlackboxedRangesParameterType {
+ /**
+ * Id of the script.
+ */
+ scriptId: Runtime.ScriptId;
+ positions: ScriptPosition[];
+ }
+ interface EnableReturnType {
+ /**
+ * Unique identifier of the debugger.
+ * @experimental
+ */
+ debuggerId: Runtime.UniqueDebuggerId;
+ }
+ interface SetBreakpointByUrlReturnType {
+ /**
+ * Id of the created breakpoint for further reference.
+ */
+ breakpointId: BreakpointId;
+ /**
+ * List of the locations this breakpoint resolved into upon addition.
+ */
+ locations: Location[];
+ }
+ interface SetBreakpointReturnType {
+ /**
+ * Id of the created breakpoint for further reference.
+ */
+ breakpointId: BreakpointId;
+ /**
+ * Location this breakpoint resolved into.
+ */
+ actualLocation: Location;
+ }
+ interface GetPossibleBreakpointsReturnType {
+ /**
+ * List of the possible breakpoint locations.
+ */
+ locations: BreakLocation[];
+ }
+ interface GetStackTraceReturnType {
+ stackTrace: Runtime.StackTrace;
+ }
+ interface SearchInContentReturnType {
+ /**
+ * List of search matches.
+ */
+ result: SearchMatch[];
+ }
+ interface SetScriptSourceReturnType {
+ /**
+ * New stack trace in case editing has happened while VM was stopped.
+ */
+ callFrames?: CallFrame[] | undefined;
+ /**
+ * Whether current call stack was modified after applying the changes.
+ */
+ stackChanged?: boolean | undefined;
+ /**
+ * Async stack trace, if any.
+ */
+ asyncStackTrace?: Runtime.StackTrace | undefined;
+ /**
+ * Async stack trace, if any.
+ * @experimental
+ */
+ asyncStackTraceId?: Runtime.StackTraceId | undefined;
+ /**
+ * Exception details if any.
+ */
+ exceptionDetails?: Runtime.ExceptionDetails | undefined;
+ }
+ interface RestartFrameReturnType {
+ /**
+ * New stack trace.
+ */
+ callFrames: CallFrame[];
+ /**
+ * Async stack trace, if any.
+ */
+ asyncStackTrace?: Runtime.StackTrace | undefined;
+ /**
+ * Async stack trace, if any.
+ * @experimental
+ */
+ asyncStackTraceId?: Runtime.StackTraceId | undefined;
+ }
+ interface GetScriptSourceReturnType {
+ /**
+ * Script source.
+ */
+ scriptSource: string;
+ }
+ interface EvaluateOnCallFrameReturnType {
+ /**
+ * Object wrapper for the evaluation result.
+ */
+ result: Runtime.RemoteObject;
+ /**
+ * Exception details.
+ */
+ exceptionDetails?: Runtime.ExceptionDetails | undefined;
+ }
+ interface ScriptParsedEventDataType {
+ /**
+ * Identifier of the script parsed.
+ */
+ scriptId: Runtime.ScriptId;
+ /**
+ * URL or name of the script parsed (if any).
+ */
+ url: string;
+ /**
+ * Line offset of the script within the resource with given URL (for script tags).
+ */
+ startLine: number;
+ /**
+ * Column offset of the script within the resource with given URL.
+ */
+ startColumn: number;
+ /**
+ * Last line of the script.
+ */
+ endLine: number;
+ /**
+ * Length of the last line of the script.
+ */
+ endColumn: number;
+ /**
+ * Specifies script creation context.
+ */
+ executionContextId: Runtime.ExecutionContextId;
+ /**
+ * Content hash of the script.
+ */
+ hash: string;
+ /**
+ * Embedder-specific auxiliary data.
+ */
+ executionContextAuxData?: {} | undefined;
+ /**
+ * True, if this script is generated as a result of the live edit operation.
+ * @experimental
+ */
+ isLiveEdit?: boolean | undefined;
+ /**
+ * URL of source map associated with script (if any).
+ */
+ sourceMapURL?: string | undefined;
+ /**
+ * True, if this script has sourceURL.
+ */
+ hasSourceURL?: boolean | undefined;
+ /**
+ * True, if this script is ES6 module.
+ */
+ isModule?: boolean | undefined;
+ /**
+ * This script length.
+ */
+ length?: number | undefined;
+ /**
+ * JavaScript top stack frame of where the script parsed event was triggered if available.
+ * @experimental
+ */
+ stackTrace?: Runtime.StackTrace | undefined;
+ }
+ interface ScriptFailedToParseEventDataType {
+ /**
+ * Identifier of the script parsed.
+ */
+ scriptId: Runtime.ScriptId;
+ /**
+ * URL or name of the script parsed (if any).
+ */
+ url: string;
+ /**
+ * Line offset of the script within the resource with given URL (for script tags).
+ */
+ startLine: number;
+ /**
+ * Column offset of the script within the resource with given URL.
+ */
+ startColumn: number;
+ /**
+ * Last line of the script.
+ */
+ endLine: number;
+ /**
+ * Length of the last line of the script.
+ */
+ endColumn: number;
+ /**
+ * Specifies script creation context.
+ */
+ executionContextId: Runtime.ExecutionContextId;
+ /**
+ * Content hash of the script.
+ */
+ hash: string;
+ /**
+ * Embedder-specific auxiliary data.
+ */
+ executionContextAuxData?: {} | undefined;
+ /**
+ * URL of source map associated with script (if any).
+ */
+ sourceMapURL?: string | undefined;
+ /**
+ * True, if this script has sourceURL.
+ */
+ hasSourceURL?: boolean | undefined;
+ /**
+ * True, if this script is ES6 module.
+ */
+ isModule?: boolean | undefined;
+ /**
+ * This script length.
+ */
+ length?: number | undefined;
+ /**
+ * JavaScript top stack frame of where the script parsed event was triggered if available.
+ * @experimental
+ */
+ stackTrace?: Runtime.StackTrace | undefined;
+ }
+ interface BreakpointResolvedEventDataType {
+ /**
+ * Breakpoint unique identifier.
+ */
+ breakpointId: BreakpointId;
+ /**
+ * Actual breakpoint location.
+ */
+ location: Location;
+ }
+ interface PausedEventDataType {
+ /**
+ * Call stack the virtual machine stopped on.
+ */
+ callFrames: CallFrame[];
+ /**
+ * Pause reason.
+ */
+ reason: string;
+ /**
+ * Object containing break-specific auxiliary properties.
+ */
+ data?: {} | undefined;
+ /**
+ * Hit breakpoints IDs
+ */
+ hitBreakpoints?: string[] | undefined;
+ /**
+ * Async stack trace, if any.
+ */
+ asyncStackTrace?: Runtime.StackTrace | undefined;
+ /**
+ * Async stack trace, if any.
+ * @experimental
+ */
+ asyncStackTraceId?: Runtime.StackTraceId | undefined;
+ /**
+ * Just scheduled async call will have this stack trace as parent stack during async execution. This field is available only after <code>Debugger.stepInto</code> call with <code>breakOnAsynCall</code> flag.
+ * @experimental
+ */
+ asyncCallStackTraceId?: Runtime.StackTraceId | undefined;
+ }
+ }
+ namespace Console {
+ /**
+ * Console message.
+ */
+ interface ConsoleMessage {
+ /**
+ * Message source.
+ */
+ source: string;
+ /**
+ * Message severity.
+ */
+ level: string;
+ /**
+ * Message text.
+ */
+ text: string;
+ /**
+ * URL of the message origin.
+ */
+ url?: string | undefined;
+ /**
+ * Line number in the resource that generated this message (1-based).
+ */
+ line?: number | undefined;
+ /**
+ * Column number in the resource that generated this message (1-based).
+ */
+ column?: number | undefined;
+ }
+ interface MessageAddedEventDataType {
+ /**
+ * Console message that has been added.
+ */
+ message: ConsoleMessage;
+ }
+ }
+ namespace Profiler {
+ /**
+ * Profile node. Holds callsite information, execution statistics and child nodes.
+ */
+ interface ProfileNode {
+ /**
+ * Unique id of the node.
+ */
+ id: number;
+ /**
+ * Function location.
+ */
+ callFrame: Runtime.CallFrame;
+ /**
+ * Number of samples where this node was on top of the call stack.
+ */
+ hitCount?: number | undefined;
+ /**
+ * Child node ids.
+ */
+ children?: number[] | undefined;
+ /**
+ * The reason of being not optimized. The function may be deoptimized or marked as don't optimize.
+ */
+ deoptReason?: string | undefined;
+ /**
+ * An array of source position ticks.
+ */
+ positionTicks?: PositionTickInfo[] | undefined;
+ }
+ /**
+ * Profile.
+ */
+ interface Profile {
+ /**
+ * The list of profile nodes. First item is the root node.
+ */
+ nodes: ProfileNode[];
+ /**
+ * Profiling start timestamp in microseconds.
+ */
+ startTime: number;
+ /**
+ * Profiling end timestamp in microseconds.
+ */
+ endTime: number;
+ /**
+ * Ids of samples top nodes.
+ */
+ samples?: number[] | undefined;
+ /**
+ * Time intervals between adjacent samples in microseconds. The first delta is relative to the profile startTime.
+ */
+ timeDeltas?: number[] | undefined;
+ }
+ /**
+ * Specifies a number of samples attributed to a certain source position.
+ */
+ interface PositionTickInfo {
+ /**
+ * Source line number (1-based).
+ */
+ line: number;
+ /**
+ * Number of samples attributed to the source line.
+ */
+ ticks: number;
+ }
+ /**
+ * Coverage data for a source range.
+ */
+ interface CoverageRange {
+ /**
+ * JavaScript script source offset for the range start.
+ */
+ startOffset: number;
+ /**
+ * JavaScript script source offset for the range end.
+ */
+ endOffset: number;
+ /**
+ * Collected execution count of the source range.
+ */
+ count: number;
+ }
+ /**
+ * Coverage data for a JavaScript function.
+ */
+ interface FunctionCoverage {
+ /**
+ * JavaScript function name.
+ */
+ functionName: string;
+ /**
+ * Source ranges inside the function with coverage data.
+ */
+ ranges: CoverageRange[];
+ /**
+ * Whether coverage data for this function has block granularity.
+ */
+ isBlockCoverage: boolean;
+ }
+ /**
+ * Coverage data for a JavaScript script.
+ */
+ interface ScriptCoverage {
+ /**
+ * JavaScript script id.
+ */
+ scriptId: Runtime.ScriptId;
+ /**
+ * JavaScript script name or url.
+ */
+ url: string;
+ /**
+ * Functions contained in the script that has coverage data.
+ */
+ functions: FunctionCoverage[];
+ }
+ /**
+ * Describes a type collected during runtime.
+ * @experimental
+ */
+ interface TypeObject {
+ /**
+ * Name of a type collected with type profiling.
+ */
+ name: string;
+ }
+ /**
+ * Source offset and types for a parameter or return value.
+ * @experimental
+ */
+ interface TypeProfileEntry {
+ /**
+ * Source offset of the parameter or end of function for return values.
+ */
+ offset: number;
+ /**
+ * The types for this parameter or return value.
+ */
+ types: TypeObject[];
+ }
+ /**
+ * Type profile data collected during runtime for a JavaScript script.
+ * @experimental
+ */
+ interface ScriptTypeProfile {
+ /**
+ * JavaScript script id.
+ */
+ scriptId: Runtime.ScriptId;
+ /**
+ * JavaScript script name or url.
+ */
+ url: string;
+ /**
+ * Type profile entries for parameters and return values of the functions in the script.
+ */
+ entries: TypeProfileEntry[];
+ }
+ interface SetSamplingIntervalParameterType {
+ /**
+ * New sampling interval in microseconds.
+ */
+ interval: number;
+ }
+ interface StartPreciseCoverageParameterType {
+ /**
+ * Collect accurate call counts beyond simple 'covered' or 'not covered'.
+ */
+ callCount?: boolean | undefined;
+ /**
+ * Collect block-based coverage.
+ */
+ detailed?: boolean | undefined;
+ }
+ interface StopReturnType {
+ /**
+ * Recorded profile.
+ */
+ profile: Profile;
+ }
+ interface TakePreciseCoverageReturnType {
+ /**
+ * Coverage data for the current isolate.
+ */
+ result: ScriptCoverage[];
+ }
+ interface GetBestEffortCoverageReturnType {
+ /**
+ * Coverage data for the current isolate.
+ */
+ result: ScriptCoverage[];
+ }
+ interface TakeTypeProfileReturnType {
+ /**
+ * Type profile for all scripts since startTypeProfile() was turned on.
+ */
+ result: ScriptTypeProfile[];
+ }
+ interface ConsoleProfileStartedEventDataType {
+ id: string;
+ /**
+ * Location of console.profile().
+ */
+ location: Debugger.Location;
+ /**
+ * Profile title passed as an argument to console.profile().
+ */
+ title?: string | undefined;
+ }
+ interface ConsoleProfileFinishedEventDataType {
+ id: string;
+ /**
+ * Location of console.profileEnd().
+ */
+ location: Debugger.Location;
+ profile: Profile;
+ /**
+ * Profile title passed as an argument to console.profile().
+ */
+ title?: string | undefined;
+ }
+ }
+ namespace HeapProfiler {
+ /**
+ * Heap snapshot object id.
+ */
+ type HeapSnapshotObjectId = string;
+ /**
+ * Sampling Heap Profile node. Holds callsite information, allocation statistics and child nodes.
+ */
+ interface SamplingHeapProfileNode {
+ /**
+ * Function location.
+ */
+ callFrame: Runtime.CallFrame;
+ /**
+ * Allocations size in bytes for the node excluding children.
+ */
+ selfSize: number;
+ /**
+ * Child nodes.
+ */
+ children: SamplingHeapProfileNode[];
+ }
+ /**
+ * Profile.
+ */
+ interface SamplingHeapProfile {
+ head: SamplingHeapProfileNode;
+ }
+ interface StartTrackingHeapObjectsParameterType {
+ trackAllocations?: boolean | undefined;
+ }
+ interface StopTrackingHeapObjectsParameterType {
+ /**
+ * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken when the tracking is stopped.
+ */
+ reportProgress?: boolean | undefined;
+ }
+ interface TakeHeapSnapshotParameterType {
+ /**
+ * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken.
+ */
+ reportProgress?: boolean | undefined;
+ }
+ interface GetObjectByHeapObjectIdParameterType {
+ objectId: HeapSnapshotObjectId;
+ /**
+ * Symbolic group name that can be used to release multiple objects.
+ */
+ objectGroup?: string | undefined;
+ }
+ interface AddInspectedHeapObjectParameterType {
+ /**
+ * Heap snapshot object id to be accessible by means of $x command line API.
+ */
+ heapObjectId: HeapSnapshotObjectId;
+ }
+ interface GetHeapObjectIdParameterType {
+ /**
+ * Identifier of the object to get heap object id for.
+ */
+ objectId: Runtime.RemoteObjectId;
+ }
+ interface StartSamplingParameterType {
+ /**
+ * Average sample interval in bytes. Poisson distribution is used for the intervals. The default value is 32768 bytes.
+ */
+ samplingInterval?: number | undefined;
+ }
+ interface GetObjectByHeapObjectIdReturnType {
+ /**
+ * Evaluation result.
+ */
+ result: Runtime.RemoteObject;
+ }
+ interface GetHeapObjectIdReturnType {
+ /**
+ * Id of the heap snapshot object corresponding to the passed remote object id.
+ */
+ heapSnapshotObjectId: HeapSnapshotObjectId;
+ }
+ interface StopSamplingReturnType {
+ /**
+ * Recorded sampling heap profile.
+ */
+ profile: SamplingHeapProfile;
+ }
+ interface GetSamplingProfileReturnType {
+ /**
+ * Return the sampling profile being collected.
+ */
+ profile: SamplingHeapProfile;
+ }
+ interface AddHeapSnapshotChunkEventDataType {
+ chunk: string;
+ }
+ interface ReportHeapSnapshotProgressEventDataType {
+ done: number;
+ total: number;
+ finished?: boolean | undefined;
+ }
+ interface LastSeenObjectIdEventDataType {
+ lastSeenObjectId: number;
+ timestamp: number;
+ }
+ interface HeapStatsUpdateEventDataType {
+ /**
+ * An array of triplets. Each triplet describes a fragment. The first integer is the fragment index, the second integer is a total count of objects for the fragment, the third integer is a total size of the objects for the fragment.
+ */
+ statsUpdate: number[];
+ }
+ }
+ namespace NodeTracing {
+ interface TraceConfig {
+ /**
+ * Controls how the trace buffer stores data.
+ */
+ recordMode?: string | undefined;
+ /**
+ * Included category filters.
+ */
+ includedCategories: string[];
+ }
+ interface StartParameterType {
+ traceConfig: TraceConfig;
+ }
+ interface GetCategoriesReturnType {
+ /**
+ * A list of supported tracing categories.
+ */
+ categories: string[];
+ }
+ interface DataCollectedEventDataType {
+ value: Array<{}>;
+ }
+ }
+ namespace NodeWorker {
+ type WorkerID = string;
+ /**
+ * Unique identifier of attached debugging session.
+ */
+ type SessionID = string;
+ interface WorkerInfo {
+ workerId: WorkerID;
+ type: string;
+ title: string;
+ url: string;
+ }
+ interface SendMessageToWorkerParameterType {
+ message: string;
+ /**
+ * Identifier of the session.
+ */
+ sessionId: SessionID;
+ }
+ interface EnableParameterType {
+ /**
+ * Whether to new workers should be paused until the frontend sends `Runtime.runIfWaitingForDebugger`
+ * message to run them.
+ */
+ waitForDebuggerOnStart: boolean;
+ }
+ interface DetachParameterType {
+ sessionId: SessionID;
+ }
+ interface AttachedToWorkerEventDataType {
+ /**
+ * Identifier assigned to the session used to send/receive messages.
+ */
+ sessionId: SessionID;
+ workerInfo: WorkerInfo;
+ waitingForDebugger: boolean;
+ }
+ interface DetachedFromWorkerEventDataType {
+ /**
+ * Detached session identifier.
+ */
+ sessionId: SessionID;
+ }
+ interface ReceivedMessageFromWorkerEventDataType {
+ /**
+ * Identifier of a session which sends a message.
+ */
+ sessionId: SessionID;
+ message: string;
+ }
+ }
+ namespace NodeRuntime {
+ interface NotifyWhenWaitingForDisconnectParameterType {
+ enabled: boolean;
+ }
+ }
+ /**
+ * The `inspector.Session` is used for dispatching messages to the V8 inspector
+ * back-end and receiving message responses and notifications.
+ */
+ class Session extends EventEmitter {
+ /**
+ * Create a new instance of the inspector.Session class.
+ * The inspector session needs to be connected through session.connect() before the messages can be dispatched to the inspector backend.
+ */
+ constructor();
+ /**
+ * Connects a session to the inspector back-end.
+ * @since v8.0.0
+ */
+ connect(): void;
+ /**
+ * Immediately close the session. All pending message callbacks will be called
+ * with an error. `session.connect()` will need to be called to be able to send
+ * messages again. Reconnected session will lose all inspector state, such as
+ * enabled agents or configured breakpoints.
+ * @since v8.0.0
+ */
+ disconnect(): void;
+ /**
+ * Posts a message to the inspector back-end. `callback` will be notified when
+ * a response is received. `callback` is a function that accepts two optional
+ * arguments: error and message-specific result.
+ *
+ * ```js
+ * session.post('Runtime.evaluate', { expression: '2 + 2' },
+ * (error, { result }) => console.log(result));
+ * // Output: { type: 'number', value: 4, description: '4' }
+ * ```
+ *
+ * The latest version of the V8 inspector protocol is published on the [Chrome DevTools Protocol Viewer](https://chromedevtools.github.io/devtools-protocol/v8/).
+ *
+ * Node.js inspector supports all the Chrome DevTools Protocol domains declared
+ * by V8\. Chrome DevTools Protocol domain provides an interface for interacting
+ * with one of the runtime agents used to inspect the application state and listen
+ * to the run-time events.
+ *
+ * ## Example usage
+ *
+ * Apart from the debugger, various V8 Profilers are available through the DevTools
+ * protocol.
+ * @since v8.0.0
+ */
+ post(method: string, params?: {}, callback?: (err: Error | null, params?: {}) => void): void;
+ post(method: string, callback?: (err: Error | null, params?: {}) => void): void;
+ /**
+ * Returns supported domains.
+ */
+ post(method: 'Schema.getDomains', callback?: (err: Error | null, params: Schema.GetDomainsReturnType) => void): void;
+ /**
+ * Evaluates expression on global object.
+ */
+ post(method: 'Runtime.evaluate', params?: Runtime.EvaluateParameterType, callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void;
+ post(method: 'Runtime.evaluate', callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void;
+ /**
+ * Add handler to promise with given promise object id.
+ */
+ post(method: 'Runtime.awaitPromise', params?: Runtime.AwaitPromiseParameterType, callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void;
+ post(method: 'Runtime.awaitPromise', callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void;
+ /**
+ * Calls function with given declaration on the given object. Object group of the result is inherited from the target object.
+ */
+ post(method: 'Runtime.callFunctionOn', params?: Runtime.CallFunctionOnParameterType, callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void;
+ post(method: 'Runtime.callFunctionOn', callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void;
+ /**
+ * Returns properties of a given object. Object group of the result is inherited from the target object.
+ */
+ post(method: 'Runtime.getProperties', params?: Runtime.GetPropertiesParameterType, callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void;
+ post(method: 'Runtime.getProperties', callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void;
+ /**
+ * Releases remote object with given id.
+ */
+ post(method: 'Runtime.releaseObject', params?: Runtime.ReleaseObjectParameterType, callback?: (err: Error | null) => void): void;
+ post(method: 'Runtime.releaseObject', callback?: (err: Error | null) => void): void;
+ /**
+ * Releases all remote objects that belong to a given group.
+ */
+ post(method: 'Runtime.releaseObjectGroup', params?: Runtime.ReleaseObjectGroupParameterType, callback?: (err: Error | null) => void): void;
+ post(method: 'Runtime.releaseObjectGroup', callback?: (err: Error | null) => void): void;
+ /**
+ * Tells inspected instance to run if it was waiting for debugger to attach.
+ */
+ post(method: 'Runtime.runIfWaitingForDebugger', callback?: (err: Error | null) => void): void;
+ /**
+ * Enables reporting of execution contexts creation by means of <code>executionContextCreated</code> event. When the reporting gets enabled the event will be sent immediately for each existing execution context.
+ */
+ post(method: 'Runtime.enable', callback?: (err: Error | null) => void): void;
+ /**
+ * Disables reporting of execution contexts creation.
+ */
+ post(method: 'Runtime.disable', callback?: (err: Error | null) => void): void;
+ /**
+ * Discards collected exceptions and console API calls.
+ */
+ post(method: 'Runtime.discardConsoleEntries', callback?: (err: Error | null) => void): void;
+ /**
+ * @experimental
+ */
+ post(method: 'Runtime.setCustomObjectFormatterEnabled', params?: Runtime.SetCustomObjectFormatterEnabledParameterType, callback?: (err: Error | null) => void): void;
+ post(method: 'Runtime.setCustomObjectFormatterEnabled', callback?: (err: Error | null) => void): void;
+ /**
+ * Compiles expression.
+ */
+ post(method: 'Runtime.compileScript', params?: Runtime.CompileScriptParameterType, callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void;
+ post(method: 'Runtime.compileScript', callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void;
+ /**
+ * Runs script with given id in a given context.
+ */
+ post(method: 'Runtime.runScript', params?: Runtime.RunScriptParameterType, callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void;
+ post(method: 'Runtime.runScript', callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void;
+ post(method: 'Runtime.queryObjects', params?: Runtime.QueryObjectsParameterType, callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void;
+ post(method: 'Runtime.queryObjects', callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void;
+ /**
+ * Returns all let, const and class variables from global scope.
+ */
+ post(
+ method: 'Runtime.globalLexicalScopeNames',
+ params?: Runtime.GlobalLexicalScopeNamesParameterType,
+ callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void
+ ): void;
+ post(method: 'Runtime.globalLexicalScopeNames', callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void): void;
+ /**
+ * Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received.
+ */
+ post(method: 'Debugger.enable', callback?: (err: Error | null, params: Debugger.EnableReturnType) => void): void;
+ /**
+ * Disables debugger for given page.
+ */
+ post(method: 'Debugger.disable', callback?: (err: Error | null) => void): void;
+ /**
+ * Activates / deactivates all breakpoints on the page.
+ */
+ post(method: 'Debugger.setBreakpointsActive', params?: Debugger.SetBreakpointsActiveParameterType, callback?: (err: Error | null) => void): void;
+ post(method: 'Debugger.setBreakpointsActive', callback?: (err: Error | null) => void): void;
+ /**
+ * Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc).
+ */
+ post(method: 'Debugger.setSkipAllPauses', params?: Debugger.SetSkipAllPausesParameterType, callback?: (err: Error | null) => void): void;
+ post(method: 'Debugger.setSkipAllPauses', callback?: (err: Error | null) => void): void;
+ /**
+ * Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this command is issued, all existing parsed scripts will have breakpoints resolved and returned in <code>locations</code> property. Further matching script parsing will result in subsequent <code>breakpointResolved</code> events issued. This logical breakpoint will survive page reloads.
+ */
+ post(method: 'Debugger.setBreakpointByUrl', params?: Debugger.SetBreakpointByUrlParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void;
+ post(method: 'Debugger.setBreakpointByUrl', callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void;
+ /**
+ * Sets JavaScript breakpoint at a given location.
+ */
+ post(method: 'Debugger.setBreakpoint', params?: Debugger.SetBreakpointParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void;
+ post(method: 'Debugger.setBreakpoint', callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void;
+ /**
+ * Removes JavaScript breakpoint.
+ */
+ post(method: 'Debugger.removeBreakpoint', params?: Debugger.RemoveBreakpointParameterType, callback?: (err: Error | null) => void): void;
+ post(method: 'Debugger.removeBreakpoint', callback?: (err: Error | null) => void): void;
+ /**
+ * Returns possible locations for breakpoint. scriptId in start and end range locations should be the same.
+ */
+ post(
+ method: 'Debugger.getPossibleBreakpoints',
+ params?: Debugger.GetPossibleBreakpointsParameterType,
+ callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void
+ ): void;
+ post(method: 'Debugger.getPossibleBreakpoints', callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void): void;
+ /**
+ * Continues execution until specific location is reached.
+ */
+ post(method: 'Debugger.continueToLocation', params?: Debugger.ContinueToLocationParameterType, callback?: (err: Error | null) => void): void;
+ post(method: 'Debugger.continueToLocation', callback?: (err: Error | null) => void): void;
+ /**
+ * @experimental
+ */
+ post(method: 'Debugger.pauseOnAsyncCall', params?: Debugger.PauseOnAsyncCallParameterType, callback?: (err: Error | null) => void): void;
+ post(method: 'Debugger.pauseOnAsyncCall', callback?: (err: Error | null) => void): void;
+ /**
+ * Steps over the statement.
+ */
+ post(method: 'Debugger.stepOver', callback?: (err: Error | null) => void): void;
+ /**
+ * Steps into the function call.
+ */
+ post(method: 'Debugger.stepInto', params?: Debugger.StepIntoParameterType, callback?: (err: Error | null) => void): void;
+ post(method: 'Debugger.stepInto', callback?: (err: Error | null) => void): void;
+ /**
+ * Steps out of the function call.
+ */
+ post(method: 'Debugger.stepOut', callback?: (err: Error | null) => void): void;
+ /**
+ * Stops on the next JavaScript statement.
+ */
+ post(method: 'Debugger.pause', callback?: (err: Error | null) => void): void;
+ /**
+ * This method is deprecated - use Debugger.stepInto with breakOnAsyncCall and Debugger.pauseOnAsyncTask instead. Steps into next scheduled async task if any is scheduled before next pause. Returns success when async task is actually scheduled, returns error if no task were scheduled or another scheduleStepIntoAsync was called.
+ * @experimental
+ */
+ post(method: 'Debugger.scheduleStepIntoAsync', callback?: (err: Error | null) => void): void;
+ /**
+ * Resumes JavaScript execution.
+ */
+ post(method: 'Debugger.resume', callback?: (err: Error | null) => void): void;
+ /**
+ * Returns stack trace with given <code>stackTraceId</code>.
+ * @experimental
+ */
+ post(method: 'Debugger.getStackTrace', params?: Debugger.GetStackTraceParameterType, callback?: (err: Error | null, params: Debugger.GetStackTraceReturnType) => void): void;
+ post(method: 'Debugger.getStackTrace', callback?: (err: Error | null, params: Debugger.GetStackTraceReturnType) => void): void;
+ /**
+ * Searches for given string in script content.
+ */
+ post(method: 'Debugger.searchInContent', params?: Debugger.SearchInContentParameterType, callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void;
+ post(method: 'Debugger.searchInContent', callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void;
+ /**
+ * Edits JavaScript source live.
+ */
+ post(method: 'Debugger.setScriptSource', params?: Debugger.SetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void;
+ post(method: 'Debugger.setScriptSource', callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void;
+ /**
+ * Restarts particular call frame from the beginning.
+ */
+ post(method: 'Debugger.restartFrame', params?: Debugger.RestartFrameParameterType, callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void;
+ post(method: 'Debugger.restartFrame', callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void;
+ /**
+ * Returns source for the script with given id.
+ */
+ post(method: 'Debugger.getScriptSource', params?: Debugger.GetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void;
+ post(method: 'Debugger.getScriptSource', callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void;
+ /**
+ * Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or no exceptions. Initial pause on exceptions state is <code>none</code>.
+ */
+ post(method: 'Debugger.setPauseOnExceptions', params?: Debugger.SetPauseOnExceptionsParameterType, callback?: (err: Error | null) => void): void;
+ post(method: 'Debugger.setPauseOnExceptions', callback?: (err: Error | null) => void): void;
+ /**
+ * Evaluates expression on a given call frame.
+ */
+ post(method: 'Debugger.evaluateOnCallFrame', params?: Debugger.EvaluateOnCallFrameParameterType, callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void;
+ post(method: 'Debugger.evaluateOnCallFrame', callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void;
+ /**
+ * Changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually.
+ */
+ post(method: 'Debugger.setVariableValue', params?: Debugger.SetVariableValueParameterType, callback?: (err: Error | null) => void): void;
+ post(method: 'Debugger.setVariableValue', callback?: (err: Error | null) => void): void;
+ /**
+ * Changes return value in top frame. Available only at return break position.
+ * @experimental
+ */
+ post(method: 'Debugger.setReturnValue', params?: Debugger.SetReturnValueParameterType, callback?: (err: Error | null) => void): void;
+ post(method: 'Debugger.setReturnValue', callback?: (err: Error | null) => void): void;
+ /**
+ * Enables or disables async call stacks tracking.
+ */
+ post(method: 'Debugger.setAsyncCallStackDepth', params?: Debugger.SetAsyncCallStackDepthParameterType, callback?: (err: Error | null) => void): void;
+ post(method: 'Debugger.setAsyncCallStackDepth', callback?: (err: Error | null) => void): void;
+ /**
+ * Replace previous blackbox patterns with passed ones. Forces backend to skip stepping/pausing in scripts with url matching one of the patterns. VM will try to leave blackboxed script by performing 'step in' several times, finally resorting to 'step out' if unsuccessful.
+ * @experimental
+ */
+ post(method: 'Debugger.setBlackboxPatterns', params?: Debugger.SetBlackboxPatternsParameterType, callback?: (err: Error | null) => void): void;
+ post(method: 'Debugger.setBlackboxPatterns', callback?: (err: Error | null) => void): void;
+ /**
+ * Makes backend skip steps in the script in blackboxed ranges. VM will try leave blacklisted scripts by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. Positions array contains positions where blackbox state is changed. First interval isn't blackboxed. Array should be sorted.
+ * @experimental
+ */
+ post(method: 'Debugger.setBlackboxedRanges', params?: Debugger.SetBlackboxedRangesParameterType, callback?: (err: Error | null) => void): void;
+ post(method: 'Debugger.setBlackboxedRanges', callback?: (err: Error | null) => void): void;
+ /**
+ * Enables console domain, sends the messages collected so far to the client by means of the <code>messageAdded</code> notification.
+ */
+ post(method: 'Console.enable', callback?: (err: Error | null) => void): void;
+ /**
+ * Disables console domain, prevents further console messages from being reported to the client.
+ */
+ post(method: 'Console.disable', callback?: (err: Error | null) => void): void;
+ /**
+ * Does nothing.
+ */
+ post(method: 'Console.clearMessages', callback?: (err: Error | null) => void): void;
+ post(method: 'Profiler.enable', callback?: (err: Error | null) => void): void;
+ post(method: 'Profiler.disable', callback?: (err: Error | null) => void): void;
+ /**
+ * Changes CPU profiler sampling interval. Must be called before CPU profiles recording started.
+ */
+ post(method: 'Profiler.setSamplingInterval', params?: Profiler.SetSamplingIntervalParameterType, callback?: (err: Error | null) => void): void;
+ post(method: 'Profiler.setSamplingInterval', callback?: (err: Error | null) => void): void;
+ post(method: 'Profiler.start', callback?: (err: Error | null) => void): void;
+ post(method: 'Profiler.stop', callback?: (err: Error | null, params: Profiler.StopReturnType) => void): void;
+ /**
+ * Enable precise code coverage. Coverage data for JavaScript executed before enabling precise code coverage may be incomplete. Enabling prevents running optimized code and resets execution counters.
+ */
+ post(method: 'Profiler.startPreciseCoverage', params?: Profiler.StartPreciseCoverageParameterType, callback?: (err: Error | null) => void): void;
+ post(method: 'Profiler.startPreciseCoverage', callback?: (err: Error | null) => void): void;
+ /**
+ * Disable precise code coverage. Disabling releases unnecessary execution count records and allows executing optimized code.
+ */
+ post(method: 'Profiler.stopPreciseCoverage', callback?: (err: Error | null) => void): void;
+ /**
+ * Collect coverage data for the current isolate, and resets execution counters. Precise code coverage needs to have started.
+ */
+ post(method: 'Profiler.takePreciseCoverage', callback?: (err: Error | null, params: Profiler.TakePreciseCoverageReturnType) => void): void;
+ /**
+ * Collect coverage data for the current isolate. The coverage data may be incomplete due to garbage collection.
+ */
+ post(method: 'Profiler.getBestEffortCoverage', callback?: (err: Error | null, params: Profiler.GetBestEffortCoverageReturnType) => void): void;
+ /**
+ * Enable type profile.
+ * @experimental
+ */
+ post(method: 'Profiler.startTypeProfile', callback?: (err: Error | null) => void): void;
+ /**
+ * Disable type profile. Disabling releases type profile data collected so far.
+ * @experimental
+ */
+ post(method: 'Profiler.stopTypeProfile', callback?: (err: Error | null) => void): void;
+ /**
+ * Collect type profile.
+ * @experimental
+ */
+ post(method: 'Profiler.takeTypeProfile', callback?: (err: Error | null, params: Profiler.TakeTypeProfileReturnType) => void): void;
+ post(method: 'HeapProfiler.enable', callback?: (err: Error | null) => void): void;
+ post(method: 'HeapProfiler.disable', callback?: (err: Error | null) => void): void;
+ post(method: 'HeapProfiler.startTrackingHeapObjects', params?: HeapProfiler.StartTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void;
+ post(method: 'HeapProfiler.startTrackingHeapObjects', callback?: (err: Error | null) => void): void;
+ post(method: 'HeapProfiler.stopTrackingHeapObjects', params?: HeapProfiler.StopTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void;
+ post(method: 'HeapProfiler.stopTrackingHeapObjects', callback?: (err: Error | null) => void): void;
+ post(method: 'HeapProfiler.takeHeapSnapshot', params?: HeapProfiler.TakeHeapSnapshotParameterType, callback?: (err: Error | null) => void): void;
+ post(method: 'HeapProfiler.takeHeapSnapshot', callback?: (err: Error | null) => void): void;
+ post(method: 'HeapProfiler.collectGarbage', callback?: (err: Error | null) => void): void;
+ post(
+ method: 'HeapProfiler.getObjectByHeapObjectId',
+ params?: HeapProfiler.GetObjectByHeapObjectIdParameterType,
+ callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void
+ ): void;
+ post(method: 'HeapProfiler.getObjectByHeapObjectId', callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void): void;
+ /**
+ * Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions).
+ */
+ post(method: 'HeapProfiler.addInspectedHeapObject', params?: HeapProfiler.AddInspectedHeapObjectParameterType, callback?: (err: Error | null) => void): void;
+ post(method: 'HeapProfiler.addInspectedHeapObject', callback?: (err: Error | null) => void): void;
+ post(method: 'HeapProfiler.getHeapObjectId', params?: HeapProfiler.GetHeapObjectIdParameterType, callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void;
+ post(method: 'HeapProfiler.getHeapObjectId', callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void;
+ post(method: 'HeapProfiler.startSampling', params?: HeapProfiler.StartSamplingParameterType, callback?: (err: Error | null) => void): void;
+ post(method: 'HeapProfiler.startSampling', callback?: (err: Error | null) => void): void;
+ post(method: 'HeapProfiler.stopSampling', callback?: (err: Error | null, params: HeapProfiler.StopSamplingReturnType) => void): void;
+ post(method: 'HeapProfiler.getSamplingProfile', callback?: (err: Error | null, params: HeapProfiler.GetSamplingProfileReturnType) => void): void;
+ /**
+ * Gets supported tracing categories.
+ */
+ post(method: 'NodeTracing.getCategories', callback?: (err: Error | null, params: NodeTracing.GetCategoriesReturnType) => void): void;
+ /**
+ * Start trace events collection.
+ */
+ post(method: 'NodeTracing.start', params?: NodeTracing.StartParameterType, callback?: (err: Error | null) => void): void;
+ post(method: 'NodeTracing.start', callback?: (err: Error | null) => void): void;
+ /**
+ * Stop trace events collection. Remaining collected events will be sent as a sequence of
+ * dataCollected events followed by tracingComplete event.
+ */
+ post(method: 'NodeTracing.stop', callback?: (err: Error | null) => void): void;
+ /**
+ * Sends protocol message over session with given id.
+ */
+ post(method: 'NodeWorker.sendMessageToWorker', params?: NodeWorker.SendMessageToWorkerParameterType, callback?: (err: Error | null) => void): void;
+ post(method: 'NodeWorker.sendMessageToWorker', callback?: (err: Error | null) => void): void;
+ /**
+ * Instructs the inspector to attach to running workers. Will also attach to new workers
+ * as they start
+ */
+ post(method: 'NodeWorker.enable', params?: NodeWorker.EnableParameterType, callback?: (err: Error | null) => void): void;
+ post(method: 'NodeWorker.enable', callback?: (err: Error | null) => void): void;
+ /**
+ * Detaches from all running workers and disables attaching to new workers as they are started.
+ */
+ post(method: 'NodeWorker.disable', callback?: (err: Error | null) => void): void;
+ /**
+ * Detached from the worker with given sessionId.
+ */
+ post(method: 'NodeWorker.detach', params?: NodeWorker.DetachParameterType, callback?: (err: Error | null) => void): void;
+ post(method: 'NodeWorker.detach', callback?: (err: Error | null) => void): void;
+ /**
+ * Enable the `NodeRuntime.waitingForDisconnect`.
+ */
+ post(method: 'NodeRuntime.notifyWhenWaitingForDisconnect', params?: NodeRuntime.NotifyWhenWaitingForDisconnectParameterType, callback?: (err: Error | null) => void): void;
+ post(method: 'NodeRuntime.notifyWhenWaitingForDisconnect', callback?: (err: Error | null) => void): void;
+ // Events
+ addListener(event: string, listener: (...args: any[]) => void): this;
+ /**
+ * Emitted when any notification from the V8 Inspector is received.
+ */
+ addListener(event: 'inspectorNotification', listener: (message: InspectorNotification<{}>) => void): this;
+ /**
+ * Issued when new execution context is created.
+ */
+ addListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification<Runtime.ExecutionContextCreatedEventDataType>) => void): this;
+ /**
+ * Issued when execution context is destroyed.
+ */
+ addListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification<Runtime.ExecutionContextDestroyedEventDataType>) => void): this;
+ /**
+ * Issued when all executionContexts were cleared in browser
+ */
+ addListener(event: 'Runtime.executionContextsCleared', listener: () => void): this;
+ /**
+ * Issued when exception was thrown and unhandled.
+ */
+ addListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification<Runtime.ExceptionThrownEventDataType>) => void): this;
+ /**
+ * Issued when unhandled exception was revoked.
+ */
+ addListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification<Runtime.ExceptionRevokedEventDataType>) => void): this;
+ /**
+ * Issued when console API was called.
+ */
+ addListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification<Runtime.ConsoleAPICalledEventDataType>) => void): this;
+ /**
+ * Issued when object should be inspected (for example, as a result of inspect() command line API call).
+ */
+ addListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification<Runtime.InspectRequestedEventDataType>) => void): this;
+ /**
+ * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger.
+ */
+ addListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification<Debugger.ScriptParsedEventDataType>) => void): this;
+ /**
+ * Fired when virtual machine fails to parse the script.
+ */
+ addListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification<Debugger.ScriptFailedToParseEventDataType>) => void): this;
+ /**
+ * Fired when breakpoint is resolved to an actual script and location.
+ */
+ addListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification<Debugger.BreakpointResolvedEventDataType>) => void): this;
+ /**
+ * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.
+ */
+ addListener(event: 'Debugger.paused', listener: (message: InspectorNotification<Debugger.PausedEventDataType>) => void): this;
+ /**
+ * Fired when the virtual machine resumed execution.
+ */
+ addListener(event: 'Debugger.resumed', listener: () => void): this;
+ /**
+ * Issued when new console message is added.
+ */
+ addListener(event: 'Console.messageAdded', listener: (message: InspectorNotification<Console.MessageAddedEventDataType>) => void): this;
+ /**
+ * Sent when new profile recording is started using console.profile() call.
+ */
+ addListener(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification<Profiler.ConsoleProfileStartedEventDataType>) => void): this;
+ addListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification<Profiler.ConsoleProfileFinishedEventDataType>) => void): this;
+ addListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification<HeapProfiler.AddHeapSnapshotChunkEventDataType>) => void): this;
+ addListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this;
+ addListener(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification<HeapProfiler.ReportHeapSnapshotProgressEventDataType>) => void): this;
+ /**
+ * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event.
+ */
+ addListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification<HeapProfiler.LastSeenObjectIdEventDataType>) => void): this;
+ /**
+ * If heap objects tracking has been started then backend may send update for one or more fragments
+ */
+ addListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification<HeapProfiler.HeapStatsUpdateEventDataType>) => void): this;
+ /**
+ * Contains an bucket of collected trace events.
+ */
+ addListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification<NodeTracing.DataCollectedEventDataType>) => void): this;
+ /**
+ * Signals that tracing is stopped and there is no trace buffers pending flush, all data were
+ * delivered via dataCollected events.
+ */
+ addListener(event: 'NodeTracing.tracingComplete', listener: () => void): this;
+ /**
+ * Issued when attached to a worker.
+ */
+ addListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification<NodeWorker.AttachedToWorkerEventDataType>) => void): this;
+ /**
+ * Issued when detached from the worker.
+ */
+ addListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification<NodeWorker.DetachedFromWorkerEventDataType>) => void): this;
+ /**
+ * Notifies about a new protocol message received from the session
+ * (session ID is provided in attachedToWorker notification).
+ */
+ addListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification<NodeWorker.ReceivedMessageFromWorkerEventDataType>) => void): this;
+ /**
+ * This event is fired instead of `Runtime.executionContextDestroyed` when
+ * enabled.
+ * It is fired when the Node process finished all code execution and is
+ * waiting for all frontends to disconnect.
+ */
+ addListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this;
+ emit(event: string | symbol, ...args: any[]): boolean;
+ emit(event: 'inspectorNotification', message: InspectorNotification<{}>): boolean;
+ emit(event: 'Runtime.executionContextCreated', message: InspectorNotification<Runtime.ExecutionContextCreatedEventDataType>): boolean;
+ emit(event: 'Runtime.executionContextDestroyed', message: InspectorNotification<Runtime.ExecutionContextDestroyedEventDataType>): boolean;
+ emit(event: 'Runtime.executionContextsCleared'): boolean;
+ emit(event: 'Runtime.exceptionThrown', message: InspectorNotification<Runtime.ExceptionThrownEventDataType>): boolean;
+ emit(event: 'Runtime.exceptionRevoked', message: InspectorNotification<Runtime.ExceptionRevokedEventDataType>): boolean;
+ emit(event: 'Runtime.consoleAPICalled', message: InspectorNotification<Runtime.ConsoleAPICalledEventDataType>): boolean;
+ emit(event: 'Runtime.inspectRequested', message: InspectorNotification<Runtime.InspectRequestedEventDataType>): boolean;
+ emit(event: 'Debugger.scriptParsed', message: InspectorNotification<Debugger.ScriptParsedEventDataType>): boolean;
+ emit(event: 'Debugger.scriptFailedToParse', message: InspectorNotification<Debugger.ScriptFailedToParseEventDataType>): boolean;
+ emit(event: 'Debugger.breakpointResolved', message: InspectorNotification<Debugger.BreakpointResolvedEventDataType>): boolean;
+ emit(event: 'Debugger.paused', message: InspectorNotification<Debugger.PausedEventDataType>): boolean;
+ emit(event: 'Debugger.resumed'): boolean;
+ emit(event: 'Console.messageAdded', message: InspectorNotification<Console.MessageAddedEventDataType>): boolean;
+ emit(event: 'Profiler.consoleProfileStarted', message: InspectorNotification<Profiler.ConsoleProfileStartedEventDataType>): boolean;
+ emit(event: 'Profiler.consoleProfileFinished', message: InspectorNotification<Profiler.ConsoleProfileFinishedEventDataType>): boolean;
+ emit(event: 'HeapProfiler.addHeapSnapshotChunk', message: InspectorNotification<HeapProfiler.AddHeapSnapshotChunkEventDataType>): boolean;
+ emit(event: 'HeapProfiler.resetProfiles'): boolean;
+ emit(event: 'HeapProfiler.reportHeapSnapshotProgress', message: InspectorNotification<HeapProfiler.ReportHeapSnapshotProgressEventDataType>): boolean;
+ emit(event: 'HeapProfiler.lastSeenObjectId', message: InspectorNotification<HeapProfiler.LastSeenObjectIdEventDataType>): boolean;
+ emit(event: 'HeapProfiler.heapStatsUpdate', message: InspectorNotification<HeapProfiler.HeapStatsUpdateEventDataType>): boolean;
+ emit(event: 'NodeTracing.dataCollected', message: InspectorNotification<NodeTracing.DataCollectedEventDataType>): boolean;
+ emit(event: 'NodeTracing.tracingComplete'): boolean;
+ emit(event: 'NodeWorker.attachedToWorker', message: InspectorNotification<NodeWorker.AttachedToWorkerEventDataType>): boolean;
+ emit(event: 'NodeWorker.detachedFromWorker', message: InspectorNotification<NodeWorker.DetachedFromWorkerEventDataType>): boolean;
+ emit(event: 'NodeWorker.receivedMessageFromWorker', message: InspectorNotification<NodeWorker.ReceivedMessageFromWorkerEventDataType>): boolean;
+ emit(event: 'NodeRuntime.waitingForDisconnect'): boolean;
+ on(event: string, listener: (...args: any[]) => void): this;
+ /**
+ * Emitted when any notification from the V8 Inspector is received.
+ */
+ on(event: 'inspectorNotification', listener: (message: InspectorNotification<{}>) => void): this;
+ /**
+ * Issued when new execution context is created.
+ */
+ on(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification<Runtime.ExecutionContextCreatedEventDataType>) => void): this;
+ /**
+ * Issued when execution context is destroyed.
+ */
+ on(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification<Runtime.ExecutionContextDestroyedEventDataType>) => void): this;
+ /**
+ * Issued when all executionContexts were cleared in browser
+ */
+ on(event: 'Runtime.executionContextsCleared', listener: () => void): this;
+ /**
+ * Issued when exception was thrown and unhandled.
+ */
+ on(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification<Runtime.ExceptionThrownEventDataType>) => void): this;
+ /**
+ * Issued when unhandled exception was revoked.
+ */
+ on(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification<Runtime.ExceptionRevokedEventDataType>) => void): this;
+ /**
+ * Issued when console API was called.
+ */
+ on(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification<Runtime.ConsoleAPICalledEventDataType>) => void): this;
+ /**
+ * Issued when object should be inspected (for example, as a result of inspect() command line API call).
+ */
+ on(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification<Runtime.InspectRequestedEventDataType>) => void): this;
+ /**
+ * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger.
+ */
+ on(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification<Debugger.ScriptParsedEventDataType>) => void): this;
+ /**
+ * Fired when virtual machine fails to parse the script.
+ */
+ on(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification<Debugger.ScriptFailedToParseEventDataType>) => void): this;
+ /**
+ * Fired when breakpoint is resolved to an actual script and location.
+ */
+ on(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification<Debugger.BreakpointResolvedEventDataType>) => void): this;
+ /**
+ * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.
+ */
+ on(event: 'Debugger.paused', listener: (message: InspectorNotification<Debugger.PausedEventDataType>) => void): this;
+ /**
+ * Fired when the virtual machine resumed execution.
+ */
+ on(event: 'Debugger.resumed', listener: () => void): this;
+ /**
+ * Issued when new console message is added.
+ */
+ on(event: 'Console.messageAdded', listener: (message: InspectorNotification<Console.MessageAddedEventDataType>) => void): this;
+ /**
+ * Sent when new profile recording is started using console.profile() call.
+ */
+ on(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification<Profiler.ConsoleProfileStartedEventDataType>) => void): this;
+ on(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification<Profiler.ConsoleProfileFinishedEventDataType>) => void): this;
+ on(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification<HeapProfiler.AddHeapSnapshotChunkEventDataType>) => void): this;
+ on(event: 'HeapProfiler.resetProfiles', listener: () => void): this;
+ on(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification<HeapProfiler.ReportHeapSnapshotProgressEventDataType>) => void): this;
+ /**
+ * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event.
+ */
+ on(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification<HeapProfiler.LastSeenObjectIdEventDataType>) => void): this;
+ /**
+ * If heap objects tracking has been started then backend may send update for one or more fragments
+ */
+ on(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification<HeapProfiler.HeapStatsUpdateEventDataType>) => void): this;
+ /**
+ * Contains an bucket of collected trace events.
+ */
+ on(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification<NodeTracing.DataCollectedEventDataType>) => void): this;
+ /**
+ * Signals that tracing is stopped and there is no trace buffers pending flush, all data were
+ * delivered via dataCollected events.
+ */
+ on(event: 'NodeTracing.tracingComplete', listener: () => void): this;
+ /**
+ * Issued when attached to a worker.
+ */
+ on(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification<NodeWorker.AttachedToWorkerEventDataType>) => void): this;
+ /**
+ * Issued when detached from the worker.
+ */
+ on(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification<NodeWorker.DetachedFromWorkerEventDataType>) => void): this;
+ /**
+ * Notifies about a new protocol message received from the session
+ * (session ID is provided in attachedToWorker notification).
+ */
+ on(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification<NodeWorker.ReceivedMessageFromWorkerEventDataType>) => void): this;
+ /**
+ * This event is fired instead of `Runtime.executionContextDestroyed` when
+ * enabled.
+ * It is fired when the Node process finished all code execution and is
+ * waiting for all frontends to disconnect.
+ */
+ on(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this;
+ once(event: string, listener: (...args: any[]) => void): this;
+ /**
+ * Emitted when any notification from the V8 Inspector is received.
+ */
+ once(event: 'inspectorNotification', listener: (message: InspectorNotification<{}>) => void): this;
+ /**
+ * Issued when new execution context is created.
+ */
+ once(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification<Runtime.ExecutionContextCreatedEventDataType>) => void): this;
+ /**
+ * Issued when execution context is destroyed.
+ */
+ once(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification<Runtime.ExecutionContextDestroyedEventDataType>) => void): this;
+ /**
+ * Issued when all executionContexts were cleared in browser
+ */
+ once(event: 'Runtime.executionContextsCleared', listener: () => void): this;
+ /**
+ * Issued when exception was thrown and unhandled.
+ */
+ once(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification<Runtime.ExceptionThrownEventDataType>) => void): this;
+ /**
+ * Issued when unhandled exception was revoked.
+ */
+ once(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification<Runtime.ExceptionRevokedEventDataType>) => void): this;
+ /**
+ * Issued when console API was called.
+ */
+ once(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification<Runtime.ConsoleAPICalledEventDataType>) => void): this;
+ /**
+ * Issued when object should be inspected (for example, as a result of inspect() command line API call).
+ */
+ once(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification<Runtime.InspectRequestedEventDataType>) => void): this;
+ /**
+ * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger.
+ */
+ once(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification<Debugger.ScriptParsedEventDataType>) => void): this;
+ /**
+ * Fired when virtual machine fails to parse the script.
+ */
+ once(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification<Debugger.ScriptFailedToParseEventDataType>) => void): this;
+ /**
+ * Fired when breakpoint is resolved to an actual script and location.
+ */
+ once(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification<Debugger.BreakpointResolvedEventDataType>) => void): this;
+ /**
+ * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.
+ */
+ once(event: 'Debugger.paused', listener: (message: InspectorNotification<Debugger.PausedEventDataType>) => void): this;
+ /**
+ * Fired when the virtual machine resumed execution.
+ */
+ once(event: 'Debugger.resumed', listener: () => void): this;
+ /**
+ * Issued when new console message is added.
+ */
+ once(event: 'Console.messageAdded', listener: (message: InspectorNotification<Console.MessageAddedEventDataType>) => void): this;
+ /**
+ * Sent when new profile recording is started using console.profile() call.
+ */
+ once(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification<Profiler.ConsoleProfileStartedEventDataType>) => void): this;
+ once(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification<Profiler.ConsoleProfileFinishedEventDataType>) => void): this;
+ once(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification<HeapProfiler.AddHeapSnapshotChunkEventDataType>) => void): this;
+ once(event: 'HeapProfiler.resetProfiles', listener: () => void): this;
+ once(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification<HeapProfiler.ReportHeapSnapshotProgressEventDataType>) => void): this;
+ /**
+ * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event.
+ */
+ once(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification<HeapProfiler.LastSeenObjectIdEventDataType>) => void): this;
+ /**
+ * If heap objects tracking has been started then backend may send update for one or more fragments
+ */
+ once(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification<HeapProfiler.HeapStatsUpdateEventDataType>) => void): this;
+ /**
+ * Contains an bucket of collected trace events.
+ */
+ once(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification<NodeTracing.DataCollectedEventDataType>) => void): this;
+ /**
+ * Signals that tracing is stopped and there is no trace buffers pending flush, all data were
+ * delivered via dataCollected events.
+ */
+ once(event: 'NodeTracing.tracingComplete', listener: () => void): this;
+ /**
+ * Issued when attached to a worker.
+ */
+ once(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification<NodeWorker.AttachedToWorkerEventDataType>) => void): this;
+ /**
+ * Issued when detached from the worker.
+ */
+ once(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification<NodeWorker.DetachedFromWorkerEventDataType>) => void): this;
+ /**
+ * Notifies about a new protocol message received from the session
+ * (session ID is provided in attachedToWorker notification).
+ */
+ once(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification<NodeWorker.ReceivedMessageFromWorkerEventDataType>) => void): this;
+ /**
+ * This event is fired instead of `Runtime.executionContextDestroyed` when
+ * enabled.
+ * It is fired when the Node process finished all code execution and is
+ * waiting for all frontends to disconnect.
+ */
+ once(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this;
+ prependListener(event: string, listener: (...args: any[]) => void): this;
+ /**
+ * Emitted when any notification from the V8 Inspector is received.
+ */
+ prependListener(event: 'inspectorNotification', listener: (message: InspectorNotification<{}>) => void): this;
+ /**
+ * Issued when new execution context is created.
+ */
+ prependListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification<Runtime.ExecutionContextCreatedEventDataType>) => void): this;
+ /**
+ * Issued when execution context is destroyed.
+ */
+ prependListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification<Runtime.ExecutionContextDestroyedEventDataType>) => void): this;
+ /**
+ * Issued when all executionContexts were cleared in browser
+ */
+ prependListener(event: 'Runtime.executionContextsCleared', listener: () => void): this;
+ /**
+ * Issued when exception was thrown and unhandled.
+ */
+ prependListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification<Runtime.ExceptionThrownEventDataType>) => void): this;
+ /**
+ * Issued when unhandled exception was revoked.
+ */
+ prependListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification<Runtime.ExceptionRevokedEventDataType>) => void): this;
+ /**
+ * Issued when console API was called.
+ */
+ prependListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification<Runtime.ConsoleAPICalledEventDataType>) => void): this;
+ /**
+ * Issued when object should be inspected (for example, as a result of inspect() command line API call).
+ */
+ prependListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification<Runtime.InspectRequestedEventDataType>) => void): this;
+ /**
+ * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger.
+ */
+ prependListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification<Debugger.ScriptParsedEventDataType>) => void): this;
+ /**
+ * Fired when virtual machine fails to parse the script.
+ */
+ prependListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification<Debugger.ScriptFailedToParseEventDataType>) => void): this;
+ /**
+ * Fired when breakpoint is resolved to an actual script and location.
+ */
+ prependListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification<Debugger.BreakpointResolvedEventDataType>) => void): this;
+ /**
+ * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.
+ */
+ prependListener(event: 'Debugger.paused', listener: (message: InspectorNotification<Debugger.PausedEventDataType>) => void): this;
+ /**
+ * Fired when the virtual machine resumed execution.
+ */
+ prependListener(event: 'Debugger.resumed', listener: () => void): this;
+ /**
+ * Issued when new console message is added.
+ */
+ prependListener(event: 'Console.messageAdded', listener: (message: InspectorNotification<Console.MessageAddedEventDataType>) => void): this;
+ /**
+ * Sent when new profile recording is started using console.profile() call.
+ */
+ prependListener(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification<Profiler.ConsoleProfileStartedEventDataType>) => void): this;
+ prependListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification<Profiler.ConsoleProfileFinishedEventDataType>) => void): this;
+ prependListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification<HeapProfiler.AddHeapSnapshotChunkEventDataType>) => void): this;
+ prependListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this;
+ prependListener(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification<HeapProfiler.ReportHeapSnapshotProgressEventDataType>) => void): this;
+ /**
+ * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event.
+ */
+ prependListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification<HeapProfiler.LastSeenObjectIdEventDataType>) => void): this;
+ /**
+ * If heap objects tracking has been started then backend may send update for one or more fragments
+ */
+ prependListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification<HeapProfiler.HeapStatsUpdateEventDataType>) => void): this;
+ /**
+ * Contains an bucket of collected trace events.
+ */
+ prependListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification<NodeTracing.DataCollectedEventDataType>) => void): this;
+ /**
+ * Signals that tracing is stopped and there is no trace buffers pending flush, all data were
+ * delivered via dataCollected events.
+ */
+ prependListener(event: 'NodeTracing.tracingComplete', listener: () => void): this;
+ /**
+ * Issued when attached to a worker.
+ */
+ prependListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification<NodeWorker.AttachedToWorkerEventDataType>) => void): this;
+ /**
+ * Issued when detached from the worker.
+ */
+ prependListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification<NodeWorker.DetachedFromWorkerEventDataType>) => void): this;
+ /**
+ * Notifies about a new protocol message received from the session
+ * (session ID is provided in attachedToWorker notification).
+ */
+ prependListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification<NodeWorker.ReceivedMessageFromWorkerEventDataType>) => void): this;
+ /**
+ * This event is fired instead of `Runtime.executionContextDestroyed` when
+ * enabled.
+ * It is fired when the Node process finished all code execution and is
+ * waiting for all frontends to disconnect.
+ */
+ prependListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this;
+ prependOnceListener(event: string, listener: (...args: any[]) => void): this;
+ /**
+ * Emitted when any notification from the V8 Inspector is received.
+ */
+ prependOnceListener(event: 'inspectorNotification', listener: (message: InspectorNotification<{}>) => void): this;
+ /**
+ * Issued when new execution context is created.
+ */
+ prependOnceListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification<Runtime.ExecutionContextCreatedEventDataType>) => void): this;
+ /**
+ * Issued when execution context is destroyed.
+ */
+ prependOnceListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification<Runtime.ExecutionContextDestroyedEventDataType>) => void): this;
+ /**
+ * Issued when all executionContexts were cleared in browser
+ */
+ prependOnceListener(event: 'Runtime.executionContextsCleared', listener: () => void): this;
+ /**
+ * Issued when exception was thrown and unhandled.
+ */
+ prependOnceListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification<Runtime.ExceptionThrownEventDataType>) => void): this;
+ /**
+ * Issued when unhandled exception was revoked.
+ */
+ prependOnceListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification<Runtime.ExceptionRevokedEventDataType>) => void): this;
+ /**
+ * Issued when console API was called.
+ */
+ prependOnceListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification<Runtime.ConsoleAPICalledEventDataType>) => void): this;
+ /**
+ * Issued when object should be inspected (for example, as a result of inspect() command line API call).
+ */
+ prependOnceListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification<Runtime.InspectRequestedEventDataType>) => void): this;
+ /**
+ * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger.
+ */
+ prependOnceListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification<Debugger.ScriptParsedEventDataType>) => void): this;
+ /**
+ * Fired when virtual machine fails to parse the script.
+ */
+ prependOnceListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification<Debugger.ScriptFailedToParseEventDataType>) => void): this;
+ /**
+ * Fired when breakpoint is resolved to an actual script and location.
+ */
+ prependOnceListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification<Debugger.BreakpointResolvedEventDataType>) => void): this;
+ /**
+ * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.
+ */
+ prependOnceListener(event: 'Debugger.paused', listener: (message: InspectorNotification<Debugger.PausedEventDataType>) => void): this;
+ /**
+ * Fired when the virtual machine resumed execution.
+ */
+ prependOnceListener(event: 'Debugger.resumed', listener: () => void): this;
+ /**
+ * Issued when new console message is added.
+ */
+ prependOnceListener(event: 'Console.messageAdded', listener: (message: InspectorNotification<Console.MessageAddedEventDataType>) => void): this;
+ /**
+ * Sent when new profile recording is started using console.profile() call.
+ */
+ prependOnceListener(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification<Profiler.ConsoleProfileStartedEventDataType>) => void): this;
+ prependOnceListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification<Profiler.ConsoleProfileFinishedEventDataType>) => void): this;
+ prependOnceListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification<HeapProfiler.AddHeapSnapshotChunkEventDataType>) => void): this;
+ prependOnceListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this;
+ prependOnceListener(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification<HeapProfiler.ReportHeapSnapshotProgressEventDataType>) => void): this;
+ /**
+ * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event.
+ */
+ prependOnceListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification<HeapProfiler.LastSeenObjectIdEventDataType>) => void): this;
+ /**
+ * If heap objects tracking has been started then backend may send update for one or more fragments
+ */
+ prependOnceListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification<HeapProfiler.HeapStatsUpdateEventDataType>) => void): this;
+ /**
+ * Contains an bucket of collected trace events.
+ */
+ prependOnceListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification<NodeTracing.DataCollectedEventDataType>) => void): this;
+ /**
+ * Signals that tracing is stopped and there is no trace buffers pending flush, all data were
+ * delivered via dataCollected events.
+ */
+ prependOnceListener(event: 'NodeTracing.tracingComplete', listener: () => void): this;
+ /**
+ * Issued when attached to a worker.
+ */
+ prependOnceListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification<NodeWorker.AttachedToWorkerEventDataType>) => void): this;
+ /**
+ * Issued when detached from the worker.
+ */
+ prependOnceListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification<NodeWorker.DetachedFromWorkerEventDataType>) => void): this;
+ /**
+ * Notifies about a new protocol message received from the session
+ * (session ID is provided in attachedToWorker notification).
+ */
+ prependOnceListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification<NodeWorker.ReceivedMessageFromWorkerEventDataType>) => void): this;
+ /**
+ * This event is fired instead of `Runtime.executionContextDestroyed` when
+ * enabled.
+ * It is fired when the Node process finished all code execution and is
+ * waiting for all frontends to disconnect.
+ */
+ prependOnceListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this;
+ }
+ /**
+ * Activate inspector on host and port. Equivalent to`node --inspect=[[host:]port]`, but can be done programmatically after node has
+ * started.
+ *
+ * If wait is `true`, will block until a client has connected to the inspect port
+ * and flow control has been passed to the debugger client.
+ *
+ * See the `security warning` regarding the `host`parameter usage.
+ * @param [port='what was specified on the CLI'] Port to listen on for inspector connections. Optional.
+ * @param [host='what was specified on the CLI'] Host to listen on for inspector connections. Optional.
+ * @param [wait=false] Block until a client has connected. Optional.
+ */
+ function open(port?: number, host?: string, wait?: boolean): void;
+ /**
+ * Deactivate the inspector. Blocks until there are no active connections.
+ */
+ function close(): void;
+ /**
+ * Return the URL of the active inspector, or `undefined` if there is none.
+ *
+ * ```console
+ * $ node --inspect -p 'inspector.url()'
+ * Debugger listening on ws://127.0.0.1:9229/166e272e-7a30-4d09-97ce-f1c012b43c34
+ * For help, see: https://nodejs.org/en/docs/inspector
+ * ws://127.0.0.1:9229/166e272e-7a30-4d09-97ce-f1c012b43c34
+ *
+ * $ node --inspect=localhost:3000 -p 'inspector.url()'
+ * Debugger listening on ws://localhost:3000/51cf8d0e-3c36-4c59-8efd-54519839e56a
+ * For help, see: https://nodejs.org/en/docs/inspector
+ * ws://localhost:3000/51cf8d0e-3c36-4c59-8efd-54519839e56a
+ *
+ * $ node -p 'inspector.url()'
+ * undefined
+ * ```
+ */
+ function url(): string | undefined;
+ /**
+ * Blocks until a client (existing or connected later) has sent`Runtime.runIfWaitingForDebugger` command.
+ *
+ * An exception will be thrown if there is no active inspector.
+ * @since v12.7.0
+ */
+ function waitForDebugger(): void;
+}
+/**
+ * The inspector module provides an API for interacting with the V8 inspector.
+ */
+declare module 'node:inspector' {
+ import inspector = require('inspector');
+ export = inspector;
+}
diff --git a/client/node_modules/@types/node/ts4.8/module.d.ts b/client/node_modules/@types/node/ts4.8/module.d.ts
new file mode 100644
index 0000000..9e6e414
--- /dev/null
+++ b/client/node_modules/@types/node/ts4.8/module.d.ts
@@ -0,0 +1,262 @@
+/**
+ * @since v0.3.7
+ */
+declare module "module" {
+ import { URL } from "node:url";
+ import { MessagePort } from "node:worker_threads";
+ namespace Module {
+ /**
+ * The `module.syncBuiltinESMExports()` method updates all the live bindings for
+ * builtin `ES Modules` to match the properties of the `CommonJS` exports. It
+ * does not add or remove exported names from the `ES Modules`.
+ *
+ * ```js
+ * const fs = require('fs');
+ * const assert = require('assert');
+ * const { syncBuiltinESMExports } = require('module');
+ *
+ * fs.readFile = newAPI;
+ *
+ * delete fs.readFileSync;
+ *
+ * function newAPI() {
+ * // ...
+ * }
+ *
+ * fs.newAPI = newAPI;
+ *
+ * syncBuiltinESMExports();
+ *
+ * import('fs').then((esmFS) => {
+ * // It syncs the existing readFile property with the new value
+ * assert.strictEqual(esmFS.readFile, newAPI);
+ * // readFileSync has been deleted from the required fs
+ * assert.strictEqual('readFileSync' in fs, false);
+ * // syncBuiltinESMExports() does not remove readFileSync from esmFS
+ * assert.strictEqual('readFileSync' in esmFS, true);
+ * // syncBuiltinESMExports() does not add names
+ * assert.strictEqual(esmFS.newAPI, undefined);
+ * });
+ * ```
+ * @since v12.12.0
+ */
+ function syncBuiltinESMExports(): void;
+ /**
+ * `path` is the resolved path for the file for which a corresponding source map
+ * should be fetched.
+ * @since v13.7.0, v12.17.0
+ */
+ function findSourceMap(path: string, error?: Error): SourceMap;
+ interface SourceMapPayload {
+ file: string;
+ version: number;
+ sources: string[];
+ sourcesContent: string[];
+ names: string[];
+ mappings: string;
+ sourceRoot: string;
+ }
+ interface SourceMapping {
+ generatedLine: number;
+ generatedColumn: number;
+ originalSource: string;
+ originalLine: number;
+ originalColumn: number;
+ }
+ interface SourceOrigin {
+ /**
+ * The name of the range in the source map, if one was provided
+ */
+ name?: string;
+ /**
+ * The file name of the original source, as reported in the SourceMap
+ */
+ fileName: string;
+ /**
+ * The 1-indexed lineNumber of the corresponding call site in the original source
+ */
+ lineNumber: number;
+ /**
+ * The 1-indexed columnNumber of the corresponding call site in the original source
+ */
+ columnNumber: number;
+ }
+ /**
+ * @since v13.7.0, v12.17.0
+ */
+ class SourceMap {
+ /**
+ * Getter for the payload used to construct the `SourceMap` instance.
+ */
+ readonly payload: SourceMapPayload;
+ constructor(payload: SourceMapPayload);
+ /**
+ * Given a line offset and column offset in the generated source
+ * file, returns an object representing the SourceMap range in the
+ * original file if found, or an empty object if not.
+ *
+ * The object returned contains the following keys:
+ *
+ * The returned value represents the raw range as it appears in the
+ * SourceMap, based on zero-indexed offsets, _not_ 1-indexed line and
+ * column numbers as they appear in Error messages and CallSite
+ * objects.
+ *
+ * To get the corresponding 1-indexed line and column numbers from a
+ * lineNumber and columnNumber as they are reported by Error stacks
+ * and CallSite objects, use `sourceMap.findOrigin(lineNumber, columnNumber)`
+ * @param lineOffset The zero-indexed line number offset in the generated source
+ * @param columnOffset The zero-indexed column number offset in the generated source
+ */
+ findEntry(lineOffset: number, columnOffset: number): SourceMapping;
+ /**
+ * Given a 1-indexed `lineNumber` and `columnNumber` from a call site in the generated source,
+ * find the corresponding call site location in the original source.
+ *
+ * If the `lineNumber` and `columnNumber` provided are not found in any source map,
+ * then an empty object is returned.
+ * @param lineNumber The 1-indexed line number of the call site in the generated source
+ * @param columnNumber The 1-indexed column number of the call site in the generated source
+ */
+ findOrigin(lineNumber: number, columnNumber: number): SourceOrigin | {};
+ }
+ interface ImportAssertions extends NodeJS.Dict<string> {
+ type?: string | undefined;
+ }
+ type ModuleFormat = "builtin" | "commonjs" | "json" | "module" | "wasm";
+ type ModuleSource = string | ArrayBuffer | NodeJS.TypedArray;
+ interface GlobalPreloadContext {
+ port: MessagePort;
+ }
+ /**
+ * Sometimes it might be necessary to run some code inside of the same global scope that the application runs in.
+ * This hook allows the return of a string that is run as a sloppy-mode script on startup.
+ *
+ * @param context Information to assist the preload code
+ * @return Code to run before application startup
+ */
+ type GlobalPreloadHook = (context: GlobalPreloadContext) => string;
+ interface ResolveHookContext {
+ /**
+ * Export conditions of the relevant `package.json`
+ */
+ conditions: string[];
+ /**
+ * An object whose key-value pairs represent the assertions for the module to import
+ */
+ importAssertions: ImportAssertions;
+ /**
+ * The module importing this one, or undefined if this is the Node.js entry point
+ */
+ parentURL: string | undefined;
+ }
+ interface ResolveFnOutput {
+ /**
+ * A hint to the load hook (it might be ignored)
+ */
+ format?: ModuleFormat | null | undefined;
+ /**
+ * The import assertions to use when caching the module (optional; if excluded the input will be used)
+ */
+ importAssertions?: ImportAssertions | undefined;
+ /**
+ * A signal that this hook intends to terminate the chain of `resolve` hooks.
+ * @default false
+ */
+ shortCircuit?: boolean | undefined;
+ /**
+ * The absolute URL to which this input resolves
+ */
+ url: string;
+ }
+ /**
+ * The `resolve` hook chain is responsible for resolving file URL for a given module specifier and parent URL, and optionally its format (such as `'module'`) as a hint to the `load` hook.
+ * If a format is specified, the load hook is ultimately responsible for providing the final `format` value (and it is free to ignore the hint provided by `resolve`);
+ * if `resolve` provides a format, a custom `load` hook is required even if only to pass the value to the Node.js default `load` hook.
+ *
+ * @param specifier The specified URL path of the module to be resolved
+ * @param context
+ * @param nextResolve The subsequent `resolve` hook in the chain, or the Node.js default `resolve` hook after the last user-supplied resolve hook
+ */
+ type ResolveHook = (
+ specifier: string,
+ context: ResolveHookContext,
+ nextResolve: (
+ specifier: string,
+ context?: ResolveHookContext,
+ ) => ResolveFnOutput | Promise<ResolveFnOutput>,
+ ) => ResolveFnOutput | Promise<ResolveFnOutput>;
+ interface LoadHookContext {
+ /**
+ * Export conditions of the relevant `package.json`
+ */
+ conditions: string[];
+ /**
+ * The format optionally supplied by the `resolve` hook chain
+ */
+ format: ModuleFormat;
+ /**
+ * An object whose key-value pairs represent the assertions for the module to import
+ */
+ importAssertions: ImportAssertions;
+ }
+ interface LoadFnOutput {
+ format: ModuleFormat;
+ /**
+ * A signal that this hook intends to terminate the chain of `resolve` hooks.
+ * @default false
+ */
+ shortCircuit?: boolean | undefined;
+ /**
+ * The source for Node.js to evaluate
+ */
+ source?: ModuleSource;
+ }
+ /**
+ * The `load` hook provides a way to define a custom method of determining how a URL should be interpreted, retrieved, and parsed.
+ * It is also in charge of validating the import assertion.
+ *
+ * @param url The URL/path of the module to be loaded
+ * @param context Metadata about the module
+ * @param nextLoad The subsequent `load` hook in the chain, or the Node.js default `load` hook after the last user-supplied `load` hook
+ */
+ type LoadHook = (
+ url: string,
+ context: LoadHookContext,
+ nextLoad: (url: string, context?: LoadHookContext) => LoadFnOutput | Promise<LoadFnOutput>,
+ ) => LoadFnOutput | Promise<LoadFnOutput>;
+ }
+ interface Module extends NodeModule {}
+ class Module {
+ static runMain(): void;
+ static wrap(code: string): string;
+ static createRequire(path: string | URL): NodeRequire;
+ static builtinModules: string[];
+ static isBuiltin(moduleName: string): boolean;
+ static Module: typeof Module;
+ constructor(id: string, parent?: Module);
+ }
+ global {
+ interface ImportMeta {
+ url: string;
+ /**
+ * @experimental
+ * This feature is only available with the `--experimental-import-meta-resolve`
+ * command flag enabled.
+ *
+ * Provides a module-relative resolution function scoped to each module, returning
+ * the URL string.
+ *
+ * @param specified The module specifier to resolve relative to `parent`.
+ * @param parent The absolute parent module URL to resolve from. If none
+ * is specified, the value of `import.meta.url` is used as the default.
+ */
+ resolve?(specified: string, parent?: string | URL): Promise<string>;
+ }
+ }
+ export = Module;
+}
+declare module "node:module" {
+ import module = require("module");
+ export = module;
+}
diff --git a/client/node_modules/@types/node/ts4.8/net.d.ts b/client/node_modules/@types/node/ts4.8/net.d.ts
new file mode 100644
index 0000000..782b891
--- /dev/null
+++ b/client/node_modules/@types/node/ts4.8/net.d.ts
@@ -0,0 +1,913 @@
+/**
+ * > Stability: 2 - Stable
+ *
+ * The `net` module provides an asynchronous network API for creating stream-based
+ * TCP or `IPC` servers ({@link createServer}) and clients
+ * ({@link createConnection}).
+ *
+ * It can be accessed using:
+ *
+ * ```js
+ * const net = require('net');
+ * ```
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/net.js)
+ */
+declare module "net" {
+ import * as stream from "node:stream";
+ import { Abortable, EventEmitter } from "node:events";
+ import * as dns from "node:dns";
+ type LookupFunction = (
+ hostname: string,
+ options: dns.LookupOneOptions,
+ callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void,
+ ) => void;
+ interface AddressInfo {
+ address: string;
+ family: string;
+ port: number;
+ }
+ interface SocketConstructorOpts {
+ fd?: number | undefined;
+ allowHalfOpen?: boolean | undefined;
+ readable?: boolean | undefined;
+ writable?: boolean | undefined;
+ signal?: AbortSignal;
+ }
+ interface OnReadOpts {
+ buffer: Uint8Array | (() => Uint8Array);
+ /**
+ * This function is called for every chunk of incoming data.
+ * Two arguments are passed to it: the number of bytes written to buffer and a reference to buffer.
+ * Return false from this function to implicitly pause() the socket.
+ */
+ callback(bytesWritten: number, buf: Uint8Array): boolean;
+ }
+ interface ConnectOpts {
+ /**
+ * If specified, incoming data is stored in a single buffer and passed to the supplied callback when data arrives on the socket.
+ * Note: this will cause the streaming functionality to not provide any data, however events like 'error', 'end', and 'close' will
+ * still be emitted as normal and methods like pause() and resume() will also behave as expected.
+ */
+ onread?: OnReadOpts | undefined;
+ }
+ interface TcpSocketConnectOpts extends ConnectOpts {
+ port: number;
+ host?: string | undefined;
+ localAddress?: string | undefined;
+ localPort?: number | undefined;
+ hints?: number | undefined;
+ family?: number | undefined;
+ lookup?: LookupFunction | undefined;
+ noDelay?: boolean | undefined;
+ keepAlive?: boolean | undefined;
+ keepAliveInitialDelay?: number | undefined;
+ /**
+ * @since v18.13.0
+ */
+ autoSelectFamily?: boolean | undefined;
+ /**
+ * @since v18.13.0
+ */
+ autoSelectFamilyAttemptTimeout?: number | undefined;
+ }
+ interface IpcSocketConnectOpts extends ConnectOpts {
+ path: string;
+ }
+ type SocketConnectOpts = TcpSocketConnectOpts | IpcSocketConnectOpts;
+ type SocketReadyState = "opening" | "open" | "readOnly" | "writeOnly" | "closed";
+ /**
+ * This class is an abstraction of a TCP socket or a streaming `IPC` endpoint
+ * (uses named pipes on Windows, and Unix domain sockets otherwise). It is also
+ * an `EventEmitter`.
+ *
+ * A `net.Socket` can be created by the user and used directly to interact with
+ * a server. For example, it is returned by {@link createConnection},
+ * so the user can use it to talk to the server.
+ *
+ * It can also be created by Node.js and passed to the user when a connection
+ * is received. For example, it is passed to the listeners of a `'connection'` event emitted on a {@link Server}, so the user can use
+ * it to interact with the client.
+ * @since v0.3.4
+ */
+ class Socket extends stream.Duplex {
+ constructor(options?: SocketConstructorOpts);
+ /**
+ * Destroys the socket after all data is written. If the `finish` event was already emitted the socket is destroyed immediately.
+ * If the socket is still writable it implicitly calls `socket.end()`.
+ * @since v0.3.4
+ */
+ destroySoon(): void;
+ /**
+ * Sends data on the socket. The second parameter specifies the encoding in the
+ * case of a string. It defaults to UTF8 encoding.
+ *
+ * Returns `true` if the entire data was flushed successfully to the kernel
+ * buffer. Returns `false` if all or part of the data was queued in user memory.`'drain'` will be emitted when the buffer is again free.
+ *
+ * The optional `callback` parameter will be executed when the data is finally
+ * written out, which may not be immediately.
+ *
+ * See `Writable` stream `write()` method for more
+ * information.
+ * @since v0.1.90
+ * @param [encoding='utf8'] Only used when data is `string`.
+ */
+ write(buffer: Uint8Array | string, cb?: (err?: Error) => void): boolean;
+ write(str: Uint8Array | string, encoding?: BufferEncoding, cb?: (err?: Error) => void): boolean;
+ /**
+ * Initiate a connection on a given socket.
+ *
+ * Possible signatures:
+ *
+ * * `socket.connect(options[, connectListener])`
+ * * `socket.connect(path[, connectListener])` for `IPC` connections.
+ * * `socket.connect(port[, host][, connectListener])` for TCP connections.
+ * * Returns: `net.Socket` The socket itself.
+ *
+ * This function is asynchronous. When the connection is established, the `'connect'` event will be emitted. If there is a problem connecting,
+ * instead of a `'connect'` event, an `'error'` event will be emitted with
+ * the error passed to the `'error'` listener.
+ * The last parameter `connectListener`, if supplied, will be added as a listener
+ * for the `'connect'` event **once**.
+ *
+ * This function should only be used for reconnecting a socket after`'close'` has been emitted or otherwise it may lead to undefined
+ * behavior.
+ */
+ connect(options: SocketConnectOpts, connectionListener?: () => void): this;
+ connect(port: number, host: string, connectionListener?: () => void): this;
+ connect(port: number, connectionListener?: () => void): this;
+ connect(path: string, connectionListener?: () => void): this;
+ /**
+ * Set the encoding for the socket as a `Readable Stream`. See `readable.setEncoding()` for more information.
+ * @since v0.1.90
+ * @return The socket itself.
+ */
+ setEncoding(encoding?: BufferEncoding): this;
+ /**
+ * Pauses the reading of data. That is, `'data'` events will not be emitted.
+ * Useful to throttle back an upload.
+ * @return The socket itself.
+ */
+ pause(): this;
+ /**
+ * Close the TCP connection by sending an RST packet and destroy the stream.
+ * If this TCP socket is in connecting status, it will send an RST packet
+ * and destroy this TCP socket once it is connected. Otherwise, it will call
+ * `socket.destroy` with an `ERR_SOCKET_CLOSED` Error. If this is not a TCP socket
+ * (for example, a pipe), calling this method will immediately throw
+ * an `ERR_INVALID_HANDLE_TYPE` Error.
+ * @since v18.3.0
+ * @return The socket itself.
+ */
+ resetAndDestroy(): this;
+ /**
+ * Resumes reading after a call to `socket.pause()`.
+ * @return The socket itself.
+ */
+ resume(): this;
+ /**
+ * Sets the socket to timeout after `timeout` milliseconds of inactivity on
+ * the socket. By default `net.Socket` do not have a timeout.
+ *
+ * When an idle timeout is triggered the socket will receive a `'timeout'` event but the connection will not be severed. The user must manually call `socket.end()` or `socket.destroy()` to
+ * end the connection.
+ *
+ * ```js
+ * socket.setTimeout(3000);
+ * socket.on('timeout', () => {
+ * console.log('socket timeout');
+ * socket.end();
+ * });
+ * ```
+ *
+ * If `timeout` is 0, then the existing idle timeout is disabled.
+ *
+ * The optional `callback` parameter will be added as a one-time listener for the `'timeout'` event.
+ * @since v0.1.90
+ * @return The socket itself.
+ */
+ setTimeout(timeout: number, callback?: () => void): this;
+ /**
+ * Enable/disable the use of Nagle's algorithm.
+ *
+ * When a TCP connection is created, it will have Nagle's algorithm enabled.
+ *
+ * Nagle's algorithm delays data before it is sent via the network. It attempts
+ * to optimize throughput at the expense of latency.
+ *
+ * Passing `true` for `noDelay` or not passing an argument will disable Nagle's
+ * algorithm for the socket. Passing `false` for `noDelay` will enable Nagle's
+ * algorithm.
+ * @since v0.1.90
+ * @param [noDelay=true]
+ * @return The socket itself.
+ */
+ setNoDelay(noDelay?: boolean): this;
+ /**
+ * Enable/disable keep-alive functionality, and optionally set the initial
+ * delay before the first keepalive probe is sent on an idle socket.
+ *
+ * Set `initialDelay` (in milliseconds) to set the delay between the last
+ * data packet received and the first keepalive probe. Setting `0` for`initialDelay` will leave the value unchanged from the default
+ * (or previous) setting.
+ *
+ * Enabling the keep-alive functionality will set the following socket options:
+ *
+ * * `SO_KEEPALIVE=1`
+ * * `TCP_KEEPIDLE=initialDelay`
+ * * `TCP_KEEPCNT=10`
+ * * `TCP_KEEPINTVL=1`
+ * @since v0.1.92
+ * @param [enable=false]
+ * @param [initialDelay=0]
+ * @return The socket itself.
+ */
+ setKeepAlive(enable?: boolean, initialDelay?: number): this;
+ /**
+ * Returns the bound `address`, the address `family` name and `port` of the
+ * socket as reported by the operating system:`{ port: 12346, family: 'IPv4', address: '127.0.0.1' }`
+ * @since v0.1.90
+ */
+ address(): AddressInfo | {};
+ /**
+ * Calling `unref()` on a socket will allow the program to exit if this is the only
+ * active socket in the event system. If the socket is already `unref`ed calling`unref()` again will have no effect.
+ * @since v0.9.1
+ * @return The socket itself.
+ */
+ unref(): this;
+ /**
+ * Opposite of `unref()`, calling `ref()` on a previously `unref`ed socket will _not_ let the program exit if it's the only socket left (the default behavior).
+ * If the socket is `ref`ed calling `ref` again will have no effect.
+ * @since v0.9.1
+ * @return The socket itself.
+ */
+ ref(): this;
+ /**
+ * This property shows the number of characters buffered for writing. The buffer
+ * may contain strings whose length after encoding is not yet known. So this number
+ * is only an approximation of the number of bytes in the buffer.
+ *
+ * `net.Socket` has the property that `socket.write()` always works. This is to
+ * help users get up and running quickly. The computer cannot always keep up
+ * with the amount of data that is written to a socket. The network connection
+ * simply might be too slow. Node.js will internally queue up the data written to a
+ * socket and send it out over the wire when it is possible.
+ *
+ * The consequence of this internal buffering is that memory may grow.
+ * Users who experience large or growing `bufferSize` should attempt to
+ * "throttle" the data flows in their program with `socket.pause()` and `socket.resume()`.
+ * @since v0.3.8
+ * @deprecated Since v14.6.0 - Use `writableLength` instead.
+ */
+ readonly bufferSize: number;
+ /**
+ * The amount of received bytes.
+ * @since v0.5.3
+ */
+ readonly bytesRead: number;
+ /**
+ * The amount of bytes sent.
+ * @since v0.5.3
+ */
+ readonly bytesWritten: number;
+ /**
+ * If `true`,`socket.connect(options[, connectListener])` was
+ * called and has not yet finished. It will stay `true` until the socket becomes
+ * connected, then it is set to `false` and the `'connect'` event is emitted. Note
+ * that the `socket.connect(options[, connectListener])` callback is a listener for the `'connect'` event.
+ * @since v6.1.0
+ */
+ readonly connecting: boolean;
+ /**
+ * This is `true` if the socket is not connected yet, either because `.connect()`
+ * has not yet been called or because it is still in the process of connecting (see `socket.connecting`).
+ * @since v10.16.0
+ */
+ readonly pending: boolean;
+ /**
+ * See `writable.destroyed` for further details.
+ */
+ readonly destroyed: boolean;
+ /**
+ * The string representation of the local IP address the remote client is
+ * connecting on. For example, in a server listening on `'0.0.0.0'`, if a client
+ * connects on `'192.168.1.1'`, the value of `socket.localAddress` would be`'192.168.1.1'`.
+ * @since v0.9.6
+ */
+ readonly localAddress?: string;
+ /**
+ * The numeric representation of the local port. For example, `80` or `21`.
+ * @since v0.9.6
+ */
+ readonly localPort?: number;
+ /**
+ * The string representation of the local IP family. `'IPv4'` or `'IPv6'`.
+ * @since v18.8.0
+ */
+ readonly localFamily?: string;
+ /**
+ * This property represents the state of the connection as a string.
+ * @see {https://nodejs.org/api/net.html#socketreadystate}
+ * @since v0.5.0
+ */
+ readonly readyState: SocketReadyState;
+ /**
+ * The string representation of the remote IP address. For example,`'74.125.127.100'` or `'2001:4860:a005::68'`. Value may be `undefined` if
+ * the socket is destroyed (for example, if the client disconnected).
+ * @since v0.5.10
+ */
+ readonly remoteAddress?: string | undefined;
+ /**
+ * The string representation of the remote IP family. `'IPv4'` or `'IPv6'`.
+ * @since v0.11.14
+ */
+ readonly remoteFamily?: string | undefined;
+ /**
+ * The numeric representation of the remote port. For example, `80` or `21`.
+ * @since v0.5.10
+ */
+ readonly remotePort?: number | undefined;
+ /**
+ * The socket timeout in milliseconds as set by socket.setTimeout(). It is undefined if a timeout has not been set.
+ * @since v10.7.0
+ */
+ readonly timeout?: number | undefined;
+ /**
+ * Half-closes the socket. i.e., it sends a FIN packet. It is possible the
+ * server will still send some data.
+ *
+ * See `writable.end()` for further details.
+ * @since v0.1.90
+ * @param [encoding='utf8'] Only used when data is `string`.
+ * @param callback Optional callback for when the socket is finished.
+ * @return The socket itself.
+ */
+ end(callback?: () => void): this;
+ end(buffer: Uint8Array | string, callback?: () => void): this;
+ end(str: Uint8Array | string, encoding?: BufferEncoding, callback?: () => void): this;
+ /**
+ * events.EventEmitter
+ * 1. close
+ * 2. connect
+ * 3. data
+ * 4. drain
+ * 5. end
+ * 6. error
+ * 7. lookup
+ * 8. ready
+ * 9. timeout
+ */
+ addListener(event: string, listener: (...args: any[]) => void): this;
+ addListener(event: "close", listener: (hadError: boolean) => void): this;
+ addListener(event: "connect", listener: () => void): this;
+ addListener(event: "data", listener: (data: Buffer) => void): this;
+ addListener(event: "drain", listener: () => void): this;
+ addListener(event: "end", listener: () => void): this;
+ addListener(event: "error", listener: (err: Error) => void): this;
+ addListener(
+ event: "lookup",
+ listener: (err: Error, address: string, family: string | number, host: string) => void,
+ ): this;
+ addListener(event: "ready", listener: () => void): this;
+ addListener(event: "timeout", listener: () => void): this;
+ emit(event: string | symbol, ...args: any[]): boolean;
+ emit(event: "close", hadError: boolean): boolean;
+ emit(event: "connect"): boolean;
+ emit(event: "data", data: Buffer): boolean;
+ emit(event: "drain"): boolean;
+ emit(event: "end"): boolean;
+ emit(event: "error", err: Error): boolean;
+ emit(event: "lookup", err: Error, address: string, family: string | number, host: string): boolean;
+ emit(event: "ready"): boolean;
+ emit(event: "timeout"): boolean;
+ on(event: string, listener: (...args: any[]) => void): this;
+ on(event: "close", listener: (hadError: boolean) => void): this;
+ on(event: "connect", listener: () => void): this;
+ on(event: "data", listener: (data: Buffer) => void): this;
+ on(event: "drain", listener: () => void): this;
+ on(event: "end", listener: () => void): this;
+ on(event: "error", listener: (err: Error) => void): this;
+ on(
+ event: "lookup",
+ listener: (err: Error, address: string, family: string | number, host: string) => void,
+ ): this;
+ on(event: "ready", listener: () => void): this;
+ on(event: "timeout", listener: () => void): this;
+ once(event: string, listener: (...args: any[]) => void): this;
+ once(event: "close", listener: (hadError: boolean) => void): this;
+ once(event: "connect", listener: () => void): this;
+ once(event: "data", listener: (data: Buffer) => void): this;
+ once(event: "drain", listener: () => void): this;
+ once(event: "end", listener: () => void): this;
+ once(event: "error", listener: (err: Error) => void): this;
+ once(
+ event: "lookup",
+ listener: (err: Error, address: string, family: string | number, host: string) => void,
+ ): this;
+ once(event: "ready", listener: () => void): this;
+ once(event: "timeout", listener: () => void): this;
+ prependListener(event: string, listener: (...args: any[]) => void): this;
+ prependListener(event: "close", listener: (hadError: boolean) => void): this;
+ prependListener(event: "connect", listener: () => void): this;
+ prependListener(event: "data", listener: (data: Buffer) => void): this;
+ prependListener(event: "drain", listener: () => void): this;
+ prependListener(event: "end", listener: () => void): this;
+ prependListener(event: "error", listener: (err: Error) => void): this;
+ prependListener(
+ event: "lookup",
+ listener: (err: Error, address: string, family: string | number, host: string) => void,
+ ): this;
+ prependListener(event: "ready", listener: () => void): this;
+ prependListener(event: "timeout", listener: () => void): this;
+ prependOnceListener(event: string, listener: (...args: any[]) => void): this;
+ prependOnceListener(event: "close", listener: (hadError: boolean) => void): this;
+ prependOnceListener(event: "connect", listener: () => void): this;
+ prependOnceListener(event: "data", listener: (data: Buffer) => void): this;
+ prependOnceListener(event: "drain", listener: () => void): this;
+ prependOnceListener(event: "end", listener: () => void): this;
+ prependOnceListener(event: "error", listener: (err: Error) => void): this;
+ prependOnceListener(
+ event: "lookup",
+ listener: (err: Error, address: string, family: string | number, host: string) => void,
+ ): this;
+ prependOnceListener(event: "ready", listener: () => void): this;
+ prependOnceListener(event: "timeout", listener: () => void): this;
+ }
+ interface ListenOptions extends Abortable {
+ port?: number | undefined;
+ host?: string | undefined;
+ backlog?: number | undefined;
+ path?: string | undefined;
+ exclusive?: boolean | undefined;
+ readableAll?: boolean | undefined;
+ writableAll?: boolean | undefined;
+ /**
+ * @default false
+ */
+ ipv6Only?: boolean | undefined;
+ }
+ interface ServerOpts {
+ /**
+ * Indicates whether half-opened TCP connections are allowed.
+ * @default false
+ */
+ allowHalfOpen?: boolean | undefined;
+ /**
+ * Indicates whether the socket should be paused on incoming connections.
+ * @default false
+ */
+ pauseOnConnect?: boolean | undefined;
+ /**
+ * If set to `true`, it disables the use of Nagle's algorithm immediately after a new incoming connection is received.
+ * @default false
+ * @since v16.5.0
+ */
+ noDelay?: boolean | undefined;
+ /**
+ * If set to `true`, it enables keep-alive functionality on the socket immediately after a new incoming connection is received,
+ * similarly on what is done in `socket.setKeepAlive([enable][, initialDelay])`.
+ * @default false
+ * @since v16.5.0
+ */
+ keepAlive?: boolean | undefined;
+ /**
+ * If set to a positive number, it sets the initial delay before the first keepalive probe is sent on an idle socket.
+ * @default 0
+ * @since v16.5.0
+ */
+ keepAliveInitialDelay?: number | undefined;
+ }
+ interface DropArgument {
+ localAddress?: string;
+ localPort?: number;
+ localFamily?: string;
+ remoteAddress?: string;
+ remotePort?: number;
+ remoteFamily?: string;
+ }
+ /**
+ * This class is used to create a TCP or `IPC` server.
+ * @since v0.1.90
+ */
+ class Server extends EventEmitter {
+ constructor(connectionListener?: (socket: Socket) => void);
+ constructor(options?: ServerOpts, connectionListener?: (socket: Socket) => void);
+ /**
+ * Start a server listening for connections. A `net.Server` can be a TCP or
+ * an `IPC` server depending on what it listens to.
+ *
+ * Possible signatures:
+ *
+ * * `server.listen(handle[, backlog][, callback])`
+ * * `server.listen(options[, callback])`
+ * * `server.listen(path[, backlog][, callback])` for `IPC` servers
+ * * `server.listen([port[, host[, backlog]]][, callback])` for TCP servers
+ *
+ * This function is asynchronous. When the server starts listening, the `'listening'` event will be emitted. The last parameter `callback`will be added as a listener for the `'listening'`
+ * event.
+ *
+ * All `listen()` methods can take a `backlog` parameter to specify the maximum
+ * length of the queue of pending connections. The actual length will be determined
+ * by the OS through sysctl settings such as `tcp_max_syn_backlog` and `somaxconn`on Linux. The default value of this parameter is 511 (not 512).
+ *
+ * All {@link Socket} are set to `SO_REUSEADDR` (see [`socket(7)`](https://man7.org/linux/man-pages/man7/socket.7.html) for
+ * details).
+ *
+ * The `server.listen()` method can be called again if and only if there was an
+ * error during the first `server.listen()` call or `server.close()` has been
+ * called. Otherwise, an `ERR_SERVER_ALREADY_LISTEN` error will be thrown.
+ *
+ * One of the most common errors raised when listening is `EADDRINUSE`.
+ * This happens when another server is already listening on the requested`port`/`path`/`handle`. One way to handle this would be to retry
+ * after a certain amount of time:
+ *
+ * ```js
+ * server.on('error', (e) => {
+ * if (e.code === 'EADDRINUSE') {
+ * console.log('Address in use, retrying...');
+ * setTimeout(() => {
+ * server.close();
+ * server.listen(PORT, HOST);
+ * }, 1000);
+ * }
+ * });
+ * ```
+ */
+ listen(port?: number, hostname?: string, backlog?: number, listeningListener?: () => void): this;
+ listen(port?: number, hostname?: string, listeningListener?: () => void): this;
+ listen(port?: number, backlog?: number, listeningListener?: () => void): this;
+ listen(port?: number, listeningListener?: () => void): this;
+ listen(path: string, backlog?: number, listeningListener?: () => void): this;
+ listen(path: string, listeningListener?: () => void): this;
+ listen(options: ListenOptions, listeningListener?: () => void): this;
+ listen(handle: any, backlog?: number, listeningListener?: () => void): this;
+ listen(handle: any, listeningListener?: () => void): this;
+ /**
+ * Stops the server from accepting new connections and keeps existing
+ * connections. This function is asynchronous, the server is finally closed
+ * when all connections are ended and the server emits a `'close'` event.
+ * The optional `callback` will be called once the `'close'` event occurs. Unlike
+ * that event, it will be called with an `Error` as its only argument if the server
+ * was not open when it was closed.
+ * @since v0.1.90
+ * @param callback Called when the server is closed.
+ */
+ close(callback?: (err?: Error) => void): this;
+ /**
+ * Returns the bound `address`, the address `family` name, and `port` of the server
+ * as reported by the operating system if listening on an IP socket
+ * (useful to find which port was assigned when getting an OS-assigned address):`{ port: 12346, family: 'IPv4', address: '127.0.0.1' }`.
+ *
+ * For a server listening on a pipe or Unix domain socket, the name is returned
+ * as a string.
+ *
+ * ```js
+ * const server = net.createServer((socket) => {
+ * socket.end('goodbye\n');
+ * }).on('error', (err) => {
+ * // Handle errors here.
+ * throw err;
+ * });
+ *
+ * // Grab an arbitrary unused port.
+ * server.listen(() => {
+ * console.log('opened server on', server.address());
+ * });
+ * ```
+ *
+ * `server.address()` returns `null` before the `'listening'` event has been
+ * emitted or after calling `server.close()`.
+ * @since v0.1.90
+ */
+ address(): AddressInfo | string | null;
+ /**
+ * Asynchronously get the number of concurrent connections on the server. Works
+ * when sockets were sent to forks.
+ *
+ * Callback should take two arguments `err` and `count`.
+ * @since v0.9.7
+ */
+ getConnections(cb: (error: Error | null, count: number) => void): void;
+ /**
+ * Opposite of `unref()`, calling `ref()` on a previously `unref`ed server will _not_ let the program exit if it's the only server left (the default behavior).
+ * If the server is `ref`ed calling `ref()` again will have no effect.
+ * @since v0.9.1
+ */
+ ref(): this;
+ /**
+ * Calling `unref()` on a server will allow the program to exit if this is the only
+ * active server in the event system. If the server is already `unref`ed calling`unref()` again will have no effect.
+ * @since v0.9.1
+ */
+ unref(): this;
+ /**
+ * Set this property to reject connections when the server's connection count gets
+ * high.
+ *
+ * It is not recommended to use this option once a socket has been sent to a child
+ * with `child_process.fork()`.
+ * @since v0.2.0
+ */
+ maxConnections: number;
+ connections: number;
+ /**
+ * Indicates whether or not the server is listening for connections.
+ * @since v5.7.0
+ */
+ listening: boolean;
+ /**
+ * events.EventEmitter
+ * 1. close
+ * 2. connection
+ * 3. error
+ * 4. listening
+ * 5. drop
+ */
+ addListener(event: string, listener: (...args: any[]) => void): this;
+ addListener(event: "close", listener: () => void): this;
+ addListener(event: "connection", listener: (socket: Socket) => void): this;
+ addListener(event: "error", listener: (err: Error) => void): this;
+ addListener(event: "listening", listener: () => void): this;
+ addListener(event: "drop", listener: (data?: DropArgument) => void): this;
+ emit(event: string | symbol, ...args: any[]): boolean;
+ emit(event: "close"): boolean;
+ emit(event: "connection", socket: Socket): boolean;
+ emit(event: "error", err: Error): boolean;
+ emit(event: "listening"): boolean;
+ emit(event: "drop", data?: DropArgument): boolean;
+ on(event: string, listener: (...args: any[]) => void): this;
+ on(event: "close", listener: () => void): this;
+ on(event: "connection", listener: (socket: Socket) => void): this;
+ on(event: "error", listener: (err: Error) => void): this;
+ on(event: "listening", listener: () => void): this;
+ on(event: "drop", listener: (data?: DropArgument) => void): this;
+ once(event: string, listener: (...args: any[]) => void): this;
+ once(event: "close", listener: () => void): this;
+ once(event: "connection", listener: (socket: Socket) => void): this;
+ once(event: "error", listener: (err: Error) => void): this;
+ once(event: "listening", listener: () => void): this;
+ once(event: "drop", listener: (data?: DropArgument) => void): this;
+ prependListener(event: string, listener: (...args: any[]) => void): this;
+ prependListener(event: "close", listener: () => void): this;
+ prependListener(event: "connection", listener: (socket: Socket) => void): this;
+ prependListener(event: "error", listener: (err: Error) => void): this;
+ prependListener(event: "listening", listener: () => void): this;
+ prependListener(event: "drop", listener: (data?: DropArgument) => void): this;
+ prependOnceListener(event: string, listener: (...args: any[]) => void): this;
+ prependOnceListener(event: "close", listener: () => void): this;
+ prependOnceListener(event: "connection", listener: (socket: Socket) => void): this;
+ prependOnceListener(event: "error", listener: (err: Error) => void): this;
+ prependOnceListener(event: "listening", listener: () => void): this;
+ prependOnceListener(event: "drop", listener: (data?: DropArgument) => void): this;
+ /**
+ * Calls {@link Server.close()} and returns a promise that fulfills when the server has closed.
+ * @since v18.18.0
+ */
+ [Symbol.asyncDispose](): Promise<void>;
+ }
+ type IPVersion = "ipv4" | "ipv6";
+ /**
+ * The `BlockList` object can be used with some network APIs to specify rules for
+ * disabling inbound or outbound access to specific IP addresses, IP ranges, or
+ * IP subnets.
+ * @since v15.0.0, v14.18.0
+ */
+ class BlockList {
+ /**
+ * Adds a rule to block the given IP address.
+ * @since v15.0.0, v14.18.0
+ * @param address An IPv4 or IPv6 address.
+ * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`.
+ */
+ addAddress(address: string, type?: IPVersion): void;
+ addAddress(address: SocketAddress): void;
+ /**
+ * Adds a rule to block a range of IP addresses from `start` (inclusive) to`end` (inclusive).
+ * @since v15.0.0, v14.18.0
+ * @param start The starting IPv4 or IPv6 address in the range.
+ * @param end The ending IPv4 or IPv6 address in the range.
+ * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`.
+ */
+ addRange(start: string, end: string, type?: IPVersion): void;
+ addRange(start: SocketAddress, end: SocketAddress): void;
+ /**
+ * Adds a rule to block a range of IP addresses specified as a subnet mask.
+ * @since v15.0.0, v14.18.0
+ * @param net The network IPv4 or IPv6 address.
+ * @param prefix The number of CIDR prefix bits. For IPv4, this must be a value between `0` and `32`. For IPv6, this must be between `0` and `128`.
+ * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`.
+ */
+ addSubnet(net: SocketAddress, prefix: number): void;
+ addSubnet(net: string, prefix: number, type?: IPVersion): void;
+ /**
+ * Returns `true` if the given IP address matches any of the rules added to the`BlockList`.
+ *
+ * ```js
+ * const blockList = new net.BlockList();
+ * blockList.addAddress('123.123.123.123');
+ * blockList.addRange('10.0.0.1', '10.0.0.10');
+ * blockList.addSubnet('8592:757c:efae:4e45::', 64, 'ipv6');
+ *
+ * console.log(blockList.check('123.123.123.123')); // Prints: true
+ * console.log(blockList.check('10.0.0.3')); // Prints: true
+ * console.log(blockList.check('222.111.111.222')); // Prints: false
+ *
+ * // IPv6 notation for IPv4 addresses works:
+ * console.log(blockList.check('::ffff:7b7b:7b7b', 'ipv6')); // Prints: true
+ * console.log(blockList.check('::ffff:123.123.123.123', 'ipv6')); // Prints: true
+ * ```
+ * @since v15.0.0, v14.18.0
+ * @param address The IP address to check
+ * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`.
+ */
+ check(address: SocketAddress): boolean;
+ check(address: string, type?: IPVersion): boolean;
+ }
+ interface TcpNetConnectOpts extends TcpSocketConnectOpts, SocketConstructorOpts {
+ timeout?: number | undefined;
+ }
+ interface IpcNetConnectOpts extends IpcSocketConnectOpts, SocketConstructorOpts {
+ timeout?: number | undefined;
+ }
+ type NetConnectOpts = TcpNetConnectOpts | IpcNetConnectOpts;
+ /**
+ * Creates a new TCP or `IPC` server.
+ *
+ * If `allowHalfOpen` is set to `true`, when the other end of the socket
+ * signals the end of transmission, the server will only send back the end of
+ * transmission when `socket.end()` is explicitly called. For example, in the
+ * context of TCP, when a FIN packed is received, a FIN packed is sent
+ * back only when `socket.end()` is explicitly called. Until then the
+ * connection is half-closed (non-readable but still writable). See `'end'` event and [RFC 1122](https://tools.ietf.org/html/rfc1122) (section 4.2.2.13) for more information.
+ *
+ * If `pauseOnConnect` is set to `true`, then the socket associated with each
+ * incoming connection will be paused, and no data will be read from its handle.
+ * This allows connections to be passed between processes without any data being
+ * read by the original process. To begin reading data from a paused socket, call `socket.resume()`.
+ *
+ * The server can be a TCP server or an `IPC` server, depending on what it `listen()` to.
+ *
+ * Here is an example of a TCP echo server which listens for connections
+ * on port 8124:
+ *
+ * ```js
+ * const net = require('net');
+ * const server = net.createServer((c) => {
+ * // 'connection' listener.
+ * console.log('client connected');
+ * c.on('end', () => {
+ * console.log('client disconnected');
+ * });
+ * c.write('hello\r\n');
+ * c.pipe(c);
+ * });
+ * server.on('error', (err) => {
+ * throw err;
+ * });
+ * server.listen(8124, () => {
+ * console.log('server bound');
+ * });
+ * ```
+ *
+ * Test this by using `telnet`:
+ *
+ * ```console
+ * $ telnet localhost 8124
+ * ```
+ *
+ * To listen on the socket `/tmp/echo.sock`:
+ *
+ * ```js
+ * server.listen('/tmp/echo.sock', () => {
+ * console.log('server bound');
+ * });
+ * ```
+ *
+ * Use `nc` to connect to a Unix domain socket server:
+ *
+ * ```console
+ * $ nc -U /tmp/echo.sock
+ * ```
+ * @since v0.5.0
+ * @param connectionListener Automatically set as a listener for the {@link 'connection'} event.
+ */
+ function createServer(connectionListener?: (socket: Socket) => void): Server;
+ function createServer(options?: ServerOpts, connectionListener?: (socket: Socket) => void): Server;
+ /**
+ * Aliases to {@link createConnection}.
+ *
+ * Possible signatures:
+ *
+ * * {@link connect}
+ * * {@link connect} for `IPC` connections.
+ * * {@link connect} for TCP connections.
+ */
+ function connect(options: NetConnectOpts, connectionListener?: () => void): Socket;
+ function connect(port: number, host?: string, connectionListener?: () => void): Socket;
+ function connect(path: string, connectionListener?: () => void): Socket;
+ /**
+ * A factory function, which creates a new {@link Socket},
+ * immediately initiates connection with `socket.connect()`,
+ * then returns the `net.Socket` that starts the connection.
+ *
+ * When the connection is established, a `'connect'` event will be emitted
+ * on the returned socket. The last parameter `connectListener`, if supplied,
+ * will be added as a listener for the `'connect'` event **once**.
+ *
+ * Possible signatures:
+ *
+ * * {@link createConnection}
+ * * {@link createConnection} for `IPC` connections.
+ * * {@link createConnection} for TCP connections.
+ *
+ * The {@link connect} function is an alias to this function.
+ */
+ function createConnection(options: NetConnectOpts, connectionListener?: () => void): Socket;
+ function createConnection(port: number, host?: string, connectionListener?: () => void): Socket;
+ function createConnection(path: string, connectionListener?: () => void): Socket;
+ /**
+ * Returns `6` if `input` is an IPv6 address. Returns `4` if `input` is an IPv4
+ * address in [dot-decimal notation](https://en.wikipedia.org/wiki/Dot-decimal_notation) with no leading zeroes. Otherwise, returns`0`.
+ *
+ * ```js
+ * net.isIP('::1'); // returns 6
+ * net.isIP('127.0.0.1'); // returns 4
+ * net.isIP('127.000.000.001'); // returns 0
+ * net.isIP('127.0.0.1/24'); // returns 0
+ * net.isIP('fhqwhgads'); // returns 0
+ * ```
+ * @since v0.3.0
+ */
+ function isIP(input: string): number;
+ /**
+ * Returns `true` if `input` is an IPv4 address in [dot-decimal notation](https://en.wikipedia.org/wiki/Dot-decimal_notation) with no
+ * leading zeroes. Otherwise, returns `false`.
+ *
+ * ```js
+ * net.isIPv4('127.0.0.1'); // returns true
+ * net.isIPv4('127.000.000.001'); // returns false
+ * net.isIPv4('127.0.0.1/24'); // returns false
+ * net.isIPv4('fhqwhgads'); // returns false
+ * ```
+ * @since v0.3.0
+ */
+ function isIPv4(input: string): boolean;
+ /**
+ * Returns `true` if `input` is an IPv6 address. Otherwise, returns `false`.
+ *
+ * ```js
+ * net.isIPv6('::1'); // returns true
+ * net.isIPv6('fhqwhgads'); // returns false
+ * ```
+ * @since v0.3.0
+ */
+ function isIPv6(input: string): boolean;
+ interface SocketAddressInitOptions {
+ /**
+ * The network address as either an IPv4 or IPv6 string.
+ * @default 127.0.0.1
+ */
+ address?: string | undefined;
+ /**
+ * @default `'ipv4'`
+ */
+ family?: IPVersion | undefined;
+ /**
+ * An IPv6 flow-label used only if `family` is `'ipv6'`.
+ * @default 0
+ */
+ flowlabel?: number | undefined;
+ /**
+ * An IP port.
+ * @default 0
+ */
+ port?: number | undefined;
+ }
+ /**
+ * @since v15.14.0, v14.18.0
+ */
+ class SocketAddress {
+ constructor(options: SocketAddressInitOptions);
+ /**
+ * @since v15.14.0, v14.18.0
+ */
+ readonly address: string;
+ /**
+ * Either \`'ipv4'\` or \`'ipv6'\`.
+ * @since v15.14.0, v14.18.0
+ */
+ readonly family: IPVersion;
+ /**
+ * @since v15.14.0, v14.18.0
+ */
+ readonly port: number;
+ /**
+ * @since v15.14.0, v14.18.0
+ */
+ readonly flowlabel: number;
+ }
+}
+declare module "node:net" {
+ export * from "net";
+}
diff --git a/client/node_modules/@types/node/ts4.8/os.d.ts b/client/node_modules/@types/node/ts4.8/os.d.ts
new file mode 100644
index 0000000..00d0373
--- /dev/null
+++ b/client/node_modules/@types/node/ts4.8/os.d.ts
@@ -0,0 +1,473 @@
+/**
+ * The `os` module provides operating system-related utility methods and
+ * properties. It can be accessed using:
+ *
+ * ```js
+ * const os = require('os');
+ * ```
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/os.js)
+ */
+declare module "os" {
+ interface CpuInfo {
+ model: string;
+ speed: number;
+ times: {
+ user: number;
+ nice: number;
+ sys: number;
+ idle: number;
+ irq: number;
+ };
+ }
+ interface NetworkInterfaceBase {
+ address: string;
+ netmask: string;
+ mac: string;
+ internal: boolean;
+ cidr: string | null;
+ }
+ interface NetworkInterfaceInfoIPv4 extends NetworkInterfaceBase {
+ family: "IPv4";
+ scopeid?: undefined;
+ }
+ interface NetworkInterfaceInfoIPv6 extends NetworkInterfaceBase {
+ family: "IPv6";
+ scopeid: number;
+ }
+ interface UserInfo<T> {
+ username: T;
+ uid: number;
+ gid: number;
+ shell: T | null;
+ homedir: T;
+ }
+ type NetworkInterfaceInfo = NetworkInterfaceInfoIPv4 | NetworkInterfaceInfoIPv6;
+ /**
+ * Returns the host name of the operating system as a string.
+ * @since v0.3.3
+ */
+ function hostname(): string;
+ /**
+ * Returns an array containing the 1, 5, and 15 minute load averages.
+ *
+ * The load average is a measure of system activity calculated by the operating
+ * system and expressed as a fractional number.
+ *
+ * The load average is a Unix-specific concept. On Windows, the return value is
+ * always `[0, 0, 0]`.
+ * @since v0.3.3
+ */
+ function loadavg(): number[];
+ /**
+ * Returns the system uptime in number of seconds.
+ * @since v0.3.3
+ */
+ function uptime(): number;
+ /**
+ * Returns the amount of free system memory in bytes as an integer.
+ * @since v0.3.3
+ */
+ function freemem(): number;
+ /**
+ * Returns the total amount of system memory in bytes as an integer.
+ * @since v0.3.3
+ */
+ function totalmem(): number;
+ /**
+ * Returns an array of objects containing information about each logical CPU core.
+ *
+ * The properties included on each object include:
+ *
+ * ```js
+ * [
+ * {
+ * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',
+ * speed: 2926,
+ * times: {
+ * user: 252020,
+ * nice: 0,
+ * sys: 30340,
+ * idle: 1070356870,
+ * irq: 0
+ * }
+ * },
+ * {
+ * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',
+ * speed: 2926,
+ * times: {
+ * user: 306960,
+ * nice: 0,
+ * sys: 26980,
+ * idle: 1071569080,
+ * irq: 0
+ * }
+ * },
+ * {
+ * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',
+ * speed: 2926,
+ * times: {
+ * user: 248450,
+ * nice: 0,
+ * sys: 21750,
+ * idle: 1070919370,
+ * irq: 0
+ * }
+ * },
+ * {
+ * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',
+ * speed: 2926,
+ * times: {
+ * user: 256880,
+ * nice: 0,
+ * sys: 19430,
+ * idle: 1070905480,
+ * irq: 20
+ * }
+ * },
+ * ]
+ * ```
+ *
+ * `nice` values are POSIX-only. On Windows, the `nice` values of all processors
+ * are always 0.
+ * @since v0.3.3
+ */
+ function cpus(): CpuInfo[];
+ /**
+ * Returns an estimate of the default amount of parallelism a program should use. Always returns a value greater than zero.
+ *
+ * This function is a small wrapper about libuv's [`uv_available_parallelism()`](https://docs.libuv.org/en/v1.x/misc.html#c.uv_available_parallelism).
+ * @since 18.4.0
+ */
+ function availableParallelism(): number;
+ /**
+ * Returns the operating system name as returned by [`uname(3)`](https://linux.die.net/man/3/uname). For example, it
+ * returns `'Linux'` on Linux, `'Darwin'` on macOS, and `'Windows_NT'` on Windows.
+ *
+ * See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for additional information
+ * about the output of running [`uname(3)`](https://linux.die.net/man/3/uname) on various operating systems.
+ * @since v0.3.3
+ */
+ function type(): string;
+ /**
+ * Returns the operating system as a string.
+ *
+ * On POSIX systems, the operating system release is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `GetVersionExW()` is used. See
+ * [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information.
+ * @since v0.3.3
+ */
+ function release(): string;
+ /**
+ * Returns an object containing network interfaces that have been assigned a
+ * network address.
+ *
+ * Each key on the returned object identifies a network interface. The associated
+ * value is an array of objects that each describe an assigned network address.
+ *
+ * The properties available on the assigned network address object include:
+ *
+ * ```js
+ * {
+ * lo: [
+ * {
+ * address: '127.0.0.1',
+ * netmask: '255.0.0.0',
+ * family: 'IPv4',
+ * mac: '00:00:00:00:00:00',
+ * internal: true,
+ * cidr: '127.0.0.1/8'
+ * },
+ * {
+ * address: '::1',
+ * netmask: 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff',
+ * family: 'IPv6',
+ * mac: '00:00:00:00:00:00',
+ * scopeid: 0,
+ * internal: true,
+ * cidr: '::1/128'
+ * }
+ * ],
+ * eth0: [
+ * {
+ * address: '192.168.1.108',
+ * netmask: '255.255.255.0',
+ * family: 'IPv4',
+ * mac: '01:02:03:0a:0b:0c',
+ * internal: false,
+ * cidr: '192.168.1.108/24'
+ * },
+ * {
+ * address: 'fe80::a00:27ff:fe4e:66a1',
+ * netmask: 'ffff:ffff:ffff:ffff::',
+ * family: 'IPv6',
+ * mac: '01:02:03:0a:0b:0c',
+ * scopeid: 1,
+ * internal: false,
+ * cidr: 'fe80::a00:27ff:fe4e:66a1/64'
+ * }
+ * ]
+ * }
+ * ```
+ * @since v0.6.0
+ */
+ function networkInterfaces(): NodeJS.Dict<NetworkInterfaceInfo[]>;
+ /**
+ * Returns the string path of the current user's home directory.
+ *
+ * On POSIX, it uses the `$HOME` environment variable if defined. Otherwise it
+ * uses the [effective UID](https://en.wikipedia.org/wiki/User_identifier#Effective_user_ID) to look up the user's home directory.
+ *
+ * On Windows, it uses the `USERPROFILE` environment variable if defined.
+ * Otherwise it uses the path to the profile directory of the current user.
+ * @since v2.3.0
+ */
+ function homedir(): string;
+ /**
+ * Returns information about the currently effective user. On POSIX platforms,
+ * this is typically a subset of the password file. The returned object includes
+ * the `username`, `uid`, `gid`, `shell`, and `homedir`. On Windows, the `uid` and`gid` fields are `-1`, and `shell` is `null`.
+ *
+ * The value of `homedir` returned by `os.userInfo()` is provided by the operating
+ * system. This differs from the result of `os.homedir()`, which queries
+ * environment variables for the home directory before falling back to the
+ * operating system response.
+ *
+ * Throws a `SystemError` if a user has no `username` or `homedir`.
+ * @since v6.0.0
+ */
+ function userInfo(options: { encoding: "buffer" }): UserInfo<Buffer>;
+ function userInfo(options?: { encoding: BufferEncoding }): UserInfo<string>;
+ type SignalConstants = {
+ [key in NodeJS.Signals]: number;
+ };
+ namespace constants {
+ const UV_UDP_REUSEADDR: number;
+ namespace signals {}
+ const signals: SignalConstants;
+ namespace errno {
+ const E2BIG: number;
+ const EACCES: number;
+ const EADDRINUSE: number;
+ const EADDRNOTAVAIL: number;
+ const EAFNOSUPPORT: number;
+ const EAGAIN: number;
+ const EALREADY: number;
+ const EBADF: number;
+ const EBADMSG: number;
+ const EBUSY: number;
+ const ECANCELED: number;
+ const ECHILD: number;
+ const ECONNABORTED: number;
+ const ECONNREFUSED: number;
+ const ECONNRESET: number;
+ const EDEADLK: number;
+ const EDESTADDRREQ: number;
+ const EDOM: number;
+ const EDQUOT: number;
+ const EEXIST: number;
+ const EFAULT: number;
+ const EFBIG: number;
+ const EHOSTUNREACH: number;
+ const EIDRM: number;
+ const EILSEQ: number;
+ const EINPROGRESS: number;
+ const EINTR: number;
+ const EINVAL: number;
+ const EIO: number;
+ const EISCONN: number;
+ const EISDIR: number;
+ const ELOOP: number;
+ const EMFILE: number;
+ const EMLINK: number;
+ const EMSGSIZE: number;
+ const EMULTIHOP: number;
+ const ENAMETOOLONG: number;
+ const ENETDOWN: number;
+ const ENETRESET: number;
+ const ENETUNREACH: number;
+ const ENFILE: number;
+ const ENOBUFS: number;
+ const ENODATA: number;
+ const ENODEV: number;
+ const ENOENT: number;
+ const ENOEXEC: number;
+ const ENOLCK: number;
+ const ENOLINK: number;
+ const ENOMEM: number;
+ const ENOMSG: number;
+ const ENOPROTOOPT: number;
+ const ENOSPC: number;
+ const ENOSR: number;
+ const ENOSTR: number;
+ const ENOSYS: number;
+ const ENOTCONN: number;
+ const ENOTDIR: number;
+ const ENOTEMPTY: number;
+ const ENOTSOCK: number;
+ const ENOTSUP: number;
+ const ENOTTY: number;
+ const ENXIO: number;
+ const EOPNOTSUPP: number;
+ const EOVERFLOW: number;
+ const EPERM: number;
+ const EPIPE: number;
+ const EPROTO: number;
+ const EPROTONOSUPPORT: number;
+ const EPROTOTYPE: number;
+ const ERANGE: number;
+ const EROFS: number;
+ const ESPIPE: number;
+ const ESRCH: number;
+ const ESTALE: number;
+ const ETIME: number;
+ const ETIMEDOUT: number;
+ const ETXTBSY: number;
+ const EWOULDBLOCK: number;
+ const EXDEV: number;
+ const WSAEINTR: number;
+ const WSAEBADF: number;
+ const WSAEACCES: number;
+ const WSAEFAULT: number;
+ const WSAEINVAL: number;
+ const WSAEMFILE: number;
+ const WSAEWOULDBLOCK: number;
+ const WSAEINPROGRESS: number;
+ const WSAEALREADY: number;
+ const WSAENOTSOCK: number;
+ const WSAEDESTADDRREQ: number;
+ const WSAEMSGSIZE: number;
+ const WSAEPROTOTYPE: number;
+ const WSAENOPROTOOPT: number;
+ const WSAEPROTONOSUPPORT: number;
+ const WSAESOCKTNOSUPPORT: number;
+ const WSAEOPNOTSUPP: number;
+ const WSAEPFNOSUPPORT: number;
+ const WSAEAFNOSUPPORT: number;
+ const WSAEADDRINUSE: number;
+ const WSAEADDRNOTAVAIL: number;
+ const WSAENETDOWN: number;
+ const WSAENETUNREACH: number;
+ const WSAENETRESET: number;
+ const WSAECONNABORTED: number;
+ const WSAECONNRESET: number;
+ const WSAENOBUFS: number;
+ const WSAEISCONN: number;
+ const WSAENOTCONN: number;
+ const WSAESHUTDOWN: number;
+ const WSAETOOMANYREFS: number;
+ const WSAETIMEDOUT: number;
+ const WSAECONNREFUSED: number;
+ const WSAELOOP: number;
+ const WSAENAMETOOLONG: number;
+ const WSAEHOSTDOWN: number;
+ const WSAEHOSTUNREACH: number;
+ const WSAENOTEMPTY: number;
+ const WSAEPROCLIM: number;
+ const WSAEUSERS: number;
+ const WSAEDQUOT: number;
+ const WSAESTALE: number;
+ const WSAEREMOTE: number;
+ const WSASYSNOTREADY: number;
+ const WSAVERNOTSUPPORTED: number;
+ const WSANOTINITIALISED: number;
+ const WSAEDISCON: number;
+ const WSAENOMORE: number;
+ const WSAECANCELLED: number;
+ const WSAEINVALIDPROCTABLE: number;
+ const WSAEINVALIDPROVIDER: number;
+ const WSAEPROVIDERFAILEDINIT: number;
+ const WSASYSCALLFAILURE: number;
+ const WSASERVICE_NOT_FOUND: number;
+ const WSATYPE_NOT_FOUND: number;
+ const WSA_E_NO_MORE: number;
+ const WSA_E_CANCELLED: number;
+ const WSAEREFUSED: number;
+ }
+ namespace priority {
+ const PRIORITY_LOW: number;
+ const PRIORITY_BELOW_NORMAL: number;
+ const PRIORITY_NORMAL: number;
+ const PRIORITY_ABOVE_NORMAL: number;
+ const PRIORITY_HIGH: number;
+ const PRIORITY_HIGHEST: number;
+ }
+ }
+ const devNull: string;
+ const EOL: string;
+ /**
+ * Returns the operating system CPU architecture for which the Node.js binary was
+ * compiled. Possible values are `'arm'`, `'arm64'`, `'ia32'`, `'mips'`,`'mipsel'`, `'ppc'`, `'ppc64'`, `'s390'`, `'s390x'`, and `'x64'`.
+ *
+ * The return value is equivalent to `process.arch`.
+ * @since v0.5.0
+ */
+ function arch(): string;
+ /**
+ * Returns a string identifying the kernel version.
+ *
+ * On POSIX systems, the operating system release is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `RtlGetVersion()` is used, and if it is not
+ * available, `GetVersionExW()` will be used. See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information.
+ * @since v13.11.0, v12.17.0
+ */
+ function version(): string;
+ /**
+ * Returns a string identifying the operating system platform for which
+ * the Node.js binary was compiled. The value is set at compile time.
+ * Possible values are `'aix'`, `'darwin'`, `'freebsd'`,`'linux'`,`'openbsd'`, `'sunos'`, and `'win32'`.
+ *
+ * The return value is equivalent to `process.platform`.
+ *
+ * The value `'android'` may also be returned if Node.js is built on the Android
+ * operating system. [Android support is experimental](https://github.com/nodejs/node/blob/HEAD/BUILDING.md#androidandroid-based-devices-eg-firefox-os).
+ * @since v0.5.0
+ */
+ function platform(): NodeJS.Platform;
+ /**
+ * Returns the machine type as a string, such as arm, aarch64, mips, mips64, ppc64, ppc64le, s390, s390x, i386, i686, x86_64.
+ *
+ * On POSIX systems, the machine type is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname).
+ * On Windows, `RtlGetVersion()` is used, and if it is not available, `GetVersionExW()` will be used.
+ * See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information.
+ * @since v18.9.0
+ */
+ function machine(): string;
+ /**
+ * Returns the operating system's default directory for temporary files as a
+ * string.
+ * @since v0.9.9
+ */
+ function tmpdir(): string;
+ /**
+ * Returns a string identifying the endianness of the CPU for which the Node.js
+ * binary was compiled.
+ *
+ * Possible values are `'BE'` for big endian and `'LE'` for little endian.
+ * @since v0.9.4
+ */
+ function endianness(): "BE" | "LE";
+ /**
+ * Returns the scheduling priority for the process specified by `pid`. If `pid` is
+ * not provided or is `0`, the priority of the current process is returned.
+ * @since v10.10.0
+ * @param [pid=0] The process ID to retrieve scheduling priority for.
+ */
+ function getPriority(pid?: number): number;
+ /**
+ * Attempts to set the scheduling priority for the process specified by `pid`. If`pid` is not provided or is `0`, the process ID of the current process is used.
+ *
+ * The `priority` input must be an integer between `-20` (high priority) and `19`(low priority). Due to differences between Unix priority levels and Windows
+ * priority classes, `priority` is mapped to one of six priority constants in`os.constants.priority`. When retrieving a process priority level, this range
+ * mapping may cause the return value to be slightly different on Windows. To avoid
+ * confusion, set `priority` to one of the priority constants.
+ *
+ * On Windows, setting priority to `PRIORITY_HIGHEST` requires elevated user
+ * privileges. Otherwise the set priority will be silently reduced to`PRIORITY_HIGH`.
+ * @since v10.10.0
+ * @param [pid=0] The process ID to set scheduling priority for.
+ * @param priority The scheduling priority to assign to the process.
+ */
+ function setPriority(priority: number): void;
+ function setPriority(pid: number, priority: number): void;
+}
+declare module "node:os" {
+ export * from "os";
+}
diff --git a/client/node_modules/@types/node/ts4.8/path.d.ts b/client/node_modules/@types/node/ts4.8/path.d.ts
new file mode 100644
index 0000000..1465c38
--- /dev/null
+++ b/client/node_modules/@types/node/ts4.8/path.d.ts
@@ -0,0 +1,191 @@
+declare module "path/posix" {
+ import path = require("path");
+ export = path;
+}
+declare module "path/win32" {
+ import path = require("path");
+ export = path;
+}
+/**
+ * The `path` module provides utilities for working with file and directory paths.
+ * It can be accessed using:
+ *
+ * ```js
+ * const path = require('path');
+ * ```
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/path.js)
+ */
+declare module "path" {
+ namespace path {
+ /**
+ * A parsed path object generated by path.parse() or consumed by path.format().
+ */
+ interface ParsedPath {
+ /**
+ * The root of the path such as '/' or 'c:\'
+ */
+ root: string;
+ /**
+ * The full directory path such as '/home/user/dir' or 'c:\path\dir'
+ */
+ dir: string;
+ /**
+ * The file name including extension (if any) such as 'index.html'
+ */
+ base: string;
+ /**
+ * The file extension (if any) such as '.html'
+ */
+ ext: string;
+ /**
+ * The file name without extension (if any) such as 'index'
+ */
+ name: string;
+ }
+ interface FormatInputPathObject {
+ /**
+ * The root of the path such as '/' or 'c:\'
+ */
+ root?: string | undefined;
+ /**
+ * The full directory path such as '/home/user/dir' or 'c:\path\dir'
+ */
+ dir?: string | undefined;
+ /**
+ * The file name including extension (if any) such as 'index.html'
+ */
+ base?: string | undefined;
+ /**
+ * The file extension (if any) such as '.html'
+ */
+ ext?: string | undefined;
+ /**
+ * The file name without extension (if any) such as 'index'
+ */
+ name?: string | undefined;
+ }
+ interface PlatformPath {
+ /**
+ * Normalize a string path, reducing '..' and '.' parts.
+ * When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used.
+ *
+ * @param path string path to normalize.
+ * @throws {TypeError} if `path` is not a string.
+ */
+ normalize(path: string): string;
+ /**
+ * Join all arguments together and normalize the resulting path.
+ *
+ * @param paths paths to join.
+ * @throws {TypeError} if any of the path segments is not a string.
+ */
+ join(...paths: string[]): string;
+ /**
+ * The right-most parameter is considered {to}. Other parameters are considered an array of {from}.
+ *
+ * Starting from leftmost {from} parameter, resolves {to} to an absolute path.
+ *
+ * If {to} isn't already absolute, {from} arguments are prepended in right to left order,
+ * until an absolute path is found. If after using all {from} paths still no absolute path is found,
+ * the current working directory is used as well. The resulting path is normalized,
+ * and trailing slashes are removed unless the path gets resolved to the root directory.
+ *
+ * @param paths A sequence of paths or path segments.
+ * @throws {TypeError} if any of the arguments is not a string.
+ */
+ resolve(...paths: string[]): string;
+ /**
+ * Determines whether {path} is an absolute path. An absolute path will always resolve to the same location, regardless of the working directory.
+ *
+ * If the given {path} is a zero-length string, `false` will be returned.
+ *
+ * @param path path to test.
+ * @throws {TypeError} if `path` is not a string.
+ */
+ isAbsolute(path: string): boolean;
+ /**
+ * Solve the relative path from {from} to {to} based on the current working directory.
+ * At times we have two absolute paths, and we need to derive the relative path from one to the other. This is actually the reverse transform of path.resolve.
+ *
+ * @throws {TypeError} if either `from` or `to` is not a string.
+ */
+ relative(from: string, to: string): string;
+ /**
+ * Return the directory name of a path. Similar to the Unix dirname command.
+ *
+ * @param path the path to evaluate.
+ * @throws {TypeError} if `path` is not a string.
+ */
+ dirname(path: string): string;
+ /**
+ * Return the last portion of a path. Similar to the Unix basename command.
+ * Often used to extract the file name from a fully qualified path.
+ *
+ * @param path the path to evaluate.
+ * @param suffix optionally, an extension to remove from the result.
+ * @throws {TypeError} if `path` is not a string or if `ext` is given and is not a string.
+ */
+ basename(path: string, suffix?: string): string;
+ /**
+ * Return the extension of the path, from the last '.' to end of string in the last portion of the path.
+ * If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string.
+ *
+ * @param path the path to evaluate.
+ * @throws {TypeError} if `path` is not a string.
+ */
+ extname(path: string): string;
+ /**
+ * The platform-specific file separator. '\\' or '/'.
+ */
+ readonly sep: "\\" | "/";
+ /**
+ * The platform-specific file delimiter. ';' or ':'.
+ */
+ readonly delimiter: ";" | ":";
+ /**
+ * Returns an object from a path string - the opposite of format().
+ *
+ * @param path path to evaluate.
+ * @throws {TypeError} if `path` is not a string.
+ */
+ parse(path: string): ParsedPath;
+ /**
+ * Returns a path string from an object - the opposite of parse().
+ *
+ * @param pathObject path to evaluate.
+ */
+ format(pathObject: FormatInputPathObject): string;
+ /**
+ * On Windows systems only, returns an equivalent namespace-prefixed path for the given path.
+ * If path is not a string, path will be returned without modifications.
+ * This method is meaningful only on Windows system.
+ * On POSIX systems, the method is non-operational and always returns path without modifications.
+ */
+ toNamespacedPath(path: string): string;
+ /**
+ * Posix specific pathing.
+ * Same as parent object on posix.
+ */
+ readonly posix: PlatformPath;
+ /**
+ * Windows specific pathing.
+ * Same as parent object on windows
+ */
+ readonly win32: PlatformPath;
+ }
+ }
+ const path: path.PlatformPath;
+ export = path;
+}
+declare module "node:path" {
+ import path = require("path");
+ export = path;
+}
+declare module "node:path/posix" {
+ import path = require("path/posix");
+ export = path;
+}
+declare module "node:path/win32" {
+ import path = require("path/win32");
+ export = path;
+}
diff --git a/client/node_modules/@types/node/ts4.8/perf_hooks.d.ts b/client/node_modules/@types/node/ts4.8/perf_hooks.d.ts
new file mode 100644
index 0000000..1960fb3
--- /dev/null
+++ b/client/node_modules/@types/node/ts4.8/perf_hooks.d.ts
@@ -0,0 +1,626 @@
+/**
+ * This module provides an implementation of a subset of the W3C [Web Performance APIs](https://w3c.github.io/perf-timing-primer/) as well as additional APIs for
+ * Node.js-specific performance measurements.
+ *
+ * Node.js supports the following [Web Performance APIs](https://w3c.github.io/perf-timing-primer/):
+ *
+ * * [High Resolution Time](https://www.w3.org/TR/hr-time-2)
+ * * [Performance Timeline](https://w3c.github.io/performance-timeline/)
+ * * [User Timing](https://www.w3.org/TR/user-timing/)
+ *
+ * ```js
+ * const { PerformanceObserver, performance } = require('perf_hooks');
+ *
+ * const obs = new PerformanceObserver((items) => {
+ * console.log(items.getEntries()[0].duration);
+ * performance.clearMarks();
+ * });
+ * obs.observe({ type: 'measure' });
+ * performance.measure('Start to Now');
+ *
+ * performance.mark('A');
+ * doSomeLongRunningProcess(() => {
+ * performance.measure('A to Now', 'A');
+ *
+ * performance.mark('B');
+ * performance.measure('A to B', 'A', 'B');
+ * });
+ * ```
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/perf_hooks.js)
+ */
+declare module "perf_hooks" {
+ import { AsyncResource } from "node:async_hooks";
+ type EntryType = "node" | "mark" | "measure" | "gc" | "function" | "http2" | "http";
+ interface NodeGCPerformanceDetail {
+ /**
+ * When `performanceEntry.entryType` is equal to 'gc', `the performance.kind` property identifies
+ * the type of garbage collection operation that occurred.
+ * See perf_hooks.constants for valid values.
+ */
+ readonly kind?: number | undefined;
+ /**
+ * When `performanceEntry.entryType` is equal to 'gc', the `performance.flags`
+ * property contains additional information about garbage collection operation.
+ * See perf_hooks.constants for valid values.
+ */
+ readonly flags?: number | undefined;
+ }
+ /**
+ * @since v8.5.0
+ */
+ class PerformanceEntry {
+ protected constructor();
+ /**
+ * The total number of milliseconds elapsed for this entry. This value will not
+ * be meaningful for all Performance Entry types.
+ * @since v8.5.0
+ */
+ readonly duration: number;
+ /**
+ * The name of the performance entry.
+ * @since v8.5.0
+ */
+ readonly name: string;
+ /**
+ * The high resolution millisecond timestamp marking the starting time of the
+ * Performance Entry.
+ * @since v8.5.0
+ */
+ readonly startTime: number;
+ /**
+ * The type of the performance entry. It may be one of:
+ *
+ * * `'node'` (Node.js only)
+ * * `'mark'` (available on the Web)
+ * * `'measure'` (available on the Web)
+ * * `'gc'` (Node.js only)
+ * * `'function'` (Node.js only)
+ * * `'http2'` (Node.js only)
+ * * `'http'` (Node.js only)
+ * @since v8.5.0
+ */
+ readonly entryType: EntryType;
+ /**
+ * Additional detail specific to the `entryType`.
+ * @since v16.0.0
+ */
+ readonly detail?: NodeGCPerformanceDetail | unknown | undefined; // TODO: Narrow this based on entry type.
+ toJSON(): any;
+ }
+ class PerformanceMark extends PerformanceEntry {
+ readonly duration: 0;
+ readonly entryType: "mark";
+ }
+ class PerformanceMeasure extends PerformanceEntry {
+ readonly entryType: "measure";
+ }
+ /**
+ * _This property is an extension by Node.js. It is not available in Web browsers._
+ *
+ * Provides timing details for Node.js itself. The constructor of this class
+ * is not exposed to users.
+ * @since v8.5.0
+ */
+ class PerformanceNodeTiming extends PerformanceEntry {
+ /**
+ * The high resolution millisecond timestamp at which the Node.js process
+ * completed bootstrapping. If bootstrapping has not yet finished, the property
+ * has the value of -1.
+ * @since v8.5.0
+ */
+ readonly bootstrapComplete: number;
+ /**
+ * The high resolution millisecond timestamp at which the Node.js environment was
+ * initialized.
+ * @since v8.5.0
+ */
+ readonly environment: number;
+ /**
+ * The high resolution millisecond timestamp of the amount of time the event loop
+ * has been idle within the event loop's event provider (e.g. `epoll_wait`). This
+ * does not take CPU usage into consideration. If the event loop has not yet
+ * started (e.g., in the first tick of the main script), the property has the
+ * value of 0.
+ * @since v14.10.0, v12.19.0
+ */
+ readonly idleTime: number;
+ /**
+ * The high resolution millisecond timestamp at which the Node.js event loop
+ * exited. If the event loop has not yet exited, the property has the value of -1\.
+ * It can only have a value of not -1 in a handler of the `'exit'` event.
+ * @since v8.5.0
+ */
+ readonly loopExit: number;
+ /**
+ * The high resolution millisecond timestamp at which the Node.js event loop
+ * started. If the event loop has not yet started (e.g., in the first tick of the
+ * main script), the property has the value of -1.
+ * @since v8.5.0
+ */
+ readonly loopStart: number;
+ /**
+ * The high resolution millisecond timestamp at which the V8 platform was
+ * initialized.
+ * @since v8.5.0
+ */
+ readonly v8Start: number;
+ }
+ interface EventLoopUtilization {
+ idle: number;
+ active: number;
+ utilization: number;
+ }
+ /**
+ * @param util1 The result of a previous call to eventLoopUtilization()
+ * @param util2 The result of a previous call to eventLoopUtilization() prior to util1
+ */
+ type EventLoopUtilityFunction = (
+ util1?: EventLoopUtilization,
+ util2?: EventLoopUtilization,
+ ) => EventLoopUtilization;
+ interface MarkOptions {
+ /**
+ * Additional optional detail to include with the mark.
+ */
+ detail?: unknown | undefined;
+ /**
+ * An optional timestamp to be used as the mark time.
+ * @default `performance.now()`.
+ */
+ startTime?: number | undefined;
+ }
+ interface MeasureOptions {
+ /**
+ * Additional optional detail to include with the mark.
+ */
+ detail?: unknown | undefined;
+ /**
+ * Duration between start and end times.
+ */
+ duration?: number | undefined;
+ /**
+ * Timestamp to be used as the end time, or a string identifying a previously recorded mark.
+ */
+ end?: number | string | undefined;
+ /**
+ * Timestamp to be used as the start time, or a string identifying a previously recorded mark.
+ */
+ start?: number | string | undefined;
+ }
+ interface TimerifyOptions {
+ /**
+ * A histogram object created using
+ * `perf_hooks.createHistogram()` that will record runtime durations in
+ * nanoseconds.
+ */
+ histogram?: RecordableHistogram | undefined;
+ }
+ interface Performance {
+ /**
+ * If name is not provided, removes all PerformanceMark objects from the Performance Timeline.
+ * If name is provided, removes only the named mark.
+ * @param name
+ */
+ clearMarks(name?: string): void;
+ /**
+ * If name is not provided, removes all PerformanceMeasure objects from the Performance Timeline.
+ * If name is provided, removes only the named measure.
+ * @param name
+ * @since v16.7.0
+ */
+ clearMeasures(name?: string): void;
+ /**
+ * Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime`.
+ * If you are only interested in performance entries of certain types or that have certain names, see
+ * `performance.getEntriesByType()` and `performance.getEntriesByName()`.
+ * @since v16.7.0
+ */
+ getEntries(): PerformanceEntry[];
+ /**
+ * Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime`
+ * whose `performanceEntry.name` is equal to `name`, and optionally, whose `performanceEntry.entryType` is equal to `type`.
+ * @param name
+ * @param type
+ * @since v16.7.0
+ */
+ getEntriesByName(name: string, type?: EntryType): PerformanceEntry[];
+ /**
+ * Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime`
+ * whose `performanceEntry.entryType` is equal to `type`.
+ * @param type
+ * @since v16.7.0
+ */
+ getEntriesByType(type: EntryType): PerformanceEntry[];
+ /**
+ * Creates a new PerformanceMark entry in the Performance Timeline.
+ * A PerformanceMark is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'mark',
+ * and whose performanceEntry.duration is always 0.
+ * Performance marks are used to mark specific significant moments in the Performance Timeline.
+ * @param name
+ * @return The PerformanceMark entry that was created
+ */
+ mark(name?: string, options?: MarkOptions): PerformanceMark;
+ /**
+ * Creates a new PerformanceMeasure entry in the Performance Timeline.
+ * A PerformanceMeasure is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'measure',
+ * and whose performanceEntry.duration measures the number of milliseconds elapsed since startMark and endMark.
+ *
+ * The startMark argument may identify any existing PerformanceMark in the the Performance Timeline, or may identify
+ * any of the timestamp properties provided by the PerformanceNodeTiming class. If the named startMark does not exist,
+ * then startMark is set to timeOrigin by default.
+ *
+ * The endMark argument must identify any existing PerformanceMark in the the Performance Timeline or any of the timestamp
+ * properties provided by the PerformanceNodeTiming class. If the named endMark does not exist, an error will be thrown.
+ * @param name
+ * @param startMark
+ * @param endMark
+ * @return The PerformanceMeasure entry that was created
+ */
+ measure(name: string, startMark?: string, endMark?: string): PerformanceMeasure;
+ measure(name: string, options: MeasureOptions): PerformanceMeasure;
+ /**
+ * An instance of the PerformanceNodeTiming class that provides performance metrics for specific Node.js operational milestones.
+ */
+ readonly nodeTiming: PerformanceNodeTiming;
+ /**
+ * @return the current high resolution millisecond timestamp
+ */
+ now(): number;
+ /**
+ * The timeOrigin specifies the high resolution millisecond timestamp from which all performance metric durations are measured.
+ */
+ readonly timeOrigin: number;
+ /**
+ * Wraps a function within a new function that measures the running time of the wrapped function.
+ * A PerformanceObserver must be subscribed to the 'function' event type in order for the timing details to be accessed.
+ * @param fn
+ */
+ timerify<T extends (...params: any[]) => any>(fn: T, options?: TimerifyOptions): T;
+ /**
+ * eventLoopUtilization is similar to CPU utilization except that it is calculated using high precision wall-clock time.
+ * It represents the percentage of time the event loop has spent outside the event loop's event provider (e.g. epoll_wait).
+ * No other CPU idle time is taken into consideration.
+ */
+ eventLoopUtilization: EventLoopUtilityFunction;
+ }
+ interface PerformanceObserverEntryList {
+ /**
+ * Returns a list of `PerformanceEntry` objects in chronological order
+ * with respect to `performanceEntry.startTime`.
+ *
+ * ```js
+ * const {
+ * performance,
+ * PerformanceObserver
+ * } = require('perf_hooks');
+ *
+ * const obs = new PerformanceObserver((perfObserverList, observer) => {
+ * console.log(perfObserverList.getEntries());
+ *
+ * * [
+ * * PerformanceEntry {
+ * * name: 'test',
+ * * entryType: 'mark',
+ * * startTime: 81.465639,
+ * * duration: 0
+ * * },
+ * * PerformanceEntry {
+ * * name: 'meow',
+ * * entryType: 'mark',
+ * * startTime: 81.860064,
+ * * duration: 0
+ * * }
+ * * ]
+ *
+ * performance.clearMarks();
+ * performance.clearMeasures();
+ * observer.disconnect();
+ * });
+ * obs.observe({ type: 'mark' });
+ *
+ * performance.mark('test');
+ * performance.mark('meow');
+ * ```
+ * @since v8.5.0
+ */
+ getEntries(): PerformanceEntry[];
+ /**
+ * Returns a list of `PerformanceEntry` objects in chronological order
+ * with respect to `performanceEntry.startTime` whose `performanceEntry.name` is
+ * equal to `name`, and optionally, whose `performanceEntry.entryType` is equal to`type`.
+ *
+ * ```js
+ * const {
+ * performance,
+ * PerformanceObserver
+ * } = require('perf_hooks');
+ *
+ * const obs = new PerformanceObserver((perfObserverList, observer) => {
+ * console.log(perfObserverList.getEntriesByName('meow'));
+ *
+ * * [
+ * * PerformanceEntry {
+ * * name: 'meow',
+ * * entryType: 'mark',
+ * * startTime: 98.545991,
+ * * duration: 0
+ * * }
+ * * ]
+ *
+ * console.log(perfObserverList.getEntriesByName('nope')); // []
+ *
+ * console.log(perfObserverList.getEntriesByName('test', 'mark'));
+ *
+ * * [
+ * * PerformanceEntry {
+ * * name: 'test',
+ * * entryType: 'mark',
+ * * startTime: 63.518931,
+ * * duration: 0
+ * * }
+ * * ]
+ *
+ * console.log(perfObserverList.getEntriesByName('test', 'measure')); // []
+ *
+ * performance.clearMarks();
+ * performance.clearMeasures();
+ * observer.disconnect();
+ * });
+ * obs.observe({ entryTypes: ['mark', 'measure'] });
+ *
+ * performance.mark('test');
+ * performance.mark('meow');
+ * ```
+ * @since v8.5.0
+ */
+ getEntriesByName(name: string, type?: EntryType): PerformanceEntry[];
+ /**
+ * Returns a list of `PerformanceEntry` objects in chronological order
+ * with respect to `performanceEntry.startTime` whose `performanceEntry.entryType`is equal to `type`.
+ *
+ * ```js
+ * const {
+ * performance,
+ * PerformanceObserver
+ * } = require('perf_hooks');
+ *
+ * const obs = new PerformanceObserver((perfObserverList, observer) => {
+ * console.log(perfObserverList.getEntriesByType('mark'));
+ *
+ * * [
+ * * PerformanceEntry {
+ * * name: 'test',
+ * * entryType: 'mark',
+ * * startTime: 55.897834,
+ * * duration: 0
+ * * },
+ * * PerformanceEntry {
+ * * name: 'meow',
+ * * entryType: 'mark',
+ * * startTime: 56.350146,
+ * * duration: 0
+ * * }
+ * * ]
+ *
+ * performance.clearMarks();
+ * performance.clearMeasures();
+ * observer.disconnect();
+ * });
+ * obs.observe({ type: 'mark' });
+ *
+ * performance.mark('test');
+ * performance.mark('meow');
+ * ```
+ * @since v8.5.0
+ */
+ getEntriesByType(type: EntryType): PerformanceEntry[];
+ }
+ type PerformanceObserverCallback = (list: PerformanceObserverEntryList, observer: PerformanceObserver) => void;
+ class PerformanceObserver extends AsyncResource {
+ constructor(callback: PerformanceObserverCallback);
+ /**
+ * Disconnects the `PerformanceObserver` instance from all notifications.
+ * @since v8.5.0
+ */
+ disconnect(): void;
+ /**
+ * Subscribes the `PerformanceObserver` instance to notifications of new `PerformanceEntry` instances identified either by `options.entryTypes`or `options.type`:
+ *
+ * ```js
+ * const {
+ * performance,
+ * PerformanceObserver
+ * } = require('perf_hooks');
+ *
+ * const obs = new PerformanceObserver((list, observer) => {
+ * // Called once asynchronously. `list` contains three items.
+ * });
+ * obs.observe({ type: 'mark' });
+ *
+ * for (let n = 0; n < 3; n++)
+ * performance.mark(`test${n}`);
+ * ```
+ * @since v8.5.0
+ */
+ observe(
+ options:
+ | {
+ entryTypes: readonly EntryType[];
+ buffered?: boolean | undefined;
+ }
+ | {
+ type: EntryType;
+ buffered?: boolean | undefined;
+ },
+ ): void;
+ }
+ namespace constants {
+ const NODE_PERFORMANCE_GC_MAJOR: number;
+ const NODE_PERFORMANCE_GC_MINOR: number;
+ const NODE_PERFORMANCE_GC_INCREMENTAL: number;
+ const NODE_PERFORMANCE_GC_WEAKCB: number;
+ const NODE_PERFORMANCE_GC_FLAGS_NO: number;
+ const NODE_PERFORMANCE_GC_FLAGS_CONSTRUCT_RETAINED: number;
+ const NODE_PERFORMANCE_GC_FLAGS_FORCED: number;
+ const NODE_PERFORMANCE_GC_FLAGS_SYNCHRONOUS_PHANTOM_PROCESSING: number;
+ const NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE: number;
+ const NODE_PERFORMANCE_GC_FLAGS_ALL_EXTERNAL_MEMORY: number;
+ const NODE_PERFORMANCE_GC_FLAGS_SCHEDULE_IDLE: number;
+ }
+ const performance: Performance;
+ interface EventLoopMonitorOptions {
+ /**
+ * The sampling rate in milliseconds.
+ * Must be greater than zero.
+ * @default 10
+ */
+ resolution?: number | undefined;
+ }
+ interface Histogram {
+ /**
+ * Returns a `Map` object detailing the accumulated percentile distribution.
+ * @since v11.10.0
+ */
+ readonly percentiles: Map<number, number>;
+ /**
+ * The number of times the event loop delay exceeded the maximum 1 hour event
+ * loop delay threshold.
+ * @since v11.10.0
+ */
+ readonly exceeds: number;
+ /**
+ * The minimum recorded event loop delay.
+ * @since v11.10.0
+ */
+ readonly min: number;
+ /**
+ * The maximum recorded event loop delay.
+ * @since v11.10.0
+ */
+ readonly max: number;
+ /**
+ * The mean of the recorded event loop delays.
+ * @since v11.10.0
+ */
+ readonly mean: number;
+ /**
+ * The standard deviation of the recorded event loop delays.
+ * @since v11.10.0
+ */
+ readonly stddev: number;
+ /**
+ * Resets the collected histogram data.
+ * @since v11.10.0
+ */
+ reset(): void;
+ /**
+ * Returns the value at the given percentile.
+ * @since v11.10.0
+ * @param percentile A percentile value in the range (0, 100].
+ */
+ percentile(percentile: number): number;
+ }
+ interface IntervalHistogram extends Histogram {
+ /**
+ * Enables the update interval timer. Returns `true` if the timer was
+ * started, `false` if it was already started.
+ * @since v11.10.0
+ */
+ enable(): boolean;
+ /**
+ * Disables the update interval timer. Returns `true` if the timer was
+ * stopped, `false` if it was already stopped.
+ * @since v11.10.0
+ */
+ disable(): boolean;
+ }
+ interface RecordableHistogram extends Histogram {
+ /**
+ * @since v15.9.0, v14.18.0
+ * @param val The amount to record in the histogram.
+ */
+ record(val: number | bigint): void;
+ /**
+ * Calculates the amount of time (in nanoseconds) that has passed since the
+ * previous call to `recordDelta()` and records that amount in the histogram.
+ *
+ * ## Examples
+ * @since v15.9.0, v14.18.0
+ */
+ recordDelta(): void;
+ /**
+ * Adds the values from other to this histogram.
+ * @since v17.4.0, v16.14.0
+ * @param other Recordable Histogram to combine with
+ */
+ add(other: RecordableHistogram): void;
+ }
+ /**
+ * _This property is an extension by Node.js. It is not available in Web browsers._
+ *
+ * Creates an `IntervalHistogram` object that samples and reports the event loop
+ * delay over time. The delays will be reported in nanoseconds.
+ *
+ * Using a timer to detect approximate event loop delay works because the
+ * execution of timers is tied specifically to the lifecycle of the libuv
+ * event loop. That is, a delay in the loop will cause a delay in the execution
+ * of the timer, and those delays are specifically what this API is intended to
+ * detect.
+ *
+ * ```js
+ * const { monitorEventLoopDelay } = require('perf_hooks');
+ * const h = monitorEventLoopDelay({ resolution: 20 });
+ * h.enable();
+ * // Do something.
+ * h.disable();
+ * console.log(h.min);
+ * console.log(h.max);
+ * console.log(h.mean);
+ * console.log(h.stddev);
+ * console.log(h.percentiles);
+ * console.log(h.percentile(50));
+ * console.log(h.percentile(99));
+ * ```
+ * @since v11.10.0
+ */
+ function monitorEventLoopDelay(options?: EventLoopMonitorOptions): IntervalHistogram;
+ interface CreateHistogramOptions {
+ /**
+ * The minimum recordable value. Must be an integer value greater than 0.
+ * @default 1
+ */
+ min?: number | bigint | undefined;
+ /**
+ * The maximum recordable value. Must be an integer value greater than min.
+ * @default Number.MAX_SAFE_INTEGER
+ */
+ max?: number | bigint | undefined;
+ /**
+ * The number of accuracy digits. Must be a number between 1 and 5.
+ * @default 3
+ */
+ figures?: number | undefined;
+ }
+ /**
+ * Returns a `RecordableHistogram`.
+ * @since v15.9.0, v14.18.0
+ */
+ function createHistogram(options?: CreateHistogramOptions): RecordableHistogram;
+
+ import { performance as _performance } from "perf_hooks";
+ global {
+ /**
+ * `performance` is a global reference for `require('perf_hooks').performance`
+ * https://nodejs.org/api/globals.html#performance
+ * @since v16.0.0
+ */
+ var performance: typeof globalThis extends {
+ onmessage: any;
+ performance: infer T;
+ } ? T
+ : typeof _performance;
+ }
+}
+declare module "node:perf_hooks" {
+ export * from "perf_hooks";
+}
diff --git a/client/node_modules/@types/node/ts4.8/process.d.ts b/client/node_modules/@types/node/ts4.8/process.d.ts
new file mode 100644
index 0000000..e71ff8e
--- /dev/null
+++ b/client/node_modules/@types/node/ts4.8/process.d.ts
@@ -0,0 +1,1518 @@
+declare module "process" {
+ import * as tty from "node:tty";
+ import { Worker } from "node:worker_threads";
+ global {
+ var process: NodeJS.Process;
+ namespace NodeJS {
+ // this namespace merge is here because these are specifically used
+ // as the type for process.stdin, process.stdout, and process.stderr.
+ // they can't live in tty.d.ts because we need to disambiguate the imported name.
+ interface ReadStream extends tty.ReadStream {}
+ interface WriteStream extends tty.WriteStream {}
+ interface MemoryUsageFn {
+ /**
+ * The `process.memoryUsage()` method iterate over each page to gather informations about memory
+ * usage which can be slow depending on the program memory allocations.
+ */
+ (): MemoryUsage;
+ /**
+ * method returns an integer representing the Resident Set Size (RSS) in bytes.
+ */
+ rss(): number;
+ }
+ interface MemoryUsage {
+ rss: number;
+ heapTotal: number;
+ heapUsed: number;
+ external: number;
+ arrayBuffers: number;
+ }
+ interface CpuUsage {
+ user: number;
+ system: number;
+ }
+ interface ProcessRelease {
+ name: string;
+ sourceUrl?: string | undefined;
+ headersUrl?: string | undefined;
+ libUrl?: string | undefined;
+ lts?: string | undefined;
+ }
+ interface ProcessVersions extends Dict<string> {
+ http_parser: string;
+ node: string;
+ v8: string;
+ ares: string;
+ uv: string;
+ zlib: string;
+ modules: string;
+ openssl: string;
+ }
+ type Platform =
+ | "aix"
+ | "android"
+ | "darwin"
+ | "freebsd"
+ | "haiku"
+ | "linux"
+ | "openbsd"
+ | "sunos"
+ | "win32"
+ | "cygwin"
+ | "netbsd";
+ type Architecture =
+ | "arm"
+ | "arm64"
+ | "ia32"
+ | "mips"
+ | "mipsel"
+ | "ppc"
+ | "ppc64"
+ | "s390"
+ | "s390x"
+ | "x64";
+ type Signals =
+ | "SIGABRT"
+ | "SIGALRM"
+ | "SIGBUS"
+ | "SIGCHLD"
+ | "SIGCONT"
+ | "SIGFPE"
+ | "SIGHUP"
+ | "SIGILL"
+ | "SIGINT"
+ | "SIGIO"
+ | "SIGIOT"
+ | "SIGKILL"
+ | "SIGPIPE"
+ | "SIGPOLL"
+ | "SIGPROF"
+ | "SIGPWR"
+ | "SIGQUIT"
+ | "SIGSEGV"
+ | "SIGSTKFLT"
+ | "SIGSTOP"
+ | "SIGSYS"
+ | "SIGTERM"
+ | "SIGTRAP"
+ | "SIGTSTP"
+ | "SIGTTIN"
+ | "SIGTTOU"
+ | "SIGUNUSED"
+ | "SIGURG"
+ | "SIGUSR1"
+ | "SIGUSR2"
+ | "SIGVTALRM"
+ | "SIGWINCH"
+ | "SIGXCPU"
+ | "SIGXFSZ"
+ | "SIGBREAK"
+ | "SIGLOST"
+ | "SIGINFO";
+ type UncaughtExceptionOrigin = "uncaughtException" | "unhandledRejection";
+ type MultipleResolveType = "resolve" | "reject";
+ type BeforeExitListener = (code: number) => void;
+ type DisconnectListener = () => void;
+ type ExitListener = (code: number) => void;
+ type RejectionHandledListener = (promise: Promise<unknown>) => void;
+ type UncaughtExceptionListener = (error: Error, origin: UncaughtExceptionOrigin) => void;
+ /**
+ * Most of the time the unhandledRejection will be an Error, but this should not be relied upon
+ * as *anything* can be thrown/rejected, it is therefore unsafe to assume that the value is an Error.
+ */
+ type UnhandledRejectionListener = (reason: unknown, promise: Promise<unknown>) => void;
+ type WarningListener = (warning: Error) => void;
+ type MessageListener = (message: unknown, sendHandle: unknown) => void;
+ type SignalsListener = (signal: Signals) => void;
+ type MultipleResolveListener = (
+ type: MultipleResolveType,
+ promise: Promise<unknown>,
+ value: unknown,
+ ) => void;
+ type WorkerListener = (worker: Worker) => void;
+ interface Socket extends ReadWriteStream {
+ isTTY?: true | undefined;
+ }
+ // Alias for compatibility
+ interface ProcessEnv extends Dict<string> {
+ /**
+ * Can be used to change the default timezone at runtime
+ */
+ TZ?: string;
+ }
+ interface HRTime {
+ (time?: [number, number]): [number, number];
+ bigint(): bigint;
+ }
+ interface ProcessReport {
+ /**
+ * Directory where the report is written.
+ * working directory of the Node.js process.
+ * @default '' indicating that reports are written to the current
+ */
+ directory: string;
+ /**
+ * Filename where the report is written.
+ * The default value is the empty string.
+ * @default '' the output filename will be comprised of a timestamp,
+ * PID, and sequence number.
+ */
+ filename: string;
+ /**
+ * Returns a JSON-formatted diagnostic report for the running process.
+ * The report's JavaScript stack trace is taken from err, if present.
+ */
+ getReport(err?: Error): string;
+ /**
+ * If true, a diagnostic report is generated on fatal errors,
+ * such as out of memory errors or failed C++ assertions.
+ * @default false
+ */
+ reportOnFatalError: boolean;
+ /**
+ * If true, a diagnostic report is generated when the process
+ * receives the signal specified by process.report.signal.
+ * @default false
+ */
+ reportOnSignal: boolean;
+ /**
+ * If true, a diagnostic report is generated on uncaught exception.
+ * @default false
+ */
+ reportOnUncaughtException: boolean;
+ /**
+ * The signal used to trigger the creation of a diagnostic report.
+ * @default 'SIGUSR2'
+ */
+ signal: Signals;
+ /**
+ * Writes a diagnostic report to a file. If filename is not provided, the default filename
+ * includes the date, time, PID, and a sequence number.
+ * The report's JavaScript stack trace is taken from err, if present.
+ *
+ * @param fileName Name of the file where the report is written.
+ * This should be a relative path, that will be appended to the directory specified in
+ * `process.report.directory`, or the current working directory of the Node.js process,
+ * if unspecified.
+ * @param error A custom error used for reporting the JavaScript stack.
+ * @return Filename of the generated report.
+ */
+ writeReport(fileName?: string): string;
+ writeReport(error?: Error): string;
+ writeReport(fileName?: string, err?: Error): string;
+ }
+ interface ResourceUsage {
+ fsRead: number;
+ fsWrite: number;
+ involuntaryContextSwitches: number;
+ ipcReceived: number;
+ ipcSent: number;
+ majorPageFault: number;
+ maxRSS: number;
+ minorPageFault: number;
+ sharedMemorySize: number;
+ signalsCount: number;
+ swappedOut: number;
+ systemCPUTime: number;
+ unsharedDataSize: number;
+ unsharedStackSize: number;
+ userCPUTime: number;
+ voluntaryContextSwitches: number;
+ }
+ interface EmitWarningOptions {
+ /**
+ * When `warning` is a `string`, `type` is the name to use for the _type_ of warning being emitted.
+ *
+ * @default 'Warning'
+ */
+ type?: string | undefined;
+ /**
+ * A unique identifier for the warning instance being emitted.
+ */
+ code?: string | undefined;
+ /**
+ * When `warning` is a `string`, `ctor` is an optional function used to limit the generated stack trace.
+ *
+ * @default process.emitWarning
+ */
+ ctor?: Function | undefined;
+ /**
+ * Additional text to include with the error.
+ */
+ detail?: string | undefined;
+ }
+ interface ProcessConfig {
+ readonly target_defaults: {
+ readonly cflags: any[];
+ readonly default_configuration: string;
+ readonly defines: string[];
+ readonly include_dirs: string[];
+ readonly libraries: string[];
+ };
+ readonly variables: {
+ readonly clang: number;
+ readonly host_arch: string;
+ readonly node_install_npm: boolean;
+ readonly node_install_waf: boolean;
+ readonly node_prefix: string;
+ readonly node_shared_openssl: boolean;
+ readonly node_shared_v8: boolean;
+ readonly node_shared_zlib: boolean;
+ readonly node_use_dtrace: boolean;
+ readonly node_use_etw: boolean;
+ readonly node_use_openssl: boolean;
+ readonly target_arch: string;
+ readonly v8_no_strict_aliasing: number;
+ readonly v8_use_snapshot: boolean;
+ readonly visibility: string;
+ };
+ }
+ interface Process extends EventEmitter {
+ /**
+ * The `process.stdout` property returns a stream connected to`stdout` (fd `1`). It is a `net.Socket` (which is a `Duplex` stream) unless fd `1` refers to a file, in which case it is
+ * a `Writable` stream.
+ *
+ * For example, to copy `process.stdin` to `process.stdout`:
+ *
+ * ```js
+ * import { stdin, stdout } from 'process';
+ *
+ * stdin.pipe(stdout);
+ * ```
+ *
+ * `process.stdout` differs from other Node.js streams in important ways. See `note on process I/O` for more information.
+ */
+ stdout: WriteStream & {
+ fd: 1;
+ };
+ /**
+ * The `process.stderr` property returns a stream connected to`stderr` (fd `2`). It is a `net.Socket` (which is a `Duplex` stream) unless fd `2` refers to a file, in which case it is
+ * a `Writable` stream.
+ *
+ * `process.stderr` differs from other Node.js streams in important ways. See `note on process I/O` for more information.
+ */
+ stderr: WriteStream & {
+ fd: 2;
+ };
+ /**
+ * The `process.stdin` property returns a stream connected to`stdin` (fd `0`). It is a `net.Socket` (which is a `Duplex` stream) unless fd `0` refers to a file, in which case it is
+ * a `Readable` stream.
+ *
+ * For details of how to read from `stdin` see `readable.read()`.
+ *
+ * As a `Duplex` stream, `process.stdin` can also be used in "old" mode that
+ * is compatible with scripts written for Node.js prior to v0.10\.
+ * For more information see `Stream compatibility`.
+ *
+ * In "old" streams mode the `stdin` stream is paused by default, so one
+ * must call `process.stdin.resume()` to read from it. Note also that calling`process.stdin.resume()` itself would switch stream to "old" mode.
+ */
+ stdin: ReadStream & {
+ fd: 0;
+ };
+ openStdin(): Socket;
+ /**
+ * The `process.argv` property returns an array containing the command-line
+ * arguments passed when the Node.js process was launched. The first element will
+ * be {@link execPath}. See `process.argv0` if access to the original value
+ * of `argv[0]` is needed. The second element will be the path to the JavaScript
+ * file being executed. The remaining elements will be any additional command-line
+ * arguments.
+ *
+ * For example, assuming the following script for `process-args.js`:
+ *
+ * ```js
+ * import { argv } from 'process';
+ *
+ * // print process.argv
+ * argv.forEach((val, index) => {
+ * console.log(`${index}: ${val}`);
+ * });
+ * ```
+ *
+ * Launching the Node.js process as:
+ *
+ * ```console
+ * $ node process-args.js one two=three four
+ * ```
+ *
+ * Would generate the output:
+ *
+ * ```text
+ * 0: /usr/local/bin/node
+ * 1: /Users/mjr/work/node/process-args.js
+ * 2: one
+ * 3: two=three
+ * 4: four
+ * ```
+ * @since v0.1.27
+ */
+ argv: string[];
+ /**
+ * The `process.argv0` property stores a read-only copy of the original value of`argv[0]` passed when Node.js starts.
+ *
+ * ```console
+ * $ bash -c 'exec -a customArgv0 ./node'
+ * > process.argv[0]
+ * '/Volumes/code/external/node/out/Release/node'
+ * > process.argv0
+ * 'customArgv0'
+ * ```
+ * @since v6.4.0
+ */
+ argv0: string;
+ /**
+ * The `process.execArgv` property returns the set of Node.js-specific command-line
+ * options passed when the Node.js process was launched. These options do not
+ * appear in the array returned by the {@link argv} property, and do not
+ * include the Node.js executable, the name of the script, or any options following
+ * the script name. These options are useful in order to spawn child processes with
+ * the same execution environment as the parent.
+ *
+ * ```console
+ * $ node --harmony script.js --version
+ * ```
+ *
+ * Results in `process.execArgv`:
+ *
+ * ```js
+ * ['--harmony']
+ * ```
+ *
+ * And `process.argv`:
+ *
+ * ```js
+ * ['/usr/local/bin/node', 'script.js', '--version']
+ * ```
+ *
+ * Refer to `Worker constructor` for the detailed behavior of worker
+ * threads with this property.
+ * @since v0.7.7
+ */
+ execArgv: string[];
+ /**
+ * The `process.execPath` property returns the absolute pathname of the executable
+ * that started the Node.js process. Symbolic links, if any, are resolved.
+ *
+ * ```js
+ * '/usr/local/bin/node'
+ * ```
+ * @since v0.1.100
+ */
+ execPath: string;
+ /**
+ * The `process.abort()` method causes the Node.js process to exit immediately and
+ * generate a core file.
+ *
+ * This feature is not available in `Worker` threads.
+ * @since v0.7.0
+ */
+ abort(): never;
+ /**
+ * The `process.chdir()` method changes the current working directory of the
+ * Node.js process or throws an exception if doing so fails (for instance, if
+ * the specified `directory` does not exist).
+ *
+ * ```js
+ * import { chdir, cwd } from 'process';
+ *
+ * console.log(`Starting directory: ${cwd()}`);
+ * try {
+ * chdir('/tmp');
+ * console.log(`New directory: ${cwd()}`);
+ * } catch (err) {
+ * console.error(`chdir: ${err}`);
+ * }
+ * ```
+ *
+ * This feature is not available in `Worker` threads.
+ * @since v0.1.17
+ */
+ chdir(directory: string): void;
+ /**
+ * The `process.cwd()` method returns the current working directory of the Node.js
+ * process.
+ *
+ * ```js
+ * import { cwd } from 'process';
+ *
+ * console.log(`Current directory: ${cwd()}`);
+ * ```
+ * @since v0.1.8
+ */
+ cwd(): string;
+ /**
+ * The port used by the Node.js debugger when enabled.
+ *
+ * ```js
+ * import process from 'process';
+ *
+ * process.debugPort = 5858;
+ * ```
+ * @since v0.7.2
+ */
+ debugPort: number;
+ /**
+ * The `process.emitWarning()` method can be used to emit custom or application
+ * specific process warnings. These can be listened for by adding a handler to the `'warning'` event.
+ *
+ * ```js
+ * import { emitWarning } from 'process';
+ *
+ * // Emit a warning with a code and additional detail.
+ * emitWarning('Something happened!', {
+ * code: 'MY_WARNING',
+ * detail: 'This is some additional information'
+ * });
+ * // Emits:
+ * // (node:56338) [MY_WARNING] Warning: Something happened!
+ * // This is some additional information
+ * ```
+ *
+ * In this example, an `Error` object is generated internally by`process.emitWarning()` and passed through to the `'warning'` handler.
+ *
+ * ```js
+ * import process from 'process';
+ *
+ * process.on('warning', (warning) => {
+ * console.warn(warning.name); // 'Warning'
+ * console.warn(warning.message); // 'Something happened!'
+ * console.warn(warning.code); // 'MY_WARNING'
+ * console.warn(warning.stack); // Stack trace
+ * console.warn(warning.detail); // 'This is some additional information'
+ * });
+ * ```
+ *
+ * If `warning` is passed as an `Error` object, the `options` argument is ignored.
+ * @since v8.0.0
+ * @param warning The warning to emit.
+ */
+ emitWarning(warning: string | Error, ctor?: Function): void;
+ emitWarning(warning: string | Error, type?: string, ctor?: Function): void;
+ emitWarning(warning: string | Error, type?: string, code?: string, ctor?: Function): void;
+ emitWarning(warning: string | Error, options?: EmitWarningOptions): void;
+ /**
+ * The `process.env` property returns an object containing the user environment.
+ * See [`environ(7)`](http://man7.org/linux/man-pages/man7/environ.7.html).
+ *
+ * An example of this object looks like:
+ *
+ * ```js
+ * {
+ * TERM: 'xterm-256color',
+ * SHELL: '/usr/local/bin/bash',
+ * USER: 'maciej',
+ * PATH: '~/.bin/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin',
+ * PWD: '/Users/maciej',
+ * EDITOR: 'vim',
+ * SHLVL: '1',
+ * HOME: '/Users/maciej',
+ * LOGNAME: 'maciej',
+ * _: '/usr/local/bin/node'
+ * }
+ * ```
+ *
+ * It is possible to modify this object, but such modifications will not be
+ * reflected outside the Node.js process, or (unless explicitly requested)
+ * to other `Worker` threads.
+ * In other words, the following example would not work:
+ *
+ * ```console
+ * $ node -e 'process.env.foo = "bar"' &#x26;&#x26; echo $foo
+ * ```
+ *
+ * While the following will:
+ *
+ * ```js
+ * import { env } from 'process';
+ *
+ * env.foo = 'bar';
+ * console.log(env.foo);
+ * ```
+ *
+ * Assigning a property on `process.env` will implicitly convert the value
+ * to a string. **This behavior is deprecated.** Future versions of Node.js may
+ * throw an error when the value is not a string, number, or boolean.
+ *
+ * ```js
+ * import { env } from 'process';
+ *
+ * env.test = null;
+ * console.log(env.test);
+ * // => 'null'
+ * env.test = undefined;
+ * console.log(env.test);
+ * // => 'undefined'
+ * ```
+ *
+ * Use `delete` to delete a property from `process.env`.
+ *
+ * ```js
+ * import { env } from 'process';
+ *
+ * env.TEST = 1;
+ * delete env.TEST;
+ * console.log(env.TEST);
+ * // => undefined
+ * ```
+ *
+ * On Windows operating systems, environment variables are case-insensitive.
+ *
+ * ```js
+ * import { env } from 'process';
+ *
+ * env.TEST = 1;
+ * console.log(env.test);
+ * // => 1
+ * ```
+ *
+ * Unless explicitly specified when creating a `Worker` instance,
+ * each `Worker` thread has its own copy of `process.env`, based on its
+ * parent thread’s `process.env`, or whatever was specified as the `env` option
+ * to the `Worker` constructor. Changes to `process.env` will not be visible
+ * across `Worker` threads, and only the main thread can make changes that
+ * are visible to the operating system or to native add-ons.
+ * @since v0.1.27
+ */
+ env: ProcessEnv;
+ /**
+ * The `process.exit()` method instructs Node.js to terminate the process
+ * synchronously with an exit status of `code`. If `code` is omitted, exit uses
+ * either the 'success' code `0` or the value of `process.exitCode` if it has been
+ * set. Node.js will not terminate until all the `'exit'` event listeners are
+ * called.
+ *
+ * To exit with a 'failure' code:
+ *
+ * ```js
+ * import { exit } from 'process';
+ *
+ * exit(1);
+ * ```
+ *
+ * The shell that executed Node.js should see the exit code as `1`.
+ *
+ * Calling `process.exit()` will force the process to exit as quickly as possible
+ * even if there are still asynchronous operations pending that have not yet
+ * completed fully, including I/O operations to `process.stdout` and`process.stderr`.
+ *
+ * In most situations, it is not actually necessary to call `process.exit()`explicitly. The Node.js process will exit on its own _if there is no additional_
+ * _work pending_ in the event loop. The `process.exitCode` property can be set to
+ * tell the process which exit code to use when the process exits gracefully.
+ *
+ * For instance, the following example illustrates a _misuse_ of the`process.exit()` method that could lead to data printed to stdout being
+ * truncated and lost:
+ *
+ * ```js
+ * import { exit } from 'process';
+ *
+ * // This is an example of what *not* to do:
+ * if (someConditionNotMet()) {
+ * printUsageToStdout();
+ * exit(1);
+ * }
+ * ```
+ *
+ * The reason this is problematic is because writes to `process.stdout` in Node.js
+ * are sometimes _asynchronous_ and may occur over multiple ticks of the Node.js
+ * event loop. Calling `process.exit()`, however, forces the process to exit _before_ those additional writes to `stdout` can be performed.
+ *
+ * Rather than calling `process.exit()` directly, the code _should_ set the`process.exitCode` and allow the process to exit naturally by avoiding
+ * scheduling any additional work for the event loop:
+ *
+ * ```js
+ * import process from 'process';
+ *
+ * // How to properly set the exit code while letting
+ * // the process exit gracefully.
+ * if (someConditionNotMet()) {
+ * printUsageToStdout();
+ * process.exitCode = 1;
+ * }
+ * ```
+ *
+ * If it is necessary to terminate the Node.js process due to an error condition,
+ * throwing an _uncaught_ error and allowing the process to terminate accordingly
+ * is safer than calling `process.exit()`.
+ *
+ * In `Worker` threads, this function stops the current thread rather
+ * than the current process.
+ * @since v0.1.13
+ * @param [code=0] The exit code.
+ */
+ exit(code?: number): never;
+ /**
+ * A number which will be the process exit code, when the process either
+ * exits gracefully, or is exited via {@link exit} without specifying
+ * a code.
+ *
+ * Specifying a code to {@link exit} will override any
+ * previous setting of `process.exitCode`.
+ * @since v0.11.8
+ */
+ exitCode?: number | undefined;
+ /**
+ * The `process.getgid()` method returns the numerical group identity of the
+ * process. (See [`getgid(2)`](http://man7.org/linux/man-pages/man2/getgid.2.html).)
+ *
+ * ```js
+ * import process from 'process';
+ *
+ * if (process.getgid) {
+ * console.log(`Current gid: ${process.getgid()}`);
+ * }
+ * ```
+ *
+ * This function is only available on POSIX platforms (i.e. not Windows or
+ * Android).
+ * @since v0.1.31
+ */
+ getgid?: () => number;
+ /**
+ * The `process.setgid()` method sets the group identity of the process. (See [`setgid(2)`](http://man7.org/linux/man-pages/man2/setgid.2.html).) The `id` can be passed as either a
+ * numeric ID or a group name
+ * string. If a group name is specified, this method blocks while resolving the
+ * associated numeric ID.
+ *
+ * ```js
+ * import process from 'process';
+ *
+ * if (process.getgid &#x26;&#x26; process.setgid) {
+ * console.log(`Current gid: ${process.getgid()}`);
+ * try {
+ * process.setgid(501);
+ * console.log(`New gid: ${process.getgid()}`);
+ * } catch (err) {
+ * console.log(`Failed to set gid: ${err}`);
+ * }
+ * }
+ * ```
+ *
+ * This function is only available on POSIX platforms (i.e. not Windows or
+ * Android).
+ * This feature is not available in `Worker` threads.
+ * @since v0.1.31
+ * @param id The group name or ID
+ */
+ setgid?: (id: number | string) => void;
+ /**
+ * The `process.getuid()` method returns the numeric user identity of the process.
+ * (See [`getuid(2)`](http://man7.org/linux/man-pages/man2/getuid.2.html).)
+ *
+ * ```js
+ * import process from 'process';
+ *
+ * if (process.getuid) {
+ * console.log(`Current uid: ${process.getuid()}`);
+ * }
+ * ```
+ *
+ * This function is only available on POSIX platforms (i.e. not Windows or
+ * Android).
+ * @since v0.1.28
+ */
+ getuid?: () => number;
+ /**
+ * The `process.setuid(id)` method sets the user identity of the process. (See [`setuid(2)`](http://man7.org/linux/man-pages/man2/setuid.2.html).) The `id` can be passed as either a
+ * numeric ID or a username string.
+ * If a username is specified, the method blocks while resolving the associated
+ * numeric ID.
+ *
+ * ```js
+ * import process from 'process';
+ *
+ * if (process.getuid &#x26;&#x26; process.setuid) {
+ * console.log(`Current uid: ${process.getuid()}`);
+ * try {
+ * process.setuid(501);
+ * console.log(`New uid: ${process.getuid()}`);
+ * } catch (err) {
+ * console.log(`Failed to set uid: ${err}`);
+ * }
+ * }
+ * ```
+ *
+ * This function is only available on POSIX platforms (i.e. not Windows or
+ * Android).
+ * This feature is not available in `Worker` threads.
+ * @since v0.1.28
+ */
+ setuid?: (id: number | string) => void;
+ /**
+ * The `process.geteuid()` method returns the numerical effective user identity of
+ * the process. (See [`geteuid(2)`](http://man7.org/linux/man-pages/man2/geteuid.2.html).)
+ *
+ * ```js
+ * import process from 'process';
+ *
+ * if (process.geteuid) {
+ * console.log(`Current uid: ${process.geteuid()}`);
+ * }
+ * ```
+ *
+ * This function is only available on POSIX platforms (i.e. not Windows or
+ * Android).
+ * @since v2.0.0
+ */
+ geteuid?: () => number;
+ /**
+ * The `process.seteuid()` method sets the effective user identity of the process.
+ * (See [`seteuid(2)`](http://man7.org/linux/man-pages/man2/seteuid.2.html).) The `id` can be passed as either a numeric ID or a username
+ * string. If a username is specified, the method blocks while resolving the
+ * associated numeric ID.
+ *
+ * ```js
+ * import process from 'process';
+ *
+ * if (process.geteuid &#x26;&#x26; process.seteuid) {
+ * console.log(`Current uid: ${process.geteuid()}`);
+ * try {
+ * process.seteuid(501);
+ * console.log(`New uid: ${process.geteuid()}`);
+ * } catch (err) {
+ * console.log(`Failed to set uid: ${err}`);
+ * }
+ * }
+ * ```
+ *
+ * This function is only available on POSIX platforms (i.e. not Windows or
+ * Android).
+ * This feature is not available in `Worker` threads.
+ * @since v2.0.0
+ * @param id A user name or ID
+ */
+ seteuid?: (id: number | string) => void;
+ /**
+ * The `process.getegid()` method returns the numerical effective group identity
+ * of the Node.js process. (See [`getegid(2)`](http://man7.org/linux/man-pages/man2/getegid.2.html).)
+ *
+ * ```js
+ * import process from 'process';
+ *
+ * if (process.getegid) {
+ * console.log(`Current gid: ${process.getegid()}`);
+ * }
+ * ```
+ *
+ * This function is only available on POSIX platforms (i.e. not Windows or
+ * Android).
+ * @since v2.0.0
+ */
+ getegid?: () => number;
+ /**
+ * The `process.setegid()` method sets the effective group identity of the process.
+ * (See [`setegid(2)`](http://man7.org/linux/man-pages/man2/setegid.2.html).) The `id` can be passed as either a numeric ID or a group
+ * name string. If a group name is specified, this method blocks while resolving
+ * the associated a numeric ID.
+ *
+ * ```js
+ * import process from 'process';
+ *
+ * if (process.getegid &#x26;&#x26; process.setegid) {
+ * console.log(`Current gid: ${process.getegid()}`);
+ * try {
+ * process.setegid(501);
+ * console.log(`New gid: ${process.getegid()}`);
+ * } catch (err) {
+ * console.log(`Failed to set gid: ${err}`);
+ * }
+ * }
+ * ```
+ *
+ * This function is only available on POSIX platforms (i.e. not Windows or
+ * Android).
+ * This feature is not available in `Worker` threads.
+ * @since v2.0.0
+ * @param id A group name or ID
+ */
+ setegid?: (id: number | string) => void;
+ /**
+ * The `process.getgroups()` method returns an array with the supplementary group
+ * IDs. POSIX leaves it unspecified if the effective group ID is included but
+ * Node.js ensures it always is.
+ *
+ * ```js
+ * import process from 'process';
+ *
+ * if (process.getgroups) {
+ * console.log(process.getgroups()); // [ 16, 21, 297 ]
+ * }
+ * ```
+ *
+ * This function is only available on POSIX platforms (i.e. not Windows or
+ * Android).
+ * @since v0.9.4
+ */
+ getgroups?: () => number[];
+ /**
+ * The `process.setgroups()` method sets the supplementary group IDs for the
+ * Node.js process. This is a privileged operation that requires the Node.js
+ * process to have `root` or the `CAP_SETGID` capability.
+ *
+ * The `groups` array can contain numeric group IDs, group names, or both.
+ *
+ * ```js
+ * import process from 'process';
+ *
+ * if (process.getgroups &#x26;&#x26; process.setgroups) {
+ * try {
+ * process.setgroups([501]);
+ * console.log(process.getgroups()); // new groups
+ * } catch (err) {
+ * console.log(`Failed to set groups: ${err}`);
+ * }
+ * }
+ * ```
+ *
+ * This function is only available on POSIX platforms (i.e. not Windows or
+ * Android).
+ * This feature is not available in `Worker` threads.
+ * @since v0.9.4
+ */
+ setgroups?: (groups: ReadonlyArray<string | number>) => void;
+ /**
+ * The `process.setUncaughtExceptionCaptureCallback()` function sets a function
+ * that will be invoked when an uncaught exception occurs, which will receive the
+ * exception value itself as its first argument.
+ *
+ * If such a function is set, the `'uncaughtException'` event will
+ * not be emitted. If `--abort-on-uncaught-exception` was passed from the
+ * command line or set through `v8.setFlagsFromString()`, the process will
+ * not abort. Actions configured to take place on exceptions such as report
+ * generations will be affected too
+ *
+ * To unset the capture function,`process.setUncaughtExceptionCaptureCallback(null)` may be used. Calling this
+ * method with a non-`null` argument while another capture function is set will
+ * throw an error.
+ *
+ * Using this function is mutually exclusive with using the deprecated `domain` built-in module.
+ * @since v9.3.0
+ */
+ setUncaughtExceptionCaptureCallback(cb: ((err: Error) => void) | null): void;
+ /**
+ * Indicates whether a callback has been set using {@link setUncaughtExceptionCaptureCallback}.
+ * @since v9.3.0
+ */
+ hasUncaughtExceptionCaptureCallback(): boolean;
+ /**
+ * The `process.version` property contains the Node.js version string.
+ *
+ * ```js
+ * import { version } from 'process';
+ *
+ * console.log(`Version: ${version}`);
+ * // Version: v14.8.0
+ * ```
+ *
+ * To get the version string without the prepended _v_, use`process.versions.node`.
+ * @since v0.1.3
+ */
+ readonly version: string;
+ /**
+ * The `process.versions` property returns an object listing the version strings of
+ * Node.js and its dependencies. `process.versions.modules` indicates the current
+ * ABI version, which is increased whenever a C++ API changes. Node.js will refuse
+ * to load modules that were compiled against a different module ABI version.
+ *
+ * ```js
+ * import { versions } from 'process';
+ *
+ * console.log(versions);
+ * ```
+ *
+ * Will generate an object similar to:
+ *
+ * ```console
+ * { node: '11.13.0',
+ * v8: '7.0.276.38-node.18',
+ * uv: '1.27.0',
+ * zlib: '1.2.11',
+ * brotli: '1.0.7',
+ * ares: '1.15.0',
+ * modules: '67',
+ * nghttp2: '1.34.0',
+ * napi: '4',
+ * llhttp: '1.1.1',
+ * openssl: '1.1.1b',
+ * cldr: '34.0',
+ * icu: '63.1',
+ * tz: '2018e',
+ * unicode: '11.0' }
+ * ```
+ * @since v0.2.0
+ */
+ readonly versions: ProcessVersions;
+ /**
+ * The `process.config` property returns an `Object` containing the JavaScript
+ * representation of the configure options used to compile the current Node.js
+ * executable. This is the same as the `config.gypi` file that was produced when
+ * running the `./configure` script.
+ *
+ * An example of the possible output looks like:
+ *
+ * ```js
+ * {
+ * target_defaults:
+ * { cflags: [],
+ * default_configuration: 'Release',
+ * defines: [],
+ * include_dirs: [],
+ * libraries: [] },
+ * variables:
+ * {
+ * host_arch: 'x64',
+ * napi_build_version: 5,
+ * node_install_npm: 'true',
+ * node_prefix: '',
+ * node_shared_cares: 'false',
+ * node_shared_http_parser: 'false',
+ * node_shared_libuv: 'false',
+ * node_shared_zlib: 'false',
+ * node_use_dtrace: 'false',
+ * node_use_openssl: 'true',
+ * node_shared_openssl: 'false',
+ * strict_aliasing: 'true',
+ * target_arch: 'x64',
+ * v8_use_snapshot: 1
+ * }
+ * }
+ * ```
+ *
+ * The `process.config` property is **not** read-only and there are existing
+ * modules in the ecosystem that are known to extend, modify, or entirely replace
+ * the value of `process.config`.
+ *
+ * Modifying the `process.config` property, or any child-property of the`process.config` object has been deprecated. The `process.config` will be made
+ * read-only in a future release.
+ * @since v0.7.7
+ */
+ readonly config: ProcessConfig;
+ /**
+ * The `process.kill()` method sends the `signal` to the process identified by`pid`.
+ *
+ * Signal names are strings such as `'SIGINT'` or `'SIGHUP'`. See `Signal Events` and [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) for more information.
+ *
+ * This method will throw an error if the target `pid` does not exist. As a special
+ * case, a signal of `0` can be used to test for the existence of a process.
+ * Windows platforms will throw an error if the `pid` is used to kill a process
+ * group.
+ *
+ * Even though the name of this function is `process.kill()`, it is really just a
+ * signal sender, like the `kill` system call. The signal sent may do something
+ * other than kill the target process.
+ *
+ * ```js
+ * import process, { kill } from 'process';
+ *
+ * process.on('SIGHUP', () => {
+ * console.log('Got SIGHUP signal.');
+ * });
+ *
+ * setTimeout(() => {
+ * console.log('Exiting.');
+ * process.exit(0);
+ * }, 100);
+ *
+ * kill(process.pid, 'SIGHUP');
+ * ```
+ *
+ * When `SIGUSR1` is received by a Node.js process, Node.js will start the
+ * debugger. See `Signal Events`.
+ * @since v0.0.6
+ * @param pid A process ID
+ * @param [signal='SIGTERM'] The signal to send, either as a string or number.
+ */
+ kill(pid: number, signal?: string | number): true;
+ /**
+ * The `process.pid` property returns the PID of the process.
+ *
+ * ```js
+ * import { pid } from 'process';
+ *
+ * console.log(`This process is pid ${pid}`);
+ * ```
+ * @since v0.1.15
+ */
+ readonly pid: number;
+ /**
+ * The `process.ppid` property returns the PID of the parent of the
+ * current process.
+ *
+ * ```js
+ * import { ppid } from 'process';
+ *
+ * console.log(`The parent process is pid ${ppid}`);
+ * ```
+ * @since v9.2.0, v8.10.0, v6.13.0
+ */
+ readonly ppid: number;
+ /**
+ * The `process.title` property returns the current process title (i.e. returns
+ * the current value of `ps`). Assigning a new value to `process.title` modifies
+ * the current value of `ps`.
+ *
+ * When a new value is assigned, different platforms will impose different maximum
+ * length restrictions on the title. Usually such restrictions are quite limited.
+ * For instance, on Linux and macOS, `process.title` is limited to the size of the
+ * binary name plus the length of the command-line arguments because setting the`process.title` overwrites the `argv` memory of the process. Node.js v0.8
+ * allowed for longer process title strings by also overwriting the `environ`memory but that was potentially insecure and confusing in some (rather obscure)
+ * cases.
+ *
+ * Assigning a value to `process.title` might not result in an accurate label
+ * within process manager applications such as macOS Activity Monitor or Windows
+ * Services Manager.
+ * @since v0.1.104
+ */
+ title: string;
+ /**
+ * The operating system CPU architecture for which the Node.js binary was compiled.
+ * Possible values are: `'arm'`, `'arm64'`, `'ia32'`, `'mips'`,`'mipsel'`, `'ppc'`,`'ppc64'`, `'s390'`, `'s390x'`, and `'x64'`.
+ *
+ * ```js
+ * import { arch } from 'process';
+ *
+ * console.log(`This processor architecture is ${arch}`);
+ * ```
+ * @since v0.5.0
+ */
+ readonly arch: Architecture;
+ /**
+ * The `process.platform` property returns a string identifying the operating
+ * system platform for which the Node.js binary was compiled.
+ *
+ * Currently possible values are:
+ *
+ * * `'aix'`
+ * * `'darwin'`
+ * * `'freebsd'`
+ * * `'linux'`
+ * * `'openbsd'`
+ * * `'sunos'`
+ * * `'win32'`
+ *
+ * ```js
+ * import { platform } from 'process';
+ *
+ * console.log(`This platform is ${platform}`);
+ * ```
+ *
+ * The value `'android'` may also be returned if the Node.js is built on the
+ * Android operating system. However, Android support in Node.js [is experimental](https://github.com/nodejs/node/blob/HEAD/BUILDING.md#androidandroid-based-devices-eg-firefox-os).
+ * @since v0.1.16
+ */
+ readonly platform: Platform;
+ /**
+ * The `process.mainModule` property provides an alternative way of retrieving `require.main`. The difference is that if the main module changes at
+ * runtime, `require.main` may still refer to the original main module in
+ * modules that were required before the change occurred. Generally, it's
+ * safe to assume that the two refer to the same module.
+ *
+ * As with `require.main`, `process.mainModule` will be `undefined` if there
+ * is no entry script.
+ * @since v0.1.17
+ * @deprecated Since v14.0.0 - Use `main` instead.
+ */
+ mainModule?: Module | undefined;
+ memoryUsage: MemoryUsageFn;
+ /**
+ * Gets the amount of memory available to the process (in bytes) based on
+ * limits imposed by the OS. If there is no such constraint, or the constraint
+ * is unknown, `undefined` is returned.
+ */
+ constrainedMemory(): number | undefined;
+ /**
+ * The `process.cpuUsage()` method returns the user and system CPU time usage of
+ * the current process, in an object with properties `user` and `system`, whose
+ * values are microsecond values (millionth of a second). These values measure time
+ * spent in user and system code respectively, and may end up being greater than
+ * actual elapsed time if multiple CPU cores are performing work for this process.
+ *
+ * The result of a previous call to `process.cpuUsage()` can be passed as the
+ * argument to the function, to get a diff reading.
+ *
+ * ```js
+ * import { cpuUsage } from 'process';
+ *
+ * const startUsage = cpuUsage();
+ * // { user: 38579, system: 6986 }
+ *
+ * // spin the CPU for 500 milliseconds
+ * const now = Date.now();
+ * while (Date.now() - now < 500);
+ *
+ * console.log(cpuUsage(startUsage));
+ * // { user: 514883, system: 11226 }
+ * ```
+ * @since v6.1.0
+ * @param previousValue A previous return value from calling `process.cpuUsage()`
+ */
+ cpuUsage(previousValue?: CpuUsage): CpuUsage;
+ /**
+ * `process.nextTick()` adds `callback` to the "next tick queue". This queue is
+ * fully drained after the current operation on the JavaScript stack runs to
+ * completion and before the event loop is allowed to continue. It's possible to
+ * create an infinite loop if one were to recursively call `process.nextTick()`.
+ * See the [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#process-nexttick) guide for more background.
+ *
+ * ```js
+ * import { nextTick } from 'process';
+ *
+ * console.log('start');
+ * nextTick(() => {
+ * console.log('nextTick callback');
+ * });
+ * console.log('scheduled');
+ * // Output:
+ * // start
+ * // scheduled
+ * // nextTick callback
+ * ```
+ *
+ * This is important when developing APIs in order to give users the opportunity
+ * to assign event handlers _after_ an object has been constructed but before any
+ * I/O has occurred:
+ *
+ * ```js
+ * import { nextTick } from 'process';
+ *
+ * function MyThing(options) {
+ * this.setupOptions(options);
+ *
+ * nextTick(() => {
+ * this.startDoingStuff();
+ * });
+ * }
+ *
+ * const thing = new MyThing();
+ * thing.getReadyForStuff();
+ *
+ * // thing.startDoingStuff() gets called now, not before.
+ * ```
+ *
+ * It is very important for APIs to be either 100% synchronous or 100%
+ * asynchronous. Consider this example:
+ *
+ * ```js
+ * // WARNING! DO NOT USE! BAD UNSAFE HAZARD!
+ * function maybeSync(arg, cb) {
+ * if (arg) {
+ * cb();
+ * return;
+ * }
+ *
+ * fs.stat('file', cb);
+ * }
+ * ```
+ *
+ * This API is hazardous because in the following case:
+ *
+ * ```js
+ * const maybeTrue = Math.random() > 0.5;
+ *
+ * maybeSync(maybeTrue, () => {
+ * foo();
+ * });
+ *
+ * bar();
+ * ```
+ *
+ * It is not clear whether `foo()` or `bar()` will be called first.
+ *
+ * The following approach is much better:
+ *
+ * ```js
+ * import { nextTick } from 'process';
+ *
+ * function definitelyAsync(arg, cb) {
+ * if (arg) {
+ * nextTick(cb);
+ * return;
+ * }
+ *
+ * fs.stat('file', cb);
+ * }
+ * ```
+ * @since v0.1.26
+ * @param args Additional arguments to pass when invoking the `callback`
+ */
+ nextTick(callback: Function, ...args: any[]): void;
+ /**
+ * The `process.release` property returns an `Object` containing metadata related
+ * to the current release, including URLs for the source tarball and headers-only
+ * tarball.
+ *
+ * `process.release` contains the following properties:
+ *
+ * ```js
+ * {
+ * name: 'node',
+ * lts: 'Erbium',
+ * sourceUrl: 'https://nodejs.org/download/release/v12.18.1/node-v12.18.1.tar.gz',
+ * headersUrl: 'https://nodejs.org/download/release/v12.18.1/node-v12.18.1-headers.tar.gz',
+ * libUrl: 'https://nodejs.org/download/release/v12.18.1/win-x64/node.lib'
+ * }
+ * ```
+ *
+ * In custom builds from non-release versions of the source tree, only the`name` property may be present. The additional properties should not be
+ * relied upon to exist.
+ * @since v3.0.0
+ */
+ readonly release: ProcessRelease;
+ features: {
+ inspector: boolean;
+ debug: boolean;
+ uv: boolean;
+ ipv6: boolean;
+ tls_alpn: boolean;
+ tls_sni: boolean;
+ tls_ocsp: boolean;
+ tls: boolean;
+ };
+ /**
+ * `process.umask()` returns the Node.js process's file mode creation mask. Child
+ * processes inherit the mask from the parent process.
+ * @since v0.1.19
+ * @deprecated Calling `process.umask()` with no argument causes the process-wide umask to be written twice. This introduces a race condition between threads, and is a potential *
+ * security vulnerability. There is no safe, cross-platform alternative API.
+ */
+ umask(): number;
+ /**
+ * Can only be set if not in worker thread.
+ */
+ umask(mask: string | number): number;
+ /**
+ * The `process.uptime()` method returns the number of seconds the current Node.js
+ * process has been running.
+ *
+ * The return value includes fractions of a second. Use `Math.floor()` to get whole
+ * seconds.
+ * @since v0.5.0
+ */
+ uptime(): number;
+ hrtime: HRTime;
+ /**
+ * If Node.js is spawned with an IPC channel, the `process.send()` method can be
+ * used to send messages to the parent process. Messages will be received as a `'message'` event on the parent's `ChildProcess` object.
+ *
+ * If Node.js was not spawned with an IPC channel, `process.send` will be `undefined`.
+ *
+ * The message goes through serialization and parsing. The resulting message might
+ * not be the same as what is originally sent.
+ * @since v0.5.9
+ * @param options used to parameterize the sending of certain types of handles.`options` supports the following properties:
+ */
+ send?(
+ message: any,
+ sendHandle?: any,
+ options?: {
+ swallowErrors?: boolean | undefined;
+ },
+ callback?: (error: Error | null) => void,
+ ): boolean;
+ /**
+ * If the Node.js process is spawned with an IPC channel (see the `Child Process` and `Cluster` documentation), the `process.disconnect()` method will close the
+ * IPC channel to the parent process, allowing the child process to exit gracefully
+ * once there are no other connections keeping it alive.
+ *
+ * The effect of calling `process.disconnect()` is the same as calling `ChildProcess.disconnect()` from the parent process.
+ *
+ * If the Node.js process was not spawned with an IPC channel,`process.disconnect()` will be `undefined`.
+ * @since v0.7.2
+ */
+ disconnect(): void;
+ /**
+ * If the Node.js process is spawned with an IPC channel (see the `Child Process` and `Cluster` documentation), the `process.connected` property will return`true` so long as the IPC
+ * channel is connected and will return `false` after`process.disconnect()` is called.
+ *
+ * Once `process.connected` is `false`, it is no longer possible to send messages
+ * over the IPC channel using `process.send()`.
+ * @since v0.7.2
+ */
+ connected: boolean;
+ /**
+ * The `process.allowedNodeEnvironmentFlags` property is a special,
+ * read-only `Set` of flags allowable within the `NODE_OPTIONS` environment variable.
+ *
+ * `process.allowedNodeEnvironmentFlags` extends `Set`, but overrides`Set.prototype.has` to recognize several different possible flag
+ * representations. `process.allowedNodeEnvironmentFlags.has()` will
+ * return `true` in the following cases:
+ *
+ * * Flags may omit leading single (`-`) or double (`--`) dashes; e.g.,`inspect-brk` for `--inspect-brk`, or `r` for `-r`.
+ * * Flags passed through to V8 (as listed in `--v8-options`) may replace
+ * one or more _non-leading_ dashes for an underscore, or vice-versa;
+ * e.g., `--perf_basic_prof`, `--perf-basic-prof`, `--perf_basic-prof`,
+ * etc.
+ * * Flags may contain one or more equals (`=`) characters; all
+ * characters after and including the first equals will be ignored;
+ * e.g., `--stack-trace-limit=100`.
+ * * Flags _must_ be allowable within `NODE_OPTIONS`.
+ *
+ * When iterating over `process.allowedNodeEnvironmentFlags`, flags will
+ * appear only _once_; each will begin with one or more dashes. Flags
+ * passed through to V8 will contain underscores instead of non-leading
+ * dashes:
+ *
+ * ```js
+ * import { allowedNodeEnvironmentFlags } from 'process';
+ *
+ * allowedNodeEnvironmentFlags.forEach((flag) => {
+ * // -r
+ * // --inspect-brk
+ * // --abort_on_uncaught_exception
+ * // ...
+ * });
+ * ```
+ *
+ * The methods `add()`, `clear()`, and `delete()` of`process.allowedNodeEnvironmentFlags` do nothing, and will fail
+ * silently.
+ *
+ * If Node.js was compiled _without_ `NODE_OPTIONS` support (shown in {@link config}), `process.allowedNodeEnvironmentFlags` will
+ * contain what _would have_ been allowable.
+ * @since v10.10.0
+ */
+ allowedNodeEnvironmentFlags: ReadonlySet<string>;
+ /**
+ * `process.report` is an object whose methods are used to generate diagnostic
+ * reports for the current process. Additional documentation is available in the `report documentation`.
+ * @since v11.8.0
+ */
+ report?: ProcessReport | undefined;
+ /**
+ * ```js
+ * import { resourceUsage } from 'process';
+ *
+ * console.log(resourceUsage());
+ * /*
+ * Will output:
+ * {
+ * userCPUTime: 82872,
+ * systemCPUTime: 4143,
+ * maxRSS: 33164,
+ * sharedMemorySize: 0,
+ * unsharedDataSize: 0,
+ * unsharedStackSize: 0,
+ * minorPageFault: 2469,
+ * majorPageFault: 0,
+ * swappedOut: 0,
+ * fsRead: 0,
+ * fsWrite: 8,
+ * ipcSent: 0,
+ * ipcReceived: 0,
+ * signalsCount: 0,
+ * voluntaryContextSwitches: 79,
+ * involuntaryContextSwitches: 1
+ * }
+ *
+ * ```
+ * @since v12.6.0
+ * @return the resource usage for the current process. All of these values come from the `uv_getrusage` call which returns a [`uv_rusage_t` struct][uv_rusage_t].
+ */
+ resourceUsage(): ResourceUsage;
+ /**
+ * The `process.traceDeprecation` property indicates whether the`--trace-deprecation` flag is set on the current Node.js process. See the
+ * documentation for the `'warning' event` and the `emitWarning() method` for more information about this
+ * flag's behavior.
+ * @since v0.8.0
+ */
+ traceDeprecation: boolean;
+ /* EventEmitter */
+ addListener(event: "beforeExit", listener: BeforeExitListener): this;
+ addListener(event: "disconnect", listener: DisconnectListener): this;
+ addListener(event: "exit", listener: ExitListener): this;
+ addListener(event: "rejectionHandled", listener: RejectionHandledListener): this;
+ addListener(event: "uncaughtException", listener: UncaughtExceptionListener): this;
+ addListener(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this;
+ addListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this;
+ addListener(event: "warning", listener: WarningListener): this;
+ addListener(event: "message", listener: MessageListener): this;
+ addListener(event: Signals, listener: SignalsListener): this;
+ addListener(event: "multipleResolves", listener: MultipleResolveListener): this;
+ addListener(event: "worker", listener: WorkerListener): this;
+ emit(event: "beforeExit", code: number): boolean;
+ emit(event: "disconnect"): boolean;
+ emit(event: "exit", code: number): boolean;
+ emit(event: "rejectionHandled", promise: Promise<unknown>): boolean;
+ emit(event: "uncaughtException", error: Error): boolean;
+ emit(event: "uncaughtExceptionMonitor", error: Error): boolean;
+ emit(event: "unhandledRejection", reason: unknown, promise: Promise<unknown>): boolean;
+ emit(event: "warning", warning: Error): boolean;
+ emit(event: "message", message: unknown, sendHandle: unknown): this;
+ emit(event: Signals, signal?: Signals): boolean;
+ emit(
+ event: "multipleResolves",
+ type: MultipleResolveType,
+ promise: Promise<unknown>,
+ value: unknown,
+ ): this;
+ emit(event: "worker", listener: WorkerListener): this;
+ on(event: "beforeExit", listener: BeforeExitListener): this;
+ on(event: "disconnect", listener: DisconnectListener): this;
+ on(event: "exit", listener: ExitListener): this;
+ on(event: "rejectionHandled", listener: RejectionHandledListener): this;
+ on(event: "uncaughtException", listener: UncaughtExceptionListener): this;
+ on(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this;
+ on(event: "unhandledRejection", listener: UnhandledRejectionListener): this;
+ on(event: "warning", listener: WarningListener): this;
+ on(event: "message", listener: MessageListener): this;
+ on(event: Signals, listener: SignalsListener): this;
+ on(event: "multipleResolves", listener: MultipleResolveListener): this;
+ on(event: "worker", listener: WorkerListener): this;
+ on(event: string | symbol, listener: (...args: any[]) => void): this;
+ once(event: "beforeExit", listener: BeforeExitListener): this;
+ once(event: "disconnect", listener: DisconnectListener): this;
+ once(event: "exit", listener: ExitListener): this;
+ once(event: "rejectionHandled", listener: RejectionHandledListener): this;
+ once(event: "uncaughtException", listener: UncaughtExceptionListener): this;
+ once(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this;
+ once(event: "unhandledRejection", listener: UnhandledRejectionListener): this;
+ once(event: "warning", listener: WarningListener): this;
+ once(event: "message", listener: MessageListener): this;
+ once(event: Signals, listener: SignalsListener): this;
+ once(event: "multipleResolves", listener: MultipleResolveListener): this;
+ once(event: "worker", listener: WorkerListener): this;
+ once(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependListener(event: "beforeExit", listener: BeforeExitListener): this;
+ prependListener(event: "disconnect", listener: DisconnectListener): this;
+ prependListener(event: "exit", listener: ExitListener): this;
+ prependListener(event: "rejectionHandled", listener: RejectionHandledListener): this;
+ prependListener(event: "uncaughtException", listener: UncaughtExceptionListener): this;
+ prependListener(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this;
+ prependListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this;
+ prependListener(event: "warning", listener: WarningListener): this;
+ prependListener(event: "message", listener: MessageListener): this;
+ prependListener(event: Signals, listener: SignalsListener): this;
+ prependListener(event: "multipleResolves", listener: MultipleResolveListener): this;
+ prependListener(event: "worker", listener: WorkerListener): this;
+ prependOnceListener(event: "beforeExit", listener: BeforeExitListener): this;
+ prependOnceListener(event: "disconnect", listener: DisconnectListener): this;
+ prependOnceListener(event: "exit", listener: ExitListener): this;
+ prependOnceListener(event: "rejectionHandled", listener: RejectionHandledListener): this;
+ prependOnceListener(event: "uncaughtException", listener: UncaughtExceptionListener): this;
+ prependOnceListener(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this;
+ prependOnceListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this;
+ prependOnceListener(event: "warning", listener: WarningListener): this;
+ prependOnceListener(event: "message", listener: MessageListener): this;
+ prependOnceListener(event: Signals, listener: SignalsListener): this;
+ prependOnceListener(event: "multipleResolves", listener: MultipleResolveListener): this;
+ prependOnceListener(event: "worker", listener: WorkerListener): this;
+ listeners(event: "beforeExit"): BeforeExitListener[];
+ listeners(event: "disconnect"): DisconnectListener[];
+ listeners(event: "exit"): ExitListener[];
+ listeners(event: "rejectionHandled"): RejectionHandledListener[];
+ listeners(event: "uncaughtException"): UncaughtExceptionListener[];
+ listeners(event: "uncaughtExceptionMonitor"): UncaughtExceptionListener[];
+ listeners(event: "unhandledRejection"): UnhandledRejectionListener[];
+ listeners(event: "warning"): WarningListener[];
+ listeners(event: "message"): MessageListener[];
+ listeners(event: Signals): SignalsListener[];
+ listeners(event: "multipleResolves"): MultipleResolveListener[];
+ listeners(event: "worker"): WorkerListener[];
+ }
+ }
+ }
+ export = process;
+}
+declare module "node:process" {
+ import process = require("process");
+ export = process;
+}
diff --git a/client/node_modules/@types/node/ts4.8/punycode.d.ts b/client/node_modules/@types/node/ts4.8/punycode.d.ts
new file mode 100644
index 0000000..cfe559b
--- /dev/null
+++ b/client/node_modules/@types/node/ts4.8/punycode.d.ts
@@ -0,0 +1,117 @@
+/**
+ * **The version of the punycode module bundled in Node.js is being deprecated.**In a future major version of Node.js this module will be removed. Users
+ * currently depending on the `punycode` module should switch to using the
+ * userland-provided [Punycode.js](https://github.com/bestiejs/punycode.js) module instead. For punycode-based URL
+ * encoding, see `url.domainToASCII` or, more generally, the `WHATWG URL API`.
+ *
+ * The `punycode` module is a bundled version of the [Punycode.js](https://github.com/bestiejs/punycode.js) module. It
+ * can be accessed using:
+ *
+ * ```js
+ * const punycode = require('punycode');
+ * ```
+ *
+ * [Punycode](https://tools.ietf.org/html/rfc3492) is a character encoding scheme defined by RFC 3492 that is
+ * primarily intended for use in Internationalized Domain Names. Because host
+ * names in URLs are limited to ASCII characters only, Domain Names that contain
+ * non-ASCII characters must be converted into ASCII using the Punycode scheme.
+ * For instance, the Japanese character that translates into the English word,`'example'` is `'例'`. The Internationalized Domain Name, `'例.com'` (equivalent
+ * to `'example.com'`) is represented by Punycode as the ASCII string`'xn--fsq.com'`.
+ *
+ * The `punycode` module provides a simple implementation of the Punycode standard.
+ *
+ * The `punycode` module is a third-party dependency used by Node.js and
+ * made available to developers as a convenience. Fixes or other modifications to
+ * the module must be directed to the [Punycode.js](https://github.com/bestiejs/punycode.js) project.
+ * @deprecated Since v7.0.0 - Deprecated
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/punycode.js)
+ */
+declare module "punycode" {
+ /**
+ * The `punycode.decode()` method converts a [Punycode](https://tools.ietf.org/html/rfc3492) string of ASCII-only
+ * characters to the equivalent string of Unicode codepoints.
+ *
+ * ```js
+ * punycode.decode('maana-pta'); // 'mañana'
+ * punycode.decode('--dqo34k'); // '☃-⌘'
+ * ```
+ * @since v0.5.1
+ */
+ function decode(string: string): string;
+ /**
+ * The `punycode.encode()` method converts a string of Unicode codepoints to a [Punycode](https://tools.ietf.org/html/rfc3492) string of ASCII-only characters.
+ *
+ * ```js
+ * punycode.encode('mañana'); // 'maana-pta'
+ * punycode.encode('☃-⌘'); // '--dqo34k'
+ * ```
+ * @since v0.5.1
+ */
+ function encode(string: string): string;
+ /**
+ * The `punycode.toUnicode()` method converts a string representing a domain name
+ * containing [Punycode](https://tools.ietf.org/html/rfc3492) encoded characters into Unicode. Only the [Punycode](https://tools.ietf.org/html/rfc3492) encoded parts of the domain name are be
+ * converted.
+ *
+ * ```js
+ * // decode domain names
+ * punycode.toUnicode('xn--maana-pta.com'); // 'mañana.com'
+ * punycode.toUnicode('xn----dqo34k.com'); // '☃-⌘.com'
+ * punycode.toUnicode('example.com'); // 'example.com'
+ * ```
+ * @since v0.6.1
+ */
+ function toUnicode(domain: string): string;
+ /**
+ * The `punycode.toASCII()` method converts a Unicode string representing an
+ * Internationalized Domain Name to [Punycode](https://tools.ietf.org/html/rfc3492). Only the non-ASCII parts of the
+ * domain name will be converted. Calling `punycode.toASCII()` on a string that
+ * already only contains ASCII characters will have no effect.
+ *
+ * ```js
+ * // encode domain names
+ * punycode.toASCII('mañana.com'); // 'xn--maana-pta.com'
+ * punycode.toASCII('☃-⌘.com'); // 'xn----dqo34k.com'
+ * punycode.toASCII('example.com'); // 'example.com'
+ * ```
+ * @since v0.6.1
+ */
+ function toASCII(domain: string): string;
+ /**
+ * @deprecated since v7.0.0
+ * The version of the punycode module bundled in Node.js is being deprecated.
+ * In a future major version of Node.js this module will be removed.
+ * Users currently depending on the punycode module should switch to using
+ * the userland-provided Punycode.js module instead.
+ */
+ const ucs2: ucs2;
+ interface ucs2 {
+ /**
+ * @deprecated since v7.0.0
+ * The version of the punycode module bundled in Node.js is being deprecated.
+ * In a future major version of Node.js this module will be removed.
+ * Users currently depending on the punycode module should switch to using
+ * the userland-provided Punycode.js module instead.
+ */
+ decode(string: string): number[];
+ /**
+ * @deprecated since v7.0.0
+ * The version of the punycode module bundled in Node.js is being deprecated.
+ * In a future major version of Node.js this module will be removed.
+ * Users currently depending on the punycode module should switch to using
+ * the userland-provided Punycode.js module instead.
+ */
+ encode(codePoints: readonly number[]): string;
+ }
+ /**
+ * @deprecated since v7.0.0
+ * The version of the punycode module bundled in Node.js is being deprecated.
+ * In a future major version of Node.js this module will be removed.
+ * Users currently depending on the punycode module should switch to using
+ * the userland-provided Punycode.js module instead.
+ */
+ const version: string;
+}
+declare module "node:punycode" {
+ export * from "punycode";
+}
diff --git a/client/node_modules/@types/node/ts4.8/querystring.d.ts b/client/node_modules/@types/node/ts4.8/querystring.d.ts
new file mode 100644
index 0000000..1837171
--- /dev/null
+++ b/client/node_modules/@types/node/ts4.8/querystring.d.ts
@@ -0,0 +1,141 @@
+/**
+ * The `querystring` module provides utilities for parsing and formatting URL
+ * query strings. It can be accessed using:
+ *
+ * ```js
+ * const querystring = require('querystring');
+ * ```
+ *
+ * `querystring` is more performant than `URLSearchParams` but is not a
+ * standardized API. Use `URLSearchParams` when performance is not critical
+ * or when compatibility with browser code is desirable.
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/querystring.js)
+ */
+declare module "querystring" {
+ interface StringifyOptions {
+ encodeURIComponent?: ((str: string) => string) | undefined;
+ }
+ interface ParseOptions {
+ maxKeys?: number | undefined;
+ decodeURIComponent?: ((str: string) => string) | undefined;
+ }
+ interface ParsedUrlQuery extends NodeJS.Dict<string | string[]> {}
+ interface ParsedUrlQueryInput extends
+ NodeJS.Dict<
+ | string
+ | number
+ | boolean
+ | readonly string[]
+ | readonly number[]
+ | readonly boolean[]
+ | null
+ >
+ {}
+ /**
+ * The `querystring.stringify()` method produces a URL query string from a
+ * given `obj` by iterating through the object's "own properties".
+ *
+ * It serializes the following types of values passed in `obj`:[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) |
+ * [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) |
+ * [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) |
+ * [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) |
+ * [string\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) |
+ * [number\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) |
+ * [bigint\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) |
+ * [boolean\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) The numeric values must be finite. Any other input values will be coerced to
+ * empty strings.
+ *
+ * ```js
+ * querystring.stringify({ foo: 'bar', baz: ['qux', 'quux'], corge: '' });
+ * // Returns 'foo=bar&#x26;baz=qux&#x26;baz=quux&#x26;corge='
+ *
+ * querystring.stringify({ foo: 'bar', baz: 'qux' }, ';', ':');
+ * // Returns 'foo:bar;baz:qux'
+ * ```
+ *
+ * By default, characters requiring percent-encoding within the query string will
+ * be encoded as UTF-8\. If an alternative encoding is required, then an alternative`encodeURIComponent` option will need to be specified:
+ *
+ * ```js
+ * // Assuming gbkEncodeURIComponent function already exists,
+ *
+ * querystring.stringify({ w: '中文', foo: 'bar' }, null, null,
+ * { encodeURIComponent: gbkEncodeURIComponent });
+ * ```
+ * @since v0.1.25
+ * @param obj The object to serialize into a URL query string
+ * @param [sep='&'] The substring used to delimit key and value pairs in the query string.
+ * @param [eq='='] . The substring used to delimit keys and values in the query string.
+ */
+ function stringify(obj?: ParsedUrlQueryInput, sep?: string, eq?: string, options?: StringifyOptions): string;
+ /**
+ * The `querystring.parse()` method parses a URL query string (`str`) into a
+ * collection of key and value pairs.
+ *
+ * For example, the query string `'foo=bar&#x26;abc=xyz&#x26;abc=123'` is parsed into:
+ *
+ * ```js
+ * {
+ * foo: 'bar',
+ * abc: ['xyz', '123']
+ * }
+ * ```
+ *
+ * The object returned by the `querystring.parse()` method _does not_prototypically inherit from the JavaScript `Object`. This means that typical`Object` methods such as `obj.toString()`,
+ * `obj.hasOwnProperty()`, and others
+ * are not defined and _will not work_.
+ *
+ * By default, percent-encoded characters within the query string will be assumed
+ * to use UTF-8 encoding. If an alternative character encoding is used, then an
+ * alternative `decodeURIComponent` option will need to be specified:
+ *
+ * ```js
+ * // Assuming gbkDecodeURIComponent function already exists...
+ *
+ * querystring.parse('w=%D6%D0%CE%C4&#x26;foo=bar', null, null,
+ * { decodeURIComponent: gbkDecodeURIComponent });
+ * ```
+ * @since v0.1.25
+ * @param str The URL query string to parse
+ * @param [sep='&'] The substring used to delimit key and value pairs in the query string.
+ * @param [eq='='] . The substring used to delimit keys and values in the query string.
+ */
+ function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): ParsedUrlQuery;
+ /**
+ * The querystring.encode() function is an alias for querystring.stringify().
+ */
+ const encode: typeof stringify;
+ /**
+ * The querystring.decode() function is an alias for querystring.parse().
+ */
+ const decode: typeof parse;
+ /**
+ * The `querystring.escape()` method performs URL percent-encoding on the given`str` in a manner that is optimized for the specific requirements of URL
+ * query strings.
+ *
+ * The `querystring.escape()` method is used by `querystring.stringify()` and is
+ * generally not expected to be used directly. It is exported primarily to allow
+ * application code to provide a replacement percent-encoding implementation if
+ * necessary by assigning `querystring.escape` to an alternative function.
+ * @since v0.1.25
+ */
+ function escape(str: string): string;
+ /**
+ * The `querystring.unescape()` method performs decoding of URL percent-encoded
+ * characters on the given `str`.
+ *
+ * The `querystring.unescape()` method is used by `querystring.parse()` and is
+ * generally not expected to be used directly. It is exported primarily to allow
+ * application code to provide a replacement decoding implementation if
+ * necessary by assigning `querystring.unescape` to an alternative function.
+ *
+ * By default, the `querystring.unescape()` method will attempt to use the
+ * JavaScript built-in `decodeURIComponent()` method to decode. If that fails,
+ * a safer equivalent that does not throw on malformed URLs will be used.
+ * @since v0.1.25
+ */
+ function unescape(str: string): string;
+}
+declare module "node:querystring" {
+ export * from "querystring";
+}
diff --git a/client/node_modules/@types/node/ts4.8/readline.d.ts b/client/node_modules/@types/node/ts4.8/readline.d.ts
new file mode 100644
index 0000000..60ccb8e
--- /dev/null
+++ b/client/node_modules/@types/node/ts4.8/readline.d.ts
@@ -0,0 +1,666 @@
+/**
+ * The `readline` module provides an interface for reading data from a `Readable` stream (such as `process.stdin`) one line at a time.
+ *
+ * To use the promise-based APIs:
+ *
+ * ```js
+ * import * as readline from 'node:readline/promises';
+ * ```
+ *
+ * To use the callback and sync APIs:
+ *
+ * ```js
+ * import * as readline from 'node:readline';
+ * ```
+ *
+ * The following simple example illustrates the basic use of the `readline` module.
+ *
+ * ```js
+ * import * as readline from 'node:readline/promises';
+ * import { stdin as input, stdout as output } from 'node:process';
+ *
+ * const rl = readline.createInterface({ input, output });
+ *
+ * const answer = await rl.question('What do you think of Node.js? ');
+ *
+ * console.log(`Thank you for your valuable feedback: ${answer}`);
+ *
+ * rl.close();
+ * ```
+ *
+ * Once this code is invoked, the Node.js application will not terminate until the`readline.Interface` is closed because the interface waits for data to be
+ * received on the `input` stream.
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/readline.js)
+ */
+declare module "readline" {
+ import { Abortable, EventEmitter } from "node:events";
+ import * as promises from "node:readline/promises";
+
+ export { promises };
+ export interface Key {
+ sequence?: string | undefined;
+ name?: string | undefined;
+ ctrl?: boolean | undefined;
+ meta?: boolean | undefined;
+ shift?: boolean | undefined;
+ }
+ /**
+ * Instances of the `readline.Interface` class are constructed using the`readline.createInterface()` method. Every instance is associated with a
+ * single `input` `Readable` stream and a single `output` `Writable` stream.
+ * The `output` stream is used to print prompts for user input that arrives on,
+ * and is read from, the `input` stream.
+ * @since v0.1.104
+ */
+ export class Interface extends EventEmitter {
+ readonly terminal: boolean;
+ /**
+ * The current input data being processed by node.
+ *
+ * This can be used when collecting input from a TTY stream to retrieve the
+ * current value that has been processed thus far, prior to the `line` event
+ * being emitted. Once the `line` event has been emitted, this property will
+ * be an empty string.
+ *
+ * Be aware that modifying the value during the instance runtime may have
+ * unintended consequences if `rl.cursor` is not also controlled.
+ *
+ * **If not using a TTY stream for input, use the `'line'` event.**
+ *
+ * One possible use case would be as follows:
+ *
+ * ```js
+ * const values = ['lorem ipsum', 'dolor sit amet'];
+ * const rl = readline.createInterface(process.stdin);
+ * const showResults = debounce(() => {
+ * console.log(
+ * '\n',
+ * values.filter((val) => val.startsWith(rl.line)).join(' ')
+ * );
+ * }, 300);
+ * process.stdin.on('keypress', (c, k) => {
+ * showResults();
+ * });
+ * ```
+ * @since v0.1.98
+ */
+ readonly line: string;
+ /**
+ * The cursor position relative to `rl.line`.
+ *
+ * This will track where the current cursor lands in the input string, when
+ * reading input from a TTY stream. The position of cursor determines the
+ * portion of the input string that will be modified as input is processed,
+ * as well as the column where the terminal caret will be rendered.
+ * @since v0.1.98
+ */
+ readonly cursor: number;
+ /**
+ * NOTE: According to the documentation:
+ *
+ * > Instances of the `readline.Interface` class are constructed using the
+ * > `readline.createInterface()` method.
+ *
+ * @see https://nodejs.org/dist/latest-v10.x/docs/api/readline.html#readline_class_interface
+ */
+ protected constructor(
+ input: NodeJS.ReadableStream,
+ output?: NodeJS.WritableStream,
+ completer?: Completer | AsyncCompleter,
+ terminal?: boolean,
+ );
+ /**
+ * NOTE: According to the documentation:
+ *
+ * > Instances of the `readline.Interface` class are constructed using the
+ * > `readline.createInterface()` method.
+ *
+ * @see https://nodejs.org/dist/latest-v10.x/docs/api/readline.html#readline_class_interface
+ */
+ protected constructor(options: ReadLineOptions);
+ /**
+ * The `rl.getPrompt()` method returns the current prompt used by `rl.prompt()`.
+ * @since v15.3.0
+ * @return the current prompt string
+ */
+ getPrompt(): string;
+ /**
+ * The `rl.setPrompt()` method sets the prompt that will be written to `output`whenever `rl.prompt()` is called.
+ * @since v0.1.98
+ */
+ setPrompt(prompt: string): void;
+ /**
+ * The `rl.prompt()` method writes the `readline.Interface` instances configured`prompt` to a new line in `output` in order to provide a user with a new
+ * location at which to provide input.
+ *
+ * When called, `rl.prompt()` will resume the `input` stream if it has been
+ * paused.
+ *
+ * If the `readline.Interface` was created with `output` set to `null` or`undefined` the prompt is not written.
+ * @since v0.1.98
+ * @param preserveCursor If `true`, prevents the cursor placement from being reset to `0`.
+ */
+ prompt(preserveCursor?: boolean): void;
+ /**
+ * The `rl.question()` method displays the `query` by writing it to the `output`,
+ * waits for user input to be provided on `input`, then invokes the `callback`function passing the provided input as the first argument.
+ *
+ * When called, `rl.question()` will resume the `input` stream if it has been
+ * paused.
+ *
+ * If the `readline.Interface` was created with `output` set to `null` or`undefined` the `query` is not written.
+ *
+ * The `callback` function passed to `rl.question()` does not follow the typical
+ * pattern of accepting an `Error` object or `null` as the first argument.
+ * The `callback` is called with the provided answer as the only argument.
+ *
+ * Example usage:
+ *
+ * ```js
+ * rl.question('What is your favorite food? ', (answer) => {
+ * console.log(`Oh, so your favorite food is ${answer}`);
+ * });
+ * ```
+ *
+ * Using an `AbortController` to cancel a question.
+ *
+ * ```js
+ * const ac = new AbortController();
+ * const signal = ac.signal;
+ *
+ * rl.question('What is your favorite food? ', { signal }, (answer) => {
+ * console.log(`Oh, so your favorite food is ${answer}`);
+ * });
+ *
+ * signal.addEventListener('abort', () => {
+ * console.log('The food question timed out');
+ * }, { once: true });
+ *
+ * setTimeout(() => ac.abort(), 10000);
+ * ```
+ *
+ * If this method is invoked as it's util.promisify()ed version, it returns a
+ * Promise that fulfills with the answer. If the question is canceled using
+ * an `AbortController` it will reject with an `AbortError`.
+ *
+ * ```js
+ * const util = require('util');
+ * const question = util.promisify(rl.question).bind(rl);
+ *
+ * async function questionExample() {
+ * try {
+ * const answer = await question('What is you favorite food? ');
+ * console.log(`Oh, so your favorite food is ${answer}`);
+ * } catch (err) {
+ * console.error('Question rejected', err);
+ * }
+ * }
+ * questionExample();
+ * ```
+ * @since v0.3.3
+ * @param query A statement or query to write to `output`, prepended to the prompt.
+ * @param callback A callback function that is invoked with the user's input in response to the `query`.
+ */
+ question(query: string, callback: (answer: string) => void): void;
+ question(query: string, options: Abortable, callback: (answer: string) => void): void;
+ /**
+ * The `rl.pause()` method pauses the `input` stream, allowing it to be resumed
+ * later if necessary.
+ *
+ * Calling `rl.pause()` does not immediately pause other events (including`'line'`) from being emitted by the `readline.Interface` instance.
+ * @since v0.3.4
+ */
+ pause(): this;
+ /**
+ * The `rl.resume()` method resumes the `input` stream if it has been paused.
+ * @since v0.3.4
+ */
+ resume(): this;
+ /**
+ * The `rl.close()` method closes the `readline.Interface` instance and
+ * relinquishes control over the `input` and `output` streams. When called,
+ * the `'close'` event will be emitted.
+ *
+ * Calling `rl.close()` does not immediately stop other events (including `'line'`)
+ * from being emitted by the `readline.Interface` instance.
+ * @since v0.1.98
+ */
+ close(): void;
+ /**
+ * The `rl.write()` method will write either `data` or a key sequence identified
+ * by `key` to the `output`. The `key` argument is supported only if `output` is
+ * a `TTY` text terminal. See `TTY keybindings` for a list of key
+ * combinations.
+ *
+ * If `key` is specified, `data` is ignored.
+ *
+ * When called, `rl.write()` will resume the `input` stream if it has been
+ * paused.
+ *
+ * If the `readline.Interface` was created with `output` set to `null` or`undefined` the `data` and `key` are not written.
+ *
+ * ```js
+ * rl.write('Delete this!');
+ * // Simulate Ctrl+U to delete the line written previously
+ * rl.write(null, { ctrl: true, name: 'u' });
+ * ```
+ *
+ * The `rl.write()` method will write the data to the `readline` `Interface`'s`input`_as if it were provided by the user_.
+ * @since v0.1.98
+ */
+ write(data: string | Buffer, key?: Key): void;
+ write(data: undefined | null | string | Buffer, key: Key): void;
+ /**
+ * Returns the real position of the cursor in relation to the input
+ * prompt + string. Long input (wrapping) strings, as well as multiple
+ * line prompts are included in the calculations.
+ * @since v13.5.0, v12.16.0
+ */
+ getCursorPos(): CursorPos;
+ /**
+ * events.EventEmitter
+ * 1. close
+ * 2. line
+ * 3. pause
+ * 4. resume
+ * 5. SIGCONT
+ * 6. SIGINT
+ * 7. SIGTSTP
+ * 8. history
+ */
+ addListener(event: string, listener: (...args: any[]) => void): this;
+ addListener(event: "close", listener: () => void): this;
+ addListener(event: "line", listener: (input: string) => void): this;
+ addListener(event: "pause", listener: () => void): this;
+ addListener(event: "resume", listener: () => void): this;
+ addListener(event: "SIGCONT", listener: () => void): this;
+ addListener(event: "SIGINT", listener: () => void): this;
+ addListener(event: "SIGTSTP", listener: () => void): this;
+ addListener(event: "history", listener: (history: string[]) => void): this;
+ emit(event: string | symbol, ...args: any[]): boolean;
+ emit(event: "close"): boolean;
+ emit(event: "line", input: string): boolean;
+ emit(event: "pause"): boolean;
+ emit(event: "resume"): boolean;
+ emit(event: "SIGCONT"): boolean;
+ emit(event: "SIGINT"): boolean;
+ emit(event: "SIGTSTP"): boolean;
+ emit(event: "history", history: string[]): boolean;
+ on(event: string, listener: (...args: any[]) => void): this;
+ on(event: "close", listener: () => void): this;
+ on(event: "line", listener: (input: string) => void): this;
+ on(event: "pause", listener: () => void): this;
+ on(event: "resume", listener: () => void): this;
+ on(event: "SIGCONT", listener: () => void): this;
+ on(event: "SIGINT", listener: () => void): this;
+ on(event: "SIGTSTP", listener: () => void): this;
+ on(event: "history", listener: (history: string[]) => void): this;
+ once(event: string, listener: (...args: any[]) => void): this;
+ once(event: "close", listener: () => void): this;
+ once(event: "line", listener: (input: string) => void): this;
+ once(event: "pause", listener: () => void): this;
+ once(event: "resume", listener: () => void): this;
+ once(event: "SIGCONT", listener: () => void): this;
+ once(event: "SIGINT", listener: () => void): this;
+ once(event: "SIGTSTP", listener: () => void): this;
+ once(event: "history", listener: (history: string[]) => void): this;
+ prependListener(event: string, listener: (...args: any[]) => void): this;
+ prependListener(event: "close", listener: () => void): this;
+ prependListener(event: "line", listener: (input: string) => void): this;
+ prependListener(event: "pause", listener: () => void): this;
+ prependListener(event: "resume", listener: () => void): this;
+ prependListener(event: "SIGCONT", listener: () => void): this;
+ prependListener(event: "SIGINT", listener: () => void): this;
+ prependListener(event: "SIGTSTP", listener: () => void): this;
+ prependListener(event: "history", listener: (history: string[]) => void): this;
+ prependOnceListener(event: string, listener: (...args: any[]) => void): this;
+ prependOnceListener(event: "close", listener: () => void): this;
+ prependOnceListener(event: "line", listener: (input: string) => void): this;
+ prependOnceListener(event: "pause", listener: () => void): this;
+ prependOnceListener(event: "resume", listener: () => void): this;
+ prependOnceListener(event: "SIGCONT", listener: () => void): this;
+ prependOnceListener(event: "SIGINT", listener: () => void): this;
+ prependOnceListener(event: "SIGTSTP", listener: () => void): this;
+ prependOnceListener(event: "history", listener: (history: string[]) => void): this;
+ [Symbol.asyncIterator](): AsyncIterableIterator<string>;
+ }
+ export type ReadLine = Interface; // type forwarded for backwards compatibility
+ export type Completer = (line: string) => CompleterResult;
+ export type AsyncCompleter = (
+ line: string,
+ callback: (err?: null | Error, result?: CompleterResult) => void,
+ ) => void;
+ export type CompleterResult = [string[], string];
+ export interface ReadLineOptions {
+ input: NodeJS.ReadableStream;
+ output?: NodeJS.WritableStream | undefined;
+ completer?: Completer | AsyncCompleter | undefined;
+ terminal?: boolean | undefined;
+ /**
+ * Initial list of history lines. This option makes sense
+ * only if `terminal` is set to `true` by the user or by an internal `output`
+ * check, otherwise the history caching mechanism is not initialized at all.
+ * @default []
+ */
+ history?: string[] | undefined;
+ historySize?: number | undefined;
+ prompt?: string | undefined;
+ crlfDelay?: number | undefined;
+ /**
+ * If `true`, when a new input line added
+ * to the history list duplicates an older one, this removes the older line
+ * from the list.
+ * @default false
+ */
+ removeHistoryDuplicates?: boolean | undefined;
+ escapeCodeTimeout?: number | undefined;
+ tabSize?: number | undefined;
+ }
+ /**
+ * The `readline.createInterface()` method creates a new `readline.Interface`instance.
+ *
+ * ```js
+ * const readline = require('readline');
+ * const rl = readline.createInterface({
+ * input: process.stdin,
+ * output: process.stdout
+ * });
+ * ```
+ *
+ * Once the `readline.Interface` instance is created, the most common case is to
+ * listen for the `'line'` event:
+ *
+ * ```js
+ * rl.on('line', (line) => {
+ * console.log(`Received: ${line}`);
+ * });
+ * ```
+ *
+ * If `terminal` is `true` for this instance then the `output` stream will get
+ * the best compatibility if it defines an `output.columns` property and emits
+ * a `'resize'` event on the `output` if or when the columns ever change
+ * (`process.stdout` does this automatically when it is a TTY).
+ *
+ * When creating a `readline.Interface` using `stdin` as input, the program
+ * will not terminate until it receives `EOF` (Ctrl+D on
+ * Linux/macOS, Ctrl+Z followed by Return on
+ * Windows).
+ * If you want your application to exit without waiting for user input, you can `unref()` the standard input stream:
+ *
+ * ```js
+ * process.stdin.unref();
+ * ```
+ * @since v0.1.98
+ */
+ export function createInterface(
+ input: NodeJS.ReadableStream,
+ output?: NodeJS.WritableStream,
+ completer?: Completer | AsyncCompleter,
+ terminal?: boolean,
+ ): Interface;
+ export function createInterface(options: ReadLineOptions): Interface;
+ /**
+ * The `readline.emitKeypressEvents()` method causes the given `Readable` stream to begin emitting `'keypress'` events corresponding to received input.
+ *
+ * Optionally, `interface` specifies a `readline.Interface` instance for which
+ * autocompletion is disabled when copy-pasted input is detected.
+ *
+ * If the `stream` is a `TTY`, then it must be in raw mode.
+ *
+ * This is automatically called by any readline instance on its `input` if the`input` is a terminal. Closing the `readline` instance does not stop
+ * the `input` from emitting `'keypress'` events.
+ *
+ * ```js
+ * readline.emitKeypressEvents(process.stdin);
+ * if (process.stdin.isTTY)
+ * process.stdin.setRawMode(true);
+ * ```
+ *
+ * ## Example: Tiny CLI
+ *
+ * The following example illustrates the use of `readline.Interface` class to
+ * implement a small command-line interface:
+ *
+ * ```js
+ * const readline = require('readline');
+ * const rl = readline.createInterface({
+ * input: process.stdin,
+ * output: process.stdout,
+ * prompt: 'OHAI> '
+ * });
+ *
+ * rl.prompt();
+ *
+ * rl.on('line', (line) => {
+ * switch (line.trim()) {
+ * case 'hello':
+ * console.log('world!');
+ * break;
+ * default:
+ * console.log(`Say what? I might have heard '${line.trim()}'`);
+ * break;
+ * }
+ * rl.prompt();
+ * }).on('close', () => {
+ * console.log('Have a great day!');
+ * process.exit(0);
+ * });
+ * ```
+ *
+ * ## Example: Read file stream line-by-Line
+ *
+ * A common use case for `readline` is to consume an input file one line at a
+ * time. The easiest way to do so is leveraging the `fs.ReadStream` API as
+ * well as a `for await...of` loop:
+ *
+ * ```js
+ * const fs = require('fs');
+ * const readline = require('readline');
+ *
+ * async function processLineByLine() {
+ * const fileStream = fs.createReadStream('input.txt');
+ *
+ * const rl = readline.createInterface({
+ * input: fileStream,
+ * crlfDelay: Infinity
+ * });
+ * // Note: we use the crlfDelay option to recognize all instances of CR LF
+ * // ('\r\n') in input.txt as a single line break.
+ *
+ * for await (const line of rl) {
+ * // Each line in input.txt will be successively available here as `line`.
+ * console.log(`Line from file: ${line}`);
+ * }
+ * }
+ *
+ * processLineByLine();
+ * ```
+ *
+ * Alternatively, one could use the `'line'` event:
+ *
+ * ```js
+ * const fs = require('fs');
+ * const readline = require('readline');
+ *
+ * const rl = readline.createInterface({
+ * input: fs.createReadStream('sample.txt'),
+ * crlfDelay: Infinity
+ * });
+ *
+ * rl.on('line', (line) => {
+ * console.log(`Line from file: ${line}`);
+ * });
+ * ```
+ *
+ * Currently, `for await...of` loop can be a bit slower. If `async` / `await`flow and speed are both essential, a mixed approach can be applied:
+ *
+ * ```js
+ * const { once } = require('events');
+ * const { createReadStream } = require('fs');
+ * const { createInterface } = require('readline');
+ *
+ * (async function processLineByLine() {
+ * try {
+ * const rl = createInterface({
+ * input: createReadStream('big-file.txt'),
+ * crlfDelay: Infinity
+ * });
+ *
+ * rl.on('line', (line) => {
+ * // Process the line.
+ * });
+ *
+ * await once(rl, 'close');
+ *
+ * console.log('File processed.');
+ * } catch (err) {
+ * console.error(err);
+ * }
+ * })();
+ * ```
+ * @since v0.7.7
+ */
+ export function emitKeypressEvents(stream: NodeJS.ReadableStream, readlineInterface?: Interface): void;
+ export type Direction = -1 | 0 | 1;
+ export interface CursorPos {
+ rows: number;
+ cols: number;
+ }
+ /**
+ * The `readline.clearLine()` method clears current line of given `TTY` stream
+ * in a specified direction identified by `dir`.
+ * @since v0.7.7
+ * @param callback Invoked once the operation completes.
+ * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
+ */
+ export function clearLine(stream: NodeJS.WritableStream, dir: Direction, callback?: () => void): boolean;
+ /**
+ * The `readline.clearScreenDown()` method clears the given `TTY` stream from
+ * the current position of the cursor down.
+ * @since v0.7.7
+ * @param callback Invoked once the operation completes.
+ * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
+ */
+ export function clearScreenDown(stream: NodeJS.WritableStream, callback?: () => void): boolean;
+ /**
+ * The `readline.cursorTo()` method moves cursor to the specified position in a
+ * given `TTY` `stream`.
+ * @since v0.7.7
+ * @param callback Invoked once the operation completes.
+ * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
+ */
+ export function cursorTo(stream: NodeJS.WritableStream, x: number, y?: number, callback?: () => void): boolean;
+ /**
+ * The `readline.moveCursor()` method moves the cursor _relative_ to its current
+ * position in a given `TTY` `stream`.
+ *
+ * ## Example: Tiny CLI
+ *
+ * The following example illustrates the use of `readline.Interface` class to
+ * implement a small command-line interface:
+ *
+ * ```js
+ * const readline = require('readline');
+ * const rl = readline.createInterface({
+ * input: process.stdin,
+ * output: process.stdout,
+ * prompt: 'OHAI> '
+ * });
+ *
+ * rl.prompt();
+ *
+ * rl.on('line', (line) => {
+ * switch (line.trim()) {
+ * case 'hello':
+ * console.log('world!');
+ * break;
+ * default:
+ * console.log(`Say what? I might have heard '${line.trim()}'`);
+ * break;
+ * }
+ * rl.prompt();
+ * }).on('close', () => {
+ * console.log('Have a great day!');
+ * process.exit(0);
+ * });
+ * ```
+ *
+ * ## Example: Read file stream line-by-Line
+ *
+ * A common use case for `readline` is to consume an input file one line at a
+ * time. The easiest way to do so is leveraging the `fs.ReadStream` API as
+ * well as a `for await...of` loop:
+ *
+ * ```js
+ * const fs = require('fs');
+ * const readline = require('readline');
+ *
+ * async function processLineByLine() {
+ * const fileStream = fs.createReadStream('input.txt');
+ *
+ * const rl = readline.createInterface({
+ * input: fileStream,
+ * crlfDelay: Infinity
+ * });
+ * // Note: we use the crlfDelay option to recognize all instances of CR LF
+ * // ('\r\n') in input.txt as a single line break.
+ *
+ * for await (const line of rl) {
+ * // Each line in input.txt will be successively available here as `line`.
+ * console.log(`Line from file: ${line}`);
+ * }
+ * }
+ *
+ * processLineByLine();
+ * ```
+ *
+ * Alternatively, one could use the `'line'` event:
+ *
+ * ```js
+ * const fs = require('fs');
+ * const readline = require('readline');
+ *
+ * const rl = readline.createInterface({
+ * input: fs.createReadStream('sample.txt'),
+ * crlfDelay: Infinity
+ * });
+ *
+ * rl.on('line', (line) => {
+ * console.log(`Line from file: ${line}`);
+ * });
+ * ```
+ *
+ * Currently, `for await...of` loop can be a bit slower. If `async` / `await`flow and speed are both essential, a mixed approach can be applied:
+ *
+ * ```js
+ * const { once } = require('events');
+ * const { createReadStream } = require('fs');
+ * const { createInterface } = require('readline');
+ *
+ * (async function processLineByLine() {
+ * try {
+ * const rl = createInterface({
+ * input: createReadStream('big-file.txt'),
+ * crlfDelay: Infinity
+ * });
+ *
+ * rl.on('line', (line) => {
+ * // Process the line.
+ * });
+ *
+ * await once(rl, 'close');
+ *
+ * console.log('File processed.');
+ * } catch (err) {
+ * console.error(err);
+ * }
+ * })();
+ * ```
+ * @since v0.7.7
+ * @param callback Invoked once the operation completes.
+ * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
+ */
+ export function moveCursor(stream: NodeJS.WritableStream, dx: number, dy: number, callback?: () => void): boolean;
+}
+declare module "node:readline" {
+ export * from "readline";
+}
diff --git a/client/node_modules/@types/node/ts4.8/readline/promises.d.ts b/client/node_modules/@types/node/ts4.8/readline/promises.d.ts
new file mode 100644
index 0000000..ba603ef
--- /dev/null
+++ b/client/node_modules/@types/node/ts4.8/readline/promises.d.ts
@@ -0,0 +1,143 @@
+/**
+ * The `readline/promise` module provides an API for reading lines of input from a Readable stream one line at a time.
+ *
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/readline/promises.js)
+ * @since v17.0.0
+ */
+declare module "readline/promises" {
+ import { AsyncCompleter, Completer, Direction, Interface as _Interface, ReadLineOptions } from "node:readline";
+ import { Abortable } from "node:events";
+
+ class Interface extends _Interface {
+ /**
+ * The rl.question() method displays the query by writing it to the output, waits for user input to be provided on input,
+ * then invokes the callback function passing the provided input as the first argument.
+ *
+ * When called, rl.question() will resume the input stream if it has been paused.
+ *
+ * If the readlinePromises.Interface was created with output set to null or undefined the query is not written.
+ *
+ * If the question is called after rl.close(), it returns a rejected promise.
+ *
+ * Example usage:
+ *
+ * ```js
+ * const answer = await rl.question('What is your favorite food? ');
+ * console.log(`Oh, so your favorite food is ${answer}`);
+ * ```
+ *
+ * Using an AbortSignal to cancel a question.
+ *
+ * ```js
+ * const signal = AbortSignal.timeout(10_000);
+ *
+ * signal.addEventListener('abort', () => {
+ * console.log('The food question timed out');
+ * }, { once: true });
+ *
+ * const answer = await rl.question('What is your favorite food? ', { signal });
+ * console.log(`Oh, so your favorite food is ${answer}`);
+ * ```
+ *
+ * @since v17.0.0
+ * @param query A statement or query to write to output, prepended to the prompt.
+ */
+ question(query: string): Promise<string>;
+ question(query: string, options: Abortable): Promise<string>;
+ }
+
+ class Readline {
+ /**
+ * @param stream A TTY stream.
+ */
+ constructor(stream: NodeJS.WritableStream, options?: { autoCommit?: boolean });
+ /**
+ * The `rl.clearLine()` method adds to the internal list of pending action an action that clears current line of the associated `stream` in a specified direction identified by `dir`.
+ * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` was passed to the constructor.
+ */
+ clearLine(dir: Direction): this;
+ /**
+ * The `rl.clearScreenDown()` method adds to the internal list of pending action an action that clears the associated `stream` from the current position of the cursor down.
+ * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` was passed to the constructor.
+ */
+ clearScreenDown(): this;
+ /**
+ * The `rl.commit()` method sends all the pending actions to the associated `stream` and clears the internal list of pending actions.
+ */
+ commit(): Promise<void>;
+ /**
+ * The `rl.cursorTo()` method adds to the internal list of pending action an action that moves cursor to the specified position in the associated `stream`.
+ * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` was passed to the constructor.
+ */
+ cursorTo(x: number, y?: number): this;
+ /**
+ * The `rl.moveCursor()` method adds to the internal list of pending action an action that moves the cursor relative to its current position in the associated `stream`.
+ * Call `rl.commit()` to see the effect of this method, unless autoCommit: true was passed to the constructor.
+ */
+ moveCursor(dx: number, dy: number): this;
+ /**
+ * The `rl.rollback()` method clears the internal list of pending actions without sending it to the associated `stream`.
+ */
+ rollback(): this;
+ }
+
+ /**
+ * The `readlinePromises.createInterface()` method creates a new `readlinePromises.Interface` instance.
+ *
+ * ```js
+ * const readlinePromises = require('node:readline/promises');
+ * const rl = readlinePromises.createInterface({
+ * input: process.stdin,
+ * output: process.stdout
+ * });
+ * ```
+ *
+ * Once the `readlinePromises.Interface` instance is created, the most common case is to listen for the `'line'` event:
+ *
+ * ```js
+ * rl.on('line', (line) => {
+ * console.log(`Received: ${line}`);
+ * });
+ * ```
+ *
+ * If `terminal` is `true` for this instance then the `output` stream will get the best compatibility if it defines an `output.columns` property,
+ * and emits a `'resize'` event on the `output`, if or when the columns ever change (`process.stdout` does this automatically when it is a TTY).
+ *
+ * ## Use of the `completer` function
+ *
+ * The `completer` function takes the current line entered by the user as an argument, and returns an `Array` with 2 entries:
+ *
+ * - An Array with matching entries for the completion.
+ * - The substring that was used for the matching.
+ *
+ * For instance: `[[substr1, substr2, ...], originalsubstring]`.
+ *
+ * ```js
+ * function completer(line) {
+ * const completions = '.help .error .exit .quit .q'.split(' ');
+ * const hits = completions.filter((c) => c.startsWith(line));
+ * // Show all completions if none found
+ * return [hits.length ? hits : completions, line];
+ * }
+ * ```
+ *
+ * The `completer` function can also returns a `Promise`, or be asynchronous:
+ *
+ * ```js
+ * async function completer(linePartial) {
+ * await someAsyncWork();
+ * return [['123'], linePartial];
+ * }
+ * ```
+ */
+ function createInterface(
+ input: NodeJS.ReadableStream,
+ output?: NodeJS.WritableStream,
+ completer?: Completer | AsyncCompleter,
+ terminal?: boolean,
+ ): Interface;
+ function createInterface(options: ReadLineOptions): Interface;
+}
+declare module "node:readline/promises" {
+ export * from "readline/promises";
+}
diff --git a/client/node_modules/@types/node/ts4.8/repl.d.ts b/client/node_modules/@types/node/ts4.8/repl.d.ts
new file mode 100644
index 0000000..7ed370b
--- /dev/null
+++ b/client/node_modules/@types/node/ts4.8/repl.d.ts
@@ -0,0 +1,430 @@
+/**
+ * The `repl` module provides a Read-Eval-Print-Loop (REPL) implementation that
+ * is available both as a standalone program or includible in other applications.
+ * It can be accessed using:
+ *
+ * ```js
+ * const repl = require('repl');
+ * ```
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/repl.js)
+ */
+declare module "repl" {
+ import { AsyncCompleter, Completer, Interface } from "node:readline";
+ import { Context } from "node:vm";
+ import { InspectOptions } from "node:util";
+ interface ReplOptions {
+ /**
+ * The input prompt to display.
+ * @default "> "
+ */
+ prompt?: string | undefined;
+ /**
+ * The `Readable` stream from which REPL input will be read.
+ * @default process.stdin
+ */
+ input?: NodeJS.ReadableStream | undefined;
+ /**
+ * The `Writable` stream to which REPL output will be written.
+ * @default process.stdout
+ */
+ output?: NodeJS.WritableStream | undefined;
+ /**
+ * If `true`, specifies that the output should be treated as a TTY terminal, and have
+ * ANSI/VT100 escape codes written to it.
+ * Default: checking the value of the `isTTY` property on the output stream upon
+ * instantiation.
+ */
+ terminal?: boolean | undefined;
+ /**
+ * The function to be used when evaluating each given line of input.
+ * Default: an async wrapper for the JavaScript `eval()` function. An `eval` function can
+ * error with `repl.Recoverable` to indicate the input was incomplete and prompt for
+ * additional lines.
+ *
+ * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_default_evaluation
+ * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_custom_evaluation_functions
+ */
+ eval?: REPLEval | undefined;
+ /**
+ * Defines if the repl prints output previews or not.
+ * @default `true` Always `false` in case `terminal` is falsy.
+ */
+ preview?: boolean | undefined;
+ /**
+ * If `true`, specifies that the default `writer` function should include ANSI color
+ * styling to REPL output. If a custom `writer` function is provided then this has no
+ * effect.
+ * Default: the REPL instance's `terminal` value.
+ */
+ useColors?: boolean | undefined;
+ /**
+ * If `true`, specifies that the default evaluation function will use the JavaScript
+ * `global` as the context as opposed to creating a new separate context for the REPL
+ * instance. The node CLI REPL sets this value to `true`.
+ * Default: `false`.
+ */
+ useGlobal?: boolean | undefined;
+ /**
+ * If `true`, specifies that the default writer will not output the return value of a
+ * command if it evaluates to `undefined`.
+ * Default: `false`.
+ */
+ ignoreUndefined?: boolean | undefined;
+ /**
+ * The function to invoke to format the output of each command before writing to `output`.
+ * Default: a wrapper for `util.inspect`.
+ *
+ * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_customizing_repl_output
+ */
+ writer?: REPLWriter | undefined;
+ /**
+ * An optional function used for custom Tab auto completion.
+ *
+ * @see https://nodejs.org/dist/latest-v11.x/docs/api/readline.html#readline_use_of_the_completer_function
+ */
+ completer?: Completer | AsyncCompleter | undefined;
+ /**
+ * A flag that specifies whether the default evaluator executes all JavaScript commands in
+ * strict mode or default (sloppy) mode.
+ * Accepted values are:
+ * - `repl.REPL_MODE_SLOPPY` - evaluates expressions in sloppy mode.
+ * - `repl.REPL_MODE_STRICT` - evaluates expressions in strict mode. This is equivalent to
+ * prefacing every repl statement with `'use strict'`.
+ */
+ replMode?: typeof REPL_MODE_SLOPPY | typeof REPL_MODE_STRICT | undefined;
+ /**
+ * Stop evaluating the current piece of code when `SIGINT` is received, i.e. `Ctrl+C` is
+ * pressed. This cannot be used together with a custom `eval` function.
+ * Default: `false`.
+ */
+ breakEvalOnSigint?: boolean | undefined;
+ }
+ type REPLEval = (
+ this: REPLServer,
+ evalCmd: string,
+ context: Context,
+ file: string,
+ cb: (err: Error | null, result: any) => void,
+ ) => void;
+ type REPLWriter = (this: REPLServer, obj: any) => string;
+ /**
+ * This is the default "writer" value, if none is passed in the REPL options,
+ * and it can be overridden by custom print functions.
+ */
+ const writer: REPLWriter & {
+ options: InspectOptions;
+ };
+ type REPLCommandAction = (this: REPLServer, text: string) => void;
+ interface REPLCommand {
+ /**
+ * Help text to be displayed when `.help` is entered.
+ */
+ help?: string | undefined;
+ /**
+ * The function to execute, optionally accepting a single string argument.
+ */
+ action: REPLCommandAction;
+ }
+ /**
+ * Instances of `repl.REPLServer` are created using the {@link start} method
+ * or directly using the JavaScript `new` keyword.
+ *
+ * ```js
+ * const repl = require('repl');
+ *
+ * const options = { useColors: true };
+ *
+ * const firstInstance = repl.start(options);
+ * const secondInstance = new repl.REPLServer(options);
+ * ```
+ * @since v0.1.91
+ */
+ class REPLServer extends Interface {
+ /**
+ * The `vm.Context` provided to the `eval` function to be used for JavaScript
+ * evaluation.
+ */
+ readonly context: Context;
+ /**
+ * @deprecated since v14.3.0 - Use `input` instead.
+ */
+ readonly inputStream: NodeJS.ReadableStream;
+ /**
+ * @deprecated since v14.3.0 - Use `output` instead.
+ */
+ readonly outputStream: NodeJS.WritableStream;
+ /**
+ * The `Readable` stream from which REPL input will be read.
+ */
+ readonly input: NodeJS.ReadableStream;
+ /**
+ * The `Writable` stream to which REPL output will be written.
+ */
+ readonly output: NodeJS.WritableStream;
+ /**
+ * The commands registered via `replServer.defineCommand()`.
+ */
+ readonly commands: NodeJS.ReadOnlyDict<REPLCommand>;
+ /**
+ * A value indicating whether the REPL is currently in "editor mode".
+ *
+ * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_commands_and_special_keys
+ */
+ readonly editorMode: boolean;
+ /**
+ * A value indicating whether the `_` variable has been assigned.
+ *
+ * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
+ */
+ readonly underscoreAssigned: boolean;
+ /**
+ * The last evaluation result from the REPL (assigned to the `_` variable inside of the REPL).
+ *
+ * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
+ */
+ readonly last: any;
+ /**
+ * A value indicating whether the `_error` variable has been assigned.
+ *
+ * @since v9.8.0
+ * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
+ */
+ readonly underscoreErrAssigned: boolean;
+ /**
+ * The last error raised inside the REPL (assigned to the `_error` variable inside of the REPL).
+ *
+ * @since v9.8.0
+ * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
+ */
+ readonly lastError: any;
+ /**
+ * Specified in the REPL options, this is the function to be used when evaluating each
+ * given line of input. If not specified in the REPL options, this is an async wrapper
+ * for the JavaScript `eval()` function.
+ */
+ readonly eval: REPLEval;
+ /**
+ * Specified in the REPL options, this is a value indicating whether the default
+ * `writer` function should include ANSI color styling to REPL output.
+ */
+ readonly useColors: boolean;
+ /**
+ * Specified in the REPL options, this is a value indicating whether the default `eval`
+ * function will use the JavaScript `global` as the context as opposed to creating a new
+ * separate context for the REPL instance.
+ */
+ readonly useGlobal: boolean;
+ /**
+ * Specified in the REPL options, this is a value indicating whether the default `writer`
+ * function should output the result of a command if it evaluates to `undefined`.
+ */
+ readonly ignoreUndefined: boolean;
+ /**
+ * Specified in the REPL options, this is the function to invoke to format the output of
+ * each command before writing to `outputStream`. If not specified in the REPL options,
+ * this will be a wrapper for `util.inspect`.
+ */
+ readonly writer: REPLWriter;
+ /**
+ * Specified in the REPL options, this is the function to use for custom Tab auto-completion.
+ */
+ readonly completer: Completer | AsyncCompleter;
+ /**
+ * Specified in the REPL options, this is a flag that specifies whether the default `eval`
+ * function should execute all JavaScript commands in strict mode or default (sloppy) mode.
+ * Possible values are:
+ * - `repl.REPL_MODE_SLOPPY` - evaluates expressions in sloppy mode.
+ * - `repl.REPL_MODE_STRICT` - evaluates expressions in strict mode. This is equivalent to
+ * prefacing every repl statement with `'use strict'`.
+ */
+ readonly replMode: typeof REPL_MODE_SLOPPY | typeof REPL_MODE_STRICT;
+ /**
+ * NOTE: According to the documentation:
+ *
+ * > Instances of `repl.REPLServer` are created using the `repl.start()` method and
+ * > _should not_ be created directly using the JavaScript `new` keyword.
+ *
+ * `REPLServer` cannot be subclassed due to implementation specifics in NodeJS.
+ *
+ * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_class_replserver
+ */
+ private constructor();
+ /**
+ * The `replServer.defineCommand()` method is used to add new `.`\-prefixed commands
+ * to the REPL instance. Such commands are invoked by typing a `.` followed by the`keyword`. The `cmd` is either a `Function` or an `Object` with the following
+ * properties:
+ *
+ * The following example shows two new commands added to the REPL instance:
+ *
+ * ```js
+ * const repl = require('repl');
+ *
+ * const replServer = repl.start({ prompt: '> ' });
+ * replServer.defineCommand('sayhello', {
+ * help: 'Say hello',
+ * action(name) {
+ * this.clearBufferedCommand();
+ * console.log(`Hello, ${name}!`);
+ * this.displayPrompt();
+ * }
+ * });
+ * replServer.defineCommand('saybye', function saybye() {
+ * console.log('Goodbye!');
+ * this.close();
+ * });
+ * ```
+ *
+ * The new commands can then be used from within the REPL instance:
+ *
+ * ```console
+ * > .sayhello Node.js User
+ * Hello, Node.js User!
+ * > .saybye
+ * Goodbye!
+ * ```
+ * @since v0.3.0
+ * @param keyword The command keyword (_without_ a leading `.` character).
+ * @param cmd The function to invoke when the command is processed.
+ */
+ defineCommand(keyword: string, cmd: REPLCommandAction | REPLCommand): void;
+ /**
+ * The `replServer.displayPrompt()` method readies the REPL instance for input
+ * from the user, printing the configured `prompt` to a new line in the `output`and resuming the `input` to accept new input.
+ *
+ * When multi-line input is being entered, an ellipsis is printed rather than the
+ * 'prompt'.
+ *
+ * When `preserveCursor` is `true`, the cursor placement will not be reset to `0`.
+ *
+ * The `replServer.displayPrompt` method is primarily intended to be called from
+ * within the action function for commands registered using the`replServer.defineCommand()` method.
+ * @since v0.1.91
+ */
+ displayPrompt(preserveCursor?: boolean): void;
+ /**
+ * The `replServer.clearBufferedCommand()` method clears any command that has been
+ * buffered but not yet executed. This method is primarily intended to be
+ * called from within the action function for commands registered using the`replServer.defineCommand()` method.
+ * @since v9.0.0
+ */
+ clearBufferedCommand(): void;
+ /**
+ * Initializes a history log file for the REPL instance. When executing the
+ * Node.js binary and using the command-line REPL, a history file is initialized
+ * by default. However, this is not the case when creating a REPL
+ * programmatically. Use this method to initialize a history log file when working
+ * with REPL instances programmatically.
+ * @since v11.10.0
+ * @param historyPath the path to the history file
+ * @param callback called when history writes are ready or upon error
+ */
+ setupHistory(path: string, callback: (err: Error | null, repl: this) => void): void;
+ /**
+ * events.EventEmitter
+ * 1. close - inherited from `readline.Interface`
+ * 2. line - inherited from `readline.Interface`
+ * 3. pause - inherited from `readline.Interface`
+ * 4. resume - inherited from `readline.Interface`
+ * 5. SIGCONT - inherited from `readline.Interface`
+ * 6. SIGINT - inherited from `readline.Interface`
+ * 7. SIGTSTP - inherited from `readline.Interface`
+ * 8. exit
+ * 9. reset
+ */
+ addListener(event: string, listener: (...args: any[]) => void): this;
+ addListener(event: "close", listener: () => void): this;
+ addListener(event: "line", listener: (input: string) => void): this;
+ addListener(event: "pause", listener: () => void): this;
+ addListener(event: "resume", listener: () => void): this;
+ addListener(event: "SIGCONT", listener: () => void): this;
+ addListener(event: "SIGINT", listener: () => void): this;
+ addListener(event: "SIGTSTP", listener: () => void): this;
+ addListener(event: "exit", listener: () => void): this;
+ addListener(event: "reset", listener: (context: Context) => void): this;
+ emit(event: string | symbol, ...args: any[]): boolean;
+ emit(event: "close"): boolean;
+ emit(event: "line", input: string): boolean;
+ emit(event: "pause"): boolean;
+ emit(event: "resume"): boolean;
+ emit(event: "SIGCONT"): boolean;
+ emit(event: "SIGINT"): boolean;
+ emit(event: "SIGTSTP"): boolean;
+ emit(event: "exit"): boolean;
+ emit(event: "reset", context: Context): boolean;
+ on(event: string, listener: (...args: any[]) => void): this;
+ on(event: "close", listener: () => void): this;
+ on(event: "line", listener: (input: string) => void): this;
+ on(event: "pause", listener: () => void): this;
+ on(event: "resume", listener: () => void): this;
+ on(event: "SIGCONT", listener: () => void): this;
+ on(event: "SIGINT", listener: () => void): this;
+ on(event: "SIGTSTP", listener: () => void): this;
+ on(event: "exit", listener: () => void): this;
+ on(event: "reset", listener: (context: Context) => void): this;
+ once(event: string, listener: (...args: any[]) => void): this;
+ once(event: "close", listener: () => void): this;
+ once(event: "line", listener: (input: string) => void): this;
+ once(event: "pause", listener: () => void): this;
+ once(event: "resume", listener: () => void): this;
+ once(event: "SIGCONT", listener: () => void): this;
+ once(event: "SIGINT", listener: () => void): this;
+ once(event: "SIGTSTP", listener: () => void): this;
+ once(event: "exit", listener: () => void): this;
+ once(event: "reset", listener: (context: Context) => void): this;
+ prependListener(event: string, listener: (...args: any[]) => void): this;
+ prependListener(event: "close", listener: () => void): this;
+ prependListener(event: "line", listener: (input: string) => void): this;
+ prependListener(event: "pause", listener: () => void): this;
+ prependListener(event: "resume", listener: () => void): this;
+ prependListener(event: "SIGCONT", listener: () => void): this;
+ prependListener(event: "SIGINT", listener: () => void): this;
+ prependListener(event: "SIGTSTP", listener: () => void): this;
+ prependListener(event: "exit", listener: () => void): this;
+ prependListener(event: "reset", listener: (context: Context) => void): this;
+ prependOnceListener(event: string, listener: (...args: any[]) => void): this;
+ prependOnceListener(event: "close", listener: () => void): this;
+ prependOnceListener(event: "line", listener: (input: string) => void): this;
+ prependOnceListener(event: "pause", listener: () => void): this;
+ prependOnceListener(event: "resume", listener: () => void): this;
+ prependOnceListener(event: "SIGCONT", listener: () => void): this;
+ prependOnceListener(event: "SIGINT", listener: () => void): this;
+ prependOnceListener(event: "SIGTSTP", listener: () => void): this;
+ prependOnceListener(event: "exit", listener: () => void): this;
+ prependOnceListener(event: "reset", listener: (context: Context) => void): this;
+ }
+ /**
+ * A flag passed in the REPL options. Evaluates expressions in sloppy mode.
+ */
+ const REPL_MODE_SLOPPY: unique symbol;
+ /**
+ * A flag passed in the REPL options. Evaluates expressions in strict mode.
+ * This is equivalent to prefacing every repl statement with `'use strict'`.
+ */
+ const REPL_MODE_STRICT: unique symbol;
+ /**
+ * The `repl.start()` method creates and starts a {@link REPLServer} instance.
+ *
+ * If `options` is a string, then it specifies the input prompt:
+ *
+ * ```js
+ * const repl = require('repl');
+ *
+ * // a Unix style prompt
+ * repl.start('$ ');
+ * ```
+ * @since v0.1.91
+ */
+ function start(options?: string | ReplOptions): REPLServer;
+ /**
+ * Indicates a recoverable error that a `REPLServer` can use to support multi-line input.
+ *
+ * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_recoverable_errors
+ */
+ class Recoverable extends SyntaxError {
+ err: Error;
+ constructor(err: Error);
+ }
+}
+declare module "node:repl" {
+ export * from "repl";
+}
diff --git a/client/node_modules/@types/node/ts4.8/stream.d.ts b/client/node_modules/@types/node/ts4.8/stream.d.ts
new file mode 100644
index 0000000..c1b8a25
--- /dev/null
+++ b/client/node_modules/@types/node/ts4.8/stream.d.ts
@@ -0,0 +1,1731 @@
+/**
+ * A stream is an abstract interface for working with streaming data in Node.js.
+ * The `stream` module provides an API for implementing the stream interface.
+ *
+ * There are many stream objects provided by Node.js. For instance, a `request to an HTTP server` and `process.stdout` are both stream instances.
+ *
+ * Streams can be readable, writable, or both. All streams are instances of `EventEmitter`.
+ *
+ * To access the `stream` module:
+ *
+ * ```js
+ * const stream = require('stream');
+ * ```
+ *
+ * The `stream` module is useful for creating new types of stream instances. It is
+ * usually not necessary to use the `stream` module to consume streams.
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/stream.js)
+ */
+declare module "stream" {
+ import { Abortable, EventEmitter } from "node:events";
+ import { Blob as NodeBlob } from "node:buffer";
+ import * as streamPromises from "node:stream/promises";
+ import * as streamConsumers from "node:stream/consumers";
+ import * as streamWeb from "node:stream/web";
+
+ type ComposeFnParam = (source: any) => void;
+
+ class internal extends EventEmitter {
+ pipe<T extends NodeJS.WritableStream>(
+ destination: T,
+ options?: {
+ end?: boolean | undefined;
+ },
+ ): T;
+ compose<T extends NodeJS.ReadableStream>(
+ stream: T | ComposeFnParam | Iterable<T> | AsyncIterable<T>,
+ options?: { signal: AbortSignal },
+ ): T;
+ }
+ namespace internal {
+ class Stream extends internal {
+ constructor(opts?: ReadableOptions);
+ }
+ interface StreamOptions<T extends Stream> extends Abortable {
+ emitClose?: boolean | undefined;
+ highWaterMark?: number | undefined;
+ objectMode?: boolean | undefined;
+ construct?(this: T, callback: (error?: Error | null) => void): void;
+ destroy?(this: T, error: Error | null, callback: (error: Error | null) => void): void;
+ autoDestroy?: boolean | undefined;
+ }
+ interface ReadableOptions extends StreamOptions<Readable> {
+ encoding?: BufferEncoding | undefined;
+ read?(this: Readable, size: number): void;
+ }
+ interface ArrayOptions {
+ /** the maximum concurrent invocations of `fn` to call on the stream at once. **Default: 1**. */
+ concurrency?: number;
+ /** allows destroying the stream if the signal is aborted. */
+ signal?: AbortSignal;
+ }
+ /**
+ * @since v0.9.4
+ */
+ class Readable extends Stream implements NodeJS.ReadableStream {
+ /**
+ * A utility method for creating Readable Streams out of iterators.
+ */
+ static from(iterable: Iterable<any> | AsyncIterable<any>, options?: ReadableOptions): Readable;
+ /**
+ * A utility method for creating a `Readable` from a web `ReadableStream`.
+ * @since v17.0.0
+ * @experimental
+ */
+ static fromWeb(
+ readableStream: streamWeb.ReadableStream,
+ options?: Pick<ReadableOptions, "encoding" | "highWaterMark" | "objectMode" | "signal">,
+ ): Readable;
+ /**
+ * Returns whether the stream has been read from or cancelled.
+ * @since v16.8.0
+ */
+ static isDisturbed(stream: Readable | NodeJS.ReadableStream): boolean;
+ /**
+ * A utility method for creating a web `ReadableStream` from a `Readable`.
+ * @since v17.0.0
+ * @experimental
+ */
+ static toWeb(streamReadable: Readable): streamWeb.ReadableStream;
+ /**
+ * Returns whether the stream was destroyed or errored before emitting `'end'`.
+ * @since v16.8.0
+ * @experimental
+ */
+ readonly readableAborted: boolean;
+ /**
+ * Is `true` if it is safe to call `readable.read()`, which means
+ * the stream has not been destroyed or emitted `'error'` or `'end'`.
+ * @since v11.4.0
+ */
+ readable: boolean;
+ /**
+ * Returns whether `'data'` has been emitted.
+ * @since v16.7.0, v14.18.0
+ * @experimental
+ */
+ readonly readableDidRead: boolean;
+ /**
+ * Getter for the property `encoding` of a given `Readable` stream. The `encoding`property can be set using the `readable.setEncoding()` method.
+ * @since v12.7.0
+ */
+ readonly readableEncoding: BufferEncoding | null;
+ /**
+ * Becomes `true` when `'end'` event is emitted.
+ * @since v12.9.0
+ */
+ readonly readableEnded: boolean;
+ /**
+ * This property reflects the current state of a `Readable` stream as described
+ * in the `Three states` section.
+ * @since v9.4.0
+ */
+ readonly readableFlowing: boolean | null;
+ /**
+ * Returns the value of `highWaterMark` passed when creating this `Readable`.
+ * @since v9.3.0
+ */
+ readonly readableHighWaterMark: number;
+ /**
+ * This property contains the number of bytes (or objects) in the queue
+ * ready to be read. The value provides introspection data regarding
+ * the status of the `highWaterMark`.
+ * @since v9.4.0
+ */
+ readonly readableLength: number;
+ /**
+ * Getter for the property `objectMode` of a given `Readable` stream.
+ * @since v12.3.0
+ */
+ readonly readableObjectMode: boolean;
+ /**
+ * Is `true` after `readable.destroy()` has been called.
+ * @since v8.0.0
+ */
+ destroyed: boolean;
+ /**
+ * Is true after 'close' has been emitted.
+ * @since v18.0.0
+ */
+ readonly closed: boolean;
+ /**
+ * Returns error if the stream has been destroyed with an error.
+ * @since v18.0.0
+ */
+ readonly errored: Error | null;
+ constructor(opts?: ReadableOptions);
+ _construct?(callback: (error?: Error | null) => void): void;
+ _read(size: number): void;
+ /**
+ * The `readable.read()` method reads data out of the internal buffer and
+ * returns it. If no data is available to be read, `null` is returned. By default,
+ * the data is returned as a `Buffer` object unless an encoding has been
+ * specified using the `readable.setEncoding()` method or the stream is operating
+ * in object mode.
+ *
+ * The optional `size` argument specifies a specific number of bytes to read. If`size` bytes are not available to be read, `null` will be returned _unless_the stream has ended, in which
+ * case all of the data remaining in the internal
+ * buffer will be returned.
+ *
+ * If the `size` argument is not specified, all of the data contained in the
+ * internal buffer will be returned.
+ *
+ * The `size` argument must be less than or equal to 1 GiB.
+ *
+ * The `readable.read()` method should only be called on `Readable` streams
+ * operating in paused mode. In flowing mode, `readable.read()` is called
+ * automatically until the internal buffer is fully drained.
+ *
+ * ```js
+ * const readable = getReadableStreamSomehow();
+ *
+ * // 'readable' may be triggered multiple times as data is buffered in
+ * readable.on('readable', () => {
+ * let chunk;
+ * console.log('Stream is readable (new data received in buffer)');
+ * // Use a loop to make sure we read all currently available data
+ * while (null !== (chunk = readable.read())) {
+ * console.log(`Read ${chunk.length} bytes of data...`);
+ * }
+ * });
+ *
+ * // 'end' will be triggered once when there is no more data available
+ * readable.on('end', () => {
+ * console.log('Reached end of stream.');
+ * });
+ * ```
+ *
+ * Each call to `readable.read()` returns a chunk of data, or `null`. The chunks
+ * are not concatenated. A `while` loop is necessary to consume all data
+ * currently in the buffer. When reading a large file `.read()` may return `null`,
+ * having consumed all buffered content so far, but there is still more data to
+ * come not yet buffered. In this case a new `'readable'` event will be emitted
+ * when there is more data in the buffer. Finally the `'end'` event will be
+ * emitted when there is no more data to come.
+ *
+ * Therefore to read a file's whole contents from a `readable`, it is necessary
+ * to collect chunks across multiple `'readable'` events:
+ *
+ * ```js
+ * const chunks = [];
+ *
+ * readable.on('readable', () => {
+ * let chunk;
+ * while (null !== (chunk = readable.read())) {
+ * chunks.push(chunk);
+ * }
+ * });
+ *
+ * readable.on('end', () => {
+ * const content = chunks.join('');
+ * });
+ * ```
+ *
+ * A `Readable` stream in object mode will always return a single item from
+ * a call to `readable.read(size)`, regardless of the value of the`size` argument.
+ *
+ * If the `readable.read()` method returns a chunk of data, a `'data'` event will
+ * also be emitted.
+ *
+ * Calling {@link read} after the `'end'` event has
+ * been emitted will return `null`. No runtime error will be raised.
+ * @since v0.9.4
+ * @param size Optional argument to specify how much data to read.
+ */
+ read(size?: number): any;
+ /**
+ * The `readable.setEncoding()` method sets the character encoding for
+ * data read from the `Readable` stream.
+ *
+ * By default, no encoding is assigned and stream data will be returned as`Buffer` objects. Setting an encoding causes the stream data
+ * to be returned as strings of the specified encoding rather than as `Buffer`objects. For instance, calling `readable.setEncoding('utf8')` will cause the
+ * output data to be interpreted as UTF-8 data, and passed as strings. Calling`readable.setEncoding('hex')` will cause the data to be encoded in hexadecimal
+ * string format.
+ *
+ * The `Readable` stream will properly handle multi-byte characters delivered
+ * through the stream that would otherwise become improperly decoded if simply
+ * pulled from the stream as `Buffer` objects.
+ *
+ * ```js
+ * const readable = getReadableStreamSomehow();
+ * readable.setEncoding('utf8');
+ * readable.on('data', (chunk) => {
+ * assert.equal(typeof chunk, 'string');
+ * console.log('Got %d characters of string data:', chunk.length);
+ * });
+ * ```
+ * @since v0.9.4
+ * @param encoding The encoding to use.
+ */
+ setEncoding(encoding: BufferEncoding): this;
+ /**
+ * The `readable.pause()` method will cause a stream in flowing mode to stop
+ * emitting `'data'` events, switching out of flowing mode. Any data that
+ * becomes available will remain in the internal buffer.
+ *
+ * ```js
+ * const readable = getReadableStreamSomehow();
+ * readable.on('data', (chunk) => {
+ * console.log(`Received ${chunk.length} bytes of data.`);
+ * readable.pause();
+ * console.log('There will be no additional data for 1 second.');
+ * setTimeout(() => {
+ * console.log('Now data will start flowing again.');
+ * readable.resume();
+ * }, 1000);
+ * });
+ * ```
+ *
+ * The `readable.pause()` method has no effect if there is a `'readable'`event listener.
+ * @since v0.9.4
+ */
+ pause(): this;
+ /**
+ * The `readable.resume()` method causes an explicitly paused `Readable` stream to
+ * resume emitting `'data'` events, switching the stream into flowing mode.
+ *
+ * The `readable.resume()` method can be used to fully consume the data from a
+ * stream without actually processing any of that data:
+ *
+ * ```js
+ * getReadableStreamSomehow()
+ * .resume()
+ * .on('end', () => {
+ * console.log('Reached the end, but did not read anything.');
+ * });
+ * ```
+ *
+ * The `readable.resume()` method has no effect if there is a `'readable'`event listener.
+ * @since v0.9.4
+ */
+ resume(): this;
+ /**
+ * The `readable.isPaused()` method returns the current operating state of the`Readable`. This is used primarily by the mechanism that underlies the`readable.pipe()` method. In most
+ * typical cases, there will be no reason to
+ * use this method directly.
+ *
+ * ```js
+ * const readable = new stream.Readable();
+ *
+ * readable.isPaused(); // === false
+ * readable.pause();
+ * readable.isPaused(); // === true
+ * readable.resume();
+ * readable.isPaused(); // === false
+ * ```
+ * @since v0.11.14
+ */
+ isPaused(): boolean;
+ /**
+ * The `readable.unpipe()` method detaches a `Writable` stream previously attached
+ * using the {@link pipe} method.
+ *
+ * If the `destination` is not specified, then _all_ pipes are detached.
+ *
+ * If the `destination` is specified, but no pipe is set up for it, then
+ * the method does nothing.
+ *
+ * ```js
+ * const fs = require('fs');
+ * const readable = getReadableStreamSomehow();
+ * const writable = fs.createWriteStream('file.txt');
+ * // All the data from readable goes into 'file.txt',
+ * // but only for the first second.
+ * readable.pipe(writable);
+ * setTimeout(() => {
+ * console.log('Stop writing to file.txt.');
+ * readable.unpipe(writable);
+ * console.log('Manually close the file stream.');
+ * writable.end();
+ * }, 1000);
+ * ```
+ * @since v0.9.4
+ * @param destination Optional specific stream to unpipe
+ */
+ unpipe(destination?: NodeJS.WritableStream): this;
+ /**
+ * Passing `chunk` as `null` signals the end of the stream (EOF) and behaves the
+ * same as `readable.push(null)`, after which no more data can be written. The EOF
+ * signal is put at the end of the buffer and any buffered data will still be
+ * flushed.
+ *
+ * The `readable.unshift()` method pushes a chunk of data back into the internal
+ * buffer. This is useful in certain situations where a stream is being consumed by
+ * code that needs to "un-consume" some amount of data that it has optimistically
+ * pulled out of the source, so that the data can be passed on to some other party.
+ *
+ * The `stream.unshift(chunk)` method cannot be called after the `'end'` event
+ * has been emitted or a runtime error will be thrown.
+ *
+ * Developers using `stream.unshift()` often should consider switching to
+ * use of a `Transform` stream instead. See the `API for stream implementers` section for more information.
+ *
+ * ```js
+ * // Pull off a header delimited by \n\n.
+ * // Use unshift() if we get too much.
+ * // Call the callback with (error, header, stream).
+ * const { StringDecoder } = require('string_decoder');
+ * function parseHeader(stream, callback) {
+ * stream.on('error', callback);
+ * stream.on('readable', onReadable);
+ * const decoder = new StringDecoder('utf8');
+ * let header = '';
+ * function onReadable() {
+ * let chunk;
+ * while (null !== (chunk = stream.read())) {
+ * const str = decoder.write(chunk);
+ * if (str.includes('\n\n')) {
+ * // Found the header boundary.
+ * const split = str.split(/\n\n/);
+ * header += split.shift();
+ * const remaining = split.join('\n\n');
+ * const buf = Buffer.from(remaining, 'utf8');
+ * stream.removeListener('error', callback);
+ * // Remove the 'readable' listener before unshifting.
+ * stream.removeListener('readable', onReadable);
+ * if (buf.length)
+ * stream.unshift(buf);
+ * // Now the body of the message can be read from the stream.
+ * callback(null, header, stream);
+ * return;
+ * }
+ * // Still reading the header.
+ * header += str;
+ * }
+ * }
+ * }
+ * ```
+ *
+ * Unlike {@link push}, `stream.unshift(chunk)` will not
+ * end the reading process by resetting the internal reading state of the stream.
+ * This can cause unexpected results if `readable.unshift()` is called during a
+ * read (i.e. from within a {@link _read} implementation on a
+ * custom stream). Following the call to `readable.unshift()` with an immediate {@link push} will reset the reading state appropriately,
+ * however it is best to simply avoid calling `readable.unshift()` while in the
+ * process of performing a read.
+ * @since v0.9.11
+ * @param chunk Chunk of data to unshift onto the read queue. For streams not operating in object mode, `chunk` must be a string, `Buffer`, `Uint8Array` or `null`. For object mode
+ * streams, `chunk` may be any JavaScript value.
+ * @param encoding Encoding of string chunks. Must be a valid `Buffer` encoding, such as `'utf8'` or `'ascii'`.
+ */
+ unshift(chunk: any, encoding?: BufferEncoding): void;
+ /**
+ * Prior to Node.js 0.10, streams did not implement the entire `stream` module API
+ * as it is currently defined. (See `Compatibility` for more information.)
+ *
+ * When using an older Node.js library that emits `'data'` events and has a {@link pause} method that is advisory only, the`readable.wrap()` method can be used to create a `Readable`
+ * stream that uses
+ * the old stream as its data source.
+ *
+ * It will rarely be necessary to use `readable.wrap()` but the method has been
+ * provided as a convenience for interacting with older Node.js applications and
+ * libraries.
+ *
+ * ```js
+ * const { OldReader } = require('./old-api-module.js');
+ * const { Readable } = require('stream');
+ * const oreader = new OldReader();
+ * const myReader = new Readable().wrap(oreader);
+ *
+ * myReader.on('readable', () => {
+ * myReader.read(); // etc.
+ * });
+ * ```
+ * @since v0.9.4
+ * @param stream An "old style" readable stream
+ */
+ wrap(stream: NodeJS.ReadableStream): this;
+ push(chunk: any, encoding?: BufferEncoding): boolean;
+ /**
+ * The iterator created by this method gives users the option to cancel the destruction
+ * of the stream if the `for await...of` loop is exited by `return`, `break`, or `throw`,
+ * or if the iterator should destroy the stream if the stream emitted an error during iteration.
+ * @since v16.3.0
+ * @param options.destroyOnReturn When set to `false`, calling `return` on the async iterator,
+ * or exiting a `for await...of` iteration using a `break`, `return`, or `throw` will not destroy the stream.
+ * **Default: `true`**.
+ */
+ iterator(options?: { destroyOnReturn?: boolean }): AsyncIterableIterator<any>;
+ /**
+ * This method allows mapping over the stream. The *fn* function will be called for every chunk in the stream.
+ * If the *fn* function returns a promise - that promise will be `await`ed before being passed to the result stream.
+ * @since v17.4.0, v16.14.0
+ * @param fn a function to map over every chunk in the stream. Async or not.
+ * @returns a stream mapped with the function *fn*.
+ */
+ map(fn: (data: any, options?: Pick<ArrayOptions, "signal">) => any, options?: ArrayOptions): Readable;
+ /**
+ * This method allows filtering the stream. For each chunk in the stream the *fn* function will be called
+ * and if it returns a truthy value, the chunk will be passed to the result stream.
+ * If the *fn* function returns a promise - that promise will be `await`ed.
+ * @since v17.4.0, v16.14.0
+ * @param fn a function to filter chunks from the stream. Async or not.
+ * @returns a stream filtered with the predicate *fn*.
+ */
+ filter(
+ fn: (data: any, options?: Pick<ArrayOptions, "signal">) => boolean | Promise<boolean>,
+ options?: ArrayOptions,
+ ): Readable;
+ /**
+ * This method allows iterating a stream. For each chunk in the stream the *fn* function will be called.
+ * If the *fn* function returns a promise - that promise will be `await`ed.
+ *
+ * This method is different from `for await...of` loops in that it can optionally process chunks concurrently.
+ * In addition, a `forEach` iteration can only be stopped by having passed a `signal` option
+ * and aborting the related AbortController while `for await...of` can be stopped with `break` or `return`.
+ * In either case the stream will be destroyed.
+ *
+ * This method is different from listening to the `'data'` event in that it uses the `readable` event
+ * in the underlying machinary and can limit the number of concurrent *fn* calls.
+ * @since v17.5.0
+ * @param fn a function to call on each chunk of the stream. Async or not.
+ * @returns a promise for when the stream has finished.
+ */
+ forEach(
+ fn: (data: any, options?: Pick<ArrayOptions, "signal">) => void | Promise<void>,
+ options?: ArrayOptions,
+ ): Promise<void>;
+ /**
+ * This method allows easily obtaining the contents of a stream.
+ *
+ * As this method reads the entire stream into memory, it negates the benefits of streams. It's intended
+ * for interoperability and convenience, not as the primary way to consume streams.
+ * @since v17.5.0
+ * @returns a promise containing an array with the contents of the stream.
+ */
+ toArray(options?: Pick<ArrayOptions, "signal">): Promise<any[]>;
+ /**
+ * This method is similar to `Array.prototype.some` and calls *fn* on each chunk in the stream
+ * until the awaited return value is `true` (or any truthy value). Once an *fn* call on a chunk
+ * `await`ed return value is truthy, the stream is destroyed and the promise is fulfilled with `true`.
+ * If none of the *fn* calls on the chunks return a truthy value, the promise is fulfilled with `false`.
+ * @since v17.5.0
+ * @param fn a function to call on each chunk of the stream. Async or not.
+ * @returns a promise evaluating to `true` if *fn* returned a truthy value for at least one of the chunks.
+ */
+ some(
+ fn: (data: any, options?: Pick<ArrayOptions, "signal">) => boolean | Promise<boolean>,
+ options?: ArrayOptions,
+ ): Promise<boolean>;
+ /**
+ * This method is similar to `Array.prototype.find` and calls *fn* on each chunk in the stream
+ * to find a chunk with a truthy value for *fn*. Once an *fn* call's awaited return value is truthy,
+ * the stream is destroyed and the promise is fulfilled with value for which *fn* returned a truthy value.
+ * If all of the *fn* calls on the chunks return a falsy value, the promise is fulfilled with `undefined`.
+ * @since v17.5.0
+ * @param fn a function to call on each chunk of the stream. Async or not.
+ * @returns a promise evaluating to the first chunk for which *fn* evaluated with a truthy value,
+ * or `undefined` if no element was found.
+ */
+ find<T>(
+ fn: (data: any, options?: Pick<ArrayOptions, "signal">) => data is T,
+ options?: ArrayOptions,
+ ): Promise<T | undefined>;
+ find(
+ fn: (data: any, options?: Pick<ArrayOptions, "signal">) => boolean | Promise<boolean>,
+ options?: ArrayOptions,
+ ): Promise<any>;
+ /**
+ * This method is similar to `Array.prototype.every` and calls *fn* on each chunk in the stream
+ * to check if all awaited return values are truthy value for *fn*. Once an *fn* call on a chunk
+ * `await`ed return value is falsy, the stream is destroyed and the promise is fulfilled with `false`.
+ * If all of the *fn* calls on the chunks return a truthy value, the promise is fulfilled with `true`.
+ * @since v17.5.0
+ * @param fn a function to call on each chunk of the stream. Async or not.
+ * @returns a promise evaluating to `true` if *fn* returned a truthy value for every one of the chunks.
+ */
+ every(
+ fn: (data: any, options?: Pick<ArrayOptions, "signal">) => boolean | Promise<boolean>,
+ options?: ArrayOptions,
+ ): Promise<boolean>;
+ /**
+ * This method returns a new stream by applying the given callback to each chunk of the stream
+ * and then flattening the result.
+ *
+ * It is possible to return a stream or another iterable or async iterable from *fn* and the result streams
+ * will be merged (flattened) into the returned stream.
+ * @since v17.5.0
+ * @param fn a function to map over every chunk in the stream. May be async. May be a stream or generator.
+ * @returns a stream flat-mapped with the function *fn*.
+ */
+ flatMap(fn: (data: any, options?: Pick<ArrayOptions, "signal">) => any, options?: ArrayOptions): Readable;
+ /**
+ * This method returns a new stream with the first *limit* chunks dropped from the start.
+ * @since v17.5.0
+ * @param limit the number of chunks to drop from the readable.
+ * @returns a stream with *limit* chunks dropped from the start.
+ */
+ drop(limit: number, options?: Pick<ArrayOptions, "signal">): Readable;
+ /**
+ * This method returns a new stream with the first *limit* chunks.
+ * @since v17.5.0
+ * @param limit the number of chunks to take from the readable.
+ * @returns a stream with *limit* chunks taken.
+ */
+ take(limit: number, options?: Pick<ArrayOptions, "signal">): Readable;
+ /**
+ * This method returns a new stream with chunks of the underlying stream paired with a counter
+ * in the form `[index, chunk]`. The first index value is `0` and it increases by 1 for each chunk produced.
+ * @since v17.5.0
+ * @returns a stream of indexed pairs.
+ */
+ asIndexedPairs(options?: Pick<ArrayOptions, "signal">): Readable;
+ /**
+ * This method calls *fn* on each chunk of the stream in order, passing it the result from the calculation
+ * on the previous element. It returns a promise for the final value of the reduction.
+ *
+ * If no *initial* value is supplied the first chunk of the stream is used as the initial value.
+ * If the stream is empty, the promise is rejected with a `TypeError` with the `ERR_INVALID_ARGS` code property.
+ *
+ * The reducer function iterates the stream element-by-element which means that there is no *concurrency* parameter
+ * or parallelism. To perform a reduce concurrently, you can extract the async function to `readable.map` method.
+ * @since v17.5.0
+ * @param fn a reducer function to call over every chunk in the stream. Async or not.
+ * @param initial the initial value to use in the reduction.
+ * @returns a promise for the final value of the reduction.
+ */
+ reduce<T = any>(
+ fn: (previous: any, data: any, options?: Pick<ArrayOptions, "signal">) => T,
+ initial?: undefined,
+ options?: Pick<ArrayOptions, "signal">,
+ ): Promise<T>;
+ reduce<T = any>(
+ fn: (previous: T, data: any, options?: Pick<ArrayOptions, "signal">) => T,
+ initial: T,
+ options?: Pick<ArrayOptions, "signal">,
+ ): Promise<T>;
+ _destroy(error: Error | null, callback: (error?: Error | null) => void): void;
+ /**
+ * Destroy the stream. Optionally emit an `'error'` event, and emit a `'close'`event (unless `emitClose` is set to `false`). After this call, the readable
+ * stream will release any internal resources and subsequent calls to `push()`will be ignored.
+ *
+ * Once `destroy()` has been called any further calls will be a no-op and no
+ * further errors except from `_destroy()` may be emitted as `'error'`.
+ *
+ * Implementors should not override this method, but instead implement `readable._destroy()`.
+ * @since v8.0.0
+ * @param error Error which will be passed as payload in `'error'` event
+ */
+ destroy(error?: Error): this;
+ /**
+ * Event emitter
+ * The defined events on documents including:
+ * 1. close
+ * 2. data
+ * 3. end
+ * 4. error
+ * 5. pause
+ * 6. readable
+ * 7. resume
+ */
+ addListener(event: "close", listener: () => void): this;
+ addListener(event: "data", listener: (chunk: any) => void): this;
+ addListener(event: "end", listener: () => void): this;
+ addListener(event: "error", listener: (err: Error) => void): this;
+ addListener(event: "pause", listener: () => void): this;
+ addListener(event: "readable", listener: () => void): this;
+ addListener(event: "resume", listener: () => void): this;
+ addListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ emit(event: "close"): boolean;
+ emit(event: "data", chunk: any): boolean;
+ emit(event: "end"): boolean;
+ emit(event: "error", err: Error): boolean;
+ emit(event: "pause"): boolean;
+ emit(event: "readable"): boolean;
+ emit(event: "resume"): boolean;
+ emit(event: string | symbol, ...args: any[]): boolean;
+ on(event: "close", listener: () => void): this;
+ on(event: "data", listener: (chunk: any) => void): this;
+ on(event: "end", listener: () => void): this;
+ on(event: "error", listener: (err: Error) => void): this;
+ on(event: "pause", listener: () => void): this;
+ on(event: "readable", listener: () => void): this;
+ on(event: "resume", listener: () => void): this;
+ on(event: string | symbol, listener: (...args: any[]) => void): this;
+ once(event: "close", listener: () => void): this;
+ once(event: "data", listener: (chunk: any) => void): this;
+ once(event: "end", listener: () => void): this;
+ once(event: "error", listener: (err: Error) => void): this;
+ once(event: "pause", listener: () => void): this;
+ once(event: "readable", listener: () => void): this;
+ once(event: "resume", listener: () => void): this;
+ once(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependListener(event: "close", listener: () => void): this;
+ prependListener(event: "data", listener: (chunk: any) => void): this;
+ prependListener(event: "end", listener: () => void): this;
+ prependListener(event: "error", listener: (err: Error) => void): this;
+ prependListener(event: "pause", listener: () => void): this;
+ prependListener(event: "readable", listener: () => void): this;
+ prependListener(event: "resume", listener: () => void): this;
+ prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependOnceListener(event: "close", listener: () => void): this;
+ prependOnceListener(event: "data", listener: (chunk: any) => void): this;
+ prependOnceListener(event: "end", listener: () => void): this;
+ prependOnceListener(event: "error", listener: (err: Error) => void): this;
+ prependOnceListener(event: "pause", listener: () => void): this;
+ prependOnceListener(event: "readable", listener: () => void): this;
+ prependOnceListener(event: "resume", listener: () => void): this;
+ prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ removeListener(event: "close", listener: () => void): this;
+ removeListener(event: "data", listener: (chunk: any) => void): this;
+ removeListener(event: "end", listener: () => void): this;
+ removeListener(event: "error", listener: (err: Error) => void): this;
+ removeListener(event: "pause", listener: () => void): this;
+ removeListener(event: "readable", listener: () => void): this;
+ removeListener(event: "resume", listener: () => void): this;
+ removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ [Symbol.asyncIterator](): AsyncIterableIterator<any>;
+ /**
+ * Calls `readable.destroy()` with an `AbortError` and returns a promise that fulfills when the stream is finished.
+ * @since v18.18.0
+ */
+ [Symbol.asyncDispose](): Promise<void>;
+ }
+ interface WritableOptions extends StreamOptions<Writable> {
+ decodeStrings?: boolean | undefined;
+ defaultEncoding?: BufferEncoding | undefined;
+ write?(
+ this: Writable,
+ chunk: any,
+ encoding: BufferEncoding,
+ callback: (error?: Error | null) => void,
+ ): void;
+ writev?(
+ this: Writable,
+ chunks: Array<{
+ chunk: any;
+ encoding: BufferEncoding;
+ }>,
+ callback: (error?: Error | null) => void,
+ ): void;
+ final?(this: Writable, callback: (error?: Error | null) => void): void;
+ }
+ /**
+ * @since v0.9.4
+ */
+ class Writable extends Stream implements NodeJS.WritableStream {
+ /**
+ * A utility method for creating a `Writable` from a web `WritableStream`.
+ * @since v17.0.0
+ * @experimental
+ */
+ static fromWeb(
+ writableStream: streamWeb.WritableStream,
+ options?: Pick<WritableOptions, "decodeStrings" | "highWaterMark" | "objectMode" | "signal">,
+ ): Writable;
+ /**
+ * A utility method for creating a web `WritableStream` from a `Writable`.
+ * @since v17.0.0
+ * @experimental
+ */
+ static toWeb(streamWritable: Writable): streamWeb.WritableStream;
+ /**
+ * Is `true` if it is safe to call `writable.write()`, which means
+ * the stream has not been destroyed, errored or ended.
+ * @since v11.4.0
+ */
+ readonly writable: boolean;
+ /**
+ * Is `true` after `writable.end()` has been called. This property
+ * does not indicate whether the data has been flushed, for this use `writable.writableFinished` instead.
+ * @since v12.9.0
+ */
+ readonly writableEnded: boolean;
+ /**
+ * Is set to `true` immediately before the `'finish'` event is emitted.
+ * @since v12.6.0
+ */
+ readonly writableFinished: boolean;
+ /**
+ * Return the value of `highWaterMark` passed when creating this `Writable`.
+ * @since v9.3.0
+ */
+ readonly writableHighWaterMark: number;
+ /**
+ * This property contains the number of bytes (or objects) in the queue
+ * ready to be written. The value provides introspection data regarding
+ * the status of the `highWaterMark`.
+ * @since v9.4.0
+ */
+ readonly writableLength: number;
+ /**
+ * Getter for the property `objectMode` of a given `Writable` stream.
+ * @since v12.3.0
+ */
+ readonly writableObjectMode: boolean;
+ /**
+ * Number of times `writable.uncork()` needs to be
+ * called in order to fully uncork the stream.
+ * @since v13.2.0, v12.16.0
+ */
+ readonly writableCorked: number;
+ /**
+ * Is `true` after `writable.destroy()` has been called.
+ * @since v8.0.0
+ */
+ destroyed: boolean;
+ /**
+ * Is true after 'close' has been emitted.
+ * @since v18.0.0
+ */
+ readonly closed: boolean;
+ /**
+ * Returns error if the stream has been destroyed with an error.
+ * @since v18.0.0
+ */
+ readonly errored: Error | null;
+ /**
+ * Is `true` if the stream's buffer has been full and stream will emit 'drain'.
+ * @since v15.2.0, v14.17.0
+ */
+ readonly writableNeedDrain: boolean;
+ constructor(opts?: WritableOptions);
+ _write(chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void;
+ _writev?(
+ chunks: Array<{
+ chunk: any;
+ encoding: BufferEncoding;
+ }>,
+ callback: (error?: Error | null) => void,
+ ): void;
+ _construct?(callback: (error?: Error | null) => void): void;
+ _destroy(error: Error | null, callback: (error?: Error | null) => void): void;
+ _final(callback: (error?: Error | null) => void): void;
+ /**
+ * The `writable.write()` method writes some data to the stream, and calls the
+ * supplied `callback` once the data has been fully handled. If an error
+ * occurs, the `callback` will be called with the error as its
+ * first argument. The `callback` is called asynchronously and before `'error'` is
+ * emitted.
+ *
+ * The return value is `true` if the internal buffer is less than the`highWaterMark` configured when the stream was created after admitting `chunk`.
+ * If `false` is returned, further attempts to write data to the stream should
+ * stop until the `'drain'` event is emitted.
+ *
+ * While a stream is not draining, calls to `write()` will buffer `chunk`, and
+ * return false. Once all currently buffered chunks are drained (accepted for
+ * delivery by the operating system), the `'drain'` event will be emitted.
+ * Once `write()` returns false, do not write more chunks
+ * until the `'drain'` event is emitted. While calling `write()` on a stream that
+ * is not draining is allowed, Node.js will buffer all written chunks until
+ * maximum memory usage occurs, at which point it will abort unconditionally.
+ * Even before it aborts, high memory usage will cause poor garbage collector
+ * performance and high RSS (which is not typically released back to the system,
+ * even after the memory is no longer required). Since TCP sockets may never
+ * drain if the remote peer does not read the data, writing a socket that is
+ * not draining may lead to a remotely exploitable vulnerability.
+ *
+ * Writing data while the stream is not draining is particularly
+ * problematic for a `Transform`, because the `Transform` streams are paused
+ * by default until they are piped or a `'data'` or `'readable'` event handler
+ * is added.
+ *
+ * If the data to be written can be generated or fetched on demand, it is
+ * recommended to encapsulate the logic into a `Readable` and use {@link pipe}. However, if calling `write()` is preferred, it is
+ * possible to respect backpressure and avoid memory issues using the `'drain'` event:
+ *
+ * ```js
+ * function write(data, cb) {
+ * if (!stream.write(data)) {
+ * stream.once('drain', cb);
+ * } else {
+ * process.nextTick(cb);
+ * }
+ * }
+ *
+ * // Wait for cb to be called before doing any other write.
+ * write('hello', () => {
+ * console.log('Write completed, do more writes now.');
+ * });
+ * ```
+ *
+ * A `Writable` stream in object mode will always ignore the `encoding` argument.
+ * @since v0.9.4
+ * @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a string, `Buffer` or `Uint8Array`. For object mode streams, `chunk` may be any
+ * JavaScript value other than `null`.
+ * @param [encoding='utf8'] The encoding, if `chunk` is a string.
+ * @param callback Callback for when this chunk of data is flushed.
+ * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
+ */
+ write(chunk: any, callback?: (error: Error | null | undefined) => void): boolean;
+ write(chunk: any, encoding: BufferEncoding, callback?: (error: Error | null | undefined) => void): boolean;
+ /**
+ * The `writable.setDefaultEncoding()` method sets the default `encoding` for a `Writable` stream.
+ * @since v0.11.15
+ * @param encoding The new default encoding
+ */
+ setDefaultEncoding(encoding: BufferEncoding): this;
+ /**
+ * Calling the `writable.end()` method signals that no more data will be written
+ * to the `Writable`. The optional `chunk` and `encoding` arguments allow one
+ * final additional chunk of data to be written immediately before closing the
+ * stream.
+ *
+ * Calling the {@link write} method after calling {@link end} will raise an error.
+ *
+ * ```js
+ * // Write 'hello, ' and then end with 'world!'.
+ * const fs = require('fs');
+ * const file = fs.createWriteStream('example.txt');
+ * file.write('hello, ');
+ * file.end('world!');
+ * // Writing more now is not allowed!
+ * ```
+ * @since v0.9.4
+ * @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a string, `Buffer` or `Uint8Array`. For object mode streams, `chunk` may be any
+ * JavaScript value other than `null`.
+ * @param encoding The encoding if `chunk` is a string
+ * @param callback Callback for when the stream is finished.
+ */
+ end(cb?: () => void): this;
+ end(chunk: any, cb?: () => void): this;
+ end(chunk: any, encoding: BufferEncoding, cb?: () => void): this;
+ /**
+ * The `writable.cork()` method forces all written data to be buffered in memory.
+ * The buffered data will be flushed when either the {@link uncork} or {@link end} methods are called.
+ *
+ * The primary intent of `writable.cork()` is to accommodate a situation in which
+ * several small chunks are written to the stream in rapid succession. Instead of
+ * immediately forwarding them to the underlying destination, `writable.cork()`buffers all the chunks until `writable.uncork()` is called, which will pass them
+ * all to `writable._writev()`, if present. This prevents a head-of-line blocking
+ * situation where data is being buffered while waiting for the first small chunk
+ * to be processed. However, use of `writable.cork()` without implementing`writable._writev()` may have an adverse effect on throughput.
+ *
+ * See also: `writable.uncork()`, `writable._writev()`.
+ * @since v0.11.2
+ */
+ cork(): void;
+ /**
+ * The `writable.uncork()` method flushes all data buffered since {@link cork} was called.
+ *
+ * When using `writable.cork()` and `writable.uncork()` to manage the buffering
+ * of writes to a stream, defer calls to `writable.uncork()` using`process.nextTick()`. Doing so allows batching of all`writable.write()` calls that occur within a given Node.js event
+ * loop phase.
+ *
+ * ```js
+ * stream.cork();
+ * stream.write('some ');
+ * stream.write('data ');
+ * process.nextTick(() => stream.uncork());
+ * ```
+ *
+ * If the `writable.cork()` method is called multiple times on a stream, the
+ * same number of calls to `writable.uncork()` must be called to flush the buffered
+ * data.
+ *
+ * ```js
+ * stream.cork();
+ * stream.write('some ');
+ * stream.cork();
+ * stream.write('data ');
+ * process.nextTick(() => {
+ * stream.uncork();
+ * // The data will not be flushed until uncork() is called a second time.
+ * stream.uncork();
+ * });
+ * ```
+ *
+ * See also: `writable.cork()`.
+ * @since v0.11.2
+ */
+ uncork(): void;
+ /**
+ * Destroy the stream. Optionally emit an `'error'` event, and emit a `'close'`event (unless `emitClose` is set to `false`). After this call, the writable
+ * stream has ended and subsequent calls to `write()` or `end()` will result in
+ * an `ERR_STREAM_DESTROYED` error.
+ * This is a destructive and immediate way to destroy a stream. Previous calls to`write()` may not have drained, and may trigger an `ERR_STREAM_DESTROYED` error.
+ * Use `end()` instead of destroy if data should flush before close, or wait for
+ * the `'drain'` event before destroying the stream.
+ *
+ * Once `destroy()` has been called any further calls will be a no-op and no
+ * further errors except from `_destroy()` may be emitted as `'error'`.
+ *
+ * Implementors should not override this method,
+ * but instead implement `writable._destroy()`.
+ * @since v8.0.0
+ * @param error Optional, an error to emit with `'error'` event.
+ */
+ destroy(error?: Error): this;
+ /**
+ * Event emitter
+ * The defined events on documents including:
+ * 1. close
+ * 2. drain
+ * 3. error
+ * 4. finish
+ * 5. pipe
+ * 6. unpipe
+ */
+ addListener(event: "close", listener: () => void): this;
+ addListener(event: "drain", listener: () => void): this;
+ addListener(event: "error", listener: (err: Error) => void): this;
+ addListener(event: "finish", listener: () => void): this;
+ addListener(event: "pipe", listener: (src: Readable) => void): this;
+ addListener(event: "unpipe", listener: (src: Readable) => void): this;
+ addListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ emit(event: "close"): boolean;
+ emit(event: "drain"): boolean;
+ emit(event: "error", err: Error): boolean;
+ emit(event: "finish"): boolean;
+ emit(event: "pipe", src: Readable): boolean;
+ emit(event: "unpipe", src: Readable): boolean;
+ emit(event: string | symbol, ...args: any[]): boolean;
+ on(event: "close", listener: () => void): this;
+ on(event: "drain", listener: () => void): this;
+ on(event: "error", listener: (err: Error) => void): this;
+ on(event: "finish", listener: () => void): this;
+ on(event: "pipe", listener: (src: Readable) => void): this;
+ on(event: "unpipe", listener: (src: Readable) => void): this;
+ on(event: string | symbol, listener: (...args: any[]) => void): this;
+ once(event: "close", listener: () => void): this;
+ once(event: "drain", listener: () => void): this;
+ once(event: "error", listener: (err: Error) => void): this;
+ once(event: "finish", listener: () => void): this;
+ once(event: "pipe", listener: (src: Readable) => void): this;
+ once(event: "unpipe", listener: (src: Readable) => void): this;
+ once(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependListener(event: "close", listener: () => void): this;
+ prependListener(event: "drain", listener: () => void): this;
+ prependListener(event: "error", listener: (err: Error) => void): this;
+ prependListener(event: "finish", listener: () => void): this;
+ prependListener(event: "pipe", listener: (src: Readable) => void): this;
+ prependListener(event: "unpipe", listener: (src: Readable) => void): this;
+ prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependOnceListener(event: "close", listener: () => void): this;
+ prependOnceListener(event: "drain", listener: () => void): this;
+ prependOnceListener(event: "error", listener: (err: Error) => void): this;
+ prependOnceListener(event: "finish", listener: () => void): this;
+ prependOnceListener(event: "pipe", listener: (src: Readable) => void): this;
+ prependOnceListener(event: "unpipe", listener: (src: Readable) => void): this;
+ prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ removeListener(event: "close", listener: () => void): this;
+ removeListener(event: "drain", listener: () => void): this;
+ removeListener(event: "error", listener: (err: Error) => void): this;
+ removeListener(event: "finish", listener: () => void): this;
+ removeListener(event: "pipe", listener: (src: Readable) => void): this;
+ removeListener(event: "unpipe", listener: (src: Readable) => void): this;
+ removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ }
+ interface DuplexOptions extends ReadableOptions, WritableOptions {
+ allowHalfOpen?: boolean | undefined;
+ readableObjectMode?: boolean | undefined;
+ writableObjectMode?: boolean | undefined;
+ readableHighWaterMark?: number | undefined;
+ writableHighWaterMark?: number | undefined;
+ writableCorked?: number | undefined;
+ construct?(this: Duplex, callback: (error?: Error | null) => void): void;
+ read?(this: Duplex, size: number): void;
+ write?(this: Duplex, chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void;
+ writev?(
+ this: Duplex,
+ chunks: Array<{
+ chunk: any;
+ encoding: BufferEncoding;
+ }>,
+ callback: (error?: Error | null) => void,
+ ): void;
+ final?(this: Duplex, callback: (error?: Error | null) => void): void;
+ destroy?(this: Duplex, error: Error | null, callback: (error: Error | null) => void): void;
+ }
+ /**
+ * Duplex streams are streams that implement both the `Readable` and `Writable` interfaces.
+ *
+ * Examples of `Duplex` streams include:
+ *
+ * * `TCP sockets`
+ * * `zlib streams`
+ * * `crypto streams`
+ * @since v0.9.4
+ */
+ class Duplex extends Readable implements Writable {
+ readonly writable: boolean;
+ readonly writableEnded: boolean;
+ readonly writableFinished: boolean;
+ readonly writableHighWaterMark: number;
+ readonly writableLength: number;
+ readonly writableObjectMode: boolean;
+ readonly writableCorked: number;
+ readonly writableNeedDrain: boolean;
+ readonly closed: boolean;
+ readonly errored: Error | null;
+ /**
+ * If `false` then the stream will automatically end the writable side when the
+ * readable side ends. Set initially by the `allowHalfOpen` constructor option,
+ * which defaults to `false`.
+ *
+ * This can be changed manually to change the half-open behavior of an existing`Duplex` stream instance, but must be changed before the `'end'` event is
+ * emitted.
+ * @since v0.9.4
+ */
+ allowHalfOpen: boolean;
+ constructor(opts?: DuplexOptions);
+ /**
+ * A utility method for creating duplex streams.
+ *
+ * - `Stream` converts writable stream into writable `Duplex` and readable stream
+ * to `Duplex`.
+ * - `Blob` converts into readable `Duplex`.
+ * - `string` converts into readable `Duplex`.
+ * - `ArrayBuffer` converts into readable `Duplex`.
+ * - `AsyncIterable` converts into a readable `Duplex`. Cannot yield `null`.
+ * - `AsyncGeneratorFunction` converts into a readable/writable transform
+ * `Duplex`. Must take a source `AsyncIterable` as first parameter. Cannot yield
+ * `null`.
+ * - `AsyncFunction` converts into a writable `Duplex`. Must return
+ * either `null` or `undefined`
+ * - `Object ({ writable, readable })` converts `readable` and
+ * `writable` into `Stream` and then combines them into `Duplex` where the
+ * `Duplex` will write to the `writable` and read from the `readable`.
+ * - `Promise` converts into readable `Duplex`. Value `null` is ignored.
+ *
+ * @since v16.8.0
+ */
+ static from(
+ src:
+ | Stream
+ | NodeBlob
+ | ArrayBuffer
+ | string
+ | Iterable<any>
+ | AsyncIterable<any>
+ | AsyncGeneratorFunction
+ | Promise<any>
+ | Object,
+ ): Duplex;
+ _write(chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void;
+ _writev?(
+ chunks: Array<{
+ chunk: any;
+ encoding: BufferEncoding;
+ }>,
+ callback: (error?: Error | null) => void,
+ ): void;
+ _destroy(error: Error | null, callback: (error: Error | null) => void): void;
+ _final(callback: (error?: Error | null) => void): void;
+ write(chunk: any, encoding?: BufferEncoding, cb?: (error: Error | null | undefined) => void): boolean;
+ write(chunk: any, cb?: (error: Error | null | undefined) => void): boolean;
+ setDefaultEncoding(encoding: BufferEncoding): this;
+ end(cb?: () => void): this;
+ end(chunk: any, cb?: () => void): this;
+ end(chunk: any, encoding?: BufferEncoding, cb?: () => void): this;
+ cork(): void;
+ uncork(): void;
+ /**
+ * Event emitter
+ * The defined events on documents including:
+ * 1. close
+ * 2. data
+ * 3. drain
+ * 4. end
+ * 5. error
+ * 6. finish
+ * 7. pause
+ * 8. pipe
+ * 9. readable
+ * 10. resume
+ * 11. unpipe
+ */
+ addListener(event: "close", listener: () => void): this;
+ addListener(event: "data", listener: (chunk: any) => void): this;
+ addListener(event: "drain", listener: () => void): this;
+ addListener(event: "end", listener: () => void): this;
+ addListener(event: "error", listener: (err: Error) => void): this;
+ addListener(event: "finish", listener: () => void): this;
+ addListener(event: "pause", listener: () => void): this;
+ addListener(event: "pipe", listener: (src: Readable) => void): this;
+ addListener(event: "readable", listener: () => void): this;
+ addListener(event: "resume", listener: () => void): this;
+ addListener(event: "unpipe", listener: (src: Readable) => void): this;
+ addListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ emit(event: "close"): boolean;
+ emit(event: "data", chunk: any): boolean;
+ emit(event: "drain"): boolean;
+ emit(event: "end"): boolean;
+ emit(event: "error", err: Error): boolean;
+ emit(event: "finish"): boolean;
+ emit(event: "pause"): boolean;
+ emit(event: "pipe", src: Readable): boolean;
+ emit(event: "readable"): boolean;
+ emit(event: "resume"): boolean;
+ emit(event: "unpipe", src: Readable): boolean;
+ emit(event: string | symbol, ...args: any[]): boolean;
+ on(event: "close", listener: () => void): this;
+ on(event: "data", listener: (chunk: any) => void): this;
+ on(event: "drain", listener: () => void): this;
+ on(event: "end", listener: () => void): this;
+ on(event: "error", listener: (err: Error) => void): this;
+ on(event: "finish", listener: () => void): this;
+ on(event: "pause", listener: () => void): this;
+ on(event: "pipe", listener: (src: Readable) => void): this;
+ on(event: "readable", listener: () => void): this;
+ on(event: "resume", listener: () => void): this;
+ on(event: "unpipe", listener: (src: Readable) => void): this;
+ on(event: string | symbol, listener: (...args: any[]) => void): this;
+ once(event: "close", listener: () => void): this;
+ once(event: "data", listener: (chunk: any) => void): this;
+ once(event: "drain", listener: () => void): this;
+ once(event: "end", listener: () => void): this;
+ once(event: "error", listener: (err: Error) => void): this;
+ once(event: "finish", listener: () => void): this;
+ once(event: "pause", listener: () => void): this;
+ once(event: "pipe", listener: (src: Readable) => void): this;
+ once(event: "readable", listener: () => void): this;
+ once(event: "resume", listener: () => void): this;
+ once(event: "unpipe", listener: (src: Readable) => void): this;
+ once(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependListener(event: "close", listener: () => void): this;
+ prependListener(event: "data", listener: (chunk: any) => void): this;
+ prependListener(event: "drain", listener: () => void): this;
+ prependListener(event: "end", listener: () => void): this;
+ prependListener(event: "error", listener: (err: Error) => void): this;
+ prependListener(event: "finish", listener: () => void): this;
+ prependListener(event: "pause", listener: () => void): this;
+ prependListener(event: "pipe", listener: (src: Readable) => void): this;
+ prependListener(event: "readable", listener: () => void): this;
+ prependListener(event: "resume", listener: () => void): this;
+ prependListener(event: "unpipe", listener: (src: Readable) => void): this;
+ prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependOnceListener(event: "close", listener: () => void): this;
+ prependOnceListener(event: "data", listener: (chunk: any) => void): this;
+ prependOnceListener(event: "drain", listener: () => void): this;
+ prependOnceListener(event: "end", listener: () => void): this;
+ prependOnceListener(event: "error", listener: (err: Error) => void): this;
+ prependOnceListener(event: "finish", listener: () => void): this;
+ prependOnceListener(event: "pause", listener: () => void): this;
+ prependOnceListener(event: "pipe", listener: (src: Readable) => void): this;
+ prependOnceListener(event: "readable", listener: () => void): this;
+ prependOnceListener(event: "resume", listener: () => void): this;
+ prependOnceListener(event: "unpipe", listener: (src: Readable) => void): this;
+ prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ removeListener(event: "close", listener: () => void): this;
+ removeListener(event: "data", listener: (chunk: any) => void): this;
+ removeListener(event: "drain", listener: () => void): this;
+ removeListener(event: "end", listener: () => void): this;
+ removeListener(event: "error", listener: (err: Error) => void): this;
+ removeListener(event: "finish", listener: () => void): this;
+ removeListener(event: "pause", listener: () => void): this;
+ removeListener(event: "pipe", listener: (src: Readable) => void): this;
+ removeListener(event: "readable", listener: () => void): this;
+ removeListener(event: "resume", listener: () => void): this;
+ removeListener(event: "unpipe", listener: (src: Readable) => void): this;
+ removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ }
+ type TransformCallback = (error?: Error | null, data?: any) => void;
+ interface TransformOptions extends DuplexOptions {
+ construct?(this: Transform, callback: (error?: Error | null) => void): void;
+ read?(this: Transform, size: number): void;
+ write?(
+ this: Transform,
+ chunk: any,
+ encoding: BufferEncoding,
+ callback: (error?: Error | null) => void,
+ ): void;
+ writev?(
+ this: Transform,
+ chunks: Array<{
+ chunk: any;
+ encoding: BufferEncoding;
+ }>,
+ callback: (error?: Error | null) => void,
+ ): void;
+ final?(this: Transform, callback: (error?: Error | null) => void): void;
+ destroy?(this: Transform, error: Error | null, callback: (error: Error | null) => void): void;
+ transform?(this: Transform, chunk: any, encoding: BufferEncoding, callback: TransformCallback): void;
+ flush?(this: Transform, callback: TransformCallback): void;
+ }
+ /**
+ * Transform streams are `Duplex` streams where the output is in some way
+ * related to the input. Like all `Duplex` streams, `Transform` streams
+ * implement both the `Readable` and `Writable` interfaces.
+ *
+ * Examples of `Transform` streams include:
+ *
+ * * `zlib streams`
+ * * `crypto streams`
+ * @since v0.9.4
+ */
+ class Transform extends Duplex {
+ constructor(opts?: TransformOptions);
+ _transform(chunk: any, encoding: BufferEncoding, callback: TransformCallback): void;
+ _flush(callback: TransformCallback): void;
+ }
+ /**
+ * The `stream.PassThrough` class is a trivial implementation of a `Transform` stream that simply passes the input bytes across to the output. Its purpose is
+ * primarily for examples and testing, but there are some use cases where`stream.PassThrough` is useful as a building block for novel sorts of streams.
+ */
+ class PassThrough extends Transform {}
+ /**
+ * Attaches an AbortSignal to a readable or writeable stream. This lets code
+ * control stream destruction using an `AbortController`.
+ *
+ * Calling `abort` on the `AbortController` corresponding to the passed`AbortSignal` will behave the same way as calling `.destroy(new AbortError())`on the stream.
+ *
+ * ```js
+ * const fs = require('fs');
+ *
+ * const controller = new AbortController();
+ * const read = addAbortSignal(
+ * controller.signal,
+ * fs.createReadStream(('object.json'))
+ * );
+ * // Later, abort the operation closing the stream
+ * controller.abort();
+ * ```
+ *
+ * Or using an `AbortSignal` with a readable stream as an async iterable:
+ *
+ * ```js
+ * const controller = new AbortController();
+ * setTimeout(() => controller.abort(), 10_000); // set a timeout
+ * const stream = addAbortSignal(
+ * controller.signal,
+ * fs.createReadStream(('object.json'))
+ * );
+ * (async () => {
+ * try {
+ * for await (const chunk of stream) {
+ * await process(chunk);
+ * }
+ * } catch (e) {
+ * if (e.name === 'AbortError') {
+ * // The operation was cancelled
+ * } else {
+ * throw e;
+ * }
+ * }
+ * })();
+ * ```
+ * @since v15.4.0
+ * @param signal A signal representing possible cancellation
+ * @param stream a stream to attach a signal to
+ */
+ function addAbortSignal<T extends Stream>(signal: AbortSignal, stream: T): T;
+ /**
+ * Returns the default highWaterMark used by streams.
+ * Defaults to `16384` (16 KiB), or `16` for `objectMode`.
+ * @since v18.17.0
+ * @param objectMode
+ */
+ function getDefaultHighWaterMark(objectMode: boolean): number;
+ /**
+ * Sets the default highWaterMark used by streams.
+ * @since v18.17.0
+ * @param objectMode
+ * @param value highWaterMark value
+ */
+ function setDefaultHighWaterMark(objectMode: boolean, value: number): void;
+ interface FinishedOptions extends Abortable {
+ error?: boolean | undefined;
+ readable?: boolean | undefined;
+ writable?: boolean | undefined;
+ }
+ /**
+ * A function to get notified when a stream is no longer readable, writable
+ * or has experienced an error or a premature close event.
+ *
+ * ```js
+ * const { finished } = require('stream');
+ *
+ * const rs = fs.createReadStream('archive.tar');
+ *
+ * finished(rs, (err) => {
+ * if (err) {
+ * console.error('Stream failed.', err);
+ * } else {
+ * console.log('Stream is done reading.');
+ * }
+ * });
+ *
+ * rs.resume(); // Drain the stream.
+ * ```
+ *
+ * Especially useful in error handling scenarios where a stream is destroyed
+ * prematurely (like an aborted HTTP request), and will not emit `'end'`or `'finish'`.
+ *
+ * The `finished` API provides promise version:
+ *
+ * ```js
+ * const { finished } = require('stream/promises');
+ *
+ * const rs = fs.createReadStream('archive.tar');
+ *
+ * async function run() {
+ * await finished(rs);
+ * console.log('Stream is done reading.');
+ * }
+ *
+ * run().catch(console.error);
+ * rs.resume(); // Drain the stream.
+ * ```
+ *
+ * `stream.finished()` leaves dangling event listeners (in particular`'error'`, `'end'`, `'finish'` and `'close'`) after `callback` has been
+ * invoked. The reason for this is so that unexpected `'error'` events (due to
+ * incorrect stream implementations) do not cause unexpected crashes.
+ * If this is unwanted behavior then the returned cleanup function needs to be
+ * invoked in the callback:
+ *
+ * ```js
+ * const cleanup = finished(rs, (err) => {
+ * cleanup();
+ * // ...
+ * });
+ * ```
+ * @since v10.0.0
+ * @param stream A readable and/or writable stream.
+ * @param callback A callback function that takes an optional error argument.
+ * @return A cleanup function which removes all registered listeners.
+ */
+ function finished(
+ stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream,
+ options: FinishedOptions,
+ callback: (err?: NodeJS.ErrnoException | null) => void,
+ ): () => void;
+ function finished(
+ stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream,
+ callback: (err?: NodeJS.ErrnoException | null) => void,
+ ): () => void;
+ namespace finished {
+ function __promisify__(
+ stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream,
+ options?: FinishedOptions,
+ ): Promise<void>;
+ }
+ type PipelineSourceFunction<T> = () => Iterable<T> | AsyncIterable<T>;
+ type PipelineSource<T> = Iterable<T> | AsyncIterable<T> | NodeJS.ReadableStream | PipelineSourceFunction<T>;
+ type PipelineTransform<S extends PipelineTransformSource<any>, U> =
+ | NodeJS.ReadWriteStream
+ | ((
+ source: S extends (...args: any[]) => Iterable<infer ST> | AsyncIterable<infer ST> ? AsyncIterable<ST>
+ : S,
+ ) => AsyncIterable<U>);
+ type PipelineTransformSource<T> = PipelineSource<T> | PipelineTransform<any, T>;
+ type PipelineDestinationIterableFunction<T> = (source: AsyncIterable<T>) => AsyncIterable<any>;
+ type PipelineDestinationPromiseFunction<T, P> = (source: AsyncIterable<T>) => Promise<P>;
+ type PipelineDestination<S extends PipelineTransformSource<any>, P> = S extends
+ PipelineTransformSource<infer ST> ?
+ | NodeJS.WritableStream
+ | PipelineDestinationIterableFunction<ST>
+ | PipelineDestinationPromiseFunction<ST, P>
+ : never;
+ type PipelineCallback<S extends PipelineDestination<any, any>> = S extends
+ PipelineDestinationPromiseFunction<any, infer P> ? (err: NodeJS.ErrnoException | null, value: P) => void
+ : (err: NodeJS.ErrnoException | null) => void;
+ type PipelinePromise<S extends PipelineDestination<any, any>> = S extends
+ PipelineDestinationPromiseFunction<any, infer P> ? Promise<P> : Promise<void>;
+ interface PipelineOptions {
+ signal?: AbortSignal | undefined;
+ end?: boolean | undefined;
+ }
+ /**
+ * A module method to pipe between streams and generators forwarding errors and
+ * properly cleaning up and provide a callback when the pipeline is complete.
+ *
+ * ```js
+ * const { pipeline } = require('stream');
+ * const fs = require('fs');
+ * const zlib = require('zlib');
+ *
+ * // Use the pipeline API to easily pipe a series of streams
+ * // together and get notified when the pipeline is fully done.
+ *
+ * // A pipeline to gzip a potentially huge tar file efficiently:
+ *
+ * pipeline(
+ * fs.createReadStream('archive.tar'),
+ * zlib.createGzip(),
+ * fs.createWriteStream('archive.tar.gz'),
+ * (err) => {
+ * if (err) {
+ * console.error('Pipeline failed.', err);
+ * } else {
+ * console.log('Pipeline succeeded.');
+ * }
+ * }
+ * );
+ * ```
+ *
+ * The `pipeline` API provides a promise version, which can also
+ * receive an options argument as the last parameter with a`signal` `AbortSignal` property. When the signal is aborted,`destroy` will be called on the underlying pipeline, with
+ * an`AbortError`.
+ *
+ * ```js
+ * const { pipeline } = require('stream/promises');
+ *
+ * async function run() {
+ * await pipeline(
+ * fs.createReadStream('archive.tar'),
+ * zlib.createGzip(),
+ * fs.createWriteStream('archive.tar.gz')
+ * );
+ * console.log('Pipeline succeeded.');
+ * }
+ *
+ * run().catch(console.error);
+ * ```
+ *
+ * To use an `AbortSignal`, pass it inside an options object,
+ * as the last argument:
+ *
+ * ```js
+ * const { pipeline } = require('stream/promises');
+ *
+ * async function run() {
+ * const ac = new AbortController();
+ * const signal = ac.signal;
+ *
+ * setTimeout(() => ac.abort(), 1);
+ * await pipeline(
+ * fs.createReadStream('archive.tar'),
+ * zlib.createGzip(),
+ * fs.createWriteStream('archive.tar.gz'),
+ * { signal },
+ * );
+ * }
+ *
+ * run().catch(console.error); // AbortError
+ * ```
+ *
+ * The `pipeline` API also supports async generators:
+ *
+ * ```js
+ * const { pipeline } = require('stream/promises');
+ * const fs = require('fs');
+ *
+ * async function run() {
+ * await pipeline(
+ * fs.createReadStream('lowercase.txt'),
+ * async function* (source, { signal }) {
+ * source.setEncoding('utf8'); // Work with strings rather than `Buffer`s.
+ * for await (const chunk of source) {
+ * yield await processChunk(chunk, { signal });
+ * }
+ * },
+ * fs.createWriteStream('uppercase.txt')
+ * );
+ * console.log('Pipeline succeeded.');
+ * }
+ *
+ * run().catch(console.error);
+ * ```
+ *
+ * Remember to handle the `signal` argument passed into the async generator.
+ * Especially in the case where the async generator is the source for the
+ * pipeline (i.e. first argument) or the pipeline will never complete.
+ *
+ * ```js
+ * const { pipeline } = require('stream/promises');
+ * const fs = require('fs');
+ *
+ * async function run() {
+ * await pipeline(
+ * async function* ({ signal }) {
+ * await someLongRunningfn({ signal });
+ * yield 'asd';
+ * },
+ * fs.createWriteStream('uppercase.txt')
+ * );
+ * console.log('Pipeline succeeded.');
+ * }
+ *
+ * run().catch(console.error);
+ * ```
+ *
+ * `stream.pipeline()` will call `stream.destroy(err)` on all streams except:
+ *
+ * * `Readable` streams which have emitted `'end'` or `'close'`.
+ * * `Writable` streams which have emitted `'finish'` or `'close'`.
+ *
+ * `stream.pipeline()` leaves dangling event listeners on the streams
+ * after the `callback` has been invoked. In the case of reuse of streams after
+ * failure, this can cause event listener leaks and swallowed errors. If the last
+ * stream is readable, dangling event listeners will be removed so that the last
+ * stream can be consumed later.
+ *
+ * `stream.pipeline()` closes all the streams when an error is raised.
+ * The `IncomingRequest` usage with `pipeline` could lead to an unexpected behavior
+ * once it would destroy the socket without sending the expected response.
+ * See the example below:
+ *
+ * ```js
+ * const fs = require('fs');
+ * const http = require('http');
+ * const { pipeline } = require('stream');
+ *
+ * const server = http.createServer((req, res) => {
+ * const fileStream = fs.createReadStream('./fileNotExist.txt');
+ * pipeline(fileStream, res, (err) => {
+ * if (err) {
+ * console.log(err); // No such file
+ * // this message can't be sent once `pipeline` already destroyed the socket
+ * return res.end('error!!!');
+ * }
+ * });
+ * });
+ * ```
+ * @since v10.0.0
+ * @param callback Called when the pipeline is fully done.
+ */
+ function pipeline<A extends PipelineSource<any>, B extends PipelineDestination<A, any>>(
+ source: A,
+ destination: B,
+ callback?: PipelineCallback<B>,
+ ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream;
+ function pipeline<
+ A extends PipelineSource<any>,
+ T1 extends PipelineTransform<A, any>,
+ B extends PipelineDestination<T1, any>,
+ >(
+ source: A,
+ transform1: T1,
+ destination: B,
+ callback?: PipelineCallback<B>,
+ ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream;
+ function pipeline<
+ A extends PipelineSource<any>,
+ T1 extends PipelineTransform<A, any>,
+ T2 extends PipelineTransform<T1, any>,
+ B extends PipelineDestination<T2, any>,
+ >(
+ source: A,
+ transform1: T1,
+ transform2: T2,
+ destination: B,
+ callback?: PipelineCallback<B>,
+ ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream;
+ function pipeline<
+ A extends PipelineSource<any>,
+ T1 extends PipelineTransform<A, any>,
+ T2 extends PipelineTransform<T1, any>,
+ T3 extends PipelineTransform<T2, any>,
+ B extends PipelineDestination<T3, any>,
+ >(
+ source: A,
+ transform1: T1,
+ transform2: T2,
+ transform3: T3,
+ destination: B,
+ callback?: PipelineCallback<B>,
+ ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream;
+ function pipeline<
+ A extends PipelineSource<any>,
+ T1 extends PipelineTransform<A, any>,
+ T2 extends PipelineTransform<T1, any>,
+ T3 extends PipelineTransform<T2, any>,
+ T4 extends PipelineTransform<T3, any>,
+ B extends PipelineDestination<T4, any>,
+ >(
+ source: A,
+ transform1: T1,
+ transform2: T2,
+ transform3: T3,
+ transform4: T4,
+ destination: B,
+ callback?: PipelineCallback<B>,
+ ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream;
+ function pipeline(
+ streams: ReadonlyArray<NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream>,
+ callback?: (err: NodeJS.ErrnoException | null) => void,
+ ): NodeJS.WritableStream;
+ function pipeline(
+ stream1: NodeJS.ReadableStream,
+ stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream,
+ ...streams: Array<
+ NodeJS.ReadWriteStream | NodeJS.WritableStream | ((err: NodeJS.ErrnoException | null) => void)
+ >
+ ): NodeJS.WritableStream;
+ namespace pipeline {
+ function __promisify__<A extends PipelineSource<any>, B extends PipelineDestination<A, any>>(
+ source: A,
+ destination: B,
+ options?: PipelineOptions,
+ ): PipelinePromise<B>;
+ function __promisify__<
+ A extends PipelineSource<any>,
+ T1 extends PipelineTransform<A, any>,
+ B extends PipelineDestination<T1, any>,
+ >(
+ source: A,
+ transform1: T1,
+ destination: B,
+ options?: PipelineOptions,
+ ): PipelinePromise<B>;
+ function __promisify__<
+ A extends PipelineSource<any>,
+ T1 extends PipelineTransform<A, any>,
+ T2 extends PipelineTransform<T1, any>,
+ B extends PipelineDestination<T2, any>,
+ >(
+ source: A,
+ transform1: T1,
+ transform2: T2,
+ destination: B,
+ options?: PipelineOptions,
+ ): PipelinePromise<B>;
+ function __promisify__<
+ A extends PipelineSource<any>,
+ T1 extends PipelineTransform<A, any>,
+ T2 extends PipelineTransform<T1, any>,
+ T3 extends PipelineTransform<T2, any>,
+ B extends PipelineDestination<T3, any>,
+ >(
+ source: A,
+ transform1: T1,
+ transform2: T2,
+ transform3: T3,
+ destination: B,
+ options?: PipelineOptions,
+ ): PipelinePromise<B>;
+ function __promisify__<
+ A extends PipelineSource<any>,
+ T1 extends PipelineTransform<A, any>,
+ T2 extends PipelineTransform<T1, any>,
+ T3 extends PipelineTransform<T2, any>,
+ T4 extends PipelineTransform<T3, any>,
+ B extends PipelineDestination<T4, any>,
+ >(
+ source: A,
+ transform1: T1,
+ transform2: T2,
+ transform3: T3,
+ transform4: T4,
+ destination: B,
+ options?: PipelineOptions,
+ ): PipelinePromise<B>;
+ function __promisify__(
+ streams: ReadonlyArray<NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream>,
+ options?: PipelineOptions,
+ ): Promise<void>;
+ function __promisify__(
+ stream1: NodeJS.ReadableStream,
+ stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream,
+ ...streams: Array<NodeJS.ReadWriteStream | NodeJS.WritableStream | PipelineOptions>
+ ): Promise<void>;
+ }
+ interface Pipe {
+ close(): void;
+ hasRef(): boolean;
+ ref(): void;
+ unref(): void;
+ }
+
+ /**
+ * Returns whether the stream has encountered an error.
+ * @since v17.3.0
+ */
+ function isErrored(stream: Readable | Writable | NodeJS.ReadableStream | NodeJS.WritableStream): boolean;
+
+ /**
+ * Returns whether the stream is readable.
+ * @since v17.4.0
+ */
+ function isReadable(stream: Readable | NodeJS.ReadableStream): boolean;
+
+ const promises: typeof streamPromises;
+ const consumers: typeof streamConsumers;
+ }
+ export = internal;
+}
+declare module "node:stream" {
+ import stream = require("stream");
+ export = stream;
+}
diff --git a/client/node_modules/@types/node/ts4.8/stream/consumers.d.ts b/client/node_modules/@types/node/ts4.8/stream/consumers.d.ts
new file mode 100644
index 0000000..5ad9cba
--- /dev/null
+++ b/client/node_modules/@types/node/ts4.8/stream/consumers.d.ts
@@ -0,0 +1,12 @@
+declare module "stream/consumers" {
+ import { Blob as NodeBlob } from "node:buffer";
+ import { Readable } from "node:stream";
+ function buffer(stream: NodeJS.ReadableStream | Readable | AsyncIterable<any>): Promise<Buffer>;
+ function text(stream: NodeJS.ReadableStream | Readable | AsyncIterable<any>): Promise<string>;
+ function arrayBuffer(stream: NodeJS.ReadableStream | Readable | AsyncIterable<any>): Promise<ArrayBuffer>;
+ function blob(stream: NodeJS.ReadableStream | Readable | AsyncIterable<any>): Promise<NodeBlob>;
+ function json(stream: NodeJS.ReadableStream | Readable | AsyncIterable<any>): Promise<unknown>;
+}
+declare module "node:stream/consumers" {
+ export * from "stream/consumers";
+}
diff --git a/client/node_modules/@types/node/ts4.8/stream/promises.d.ts b/client/node_modules/@types/node/ts4.8/stream/promises.d.ts
new file mode 100644
index 0000000..6eac5b7
--- /dev/null
+++ b/client/node_modules/@types/node/ts4.8/stream/promises.d.ts
@@ -0,0 +1,83 @@
+declare module "stream/promises" {
+ import {
+ FinishedOptions,
+ PipelineDestination,
+ PipelineOptions,
+ PipelinePromise,
+ PipelineSource,
+ PipelineTransform,
+ } from "node:stream";
+ function finished(
+ stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream,
+ options?: FinishedOptions,
+ ): Promise<void>;
+ function pipeline<A extends PipelineSource<any>, B extends PipelineDestination<A, any>>(
+ source: A,
+ destination: B,
+ options?: PipelineOptions,
+ ): PipelinePromise<B>;
+ function pipeline<
+ A extends PipelineSource<any>,
+ T1 extends PipelineTransform<A, any>,
+ B extends PipelineDestination<T1, any>,
+ >(
+ source: A,
+ transform1: T1,
+ destination: B,
+ options?: PipelineOptions,
+ ): PipelinePromise<B>;
+ function pipeline<
+ A extends PipelineSource<any>,
+ T1 extends PipelineTransform<A, any>,
+ T2 extends PipelineTransform<T1, any>,
+ B extends PipelineDestination<T2, any>,
+ >(
+ source: A,
+ transform1: T1,
+ transform2: T2,
+ destination: B,
+ options?: PipelineOptions,
+ ): PipelinePromise<B>;
+ function pipeline<
+ A extends PipelineSource<any>,
+ T1 extends PipelineTransform<A, any>,
+ T2 extends PipelineTransform<T1, any>,
+ T3 extends PipelineTransform<T2, any>,
+ B extends PipelineDestination<T3, any>,
+ >(
+ source: A,
+ transform1: T1,
+ transform2: T2,
+ transform3: T3,
+ destination: B,
+ options?: PipelineOptions,
+ ): PipelinePromise<B>;
+ function pipeline<
+ A extends PipelineSource<any>,
+ T1 extends PipelineTransform<A, any>,
+ T2 extends PipelineTransform<T1, any>,
+ T3 extends PipelineTransform<T2, any>,
+ T4 extends PipelineTransform<T3, any>,
+ B extends PipelineDestination<T4, any>,
+ >(
+ source: A,
+ transform1: T1,
+ transform2: T2,
+ transform3: T3,
+ transform4: T4,
+ destination: B,
+ options?: PipelineOptions,
+ ): PipelinePromise<B>;
+ function pipeline(
+ streams: ReadonlyArray<NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream>,
+ options?: PipelineOptions,
+ ): Promise<void>;
+ function pipeline(
+ stream1: NodeJS.ReadableStream,
+ stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream,
+ ...streams: Array<NodeJS.ReadWriteStream | NodeJS.WritableStream | PipelineOptions>
+ ): Promise<void>;
+}
+declare module "node:stream/promises" {
+ export * from "stream/promises";
+}
diff --git a/client/node_modules/@types/node/ts4.8/stream/web.d.ts b/client/node_modules/@types/node/ts4.8/stream/web.d.ts
new file mode 100644
index 0000000..634936e
--- /dev/null
+++ b/client/node_modules/@types/node/ts4.8/stream/web.d.ts
@@ -0,0 +1,336 @@
+declare module "stream/web" {
+ // stub module, pending copy&paste from .d.ts or manual impl
+ // copy from lib.dom.d.ts
+ interface ReadableWritablePair<R = any, W = any> {
+ readable: ReadableStream<R>;
+ /**
+ * Provides a convenient, chainable way of piping this readable stream
+ * through a transform stream (or any other { writable, readable }
+ * pair). It simply pipes the stream into the writable side of the
+ * supplied pair, and returns the readable side for further use.
+ *
+ * Piping a stream will lock it for the duration of the pipe, preventing
+ * any other consumer from acquiring a reader.
+ */
+ writable: WritableStream<W>;
+ }
+ interface StreamPipeOptions {
+ preventAbort?: boolean;
+ preventCancel?: boolean;
+ /**
+ * Pipes this readable stream to a given writable stream destination.
+ * The way in which the piping process behaves under various error
+ * conditions can be customized with a number of passed options. It
+ * returns a promise that fulfills when the piping process completes
+ * successfully, or rejects if any errors were encountered.
+ *
+ * Piping a stream will lock it for the duration of the pipe, preventing
+ * any other consumer from acquiring a reader.
+ *
+ * Errors and closures of the source and destination streams propagate
+ * as follows:
+ *
+ * An error in this source readable stream will abort destination,
+ * unless preventAbort is truthy. The returned promise will be rejected
+ * with the source's error, or with any error that occurs during
+ * aborting the destination.
+ *
+ * An error in destination will cancel this source readable stream,
+ * unless preventCancel is truthy. The returned promise will be rejected
+ * with the destination's error, or with any error that occurs during
+ * canceling the source.
+ *
+ * When this source readable stream closes, destination will be closed,
+ * unless preventClose is truthy. The returned promise will be fulfilled
+ * once this process completes, unless an error is encountered while
+ * closing the destination, in which case it will be rejected with that
+ * error.
+ *
+ * If destination starts out closed or closing, this source readable
+ * stream will be canceled, unless preventCancel is true. The returned
+ * promise will be rejected with an error indicating piping to a closed
+ * stream failed, or with any error that occurs during canceling the
+ * source.
+ *
+ * The signal option can be set to an AbortSignal to allow aborting an
+ * ongoing pipe operation via the corresponding AbortController. In this
+ * case, this source readable stream will be canceled, and destination
+ * aborted, unless the respective options preventCancel or preventAbort
+ * are set.
+ */
+ preventClose?: boolean;
+ signal?: AbortSignal;
+ }
+ interface ReadableStreamGenericReader {
+ readonly closed: Promise<undefined>;
+ cancel(reason?: any): Promise<void>;
+ }
+ interface ReadableStreamDefaultReadValueResult<T> {
+ done: false;
+ value: T;
+ }
+ interface ReadableStreamDefaultReadDoneResult {
+ done: true;
+ value?: undefined;
+ }
+ type ReadableStreamController<T> = ReadableStreamDefaultController<T>;
+ type ReadableStreamDefaultReadResult<T> =
+ | ReadableStreamDefaultReadValueResult<T>
+ | ReadableStreamDefaultReadDoneResult;
+ interface ReadableByteStreamControllerCallback {
+ (controller: ReadableByteStreamController): void | PromiseLike<void>;
+ }
+ interface UnderlyingSinkAbortCallback {
+ (reason?: any): void | PromiseLike<void>;
+ }
+ interface UnderlyingSinkCloseCallback {
+ (): void | PromiseLike<void>;
+ }
+ interface UnderlyingSinkStartCallback {
+ (controller: WritableStreamDefaultController): any;
+ }
+ interface UnderlyingSinkWriteCallback<W> {
+ (chunk: W, controller: WritableStreamDefaultController): void | PromiseLike<void>;
+ }
+ interface UnderlyingSourceCancelCallback {
+ (reason?: any): void | PromiseLike<void>;
+ }
+ interface UnderlyingSourcePullCallback<R> {
+ (controller: ReadableStreamController<R>): void | PromiseLike<void>;
+ }
+ interface UnderlyingSourceStartCallback<R> {
+ (controller: ReadableStreamController<R>): any;
+ }
+ interface TransformerFlushCallback<O> {
+ (controller: TransformStreamDefaultController<O>): void | PromiseLike<void>;
+ }
+ interface TransformerStartCallback<O> {
+ (controller: TransformStreamDefaultController<O>): any;
+ }
+ interface TransformerTransformCallback<I, O> {
+ (chunk: I, controller: TransformStreamDefaultController<O>): void | PromiseLike<void>;
+ }
+ interface UnderlyingByteSource {
+ autoAllocateChunkSize?: number;
+ cancel?: ReadableStreamErrorCallback;
+ pull?: ReadableByteStreamControllerCallback;
+ start?: ReadableByteStreamControllerCallback;
+ type: "bytes";
+ }
+ interface UnderlyingSource<R = any> {
+ cancel?: UnderlyingSourceCancelCallback;
+ pull?: UnderlyingSourcePullCallback<R>;
+ start?: UnderlyingSourceStartCallback<R>;
+ type?: undefined;
+ }
+ interface UnderlyingSink<W = any> {
+ abort?: UnderlyingSinkAbortCallback;
+ close?: UnderlyingSinkCloseCallback;
+ start?: UnderlyingSinkStartCallback;
+ type?: undefined;
+ write?: UnderlyingSinkWriteCallback<W>;
+ }
+ interface ReadableStreamErrorCallback {
+ (reason: any): void | PromiseLike<void>;
+ }
+ /** This Streams API interface represents a readable stream of byte data. */
+ interface ReadableStream<R = any> {
+ readonly locked: boolean;
+ cancel(reason?: any): Promise<void>;
+ getReader(): ReadableStreamDefaultReader<R>;
+ pipeThrough<T>(transform: ReadableWritablePair<T, R>, options?: StreamPipeOptions): ReadableStream<T>;
+ pipeTo(destination: WritableStream<R>, options?: StreamPipeOptions): Promise<void>;
+ tee(): [ReadableStream<R>, ReadableStream<R>];
+ values(options?: { preventCancel?: boolean }): AsyncIterableIterator<R>;
+ [Symbol.asyncIterator](): AsyncIterableIterator<R>;
+ }
+ const ReadableStream: {
+ prototype: ReadableStream;
+ new(underlyingSource: UnderlyingByteSource, strategy?: QueuingStrategy<Uint8Array>): ReadableStream<Uint8Array>;
+ new<R = any>(underlyingSource?: UnderlyingSource<R>, strategy?: QueuingStrategy<R>): ReadableStream<R>;
+ };
+ interface ReadableStreamDefaultReader<R = any> extends ReadableStreamGenericReader {
+ read(): Promise<ReadableStreamDefaultReadResult<R>>;
+ releaseLock(): void;
+ }
+ const ReadableStreamDefaultReader: {
+ prototype: ReadableStreamDefaultReader;
+ new<R = any>(stream: ReadableStream<R>): ReadableStreamDefaultReader<R>;
+ };
+ const ReadableStreamBYOBReader: any;
+ const ReadableStreamBYOBRequest: any;
+ interface ReadableByteStreamController {
+ readonly byobRequest: undefined;
+ readonly desiredSize: number | null;
+ close(): void;
+ enqueue(chunk: ArrayBufferView): void;
+ error(error?: any): void;
+ }
+ const ReadableByteStreamController: {
+ prototype: ReadableByteStreamController;
+ new(): ReadableByteStreamController;
+ };
+ interface ReadableStreamDefaultController<R = any> {
+ readonly desiredSize: number | null;
+ close(): void;
+ enqueue(chunk?: R): void;
+ error(e?: any): void;
+ }
+ const ReadableStreamDefaultController: {
+ prototype: ReadableStreamDefaultController;
+ new(): ReadableStreamDefaultController;
+ };
+ interface Transformer<I = any, O = any> {
+ flush?: TransformerFlushCallback<O>;
+ readableType?: undefined;
+ start?: TransformerStartCallback<O>;
+ transform?: TransformerTransformCallback<I, O>;
+ writableType?: undefined;
+ }
+ interface TransformStream<I = any, O = any> {
+ readonly readable: ReadableStream<O>;
+ readonly writable: WritableStream<I>;
+ }
+ const TransformStream: {
+ prototype: TransformStream;
+ new<I = any, O = any>(
+ transformer?: Transformer<I, O>,
+ writableStrategy?: QueuingStrategy<I>,
+ readableStrategy?: QueuingStrategy<O>,
+ ): TransformStream<I, O>;
+ };
+ interface TransformStreamDefaultController<O = any> {
+ readonly desiredSize: number | null;
+ enqueue(chunk?: O): void;
+ error(reason?: any): void;
+ terminate(): void;
+ }
+ const TransformStreamDefaultController: {
+ prototype: TransformStreamDefaultController;
+ new(): TransformStreamDefaultController;
+ };
+ /**
+ * This Streams API interface provides a standard abstraction for writing
+ * streaming data to a destination, known as a sink. This object comes with
+ * built-in back pressure and queuing.
+ */
+ interface WritableStream<W = any> {
+ readonly locked: boolean;
+ abort(reason?: any): Promise<void>;
+ close(): Promise<void>;
+ getWriter(): WritableStreamDefaultWriter<W>;
+ }
+ const WritableStream: {
+ prototype: WritableStream;
+ new<W = any>(underlyingSink?: UnderlyingSink<W>, strategy?: QueuingStrategy<W>): WritableStream<W>;
+ };
+ /**
+ * This Streams API interface is the object returned by
+ * WritableStream.getWriter() and once created locks the < writer to the
+ * WritableStream ensuring that no other streams can write to the underlying
+ * sink.
+ */
+ interface WritableStreamDefaultWriter<W = any> {
+ readonly closed: Promise<undefined>;
+ readonly desiredSize: number | null;
+ readonly ready: Promise<undefined>;
+ abort(reason?: any): Promise<void>;
+ close(): Promise<void>;
+ releaseLock(): void;
+ write(chunk?: W): Promise<void>;
+ }
+ const WritableStreamDefaultWriter: {
+ prototype: WritableStreamDefaultWriter;
+ new<W = any>(stream: WritableStream<W>): WritableStreamDefaultWriter<W>;
+ };
+ /**
+ * This Streams API interface represents a controller allowing control of a
+ * WritableStream's state. When constructing a WritableStream, the
+ * underlying sink is given a corresponding WritableStreamDefaultController
+ * instance to manipulate.
+ */
+ interface WritableStreamDefaultController {
+ error(e?: any): void;
+ }
+ const WritableStreamDefaultController: {
+ prototype: WritableStreamDefaultController;
+ new(): WritableStreamDefaultController;
+ };
+ interface QueuingStrategy<T = any> {
+ highWaterMark?: number;
+ size?: QueuingStrategySize<T>;
+ }
+ interface QueuingStrategySize<T = any> {
+ (chunk?: T): number;
+ }
+ interface QueuingStrategyInit {
+ /**
+ * Creates a new ByteLengthQueuingStrategy with the provided high water
+ * mark.
+ *
+ * Note that the provided high water mark will not be validated ahead of
+ * time. Instead, if it is negative, NaN, or not a number, the resulting
+ * ByteLengthQueuingStrategy will cause the corresponding stream
+ * constructor to throw.
+ */
+ highWaterMark: number;
+ }
+ /**
+ * This Streams API interface provides a built-in byte length queuing
+ * strategy that can be used when constructing streams.
+ */
+ interface ByteLengthQueuingStrategy extends QueuingStrategy<ArrayBufferView> {
+ readonly highWaterMark: number;
+ readonly size: QueuingStrategySize<ArrayBufferView>;
+ }
+ const ByteLengthQueuingStrategy: {
+ prototype: ByteLengthQueuingStrategy;
+ new(init: QueuingStrategyInit): ByteLengthQueuingStrategy;
+ };
+ /**
+ * This Streams API interface provides a built-in byte length queuing
+ * strategy that can be used when constructing streams.
+ */
+ interface CountQueuingStrategy extends QueuingStrategy {
+ readonly highWaterMark: number;
+ readonly size: QueuingStrategySize;
+ }
+ const CountQueuingStrategy: {
+ prototype: CountQueuingStrategy;
+ new(init: QueuingStrategyInit): CountQueuingStrategy;
+ };
+ interface TextEncoderStream {
+ /** Returns "utf-8". */
+ readonly encoding: "utf-8";
+ readonly readable: ReadableStream<Uint8Array>;
+ readonly writable: WritableStream<string>;
+ readonly [Symbol.toStringTag]: string;
+ }
+ const TextEncoderStream: {
+ prototype: TextEncoderStream;
+ new(): TextEncoderStream;
+ };
+ interface TextDecoderOptions {
+ fatal?: boolean;
+ ignoreBOM?: boolean;
+ }
+ type BufferSource = ArrayBufferView | ArrayBuffer;
+ interface TextDecoderStream {
+ /** Returns encoding's name, lower cased. */
+ readonly encoding: string;
+ /** Returns `true` if error mode is "fatal", and `false` otherwise. */
+ readonly fatal: boolean;
+ /** Returns `true` if ignore BOM flag is set, and `false` otherwise. */
+ readonly ignoreBOM: boolean;
+ readonly readable: ReadableStream<string>;
+ readonly writable: WritableStream<BufferSource>;
+ readonly [Symbol.toStringTag]: string;
+ }
+ const TextDecoderStream: {
+ prototype: TextDecoderStream;
+ new(label?: string, options?: TextDecoderOptions): TextDecoderStream;
+ };
+}
+declare module "node:stream/web" {
+ export * from "stream/web";
+}
diff --git a/client/node_modules/@types/node/ts4.8/string_decoder.d.ts b/client/node_modules/@types/node/ts4.8/string_decoder.d.ts
new file mode 100644
index 0000000..e9a8cc2
--- /dev/null
+++ b/client/node_modules/@types/node/ts4.8/string_decoder.d.ts
@@ -0,0 +1,67 @@
+/**
+ * The `string_decoder` module provides an API for decoding `Buffer` objects into
+ * strings in a manner that preserves encoded multi-byte UTF-8 and UTF-16
+ * characters. It can be accessed using:
+ *
+ * ```js
+ * const { StringDecoder } = require('string_decoder');
+ * ```
+ *
+ * The following example shows the basic use of the `StringDecoder` class.
+ *
+ * ```js
+ * const { StringDecoder } = require('string_decoder');
+ * const decoder = new StringDecoder('utf8');
+ *
+ * const cent = Buffer.from([0xC2, 0xA2]);
+ * console.log(decoder.write(cent));
+ *
+ * const euro = Buffer.from([0xE2, 0x82, 0xAC]);
+ * console.log(decoder.write(euro));
+ * ```
+ *
+ * When a `Buffer` instance is written to the `StringDecoder` instance, an
+ * internal buffer is used to ensure that the decoded string does not contain
+ * any incomplete multibyte characters. These are held in the buffer until the
+ * next call to `stringDecoder.write()` or until `stringDecoder.end()` is called.
+ *
+ * In the following example, the three UTF-8 encoded bytes of the European Euro
+ * symbol (`€`) are written over three separate operations:
+ *
+ * ```js
+ * const { StringDecoder } = require('string_decoder');
+ * const decoder = new StringDecoder('utf8');
+ *
+ * decoder.write(Buffer.from([0xE2]));
+ * decoder.write(Buffer.from([0x82]));
+ * console.log(decoder.end(Buffer.from([0xAC])));
+ * ```
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/string_decoder.js)
+ */
+declare module "string_decoder" {
+ class StringDecoder {
+ constructor(encoding?: BufferEncoding);
+ /**
+ * Returns a decoded string, ensuring that any incomplete multibyte characters at
+ * the end of the `Buffer`, or `TypedArray`, or `DataView` are omitted from the
+ * returned string and stored in an internal buffer for the next call to`stringDecoder.write()` or `stringDecoder.end()`.
+ * @since v0.1.99
+ * @param buffer A `Buffer`, or `TypedArray`, or `DataView` containing the bytes to decode.
+ */
+ write(buffer: Buffer): string;
+ /**
+ * Returns any remaining input stored in the internal buffer as a string. Bytes
+ * representing incomplete UTF-8 and UTF-16 characters will be replaced with
+ * substitution characters appropriate for the character encoding.
+ *
+ * If the `buffer` argument is provided, one final call to `stringDecoder.write()`is performed before returning the remaining input.
+ * After `end()` is called, the `stringDecoder` object can be reused for new input.
+ * @since v0.9.3
+ * @param buffer A `Buffer`, or `TypedArray`, or `DataView` containing the bytes to decode.
+ */
+ end(buffer?: Buffer): string;
+ }
+}
+declare module "node:string_decoder" {
+ export * from "string_decoder";
+}
diff --git a/client/node_modules/@types/node/ts4.8/test.d.ts b/client/node_modules/@types/node/ts4.8/test.d.ts
new file mode 100644
index 0000000..99b9cce
--- /dev/null
+++ b/client/node_modules/@types/node/ts4.8/test.d.ts
@@ -0,0 +1,974 @@
+/**
+ * The `node:test` module provides a standalone testing module.
+ * @see [source](https://github.com/nodejs/node/blob/v18.x/lib/test.js)
+ */
+declare module "node:test" {
+ import { AsyncResource } from "node:async_hooks";
+ /**
+ * Programmatically start the test runner.
+ * @since v18.9.0
+ * @param options Configuration options for running tests.
+ * @returns A {@link TestsStream} that emits events about the test execution.
+ */
+ function run(options?: RunOptions): TestsStream;
+ /**
+ * The `test()` function is the value imported from the test module. Each invocation of this
+ * function results in reporting the test to the {@link TestsStream}.
+ *
+ * The {@link TestContext} object passed to the fn argument can be used to perform actions
+ * related to the current test. Examples include skipping the test, adding additional
+ * diagnostic information, or creating subtests.
+ *
+ * `test()` returns a {@link Promise} that resolves once the test completes. The return value
+ * can usually be discarded for top level tests. However, the return value from subtests should
+ * be used to prevent the parent test from finishing first and cancelling the subtest as shown
+ * in the following example.
+ *
+ * ```js
+ * test('top level test', async (t) => {
+ * // The setTimeout() in the following subtest would cause it to outlive its
+ * // parent test if 'await' is removed on the next line. Once the parent test
+ * // completes, it will cancel any outstanding subtests.
+ * await t.test('longer running subtest', async (t) => {
+ * return new Promise((resolve, reject) => {
+ * setTimeout(resolve, 1000);
+ * });
+ * });
+ * });
+ * ```
+ * @since v18.0.0
+ * @param name The name of the test, which is displayed when reporting test results.
+ * Default: The `name` property of fn, or `'<anonymous>'` if `fn` does not have a name.
+ * @param options Configuration options for the test
+ * @param fn The function under test. The first argument to this function is a
+ * {@link TestContext} object. If the test uses callbacks, the callback function is
+ * passed as the second argument. Default: A no-op function.
+ * @returns A {@link Promise} resolved with `undefined` once the test completes.
+ */
+ function test(name?: string, fn?: TestFn): Promise<void>;
+ function test(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
+ function test(options?: TestOptions, fn?: TestFn): Promise<void>;
+ function test(fn?: TestFn): Promise<void>;
+ namespace test {
+ export { after, afterEach, before, beforeEach, describe, it, mock, only, run, skip, test, todo };
+ }
+ /**
+ * @since v18.6.0
+ * @param name The name of the suite, which is displayed when reporting suite results.
+ * Default: The `name` property of fn, or `'<anonymous>'` if `fn` does not have a name.
+ * @param options Configuration options for the suite
+ * @param fn The function under suite. Default: A no-op function.
+ */
+ function describe(name?: string, options?: TestOptions, fn?: SuiteFn): Promise<void>;
+ function describe(name?: string, fn?: SuiteFn): Promise<void>;
+ function describe(options?: TestOptions, fn?: SuiteFn): Promise<void>;
+ function describe(fn?: SuiteFn): Promise<void>;
+ namespace describe {
+ /**
+ * Shorthand for skipping a suite, same as `describe([name], { skip: true }[, fn])`.
+ */
+ function skip(name?: string, options?: TestOptions, fn?: SuiteFn): Promise<void>;
+ function skip(name?: string, fn?: SuiteFn): Promise<void>;
+ function skip(options?: TestOptions, fn?: SuiteFn): Promise<void>;
+ function skip(fn?: SuiteFn): Promise<void>;
+ /**
+ * Shorthand for marking a suite as `TODO`, same as `describe([name], { todo: true }[, fn])`.
+ */
+ function todo(name?: string, options?: TestOptions, fn?: SuiteFn): Promise<void>;
+ function todo(name?: string, fn?: SuiteFn): Promise<void>;
+ function todo(options?: TestOptions, fn?: SuiteFn): Promise<void>;
+ function todo(fn?: SuiteFn): Promise<void>;
+ /**
+ * Shorthand for marking a suite as `only`, same as `describe([name], { only: true }[, fn])`.
+ * @since v18.15.0
+ */
+ function only(name?: string, options?: TestOptions, fn?: SuiteFn): Promise<void>;
+ function only(name?: string, fn?: SuiteFn): Promise<void>;
+ function only(options?: TestOptions, fn?: SuiteFn): Promise<void>;
+ function only(fn?: SuiteFn): Promise<void>;
+ }
+
+ /**
+ * @since v18.6.0
+ * @param name The name of the test, which is displayed when reporting test results.
+ * Default: The `name` property of fn, or `'<anonymous>'` if `fn` does not have a name.
+ * @param options Configuration options for the test
+ * @param fn The function under test. If the test uses callbacks, the callback function is
+ * passed as the second argument. Default: A no-op function.
+ */
+ function it(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
+ function it(name?: string, fn?: TestFn): Promise<void>;
+ function it(options?: TestOptions, fn?: TestFn): Promise<void>;
+ function it(fn?: TestFn): Promise<void>;
+ namespace it {
+ /**
+ * Shorthand for skipping a test, same as `it([name], { skip: true }[, fn])`.
+ */
+ function skip(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
+ function skip(name?: string, fn?: TestFn): Promise<void>;
+ function skip(options?: TestOptions, fn?: TestFn): Promise<void>;
+ function skip(fn?: TestFn): Promise<void>;
+ /**
+ * Shorthand for marking a test as `TODO`, same as `it([name], { todo: true }[, fn])`.
+ */
+ function todo(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
+ function todo(name?: string, fn?: TestFn): Promise<void>;
+ function todo(options?: TestOptions, fn?: TestFn): Promise<void>;
+ function todo(fn?: TestFn): Promise<void>;
+ /**
+ * Shorthand for marking a test as `only`, same as `it([name], { only: true }[, fn])`.
+ * @since v18.15.0
+ */
+ function only(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
+ function only(name?: string, fn?: TestFn): Promise<void>;
+ function only(options?: TestOptions, fn?: TestFn): Promise<void>;
+ function only(fn?: TestFn): Promise<void>;
+ }
+ /**
+ * Shorthand for skipping a test, same as `test([name], { skip: true }[, fn])`.
+ * @since v18.17.0
+ */
+ function skip(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
+ function skip(name?: string, fn?: TestFn): Promise<void>;
+ function skip(options?: TestOptions, fn?: TestFn): Promise<void>;
+ function skip(fn?: TestFn): Promise<void>;
+ /**
+ * Shorthand for marking a test as `TODO`, same as `test([name], { todo: true }[, fn])`.
+ * @since v18.17.0
+ */
+ function todo(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
+ function todo(name?: string, fn?: TestFn): Promise<void>;
+ function todo(options?: TestOptions, fn?: TestFn): Promise<void>;
+ function todo(fn?: TestFn): Promise<void>;
+ /**
+ * Shorthand for marking a test as `only`, same as `test([name], { only: true }[, fn])`.
+ * @since v18.17.0
+ */
+ function only(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
+ function only(name?: string, fn?: TestFn): Promise<void>;
+ function only(options?: TestOptions, fn?: TestFn): Promise<void>;
+ function only(fn?: TestFn): Promise<void>;
+
+ /**
+ * The type of a function under test. The first argument to this function is a
+ * {@link TestContext} object. If the test uses callbacks, the callback function is passed as
+ * the second argument.
+ */
+ type TestFn = (t: TestContext, done: (result?: any) => void) => any;
+
+ /**
+ * The type of a function under Suite.
+ */
+ type SuiteFn = (s: SuiteContext) => void | Promise<void>;
+
+ interface RunOptions {
+ /**
+ * If a number is provided, then that many files would run in parallel.
+ * If truthy, it would run (number of cpu cores - 1) files in parallel.
+ * If falsy, it would only run one file at a time.
+ * If unspecified, subtests inherit this value from their parent.
+ * @default true
+ */
+ concurrency?: number | boolean | undefined;
+
+ /**
+ * An array containing the list of files to run.
+ * If unspecified, the test runner execution model will be used.
+ */
+ files?: readonly string[] | undefined;
+
+ /**
+ * Allows aborting an in-progress test execution.
+ * @default undefined
+ */
+ signal?: AbortSignal | undefined;
+
+ /**
+ * A number of milliseconds the test will fail after.
+ * If unspecified, subtests inherit this value from their parent.
+ * @default Infinity
+ */
+ timeout?: number | undefined;
+
+ /**
+ * Sets inspector port of test child process.
+ * If a nullish value is provided, each process gets its own port,
+ * incremented from the primary's `process.debugPort`.
+ */
+ inspectPort?: number | (() => number) | undefined;
+ /**
+ * That can be used to only run tests whose name matches the provided pattern.
+ * Test name patterns are interpreted as JavaScript regular expressions.
+ * For each test that is executed, any corresponding test hooks, such as `beforeEach()`, are also run.
+ */
+ testNamePatterns?: string | RegExp | string[] | RegExp[];
+ /**
+ * A function that accepts the TestsStream instance and can be used to setup listeners before any tests are run.
+ */
+ setup?: (root: Test) => void | Promise<void>;
+ /**
+ * Whether to run in watch mode or not.
+ * @default false
+ */
+ watch?: boolean | undefined;
+ }
+ class Test extends AsyncResource {
+ concurrency: number;
+ nesting: number;
+ only: boolean;
+ reporter: TestsStream;
+ runOnlySubtests: boolean;
+ testNumber: number;
+ timeout: number | null;
+ }
+
+ /**
+ * A successful call of the `run()` method will return a new `TestsStream` object,
+ * streaming a series of events representing the execution of the tests.
+ * `TestsStream` will emit events in the order of the tests' definitions.
+ * @since v18.9.0
+ */
+ interface TestsStream extends NodeJS.ReadableStream {
+ addListener(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this;
+ addListener(event: "test:fail", listener: (data: TestFail) => void): this;
+ addListener(event: "test:pass", listener: (data: TestPass) => void): this;
+ addListener(event: "test:plan", listener: (data: TestPlan) => void): this;
+ addListener(event: "test:start", listener: (data: TestStart) => void): this;
+ addListener(event: "test:stderr", listener: (data: TestStderr) => void): this;
+ addListener(event: "test:stdout", listener: (data: TestStdout) => void): this;
+ addListener(event: string, listener: (...args: any[]) => void): this;
+ emit(event: "test:diagnostic", data: DiagnosticData): boolean;
+ emit(event: "test:fail", data: TestFail): boolean;
+ emit(event: "test:pass", data: TestPass): boolean;
+ emit(event: "test:plan", data: TestPlan): boolean;
+ emit(event: "test:start", data: TestStart): boolean;
+ emit(event: "test:stderr", data: TestStderr): boolean;
+ emit(event: "test:stdout", data: TestStdout): boolean;
+ emit(event: string | symbol, ...args: any[]): boolean;
+ on(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this;
+ on(event: "test:fail", listener: (data: TestFail) => void): this;
+ on(event: "test:pass", listener: (data: TestPass) => void): this;
+ on(event: "test:plan", listener: (data: TestPlan) => void): this;
+ on(event: "test:start", listener: (data: TestStart) => void): this;
+ on(event: "test:stderr", listener: (data: TestStderr) => void): this;
+ on(event: "test:stdout", listener: (data: TestStdout) => void): this;
+ on(event: string, listener: (...args: any[]) => void): this;
+ once(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this;
+ once(event: "test:fail", listener: (data: TestFail) => void): this;
+ once(event: "test:pass", listener: (data: TestPass) => void): this;
+ once(event: "test:plan", listener: (data: TestPlan) => void): this;
+ once(event: "test:start", listener: (data: TestStart) => void): this;
+ once(event: "test:stderr", listener: (data: TestStderr) => void): this;
+ once(event: "test:stdout", listener: (data: TestStdout) => void): this;
+ once(event: string, listener: (...args: any[]) => void): this;
+ prependListener(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this;
+ prependListener(event: "test:fail", listener: (data: TestFail) => void): this;
+ prependListener(event: "test:pass", listener: (data: TestPass) => void): this;
+ prependListener(event: "test:plan", listener: (data: TestPlan) => void): this;
+ prependListener(event: "test:start", listener: (data: TestStart) => void): this;
+ prependListener(event: "test:stderr", listener: (data: TestStderr) => void): this;
+ prependListener(event: "test:stdout", listener: (data: TestStdout) => void): this;
+ prependListener(event: string, listener: (...args: any[]) => void): this;
+ prependOnceListener(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this;
+ prependOnceListener(event: "test:fail", listener: (data: TestFail) => void): this;
+ prependOnceListener(event: "test:pass", listener: (data: TestPass) => void): this;
+ prependOnceListener(event: "test:plan", listener: (data: TestPlan) => void): this;
+ prependOnceListener(event: "test:start", listener: (data: TestStart) => void): this;
+ prependOnceListener(event: "test:stderr", listener: (data: TestStderr) => void): this;
+ prependOnceListener(event: "test:stdout", listener: (data: TestStdout) => void): this;
+ prependOnceListener(event: string, listener: (...args: any[]) => void): this;
+ }
+
+ /**
+ * An instance of `TestContext` is passed to each test function in order to interact with the
+ * test runner. However, the `TestContext` constructor is not exposed as part of the API.
+ * @since v18.0.0
+ */
+ interface TestContext {
+ /**
+ * This function is used to create a hook running before subtest of the current test.
+ * @param fn The hook function. If the hook uses callbacks, the callback function is passed as
+ * the second argument. Default: A no-op function.
+ * @param options Configuration options for the hook.
+ * @since v18.17.0
+ */
+ before: typeof before;
+
+ /**
+ * This function is used to create a hook running before each subtest of the current test.
+ * @param fn The hook function. If the hook uses callbacks, the callback function is passed as
+ * the second argument. Default: A no-op function.
+ * @param options Configuration options for the hook.
+ * @since v18.8.0
+ */
+ beforeEach: typeof beforeEach;
+
+ /**
+ * This function is used to create a hook that runs after the current test finishes.
+ * @param fn The hook function. If the hook uses callbacks, the callback function is passed as
+ * the second argument. Default: A no-op function.
+ * @param options Configuration options for the hook.
+ * @since v18.13.0
+ */
+ after: typeof after;
+
+ /**
+ * This function is used to create a hook running after each subtest of the current test.
+ * @param fn The hook function. If the hook uses callbacks, the callback function is passed as
+ * the second argument. Default: A no-op function.
+ * @param options Configuration options for the hook.
+ * @since v18.8.0
+ */
+ afterEach: typeof afterEach;
+
+ /**
+ * This function is used to write diagnostics to the output. Any diagnostic information is
+ * included at the end of the test's results. This function does not return a value.
+ * @param message Message to be reported.
+ * @since v18.0.0
+ */
+ diagnostic(message: string): void;
+
+ /**
+ * The name of the test.
+ * @since v18.8.0
+ */
+ readonly name: string;
+
+ /**
+ * If `shouldRunOnlyTests` is truthy, the test context will only run tests that have the `only`
+ * option set. Otherwise, all tests are run. If Node.js was not started with the `--test-only`
+ * command-line option, this function is a no-op.
+ * @param shouldRunOnlyTests Whether or not to run `only` tests.
+ * @since v18.0.0
+ */
+ runOnly(shouldRunOnlyTests: boolean): void;
+
+ /**
+ * Can be used to abort test subtasks when the test has been aborted.
+ * @since v18.7.0
+ */
+ readonly signal: AbortSignal;
+
+ /**
+ * This function causes the test's output to indicate the test as skipped. If `message` is
+ * provided, it is included in the output. Calling `skip()` does not terminate execution of
+ * the test function. This function does not return a value.
+ * @param message Optional skip message.
+ * @since v18.0.0
+ */
+ skip(message?: string): void;
+
+ /**
+ * This function adds a `TODO` directive to the test's output. If `message` is provided, it is
+ * included in the output. Calling `todo()` does not terminate execution of the test
+ * function. This function does not return a value.
+ * @param message Optional `TODO` message.
+ * @since v18.0.0
+ */
+ todo(message?: string): void;
+
+ /**
+ * This function is used to create subtests under the current test. This function behaves in
+ * the same fashion as the top level {@link test} function.
+ * @since v18.0.0
+ * @param name The name of the test, which is displayed when reporting test results.
+ * Default: The `name` property of fn, or `'<anonymous>'` if `fn` does not have a name.
+ * @param options Configuration options for the test
+ * @param fn The function under test. This first argument to this function is a
+ * {@link TestContext} object. If the test uses callbacks, the callback function is
+ * passed as the second argument. Default: A no-op function.
+ * @returns A {@link Promise} resolved with `undefined` once the test completes.
+ */
+ test: typeof test;
+ /**
+ * Each test provides its own MockTracker instance.
+ */
+ readonly mock: MockTracker;
+ }
+
+ /**
+ * An instance of `SuiteContext` is passed to each suite function in order to
+ * interact with the test runner. However, the `SuiteContext` constructor is not
+ * exposed as part of the API.
+ * @since v18.7.0, v16.17.0
+ */
+ class SuiteContext {
+ /**
+ * The name of the suite.
+ * @since v18.8.0, v16.18.0
+ */
+ readonly name: string;
+ /**
+ * Can be used to abort test subtasks when the test has been aborted.
+ * @since v18.7.0, v16.17.0
+ */
+ readonly signal: AbortSignal;
+ }
+ interface TestOptions {
+ /**
+ * If a number is provided, then that many tests would run in parallel.
+ * If truthy, it would run (number of cpu cores - 1) tests in parallel.
+ * For subtests, it will be `Infinity` tests in parallel.
+ * If falsy, it would only run one test at a time.
+ * If unspecified, subtests inherit this value from their parent.
+ * @default false
+ */
+ concurrency?: number | boolean | undefined;
+
+ /**
+ * If truthy, and the test context is configured to run `only` tests, then this test will be
+ * run. Otherwise, the test is skipped.
+ * @default false
+ */
+ only?: boolean | undefined;
+
+ /**
+ * Allows aborting an in-progress test.
+ * @since v18.8.0
+ */
+ signal?: AbortSignal | undefined;
+
+ /**
+ * If truthy, the test is skipped. If a string is provided, that string is displayed in the
+ * test results as the reason for skipping the test.
+ * @default false
+ */
+ skip?: boolean | string | undefined;
+
+ /**
+ * A number of milliseconds the test will fail after. If unspecified, subtests inherit this
+ * value from their parent.
+ * @default Infinity
+ * @since v18.7.0
+ */
+ timeout?: number | undefined;
+
+ /**
+ * If truthy, the test marked as `TODO`. If a string is provided, that string is displayed in
+ * the test results as the reason why the test is `TODO`.
+ * @default false
+ */
+ todo?: boolean | string | undefined;
+ }
+
+ /**
+ * This function is used to create a hook running before running a suite.
+ * @param fn The hook function. If the hook uses callbacks, the callback function is passed as
+ * the second argument. Default: A no-op function.
+ * @param options Configuration options for the hook.
+ * @since v18.8.0
+ */
+ function before(fn?: HookFn, options?: HookOptions): void;
+
+ /**
+ * This function is used to create a hook running after running a suite.
+ * @param fn The hook function. If the hook uses callbacks, the callback function is passed as
+ * the second argument. Default: A no-op function.
+ * @param options Configuration options for the hook.
+ * @since v18.8.0
+ */
+ function after(fn?: HookFn, options?: HookOptions): void;
+
+ /**
+ * This function is used to create a hook running before each subtest of the current suite.
+ * @param fn The hook function. If the hook uses callbacks, the callback function is passed as
+ * the second argument. Default: A no-op function.
+ * @param options Configuration options for the hook.
+ * @since v18.8.0
+ */
+ function beforeEach(fn?: HookFn, options?: HookOptions): void;
+
+ /**
+ * This function is used to create a hook running after each subtest of the current test.
+ * @param fn The hook function. If the hook uses callbacks, the callback function is passed as
+ * the second argument. Default: A no-op function.
+ * @param options Configuration options for the hook.
+ * @since v18.8.0
+ */
+ function afterEach(fn?: HookFn, options?: HookOptions): void;
+
+ /**
+ * The hook function. If the hook uses callbacks, the callback function is passed as the
+ * second argument.
+ */
+ type HookFn = (s: SuiteContext, done: (result?: any) => void) => any;
+
+ /**
+ * Configuration options for hooks.
+ * @since v18.8.0
+ */
+ interface HookOptions {
+ /**
+ * Allows aborting an in-progress hook.
+ */
+ signal?: AbortSignal | undefined;
+
+ /**
+ * A number of milliseconds the hook will fail after. If unspecified, subtests inherit this
+ * value from their parent.
+ * @default Infinity
+ */
+ timeout?: number | undefined;
+ }
+
+ interface MockFunctionOptions {
+ /**
+ * The number of times that the mock will use the behavior of `implementation`.
+ * Once the mock function has been called `times` times,
+ * it will automatically restore the behavior of `original`.
+ * This value must be an integer greater than zero.
+ * @default Infinity
+ */
+ times?: number | undefined;
+ }
+
+ interface MockMethodOptions extends MockFunctionOptions {
+ /**
+ * If `true`, `object[methodName]` is treated as a getter.
+ * This option cannot be used with the `setter` option.
+ */
+ getter?: boolean | undefined;
+
+ /**
+ * If `true`, `object[methodName]` is treated as a setter.
+ * This option cannot be used with the `getter` option.
+ */
+ setter?: boolean | undefined;
+ }
+
+ type Mock<F extends Function> = F & {
+ mock: MockFunctionContext<F>;
+ };
+
+ type NoOpFunction = (...args: any[]) => undefined;
+
+ type FunctionPropertyNames<T> = {
+ [K in keyof T]: T[K] extends Function ? K : never;
+ }[keyof T];
+
+ interface MockTracker {
+ /**
+ * This function is used to create a mock function.
+ * @param original An optional function to create a mock on.
+ * @param implementation An optional function used as the mock implementation for `original`.
+ * This is useful for creating mocks that exhibit one behavior for a specified number of calls and then restore the behavior of `original`.
+ * @param options Optional configuration options for the mock function.
+ */
+ fn<F extends Function = NoOpFunction>(original?: F, options?: MockFunctionOptions): Mock<F>;
+ fn<F extends Function = NoOpFunction, Implementation extends Function = F>(
+ original?: F,
+ implementation?: Implementation,
+ options?: MockFunctionOptions,
+ ): Mock<F | Implementation>;
+
+ /**
+ * This function is used to create a mock on an existing object method.
+ * @param object The object whose method is being mocked.
+ * @param methodName The identifier of the method on `object` to mock. If `object[methodName]` is not a function, an error is thrown.
+ * @param implementation An optional function used as the mock implementation for `object[methodName]`.
+ * @param options Optional configuration options for the mock method.
+ */
+ method<
+ MockedObject extends object,
+ MethodName extends FunctionPropertyNames<MockedObject>,
+ >(
+ object: MockedObject,
+ methodName: MethodName,
+ options?: MockFunctionOptions,
+ ): MockedObject[MethodName] extends Function ? Mock<MockedObject[MethodName]>
+ : never;
+ method<
+ MockedObject extends object,
+ MethodName extends FunctionPropertyNames<MockedObject>,
+ Implementation extends Function,
+ >(
+ object: MockedObject,
+ methodName: MethodName,
+ implementation: Implementation,
+ options?: MockFunctionOptions,
+ ): MockedObject[MethodName] extends Function ? Mock<MockedObject[MethodName] | Implementation>
+ : never;
+ method<MockedObject extends object>(
+ object: MockedObject,
+ methodName: keyof MockedObject,
+ options: MockMethodOptions,
+ ): Mock<Function>;
+ method<MockedObject extends object>(
+ object: MockedObject,
+ methodName: keyof MockedObject,
+ implementation: Function,
+ options: MockMethodOptions,
+ ): Mock<Function>;
+
+ /**
+ * This function is syntax sugar for {@link MockTracker.method} with `options.getter` set to `true`.
+ */
+ getter<
+ MockedObject extends object,
+ MethodName extends keyof MockedObject,
+ >(
+ object: MockedObject,
+ methodName: MethodName,
+ options?: MockFunctionOptions,
+ ): Mock<() => MockedObject[MethodName]>;
+ getter<
+ MockedObject extends object,
+ MethodName extends keyof MockedObject,
+ Implementation extends Function,
+ >(
+ object: MockedObject,
+ methodName: MethodName,
+ implementation?: Implementation,
+ options?: MockFunctionOptions,
+ ): Mock<(() => MockedObject[MethodName]) | Implementation>;
+
+ /**
+ * This function is syntax sugar for {@link MockTracker.method} with `options.setter` set to `true`.
+ */
+ setter<
+ MockedObject extends object,
+ MethodName extends keyof MockedObject,
+ >(
+ object: MockedObject,
+ methodName: MethodName,
+ options?: MockFunctionOptions,
+ ): Mock<(value: MockedObject[MethodName]) => void>;
+ setter<
+ MockedObject extends object,
+ MethodName extends keyof MockedObject,
+ Implementation extends Function,
+ >(
+ object: MockedObject,
+ methodName: MethodName,
+ implementation?: Implementation,
+ options?: MockFunctionOptions,
+ ): Mock<((value: MockedObject[MethodName]) => void) | Implementation>;
+
+ /**
+ * This function restores the default behavior of all mocks that were previously created by this `MockTracker`
+ * and disassociates the mocks from the `MockTracker` instance. Once disassociated, the mocks can still be used,
+ * but the `MockTracker` instance can no longer be used to reset their behavior or otherwise interact with them.
+ *
+ * After each test completes, this function is called on the test context's `MockTracker`.
+ * If the global `MockTracker` is used extensively, calling this function manually is recommended.
+ */
+ reset(): void;
+
+ /**
+ * This function restores the default behavior of all mocks that were previously created by this `MockTracker`.
+ * Unlike `mock.reset()`, `mock.restoreAll()` does not disassociate the mocks from the `MockTracker` instance.
+ */
+ restoreAll(): void;
+ }
+
+ const mock: MockTracker;
+
+ interface MockFunctionCall<
+ F extends Function,
+ ReturnType = F extends (...args: any) => infer T ? T
+ : F extends abstract new(...args: any) => infer T ? T
+ : unknown,
+ Args = F extends (...args: infer Y) => any ? Y
+ : F extends abstract new(...args: infer Y) => any ? Y
+ : unknown[],
+ > {
+ /**
+ * An array of the arguments passed to the mock function.
+ */
+ arguments: Args;
+ /**
+ * If the mocked function threw then this property contains the thrown value.
+ */
+ error: unknown | undefined;
+ /**
+ * The value returned by the mocked function.
+ *
+ * If the mocked function threw, it will be `undefined`.
+ */
+ result: ReturnType | undefined;
+ /**
+ * An `Error` object whose stack can be used to determine the callsite of the mocked function invocation.
+ */
+ stack: Error;
+ /**
+ * If the mocked function is a constructor, this field contains the class being constructed.
+ * Otherwise this will be `undefined`.
+ */
+ target: F extends abstract new(...args: any) => any ? F : undefined;
+ /**
+ * The mocked function's `this` value.
+ */
+ this: unknown;
+ }
+
+ interface MockFunctionContext<F extends Function> {
+ /**
+ * A getter that returns a copy of the internal array used to track calls to the mock.
+ */
+ readonly calls: Array<MockFunctionCall<F>>;
+
+ /**
+ * This function returns the number of times that this mock has been invoked.
+ * This function is more efficient than checking `ctx.calls.length`
+ * because `ctx.calls` is a getter that creates a copy of the internal call tracking array.
+ */
+ callCount(): number;
+
+ /**
+ * This function is used to change the behavior of an existing mock.
+ * @param implementation The function to be used as the mock's new implementation.
+ */
+ mockImplementation(implementation: Function): void;
+
+ /**
+ * This function is used to change the behavior of an existing mock for a single invocation.
+ * Once invocation `onCall` has occurred, the mock will revert to whatever behavior
+ * it would have used had `mockImplementationOnce()` not been called.
+ * @param implementation The function to be used as the mock's implementation for the invocation number specified by `onCall`.
+ * @param onCall The invocation number that will use `implementation`.
+ * If the specified invocation has already occurred then an exception is thrown.
+ */
+ mockImplementationOnce(implementation: Function, onCall?: number): void;
+
+ /**
+ * Resets the call history of the mock function.
+ */
+ resetCalls(): void;
+
+ /**
+ * Resets the implementation of the mock function to its original behavior.
+ * The mock can still be used after calling this function.
+ */
+ restore(): void;
+ }
+
+ export { after, afterEach, before, beforeEach, describe, it, mock, run, test, test as default };
+}
+
+interface DiagnosticData {
+ /**
+ * The diagnostic message.
+ */
+ message: string;
+ /**
+ * The nesting level of the test.
+ */
+ nesting: number;
+ /**
+ * The path of the test file, undefined if test is not ran through a file.
+ */
+ file?: string;
+}
+interface TestFail {
+ /**
+ * Additional execution metadata.
+ */
+ details: {
+ /**
+ * The duration of the test in milliseconds.
+ */
+ duration_ms: number;
+ /**
+ * The error thrown by the test.
+ */
+ error: Error;
+ /**
+ * The type of the test, used to denote whether this is a suite.
+ * @since 18.17.0
+ */
+ type?: "suite";
+ };
+ /**
+ * The test name.
+ */
+ name: string;
+ /**
+ * The nesting level of the test.
+ */
+ nesting: number;
+ /**
+ * The ordinal number of the test.
+ */
+ testNumber: number;
+ /**
+ * Present if `context.todo` is called.
+ */
+ todo?: string | boolean;
+ /**
+ * Present if `context.skip` is called.
+ */
+ skip?: string | boolean;
+ /**
+ * The path of the test file, undefined if test is not ran through a file.
+ */
+ file?: string;
+}
+interface TestPass {
+ /**
+ * Additional execution metadata.
+ */
+ details: {
+ /**
+ * The duration of the test in milliseconds.
+ */
+ duration_ms: number;
+ /**
+ * The type of the test, used to denote whether this is a suite.
+ * @since 18.17.0
+ */
+ type?: "suite";
+ };
+ /**
+ * The test name.
+ */
+ name: string;
+ /**
+ * The nesting level of the test.
+ */
+ nesting: number;
+ /**
+ * The ordinal number of the test.
+ */
+ testNumber: number;
+ /**
+ * Present if `context.todo` is called.
+ */
+ todo?: string | boolean;
+ /**
+ * Present if `context.skip` is called.
+ */
+ skip?: string | boolean;
+ /**
+ * The path of the test file, undefined if test is not ran through a file.
+ */
+ file?: string;
+}
+interface TestPlan {
+ /**
+ * The nesting level of the test.
+ */
+ nesting: number;
+ /**
+ * The number of subtests that have ran.
+ */
+ count: number;
+ /**
+ * The path of the test file, undefined if test is not ran through a file.
+ */
+ file?: string;
+}
+interface TestStart {
+ /**
+ * The test name.
+ */
+ name: string;
+ /**
+ * The nesting level of the test.
+ */
+ nesting: number;
+ /**
+ * The path of the test file, undefined if test is not ran through a file.
+ */
+ file?: string;
+}
+interface TestStderr {
+ /**
+ * The path of the test file, undefined if test is not ran through a file.
+ */
+ file?: string;
+ /**
+ * The message written to `stderr`
+ */
+ message: string;
+}
+interface TestStdout {
+ /**
+ * The path of the test file, undefined if test is not ran through a file.
+ */
+ file?: string;
+ /**
+ * The message written to `stdout`
+ */
+ message: string;
+}
+interface TestEnqueue {
+ /**
+ * The test name
+ */
+ name: string;
+ /**
+ * The path of the test file, undefined if test is not ran through a file.
+ */
+ file?: string;
+ /**
+ * The nesting level of the test.
+ */
+ nesting: number;
+}
+interface TestDequeue {
+ /**
+ * The test name
+ */
+ name: string;
+ /**
+ * The path of the test file, undefined if test is not ran through a file.
+ */
+ file?: string;
+ /**
+ * The nesting level of the test.
+ */
+ nesting: number;
+}
+
+/**
+ * The `node:test/reporters` module exposes the builtin-reporters for `node:test`.
+ * To access it:
+ *
+ * ```js
+ * import test from 'node:test/reporters';
+ * ```
+ *
+ * This module is only available under the `node:` scheme. The following will not
+ * work:
+ *
+ * ```js
+ * import test from 'test/reporters';
+ * ```
+ * @since v18.17.0
+ * @see [source](https://github.com/nodejs/node/blob/v18.17.0/lib/test/reporters.js)
+ */
+declare module "node:test/reporters" {
+ import { Transform } from "node:stream";
+
+ type TestEvent =
+ | { type: "test:diagnostic"; data: DiagnosticData }
+ | { type: "test:fail"; data: TestFail }
+ | { type: "test:pass"; data: TestPass }
+ | { type: "test:plan"; data: TestPlan }
+ | { type: "test:start"; data: TestStart }
+ | { type: "test:stderr"; data: TestStderr }
+ | { type: "test:stdout"; data: TestStdout }
+ | { type: "test:enqueue"; data: TestEnqueue }
+ | { type: "test:dequeue"; data: TestDequeue }
+ | { type: "test:watch:drained" };
+ type TestEventGenerator = AsyncGenerator<TestEvent, void>;
+
+ /**
+ * The `dot` reporter outputs the test results in a compact format,
+ * where each passing test is represented by a `.`,
+ * and each failing test is represented by a `X`.
+ */
+ function dot(source: TestEventGenerator): AsyncGenerator<"\n" | "." | "X", void>;
+ /**
+ * The `tap` reporter outputs the test results in the [TAP](https://testanything.org/) format.
+ */
+ function tap(source: TestEventGenerator): AsyncGenerator<string, void>;
+ /**
+ * The `spec` reporter outputs the test results in a human-readable format.
+ */
+ class Spec extends Transform {
+ constructor();
+ }
+ export { dot, Spec as spec, tap, TestEvent };
+}
diff --git a/client/node_modules/@types/node/ts4.8/timers.d.ts b/client/node_modules/@types/node/ts4.8/timers.d.ts
new file mode 100644
index 0000000..0d1beed
--- /dev/null
+++ b/client/node_modules/@types/node/ts4.8/timers.d.ts
@@ -0,0 +1,126 @@
+/**
+ * The `timer` module exposes a global API for scheduling functions to
+ * be called at some future period of time. Because the timer functions are
+ * globals, there is no need to call `require('timers')` to use the API.
+ *
+ * The timer functions within Node.js implement a similar API as the timers API
+ * provided by Web Browsers but use a different internal implementation that is
+ * built around the Node.js [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#setimmediate-vs-settimeout).
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/timers.js)
+ */
+declare module "timers" {
+ import { Abortable } from "node:events";
+ import {
+ setImmediate as setImmediatePromise,
+ setInterval as setIntervalPromise,
+ setTimeout as setTimeoutPromise,
+ } from "node:timers/promises";
+ interface TimerOptions extends Abortable {
+ /**
+ * Set to `false` to indicate that the scheduled `Timeout`
+ * should not require the Node.js event loop to remain active.
+ * @default true
+ */
+ ref?: boolean | undefined;
+ }
+ let setTimeout: typeof global.setTimeout;
+ let clearTimeout: typeof global.clearTimeout;
+ let setInterval: typeof global.setInterval;
+ let clearInterval: typeof global.clearInterval;
+ let setImmediate: typeof global.setImmediate;
+ let clearImmediate: typeof global.clearImmediate;
+ global {
+ namespace NodeJS {
+ // compatibility with older typings
+ interface Timer extends RefCounted {
+ hasRef(): boolean;
+ refresh(): this;
+ [Symbol.toPrimitive](): number;
+ }
+ interface Immediate extends RefCounted {
+ /**
+ * If true, the `Immediate` object will keep the Node.js event loop active.
+ * @since v11.0.0
+ */
+ hasRef(): boolean;
+ _onImmediate: Function; // to distinguish it from the Timeout class
+ /**
+ * Cancels the immediate. This is similar to calling `clearImmediate()`.
+ * @since v18.18.0
+ */
+ [Symbol.dispose](): void;
+ }
+ interface Timeout extends Timer {
+ /**
+ * If true, the `Timeout` object will keep the Node.js event loop active.
+ * @since v11.0.0
+ */
+ hasRef(): boolean;
+ /**
+ * Sets the timer's start time to the current time, and reschedules the timer to
+ * call its callback at the previously specified duration adjusted to the current
+ * time. This is useful for refreshing a timer without allocating a new
+ * JavaScript object.
+ *
+ * Using this on a timer that has already called its callback will reactivate the
+ * timer.
+ * @since v10.2.0
+ * @return a reference to `timeout`
+ */
+ refresh(): this;
+ [Symbol.toPrimitive](): number;
+ /**
+ * Cancels the timeout.
+ * @since v18.18.0
+ */
+ [Symbol.dispose](): void;
+ }
+ }
+ /**
+ * Schedules execution of a one-time `callback` after `delay` milliseconds. The `callback` will likely not be invoked in precisely `delay` milliseconds.
+ * Node.js makes no guarantees about the exact timing of when callbacks will fire, nor of their ordering. The callback will be called as close as possible to the time specified.
+ * When `delay` is larger than `2147483647` or less than `1`, the `delay` will be set to `1`. Non-integer delays are truncated to an integer.
+ * If `callback` is not a function, a [TypeError](https://nodejs.org/api/errors.html#class-typeerror) will be thrown.
+ * @since v0.0.1
+ */
+ function setTimeout<TArgs extends any[]>(
+ callback: (...args: TArgs) => void,
+ ms?: number,
+ ...args: TArgs
+ ): NodeJS.Timeout;
+ // util.promisify no rest args compability
+ // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
+ function setTimeout(callback: (args: void) => void, ms?: number): NodeJS.Timeout;
+ namespace setTimeout {
+ const __promisify__: typeof setTimeoutPromise;
+ }
+ function clearTimeout(timeoutId: NodeJS.Timeout | string | number | undefined): void;
+ function setInterval<TArgs extends any[]>(
+ callback: (...args: TArgs) => void,
+ ms?: number,
+ ...args: TArgs
+ ): NodeJS.Timeout;
+ // util.promisify no rest args compability
+ // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
+ function setInterval(callback: (args: void) => void, ms?: number): NodeJS.Timeout;
+ namespace setInterval {
+ const __promisify__: typeof setIntervalPromise;
+ }
+ function clearInterval(intervalId: NodeJS.Timeout | string | number | undefined): void;
+ function setImmediate<TArgs extends any[]>(
+ callback: (...args: TArgs) => void,
+ ...args: TArgs
+ ): NodeJS.Immediate;
+ // util.promisify no rest args compability
+ // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
+ function setImmediate(callback: (args: void) => void): NodeJS.Immediate;
+ namespace setImmediate {
+ const __promisify__: typeof setImmediatePromise;
+ }
+ function clearImmediate(immediateId: NodeJS.Immediate | undefined): void;
+ function queueMicrotask(callback: () => void): void;
+ }
+}
+declare module "node:timers" {
+ export * from "timers";
+}
diff --git a/client/node_modules/@types/node/ts4.8/timers/promises.d.ts b/client/node_modules/@types/node/ts4.8/timers/promises.d.ts
new file mode 100644
index 0000000..abb5b42
--- /dev/null
+++ b/client/node_modules/@types/node/ts4.8/timers/promises.d.ts
@@ -0,0 +1,93 @@
+/**
+ * The `timers/promises` API provides an alternative set of timer functions
+ * that return `Promise` objects. The API is accessible via`require('timers/promises')`.
+ *
+ * ```js
+ * import {
+ * setTimeout,
+ * setImmediate,
+ * setInterval,
+ * } from 'timers/promises';
+ * ```
+ * @since v15.0.0
+ */
+declare module "timers/promises" {
+ import { TimerOptions } from "node:timers";
+ /**
+ * ```js
+ * import {
+ * setTimeout,
+ * } from 'timers/promises';
+ *
+ * const res = await setTimeout(100, 'result');
+ *
+ * console.log(res); // Prints 'result'
+ * ```
+ * @since v15.0.0
+ * @param [delay=1] The number of milliseconds to wait before fulfilling the promise.
+ * @param value A value with which the promise is fulfilled.
+ */
+ function setTimeout<T = void>(delay?: number, value?: T, options?: TimerOptions): Promise<T>;
+ /**
+ * ```js
+ * import {
+ * setImmediate,
+ * } from 'timers/promises';
+ *
+ * const res = await setImmediate('result');
+ *
+ * console.log(res); // Prints 'result'
+ * ```
+ * @since v15.0.0
+ * @param value A value with which the promise is fulfilled.
+ */
+ function setImmediate<T = void>(value?: T, options?: TimerOptions): Promise<T>;
+ /**
+ * Returns an async iterator that generates values in an interval of `delay` ms.
+ *
+ * ```js
+ * import {
+ * setInterval,
+ * } from 'timers/promises';
+ *
+ * const interval = 100;
+ * for await (const startTime of setInterval(interval, Date.now())) {
+ * const now = Date.now();
+ * console.log(now);
+ * if ((now - startTime) > 1000)
+ * break;
+ * }
+ * console.log(Date.now());
+ * ```
+ * @since v15.9.0
+ */
+ function setInterval<T = void>(delay?: number, value?: T, options?: TimerOptions): AsyncIterable<T>;
+
+ interface Scheduler {
+ /**
+ * ```js
+ * import { scheduler } from 'node:timers/promises';
+ *
+ * await scheduler.wait(1000); // Wait one second before continuing
+ * ```
+ * An experimental API defined by the Scheduling APIs draft specification being developed as a standard Web Platform API.
+ * Calling timersPromises.scheduler.wait(delay, options) is roughly equivalent to calling timersPromises.setTimeout(delay, undefined, options) except that the ref option is not supported.
+ * @since v16.14.0
+ * @experimental
+ * @param [delay=1] The number of milliseconds to wait before fulfilling the promise.
+ */
+ wait: (delay?: number, options?: TimerOptions) => Promise<void>;
+ /**
+ * An experimental API defined by the Scheduling APIs draft specification being developed as a standard Web Platform API.
+ * Calling timersPromises.scheduler.yield() is equivalent to calling timersPromises.setImmediate() with no arguments.
+ * @since v16.14.0
+ * @experimental
+ */
+ yield: () => Promise<void>;
+ }
+
+ const scheduler: Scheduler;
+}
+declare module "node:timers/promises" {
+ export * from "timers/promises";
+}
diff --git a/client/node_modules/@types/node/ts4.8/tls.d.ts b/client/node_modules/@types/node/ts4.8/tls.d.ts
new file mode 100644
index 0000000..5b2fe7f
--- /dev/null
+++ b/client/node_modules/@types/node/ts4.8/tls.d.ts
@@ -0,0 +1,1191 @@
+/**
+ * The `tls` module provides an implementation of the Transport Layer Security
+ * (TLS) and Secure Socket Layer (SSL) protocols that is built on top of OpenSSL.
+ * The module can be accessed using:
+ *
+ * ```js
+ * const tls = require('tls');
+ * ```
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/tls.js)
+ */
+declare module "tls" {
+ import { X509Certificate } from "node:crypto";
+ import * as net from "node:net";
+ import * as stream from "stream";
+ const CLIENT_RENEG_LIMIT: number;
+ const CLIENT_RENEG_WINDOW: number;
+ interface Certificate {
+ /**
+ * Country code.
+ */
+ C: string;
+ /**
+ * Street.
+ */
+ ST: string;
+ /**
+ * Locality.
+ */
+ L: string;
+ /**
+ * Organization.
+ */
+ O: string;
+ /**
+ * Organizational unit.
+ */
+ OU: string;
+ /**
+ * Common name.
+ */
+ CN: string;
+ }
+ interface PeerCertificate {
+ /**
+ * `true` if a Certificate Authority (CA), `false` otherwise.
+ * @since v18.13.0
+ */
+ ca: boolean;
+ /**
+ * The DER encoded X.509 certificate data.
+ */
+ raw: Buffer;
+ /**
+ * The certificate subject.
+ */
+ subject: Certificate;
+ /**
+ * The certificate issuer, described in the same terms as the `subject`.
+ */
+ issuer: Certificate;
+ /**
+ * The date-time the certificate is valid from.
+ */
+ valid_from: string;
+ /**
+ * The date-time the certificate is valid to.
+ */
+ valid_to: string;
+ /**
+ * The certificate serial number, as a hex string.
+ */
+ serialNumber: string;
+ /**
+ * The SHA-1 digest of the DER encoded certificate.
+ * It is returned as a `:` separated hexadecimal string.
+ */
+ fingerprint: string;
+ /**
+ * The SHA-256 digest of the DER encoded certificate.
+ * It is returned as a `:` separated hexadecimal string.
+ */
+ fingerprint256: string;
+ /**
+ * The SHA-512 digest of the DER encoded certificate.
+ * It is returned as a `:` separated hexadecimal string.
+ */
+ fingerprint512: string;
+ /**
+ * The extended key usage, a set of OIDs.
+ */
+ ext_key_usage?: string[];
+ /**
+ * A string containing concatenated names for the subject,
+ * an alternative to the `subject` names.
+ */
+ subjectaltname?: string;
+ /**
+ * An array describing the AuthorityInfoAccess, used with OCSP.
+ */
+ infoAccess?: NodeJS.Dict<string[]>;
+ /**
+ * For RSA keys: The RSA bit size.
+ *
+ * For EC keys: The key size in bits.
+ */
+ bits?: number;
+ /**
+ * The RSA exponent, as a string in hexadecimal number notation.
+ */
+ exponent?: string;
+ /**
+ * The RSA modulus, as a hexadecimal string.
+ */
+ modulus?: string;
+ /**
+ * The public key.
+ */
+ pubkey?: Buffer;
+ /**
+ * The ASN.1 name of the OID of the elliptic curve.
+ * Well-known curves are identified by an OID.
+ * While it is unusual, it is possible that the curve
+ * is identified by its mathematical properties,
+ * in which case it will not have an OID.
+ */
+ asn1Curve?: string;
+ /**
+ * The NIST name for the elliptic curve,if it has one
+ * (not all well-known curves have been assigned names by NIST).
+ */
+ nistCurve?: string;
+ }
+ interface DetailedPeerCertificate extends PeerCertificate {
+ /**
+ * The issuer certificate object.
+ * For self-signed certificates, this may be a circular reference.
+ */
+ issuerCertificate: DetailedPeerCertificate;
+ }
+ interface CipherNameAndProtocol {
+ /**
+ * The cipher name.
+ */
+ name: string;
+ /**
+ * SSL/TLS protocol version.
+ */
+ version: string;
+ /**
+ * IETF name for the cipher suite.
+ */
+ standardName: string;
+ }
+ interface EphemeralKeyInfo {
+ /**
+ * The supported types are 'DH' and 'ECDH'.
+ */
+ type: string;
+ /**
+ * The name property is available only when type is 'ECDH'.
+ */
+ name?: string | undefined;
+ /**
+ * The size of parameter of an ephemeral key exchange.
+ */
+ size: number;
+ }
+ interface KeyObject {
+ /**
+ * Private keys in PEM format.
+ */
+ pem: string | Buffer;
+ /**
+ * Optional passphrase.
+ */
+ passphrase?: string | undefined;
+ }
+ interface PxfObject {
+ /**
+ * PFX or PKCS12 encoded private key and certificate chain.
+ */
+ buf: string | Buffer;
+ /**
+ * Optional passphrase.
+ */
+ passphrase?: string | undefined;
+ }
+ interface TLSSocketOptions extends SecureContextOptions, CommonConnectionOptions {
+ /**
+ * If true the TLS socket will be instantiated in server-mode.
+ * Defaults to false.
+ */
+ isServer?: boolean | undefined;
+ /**
+ * An optional net.Server instance.
+ */
+ server?: net.Server | undefined;
+ /**
+ * An optional Buffer instance containing a TLS session.
+ */
+ session?: Buffer | undefined;
+ /**
+ * If true, specifies that the OCSP status request extension will be
+ * added to the client hello and an 'OCSPResponse' event will be
+ * emitted on the socket before establishing a secure communication
+ */
+ requestOCSP?: boolean | undefined;
+ }
+ /**
+ * Performs transparent encryption of written data and all required TLS
+ * negotiation.
+ *
+ * Instances of `tls.TLSSocket` implement the duplex `Stream` interface.
+ *
+ * Methods that return TLS connection metadata (e.g.{@link TLSSocket.getPeerCertificate} will only return data while the
+ * connection is open.
+ * @since v0.11.4
+ */
+ class TLSSocket extends net.Socket {
+ /**
+ * Construct a new tls.TLSSocket object from an existing TCP socket.
+ */
+ constructor(socket: net.Socket, options?: TLSSocketOptions);
+ /**
+ * This property is `true` if the peer certificate was signed by one of the CAs
+ * specified when creating the `tls.TLSSocket` instance, otherwise `false`.
+ * @since v0.11.4
+ */
+ authorized: boolean;
+ /**
+ * Returns the reason why the peer's certificate was not been verified. This
+ * property is set only when `tlsSocket.authorized === false`.
+ * @since v0.11.4
+ */
+ authorizationError: Error;
+ /**
+ * Always returns `true`. This may be used to distinguish TLS sockets from regular`net.Socket` instances.
+ * @since v0.11.4
+ */
+ encrypted: true;
+ /**
+ * String containing the selected ALPN protocol.
+ * Before a handshake has completed, this value is always null.
+ * When a handshake is completed but not ALPN protocol was selected, tlsSocket.alpnProtocol equals false.
+ */
+ alpnProtocol: string | false | null;
+ /**
+ * Returns an object representing the local certificate. The returned object has
+ * some properties corresponding to the fields of the certificate.
+ *
+ * See {@link TLSSocket.getPeerCertificate} for an example of the certificate
+ * structure.
+ *
+ * If there is no local certificate, an empty object will be returned. If the
+ * socket has been destroyed, `null` will be returned.
+ * @since v11.2.0
+ */
+ getCertificate(): PeerCertificate | object | null;
+ /**
+ * Returns an object containing information on the negotiated cipher suite.
+ *
+ * For example:
+ *
+ * ```json
+ * {
+ * "name": "AES128-SHA256",
+ * "standardName": "TLS_RSA_WITH_AES_128_CBC_SHA256",
+ * "version": "TLSv1.2"
+ * }
+ * ```
+ *
+ * See [SSL\_CIPHER\_get\_name](https://www.openssl.org/docs/man1.1.1/man3/SSL_CIPHER_get_name.html) for more information.
+ * @since v0.11.4
+ */
+ getCipher(): CipherNameAndProtocol;
+ /**
+ * Returns an object representing the type, name, and size of parameter of
+ * an ephemeral key exchange in `perfect forward secrecy` on a client
+ * connection. It returns an empty object when the key exchange is not
+ * ephemeral. As this is only supported on a client socket; `null` is returned
+ * if called on a server socket. The supported types are `'DH'` and `'ECDH'`. The`name` property is available only when type is `'ECDH'`.
+ *
+ * For example: `{ type: 'ECDH', name: 'prime256v1', size: 256 }`.
+ * @since v5.0.0
+ */
+ getEphemeralKeyInfo(): EphemeralKeyInfo | object | null;
+ /**
+ * As the `Finished` messages are message digests of the complete handshake
+ * (with a total of 192 bits for TLS 1.0 and more for SSL 3.0), they can
+ * be used for external authentication procedures when the authentication
+ * provided by SSL/TLS is not desired or is not enough.
+ *
+ * Corresponds to the `SSL_get_finished` routine in OpenSSL and may be used
+ * to implement the `tls-unique` channel binding from [RFC 5929](https://tools.ietf.org/html/rfc5929).
+ * @since v9.9.0
+ * @return The latest `Finished` message that has been sent to the socket as part of a SSL/TLS handshake, or `undefined` if no `Finished` message has been sent yet.
+ */
+ getFinished(): Buffer | undefined;
+ /**
+ * Returns an object representing the peer's certificate. If the peer does not
+ * provide a certificate, an empty object will be returned. If the socket has been
+ * destroyed, `null` will be returned.
+ *
+ * If the full certificate chain was requested, each certificate will include an`issuerCertificate` property containing an object representing its issuer's
+ * certificate.
+ * @since v0.11.4
+ * @param detailed Include the full certificate chain if `true`, otherwise include just the peer's certificate.
+ * @return A certificate object.
+ */
+ getPeerCertificate(detailed: true): DetailedPeerCertificate;
+ getPeerCertificate(detailed?: false): PeerCertificate;
+ getPeerCertificate(detailed?: boolean): PeerCertificate | DetailedPeerCertificate;
+ /**
+ * As the `Finished` messages are message digests of the complete handshake
+ * (with a total of 192 bits for TLS 1.0 and more for SSL 3.0), they can
+ * be used for external authentication procedures when the authentication
+ * provided by SSL/TLS is not desired or is not enough.
+ *
+ * Corresponds to the `SSL_get_peer_finished` routine in OpenSSL and may be used
+ * to implement the `tls-unique` channel binding from [RFC 5929](https://tools.ietf.org/html/rfc5929).
+ * @since v9.9.0
+ * @return The latest `Finished` message that is expected or has actually been received from the socket as part of a SSL/TLS handshake, or `undefined` if there is no `Finished` message so
+ * far.
+ */
+ getPeerFinished(): Buffer | undefined;
+ /**
+ * Returns a string containing the negotiated SSL/TLS protocol version of the
+ * current connection. The value `'unknown'` will be returned for connected
+ * sockets that have not completed the handshaking process. The value `null` will
+ * be returned for server sockets or disconnected client sockets.
+ *
+ * Protocol versions are:
+ *
+ * * `'SSLv3'`
+ * * `'TLSv1'`
+ * * `'TLSv1.1'`
+ * * `'TLSv1.2'`
+ * * `'TLSv1.3'`
+ *
+ * See the OpenSSL [`SSL_get_version`](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html) documentation for more information.
+ * @since v5.7.0
+ */
+ getProtocol(): string | null;
+ /**
+ * Returns the TLS session data or `undefined` if no session was
+ * negotiated. On the client, the data can be provided to the `session` option of {@link connect} to resume the connection. On the server, it may be useful
+ * for debugging.
+ *
+ * See `Session Resumption` for more information.
+ *
+ * Note: `getSession()` works only for TLSv1.2 and below. For TLSv1.3, applications
+ * must use the `'session'` event (it also works for TLSv1.2 and below).
+ * @since v0.11.4
+ */
+ getSession(): Buffer | undefined;
+ /**
+ * See [SSL\_get\_shared\_sigalgs](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_shared_sigalgs.html) for more information.
+ * @since v12.11.0
+ * @return List of signature algorithms shared between the server and the client in the order of decreasing preference.
+ */
+ getSharedSigalgs(): string[];
+ /**
+ * For a client, returns the TLS session ticket if one is available, or`undefined`. For a server, always returns `undefined`.
+ *
+ * It may be useful for debugging.
+ *
+ * See `Session Resumption` for more information.
+ * @since v0.11.4
+ */
+ getTLSTicket(): Buffer | undefined;
+ /**
+ * See `Session Resumption` for more information.
+ * @since v0.5.6
+ * @return `true` if the session was reused, `false` otherwise.
+ */
+ isSessionReused(): boolean;
+ /**
+ * The `tlsSocket.renegotiate()` method initiates a TLS renegotiation process.
+ * Upon completion, the `callback` function will be passed a single argument
+ * that is either an `Error` (if the request failed) or `null`.
+ *
+ * This method can be used to request a peer's certificate after the secure
+ * connection has been established.
+ *
+ * When running as the server, the socket will be destroyed with an error after`handshakeTimeout` timeout.
+ *
+ * For TLSv1.3, renegotiation cannot be initiated, it is not supported by the
+ * protocol.
+ * @since v0.11.8
+ * @param callback If `renegotiate()` returned `true`, callback is attached once to the `'secure'` event. If `renegotiate()` returned `false`, `callback` will be called in the next tick with
+ * an error, unless the `tlsSocket` has been destroyed, in which case `callback` will not be called at all.
+ * @return `true` if renegotiation was initiated, `false` otherwise.
+ */
+ renegotiate(
+ options: {
+ rejectUnauthorized?: boolean | undefined;
+ requestCert?: boolean | undefined;
+ },
+ callback: (err: Error | null) => void,
+ ): undefined | boolean;
+ /**
+ * The `tlsSocket.setMaxSendFragment()` method sets the maximum TLS fragment size.
+ * Returns `true` if setting the limit succeeded; `false` otherwise.
+ *
+ * Smaller fragment sizes decrease the buffering latency on the client: larger
+ * fragments are buffered by the TLS layer until the entire fragment is received
+ * and its integrity is verified; large fragments can span multiple roundtrips
+ * and their processing can be delayed due to packet loss or reordering. However,
+ * smaller fragments add extra TLS framing bytes and CPU overhead, which may
+ * decrease overall server throughput.
+ * @since v0.11.11
+ * @param [size=16384] The maximum TLS fragment size. The maximum value is `16384`.
+ */
+ setMaxSendFragment(size: number): boolean;
+ /**
+ * Disables TLS renegotiation for this `TLSSocket` instance. Once called, attempts
+ * to renegotiate will trigger an `'error'` event on the `TLSSocket`.
+ * @since v8.4.0
+ */
+ disableRenegotiation(): void;
+ /**
+ * When enabled, TLS packet trace information is written to `stderr`. This can be
+ * used to debug TLS connection problems.
+ *
+ * The format of the output is identical to the output of`openssl s_client -trace` or `openssl s_server -trace`. While it is produced by
+ * OpenSSL's `SSL_trace()` function, the format is undocumented, can change
+ * without notice, and should not be relied on.
+ * @since v12.2.0
+ */
+ enableTrace(): void;
+ /**
+ * Returns the peer certificate as an `X509Certificate` object.
+ *
+ * If there is no peer certificate, or the socket has been destroyed,`undefined` will be returned.
+ * @since v15.9.0
+ */
+ getPeerX509Certificate(): X509Certificate | undefined;
+ /**
+ * Returns the local certificate as an `X509Certificate` object.
+ *
+ * If there is no local certificate, or the socket has been destroyed,`undefined` will be returned.
+ * @since v15.9.0
+ */
+ getX509Certificate(): X509Certificate | undefined;
+ /**
+ * Keying material is used for validations to prevent different kind of attacks in
+ * network protocols, for example in the specifications of IEEE 802.1X.
+ *
+ * Example
+ *
+ * ```js
+ * const keyingMaterial = tlsSocket.exportKeyingMaterial(
+ * 128,
+ * 'client finished');
+ *
+ * /*
+ * Example return value of keyingMaterial:
+ * <Buffer 76 26 af 99 c5 56 8e 42 09 91 ef 9f 93 cb ad 6c 7b 65 f8 53 f1 d8 d9
+ * 12 5a 33 b8 b5 25 df 7b 37 9f e0 e2 4f b8 67 83 a3 2f cd 5d 41 42 4c 91
+ * 74 ef 2c ... 78 more bytes>
+ *
+ * ```
+ *
+ * See the OpenSSL [`SSL_export_keying_material`](https://www.openssl.org/docs/man1.1.1/man3/SSL_export_keying_material.html) documentation for more
+ * information.
+ * @since v13.10.0, v12.17.0
+ * @param length number of bytes to retrieve from keying material
+ * @param label an application specific label, typically this will be a value from the [IANA Exporter Label
+ * Registry](https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#exporter-labels).
+ * @param context Optionally provide a context.
+ * @return requested bytes of the keying material
+ */
+ exportKeyingMaterial(length: number, label: string, context: Buffer): Buffer;
+ addListener(event: string, listener: (...args: any[]) => void): this;
+ addListener(event: "OCSPResponse", listener: (response: Buffer) => void): this;
+ addListener(event: "secureConnect", listener: () => void): this;
+ addListener(event: "session", listener: (session: Buffer) => void): this;
+ addListener(event: "keylog", listener: (line: Buffer) => void): this;
+ emit(event: string | symbol, ...args: any[]): boolean;
+ emit(event: "OCSPResponse", response: Buffer): boolean;
+ emit(event: "secureConnect"): boolean;
+ emit(event: "session", session: Buffer): boolean;
+ emit(event: "keylog", line: Buffer): boolean;
+ on(event: string, listener: (...args: any[]) => void): this;
+ on(event: "OCSPResponse", listener: (response: Buffer) => void): this;
+ on(event: "secureConnect", listener: () => void): this;
+ on(event: "session", listener: (session: Buffer) => void): this;
+ on(event: "keylog", listener: (line: Buffer) => void): this;
+ once(event: string, listener: (...args: any[]) => void): this;
+ once(event: "OCSPResponse", listener: (response: Buffer) => void): this;
+ once(event: "secureConnect", listener: () => void): this;
+ once(event: "session", listener: (session: Buffer) => void): this;
+ once(event: "keylog", listener: (line: Buffer) => void): this;
+ prependListener(event: string, listener: (...args: any[]) => void): this;
+ prependListener(event: "OCSPResponse", listener: (response: Buffer) => void): this;
+ prependListener(event: "secureConnect", listener: () => void): this;
+ prependListener(event: "session", listener: (session: Buffer) => void): this;
+ prependListener(event: "keylog", listener: (line: Buffer) => void): this;
+ prependOnceListener(event: string, listener: (...args: any[]) => void): this;
+ prependOnceListener(event: "OCSPResponse", listener: (response: Buffer) => void): this;
+ prependOnceListener(event: "secureConnect", listener: () => void): this;
+ prependOnceListener(event: "session", listener: (session: Buffer) => void): this;
+ prependOnceListener(event: "keylog", listener: (line: Buffer) => void): this;
+ }
+ interface CommonConnectionOptions {
+ /**
+ * An optional TLS context object from tls.createSecureContext()
+ */
+ secureContext?: SecureContext | undefined;
+ /**
+ * When enabled, TLS packet trace information is written to `stderr`. This can be
+ * used to debug TLS connection problems.
+ * @default false
+ */
+ enableTrace?: boolean | undefined;
+ /**
+ * If true the server will request a certificate from clients that
+ * connect and attempt to verify that certificate. Defaults to
+ * false.
+ */
+ requestCert?: boolean | undefined;
+ /**
+ * An array of strings or a Buffer naming possible ALPN protocols.
+ * (Protocols should be ordered by their priority.)
+ */
+ ALPNProtocols?: string[] | Uint8Array[] | Uint8Array | undefined;
+ /**
+ * SNICallback(servername, cb) <Function> A function that will be
+ * called if the client supports SNI TLS extension. Two arguments
+ * will be passed when called: servername and cb. SNICallback should
+ * invoke cb(null, ctx), where ctx is a SecureContext instance.
+ * (tls.createSecureContext(...) can be used to get a proper
+ * SecureContext.) If SNICallback wasn't provided the default callback
+ * with high-level API will be used (see below).
+ */
+ SNICallback?: ((servername: string, cb: (err: Error | null, ctx?: SecureContext) => void) => void) | undefined;
+ /**
+ * If true the server will reject any connection which is not
+ * authorized with the list of supplied CAs. This option only has an
+ * effect if requestCert is true.
+ * @default true
+ */
+ rejectUnauthorized?: boolean | undefined;
+ }
+ interface TlsOptions extends SecureContextOptions, CommonConnectionOptions, net.ServerOpts {
+ /**
+ * Abort the connection if the SSL/TLS handshake does not finish in the
+ * specified number of milliseconds. A 'tlsClientError' is emitted on
+ * the tls.Server object whenever a handshake times out. Default:
+ * 120000 (120 seconds).
+ */
+ handshakeTimeout?: number | undefined;
+ /**
+ * The number of seconds after which a TLS session created by the
+ * server will no longer be resumable. See Session Resumption for more
+ * information. Default: 300.
+ */
+ sessionTimeout?: number | undefined;
+ /**
+ * 48-bytes of cryptographically strong pseudo-random data.
+ */
+ ticketKeys?: Buffer | undefined;
+ /**
+ * @param socket
+ * @param identity identity parameter sent from the client.
+ * @return pre-shared key that must either be
+ * a buffer or `null` to stop the negotiation process. Returned PSK must be
+ * compatible with the selected cipher's digest.
+ *
+ * When negotiating TLS-PSK (pre-shared keys), this function is called
+ * with the identity provided by the client.
+ * If the return value is `null` the negotiation process will stop and an
+ * "unknown_psk_identity" alert message will be sent to the other party.
+ * If the server wishes to hide the fact that the PSK identity was not known,
+ * the callback must provide some random data as `psk` to make the connection
+ * fail with "decrypt_error" before negotiation is finished.
+ * PSK ciphers are disabled by default, and using TLS-PSK thus
+ * requires explicitly specifying a cipher suite with the `ciphers` option.
+ * More information can be found in the RFC 4279.
+ */
+ pskCallback?(socket: TLSSocket, identity: string): DataView | NodeJS.TypedArray | null;
+ /**
+ * hint to send to a client to help
+ * with selecting the identity during TLS-PSK negotiation. Will be ignored
+ * in TLS 1.3. Upon failing to set pskIdentityHint `tlsClientError` will be
+ * emitted with `ERR_TLS_PSK_SET_IDENTIY_HINT_FAILED` code.
+ */
+ pskIdentityHint?: string | undefined;
+ }
+ interface PSKCallbackNegotation {
+ psk: DataView | NodeJS.TypedArray;
+ identity: string;
+ }
+ interface ConnectionOptions extends SecureContextOptions, CommonConnectionOptions {
+ host?: string | undefined;
+ port?: number | undefined;
+ path?: string | undefined; // Creates unix socket connection to path. If this option is specified, `host` and `port` are ignored.
+ socket?: stream.Duplex | undefined; // Establish secure connection on a given socket rather than creating a new socket
+ checkServerIdentity?: typeof checkServerIdentity | undefined;
+ servername?: string | undefined; // SNI TLS Extension
+ session?: Buffer | undefined;
+ minDHSize?: number | undefined;
+ lookup?: net.LookupFunction | undefined;
+ timeout?: number | undefined;
+ /**
+ * When negotiating TLS-PSK (pre-shared keys), this function is called
+ * with optional identity `hint` provided by the server or `null`
+ * in case of TLS 1.3 where `hint` was removed.
+ * It will be necessary to provide a custom `tls.checkServerIdentity()`
+ * for the connection as the default one will try to check hostname/IP
+ * of the server against the certificate but that's not applicable for PSK
+ * because there won't be a certificate present.
+ * More information can be found in the RFC 4279.
+ *
+ * @param hint message sent from the server to help client
+ * decide which identity to use during negotiation.
+ * Always `null` if TLS 1.3 is used.
+ * @returns Return `null` to stop the negotiation process. `psk` must be
+ * compatible with the selected cipher's digest.
+ * `identity` must use UTF-8 encoding.
+ */
+ pskCallback?(hint: string | null): PSKCallbackNegotation | null;
+ }
+ /**
+ * Accepts encrypted connections using TLS or SSL.
+ * @since v0.3.2
+ */
+ class Server extends net.Server {
+ constructor(secureConnectionListener?: (socket: TLSSocket) => void);
+ constructor(options: TlsOptions, secureConnectionListener?: (socket: TLSSocket) => void);
+ /**
+ * The `server.addContext()` method adds a secure context that will be used if
+ * the client request's SNI name matches the supplied `hostname` (or wildcard).
+ *
+ * When there are multiple matching contexts, the most recently added one is
+ * used.
+ * @since v0.5.3
+ * @param hostname A SNI host name or wildcard (e.g. `'*'`)
+ * @param context An object containing any of the possible properties from the {@link createSecureContext} `options` arguments (e.g. `key`, `cert`, `ca`, etc).
+ */
+ addContext(hostname: string, context: SecureContextOptions): void;
+ /**
+ * Returns the session ticket keys.
+ *
+ * See `Session Resumption` for more information.
+ * @since v3.0.0
+ * @return A 48-byte buffer containing the session ticket keys.
+ */
+ getTicketKeys(): Buffer;
+ /**
+ * The `server.setSecureContext()` method replaces the secure context of an
+ * existing server. Existing connections to the server are not interrupted.
+ * @since v11.0.0
+ * @param options An object containing any of the possible properties from the {@link createSecureContext} `options` arguments (e.g. `key`, `cert`, `ca`, etc).
+ */
+ setSecureContext(options: SecureContextOptions): void;
+ /**
+ * Sets the session ticket keys.
+ *
+ * Changes to the ticket keys are effective only for future server connections.
+ * Existing or currently pending server connections will use the previous keys.
+ *
+ * See `Session Resumption` for more information.
+ * @since v3.0.0
+ * @param keys A 48-byte buffer containing the session ticket keys.
+ */
+ setTicketKeys(keys: Buffer): void;
+ /**
+ * events.EventEmitter
+ * 1. tlsClientError
+ * 2. newSession
+ * 3. OCSPRequest
+ * 4. resumeSession
+ * 5. secureConnection
+ * 6. keylog
+ */
+ addListener(event: string, listener: (...args: any[]) => void): this;
+ addListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
+ addListener(
+ event: "newSession",
+ listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void,
+ ): this;
+ addListener(
+ event: "OCSPRequest",
+ listener: (
+ certificate: Buffer,
+ issuer: Buffer,
+ callback: (err: Error | null, resp: Buffer) => void,
+ ) => void,
+ ): this;
+ addListener(
+ event: "resumeSession",
+ listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void,
+ ): this;
+ addListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
+ addListener(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
+ emit(event: string | symbol, ...args: any[]): boolean;
+ emit(event: "tlsClientError", err: Error, tlsSocket: TLSSocket): boolean;
+ emit(event: "newSession", sessionId: Buffer, sessionData: Buffer, callback: () => void): boolean;
+ emit(
+ event: "OCSPRequest",
+ certificate: Buffer,
+ issuer: Buffer,
+ callback: (err: Error | null, resp: Buffer) => void,
+ ): boolean;
+ emit(
+ event: "resumeSession",
+ sessionId: Buffer,
+ callback: (err: Error | null, sessionData: Buffer | null) => void,
+ ): boolean;
+ emit(event: "secureConnection", tlsSocket: TLSSocket): boolean;
+ emit(event: "keylog", line: Buffer, tlsSocket: TLSSocket): boolean;
+ on(event: string, listener: (...args: any[]) => void): this;
+ on(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
+ on(event: "newSession", listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this;
+ on(
+ event: "OCSPRequest",
+ listener: (
+ certificate: Buffer,
+ issuer: Buffer,
+ callback: (err: Error | null, resp: Buffer) => void,
+ ) => void,
+ ): this;
+ on(
+ event: "resumeSession",
+ listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void,
+ ): this;
+ on(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
+ on(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
+ once(event: string, listener: (...args: any[]) => void): this;
+ once(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
+ once(
+ event: "newSession",
+ listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void,
+ ): this;
+ once(
+ event: "OCSPRequest",
+ listener: (
+ certificate: Buffer,
+ issuer: Buffer,
+ callback: (err: Error | null, resp: Buffer) => void,
+ ) => void,
+ ): this;
+ once(
+ event: "resumeSession",
+ listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void,
+ ): this;
+ once(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
+ once(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
+ prependListener(event: string, listener: (...args: any[]) => void): this;
+ prependListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
+ prependListener(
+ event: "newSession",
+ listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void,
+ ): this;
+ prependListener(
+ event: "OCSPRequest",
+ listener: (
+ certificate: Buffer,
+ issuer: Buffer,
+ callback: (err: Error | null, resp: Buffer) => void,
+ ) => void,
+ ): this;
+ prependListener(
+ event: "resumeSession",
+ listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void,
+ ): this;
+ prependListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
+ prependListener(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
+ prependOnceListener(event: string, listener: (...args: any[]) => void): this;
+ prependOnceListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
+ prependOnceListener(
+ event: "newSession",
+ listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void,
+ ): this;
+ prependOnceListener(
+ event: "OCSPRequest",
+ listener: (
+ certificate: Buffer,
+ issuer: Buffer,
+ callback: (err: Error | null, resp: Buffer) => void,
+ ) => void,
+ ): this;
+ prependOnceListener(
+ event: "resumeSession",
+ listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void,
+ ): this;
+ prependOnceListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
+ prependOnceListener(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
+ }
+ /**
+ * @deprecated since v0.11.3 Use `tls.TLSSocket` instead.
+ */
+ interface SecurePair {
+ encrypted: TLSSocket;
+ cleartext: TLSSocket;
+ }
+ type SecureVersion = "TLSv1.3" | "TLSv1.2" | "TLSv1.1" | "TLSv1";
+ interface SecureContextOptions {
+ /**
+ * Optionally override the trusted CA certificates. Default is to trust
+ * the well-known CAs curated by Mozilla. Mozilla's CAs are completely
+ * replaced when CAs are explicitly specified using this option.
+ */
+ ca?: string | Buffer | Array<string | Buffer> | undefined;
+ /**
+ * Cert chains in PEM format. One cert chain should be provided per
+ * private key. Each cert chain should consist of the PEM formatted
+ * certificate for a provided private key, followed by the PEM
+ * formatted intermediate certificates (if any), in order, and not
+ * including the root CA (the root CA must be pre-known to the peer,
+ * see ca). When providing multiple cert chains, they do not have to
+ * be in the same order as their private keys in key. If the
+ * intermediate certificates are not provided, the peer will not be
+ * able to validate the certificate, and the handshake will fail.
+ */
+ cert?: string | Buffer | Array<string | Buffer> | undefined;
+ /**
+ * Colon-separated list of supported signature algorithms. The list
+ * can contain digest algorithms (SHA256, MD5 etc.), public key
+ * algorithms (RSA-PSS, ECDSA etc.), combination of both (e.g
+ * 'RSA+SHA384') or TLS v1.3 scheme names (e.g. rsa_pss_pss_sha512).
+ */
+ sigalgs?: string | undefined;
+ /**
+ * Cipher suite specification, replacing the default. For more
+ * information, see modifying the default cipher suite. Permitted
+ * ciphers can be obtained via tls.getCiphers(). Cipher names must be
+ * uppercased in order for OpenSSL to accept them.
+ */
+ ciphers?: string | undefined;
+ /**
+ * Name of an OpenSSL engine which can provide the client certificate.
+ */
+ clientCertEngine?: string | undefined;
+ /**
+ * PEM formatted CRLs (Certificate Revocation Lists).
+ */
+ crl?: string | Buffer | Array<string | Buffer> | undefined;
+ /**
+ * `'auto'` or custom Diffie-Hellman parameters, required for non-ECDHE perfect forward secrecy.
+ * If omitted or invalid, the parameters are silently discarded and DHE ciphers will not be available.
+ * ECDHE-based perfect forward secrecy will still be available.
+ */
+ dhparam?: string | Buffer | undefined;
+ /**
+ * A string describing a named curve or a colon separated list of curve
+ * NIDs or names, for example P-521:P-384:P-256, to use for ECDH key
+ * agreement. Set to auto to select the curve automatically. Use
+ * crypto.getCurves() to obtain a list of available curve names. On
+ * recent releases, openssl ecparam -list_curves will also display the
+ * name and description of each available elliptic curve. Default:
+ * tls.DEFAULT_ECDH_CURVE.
+ */
+ ecdhCurve?: string | undefined;
+ /**
+ * Attempt to use the server's cipher suite preferences instead of the
+ * client's. When true, causes SSL_OP_CIPHER_SERVER_PREFERENCE to be
+ * set in secureOptions
+ */
+ honorCipherOrder?: boolean | undefined;
+ /**
+ * Private keys in PEM format. PEM allows the option of private keys
+ * being encrypted. Encrypted keys will be decrypted with
+ * options.passphrase. Multiple keys using different algorithms can be
+ * provided either as an array of unencrypted key strings or buffers,
+ * or an array of objects in the form {pem: <string|buffer>[,
+ * passphrase: <string>]}. The object form can only occur in an array.
+ * object.passphrase is optional. Encrypted keys will be decrypted with
+ * object.passphrase if provided, or options.passphrase if it is not.
+ */
+ key?: string | Buffer | Array<string | Buffer | KeyObject> | undefined;
+ /**
+ * Name of an OpenSSL engine to get private key from. Should be used
+ * together with privateKeyIdentifier.
+ */
+ privateKeyEngine?: string | undefined;
+ /**
+ * Identifier of a private key managed by an OpenSSL engine. Should be
+ * used together with privateKeyEngine. Should not be set together with
+ * key, because both options define a private key in different ways.
+ */
+ privateKeyIdentifier?: string | undefined;
+ /**
+ * Optionally set the maximum TLS version to allow. One
+ * of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the
+ * `secureProtocol` option, use one or the other.
+ * **Default:** `'TLSv1.3'`, unless changed using CLI options. Using
+ * `--tls-max-v1.2` sets the default to `'TLSv1.2'`. Using `--tls-max-v1.3` sets the default to
+ * `'TLSv1.3'`. If multiple of the options are provided, the highest maximum is used.
+ */
+ maxVersion?: SecureVersion | undefined;
+ /**
+ * Optionally set the minimum TLS version to allow. One
+ * of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the
+ * `secureProtocol` option, use one or the other. It is not recommended to use
+ * less than TLSv1.2, but it may be required for interoperability.
+ * **Default:** `'TLSv1.2'`, unless changed using CLI options. Using
+ * `--tls-v1.0` sets the default to `'TLSv1'`. Using `--tls-v1.1` sets the default to
+ * `'TLSv1.1'`. Using `--tls-min-v1.3` sets the default to
+ * 'TLSv1.3'. If multiple of the options are provided, the lowest minimum is used.
+ */
+ minVersion?: SecureVersion | undefined;
+ /**
+ * Shared passphrase used for a single private key and/or a PFX.
+ */
+ passphrase?: string | undefined;
+ /**
+ * PFX or PKCS12 encoded private key and certificate chain. pfx is an
+ * alternative to providing key and cert individually. PFX is usually
+ * encrypted, if it is, passphrase will be used to decrypt it. Multiple
+ * PFX can be provided either as an array of unencrypted PFX buffers,
+ * or an array of objects in the form {buf: <string|buffer>[,
+ * passphrase: <string>]}. The object form can only occur in an array.
+ * object.passphrase is optional. Encrypted PFX will be decrypted with
+ * object.passphrase if provided, or options.passphrase if it is not.
+ */
+ pfx?: string | Buffer | Array<string | Buffer | PxfObject> | undefined;
+ /**
+ * Optionally affect the OpenSSL protocol behavior, which is not
+ * usually necessary. This should be used carefully if at all! Value is
+ * a numeric bitmask of the SSL_OP_* options from OpenSSL Options
+ */
+ secureOptions?: number | undefined; // Value is a numeric bitmask of the `SSL_OP_*` options
+ /**
+ * Legacy mechanism to select the TLS protocol version to use, it does
+ * not support independent control of the minimum and maximum version,
+ * and does not support limiting the protocol to TLSv1.3. Use
+ * minVersion and maxVersion instead. The possible values are listed as
+ * SSL_METHODS, use the function names as strings. For example, use
+ * 'TLSv1_1_method' to force TLS version 1.1, or 'TLS_method' to allow
+ * any TLS protocol version up to TLSv1.3. It is not recommended to use
+ * TLS versions less than 1.2, but it may be required for
+ * interoperability. Default: none, see minVersion.
+ */
+ secureProtocol?: string | undefined;
+ /**
+ * Opaque identifier used by servers to ensure session state is not
+ * shared between applications. Unused by clients.
+ */
+ sessionIdContext?: string | undefined;
+ /**
+ * 48-bytes of cryptographically strong pseudo-random data.
+ * See Session Resumption for more information.
+ */
+ ticketKeys?: Buffer | undefined;
+ /**
+ * The number of seconds after which a TLS session created by the
+ * server will no longer be resumable. See Session Resumption for more
+ * information. Default: 300.
+ */
+ sessionTimeout?: number | undefined;
+ }
+ interface SecureContext {
+ context: any;
+ }
+ /**
+ * Verifies the certificate `cert` is issued to `hostname`.
+ *
+ * Returns [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object, populating it with `reason`, `host`, and `cert` on
+ * failure. On success, returns [undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Undefined_type).
+ *
+ * This function is intended to be used in combination with the`checkServerIdentity` option that can be passed to {@link connect} and as
+ * such operates on a `certificate object`. For other purposes, consider using `x509.checkHost()` instead.
+ *
+ * This function can be overwritten by providing an alternative function as the`options.checkServerIdentity` option that is passed to `tls.connect()`. The
+ * overwriting function can call `tls.checkServerIdentity()` of course, to augment
+ * the checks done with additional verification.
+ *
+ * This function is only called if the certificate passed all other checks, such as
+ * being issued by trusted CA (`options.ca`).
+ *
+ * Earlier versions of Node.js incorrectly accepted certificates for a given`hostname` if a matching `uniformResourceIdentifier` subject alternative name
+ * was present (see [CVE-2021-44531](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-44531)). Applications that wish to accept`uniformResourceIdentifier` subject alternative names can use
+ * a custom`options.checkServerIdentity` function that implements the desired behavior.
+ * @since v0.8.4
+ * @param hostname The host name or IP address to verify the certificate against.
+ * @param cert A `certificate object` representing the peer's certificate.
+ */
+ function checkServerIdentity(hostname: string, cert: PeerCertificate): Error | undefined;
+ /**
+ * Creates a new {@link Server}. The `secureConnectionListener`, if provided, is
+ * automatically set as a listener for the `'secureConnection'` event.
+ *
+ * The `ticketKeys` options is automatically shared between `cluster` module
+ * workers.
+ *
+ * The following illustrates a simple echo server:
+ *
+ * ```js
+ * const tls = require('tls');
+ * const fs = require('fs');
+ *
+ * const options = {
+ * key: fs.readFileSync('server-key.pem'),
+ * cert: fs.readFileSync('server-cert.pem'),
+ *
+ * // This is necessary only if using client certificate authentication.
+ * requestCert: true,
+ *
+ * // This is necessary only if the client uses a self-signed certificate.
+ * ca: [ fs.readFileSync('client-cert.pem') ]
+ * };
+ *
+ * const server = tls.createServer(options, (socket) => {
+ * console.log('server connected',
+ * socket.authorized ? 'authorized' : 'unauthorized');
+ * socket.write('welcome!\n');
+ * socket.setEncoding('utf8');
+ * socket.pipe(socket);
+ * });
+ * server.listen(8000, () => {
+ * console.log('server bound');
+ * });
+ * ```
+ *
+ * The server can be tested by connecting to it using the example client from {@link connect}.
+ * @since v0.3.2
+ */
+ function createServer(secureConnectionListener?: (socket: TLSSocket) => void): Server;
+ function createServer(options: TlsOptions, secureConnectionListener?: (socket: TLSSocket) => void): Server;
+ /**
+ * The `callback` function, if specified, will be added as a listener for the `'secureConnect'` event.
+ *
+ * `tls.connect()` returns a {@link TLSSocket} object.
+ *
+ * Unlike the `https` API, `tls.connect()` does not enable the
+ * SNI (Server Name Indication) extension by default, which may cause some
+ * servers to return an incorrect certificate or reject the connection
+ * altogether. To enable SNI, set the `servername` option in addition
+ * to `host`.
+ *
+ * The following illustrates a client for the echo server example from {@link createServer}:
+ *
+ * ```js
+ * // Assumes an echo server that is listening on port 8000.
+ * const tls = require('tls');
+ * const fs = require('fs');
+ *
+ * const options = {
+ * // Necessary only if the server requires client certificate authentication.
+ * key: fs.readFileSync('client-key.pem'),
+ * cert: fs.readFileSync('client-cert.pem'),
+ *
+ * // Necessary only if the server uses a self-signed certificate.
+ * ca: [ fs.readFileSync('server-cert.pem') ],
+ *
+ * // Necessary only if the server's cert isn't for "localhost".
+ * checkServerIdentity: () => { return null; },
+ * };
+ *
+ * const socket = tls.connect(8000, options, () => {
+ * console.log('client connected',
+ * socket.authorized ? 'authorized' : 'unauthorized');
+ * process.stdin.pipe(socket);
+ * process.stdin.resume();
+ * });
+ * socket.setEncoding('utf8');
+ * socket.on('data', (data) => {
+ * console.log(data);
+ * });
+ * socket.on('end', () => {
+ * console.log('server ends connection');
+ * });
+ * ```
+ * @since v0.11.3
+ */
+ function connect(options: ConnectionOptions, secureConnectListener?: () => void): TLSSocket;
+ function connect(
+ port: number,
+ host?: string,
+ options?: ConnectionOptions,
+ secureConnectListener?: () => void,
+ ): TLSSocket;
+ function connect(port: number, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket;
+ /**
+ * Creates a new secure pair object with two streams, one of which reads and writes
+ * the encrypted data and the other of which reads and writes the cleartext data.
+ * Generally, the encrypted stream is piped to/from an incoming encrypted data
+ * stream and the cleartext one is used as a replacement for the initial encrypted
+ * stream.
+ *
+ * `tls.createSecurePair()` returns a `tls.SecurePair` object with `cleartext` and`encrypted` stream properties.
+ *
+ * Using `cleartext` has the same API as {@link TLSSocket}.
+ *
+ * The `tls.createSecurePair()` method is now deprecated in favor of`tls.TLSSocket()`. For example, the code:
+ *
+ * ```js
+ * pair = tls.createSecurePair(// ... );
+ * pair.encrypted.pipe(socket);
+ * socket.pipe(pair.encrypted);
+ * ```
+ *
+ * can be replaced by:
+ *
+ * ```js
+ * secureSocket = tls.TLSSocket(socket, options);
+ * ```
+ *
+ * where `secureSocket` has the same API as `pair.cleartext`.
+ * @since v0.3.2
+ * @deprecated Since v0.11.3 - Use {@link TLSSocket} instead.
+ * @param context A secure context object as returned by `tls.createSecureContext()`
+ * @param isServer `true` to specify that this TLS connection should be opened as a server.
+ * @param requestCert `true` to specify whether a server should request a certificate from a connecting client. Only applies when `isServer` is `true`.
+ * @param rejectUnauthorized If not `false` a server automatically reject clients with invalid certificates. Only applies when `isServer` is `true`.
+ */
+ function createSecurePair(
+ context?: SecureContext,
+ isServer?: boolean,
+ requestCert?: boolean,
+ rejectUnauthorized?: boolean,
+ ): SecurePair;
+ /**
+ * {@link createServer} sets the default value of the `honorCipherOrder` option
+ * to `true`, other APIs that create secure contexts leave it unset.
+ *
+ * {@link createServer} uses a 128 bit truncated SHA1 hash value generated
+ * from `process.argv` as the default value of the `sessionIdContext` option, other
+ * APIs that create secure contexts have no default value.
+ *
+ * The `tls.createSecureContext()` method creates a `SecureContext` object. It is
+ * usable as an argument to several `tls` APIs, such as {@link createServer} and `server.addContext()`, but has no public methods.
+ *
+ * A key is _required_ for ciphers that use certificates. Either `key` or`pfx` can be used to provide it.
+ *
+ * If the `ca` option is not given, then Node.js will default to using [Mozilla's publicly trusted list of
+ * CAs](https://hg.mozilla.org/mozilla-central/raw-file/tip/security/nss/lib/ckfw/builtins/certdata.txt).
+ * @since v0.11.13
+ */
+ function createSecureContext(options?: SecureContextOptions): SecureContext;
+ /**
+ * Returns an array with the names of the supported TLS ciphers. The names are
+ * lower-case for historical reasons, but must be uppercased to be used in
+ * the `ciphers` option of {@link createSecureContext}.
+ *
+ * Not all supported ciphers are enabled by default. See `Modifying the default TLS cipher suite`.
+ *
+ * Cipher names that start with `'tls_'` are for TLSv1.3, all the others are for
+ * TLSv1.2 and below.
+ *
+ * ```js
+ * console.log(tls.getCiphers()); // ['aes128-gcm-sha256', 'aes128-sha', ...]
+ * ```
+ * @since v0.10.2
+ */
+ function getCiphers(): string[];
+ /**
+ * The default curve name to use for ECDH key agreement in a tls server.
+ * The default value is 'auto'. See tls.createSecureContext() for further
+ * information.
+ */
+ let DEFAULT_ECDH_CURVE: string;
+ /**
+ * The default value of the maxVersion option of
+ * tls.createSecureContext(). It can be assigned any of the supported TLS
+ * protocol versions, 'TLSv1.3', 'TLSv1.2', 'TLSv1.1', or 'TLSv1'. Default:
+ * 'TLSv1.3', unless changed using CLI options. Using --tls-max-v1.2 sets
+ * the default to 'TLSv1.2'. Using --tls-max-v1.3 sets the default to
+ * 'TLSv1.3'. If multiple of the options are provided, the highest maximum
+ * is used.
+ */
+ let DEFAULT_MAX_VERSION: SecureVersion;
+ /**
+ * The default value of the minVersion option of tls.createSecureContext().
+ * It can be assigned any of the supported TLS protocol versions,
+ * 'TLSv1.3', 'TLSv1.2', 'TLSv1.1', or 'TLSv1'. Default: 'TLSv1.2', unless
+ * changed using CLI options. Using --tls-min-v1.0 sets the default to
+ * 'TLSv1'. Using --tls-min-v1.1 sets the default to 'TLSv1.1'. Using
+ * --tls-min-v1.3 sets the default to 'TLSv1.3'. If multiple of the options
+ * are provided, the lowest minimum is used.
+ */
+ let DEFAULT_MIN_VERSION: SecureVersion;
+ /**
+ * The default value of the ciphers option of tls.createSecureContext().
+ * It can be assigned any of the supported OpenSSL ciphers.
+ * Defaults to the content of crypto.constants.defaultCoreCipherList, unless
+ * changed using CLI options using --tls-default-ciphers.
+ */
+ let DEFAULT_CIPHERS: string;
+ /**
+ * An immutable array of strings representing the root certificates (in PEM
+ * format) used for verifying peer certificates. This is the default value
+ * of the ca option to tls.createSecureContext().
+ */
+ const rootCertificates: readonly string[];
+}
+declare module "node:tls" {
+ export * from "tls";
+}
diff --git a/client/node_modules/@types/node/ts4.8/trace_events.d.ts b/client/node_modules/@types/node/ts4.8/trace_events.d.ts
new file mode 100644
index 0000000..7f0fe55
--- /dev/null
+++ b/client/node_modules/@types/node/ts4.8/trace_events.d.ts
@@ -0,0 +1,171 @@
+/**
+ * The `trace_events` module provides a mechanism to centralize tracing information
+ * generated by V8, Node.js core, and userspace code.
+ *
+ * Tracing can be enabled with the `--trace-event-categories` command-line flag
+ * or by using the `trace_events` module. The `--trace-event-categories` flag
+ * accepts a list of comma-separated category names.
+ *
+ * The available categories are:
+ *
+ * * `node`: An empty placeholder.
+ * * `node.async_hooks`: Enables capture of detailed `async_hooks` trace data.
+ * The `async_hooks` events have a unique `asyncId` and a special `triggerId` `triggerAsyncId` property.
+ * * `node.bootstrap`: Enables capture of Node.js bootstrap milestones.
+ * * `node.console`: Enables capture of `console.time()` and `console.count()`output.
+ * * `node.dns.native`: Enables capture of trace data for DNS queries.
+ * * `node.environment`: Enables capture of Node.js Environment milestones.
+ * * `node.fs.sync`: Enables capture of trace data for file system sync methods.
+ * * `node.perf`: Enables capture of `Performance API` measurements.
+ * * `node.perf.usertiming`: Enables capture of only Performance API User Timing
+ * measures and marks.
+ * * `node.perf.timerify`: Enables capture of only Performance API timerify
+ * measurements.
+ * * `node.promises.rejections`: Enables capture of trace data tracking the number
+ * of unhandled Promise rejections and handled-after-rejections.
+ * * `node.vm.script`: Enables capture of trace data for the `vm` module's`runInNewContext()`, `runInContext()`, and `runInThisContext()` methods.
+ * * `v8`: The `V8` events are GC, compiling, and execution related.
+ *
+ * By default the `node`, `node.async_hooks`, and `v8` categories are enabled.
+ *
+ * ```bash
+ * node --trace-event-categories v8,node,node.async_hooks server.js
+ * ```
+ *
+ * Prior versions of Node.js required the use of the `--trace-events-enabled`flag to enable trace events. This requirement has been removed. However, the`--trace-events-enabled` flag _may_ still be
+ * used and will enable the`node`, `node.async_hooks`, and `v8` trace event categories by default.
+ *
+ * ```bash
+ * node --trace-events-enabled
+ *
+ * # is equivalent to
+ *
+ * node --trace-event-categories v8,node,node.async_hooks
+ * ```
+ *
+ * Alternatively, trace events may be enabled using the `trace_events` module:
+ *
+ * ```js
+ * const trace_events = require('trace_events');
+ * const tracing = trace_events.createTracing({ categories: ['node.perf'] });
+ * tracing.enable(); // Enable trace event capture for the 'node.perf' category
+ *
+ * // do work
+ *
+ * tracing.disable(); // Disable trace event capture for the 'node.perf' category
+ * ```
+ *
+ * Running Node.js with tracing enabled will produce log files that can be opened
+ * in the [`chrome://tracing`](https://www.chromium.org/developers/how-tos/trace-event-profiling-tool) tab of Chrome.
+ *
+ * The logging file is by default called `node_trace.${rotation}.log`, where`${rotation}` is an incrementing log-rotation id. The filepath pattern can
+ * be specified with `--trace-event-file-pattern` that accepts a template
+ * string that supports `${rotation}` and `${pid}`:
+ *
+ * ```bash
+ * node --trace-event-categories v8 --trace-event-file-pattern '${pid}-${rotation}.log' server.js
+ * ```
+ *
+ * To guarantee that the log file is properly generated after signal events like`SIGINT`, `SIGTERM`, or `SIGBREAK`, make sure to have the appropriate handlers
+ * in your code, such as:
+ *
+ * ```js
+ * process.on('SIGINT', function onSigint() {
+ * console.info('Received SIGINT.');
+ * process.exit(130); // Or applicable exit code depending on OS and signal
+ * });
+ * ```
+ *
+ * The tracing system uses the same time source
+ * as the one used by `process.hrtime()`.
+ * However the trace-event timestamps are expressed in microseconds,
+ * unlike `process.hrtime()` which returns nanoseconds.
+ *
+ * The features from this module are not available in `Worker` threads.
+ * @experimental
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/trace_events.js)
+ */
+declare module "trace_events" {
+ /**
+ * The `Tracing` object is used to enable or disable tracing for sets of
+ * categories. Instances are created using the
+ * `trace_events.createTracing()` method.
+ *
+ * When created, the `Tracing` object is disabled. Calling the
+ * `tracing.enable()` method adds the categories to the set of enabled trace
+ * event categories. Calling `tracing.disable()` will remove the categories
+ * from the set of enabled trace event categories.
+ */
+ interface Tracing {
+ /**
+ * A comma-separated list of the trace event categories covered by this
+ * `Tracing` object.
+ */
+ readonly categories: string;
+ /**
+ * Disables this `Tracing` object.
+ *
+ * Only trace event categories _not_ covered by other enabled `Tracing`
+ * objects and _not_ specified by the `--trace-event-categories` flag
+ * will be disabled.
+ */
+ disable(): void;
+ /**
+ * Enables this `Tracing` object for the set of categories covered by
+ * the `Tracing` object.
+ */
+ enable(): void;
+ /**
+ * `true` only if the `Tracing` object has been enabled.
+ */
+ readonly enabled: boolean;
+ }
+ interface CreateTracingOptions {
+ /**
+ * An array of trace category names. Values included in the array are
+ * coerced to a string when possible. An error will be thrown if the
+ * value cannot be coerced.
+ */
+ categories: string[];
+ }
+ /**
+ * Creates and returns a `Tracing` object for the given set of `categories`.
+ *
+ * ```js
+ * const trace_events = require('trace_events');
+ * const categories = ['node.perf', 'node.async_hooks'];
+ * const tracing = trace_events.createTracing({ categories });
+ * tracing.enable();
+ * // do stuff
+ * tracing.disable();
+ * ```
+ * @since v10.0.0
+ * @return .
+ */
+ function createTracing(options: CreateTracingOptions): Tracing;
+ /**
+ * Returns a comma-separated list of all currently-enabled trace event
+ * categories. The current set of enabled trace event categories is determined
+ * by the _union_ of all currently-enabled `Tracing` objects and any categories
+ * enabled using the `--trace-event-categories` flag.
+ *
+ * Given the file `test.js` below, the command`node --trace-event-categories node.perf test.js` will print`'node.async_hooks,node.perf'` to the console.
+ *
+ * ```js
+ * const trace_events = require('trace_events');
+ * const t1 = trace_events.createTracing({ categories: ['node.async_hooks'] });
+ * const t2 = trace_events.createTracing({ categories: ['node.perf'] });
+ * const t3 = trace_events.createTracing({ categories: ['v8'] });
+ *
+ * t1.enable();
+ * t2.enable();
+ *
+ * console.log(trace_events.getEnabledCategories());
+ * ```
+ * @since v10.0.0
+ */
+ function getEnabledCategories(): string | undefined;
+}
+declare module "node:trace_events" {
+ export * from "trace_events";
+}
diff --git a/client/node_modules/@types/node/ts4.8/tty.d.ts b/client/node_modules/@types/node/ts4.8/tty.d.ts
new file mode 100644
index 0000000..c030415
--- /dev/null
+++ b/client/node_modules/@types/node/ts4.8/tty.d.ts
@@ -0,0 +1,206 @@
+/**
+ * The `tty` module provides the `tty.ReadStream` and `tty.WriteStream` classes.
+ * In most cases, it will not be necessary or possible to use this module directly.
+ * However, it can be accessed using:
+ *
+ * ```js
+ * const tty = require('tty');
+ * ```
+ *
+ * When Node.js detects that it is being run with a text terminal ("TTY")
+ * attached, `process.stdin` will, by default, be initialized as an instance of`tty.ReadStream` and both `process.stdout` and `process.stderr` will, by
+ * default, be instances of `tty.WriteStream`. The preferred method of determining
+ * whether Node.js is being run within a TTY context is to check that the value of
+ * the `process.stdout.isTTY` property is `true`:
+ *
+ * ```console
+ * $ node -p -e "Boolean(process.stdout.isTTY)"
+ * true
+ * $ node -p -e "Boolean(process.stdout.isTTY)" | cat
+ * false
+ * ```
+ *
+ * In most cases, there should be little to no reason for an application to
+ * manually create instances of the `tty.ReadStream` and `tty.WriteStream`classes.
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/tty.js)
+ */
+declare module "tty" {
+ import * as net from "node:net";
+ /**
+ * The `tty.isatty()` method returns `true` if the given `fd` is associated with
+ * a TTY and `false` if it is not, including whenever `fd` is not a non-negative
+ * integer.
+ * @since v0.5.8
+ * @param fd A numeric file descriptor
+ */
+ function isatty(fd: number): boolean;
+ /**
+ * Represents the readable side of a TTY. In normal circumstances `process.stdin` will be the only `tty.ReadStream` instance in a Node.js
+ * process and there should be no reason to create additional instances.
+ * @since v0.5.8
+ */
+ class ReadStream extends net.Socket {
+ constructor(fd: number, options?: net.SocketConstructorOpts);
+ /**
+ * A `boolean` that is `true` if the TTY is currently configured to operate as a
+ * raw device. Defaults to `false`.
+ * @since v0.7.7
+ */
+ isRaw: boolean;
+ /**
+ * Allows configuration of `tty.ReadStream` so that it operates as a raw device.
+ *
+ * When in raw mode, input is always available character-by-character, not
+ * including modifiers. Additionally, all special processing of characters by the
+ * terminal is disabled, including echoing input
+ * characters. Ctrl+C will no longer cause a `SIGINT` when
+ * in this mode.
+ * @since v0.7.7
+ * @param mode If `true`, configures the `tty.ReadStream` to operate as a raw device. If `false`, configures the `tty.ReadStream` to operate in its default mode. The `readStream.isRaw`
+ * property will be set to the resulting mode.
+ * @return The read stream instance.
+ */
+ setRawMode(mode: boolean): this;
+ /**
+ * A `boolean` that is always `true` for `tty.ReadStream` instances.
+ * @since v0.5.8
+ */
+ isTTY: boolean;
+ }
+ /**
+ * -1 - to the left from cursor
+ * 0 - the entire line
+ * 1 - to the right from cursor
+ */
+ type Direction = -1 | 0 | 1;
+ /**
+ * Represents the writable side of a TTY. In normal circumstances,`process.stdout` and `process.stderr` will be the only`tty.WriteStream` instances created for a Node.js process and there
+ * should be no reason to create additional instances.
+ * @since v0.5.8
+ */
+ class WriteStream extends net.Socket {
+ constructor(fd: number);
+ addListener(event: string, listener: (...args: any[]) => void): this;
+ addListener(event: "resize", listener: () => void): this;
+ emit(event: string | symbol, ...args: any[]): boolean;
+ emit(event: "resize"): boolean;
+ on(event: string, listener: (...args: any[]) => void): this;
+ on(event: "resize", listener: () => void): this;
+ once(event: string, listener: (...args: any[]) => void): this;
+ once(event: "resize", listener: () => void): this;
+ prependListener(event: string, listener: (...args: any[]) => void): this;
+ prependListener(event: "resize", listener: () => void): this;
+ prependOnceListener(event: string, listener: (...args: any[]) => void): this;
+ prependOnceListener(event: "resize", listener: () => void): this;
+ /**
+ * `writeStream.clearLine()` clears the current line of this `WriteStream` in a
+ * direction identified by `dir`.
+ * @since v0.7.7
+ * @param callback Invoked once the operation completes.
+ * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
+ */
+ clearLine(dir: Direction, callback?: () => void): boolean;
+ /**
+ * `writeStream.clearScreenDown()` clears this `WriteStream` from the current
+ * cursor down.
+ * @since v0.7.7
+ * @param callback Invoked once the operation completes.
+ * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
+ */
+ clearScreenDown(callback?: () => void): boolean;
+ /**
+ * `writeStream.cursorTo()` moves this `WriteStream`'s cursor to the specified
+ * position.
+ * @since v0.7.7
+ * @param callback Invoked once the operation completes.
+ * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
+ */
+ cursorTo(x: number, y?: number, callback?: () => void): boolean;
+ cursorTo(x: number, callback: () => void): boolean;
+ /**
+ * `writeStream.moveCursor()` moves this `WriteStream`'s cursor _relative_ to its
+ * current position.
+ * @since v0.7.7
+ * @param callback Invoked once the operation completes.
+ * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
+ */
+ moveCursor(dx: number, dy: number, callback?: () => void): boolean;
+ /**
+ * Returns:
+ *
+ * * `1` for 2,
+ * * `4` for 16,
+ * * `8` for 256,
+ * * `24` for 16,777,216 colors supported.
+ *
+ * Use this to determine what colors the terminal supports. Due to the nature of
+ * colors in terminals it is possible to either have false positives or false
+ * negatives. It depends on process information and the environment variables that
+ * may lie about what terminal is used.
+ * It is possible to pass in an `env` object to simulate the usage of a specific
+ * terminal. This can be useful to check how specific environment settings behave.
+ *
+ * To enforce a specific color support, use one of the below environment settings.
+ *
+ * * 2 colors: `FORCE_COLOR = 0` (Disables colors)
+ * * 16 colors: `FORCE_COLOR = 1`
+ * * 256 colors: `FORCE_COLOR = 2`
+ * * 16,777,216 colors: `FORCE_COLOR = 3`
+ *
+ * Disabling color support is also possible by using the `NO_COLOR` and`NODE_DISABLE_COLORS` environment variables.
+ * @since v9.9.0
+ * @param [env=process.env] An object containing the environment variables to check. This enables simulating the usage of a specific terminal.
+ */
+ getColorDepth(env?: object): number;
+ /**
+ * Returns `true` if the `writeStream` supports at least as many colors as provided
+ * in `count`. Minimum support is 2 (black and white).
+ *
+ * This has the same false positives and negatives as described in `writeStream.getColorDepth()`.
+ *
+ * ```js
+ * process.stdout.hasColors();
+ * // Returns true or false depending on if `stdout` supports at least 16 colors.
+ * process.stdout.hasColors(256);
+ * // Returns true or false depending on if `stdout` supports at least 256 colors.
+ * process.stdout.hasColors({ TMUX: '1' });
+ * // Returns true.
+ * process.stdout.hasColors(2 ** 24, { TMUX: '1' });
+ * // Returns false (the environment setting pretends to support 2 ** 8 colors).
+ * ```
+ * @since v11.13.0, v10.16.0
+ * @param [count=16] The number of colors that are requested (minimum 2).
+ * @param [env=process.env] An object containing the environment variables to check. This enables simulating the usage of a specific terminal.
+ */
+ hasColors(count?: number): boolean;
+ hasColors(env?: object): boolean;
+ hasColors(count: number, env?: object): boolean;
+ /**
+ * `writeStream.getWindowSize()` returns the size of the TTY
+ * corresponding to this `WriteStream`. The array is of the type`[numColumns, numRows]` where `numColumns` and `numRows` represent the number
+ * of columns and rows in the corresponding TTY.
+ * @since v0.7.7
+ */
+ getWindowSize(): [number, number];
+ /**
+ * A `number` specifying the number of columns the TTY currently has. This property
+ * is updated whenever the `'resize'` event is emitted.
+ * @since v0.7.7
+ */
+ columns: number;
+ /**
+ * A `number` specifying the number of rows the TTY currently has. This property
+ * is updated whenever the `'resize'` event is emitted.
+ * @since v0.7.7
+ */
+ rows: number;
+ /**
+ * A `boolean` that is always `true`.
+ * @since v0.5.8
+ */
+ isTTY: boolean;
+ }
+}
+declare module "node:tty" {
+ export * from "tty";
+}
diff --git a/client/node_modules/@types/node/ts4.8/url.d.ts b/client/node_modules/@types/node/ts4.8/url.d.ts
new file mode 100644
index 0000000..ea7b7b1
--- /dev/null
+++ b/client/node_modules/@types/node/ts4.8/url.d.ts
@@ -0,0 +1,937 @@
+/**
+ * The `url` module provides utilities for URL resolution and parsing. It can be
+ * accessed using:
+ *
+ * ```js
+ * import url from 'url';
+ * ```
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/url.js)
+ */
+declare module "url" {
+ import { Blob as NodeBlob } from "node:buffer";
+ import { ClientRequestArgs } from "node:http";
+ import { ParsedUrlQuery, ParsedUrlQueryInput } from "node:querystring";
+ // Input to `url.format`
+ interface UrlObject {
+ auth?: string | null | undefined;
+ hash?: string | null | undefined;
+ host?: string | null | undefined;
+ hostname?: string | null | undefined;
+ href?: string | null | undefined;
+ pathname?: string | null | undefined;
+ protocol?: string | null | undefined;
+ search?: string | null | undefined;
+ slashes?: boolean | null | undefined;
+ port?: string | number | null | undefined;
+ query?: string | null | ParsedUrlQueryInput | undefined;
+ }
+ // Output of `url.parse`
+ interface Url {
+ auth: string | null;
+ hash: string | null;
+ host: string | null;
+ hostname: string | null;
+ href: string;
+ path: string | null;
+ pathname: string | null;
+ protocol: string | null;
+ search: string | null;
+ slashes: boolean | null;
+ port: string | null;
+ query: string | null | ParsedUrlQuery;
+ }
+ interface UrlWithParsedQuery extends Url {
+ query: ParsedUrlQuery;
+ }
+ interface UrlWithStringQuery extends Url {
+ query: string | null;
+ }
+ /**
+ * The `url.parse()` method takes a URL string, parses it, and returns a URL
+ * object.
+ *
+ * A `TypeError` is thrown if `urlString` is not a string.
+ *
+ * A `URIError` is thrown if the `auth` property is present but cannot be decoded.
+ *
+ * Use of the legacy `url.parse()` method is discouraged. Users should
+ * use the WHATWG `URL` API. Because the `url.parse()` method uses a
+ * lenient, non-standard algorithm for parsing URL strings, security
+ * issues can be introduced. Specifically, issues with [host name spoofing](https://hackerone.com/reports/678487) and
+ * incorrect handling of usernames and passwords have been identified.
+ *
+ * Deprecation of this API has been shelved for now primarily due to the the
+ * inability of the [WHATWG API to parse relative URLs](https://github.com/nodejs/node/issues/12682#issuecomment-1154492373).
+ * [Discussions are ongoing](https://github.com/whatwg/url/issues/531) for the best way to resolve this.
+ *
+ * @since v0.1.25
+ * @param urlString The URL string to parse.
+ * @param [parseQueryString=false] If `true`, the `query` property will always be set to an object returned by the {@link querystring} module's `parse()` method. If `false`, the `query` property
+ * on the returned URL object will be an unparsed, undecoded string.
+ * @param [slashesDenoteHost=false] If `true`, the first token after the literal string `//` and preceding the next `/` will be interpreted as the `host`. For instance, given `//foo/bar`, the
+ * result would be `{host: 'foo', pathname: '/bar'}` rather than `{pathname: '//foo/bar'}`.
+ */
+ function parse(urlString: string): UrlWithStringQuery;
+ function parse(
+ urlString: string,
+ parseQueryString: false | undefined,
+ slashesDenoteHost?: boolean,
+ ): UrlWithStringQuery;
+ function parse(urlString: string, parseQueryString: true, slashesDenoteHost?: boolean): UrlWithParsedQuery;
+ function parse(urlString: string, parseQueryString: boolean, slashesDenoteHost?: boolean): Url;
+ /**
+ * The `url.format()` method returns a formatted URL string derived from`urlObject`.
+ *
+ * ```js
+ * const url = require('url');
+ * url.format({
+ * protocol: 'https',
+ * hostname: 'example.com',
+ * pathname: '/some/path',
+ * query: {
+ * page: 1,
+ * format: 'json'
+ * }
+ * });
+ *
+ * // => 'https://example.com/some/path?page=1&#x26;format=json'
+ * ```
+ *
+ * If `urlObject` is not an object or a string, `url.format()` will throw a `TypeError`.
+ *
+ * The formatting process operates as follows:
+ *
+ * * A new empty string `result` is created.
+ * * If `urlObject.protocol` is a string, it is appended as-is to `result`.
+ * * Otherwise, if `urlObject.protocol` is not `undefined` and is not a string, an `Error` is thrown.
+ * * For all string values of `urlObject.protocol` that _do not end_ with an ASCII
+ * colon (`:`) character, the literal string `:` will be appended to `result`.
+ * * If either of the following conditions is true, then the literal string `//`will be appended to `result`:
+ * * `urlObject.slashes` property is true;
+ * * `urlObject.protocol` begins with `http`, `https`, `ftp`, `gopher`, or`file`;
+ * * If the value of the `urlObject.auth` property is truthy, and either`urlObject.host` or `urlObject.hostname` are not `undefined`, the value of`urlObject.auth` will be coerced into a string
+ * and appended to `result`followed by the literal string `@`.
+ * * If the `urlObject.host` property is `undefined` then:
+ * * If the `urlObject.hostname` is a string, it is appended to `result`.
+ * * Otherwise, if `urlObject.hostname` is not `undefined` and is not a string,
+ * an `Error` is thrown.
+ * * If the `urlObject.port` property value is truthy, and `urlObject.hostname`is not `undefined`:
+ * * The literal string `:` is appended to `result`, and
+ * * The value of `urlObject.port` is coerced to a string and appended to`result`.
+ * * Otherwise, if the `urlObject.host` property value is truthy, the value of`urlObject.host` is coerced to a string and appended to `result`.
+ * * If the `urlObject.pathname` property is a string that is not an empty string:
+ * * If the `urlObject.pathname`_does not start_ with an ASCII forward slash
+ * (`/`), then the literal string `'/'` is appended to `result`.
+ * * The value of `urlObject.pathname` is appended to `result`.
+ * * Otherwise, if `urlObject.pathname` is not `undefined` and is not a string, an `Error` is thrown.
+ * * If the `urlObject.search` property is `undefined` and if the `urlObject.query`property is an `Object`, the literal string `?` is appended to `result`followed by the output of calling the
+ * `querystring` module's `stringify()`method passing the value of `urlObject.query`.
+ * * Otherwise, if `urlObject.search` is a string:
+ * * If the value of `urlObject.search`_does not start_ with the ASCII question
+ * mark (`?`) character, the literal string `?` is appended to `result`.
+ * * The value of `urlObject.search` is appended to `result`.
+ * * Otherwise, if `urlObject.search` is not `undefined` and is not a string, an `Error` is thrown.
+ * * If the `urlObject.hash` property is a string:
+ * * If the value of `urlObject.hash`_does not start_ with the ASCII hash (`#`)
+ * character, the literal string `#` is appended to `result`.
+ * * The value of `urlObject.hash` is appended to `result`.
+ * * Otherwise, if the `urlObject.hash` property is not `undefined` and is not a
+ * string, an `Error` is thrown.
+ * * `result` is returned.
+ * @since v0.1.25
+ * @legacy Use the WHATWG URL API instead.
+ * @param urlObject A URL object (as returned by `url.parse()` or constructed otherwise). If a string, it is converted to an object by passing it to `url.parse()`.
+ */
+ function format(urlObject: URL, options?: URLFormatOptions): string;
+ /**
+ * The `url.format()` method returns a formatted URL string derived from`urlObject`.
+ *
+ * ```js
+ * const url = require('url');
+ * url.format({
+ * protocol: 'https',
+ * hostname: 'example.com',
+ * pathname: '/some/path',
+ * query: {
+ * page: 1,
+ * format: 'json'
+ * }
+ * });
+ *
+ * // => 'https://example.com/some/path?page=1&#x26;format=json'
+ * ```
+ *
+ * If `urlObject` is not an object or a string, `url.format()` will throw a `TypeError`.
+ *
+ * The formatting process operates as follows:
+ *
+ * * A new empty string `result` is created.
+ * * If `urlObject.protocol` is a string, it is appended as-is to `result`.
+ * * Otherwise, if `urlObject.protocol` is not `undefined` and is not a string, an `Error` is thrown.
+ * * For all string values of `urlObject.protocol` that _do not end_ with an ASCII
+ * colon (`:`) character, the literal string `:` will be appended to `result`.
+ * * If either of the following conditions is true, then the literal string `//`will be appended to `result`:
+ * * `urlObject.slashes` property is true;
+ * * `urlObject.protocol` begins with `http`, `https`, `ftp`, `gopher`, or`file`;
+ * * If the value of the `urlObject.auth` property is truthy, and either`urlObject.host` or `urlObject.hostname` are not `undefined`, the value of`urlObject.auth` will be coerced into a string
+ * and appended to `result`followed by the literal string `@`.
+ * * If the `urlObject.host` property is `undefined` then:
+ * * If the `urlObject.hostname` is a string, it is appended to `result`.
+ * * Otherwise, if `urlObject.hostname` is not `undefined` and is not a string,
+ * an `Error` is thrown.
+ * * If the `urlObject.port` property value is truthy, and `urlObject.hostname`is not `undefined`:
+ * * The literal string `:` is appended to `result`, and
+ * * The value of `urlObject.port` is coerced to a string and appended to`result`.
+ * * Otherwise, if the `urlObject.host` property value is truthy, the value of`urlObject.host` is coerced to a string and appended to `result`.
+ * * If the `urlObject.pathname` property is a string that is not an empty string:
+ * * If the `urlObject.pathname`_does not start_ with an ASCII forward slash
+ * (`/`), then the literal string `'/'` is appended to `result`.
+ * * The value of `urlObject.pathname` is appended to `result`.
+ * * Otherwise, if `urlObject.pathname` is not `undefined` and is not a string, an `Error` is thrown.
+ * * If the `urlObject.search` property is `undefined` and if the `urlObject.query`property is an `Object`, the literal string `?` is appended to `result`followed by the output of calling the
+ * `querystring` module's `stringify()`method passing the value of `urlObject.query`.
+ * * Otherwise, if `urlObject.search` is a string:
+ * * If the value of `urlObject.search`_does not start_ with the ASCII question
+ * mark (`?`) character, the literal string `?` is appended to `result`.
+ * * The value of `urlObject.search` is appended to `result`.
+ * * Otherwise, if `urlObject.search` is not `undefined` and is not a string, an `Error` is thrown.
+ * * If the `urlObject.hash` property is a string:
+ * * If the value of `urlObject.hash`_does not start_ with the ASCII hash (`#`)
+ * character, the literal string `#` is appended to `result`.
+ * * The value of `urlObject.hash` is appended to `result`.
+ * * Otherwise, if the `urlObject.hash` property is not `undefined` and is not a
+ * string, an `Error` is thrown.
+ * * `result` is returned.
+ * @since v0.1.25
+ * @legacy Use the WHATWG URL API instead.
+ * @param urlObject A URL object (as returned by `url.parse()` or constructed otherwise). If a string, it is converted to an object by passing it to `url.parse()`.
+ */
+ function format(urlObject: UrlObject | string): string;
+ /**
+ * The `url.resolve()` method resolves a target URL relative to a base URL in a
+ * manner similar to that of a web browser resolving an anchor tag.
+ *
+ * ```js
+ * const url = require('url');
+ * url.resolve('/one/two/three', 'four'); // '/one/two/four'
+ * url.resolve('http://example.com/', '/one'); // 'http://example.com/one'
+ * url.resolve('http://example.com/one', '/two'); // 'http://example.com/two'
+ * ```
+ *
+ * To achieve the same result using the WHATWG URL API:
+ *
+ * ```js
+ * function resolve(from, to) {
+ * const resolvedUrl = new URL(to, new URL(from, 'resolve://'));
+ * if (resolvedUrl.protocol === 'resolve:') {
+ * // `from` is a relative URL.
+ * const { pathname, search, hash } = resolvedUrl;
+ * return pathname + search + hash;
+ * }
+ * return resolvedUrl.toString();
+ * }
+ *
+ * resolve('/one/two/three', 'four'); // '/one/two/four'
+ * resolve('http://example.com/', '/one'); // 'http://example.com/one'
+ * resolve('http://example.com/one', '/two'); // 'http://example.com/two'
+ * ```
+ * @since v0.1.25
+ * @legacy Use the WHATWG URL API instead.
+ * @param from The base URL to use if `to` is a relative URL.
+ * @param to The target URL to resolve.
+ */
+ function resolve(from: string, to: string): string;
+ /**
+ * Returns the [Punycode](https://tools.ietf.org/html/rfc5891#section-4.4) ASCII serialization of the `domain`. If `domain` is an
+ * invalid domain, the empty string is returned.
+ *
+ * It performs the inverse operation to {@link domainToUnicode}.
+ *
+ * This feature is only available if the `node` executable was compiled with `ICU` enabled. If not, the domain names are passed through unchanged.
+ *
+ * ```js
+ * import url from 'url';
+ *
+ * console.log(url.domainToASCII('español.com'));
+ * // Prints xn--espaol-zwa.com
+ * console.log(url.domainToASCII('中文.com'));
+ * // Prints xn--fiq228c.com
+ * console.log(url.domainToASCII('xn--iñvalid.com'));
+ * // Prints an empty string
+ * ```
+ * @since v7.4.0, v6.13.0
+ */
+ function domainToASCII(domain: string): string;
+ /**
+ * Returns the Unicode serialization of the `domain`. If `domain` is an invalid
+ * domain, the empty string is returned.
+ *
+ * It performs the inverse operation to {@link domainToASCII}.
+ *
+ * This feature is only available if the `node` executable was compiled with `ICU` enabled. If not, the domain names are passed through unchanged.
+ *
+ * ```js
+ * import url from 'url';
+ *
+ * console.log(url.domainToUnicode('xn--espaol-zwa.com'));
+ * // Prints español.com
+ * console.log(url.domainToUnicode('xn--fiq228c.com'));
+ * // Prints 中文.com
+ * console.log(url.domainToUnicode('xn--iñvalid.com'));
+ * // Prints an empty string
+ * ```
+ * @since v7.4.0, v6.13.0
+ */
+ function domainToUnicode(domain: string): string;
+ /**
+ * This function ensures the correct decodings of percent-encoded characters as
+ * well as ensuring a cross-platform valid absolute path string.
+ *
+ * ```js
+ * import { fileURLToPath } from 'url';
+ *
+ * const __filename = fileURLToPath(import.meta.url);
+ *
+ * new URL('file:///C:/path/').pathname; // Incorrect: /C:/path/
+ * fileURLToPath('file:///C:/path/'); // Correct: C:\path\ (Windows)
+ *
+ * new URL('file://nas/foo.txt').pathname; // Incorrect: /foo.txt
+ * fileURLToPath('file://nas/foo.txt'); // Correct: \\nas\foo.txt (Windows)
+ *
+ * new URL('file:///你好.txt').pathname; // Incorrect: /%E4%BD%A0%E5%A5%BD.txt
+ * fileURLToPath('file:///你好.txt'); // Correct: /你好.txt (POSIX)
+ *
+ * new URL('file:///hello world').pathname; // Incorrect: /hello%20world
+ * fileURLToPath('file:///hello world'); // Correct: /hello world (POSIX)
+ * ```
+ * @since v10.12.0
+ * @param url The file URL string or URL object to convert to a path.
+ * @return The fully-resolved platform-specific Node.js file path.
+ */
+ function fileURLToPath(url: string | URL): string;
+ /**
+ * This function ensures that `path` is resolved absolutely, and that the URL
+ * control characters are correctly encoded when converting into a File URL.
+ *
+ * ```js
+ * import { pathToFileURL } from 'url';
+ *
+ * new URL('/foo#1', 'file:'); // Incorrect: file:///foo#1
+ * pathToFileURL('/foo#1'); // Correct: file:///foo%231 (POSIX)
+ *
+ * new URL('/some/path%.c', 'file:'); // Incorrect: file:///some/path%.c
+ * pathToFileURL('/some/path%.c'); // Correct: file:///some/path%25.c (POSIX)
+ * ```
+ * @since v10.12.0
+ * @param path The path to convert to a File URL.
+ * @return The file URL object.
+ */
+ function pathToFileURL(path: string): URL;
+ /**
+ * This utility function converts a URL object into an ordinary options object as
+ * expected by the `http.request()` and `https.request()` APIs.
+ *
+ * ```js
+ * import { urlToHttpOptions } from 'url';
+ * const myURL = new URL('https://a:b@測試?abc#foo');
+ *
+ * console.log(urlToHttpOptions(myURL));
+ * /*
+ * {
+ * protocol: 'https:',
+ * hostname: 'xn--g6w251d',
+ * hash: '#foo',
+ * search: '?abc',
+ * pathname: '/',
+ * path: '/?abc',
+ * href: 'https://a:b@xn--g6w251d/?abc#foo',
+ * auth: 'a:b'
+ * }
+ *
+ * ```
+ * @since v15.7.0, v14.18.0
+ * @param url The `WHATWG URL` object to convert to an options object.
+ * @return Options object
+ */
+ function urlToHttpOptions(url: URL): ClientRequestArgs;
+ interface URLFormatOptions {
+ auth?: boolean | undefined;
+ fragment?: boolean | undefined;
+ search?: boolean | undefined;
+ unicode?: boolean | undefined;
+ }
+ /**
+ * Browser-compatible `URL` class, implemented by following the WHATWG URL
+ * Standard. [Examples of parsed URLs](https://url.spec.whatwg.org/#example-url-parsing) may be found in the Standard itself.
+ * The `URL` class is also available on the global object.
+ *
+ * In accordance with browser conventions, all properties of `URL` objects
+ * are implemented as getters and setters on the class prototype, rather than as
+ * data properties on the object itself. Thus, unlike `legacy urlObject` s,
+ * using the `delete` keyword on any properties of `URL` objects (e.g. `delete myURL.protocol`, `delete myURL.pathname`, etc) has no effect but will still
+ * return `true`.
+ * @since v7.0.0, v6.13.0
+ */
+ class URL {
+ /**
+ * Creates a `'blob:nodedata:...'` URL string that represents the given `Blob` object and can be used to retrieve the `Blob` later.
+ *
+ * ```js
+ * const {
+ * Blob,
+ * resolveObjectURL,
+ * } = require('buffer');
+ *
+ * const blob = new Blob(['hello']);
+ * const id = URL.createObjectURL(blob);
+ *
+ * // later...
+ *
+ * const otherBlob = resolveObjectURL(id);
+ * console.log(otherBlob.size);
+ * ```
+ *
+ * The data stored by the registered `Blob` will be retained in memory until`URL.revokeObjectURL()` is called to remove it.
+ *
+ * `Blob` objects are registered within the current thread. If using Worker
+ * Threads, `Blob` objects registered within one Worker will not be available
+ * to other workers or the main thread.
+ * @since v16.7.0
+ * @experimental
+ */
+ static createObjectURL(blob: NodeBlob): string;
+ /**
+ * Removes the stored `Blob` identified by the given ID. Attempting to revoke a
+ * ID that isn’t registered will silently fail.
+ * @since v16.7.0
+ * @experimental
+ * @param id A `'blob:nodedata:...` URL string returned by a prior call to `URL.createObjectURL()`.
+ */
+ static revokeObjectURL(objectUrl: string): void;
+ /**
+ * Checks if an `input` relative to the `base` can be parsed to a `URL`.
+ *
+ * ```js
+ * const isValid = URL.canParse('/foo', 'https://example.org/'); // true
+ *
+ * const isNotValid = URL.canParse('/foo'); // false
+ * ```
+ * @since v18.17.0
+ * @param input The absolute or relative input URL to parse. If `input` is relative, then `base` is required. If `input` is absolute, the `base` is ignored. If `input` is not a string, it is
+ * `converted to a string` first.
+ * @param base The base URL to resolve against if the `input` is not absolute. If `base` is not a string, it is `converted to a string` first.
+ */
+ static canParse(input: string, base?: string): boolean;
+ constructor(input: string, base?: string | URL);
+ /**
+ * Gets and sets the fragment portion of the URL.
+ *
+ * ```js
+ * const myURL = new URL('https://example.org/foo#bar');
+ * console.log(myURL.hash);
+ * // Prints #bar
+ *
+ * myURL.hash = 'baz';
+ * console.log(myURL.href);
+ * // Prints https://example.org/foo#baz
+ * ```
+ *
+ * Invalid URL characters included in the value assigned to the `hash` property
+ * are `percent-encoded`. The selection of which characters to
+ * percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce.
+ */
+ hash: string;
+ /**
+ * Gets and sets the host portion of the URL.
+ *
+ * ```js
+ * const myURL = new URL('https://example.org:81/foo');
+ * console.log(myURL.host);
+ * // Prints example.org:81
+ *
+ * myURL.host = 'example.com:82';
+ * console.log(myURL.href);
+ * // Prints https://example.com:82/foo
+ * ```
+ *
+ * Invalid host values assigned to the `host` property are ignored.
+ */
+ host: string;
+ /**
+ * Gets and sets the host name portion of the URL. The key difference between`url.host` and `url.hostname` is that `url.hostname` does _not_ include the
+ * port.
+ *
+ * ```js
+ * const myURL = new URL('https://example.org:81/foo');
+ * console.log(myURL.hostname);
+ * // Prints example.org
+ *
+ * // Setting the hostname does not change the port
+ * myURL.hostname = 'example.com:82';
+ * console.log(myURL.href);
+ * // Prints https://example.com:81/foo
+ *
+ * // Use myURL.host to change the hostname and port
+ * myURL.host = 'example.org:82';
+ * console.log(myURL.href);
+ * // Prints https://example.org:82/foo
+ * ```
+ *
+ * Invalid host name values assigned to the `hostname` property are ignored.
+ */
+ hostname: string;
+ /**
+ * Gets and sets the serialized URL.
+ *
+ * ```js
+ * const myURL = new URL('https://example.org/foo');
+ * console.log(myURL.href);
+ * // Prints https://example.org/foo
+ *
+ * myURL.href = 'https://example.com/bar';
+ * console.log(myURL.href);
+ * // Prints https://example.com/bar
+ * ```
+ *
+ * Getting the value of the `href` property is equivalent to calling {@link toString}.
+ *
+ * Setting the value of this property to a new value is equivalent to creating a
+ * new `URL` object using `new URL(value)`. Each of the `URL`object's properties will be modified.
+ *
+ * If the value assigned to the `href` property is not a valid URL, a `TypeError`will be thrown.
+ */
+ href: string;
+ /**
+ * Gets the read-only serialization of the URL's origin.
+ *
+ * ```js
+ * const myURL = new URL('https://example.org/foo/bar?baz');
+ * console.log(myURL.origin);
+ * // Prints https://example.org
+ * ```
+ *
+ * ```js
+ * const idnURL = new URL('https://測試');
+ * console.log(idnURL.origin);
+ * // Prints https://xn--g6w251d
+ *
+ * console.log(idnURL.hostname);
+ * // Prints xn--g6w251d
+ * ```
+ */
+ readonly origin: string;
+ /**
+ * Gets and sets the password portion of the URL.
+ *
+ * ```js
+ * const myURL = new URL('https://abc:xyz@example.com');
+ * console.log(myURL.password);
+ * // Prints xyz
+ *
+ * myURL.password = '123';
+ * console.log(myURL.href);
+ * // Prints https://abc:123@example.com
+ * ```
+ *
+ * Invalid URL characters included in the value assigned to the `password` property
+ * are `percent-encoded`. The selection of which characters to
+ * percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce.
+ */
+ password: string;
+ /**
+ * Gets and sets the path portion of the URL.
+ *
+ * ```js
+ * const myURL = new URL('https://example.org/abc/xyz?123');
+ * console.log(myURL.pathname);
+ * // Prints /abc/xyz
+ *
+ * myURL.pathname = '/abcdef';
+ * console.log(myURL.href);
+ * // Prints https://example.org/abcdef?123
+ * ```
+ *
+ * Invalid URL characters included in the value assigned to the `pathname`property are `percent-encoded`. The selection of which characters
+ * to percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce.
+ */
+ pathname: string;
+ /**
+ * Gets and sets the port portion of the URL.
+ *
+ * The port value may be a number or a string containing a number in the range`0` to `65535` (inclusive). Setting the value to the default port of the`URL` objects given `protocol` will
+ * result in the `port` value becoming
+ * the empty string (`''`).
+ *
+ * The port value can be an empty string in which case the port depends on
+ * the protocol/scheme:
+ *
+ * <omitted>
+ *
+ * Upon assigning a value to the port, the value will first be converted to a
+ * string using `.toString()`.
+ *
+ * If that string is invalid but it begins with a number, the leading number is
+ * assigned to `port`.
+ * If the number lies outside the range denoted above, it is ignored.
+ *
+ * ```js
+ * const myURL = new URL('https://example.org:8888');
+ * console.log(myURL.port);
+ * // Prints 8888
+ *
+ * // Default ports are automatically transformed to the empty string
+ * // (HTTPS protocol's default port is 443)
+ * myURL.port = '443';
+ * console.log(myURL.port);
+ * // Prints the empty string
+ * console.log(myURL.href);
+ * // Prints https://example.org/
+ *
+ * myURL.port = 1234;
+ * console.log(myURL.port);
+ * // Prints 1234
+ * console.log(myURL.href);
+ * // Prints https://example.org:1234/
+ *
+ * // Completely invalid port strings are ignored
+ * myURL.port = 'abcd';
+ * console.log(myURL.port);
+ * // Prints 1234
+ *
+ * // Leading numbers are treated as a port number
+ * myURL.port = '5678abcd';
+ * console.log(myURL.port);
+ * // Prints 5678
+ *
+ * // Non-integers are truncated
+ * myURL.port = 1234.5678;
+ * console.log(myURL.port);
+ * // Prints 1234
+ *
+ * // Out-of-range numbers which are not represented in scientific notation
+ * // will be ignored.
+ * myURL.port = 1e10; // 10000000000, will be range-checked as described below
+ * console.log(myURL.port);
+ * // Prints 1234
+ * ```
+ *
+ * Numbers which contain a decimal point,
+ * such as floating-point numbers or numbers in scientific notation,
+ * are not an exception to this rule.
+ * Leading numbers up to the decimal point will be set as the URL's port,
+ * assuming they are valid:
+ *
+ * ```js
+ * myURL.port = 4.567e21;
+ * console.log(myURL.port);
+ * // Prints 4 (because it is the leading number in the string '4.567e21')
+ * ```
+ */
+ port: string;
+ /**
+ * Gets and sets the protocol portion of the URL.
+ *
+ * ```js
+ * const myURL = new URL('https://example.org');
+ * console.log(myURL.protocol);
+ * // Prints https:
+ *
+ * myURL.protocol = 'ftp';
+ * console.log(myURL.href);
+ * // Prints ftp://example.org/
+ * ```
+ *
+ * Invalid URL protocol values assigned to the `protocol` property are ignored.
+ */
+ protocol: string;
+ /**
+ * Gets and sets the serialized query portion of the URL.
+ *
+ * ```js
+ * const myURL = new URL('https://example.org/abc?123');
+ * console.log(myURL.search);
+ * // Prints ?123
+ *
+ * myURL.search = 'abc=xyz';
+ * console.log(myURL.href);
+ * // Prints https://example.org/abc?abc=xyz
+ * ```
+ *
+ * Any invalid URL characters appearing in the value assigned the `search`property will be `percent-encoded`. The selection of which
+ * characters to percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce.
+ */
+ search: string;
+ /**
+ * Gets the `URLSearchParams` object representing the query parameters of the
+ * URL. This property is read-only but the `URLSearchParams` object it provides
+ * can be used to mutate the URL instance; to replace the entirety of query
+ * parameters of the URL, use the {@link search} setter. See `URLSearchParams` documentation for details.
+ *
+ * Use care when using `.searchParams` to modify the `URL` because,
+ * per the WHATWG specification, the `URLSearchParams` object uses
+ * different rules to determine which characters to percent-encode. For
+ * instance, the `URL` object will not percent encode the ASCII tilde (`~`)
+ * character, while `URLSearchParams` will always encode it:
+ *
+ * ```js
+ * const myUrl = new URL('https://example.org/abc?foo=~bar');
+ *
+ * console.log(myUrl.search); // prints ?foo=~bar
+ *
+ * // Modify the URL via searchParams...
+ * myUrl.searchParams.sort();
+ *
+ * console.log(myUrl.search); // prints ?foo=%7Ebar
+ * ```
+ */
+ readonly searchParams: URLSearchParams;
+ /**
+ * Gets and sets the username portion of the URL.
+ *
+ * ```js
+ * const myURL = new URL('https://abc:xyz@example.com');
+ * console.log(myURL.username);
+ * // Prints abc
+ *
+ * myURL.username = '123';
+ * console.log(myURL.href);
+ * // Prints https://123:xyz@example.com/
+ * ```
+ *
+ * Any invalid URL characters appearing in the value assigned the `username`property will be `percent-encoded`. The selection of which
+ * characters to percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce.
+ */
+ username: string;
+ /**
+ * The `toString()` method on the `URL` object returns the serialized URL. The
+ * value returned is equivalent to that of {@link href} and {@link toJSON}.
+ */
+ toString(): string;
+ /**
+ * The `toJSON()` method on the `URL` object returns the serialized URL. The
+ * value returned is equivalent to that of {@link href} and {@link toString}.
+ *
+ * This method is automatically called when an `URL` object is serialized
+ * with [`JSON.stringify()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify).
+ *
+ * ```js
+ * const myURLs = [
+ * new URL('https://www.example.com'),
+ * new URL('https://test.example.org'),
+ * ];
+ * console.log(JSON.stringify(myURLs));
+ * // Prints ["https://www.example.com/","https://test.example.org/"]
+ * ```
+ */
+ toJSON(): string;
+ }
+ /**
+ * The `URLSearchParams` API provides read and write access to the query of a`URL`. The `URLSearchParams` class can also be used standalone with one of the
+ * four following constructors.
+ * The `URLSearchParams` class is also available on the global object.
+ *
+ * The WHATWG `URLSearchParams` interface and the `querystring` module have
+ * similar purpose, but the purpose of the `querystring` module is more
+ * general, as it allows the customization of delimiter characters (`&#x26;` and `=`).
+ * On the other hand, this API is designed purely for URL query strings.
+ *
+ * ```js
+ * const myURL = new URL('https://example.org/?abc=123');
+ * console.log(myURL.searchParams.get('abc'));
+ * // Prints 123
+ *
+ * myURL.searchParams.append('abc', 'xyz');
+ * console.log(myURL.href);
+ * // Prints https://example.org/?abc=123&#x26;abc=xyz
+ *
+ * myURL.searchParams.delete('abc');
+ * myURL.searchParams.set('a', 'b');
+ * console.log(myURL.href);
+ * // Prints https://example.org/?a=b
+ *
+ * const newSearchParams = new URLSearchParams(myURL.searchParams);
+ * // The above is equivalent to
+ * // const newSearchParams = new URLSearchParams(myURL.search);
+ *
+ * newSearchParams.append('a', 'c');
+ * console.log(myURL.href);
+ * // Prints https://example.org/?a=b
+ * console.log(newSearchParams.toString());
+ * // Prints a=b&#x26;a=c
+ *
+ * // newSearchParams.toString() is implicitly called
+ * myURL.search = newSearchParams;
+ * console.log(myURL.href);
+ * // Prints https://example.org/?a=b&#x26;a=c
+ * newSearchParams.delete('a');
+ * console.log(myURL.href);
+ * // Prints https://example.org/?a=b&#x26;a=c
+ * ```
+ * @since v7.5.0, v6.13.0
+ */
+ class URLSearchParams implements Iterable<[string, string]> {
+ constructor(
+ init?:
+ | URLSearchParams
+ | string
+ | Record<string, string | readonly string[]>
+ | Iterable<[string, string]>
+ | ReadonlyArray<[string, string]>,
+ );
+ /**
+ * Append a new name-value pair to the query string.
+ */
+ append(name: string, value: string): void;
+ /**
+ * If `value` is provided, removes all name-value pairs
+ * where name is `name` and value is `value`..
+ *
+ * If `value` is not provided, removes all name-value pairs whose name is `name`.
+ */
+ delete(name: string, value?: string): void;
+ /**
+ * Returns an ES6 `Iterator` over each of the name-value pairs in the query.
+ * Each item of the iterator is a JavaScript `Array`. The first item of the `Array`is the `name`, the second item of the `Array` is the `value`.
+ *
+ * Alias for `urlSearchParams[@@iterator]()`.
+ */
+ entries(): IterableIterator<[string, string]>;
+ /**
+ * Iterates over each name-value pair in the query and invokes the given function.
+ *
+ * ```js
+ * const myURL = new URL('https://example.org/?a=b&#x26;c=d');
+ * myURL.searchParams.forEach((value, name, searchParams) => {
+ * console.log(name, value, myURL.searchParams === searchParams);
+ * });
+ * // Prints:
+ * // a b true
+ * // c d true
+ * ```
+ * @param fn Invoked for each name-value pair in the query
+ * @param thisArg To be used as `this` value for when `fn` is called
+ */
+ forEach<TThis = this>(
+ callback: (this: TThis, value: string, name: string, searchParams: URLSearchParams) => void,
+ thisArg?: TThis,
+ ): void;
+ /**
+ * Returns the value of the first name-value pair whose name is `name`. If there
+ * are no such pairs, `null` is returned.
+ * @return or `null` if there is no name-value pair with the given `name`.
+ */
+ get(name: string): string | null;
+ /**
+ * Returns the values of all name-value pairs whose name is `name`. If there are
+ * no such pairs, an empty array is returned.
+ */
+ getAll(name: string): string[];
+ /**
+ * Checks if the `URLSearchParams` object contains key-value pair(s) based on`name` and an optional `value` argument.
+ *
+ * If `value` is provided, returns `true` when name-value pair with
+ * same `name` and `value` exists.
+ *
+ * If `value` is not provided, returns `true` if there is at least one name-value
+ * pair whose name is `name`.
+ */
+ has(name: string, value?: string): boolean;
+ /**
+ * Returns an ES6 `Iterator` over the names of each name-value pair.
+ *
+ * ```js
+ * const params = new URLSearchParams('foo=bar&#x26;foo=baz');
+ * for (const name of params.keys()) {
+ * console.log(name);
+ * }
+ * // Prints:
+ * // foo
+ * // foo
+ * ```
+ */
+ keys(): IterableIterator<string>;
+ /**
+ * Sets the value in the `URLSearchParams` object associated with `name` to`value`. If there are any pre-existing name-value pairs whose names are `name`,
+ * set the first such pair's value to `value` and remove all others. If not,
+ * append the name-value pair to the query string.
+ *
+ * ```js
+ * const params = new URLSearchParams();
+ * params.append('foo', 'bar');
+ * params.append('foo', 'baz');
+ * params.append('abc', 'def');
+ * console.log(params.toString());
+ * // Prints foo=bar&#x26;foo=baz&#x26;abc=def
+ *
+ * params.set('foo', 'def');
+ * params.set('xyz', 'opq');
+ * console.log(params.toString());
+ * // Prints foo=def&#x26;abc=def&#x26;xyz=opq
+ * ```
+ */
+ set(name: string, value: string): void;
+ /**
+ * The total number of parameter entries.
+ * @since v18.16.0
+ */
+ readonly size: number;
+ /**
+ * Sort all existing name-value pairs in-place by their names. Sorting is done
+ * with a [stable sorting algorithm](https://en.wikipedia.org/wiki/Sorting_algorithm#Stability), so relative order between name-value pairs
+ * with the same name is preserved.
+ *
+ * This method can be used, in particular, to increase cache hits.
+ *
+ * ```js
+ * const params = new URLSearchParams('query[]=abc&#x26;type=search&#x26;query[]=123');
+ * params.sort();
+ * console.log(params.toString());
+ * // Prints query%5B%5D=abc&#x26;query%5B%5D=123&#x26;type=search
+ * ```
+ * @since v7.7.0, v6.13.0
+ */
+ sort(): void;
+ /**
+ * Returns the search parameters serialized as a string, with characters
+ * percent-encoded where necessary.
+ */
+ toString(): string;
+ /**
+ * Returns an ES6 `Iterator` over the values of each name-value pair.
+ */
+ values(): IterableIterator<string>;
+ [Symbol.iterator](): IterableIterator<[string, string]>;
+ }
+ import { URL as _URL, URLSearchParams as _URLSearchParams } from "url";
+ global {
+ interface URLSearchParams extends _URLSearchParams {}
+ interface URL extends _URL {}
+ interface Global {
+ URL: typeof _URL;
+ URLSearchParams: typeof _URLSearchParams;
+ }
+ /**
+ * `URL` class is a global reference for `require('url').URL`
+ * https://nodejs.org/api/url.html#the-whatwg-url-api
+ * @since v10.0.0
+ */
+ var URL: typeof globalThis extends {
+ onmessage: any;
+ URL: infer T;
+ } ? T
+ : typeof _URL;
+ /**
+ * `URLSearchParams` class is a global reference for `require('url').URLSearchParams`
+ * https://nodejs.org/api/url.html#class-urlsearchparams
+ * @since v10.0.0
+ */
+ var URLSearchParams: typeof globalThis extends {
+ onmessage: any;
+ URLSearchParams: infer T;
+ } ? T
+ : typeof _URLSearchParams;
+ }
+}
+declare module "node:url" {
+ export * from "url";
+}
diff --git a/client/node_modules/@types/node/ts4.8/util.d.ts b/client/node_modules/@types/node/ts4.8/util.d.ts
new file mode 100644
index 0000000..ed3fdb2
--- /dev/null
+++ b/client/node_modules/@types/node/ts4.8/util.d.ts
@@ -0,0 +1,2078 @@
+/**
+ * The `util` module supports the needs of Node.js internal APIs. Many of the
+ * utilities are useful for application and module developers as well. To access
+ * it:
+ *
+ * ```js
+ * const util = require('util');
+ * ```
+ * @see [source](https://github.com/nodejs/node/blob/v18.x/lib/util.js)
+ */
+declare module "util" {
+ import * as types from "node:util/types";
+ export interface InspectOptions {
+ /**
+ * If `true`, object's non-enumerable symbols and properties are included in the formatted result.
+ * `WeakMap` and `WeakSet` entries are also included as well as user defined prototype properties (excluding method properties).
+ * @default false
+ */
+ showHidden?: boolean | undefined;
+ /**
+ * Specifies the number of times to recurse while formatting object.
+ * This is useful for inspecting large objects.
+ * To recurse up to the maximum call stack size pass `Infinity` or `null`.
+ * @default 2
+ */
+ depth?: number | null | undefined;
+ /**
+ * If `true`, the output is styled with ANSI color codes. Colors are customizable.
+ */
+ colors?: boolean | undefined;
+ /**
+ * If `false`, `[util.inspect.custom](depth, opts, inspect)` functions are not invoked.
+ * @default true
+ */
+ customInspect?: boolean | undefined;
+ /**
+ * If `true`, `Proxy` inspection includes the target and handler objects.
+ * @default false
+ */
+ showProxy?: boolean | undefined;
+ /**
+ * Specifies the maximum number of `Array`, `TypedArray`, `WeakMap`, and `WeakSet` elements
+ * to include when formatting. Set to `null` or `Infinity` to show all elements.
+ * Set to `0` or negative to show no elements.
+ * @default 100
+ */
+ maxArrayLength?: number | null | undefined;
+ /**
+ * Specifies the maximum number of characters to
+ * include when formatting. Set to `null` or `Infinity` to show all elements.
+ * Set to `0` or negative to show no characters.
+ * @default 10000
+ */
+ maxStringLength?: number | null | undefined;
+ /**
+ * The length at which input values are split across multiple lines.
+ * Set to `Infinity` to format the input as a single line
+ * (in combination with `compact` set to `true` or any number >= `1`).
+ * @default 80
+ */
+ breakLength?: number | undefined;
+ /**
+ * Setting this to `false` causes each object key
+ * to be displayed on a new line. It will also add new lines to text that is
+ * longer than `breakLength`. If set to a number, the most `n` inner elements
+ * are united on a single line as long as all properties fit into
+ * `breakLength`. Short array elements are also grouped together. Note that no
+ * text will be reduced below 16 characters, no matter the `breakLength` size.
+ * For more information, see the example below.
+ * @default true
+ */
+ compact?: boolean | number | undefined;
+ /**
+ * If set to `true` or a function, all properties of an object, and `Set` and `Map`
+ * entries are sorted in the resulting string.
+ * If set to `true` the default sort is used.
+ * If set to a function, it is used as a compare function.
+ */
+ sorted?: boolean | ((a: string, b: string) => number) | undefined;
+ /**
+ * If set to `true`, getters are going to be
+ * inspected as well. If set to `'get'` only getters without setter are going
+ * to be inspected. If set to `'set'` only getters having a corresponding
+ * setter are going to be inspected. This might cause side effects depending on
+ * the getter function.
+ * @default false
+ */
+ getters?: "get" | "set" | boolean | undefined;
+ /**
+ * If set to `true`, an underscore is used to separate every three digits in all bigints and numbers.
+ * @default false
+ */
+ numericSeparator?: boolean | undefined;
+ }
+ export type Style =
+ | "special"
+ | "number"
+ | "bigint"
+ | "boolean"
+ | "undefined"
+ | "null"
+ | "string"
+ | "symbol"
+ | "date"
+ | "regexp"
+ | "module";
+ export type CustomInspectFunction = (depth: number, options: InspectOptionsStylized) => any; // TODO: , inspect: inspect
+ export interface InspectOptionsStylized extends InspectOptions {
+ stylize(text: string, styleType: Style): string;
+ }
+ /**
+ * The `util.format()` method returns a formatted string using the first argument
+ * as a `printf`\-like format string which can contain zero or more format
+ * specifiers. Each specifier is replaced with the converted value from the
+ * corresponding argument. Supported specifiers are:
+ *
+ * If a specifier does not have a corresponding argument, it is not replaced:
+ *
+ * ```js
+ * util.format('%s:%s', 'foo');
+ * // Returns: 'foo:%s'
+ * ```
+ *
+ * Values that are not part of the format string are formatted using`util.inspect()` if their type is not `string`.
+ *
+ * If there are more arguments passed to the `util.format()` method than the
+ * number of specifiers, the extra arguments are concatenated to the returned
+ * string, separated by spaces:
+ *
+ * ```js
+ * util.format('%s:%s', 'foo', 'bar', 'baz');
+ * // Returns: 'foo:bar baz'
+ * ```
+ *
+ * If the first argument does not contain a valid format specifier, `util.format()`returns a string that is the concatenation of all arguments separated by spaces:
+ *
+ * ```js
+ * util.format(1, 2, 3);
+ * // Returns: '1 2 3'
+ * ```
+ *
+ * If only one argument is passed to `util.format()`, it is returned as it is
+ * without any formatting:
+ *
+ * ```js
+ * util.format('%% %s');
+ * // Returns: '%% %s'
+ * ```
+ *
+ * `util.format()` is a synchronous method that is intended as a debugging tool.
+ * Some input values can have a significant performance overhead that can block the
+ * event loop. Use this function with care and never in a hot code path.
+ * @since v0.5.3
+ * @param format A `printf`-like format string.
+ */
+ export function format(format?: any, ...param: any[]): string;
+ /**
+ * This function is identical to {@link format}, except in that it takes
+ * an `inspectOptions` argument which specifies options that are passed along to {@link inspect}.
+ *
+ * ```js
+ * util.formatWithOptions({ colors: true }, 'See object %O', { foo: 42 });
+ * // Returns 'See object { foo: 42 }', where `42` is colored as a number
+ * // when printed to a terminal.
+ * ```
+ * @since v10.0.0
+ */
+ export function formatWithOptions(inspectOptions: InspectOptions, format?: any, ...param: any[]): string;
+ /**
+ * Returns the string name for a numeric error code that comes from a Node.js API.
+ * The mapping between error codes and error names is platform-dependent.
+ * See `Common System Errors` for the names of common errors.
+ *
+ * ```js
+ * fs.access('file/that/does/not/exist', (err) => {
+ * const name = util.getSystemErrorName(err.errno);
+ * console.error(name); // ENOENT
+ * });
+ * ```
+ * @since v9.7.0
+ */
+ export function getSystemErrorName(err: number): string;
+ /**
+ * Returns a Map of all system error codes available from the Node.js API.
+ * The mapping between error codes and error names is platform-dependent.
+ * See `Common System Errors` for the names of common errors.
+ *
+ * ```js
+ * fs.access('file/that/does/not/exist', (err) => {
+ * const errorMap = util.getSystemErrorMap();
+ * const name = errorMap.get(err.errno);
+ * console.error(name); // ENOENT
+ * });
+ * ```
+ * @since v16.0.0, v14.17.0
+ */
+ export function getSystemErrorMap(): Map<number, [string, string]>;
+ /**
+ * The `util.log()` method prints the given `string` to `stdout` with an included
+ * timestamp.
+ *
+ * ```js
+ * const util = require('util');
+ *
+ * util.log('Timestamped message.');
+ * ```
+ * @since v0.3.0
+ * @deprecated Since v6.0.0 - Use a third party module instead.
+ */
+ export function log(string: string): void;
+ /**
+ * Returns the `string` after replacing any surrogate code points
+ * (or equivalently, any unpaired surrogate code units) with the
+ * Unicode "replacement character" U+FFFD.
+ * @since v16.8.0, v14.18.0
+ */
+ export function toUSVString(string: string): string;
+ /**
+ * Creates and returns an `AbortController` instance whose `AbortSignal` is marked
+ * as transferable and can be used with `structuredClone()` or `postMessage()`.
+ * @since v18.11.0
+ * @returns A transferable AbortController
+ */
+ export function transferableAbortController(): AbortController;
+ /**
+ * Marks the given {AbortSignal} as transferable so that it can be used with
+ * `structuredClone()` and `postMessage()`.
+ *
+ * ```js
+ * const signal = transferableAbortSignal(AbortSignal.timeout(100));
+ * const channel = new MessageChannel();
+ * channel.port2.postMessage(signal, [signal]);
+ * ```
+ * @since v18.11.0
+ * @param signal The AbortSignal
+ * @returns The same AbortSignal
+ */
+ export function transferableAbortSignal(signal: AbortSignal): AbortSignal;
+ /**
+ * Listens to abort event on the provided `signal` and returns a promise that is fulfilled when the `signal` is aborted.
+ * If the passed `resource` is garbage collected before the `signal` is aborted, the returned promise shall remain pending indefinitely.
+ * @param resource Any non-null entity, reference to which is held weakly.
+ */
+ export function aborted(signal: AbortSignal, resource: any): Promise<void>;
+ /**
+ * The `util.inspect()` method returns a string representation of `object` that is
+ * intended for debugging. The output of `util.inspect` may change at any time
+ * and should not be depended upon programmatically. Additional `options` may be
+ * passed that alter the result.`util.inspect()` will use the constructor's name and/or `@@toStringTag` to make
+ * an identifiable tag for an inspected value.
+ *
+ * ```js
+ * class Foo {
+ * get [Symbol.toStringTag]() {
+ * return 'bar';
+ * }
+ * }
+ *
+ * class Bar {}
+ *
+ * const baz = Object.create(null, { [Symbol.toStringTag]: { value: 'foo' } });
+ *
+ * util.inspect(new Foo()); // 'Foo [bar] {}'
+ * util.inspect(new Bar()); // 'Bar {}'
+ * util.inspect(baz); // '[foo] {}'
+ * ```
+ *
+ * Circular references point to their anchor by using a reference index:
+ *
+ * ```js
+ * const { inspect } = require('util');
+ *
+ * const obj = {};
+ * obj.a = [obj];
+ * obj.b = {};
+ * obj.b.inner = obj.b;
+ * obj.b.obj = obj;
+ *
+ * console.log(inspect(obj));
+ * // <ref *1> {
+ * // a: [ [Circular *1] ],
+ * // b: <ref *2> { inner: [Circular *2], obj: [Circular *1] }
+ * // }
+ * ```
+ *
+ * The following example inspects all properties of the `util` object:
+ *
+ * ```js
+ * const util = require('util');
+ *
+ * console.log(util.inspect(util, { showHidden: true, depth: null }));
+ * ```
+ *
+ * The following example highlights the effect of the `compact` option:
+ *
+ * ```js
+ * const util = require('util');
+ *
+ * const o = {
+ * a: [1, 2, [[
+ * 'Lorem ipsum dolor sit amet,\nconsectetur adipiscing elit, sed do ' +
+ * 'eiusmod \ntempor incididunt ut labore et dolore magna aliqua.',
+ * 'test',
+ * 'foo']], 4],
+ * b: new Map([['za', 1], ['zb', 'test']])
+ * };
+ * console.log(util.inspect(o, { compact: true, depth: 5, breakLength: 80 }));
+ *
+ * // { a:
+ * // [ 1,
+ * // 2,
+ * // [ [ 'Lorem ipsum dolor sit amet,\nconsectetur [...]', // A long line
+ * // 'test',
+ * // 'foo' ] ],
+ * // 4 ],
+ * // b: Map(2) { 'za' => 1, 'zb' => 'test' } }
+ *
+ * // Setting `compact` to false or an integer creates more reader friendly output.
+ * console.log(util.inspect(o, { compact: false, depth: 5, breakLength: 80 }));
+ *
+ * // {
+ * // a: [
+ * // 1,
+ * // 2,
+ * // [
+ * // [
+ * // 'Lorem ipsum dolor sit amet,\n' +
+ * // 'consectetur adipiscing elit, sed do eiusmod \n' +
+ * // 'tempor incididunt ut labore et dolore magna aliqua.',
+ * // 'test',
+ * // 'foo'
+ * // ]
+ * // ],
+ * // 4
+ * // ],
+ * // b: Map(2) {
+ * // 'za' => 1,
+ * // 'zb' => 'test'
+ * // }
+ * // }
+ *
+ * // Setting `breakLength` to e.g. 150 will print the "Lorem ipsum" text in a
+ * // single line.
+ * ```
+ *
+ * The `showHidden` option allows [`WeakMap`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap) and
+ * [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) entries to be
+ * inspected. If there are more entries than `maxArrayLength`, there is no
+ * guarantee which entries are displayed. That means retrieving the same [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) entries twice may
+ * result in different output. Furthermore, entries
+ * with no remaining strong references may be garbage collected at any time.
+ *
+ * ```js
+ * const { inspect } = require('util');
+ *
+ * const obj = { a: 1 };
+ * const obj2 = { b: 2 };
+ * const weakSet = new WeakSet([obj, obj2]);
+ *
+ * console.log(inspect(weakSet, { showHidden: true }));
+ * // WeakSet { { a: 1 }, { b: 2 } }
+ * ```
+ *
+ * The `sorted` option ensures that an object's property insertion order does not
+ * impact the result of `util.inspect()`.
+ *
+ * ```js
+ * const { inspect } = require('util');
+ * const assert = require('assert');
+ *
+ * const o1 = {
+ * b: [2, 3, 1],
+ * a: '`a` comes before `b`',
+ * c: new Set([2, 3, 1])
+ * };
+ * console.log(inspect(o1, { sorted: true }));
+ * // { a: '`a` comes before `b`', b: [ 2, 3, 1 ], c: Set(3) { 1, 2, 3 } }
+ * console.log(inspect(o1, { sorted: (a, b) => b.localeCompare(a) }));
+ * // { c: Set(3) { 3, 2, 1 }, b: [ 2, 3, 1 ], a: '`a` comes before `b`' }
+ *
+ * const o2 = {
+ * c: new Set([2, 1, 3]),
+ * a: '`a` comes before `b`',
+ * b: [2, 3, 1]
+ * };
+ * assert.strict.equal(
+ * inspect(o1, { sorted: true }),
+ * inspect(o2, { sorted: true })
+ * );
+ * ```
+ *
+ * The `numericSeparator` option adds an underscore every three digits to all
+ * numbers.
+ *
+ * ```js
+ * const { inspect } = require('util');
+ *
+ * const thousand = 1_000;
+ * const million = 1_000_000;
+ * const bigNumber = 123_456_789n;
+ * const bigDecimal = 1_234.123_45;
+ *
+ * console.log(thousand, million, bigNumber, bigDecimal);
+ * // 1_000 1_000_000 123_456_789n 1_234.123_45
+ * ```
+ *
+ * `util.inspect()` is a synchronous method intended for debugging. Its maximum
+ * output length is approximately 128 MB. Inputs that result in longer output will
+ * be truncated.
+ * @since v0.3.0
+ * @param object Any JavaScript primitive or `Object`.
+ * @return The representation of `object`.
+ */
+ export function inspect(object: any, showHidden?: boolean, depth?: number | null, color?: boolean): string;
+ export function inspect(object: any, options?: InspectOptions): string;
+ export namespace inspect {
+ let colors: NodeJS.Dict<[number, number]>;
+ let styles: {
+ [K in Style]: string;
+ };
+ let defaultOptions: InspectOptions;
+ /**
+ * Allows changing inspect settings from the repl.
+ */
+ let replDefaults: InspectOptions;
+ /**
+ * That can be used to declare custom inspect functions.
+ */
+ const custom: unique symbol;
+ }
+ /**
+ * Alias for [`Array.isArray()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray).
+ *
+ * Returns `true` if the given `object` is an `Array`. Otherwise, returns `false`.
+ *
+ * ```js
+ * const util = require('util');
+ *
+ * util.isArray([]);
+ * // Returns: true
+ * util.isArray(new Array());
+ * // Returns: true
+ * util.isArray({});
+ * // Returns: false
+ * ```
+ * @since v0.6.0
+ * @deprecated Since v4.0.0 - Use `isArray` instead.
+ */
+ export function isArray(object: unknown): object is unknown[];
+ /**
+ * Returns `true` if the given `object` is a `RegExp`. Otherwise, returns `false`.
+ *
+ * ```js
+ * const util = require('util');
+ *
+ * util.isRegExp(/some regexp/);
+ * // Returns: true
+ * util.isRegExp(new RegExp('another regexp'));
+ * // Returns: true
+ * util.isRegExp({});
+ * // Returns: false
+ * ```
+ * @since v0.6.0
+ * @deprecated Since v4.0.0 - Deprecated
+ */
+ export function isRegExp(object: unknown): object is RegExp;
+ /**
+ * Returns `true` if the given `object` is a `Date`. Otherwise, returns `false`.
+ *
+ * ```js
+ * const util = require('util');
+ *
+ * util.isDate(new Date());
+ * // Returns: true
+ * util.isDate(Date());
+ * // false (without 'new' returns a String)
+ * util.isDate({});
+ * // Returns: false
+ * ```
+ * @since v0.6.0
+ * @deprecated Since v4.0.0 - Use {@link types.isDate} instead.
+ */
+ export function isDate(object: unknown): object is Date;
+ /**
+ * Returns `true` if the given `object` is an `Error`. Otherwise, returns`false`.
+ *
+ * ```js
+ * const util = require('util');
+ *
+ * util.isError(new Error());
+ * // Returns: true
+ * util.isError(new TypeError());
+ * // Returns: true
+ * util.isError({ name: 'Error', message: 'an error occurred' });
+ * // Returns: false
+ * ```
+ *
+ * This method relies on `Object.prototype.toString()` behavior. It is
+ * possible to obtain an incorrect result when the `object` argument manipulates`@@toStringTag`.
+ *
+ * ```js
+ * const util = require('util');
+ * const obj = { name: 'Error', message: 'an error occurred' };
+ *
+ * util.isError(obj);
+ * // Returns: false
+ * obj[Symbol.toStringTag] = 'Error';
+ * util.isError(obj);
+ * // Returns: true
+ * ```
+ * @since v0.6.0
+ * @deprecated Since v4.0.0 - Use {@link types.isNativeError} instead.
+ */
+ export function isError(object: unknown): object is Error;
+ /**
+ * Usage of `util.inherits()` is discouraged. Please use the ES6 `class` and`extends` keywords to get language level inheritance support. Also note
+ * that the two styles are [semantically incompatible](https://github.com/nodejs/node/issues/4179).
+ *
+ * Inherit the prototype methods from one [constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/constructor) into another. The
+ * prototype of `constructor` will be set to a new object created from`superConstructor`.
+ *
+ * This mainly adds some input validation on top of`Object.setPrototypeOf(constructor.prototype, superConstructor.prototype)`.
+ * As an additional convenience, `superConstructor` will be accessible
+ * through the `constructor.super_` property.
+ *
+ * ```js
+ * const util = require('util');
+ * const EventEmitter = require('events');
+ *
+ * function MyStream() {
+ * EventEmitter.call(this);
+ * }
+ *
+ * util.inherits(MyStream, EventEmitter);
+ *
+ * MyStream.prototype.write = function(data) {
+ * this.emit('data', data);
+ * };
+ *
+ * const stream = new MyStream();
+ *
+ * console.log(stream instanceof EventEmitter); // true
+ * console.log(MyStream.super_ === EventEmitter); // true
+ *
+ * stream.on('data', (data) => {
+ * console.log(`Received data: "${data}"`);
+ * });
+ * stream.write('It works!'); // Received data: "It works!"
+ * ```
+ *
+ * ES6 example using `class` and `extends`:
+ *
+ * ```js
+ * const EventEmitter = require('events');
+ *
+ * class MyStream extends EventEmitter {
+ * write(data) {
+ * this.emit('data', data);
+ * }
+ * }
+ *
+ * const stream = new MyStream();
+ *
+ * stream.on('data', (data) => {
+ * console.log(`Received data: "${data}"`);
+ * });
+ * stream.write('With ES6');
+ * ```
+ * @since v0.3.0
+ * @legacy Use ES2015 class syntax and `extends` keyword instead.
+ */
+ export function inherits(constructor: unknown, superConstructor: unknown): void;
+ export type DebugLoggerFunction = (msg: string, ...param: unknown[]) => void;
+ export interface DebugLogger extends DebugLoggerFunction {
+ enabled: boolean;
+ }
+ /**
+ * The `util.debuglog()` method is used to create a function that conditionally
+ * writes debug messages to `stderr` based on the existence of the `NODE_DEBUG`environment variable. If the `section` name appears within the value of that
+ * environment variable, then the returned function operates similar to `console.error()`. If not, then the returned function is a no-op.
+ *
+ * ```js
+ * const util = require('util');
+ * const debuglog = util.debuglog('foo');
+ *
+ * debuglog('hello from foo [%d]', 123);
+ * ```
+ *
+ * If this program is run with `NODE_DEBUG=foo` in the environment, then
+ * it will output something like:
+ *
+ * ```console
+ * FOO 3245: hello from foo [123]
+ * ```
+ *
+ * where `3245` is the process id. If it is not run with that
+ * environment variable set, then it will not print anything.
+ *
+ * The `section` supports wildcard also:
+ *
+ * ```js
+ * const util = require('util');
+ * const debuglog = util.debuglog('foo-bar');
+ *
+ * debuglog('hi there, it\'s foo-bar [%d]', 2333);
+ * ```
+ *
+ * if it is run with `NODE_DEBUG=foo*` in the environment, then it will output
+ * something like:
+ *
+ * ```console
+ * FOO-BAR 3257: hi there, it's foo-bar [2333]
+ * ```
+ *
+ * Multiple comma-separated `section` names may be specified in the `NODE_DEBUG`environment variable: `NODE_DEBUG=fs,net,tls`.
+ *
+ * The optional `callback` argument can be used to replace the logging function
+ * with a different function that doesn't have any initialization or
+ * unnecessary wrapping.
+ *
+ * ```js
+ * const util = require('util');
+ * let debuglog = util.debuglog('internals', (debug) => {
+ * // Replace with a logging function that optimizes out
+ * // testing if the section is enabled
+ * debuglog = debug;
+ * });
+ * ```
+ * @since v0.11.3
+ * @param section A string identifying the portion of the application for which the `debuglog` function is being created.
+ * @param callback A callback invoked the first time the logging function is called with a function argument that is a more optimized logging function.
+ * @return The logging function
+ */
+ export function debuglog(section: string, callback?: (fn: DebugLoggerFunction) => void): DebugLogger;
+ export const debug: typeof debuglog;
+ /**
+ * Returns `true` if the given `object` is a `Boolean`. Otherwise, returns `false`.
+ *
+ * ```js
+ * const util = require('util');
+ *
+ * util.isBoolean(1);
+ * // Returns: false
+ * util.isBoolean(0);
+ * // Returns: false
+ * util.isBoolean(false);
+ * // Returns: true
+ * ```
+ * @since v0.11.5
+ * @deprecated Since v4.0.0 - Use `typeof value === 'boolean'` instead.
+ */
+ export function isBoolean(object: unknown): object is boolean;
+ /**
+ * Returns `true` if the given `object` is a `Buffer`. Otherwise, returns `false`.
+ *
+ * ```js
+ * const util = require('util');
+ *
+ * util.isBuffer({ length: 0 });
+ * // Returns: false
+ * util.isBuffer([]);
+ * // Returns: false
+ * util.isBuffer(Buffer.from('hello world'));
+ * // Returns: true
+ * ```
+ * @since v0.11.5
+ * @deprecated Since v4.0.0 - Use `isBuffer` instead.
+ */
+ export function isBuffer(object: unknown): object is Buffer;
+ /**
+ * Returns `true` if the given `object` is a `Function`. Otherwise, returns`false`.
+ *
+ * ```js
+ * const util = require('util');
+ *
+ * function Foo() {}
+ * const Bar = () => {};
+ *
+ * util.isFunction({});
+ * // Returns: false
+ * util.isFunction(Foo);
+ * // Returns: true
+ * util.isFunction(Bar);
+ * // Returns: true
+ * ```
+ * @since v0.11.5
+ * @deprecated Since v4.0.0 - Use `typeof value === 'function'` instead.
+ */
+ export function isFunction(object: unknown): boolean;
+ /**
+ * Returns `true` if the given `object` is strictly `null`. Otherwise, returns`false`.
+ *
+ * ```js
+ * const util = require('util');
+ *
+ * util.isNull(0);
+ * // Returns: false
+ * util.isNull(undefined);
+ * // Returns: false
+ * util.isNull(null);
+ * // Returns: true
+ * ```
+ * @since v0.11.5
+ * @deprecated Since v4.0.0 - Use `value === null` instead.
+ */
+ export function isNull(object: unknown): object is null;
+ /**
+ * Returns `true` if the given `object` is `null` or `undefined`. Otherwise,
+ * returns `false`.
+ *
+ * ```js
+ * const util = require('util');
+ *
+ * util.isNullOrUndefined(0);
+ * // Returns: false
+ * util.isNullOrUndefined(undefined);
+ * // Returns: true
+ * util.isNullOrUndefined(null);
+ * // Returns: true
+ * ```
+ * @since v0.11.5
+ * @deprecated Since v4.0.0 - Use `value === undefined || value === null` instead.
+ */
+ export function isNullOrUndefined(object: unknown): object is null | undefined;
+ /**
+ * Returns `true` if the given `object` is a `Number`. Otherwise, returns `false`.
+ *
+ * ```js
+ * const util = require('util');
+ *
+ * util.isNumber(false);
+ * // Returns: false
+ * util.isNumber(Infinity);
+ * // Returns: true
+ * util.isNumber(0);
+ * // Returns: true
+ * util.isNumber(NaN);
+ * // Returns: true
+ * ```
+ * @since v0.11.5
+ * @deprecated Since v4.0.0 - Use `typeof value === 'number'` instead.
+ */
+ export function isNumber(object: unknown): object is number;
+ /**
+ * Returns `true` if the given `object` is strictly an `Object`**and** not a`Function` (even though functions are objects in JavaScript).
+ * Otherwise, returns `false`.
+ *
+ * ```js
+ * const util = require('util');
+ *
+ * util.isObject(5);
+ * // Returns: false
+ * util.isObject(null);
+ * // Returns: false
+ * util.isObject({});
+ * // Returns: true
+ * util.isObject(() => {});
+ * // Returns: false
+ * ```
+ * @since v0.11.5
+ * @deprecated Since v4.0.0 - Deprecated: Use `value !== null && typeof value === 'object'` instead.
+ */
+ export function isObject(object: unknown): boolean;
+ /**
+ * Returns `true` if the given `object` is a primitive type. Otherwise, returns`false`.
+ *
+ * ```js
+ * const util = require('util');
+ *
+ * util.isPrimitive(5);
+ * // Returns: true
+ * util.isPrimitive('foo');
+ * // Returns: true
+ * util.isPrimitive(false);
+ * // Returns: true
+ * util.isPrimitive(null);
+ * // Returns: true
+ * util.isPrimitive(undefined);
+ * // Returns: true
+ * util.isPrimitive({});
+ * // Returns: false
+ * util.isPrimitive(() => {});
+ * // Returns: false
+ * util.isPrimitive(/^$/);
+ * // Returns: false
+ * util.isPrimitive(new Date());
+ * // Returns: false
+ * ```
+ * @since v0.11.5
+ * @deprecated Since v4.0.0 - Use `(typeof value !== 'object' && typeof value !== 'function') || value === null` instead.
+ */
+ export function isPrimitive(object: unknown): boolean;
+ /**
+ * Returns `true` if the given `object` is a `string`. Otherwise, returns `false`.
+ *
+ * ```js
+ * const util = require('util');
+ *
+ * util.isString('');
+ * // Returns: true
+ * util.isString('foo');
+ * // Returns: true
+ * util.isString(String('foo'));
+ * // Returns: true
+ * util.isString(5);
+ * // Returns: false
+ * ```
+ * @since v0.11.5
+ * @deprecated Since v4.0.0 - Use `typeof value === 'string'` instead.
+ */
+ export function isString(object: unknown): object is string;
+ /**
+ * Returns `true` if the given `object` is a `Symbol`. Otherwise, returns `false`.
+ *
+ * ```js
+ * const util = require('util');
+ *
+ * util.isSymbol(5);
+ * // Returns: false
+ * util.isSymbol('foo');
+ * // Returns: false
+ * util.isSymbol(Symbol('foo'));
+ * // Returns: true
+ * ```
+ * @since v0.11.5
+ * @deprecated Since v4.0.0 - Use `typeof value === 'symbol'` instead.
+ */
+ export function isSymbol(object: unknown): object is symbol;
+ /**
+ * Returns `true` if the given `object` is `undefined`. Otherwise, returns `false`.
+ *
+ * ```js
+ * const util = require('util');
+ *
+ * const foo = undefined;
+ * util.isUndefined(5);
+ * // Returns: false
+ * util.isUndefined(foo);
+ * // Returns: true
+ * util.isUndefined(null);
+ * // Returns: false
+ * ```
+ * @since v0.11.5
+ * @deprecated Since v4.0.0 - Use `value === undefined` instead.
+ */
+ export function isUndefined(object: unknown): object is undefined;
+ /**
+ * The `util.deprecate()` method wraps `fn` (which may be a function or class) in
+ * such a way that it is marked as deprecated.
+ *
+ * ```js
+ * const util = require('util');
+ *
+ * exports.obsoleteFunction = util.deprecate(() => {
+ * // Do something here.
+ * }, 'obsoleteFunction() is deprecated. Use newShinyFunction() instead.');
+ * ```
+ *
+ * When called, `util.deprecate()` will return a function that will emit a`DeprecationWarning` using the `'warning'` event. The warning will
+ * be emitted and printed to `stderr` the first time the returned function is
+ * called. After the warning is emitted, the wrapped function is called without
+ * emitting a warning.
+ *
+ * If the same optional `code` is supplied in multiple calls to `util.deprecate()`,
+ * the warning will be emitted only once for that `code`.
+ *
+ * ```js
+ * const util = require('util');
+ *
+ * const fn1 = util.deprecate(someFunction, someMessage, 'DEP0001');
+ * const fn2 = util.deprecate(someOtherFunction, someOtherMessage, 'DEP0001');
+ * fn1(); // Emits a deprecation warning with code DEP0001
+ * fn2(); // Does not emit a deprecation warning because it has the same code
+ * ```
+ *
+ * If either the `--no-deprecation` or `--no-warnings` command-line flags are
+ * used, or if the `process.noDeprecation` property is set to `true`_prior_ to
+ * the first deprecation warning, the `util.deprecate()` method does nothing.
+ *
+ * If the `--trace-deprecation` or `--trace-warnings` command-line flags are set,
+ * or the `process.traceDeprecation` property is set to `true`, a warning and a
+ * stack trace are printed to `stderr` the first time the deprecated function is
+ * called.
+ *
+ * If the `--throw-deprecation` command-line flag is set, or the`process.throwDeprecation` property is set to `true`, then an exception will be
+ * thrown when the deprecated function is called.
+ *
+ * The `--throw-deprecation` command-line flag and `process.throwDeprecation`property take precedence over `--trace-deprecation` and`process.traceDeprecation`.
+ * @since v0.8.0
+ * @param fn The function that is being deprecated.
+ * @param msg A warning message to display when the deprecated function is invoked.
+ * @param code A deprecation code. See the `list of deprecated APIs` for a list of codes.
+ * @return The deprecated function wrapped to emit a warning.
+ */
+ export function deprecate<T extends Function>(fn: T, msg: string, code?: string): T;
+ /**
+ * Returns `true` if there is deep strict equality between `val1` and `val2`.
+ * Otherwise, returns `false`.
+ *
+ * See `assert.deepStrictEqual()` for more information about deep strict
+ * equality.
+ * @since v9.0.0
+ */
+ export function isDeepStrictEqual(val1: unknown, val2: unknown): boolean;
+ /**
+ * Returns `str` with any ANSI escape codes removed.
+ *
+ * ```js
+ * console.log(util.stripVTControlCharacters('\u001B[4mvalue\u001B[0m'));
+ * // Prints "value"
+ * ```
+ * @since v16.11.0
+ */
+ export function stripVTControlCharacters(str: string): string;
+ /**
+ * Takes an `async` function (or a function that returns a `Promise`) and returns a
+ * function following the error-first callback style, i.e. taking
+ * an `(err, value) => ...` callback as the last argument. In the callback, the
+ * first argument will be the rejection reason (or `null` if the `Promise`resolved), and the second argument will be the resolved value.
+ *
+ * ```js
+ * const util = require('util');
+ *
+ * async function fn() {
+ * return 'hello world';
+ * }
+ * const callbackFunction = util.callbackify(fn);
+ *
+ * callbackFunction((err, ret) => {
+ * if (err) throw err;
+ * console.log(ret);
+ * });
+ * ```
+ *
+ * Will print:
+ *
+ * ```text
+ * hello world
+ * ```
+ *
+ * The callback is executed asynchronously, and will have a limited stack trace.
+ * If the callback throws, the process will emit an `'uncaughtException'` event, and if not handled will exit.
+ *
+ * Since `null` has a special meaning as the first argument to a callback, if a
+ * wrapped function rejects a `Promise` with a falsy value as a reason, the value
+ * is wrapped in an `Error` with the original value stored in a field named`reason`.
+ *
+ * ```js
+ * function fn() {
+ * return Promise.reject(null);
+ * }
+ * const callbackFunction = util.callbackify(fn);
+ *
+ * callbackFunction((err, ret) => {
+ * // When the Promise was rejected with `null` it is wrapped with an Error and
+ * // the original value is stored in `reason`.
+ * err &#x26;&#x26; Object.hasOwn(err, 'reason') &#x26;&#x26; err.reason === null; // true
+ * });
+ * ```
+ * @since v8.2.0
+ * @param fn An `async` function
+ * @return a callback style function
+ */
+ export function callbackify(fn: () => Promise<void>): (callback: (err: NodeJS.ErrnoException) => void) => void;
+ export function callbackify<TResult>(
+ fn: () => Promise<TResult>,
+ ): (callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void;
+ export function callbackify<T1>(
+ fn: (arg1: T1) => Promise<void>,
+ ): (arg1: T1, callback: (err: NodeJS.ErrnoException) => void) => void;
+ export function callbackify<T1, TResult>(
+ fn: (arg1: T1) => Promise<TResult>,
+ ): (arg1: T1, callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void;
+ export function callbackify<T1, T2>(
+ fn: (arg1: T1, arg2: T2) => Promise<void>,
+ ): (arg1: T1, arg2: T2, callback: (err: NodeJS.ErrnoException) => void) => void;
+ export function callbackify<T1, T2, TResult>(
+ fn: (arg1: T1, arg2: T2) => Promise<TResult>,
+ ): (arg1: T1, arg2: T2, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void;
+ export function callbackify<T1, T2, T3>(
+ fn: (arg1: T1, arg2: T2, arg3: T3) => Promise<void>,
+ ): (arg1: T1, arg2: T2, arg3: T3, callback: (err: NodeJS.ErrnoException) => void) => void;
+ export function callbackify<T1, T2, T3, TResult>(
+ fn: (arg1: T1, arg2: T2, arg3: T3) => Promise<TResult>,
+ ): (arg1: T1, arg2: T2, arg3: T3, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void;
+ export function callbackify<T1, T2, T3, T4>(
+ fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<void>,
+ ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: NodeJS.ErrnoException) => void) => void;
+ export function callbackify<T1, T2, T3, T4, TResult>(
+ fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<TResult>,
+ ): (
+ arg1: T1,
+ arg2: T2,
+ arg3: T3,
+ arg4: T4,
+ callback: (err: NodeJS.ErrnoException | null, result: TResult) => void,
+ ) => void;
+ export function callbackify<T1, T2, T3, T4, T5>(
+ fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<void>,
+ ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: NodeJS.ErrnoException) => void) => void;
+ export function callbackify<T1, T2, T3, T4, T5, TResult>(
+ fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<TResult>,
+ ): (
+ arg1: T1,
+ arg2: T2,
+ arg3: T3,
+ arg4: T4,
+ arg5: T5,
+ callback: (err: NodeJS.ErrnoException | null, result: TResult) => void,
+ ) => void;
+ export function callbackify<T1, T2, T3, T4, T5, T6>(
+ fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => Promise<void>,
+ ): (
+ arg1: T1,
+ arg2: T2,
+ arg3: T3,
+ arg4: T4,
+ arg5: T5,
+ arg6: T6,
+ callback: (err: NodeJS.ErrnoException) => void,
+ ) => void;
+ export function callbackify<T1, T2, T3, T4, T5, T6, TResult>(
+ fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => Promise<TResult>,
+ ): (
+ arg1: T1,
+ arg2: T2,
+ arg3: T3,
+ arg4: T4,
+ arg5: T5,
+ arg6: T6,
+ callback: (err: NodeJS.ErrnoException | null, result: TResult) => void,
+ ) => void;
+ export interface CustomPromisifyLegacy<TCustom extends Function> extends Function {
+ __promisify__: TCustom;
+ }
+ export interface CustomPromisifySymbol<TCustom extends Function> extends Function {
+ [promisify.custom]: TCustom;
+ }
+ export type CustomPromisify<TCustom extends Function> =
+ | CustomPromisifySymbol<TCustom>
+ | CustomPromisifyLegacy<TCustom>;
+ /**
+ * Takes a function following the common error-first callback style, i.e. taking
+ * an `(err, value) => ...` callback as the last argument, and returns a version
+ * that returns promises.
+ *
+ * ```js
+ * const util = require('util');
+ * const fs = require('fs');
+ *
+ * const stat = util.promisify(fs.stat);
+ * stat('.').then((stats) => {
+ * // Do something with `stats`
+ * }).catch((error) => {
+ * // Handle the error.
+ * });
+ * ```
+ *
+ * Or, equivalently using `async function`s:
+ *
+ * ```js
+ * const util = require('util');
+ * const fs = require('fs');
+ *
+ * const stat = util.promisify(fs.stat);
+ *
+ * async function callStat() {
+ * const stats = await stat('.');
+ * console.log(`This directory is owned by ${stats.uid}`);
+ * }
+ * ```
+ *
+ * If there is an `original[util.promisify.custom]` property present, `promisify`will return its value, see `Custom promisified functions`.
+ *
+ * `promisify()` assumes that `original` is a function taking a callback as its
+ * final argument in all cases. If `original` is not a function, `promisify()`will throw an error. If `original` is a function but its last argument is not
+ * an error-first callback, it will still be passed an error-first
+ * callback as its last argument.
+ *
+ * Using `promisify()` on class methods or other methods that use `this` may not
+ * work as expected unless handled specially:
+ *
+ * ```js
+ * const util = require('util');
+ *
+ * class Foo {
+ * constructor() {
+ * this.a = 42;
+ * }
+ *
+ * bar(callback) {
+ * callback(null, this.a);
+ * }
+ * }
+ *
+ * const foo = new Foo();
+ *
+ * const naiveBar = util.promisify(foo.bar);
+ * // TypeError: Cannot read property 'a' of undefined
+ * // naiveBar().then(a => console.log(a));
+ *
+ * naiveBar.call(foo).then((a) => console.log(a)); // '42'
+ *
+ * const bindBar = naiveBar.bind(foo);
+ * bindBar().then((a) => console.log(a)); // '42'
+ * ```
+ * @since v8.0.0
+ */
+ export function promisify<TCustom extends Function>(fn: CustomPromisify<TCustom>): TCustom;
+ export function promisify<TResult>(
+ fn: (callback: (err: any, result: TResult) => void) => void,
+ ): () => Promise<TResult>;
+ export function promisify(fn: (callback: (err?: any) => void) => void): () => Promise<void>;
+ export function promisify<T1, TResult>(
+ fn: (arg1: T1, callback: (err: any, result: TResult) => void) => void,
+ ): (arg1: T1) => Promise<TResult>;
+ export function promisify<T1>(fn: (arg1: T1, callback: (err?: any) => void) => void): (arg1: T1) => Promise<void>;
+ export function promisify<T1, T2, TResult>(
+ fn: (arg1: T1, arg2: T2, callback: (err: any, result: TResult) => void) => void,
+ ): (arg1: T1, arg2: T2) => Promise<TResult>;
+ export function promisify<T1, T2>(
+ fn: (arg1: T1, arg2: T2, callback: (err?: any) => void) => void,
+ ): (arg1: T1, arg2: T2) => Promise<void>;
+ export function promisify<T1, T2, T3, TResult>(
+ fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err: any, result: TResult) => void) => void,
+ ): (arg1: T1, arg2: T2, arg3: T3) => Promise<TResult>;
+ export function promisify<T1, T2, T3>(
+ fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err?: any) => void) => void,
+ ): (arg1: T1, arg2: T2, arg3: T3) => Promise<void>;
+ export function promisify<T1, T2, T3, T4, TResult>(
+ fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: any, result: TResult) => void) => void,
+ ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<TResult>;
+ export function promisify<T1, T2, T3, T4>(
+ fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err?: any) => void) => void,
+ ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<void>;
+ export function promisify<T1, T2, T3, T4, T5, TResult>(
+ fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: any, result: TResult) => void) => void,
+ ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<TResult>;
+ export function promisify<T1, T2, T3, T4, T5>(
+ fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err?: any) => void) => void,
+ ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<void>;
+ export function promisify(fn: Function): Function;
+ export namespace promisify {
+ /**
+ * That can be used to declare custom promisified variants of functions.
+ */
+ const custom: unique symbol;
+ }
+ /**
+ * An implementation of the [WHATWG Encoding Standard](https://encoding.spec.whatwg.org/) `TextDecoder` API.
+ *
+ * ```js
+ * const decoder = new TextDecoder();
+ * const u8arr = new Uint8Array([72, 101, 108, 108, 111]);
+ * console.log(decoder.decode(u8arr)); // Hello
+ * ```
+ * @since v8.3.0
+ */
+ export class TextDecoder {
+ /**
+ * The encoding supported by the `TextDecoder` instance.
+ */
+ readonly encoding: string;
+ /**
+ * The value will be `true` if decoding errors result in a `TypeError` being
+ * thrown.
+ */
+ readonly fatal: boolean;
+ /**
+ * The value will be `true` if the decoding result will include the byte order
+ * mark.
+ */
+ readonly ignoreBOM: boolean;
+ constructor(
+ encoding?: string,
+ options?: {
+ fatal?: boolean | undefined;
+ ignoreBOM?: boolean | undefined;
+ },
+ );
+ /**
+ * Decodes the `input` and returns a string. If `options.stream` is `true`, any
+ * incomplete byte sequences occurring at the end of the `input` are buffered
+ * internally and emitted after the next call to `textDecoder.decode()`.
+ *
+ * If `textDecoder.fatal` is `true`, decoding errors that occur will result in a`TypeError` being thrown.
+ * @param input An `ArrayBuffer`, `DataView` or `TypedArray` instance containing the encoded data.
+ */
+ decode(
+ input?: NodeJS.ArrayBufferView | ArrayBuffer | null,
+ options?: {
+ stream?: boolean | undefined;
+ },
+ ): string;
+ }
+ export interface EncodeIntoResult {
+ /**
+ * The read Unicode code units of input.
+ */
+ read: number;
+ /**
+ * The written UTF-8 bytes of output.
+ */
+ written: number;
+ }
+ export { types };
+
+ //// TextEncoder/Decoder
+ /**
+ * An implementation of the [WHATWG Encoding Standard](https://encoding.spec.whatwg.org/) `TextEncoder` API. All
+ * instances of `TextEncoder` only support UTF-8 encoding.
+ *
+ * ```js
+ * const encoder = new TextEncoder();
+ * const uint8array = encoder.encode('this is some data');
+ * ```
+ *
+ * The `TextEncoder` class is also available on the global object.
+ * @since v8.3.0
+ */
+ export class TextEncoder {
+ /**
+ * The encoding supported by the `TextEncoder` instance. Always set to `'utf-8'`.
+ */
+ readonly encoding: string;
+ /**
+ * UTF-8 encodes the `input` string and returns a `Uint8Array` containing the
+ * encoded bytes.
+ * @param [input='an empty string'] The text to encode.
+ */
+ encode(input?: string): Uint8Array;
+ /**
+ * UTF-8 encodes the `src` string to the `dest` Uint8Array and returns an object
+ * containing the read Unicode code units and written UTF-8 bytes.
+ *
+ * ```js
+ * const encoder = new TextEncoder();
+ * const src = 'this is some data';
+ * const dest = new Uint8Array(10);
+ * const { read, written } = encoder.encodeInto(src, dest);
+ * ```
+ * @param src The text to encode.
+ * @param dest The array to hold the encode result.
+ */
+ encodeInto(src: string, dest: Uint8Array): EncodeIntoResult;
+ }
+
+ import { TextDecoder as _TextDecoder, TextEncoder as _TextEncoder } from "util";
+ global {
+ /**
+ * `TextDecoder` class is a global reference for `require('util').TextDecoder`
+ * https://nodejs.org/api/globals.html#textdecoder
+ * @since v11.0.0
+ */
+ var TextDecoder: typeof globalThis extends {
+ onmessage: any;
+ TextDecoder: infer TextDecoder;
+ } ? TextDecoder
+ : typeof _TextDecoder;
+
+ /**
+ * `TextEncoder` class is a global reference for `require('util').TextEncoder`
+ * https://nodejs.org/api/globals.html#textencoder
+ * @since v11.0.0
+ */
+ var TextEncoder: typeof globalThis extends {
+ onmessage: any;
+ TextEncoder: infer TextEncoder;
+ } ? TextEncoder
+ : typeof _TextEncoder;
+ }
+
+ //// parseArgs
+ /**
+ * Provides a high-level API for command-line argument parsing. Takes a
+ * specification for the expected arguments and returns a structured object
+ * with the parsed values and positionals.
+ *
+ * `config` provides arguments for parsing and configures the parser. It
+ * supports the following properties:
+ *
+ * - `args` The array of argument strings. **Default:** `process.argv` with
+ * `execPath` and `filename` removed.
+ * - `options` Arguments known to the parser. Keys of `options` are the long
+ * names of options and values are objects accepting the following properties:
+ *
+ * - `type` Type of argument, which must be either `boolean` (for options
+ * which do not take values) or `string` (for options which do).
+ * - `multiple` Whether this option can be provided multiple
+ * times. If `true`, all values will be collected in an array. If
+ * `false`, values for the option are last-wins. **Default:** `false`.
+ * - `short` A single character alias for the option.
+ * - `default` The default option value when it is not set by args. It
+ * must be of the same type as the `type` property. When `multiple`
+ * is `true`, it must be an array.
+ *
+ * - `strict`: Whether an error should be thrown when unknown arguments
+ * are encountered, or when arguments are passed that do not match the
+ * `type` configured in `options`. **Default:** `true`.
+ * - `allowPositionals`: Whether this command accepts positional arguments.
+ * **Default:** `false` if `strict` is `true`, otherwise `true`.
+ * - `tokens`: Whether tokens {boolean} Return the parsed tokens. This is useful
+ * for extending the built-in behavior, from adding additional checks through
+ * to reprocessing the tokens in different ways.
+ * **Default:** `false`.
+ *
+ * @returns The parsed command line arguments:
+ *
+ * - `values` A mapping of parsed option names with their string
+ * or boolean values.
+ * - `positionals` Positional arguments.
+ * - `tokens` Detailed parse information (only if `tokens` was specified).
+ */
+ export function parseArgs<T extends ParseArgsConfig>(config?: T): ParsedResults<T>;
+
+ interface ParseArgsOptionConfig {
+ /**
+ * Type of argument.
+ */
+ type: "string" | "boolean";
+ /**
+ * Whether this option can be provided multiple times.
+ * If `true`, all values will be collected in an array.
+ * If `false`, values for the option are last-wins.
+ * @default false.
+ */
+ multiple?: boolean | undefined;
+ /**
+ * A single character alias for the option.
+ */
+ short?: string | undefined;
+ /**
+ * The default option value when it is not set by args.
+ * It must be of the same type as the the `type` property.
+ * When `multiple` is `true`, it must be an array.
+ * @since v18.11.0
+ */
+ default?: string | boolean | string[] | boolean[] | undefined;
+ }
+
+ interface ParseArgsOptionsConfig {
+ [longOption: string]: ParseArgsOptionConfig;
+ }
+
+ export interface ParseArgsConfig {
+ /**
+ * Array of argument strings.
+ */
+ args?: string[] | undefined;
+ /**
+ * Used to describe arguments known to the parser.
+ */
+ options?: ParseArgsOptionsConfig | undefined;
+ /**
+ * Should an error be thrown when unknown arguments are encountered,
+ * or when arguments are passed that do not match the `type` configured in `options`.
+ * @default true
+ */
+ strict?: boolean | undefined;
+ /**
+ * Whether this command accepts positional arguments.
+ */
+ allowPositionals?: boolean | undefined;
+ /**
+ * Return the parsed tokens. This is useful for extending the built-in behavior,
+ * from adding additional checks through to reprocessing the tokens in different ways.
+ * @default false
+ */
+ tokens?: boolean | undefined;
+ }
+
+ /*
+ IfDefaultsTrue and IfDefaultsFalse are helpers to handle default values for missing boolean properties.
+ TypeScript does not have exact types for objects: https://github.com/microsoft/TypeScript/issues/12936
+ This means it is impossible to distinguish between "field X is definitely not present" and "field X may or may not be present".
+ But we expect users to generally provide their config inline or `as const`, which means TS will always know whether a given field is present.
+ So this helper treats "not definitely present" (i.e., not `extends boolean`) as being "definitely not present", i.e. it should have its default value.
+ This is technically incorrect but is a much nicer UX for the common case.
+ The IfDefaultsTrue version is for things which default to true; the IfDefaultsFalse version is for things which default to false.
+ */
+ type IfDefaultsTrue<T, IfTrue, IfFalse> = T extends true ? IfTrue
+ : T extends false ? IfFalse
+ : IfTrue;
+
+ // we put the `extends false` condition first here because `undefined` compares like `any` when `strictNullChecks: false`
+ type IfDefaultsFalse<T, IfTrue, IfFalse> = T extends false ? IfFalse
+ : T extends true ? IfTrue
+ : IfFalse;
+
+ type ExtractOptionValue<T extends ParseArgsConfig, O extends ParseArgsOptionConfig> = IfDefaultsTrue<
+ T["strict"],
+ O["type"] extends "string" ? string : O["type"] extends "boolean" ? boolean : string | boolean,
+ string | boolean
+ >;
+
+ type ParsedValues<T extends ParseArgsConfig> =
+ & IfDefaultsTrue<T["strict"], unknown, { [longOption: string]: undefined | string | boolean }>
+ & (T["options"] extends ParseArgsOptionsConfig ? {
+ -readonly [LongOption in keyof T["options"]]: IfDefaultsFalse<
+ T["options"][LongOption]["multiple"],
+ undefined | Array<ExtractOptionValue<T, T["options"][LongOption]>>,
+ undefined | ExtractOptionValue<T, T["options"][LongOption]>
+ >;
+ }
+ : {});
+
+ type ParsedPositionals<T extends ParseArgsConfig> = IfDefaultsTrue<
+ T["strict"],
+ IfDefaultsFalse<T["allowPositionals"], string[], []>,
+ IfDefaultsTrue<T["allowPositionals"], string[], []>
+ >;
+
+ type PreciseTokenForOptions<
+ K extends string,
+ O extends ParseArgsOptionConfig,
+ > = O["type"] extends "string" ? {
+ kind: "option";
+ index: number;
+ name: K;
+ rawName: string;
+ value: string;
+ inlineValue: boolean;
+ }
+ : O["type"] extends "boolean" ? {
+ kind: "option";
+ index: number;
+ name: K;
+ rawName: string;
+ value: undefined;
+ inlineValue: undefined;
+ }
+ : OptionToken & { name: K };
+
+ type TokenForOptions<
+ T extends ParseArgsConfig,
+ K extends keyof T["options"] = keyof T["options"],
+ > = K extends unknown
+ ? T["options"] extends ParseArgsOptionsConfig ? PreciseTokenForOptions<K & string, T["options"][K]>
+ : OptionToken
+ : never;
+
+ type ParsedOptionToken<T extends ParseArgsConfig> = IfDefaultsTrue<T["strict"], TokenForOptions<T>, OptionToken>;
+
+ type ParsedPositionalToken<T extends ParseArgsConfig> = IfDefaultsTrue<
+ T["strict"],
+ IfDefaultsFalse<T["allowPositionals"], { kind: "positional"; index: number; value: string }, never>,
+ IfDefaultsTrue<T["allowPositionals"], { kind: "positional"; index: number; value: string }, never>
+ >;
+
+ type ParsedTokens<T extends ParseArgsConfig> = Array<
+ ParsedOptionToken<T> | ParsedPositionalToken<T> | { kind: "option-terminator"; index: number }
+ >;
+
+ type PreciseParsedResults<T extends ParseArgsConfig> = IfDefaultsFalse<
+ T["tokens"],
+ {
+ values: ParsedValues<T>;
+ positionals: ParsedPositionals<T>;
+ tokens: ParsedTokens<T>;
+ },
+ {
+ values: ParsedValues<T>;
+ positionals: ParsedPositionals<T>;
+ }
+ >;
+
+ type OptionToken =
+ | { kind: "option"; index: number; name: string; rawName: string; value: string; inlineValue: boolean }
+ | {
+ kind: "option";
+ index: number;
+ name: string;
+ rawName: string;
+ value: undefined;
+ inlineValue: undefined;
+ };
+
+ type Token =
+ | OptionToken
+ | { kind: "positional"; index: number; value: string }
+ | { kind: "option-terminator"; index: number };
+
+ // If ParseArgsConfig extends T, then the user passed config constructed elsewhere.
+ // So we can't rely on the `"not definitely present" implies "definitely not present"` assumption mentioned above.
+ type ParsedResults<T extends ParseArgsConfig> = ParseArgsConfig extends T ? {
+ values: { [longOption: string]: undefined | string | boolean | Array<string | boolean> };
+ positionals: string[];
+ tokens?: Token[];
+ }
+ : PreciseParsedResults<T>;
+
+ /**
+ * @since v18.13.0
+ */
+ export class MIMEType {
+ /**
+ * Creates a new MIMEType object by parsing the input.
+ *
+ * A `TypeError` will be thrown if the `input` is not a valid MIME.
+ * Note that an effort will be made to coerce the given values into strings.
+ * @param input The input MIME to parse.
+ */
+ constructor(input: string | { toString: () => string });
+
+ /**
+ * Gets and sets the type portion of the MIME.
+ */
+ type: string;
+
+ /**
+ * Gets and sets the subtype portion of the MIME.
+ */
+ subtype: string;
+
+ /**
+ * Gets the essence of the MIME.
+ *
+ * Use `mime.type` or `mime.subtype` to alter the MIME.
+ */
+ readonly essence: string;
+
+ /**
+ * Gets the `MIMEParams` object representing the parameters of the MIME.
+ */
+ readonly params: MIMEParams;
+
+ /**
+ * Returns the serialized MIME.
+ *
+ * Because of the need for standard compliance, this method
+ * does not allow users to customize the serialization process of the MIME.
+ */
+ toString(): string;
+ }
+
+ /**
+ * @since v18.13.0
+ */
+ export class MIMEParams {
+ /**
+ * Remove all name-value pairs whose name is `name`.
+ */
+ delete(name: string): void;
+ /**
+ * Returns an iterator over each of the name-value pairs in the parameters.
+ */
+ entries(): IterableIterator<[string, string]>;
+ /**
+ * Returns the value of the first name-value pair whose name is `name`.
+ * If there are no such pairs, `null` is returned.
+ */
+ get(name: string): string | null;
+ /**
+ * Returns `true` if there is at least one name-value pair whose name is `name`.
+ */
+ has(name: string): boolean;
+ /**
+ * Returns an iterator over the names of each name-value pair.
+ */
+ keys(): IterableIterator<string>;
+ /**
+ * Sets the value in the `MIMEParams` object associated with `name` to `value`.
+ * If there are any pre-existing name-value pairs whose names are `name`,
+ * set the first such pair's value to `value`.
+ */
+ set(name: string, value: string): void;
+ /**
+ * Returns an iterator over the values of each name-value pair.
+ */
+ values(): IterableIterator<string>;
+ /**
+ * Returns an iterator over each of the name-value pairs in the parameters.
+ */
+ [Symbol.iterator]: typeof MIMEParams.prototype.entries;
+ }
+}
+declare module "util/types" {
+ export * from "util/types";
+}
+declare module "util/types" {
+ import { KeyObject, webcrypto } from "node:crypto";
+ /**
+ * Returns `true` if the value is a built-in [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) or
+ * [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instance.
+ *
+ * See also `util.types.isArrayBuffer()` and `util.types.isSharedArrayBuffer()`.
+ *
+ * ```js
+ * util.types.isAnyArrayBuffer(new ArrayBuffer()); // Returns true
+ * util.types.isAnyArrayBuffer(new SharedArrayBuffer()); // Returns true
+ * ```
+ * @since v10.0.0
+ */
+ function isAnyArrayBuffer(object: unknown): object is ArrayBufferLike;
+ /**
+ * Returns `true` if the value is an `arguments` object.
+ *
+ * ```js
+ * function foo() {
+ * util.types.isArgumentsObject(arguments); // Returns true
+ * }
+ * ```
+ * @since v10.0.0
+ */
+ function isArgumentsObject(object: unknown): object is IArguments;
+ /**
+ * Returns `true` if the value is a built-in [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) instance.
+ * This does _not_ include [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instances. Usually, it is
+ * desirable to test for both; See `util.types.isAnyArrayBuffer()` for that.
+ *
+ * ```js
+ * util.types.isArrayBuffer(new ArrayBuffer()); // Returns true
+ * util.types.isArrayBuffer(new SharedArrayBuffer()); // Returns false
+ * ```
+ * @since v10.0.0
+ */
+ function isArrayBuffer(object: unknown): object is ArrayBuffer;
+ /**
+ * Returns `true` if the value is an instance of one of the [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) views, such as typed
+ * array objects or [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView). Equivalent to
+ * [`ArrayBuffer.isView()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView).
+ *
+ * ```js
+ * util.types.isArrayBufferView(new Int8Array()); // true
+ * util.types.isArrayBufferView(Buffer.from('hello world')); // true
+ * util.types.isArrayBufferView(new DataView(new ArrayBuffer(16))); // true
+ * util.types.isArrayBufferView(new ArrayBuffer()); // false
+ * ```
+ * @since v10.0.0
+ */
+ function isArrayBufferView(object: unknown): object is NodeJS.ArrayBufferView;
+ /**
+ * Returns `true` if the value is an [async function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function).
+ * This only reports back what the JavaScript engine is seeing;
+ * in particular, the return value may not match the original source code if
+ * a transpilation tool was used.
+ *
+ * ```js
+ * util.types.isAsyncFunction(function foo() {}); // Returns false
+ * util.types.isAsyncFunction(async function foo() {}); // Returns true
+ * ```
+ * @since v10.0.0
+ */
+ function isAsyncFunction(object: unknown): boolean;
+ /**
+ * Returns `true` if the value is a `BigInt64Array` instance.
+ *
+ * ```js
+ * util.types.isBigInt64Array(new BigInt64Array()); // Returns true
+ * util.types.isBigInt64Array(new BigUint64Array()); // Returns false
+ * ```
+ * @since v10.0.0
+ */
+ function isBigInt64Array(value: unknown): value is BigInt64Array;
+ /**
+ * Returns `true` if the value is a `BigUint64Array` instance.
+ *
+ * ```js
+ * util.types.isBigUint64Array(new BigInt64Array()); // Returns false
+ * util.types.isBigUint64Array(new BigUint64Array()); // Returns true
+ * ```
+ * @since v10.0.0
+ */
+ function isBigUint64Array(value: unknown): value is BigUint64Array;
+ /**
+ * Returns `true` if the value is a boolean object, e.g. created
+ * by `new Boolean()`.
+ *
+ * ```js
+ * util.types.isBooleanObject(false); // Returns false
+ * util.types.isBooleanObject(true); // Returns false
+ * util.types.isBooleanObject(new Boolean(false)); // Returns true
+ * util.types.isBooleanObject(new Boolean(true)); // Returns true
+ * util.types.isBooleanObject(Boolean(false)); // Returns false
+ * util.types.isBooleanObject(Boolean(true)); // Returns false
+ * ```
+ * @since v10.0.0
+ */
+ function isBooleanObject(object: unknown): object is Boolean;
+ /**
+ * Returns `true` if the value is any boxed primitive object, e.g. created
+ * by `new Boolean()`, `new String()` or `Object(Symbol())`.
+ *
+ * For example:
+ *
+ * ```js
+ * util.types.isBoxedPrimitive(false); // Returns false
+ * util.types.isBoxedPrimitive(new Boolean(false)); // Returns true
+ * util.types.isBoxedPrimitive(Symbol('foo')); // Returns false
+ * util.types.isBoxedPrimitive(Object(Symbol('foo'))); // Returns true
+ * util.types.isBoxedPrimitive(Object(BigInt(5))); // Returns true
+ * ```
+ * @since v10.11.0
+ */
+ function isBoxedPrimitive(object: unknown): object is String | Number | BigInt | Boolean | Symbol;
+ /**
+ * Returns `true` if the value is a built-in [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView) instance.
+ *
+ * ```js
+ * const ab = new ArrayBuffer(20);
+ * util.types.isDataView(new DataView(ab)); // Returns true
+ * util.types.isDataView(new Float64Array()); // Returns false
+ * ```
+ *
+ * See also [`ArrayBuffer.isView()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView).
+ * @since v10.0.0
+ */
+ function isDataView(object: unknown): object is DataView;
+ /**
+ * Returns `true` if the value is a built-in [`Date`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) instance.
+ *
+ * ```js
+ * util.types.isDate(new Date()); // Returns true
+ * ```
+ * @since v10.0.0
+ */
+ function isDate(object: unknown): object is Date;
+ /**
+ * Returns `true` if the value is a native `External` value.
+ *
+ * A native `External` value is a special type of object that contains a
+ * raw C++ pointer (`void*`) for access from native code, and has no other
+ * properties. Such objects are created either by Node.js internals or native
+ * addons. In JavaScript, they are [frozen](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze) objects with a`null` prototype.
+ *
+ * ```c
+ * #include <js_native_api.h>
+ * #include <stdlib.h>
+ * napi_value result;
+ * static napi_value MyNapi(napi_env env, napi_callback_info info) {
+ * int* raw = (int*) malloc(1024);
+ * napi_status status = napi_create_external(env, (void*) raw, NULL, NULL, &#x26;result);
+ * if (status != napi_ok) {
+ * napi_throw_error(env, NULL, "napi_create_external failed");
+ * return NULL;
+ * }
+ * return result;
+ * }
+ * ...
+ * DECLARE_NAPI_PROPERTY("myNapi", MyNapi)
+ * ...
+ * ```
+ *
+ * ```js
+ * const native = require('napi_addon.node');
+ * const data = native.myNapi();
+ * util.types.isExternal(data); // returns true
+ * util.types.isExternal(0); // returns false
+ * util.types.isExternal(new String('foo')); // returns false
+ * ```
+ *
+ * For further information on `napi_create_external`, refer to `napi_create_external()`.
+ * @since v10.0.0
+ */
+ function isExternal(object: unknown): boolean;
+ /**
+ * Returns `true` if the value is a built-in [`Float32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array) instance.
+ *
+ * ```js
+ * util.types.isFloat32Array(new ArrayBuffer()); // Returns false
+ * util.types.isFloat32Array(new Float32Array()); // Returns true
+ * util.types.isFloat32Array(new Float64Array()); // Returns false
+ * ```
+ * @since v10.0.0
+ */
+ function isFloat32Array(object: unknown): object is Float32Array;
+ /**
+ * Returns `true` if the value is a built-in [`Float64Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array) instance.
+ *
+ * ```js
+ * util.types.isFloat64Array(new ArrayBuffer()); // Returns false
+ * util.types.isFloat64Array(new Uint8Array()); // Returns false
+ * util.types.isFloat64Array(new Float64Array()); // Returns true
+ * ```
+ * @since v10.0.0
+ */
+ function isFloat64Array(object: unknown): object is Float64Array;
+ /**
+ * Returns `true` if the value is a generator function.
+ * This only reports back what the JavaScript engine is seeing;
+ * in particular, the return value may not match the original source code if
+ * a transpilation tool was used.
+ *
+ * ```js
+ * util.types.isGeneratorFunction(function foo() {}); // Returns false
+ * util.types.isGeneratorFunction(function* foo() {}); // Returns true
+ * ```
+ * @since v10.0.0
+ */
+ function isGeneratorFunction(object: unknown): object is GeneratorFunction;
+ /**
+ * Returns `true` if the value is a generator object as returned from a
+ * built-in generator function.
+ * This only reports back what the JavaScript engine is seeing;
+ * in particular, the return value may not match the original source code if
+ * a transpilation tool was used.
+ *
+ * ```js
+ * function* foo() {}
+ * const generator = foo();
+ * util.types.isGeneratorObject(generator); // Returns true
+ * ```
+ * @since v10.0.0
+ */
+ function isGeneratorObject(object: unknown): object is Generator;
+ /**
+ * Returns `true` if the value is a built-in [`Int8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array) instance.
+ *
+ * ```js
+ * util.types.isInt8Array(new ArrayBuffer()); // Returns false
+ * util.types.isInt8Array(new Int8Array()); // Returns true
+ * util.types.isInt8Array(new Float64Array()); // Returns false
+ * ```
+ * @since v10.0.0
+ */
+ function isInt8Array(object: unknown): object is Int8Array;
+ /**
+ * Returns `true` if the value is a built-in [`Int16Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array) instance.
+ *
+ * ```js
+ * util.types.isInt16Array(new ArrayBuffer()); // Returns false
+ * util.types.isInt16Array(new Int16Array()); // Returns true
+ * util.types.isInt16Array(new Float64Array()); // Returns false
+ * ```
+ * @since v10.0.0
+ */
+ function isInt16Array(object: unknown): object is Int16Array;
+ /**
+ * Returns `true` if the value is a built-in [`Int32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array) instance.
+ *
+ * ```js
+ * util.types.isInt32Array(new ArrayBuffer()); // Returns false
+ * util.types.isInt32Array(new Int32Array()); // Returns true
+ * util.types.isInt32Array(new Float64Array()); // Returns false
+ * ```
+ * @since v10.0.0
+ */
+ function isInt32Array(object: unknown): object is Int32Array;
+ /**
+ * Returns `true` if the value is a built-in [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) instance.
+ *
+ * ```js
+ * util.types.isMap(new Map()); // Returns true
+ * ```
+ * @since v10.0.0
+ */
+ function isMap<T>(
+ object: T | {},
+ ): object is T extends ReadonlyMap<any, any> ? (unknown extends T ? never : ReadonlyMap<any, any>)
+ : Map<unknown, unknown>;
+ /**
+ * Returns `true` if the value is an iterator returned for a built-in [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) instance.
+ *
+ * ```js
+ * const map = new Map();
+ * util.types.isMapIterator(map.keys()); // Returns true
+ * util.types.isMapIterator(map.values()); // Returns true
+ * util.types.isMapIterator(map.entries()); // Returns true
+ * util.types.isMapIterator(map[Symbol.iterator]()); // Returns true
+ * ```
+ * @since v10.0.0
+ */
+ function isMapIterator(object: unknown): boolean;
+ /**
+ * Returns `true` if the value is an instance of a [Module Namespace Object](https://tc39.github.io/ecma262/#sec-module-namespace-exotic-objects).
+ *
+ * ```js
+ * import * as ns from './a.js';
+ *
+ * util.types.isModuleNamespaceObject(ns); // Returns true
+ * ```
+ * @since v10.0.0
+ */
+ function isModuleNamespaceObject(value: unknown): boolean;
+ /**
+ * Returns `true` if the value is an instance of a built-in `Error` type.
+ *
+ * ```js
+ * util.types.isNativeError(new Error()); // Returns true
+ * util.types.isNativeError(new TypeError()); // Returns true
+ * util.types.isNativeError(new RangeError()); // Returns true
+ * ```
+ * @since v10.0.0
+ */
+ function isNativeError(object: unknown): object is Error;
+ /**
+ * Returns `true` if the value is a number object, e.g. created
+ * by `new Number()`.
+ *
+ * ```js
+ * util.types.isNumberObject(0); // Returns false
+ * util.types.isNumberObject(new Number(0)); // Returns true
+ * ```
+ * @since v10.0.0
+ */
+ function isNumberObject(object: unknown): object is Number;
+ /**
+ * Returns `true` if the value is a built-in [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).
+ *
+ * ```js
+ * util.types.isPromise(Promise.resolve(42)); // Returns true
+ * ```
+ * @since v10.0.0
+ */
+ function isPromise(object: unknown): object is Promise<unknown>;
+ /**
+ * Returns `true` if the value is a [`Proxy`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy) instance.
+ *
+ * ```js
+ * const target = {};
+ * const proxy = new Proxy(target, {});
+ * util.types.isProxy(target); // Returns false
+ * util.types.isProxy(proxy); // Returns true
+ * ```
+ * @since v10.0.0
+ */
+ function isProxy(object: unknown): boolean;
+ /**
+ * Returns `true` if the value is a regular expression object.
+ *
+ * ```js
+ * util.types.isRegExp(/abc/); // Returns true
+ * util.types.isRegExp(new RegExp('abc')); // Returns true
+ * ```
+ * @since v10.0.0
+ */
+ function isRegExp(object: unknown): object is RegExp;
+ /**
+ * Returns `true` if the value is a built-in [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) instance.
+ *
+ * ```js
+ * util.types.isSet(new Set()); // Returns true
+ * ```
+ * @since v10.0.0
+ */
+ function isSet<T>(
+ object: T | {},
+ ): object is T extends ReadonlySet<any> ? (unknown extends T ? never : ReadonlySet<any>) : Set<unknown>;
+ /**
+ * Returns `true` if the value is an iterator returned for a built-in [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) instance.
+ *
+ * ```js
+ * const set = new Set();
+ * util.types.isSetIterator(set.keys()); // Returns true
+ * util.types.isSetIterator(set.values()); // Returns true
+ * util.types.isSetIterator(set.entries()); // Returns true
+ * util.types.isSetIterator(set[Symbol.iterator]()); // Returns true
+ * ```
+ * @since v10.0.0
+ */
+ function isSetIterator(object: unknown): boolean;
+ /**
+ * Returns `true` if the value is a built-in [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instance.
+ * This does _not_ include [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) instances. Usually, it is
+ * desirable to test for both; See `util.types.isAnyArrayBuffer()` for that.
+ *
+ * ```js
+ * util.types.isSharedArrayBuffer(new ArrayBuffer()); // Returns false
+ * util.types.isSharedArrayBuffer(new SharedArrayBuffer()); // Returns true
+ * ```
+ * @since v10.0.0
+ */
+ function isSharedArrayBuffer(object: unknown): object is SharedArrayBuffer;
+ /**
+ * Returns `true` if the value is a string object, e.g. created
+ * by `new String()`.
+ *
+ * ```js
+ * util.types.isStringObject('foo'); // Returns false
+ * util.types.isStringObject(new String('foo')); // Returns true
+ * ```
+ * @since v10.0.0
+ */
+ function isStringObject(object: unknown): object is String;
+ /**
+ * Returns `true` if the value is a symbol object, created
+ * by calling `Object()` on a `Symbol` primitive.
+ *
+ * ```js
+ * const symbol = Symbol('foo');
+ * util.types.isSymbolObject(symbol); // Returns false
+ * util.types.isSymbolObject(Object(symbol)); // Returns true
+ * ```
+ * @since v10.0.0
+ */
+ function isSymbolObject(object: unknown): object is Symbol;
+ /**
+ * Returns `true` if the value is a built-in [`TypedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) instance.
+ *
+ * ```js
+ * util.types.isTypedArray(new ArrayBuffer()); // Returns false
+ * util.types.isTypedArray(new Uint8Array()); // Returns true
+ * util.types.isTypedArray(new Float64Array()); // Returns true
+ * ```
+ *
+ * See also [`ArrayBuffer.isView()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView).
+ * @since v10.0.0
+ */
+ function isTypedArray(object: unknown): object is NodeJS.TypedArray;
+ /**
+ * Returns `true` if the value is a built-in [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) instance.
+ *
+ * ```js
+ * util.types.isUint8Array(new ArrayBuffer()); // Returns false
+ * util.types.isUint8Array(new Uint8Array()); // Returns true
+ * util.types.isUint8Array(new Float64Array()); // Returns false
+ * ```
+ * @since v10.0.0
+ */
+ function isUint8Array(object: unknown): object is Uint8Array;
+ /**
+ * Returns `true` if the value is a built-in [`Uint8ClampedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray) instance.
+ *
+ * ```js
+ * util.types.isUint8ClampedArray(new ArrayBuffer()); // Returns false
+ * util.types.isUint8ClampedArray(new Uint8ClampedArray()); // Returns true
+ * util.types.isUint8ClampedArray(new Float64Array()); // Returns false
+ * ```
+ * @since v10.0.0
+ */
+ function isUint8ClampedArray(object: unknown): object is Uint8ClampedArray;
+ /**
+ * Returns `true` if the value is a built-in [`Uint16Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array) instance.
+ *
+ * ```js
+ * util.types.isUint16Array(new ArrayBuffer()); // Returns false
+ * util.types.isUint16Array(new Uint16Array()); // Returns true
+ * util.types.isUint16Array(new Float64Array()); // Returns false
+ * ```
+ * @since v10.0.0
+ */
+ function isUint16Array(object: unknown): object is Uint16Array;
+ /**
+ * Returns `true` if the value is a built-in [`Uint32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array) instance.
+ *
+ * ```js
+ * util.types.isUint32Array(new ArrayBuffer()); // Returns false
+ * util.types.isUint32Array(new Uint32Array()); // Returns true
+ * util.types.isUint32Array(new Float64Array()); // Returns false
+ * ```
+ * @since v10.0.0
+ */
+ function isUint32Array(object: unknown): object is Uint32Array;
+ /**
+ * Returns `true` if the value is a built-in [`WeakMap`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap) instance.
+ *
+ * ```js
+ * util.types.isWeakMap(new WeakMap()); // Returns true
+ * ```
+ * @since v10.0.0
+ */
+ function isWeakMap(object: unknown): object is WeakMap<object, unknown>;
+ /**
+ * Returns `true` if the value is a built-in [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) instance.
+ *
+ * ```js
+ * util.types.isWeakSet(new WeakSet()); // Returns true
+ * ```
+ * @since v10.0.0
+ */
+ function isWeakSet(object: unknown): object is WeakSet<object>;
+ /**
+ * Returns `true` if `value` is a `KeyObject`, `false` otherwise.
+ * @since v16.2.0
+ */
+ function isKeyObject(object: unknown): object is KeyObject;
+ /**
+ * Returns `true` if `value` is a `CryptoKey`, `false` otherwise.
+ * @since v16.2.0
+ */
+ function isCryptoKey(object: unknown): object is webcrypto.CryptoKey;
+}
+declare module "node:util" {
+ export * from "util";
+}
+declare module "node:util/types" {
+ export * from "util/types";
+}
diff --git a/client/node_modules/@types/node/ts4.8/v8.d.ts b/client/node_modules/@types/node/ts4.8/v8.d.ts
new file mode 100644
index 0000000..b22d7fb
--- /dev/null
+++ b/client/node_modules/@types/node/ts4.8/v8.d.ts
@@ -0,0 +1,541 @@
+/**
+ * The `v8` module exposes APIs that are specific to the version of [V8](https://developers.google.com/v8/) built into the Node.js binary. It can be accessed using:
+ *
+ * ```js
+ * const v8 = require('v8');
+ * ```
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/v8.js)
+ */
+declare module "v8" {
+ import { Readable } from "node:stream";
+ interface HeapSpaceInfo {
+ space_name: string;
+ space_size: number;
+ space_used_size: number;
+ space_available_size: number;
+ physical_space_size: number;
+ }
+ // ** Signifies if the --zap_code_space option is enabled or not. 1 == enabled, 0 == disabled. */
+ type DoesZapCodeSpaceFlag = 0 | 1;
+ interface HeapInfo {
+ total_heap_size: number;
+ total_heap_size_executable: number;
+ total_physical_size: number;
+ total_available_size: number;
+ used_heap_size: number;
+ heap_size_limit: number;
+ malloced_memory: number;
+ peak_malloced_memory: number;
+ does_zap_garbage: DoesZapCodeSpaceFlag;
+ number_of_native_contexts: number;
+ number_of_detached_contexts: number;
+ }
+ interface HeapCodeStatistics {
+ code_and_metadata_size: number;
+ bytecode_and_metadata_size: number;
+ external_script_source_size: number;
+ }
+ /**
+ * Returns an integer representing a version tag derived from the V8 version,
+ * command-line flags, and detected CPU features. This is useful for determining
+ * whether a `vm.Script` `cachedData` buffer is compatible with this instance
+ * of V8.
+ *
+ * ```js
+ * console.log(v8.cachedDataVersionTag()); // 3947234607
+ * // The value returned by v8.cachedDataVersionTag() is derived from the V8
+ * // version, command-line flags, and detected CPU features. Test that the value
+ * // does indeed update when flags are toggled.
+ * v8.setFlagsFromString('--allow_natives_syntax');
+ * console.log(v8.cachedDataVersionTag()); // 183726201
+ * ```
+ * @since v8.0.0
+ */
+ function cachedDataVersionTag(): number;
+ /**
+ * Returns an object with the following properties:
+ *
+ * `does_zap_garbage` is a 0/1 boolean, which signifies whether the`--zap_code_space` option is enabled or not. This makes V8 overwrite heap
+ * garbage with a bit pattern. The RSS footprint (resident set size) gets bigger
+ * because it continuously touches all heap pages and that makes them less likely
+ * to get swapped out by the operating system.
+ *
+ * `number_of_native_contexts` The value of native\_context is the number of the
+ * top-level contexts currently active. Increase of this number over time indicates
+ * a memory leak.
+ *
+ * `number_of_detached_contexts` The value of detached\_context is the number
+ * of contexts that were detached and not yet garbage collected. This number
+ * being non-zero indicates a potential memory leak.
+ *
+ * ```js
+ * {
+ * total_heap_size: 7326976,
+ * total_heap_size_executable: 4194304,
+ * total_physical_size: 7326976,
+ * total_available_size: 1152656,
+ * used_heap_size: 3476208,
+ * heap_size_limit: 1535115264,
+ * malloced_memory: 16384,
+ * peak_malloced_memory: 1127496,
+ * does_zap_garbage: 0,
+ * number_of_native_contexts: 1,
+ * number_of_detached_contexts: 0
+ * }
+ * ```
+ * @since v1.0.0
+ */
+ function getHeapStatistics(): HeapInfo;
+ /**
+ * Returns statistics about the V8 heap spaces, i.e. the segments which make up
+ * the V8 heap. Neither the ordering of heap spaces, nor the availability of a
+ * heap space can be guaranteed as the statistics are provided via the
+ * V8[`GetHeapSpaceStatistics`](https://v8docs.nodesource.com/node-13.2/d5/dda/classv8_1_1_isolate.html#ac673576f24fdc7a33378f8f57e1d13a4) function and may change from one V8 version to the
+ * next.
+ *
+ * The value returned is an array of objects containing the following properties:
+ *
+ * ```json
+ * [
+ * {
+ * "space_name": "new_space",
+ * "space_size": 2063872,
+ * "space_used_size": 951112,
+ * "space_available_size": 80824,
+ * "physical_space_size": 2063872
+ * },
+ * {
+ * "space_name": "old_space",
+ * "space_size": 3090560,
+ * "space_used_size": 2493792,
+ * "space_available_size": 0,
+ * "physical_space_size": 3090560
+ * },
+ * {
+ * "space_name": "code_space",
+ * "space_size": 1260160,
+ * "space_used_size": 644256,
+ * "space_available_size": 960,
+ * "physical_space_size": 1260160
+ * },
+ * {
+ * "space_name": "map_space",
+ * "space_size": 1094160,
+ * "space_used_size": 201608,
+ * "space_available_size": 0,
+ * "physical_space_size": 1094160
+ * },
+ * {
+ * "space_name": "large_object_space",
+ * "space_size": 0,
+ * "space_used_size": 0,
+ * "space_available_size": 1490980608,
+ * "physical_space_size": 0
+ * }
+ * ]
+ * ```
+ * @since v6.0.0
+ */
+ function getHeapSpaceStatistics(): HeapSpaceInfo[];
+ /**
+ * The `v8.setFlagsFromString()` method can be used to programmatically set
+ * V8 command-line flags. This method should be used with care. Changing settings
+ * after the VM has started may result in unpredictable behavior, including
+ * crashes and data loss; or it may simply do nothing.
+ *
+ * The V8 options available for a version of Node.js may be determined by running`node --v8-options`.
+ *
+ * Usage:
+ *
+ * ```js
+ * // Print GC events to stdout for one minute.
+ * const v8 = require('v8');
+ * v8.setFlagsFromString('--trace_gc');
+ * setTimeout(() => { v8.setFlagsFromString('--notrace_gc'); }, 60e3);
+ * ```
+ * @since v1.0.0
+ */
+ function setFlagsFromString(flags: string): void;
+ /**
+ * Generates a snapshot of the current V8 heap and returns a Readable
+ * Stream that may be used to read the JSON serialized representation.
+ * This JSON stream format is intended to be used with tools such as
+ * Chrome DevTools. The JSON schema is undocumented and specific to the
+ * V8 engine. Therefore, the schema may change from one version of V8 to the next.
+ *
+ * Creating a heap snapshot requires memory about twice the size of the heap at
+ * the time the snapshot is created. This results in the risk of OOM killers
+ * terminating the process.
+ *
+ * Generating a snapshot is a synchronous operation which blocks the event loop
+ * for a duration depending on the heap size.
+ *
+ * ```js
+ * // Print heap snapshot to the console
+ * const v8 = require('v8');
+ * const stream = v8.getHeapSnapshot();
+ * stream.pipe(process.stdout);
+ * ```
+ * @since v11.13.0
+ * @return A Readable Stream containing the V8 heap snapshot
+ */
+ function getHeapSnapshot(): Readable;
+ /**
+ * Generates a snapshot of the current V8 heap and writes it to a JSON
+ * file. This file is intended to be used with tools such as Chrome
+ * DevTools. The JSON schema is undocumented and specific to the V8
+ * engine, and may change from one version of V8 to the next.
+ *
+ * A heap snapshot is specific to a single V8 isolate. When using `worker threads`, a heap snapshot generated from the main thread will
+ * not contain any information about the workers, and vice versa.
+ *
+ * Creating a heap snapshot requires memory about twice the size of the heap at
+ * the time the snapshot is created. This results in the risk of OOM killers
+ * terminating the process.
+ *
+ * Generating a snapshot is a synchronous operation which blocks the event loop
+ * for a duration depending on the heap size.
+ *
+ * ```js
+ * const { writeHeapSnapshot } = require('v8');
+ * const {
+ * Worker,
+ * isMainThread,
+ * parentPort
+ * } = require('worker_threads');
+ *
+ * if (isMainThread) {
+ * const worker = new Worker(__filename);
+ *
+ * worker.once('message', (filename) => {
+ * console.log(`worker heapdump: ${filename}`);
+ * // Now get a heapdump for the main thread.
+ * console.log(`main thread heapdump: ${writeHeapSnapshot()}`);
+ * });
+ *
+ * // Tell the worker to create a heapdump.
+ * worker.postMessage('heapdump');
+ * } else {
+ * parentPort.once('message', (message) => {
+ * if (message === 'heapdump') {
+ * // Generate a heapdump for the worker
+ * // and return the filename to the parent.
+ * parentPort.postMessage(writeHeapSnapshot());
+ * }
+ * });
+ * }
+ * ```
+ * @since v11.13.0
+ * @param filename The file path where the V8 heap snapshot is to be saved. If not specified, a file name with the pattern `'Heap-${yyyymmdd}-${hhmmss}-${pid}-${thread_id}.heapsnapshot'` will be
+ * generated, where `{pid}` will be the PID of the Node.js process, `{thread_id}` will be `0` when `writeHeapSnapshot()` is called from the main Node.js thread or the id of a
+ * worker thread.
+ * @return The filename where the snapshot was saved.
+ */
+ function writeHeapSnapshot(filename?: string): string;
+ /**
+ * Returns an object with the following properties:
+ *
+ * ```js
+ * {
+ * code_and_metadata_size: 212208,
+ * bytecode_and_metadata_size: 161368,
+ * external_script_source_size: 1410794
+ * }
+ * ```
+ * @since v12.8.0
+ */
+ function getHeapCodeStatistics(): HeapCodeStatistics;
+ /**
+ * @since v8.0.0
+ */
+ class Serializer {
+ /**
+ * Writes out a header, which includes the serialization format version.
+ */
+ writeHeader(): void;
+ /**
+ * Serializes a JavaScript value and adds the serialized representation to the
+ * internal buffer.
+ *
+ * This throws an error if `value` cannot be serialized.
+ */
+ writeValue(val: any): boolean;
+ /**
+ * Returns the stored internal buffer. This serializer should not be used once
+ * the buffer is released. Calling this method results in undefined behavior
+ * if a previous write has failed.
+ */
+ releaseBuffer(): Buffer;
+ /**
+ * Marks an `ArrayBuffer` as having its contents transferred out of band.
+ * Pass the corresponding `ArrayBuffer` in the deserializing context to `deserializer.transferArrayBuffer()`.
+ * @param id A 32-bit unsigned integer.
+ * @param arrayBuffer An `ArrayBuffer` instance.
+ */
+ transferArrayBuffer(id: number, arrayBuffer: ArrayBuffer): void;
+ /**
+ * Write a raw 32-bit unsigned integer.
+ * For use inside of a custom `serializer._writeHostObject()`.
+ */
+ writeUint32(value: number): void;
+ /**
+ * Write a raw 64-bit unsigned integer, split into high and low 32-bit parts.
+ * For use inside of a custom `serializer._writeHostObject()`.
+ */
+ writeUint64(hi: number, lo: number): void;
+ /**
+ * Write a JS `number` value.
+ * For use inside of a custom `serializer._writeHostObject()`.
+ */
+ writeDouble(value: number): void;
+ /**
+ * Write raw bytes into the serializer’s internal buffer. The deserializer
+ * will require a way to compute the length of the buffer.
+ * For use inside of a custom `serializer._writeHostObject()`.
+ */
+ writeRawBytes(buffer: NodeJS.TypedArray): void;
+ }
+ /**
+ * A subclass of `Serializer` that serializes `TypedArray`(in particular `Buffer`) and `DataView` objects as host objects, and only
+ * stores the part of their underlying `ArrayBuffer`s that they are referring to.
+ * @since v8.0.0
+ */
+ class DefaultSerializer extends Serializer {}
+ /**
+ * @since v8.0.0
+ */
+ class Deserializer {
+ constructor(data: NodeJS.TypedArray);
+ /**
+ * Reads and validates a header (including the format version).
+ * May, for example, reject an invalid or unsupported wire format. In that case,
+ * an `Error` is thrown.
+ */
+ readHeader(): boolean;
+ /**
+ * Deserializes a JavaScript value from the buffer and returns it.
+ */
+ readValue(): any;
+ /**
+ * Marks an `ArrayBuffer` as having its contents transferred out of band.
+ * Pass the corresponding `ArrayBuffer` in the serializing context to `serializer.transferArrayBuffer()` (or return the `id` from `serializer._getSharedArrayBufferId()` in the case of
+ * `SharedArrayBuffer`s).
+ * @param id A 32-bit unsigned integer.
+ * @param arrayBuffer An `ArrayBuffer` instance.
+ */
+ transferArrayBuffer(id: number, arrayBuffer: ArrayBuffer): void;
+ /**
+ * Reads the underlying wire format version. Likely mostly to be useful to
+ * legacy code reading old wire format versions. May not be called before`.readHeader()`.
+ */
+ getWireFormatVersion(): number;
+ /**
+ * Read a raw 32-bit unsigned integer and return it.
+ * For use inside of a custom `deserializer._readHostObject()`.
+ */
+ readUint32(): number;
+ /**
+ * Read a raw 64-bit unsigned integer and return it as an array `[hi, lo]`with two 32-bit unsigned integer entries.
+ * For use inside of a custom `deserializer._readHostObject()`.
+ */
+ readUint64(): [number, number];
+ /**
+ * Read a JS `number` value.
+ * For use inside of a custom `deserializer._readHostObject()`.
+ */
+ readDouble(): number;
+ /**
+ * Read raw bytes from the deserializer’s internal buffer. The `length` parameter
+ * must correspond to the length of the buffer that was passed to `serializer.writeRawBytes()`.
+ * For use inside of a custom `deserializer._readHostObject()`.
+ */
+ readRawBytes(length: number): Buffer;
+ }
+ /**
+ * A subclass of `Deserializer` corresponding to the format written by `DefaultSerializer`.
+ * @since v8.0.0
+ */
+ class DefaultDeserializer extends Deserializer {}
+ /**
+ * Uses a `DefaultSerializer` to serialize `value` into a buffer.
+ *
+ * `ERR_BUFFER_TOO_LARGE` will be thrown when trying to
+ * serialize a huge object which requires buffer
+ * larger than `buffer.constants.MAX_LENGTH`.
+ * @since v8.0.0
+ */
+ function serialize(value: any): Buffer;
+ /**
+ * Uses a `DefaultDeserializer` with default options to read a JS value
+ * from a buffer.
+ * @since v8.0.0
+ * @param buffer A buffer returned by {@link serialize}.
+ */
+ function deserialize(buffer: NodeJS.TypedArray): any;
+ /**
+ * The `v8.takeCoverage()` method allows the user to write the coverage started by `NODE_V8_COVERAGE` to disk on demand. This method can be invoked multiple
+ * times during the lifetime of the process. Each time the execution counter will
+ * be reset and a new coverage report will be written to the directory specified
+ * by `NODE_V8_COVERAGE`.
+ *
+ * When the process is about to exit, one last coverage will still be written to
+ * disk unless {@link stopCoverage} is invoked before the process exits.
+ * @since v15.1.0, v14.18.0, v12.22.0
+ */
+ function takeCoverage(): void;
+ /**
+ * The `v8.stopCoverage()` method allows the user to stop the coverage collection
+ * started by `NODE_V8_COVERAGE`, so that V8 can release the execution count
+ * records and optimize code. This can be used in conjunction with {@link takeCoverage} if the user wants to collect the coverage on demand.
+ * @since v15.1.0, v14.18.0, v12.22.0
+ */
+ function stopCoverage(): void;
+
+ /**
+ * This API collects GC data in current thread.
+ */
+ class GCProfiler {
+ /**
+ * Start collecting GC data.
+ */
+ start(): void;
+ /**
+ * Stop collecting GC data and return a object.
+ */
+ stop(): GCProfilerResult;
+ }
+ interface GCProfilerResult {
+ version: number;
+ startTime: number;
+ endTime: number;
+ statistics: Array<{
+ gcType: string;
+ cost: number;
+ beforeGC: {
+ heapStatistics: HeapStatistics;
+ heapSpaceStatistics: HeapSpaceStatistics[];
+ };
+ afterGC: {
+ heapStatistics: HeapStatistics;
+ heapSpaceStatistics: HeapSpaceStatistics[];
+ };
+ }>;
+ }
+ interface HeapStatistics {
+ totalHeapSize: number;
+ totalHeapSizeExecutable: number;
+ totalPhysicalSize: number;
+ totalAvailableSize: number;
+ totalGlobalHandlesSize: number;
+ usedGlobalHandlesSize: number;
+ usedHeapSize: number;
+ heapSizeLimit: number;
+ mallocedMemory: number;
+ externalMemory: number;
+ peakMallocedMemory: number;
+ }
+ interface HeapSpaceStatistics {
+ spaceName: string;
+ spaceSize: number;
+ spaceUsedSize: number;
+ spaceAvailableSize: number;
+ physicalSpaceSize: number;
+ }
+ /**
+ * Called when a promise is constructed. This does not mean that corresponding before/after events will occur, only that the possibility exists. This will
+ * happen if a promise is created without ever getting a continuation.
+ * @since v17.1.0, v16.14.0
+ * @param promise The promise being created.
+ * @param parent The promise continued from, if applicable.
+ */
+ interface Init {
+ (promise: Promise<unknown>, parent: Promise<unknown>): void;
+ }
+ /**
+ * Called before a promise continuation executes. This can be in the form of `then()`, `catch()`, or `finally()` handlers or an await resuming.
+ *
+ * The before callback will be called 0 to N times. The before callback will typically be called 0 times if no continuation was ever made for the promise.
+ * The before callback may be called many times in the case where many continuations have been made from the same promise.
+ * @since v17.1.0, v16.14.0
+ */
+ interface Before {
+ (promise: Promise<unknown>): void;
+ }
+ /**
+ * Called immediately after a promise continuation executes. This may be after a `then()`, `catch()`, or `finally()` handler or before an await after another await.
+ * @since v17.1.0, v16.14.0
+ */
+ interface After {
+ (promise: Promise<unknown>): void;
+ }
+ /**
+ * Called when the promise receives a resolution or rejection value. This may occur synchronously in the case of {@link Promise.resolve()} or
+ * {@link Promise.reject()}.
+ * @since v17.1.0, v16.14.0
+ */
+ interface Settled {
+ (promise: Promise<unknown>): void;
+ }
+ /**
+ * Key events in the lifetime of a promise have been categorized into four areas: creation of a promise, before/after a continuation handler is called or
+ * around an await, and when the promise resolves or rejects.
+ *
+ * Because promises are asynchronous resources whose lifecycle is tracked via the promise hooks mechanism, the `init()`, `before()`, `after()`, and
+ * `settled()` callbacks must not be async functions as they create more promises which would produce an infinite loop.
+ * @since v17.1.0, v16.14.0
+ */
+ interface HookCallbacks {
+ init?: Init;
+ before?: Before;
+ after?: After;
+ settled?: Settled;
+ }
+ interface PromiseHooks {
+ /**
+ * The `init` hook must be a plain function. Providing an async function will throw as it would produce an infinite microtask loop.
+ * @since v17.1.0, v16.14.0
+ * @param init The {@link Init | `init` callback} to call when a promise is created.
+ * @return Call to stop the hook.
+ */
+ onInit: (init: Init) => Function;
+ /**
+ * The `settled` hook must be a plain function. Providing an async function will throw as it would produce an infinite microtask loop.
+ * @since v17.1.0, v16.14.0
+ * @param settled The {@link Settled | `settled` callback} to call when a promise is created.
+ * @return Call to stop the hook.
+ */
+ onSettled: (settled: Settled) => Function;
+ /**
+ * The `before` hook must be a plain function. Providing an async function will throw as it would produce an infinite microtask loop.
+ * @since v17.1.0, v16.14.0
+ * @param before The {@link Before | `before` callback} to call before a promise continuation executes.
+ * @return Call to stop the hook.
+ */
+ onBefore: (before: Before) => Function;
+ /**
+ * The `after` hook must be a plain function. Providing an async function will throw as it would produce an infinite microtask loop.
+ * @since v17.1.0, v16.14.0
+ * @param after The {@link After | `after` callback} to call after a promise continuation executes.
+ * @return Call to stop the hook.
+ */
+ onAfter: (after: After) => Function;
+ /**
+ * Registers functions to be called for different lifetime events of each promise.
+ * The callbacks `init()`/`before()`/`after()`/`settled()` are called for the respective events during a promise's lifetime.
+ * All callbacks are optional. For example, if only promise creation needs to be tracked, then only the init callback needs to be passed.
+ * The hook callbacks must be plain functions. Providing async functions will throw as it would produce an infinite microtask loop.
+ * @since v17.1.0, v16.14.0
+ * @param callbacks The {@link HookCallbacks | Hook Callbacks} to register
+ * @return Used for disabling hooks
+ */
+ createHook: (callbacks: HookCallbacks) => Function;
+ }
+ /**
+ * The `promiseHooks` interface can be used to track promise lifecycle events.
+ * @since v17.1.0, v16.14.0
+ */
+ const promiseHooks: PromiseHooks;
+}
+declare module "node:v8" {
+ export * from "v8";
+}
diff --git a/client/node_modules/@types/node/ts4.8/vm.d.ts b/client/node_modules/@types/node/ts4.8/vm.d.ts
new file mode 100644
index 0000000..8d2f6ab
--- /dev/null
+++ b/client/node_modules/@types/node/ts4.8/vm.d.ts
@@ -0,0 +1,663 @@
+/**
+ * The `vm` module enables compiling and running code within V8 Virtual
+ * Machine contexts.
+ *
+ * **The `vm` module is not a security**
+ * **mechanism. Do not use it to run untrusted code.**
+ *
+ * JavaScript code can be compiled and run immediately or
+ * compiled, saved, and run later.
+ *
+ * A common use case is to run the code in a different V8 Context. This means
+ * invoked code has a different global object than the invoking code.
+ *
+ * One can provide the context by `contextifying` an
+ * object. The invoked code treats any property in the context like a
+ * global variable. Any changes to global variables caused by the invoked
+ * code are reflected in the context object.
+ *
+ * ```js
+ * const vm = require('vm');
+ *
+ * const x = 1;
+ *
+ * const context = { x: 2 };
+ * vm.createContext(context); // Contextify the object.
+ *
+ * const code = 'x += 40; var y = 17;';
+ * // `x` and `y` are global variables in the context.
+ * // Initially, x has the value 2 because that is the value of context.x.
+ * vm.runInContext(code, context);
+ *
+ * console.log(context.x); // 42
+ * console.log(context.y); // 17
+ *
+ * console.log(x); // 1; y is not defined.
+ * ```
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/vm.js)
+ */
+declare module "vm" {
+ import { ImportAssertions } from "node:module";
+ interface Context extends NodeJS.Dict<any> {}
+ interface BaseOptions {
+ /**
+ * Specifies the filename used in stack traces produced by this script.
+ * Default: `''`.
+ */
+ filename?: string | undefined;
+ /**
+ * Specifies the line number offset that is displayed in stack traces produced by this script.
+ * Default: `0`.
+ */
+ lineOffset?: number | undefined;
+ /**
+ * Specifies the column number offset that is displayed in stack traces produced by this script.
+ * @default 0
+ */
+ columnOffset?: number | undefined;
+ }
+ interface ScriptOptions extends BaseOptions {
+ /**
+ * V8's code cache data for the supplied source.
+ */
+ cachedData?: Buffer | NodeJS.ArrayBufferView | undefined;
+ /** @deprecated in favor of `script.createCachedData()` */
+ produceCachedData?: boolean | undefined;
+ /**
+ * Called during evaluation of this module when `import()` is called.
+ * If this option is not specified, calls to `import()` will reject with `ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING`.
+ */
+ importModuleDynamically?:
+ | ((specifier: string, script: Script, importAssertions: ImportAssertions) => Module)
+ | undefined;
+ }
+ interface RunningScriptOptions extends BaseOptions {
+ /**
+ * When `true`, if an `Error` occurs while compiling the `code`, the line of code causing the error is attached to the stack trace.
+ * Default: `true`.
+ */
+ displayErrors?: boolean | undefined;
+ /**
+ * Specifies the number of milliseconds to execute code before terminating execution.
+ * If execution is terminated, an `Error` will be thrown. This value must be a strictly positive integer.
+ */
+ timeout?: number | undefined;
+ /**
+ * If `true`, the execution will be terminated when `SIGINT` (Ctrl+C) is received.
+ * Existing handlers for the event that have been attached via `process.on('SIGINT')` will be disabled during script execution, but will continue to work after that.
+ * If execution is terminated, an `Error` will be thrown.
+ * Default: `false`.
+ */
+ breakOnSigint?: boolean | undefined;
+ }
+ interface RunningScriptInNewContextOptions extends RunningScriptOptions {
+ /**
+ * Human-readable name of the newly created context.
+ */
+ contextName?: CreateContextOptions["name"];
+ /**
+ * Origin corresponding to the newly created context for display purposes. The origin should be formatted like a URL,
+ * but with only the scheme, host, and port (if necessary), like the value of the `url.origin` property of a `URL` object.
+ * Most notably, this string should omit the trailing slash, as that denotes a path.
+ */
+ contextOrigin?: CreateContextOptions["origin"];
+ contextCodeGeneration?: CreateContextOptions["codeGeneration"];
+ /**
+ * If set to `afterEvaluate`, microtasks will be run immediately after the script has run.
+ */
+ microtaskMode?: CreateContextOptions["microtaskMode"];
+ }
+ interface RunningCodeOptions extends RunningScriptOptions {
+ cachedData?: ScriptOptions["cachedData"];
+ importModuleDynamically?: ScriptOptions["importModuleDynamically"];
+ }
+ interface RunningCodeInNewContextOptions extends RunningScriptInNewContextOptions {
+ cachedData?: ScriptOptions["cachedData"];
+ importModuleDynamically?: ScriptOptions["importModuleDynamically"];
+ }
+ interface CompileFunctionOptions extends BaseOptions {
+ /**
+ * Provides an optional data with V8's code cache data for the supplied source.
+ */
+ cachedData?: Buffer | undefined;
+ /**
+ * Specifies whether to produce new cache data.
+ * Default: `false`,
+ */
+ produceCachedData?: boolean | undefined;
+ /**
+ * The sandbox/context in which the said function should be compiled in.
+ */
+ parsingContext?: Context | undefined;
+ /**
+ * An array containing a collection of context extensions (objects wrapping the current scope) to be applied while compiling
+ */
+ contextExtensions?: Object[] | undefined;
+ }
+ interface CreateContextOptions {
+ /**
+ * Human-readable name of the newly created context.
+ * @default 'VM Context i' Where i is an ascending numerical index of the created context.
+ */
+ name?: string | undefined;
+ /**
+ * Corresponds to the newly created context for display purposes.
+ * The origin should be formatted like a `URL`, but with only the scheme, host, and port (if necessary),
+ * like the value of the `url.origin` property of a URL object.
+ * Most notably, this string should omit the trailing slash, as that denotes a path.
+ * @default ''
+ */
+ origin?: string | undefined;
+ codeGeneration?:
+ | {
+ /**
+ * If set to false any calls to eval or function constructors (Function, GeneratorFunction, etc)
+ * will throw an EvalError.
+ * @default true
+ */
+ strings?: boolean | undefined;
+ /**
+ * If set to false any attempt to compile a WebAssembly module will throw a WebAssembly.CompileError.
+ * @default true
+ */
+ wasm?: boolean | undefined;
+ }
+ | undefined;
+ /**
+ * If set to `afterEvaluate`, microtasks will be run immediately after the script has run.
+ */
+ microtaskMode?: "afterEvaluate" | undefined;
+ }
+ type MeasureMemoryMode = "summary" | "detailed";
+ interface MeasureMemoryOptions {
+ /**
+ * @default 'summary'
+ */
+ mode?: MeasureMemoryMode | undefined;
+ /**
+ * @default 'default'
+ */
+ execution?: "default" | "eager" | undefined;
+ }
+ interface MemoryMeasurement {
+ total: {
+ jsMemoryEstimate: number;
+ jsMemoryRange: [number, number];
+ };
+ }
+ /**
+ * Instances of the `vm.Script` class contain precompiled scripts that can be
+ * executed in specific contexts.
+ * @since v0.3.1
+ */
+ class Script {
+ constructor(code: string, options?: ScriptOptions | string);
+ /**
+ * Runs the compiled code contained by the `vm.Script` object within the given`contextifiedObject` and returns the result. Running code does not have access
+ * to local scope.
+ *
+ * The following example compiles code that increments a global variable, sets
+ * the value of another global variable, then execute the code multiple times.
+ * The globals are contained in the `context` object.
+ *
+ * ```js
+ * const vm = require('vm');
+ *
+ * const context = {
+ * animal: 'cat',
+ * count: 2
+ * };
+ *
+ * const script = new vm.Script('count += 1; name = "kitty";');
+ *
+ * vm.createContext(context);
+ * for (let i = 0; i < 10; ++i) {
+ * script.runInContext(context);
+ * }
+ *
+ * console.log(context);
+ * // Prints: { animal: 'cat', count: 12, name: 'kitty' }
+ * ```
+ *
+ * Using the `timeout` or `breakOnSigint` options will result in new event loops
+ * and corresponding threads being started, which have a non-zero performance
+ * overhead.
+ * @since v0.3.1
+ * @param contextifiedObject A `contextified` object as returned by the `vm.createContext()` method.
+ * @return the result of the very last statement executed in the script.
+ */
+ runInContext(contextifiedObject: Context, options?: RunningScriptOptions): any;
+ /**
+ * First contextifies the given `contextObject`, runs the compiled code contained
+ * by the `vm.Script` object within the created context, and returns the result.
+ * Running code does not have access to local scope.
+ *
+ * The following example compiles code that sets a global variable, then executes
+ * the code multiple times in different contexts. The globals are set on and
+ * contained within each individual `context`.
+ *
+ * ```js
+ * const vm = require('vm');
+ *
+ * const script = new vm.Script('globalVar = "set"');
+ *
+ * const contexts = [{}, {}, {}];
+ * contexts.forEach((context) => {
+ * script.runInNewContext(context);
+ * });
+ *
+ * console.log(contexts);
+ * // Prints: [{ globalVar: 'set' }, { globalVar: 'set' }, { globalVar: 'set' }]
+ * ```
+ * @since v0.3.1
+ * @param contextObject An object that will be `contextified`. If `undefined`, a new object will be created.
+ * @return the result of the very last statement executed in the script.
+ */
+ runInNewContext(contextObject?: Context, options?: RunningScriptInNewContextOptions): any;
+ /**
+ * Runs the compiled code contained by the `vm.Script` within the context of the
+ * current `global` object. Running code does not have access to local scope, but _does_ have access to the current `global` object.
+ *
+ * The following example compiles code that increments a `global` variable then
+ * executes that code multiple times:
+ *
+ * ```js
+ * const vm = require('vm');
+ *
+ * global.globalVar = 0;
+ *
+ * const script = new vm.Script('globalVar += 1', { filename: 'myfile.vm' });
+ *
+ * for (let i = 0; i < 1000; ++i) {
+ * script.runInThisContext();
+ * }
+ *
+ * console.log(globalVar);
+ *
+ * // 1000
+ * ```
+ * @since v0.3.1
+ * @return the result of the very last statement executed in the script.
+ */
+ runInThisContext(options?: RunningScriptOptions): any;
+ /**
+ * Creates a code cache that can be used with the `Script` constructor's`cachedData` option. Returns a `Buffer`. This method may be called at any
+ * time and any number of times.
+ *
+ * ```js
+ * const script = new vm.Script(`
+ * function add(a, b) {
+ * return a + b;
+ * }
+ *
+ * const x = add(1, 2);
+ * `);
+ *
+ * const cacheWithoutX = script.createCachedData();
+ *
+ * script.runInThisContext();
+ *
+ * const cacheWithX = script.createCachedData();
+ * ```
+ * @since v10.6.0
+ */
+ createCachedData(): Buffer;
+ /** @deprecated in favor of `script.createCachedData()` */
+ cachedDataProduced?: boolean | undefined;
+ cachedDataRejected?: boolean | undefined;
+ cachedData?: Buffer | undefined;
+ /**
+ * When the script is compiled from a source that contains a source map magic comment, this property will be set to the URL of the source map.
+ */
+ sourceMapURL?: string | undefined;
+ }
+ /**
+ * If given a `contextObject`, the `vm.createContext()` method will `prepare
+ * that object` so that it can be used in calls to {@link runInContext} or `script.runInContext()`. Inside such scripts,
+ * the `contextObject` will be the global object, retaining all of its existing
+ * properties but also having the built-in objects and functions any standard [global object](https://es5.github.io/#x15.1) has. Outside of scripts run by the vm module, global variables
+ * will remain unchanged.
+ *
+ * ```js
+ * const vm = require('vm');
+ *
+ * global.globalVar = 3;
+ *
+ * const context = { globalVar: 1 };
+ * vm.createContext(context);
+ *
+ * vm.runInContext('globalVar *= 2;', context);
+ *
+ * console.log(context);
+ * // Prints: { globalVar: 2 }
+ *
+ * console.log(global.globalVar);
+ * // Prints: 3
+ * ```
+ *
+ * If `contextObject` is omitted (or passed explicitly as `undefined`), a new,
+ * empty `contextified` object will be returned.
+ *
+ * The `vm.createContext()` method is primarily useful for creating a single
+ * context that can be used to run multiple scripts. For instance, if emulating a
+ * web browser, the method can be used to create a single context representing a
+ * window's global object, then run all `<script>` tags together within that
+ * context.
+ *
+ * The provided `name` and `origin` of the context are made visible through the
+ * Inspector API.
+ * @since v0.3.1
+ * @return contextified object.
+ */
+ function createContext(sandbox?: Context, options?: CreateContextOptions): Context;
+ /**
+ * Returns `true` if the given `object` object has been `contextified` using {@link createContext}.
+ * @since v0.11.7
+ */
+ function isContext(sandbox: Context): boolean;
+ /**
+ * The `vm.runInContext()` method compiles `code`, runs it within the context of
+ * the `contextifiedObject`, then returns the result. Running code does not have
+ * access to the local scope. The `contextifiedObject` object _must_ have been
+ * previously `contextified` using the {@link createContext} method.
+ *
+ * If `options` is a string, then it specifies the filename.
+ *
+ * The following example compiles and executes different scripts using a single `contextified` object:
+ *
+ * ```js
+ * const vm = require('vm');
+ *
+ * const contextObject = { globalVar: 1 };
+ * vm.createContext(contextObject);
+ *
+ * for (let i = 0; i < 10; ++i) {
+ * vm.runInContext('globalVar *= 2;', contextObject);
+ * }
+ * console.log(contextObject);
+ * // Prints: { globalVar: 1024 }
+ * ```
+ * @since v0.3.1
+ * @param code The JavaScript code to compile and run.
+ * @param contextifiedObject The `contextified` object that will be used as the `global` when the `code` is compiled and run.
+ * @return the result of the very last statement executed in the script.
+ */
+ function runInContext(code: string, contextifiedObject: Context, options?: RunningCodeOptions | string): any;
+ /**
+ * The `vm.runInNewContext()` first contextifies the given `contextObject` (or
+ * creates a new `contextObject` if passed as `undefined`), compiles the `code`,
+ * runs it within the created context, then returns the result. Running code
+ * does not have access to the local scope.
+ *
+ * If `options` is a string, then it specifies the filename.
+ *
+ * The following example compiles and executes code that increments a global
+ * variable and sets a new one. These globals are contained in the `contextObject`.
+ *
+ * ```js
+ * const vm = require('vm');
+ *
+ * const contextObject = {
+ * animal: 'cat',
+ * count: 2
+ * };
+ *
+ * vm.runInNewContext('count += 1; name = "kitty"', contextObject);
+ * console.log(contextObject);
+ * // Prints: { animal: 'cat', count: 3, name: 'kitty' }
+ * ```
+ * @since v0.3.1
+ * @param code The JavaScript code to compile and run.
+ * @param contextObject An object that will be `contextified`. If `undefined`, a new object will be created.
+ * @return the result of the very last statement executed in the script.
+ */
+ function runInNewContext(
+ code: string,
+ contextObject?: Context,
+ options?: RunningCodeInNewContextOptions | string,
+ ): any;
+ /**
+ * `vm.runInThisContext()` compiles `code`, runs it within the context of the
+ * current `global` and returns the result. Running code does not have access to
+ * local scope, but does have access to the current `global` object.
+ *
+ * If `options` is a string, then it specifies the filename.
+ *
+ * The following example illustrates using both `vm.runInThisContext()` and
+ * the JavaScript [`eval()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval) function to run the same code:
+ *
+ * ```js
+ * const vm = require('vm');
+ * let localVar = 'initial value';
+ *
+ * const vmResult = vm.runInThisContext('localVar = "vm";');
+ * console.log(`vmResult: '${vmResult}', localVar: '${localVar}'`);
+ * // Prints: vmResult: 'vm', localVar: 'initial value'
+ *
+ * const evalResult = eval('localVar = "eval";');
+ * console.log(`evalResult: '${evalResult}', localVar: '${localVar}'`);
+ * // Prints: evalResult: 'eval', localVar: 'eval'
+ * ```
+ *
+ * Because `vm.runInThisContext()` does not have access to the local scope,`localVar` is unchanged. In contrast,
+ * [`eval()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval) _does_ have access to the
+ * local scope, so the value `localVar` is changed. In this way`vm.runInThisContext()` is much like an [indirect `eval()` call](https://es5.github.io/#x10.4.2), e.g.`(0,eval)('code')`.
+ *
+ * ## Example: Running an HTTP server within a VM
+ *
+ * When using either `script.runInThisContext()` or {@link runInThisContext}, the code is executed within the current V8 global
+ * context. The code passed to this VM context will have its own isolated scope.
+ *
+ * In order to run a simple web server using the `http` module the code passed to
+ * the context must either call `require('http')` on its own, or have a reference
+ * to the `http` module passed to it. For instance:
+ *
+ * ```js
+ * 'use strict';
+ * const vm = require('vm');
+ *
+ * const code = `
+ * ((require) => {
+ * const http = require('http');
+ *
+ * http.createServer((request, response) => {
+ * response.writeHead(200, { 'Content-Type': 'text/plain' });
+ * response.end('Hello World\\n');
+ * }).listen(8124);
+ *
+ * console.log('Server running at http://127.0.0.1:8124/');
+ * })`;
+ *
+ * vm.runInThisContext(code)(require);
+ * ```
+ *
+ * The `require()` in the above case shares the state with the context it is
+ * passed from. This may introduce risks when untrusted code is executed, e.g.
+ * altering objects in the context in unwanted ways.
+ * @since v0.3.1
+ * @param code The JavaScript code to compile and run.
+ * @return the result of the very last statement executed in the script.
+ */
+ function runInThisContext(code: string, options?: RunningCodeOptions | string): any;
+ /**
+ * Compiles the given code into the provided context (if no context is
+ * supplied, the current context is used), and returns it wrapped inside a
+ * function with the given `params`.
+ * @since v10.10.0
+ * @param code The body of the function to compile.
+ * @param params An array of strings containing all parameters for the function.
+ */
+ function compileFunction(
+ code: string,
+ params?: readonly string[],
+ options?: CompileFunctionOptions,
+ ): Function & {
+ cachedData?: Script["cachedData"] | undefined;
+ cachedDataProduced?: Script["cachedDataProduced"] | undefined;
+ cachedDataRejected?: Script["cachedDataRejected"] | undefined;
+ };
+ /**
+ * Measure the memory known to V8 and used by all contexts known to the
+ * current V8 isolate, or the main context.
+ *
+ * The format of the object that the returned Promise may resolve with is
+ * specific to the V8 engine and may change from one version of V8 to the next.
+ *
+ * The returned result is different from the statistics returned by`v8.getHeapSpaceStatistics()` in that `vm.measureMemory()` measure the
+ * memory reachable by each V8 specific contexts in the current instance of
+ * the V8 engine, while the result of `v8.getHeapSpaceStatistics()` measure
+ * the memory occupied by each heap space in the current V8 instance.
+ *
+ * ```js
+ * const vm = require('vm');
+ * // Measure the memory used by the main context.
+ * vm.measureMemory({ mode: 'summary' })
+ * // This is the same as vm.measureMemory()
+ * .then((result) => {
+ * // The current format is:
+ * // {
+ * // total: {
+ * // jsMemoryEstimate: 2418479, jsMemoryRange: [ 2418479, 2745799 ]
+ * // }
+ * // }
+ * console.log(result);
+ * });
+ *
+ * const context = vm.createContext({ a: 1 });
+ * vm.measureMemory({ mode: 'detailed', execution: 'eager' })
+ * .then((result) => {
+ * // Reference the context here so that it won't be GC'ed
+ * // until the measurement is complete.
+ * console.log(context.a);
+ * // {
+ * // total: {
+ * // jsMemoryEstimate: 2574732,
+ * // jsMemoryRange: [ 2574732, 2904372 ]
+ * // },
+ * // current: {
+ * // jsMemoryEstimate: 2438996,
+ * // jsMemoryRange: [ 2438996, 2768636 ]
+ * // },
+ * // other: [
+ * // {
+ * // jsMemoryEstimate: 135736,
+ * // jsMemoryRange: [ 135736, 465376 ]
+ * // }
+ * // ]
+ * // }
+ * console.log(result);
+ * });
+ * ```
+ * @since v13.10.0
+ * @experimental
+ */
+ function measureMemory(options?: MeasureMemoryOptions): Promise<MemoryMeasurement>;
+
+ interface ModuleEvaluateOptions {
+ timeout?: RunningScriptOptions["timeout"] | undefined;
+ breakOnSigint?: RunningScriptOptions["breakOnSigint"] | undefined;
+ }
+ type ModuleLinker = (
+ specifier: string,
+ referencingModule: Module,
+ extra: { assert: Object },
+ ) => Module | Promise<Module>;
+ type ModuleStatus = "unlinked" | "linking" | "linked" | "evaluating" | "evaluated" | "errored";
+ class Module {
+ /**
+ * The specifiers of all dependencies of this module.
+ */
+ dependencySpecifiers: readonly string[];
+ /**
+ * If the `module.status` is `'errored'`, this property contains the exception thrown by the module during evaluation.
+ * If the status is anything else, accessing this property will result in a thrown exception.
+ */
+ error: any;
+ /**
+ * The identifier of the current module, as set in the constructor.
+ */
+ identifier: string;
+ context: Context;
+ /**
+ * The namespace object of the module. This is only available after linking (`module.link()`) has completed.
+ */
+ namespace: Object;
+ /**
+ * The current status of the module.
+ */
+ status: ModuleStatus;
+ /**
+ * Evaluate the module.
+ *
+ * This must be called after the module has been linked; otherwise it will reject
+ * It could be called also when the module has already been evaluated, in which case it will either do nothing
+ * if the initial evaluation ended in success (`module.status` is `'evaluated'`) or it will re-throw the exception
+ * that the initial evaluation resulted in (`module.status` is `'errored'`).
+ *
+ * This method cannot be called while the module is being evaluated (`module.status` is `'evaluating'`).
+ */
+ evaluate(options?: ModuleEvaluateOptions): Promise<void>;
+ /**
+ * Link module dependencies. This method must be called before evaluation, and can only be called once per module.
+ */
+ link(linker: ModuleLinker): Promise<void>;
+ }
+
+ interface SourceTextModuleOptions {
+ /**
+ * String used in stack traces.
+ * @default 'vm:module(i)' where i is a context-specific ascending index.
+ */
+ identifier?: string | undefined;
+ cachedData?: ScriptOptions["cachedData"] | undefined;
+ context?: Context | undefined;
+ lineOffset?: BaseOptions["lineOffset"] | undefined;
+ columnOffset?: BaseOptions["columnOffset"] | undefined;
+ /**
+ * Called during evaluation of this module to initialize the `import.meta`.
+ */
+ initializeImportMeta?: ((meta: ImportMeta, module: SourceTextModule) => void) | undefined;
+ importModuleDynamically?: ScriptOptions["importModuleDynamically"] | undefined;
+ }
+ class SourceTextModule extends Module {
+ /**
+ * Creates a new `SourceTextModule` instance.
+ * @param code JavaScript Module code to parse
+ */
+ constructor(code: string, options?: SourceTextModuleOptions);
+ }
+
+ interface SyntheticModuleOptions {
+ /**
+ * String used in stack traces.
+ * @default 'vm:module(i)' where i is a context-specific ascending index.
+ */
+ identifier?: string | undefined;
+ /**
+ * The contextified object as returned by the `vm.createContext()` method, to compile and evaluate this module in.
+ */
+ context?: Context | undefined;
+ }
+ class SyntheticModule extends Module {
+ /**
+ * Creates a new `SyntheticModule` instance.
+ * @param exportNames Array of names that will be exported from the module.
+ * @param evaluateCallback Called when the module is evaluated.
+ */
+ constructor(
+ exportNames: string[],
+ evaluateCallback: (this: SyntheticModule) => void,
+ options?: SyntheticModuleOptions,
+ );
+ /**
+ * This method is used after the module is linked to set the values of exports.
+ * If it is called before the module is linked, an `ERR_VM_MODULE_STATUS` error will be thrown.
+ * @param name
+ * @param value
+ */
+ setExport(name: string, value: any): void;
+ }
+}
+declare module "node:vm" {
+ export * from "vm";
+}
diff --git a/client/node_modules/@types/node/ts4.8/wasi.d.ts b/client/node_modules/@types/node/ts4.8/wasi.d.ts
new file mode 100644
index 0000000..9af8059
--- /dev/null
+++ b/client/node_modules/@types/node/ts4.8/wasi.d.ts
@@ -0,0 +1,158 @@
+/**
+ * The WASI API provides an implementation of the [WebAssembly System Interface](https://wasi.dev/) specification. WASI gives sandboxed WebAssembly applications access to the
+ * underlying operating system via a collection of POSIX-like functions.
+ *
+ * ```js
+ * import { readFile } from 'fs/promises';
+ * import { WASI } from 'wasi';
+ * import { argv, env } from 'process';
+ *
+ * const wasi = new WASI({
+ * args: argv,
+ * env,
+ * preopens: {
+ * '/sandbox': '/some/real/path/that/wasm/can/access'
+ * }
+ * });
+ *
+ * // Some WASI binaries require:
+ * // const importObject = { wasi_unstable: wasi.wasiImport };
+ * const importObject = { wasi_snapshot_preview1: wasi.wasiImport };
+ *
+ * const wasm = await WebAssembly.compile(
+ * await readFile(new URL('./demo.wasm', import.meta.url))
+ * );
+ * const instance = await WebAssembly.instantiate(wasm, importObject);
+ *
+ * wasi.start(instance);
+ * ```
+ *
+ * To run the above example, create a new WebAssembly text format file named`demo.wat`:
+ *
+ * ```text
+ * (module
+ * ;; Import the required fd_write WASI function which will write the given io vectors to stdout
+ * ;; The function signature for fd_write is:
+ * ;; (File Descriptor, *iovs, iovs_len, nwritten) -> Returns number of bytes written
+ * (import "wasi_snapshot_preview1" "fd_write" (func $fd_write (param i32 i32 i32 i32) (result i32)))
+ *
+ * (memory 1)
+ * (export "memory" (memory 0))
+ *
+ * ;; Write 'hello world\n' to memory at an offset of 8 bytes
+ * ;; Note the trailing newline which is required for the text to appear
+ * (data (i32.const 8) "hello world\n")
+ *
+ * (func $main (export "_start")
+ * ;; Creating a new io vector within linear memory
+ * (i32.store (i32.const 0) (i32.const 8)) ;; iov.iov_base - This is a pointer to the start of the 'hello world\n' string
+ * (i32.store (i32.const 4) (i32.const 12)) ;; iov.iov_len - The length of the 'hello world\n' string
+ *
+ * (call $fd_write
+ * (i32.const 1) ;; file_descriptor - 1 for stdout
+ * (i32.const 0) ;; *iovs - The pointer to the iov array, which is stored at memory location 0
+ * (i32.const 1) ;; iovs_len - We're printing 1 string stored in an iov - so one.
+ * (i32.const 20) ;; nwritten - A place in memory to store the number of bytes written
+ * )
+ * drop ;; Discard the number of bytes written from the top of the stack
+ * )
+ * )
+ * ```
+ *
+ * Use [wabt](https://github.com/WebAssembly/wabt) to compile `.wat` to `.wasm`
+ *
+ * ```console
+ * $ wat2wasm demo.wat
+ * ```
+ *
+ * The `--experimental-wasi-unstable-preview1` CLI argument is needed for this
+ * example to run.
+ * @experimental
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/wasi.js)
+ */
+declare module "wasi" {
+ interface WASIOptions {
+ /**
+ * An array of strings that the WebAssembly application will
+ * see as command line arguments. The first argument is the virtual path to the
+ * WASI command itself.
+ */
+ args?: string[] | undefined;
+ /**
+ * An object similar to `process.env` that the WebAssembly
+ * application will see as its environment.
+ */
+ env?: object | undefined;
+ /**
+ * This object represents the WebAssembly application's
+ * sandbox directory structure. The string keys of `preopens` are treated as
+ * directories within the sandbox. The corresponding values in `preopens` are
+ * the real paths to those directories on the host machine.
+ */
+ preopens?: NodeJS.Dict<string> | undefined;
+ /**
+ * By default, WASI applications terminate the Node.js
+ * process via the `__wasi_proc_exit()` function. Setting this option to `true`
+ * causes `wasi.start()` to return the exit code rather than terminate the
+ * process.
+ * @default false
+ */
+ returnOnExit?: boolean | undefined;
+ /**
+ * The file descriptor used as standard input in the WebAssembly application.
+ * @default 0
+ */
+ stdin?: number | undefined;
+ /**
+ * The file descriptor used as standard output in the WebAssembly application.
+ * @default 1
+ */
+ stdout?: number | undefined;
+ /**
+ * The file descriptor used as standard error in the WebAssembly application.
+ * @default 2
+ */
+ stderr?: number | undefined;
+ }
+ /**
+ * The `WASI` class provides the WASI system call API and additional convenience
+ * methods for working with WASI-based applications. Each `WASI` instance
+ * represents a distinct sandbox environment. For security purposes, each `WASI`instance must have its command-line arguments, environment variables, and
+ * sandbox directory structure configured explicitly.
+ * @since v13.3.0, v12.16.0
+ */
+ class WASI {
+ constructor(options?: WASIOptions);
+ /**
+ * Attempt to begin execution of `instance` as a WASI command by invoking its`_start()` export. If `instance` does not contain a `_start()` export, or if`instance` contains an `_initialize()`
+ * export, then an exception is thrown.
+ *
+ * `start()` requires that `instance` exports a [`WebAssembly.Memory`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Memory) named`memory`. If
+ * `instance` does not have a `memory` export an exception is thrown.
+ *
+ * If `start()` is called more than once, an exception is thrown.
+ * @since v13.3.0, v12.16.0
+ */
+ start(instance: object): void; // TODO: avoid DOM dependency until WASM moved to own lib.
+ /**
+ * Attempt to initialize `instance` as a WASI reactor by invoking its`_initialize()` export, if it is present. If `instance` contains a `_start()`export, then an exception is thrown.
+ *
+ * `initialize()` requires that `instance` exports a [`WebAssembly.Memory`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Memory) named`memory`.
+ * If `instance` does not have a `memory` export an exception is thrown.
+ *
+ * If `initialize()` is called more than once, an exception is thrown.
+ * @since v14.6.0, v12.19.0
+ */
+ initialize(instance: object): void; // TODO: avoid DOM dependency until WASM moved to own lib.
+ /**
+ * `wasiImport` is an object that implements the WASI system call API. This object
+ * should be passed as the `wasi_snapshot_preview1` import during the instantiation
+ * of a [`WebAssembly.Instance`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Instance).
+ * @since v13.3.0, v12.16.0
+ */
+ readonly wasiImport: NodeJS.Dict<any>; // TODO: Narrow to DOM types
+ }
+}
+declare module "node:wasi" {
+ export * from "wasi";
+}
diff --git a/client/node_modules/@types/node/ts4.8/worker_threads.d.ts b/client/node_modules/@types/node/ts4.8/worker_threads.d.ts
new file mode 100644
index 0000000..ad76c4c
--- /dev/null
+++ b/client/node_modules/@types/node/ts4.8/worker_threads.d.ts
@@ -0,0 +1,692 @@
+/**
+ * The `worker_threads` module enables the use of threads that execute JavaScript
+ * in parallel. To access it:
+ *
+ * ```js
+ * const worker = require('worker_threads');
+ * ```
+ *
+ * Workers (threads) are useful for performing CPU-intensive JavaScript operations.
+ * They do not help much with I/O-intensive work. The Node.js built-in
+ * asynchronous I/O operations are more efficient than Workers can be.
+ *
+ * Unlike `child_process` or `cluster`, `worker_threads` can share memory. They do
+ * so by transferring `ArrayBuffer` instances or sharing `SharedArrayBuffer`instances.
+ *
+ * ```js
+ * const {
+ * Worker, isMainThread, parentPort, workerData
+ * } = require('worker_threads');
+ *
+ * if (isMainThread) {
+ * module.exports = function parseJSAsync(script) {
+ * return new Promise((resolve, reject) => {
+ * const worker = new Worker(__filename, {
+ * workerData: script
+ * });
+ * worker.on('message', resolve);
+ * worker.on('error', reject);
+ * worker.on('exit', (code) => {
+ * if (code !== 0)
+ * reject(new Error(`Worker stopped with exit code ${code}`));
+ * });
+ * });
+ * };
+ * } else {
+ * const { parse } = require('some-js-parsing-library');
+ * const script = workerData;
+ * parentPort.postMessage(parse(script));
+ * }
+ * ```
+ *
+ * The above example spawns a Worker thread for each `parseJSAsync()` call. In
+ * practice, use a pool of Workers for these kinds of tasks. Otherwise, the
+ * overhead of creating Workers would likely exceed their benefit.
+ *
+ * When implementing a worker pool, use the `AsyncResource` API to inform
+ * diagnostic tools (e.g. to provide asynchronous stack traces) about the
+ * correlation between tasks and their outcomes. See `"Using AsyncResource for a Worker thread pool"` in the `async_hooks` documentation for an example implementation.
+ *
+ * Worker threads inherit non-process-specific options by default. Refer to `Worker constructor options` to know how to customize worker thread options,
+ * specifically `argv` and `execArgv` options.
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/worker_threads.js)
+ */
+declare module "worker_threads" {
+ import { Blob } from "node:buffer";
+ import { Context } from "node:vm";
+ import { EventEmitter } from "node:events";
+ import { EventLoopUtilityFunction } from "node:perf_hooks";
+ import { FileHandle } from "node:fs/promises";
+ import { Readable, Writable } from "node:stream";
+ import { URL } from "node:url";
+ import { X509Certificate } from "node:crypto";
+ const isMainThread: boolean;
+ const parentPort: null | MessagePort;
+ const resourceLimits: ResourceLimits;
+ const SHARE_ENV: unique symbol;
+ const threadId: number;
+ const workerData: any;
+ /**
+ * Instances of the `worker.MessageChannel` class represent an asynchronous,
+ * two-way communications channel.
+ * The `MessageChannel` has no methods of its own. `new MessageChannel()`yields an object with `port1` and `port2` properties, which refer to linked `MessagePort` instances.
+ *
+ * ```js
+ * const { MessageChannel } = require('worker_threads');
+ *
+ * const { port1, port2 } = new MessageChannel();
+ * port1.on('message', (message) => console.log('received', message));
+ * port2.postMessage({ foo: 'bar' });
+ * // Prints: received { foo: 'bar' } from the `port1.on('message')` listener
+ * ```
+ * @since v10.5.0
+ */
+ class MessageChannel {
+ readonly port1: MessagePort;
+ readonly port2: MessagePort;
+ }
+ interface WorkerPerformance {
+ eventLoopUtilization: EventLoopUtilityFunction;
+ }
+ type TransferListItem = ArrayBuffer | MessagePort | FileHandle | X509Certificate | Blob;
+ /**
+ * Instances of the `worker.MessagePort` class represent one end of an
+ * asynchronous, two-way communications channel. It can be used to transfer
+ * structured data, memory regions and other `MessagePort`s between different `Worker` s.
+ *
+ * This implementation matches [browser `MessagePort`](https://developer.mozilla.org/en-US/docs/Web/API/MessagePort) s.
+ * @since v10.5.0
+ */
+ class MessagePort extends EventEmitter {
+ /**
+ * Disables further sending of messages on either side of the connection.
+ * This method can be called when no further communication will happen over this`MessagePort`.
+ *
+ * The `'close' event` is emitted on both `MessagePort` instances that
+ * are part of the channel.
+ * @since v10.5.0
+ */
+ close(): void;
+ /**
+ * Sends a JavaScript value to the receiving side of this channel.`value` is transferred in a way which is compatible with
+ * the [HTML structured clone algorithm](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm).
+ *
+ * In particular, the significant differences to `JSON` are:
+ *
+ * * `value` may contain circular references.
+ * * `value` may contain instances of builtin JS types such as `RegExp`s,`BigInt`s, `Map`s, `Set`s, etc.
+ * * `value` may contain typed arrays, both using `ArrayBuffer`s
+ * and `SharedArrayBuffer`s.
+ * * `value` may contain [`WebAssembly.Module`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Module) instances.
+ * * `value` may not contain native (C++-backed) objects other than:
+ *
+ * ```js
+ * const { MessageChannel } = require('worker_threads');
+ * const { port1, port2 } = new MessageChannel();
+ *
+ * port1.on('message', (message) => console.log(message));
+ *
+ * const circularData = {};
+ * circularData.foo = circularData;
+ * // Prints: { foo: [Circular] }
+ * port2.postMessage(circularData);
+ * ```
+ *
+ * `transferList` may be a list of [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer), `MessagePort` and `FileHandle` objects.
+ * After transferring, they are not usable on the sending side of the channel
+ * anymore (even if they are not contained in `value`). Unlike with `child processes`, transferring handles such as network sockets is currently
+ * not supported.
+ *
+ * If `value` contains [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instances, those are accessible
+ * from either thread. They cannot be listed in `transferList`.
+ *
+ * `value` may still contain `ArrayBuffer` instances that are not in`transferList`; in that case, the underlying memory is copied rather than moved.
+ *
+ * ```js
+ * const { MessageChannel } = require('worker_threads');
+ * const { port1, port2 } = new MessageChannel();
+ *
+ * port1.on('message', (message) => console.log(message));
+ *
+ * const uint8Array = new Uint8Array([ 1, 2, 3, 4 ]);
+ * // This posts a copy of `uint8Array`:
+ * port2.postMessage(uint8Array);
+ * // This does not copy data, but renders `uint8Array` unusable:
+ * port2.postMessage(uint8Array, [ uint8Array.buffer ]);
+ *
+ * // The memory for the `sharedUint8Array` is accessible from both the
+ * // original and the copy received by `.on('message')`:
+ * const sharedUint8Array = new Uint8Array(new SharedArrayBuffer(4));
+ * port2.postMessage(sharedUint8Array);
+ *
+ * // This transfers a freshly created message port to the receiver.
+ * // This can be used, for example, to create communication channels between
+ * // multiple `Worker` threads that are children of the same parent thread.
+ * const otherChannel = new MessageChannel();
+ * port2.postMessage({ port: otherChannel.port1 }, [ otherChannel.port1 ]);
+ * ```
+ *
+ * The message object is cloned immediately, and can be modified after
+ * posting without having side effects.
+ *
+ * For more information on the serialization and deserialization mechanisms
+ * behind this API, see the `serialization API of the v8 module`.
+ * @since v10.5.0
+ */
+ postMessage(value: any, transferList?: readonly TransferListItem[]): void;
+ /**
+ * Opposite of `unref()`. Calling `ref()` on a previously `unref()`ed port does _not_ let the program exit if it's the only active handle left (the default
+ * behavior). If the port is `ref()`ed, calling `ref()` again has no effect.
+ *
+ * If listeners are attached or removed using `.on('message')`, the port
+ * is `ref()`ed and `unref()`ed automatically depending on whether
+ * listeners for the event exist.
+ * @since v10.5.0
+ */
+ ref(): void;
+ /**
+ * Calling `unref()` on a port allows the thread to exit if this is the only
+ * active handle in the event system. If the port is already `unref()`ed calling`unref()` again has no effect.
+ *
+ * If listeners are attached or removed using `.on('message')`, the port is`ref()`ed and `unref()`ed automatically depending on whether
+ * listeners for the event exist.
+ * @since v10.5.0
+ */
+ unref(): void;
+ /**
+ * Starts receiving messages on this `MessagePort`. When using this port
+ * as an event emitter, this is called automatically once `'message'`listeners are attached.
+ *
+ * This method exists for parity with the Web `MessagePort` API. In Node.js,
+ * it is only useful for ignoring messages when no event listener is present.
+ * Node.js also diverges in its handling of `.onmessage`. Setting it
+ * automatically calls `.start()`, but unsetting it lets messages queue up
+ * until a new handler is set or the port is discarded.
+ * @since v10.5.0
+ */
+ start(): void;
+ addListener(event: "close", listener: () => void): this;
+ addListener(event: "message", listener: (value: any) => void): this;
+ addListener(event: "messageerror", listener: (error: Error) => void): this;
+ addListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ emit(event: "close"): boolean;
+ emit(event: "message", value: any): boolean;
+ emit(event: "messageerror", error: Error): boolean;
+ emit(event: string | symbol, ...args: any[]): boolean;
+ on(event: "close", listener: () => void): this;
+ on(event: "message", listener: (value: any) => void): this;
+ on(event: "messageerror", listener: (error: Error) => void): this;
+ on(event: string | symbol, listener: (...args: any[]) => void): this;
+ once(event: "close", listener: () => void): this;
+ once(event: "message", listener: (value: any) => void): this;
+ once(event: "messageerror", listener: (error: Error) => void): this;
+ once(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependListener(event: "close", listener: () => void): this;
+ prependListener(event: "message", listener: (value: any) => void): this;
+ prependListener(event: "messageerror", listener: (error: Error) => void): this;
+ prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependOnceListener(event: "close", listener: () => void): this;
+ prependOnceListener(event: "message", listener: (value: any) => void): this;
+ prependOnceListener(event: "messageerror", listener: (error: Error) => void): this;
+ prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ removeListener(event: "close", listener: () => void): this;
+ removeListener(event: "message", listener: (value: any) => void): this;
+ removeListener(event: "messageerror", listener: (error: Error) => void): this;
+ removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ off(event: "close", listener: () => void): this;
+ off(event: "message", listener: (value: any) => void): this;
+ off(event: "messageerror", listener: (error: Error) => void): this;
+ off(event: string | symbol, listener: (...args: any[]) => void): this;
+ }
+ interface WorkerOptions {
+ /**
+ * List of arguments which would be stringified and appended to
+ * `process.argv` in the worker. This is mostly similar to the `workerData`
+ * but the values will be available on the global `process.argv` as if they
+ * were passed as CLI options to the script.
+ */
+ argv?: any[] | undefined;
+ env?: NodeJS.Dict<string> | typeof SHARE_ENV | undefined;
+ eval?: boolean | undefined;
+ workerData?: any;
+ stdin?: boolean | undefined;
+ stdout?: boolean | undefined;
+ stderr?: boolean | undefined;
+ execArgv?: string[] | undefined;
+ resourceLimits?: ResourceLimits | undefined;
+ /**
+ * Additional data to send in the first worker message.
+ */
+ transferList?: TransferListItem[] | undefined;
+ /**
+ * @default true
+ */
+ trackUnmanagedFds?: boolean | undefined;
+ /**
+ * An optional `name` to be appended to the worker title
+ * for debuggin/identification purposes, making the final title as
+ * `[worker ${id}] ${name}`.
+ */
+ name?: string | undefined;
+ }
+ interface ResourceLimits {
+ /**
+ * The maximum size of a heap space for recently created objects.
+ */
+ maxYoungGenerationSizeMb?: number | undefined;
+ /**
+ * The maximum size of the main heap in MB.
+ */
+ maxOldGenerationSizeMb?: number | undefined;
+ /**
+ * The size of a pre-allocated memory range used for generated code.
+ */
+ codeRangeSizeMb?: number | undefined;
+ /**
+ * The default maximum stack size for the thread. Small values may lead to unusable Worker instances.
+ * @default 4
+ */
+ stackSizeMb?: number | undefined;
+ }
+ /**
+ * The `Worker` class represents an independent JavaScript execution thread.
+ * Most Node.js APIs are available inside of it.
+ *
+ * Notable differences inside a Worker environment are:
+ *
+ * * The `process.stdin`, `process.stdout` and `process.stderr` may be redirected by the parent thread.
+ * * The `require('worker_threads').isMainThread` property is set to `false`.
+ * * The `require('worker_threads').parentPort` message port is available.
+ * * `process.exit()` does not stop the whole program, just the single thread,
+ * and `process.abort()` is not available.
+ * * `process.chdir()` and `process` methods that set group or user ids
+ * are not available.
+ * * `process.env` is a copy of the parent thread's environment variables,
+ * unless otherwise specified. Changes to one copy are not visible in other
+ * threads, and are not visible to native add-ons (unless `worker.SHARE_ENV` is passed as the `env` option to the `Worker` constructor).
+ * * `process.title` cannot be modified.
+ * * Signals are not delivered through `process.on('...')`.
+ * * Execution may stop at any point as a result of `worker.terminate()` being invoked.
+ * * IPC channels from parent processes are not accessible.
+ * * The `trace_events` module is not supported.
+ * * Native add-ons can only be loaded from multiple threads if they fulfill `certain conditions`.
+ *
+ * Creating `Worker` instances inside of other `Worker`s is possible.
+ *
+ * Like [Web Workers](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) and the `cluster module`, two-way communication can be
+ * achieved through inter-thread message passing. Internally, a `Worker` has a
+ * built-in pair of `MessagePort` s that are already associated with each other
+ * when the `Worker` is created. While the `MessagePort` object on the parent side
+ * is not directly exposed, its functionalities are exposed through `worker.postMessage()` and the `worker.on('message')` event
+ * on the `Worker` object for the parent thread.
+ *
+ * To create custom messaging channels (which is encouraged over using the default
+ * global channel because it facilitates separation of concerns), users can create
+ * a `MessageChannel` object on either thread and pass one of the`MessagePort`s on that `MessageChannel` to the other thread through a
+ * pre-existing channel, such as the global one.
+ *
+ * See `port.postMessage()` for more information on how messages are passed,
+ * and what kind of JavaScript values can be successfully transported through
+ * the thread barrier.
+ *
+ * ```js
+ * const assert = require('assert');
+ * const {
+ * Worker, MessageChannel, MessagePort, isMainThread, parentPort
+ * } = require('worker_threads');
+ * if (isMainThread) {
+ * const worker = new Worker(__filename);
+ * const subChannel = new MessageChannel();
+ * worker.postMessage({ hereIsYourPort: subChannel.port1 }, [subChannel.port1]);
+ * subChannel.port2.on('message', (value) => {
+ * console.log('received:', value);
+ * });
+ * } else {
+ * parentPort.once('message', (value) => {
+ * assert(value.hereIsYourPort instanceof MessagePort);
+ * value.hereIsYourPort.postMessage('the worker is sending this');
+ * value.hereIsYourPort.close();
+ * });
+ * }
+ * ```
+ * @since v10.5.0
+ */
+ class Worker extends EventEmitter {
+ /**
+ * If `stdin: true` was passed to the `Worker` constructor, this is a
+ * writable stream. The data written to this stream will be made available in
+ * the worker thread as `process.stdin`.
+ * @since v10.5.0
+ */
+ readonly stdin: Writable | null;
+ /**
+ * This is a readable stream which contains data written to `process.stdout` inside the worker thread. If `stdout: true` was not passed to the `Worker` constructor, then data is piped to the
+ * parent thread's `process.stdout` stream.
+ * @since v10.5.0
+ */
+ readonly stdout: Readable;
+ /**
+ * This is a readable stream which contains data written to `process.stderr` inside the worker thread. If `stderr: true` was not passed to the `Worker` constructor, then data is piped to the
+ * parent thread's `process.stderr` stream.
+ * @since v10.5.0
+ */
+ readonly stderr: Readable;
+ /**
+ * An integer identifier for the referenced thread. Inside the worker thread,
+ * it is available as `require('worker_threads').threadId`.
+ * This value is unique for each `Worker` instance inside a single process.
+ * @since v10.5.0
+ */
+ readonly threadId: number;
+ /**
+ * Provides the set of JS engine resource constraints for this Worker thread.
+ * If the `resourceLimits` option was passed to the `Worker` constructor,
+ * this matches its values.
+ *
+ * If the worker has stopped, the return value is an empty object.
+ * @since v13.2.0, v12.16.0
+ */
+ readonly resourceLimits?: ResourceLimits | undefined;
+ /**
+ * An object that can be used to query performance information from a worker
+ * instance. Similar to `perf_hooks.performance`.
+ * @since v15.1.0, v14.17.0, v12.22.0
+ */
+ readonly performance: WorkerPerformance;
+ /**
+ * @param filename The path to the Worker’s main script or module.
+ * Must be either an absolute path or a relative path (i.e. relative to the current working directory) starting with ./ or ../,
+ * or a WHATWG URL object using file: protocol. If options.eval is true, this is a string containing JavaScript code rather than a path.
+ */
+ constructor(filename: string | URL, options?: WorkerOptions);
+ /**
+ * Send a message to the worker that is received via `require('worker_threads').parentPort.on('message')`.
+ * See `port.postMessage()` for more details.
+ * @since v10.5.0
+ */
+ postMessage(value: any, transferList?: readonly TransferListItem[]): void;
+ /**
+ * Opposite of `unref()`, calling `ref()` on a previously `unref()`ed worker does _not_ let the program exit if it's the only active handle left (the default
+ * behavior). If the worker is `ref()`ed, calling `ref()` again has
+ * no effect.
+ * @since v10.5.0
+ */
+ ref(): void;
+ /**
+ * Calling `unref()` on a worker allows the thread to exit if this is the only
+ * active handle in the event system. If the worker is already `unref()`ed calling`unref()` again has no effect.
+ * @since v10.5.0
+ */
+ unref(): void;
+ /**
+ * Stop all JavaScript execution in the worker thread as soon as possible.
+ * Returns a Promise for the exit code that is fulfilled when the `'exit' event` is emitted.
+ * @since v10.5.0
+ */
+ terminate(): Promise<number>;
+ /**
+ * Returns a readable stream for a V8 snapshot of the current state of the Worker.
+ * See `v8.getHeapSnapshot()` for more details.
+ *
+ * If the Worker thread is no longer running, which may occur before the `'exit' event` is emitted, the returned `Promise` is rejected
+ * immediately with an `ERR_WORKER_NOT_RUNNING` error.
+ * @since v13.9.0, v12.17.0
+ * @return A promise for a Readable Stream containing a V8 heap snapshot
+ */
+ getHeapSnapshot(): Promise<Readable>;
+ addListener(event: "error", listener: (err: Error) => void): this;
+ addListener(event: "exit", listener: (exitCode: number) => void): this;
+ addListener(event: "message", listener: (value: any) => void): this;
+ addListener(event: "messageerror", listener: (error: Error) => void): this;
+ addListener(event: "online", listener: () => void): this;
+ addListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ emit(event: "error", err: Error): boolean;
+ emit(event: "exit", exitCode: number): boolean;
+ emit(event: "message", value: any): boolean;
+ emit(event: "messageerror", error: Error): boolean;
+ emit(event: "online"): boolean;
+ emit(event: string | symbol, ...args: any[]): boolean;
+ on(event: "error", listener: (err: Error) => void): this;
+ on(event: "exit", listener: (exitCode: number) => void): this;
+ on(event: "message", listener: (value: any) => void): this;
+ on(event: "messageerror", listener: (error: Error) => void): this;
+ on(event: "online", listener: () => void): this;
+ on(event: string | symbol, listener: (...args: any[]) => void): this;
+ once(event: "error", listener: (err: Error) => void): this;
+ once(event: "exit", listener: (exitCode: number) => void): this;
+ once(event: "message", listener: (value: any) => void): this;
+ once(event: "messageerror", listener: (error: Error) => void): this;
+ once(event: "online", listener: () => void): this;
+ once(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependListener(event: "error", listener: (err: Error) => void): this;
+ prependListener(event: "exit", listener: (exitCode: number) => void): this;
+ prependListener(event: "message", listener: (value: any) => void): this;
+ prependListener(event: "messageerror", listener: (error: Error) => void): this;
+ prependListener(event: "online", listener: () => void): this;
+ prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependOnceListener(event: "error", listener: (err: Error) => void): this;
+ prependOnceListener(event: "exit", listener: (exitCode: number) => void): this;
+ prependOnceListener(event: "message", listener: (value: any) => void): this;
+ prependOnceListener(event: "messageerror", listener: (error: Error) => void): this;
+ prependOnceListener(event: "online", listener: () => void): this;
+ prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ removeListener(event: "error", listener: (err: Error) => void): this;
+ removeListener(event: "exit", listener: (exitCode: number) => void): this;
+ removeListener(event: "message", listener: (value: any) => void): this;
+ removeListener(event: "messageerror", listener: (error: Error) => void): this;
+ removeListener(event: "online", listener: () => void): this;
+ removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ off(event: "error", listener: (err: Error) => void): this;
+ off(event: "exit", listener: (exitCode: number) => void): this;
+ off(event: "message", listener: (value: any) => void): this;
+ off(event: "messageerror", listener: (error: Error) => void): this;
+ off(event: "online", listener: () => void): this;
+ off(event: string | symbol, listener: (...args: any[]) => void): this;
+ }
+ interface BroadcastChannel extends NodeJS.RefCounted {}
+ /**
+ * Instances of `BroadcastChannel` allow asynchronous one-to-many communication
+ * with all other `BroadcastChannel` instances bound to the same channel name.
+ *
+ * ```js
+ * 'use strict';
+ *
+ * const {
+ * isMainThread,
+ * BroadcastChannel,
+ * Worker
+ * } = require('worker_threads');
+ *
+ * const bc = new BroadcastChannel('hello');
+ *
+ * if (isMainThread) {
+ * let c = 0;
+ * bc.onmessage = (event) => {
+ * console.log(event.data);
+ * if (++c === 10) bc.close();
+ * };
+ * for (let n = 0; n < 10; n++)
+ * new Worker(__filename);
+ * } else {
+ * bc.postMessage('hello from every worker');
+ * bc.close();
+ * }
+ * ```
+ * @since v15.4.0
+ */
+ class BroadcastChannel {
+ readonly name: string;
+ /**
+ * Invoked with a single \`MessageEvent\` argument when a message is received.
+ * @since v15.4.0
+ */
+ onmessage: (message: unknown) => void;
+ /**
+ * Invoked with a received message cannot be deserialized.
+ * @since v15.4.0
+ */
+ onmessageerror: (message: unknown) => void;
+ constructor(name: string);
+ /**
+ * Closes the `BroadcastChannel` connection.
+ * @since v15.4.0
+ */
+ close(): void;
+ /**
+ * @since v15.4.0
+ * @param message Any cloneable JavaScript value.
+ */
+ postMessage(message: unknown): void;
+ }
+ /**
+ * Mark an object as not transferable. If `object` occurs in the transfer list of
+ * a `port.postMessage()` call, it is ignored.
+ *
+ * In particular, this makes sense for objects that can be cloned, rather than
+ * transferred, and which are used by other objects on the sending side.
+ * For example, Node.js marks the `ArrayBuffer`s it uses for its `Buffer pool` with this.
+ *
+ * This operation cannot be undone.
+ *
+ * ```js
+ * const { MessageChannel, markAsUntransferable } = require('worker_threads');
+ *
+ * const pooledBuffer = new ArrayBuffer(8);
+ * const typedArray1 = new Uint8Array(pooledBuffer);
+ * const typedArray2 = new Float64Array(pooledBuffer);
+ *
+ * markAsUntransferable(pooledBuffer);
+ *
+ * const { port1 } = new MessageChannel();
+ * port1.postMessage(typedArray1, [ typedArray1.buffer ]);
+ *
+ * // The following line prints the contents of typedArray1 -- it still owns
+ * // its memory and has been cloned, not transferred. Without
+ * // `markAsUntransferable()`, this would print an empty Uint8Array.
+ * // typedArray2 is intact as well.
+ * console.log(typedArray1);
+ * console.log(typedArray2);
+ * ```
+ *
+ * There is no equivalent to this API in browsers.
+ * @since v14.5.0, v12.19.0
+ */
+ function markAsUntransferable(object: object): void;
+ /**
+ * Transfer a `MessagePort` to a different `vm` Context. The original `port`object is rendered unusable, and the returned `MessagePort` instance
+ * takes its place.
+ *
+ * The returned `MessagePort` is an object in the target context and
+ * inherits from its global `Object` class. Objects passed to the [`port.onmessage()`](https://developer.mozilla.org/en-US/docs/Web/API/MessagePort/onmessage) listener are also created in the
+ * target context
+ * and inherit from its global `Object` class.
+ *
+ * However, the created `MessagePort` no longer inherits from [`EventTarget`](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget), and only
+ * [`port.onmessage()`](https://developer.mozilla.org/en-US/docs/Web/API/MessagePort/onmessage) can be used to receive
+ * events using it.
+ * @since v11.13.0
+ * @param port The message port to transfer.
+ * @param contextifiedSandbox A `contextified` object as returned by the `vm.createContext()` method.
+ */
+ function moveMessagePortToContext(port: MessagePort, contextifiedSandbox: Context): MessagePort;
+ /**
+ * Receive a single message from a given `MessagePort`. If no message is available,`undefined` is returned, otherwise an object with a single `message` property
+ * that contains the message payload, corresponding to the oldest message in the`MessagePort`’s queue.
+ *
+ * ```js
+ * const { MessageChannel, receiveMessageOnPort } = require('worker_threads');
+ * const { port1, port2 } = new MessageChannel();
+ * port1.postMessage({ hello: 'world' });
+ *
+ * console.log(receiveMessageOnPort(port2));
+ * // Prints: { message: { hello: 'world' } }
+ * console.log(receiveMessageOnPort(port2));
+ * // Prints: undefined
+ * ```
+ *
+ * When this function is used, no `'message'` event is emitted and the`onmessage` listener is not invoked.
+ * @since v12.3.0
+ */
+ function receiveMessageOnPort(port: MessagePort):
+ | {
+ message: any;
+ }
+ | undefined;
+ type Serializable = string | object | number | boolean | bigint;
+ /**
+ * Within a worker thread, `worker.getEnvironmentData()` returns a clone
+ * of data passed to the spawning thread's `worker.setEnvironmentData()`.
+ * Every new `Worker` receives its own copy of the environment data
+ * automatically.
+ *
+ * ```js
+ * const {
+ * Worker,
+ * isMainThread,
+ * setEnvironmentData,
+ * getEnvironmentData,
+ * } = require('worker_threads');
+ *
+ * if (isMainThread) {
+ * setEnvironmentData('Hello', 'World!');
+ * const worker = new Worker(__filename);
+ * } else {
+ * console.log(getEnvironmentData('Hello')); // Prints 'World!'.
+ * }
+ * ```
+ * @since v15.12.0, v14.18.0
+ * @param key Any arbitrary, cloneable JavaScript value that can be used as a {Map} key.
+ */
+ function getEnvironmentData(key: Serializable): Serializable;
+ /**
+ * The `worker.setEnvironmentData()` API sets the content of`worker.getEnvironmentData()` in the current thread and all new `Worker`instances spawned from the current context.
+ * @since v15.12.0, v14.18.0
+ * @param key Any arbitrary, cloneable JavaScript value that can be used as a {Map} key.
+ * @param value Any arbitrary, cloneable JavaScript value that will be cloned and passed automatically to all new `Worker` instances. If `value` is passed as `undefined`, any previously set value
+ * for the `key` will be deleted.
+ */
+ function setEnvironmentData(key: Serializable, value: Serializable): void;
+
+ import {
+ BroadcastChannel as _BroadcastChannel,
+ MessageChannel as _MessageChannel,
+ MessagePort as _MessagePort,
+ } from "worker_threads";
+ global {
+ /**
+ * `BroadcastChannel` class is a global reference for `require('worker_threads').BroadcastChannel`
+ * https://nodejs.org/api/globals.html#broadcastchannel
+ * @since v18.0.0
+ */
+ var BroadcastChannel: typeof globalThis extends {
+ onmessage: any;
+ BroadcastChannel: infer T;
+ } ? T
+ : typeof _BroadcastChannel;
+
+ /**
+ * `MessageChannel` class is a global reference for `require('worker_threads').MessageChannel`
+ * https://nodejs.org/api/globals.html#messagechannel
+ * @since v15.0.0
+ */
+ var MessageChannel: typeof globalThis extends {
+ onmessage: any;
+ MessageChannel: infer T;
+ } ? T
+ : typeof _MessageChannel;
+
+ /**
+ * `MessagePort` class is a global reference for `require('worker_threads').MessagePort`
+ * https://nodejs.org/api/globals.html#messageport
+ * @since v15.0.0
+ */
+ var MessagePort: typeof globalThis extends {
+ onmessage: any;
+ MessagePort: infer T;
+ } ? T
+ : typeof _MessagePort;
+ }
+}
+declare module "node:worker_threads" {
+ export * from "worker_threads";
+}
diff --git a/client/node_modules/@types/node/ts4.8/zlib.d.ts b/client/node_modules/@types/node/ts4.8/zlib.d.ts
new file mode 100644
index 0000000..bcd48eb
--- /dev/null
+++ b/client/node_modules/@types/node/ts4.8/zlib.d.ts
@@ -0,0 +1,517 @@
+/**
+ * The `zlib` module provides compression functionality implemented using Gzip,
+ * Deflate/Inflate, and Brotli.
+ *
+ * To access it:
+ *
+ * ```js
+ * const zlib = require('zlib');
+ * ```
+ *
+ * Compression and decompression are built around the Node.js `Streams API`.
+ *
+ * Compressing or decompressing a stream (such as a file) can be accomplished by
+ * piping the source stream through a `zlib` `Transform` stream into a destination
+ * stream:
+ *
+ * ```js
+ * const { createGzip } = require('zlib');
+ * const { pipeline } = require('stream');
+ * const {
+ * createReadStream,
+ * createWriteStream
+ * } = require('fs');
+ *
+ * const gzip = createGzip();
+ * const source = createReadStream('input.txt');
+ * const destination = createWriteStream('input.txt.gz');
+ *
+ * pipeline(source, gzip, destination, (err) => {
+ * if (err) {
+ * console.error('An error occurred:', err);
+ * process.exitCode = 1;
+ * }
+ * });
+ *
+ * // Or, Promisified
+ *
+ * const { promisify } = require('util');
+ * const pipe = promisify(pipeline);
+ *
+ * async function do_gzip(input, output) {
+ * const gzip = createGzip();
+ * const source = createReadStream(input);
+ * const destination = createWriteStream(output);
+ * await pipe(source, gzip, destination);
+ * }
+ *
+ * do_gzip('input.txt', 'input.txt.gz')
+ * .catch((err) => {
+ * console.error('An error occurred:', err);
+ * process.exitCode = 1;
+ * });
+ * ```
+ *
+ * It is also possible to compress or decompress data in a single step:
+ *
+ * ```js
+ * const { deflate, unzip } = require('zlib');
+ *
+ * const input = '.................................';
+ * deflate(input, (err, buffer) => {
+ * if (err) {
+ * console.error('An error occurred:', err);
+ * process.exitCode = 1;
+ * }
+ * console.log(buffer.toString('base64'));
+ * });
+ *
+ * const buffer = Buffer.from('eJzT0yMAAGTvBe8=', 'base64');
+ * unzip(buffer, (err, buffer) => {
+ * if (err) {
+ * console.error('An error occurred:', err);
+ * process.exitCode = 1;
+ * }
+ * console.log(buffer.toString());
+ * });
+ *
+ * // Or, Promisified
+ *
+ * const { promisify } = require('util');
+ * const do_unzip = promisify(unzip);
+ *
+ * do_unzip(buffer)
+ * .then((buf) => console.log(buf.toString()))
+ * .catch((err) => {
+ * console.error('An error occurred:', err);
+ * process.exitCode = 1;
+ * });
+ * ```
+ * @since v0.5.8
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/zlib.js)
+ */
+declare module "zlib" {
+ import * as stream from "node:stream";
+ interface ZlibOptions {
+ /**
+ * @default constants.Z_NO_FLUSH
+ */
+ flush?: number | undefined;
+ /**
+ * @default constants.Z_FINISH
+ */
+ finishFlush?: number | undefined;
+ /**
+ * @default 16*1024
+ */
+ chunkSize?: number | undefined;
+ windowBits?: number | undefined;
+ level?: number | undefined; // compression only
+ memLevel?: number | undefined; // compression only
+ strategy?: number | undefined; // compression only
+ dictionary?: NodeJS.ArrayBufferView | ArrayBuffer | undefined; // deflate/inflate only, empty dictionary by default
+ info?: boolean | undefined;
+ maxOutputLength?: number | undefined;
+ }
+ interface BrotliOptions {
+ /**
+ * @default constants.BROTLI_OPERATION_PROCESS
+ */
+ flush?: number | undefined;
+ /**
+ * @default constants.BROTLI_OPERATION_FINISH
+ */
+ finishFlush?: number | undefined;
+ /**
+ * @default 16*1024
+ */
+ chunkSize?: number | undefined;
+ params?:
+ | {
+ /**
+ * Each key is a `constants.BROTLI_*` constant.
+ */
+ [key: number]: boolean | number;
+ }
+ | undefined;
+ maxOutputLength?: number | undefined;
+ }
+ interface Zlib {
+ /** @deprecated Use bytesWritten instead. */
+ readonly bytesRead: number;
+ readonly bytesWritten: number;
+ shell?: boolean | string | undefined;
+ close(callback?: () => void): void;
+ flush(kind?: number, callback?: () => void): void;
+ flush(callback?: () => void): void;
+ }
+ interface ZlibParams {
+ params(level: number, strategy: number, callback: () => void): void;
+ }
+ interface ZlibReset {
+ reset(): void;
+ }
+ interface BrotliCompress extends stream.Transform, Zlib {}
+ interface BrotliDecompress extends stream.Transform, Zlib {}
+ interface Gzip extends stream.Transform, Zlib {}
+ interface Gunzip extends stream.Transform, Zlib {}
+ interface Deflate extends stream.Transform, Zlib, ZlibReset, ZlibParams {}
+ interface Inflate extends stream.Transform, Zlib, ZlibReset {}
+ interface DeflateRaw extends stream.Transform, Zlib, ZlibReset, ZlibParams {}
+ interface InflateRaw extends stream.Transform, Zlib, ZlibReset {}
+ interface Unzip extends stream.Transform, Zlib {}
+ /**
+ * Creates and returns a new `BrotliCompress` object.
+ * @since v11.7.0, v10.16.0
+ */
+ function createBrotliCompress(options?: BrotliOptions): BrotliCompress;
+ /**
+ * Creates and returns a new `BrotliDecompress` object.
+ * @since v11.7.0, v10.16.0
+ */
+ function createBrotliDecompress(options?: BrotliOptions): BrotliDecompress;
+ /**
+ * Creates and returns a new `Gzip` object.
+ * See `example`.
+ * @since v0.5.8
+ */
+ function createGzip(options?: ZlibOptions): Gzip;
+ /**
+ * Creates and returns a new `Gunzip` object.
+ * @since v0.5.8
+ */
+ function createGunzip(options?: ZlibOptions): Gunzip;
+ /**
+ * Creates and returns a new `Deflate` object.
+ * @since v0.5.8
+ */
+ function createDeflate(options?: ZlibOptions): Deflate;
+ /**
+ * Creates and returns a new `Inflate` object.
+ * @since v0.5.8
+ */
+ function createInflate(options?: ZlibOptions): Inflate;
+ /**
+ * Creates and returns a new `DeflateRaw` object.
+ *
+ * An upgrade of zlib from 1.2.8 to 1.2.11 changed behavior when `windowBits`is set to 8 for raw deflate streams. zlib would automatically set `windowBits`to 9 if was initially set to 8\. Newer
+ * versions of zlib will throw an exception,
+ * so Node.js restored the original behavior of upgrading a value of 8 to 9,
+ * since passing `windowBits = 9` to zlib actually results in a compressed stream
+ * that effectively uses an 8-bit window only.
+ * @since v0.5.8
+ */
+ function createDeflateRaw(options?: ZlibOptions): DeflateRaw;
+ /**
+ * Creates and returns a new `InflateRaw` object.
+ * @since v0.5.8
+ */
+ function createInflateRaw(options?: ZlibOptions): InflateRaw;
+ /**
+ * Creates and returns a new `Unzip` object.
+ * @since v0.5.8
+ */
+ function createUnzip(options?: ZlibOptions): Unzip;
+ type InputType = string | ArrayBuffer | NodeJS.ArrayBufferView;
+ type CompressCallback = (error: Error | null, result: Buffer) => void;
+ /**
+ * @since v11.7.0, v10.16.0
+ */
+ function brotliCompress(buf: InputType, options: BrotliOptions, callback: CompressCallback): void;
+ function brotliCompress(buf: InputType, callback: CompressCallback): void;
+ namespace brotliCompress {
+ function __promisify__(buffer: InputType, options?: BrotliOptions): Promise<Buffer>;
+ }
+ /**
+ * Compress a chunk of data with `BrotliCompress`.
+ * @since v11.7.0, v10.16.0
+ */
+ function brotliCompressSync(buf: InputType, options?: BrotliOptions): Buffer;
+ /**
+ * @since v11.7.0, v10.16.0
+ */
+ function brotliDecompress(buf: InputType, options: BrotliOptions, callback: CompressCallback): void;
+ function brotliDecompress(buf: InputType, callback: CompressCallback): void;
+ namespace brotliDecompress {
+ function __promisify__(buffer: InputType, options?: BrotliOptions): Promise<Buffer>;
+ }
+ /**
+ * Decompress a chunk of data with `BrotliDecompress`.
+ * @since v11.7.0, v10.16.0
+ */
+ function brotliDecompressSync(buf: InputType, options?: BrotliOptions): Buffer;
+ /**
+ * @since v0.6.0
+ */
+ function deflate(buf: InputType, callback: CompressCallback): void;
+ function deflate(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
+ namespace deflate {
+ function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<Buffer>;
+ }
+ /**
+ * Compress a chunk of data with `Deflate`.
+ * @since v0.11.12
+ */
+ function deflateSync(buf: InputType, options?: ZlibOptions): Buffer;
+ /**
+ * @since v0.6.0
+ */
+ function deflateRaw(buf: InputType, callback: CompressCallback): void;
+ function deflateRaw(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
+ namespace deflateRaw {
+ function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<Buffer>;
+ }
+ /**
+ * Compress a chunk of data with `DeflateRaw`.
+ * @since v0.11.12
+ */
+ function deflateRawSync(buf: InputType, options?: ZlibOptions): Buffer;
+ /**
+ * @since v0.6.0
+ */
+ function gzip(buf: InputType, callback: CompressCallback): void;
+ function gzip(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
+ namespace gzip {
+ function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<Buffer>;
+ }
+ /**
+ * Compress a chunk of data with `Gzip`.
+ * @since v0.11.12
+ */
+ function gzipSync(buf: InputType, options?: ZlibOptions): Buffer;
+ /**
+ * @since v0.6.0
+ */
+ function gunzip(buf: InputType, callback: CompressCallback): void;
+ function gunzip(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
+ namespace gunzip {
+ function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<Buffer>;
+ }
+ /**
+ * Decompress a chunk of data with `Gunzip`.
+ * @since v0.11.12
+ */
+ function gunzipSync(buf: InputType, options?: ZlibOptions): Buffer;
+ /**
+ * @since v0.6.0
+ */
+ function inflate(buf: InputType, callback: CompressCallback): void;
+ function inflate(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
+ namespace inflate {
+ function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<Buffer>;
+ }
+ /**
+ * Decompress a chunk of data with `Inflate`.
+ * @since v0.11.12
+ */
+ function inflateSync(buf: InputType, options?: ZlibOptions): Buffer;
+ /**
+ * @since v0.6.0
+ */
+ function inflateRaw(buf: InputType, callback: CompressCallback): void;
+ function inflateRaw(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
+ namespace inflateRaw {
+ function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<Buffer>;
+ }
+ /**
+ * Decompress a chunk of data with `InflateRaw`.
+ * @since v0.11.12
+ */
+ function inflateRawSync(buf: InputType, options?: ZlibOptions): Buffer;
+ /**
+ * @since v0.6.0
+ */
+ function unzip(buf: InputType, callback: CompressCallback): void;
+ function unzip(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
+ namespace unzip {
+ function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<Buffer>;
+ }
+ /**
+ * Decompress a chunk of data with `Unzip`.
+ * @since v0.11.12
+ */
+ function unzipSync(buf: InputType, options?: ZlibOptions): Buffer;
+ namespace constants {
+ const BROTLI_DECODE: number;
+ const BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES: number;
+ const BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP: number;
+ const BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES: number;
+ const BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1: number;
+ const BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2: number;
+ const BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS: number;
+ const BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET: number;
+ const BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1: number;
+ const BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2: number;
+ const BROTLI_DECODER_ERROR_FORMAT_CL_SPACE: number;
+ const BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT: number;
+ const BROTLI_DECODER_ERROR_FORMAT_DICTIONARY: number;
+ const BROTLI_DECODER_ERROR_FORMAT_DISTANCE: number;
+ const BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE: number;
+ const BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE: number;
+ const BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE: number;
+ const BROTLI_DECODER_ERROR_FORMAT_PADDING_1: number;
+ const BROTLI_DECODER_ERROR_FORMAT_PADDING_2: number;
+ const BROTLI_DECODER_ERROR_FORMAT_RESERVED: number;
+ const BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET: number;
+ const BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME: number;
+ const BROTLI_DECODER_ERROR_FORMAT_TRANSFORM: number;
+ const BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS: number;
+ const BROTLI_DECODER_ERROR_INVALID_ARGUMENTS: number;
+ const BROTLI_DECODER_ERROR_UNREACHABLE: number;
+ const BROTLI_DECODER_NEEDS_MORE_INPUT: number;
+ const BROTLI_DECODER_NEEDS_MORE_OUTPUT: number;
+ const BROTLI_DECODER_NO_ERROR: number;
+ const BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION: number;
+ const BROTLI_DECODER_PARAM_LARGE_WINDOW: number;
+ const BROTLI_DECODER_RESULT_ERROR: number;
+ const BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT: number;
+ const BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT: number;
+ const BROTLI_DECODER_RESULT_SUCCESS: number;
+ const BROTLI_DECODER_SUCCESS: number;
+ const BROTLI_DEFAULT_MODE: number;
+ const BROTLI_DEFAULT_QUALITY: number;
+ const BROTLI_DEFAULT_WINDOW: number;
+ const BROTLI_ENCODE: number;
+ const BROTLI_LARGE_MAX_WINDOW_BITS: number;
+ const BROTLI_MAX_INPUT_BLOCK_BITS: number;
+ const BROTLI_MAX_QUALITY: number;
+ const BROTLI_MAX_WINDOW_BITS: number;
+ const BROTLI_MIN_INPUT_BLOCK_BITS: number;
+ const BROTLI_MIN_QUALITY: number;
+ const BROTLI_MIN_WINDOW_BITS: number;
+ const BROTLI_MODE_FONT: number;
+ const BROTLI_MODE_GENERIC: number;
+ const BROTLI_MODE_TEXT: number;
+ const BROTLI_OPERATION_EMIT_METADATA: number;
+ const BROTLI_OPERATION_FINISH: number;
+ const BROTLI_OPERATION_FLUSH: number;
+ const BROTLI_OPERATION_PROCESS: number;
+ const BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING: number;
+ const BROTLI_PARAM_LARGE_WINDOW: number;
+ const BROTLI_PARAM_LGBLOCK: number;
+ const BROTLI_PARAM_LGWIN: number;
+ const BROTLI_PARAM_MODE: number;
+ const BROTLI_PARAM_NDIRECT: number;
+ const BROTLI_PARAM_NPOSTFIX: number;
+ const BROTLI_PARAM_QUALITY: number;
+ const BROTLI_PARAM_SIZE_HINT: number;
+ const DEFLATE: number;
+ const DEFLATERAW: number;
+ const GUNZIP: number;
+ const GZIP: number;
+ const INFLATE: number;
+ const INFLATERAW: number;
+ const UNZIP: number;
+ // Allowed flush values.
+ const Z_NO_FLUSH: number;
+ const Z_PARTIAL_FLUSH: number;
+ const Z_SYNC_FLUSH: number;
+ const Z_FULL_FLUSH: number;
+ const Z_FINISH: number;
+ const Z_BLOCK: number;
+ const Z_TREES: number;
+ // Return codes for the compression/decompression functions.
+ // Negative values are errors, positive values are used for special but normal events.
+ const Z_OK: number;
+ const Z_STREAM_END: number;
+ const Z_NEED_DICT: number;
+ const Z_ERRNO: number;
+ const Z_STREAM_ERROR: number;
+ const Z_DATA_ERROR: number;
+ const Z_MEM_ERROR: number;
+ const Z_BUF_ERROR: number;
+ const Z_VERSION_ERROR: number;
+ // Compression levels.
+ const Z_NO_COMPRESSION: number;
+ const Z_BEST_SPEED: number;
+ const Z_BEST_COMPRESSION: number;
+ const Z_DEFAULT_COMPRESSION: number;
+ // Compression strategy.
+ const Z_FILTERED: number;
+ const Z_HUFFMAN_ONLY: number;
+ const Z_RLE: number;
+ const Z_FIXED: number;
+ const Z_DEFAULT_STRATEGY: number;
+ const Z_DEFAULT_WINDOWBITS: number;
+ const Z_MIN_WINDOWBITS: number;
+ const Z_MAX_WINDOWBITS: number;
+ const Z_MIN_CHUNK: number;
+ const Z_MAX_CHUNK: number;
+ const Z_DEFAULT_CHUNK: number;
+ const Z_MIN_MEMLEVEL: number;
+ const Z_MAX_MEMLEVEL: number;
+ const Z_DEFAULT_MEMLEVEL: number;
+ const Z_MIN_LEVEL: number;
+ const Z_MAX_LEVEL: number;
+ const Z_DEFAULT_LEVEL: number;
+ const ZLIB_VERNUM: number;
+ }
+ // Allowed flush values.
+ /** @deprecated Use `constants.Z_NO_FLUSH` */
+ const Z_NO_FLUSH: number;
+ /** @deprecated Use `constants.Z_PARTIAL_FLUSH` */
+ const Z_PARTIAL_FLUSH: number;
+ /** @deprecated Use `constants.Z_SYNC_FLUSH` */
+ const Z_SYNC_FLUSH: number;
+ /** @deprecated Use `constants.Z_FULL_FLUSH` */
+ const Z_FULL_FLUSH: number;
+ /** @deprecated Use `constants.Z_FINISH` */
+ const Z_FINISH: number;
+ /** @deprecated Use `constants.Z_BLOCK` */
+ const Z_BLOCK: number;
+ /** @deprecated Use `constants.Z_TREES` */
+ const Z_TREES: number;
+ // Return codes for the compression/decompression functions.
+ // Negative values are errors, positive values are used for special but normal events.
+ /** @deprecated Use `constants.Z_OK` */
+ const Z_OK: number;
+ /** @deprecated Use `constants.Z_STREAM_END` */
+ const Z_STREAM_END: number;
+ /** @deprecated Use `constants.Z_NEED_DICT` */
+ const Z_NEED_DICT: number;
+ /** @deprecated Use `constants.Z_ERRNO` */
+ const Z_ERRNO: number;
+ /** @deprecated Use `constants.Z_STREAM_ERROR` */
+ const Z_STREAM_ERROR: number;
+ /** @deprecated Use `constants.Z_DATA_ERROR` */
+ const Z_DATA_ERROR: number;
+ /** @deprecated Use `constants.Z_MEM_ERROR` */
+ const Z_MEM_ERROR: number;
+ /** @deprecated Use `constants.Z_BUF_ERROR` */
+ const Z_BUF_ERROR: number;
+ /** @deprecated Use `constants.Z_VERSION_ERROR` */
+ const Z_VERSION_ERROR: number;
+ // Compression levels.
+ /** @deprecated Use `constants.Z_NO_COMPRESSION` */
+ const Z_NO_COMPRESSION: number;
+ /** @deprecated Use `constants.Z_BEST_SPEED` */
+ const Z_BEST_SPEED: number;
+ /** @deprecated Use `constants.Z_BEST_COMPRESSION` */
+ const Z_BEST_COMPRESSION: number;
+ /** @deprecated Use `constants.Z_DEFAULT_COMPRESSION` */
+ const Z_DEFAULT_COMPRESSION: number;
+ // Compression strategy.
+ /** @deprecated Use `constants.Z_FILTERED` */
+ const Z_FILTERED: number;
+ /** @deprecated Use `constants.Z_HUFFMAN_ONLY` */
+ const Z_HUFFMAN_ONLY: number;
+ /** @deprecated Use `constants.Z_RLE` */
+ const Z_RLE: number;
+ /** @deprecated Use `constants.Z_FIXED` */
+ const Z_FIXED: number;
+ /** @deprecated Use `constants.Z_DEFAULT_STRATEGY` */
+ const Z_DEFAULT_STRATEGY: number;
+ /** @deprecated */
+ const Z_BINARY: number;
+ /** @deprecated */
+ const Z_TEXT: number;
+ /** @deprecated */
+ const Z_ASCII: number;
+ /** @deprecated */
+ const Z_UNKNOWN: number;
+ /** @deprecated */
+ const Z_DEFLATED: number;
+}
+declare module "node:zlib" {
+ export * from "zlib";
+}
diff --git a/client/node_modules/@types/node/tty.d.ts b/client/node_modules/@types/node/tty.d.ts
new file mode 100644
index 0000000..c030415
--- /dev/null
+++ b/client/node_modules/@types/node/tty.d.ts
@@ -0,0 +1,206 @@
+/**
+ * The `tty` module provides the `tty.ReadStream` and `tty.WriteStream` classes.
+ * In most cases, it will not be necessary or possible to use this module directly.
+ * However, it can be accessed using:
+ *
+ * ```js
+ * const tty = require('tty');
+ * ```
+ *
+ * When Node.js detects that it is being run with a text terminal ("TTY")
+ * attached, `process.stdin` will, by default, be initialized as an instance of`tty.ReadStream` and both `process.stdout` and `process.stderr` will, by
+ * default, be instances of `tty.WriteStream`. The preferred method of determining
+ * whether Node.js is being run within a TTY context is to check that the value of
+ * the `process.stdout.isTTY` property is `true`:
+ *
+ * ```console
+ * $ node -p -e "Boolean(process.stdout.isTTY)"
+ * true
+ * $ node -p -e "Boolean(process.stdout.isTTY)" | cat
+ * false
+ * ```
+ *
+ * In most cases, there should be little to no reason for an application to
+ * manually create instances of the `tty.ReadStream` and `tty.WriteStream`classes.
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/tty.js)
+ */
+declare module "tty" {
+ import * as net from "node:net";
+ /**
+ * The `tty.isatty()` method returns `true` if the given `fd` is associated with
+ * a TTY and `false` if it is not, including whenever `fd` is not a non-negative
+ * integer.
+ * @since v0.5.8
+ * @param fd A numeric file descriptor
+ */
+ function isatty(fd: number): boolean;
+ /**
+ * Represents the readable side of a TTY. In normal circumstances `process.stdin` will be the only `tty.ReadStream` instance in a Node.js
+ * process and there should be no reason to create additional instances.
+ * @since v0.5.8
+ */
+ class ReadStream extends net.Socket {
+ constructor(fd: number, options?: net.SocketConstructorOpts);
+ /**
+ * A `boolean` that is `true` if the TTY is currently configured to operate as a
+ * raw device. Defaults to `false`.
+ * @since v0.7.7
+ */
+ isRaw: boolean;
+ /**
+ * Allows configuration of `tty.ReadStream` so that it operates as a raw device.
+ *
+ * When in raw mode, input is always available character-by-character, not
+ * including modifiers. Additionally, all special processing of characters by the
+ * terminal is disabled, including echoing input
+ * characters. Ctrl+C will no longer cause a `SIGINT` when
+ * in this mode.
+ * @since v0.7.7
+ * @param mode If `true`, configures the `tty.ReadStream` to operate as a raw device. If `false`, configures the `tty.ReadStream` to operate in its default mode. The `readStream.isRaw`
+ * property will be set to the resulting mode.
+ * @return The read stream instance.
+ */
+ setRawMode(mode: boolean): this;
+ /**
+ * A `boolean` that is always `true` for `tty.ReadStream` instances.
+ * @since v0.5.8
+ */
+ isTTY: boolean;
+ }
+ /**
+ * -1 - to the left from cursor
+ * 0 - the entire line
+ * 1 - to the right from cursor
+ */
+ type Direction = -1 | 0 | 1;
+ /**
+ * Represents the writable side of a TTY. In normal circumstances,`process.stdout` and `process.stderr` will be the only`tty.WriteStream` instances created for a Node.js process and there
+ * should be no reason to create additional instances.
+ * @since v0.5.8
+ */
+ class WriteStream extends net.Socket {
+ constructor(fd: number);
+ addListener(event: string, listener: (...args: any[]) => void): this;
+ addListener(event: "resize", listener: () => void): this;
+ emit(event: string | symbol, ...args: any[]): boolean;
+ emit(event: "resize"): boolean;
+ on(event: string, listener: (...args: any[]) => void): this;
+ on(event: "resize", listener: () => void): this;
+ once(event: string, listener: (...args: any[]) => void): this;
+ once(event: "resize", listener: () => void): this;
+ prependListener(event: string, listener: (...args: any[]) => void): this;
+ prependListener(event: "resize", listener: () => void): this;
+ prependOnceListener(event: string, listener: (...args: any[]) => void): this;
+ prependOnceListener(event: "resize", listener: () => void): this;
+ /**
+ * `writeStream.clearLine()` clears the current line of this `WriteStream` in a
+ * direction identified by `dir`.
+ * @since v0.7.7
+ * @param callback Invoked once the operation completes.
+ * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
+ */
+ clearLine(dir: Direction, callback?: () => void): boolean;
+ /**
+ * `writeStream.clearScreenDown()` clears this `WriteStream` from the current
+ * cursor down.
+ * @since v0.7.7
+ * @param callback Invoked once the operation completes.
+ * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
+ */
+ clearScreenDown(callback?: () => void): boolean;
+ /**
+ * `writeStream.cursorTo()` moves this `WriteStream`'s cursor to the specified
+ * position.
+ * @since v0.7.7
+ * @param callback Invoked once the operation completes.
+ * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
+ */
+ cursorTo(x: number, y?: number, callback?: () => void): boolean;
+ cursorTo(x: number, callback: () => void): boolean;
+ /**
+ * `writeStream.moveCursor()` moves this `WriteStream`'s cursor _relative_ to its
+ * current position.
+ * @since v0.7.7
+ * @param callback Invoked once the operation completes.
+ * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
+ */
+ moveCursor(dx: number, dy: number, callback?: () => void): boolean;
+ /**
+ * Returns:
+ *
+ * * `1` for 2,
+ * * `4` for 16,
+ * * `8` for 256,
+ * * `24` for 16,777,216 colors supported.
+ *
+ * Use this to determine what colors the terminal supports. Due to the nature of
+ * colors in terminals it is possible to either have false positives or false
+ * negatives. It depends on process information and the environment variables that
+ * may lie about what terminal is used.
+ * It is possible to pass in an `env` object to simulate the usage of a specific
+ * terminal. This can be useful to check how specific environment settings behave.
+ *
+ * To enforce a specific color support, use one of the below environment settings.
+ *
+ * * 2 colors: `FORCE_COLOR = 0` (Disables colors)
+ * * 16 colors: `FORCE_COLOR = 1`
+ * * 256 colors: `FORCE_COLOR = 2`
+ * * 16,777,216 colors: `FORCE_COLOR = 3`
+ *
+ * Disabling color support is also possible by using the `NO_COLOR` and`NODE_DISABLE_COLORS` environment variables.
+ * @since v9.9.0
+ * @param [env=process.env] An object containing the environment variables to check. This enables simulating the usage of a specific terminal.
+ */
+ getColorDepth(env?: object): number;
+ /**
+ * Returns `true` if the `writeStream` supports at least as many colors as provided
+ * in `count`. Minimum support is 2 (black and white).
+ *
+ * This has the same false positives and negatives as described in `writeStream.getColorDepth()`.
+ *
+ * ```js
+ * process.stdout.hasColors();
+ * // Returns true or false depending on if `stdout` supports at least 16 colors.
+ * process.stdout.hasColors(256);
+ * // Returns true or false depending on if `stdout` supports at least 256 colors.
+ * process.stdout.hasColors({ TMUX: '1' });
+ * // Returns true.
+ * process.stdout.hasColors(2 ** 24, { TMUX: '1' });
+ * // Returns false (the environment setting pretends to support 2 ** 8 colors).
+ * ```
+ * @since v11.13.0, v10.16.0
+ * @param [count=16] The number of colors that are requested (minimum 2).
+ * @param [env=process.env] An object containing the environment variables to check. This enables simulating the usage of a specific terminal.
+ */
+ hasColors(count?: number): boolean;
+ hasColors(env?: object): boolean;
+ hasColors(count: number, env?: object): boolean;
+ /**
+ * `writeStream.getWindowSize()` returns the size of the TTY
+ * corresponding to this `WriteStream`. The array is of the type`[numColumns, numRows]` where `numColumns` and `numRows` represent the number
+ * of columns and rows in the corresponding TTY.
+ * @since v0.7.7
+ */
+ getWindowSize(): [number, number];
+ /**
+ * A `number` specifying the number of columns the TTY currently has. This property
+ * is updated whenever the `'resize'` event is emitted.
+ * @since v0.7.7
+ */
+ columns: number;
+ /**
+ * A `number` specifying the number of rows the TTY currently has. This property
+ * is updated whenever the `'resize'` event is emitted.
+ * @since v0.7.7
+ */
+ rows: number;
+ /**
+ * A `boolean` that is always `true`.
+ * @since v0.5.8
+ */
+ isTTY: boolean;
+ }
+}
+declare module "node:tty" {
+ export * from "tty";
+}
diff --git a/client/node_modules/@types/node/url.d.ts b/client/node_modules/@types/node/url.d.ts
new file mode 100644
index 0000000..ea7b7b1
--- /dev/null
+++ b/client/node_modules/@types/node/url.d.ts
@@ -0,0 +1,937 @@
+/**
+ * The `url` module provides utilities for URL resolution and parsing. It can be
+ * accessed using:
+ *
+ * ```js
+ * import url from 'url';
+ * ```
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/url.js)
+ */
+declare module "url" {
+ import { Blob as NodeBlob } from "node:buffer";
+ import { ClientRequestArgs } from "node:http";
+ import { ParsedUrlQuery, ParsedUrlQueryInput } from "node:querystring";
+ // Input to `url.format`
+ interface UrlObject {
+ auth?: string | null | undefined;
+ hash?: string | null | undefined;
+ host?: string | null | undefined;
+ hostname?: string | null | undefined;
+ href?: string | null | undefined;
+ pathname?: string | null | undefined;
+ protocol?: string | null | undefined;
+ search?: string | null | undefined;
+ slashes?: boolean | null | undefined;
+ port?: string | number | null | undefined;
+ query?: string | null | ParsedUrlQueryInput | undefined;
+ }
+ // Output of `url.parse`
+ interface Url {
+ auth: string | null;
+ hash: string | null;
+ host: string | null;
+ hostname: string | null;
+ href: string;
+ path: string | null;
+ pathname: string | null;
+ protocol: string | null;
+ search: string | null;
+ slashes: boolean | null;
+ port: string | null;
+ query: string | null | ParsedUrlQuery;
+ }
+ interface UrlWithParsedQuery extends Url {
+ query: ParsedUrlQuery;
+ }
+ interface UrlWithStringQuery extends Url {
+ query: string | null;
+ }
+ /**
+ * The `url.parse()` method takes a URL string, parses it, and returns a URL
+ * object.
+ *
+ * A `TypeError` is thrown if `urlString` is not a string.
+ *
+ * A `URIError` is thrown if the `auth` property is present but cannot be decoded.
+ *
+ * Use of the legacy `url.parse()` method is discouraged. Users should
+ * use the WHATWG `URL` API. Because the `url.parse()` method uses a
+ * lenient, non-standard algorithm for parsing URL strings, security
+ * issues can be introduced. Specifically, issues with [host name spoofing](https://hackerone.com/reports/678487) and
+ * incorrect handling of usernames and passwords have been identified.
+ *
+ * Deprecation of this API has been shelved for now primarily due to the the
+ * inability of the [WHATWG API to parse relative URLs](https://github.com/nodejs/node/issues/12682#issuecomment-1154492373).
+ * [Discussions are ongoing](https://github.com/whatwg/url/issues/531) for the best way to resolve this.
+ *
+ * @since v0.1.25
+ * @param urlString The URL string to parse.
+ * @param [parseQueryString=false] If `true`, the `query` property will always be set to an object returned by the {@link querystring} module's `parse()` method. If `false`, the `query` property
+ * on the returned URL object will be an unparsed, undecoded string.
+ * @param [slashesDenoteHost=false] If `true`, the first token after the literal string `//` and preceding the next `/` will be interpreted as the `host`. For instance, given `//foo/bar`, the
+ * result would be `{host: 'foo', pathname: '/bar'}` rather than `{pathname: '//foo/bar'}`.
+ */
+ function parse(urlString: string): UrlWithStringQuery;
+ function parse(
+ urlString: string,
+ parseQueryString: false | undefined,
+ slashesDenoteHost?: boolean,
+ ): UrlWithStringQuery;
+ function parse(urlString: string, parseQueryString: true, slashesDenoteHost?: boolean): UrlWithParsedQuery;
+ function parse(urlString: string, parseQueryString: boolean, slashesDenoteHost?: boolean): Url;
+ /**
+ * The `url.format()` method returns a formatted URL string derived from`urlObject`.
+ *
+ * ```js
+ * const url = require('url');
+ * url.format({
+ * protocol: 'https',
+ * hostname: 'example.com',
+ * pathname: '/some/path',
+ * query: {
+ * page: 1,
+ * format: 'json'
+ * }
+ * });
+ *
+ * // => 'https://example.com/some/path?page=1&#x26;format=json'
+ * ```
+ *
+ * If `urlObject` is not an object or a string, `url.format()` will throw a `TypeError`.
+ *
+ * The formatting process operates as follows:
+ *
+ * * A new empty string `result` is created.
+ * * If `urlObject.protocol` is a string, it is appended as-is to `result`.
+ * * Otherwise, if `urlObject.protocol` is not `undefined` and is not a string, an `Error` is thrown.
+ * * For all string values of `urlObject.protocol` that _do not end_ with an ASCII
+ * colon (`:`) character, the literal string `:` will be appended to `result`.
+ * * If either of the following conditions is true, then the literal string `//`will be appended to `result`:
+ * * `urlObject.slashes` property is true;
+ * * `urlObject.protocol` begins with `http`, `https`, `ftp`, `gopher`, or`file`;
+ * * If the value of the `urlObject.auth` property is truthy, and either`urlObject.host` or `urlObject.hostname` are not `undefined`, the value of`urlObject.auth` will be coerced into a string
+ * and appended to `result`followed by the literal string `@`.
+ * * If the `urlObject.host` property is `undefined` then:
+ * * If the `urlObject.hostname` is a string, it is appended to `result`.
+ * * Otherwise, if `urlObject.hostname` is not `undefined` and is not a string,
+ * an `Error` is thrown.
+ * * If the `urlObject.port` property value is truthy, and `urlObject.hostname`is not `undefined`:
+ * * The literal string `:` is appended to `result`, and
+ * * The value of `urlObject.port` is coerced to a string and appended to`result`.
+ * * Otherwise, if the `urlObject.host` property value is truthy, the value of`urlObject.host` is coerced to a string and appended to `result`.
+ * * If the `urlObject.pathname` property is a string that is not an empty string:
+ * * If the `urlObject.pathname`_does not start_ with an ASCII forward slash
+ * (`/`), then the literal string `'/'` is appended to `result`.
+ * * The value of `urlObject.pathname` is appended to `result`.
+ * * Otherwise, if `urlObject.pathname` is not `undefined` and is not a string, an `Error` is thrown.
+ * * If the `urlObject.search` property is `undefined` and if the `urlObject.query`property is an `Object`, the literal string `?` is appended to `result`followed by the output of calling the
+ * `querystring` module's `stringify()`method passing the value of `urlObject.query`.
+ * * Otherwise, if `urlObject.search` is a string:
+ * * If the value of `urlObject.search`_does not start_ with the ASCII question
+ * mark (`?`) character, the literal string `?` is appended to `result`.
+ * * The value of `urlObject.search` is appended to `result`.
+ * * Otherwise, if `urlObject.search` is not `undefined` and is not a string, an `Error` is thrown.
+ * * If the `urlObject.hash` property is a string:
+ * * If the value of `urlObject.hash`_does not start_ with the ASCII hash (`#`)
+ * character, the literal string `#` is appended to `result`.
+ * * The value of `urlObject.hash` is appended to `result`.
+ * * Otherwise, if the `urlObject.hash` property is not `undefined` and is not a
+ * string, an `Error` is thrown.
+ * * `result` is returned.
+ * @since v0.1.25
+ * @legacy Use the WHATWG URL API instead.
+ * @param urlObject A URL object (as returned by `url.parse()` or constructed otherwise). If a string, it is converted to an object by passing it to `url.parse()`.
+ */
+ function format(urlObject: URL, options?: URLFormatOptions): string;
+ /**
+ * The `url.format()` method returns a formatted URL string derived from`urlObject`.
+ *
+ * ```js
+ * const url = require('url');
+ * url.format({
+ * protocol: 'https',
+ * hostname: 'example.com',
+ * pathname: '/some/path',
+ * query: {
+ * page: 1,
+ * format: 'json'
+ * }
+ * });
+ *
+ * // => 'https://example.com/some/path?page=1&#x26;format=json'
+ * ```
+ *
+ * If `urlObject` is not an object or a string, `url.format()` will throw a `TypeError`.
+ *
+ * The formatting process operates as follows:
+ *
+ * * A new empty string `result` is created.
+ * * If `urlObject.protocol` is a string, it is appended as-is to `result`.
+ * * Otherwise, if `urlObject.protocol` is not `undefined` and is not a string, an `Error` is thrown.
+ * * For all string values of `urlObject.protocol` that _do not end_ with an ASCII
+ * colon (`:`) character, the literal string `:` will be appended to `result`.
+ * * If either of the following conditions is true, then the literal string `//`will be appended to `result`:
+ * * `urlObject.slashes` property is true;
+ * * `urlObject.protocol` begins with `http`, `https`, `ftp`, `gopher`, or`file`;
+ * * If the value of the `urlObject.auth` property is truthy, and either`urlObject.host` or `urlObject.hostname` are not `undefined`, the value of`urlObject.auth` will be coerced into a string
+ * and appended to `result`followed by the literal string `@`.
+ * * If the `urlObject.host` property is `undefined` then:
+ * * If the `urlObject.hostname` is a string, it is appended to `result`.
+ * * Otherwise, if `urlObject.hostname` is not `undefined` and is not a string,
+ * an `Error` is thrown.
+ * * If the `urlObject.port` property value is truthy, and `urlObject.hostname`is not `undefined`:
+ * * The literal string `:` is appended to `result`, and
+ * * The value of `urlObject.port` is coerced to a string and appended to`result`.
+ * * Otherwise, if the `urlObject.host` property value is truthy, the value of`urlObject.host` is coerced to a string and appended to `result`.
+ * * If the `urlObject.pathname` property is a string that is not an empty string:
+ * * If the `urlObject.pathname`_does not start_ with an ASCII forward slash
+ * (`/`), then the literal string `'/'` is appended to `result`.
+ * * The value of `urlObject.pathname` is appended to `result`.
+ * * Otherwise, if `urlObject.pathname` is not `undefined` and is not a string, an `Error` is thrown.
+ * * If the `urlObject.search` property is `undefined` and if the `urlObject.query`property is an `Object`, the literal string `?` is appended to `result`followed by the output of calling the
+ * `querystring` module's `stringify()`method passing the value of `urlObject.query`.
+ * * Otherwise, if `urlObject.search` is a string:
+ * * If the value of `urlObject.search`_does not start_ with the ASCII question
+ * mark (`?`) character, the literal string `?` is appended to `result`.
+ * * The value of `urlObject.search` is appended to `result`.
+ * * Otherwise, if `urlObject.search` is not `undefined` and is not a string, an `Error` is thrown.
+ * * If the `urlObject.hash` property is a string:
+ * * If the value of `urlObject.hash`_does not start_ with the ASCII hash (`#`)
+ * character, the literal string `#` is appended to `result`.
+ * * The value of `urlObject.hash` is appended to `result`.
+ * * Otherwise, if the `urlObject.hash` property is not `undefined` and is not a
+ * string, an `Error` is thrown.
+ * * `result` is returned.
+ * @since v0.1.25
+ * @legacy Use the WHATWG URL API instead.
+ * @param urlObject A URL object (as returned by `url.parse()` or constructed otherwise). If a string, it is converted to an object by passing it to `url.parse()`.
+ */
+ function format(urlObject: UrlObject | string): string;
+ /**
+ * The `url.resolve()` method resolves a target URL relative to a base URL in a
+ * manner similar to that of a web browser resolving an anchor tag.
+ *
+ * ```js
+ * const url = require('url');
+ * url.resolve('/one/two/three', 'four'); // '/one/two/four'
+ * url.resolve('http://example.com/', '/one'); // 'http://example.com/one'
+ * url.resolve('http://example.com/one', '/two'); // 'http://example.com/two'
+ * ```
+ *
+ * To achieve the same result using the WHATWG URL API:
+ *
+ * ```js
+ * function resolve(from, to) {
+ * const resolvedUrl = new URL(to, new URL(from, 'resolve://'));
+ * if (resolvedUrl.protocol === 'resolve:') {
+ * // `from` is a relative URL.
+ * const { pathname, search, hash } = resolvedUrl;
+ * return pathname + search + hash;
+ * }
+ * return resolvedUrl.toString();
+ * }
+ *
+ * resolve('/one/two/three', 'four'); // '/one/two/four'
+ * resolve('http://example.com/', '/one'); // 'http://example.com/one'
+ * resolve('http://example.com/one', '/two'); // 'http://example.com/two'
+ * ```
+ * @since v0.1.25
+ * @legacy Use the WHATWG URL API instead.
+ * @param from The base URL to use if `to` is a relative URL.
+ * @param to The target URL to resolve.
+ */
+ function resolve(from: string, to: string): string;
+ /**
+ * Returns the [Punycode](https://tools.ietf.org/html/rfc5891#section-4.4) ASCII serialization of the `domain`. If `domain` is an
+ * invalid domain, the empty string is returned.
+ *
+ * It performs the inverse operation to {@link domainToUnicode}.
+ *
+ * This feature is only available if the `node` executable was compiled with `ICU` enabled. If not, the domain names are passed through unchanged.
+ *
+ * ```js
+ * import url from 'url';
+ *
+ * console.log(url.domainToASCII('español.com'));
+ * // Prints xn--espaol-zwa.com
+ * console.log(url.domainToASCII('中文.com'));
+ * // Prints xn--fiq228c.com
+ * console.log(url.domainToASCII('xn--iñvalid.com'));
+ * // Prints an empty string
+ * ```
+ * @since v7.4.0, v6.13.0
+ */
+ function domainToASCII(domain: string): string;
+ /**
+ * Returns the Unicode serialization of the `domain`. If `domain` is an invalid
+ * domain, the empty string is returned.
+ *
+ * It performs the inverse operation to {@link domainToASCII}.
+ *
+ * This feature is only available if the `node` executable was compiled with `ICU` enabled. If not, the domain names are passed through unchanged.
+ *
+ * ```js
+ * import url from 'url';
+ *
+ * console.log(url.domainToUnicode('xn--espaol-zwa.com'));
+ * // Prints español.com
+ * console.log(url.domainToUnicode('xn--fiq228c.com'));
+ * // Prints 中文.com
+ * console.log(url.domainToUnicode('xn--iñvalid.com'));
+ * // Prints an empty string
+ * ```
+ * @since v7.4.0, v6.13.0
+ */
+ function domainToUnicode(domain: string): string;
+ /**
+ * This function ensures the correct decodings of percent-encoded characters as
+ * well as ensuring a cross-platform valid absolute path string.
+ *
+ * ```js
+ * import { fileURLToPath } from 'url';
+ *
+ * const __filename = fileURLToPath(import.meta.url);
+ *
+ * new URL('file:///C:/path/').pathname; // Incorrect: /C:/path/
+ * fileURLToPath('file:///C:/path/'); // Correct: C:\path\ (Windows)
+ *
+ * new URL('file://nas/foo.txt').pathname; // Incorrect: /foo.txt
+ * fileURLToPath('file://nas/foo.txt'); // Correct: \\nas\foo.txt (Windows)
+ *
+ * new URL('file:///你好.txt').pathname; // Incorrect: /%E4%BD%A0%E5%A5%BD.txt
+ * fileURLToPath('file:///你好.txt'); // Correct: /你好.txt (POSIX)
+ *
+ * new URL('file:///hello world').pathname; // Incorrect: /hello%20world
+ * fileURLToPath('file:///hello world'); // Correct: /hello world (POSIX)
+ * ```
+ * @since v10.12.0
+ * @param url The file URL string or URL object to convert to a path.
+ * @return The fully-resolved platform-specific Node.js file path.
+ */
+ function fileURLToPath(url: string | URL): string;
+ /**
+ * This function ensures that `path` is resolved absolutely, and that the URL
+ * control characters are correctly encoded when converting into a File URL.
+ *
+ * ```js
+ * import { pathToFileURL } from 'url';
+ *
+ * new URL('/foo#1', 'file:'); // Incorrect: file:///foo#1
+ * pathToFileURL('/foo#1'); // Correct: file:///foo%231 (POSIX)
+ *
+ * new URL('/some/path%.c', 'file:'); // Incorrect: file:///some/path%.c
+ * pathToFileURL('/some/path%.c'); // Correct: file:///some/path%25.c (POSIX)
+ * ```
+ * @since v10.12.0
+ * @param path The path to convert to a File URL.
+ * @return The file URL object.
+ */
+ function pathToFileURL(path: string): URL;
+ /**
+ * This utility function converts a URL object into an ordinary options object as
+ * expected by the `http.request()` and `https.request()` APIs.
+ *
+ * ```js
+ * import { urlToHttpOptions } from 'url';
+ * const myURL = new URL('https://a:b@測試?abc#foo');
+ *
+ * console.log(urlToHttpOptions(myURL));
+ * /*
+ * {
+ * protocol: 'https:',
+ * hostname: 'xn--g6w251d',
+ * hash: '#foo',
+ * search: '?abc',
+ * pathname: '/',
+ * path: '/?abc',
+ * href: 'https://a:b@xn--g6w251d/?abc#foo',
+ * auth: 'a:b'
+ * }
+ *
+ * ```
+ * @since v15.7.0, v14.18.0
+ * @param url The `WHATWG URL` object to convert to an options object.
+ * @return Options object
+ */
+ function urlToHttpOptions(url: URL): ClientRequestArgs;
+ interface URLFormatOptions {
+ auth?: boolean | undefined;
+ fragment?: boolean | undefined;
+ search?: boolean | undefined;
+ unicode?: boolean | undefined;
+ }
+ /**
+ * Browser-compatible `URL` class, implemented by following the WHATWG URL
+ * Standard. [Examples of parsed URLs](https://url.spec.whatwg.org/#example-url-parsing) may be found in the Standard itself.
+ * The `URL` class is also available on the global object.
+ *
+ * In accordance with browser conventions, all properties of `URL` objects
+ * are implemented as getters and setters on the class prototype, rather than as
+ * data properties on the object itself. Thus, unlike `legacy urlObject` s,
+ * using the `delete` keyword on any properties of `URL` objects (e.g. `delete myURL.protocol`, `delete myURL.pathname`, etc) has no effect but will still
+ * return `true`.
+ * @since v7.0.0, v6.13.0
+ */
+ class URL {
+ /**
+ * Creates a `'blob:nodedata:...'` URL string that represents the given `Blob` object and can be used to retrieve the `Blob` later.
+ *
+ * ```js
+ * const {
+ * Blob,
+ * resolveObjectURL,
+ * } = require('buffer');
+ *
+ * const blob = new Blob(['hello']);
+ * const id = URL.createObjectURL(blob);
+ *
+ * // later...
+ *
+ * const otherBlob = resolveObjectURL(id);
+ * console.log(otherBlob.size);
+ * ```
+ *
+ * The data stored by the registered `Blob` will be retained in memory until`URL.revokeObjectURL()` is called to remove it.
+ *
+ * `Blob` objects are registered within the current thread. If using Worker
+ * Threads, `Blob` objects registered within one Worker will not be available
+ * to other workers or the main thread.
+ * @since v16.7.0
+ * @experimental
+ */
+ static createObjectURL(blob: NodeBlob): string;
+ /**
+ * Removes the stored `Blob` identified by the given ID. Attempting to revoke a
+ * ID that isn’t registered will silently fail.
+ * @since v16.7.0
+ * @experimental
+ * @param id A `'blob:nodedata:...` URL string returned by a prior call to `URL.createObjectURL()`.
+ */
+ static revokeObjectURL(objectUrl: string): void;
+ /**
+ * Checks if an `input` relative to the `base` can be parsed to a `URL`.
+ *
+ * ```js
+ * const isValid = URL.canParse('/foo', 'https://example.org/'); // true
+ *
+ * const isNotValid = URL.canParse('/foo'); // false
+ * ```
+ * @since v18.17.0
+ * @param input The absolute or relative input URL to parse. If `input` is relative, then `base` is required. If `input` is absolute, the `base` is ignored. If `input` is not a string, it is
+ * `converted to a string` first.
+ * @param base The base URL to resolve against if the `input` is not absolute. If `base` is not a string, it is `converted to a string` first.
+ */
+ static canParse(input: string, base?: string): boolean;
+ constructor(input: string, base?: string | URL);
+ /**
+ * Gets and sets the fragment portion of the URL.
+ *
+ * ```js
+ * const myURL = new URL('https://example.org/foo#bar');
+ * console.log(myURL.hash);
+ * // Prints #bar
+ *
+ * myURL.hash = 'baz';
+ * console.log(myURL.href);
+ * // Prints https://example.org/foo#baz
+ * ```
+ *
+ * Invalid URL characters included in the value assigned to the `hash` property
+ * are `percent-encoded`. The selection of which characters to
+ * percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce.
+ */
+ hash: string;
+ /**
+ * Gets and sets the host portion of the URL.
+ *
+ * ```js
+ * const myURL = new URL('https://example.org:81/foo');
+ * console.log(myURL.host);
+ * // Prints example.org:81
+ *
+ * myURL.host = 'example.com:82';
+ * console.log(myURL.href);
+ * // Prints https://example.com:82/foo
+ * ```
+ *
+ * Invalid host values assigned to the `host` property are ignored.
+ */
+ host: string;
+ /**
+ * Gets and sets the host name portion of the URL. The key difference between`url.host` and `url.hostname` is that `url.hostname` does _not_ include the
+ * port.
+ *
+ * ```js
+ * const myURL = new URL('https://example.org:81/foo');
+ * console.log(myURL.hostname);
+ * // Prints example.org
+ *
+ * // Setting the hostname does not change the port
+ * myURL.hostname = 'example.com:82';
+ * console.log(myURL.href);
+ * // Prints https://example.com:81/foo
+ *
+ * // Use myURL.host to change the hostname and port
+ * myURL.host = 'example.org:82';
+ * console.log(myURL.href);
+ * // Prints https://example.org:82/foo
+ * ```
+ *
+ * Invalid host name values assigned to the `hostname` property are ignored.
+ */
+ hostname: string;
+ /**
+ * Gets and sets the serialized URL.
+ *
+ * ```js
+ * const myURL = new URL('https://example.org/foo');
+ * console.log(myURL.href);
+ * // Prints https://example.org/foo
+ *
+ * myURL.href = 'https://example.com/bar';
+ * console.log(myURL.href);
+ * // Prints https://example.com/bar
+ * ```
+ *
+ * Getting the value of the `href` property is equivalent to calling {@link toString}.
+ *
+ * Setting the value of this property to a new value is equivalent to creating a
+ * new `URL` object using `new URL(value)`. Each of the `URL`object's properties will be modified.
+ *
+ * If the value assigned to the `href` property is not a valid URL, a `TypeError`will be thrown.
+ */
+ href: string;
+ /**
+ * Gets the read-only serialization of the URL's origin.
+ *
+ * ```js
+ * const myURL = new URL('https://example.org/foo/bar?baz');
+ * console.log(myURL.origin);
+ * // Prints https://example.org
+ * ```
+ *
+ * ```js
+ * const idnURL = new URL('https://測試');
+ * console.log(idnURL.origin);
+ * // Prints https://xn--g6w251d
+ *
+ * console.log(idnURL.hostname);
+ * // Prints xn--g6w251d
+ * ```
+ */
+ readonly origin: string;
+ /**
+ * Gets and sets the password portion of the URL.
+ *
+ * ```js
+ * const myURL = new URL('https://abc:xyz@example.com');
+ * console.log(myURL.password);
+ * // Prints xyz
+ *
+ * myURL.password = '123';
+ * console.log(myURL.href);
+ * // Prints https://abc:123@example.com
+ * ```
+ *
+ * Invalid URL characters included in the value assigned to the `password` property
+ * are `percent-encoded`. The selection of which characters to
+ * percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce.
+ */
+ password: string;
+ /**
+ * Gets and sets the path portion of the URL.
+ *
+ * ```js
+ * const myURL = new URL('https://example.org/abc/xyz?123');
+ * console.log(myURL.pathname);
+ * // Prints /abc/xyz
+ *
+ * myURL.pathname = '/abcdef';
+ * console.log(myURL.href);
+ * // Prints https://example.org/abcdef?123
+ * ```
+ *
+ * Invalid URL characters included in the value assigned to the `pathname`property are `percent-encoded`. The selection of which characters
+ * to percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce.
+ */
+ pathname: string;
+ /**
+ * Gets and sets the port portion of the URL.
+ *
+ * The port value may be a number or a string containing a number in the range`0` to `65535` (inclusive). Setting the value to the default port of the`URL` objects given `protocol` will
+ * result in the `port` value becoming
+ * the empty string (`''`).
+ *
+ * The port value can be an empty string in which case the port depends on
+ * the protocol/scheme:
+ *
+ * <omitted>
+ *
+ * Upon assigning a value to the port, the value will first be converted to a
+ * string using `.toString()`.
+ *
+ * If that string is invalid but it begins with a number, the leading number is
+ * assigned to `port`.
+ * If the number lies outside the range denoted above, it is ignored.
+ *
+ * ```js
+ * const myURL = new URL('https://example.org:8888');
+ * console.log(myURL.port);
+ * // Prints 8888
+ *
+ * // Default ports are automatically transformed to the empty string
+ * // (HTTPS protocol's default port is 443)
+ * myURL.port = '443';
+ * console.log(myURL.port);
+ * // Prints the empty string
+ * console.log(myURL.href);
+ * // Prints https://example.org/
+ *
+ * myURL.port = 1234;
+ * console.log(myURL.port);
+ * // Prints 1234
+ * console.log(myURL.href);
+ * // Prints https://example.org:1234/
+ *
+ * // Completely invalid port strings are ignored
+ * myURL.port = 'abcd';
+ * console.log(myURL.port);
+ * // Prints 1234
+ *
+ * // Leading numbers are treated as a port number
+ * myURL.port = '5678abcd';
+ * console.log(myURL.port);
+ * // Prints 5678
+ *
+ * // Non-integers are truncated
+ * myURL.port = 1234.5678;
+ * console.log(myURL.port);
+ * // Prints 1234
+ *
+ * // Out-of-range numbers which are not represented in scientific notation
+ * // will be ignored.
+ * myURL.port = 1e10; // 10000000000, will be range-checked as described below
+ * console.log(myURL.port);
+ * // Prints 1234
+ * ```
+ *
+ * Numbers which contain a decimal point,
+ * such as floating-point numbers or numbers in scientific notation,
+ * are not an exception to this rule.
+ * Leading numbers up to the decimal point will be set as the URL's port,
+ * assuming they are valid:
+ *
+ * ```js
+ * myURL.port = 4.567e21;
+ * console.log(myURL.port);
+ * // Prints 4 (because it is the leading number in the string '4.567e21')
+ * ```
+ */
+ port: string;
+ /**
+ * Gets and sets the protocol portion of the URL.
+ *
+ * ```js
+ * const myURL = new URL('https://example.org');
+ * console.log(myURL.protocol);
+ * // Prints https:
+ *
+ * myURL.protocol = 'ftp';
+ * console.log(myURL.href);
+ * // Prints ftp://example.org/
+ * ```
+ *
+ * Invalid URL protocol values assigned to the `protocol` property are ignored.
+ */
+ protocol: string;
+ /**
+ * Gets and sets the serialized query portion of the URL.
+ *
+ * ```js
+ * const myURL = new URL('https://example.org/abc?123');
+ * console.log(myURL.search);
+ * // Prints ?123
+ *
+ * myURL.search = 'abc=xyz';
+ * console.log(myURL.href);
+ * // Prints https://example.org/abc?abc=xyz
+ * ```
+ *
+ * Any invalid URL characters appearing in the value assigned the `search`property will be `percent-encoded`. The selection of which
+ * characters to percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce.
+ */
+ search: string;
+ /**
+ * Gets the `URLSearchParams` object representing the query parameters of the
+ * URL. This property is read-only but the `URLSearchParams` object it provides
+ * can be used to mutate the URL instance; to replace the entirety of query
+ * parameters of the URL, use the {@link search} setter. See `URLSearchParams` documentation for details.
+ *
+ * Use care when using `.searchParams` to modify the `URL` because,
+ * per the WHATWG specification, the `URLSearchParams` object uses
+ * different rules to determine which characters to percent-encode. For
+ * instance, the `URL` object will not percent encode the ASCII tilde (`~`)
+ * character, while `URLSearchParams` will always encode it:
+ *
+ * ```js
+ * const myUrl = new URL('https://example.org/abc?foo=~bar');
+ *
+ * console.log(myUrl.search); // prints ?foo=~bar
+ *
+ * // Modify the URL via searchParams...
+ * myUrl.searchParams.sort();
+ *
+ * console.log(myUrl.search); // prints ?foo=%7Ebar
+ * ```
+ */
+ readonly searchParams: URLSearchParams;
+ /**
+ * Gets and sets the username portion of the URL.
+ *
+ * ```js
+ * const myURL = new URL('https://abc:xyz@example.com');
+ * console.log(myURL.username);
+ * // Prints abc
+ *
+ * myURL.username = '123';
+ * console.log(myURL.href);
+ * // Prints https://123:xyz@example.com/
+ * ```
+ *
+ * Any invalid URL characters appearing in the value assigned the `username`property will be `percent-encoded`. The selection of which
+ * characters to percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce.
+ */
+ username: string;
+ /**
+ * The `toString()` method on the `URL` object returns the serialized URL. The
+ * value returned is equivalent to that of {@link href} and {@link toJSON}.
+ */
+ toString(): string;
+ /**
+ * The `toJSON()` method on the `URL` object returns the serialized URL. The
+ * value returned is equivalent to that of {@link href} and {@link toString}.
+ *
+ * This method is automatically called when an `URL` object is serialized
+ * with [`JSON.stringify()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify).
+ *
+ * ```js
+ * const myURLs = [
+ * new URL('https://www.example.com'),
+ * new URL('https://test.example.org'),
+ * ];
+ * console.log(JSON.stringify(myURLs));
+ * // Prints ["https://www.example.com/","https://test.example.org/"]
+ * ```
+ */
+ toJSON(): string;
+ }
+ /**
+ * The `URLSearchParams` API provides read and write access to the query of a`URL`. The `URLSearchParams` class can also be used standalone with one of the
+ * four following constructors.
+ * The `URLSearchParams` class is also available on the global object.
+ *
+ * The WHATWG `URLSearchParams` interface and the `querystring` module have
+ * similar purpose, but the purpose of the `querystring` module is more
+ * general, as it allows the customization of delimiter characters (`&#x26;` and `=`).
+ * On the other hand, this API is designed purely for URL query strings.
+ *
+ * ```js
+ * const myURL = new URL('https://example.org/?abc=123');
+ * console.log(myURL.searchParams.get('abc'));
+ * // Prints 123
+ *
+ * myURL.searchParams.append('abc', 'xyz');
+ * console.log(myURL.href);
+ * // Prints https://example.org/?abc=123&#x26;abc=xyz
+ *
+ * myURL.searchParams.delete('abc');
+ * myURL.searchParams.set('a', 'b');
+ * console.log(myURL.href);
+ * // Prints https://example.org/?a=b
+ *
+ * const newSearchParams = new URLSearchParams(myURL.searchParams);
+ * // The above is equivalent to
+ * // const newSearchParams = new URLSearchParams(myURL.search);
+ *
+ * newSearchParams.append('a', 'c');
+ * console.log(myURL.href);
+ * // Prints https://example.org/?a=b
+ * console.log(newSearchParams.toString());
+ * // Prints a=b&#x26;a=c
+ *
+ * // newSearchParams.toString() is implicitly called
+ * myURL.search = newSearchParams;
+ * console.log(myURL.href);
+ * // Prints https://example.org/?a=b&#x26;a=c
+ * newSearchParams.delete('a');
+ * console.log(myURL.href);
+ * // Prints https://example.org/?a=b&#x26;a=c
+ * ```
+ * @since v7.5.0, v6.13.0
+ */
+ class URLSearchParams implements Iterable<[string, string]> {
+ constructor(
+ init?:
+ | URLSearchParams
+ | string
+ | Record<string, string | readonly string[]>
+ | Iterable<[string, string]>
+ | ReadonlyArray<[string, string]>,
+ );
+ /**
+ * Append a new name-value pair to the query string.
+ */
+ append(name: string, value: string): void;
+ /**
+ * If `value` is provided, removes all name-value pairs
+ * where name is `name` and value is `value`..
+ *
+ * If `value` is not provided, removes all name-value pairs whose name is `name`.
+ */
+ delete(name: string, value?: string): void;
+ /**
+ * Returns an ES6 `Iterator` over each of the name-value pairs in the query.
+ * Each item of the iterator is a JavaScript `Array`. The first item of the `Array`is the `name`, the second item of the `Array` is the `value`.
+ *
+ * Alias for `urlSearchParams[@@iterator]()`.
+ */
+ entries(): IterableIterator<[string, string]>;
+ /**
+ * Iterates over each name-value pair in the query and invokes the given function.
+ *
+ * ```js
+ * const myURL = new URL('https://example.org/?a=b&#x26;c=d');
+ * myURL.searchParams.forEach((value, name, searchParams) => {
+ * console.log(name, value, myURL.searchParams === searchParams);
+ * });
+ * // Prints:
+ * // a b true
+ * // c d true
+ * ```
+ * @param fn Invoked for each name-value pair in the query
+ * @param thisArg To be used as `this` value for when `fn` is called
+ */
+ forEach<TThis = this>(
+ callback: (this: TThis, value: string, name: string, searchParams: URLSearchParams) => void,
+ thisArg?: TThis,
+ ): void;
+ /**
+ * Returns the value of the first name-value pair whose name is `name`. If there
+ * are no such pairs, `null` is returned.
+ * @return or `null` if there is no name-value pair with the given `name`.
+ */
+ get(name: string): string | null;
+ /**
+ * Returns the values of all name-value pairs whose name is `name`. If there are
+ * no such pairs, an empty array is returned.
+ */
+ getAll(name: string): string[];
+ /**
+ * Checks if the `URLSearchParams` object contains key-value pair(s) based on`name` and an optional `value` argument.
+ *
+ * If `value` is provided, returns `true` when name-value pair with
+ * same `name` and `value` exists.
+ *
+ * If `value` is not provided, returns `true` if there is at least one name-value
+ * pair whose name is `name`.
+ */
+ has(name: string, value?: string): boolean;
+ /**
+ * Returns an ES6 `Iterator` over the names of each name-value pair.
+ *
+ * ```js
+ * const params = new URLSearchParams('foo=bar&#x26;foo=baz');
+ * for (const name of params.keys()) {
+ * console.log(name);
+ * }
+ * // Prints:
+ * // foo
+ * // foo
+ * ```
+ */
+ keys(): IterableIterator<string>;
+ /**
+ * Sets the value in the `URLSearchParams` object associated with `name` to`value`. If there are any pre-existing name-value pairs whose names are `name`,
+ * set the first such pair's value to `value` and remove all others. If not,
+ * append the name-value pair to the query string.
+ *
+ * ```js
+ * const params = new URLSearchParams();
+ * params.append('foo', 'bar');
+ * params.append('foo', 'baz');
+ * params.append('abc', 'def');
+ * console.log(params.toString());
+ * // Prints foo=bar&#x26;foo=baz&#x26;abc=def
+ *
+ * params.set('foo', 'def');
+ * params.set('xyz', 'opq');
+ * console.log(params.toString());
+ * // Prints foo=def&#x26;abc=def&#x26;xyz=opq
+ * ```
+ */
+ set(name: string, value: string): void;
+ /**
+ * The total number of parameter entries.
+ * @since v18.16.0
+ */
+ readonly size: number;
+ /**
+ * Sort all existing name-value pairs in-place by their names. Sorting is done
+ * with a [stable sorting algorithm](https://en.wikipedia.org/wiki/Sorting_algorithm#Stability), so relative order between name-value pairs
+ * with the same name is preserved.
+ *
+ * This method can be used, in particular, to increase cache hits.
+ *
+ * ```js
+ * const params = new URLSearchParams('query[]=abc&#x26;type=search&#x26;query[]=123');
+ * params.sort();
+ * console.log(params.toString());
+ * // Prints query%5B%5D=abc&#x26;query%5B%5D=123&#x26;type=search
+ * ```
+ * @since v7.7.0, v6.13.0
+ */
+ sort(): void;
+ /**
+ * Returns the search parameters serialized as a string, with characters
+ * percent-encoded where necessary.
+ */
+ toString(): string;
+ /**
+ * Returns an ES6 `Iterator` over the values of each name-value pair.
+ */
+ values(): IterableIterator<string>;
+ [Symbol.iterator](): IterableIterator<[string, string]>;
+ }
+ import { URL as _URL, URLSearchParams as _URLSearchParams } from "url";
+ global {
+ interface URLSearchParams extends _URLSearchParams {}
+ interface URL extends _URL {}
+ interface Global {
+ URL: typeof _URL;
+ URLSearchParams: typeof _URLSearchParams;
+ }
+ /**
+ * `URL` class is a global reference for `require('url').URL`
+ * https://nodejs.org/api/url.html#the-whatwg-url-api
+ * @since v10.0.0
+ */
+ var URL: typeof globalThis extends {
+ onmessage: any;
+ URL: infer T;
+ } ? T
+ : typeof _URL;
+ /**
+ * `URLSearchParams` class is a global reference for `require('url').URLSearchParams`
+ * https://nodejs.org/api/url.html#class-urlsearchparams
+ * @since v10.0.0
+ */
+ var URLSearchParams: typeof globalThis extends {
+ onmessage: any;
+ URLSearchParams: infer T;
+ } ? T
+ : typeof _URLSearchParams;
+ }
+}
+declare module "node:url" {
+ export * from "url";
+}
diff --git a/client/node_modules/@types/node/util.d.ts b/client/node_modules/@types/node/util.d.ts
new file mode 100644
index 0000000..845332a
--- /dev/null
+++ b/client/node_modules/@types/node/util.d.ts
@@ -0,0 +1,2078 @@
+/**
+ * The `util` module supports the needs of Node.js internal APIs. Many of the
+ * utilities are useful for application and module developers as well. To access
+ * it:
+ *
+ * ```js
+ * const util = require('util');
+ * ```
+ * @see [source](https://github.com/nodejs/node/blob/v18.x/lib/util.js)
+ */
+declare module "util" {
+ import * as types from "node:util/types";
+ export interface InspectOptions {
+ /**
+ * If `true`, object's non-enumerable symbols and properties are included in the formatted result.
+ * `WeakMap` and `WeakSet` entries are also included as well as user defined prototype properties (excluding method properties).
+ * @default false
+ */
+ showHidden?: boolean | undefined;
+ /**
+ * Specifies the number of times to recurse while formatting object.
+ * This is useful for inspecting large objects.
+ * To recurse up to the maximum call stack size pass `Infinity` or `null`.
+ * @default 2
+ */
+ depth?: number | null | undefined;
+ /**
+ * If `true`, the output is styled with ANSI color codes. Colors are customizable.
+ */
+ colors?: boolean | undefined;
+ /**
+ * If `false`, `[util.inspect.custom](depth, opts, inspect)` functions are not invoked.
+ * @default true
+ */
+ customInspect?: boolean | undefined;
+ /**
+ * If `true`, `Proxy` inspection includes the target and handler objects.
+ * @default false
+ */
+ showProxy?: boolean | undefined;
+ /**
+ * Specifies the maximum number of `Array`, `TypedArray`, `WeakMap`, and `WeakSet` elements
+ * to include when formatting. Set to `null` or `Infinity` to show all elements.
+ * Set to `0` or negative to show no elements.
+ * @default 100
+ */
+ maxArrayLength?: number | null | undefined;
+ /**
+ * Specifies the maximum number of characters to
+ * include when formatting. Set to `null` or `Infinity` to show all elements.
+ * Set to `0` or negative to show no characters.
+ * @default 10000
+ */
+ maxStringLength?: number | null | undefined;
+ /**
+ * The length at which input values are split across multiple lines.
+ * Set to `Infinity` to format the input as a single line
+ * (in combination with `compact` set to `true` or any number >= `1`).
+ * @default 80
+ */
+ breakLength?: number | undefined;
+ /**
+ * Setting this to `false` causes each object key
+ * to be displayed on a new line. It will also add new lines to text that is
+ * longer than `breakLength`. If set to a number, the most `n` inner elements
+ * are united on a single line as long as all properties fit into
+ * `breakLength`. Short array elements are also grouped together. Note that no
+ * text will be reduced below 16 characters, no matter the `breakLength` size.
+ * For more information, see the example below.
+ * @default true
+ */
+ compact?: boolean | number | undefined;
+ /**
+ * If set to `true` or a function, all properties of an object, and `Set` and `Map`
+ * entries are sorted in the resulting string.
+ * If set to `true` the default sort is used.
+ * If set to a function, it is used as a compare function.
+ */
+ sorted?: boolean | ((a: string, b: string) => number) | undefined;
+ /**
+ * If set to `true`, getters are going to be
+ * inspected as well. If set to `'get'` only getters without setter are going
+ * to be inspected. If set to `'set'` only getters having a corresponding
+ * setter are going to be inspected. This might cause side effects depending on
+ * the getter function.
+ * @default false
+ */
+ getters?: "get" | "set" | boolean | undefined;
+ /**
+ * If set to `true`, an underscore is used to separate every three digits in all bigints and numbers.
+ * @default false
+ */
+ numericSeparator?: boolean | undefined;
+ }
+ export type Style =
+ | "special"
+ | "number"
+ | "bigint"
+ | "boolean"
+ | "undefined"
+ | "null"
+ | "string"
+ | "symbol"
+ | "date"
+ | "regexp"
+ | "module";
+ export type CustomInspectFunction = (depth: number, options: InspectOptionsStylized) => any; // TODO: , inspect: inspect
+ export interface InspectOptionsStylized extends InspectOptions {
+ stylize(text: string, styleType: Style): string;
+ }
+ /**
+ * The `util.format()` method returns a formatted string using the first argument
+ * as a `printf`\-like format string which can contain zero or more format
+ * specifiers. Each specifier is replaced with the converted value from the
+ * corresponding argument. Supported specifiers are:
+ *
+ * If a specifier does not have a corresponding argument, it is not replaced:
+ *
+ * ```js
+ * util.format('%s:%s', 'foo');
+ * // Returns: 'foo:%s'
+ * ```
+ *
+ * Values that are not part of the format string are formatted using`util.inspect()` if their type is not `string`.
+ *
+ * If there are more arguments passed to the `util.format()` method than the
+ * number of specifiers, the extra arguments are concatenated to the returned
+ * string, separated by spaces:
+ *
+ * ```js
+ * util.format('%s:%s', 'foo', 'bar', 'baz');
+ * // Returns: 'foo:bar baz'
+ * ```
+ *
+ * If the first argument does not contain a valid format specifier, `util.format()`returns a string that is the concatenation of all arguments separated by spaces:
+ *
+ * ```js
+ * util.format(1, 2, 3);
+ * // Returns: '1 2 3'
+ * ```
+ *
+ * If only one argument is passed to `util.format()`, it is returned as it is
+ * without any formatting:
+ *
+ * ```js
+ * util.format('%% %s');
+ * // Returns: '%% %s'
+ * ```
+ *
+ * `util.format()` is a synchronous method that is intended as a debugging tool.
+ * Some input values can have a significant performance overhead that can block the
+ * event loop. Use this function with care and never in a hot code path.
+ * @since v0.5.3
+ * @param format A `printf`-like format string.
+ */
+ export function format(format?: any, ...param: any[]): string;
+ /**
+ * This function is identical to {@link format}, except in that it takes
+ * an `inspectOptions` argument which specifies options that are passed along to {@link inspect}.
+ *
+ * ```js
+ * util.formatWithOptions({ colors: true }, 'See object %O', { foo: 42 });
+ * // Returns 'See object { foo: 42 }', where `42` is colored as a number
+ * // when printed to a terminal.
+ * ```
+ * @since v10.0.0
+ */
+ export function formatWithOptions(inspectOptions: InspectOptions, format?: any, ...param: any[]): string;
+ /**
+ * Returns the string name for a numeric error code that comes from a Node.js API.
+ * The mapping between error codes and error names is platform-dependent.
+ * See `Common System Errors` for the names of common errors.
+ *
+ * ```js
+ * fs.access('file/that/does/not/exist', (err) => {
+ * const name = util.getSystemErrorName(err.errno);
+ * console.error(name); // ENOENT
+ * });
+ * ```
+ * @since v9.7.0
+ */
+ export function getSystemErrorName(err: number): string;
+ /**
+ * Returns a Map of all system error codes available from the Node.js API.
+ * The mapping between error codes and error names is platform-dependent.
+ * See `Common System Errors` for the names of common errors.
+ *
+ * ```js
+ * fs.access('file/that/does/not/exist', (err) => {
+ * const errorMap = util.getSystemErrorMap();
+ * const name = errorMap.get(err.errno);
+ * console.error(name); // ENOENT
+ * });
+ * ```
+ * @since v16.0.0, v14.17.0
+ */
+ export function getSystemErrorMap(): Map<number, [string, string]>;
+ /**
+ * The `util.log()` method prints the given `string` to `stdout` with an included
+ * timestamp.
+ *
+ * ```js
+ * const util = require('util');
+ *
+ * util.log('Timestamped message.');
+ * ```
+ * @since v0.3.0
+ * @deprecated Since v6.0.0 - Use a third party module instead.
+ */
+ export function log(string: string): void;
+ /**
+ * Returns the `string` after replacing any surrogate code points
+ * (or equivalently, any unpaired surrogate code units) with the
+ * Unicode "replacement character" U+FFFD.
+ * @since v16.8.0, v14.18.0
+ */
+ export function toUSVString(string: string): string;
+ /**
+ * Creates and returns an `AbortController` instance whose `AbortSignal` is marked
+ * as transferable and can be used with `structuredClone()` or `postMessage()`.
+ * @since v18.11.0
+ * @returns A transferable AbortController
+ */
+ export function transferableAbortController(): AbortController;
+ /**
+ * Marks the given {AbortSignal} as transferable so that it can be used with
+ * `structuredClone()` and `postMessage()`.
+ *
+ * ```js
+ * const signal = transferableAbortSignal(AbortSignal.timeout(100));
+ * const channel = new MessageChannel();
+ * channel.port2.postMessage(signal, [signal]);
+ * ```
+ * @since v18.11.0
+ * @param signal The AbortSignal
+ * @returns The same AbortSignal
+ */
+ export function transferableAbortSignal(signal: AbortSignal): AbortSignal;
+ /**
+ * Listens to abort event on the provided `signal` and returns a promise that is fulfilled when the `signal` is aborted.
+ * If the passed `resource` is garbage collected before the `signal` is aborted, the returned promise shall remain pending indefinitely.
+ * @param resource Any non-null entity, reference to which is held weakly.
+ */
+ export function aborted(signal: AbortSignal, resource: any): Promise<void>;
+ /**
+ * The `util.inspect()` method returns a string representation of `object` that is
+ * intended for debugging. The output of `util.inspect` may change at any time
+ * and should not be depended upon programmatically. Additional `options` may be
+ * passed that alter the result.`util.inspect()` will use the constructor's name and/or `@@toStringTag` to make
+ * an identifiable tag for an inspected value.
+ *
+ * ```js
+ * class Foo {
+ * get [Symbol.toStringTag]() {
+ * return 'bar';
+ * }
+ * }
+ *
+ * class Bar {}
+ *
+ * const baz = Object.create(null, { [Symbol.toStringTag]: { value: 'foo' } });
+ *
+ * util.inspect(new Foo()); // 'Foo [bar] {}'
+ * util.inspect(new Bar()); // 'Bar {}'
+ * util.inspect(baz); // '[foo] {}'
+ * ```
+ *
+ * Circular references point to their anchor by using a reference index:
+ *
+ * ```js
+ * const { inspect } = require('util');
+ *
+ * const obj = {};
+ * obj.a = [obj];
+ * obj.b = {};
+ * obj.b.inner = obj.b;
+ * obj.b.obj = obj;
+ *
+ * console.log(inspect(obj));
+ * // <ref *1> {
+ * // a: [ [Circular *1] ],
+ * // b: <ref *2> { inner: [Circular *2], obj: [Circular *1] }
+ * // }
+ * ```
+ *
+ * The following example inspects all properties of the `util` object:
+ *
+ * ```js
+ * const util = require('util');
+ *
+ * console.log(util.inspect(util, { showHidden: true, depth: null }));
+ * ```
+ *
+ * The following example highlights the effect of the `compact` option:
+ *
+ * ```js
+ * const util = require('util');
+ *
+ * const o = {
+ * a: [1, 2, [[
+ * 'Lorem ipsum dolor sit amet,\nconsectetur adipiscing elit, sed do ' +
+ * 'eiusmod \ntempor incididunt ut labore et dolore magna aliqua.',
+ * 'test',
+ * 'foo']], 4],
+ * b: new Map([['za', 1], ['zb', 'test']])
+ * };
+ * console.log(util.inspect(o, { compact: true, depth: 5, breakLength: 80 }));
+ *
+ * // { a:
+ * // [ 1,
+ * // 2,
+ * // [ [ 'Lorem ipsum dolor sit amet,\nconsectetur [...]', // A long line
+ * // 'test',
+ * // 'foo' ] ],
+ * // 4 ],
+ * // b: Map(2) { 'za' => 1, 'zb' => 'test' } }
+ *
+ * // Setting `compact` to false or an integer creates more reader friendly output.
+ * console.log(util.inspect(o, { compact: false, depth: 5, breakLength: 80 }));
+ *
+ * // {
+ * // a: [
+ * // 1,
+ * // 2,
+ * // [
+ * // [
+ * // 'Lorem ipsum dolor sit amet,\n' +
+ * // 'consectetur adipiscing elit, sed do eiusmod \n' +
+ * // 'tempor incididunt ut labore et dolore magna aliqua.',
+ * // 'test',
+ * // 'foo'
+ * // ]
+ * // ],
+ * // 4
+ * // ],
+ * // b: Map(2) {
+ * // 'za' => 1,
+ * // 'zb' => 'test'
+ * // }
+ * // }
+ *
+ * // Setting `breakLength` to e.g. 150 will print the "Lorem ipsum" text in a
+ * // single line.
+ * ```
+ *
+ * The `showHidden` option allows [`WeakMap`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap) and
+ * [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) entries to be
+ * inspected. If there are more entries than `maxArrayLength`, there is no
+ * guarantee which entries are displayed. That means retrieving the same [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) entries twice may
+ * result in different output. Furthermore, entries
+ * with no remaining strong references may be garbage collected at any time.
+ *
+ * ```js
+ * const { inspect } = require('util');
+ *
+ * const obj = { a: 1 };
+ * const obj2 = { b: 2 };
+ * const weakSet = new WeakSet([obj, obj2]);
+ *
+ * console.log(inspect(weakSet, { showHidden: true }));
+ * // WeakSet { { a: 1 }, { b: 2 } }
+ * ```
+ *
+ * The `sorted` option ensures that an object's property insertion order does not
+ * impact the result of `util.inspect()`.
+ *
+ * ```js
+ * const { inspect } = require('util');
+ * const assert = require('assert');
+ *
+ * const o1 = {
+ * b: [2, 3, 1],
+ * a: '`a` comes before `b`',
+ * c: new Set([2, 3, 1])
+ * };
+ * console.log(inspect(o1, { sorted: true }));
+ * // { a: '`a` comes before `b`', b: [ 2, 3, 1 ], c: Set(3) { 1, 2, 3 } }
+ * console.log(inspect(o1, { sorted: (a, b) => b.localeCompare(a) }));
+ * // { c: Set(3) { 3, 2, 1 }, b: [ 2, 3, 1 ], a: '`a` comes before `b`' }
+ *
+ * const o2 = {
+ * c: new Set([2, 1, 3]),
+ * a: '`a` comes before `b`',
+ * b: [2, 3, 1]
+ * };
+ * assert.strict.equal(
+ * inspect(o1, { sorted: true }),
+ * inspect(o2, { sorted: true })
+ * );
+ * ```
+ *
+ * The `numericSeparator` option adds an underscore every three digits to all
+ * numbers.
+ *
+ * ```js
+ * const { inspect } = require('util');
+ *
+ * const thousand = 1_000;
+ * const million = 1_000_000;
+ * const bigNumber = 123_456_789n;
+ * const bigDecimal = 1_234.123_45;
+ *
+ * console.log(thousand, million, bigNumber, bigDecimal);
+ * // 1_000 1_000_000 123_456_789n 1_234.123_45
+ * ```
+ *
+ * `util.inspect()` is a synchronous method intended for debugging. Its maximum
+ * output length is approximately 128 MB. Inputs that result in longer output will
+ * be truncated.
+ * @since v0.3.0
+ * @param object Any JavaScript primitive or `Object`.
+ * @return The representation of `object`.
+ */
+ export function inspect(object: any, showHidden?: boolean, depth?: number | null, color?: boolean): string;
+ export function inspect(object: any, options?: InspectOptions): string;
+ export namespace inspect {
+ let colors: NodeJS.Dict<[number, number]>;
+ let styles: {
+ [K in Style]: string;
+ };
+ let defaultOptions: InspectOptions;
+ /**
+ * Allows changing inspect settings from the repl.
+ */
+ let replDefaults: InspectOptions;
+ /**
+ * That can be used to declare custom inspect functions.
+ */
+ const custom: unique symbol;
+ }
+ /**
+ * Alias for [`Array.isArray()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray).
+ *
+ * Returns `true` if the given `object` is an `Array`. Otherwise, returns `false`.
+ *
+ * ```js
+ * const util = require('util');
+ *
+ * util.isArray([]);
+ * // Returns: true
+ * util.isArray(new Array());
+ * // Returns: true
+ * util.isArray({});
+ * // Returns: false
+ * ```
+ * @since v0.6.0
+ * @deprecated Since v4.0.0 - Use `isArray` instead.
+ */
+ export function isArray(object: unknown): object is unknown[];
+ /**
+ * Returns `true` if the given `object` is a `RegExp`. Otherwise, returns `false`.
+ *
+ * ```js
+ * const util = require('util');
+ *
+ * util.isRegExp(/some regexp/);
+ * // Returns: true
+ * util.isRegExp(new RegExp('another regexp'));
+ * // Returns: true
+ * util.isRegExp({});
+ * // Returns: false
+ * ```
+ * @since v0.6.0
+ * @deprecated Since v4.0.0 - Deprecated
+ */
+ export function isRegExp(object: unknown): object is RegExp;
+ /**
+ * Returns `true` if the given `object` is a `Date`. Otherwise, returns `false`.
+ *
+ * ```js
+ * const util = require('util');
+ *
+ * util.isDate(new Date());
+ * // Returns: true
+ * util.isDate(Date());
+ * // false (without 'new' returns a String)
+ * util.isDate({});
+ * // Returns: false
+ * ```
+ * @since v0.6.0
+ * @deprecated Since v4.0.0 - Use {@link types.isDate} instead.
+ */
+ export function isDate(object: unknown): object is Date;
+ /**
+ * Returns `true` if the given `object` is an `Error`. Otherwise, returns`false`.
+ *
+ * ```js
+ * const util = require('util');
+ *
+ * util.isError(new Error());
+ * // Returns: true
+ * util.isError(new TypeError());
+ * // Returns: true
+ * util.isError({ name: 'Error', message: 'an error occurred' });
+ * // Returns: false
+ * ```
+ *
+ * This method relies on `Object.prototype.toString()` behavior. It is
+ * possible to obtain an incorrect result when the `object` argument manipulates`@@toStringTag`.
+ *
+ * ```js
+ * const util = require('util');
+ * const obj = { name: 'Error', message: 'an error occurred' };
+ *
+ * util.isError(obj);
+ * // Returns: false
+ * obj[Symbol.toStringTag] = 'Error';
+ * util.isError(obj);
+ * // Returns: true
+ * ```
+ * @since v0.6.0
+ * @deprecated Since v4.0.0 - Use {@link types.isNativeError} instead.
+ */
+ export function isError(object: unknown): object is Error;
+ /**
+ * Usage of `util.inherits()` is discouraged. Please use the ES6 `class` and`extends` keywords to get language level inheritance support. Also note
+ * that the two styles are [semantically incompatible](https://github.com/nodejs/node/issues/4179).
+ *
+ * Inherit the prototype methods from one [constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/constructor) into another. The
+ * prototype of `constructor` will be set to a new object created from`superConstructor`.
+ *
+ * This mainly adds some input validation on top of`Object.setPrototypeOf(constructor.prototype, superConstructor.prototype)`.
+ * As an additional convenience, `superConstructor` will be accessible
+ * through the `constructor.super_` property.
+ *
+ * ```js
+ * const util = require('util');
+ * const EventEmitter = require('events');
+ *
+ * function MyStream() {
+ * EventEmitter.call(this);
+ * }
+ *
+ * util.inherits(MyStream, EventEmitter);
+ *
+ * MyStream.prototype.write = function(data) {
+ * this.emit('data', data);
+ * };
+ *
+ * const stream = new MyStream();
+ *
+ * console.log(stream instanceof EventEmitter); // true
+ * console.log(MyStream.super_ === EventEmitter); // true
+ *
+ * stream.on('data', (data) => {
+ * console.log(`Received data: "${data}"`);
+ * });
+ * stream.write('It works!'); // Received data: "It works!"
+ * ```
+ *
+ * ES6 example using `class` and `extends`:
+ *
+ * ```js
+ * const EventEmitter = require('events');
+ *
+ * class MyStream extends EventEmitter {
+ * write(data) {
+ * this.emit('data', data);
+ * }
+ * }
+ *
+ * const stream = new MyStream();
+ *
+ * stream.on('data', (data) => {
+ * console.log(`Received data: "${data}"`);
+ * });
+ * stream.write('With ES6');
+ * ```
+ * @since v0.3.0
+ * @legacy Use ES2015 class syntax and `extends` keyword instead.
+ */
+ export function inherits(constructor: unknown, superConstructor: unknown): void;
+ export type DebugLoggerFunction = (msg: string, ...param: unknown[]) => void;
+ export interface DebugLogger extends DebugLoggerFunction {
+ enabled: boolean;
+ }
+ /**
+ * The `util.debuglog()` method is used to create a function that conditionally
+ * writes debug messages to `stderr` based on the existence of the `NODE_DEBUG`environment variable. If the `section` name appears within the value of that
+ * environment variable, then the returned function operates similar to `console.error()`. If not, then the returned function is a no-op.
+ *
+ * ```js
+ * const util = require('util');
+ * const debuglog = util.debuglog('foo');
+ *
+ * debuglog('hello from foo [%d]', 123);
+ * ```
+ *
+ * If this program is run with `NODE_DEBUG=foo` in the environment, then
+ * it will output something like:
+ *
+ * ```console
+ * FOO 3245: hello from foo [123]
+ * ```
+ *
+ * where `3245` is the process id. If it is not run with that
+ * environment variable set, then it will not print anything.
+ *
+ * The `section` supports wildcard also:
+ *
+ * ```js
+ * const util = require('util');
+ * const debuglog = util.debuglog('foo-bar');
+ *
+ * debuglog('hi there, it\'s foo-bar [%d]', 2333);
+ * ```
+ *
+ * if it is run with `NODE_DEBUG=foo*` in the environment, then it will output
+ * something like:
+ *
+ * ```console
+ * FOO-BAR 3257: hi there, it's foo-bar [2333]
+ * ```
+ *
+ * Multiple comma-separated `section` names may be specified in the `NODE_DEBUG`environment variable: `NODE_DEBUG=fs,net,tls`.
+ *
+ * The optional `callback` argument can be used to replace the logging function
+ * with a different function that doesn't have any initialization or
+ * unnecessary wrapping.
+ *
+ * ```js
+ * const util = require('util');
+ * let debuglog = util.debuglog('internals', (debug) => {
+ * // Replace with a logging function that optimizes out
+ * // testing if the section is enabled
+ * debuglog = debug;
+ * });
+ * ```
+ * @since v0.11.3
+ * @param section A string identifying the portion of the application for which the `debuglog` function is being created.
+ * @param callback A callback invoked the first time the logging function is called with a function argument that is a more optimized logging function.
+ * @return The logging function
+ */
+ export function debuglog(section: string, callback?: (fn: DebugLoggerFunction) => void): DebugLogger;
+ export const debug: typeof debuglog;
+ /**
+ * Returns `true` if the given `object` is a `Boolean`. Otherwise, returns `false`.
+ *
+ * ```js
+ * const util = require('util');
+ *
+ * util.isBoolean(1);
+ * // Returns: false
+ * util.isBoolean(0);
+ * // Returns: false
+ * util.isBoolean(false);
+ * // Returns: true
+ * ```
+ * @since v0.11.5
+ * @deprecated Since v4.0.0 - Use `typeof value === 'boolean'` instead.
+ */
+ export function isBoolean(object: unknown): object is boolean;
+ /**
+ * Returns `true` if the given `object` is a `Buffer`. Otherwise, returns `false`.
+ *
+ * ```js
+ * const util = require('util');
+ *
+ * util.isBuffer({ length: 0 });
+ * // Returns: false
+ * util.isBuffer([]);
+ * // Returns: false
+ * util.isBuffer(Buffer.from('hello world'));
+ * // Returns: true
+ * ```
+ * @since v0.11.5
+ * @deprecated Since v4.0.0 - Use `isBuffer` instead.
+ */
+ export function isBuffer(object: unknown): object is Buffer;
+ /**
+ * Returns `true` if the given `object` is a `Function`. Otherwise, returns`false`.
+ *
+ * ```js
+ * const util = require('util');
+ *
+ * function Foo() {}
+ * const Bar = () => {};
+ *
+ * util.isFunction({});
+ * // Returns: false
+ * util.isFunction(Foo);
+ * // Returns: true
+ * util.isFunction(Bar);
+ * // Returns: true
+ * ```
+ * @since v0.11.5
+ * @deprecated Since v4.0.0 - Use `typeof value === 'function'` instead.
+ */
+ export function isFunction(object: unknown): boolean;
+ /**
+ * Returns `true` if the given `object` is strictly `null`. Otherwise, returns`false`.
+ *
+ * ```js
+ * const util = require('util');
+ *
+ * util.isNull(0);
+ * // Returns: false
+ * util.isNull(undefined);
+ * // Returns: false
+ * util.isNull(null);
+ * // Returns: true
+ * ```
+ * @since v0.11.5
+ * @deprecated Since v4.0.0 - Use `value === null` instead.
+ */
+ export function isNull(object: unknown): object is null;
+ /**
+ * Returns `true` if the given `object` is `null` or `undefined`. Otherwise,
+ * returns `false`.
+ *
+ * ```js
+ * const util = require('util');
+ *
+ * util.isNullOrUndefined(0);
+ * // Returns: false
+ * util.isNullOrUndefined(undefined);
+ * // Returns: true
+ * util.isNullOrUndefined(null);
+ * // Returns: true
+ * ```
+ * @since v0.11.5
+ * @deprecated Since v4.0.0 - Use `value === undefined || value === null` instead.
+ */
+ export function isNullOrUndefined(object: unknown): object is null | undefined;
+ /**
+ * Returns `true` if the given `object` is a `Number`. Otherwise, returns `false`.
+ *
+ * ```js
+ * const util = require('util');
+ *
+ * util.isNumber(false);
+ * // Returns: false
+ * util.isNumber(Infinity);
+ * // Returns: true
+ * util.isNumber(0);
+ * // Returns: true
+ * util.isNumber(NaN);
+ * // Returns: true
+ * ```
+ * @since v0.11.5
+ * @deprecated Since v4.0.0 - Use `typeof value === 'number'` instead.
+ */
+ export function isNumber(object: unknown): object is number;
+ /**
+ * Returns `true` if the given `object` is strictly an `Object`**and** not a`Function` (even though functions are objects in JavaScript).
+ * Otherwise, returns `false`.
+ *
+ * ```js
+ * const util = require('util');
+ *
+ * util.isObject(5);
+ * // Returns: false
+ * util.isObject(null);
+ * // Returns: false
+ * util.isObject({});
+ * // Returns: true
+ * util.isObject(() => {});
+ * // Returns: false
+ * ```
+ * @since v0.11.5
+ * @deprecated Since v4.0.0 - Deprecated: Use `value !== null && typeof value === 'object'` instead.
+ */
+ export function isObject(object: unknown): boolean;
+ /**
+ * Returns `true` if the given `object` is a primitive type. Otherwise, returns`false`.
+ *
+ * ```js
+ * const util = require('util');
+ *
+ * util.isPrimitive(5);
+ * // Returns: true
+ * util.isPrimitive('foo');
+ * // Returns: true
+ * util.isPrimitive(false);
+ * // Returns: true
+ * util.isPrimitive(null);
+ * // Returns: true
+ * util.isPrimitive(undefined);
+ * // Returns: true
+ * util.isPrimitive({});
+ * // Returns: false
+ * util.isPrimitive(() => {});
+ * // Returns: false
+ * util.isPrimitive(/^$/);
+ * // Returns: false
+ * util.isPrimitive(new Date());
+ * // Returns: false
+ * ```
+ * @since v0.11.5
+ * @deprecated Since v4.0.0 - Use `(typeof value !== 'object' && typeof value !== 'function') || value === null` instead.
+ */
+ export function isPrimitive(object: unknown): boolean;
+ /**
+ * Returns `true` if the given `object` is a `string`. Otherwise, returns `false`.
+ *
+ * ```js
+ * const util = require('util');
+ *
+ * util.isString('');
+ * // Returns: true
+ * util.isString('foo');
+ * // Returns: true
+ * util.isString(String('foo'));
+ * // Returns: true
+ * util.isString(5);
+ * // Returns: false
+ * ```
+ * @since v0.11.5
+ * @deprecated Since v4.0.0 - Use `typeof value === 'string'` instead.
+ */
+ export function isString(object: unknown): object is string;
+ /**
+ * Returns `true` if the given `object` is a `Symbol`. Otherwise, returns `false`.
+ *
+ * ```js
+ * const util = require('util');
+ *
+ * util.isSymbol(5);
+ * // Returns: false
+ * util.isSymbol('foo');
+ * // Returns: false
+ * util.isSymbol(Symbol('foo'));
+ * // Returns: true
+ * ```
+ * @since v0.11.5
+ * @deprecated Since v4.0.0 - Use `typeof value === 'symbol'` instead.
+ */
+ export function isSymbol(object: unknown): object is symbol;
+ /**
+ * Returns `true` if the given `object` is `undefined`. Otherwise, returns `false`.
+ *
+ * ```js
+ * const util = require('util');
+ *
+ * const foo = undefined;
+ * util.isUndefined(5);
+ * // Returns: false
+ * util.isUndefined(foo);
+ * // Returns: true
+ * util.isUndefined(null);
+ * // Returns: false
+ * ```
+ * @since v0.11.5
+ * @deprecated Since v4.0.0 - Use `value === undefined` instead.
+ */
+ export function isUndefined(object: unknown): object is undefined;
+ /**
+ * The `util.deprecate()` method wraps `fn` (which may be a function or class) in
+ * such a way that it is marked as deprecated.
+ *
+ * ```js
+ * const util = require('util');
+ *
+ * exports.obsoleteFunction = util.deprecate(() => {
+ * // Do something here.
+ * }, 'obsoleteFunction() is deprecated. Use newShinyFunction() instead.');
+ * ```
+ *
+ * When called, `util.deprecate()` will return a function that will emit a`DeprecationWarning` using the `'warning'` event. The warning will
+ * be emitted and printed to `stderr` the first time the returned function is
+ * called. After the warning is emitted, the wrapped function is called without
+ * emitting a warning.
+ *
+ * If the same optional `code` is supplied in multiple calls to `util.deprecate()`,
+ * the warning will be emitted only once for that `code`.
+ *
+ * ```js
+ * const util = require('util');
+ *
+ * const fn1 = util.deprecate(someFunction, someMessage, 'DEP0001');
+ * const fn2 = util.deprecate(someOtherFunction, someOtherMessage, 'DEP0001');
+ * fn1(); // Emits a deprecation warning with code DEP0001
+ * fn2(); // Does not emit a deprecation warning because it has the same code
+ * ```
+ *
+ * If either the `--no-deprecation` or `--no-warnings` command-line flags are
+ * used, or if the `process.noDeprecation` property is set to `true`_prior_ to
+ * the first deprecation warning, the `util.deprecate()` method does nothing.
+ *
+ * If the `--trace-deprecation` or `--trace-warnings` command-line flags are set,
+ * or the `process.traceDeprecation` property is set to `true`, a warning and a
+ * stack trace are printed to `stderr` the first time the deprecated function is
+ * called.
+ *
+ * If the `--throw-deprecation` command-line flag is set, or the`process.throwDeprecation` property is set to `true`, then an exception will be
+ * thrown when the deprecated function is called.
+ *
+ * The `--throw-deprecation` command-line flag and `process.throwDeprecation`property take precedence over `--trace-deprecation` and`process.traceDeprecation`.
+ * @since v0.8.0
+ * @param fn The function that is being deprecated.
+ * @param msg A warning message to display when the deprecated function is invoked.
+ * @param code A deprecation code. See the `list of deprecated APIs` for a list of codes.
+ * @return The deprecated function wrapped to emit a warning.
+ */
+ export function deprecate<T extends Function>(fn: T, msg: string, code?: string): T;
+ /**
+ * Returns `true` if there is deep strict equality between `val1` and `val2`.
+ * Otherwise, returns `false`.
+ *
+ * See `assert.deepStrictEqual()` for more information about deep strict
+ * equality.
+ * @since v9.0.0
+ */
+ export function isDeepStrictEqual(val1: unknown, val2: unknown): boolean;
+ /**
+ * Returns `str` with any ANSI escape codes removed.
+ *
+ * ```js
+ * console.log(util.stripVTControlCharacters('\u001B[4mvalue\u001B[0m'));
+ * // Prints "value"
+ * ```
+ * @since v16.11.0
+ */
+ export function stripVTControlCharacters(str: string): string;
+ /**
+ * Takes an `async` function (or a function that returns a `Promise`) and returns a
+ * function following the error-first callback style, i.e. taking
+ * an `(err, value) => ...` callback as the last argument. In the callback, the
+ * first argument will be the rejection reason (or `null` if the `Promise`resolved), and the second argument will be the resolved value.
+ *
+ * ```js
+ * const util = require('util');
+ *
+ * async function fn() {
+ * return 'hello world';
+ * }
+ * const callbackFunction = util.callbackify(fn);
+ *
+ * callbackFunction((err, ret) => {
+ * if (err) throw err;
+ * console.log(ret);
+ * });
+ * ```
+ *
+ * Will print:
+ *
+ * ```text
+ * hello world
+ * ```
+ *
+ * The callback is executed asynchronously, and will have a limited stack trace.
+ * If the callback throws, the process will emit an `'uncaughtException'` event, and if not handled will exit.
+ *
+ * Since `null` has a special meaning as the first argument to a callback, if a
+ * wrapped function rejects a `Promise` with a falsy value as a reason, the value
+ * is wrapped in an `Error` with the original value stored in a field named`reason`.
+ *
+ * ```js
+ * function fn() {
+ * return Promise.reject(null);
+ * }
+ * const callbackFunction = util.callbackify(fn);
+ *
+ * callbackFunction((err, ret) => {
+ * // When the Promise was rejected with `null` it is wrapped with an Error and
+ * // the original value is stored in `reason`.
+ * err &#x26;&#x26; Object.hasOwn(err, 'reason') &#x26;&#x26; err.reason === null; // true
+ * });
+ * ```
+ * @since v8.2.0
+ * @param fn An `async` function
+ * @return a callback style function
+ */
+ export function callbackify(fn: () => Promise<void>): (callback: (err: NodeJS.ErrnoException) => void) => void;
+ export function callbackify<TResult>(
+ fn: () => Promise<TResult>,
+ ): (callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void;
+ export function callbackify<T1>(
+ fn: (arg1: T1) => Promise<void>,
+ ): (arg1: T1, callback: (err: NodeJS.ErrnoException) => void) => void;
+ export function callbackify<T1, TResult>(
+ fn: (arg1: T1) => Promise<TResult>,
+ ): (arg1: T1, callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void;
+ export function callbackify<T1, T2>(
+ fn: (arg1: T1, arg2: T2) => Promise<void>,
+ ): (arg1: T1, arg2: T2, callback: (err: NodeJS.ErrnoException) => void) => void;
+ export function callbackify<T1, T2, TResult>(
+ fn: (arg1: T1, arg2: T2) => Promise<TResult>,
+ ): (arg1: T1, arg2: T2, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void;
+ export function callbackify<T1, T2, T3>(
+ fn: (arg1: T1, arg2: T2, arg3: T3) => Promise<void>,
+ ): (arg1: T1, arg2: T2, arg3: T3, callback: (err: NodeJS.ErrnoException) => void) => void;
+ export function callbackify<T1, T2, T3, TResult>(
+ fn: (arg1: T1, arg2: T2, arg3: T3) => Promise<TResult>,
+ ): (arg1: T1, arg2: T2, arg3: T3, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void;
+ export function callbackify<T1, T2, T3, T4>(
+ fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<void>,
+ ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: NodeJS.ErrnoException) => void) => void;
+ export function callbackify<T1, T2, T3, T4, TResult>(
+ fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<TResult>,
+ ): (
+ arg1: T1,
+ arg2: T2,
+ arg3: T3,
+ arg4: T4,
+ callback: (err: NodeJS.ErrnoException | null, result: TResult) => void,
+ ) => void;
+ export function callbackify<T1, T2, T3, T4, T5>(
+ fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<void>,
+ ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: NodeJS.ErrnoException) => void) => void;
+ export function callbackify<T1, T2, T3, T4, T5, TResult>(
+ fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<TResult>,
+ ): (
+ arg1: T1,
+ arg2: T2,
+ arg3: T3,
+ arg4: T4,
+ arg5: T5,
+ callback: (err: NodeJS.ErrnoException | null, result: TResult) => void,
+ ) => void;
+ export function callbackify<T1, T2, T3, T4, T5, T6>(
+ fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => Promise<void>,
+ ): (
+ arg1: T1,
+ arg2: T2,
+ arg3: T3,
+ arg4: T4,
+ arg5: T5,
+ arg6: T6,
+ callback: (err: NodeJS.ErrnoException) => void,
+ ) => void;
+ export function callbackify<T1, T2, T3, T4, T5, T6, TResult>(
+ fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => Promise<TResult>,
+ ): (
+ arg1: T1,
+ arg2: T2,
+ arg3: T3,
+ arg4: T4,
+ arg5: T5,
+ arg6: T6,
+ callback: (err: NodeJS.ErrnoException | null, result: TResult) => void,
+ ) => void;
+ export interface CustomPromisifyLegacy<TCustom extends Function> extends Function {
+ __promisify__: TCustom;
+ }
+ export interface CustomPromisifySymbol<TCustom extends Function> extends Function {
+ [promisify.custom]: TCustom;
+ }
+ export type CustomPromisify<TCustom extends Function> =
+ | CustomPromisifySymbol<TCustom>
+ | CustomPromisifyLegacy<TCustom>;
+ /**
+ * Takes a function following the common error-first callback style, i.e. taking
+ * an `(err, value) => ...` callback as the last argument, and returns a version
+ * that returns promises.
+ *
+ * ```js
+ * const util = require('util');
+ * const fs = require('fs');
+ *
+ * const stat = util.promisify(fs.stat);
+ * stat('.').then((stats) => {
+ * // Do something with `stats`
+ * }).catch((error) => {
+ * // Handle the error.
+ * });
+ * ```
+ *
+ * Or, equivalently using `async function`s:
+ *
+ * ```js
+ * const util = require('util');
+ * const fs = require('fs');
+ *
+ * const stat = util.promisify(fs.stat);
+ *
+ * async function callStat() {
+ * const stats = await stat('.');
+ * console.log(`This directory is owned by ${stats.uid}`);
+ * }
+ * ```
+ *
+ * If there is an `original[util.promisify.custom]` property present, `promisify`will return its value, see `Custom promisified functions`.
+ *
+ * `promisify()` assumes that `original` is a function taking a callback as its
+ * final argument in all cases. If `original` is not a function, `promisify()`will throw an error. If `original` is a function but its last argument is not
+ * an error-first callback, it will still be passed an error-first
+ * callback as its last argument.
+ *
+ * Using `promisify()` on class methods or other methods that use `this` may not
+ * work as expected unless handled specially:
+ *
+ * ```js
+ * const util = require('util');
+ *
+ * class Foo {
+ * constructor() {
+ * this.a = 42;
+ * }
+ *
+ * bar(callback) {
+ * callback(null, this.a);
+ * }
+ * }
+ *
+ * const foo = new Foo();
+ *
+ * const naiveBar = util.promisify(foo.bar);
+ * // TypeError: Cannot read property 'a' of undefined
+ * // naiveBar().then(a => console.log(a));
+ *
+ * naiveBar.call(foo).then((a) => console.log(a)); // '42'
+ *
+ * const bindBar = naiveBar.bind(foo);
+ * bindBar().then((a) => console.log(a)); // '42'
+ * ```
+ * @since v8.0.0
+ */
+ export function promisify<TCustom extends Function>(fn: CustomPromisify<TCustom>): TCustom;
+ export function promisify<TResult>(
+ fn: (callback: (err: any, result: TResult) => void) => void,
+ ): () => Promise<TResult>;
+ export function promisify(fn: (callback: (err?: any) => void) => void): () => Promise<void>;
+ export function promisify<T1, TResult>(
+ fn: (arg1: T1, callback: (err: any, result: TResult) => void) => void,
+ ): (arg1: T1) => Promise<TResult>;
+ export function promisify<T1>(fn: (arg1: T1, callback: (err?: any) => void) => void): (arg1: T1) => Promise<void>;
+ export function promisify<T1, T2, TResult>(
+ fn: (arg1: T1, arg2: T2, callback: (err: any, result: TResult) => void) => void,
+ ): (arg1: T1, arg2: T2) => Promise<TResult>;
+ export function promisify<T1, T2>(
+ fn: (arg1: T1, arg2: T2, callback: (err?: any) => void) => void,
+ ): (arg1: T1, arg2: T2) => Promise<void>;
+ export function promisify<T1, T2, T3, TResult>(
+ fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err: any, result: TResult) => void) => void,
+ ): (arg1: T1, arg2: T2, arg3: T3) => Promise<TResult>;
+ export function promisify<T1, T2, T3>(
+ fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err?: any) => void) => void,
+ ): (arg1: T1, arg2: T2, arg3: T3) => Promise<void>;
+ export function promisify<T1, T2, T3, T4, TResult>(
+ fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: any, result: TResult) => void) => void,
+ ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<TResult>;
+ export function promisify<T1, T2, T3, T4>(
+ fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err?: any) => void) => void,
+ ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<void>;
+ export function promisify<T1, T2, T3, T4, T5, TResult>(
+ fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: any, result: TResult) => void) => void,
+ ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<TResult>;
+ export function promisify<T1, T2, T3, T4, T5>(
+ fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err?: any) => void) => void,
+ ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<void>;
+ export function promisify(fn: Function): Function;
+ export namespace promisify {
+ /**
+ * That can be used to declare custom promisified variants of functions.
+ */
+ const custom: unique symbol;
+ }
+ /**
+ * An implementation of the [WHATWG Encoding Standard](https://encoding.spec.whatwg.org/) `TextDecoder` API.
+ *
+ * ```js
+ * const decoder = new TextDecoder();
+ * const u8arr = new Uint8Array([72, 101, 108, 108, 111]);
+ * console.log(decoder.decode(u8arr)); // Hello
+ * ```
+ * @since v8.3.0
+ */
+ export class TextDecoder {
+ /**
+ * The encoding supported by the `TextDecoder` instance.
+ */
+ readonly encoding: string;
+ /**
+ * The value will be `true` if decoding errors result in a `TypeError` being
+ * thrown.
+ */
+ readonly fatal: boolean;
+ /**
+ * The value will be `true` if the decoding result will include the byte order
+ * mark.
+ */
+ readonly ignoreBOM: boolean;
+ constructor(
+ encoding?: string,
+ options?: {
+ fatal?: boolean | undefined;
+ ignoreBOM?: boolean | undefined;
+ },
+ );
+ /**
+ * Decodes the `input` and returns a string. If `options.stream` is `true`, any
+ * incomplete byte sequences occurring at the end of the `input` are buffered
+ * internally and emitted after the next call to `textDecoder.decode()`.
+ *
+ * If `textDecoder.fatal` is `true`, decoding errors that occur will result in a`TypeError` being thrown.
+ * @param input An `ArrayBuffer`, `DataView` or `TypedArray` instance containing the encoded data.
+ */
+ decode(
+ input?: NodeJS.ArrayBufferView | ArrayBuffer | null,
+ options?: {
+ stream?: boolean | undefined;
+ },
+ ): string;
+ }
+ export interface EncodeIntoResult {
+ /**
+ * The read Unicode code units of input.
+ */
+ read: number;
+ /**
+ * The written UTF-8 bytes of output.
+ */
+ written: number;
+ }
+ export { types };
+
+ //// TextEncoder/Decoder
+ /**
+ * An implementation of the [WHATWG Encoding Standard](https://encoding.spec.whatwg.org/) `TextEncoder` API. All
+ * instances of `TextEncoder` only support UTF-8 encoding.
+ *
+ * ```js
+ * const encoder = new TextEncoder();
+ * const uint8array = encoder.encode('this is some data');
+ * ```
+ *
+ * The `TextEncoder` class is also available on the global object.
+ * @since v8.3.0
+ */
+ export class TextEncoder {
+ /**
+ * The encoding supported by the `TextEncoder` instance. Always set to `'utf-8'`.
+ */
+ readonly encoding: string;
+ /**
+ * UTF-8 encodes the `input` string and returns a `Uint8Array` containing the
+ * encoded bytes.
+ * @param [input='an empty string'] The text to encode.
+ */
+ encode(input?: string): Uint8Array;
+ /**
+ * UTF-8 encodes the `src` string to the `dest` Uint8Array and returns an object
+ * containing the read Unicode code units and written UTF-8 bytes.
+ *
+ * ```js
+ * const encoder = new TextEncoder();
+ * const src = 'this is some data';
+ * const dest = new Uint8Array(10);
+ * const { read, written } = encoder.encodeInto(src, dest);
+ * ```
+ * @param src The text to encode.
+ * @param dest The array to hold the encode result.
+ */
+ encodeInto(src: string, dest: Uint8Array): EncodeIntoResult;
+ }
+
+ import { TextDecoder as _TextDecoder, TextEncoder as _TextEncoder } from "util";
+ global {
+ /**
+ * `TextDecoder` class is a global reference for `require('util').TextDecoder`
+ * https://nodejs.org/api/globals.html#textdecoder
+ * @since v11.0.0
+ */
+ var TextDecoder: typeof globalThis extends {
+ onmessage: any;
+ TextDecoder: infer TextDecoder;
+ } ? TextDecoder
+ : typeof _TextDecoder;
+
+ /**
+ * `TextEncoder` class is a global reference for `require('util').TextEncoder`
+ * https://nodejs.org/api/globals.html#textencoder
+ * @since v11.0.0
+ */
+ var TextEncoder: typeof globalThis extends {
+ onmessage: any;
+ TextEncoder: infer TextEncoder;
+ } ? TextEncoder
+ : typeof _TextEncoder;
+ }
+
+ //// parseArgs
+ /**
+ * Provides a high-level API for command-line argument parsing. Takes a
+ * specification for the expected arguments and returns a structured object
+ * with the parsed values and positionals.
+ *
+ * `config` provides arguments for parsing and configures the parser. It
+ * supports the following properties:
+ *
+ * - `args` The array of argument strings. **Default:** `process.argv` with
+ * `execPath` and `filename` removed.
+ * - `options` Arguments known to the parser. Keys of `options` are the long
+ * names of options and values are objects accepting the following properties:
+ *
+ * - `type` Type of argument, which must be either `boolean` (for options
+ * which do not take values) or `string` (for options which do).
+ * - `multiple` Whether this option can be provided multiple
+ * times. If `true`, all values will be collected in an array. If
+ * `false`, values for the option are last-wins. **Default:** `false`.
+ * - `short` A single character alias for the option.
+ * - `default` The default option value when it is not set by args. It
+ * must be of the same type as the `type` property. When `multiple`
+ * is `true`, it must be an array.
+ *
+ * - `strict`: Whether an error should be thrown when unknown arguments
+ * are encountered, or when arguments are passed that do not match the
+ * `type` configured in `options`. **Default:** `true`.
+ * - `allowPositionals`: Whether this command accepts positional arguments.
+ * **Default:** `false` if `strict` is `true`, otherwise `true`.
+ * - `tokens`: Whether tokens {boolean} Return the parsed tokens. This is useful
+ * for extending the built-in behavior, from adding additional checks through
+ * to reprocessing the tokens in different ways.
+ * **Default:** `false`.
+ *
+ * @returns The parsed command line arguments:
+ *
+ * - `values` A mapping of parsed option names with their string
+ * or boolean values.
+ * - `positionals` Positional arguments.
+ * - `tokens` Detailed parse information (only if `tokens` was specified).
+ */
+ export function parseArgs<T extends ParseArgsConfig>(config?: T): ParsedResults<T>;
+
+ interface ParseArgsOptionConfig {
+ /**
+ * Type of argument.
+ */
+ type: "string" | "boolean";
+ /**
+ * Whether this option can be provided multiple times.
+ * If `true`, all values will be collected in an array.
+ * If `false`, values for the option are last-wins.
+ * @default false.
+ */
+ multiple?: boolean | undefined;
+ /**
+ * A single character alias for the option.
+ */
+ short?: string | undefined;
+ /**
+ * The default option value when it is not set by args.
+ * It must be of the same type as the the `type` property.
+ * When `multiple` is `true`, it must be an array.
+ * @since v18.11.0
+ */
+ default?: string | boolean | string[] | boolean[] | undefined;
+ }
+
+ interface ParseArgsOptionsConfig {
+ [longOption: string]: ParseArgsOptionConfig;
+ }
+
+ export interface ParseArgsConfig {
+ /**
+ * Array of argument strings.
+ */
+ args?: string[] | undefined;
+ /**
+ * Used to describe arguments known to the parser.
+ */
+ options?: ParseArgsOptionsConfig | undefined;
+ /**
+ * Should an error be thrown when unknown arguments are encountered,
+ * or when arguments are passed that do not match the `type` configured in `options`.
+ * @default true
+ */
+ strict?: boolean | undefined;
+ /**
+ * Whether this command accepts positional arguments.
+ */
+ allowPositionals?: boolean | undefined;
+ /**
+ * Return the parsed tokens. This is useful for extending the built-in behavior,
+ * from adding additional checks through to reprocessing the tokens in different ways.
+ * @default false
+ */
+ tokens?: boolean | undefined;
+ }
+
+ /*
+ IfDefaultsTrue and IfDefaultsFalse are helpers to handle default values for missing boolean properties.
+ TypeScript does not have exact types for objects: https://github.com/microsoft/TypeScript/issues/12936
+ This means it is impossible to distinguish between "field X is definitely not present" and "field X may or may not be present".
+ But we expect users to generally provide their config inline or `as const`, which means TS will always know whether a given field is present.
+ So this helper treats "not definitely present" (i.e., not `extends boolean`) as being "definitely not present", i.e. it should have its default value.
+ This is technically incorrect but is a much nicer UX for the common case.
+ The IfDefaultsTrue version is for things which default to true; the IfDefaultsFalse version is for things which default to false.
+ */
+ type IfDefaultsTrue<T, IfTrue, IfFalse> = T extends true ? IfTrue
+ : T extends false ? IfFalse
+ : IfTrue;
+
+ // we put the `extends false` condition first here because `undefined` compares like `any` when `strictNullChecks: false`
+ type IfDefaultsFalse<T, IfTrue, IfFalse> = T extends false ? IfFalse
+ : T extends true ? IfTrue
+ : IfFalse;
+
+ type ExtractOptionValue<T extends ParseArgsConfig, O extends ParseArgsOptionConfig> = IfDefaultsTrue<
+ T["strict"],
+ O["type"] extends "string" ? string : O["type"] extends "boolean" ? boolean : string | boolean,
+ string | boolean
+ >;
+
+ type ParsedValues<T extends ParseArgsConfig> =
+ & IfDefaultsTrue<T["strict"], unknown, { [longOption: string]: undefined | string | boolean }>
+ & (T["options"] extends ParseArgsOptionsConfig ? {
+ -readonly [LongOption in keyof T["options"]]: IfDefaultsFalse<
+ T["options"][LongOption]["multiple"],
+ undefined | Array<ExtractOptionValue<T, T["options"][LongOption]>>,
+ undefined | ExtractOptionValue<T, T["options"][LongOption]>
+ >;
+ }
+ : {});
+
+ type ParsedPositionals<T extends ParseArgsConfig> = IfDefaultsTrue<
+ T["strict"],
+ IfDefaultsFalse<T["allowPositionals"], string[], []>,
+ IfDefaultsTrue<T["allowPositionals"], string[], []>
+ >;
+
+ type PreciseTokenForOptions<
+ K extends string,
+ O extends ParseArgsOptionConfig,
+ > = O["type"] extends "string" ? {
+ kind: "option";
+ index: number;
+ name: K;
+ rawName: string;
+ value: string;
+ inlineValue: boolean;
+ }
+ : O["type"] extends "boolean" ? {
+ kind: "option";
+ index: number;
+ name: K;
+ rawName: string;
+ value: undefined;
+ inlineValue: undefined;
+ }
+ : OptionToken & { name: K };
+
+ type TokenForOptions<
+ T extends ParseArgsConfig,
+ K extends keyof T["options"] = keyof T["options"],
+ > = K extends unknown
+ ? T["options"] extends ParseArgsOptionsConfig ? PreciseTokenForOptions<K & string, T["options"][K]>
+ : OptionToken
+ : never;
+
+ type ParsedOptionToken<T extends ParseArgsConfig> = IfDefaultsTrue<T["strict"], TokenForOptions<T>, OptionToken>;
+
+ type ParsedPositionalToken<T extends ParseArgsConfig> = IfDefaultsTrue<
+ T["strict"],
+ IfDefaultsFalse<T["allowPositionals"], { kind: "positional"; index: number; value: string }, never>,
+ IfDefaultsTrue<T["allowPositionals"], { kind: "positional"; index: number; value: string }, never>
+ >;
+
+ type ParsedTokens<T extends ParseArgsConfig> = Array<
+ ParsedOptionToken<T> | ParsedPositionalToken<T> | { kind: "option-terminator"; index: number }
+ >;
+
+ type PreciseParsedResults<T extends ParseArgsConfig> = IfDefaultsFalse<
+ T["tokens"],
+ {
+ values: ParsedValues<T>;
+ positionals: ParsedPositionals<T>;
+ tokens: ParsedTokens<T>;
+ },
+ {
+ values: ParsedValues<T>;
+ positionals: ParsedPositionals<T>;
+ }
+ >;
+
+ type OptionToken =
+ | { kind: "option"; index: number; name: string; rawName: string; value: string; inlineValue: boolean }
+ | {
+ kind: "option";
+ index: number;
+ name: string;
+ rawName: string;
+ value: undefined;
+ inlineValue: undefined;
+ };
+
+ type Token =
+ | OptionToken
+ | { kind: "positional"; index: number; value: string }
+ | { kind: "option-terminator"; index: number };
+
+ // If ParseArgsConfig extends T, then the user passed config constructed elsewhere.
+ // So we can't rely on the `"not definitely present" implies "definitely not present"` assumption mentioned above.
+ type ParsedResults<T extends ParseArgsConfig> = ParseArgsConfig extends T ? {
+ values: { [longOption: string]: undefined | string | boolean | Array<string | boolean> };
+ positionals: string[];
+ tokens?: Token[];
+ }
+ : PreciseParsedResults<T>;
+
+ /**
+ * @since v18.13.0
+ */
+ export class MIMEType {
+ /**
+ * Creates a new MIMEType object by parsing the input.
+ *
+ * A `TypeError` will be thrown if the `input` is not a valid MIME.
+ * Note that an effort will be made to coerce the given values into strings.
+ * @param input The input MIME to parse.
+ */
+ constructor(input: string | { toString: () => string });
+
+ /**
+ * Gets and sets the type portion of the MIME.
+ */
+ type: string;
+
+ /**
+ * Gets and sets the subtype portion of the MIME.
+ */
+ subtype: string;
+
+ /**
+ * Gets the essence of the MIME.
+ *
+ * Use `mime.type` or `mime.subtype` to alter the MIME.
+ */
+ readonly essence: string;
+
+ /**
+ * Gets the `MIMEParams` object representing the parameters of the MIME.
+ */
+ readonly params: MIMEParams;
+
+ /**
+ * Returns the serialized MIME.
+ *
+ * Because of the need for standard compliance, this method
+ * does not allow users to customize the serialization process of the MIME.
+ */
+ toString(): string;
+ }
+
+ /**
+ * @since v18.13.0
+ */
+ export class MIMEParams {
+ /**
+ * Remove all name-value pairs whose name is `name`.
+ */
+ delete(name: string): void;
+ /**
+ * Returns an iterator over each of the name-value pairs in the parameters.
+ */
+ entries(): IterableIterator<[name: string, value: string]>;
+ /**
+ * Returns the value of the first name-value pair whose name is `name`.
+ * If there are no such pairs, `null` is returned.
+ */
+ get(name: string): string | null;
+ /**
+ * Returns `true` if there is at least one name-value pair whose name is `name`.
+ */
+ has(name: string): boolean;
+ /**
+ * Returns an iterator over the names of each name-value pair.
+ */
+ keys(): IterableIterator<string>;
+ /**
+ * Sets the value in the `MIMEParams` object associated with `name` to `value`.
+ * If there are any pre-existing name-value pairs whose names are `name`,
+ * set the first such pair's value to `value`.
+ */
+ set(name: string, value: string): void;
+ /**
+ * Returns an iterator over the values of each name-value pair.
+ */
+ values(): IterableIterator<string>;
+ /**
+ * Returns an iterator over each of the name-value pairs in the parameters.
+ */
+ [Symbol.iterator]: typeof MIMEParams.prototype.entries;
+ }
+}
+declare module "util/types" {
+ export * from "util/types";
+}
+declare module "util/types" {
+ import { KeyObject, webcrypto } from "node:crypto";
+ /**
+ * Returns `true` if the value is a built-in [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) or
+ * [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instance.
+ *
+ * See also `util.types.isArrayBuffer()` and `util.types.isSharedArrayBuffer()`.
+ *
+ * ```js
+ * util.types.isAnyArrayBuffer(new ArrayBuffer()); // Returns true
+ * util.types.isAnyArrayBuffer(new SharedArrayBuffer()); // Returns true
+ * ```
+ * @since v10.0.0
+ */
+ function isAnyArrayBuffer(object: unknown): object is ArrayBufferLike;
+ /**
+ * Returns `true` if the value is an `arguments` object.
+ *
+ * ```js
+ * function foo() {
+ * util.types.isArgumentsObject(arguments); // Returns true
+ * }
+ * ```
+ * @since v10.0.0
+ */
+ function isArgumentsObject(object: unknown): object is IArguments;
+ /**
+ * Returns `true` if the value is a built-in [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) instance.
+ * This does _not_ include [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instances. Usually, it is
+ * desirable to test for both; See `util.types.isAnyArrayBuffer()` for that.
+ *
+ * ```js
+ * util.types.isArrayBuffer(new ArrayBuffer()); // Returns true
+ * util.types.isArrayBuffer(new SharedArrayBuffer()); // Returns false
+ * ```
+ * @since v10.0.0
+ */
+ function isArrayBuffer(object: unknown): object is ArrayBuffer;
+ /**
+ * Returns `true` if the value is an instance of one of the [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) views, such as typed
+ * array objects or [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView). Equivalent to
+ * [`ArrayBuffer.isView()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView).
+ *
+ * ```js
+ * util.types.isArrayBufferView(new Int8Array()); // true
+ * util.types.isArrayBufferView(Buffer.from('hello world')); // true
+ * util.types.isArrayBufferView(new DataView(new ArrayBuffer(16))); // true
+ * util.types.isArrayBufferView(new ArrayBuffer()); // false
+ * ```
+ * @since v10.0.0
+ */
+ function isArrayBufferView(object: unknown): object is NodeJS.ArrayBufferView;
+ /**
+ * Returns `true` if the value is an [async function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function).
+ * This only reports back what the JavaScript engine is seeing;
+ * in particular, the return value may not match the original source code if
+ * a transpilation tool was used.
+ *
+ * ```js
+ * util.types.isAsyncFunction(function foo() {}); // Returns false
+ * util.types.isAsyncFunction(async function foo() {}); // Returns true
+ * ```
+ * @since v10.0.0
+ */
+ function isAsyncFunction(object: unknown): boolean;
+ /**
+ * Returns `true` if the value is a `BigInt64Array` instance.
+ *
+ * ```js
+ * util.types.isBigInt64Array(new BigInt64Array()); // Returns true
+ * util.types.isBigInt64Array(new BigUint64Array()); // Returns false
+ * ```
+ * @since v10.0.0
+ */
+ function isBigInt64Array(value: unknown): value is BigInt64Array;
+ /**
+ * Returns `true` if the value is a `BigUint64Array` instance.
+ *
+ * ```js
+ * util.types.isBigUint64Array(new BigInt64Array()); // Returns false
+ * util.types.isBigUint64Array(new BigUint64Array()); // Returns true
+ * ```
+ * @since v10.0.0
+ */
+ function isBigUint64Array(value: unknown): value is BigUint64Array;
+ /**
+ * Returns `true` if the value is a boolean object, e.g. created
+ * by `new Boolean()`.
+ *
+ * ```js
+ * util.types.isBooleanObject(false); // Returns false
+ * util.types.isBooleanObject(true); // Returns false
+ * util.types.isBooleanObject(new Boolean(false)); // Returns true
+ * util.types.isBooleanObject(new Boolean(true)); // Returns true
+ * util.types.isBooleanObject(Boolean(false)); // Returns false
+ * util.types.isBooleanObject(Boolean(true)); // Returns false
+ * ```
+ * @since v10.0.0
+ */
+ function isBooleanObject(object: unknown): object is Boolean;
+ /**
+ * Returns `true` if the value is any boxed primitive object, e.g. created
+ * by `new Boolean()`, `new String()` or `Object(Symbol())`.
+ *
+ * For example:
+ *
+ * ```js
+ * util.types.isBoxedPrimitive(false); // Returns false
+ * util.types.isBoxedPrimitive(new Boolean(false)); // Returns true
+ * util.types.isBoxedPrimitive(Symbol('foo')); // Returns false
+ * util.types.isBoxedPrimitive(Object(Symbol('foo'))); // Returns true
+ * util.types.isBoxedPrimitive(Object(BigInt(5))); // Returns true
+ * ```
+ * @since v10.11.0
+ */
+ function isBoxedPrimitive(object: unknown): object is String | Number | BigInt | Boolean | Symbol;
+ /**
+ * Returns `true` if the value is a built-in [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView) instance.
+ *
+ * ```js
+ * const ab = new ArrayBuffer(20);
+ * util.types.isDataView(new DataView(ab)); // Returns true
+ * util.types.isDataView(new Float64Array()); // Returns false
+ * ```
+ *
+ * See also [`ArrayBuffer.isView()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView).
+ * @since v10.0.0
+ */
+ function isDataView(object: unknown): object is DataView;
+ /**
+ * Returns `true` if the value is a built-in [`Date`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) instance.
+ *
+ * ```js
+ * util.types.isDate(new Date()); // Returns true
+ * ```
+ * @since v10.0.0
+ */
+ function isDate(object: unknown): object is Date;
+ /**
+ * Returns `true` if the value is a native `External` value.
+ *
+ * A native `External` value is a special type of object that contains a
+ * raw C++ pointer (`void*`) for access from native code, and has no other
+ * properties. Such objects are created either by Node.js internals or native
+ * addons. In JavaScript, they are [frozen](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze) objects with a`null` prototype.
+ *
+ * ```c
+ * #include <js_native_api.h>
+ * #include <stdlib.h>
+ * napi_value result;
+ * static napi_value MyNapi(napi_env env, napi_callback_info info) {
+ * int* raw = (int*) malloc(1024);
+ * napi_status status = napi_create_external(env, (void*) raw, NULL, NULL, &#x26;result);
+ * if (status != napi_ok) {
+ * napi_throw_error(env, NULL, "napi_create_external failed");
+ * return NULL;
+ * }
+ * return result;
+ * }
+ * ...
+ * DECLARE_NAPI_PROPERTY("myNapi", MyNapi)
+ * ...
+ * ```
+ *
+ * ```js
+ * const native = require('napi_addon.node');
+ * const data = native.myNapi();
+ * util.types.isExternal(data); // returns true
+ * util.types.isExternal(0); // returns false
+ * util.types.isExternal(new String('foo')); // returns false
+ * ```
+ *
+ * For further information on `napi_create_external`, refer to `napi_create_external()`.
+ * @since v10.0.0
+ */
+ function isExternal(object: unknown): boolean;
+ /**
+ * Returns `true` if the value is a built-in [`Float32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array) instance.
+ *
+ * ```js
+ * util.types.isFloat32Array(new ArrayBuffer()); // Returns false
+ * util.types.isFloat32Array(new Float32Array()); // Returns true
+ * util.types.isFloat32Array(new Float64Array()); // Returns false
+ * ```
+ * @since v10.0.0
+ */
+ function isFloat32Array(object: unknown): object is Float32Array;
+ /**
+ * Returns `true` if the value is a built-in [`Float64Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array) instance.
+ *
+ * ```js
+ * util.types.isFloat64Array(new ArrayBuffer()); // Returns false
+ * util.types.isFloat64Array(new Uint8Array()); // Returns false
+ * util.types.isFloat64Array(new Float64Array()); // Returns true
+ * ```
+ * @since v10.0.0
+ */
+ function isFloat64Array(object: unknown): object is Float64Array;
+ /**
+ * Returns `true` if the value is a generator function.
+ * This only reports back what the JavaScript engine is seeing;
+ * in particular, the return value may not match the original source code if
+ * a transpilation tool was used.
+ *
+ * ```js
+ * util.types.isGeneratorFunction(function foo() {}); // Returns false
+ * util.types.isGeneratorFunction(function* foo() {}); // Returns true
+ * ```
+ * @since v10.0.0
+ */
+ function isGeneratorFunction(object: unknown): object is GeneratorFunction;
+ /**
+ * Returns `true` if the value is a generator object as returned from a
+ * built-in generator function.
+ * This only reports back what the JavaScript engine is seeing;
+ * in particular, the return value may not match the original source code if
+ * a transpilation tool was used.
+ *
+ * ```js
+ * function* foo() {}
+ * const generator = foo();
+ * util.types.isGeneratorObject(generator); // Returns true
+ * ```
+ * @since v10.0.0
+ */
+ function isGeneratorObject(object: unknown): object is Generator;
+ /**
+ * Returns `true` if the value is a built-in [`Int8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array) instance.
+ *
+ * ```js
+ * util.types.isInt8Array(new ArrayBuffer()); // Returns false
+ * util.types.isInt8Array(new Int8Array()); // Returns true
+ * util.types.isInt8Array(new Float64Array()); // Returns false
+ * ```
+ * @since v10.0.0
+ */
+ function isInt8Array(object: unknown): object is Int8Array;
+ /**
+ * Returns `true` if the value is a built-in [`Int16Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array) instance.
+ *
+ * ```js
+ * util.types.isInt16Array(new ArrayBuffer()); // Returns false
+ * util.types.isInt16Array(new Int16Array()); // Returns true
+ * util.types.isInt16Array(new Float64Array()); // Returns false
+ * ```
+ * @since v10.0.0
+ */
+ function isInt16Array(object: unknown): object is Int16Array;
+ /**
+ * Returns `true` if the value is a built-in [`Int32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array) instance.
+ *
+ * ```js
+ * util.types.isInt32Array(new ArrayBuffer()); // Returns false
+ * util.types.isInt32Array(new Int32Array()); // Returns true
+ * util.types.isInt32Array(new Float64Array()); // Returns false
+ * ```
+ * @since v10.0.0
+ */
+ function isInt32Array(object: unknown): object is Int32Array;
+ /**
+ * Returns `true` if the value is a built-in [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) instance.
+ *
+ * ```js
+ * util.types.isMap(new Map()); // Returns true
+ * ```
+ * @since v10.0.0
+ */
+ function isMap<T>(
+ object: T | {},
+ ): object is T extends ReadonlyMap<any, any> ? (unknown extends T ? never : ReadonlyMap<any, any>)
+ : Map<unknown, unknown>;
+ /**
+ * Returns `true` if the value is an iterator returned for a built-in [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) instance.
+ *
+ * ```js
+ * const map = new Map();
+ * util.types.isMapIterator(map.keys()); // Returns true
+ * util.types.isMapIterator(map.values()); // Returns true
+ * util.types.isMapIterator(map.entries()); // Returns true
+ * util.types.isMapIterator(map[Symbol.iterator]()); // Returns true
+ * ```
+ * @since v10.0.0
+ */
+ function isMapIterator(object: unknown): boolean;
+ /**
+ * Returns `true` if the value is an instance of a [Module Namespace Object](https://tc39.github.io/ecma262/#sec-module-namespace-exotic-objects).
+ *
+ * ```js
+ * import * as ns from './a.js';
+ *
+ * util.types.isModuleNamespaceObject(ns); // Returns true
+ * ```
+ * @since v10.0.0
+ */
+ function isModuleNamespaceObject(value: unknown): boolean;
+ /**
+ * Returns `true` if the value is an instance of a built-in `Error` type.
+ *
+ * ```js
+ * util.types.isNativeError(new Error()); // Returns true
+ * util.types.isNativeError(new TypeError()); // Returns true
+ * util.types.isNativeError(new RangeError()); // Returns true
+ * ```
+ * @since v10.0.0
+ */
+ function isNativeError(object: unknown): object is Error;
+ /**
+ * Returns `true` if the value is a number object, e.g. created
+ * by `new Number()`.
+ *
+ * ```js
+ * util.types.isNumberObject(0); // Returns false
+ * util.types.isNumberObject(new Number(0)); // Returns true
+ * ```
+ * @since v10.0.0
+ */
+ function isNumberObject(object: unknown): object is Number;
+ /**
+ * Returns `true` if the value is a built-in [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).
+ *
+ * ```js
+ * util.types.isPromise(Promise.resolve(42)); // Returns true
+ * ```
+ * @since v10.0.0
+ */
+ function isPromise(object: unknown): object is Promise<unknown>;
+ /**
+ * Returns `true` if the value is a [`Proxy`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy) instance.
+ *
+ * ```js
+ * const target = {};
+ * const proxy = new Proxy(target, {});
+ * util.types.isProxy(target); // Returns false
+ * util.types.isProxy(proxy); // Returns true
+ * ```
+ * @since v10.0.0
+ */
+ function isProxy(object: unknown): boolean;
+ /**
+ * Returns `true` if the value is a regular expression object.
+ *
+ * ```js
+ * util.types.isRegExp(/abc/); // Returns true
+ * util.types.isRegExp(new RegExp('abc')); // Returns true
+ * ```
+ * @since v10.0.0
+ */
+ function isRegExp(object: unknown): object is RegExp;
+ /**
+ * Returns `true` if the value is a built-in [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) instance.
+ *
+ * ```js
+ * util.types.isSet(new Set()); // Returns true
+ * ```
+ * @since v10.0.0
+ */
+ function isSet<T>(
+ object: T | {},
+ ): object is T extends ReadonlySet<any> ? (unknown extends T ? never : ReadonlySet<any>) : Set<unknown>;
+ /**
+ * Returns `true` if the value is an iterator returned for a built-in [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) instance.
+ *
+ * ```js
+ * const set = new Set();
+ * util.types.isSetIterator(set.keys()); // Returns true
+ * util.types.isSetIterator(set.values()); // Returns true
+ * util.types.isSetIterator(set.entries()); // Returns true
+ * util.types.isSetIterator(set[Symbol.iterator]()); // Returns true
+ * ```
+ * @since v10.0.0
+ */
+ function isSetIterator(object: unknown): boolean;
+ /**
+ * Returns `true` if the value is a built-in [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instance.
+ * This does _not_ include [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) instances. Usually, it is
+ * desirable to test for both; See `util.types.isAnyArrayBuffer()` for that.
+ *
+ * ```js
+ * util.types.isSharedArrayBuffer(new ArrayBuffer()); // Returns false
+ * util.types.isSharedArrayBuffer(new SharedArrayBuffer()); // Returns true
+ * ```
+ * @since v10.0.0
+ */
+ function isSharedArrayBuffer(object: unknown): object is SharedArrayBuffer;
+ /**
+ * Returns `true` if the value is a string object, e.g. created
+ * by `new String()`.
+ *
+ * ```js
+ * util.types.isStringObject('foo'); // Returns false
+ * util.types.isStringObject(new String('foo')); // Returns true
+ * ```
+ * @since v10.0.0
+ */
+ function isStringObject(object: unknown): object is String;
+ /**
+ * Returns `true` if the value is a symbol object, created
+ * by calling `Object()` on a `Symbol` primitive.
+ *
+ * ```js
+ * const symbol = Symbol('foo');
+ * util.types.isSymbolObject(symbol); // Returns false
+ * util.types.isSymbolObject(Object(symbol)); // Returns true
+ * ```
+ * @since v10.0.0
+ */
+ function isSymbolObject(object: unknown): object is Symbol;
+ /**
+ * Returns `true` if the value is a built-in [`TypedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) instance.
+ *
+ * ```js
+ * util.types.isTypedArray(new ArrayBuffer()); // Returns false
+ * util.types.isTypedArray(new Uint8Array()); // Returns true
+ * util.types.isTypedArray(new Float64Array()); // Returns true
+ * ```
+ *
+ * See also [`ArrayBuffer.isView()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView).
+ * @since v10.0.0
+ */
+ function isTypedArray(object: unknown): object is NodeJS.TypedArray;
+ /**
+ * Returns `true` if the value is a built-in [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) instance.
+ *
+ * ```js
+ * util.types.isUint8Array(new ArrayBuffer()); // Returns false
+ * util.types.isUint8Array(new Uint8Array()); // Returns true
+ * util.types.isUint8Array(new Float64Array()); // Returns false
+ * ```
+ * @since v10.0.0
+ */
+ function isUint8Array(object: unknown): object is Uint8Array;
+ /**
+ * Returns `true` if the value is a built-in [`Uint8ClampedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray) instance.
+ *
+ * ```js
+ * util.types.isUint8ClampedArray(new ArrayBuffer()); // Returns false
+ * util.types.isUint8ClampedArray(new Uint8ClampedArray()); // Returns true
+ * util.types.isUint8ClampedArray(new Float64Array()); // Returns false
+ * ```
+ * @since v10.0.0
+ */
+ function isUint8ClampedArray(object: unknown): object is Uint8ClampedArray;
+ /**
+ * Returns `true` if the value is a built-in [`Uint16Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array) instance.
+ *
+ * ```js
+ * util.types.isUint16Array(new ArrayBuffer()); // Returns false
+ * util.types.isUint16Array(new Uint16Array()); // Returns true
+ * util.types.isUint16Array(new Float64Array()); // Returns false
+ * ```
+ * @since v10.0.0
+ */
+ function isUint16Array(object: unknown): object is Uint16Array;
+ /**
+ * Returns `true` if the value is a built-in [`Uint32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array) instance.
+ *
+ * ```js
+ * util.types.isUint32Array(new ArrayBuffer()); // Returns false
+ * util.types.isUint32Array(new Uint32Array()); // Returns true
+ * util.types.isUint32Array(new Float64Array()); // Returns false
+ * ```
+ * @since v10.0.0
+ */
+ function isUint32Array(object: unknown): object is Uint32Array;
+ /**
+ * Returns `true` if the value is a built-in [`WeakMap`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap) instance.
+ *
+ * ```js
+ * util.types.isWeakMap(new WeakMap()); // Returns true
+ * ```
+ * @since v10.0.0
+ */
+ function isWeakMap(object: unknown): object is WeakMap<object, unknown>;
+ /**
+ * Returns `true` if the value is a built-in [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) instance.
+ *
+ * ```js
+ * util.types.isWeakSet(new WeakSet()); // Returns true
+ * ```
+ * @since v10.0.0
+ */
+ function isWeakSet(object: unknown): object is WeakSet<object>;
+ /**
+ * Returns `true` if `value` is a `KeyObject`, `false` otherwise.
+ * @since v16.2.0
+ */
+ function isKeyObject(object: unknown): object is KeyObject;
+ /**
+ * Returns `true` if `value` is a `CryptoKey`, `false` otherwise.
+ * @since v16.2.0
+ */
+ function isCryptoKey(object: unknown): object is webcrypto.CryptoKey;
+}
+declare module "node:util" {
+ export * from "util";
+}
+declare module "node:util/types" {
+ export * from "util/types";
+}
diff --git a/client/node_modules/@types/node/v8.d.ts b/client/node_modules/@types/node/v8.d.ts
new file mode 100644
index 0000000..b22d7fb
--- /dev/null
+++ b/client/node_modules/@types/node/v8.d.ts
@@ -0,0 +1,541 @@
+/**
+ * The `v8` module exposes APIs that are specific to the version of [V8](https://developers.google.com/v8/) built into the Node.js binary. It can be accessed using:
+ *
+ * ```js
+ * const v8 = require('v8');
+ * ```
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/v8.js)
+ */
+declare module "v8" {
+ import { Readable } from "node:stream";
+ interface HeapSpaceInfo {
+ space_name: string;
+ space_size: number;
+ space_used_size: number;
+ space_available_size: number;
+ physical_space_size: number;
+ }
+ // ** Signifies if the --zap_code_space option is enabled or not. 1 == enabled, 0 == disabled. */
+ type DoesZapCodeSpaceFlag = 0 | 1;
+ interface HeapInfo {
+ total_heap_size: number;
+ total_heap_size_executable: number;
+ total_physical_size: number;
+ total_available_size: number;
+ used_heap_size: number;
+ heap_size_limit: number;
+ malloced_memory: number;
+ peak_malloced_memory: number;
+ does_zap_garbage: DoesZapCodeSpaceFlag;
+ number_of_native_contexts: number;
+ number_of_detached_contexts: number;
+ }
+ interface HeapCodeStatistics {
+ code_and_metadata_size: number;
+ bytecode_and_metadata_size: number;
+ external_script_source_size: number;
+ }
+ /**
+ * Returns an integer representing a version tag derived from the V8 version,
+ * command-line flags, and detected CPU features. This is useful for determining
+ * whether a `vm.Script` `cachedData` buffer is compatible with this instance
+ * of V8.
+ *
+ * ```js
+ * console.log(v8.cachedDataVersionTag()); // 3947234607
+ * // The value returned by v8.cachedDataVersionTag() is derived from the V8
+ * // version, command-line flags, and detected CPU features. Test that the value
+ * // does indeed update when flags are toggled.
+ * v8.setFlagsFromString('--allow_natives_syntax');
+ * console.log(v8.cachedDataVersionTag()); // 183726201
+ * ```
+ * @since v8.0.0
+ */
+ function cachedDataVersionTag(): number;
+ /**
+ * Returns an object with the following properties:
+ *
+ * `does_zap_garbage` is a 0/1 boolean, which signifies whether the`--zap_code_space` option is enabled or not. This makes V8 overwrite heap
+ * garbage with a bit pattern. The RSS footprint (resident set size) gets bigger
+ * because it continuously touches all heap pages and that makes them less likely
+ * to get swapped out by the operating system.
+ *
+ * `number_of_native_contexts` The value of native\_context is the number of the
+ * top-level contexts currently active. Increase of this number over time indicates
+ * a memory leak.
+ *
+ * `number_of_detached_contexts` The value of detached\_context is the number
+ * of contexts that were detached and not yet garbage collected. This number
+ * being non-zero indicates a potential memory leak.
+ *
+ * ```js
+ * {
+ * total_heap_size: 7326976,
+ * total_heap_size_executable: 4194304,
+ * total_physical_size: 7326976,
+ * total_available_size: 1152656,
+ * used_heap_size: 3476208,
+ * heap_size_limit: 1535115264,
+ * malloced_memory: 16384,
+ * peak_malloced_memory: 1127496,
+ * does_zap_garbage: 0,
+ * number_of_native_contexts: 1,
+ * number_of_detached_contexts: 0
+ * }
+ * ```
+ * @since v1.0.0
+ */
+ function getHeapStatistics(): HeapInfo;
+ /**
+ * Returns statistics about the V8 heap spaces, i.e. the segments which make up
+ * the V8 heap. Neither the ordering of heap spaces, nor the availability of a
+ * heap space can be guaranteed as the statistics are provided via the
+ * V8[`GetHeapSpaceStatistics`](https://v8docs.nodesource.com/node-13.2/d5/dda/classv8_1_1_isolate.html#ac673576f24fdc7a33378f8f57e1d13a4) function and may change from one V8 version to the
+ * next.
+ *
+ * The value returned is an array of objects containing the following properties:
+ *
+ * ```json
+ * [
+ * {
+ * "space_name": "new_space",
+ * "space_size": 2063872,
+ * "space_used_size": 951112,
+ * "space_available_size": 80824,
+ * "physical_space_size": 2063872
+ * },
+ * {
+ * "space_name": "old_space",
+ * "space_size": 3090560,
+ * "space_used_size": 2493792,
+ * "space_available_size": 0,
+ * "physical_space_size": 3090560
+ * },
+ * {
+ * "space_name": "code_space",
+ * "space_size": 1260160,
+ * "space_used_size": 644256,
+ * "space_available_size": 960,
+ * "physical_space_size": 1260160
+ * },
+ * {
+ * "space_name": "map_space",
+ * "space_size": 1094160,
+ * "space_used_size": 201608,
+ * "space_available_size": 0,
+ * "physical_space_size": 1094160
+ * },
+ * {
+ * "space_name": "large_object_space",
+ * "space_size": 0,
+ * "space_used_size": 0,
+ * "space_available_size": 1490980608,
+ * "physical_space_size": 0
+ * }
+ * ]
+ * ```
+ * @since v6.0.0
+ */
+ function getHeapSpaceStatistics(): HeapSpaceInfo[];
+ /**
+ * The `v8.setFlagsFromString()` method can be used to programmatically set
+ * V8 command-line flags. This method should be used with care. Changing settings
+ * after the VM has started may result in unpredictable behavior, including
+ * crashes and data loss; or it may simply do nothing.
+ *
+ * The V8 options available for a version of Node.js may be determined by running`node --v8-options`.
+ *
+ * Usage:
+ *
+ * ```js
+ * // Print GC events to stdout for one minute.
+ * const v8 = require('v8');
+ * v8.setFlagsFromString('--trace_gc');
+ * setTimeout(() => { v8.setFlagsFromString('--notrace_gc'); }, 60e3);
+ * ```
+ * @since v1.0.0
+ */
+ function setFlagsFromString(flags: string): void;
+ /**
+ * Generates a snapshot of the current V8 heap and returns a Readable
+ * Stream that may be used to read the JSON serialized representation.
+ * This JSON stream format is intended to be used with tools such as
+ * Chrome DevTools. The JSON schema is undocumented and specific to the
+ * V8 engine. Therefore, the schema may change from one version of V8 to the next.
+ *
+ * Creating a heap snapshot requires memory about twice the size of the heap at
+ * the time the snapshot is created. This results in the risk of OOM killers
+ * terminating the process.
+ *
+ * Generating a snapshot is a synchronous operation which blocks the event loop
+ * for a duration depending on the heap size.
+ *
+ * ```js
+ * // Print heap snapshot to the console
+ * const v8 = require('v8');
+ * const stream = v8.getHeapSnapshot();
+ * stream.pipe(process.stdout);
+ * ```
+ * @since v11.13.0
+ * @return A Readable Stream containing the V8 heap snapshot
+ */
+ function getHeapSnapshot(): Readable;
+ /**
+ * Generates a snapshot of the current V8 heap and writes it to a JSON
+ * file. This file is intended to be used with tools such as Chrome
+ * DevTools. The JSON schema is undocumented and specific to the V8
+ * engine, and may change from one version of V8 to the next.
+ *
+ * A heap snapshot is specific to a single V8 isolate. When using `worker threads`, a heap snapshot generated from the main thread will
+ * not contain any information about the workers, and vice versa.
+ *
+ * Creating a heap snapshot requires memory about twice the size of the heap at
+ * the time the snapshot is created. This results in the risk of OOM killers
+ * terminating the process.
+ *
+ * Generating a snapshot is a synchronous operation which blocks the event loop
+ * for a duration depending on the heap size.
+ *
+ * ```js
+ * const { writeHeapSnapshot } = require('v8');
+ * const {
+ * Worker,
+ * isMainThread,
+ * parentPort
+ * } = require('worker_threads');
+ *
+ * if (isMainThread) {
+ * const worker = new Worker(__filename);
+ *
+ * worker.once('message', (filename) => {
+ * console.log(`worker heapdump: ${filename}`);
+ * // Now get a heapdump for the main thread.
+ * console.log(`main thread heapdump: ${writeHeapSnapshot()}`);
+ * });
+ *
+ * // Tell the worker to create a heapdump.
+ * worker.postMessage('heapdump');
+ * } else {
+ * parentPort.once('message', (message) => {
+ * if (message === 'heapdump') {
+ * // Generate a heapdump for the worker
+ * // and return the filename to the parent.
+ * parentPort.postMessage(writeHeapSnapshot());
+ * }
+ * });
+ * }
+ * ```
+ * @since v11.13.0
+ * @param filename The file path where the V8 heap snapshot is to be saved. If not specified, a file name with the pattern `'Heap-${yyyymmdd}-${hhmmss}-${pid}-${thread_id}.heapsnapshot'` will be
+ * generated, where `{pid}` will be the PID of the Node.js process, `{thread_id}` will be `0` when `writeHeapSnapshot()` is called from the main Node.js thread or the id of a
+ * worker thread.
+ * @return The filename where the snapshot was saved.
+ */
+ function writeHeapSnapshot(filename?: string): string;
+ /**
+ * Returns an object with the following properties:
+ *
+ * ```js
+ * {
+ * code_and_metadata_size: 212208,
+ * bytecode_and_metadata_size: 161368,
+ * external_script_source_size: 1410794
+ * }
+ * ```
+ * @since v12.8.0
+ */
+ function getHeapCodeStatistics(): HeapCodeStatistics;
+ /**
+ * @since v8.0.0
+ */
+ class Serializer {
+ /**
+ * Writes out a header, which includes the serialization format version.
+ */
+ writeHeader(): void;
+ /**
+ * Serializes a JavaScript value and adds the serialized representation to the
+ * internal buffer.
+ *
+ * This throws an error if `value` cannot be serialized.
+ */
+ writeValue(val: any): boolean;
+ /**
+ * Returns the stored internal buffer. This serializer should not be used once
+ * the buffer is released. Calling this method results in undefined behavior
+ * if a previous write has failed.
+ */
+ releaseBuffer(): Buffer;
+ /**
+ * Marks an `ArrayBuffer` as having its contents transferred out of band.
+ * Pass the corresponding `ArrayBuffer` in the deserializing context to `deserializer.transferArrayBuffer()`.
+ * @param id A 32-bit unsigned integer.
+ * @param arrayBuffer An `ArrayBuffer` instance.
+ */
+ transferArrayBuffer(id: number, arrayBuffer: ArrayBuffer): void;
+ /**
+ * Write a raw 32-bit unsigned integer.
+ * For use inside of a custom `serializer._writeHostObject()`.
+ */
+ writeUint32(value: number): void;
+ /**
+ * Write a raw 64-bit unsigned integer, split into high and low 32-bit parts.
+ * For use inside of a custom `serializer._writeHostObject()`.
+ */
+ writeUint64(hi: number, lo: number): void;
+ /**
+ * Write a JS `number` value.
+ * For use inside of a custom `serializer._writeHostObject()`.
+ */
+ writeDouble(value: number): void;
+ /**
+ * Write raw bytes into the serializer’s internal buffer. The deserializer
+ * will require a way to compute the length of the buffer.
+ * For use inside of a custom `serializer._writeHostObject()`.
+ */
+ writeRawBytes(buffer: NodeJS.TypedArray): void;
+ }
+ /**
+ * A subclass of `Serializer` that serializes `TypedArray`(in particular `Buffer`) and `DataView` objects as host objects, and only
+ * stores the part of their underlying `ArrayBuffer`s that they are referring to.
+ * @since v8.0.0
+ */
+ class DefaultSerializer extends Serializer {}
+ /**
+ * @since v8.0.0
+ */
+ class Deserializer {
+ constructor(data: NodeJS.TypedArray);
+ /**
+ * Reads and validates a header (including the format version).
+ * May, for example, reject an invalid or unsupported wire format. In that case,
+ * an `Error` is thrown.
+ */
+ readHeader(): boolean;
+ /**
+ * Deserializes a JavaScript value from the buffer and returns it.
+ */
+ readValue(): any;
+ /**
+ * Marks an `ArrayBuffer` as having its contents transferred out of band.
+ * Pass the corresponding `ArrayBuffer` in the serializing context to `serializer.transferArrayBuffer()` (or return the `id` from `serializer._getSharedArrayBufferId()` in the case of
+ * `SharedArrayBuffer`s).
+ * @param id A 32-bit unsigned integer.
+ * @param arrayBuffer An `ArrayBuffer` instance.
+ */
+ transferArrayBuffer(id: number, arrayBuffer: ArrayBuffer): void;
+ /**
+ * Reads the underlying wire format version. Likely mostly to be useful to
+ * legacy code reading old wire format versions. May not be called before`.readHeader()`.
+ */
+ getWireFormatVersion(): number;
+ /**
+ * Read a raw 32-bit unsigned integer and return it.
+ * For use inside of a custom `deserializer._readHostObject()`.
+ */
+ readUint32(): number;
+ /**
+ * Read a raw 64-bit unsigned integer and return it as an array `[hi, lo]`with two 32-bit unsigned integer entries.
+ * For use inside of a custom `deserializer._readHostObject()`.
+ */
+ readUint64(): [number, number];
+ /**
+ * Read a JS `number` value.
+ * For use inside of a custom `deserializer._readHostObject()`.
+ */
+ readDouble(): number;
+ /**
+ * Read raw bytes from the deserializer’s internal buffer. The `length` parameter
+ * must correspond to the length of the buffer that was passed to `serializer.writeRawBytes()`.
+ * For use inside of a custom `deserializer._readHostObject()`.
+ */
+ readRawBytes(length: number): Buffer;
+ }
+ /**
+ * A subclass of `Deserializer` corresponding to the format written by `DefaultSerializer`.
+ * @since v8.0.0
+ */
+ class DefaultDeserializer extends Deserializer {}
+ /**
+ * Uses a `DefaultSerializer` to serialize `value` into a buffer.
+ *
+ * `ERR_BUFFER_TOO_LARGE` will be thrown when trying to
+ * serialize a huge object which requires buffer
+ * larger than `buffer.constants.MAX_LENGTH`.
+ * @since v8.0.0
+ */
+ function serialize(value: any): Buffer;
+ /**
+ * Uses a `DefaultDeserializer` with default options to read a JS value
+ * from a buffer.
+ * @since v8.0.0
+ * @param buffer A buffer returned by {@link serialize}.
+ */
+ function deserialize(buffer: NodeJS.TypedArray): any;
+ /**
+ * The `v8.takeCoverage()` method allows the user to write the coverage started by `NODE_V8_COVERAGE` to disk on demand. This method can be invoked multiple
+ * times during the lifetime of the process. Each time the execution counter will
+ * be reset and a new coverage report will be written to the directory specified
+ * by `NODE_V8_COVERAGE`.
+ *
+ * When the process is about to exit, one last coverage will still be written to
+ * disk unless {@link stopCoverage} is invoked before the process exits.
+ * @since v15.1.0, v14.18.0, v12.22.0
+ */
+ function takeCoverage(): void;
+ /**
+ * The `v8.stopCoverage()` method allows the user to stop the coverage collection
+ * started by `NODE_V8_COVERAGE`, so that V8 can release the execution count
+ * records and optimize code. This can be used in conjunction with {@link takeCoverage} if the user wants to collect the coverage on demand.
+ * @since v15.1.0, v14.18.0, v12.22.0
+ */
+ function stopCoverage(): void;
+
+ /**
+ * This API collects GC data in current thread.
+ */
+ class GCProfiler {
+ /**
+ * Start collecting GC data.
+ */
+ start(): void;
+ /**
+ * Stop collecting GC data and return a object.
+ */
+ stop(): GCProfilerResult;
+ }
+ interface GCProfilerResult {
+ version: number;
+ startTime: number;
+ endTime: number;
+ statistics: Array<{
+ gcType: string;
+ cost: number;
+ beforeGC: {
+ heapStatistics: HeapStatistics;
+ heapSpaceStatistics: HeapSpaceStatistics[];
+ };
+ afterGC: {
+ heapStatistics: HeapStatistics;
+ heapSpaceStatistics: HeapSpaceStatistics[];
+ };
+ }>;
+ }
+ interface HeapStatistics {
+ totalHeapSize: number;
+ totalHeapSizeExecutable: number;
+ totalPhysicalSize: number;
+ totalAvailableSize: number;
+ totalGlobalHandlesSize: number;
+ usedGlobalHandlesSize: number;
+ usedHeapSize: number;
+ heapSizeLimit: number;
+ mallocedMemory: number;
+ externalMemory: number;
+ peakMallocedMemory: number;
+ }
+ interface HeapSpaceStatistics {
+ spaceName: string;
+ spaceSize: number;
+ spaceUsedSize: number;
+ spaceAvailableSize: number;
+ physicalSpaceSize: number;
+ }
+ /**
+ * Called when a promise is constructed. This does not mean that corresponding before/after events will occur, only that the possibility exists. This will
+ * happen if a promise is created without ever getting a continuation.
+ * @since v17.1.0, v16.14.0
+ * @param promise The promise being created.
+ * @param parent The promise continued from, if applicable.
+ */
+ interface Init {
+ (promise: Promise<unknown>, parent: Promise<unknown>): void;
+ }
+ /**
+ * Called before a promise continuation executes. This can be in the form of `then()`, `catch()`, or `finally()` handlers or an await resuming.
+ *
+ * The before callback will be called 0 to N times. The before callback will typically be called 0 times if no continuation was ever made for the promise.
+ * The before callback may be called many times in the case where many continuations have been made from the same promise.
+ * @since v17.1.0, v16.14.0
+ */
+ interface Before {
+ (promise: Promise<unknown>): void;
+ }
+ /**
+ * Called immediately after a promise continuation executes. This may be after a `then()`, `catch()`, or `finally()` handler or before an await after another await.
+ * @since v17.1.0, v16.14.0
+ */
+ interface After {
+ (promise: Promise<unknown>): void;
+ }
+ /**
+ * Called when the promise receives a resolution or rejection value. This may occur synchronously in the case of {@link Promise.resolve()} or
+ * {@link Promise.reject()}.
+ * @since v17.1.0, v16.14.0
+ */
+ interface Settled {
+ (promise: Promise<unknown>): void;
+ }
+ /**
+ * Key events in the lifetime of a promise have been categorized into four areas: creation of a promise, before/after a continuation handler is called or
+ * around an await, and when the promise resolves or rejects.
+ *
+ * Because promises are asynchronous resources whose lifecycle is tracked via the promise hooks mechanism, the `init()`, `before()`, `after()`, and
+ * `settled()` callbacks must not be async functions as they create more promises which would produce an infinite loop.
+ * @since v17.1.0, v16.14.0
+ */
+ interface HookCallbacks {
+ init?: Init;
+ before?: Before;
+ after?: After;
+ settled?: Settled;
+ }
+ interface PromiseHooks {
+ /**
+ * The `init` hook must be a plain function. Providing an async function will throw as it would produce an infinite microtask loop.
+ * @since v17.1.0, v16.14.0
+ * @param init The {@link Init | `init` callback} to call when a promise is created.
+ * @return Call to stop the hook.
+ */
+ onInit: (init: Init) => Function;
+ /**
+ * The `settled` hook must be a plain function. Providing an async function will throw as it would produce an infinite microtask loop.
+ * @since v17.1.0, v16.14.0
+ * @param settled The {@link Settled | `settled` callback} to call when a promise is created.
+ * @return Call to stop the hook.
+ */
+ onSettled: (settled: Settled) => Function;
+ /**
+ * The `before` hook must be a plain function. Providing an async function will throw as it would produce an infinite microtask loop.
+ * @since v17.1.0, v16.14.0
+ * @param before The {@link Before | `before` callback} to call before a promise continuation executes.
+ * @return Call to stop the hook.
+ */
+ onBefore: (before: Before) => Function;
+ /**
+ * The `after` hook must be a plain function. Providing an async function will throw as it would produce an infinite microtask loop.
+ * @since v17.1.0, v16.14.0
+ * @param after The {@link After | `after` callback} to call after a promise continuation executes.
+ * @return Call to stop the hook.
+ */
+ onAfter: (after: After) => Function;
+ /**
+ * Registers functions to be called for different lifetime events of each promise.
+ * The callbacks `init()`/`before()`/`after()`/`settled()` are called for the respective events during a promise's lifetime.
+ * All callbacks are optional. For example, if only promise creation needs to be tracked, then only the init callback needs to be passed.
+ * The hook callbacks must be plain functions. Providing async functions will throw as it would produce an infinite microtask loop.
+ * @since v17.1.0, v16.14.0
+ * @param callbacks The {@link HookCallbacks | Hook Callbacks} to register
+ * @return Used for disabling hooks
+ */
+ createHook: (callbacks: HookCallbacks) => Function;
+ }
+ /**
+ * The `promiseHooks` interface can be used to track promise lifecycle events.
+ * @since v17.1.0, v16.14.0
+ */
+ const promiseHooks: PromiseHooks;
+}
+declare module "node:v8" {
+ export * from "v8";
+}
diff --git a/client/node_modules/@types/node/vm.d.ts b/client/node_modules/@types/node/vm.d.ts
new file mode 100644
index 0000000..8d2f6ab
--- /dev/null
+++ b/client/node_modules/@types/node/vm.d.ts
@@ -0,0 +1,663 @@
+/**
+ * The `vm` module enables compiling and running code within V8 Virtual
+ * Machine contexts.
+ *
+ * **The `vm` module is not a security**
+ * **mechanism. Do not use it to run untrusted code.**
+ *
+ * JavaScript code can be compiled and run immediately or
+ * compiled, saved, and run later.
+ *
+ * A common use case is to run the code in a different V8 Context. This means
+ * invoked code has a different global object than the invoking code.
+ *
+ * One can provide the context by `contextifying` an
+ * object. The invoked code treats any property in the context like a
+ * global variable. Any changes to global variables caused by the invoked
+ * code are reflected in the context object.
+ *
+ * ```js
+ * const vm = require('vm');
+ *
+ * const x = 1;
+ *
+ * const context = { x: 2 };
+ * vm.createContext(context); // Contextify the object.
+ *
+ * const code = 'x += 40; var y = 17;';
+ * // `x` and `y` are global variables in the context.
+ * // Initially, x has the value 2 because that is the value of context.x.
+ * vm.runInContext(code, context);
+ *
+ * console.log(context.x); // 42
+ * console.log(context.y); // 17
+ *
+ * console.log(x); // 1; y is not defined.
+ * ```
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/vm.js)
+ */
+declare module "vm" {
+ import { ImportAssertions } from "node:module";
+ interface Context extends NodeJS.Dict<any> {}
+ interface BaseOptions {
+ /**
+ * Specifies the filename used in stack traces produced by this script.
+ * Default: `''`.
+ */
+ filename?: string | undefined;
+ /**
+ * Specifies the line number offset that is displayed in stack traces produced by this script.
+ * Default: `0`.
+ */
+ lineOffset?: number | undefined;
+ /**
+ * Specifies the column number offset that is displayed in stack traces produced by this script.
+ * @default 0
+ */
+ columnOffset?: number | undefined;
+ }
+ interface ScriptOptions extends BaseOptions {
+ /**
+ * V8's code cache data for the supplied source.
+ */
+ cachedData?: Buffer | NodeJS.ArrayBufferView | undefined;
+ /** @deprecated in favor of `script.createCachedData()` */
+ produceCachedData?: boolean | undefined;
+ /**
+ * Called during evaluation of this module when `import()` is called.
+ * If this option is not specified, calls to `import()` will reject with `ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING`.
+ */
+ importModuleDynamically?:
+ | ((specifier: string, script: Script, importAssertions: ImportAssertions) => Module)
+ | undefined;
+ }
+ interface RunningScriptOptions extends BaseOptions {
+ /**
+ * When `true`, if an `Error` occurs while compiling the `code`, the line of code causing the error is attached to the stack trace.
+ * Default: `true`.
+ */
+ displayErrors?: boolean | undefined;
+ /**
+ * Specifies the number of milliseconds to execute code before terminating execution.
+ * If execution is terminated, an `Error` will be thrown. This value must be a strictly positive integer.
+ */
+ timeout?: number | undefined;
+ /**
+ * If `true`, the execution will be terminated when `SIGINT` (Ctrl+C) is received.
+ * Existing handlers for the event that have been attached via `process.on('SIGINT')` will be disabled during script execution, but will continue to work after that.
+ * If execution is terminated, an `Error` will be thrown.
+ * Default: `false`.
+ */
+ breakOnSigint?: boolean | undefined;
+ }
+ interface RunningScriptInNewContextOptions extends RunningScriptOptions {
+ /**
+ * Human-readable name of the newly created context.
+ */
+ contextName?: CreateContextOptions["name"];
+ /**
+ * Origin corresponding to the newly created context for display purposes. The origin should be formatted like a URL,
+ * but with only the scheme, host, and port (if necessary), like the value of the `url.origin` property of a `URL` object.
+ * Most notably, this string should omit the trailing slash, as that denotes a path.
+ */
+ contextOrigin?: CreateContextOptions["origin"];
+ contextCodeGeneration?: CreateContextOptions["codeGeneration"];
+ /**
+ * If set to `afterEvaluate`, microtasks will be run immediately after the script has run.
+ */
+ microtaskMode?: CreateContextOptions["microtaskMode"];
+ }
+ interface RunningCodeOptions extends RunningScriptOptions {
+ cachedData?: ScriptOptions["cachedData"];
+ importModuleDynamically?: ScriptOptions["importModuleDynamically"];
+ }
+ interface RunningCodeInNewContextOptions extends RunningScriptInNewContextOptions {
+ cachedData?: ScriptOptions["cachedData"];
+ importModuleDynamically?: ScriptOptions["importModuleDynamically"];
+ }
+ interface CompileFunctionOptions extends BaseOptions {
+ /**
+ * Provides an optional data with V8's code cache data for the supplied source.
+ */
+ cachedData?: Buffer | undefined;
+ /**
+ * Specifies whether to produce new cache data.
+ * Default: `false`,
+ */
+ produceCachedData?: boolean | undefined;
+ /**
+ * The sandbox/context in which the said function should be compiled in.
+ */
+ parsingContext?: Context | undefined;
+ /**
+ * An array containing a collection of context extensions (objects wrapping the current scope) to be applied while compiling
+ */
+ contextExtensions?: Object[] | undefined;
+ }
+ interface CreateContextOptions {
+ /**
+ * Human-readable name of the newly created context.
+ * @default 'VM Context i' Where i is an ascending numerical index of the created context.
+ */
+ name?: string | undefined;
+ /**
+ * Corresponds to the newly created context for display purposes.
+ * The origin should be formatted like a `URL`, but with only the scheme, host, and port (if necessary),
+ * like the value of the `url.origin` property of a URL object.
+ * Most notably, this string should omit the trailing slash, as that denotes a path.
+ * @default ''
+ */
+ origin?: string | undefined;
+ codeGeneration?:
+ | {
+ /**
+ * If set to false any calls to eval or function constructors (Function, GeneratorFunction, etc)
+ * will throw an EvalError.
+ * @default true
+ */
+ strings?: boolean | undefined;
+ /**
+ * If set to false any attempt to compile a WebAssembly module will throw a WebAssembly.CompileError.
+ * @default true
+ */
+ wasm?: boolean | undefined;
+ }
+ | undefined;
+ /**
+ * If set to `afterEvaluate`, microtasks will be run immediately after the script has run.
+ */
+ microtaskMode?: "afterEvaluate" | undefined;
+ }
+ type MeasureMemoryMode = "summary" | "detailed";
+ interface MeasureMemoryOptions {
+ /**
+ * @default 'summary'
+ */
+ mode?: MeasureMemoryMode | undefined;
+ /**
+ * @default 'default'
+ */
+ execution?: "default" | "eager" | undefined;
+ }
+ interface MemoryMeasurement {
+ total: {
+ jsMemoryEstimate: number;
+ jsMemoryRange: [number, number];
+ };
+ }
+ /**
+ * Instances of the `vm.Script` class contain precompiled scripts that can be
+ * executed in specific contexts.
+ * @since v0.3.1
+ */
+ class Script {
+ constructor(code: string, options?: ScriptOptions | string);
+ /**
+ * Runs the compiled code contained by the `vm.Script` object within the given`contextifiedObject` and returns the result. Running code does not have access
+ * to local scope.
+ *
+ * The following example compiles code that increments a global variable, sets
+ * the value of another global variable, then execute the code multiple times.
+ * The globals are contained in the `context` object.
+ *
+ * ```js
+ * const vm = require('vm');
+ *
+ * const context = {
+ * animal: 'cat',
+ * count: 2
+ * };
+ *
+ * const script = new vm.Script('count += 1; name = "kitty";');
+ *
+ * vm.createContext(context);
+ * for (let i = 0; i < 10; ++i) {
+ * script.runInContext(context);
+ * }
+ *
+ * console.log(context);
+ * // Prints: { animal: 'cat', count: 12, name: 'kitty' }
+ * ```
+ *
+ * Using the `timeout` or `breakOnSigint` options will result in new event loops
+ * and corresponding threads being started, which have a non-zero performance
+ * overhead.
+ * @since v0.3.1
+ * @param contextifiedObject A `contextified` object as returned by the `vm.createContext()` method.
+ * @return the result of the very last statement executed in the script.
+ */
+ runInContext(contextifiedObject: Context, options?: RunningScriptOptions): any;
+ /**
+ * First contextifies the given `contextObject`, runs the compiled code contained
+ * by the `vm.Script` object within the created context, and returns the result.
+ * Running code does not have access to local scope.
+ *
+ * The following example compiles code that sets a global variable, then executes
+ * the code multiple times in different contexts. The globals are set on and
+ * contained within each individual `context`.
+ *
+ * ```js
+ * const vm = require('vm');
+ *
+ * const script = new vm.Script('globalVar = "set"');
+ *
+ * const contexts = [{}, {}, {}];
+ * contexts.forEach((context) => {
+ * script.runInNewContext(context);
+ * });
+ *
+ * console.log(contexts);
+ * // Prints: [{ globalVar: 'set' }, { globalVar: 'set' }, { globalVar: 'set' }]
+ * ```
+ * @since v0.3.1
+ * @param contextObject An object that will be `contextified`. If `undefined`, a new object will be created.
+ * @return the result of the very last statement executed in the script.
+ */
+ runInNewContext(contextObject?: Context, options?: RunningScriptInNewContextOptions): any;
+ /**
+ * Runs the compiled code contained by the `vm.Script` within the context of the
+ * current `global` object. Running code does not have access to local scope, but _does_ have access to the current `global` object.
+ *
+ * The following example compiles code that increments a `global` variable then
+ * executes that code multiple times:
+ *
+ * ```js
+ * const vm = require('vm');
+ *
+ * global.globalVar = 0;
+ *
+ * const script = new vm.Script('globalVar += 1', { filename: 'myfile.vm' });
+ *
+ * for (let i = 0; i < 1000; ++i) {
+ * script.runInThisContext();
+ * }
+ *
+ * console.log(globalVar);
+ *
+ * // 1000
+ * ```
+ * @since v0.3.1
+ * @return the result of the very last statement executed in the script.
+ */
+ runInThisContext(options?: RunningScriptOptions): any;
+ /**
+ * Creates a code cache that can be used with the `Script` constructor's`cachedData` option. Returns a `Buffer`. This method may be called at any
+ * time and any number of times.
+ *
+ * ```js
+ * const script = new vm.Script(`
+ * function add(a, b) {
+ * return a + b;
+ * }
+ *
+ * const x = add(1, 2);
+ * `);
+ *
+ * const cacheWithoutX = script.createCachedData();
+ *
+ * script.runInThisContext();
+ *
+ * const cacheWithX = script.createCachedData();
+ * ```
+ * @since v10.6.0
+ */
+ createCachedData(): Buffer;
+ /** @deprecated in favor of `script.createCachedData()` */
+ cachedDataProduced?: boolean | undefined;
+ cachedDataRejected?: boolean | undefined;
+ cachedData?: Buffer | undefined;
+ /**
+ * When the script is compiled from a source that contains a source map magic comment, this property will be set to the URL of the source map.
+ */
+ sourceMapURL?: string | undefined;
+ }
+ /**
+ * If given a `contextObject`, the `vm.createContext()` method will `prepare
+ * that object` so that it can be used in calls to {@link runInContext} or `script.runInContext()`. Inside such scripts,
+ * the `contextObject` will be the global object, retaining all of its existing
+ * properties but also having the built-in objects and functions any standard [global object](https://es5.github.io/#x15.1) has. Outside of scripts run by the vm module, global variables
+ * will remain unchanged.
+ *
+ * ```js
+ * const vm = require('vm');
+ *
+ * global.globalVar = 3;
+ *
+ * const context = { globalVar: 1 };
+ * vm.createContext(context);
+ *
+ * vm.runInContext('globalVar *= 2;', context);
+ *
+ * console.log(context);
+ * // Prints: { globalVar: 2 }
+ *
+ * console.log(global.globalVar);
+ * // Prints: 3
+ * ```
+ *
+ * If `contextObject` is omitted (or passed explicitly as `undefined`), a new,
+ * empty `contextified` object will be returned.
+ *
+ * The `vm.createContext()` method is primarily useful for creating a single
+ * context that can be used to run multiple scripts. For instance, if emulating a
+ * web browser, the method can be used to create a single context representing a
+ * window's global object, then run all `<script>` tags together within that
+ * context.
+ *
+ * The provided `name` and `origin` of the context are made visible through the
+ * Inspector API.
+ * @since v0.3.1
+ * @return contextified object.
+ */
+ function createContext(sandbox?: Context, options?: CreateContextOptions): Context;
+ /**
+ * Returns `true` if the given `object` object has been `contextified` using {@link createContext}.
+ * @since v0.11.7
+ */
+ function isContext(sandbox: Context): boolean;
+ /**
+ * The `vm.runInContext()` method compiles `code`, runs it within the context of
+ * the `contextifiedObject`, then returns the result. Running code does not have
+ * access to the local scope. The `contextifiedObject` object _must_ have been
+ * previously `contextified` using the {@link createContext} method.
+ *
+ * If `options` is a string, then it specifies the filename.
+ *
+ * The following example compiles and executes different scripts using a single `contextified` object:
+ *
+ * ```js
+ * const vm = require('vm');
+ *
+ * const contextObject = { globalVar: 1 };
+ * vm.createContext(contextObject);
+ *
+ * for (let i = 0; i < 10; ++i) {
+ * vm.runInContext('globalVar *= 2;', contextObject);
+ * }
+ * console.log(contextObject);
+ * // Prints: { globalVar: 1024 }
+ * ```
+ * @since v0.3.1
+ * @param code The JavaScript code to compile and run.
+ * @param contextifiedObject The `contextified` object that will be used as the `global` when the `code` is compiled and run.
+ * @return the result of the very last statement executed in the script.
+ */
+ function runInContext(code: string, contextifiedObject: Context, options?: RunningCodeOptions | string): any;
+ /**
+ * The `vm.runInNewContext()` first contextifies the given `contextObject` (or
+ * creates a new `contextObject` if passed as `undefined`), compiles the `code`,
+ * runs it within the created context, then returns the result. Running code
+ * does not have access to the local scope.
+ *
+ * If `options` is a string, then it specifies the filename.
+ *
+ * The following example compiles and executes code that increments a global
+ * variable and sets a new one. These globals are contained in the `contextObject`.
+ *
+ * ```js
+ * const vm = require('vm');
+ *
+ * const contextObject = {
+ * animal: 'cat',
+ * count: 2
+ * };
+ *
+ * vm.runInNewContext('count += 1; name = "kitty"', contextObject);
+ * console.log(contextObject);
+ * // Prints: { animal: 'cat', count: 3, name: 'kitty' }
+ * ```
+ * @since v0.3.1
+ * @param code The JavaScript code to compile and run.
+ * @param contextObject An object that will be `contextified`. If `undefined`, a new object will be created.
+ * @return the result of the very last statement executed in the script.
+ */
+ function runInNewContext(
+ code: string,
+ contextObject?: Context,
+ options?: RunningCodeInNewContextOptions | string,
+ ): any;
+ /**
+ * `vm.runInThisContext()` compiles `code`, runs it within the context of the
+ * current `global` and returns the result. Running code does not have access to
+ * local scope, but does have access to the current `global` object.
+ *
+ * If `options` is a string, then it specifies the filename.
+ *
+ * The following example illustrates using both `vm.runInThisContext()` and
+ * the JavaScript [`eval()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval) function to run the same code:
+ *
+ * ```js
+ * const vm = require('vm');
+ * let localVar = 'initial value';
+ *
+ * const vmResult = vm.runInThisContext('localVar = "vm";');
+ * console.log(`vmResult: '${vmResult}', localVar: '${localVar}'`);
+ * // Prints: vmResult: 'vm', localVar: 'initial value'
+ *
+ * const evalResult = eval('localVar = "eval";');
+ * console.log(`evalResult: '${evalResult}', localVar: '${localVar}'`);
+ * // Prints: evalResult: 'eval', localVar: 'eval'
+ * ```
+ *
+ * Because `vm.runInThisContext()` does not have access to the local scope,`localVar` is unchanged. In contrast,
+ * [`eval()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval) _does_ have access to the
+ * local scope, so the value `localVar` is changed. In this way`vm.runInThisContext()` is much like an [indirect `eval()` call](https://es5.github.io/#x10.4.2), e.g.`(0,eval)('code')`.
+ *
+ * ## Example: Running an HTTP server within a VM
+ *
+ * When using either `script.runInThisContext()` or {@link runInThisContext}, the code is executed within the current V8 global
+ * context. The code passed to this VM context will have its own isolated scope.
+ *
+ * In order to run a simple web server using the `http` module the code passed to
+ * the context must either call `require('http')` on its own, or have a reference
+ * to the `http` module passed to it. For instance:
+ *
+ * ```js
+ * 'use strict';
+ * const vm = require('vm');
+ *
+ * const code = `
+ * ((require) => {
+ * const http = require('http');
+ *
+ * http.createServer((request, response) => {
+ * response.writeHead(200, { 'Content-Type': 'text/plain' });
+ * response.end('Hello World\\n');
+ * }).listen(8124);
+ *
+ * console.log('Server running at http://127.0.0.1:8124/');
+ * })`;
+ *
+ * vm.runInThisContext(code)(require);
+ * ```
+ *
+ * The `require()` in the above case shares the state with the context it is
+ * passed from. This may introduce risks when untrusted code is executed, e.g.
+ * altering objects in the context in unwanted ways.
+ * @since v0.3.1
+ * @param code The JavaScript code to compile and run.
+ * @return the result of the very last statement executed in the script.
+ */
+ function runInThisContext(code: string, options?: RunningCodeOptions | string): any;
+ /**
+ * Compiles the given code into the provided context (if no context is
+ * supplied, the current context is used), and returns it wrapped inside a
+ * function with the given `params`.
+ * @since v10.10.0
+ * @param code The body of the function to compile.
+ * @param params An array of strings containing all parameters for the function.
+ */
+ function compileFunction(
+ code: string,
+ params?: readonly string[],
+ options?: CompileFunctionOptions,
+ ): Function & {
+ cachedData?: Script["cachedData"] | undefined;
+ cachedDataProduced?: Script["cachedDataProduced"] | undefined;
+ cachedDataRejected?: Script["cachedDataRejected"] | undefined;
+ };
+ /**
+ * Measure the memory known to V8 and used by all contexts known to the
+ * current V8 isolate, or the main context.
+ *
+ * The format of the object that the returned Promise may resolve with is
+ * specific to the V8 engine and may change from one version of V8 to the next.
+ *
+ * The returned result is different from the statistics returned by`v8.getHeapSpaceStatistics()` in that `vm.measureMemory()` measure the
+ * memory reachable by each V8 specific contexts in the current instance of
+ * the V8 engine, while the result of `v8.getHeapSpaceStatistics()` measure
+ * the memory occupied by each heap space in the current V8 instance.
+ *
+ * ```js
+ * const vm = require('vm');
+ * // Measure the memory used by the main context.
+ * vm.measureMemory({ mode: 'summary' })
+ * // This is the same as vm.measureMemory()
+ * .then((result) => {
+ * // The current format is:
+ * // {
+ * // total: {
+ * // jsMemoryEstimate: 2418479, jsMemoryRange: [ 2418479, 2745799 ]
+ * // }
+ * // }
+ * console.log(result);
+ * });
+ *
+ * const context = vm.createContext({ a: 1 });
+ * vm.measureMemory({ mode: 'detailed', execution: 'eager' })
+ * .then((result) => {
+ * // Reference the context here so that it won't be GC'ed
+ * // until the measurement is complete.
+ * console.log(context.a);
+ * // {
+ * // total: {
+ * // jsMemoryEstimate: 2574732,
+ * // jsMemoryRange: [ 2574732, 2904372 ]
+ * // },
+ * // current: {
+ * // jsMemoryEstimate: 2438996,
+ * // jsMemoryRange: [ 2438996, 2768636 ]
+ * // },
+ * // other: [
+ * // {
+ * // jsMemoryEstimate: 135736,
+ * // jsMemoryRange: [ 135736, 465376 ]
+ * // }
+ * // ]
+ * // }
+ * console.log(result);
+ * });
+ * ```
+ * @since v13.10.0
+ * @experimental
+ */
+ function measureMemory(options?: MeasureMemoryOptions): Promise<MemoryMeasurement>;
+
+ interface ModuleEvaluateOptions {
+ timeout?: RunningScriptOptions["timeout"] | undefined;
+ breakOnSigint?: RunningScriptOptions["breakOnSigint"] | undefined;
+ }
+ type ModuleLinker = (
+ specifier: string,
+ referencingModule: Module,
+ extra: { assert: Object },
+ ) => Module | Promise<Module>;
+ type ModuleStatus = "unlinked" | "linking" | "linked" | "evaluating" | "evaluated" | "errored";
+ class Module {
+ /**
+ * The specifiers of all dependencies of this module.
+ */
+ dependencySpecifiers: readonly string[];
+ /**
+ * If the `module.status` is `'errored'`, this property contains the exception thrown by the module during evaluation.
+ * If the status is anything else, accessing this property will result in a thrown exception.
+ */
+ error: any;
+ /**
+ * The identifier of the current module, as set in the constructor.
+ */
+ identifier: string;
+ context: Context;
+ /**
+ * The namespace object of the module. This is only available after linking (`module.link()`) has completed.
+ */
+ namespace: Object;
+ /**
+ * The current status of the module.
+ */
+ status: ModuleStatus;
+ /**
+ * Evaluate the module.
+ *
+ * This must be called after the module has been linked; otherwise it will reject
+ * It could be called also when the module has already been evaluated, in which case it will either do nothing
+ * if the initial evaluation ended in success (`module.status` is `'evaluated'`) or it will re-throw the exception
+ * that the initial evaluation resulted in (`module.status` is `'errored'`).
+ *
+ * This method cannot be called while the module is being evaluated (`module.status` is `'evaluating'`).
+ */
+ evaluate(options?: ModuleEvaluateOptions): Promise<void>;
+ /**
+ * Link module dependencies. This method must be called before evaluation, and can only be called once per module.
+ */
+ link(linker: ModuleLinker): Promise<void>;
+ }
+
+ interface SourceTextModuleOptions {
+ /**
+ * String used in stack traces.
+ * @default 'vm:module(i)' where i is a context-specific ascending index.
+ */
+ identifier?: string | undefined;
+ cachedData?: ScriptOptions["cachedData"] | undefined;
+ context?: Context | undefined;
+ lineOffset?: BaseOptions["lineOffset"] | undefined;
+ columnOffset?: BaseOptions["columnOffset"] | undefined;
+ /**
+ * Called during evaluation of this module to initialize the `import.meta`.
+ */
+ initializeImportMeta?: ((meta: ImportMeta, module: SourceTextModule) => void) | undefined;
+ importModuleDynamically?: ScriptOptions["importModuleDynamically"] | undefined;
+ }
+ class SourceTextModule extends Module {
+ /**
+ * Creates a new `SourceTextModule` instance.
+ * @param code JavaScript Module code to parse
+ */
+ constructor(code: string, options?: SourceTextModuleOptions);
+ }
+
+ interface SyntheticModuleOptions {
+ /**
+ * String used in stack traces.
+ * @default 'vm:module(i)' where i is a context-specific ascending index.
+ */
+ identifier?: string | undefined;
+ /**
+ * The contextified object as returned by the `vm.createContext()` method, to compile and evaluate this module in.
+ */
+ context?: Context | undefined;
+ }
+ class SyntheticModule extends Module {
+ /**
+ * Creates a new `SyntheticModule` instance.
+ * @param exportNames Array of names that will be exported from the module.
+ * @param evaluateCallback Called when the module is evaluated.
+ */
+ constructor(
+ exportNames: string[],
+ evaluateCallback: (this: SyntheticModule) => void,
+ options?: SyntheticModuleOptions,
+ );
+ /**
+ * This method is used after the module is linked to set the values of exports.
+ * If it is called before the module is linked, an `ERR_VM_MODULE_STATUS` error will be thrown.
+ * @param name
+ * @param value
+ */
+ setExport(name: string, value: any): void;
+ }
+}
+declare module "node:vm" {
+ export * from "vm";
+}
diff --git a/client/node_modules/@types/node/wasi.d.ts b/client/node_modules/@types/node/wasi.d.ts
new file mode 100644
index 0000000..9af8059
--- /dev/null
+++ b/client/node_modules/@types/node/wasi.d.ts
@@ -0,0 +1,158 @@
+/**
+ * The WASI API provides an implementation of the [WebAssembly System Interface](https://wasi.dev/) specification. WASI gives sandboxed WebAssembly applications access to the
+ * underlying operating system via a collection of POSIX-like functions.
+ *
+ * ```js
+ * import { readFile } from 'fs/promises';
+ * import { WASI } from 'wasi';
+ * import { argv, env } from 'process';
+ *
+ * const wasi = new WASI({
+ * args: argv,
+ * env,
+ * preopens: {
+ * '/sandbox': '/some/real/path/that/wasm/can/access'
+ * }
+ * });
+ *
+ * // Some WASI binaries require:
+ * // const importObject = { wasi_unstable: wasi.wasiImport };
+ * const importObject = { wasi_snapshot_preview1: wasi.wasiImport };
+ *
+ * const wasm = await WebAssembly.compile(
+ * await readFile(new URL('./demo.wasm', import.meta.url))
+ * );
+ * const instance = await WebAssembly.instantiate(wasm, importObject);
+ *
+ * wasi.start(instance);
+ * ```
+ *
+ * To run the above example, create a new WebAssembly text format file named`demo.wat`:
+ *
+ * ```text
+ * (module
+ * ;; Import the required fd_write WASI function which will write the given io vectors to stdout
+ * ;; The function signature for fd_write is:
+ * ;; (File Descriptor, *iovs, iovs_len, nwritten) -> Returns number of bytes written
+ * (import "wasi_snapshot_preview1" "fd_write" (func $fd_write (param i32 i32 i32 i32) (result i32)))
+ *
+ * (memory 1)
+ * (export "memory" (memory 0))
+ *
+ * ;; Write 'hello world\n' to memory at an offset of 8 bytes
+ * ;; Note the trailing newline which is required for the text to appear
+ * (data (i32.const 8) "hello world\n")
+ *
+ * (func $main (export "_start")
+ * ;; Creating a new io vector within linear memory
+ * (i32.store (i32.const 0) (i32.const 8)) ;; iov.iov_base - This is a pointer to the start of the 'hello world\n' string
+ * (i32.store (i32.const 4) (i32.const 12)) ;; iov.iov_len - The length of the 'hello world\n' string
+ *
+ * (call $fd_write
+ * (i32.const 1) ;; file_descriptor - 1 for stdout
+ * (i32.const 0) ;; *iovs - The pointer to the iov array, which is stored at memory location 0
+ * (i32.const 1) ;; iovs_len - We're printing 1 string stored in an iov - so one.
+ * (i32.const 20) ;; nwritten - A place in memory to store the number of bytes written
+ * )
+ * drop ;; Discard the number of bytes written from the top of the stack
+ * )
+ * )
+ * ```
+ *
+ * Use [wabt](https://github.com/WebAssembly/wabt) to compile `.wat` to `.wasm`
+ *
+ * ```console
+ * $ wat2wasm demo.wat
+ * ```
+ *
+ * The `--experimental-wasi-unstable-preview1` CLI argument is needed for this
+ * example to run.
+ * @experimental
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/wasi.js)
+ */
+declare module "wasi" {
+ interface WASIOptions {
+ /**
+ * An array of strings that the WebAssembly application will
+ * see as command line arguments. The first argument is the virtual path to the
+ * WASI command itself.
+ */
+ args?: string[] | undefined;
+ /**
+ * An object similar to `process.env` that the WebAssembly
+ * application will see as its environment.
+ */
+ env?: object | undefined;
+ /**
+ * This object represents the WebAssembly application's
+ * sandbox directory structure. The string keys of `preopens` are treated as
+ * directories within the sandbox. The corresponding values in `preopens` are
+ * the real paths to those directories on the host machine.
+ */
+ preopens?: NodeJS.Dict<string> | undefined;
+ /**
+ * By default, WASI applications terminate the Node.js
+ * process via the `__wasi_proc_exit()` function. Setting this option to `true`
+ * causes `wasi.start()` to return the exit code rather than terminate the
+ * process.
+ * @default false
+ */
+ returnOnExit?: boolean | undefined;
+ /**
+ * The file descriptor used as standard input in the WebAssembly application.
+ * @default 0
+ */
+ stdin?: number | undefined;
+ /**
+ * The file descriptor used as standard output in the WebAssembly application.
+ * @default 1
+ */
+ stdout?: number | undefined;
+ /**
+ * The file descriptor used as standard error in the WebAssembly application.
+ * @default 2
+ */
+ stderr?: number | undefined;
+ }
+ /**
+ * The `WASI` class provides the WASI system call API and additional convenience
+ * methods for working with WASI-based applications. Each `WASI` instance
+ * represents a distinct sandbox environment. For security purposes, each `WASI`instance must have its command-line arguments, environment variables, and
+ * sandbox directory structure configured explicitly.
+ * @since v13.3.0, v12.16.0
+ */
+ class WASI {
+ constructor(options?: WASIOptions);
+ /**
+ * Attempt to begin execution of `instance` as a WASI command by invoking its`_start()` export. If `instance` does not contain a `_start()` export, or if`instance` contains an `_initialize()`
+ * export, then an exception is thrown.
+ *
+ * `start()` requires that `instance` exports a [`WebAssembly.Memory`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Memory) named`memory`. If
+ * `instance` does not have a `memory` export an exception is thrown.
+ *
+ * If `start()` is called more than once, an exception is thrown.
+ * @since v13.3.0, v12.16.0
+ */
+ start(instance: object): void; // TODO: avoid DOM dependency until WASM moved to own lib.
+ /**
+ * Attempt to initialize `instance` as a WASI reactor by invoking its`_initialize()` export, if it is present. If `instance` contains a `_start()`export, then an exception is thrown.
+ *
+ * `initialize()` requires that `instance` exports a [`WebAssembly.Memory`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Memory) named`memory`.
+ * If `instance` does not have a `memory` export an exception is thrown.
+ *
+ * If `initialize()` is called more than once, an exception is thrown.
+ * @since v14.6.0, v12.19.0
+ */
+ initialize(instance: object): void; // TODO: avoid DOM dependency until WASM moved to own lib.
+ /**
+ * `wasiImport` is an object that implements the WASI system call API. This object
+ * should be passed as the `wasi_snapshot_preview1` import during the instantiation
+ * of a [`WebAssembly.Instance`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Instance).
+ * @since v13.3.0, v12.16.0
+ */
+ readonly wasiImport: NodeJS.Dict<any>; // TODO: Narrow to DOM types
+ }
+}
+declare module "node:wasi" {
+ export * from "wasi";
+}
diff --git a/client/node_modules/@types/node/worker_threads.d.ts b/client/node_modules/@types/node/worker_threads.d.ts
new file mode 100644
index 0000000..ad76c4c
--- /dev/null
+++ b/client/node_modules/@types/node/worker_threads.d.ts
@@ -0,0 +1,692 @@
+/**
+ * The `worker_threads` module enables the use of threads that execute JavaScript
+ * in parallel. To access it:
+ *
+ * ```js
+ * const worker = require('worker_threads');
+ * ```
+ *
+ * Workers (threads) are useful for performing CPU-intensive JavaScript operations.
+ * They do not help much with I/O-intensive work. The Node.js built-in
+ * asynchronous I/O operations are more efficient than Workers can be.
+ *
+ * Unlike `child_process` or `cluster`, `worker_threads` can share memory. They do
+ * so by transferring `ArrayBuffer` instances or sharing `SharedArrayBuffer`instances.
+ *
+ * ```js
+ * const {
+ * Worker, isMainThread, parentPort, workerData
+ * } = require('worker_threads');
+ *
+ * if (isMainThread) {
+ * module.exports = function parseJSAsync(script) {
+ * return new Promise((resolve, reject) => {
+ * const worker = new Worker(__filename, {
+ * workerData: script
+ * });
+ * worker.on('message', resolve);
+ * worker.on('error', reject);
+ * worker.on('exit', (code) => {
+ * if (code !== 0)
+ * reject(new Error(`Worker stopped with exit code ${code}`));
+ * });
+ * });
+ * };
+ * } else {
+ * const { parse } = require('some-js-parsing-library');
+ * const script = workerData;
+ * parentPort.postMessage(parse(script));
+ * }
+ * ```
+ *
+ * The above example spawns a Worker thread for each `parseJSAsync()` call. In
+ * practice, use a pool of Workers for these kinds of tasks. Otherwise, the
+ * overhead of creating Workers would likely exceed their benefit.
+ *
+ * When implementing a worker pool, use the `AsyncResource` API to inform
+ * diagnostic tools (e.g. to provide asynchronous stack traces) about the
+ * correlation between tasks and their outcomes. See `"Using AsyncResource for a Worker thread pool"` in the `async_hooks` documentation for an example implementation.
+ *
+ * Worker threads inherit non-process-specific options by default. Refer to `Worker constructor options` to know how to customize worker thread options,
+ * specifically `argv` and `execArgv` options.
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/worker_threads.js)
+ */
+declare module "worker_threads" {
+ import { Blob } from "node:buffer";
+ import { Context } from "node:vm";
+ import { EventEmitter } from "node:events";
+ import { EventLoopUtilityFunction } from "node:perf_hooks";
+ import { FileHandle } from "node:fs/promises";
+ import { Readable, Writable } from "node:stream";
+ import { URL } from "node:url";
+ import { X509Certificate } from "node:crypto";
+ const isMainThread: boolean;
+ const parentPort: null | MessagePort;
+ const resourceLimits: ResourceLimits;
+ const SHARE_ENV: unique symbol;
+ const threadId: number;
+ const workerData: any;
+ /**
+ * Instances of the `worker.MessageChannel` class represent an asynchronous,
+ * two-way communications channel.
+ * The `MessageChannel` has no methods of its own. `new MessageChannel()`yields an object with `port1` and `port2` properties, which refer to linked `MessagePort` instances.
+ *
+ * ```js
+ * const { MessageChannel } = require('worker_threads');
+ *
+ * const { port1, port2 } = new MessageChannel();
+ * port1.on('message', (message) => console.log('received', message));
+ * port2.postMessage({ foo: 'bar' });
+ * // Prints: received { foo: 'bar' } from the `port1.on('message')` listener
+ * ```
+ * @since v10.5.0
+ */
+ class MessageChannel {
+ readonly port1: MessagePort;
+ readonly port2: MessagePort;
+ }
+ interface WorkerPerformance {
+ eventLoopUtilization: EventLoopUtilityFunction;
+ }
+ type TransferListItem = ArrayBuffer | MessagePort | FileHandle | X509Certificate | Blob;
+ /**
+ * Instances of the `worker.MessagePort` class represent one end of an
+ * asynchronous, two-way communications channel. It can be used to transfer
+ * structured data, memory regions and other `MessagePort`s between different `Worker` s.
+ *
+ * This implementation matches [browser `MessagePort`](https://developer.mozilla.org/en-US/docs/Web/API/MessagePort) s.
+ * @since v10.5.0
+ */
+ class MessagePort extends EventEmitter {
+ /**
+ * Disables further sending of messages on either side of the connection.
+ * This method can be called when no further communication will happen over this`MessagePort`.
+ *
+ * The `'close' event` is emitted on both `MessagePort` instances that
+ * are part of the channel.
+ * @since v10.5.0
+ */
+ close(): void;
+ /**
+ * Sends a JavaScript value to the receiving side of this channel.`value` is transferred in a way which is compatible with
+ * the [HTML structured clone algorithm](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm).
+ *
+ * In particular, the significant differences to `JSON` are:
+ *
+ * * `value` may contain circular references.
+ * * `value` may contain instances of builtin JS types such as `RegExp`s,`BigInt`s, `Map`s, `Set`s, etc.
+ * * `value` may contain typed arrays, both using `ArrayBuffer`s
+ * and `SharedArrayBuffer`s.
+ * * `value` may contain [`WebAssembly.Module`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Module) instances.
+ * * `value` may not contain native (C++-backed) objects other than:
+ *
+ * ```js
+ * const { MessageChannel } = require('worker_threads');
+ * const { port1, port2 } = new MessageChannel();
+ *
+ * port1.on('message', (message) => console.log(message));
+ *
+ * const circularData = {};
+ * circularData.foo = circularData;
+ * // Prints: { foo: [Circular] }
+ * port2.postMessage(circularData);
+ * ```
+ *
+ * `transferList` may be a list of [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer), `MessagePort` and `FileHandle` objects.
+ * After transferring, they are not usable on the sending side of the channel
+ * anymore (even if they are not contained in `value`). Unlike with `child processes`, transferring handles such as network sockets is currently
+ * not supported.
+ *
+ * If `value` contains [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instances, those are accessible
+ * from either thread. They cannot be listed in `transferList`.
+ *
+ * `value` may still contain `ArrayBuffer` instances that are not in`transferList`; in that case, the underlying memory is copied rather than moved.
+ *
+ * ```js
+ * const { MessageChannel } = require('worker_threads');
+ * const { port1, port2 } = new MessageChannel();
+ *
+ * port1.on('message', (message) => console.log(message));
+ *
+ * const uint8Array = new Uint8Array([ 1, 2, 3, 4 ]);
+ * // This posts a copy of `uint8Array`:
+ * port2.postMessage(uint8Array);
+ * // This does not copy data, but renders `uint8Array` unusable:
+ * port2.postMessage(uint8Array, [ uint8Array.buffer ]);
+ *
+ * // The memory for the `sharedUint8Array` is accessible from both the
+ * // original and the copy received by `.on('message')`:
+ * const sharedUint8Array = new Uint8Array(new SharedArrayBuffer(4));
+ * port2.postMessage(sharedUint8Array);
+ *
+ * // This transfers a freshly created message port to the receiver.
+ * // This can be used, for example, to create communication channels between
+ * // multiple `Worker` threads that are children of the same parent thread.
+ * const otherChannel = new MessageChannel();
+ * port2.postMessage({ port: otherChannel.port1 }, [ otherChannel.port1 ]);
+ * ```
+ *
+ * The message object is cloned immediately, and can be modified after
+ * posting without having side effects.
+ *
+ * For more information on the serialization and deserialization mechanisms
+ * behind this API, see the `serialization API of the v8 module`.
+ * @since v10.5.0
+ */
+ postMessage(value: any, transferList?: readonly TransferListItem[]): void;
+ /**
+ * Opposite of `unref()`. Calling `ref()` on a previously `unref()`ed port does _not_ let the program exit if it's the only active handle left (the default
+ * behavior). If the port is `ref()`ed, calling `ref()` again has no effect.
+ *
+ * If listeners are attached or removed using `.on('message')`, the port
+ * is `ref()`ed and `unref()`ed automatically depending on whether
+ * listeners for the event exist.
+ * @since v10.5.0
+ */
+ ref(): void;
+ /**
+ * Calling `unref()` on a port allows the thread to exit if this is the only
+ * active handle in the event system. If the port is already `unref()`ed calling`unref()` again has no effect.
+ *
+ * If listeners are attached or removed using `.on('message')`, the port is`ref()`ed and `unref()`ed automatically depending on whether
+ * listeners for the event exist.
+ * @since v10.5.0
+ */
+ unref(): void;
+ /**
+ * Starts receiving messages on this `MessagePort`. When using this port
+ * as an event emitter, this is called automatically once `'message'`listeners are attached.
+ *
+ * This method exists for parity with the Web `MessagePort` API. In Node.js,
+ * it is only useful for ignoring messages when no event listener is present.
+ * Node.js also diverges in its handling of `.onmessage`. Setting it
+ * automatically calls `.start()`, but unsetting it lets messages queue up
+ * until a new handler is set or the port is discarded.
+ * @since v10.5.0
+ */
+ start(): void;
+ addListener(event: "close", listener: () => void): this;
+ addListener(event: "message", listener: (value: any) => void): this;
+ addListener(event: "messageerror", listener: (error: Error) => void): this;
+ addListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ emit(event: "close"): boolean;
+ emit(event: "message", value: any): boolean;
+ emit(event: "messageerror", error: Error): boolean;
+ emit(event: string | symbol, ...args: any[]): boolean;
+ on(event: "close", listener: () => void): this;
+ on(event: "message", listener: (value: any) => void): this;
+ on(event: "messageerror", listener: (error: Error) => void): this;
+ on(event: string | symbol, listener: (...args: any[]) => void): this;
+ once(event: "close", listener: () => void): this;
+ once(event: "message", listener: (value: any) => void): this;
+ once(event: "messageerror", listener: (error: Error) => void): this;
+ once(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependListener(event: "close", listener: () => void): this;
+ prependListener(event: "message", listener: (value: any) => void): this;
+ prependListener(event: "messageerror", listener: (error: Error) => void): this;
+ prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependOnceListener(event: "close", listener: () => void): this;
+ prependOnceListener(event: "message", listener: (value: any) => void): this;
+ prependOnceListener(event: "messageerror", listener: (error: Error) => void): this;
+ prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ removeListener(event: "close", listener: () => void): this;
+ removeListener(event: "message", listener: (value: any) => void): this;
+ removeListener(event: "messageerror", listener: (error: Error) => void): this;
+ removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ off(event: "close", listener: () => void): this;
+ off(event: "message", listener: (value: any) => void): this;
+ off(event: "messageerror", listener: (error: Error) => void): this;
+ off(event: string | symbol, listener: (...args: any[]) => void): this;
+ }
+ interface WorkerOptions {
+ /**
+ * List of arguments which would be stringified and appended to
+ * `process.argv` in the worker. This is mostly similar to the `workerData`
+ * but the values will be available on the global `process.argv` as if they
+ * were passed as CLI options to the script.
+ */
+ argv?: any[] | undefined;
+ env?: NodeJS.Dict<string> | typeof SHARE_ENV | undefined;
+ eval?: boolean | undefined;
+ workerData?: any;
+ stdin?: boolean | undefined;
+ stdout?: boolean | undefined;
+ stderr?: boolean | undefined;
+ execArgv?: string[] | undefined;
+ resourceLimits?: ResourceLimits | undefined;
+ /**
+ * Additional data to send in the first worker message.
+ */
+ transferList?: TransferListItem[] | undefined;
+ /**
+ * @default true
+ */
+ trackUnmanagedFds?: boolean | undefined;
+ /**
+ * An optional `name` to be appended to the worker title
+ * for debuggin/identification purposes, making the final title as
+ * `[worker ${id}] ${name}`.
+ */
+ name?: string | undefined;
+ }
+ interface ResourceLimits {
+ /**
+ * The maximum size of a heap space for recently created objects.
+ */
+ maxYoungGenerationSizeMb?: number | undefined;
+ /**
+ * The maximum size of the main heap in MB.
+ */
+ maxOldGenerationSizeMb?: number | undefined;
+ /**
+ * The size of a pre-allocated memory range used for generated code.
+ */
+ codeRangeSizeMb?: number | undefined;
+ /**
+ * The default maximum stack size for the thread. Small values may lead to unusable Worker instances.
+ * @default 4
+ */
+ stackSizeMb?: number | undefined;
+ }
+ /**
+ * The `Worker` class represents an independent JavaScript execution thread.
+ * Most Node.js APIs are available inside of it.
+ *
+ * Notable differences inside a Worker environment are:
+ *
+ * * The `process.stdin`, `process.stdout` and `process.stderr` may be redirected by the parent thread.
+ * * The `require('worker_threads').isMainThread` property is set to `false`.
+ * * The `require('worker_threads').parentPort` message port is available.
+ * * `process.exit()` does not stop the whole program, just the single thread,
+ * and `process.abort()` is not available.
+ * * `process.chdir()` and `process` methods that set group or user ids
+ * are not available.
+ * * `process.env` is a copy of the parent thread's environment variables,
+ * unless otherwise specified. Changes to one copy are not visible in other
+ * threads, and are not visible to native add-ons (unless `worker.SHARE_ENV` is passed as the `env` option to the `Worker` constructor).
+ * * `process.title` cannot be modified.
+ * * Signals are not delivered through `process.on('...')`.
+ * * Execution may stop at any point as a result of `worker.terminate()` being invoked.
+ * * IPC channels from parent processes are not accessible.
+ * * The `trace_events` module is not supported.
+ * * Native add-ons can only be loaded from multiple threads if they fulfill `certain conditions`.
+ *
+ * Creating `Worker` instances inside of other `Worker`s is possible.
+ *
+ * Like [Web Workers](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) and the `cluster module`, two-way communication can be
+ * achieved through inter-thread message passing. Internally, a `Worker` has a
+ * built-in pair of `MessagePort` s that are already associated with each other
+ * when the `Worker` is created. While the `MessagePort` object on the parent side
+ * is not directly exposed, its functionalities are exposed through `worker.postMessage()` and the `worker.on('message')` event
+ * on the `Worker` object for the parent thread.
+ *
+ * To create custom messaging channels (which is encouraged over using the default
+ * global channel because it facilitates separation of concerns), users can create
+ * a `MessageChannel` object on either thread and pass one of the`MessagePort`s on that `MessageChannel` to the other thread through a
+ * pre-existing channel, such as the global one.
+ *
+ * See `port.postMessage()` for more information on how messages are passed,
+ * and what kind of JavaScript values can be successfully transported through
+ * the thread barrier.
+ *
+ * ```js
+ * const assert = require('assert');
+ * const {
+ * Worker, MessageChannel, MessagePort, isMainThread, parentPort
+ * } = require('worker_threads');
+ * if (isMainThread) {
+ * const worker = new Worker(__filename);
+ * const subChannel = new MessageChannel();
+ * worker.postMessage({ hereIsYourPort: subChannel.port1 }, [subChannel.port1]);
+ * subChannel.port2.on('message', (value) => {
+ * console.log('received:', value);
+ * });
+ * } else {
+ * parentPort.once('message', (value) => {
+ * assert(value.hereIsYourPort instanceof MessagePort);
+ * value.hereIsYourPort.postMessage('the worker is sending this');
+ * value.hereIsYourPort.close();
+ * });
+ * }
+ * ```
+ * @since v10.5.0
+ */
+ class Worker extends EventEmitter {
+ /**
+ * If `stdin: true` was passed to the `Worker` constructor, this is a
+ * writable stream. The data written to this stream will be made available in
+ * the worker thread as `process.stdin`.
+ * @since v10.5.0
+ */
+ readonly stdin: Writable | null;
+ /**
+ * This is a readable stream which contains data written to `process.stdout` inside the worker thread. If `stdout: true` was not passed to the `Worker` constructor, then data is piped to the
+ * parent thread's `process.stdout` stream.
+ * @since v10.5.0
+ */
+ readonly stdout: Readable;
+ /**
+ * This is a readable stream which contains data written to `process.stderr` inside the worker thread. If `stderr: true` was not passed to the `Worker` constructor, then data is piped to the
+ * parent thread's `process.stderr` stream.
+ * @since v10.5.0
+ */
+ readonly stderr: Readable;
+ /**
+ * An integer identifier for the referenced thread. Inside the worker thread,
+ * it is available as `require('worker_threads').threadId`.
+ * This value is unique for each `Worker` instance inside a single process.
+ * @since v10.5.0
+ */
+ readonly threadId: number;
+ /**
+ * Provides the set of JS engine resource constraints for this Worker thread.
+ * If the `resourceLimits` option was passed to the `Worker` constructor,
+ * this matches its values.
+ *
+ * If the worker has stopped, the return value is an empty object.
+ * @since v13.2.0, v12.16.0
+ */
+ readonly resourceLimits?: ResourceLimits | undefined;
+ /**
+ * An object that can be used to query performance information from a worker
+ * instance. Similar to `perf_hooks.performance`.
+ * @since v15.1.0, v14.17.0, v12.22.0
+ */
+ readonly performance: WorkerPerformance;
+ /**
+ * @param filename The path to the Worker’s main script or module.
+ * Must be either an absolute path or a relative path (i.e. relative to the current working directory) starting with ./ or ../,
+ * or a WHATWG URL object using file: protocol. If options.eval is true, this is a string containing JavaScript code rather than a path.
+ */
+ constructor(filename: string | URL, options?: WorkerOptions);
+ /**
+ * Send a message to the worker that is received via `require('worker_threads').parentPort.on('message')`.
+ * See `port.postMessage()` for more details.
+ * @since v10.5.0
+ */
+ postMessage(value: any, transferList?: readonly TransferListItem[]): void;
+ /**
+ * Opposite of `unref()`, calling `ref()` on a previously `unref()`ed worker does _not_ let the program exit if it's the only active handle left (the default
+ * behavior). If the worker is `ref()`ed, calling `ref()` again has
+ * no effect.
+ * @since v10.5.0
+ */
+ ref(): void;
+ /**
+ * Calling `unref()` on a worker allows the thread to exit if this is the only
+ * active handle in the event system. If the worker is already `unref()`ed calling`unref()` again has no effect.
+ * @since v10.5.0
+ */
+ unref(): void;
+ /**
+ * Stop all JavaScript execution in the worker thread as soon as possible.
+ * Returns a Promise for the exit code that is fulfilled when the `'exit' event` is emitted.
+ * @since v10.5.0
+ */
+ terminate(): Promise<number>;
+ /**
+ * Returns a readable stream for a V8 snapshot of the current state of the Worker.
+ * See `v8.getHeapSnapshot()` for more details.
+ *
+ * If the Worker thread is no longer running, which may occur before the `'exit' event` is emitted, the returned `Promise` is rejected
+ * immediately with an `ERR_WORKER_NOT_RUNNING` error.
+ * @since v13.9.0, v12.17.0
+ * @return A promise for a Readable Stream containing a V8 heap snapshot
+ */
+ getHeapSnapshot(): Promise<Readable>;
+ addListener(event: "error", listener: (err: Error) => void): this;
+ addListener(event: "exit", listener: (exitCode: number) => void): this;
+ addListener(event: "message", listener: (value: any) => void): this;
+ addListener(event: "messageerror", listener: (error: Error) => void): this;
+ addListener(event: "online", listener: () => void): this;
+ addListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ emit(event: "error", err: Error): boolean;
+ emit(event: "exit", exitCode: number): boolean;
+ emit(event: "message", value: any): boolean;
+ emit(event: "messageerror", error: Error): boolean;
+ emit(event: "online"): boolean;
+ emit(event: string | symbol, ...args: any[]): boolean;
+ on(event: "error", listener: (err: Error) => void): this;
+ on(event: "exit", listener: (exitCode: number) => void): this;
+ on(event: "message", listener: (value: any) => void): this;
+ on(event: "messageerror", listener: (error: Error) => void): this;
+ on(event: "online", listener: () => void): this;
+ on(event: string | symbol, listener: (...args: any[]) => void): this;
+ once(event: "error", listener: (err: Error) => void): this;
+ once(event: "exit", listener: (exitCode: number) => void): this;
+ once(event: "message", listener: (value: any) => void): this;
+ once(event: "messageerror", listener: (error: Error) => void): this;
+ once(event: "online", listener: () => void): this;
+ once(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependListener(event: "error", listener: (err: Error) => void): this;
+ prependListener(event: "exit", listener: (exitCode: number) => void): this;
+ prependListener(event: "message", listener: (value: any) => void): this;
+ prependListener(event: "messageerror", listener: (error: Error) => void): this;
+ prependListener(event: "online", listener: () => void): this;
+ prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ prependOnceListener(event: "error", listener: (err: Error) => void): this;
+ prependOnceListener(event: "exit", listener: (exitCode: number) => void): this;
+ prependOnceListener(event: "message", listener: (value: any) => void): this;
+ prependOnceListener(event: "messageerror", listener: (error: Error) => void): this;
+ prependOnceListener(event: "online", listener: () => void): this;
+ prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ removeListener(event: "error", listener: (err: Error) => void): this;
+ removeListener(event: "exit", listener: (exitCode: number) => void): this;
+ removeListener(event: "message", listener: (value: any) => void): this;
+ removeListener(event: "messageerror", listener: (error: Error) => void): this;
+ removeListener(event: "online", listener: () => void): this;
+ removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
+ off(event: "error", listener: (err: Error) => void): this;
+ off(event: "exit", listener: (exitCode: number) => void): this;
+ off(event: "message", listener: (value: any) => void): this;
+ off(event: "messageerror", listener: (error: Error) => void): this;
+ off(event: "online", listener: () => void): this;
+ off(event: string | symbol, listener: (...args: any[]) => void): this;
+ }
+ interface BroadcastChannel extends NodeJS.RefCounted {}
+ /**
+ * Instances of `BroadcastChannel` allow asynchronous one-to-many communication
+ * with all other `BroadcastChannel` instances bound to the same channel name.
+ *
+ * ```js
+ * 'use strict';
+ *
+ * const {
+ * isMainThread,
+ * BroadcastChannel,
+ * Worker
+ * } = require('worker_threads');
+ *
+ * const bc = new BroadcastChannel('hello');
+ *
+ * if (isMainThread) {
+ * let c = 0;
+ * bc.onmessage = (event) => {
+ * console.log(event.data);
+ * if (++c === 10) bc.close();
+ * };
+ * for (let n = 0; n < 10; n++)
+ * new Worker(__filename);
+ * } else {
+ * bc.postMessage('hello from every worker');
+ * bc.close();
+ * }
+ * ```
+ * @since v15.4.0
+ */
+ class BroadcastChannel {
+ readonly name: string;
+ /**
+ * Invoked with a single \`MessageEvent\` argument when a message is received.
+ * @since v15.4.0
+ */
+ onmessage: (message: unknown) => void;
+ /**
+ * Invoked with a received message cannot be deserialized.
+ * @since v15.4.0
+ */
+ onmessageerror: (message: unknown) => void;
+ constructor(name: string);
+ /**
+ * Closes the `BroadcastChannel` connection.
+ * @since v15.4.0
+ */
+ close(): void;
+ /**
+ * @since v15.4.0
+ * @param message Any cloneable JavaScript value.
+ */
+ postMessage(message: unknown): void;
+ }
+ /**
+ * Mark an object as not transferable. If `object` occurs in the transfer list of
+ * a `port.postMessage()` call, it is ignored.
+ *
+ * In particular, this makes sense for objects that can be cloned, rather than
+ * transferred, and which are used by other objects on the sending side.
+ * For example, Node.js marks the `ArrayBuffer`s it uses for its `Buffer pool` with this.
+ *
+ * This operation cannot be undone.
+ *
+ * ```js
+ * const { MessageChannel, markAsUntransferable } = require('worker_threads');
+ *
+ * const pooledBuffer = new ArrayBuffer(8);
+ * const typedArray1 = new Uint8Array(pooledBuffer);
+ * const typedArray2 = new Float64Array(pooledBuffer);
+ *
+ * markAsUntransferable(pooledBuffer);
+ *
+ * const { port1 } = new MessageChannel();
+ * port1.postMessage(typedArray1, [ typedArray1.buffer ]);
+ *
+ * // The following line prints the contents of typedArray1 -- it still owns
+ * // its memory and has been cloned, not transferred. Without
+ * // `markAsUntransferable()`, this would print an empty Uint8Array.
+ * // typedArray2 is intact as well.
+ * console.log(typedArray1);
+ * console.log(typedArray2);
+ * ```
+ *
+ * There is no equivalent to this API in browsers.
+ * @since v14.5.0, v12.19.0
+ */
+ function markAsUntransferable(object: object): void;
+ /**
+ * Transfer a `MessagePort` to a different `vm` Context. The original `port`object is rendered unusable, and the returned `MessagePort` instance
+ * takes its place.
+ *
+ * The returned `MessagePort` is an object in the target context and
+ * inherits from its global `Object` class. Objects passed to the [`port.onmessage()`](https://developer.mozilla.org/en-US/docs/Web/API/MessagePort/onmessage) listener are also created in the
+ * target context
+ * and inherit from its global `Object` class.
+ *
+ * However, the created `MessagePort` no longer inherits from [`EventTarget`](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget), and only
+ * [`port.onmessage()`](https://developer.mozilla.org/en-US/docs/Web/API/MessagePort/onmessage) can be used to receive
+ * events using it.
+ * @since v11.13.0
+ * @param port The message port to transfer.
+ * @param contextifiedSandbox A `contextified` object as returned by the `vm.createContext()` method.
+ */
+ function moveMessagePortToContext(port: MessagePort, contextifiedSandbox: Context): MessagePort;
+ /**
+ * Receive a single message from a given `MessagePort`. If no message is available,`undefined` is returned, otherwise an object with a single `message` property
+ * that contains the message payload, corresponding to the oldest message in the`MessagePort`’s queue.
+ *
+ * ```js
+ * const { MessageChannel, receiveMessageOnPort } = require('worker_threads');
+ * const { port1, port2 } = new MessageChannel();
+ * port1.postMessage({ hello: 'world' });
+ *
+ * console.log(receiveMessageOnPort(port2));
+ * // Prints: { message: { hello: 'world' } }
+ * console.log(receiveMessageOnPort(port2));
+ * // Prints: undefined
+ * ```
+ *
+ * When this function is used, no `'message'` event is emitted and the`onmessage` listener is not invoked.
+ * @since v12.3.0
+ */
+ function receiveMessageOnPort(port: MessagePort):
+ | {
+ message: any;
+ }
+ | undefined;
+ type Serializable = string | object | number | boolean | bigint;
+ /**
+ * Within a worker thread, `worker.getEnvironmentData()` returns a clone
+ * of data passed to the spawning thread's `worker.setEnvironmentData()`.
+ * Every new `Worker` receives its own copy of the environment data
+ * automatically.
+ *
+ * ```js
+ * const {
+ * Worker,
+ * isMainThread,
+ * setEnvironmentData,
+ * getEnvironmentData,
+ * } = require('worker_threads');
+ *
+ * if (isMainThread) {
+ * setEnvironmentData('Hello', 'World!');
+ * const worker = new Worker(__filename);
+ * } else {
+ * console.log(getEnvironmentData('Hello')); // Prints 'World!'.
+ * }
+ * ```
+ * @since v15.12.0, v14.18.0
+ * @param key Any arbitrary, cloneable JavaScript value that can be used as a {Map} key.
+ */
+ function getEnvironmentData(key: Serializable): Serializable;
+ /**
+ * The `worker.setEnvironmentData()` API sets the content of`worker.getEnvironmentData()` in the current thread and all new `Worker`instances spawned from the current context.
+ * @since v15.12.0, v14.18.0
+ * @param key Any arbitrary, cloneable JavaScript value that can be used as a {Map} key.
+ * @param value Any arbitrary, cloneable JavaScript value that will be cloned and passed automatically to all new `Worker` instances. If `value` is passed as `undefined`, any previously set value
+ * for the `key` will be deleted.
+ */
+ function setEnvironmentData(key: Serializable, value: Serializable): void;
+
+ import {
+ BroadcastChannel as _BroadcastChannel,
+ MessageChannel as _MessageChannel,
+ MessagePort as _MessagePort,
+ } from "worker_threads";
+ global {
+ /**
+ * `BroadcastChannel` class is a global reference for `require('worker_threads').BroadcastChannel`
+ * https://nodejs.org/api/globals.html#broadcastchannel
+ * @since v18.0.0
+ */
+ var BroadcastChannel: typeof globalThis extends {
+ onmessage: any;
+ BroadcastChannel: infer T;
+ } ? T
+ : typeof _BroadcastChannel;
+
+ /**
+ * `MessageChannel` class is a global reference for `require('worker_threads').MessageChannel`
+ * https://nodejs.org/api/globals.html#messagechannel
+ * @since v15.0.0
+ */
+ var MessageChannel: typeof globalThis extends {
+ onmessage: any;
+ MessageChannel: infer T;
+ } ? T
+ : typeof _MessageChannel;
+
+ /**
+ * `MessagePort` class is a global reference for `require('worker_threads').MessagePort`
+ * https://nodejs.org/api/globals.html#messageport
+ * @since v15.0.0
+ */
+ var MessagePort: typeof globalThis extends {
+ onmessage: any;
+ MessagePort: infer T;
+ } ? T
+ : typeof _MessagePort;
+ }
+}
+declare module "node:worker_threads" {
+ export * from "worker_threads";
+}
diff --git a/client/node_modules/@types/node/zlib.d.ts b/client/node_modules/@types/node/zlib.d.ts
new file mode 100644
index 0000000..bcd48eb
--- /dev/null
+++ b/client/node_modules/@types/node/zlib.d.ts
@@ -0,0 +1,517 @@
+/**
+ * The `zlib` module provides compression functionality implemented using Gzip,
+ * Deflate/Inflate, and Brotli.
+ *
+ * To access it:
+ *
+ * ```js
+ * const zlib = require('zlib');
+ * ```
+ *
+ * Compression and decompression are built around the Node.js `Streams API`.
+ *
+ * Compressing or decompressing a stream (such as a file) can be accomplished by
+ * piping the source stream through a `zlib` `Transform` stream into a destination
+ * stream:
+ *
+ * ```js
+ * const { createGzip } = require('zlib');
+ * const { pipeline } = require('stream');
+ * const {
+ * createReadStream,
+ * createWriteStream
+ * } = require('fs');
+ *
+ * const gzip = createGzip();
+ * const source = createReadStream('input.txt');
+ * const destination = createWriteStream('input.txt.gz');
+ *
+ * pipeline(source, gzip, destination, (err) => {
+ * if (err) {
+ * console.error('An error occurred:', err);
+ * process.exitCode = 1;
+ * }
+ * });
+ *
+ * // Or, Promisified
+ *
+ * const { promisify } = require('util');
+ * const pipe = promisify(pipeline);
+ *
+ * async function do_gzip(input, output) {
+ * const gzip = createGzip();
+ * const source = createReadStream(input);
+ * const destination = createWriteStream(output);
+ * await pipe(source, gzip, destination);
+ * }
+ *
+ * do_gzip('input.txt', 'input.txt.gz')
+ * .catch((err) => {
+ * console.error('An error occurred:', err);
+ * process.exitCode = 1;
+ * });
+ * ```
+ *
+ * It is also possible to compress or decompress data in a single step:
+ *
+ * ```js
+ * const { deflate, unzip } = require('zlib');
+ *
+ * const input = '.................................';
+ * deflate(input, (err, buffer) => {
+ * if (err) {
+ * console.error('An error occurred:', err);
+ * process.exitCode = 1;
+ * }
+ * console.log(buffer.toString('base64'));
+ * });
+ *
+ * const buffer = Buffer.from('eJzT0yMAAGTvBe8=', 'base64');
+ * unzip(buffer, (err, buffer) => {
+ * if (err) {
+ * console.error('An error occurred:', err);
+ * process.exitCode = 1;
+ * }
+ * console.log(buffer.toString());
+ * });
+ *
+ * // Or, Promisified
+ *
+ * const { promisify } = require('util');
+ * const do_unzip = promisify(unzip);
+ *
+ * do_unzip(buffer)
+ * .then((buf) => console.log(buf.toString()))
+ * .catch((err) => {
+ * console.error('An error occurred:', err);
+ * process.exitCode = 1;
+ * });
+ * ```
+ * @since v0.5.8
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/zlib.js)
+ */
+declare module "zlib" {
+ import * as stream from "node:stream";
+ interface ZlibOptions {
+ /**
+ * @default constants.Z_NO_FLUSH
+ */
+ flush?: number | undefined;
+ /**
+ * @default constants.Z_FINISH
+ */
+ finishFlush?: number | undefined;
+ /**
+ * @default 16*1024
+ */
+ chunkSize?: number | undefined;
+ windowBits?: number | undefined;
+ level?: number | undefined; // compression only
+ memLevel?: number | undefined; // compression only
+ strategy?: number | undefined; // compression only
+ dictionary?: NodeJS.ArrayBufferView | ArrayBuffer | undefined; // deflate/inflate only, empty dictionary by default
+ info?: boolean | undefined;
+ maxOutputLength?: number | undefined;
+ }
+ interface BrotliOptions {
+ /**
+ * @default constants.BROTLI_OPERATION_PROCESS
+ */
+ flush?: number | undefined;
+ /**
+ * @default constants.BROTLI_OPERATION_FINISH
+ */
+ finishFlush?: number | undefined;
+ /**
+ * @default 16*1024
+ */
+ chunkSize?: number | undefined;
+ params?:
+ | {
+ /**
+ * Each key is a `constants.BROTLI_*` constant.
+ */
+ [key: number]: boolean | number;
+ }
+ | undefined;
+ maxOutputLength?: number | undefined;
+ }
+ interface Zlib {
+ /** @deprecated Use bytesWritten instead. */
+ readonly bytesRead: number;
+ readonly bytesWritten: number;
+ shell?: boolean | string | undefined;
+ close(callback?: () => void): void;
+ flush(kind?: number, callback?: () => void): void;
+ flush(callback?: () => void): void;
+ }
+ interface ZlibParams {
+ params(level: number, strategy: number, callback: () => void): void;
+ }
+ interface ZlibReset {
+ reset(): void;
+ }
+ interface BrotliCompress extends stream.Transform, Zlib {}
+ interface BrotliDecompress extends stream.Transform, Zlib {}
+ interface Gzip extends stream.Transform, Zlib {}
+ interface Gunzip extends stream.Transform, Zlib {}
+ interface Deflate extends stream.Transform, Zlib, ZlibReset, ZlibParams {}
+ interface Inflate extends stream.Transform, Zlib, ZlibReset {}
+ interface DeflateRaw extends stream.Transform, Zlib, ZlibReset, ZlibParams {}
+ interface InflateRaw extends stream.Transform, Zlib, ZlibReset {}
+ interface Unzip extends stream.Transform, Zlib {}
+ /**
+ * Creates and returns a new `BrotliCompress` object.
+ * @since v11.7.0, v10.16.0
+ */
+ function createBrotliCompress(options?: BrotliOptions): BrotliCompress;
+ /**
+ * Creates and returns a new `BrotliDecompress` object.
+ * @since v11.7.0, v10.16.0
+ */
+ function createBrotliDecompress(options?: BrotliOptions): BrotliDecompress;
+ /**
+ * Creates and returns a new `Gzip` object.
+ * See `example`.
+ * @since v0.5.8
+ */
+ function createGzip(options?: ZlibOptions): Gzip;
+ /**
+ * Creates and returns a new `Gunzip` object.
+ * @since v0.5.8
+ */
+ function createGunzip(options?: ZlibOptions): Gunzip;
+ /**
+ * Creates and returns a new `Deflate` object.
+ * @since v0.5.8
+ */
+ function createDeflate(options?: ZlibOptions): Deflate;
+ /**
+ * Creates and returns a new `Inflate` object.
+ * @since v0.5.8
+ */
+ function createInflate(options?: ZlibOptions): Inflate;
+ /**
+ * Creates and returns a new `DeflateRaw` object.
+ *
+ * An upgrade of zlib from 1.2.8 to 1.2.11 changed behavior when `windowBits`is set to 8 for raw deflate streams. zlib would automatically set `windowBits`to 9 if was initially set to 8\. Newer
+ * versions of zlib will throw an exception,
+ * so Node.js restored the original behavior of upgrading a value of 8 to 9,
+ * since passing `windowBits = 9` to zlib actually results in a compressed stream
+ * that effectively uses an 8-bit window only.
+ * @since v0.5.8
+ */
+ function createDeflateRaw(options?: ZlibOptions): DeflateRaw;
+ /**
+ * Creates and returns a new `InflateRaw` object.
+ * @since v0.5.8
+ */
+ function createInflateRaw(options?: ZlibOptions): InflateRaw;
+ /**
+ * Creates and returns a new `Unzip` object.
+ * @since v0.5.8
+ */
+ function createUnzip(options?: ZlibOptions): Unzip;
+ type InputType = string | ArrayBuffer | NodeJS.ArrayBufferView;
+ type CompressCallback = (error: Error | null, result: Buffer) => void;
+ /**
+ * @since v11.7.0, v10.16.0
+ */
+ function brotliCompress(buf: InputType, options: BrotliOptions, callback: CompressCallback): void;
+ function brotliCompress(buf: InputType, callback: CompressCallback): void;
+ namespace brotliCompress {
+ function __promisify__(buffer: InputType, options?: BrotliOptions): Promise<Buffer>;
+ }
+ /**
+ * Compress a chunk of data with `BrotliCompress`.
+ * @since v11.7.0, v10.16.0
+ */
+ function brotliCompressSync(buf: InputType, options?: BrotliOptions): Buffer;
+ /**
+ * @since v11.7.0, v10.16.0
+ */
+ function brotliDecompress(buf: InputType, options: BrotliOptions, callback: CompressCallback): void;
+ function brotliDecompress(buf: InputType, callback: CompressCallback): void;
+ namespace brotliDecompress {
+ function __promisify__(buffer: InputType, options?: BrotliOptions): Promise<Buffer>;
+ }
+ /**
+ * Decompress a chunk of data with `BrotliDecompress`.
+ * @since v11.7.0, v10.16.0
+ */
+ function brotliDecompressSync(buf: InputType, options?: BrotliOptions): Buffer;
+ /**
+ * @since v0.6.0
+ */
+ function deflate(buf: InputType, callback: CompressCallback): void;
+ function deflate(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
+ namespace deflate {
+ function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<Buffer>;
+ }
+ /**
+ * Compress a chunk of data with `Deflate`.
+ * @since v0.11.12
+ */
+ function deflateSync(buf: InputType, options?: ZlibOptions): Buffer;
+ /**
+ * @since v0.6.0
+ */
+ function deflateRaw(buf: InputType, callback: CompressCallback): void;
+ function deflateRaw(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
+ namespace deflateRaw {
+ function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<Buffer>;
+ }
+ /**
+ * Compress a chunk of data with `DeflateRaw`.
+ * @since v0.11.12
+ */
+ function deflateRawSync(buf: InputType, options?: ZlibOptions): Buffer;
+ /**
+ * @since v0.6.0
+ */
+ function gzip(buf: InputType, callback: CompressCallback): void;
+ function gzip(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
+ namespace gzip {
+ function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<Buffer>;
+ }
+ /**
+ * Compress a chunk of data with `Gzip`.
+ * @since v0.11.12
+ */
+ function gzipSync(buf: InputType, options?: ZlibOptions): Buffer;
+ /**
+ * @since v0.6.0
+ */
+ function gunzip(buf: InputType, callback: CompressCallback): void;
+ function gunzip(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
+ namespace gunzip {
+ function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<Buffer>;
+ }
+ /**
+ * Decompress a chunk of data with `Gunzip`.
+ * @since v0.11.12
+ */
+ function gunzipSync(buf: InputType, options?: ZlibOptions): Buffer;
+ /**
+ * @since v0.6.0
+ */
+ function inflate(buf: InputType, callback: CompressCallback): void;
+ function inflate(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
+ namespace inflate {
+ function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<Buffer>;
+ }
+ /**
+ * Decompress a chunk of data with `Inflate`.
+ * @since v0.11.12
+ */
+ function inflateSync(buf: InputType, options?: ZlibOptions): Buffer;
+ /**
+ * @since v0.6.0
+ */
+ function inflateRaw(buf: InputType, callback: CompressCallback): void;
+ function inflateRaw(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
+ namespace inflateRaw {
+ function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<Buffer>;
+ }
+ /**
+ * Decompress a chunk of data with `InflateRaw`.
+ * @since v0.11.12
+ */
+ function inflateRawSync(buf: InputType, options?: ZlibOptions): Buffer;
+ /**
+ * @since v0.6.0
+ */
+ function unzip(buf: InputType, callback: CompressCallback): void;
+ function unzip(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
+ namespace unzip {
+ function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<Buffer>;
+ }
+ /**
+ * Decompress a chunk of data with `Unzip`.
+ * @since v0.11.12
+ */
+ function unzipSync(buf: InputType, options?: ZlibOptions): Buffer;
+ namespace constants {
+ const BROTLI_DECODE: number;
+ const BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES: number;
+ const BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP: number;
+ const BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES: number;
+ const BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1: number;
+ const BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2: number;
+ const BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS: number;
+ const BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET: number;
+ const BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1: number;
+ const BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2: number;
+ const BROTLI_DECODER_ERROR_FORMAT_CL_SPACE: number;
+ const BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT: number;
+ const BROTLI_DECODER_ERROR_FORMAT_DICTIONARY: number;
+ const BROTLI_DECODER_ERROR_FORMAT_DISTANCE: number;
+ const BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE: number;
+ const BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE: number;
+ const BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE: number;
+ const BROTLI_DECODER_ERROR_FORMAT_PADDING_1: number;
+ const BROTLI_DECODER_ERROR_FORMAT_PADDING_2: number;
+ const BROTLI_DECODER_ERROR_FORMAT_RESERVED: number;
+ const BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET: number;
+ const BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME: number;
+ const BROTLI_DECODER_ERROR_FORMAT_TRANSFORM: number;
+ const BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS: number;
+ const BROTLI_DECODER_ERROR_INVALID_ARGUMENTS: number;
+ const BROTLI_DECODER_ERROR_UNREACHABLE: number;
+ const BROTLI_DECODER_NEEDS_MORE_INPUT: number;
+ const BROTLI_DECODER_NEEDS_MORE_OUTPUT: number;
+ const BROTLI_DECODER_NO_ERROR: number;
+ const BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION: number;
+ const BROTLI_DECODER_PARAM_LARGE_WINDOW: number;
+ const BROTLI_DECODER_RESULT_ERROR: number;
+ const BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT: number;
+ const BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT: number;
+ const BROTLI_DECODER_RESULT_SUCCESS: number;
+ const BROTLI_DECODER_SUCCESS: number;
+ const BROTLI_DEFAULT_MODE: number;
+ const BROTLI_DEFAULT_QUALITY: number;
+ const BROTLI_DEFAULT_WINDOW: number;
+ const BROTLI_ENCODE: number;
+ const BROTLI_LARGE_MAX_WINDOW_BITS: number;
+ const BROTLI_MAX_INPUT_BLOCK_BITS: number;
+ const BROTLI_MAX_QUALITY: number;
+ const BROTLI_MAX_WINDOW_BITS: number;
+ const BROTLI_MIN_INPUT_BLOCK_BITS: number;
+ const BROTLI_MIN_QUALITY: number;
+ const BROTLI_MIN_WINDOW_BITS: number;
+ const BROTLI_MODE_FONT: number;
+ const BROTLI_MODE_GENERIC: number;
+ const BROTLI_MODE_TEXT: number;
+ const BROTLI_OPERATION_EMIT_METADATA: number;
+ const BROTLI_OPERATION_FINISH: number;
+ const BROTLI_OPERATION_FLUSH: number;
+ const BROTLI_OPERATION_PROCESS: number;
+ const BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING: number;
+ const BROTLI_PARAM_LARGE_WINDOW: number;
+ const BROTLI_PARAM_LGBLOCK: number;
+ const BROTLI_PARAM_LGWIN: number;
+ const BROTLI_PARAM_MODE: number;
+ const BROTLI_PARAM_NDIRECT: number;
+ const BROTLI_PARAM_NPOSTFIX: number;
+ const BROTLI_PARAM_QUALITY: number;
+ const BROTLI_PARAM_SIZE_HINT: number;
+ const DEFLATE: number;
+ const DEFLATERAW: number;
+ const GUNZIP: number;
+ const GZIP: number;
+ const INFLATE: number;
+ const INFLATERAW: number;
+ const UNZIP: number;
+ // Allowed flush values.
+ const Z_NO_FLUSH: number;
+ const Z_PARTIAL_FLUSH: number;
+ const Z_SYNC_FLUSH: number;
+ const Z_FULL_FLUSH: number;
+ const Z_FINISH: number;
+ const Z_BLOCK: number;
+ const Z_TREES: number;
+ // Return codes for the compression/decompression functions.
+ // Negative values are errors, positive values are used for special but normal events.
+ const Z_OK: number;
+ const Z_STREAM_END: number;
+ const Z_NEED_DICT: number;
+ const Z_ERRNO: number;
+ const Z_STREAM_ERROR: number;
+ const Z_DATA_ERROR: number;
+ const Z_MEM_ERROR: number;
+ const Z_BUF_ERROR: number;
+ const Z_VERSION_ERROR: number;
+ // Compression levels.
+ const Z_NO_COMPRESSION: number;
+ const Z_BEST_SPEED: number;
+ const Z_BEST_COMPRESSION: number;
+ const Z_DEFAULT_COMPRESSION: number;
+ // Compression strategy.
+ const Z_FILTERED: number;
+ const Z_HUFFMAN_ONLY: number;
+ const Z_RLE: number;
+ const Z_FIXED: number;
+ const Z_DEFAULT_STRATEGY: number;
+ const Z_DEFAULT_WINDOWBITS: number;
+ const Z_MIN_WINDOWBITS: number;
+ const Z_MAX_WINDOWBITS: number;
+ const Z_MIN_CHUNK: number;
+ const Z_MAX_CHUNK: number;
+ const Z_DEFAULT_CHUNK: number;
+ const Z_MIN_MEMLEVEL: number;
+ const Z_MAX_MEMLEVEL: number;
+ const Z_DEFAULT_MEMLEVEL: number;
+ const Z_MIN_LEVEL: number;
+ const Z_MAX_LEVEL: number;
+ const Z_DEFAULT_LEVEL: number;
+ const ZLIB_VERNUM: number;
+ }
+ // Allowed flush values.
+ /** @deprecated Use `constants.Z_NO_FLUSH` */
+ const Z_NO_FLUSH: number;
+ /** @deprecated Use `constants.Z_PARTIAL_FLUSH` */
+ const Z_PARTIAL_FLUSH: number;
+ /** @deprecated Use `constants.Z_SYNC_FLUSH` */
+ const Z_SYNC_FLUSH: number;
+ /** @deprecated Use `constants.Z_FULL_FLUSH` */
+ const Z_FULL_FLUSH: number;
+ /** @deprecated Use `constants.Z_FINISH` */
+ const Z_FINISH: number;
+ /** @deprecated Use `constants.Z_BLOCK` */
+ const Z_BLOCK: number;
+ /** @deprecated Use `constants.Z_TREES` */
+ const Z_TREES: number;
+ // Return codes for the compression/decompression functions.
+ // Negative values are errors, positive values are used for special but normal events.
+ /** @deprecated Use `constants.Z_OK` */
+ const Z_OK: number;
+ /** @deprecated Use `constants.Z_STREAM_END` */
+ const Z_STREAM_END: number;
+ /** @deprecated Use `constants.Z_NEED_DICT` */
+ const Z_NEED_DICT: number;
+ /** @deprecated Use `constants.Z_ERRNO` */
+ const Z_ERRNO: number;
+ /** @deprecated Use `constants.Z_STREAM_ERROR` */
+ const Z_STREAM_ERROR: number;
+ /** @deprecated Use `constants.Z_DATA_ERROR` */
+ const Z_DATA_ERROR: number;
+ /** @deprecated Use `constants.Z_MEM_ERROR` */
+ const Z_MEM_ERROR: number;
+ /** @deprecated Use `constants.Z_BUF_ERROR` */
+ const Z_BUF_ERROR: number;
+ /** @deprecated Use `constants.Z_VERSION_ERROR` */
+ const Z_VERSION_ERROR: number;
+ // Compression levels.
+ /** @deprecated Use `constants.Z_NO_COMPRESSION` */
+ const Z_NO_COMPRESSION: number;
+ /** @deprecated Use `constants.Z_BEST_SPEED` */
+ const Z_BEST_SPEED: number;
+ /** @deprecated Use `constants.Z_BEST_COMPRESSION` */
+ const Z_BEST_COMPRESSION: number;
+ /** @deprecated Use `constants.Z_DEFAULT_COMPRESSION` */
+ const Z_DEFAULT_COMPRESSION: number;
+ // Compression strategy.
+ /** @deprecated Use `constants.Z_FILTERED` */
+ const Z_FILTERED: number;
+ /** @deprecated Use `constants.Z_HUFFMAN_ONLY` */
+ const Z_HUFFMAN_ONLY: number;
+ /** @deprecated Use `constants.Z_RLE` */
+ const Z_RLE: number;
+ /** @deprecated Use `constants.Z_FIXED` */
+ const Z_FIXED: number;
+ /** @deprecated Use `constants.Z_DEFAULT_STRATEGY` */
+ const Z_DEFAULT_STRATEGY: number;
+ /** @deprecated */
+ const Z_BINARY: number;
+ /** @deprecated */
+ const Z_TEXT: number;
+ /** @deprecated */
+ const Z_ASCII: number;
+ /** @deprecated */
+ const Z_UNKNOWN: number;
+ /** @deprecated */
+ const Z_DEFLATED: number;
+}
+declare module "node:zlib" {
+ export * from "zlib";
+}
diff --git a/client/node_modules/@types/responselike/LICENSE b/client/node_modules/@types/responselike/LICENSE
new file mode 100644
index 0000000..9e841e7
--- /dev/null
+++ b/client/node_modules/@types/responselike/LICENSE
@@ -0,0 +1,21 @@
+ MIT License
+
+ Copyright (c) Microsoft Corporation.
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE
diff --git a/client/node_modules/@types/responselike/README.md b/client/node_modules/@types/responselike/README.md
new file mode 100644
index 0000000..77d7f21
--- /dev/null
+++ b/client/node_modules/@types/responselike/README.md
@@ -0,0 +1,48 @@
+# Installation
+> `npm install --save @types/responselike`
+
+# Summary
+This package contains type definitions for responselike (https://github.com/lukechilds/responselike#readme).
+
+# Details
+Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/responselike.
+## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/responselike/index.d.ts)
+````ts
+/// <reference types="node" />
+
+import { IncomingMessage } from "http";
+import { Stream } from "stream";
+
+export = ResponseLike;
+
+/**
+ * Returns a streamable response object similar to a [Node.js HTTP response stream](https://nodejs.org/api/http.html#http_class_http_incomingmessage).
+ */
+declare class ResponseLike extends Stream.Readable {
+ statusCode: number;
+ headers: { [header: string]: string | string[] | undefined };
+ body: Buffer;
+ url: string;
+
+ /**
+ * @param statusCode HTTP response status code.
+ * @param headers HTTP headers object. Keys will be automatically lowercased.
+ * @param body A Buffer containing the response body. The Buffer contents will be streamable but is also exposed directly as `response.body`.
+ * @param url Request URL string.
+ */
+ constructor(
+ statusCode: number,
+ headers: { [header: string]: string | string[] | undefined },
+ body: Buffer,
+ url: string,
+ );
+}
+
+````
+
+### Additional Details
+ * Last updated: Tue, 07 Nov 2023 15:11:36 GMT
+ * Dependencies: [@types/node](https://npmjs.com/package/@types/node)
+
+# Credits
+These definitions were written by [BendingBender](https://github.com/BendingBender).
diff --git a/client/node_modules/@types/responselike/index.d.ts b/client/node_modules/@types/responselike/index.d.ts
new file mode 100644
index 0000000..d7ce72b
--- /dev/null
+++ b/client/node_modules/@types/responselike/index.d.ts
@@ -0,0 +1,29 @@
+/// <reference types="node" />
+
+import { IncomingMessage } from "http";
+import { Stream } from "stream";
+
+export = ResponseLike;
+
+/**
+ * Returns a streamable response object similar to a [Node.js HTTP response stream](https://nodejs.org/api/http.html#http_class_http_incomingmessage).
+ */
+declare class ResponseLike extends Stream.Readable {
+ statusCode: number;
+ headers: { [header: string]: string | string[] | undefined };
+ body: Buffer;
+ url: string;
+
+ /**
+ * @param statusCode HTTP response status code.
+ * @param headers HTTP headers object. Keys will be automatically lowercased.
+ * @param body A Buffer containing the response body. The Buffer contents will be streamable but is also exposed directly as `response.body`.
+ * @param url Request URL string.
+ */
+ constructor(
+ statusCode: number,
+ headers: { [header: string]: string | string[] | undefined },
+ body: Buffer,
+ url: string,
+ );
+}
diff --git a/client/node_modules/@types/responselike/package.json b/client/node_modules/@types/responselike/package.json
new file mode 100644
index 0000000..8112f89
--- /dev/null
+++ b/client/node_modules/@types/responselike/package.json
@@ -0,0 +1,27 @@
+{
+ "name": "@types/responselike",
+ "version": "1.0.3",
+ "description": "TypeScript definitions for responselike",
+ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/responselike",
+ "license": "MIT",
+ "contributors": [
+ {
+ "name": "BendingBender",
+ "githubUsername": "BendingBender",
+ "url": "https://github.com/BendingBender"
+ }
+ ],
+ "main": "",
+ "types": "index.d.ts",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
+ "directory": "types/responselike"
+ },
+ "scripts": {},
+ "dependencies": {
+ "@types/node": "*"
+ },
+ "typesPublisherContentHash": "ea1d581578b0ef6027b7cd6aa25990bb9ee8723d002d0617acf0aa4d3324aa49",
+ "typeScriptVersion": "4.5"
+} \ No newline at end of file
diff --git a/client/node_modules/@types/yauzl/LICENSE b/client/node_modules/@types/yauzl/LICENSE
new file mode 100644
index 0000000..9e841e7
--- /dev/null
+++ b/client/node_modules/@types/yauzl/LICENSE
@@ -0,0 +1,21 @@
+ MIT License
+
+ Copyright (c) Microsoft Corporation.
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE
diff --git a/client/node_modules/@types/yauzl/README.md b/client/node_modules/@types/yauzl/README.md
new file mode 100644
index 0000000..ce49325
--- /dev/null
+++ b/client/node_modules/@types/yauzl/README.md
@@ -0,0 +1,15 @@
+# Installation
+> `npm install --save @types/yauzl`
+
+# Summary
+This package contains type definitions for yauzl (https://github.com/thejoshwolfe/yauzl).
+
+# Details
+Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/yauzl.
+
+### Additional Details
+ * Last updated: Tue, 07 Nov 2023 15:11:36 GMT
+ * Dependencies: [@types/node](https://npmjs.com/package/@types/node)
+
+# Credits
+These definitions were written by [Florian Keller](https://github.com/ffflorian).
diff --git a/client/node_modules/@types/yauzl/index.d.ts b/client/node_modules/@types/yauzl/index.d.ts
new file mode 100644
index 0000000..e426fb6
--- /dev/null
+++ b/client/node_modules/@types/yauzl/index.d.ts
@@ -0,0 +1,110 @@
+/// <reference types="node" />
+
+import { EventEmitter } from "events";
+import { Readable } from "stream";
+
+export abstract class RandomAccessReader extends EventEmitter {
+ _readStreamForRange(start: number, end: number): void;
+ createReadStream(options: { start: number; end: number }): void;
+ read(buffer: Buffer, offset: number, length: number, position: number, callback: (err: Error | null) => void): void;
+ close(callback: (err: Error | null) => void): void;
+}
+
+export class Entry {
+ comment: string;
+ compressedSize: number;
+ compressionMethod: number;
+ crc32: number;
+ externalFileAttributes: number;
+ extraFieldLength: number;
+ extraFields: Array<{ id: number; data: Buffer }>;
+ fileCommentLength: number;
+ fileName: string;
+ fileNameLength: number;
+ generalPurposeBitFlag: number;
+ internalFileAttributes: number;
+ lastModFileDate: number;
+ lastModFileTime: number;
+ relativeOffsetOfLocalHeader: number;
+ uncompressedSize: number;
+ versionMadeBy: number;
+ versionNeededToExtract: number;
+
+ getLastModDate(): Date;
+ isEncrypted(): boolean;
+ isCompressed(): boolean;
+}
+
+export interface ZipFileOptions {
+ decompress: boolean | null;
+ decrypt: boolean | null;
+ start: number | null;
+ end: number | null;
+}
+
+export class ZipFile extends EventEmitter {
+ autoClose: boolean;
+ comment: string;
+ decodeStrings: boolean;
+ emittedError: boolean;
+ entriesRead: number;
+ entryCount: number;
+ fileSize: number;
+ isOpen: boolean;
+ lazyEntries: boolean;
+ readEntryCursor: boolean;
+ validateEntrySizes: boolean;
+
+ constructor(
+ reader: RandomAccessReader,
+ centralDirectoryOffset: number,
+ fileSize: number,
+ entryCount: number,
+ comment: string,
+ autoClose: boolean,
+ lazyEntries: boolean,
+ decodeStrings: boolean,
+ validateEntrySizes: boolean,
+ );
+
+ openReadStream(
+ entry: Entry,
+ options: ZipFileOptions,
+ callback: (err: Error | null, stream: Readable) => void,
+ ): void;
+ openReadStream(entry: Entry, callback: (err: Error | null, stream: Readable) => void): void;
+ close(): void;
+ readEntry(): void;
+}
+
+export interface Options {
+ autoClose?: boolean | undefined;
+ lazyEntries?: boolean | undefined;
+ decodeStrings?: boolean | undefined;
+ validateEntrySizes?: boolean | undefined;
+ strictFileNames?: boolean | undefined;
+}
+
+export function open(path: string, options: Options, callback?: (err: Error | null, zipfile: ZipFile) => void): void;
+export function open(path: string, callback?: (err: Error | null, zipfile: ZipFile) => void): void;
+export function fromFd(fd: number, options: Options, callback?: (err: Error | null, zipfile: ZipFile) => void): void;
+export function fromFd(fd: number, callback?: (err: Error | null, zipfile: ZipFile) => void): void;
+export function fromBuffer(
+ buffer: Buffer,
+ options: Options,
+ callback?: (err: Error | null, zipfile: ZipFile) => void,
+): void;
+export function fromBuffer(buffer: Buffer, callback?: (err: Error | null, zipfile: ZipFile) => void): void;
+export function fromRandomAccessReader(
+ reader: RandomAccessReader,
+ totalSize: number,
+ options: Options,
+ callback: (err: Error | null, zipfile: ZipFile) => void,
+): void;
+export function fromRandomAccessReader(
+ reader: RandomAccessReader,
+ totalSize: number,
+ callback: (err: Error | null, zipfile: ZipFile) => void,
+): void;
+export function dosDateTimeToDate(date: number, time: number): Date;
+export function validateFileName(fileName: string): string | null;
diff --git a/client/node_modules/@types/yauzl/package.json b/client/node_modules/@types/yauzl/package.json
new file mode 100644
index 0000000..f7a3cd2
--- /dev/null
+++ b/client/node_modules/@types/yauzl/package.json
@@ -0,0 +1,27 @@
+{
+ "name": "@types/yauzl",
+ "version": "2.10.3",
+ "description": "TypeScript definitions for yauzl",
+ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/yauzl",
+ "license": "MIT",
+ "contributors": [
+ {
+ "name": "Florian Keller",
+ "githubUsername": "ffflorian",
+ "url": "https://github.com/ffflorian"
+ }
+ ],
+ "main": "",
+ "types": "index.d.ts",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
+ "directory": "types/yauzl"
+ },
+ "scripts": {},
+ "dependencies": {
+ "@types/node": "*"
+ },
+ "typesPublisherContentHash": "4fb24c28ac8c0fdb7539555e955c273a2a4a433e99938ed73d9e7df3a9e1e2a7",
+ "typeScriptVersion": "4.5"
+} \ No newline at end of file
diff --git a/client/node_modules/ws/LICENSE b/client/node_modules/ws/LICENSE
new file mode 100644
index 0000000..1da5b96
--- /dev/null
+++ b/client/node_modules/ws/LICENSE
@@ -0,0 +1,20 @@
+Copyright (c) 2011 Einar Otto Stangvik <einaros@gmail.com>
+Copyright (c) 2013 Arnout Kazemier and contributors
+Copyright (c) 2016 Luigi Pinca and contributors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/client/node_modules/ws/README.md b/client/node_modules/ws/README.md
new file mode 100644
index 0000000..80d9886
--- /dev/null
+++ b/client/node_modules/ws/README.md
@@ -0,0 +1,549 @@
+# ws: a Node.js WebSocket library
+
+[![Version npm](https://img.shields.io/npm/v/ws.svg?logo=npm)](https://www.npmjs.com/package/ws)
+[![CI](https://img.shields.io/github/actions/workflow/status/websockets/ws/ci.yml?branch=master&label=CI&logo=github)](https://github.com/websockets/ws/actions?query=workflow%3ACI+branch%3Amaster)
+[![Coverage Status](https://img.shields.io/coveralls/websockets/ws/master.svg?logo=coveralls)](https://coveralls.io/github/websockets/ws)
+
+ws is a simple to use, blazing fast, and thoroughly tested WebSocket client and
+server implementation.
+
+Passes the quite extensive Autobahn test suite: [server][server-report],
+[client][client-report].
+
+**Note**: This module does not work in the browser. The client in the docs is a
+reference to a back end with the role of a client in the WebSocket
+communication. Browser clients must use the native
+[`WebSocket`](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket)
+object. To make the same code work seamlessly on Node.js and the browser, you
+can use one of the many wrappers available on npm, like
+[isomorphic-ws](https://github.com/heineiuo/isomorphic-ws).
+
+## Table of Contents
+
+- [Protocol support](#protocol-support)
+- [Installing](#installing)
+ - [Opt-in for performance](#opt-in-for-performance)
+ - [Legacy opt-in for performance](#legacy-opt-in-for-performance)
+- [API docs](#api-docs)
+- [WebSocket compression](#websocket-compression)
+- [Usage examples](#usage-examples)
+ - [Sending and receiving text data](#sending-and-receiving-text-data)
+ - [Sending binary data](#sending-binary-data)
+ - [Simple server](#simple-server)
+ - [External HTTP/S server](#external-https-server)
+ - [Multiple servers sharing a single HTTP/S server](#multiple-servers-sharing-a-single-https-server)
+ - [Client authentication](#client-authentication)
+ - [Server broadcast](#server-broadcast)
+ - [Round-trip time](#round-trip-time)
+ - [Use the Node.js streams API](#use-the-nodejs-streams-api)
+ - [Other examples](#other-examples)
+- [FAQ](#faq)
+ - [How to get the IP address of the client?](#how-to-get-the-ip-address-of-the-client)
+ - [How to detect and close broken connections?](#how-to-detect-and-close-broken-connections)
+ - [How to connect via a proxy?](#how-to-connect-via-a-proxy)
+- [Changelog](#changelog)
+- [License](#license)
+
+## Protocol support
+
+- **HyBi drafts 07-12** (Use the option `protocolVersion: 8`)
+- **HyBi drafts 13-17** (Current default, alternatively option
+ `protocolVersion: 13`)
+
+## Installing
+
+```
+npm install ws
+```
+
+### Opt-in for performance
+
+[bufferutil][] is an optional module that can be installed alongside the ws
+module:
+
+```
+npm install --save-optional bufferutil
+```
+
+This is a binary addon that improves the performance of certain operations such
+as masking and unmasking the data payload of the WebSocket frames. Prebuilt
+binaries are available for the most popular platforms, so you don't necessarily
+need to have a C++ compiler installed on your machine.
+
+To force ws to not use bufferutil, use the
+[`WS_NO_BUFFER_UTIL`](./doc/ws.md#ws_no_buffer_util) environment variable. This
+can be useful to enhance security in systems where a user can put a package in
+the package search path of an application of another user, due to how the
+Node.js resolver algorithm works.
+
+#### Legacy opt-in for performance
+
+If you are running on an old version of Node.js (prior to v18.14.0), ws also
+supports the [utf-8-validate][] module:
+
+```
+npm install --save-optional utf-8-validate
+```
+
+This contains a binary polyfill for [`buffer.isUtf8()`][].
+
+To force ws to not use utf-8-validate, use the
+[`WS_NO_UTF_8_VALIDATE`](./doc/ws.md#ws_no_utf_8_validate) environment variable.
+
+## API docs
+
+See [`/doc/ws.md`](./doc/ws.md) for Node.js-like documentation of ws classes and
+utility functions.
+
+## WebSocket compression
+
+ws supports the [permessage-deflate extension][permessage-deflate] which enables
+the client and server to negotiate a compression algorithm and its parameters,
+and then selectively apply it to the data payloads of each WebSocket message.
+
+The extension is disabled by default on the server and enabled by default on the
+client. It adds a significant overhead in terms of performance and memory
+consumption so we suggest to enable it only if it is really needed.
+
+Note that Node.js has a variety of issues with high-performance compression,
+where increased concurrency, especially on Linux, can lead to [catastrophic
+memory fragmentation][node-zlib-bug] and slow performance. If you intend to use
+permessage-deflate in production, it is worthwhile to set up a test
+representative of your workload and ensure Node.js/zlib will handle it with
+acceptable performance and memory usage.
+
+Tuning of permessage-deflate can be done via the options defined below. You can
+also use `zlibDeflateOptions` and `zlibInflateOptions`, which is passed directly
+into the creation of [raw deflate/inflate streams][node-zlib-deflaterawdocs].
+
+See [the docs][ws-server-options] for more options.
+
+```js
+import WebSocket, { WebSocketServer } from 'ws';
+
+const wss = new WebSocketServer({
+ port: 8080,
+ perMessageDeflate: {
+ zlibDeflateOptions: {
+ // See zlib defaults.
+ chunkSize: 1024,
+ memLevel: 7,
+ level: 3
+ },
+ zlibInflateOptions: {
+ chunkSize: 10 * 1024
+ },
+ // Other options settable:
+ clientNoContextTakeover: true, // Defaults to negotiated value.
+ serverNoContextTakeover: true, // Defaults to negotiated value.
+ serverMaxWindowBits: 10, // Defaults to negotiated value.
+ // Below options specified as default values.
+ concurrencyLimit: 10, // Limits zlib concurrency for perf.
+ threshold: 1024 // Size (in bytes) below which messages
+ // should not be compressed if context takeover is disabled.
+ }
+});
+```
+
+The client will only use the extension if it is supported and enabled on the
+server. To always disable the extension on the client set the
+`perMessageDeflate` option to `false`.
+
+```js
+import WebSocket from 'ws';
+
+const ws = new WebSocket('ws://www.host.com/path', {
+ perMessageDeflate: false
+});
+```
+
+## Usage examples
+
+### Sending and receiving text data
+
+```js
+import WebSocket from 'ws';
+
+const ws = new WebSocket('ws://www.host.com/path');
+
+ws.on('error', console.error);
+
+ws.on('open', function open() {
+ ws.send('something');
+});
+
+ws.on('message', function message(data) {
+ console.log('received: %s', data);
+});
+```
+
+### Sending binary data
+
+```js
+import WebSocket from 'ws';
+
+const ws = new WebSocket('ws://www.host.com/path');
+
+ws.on('error', console.error);
+
+ws.on('open', function open() {
+ const array = new Float32Array(5);
+
+ for (var i = 0; i < array.length; ++i) {
+ array[i] = i / 2;
+ }
+
+ ws.send(array);
+});
+```
+
+### Simple server
+
+```js
+import { WebSocketServer } from 'ws';
+
+const wss = new WebSocketServer({ port: 8080 });
+
+wss.on('connection', function connection(ws) {
+ ws.on('error', console.error);
+
+ ws.on('message', function message(data) {
+ console.log('received: %s', data);
+ });
+
+ ws.send('something');
+});
+```
+
+### External HTTP/S server
+
+```js
+import { createServer } from 'https';
+import { readFileSync } from 'fs';
+import { WebSocketServer } from 'ws';
+
+const server = createServer({
+ cert: readFileSync('/path/to/cert.pem'),
+ key: readFileSync('/path/to/key.pem')
+});
+const wss = new WebSocketServer({ server });
+
+wss.on('connection', function connection(ws) {
+ ws.on('error', console.error);
+
+ ws.on('message', function message(data) {
+ console.log('received: %s', data);
+ });
+
+ ws.send('something');
+});
+
+server.listen(8080);
+```
+
+### Multiple servers sharing a single HTTP/S server
+
+```js
+import { createServer } from 'http';
+import { parse } from 'url';
+import { WebSocketServer } from 'ws';
+
+const server = createServer();
+const wss1 = new WebSocketServer({ noServer: true });
+const wss2 = new WebSocketServer({ noServer: true });
+
+wss1.on('connection', function connection(ws) {
+ ws.on('error', console.error);
+
+ // ...
+});
+
+wss2.on('connection', function connection(ws) {
+ ws.on('error', console.error);
+
+ // ...
+});
+
+server.on('upgrade', function upgrade(request, socket, head) {
+ const { pathname } = parse(request.url);
+
+ if (pathname === '/foo') {
+ wss1.handleUpgrade(request, socket, head, function done(ws) {
+ wss1.emit('connection', ws, request);
+ });
+ } else if (pathname === '/bar') {
+ wss2.handleUpgrade(request, socket, head, function done(ws) {
+ wss2.emit('connection', ws, request);
+ });
+ } else {
+ socket.destroy();
+ }
+});
+
+server.listen(8080);
+```
+
+### Client authentication
+
+```js
+import { createServer } from 'http';
+import { WebSocketServer } from 'ws';
+
+function onSocketError(err) {
+ console.error(err);
+}
+
+const server = createServer();
+const wss = new WebSocketServer({ noServer: true });
+
+wss.on('connection', function connection(ws, request, client) {
+ ws.on('error', console.error);
+
+ ws.on('message', function message(data) {
+ console.log(`Received message ${data} from user ${client}`);
+ });
+});
+
+server.on('upgrade', function upgrade(request, socket, head) {
+ socket.on('error', onSocketError);
+
+ // This function is not defined on purpose. Implement it with your own logic.
+ authenticate(request, function next(err, client) {
+ if (err || !client) {
+ socket.write('HTTP/1.1 401 Unauthorized\r\n\r\n');
+ socket.destroy();
+ return;
+ }
+
+ socket.removeListener('error', onSocketError);
+
+ wss.handleUpgrade(request, socket, head, function done(ws) {
+ wss.emit('connection', ws, request, client);
+ });
+ });
+});
+
+server.listen(8080);
+```
+
+Also see the provided [example][session-parse-example] using `express-session`.
+
+### Server broadcast
+
+A client WebSocket broadcasting to all connected WebSocket clients, including
+itself.
+
+```js
+import WebSocket, { WebSocketServer } from 'ws';
+
+const wss = new WebSocketServer({ port: 8080 });
+
+wss.on('connection', function connection(ws) {
+ ws.on('error', console.error);
+
+ ws.on('message', function message(data, isBinary) {
+ wss.clients.forEach(function each(client) {
+ if (client.readyState === WebSocket.OPEN) {
+ client.send(data, { binary: isBinary });
+ }
+ });
+ });
+});
+```
+
+A client WebSocket broadcasting to every other connected WebSocket clients,
+excluding itself.
+
+```js
+import WebSocket, { WebSocketServer } from 'ws';
+
+const wss = new WebSocketServer({ port: 8080 });
+
+wss.on('connection', function connection(ws) {
+ ws.on('error', console.error);
+
+ ws.on('message', function message(data, isBinary) {
+ wss.clients.forEach(function each(client) {
+ if (client !== ws && client.readyState === WebSocket.OPEN) {
+ client.send(data, { binary: isBinary });
+ }
+ });
+ });
+});
+```
+
+### Round-trip time
+
+```js
+import WebSocket from 'ws';
+
+const ws = new WebSocket('wss://websocket-echo.com/');
+
+ws.on('error', console.error);
+
+ws.on('open', function open() {
+ console.log('connected');
+ ws.send(Date.now());
+});
+
+ws.on('close', function close() {
+ console.log('disconnected');
+});
+
+ws.on('message', function message(data) {
+ console.log(`Round-trip time: ${Date.now() - data} ms`);
+
+ setTimeout(function timeout() {
+ ws.send(Date.now());
+ }, 500);
+});
+```
+
+### Use the Node.js streams API
+
+```js
+import WebSocket, { createWebSocketStream } from 'ws';
+
+const ws = new WebSocket('wss://websocket-echo.com/');
+
+const duplex = createWebSocketStream(ws, { encoding: 'utf8' });
+
+duplex.on('error', console.error);
+
+duplex.pipe(process.stdout);
+process.stdin.pipe(duplex);
+```
+
+### Other examples
+
+For a full example with a browser client communicating with a ws server, see the
+examples folder.
+
+Otherwise, see the test cases.
+
+## FAQ
+
+### How to get the IP address of the client?
+
+The remote IP address can be obtained from the raw socket.
+
+```js
+import { WebSocketServer } from 'ws';
+
+const wss = new WebSocketServer({ port: 8080 });
+
+wss.on('connection', function connection(ws, req) {
+ const ip = req.socket.remoteAddress;
+
+ ws.on('error', console.error);
+});
+```
+
+When the server runs behind a proxy like NGINX, the de-facto standard is to use
+the `X-Forwarded-For` header.
+
+```js
+wss.on('connection', function connection(ws, req) {
+ const ip = req.headers['x-forwarded-for'].split(',')[0].trim();
+
+ ws.on('error', console.error);
+});
+```
+
+### How to detect and close broken connections?
+
+Sometimes the link between the server and the client can be interrupted in a way
+that keeps both the server and the client unaware of the broken state of the
+connection (e.g. when pulling the cord).
+
+In these cases ping messages can be used as a means to verify that the remote
+endpoint is still responsive.
+
+```js
+import { WebSocketServer } from 'ws';
+
+function heartbeat() {
+ this.isAlive = true;
+}
+
+const wss = new WebSocketServer({ port: 8080 });
+
+wss.on('connection', function connection(ws) {
+ ws.isAlive = true;
+ ws.on('error', console.error);
+ ws.on('pong', heartbeat);
+});
+
+const interval = setInterval(function ping() {
+ wss.clients.forEach(function each(ws) {
+ if (ws.isAlive === false) return ws.terminate();
+
+ ws.isAlive = false;
+ ws.ping();
+ });
+}, 30000);
+
+wss.on('close', function close() {
+ clearInterval(interval);
+});
+```
+
+Pong messages are automatically sent in response to ping messages as required by
+the spec.
+
+Just like the server example above your clients might as well lose connection
+without knowing it. You might want to add a ping listener on your clients to
+prevent that. A simple implementation would be:
+
+```js
+import WebSocket from 'ws';
+
+function heartbeat() {
+ clearTimeout(this.pingTimeout);
+
+ // Use `WebSocket#terminate()`, which immediately destroys the connection,
+ // instead of `WebSocket#close()`, which waits for the close timer.
+ // Delay should be equal to the interval at which your server
+ // sends out pings plus a conservative assumption of the latency.
+ this.pingTimeout = setTimeout(() => {
+ this.terminate();
+ }, 30000 + 1000);
+}
+
+const client = new WebSocket('wss://websocket-echo.com/');
+
+client.on('error', console.error);
+client.on('open', heartbeat);
+client.on('ping', heartbeat);
+client.on('close', function clear() {
+ clearTimeout(this.pingTimeout);
+});
+```
+
+### How to connect via a proxy?
+
+Use a custom `http.Agent` implementation like [https-proxy-agent][] or
+[socks-proxy-agent][].
+
+## Changelog
+
+We're using the GitHub [releases][changelog] for changelog entries.
+
+## License
+
+[MIT](LICENSE)
+
+[`buffer.isutf8()`]: https://nodejs.org/api/buffer.html#bufferisutf8input
+[bufferutil]: https://github.com/websockets/bufferutil
+[changelog]: https://github.com/websockets/ws/releases
+[client-report]: http://websockets.github.io/ws/autobahn/clients/
+[https-proxy-agent]: https://github.com/TooTallNate/node-https-proxy-agent
+[node-zlib-bug]: https://github.com/nodejs/node/issues/8871
+[node-zlib-deflaterawdocs]:
+ https://nodejs.org/api/zlib.html#zlib_zlib_createdeflateraw_options
+[permessage-deflate]: https://tools.ietf.org/html/rfc7692
+[server-report]: http://websockets.github.io/ws/autobahn/servers/
+[session-parse-example]: ./examples/express-session-parse
+[socks-proxy-agent]: https://github.com/TooTallNate/node-socks-proxy-agent
+[utf-8-validate]: https://github.com/websockets/utf-8-validate
+[ws-server-options]: ./doc/ws.md#new-websocketserveroptions-callback
diff --git a/client/node_modules/ws/browser.js b/client/node_modules/ws/browser.js
new file mode 100644
index 0000000..ca4f628
--- /dev/null
+++ b/client/node_modules/ws/browser.js
@@ -0,0 +1,8 @@
+'use strict';
+
+module.exports = function () {
+ throw new Error(
+ 'ws does not work in the browser. Browser clients must use the native ' +
+ 'WebSocket object'
+ );
+};
diff --git a/client/node_modules/ws/index.js b/client/node_modules/ws/index.js
new file mode 100644
index 0000000..41edb3b
--- /dev/null
+++ b/client/node_modules/ws/index.js
@@ -0,0 +1,13 @@
+'use strict';
+
+const WebSocket = require('./lib/websocket');
+
+WebSocket.createWebSocketStream = require('./lib/stream');
+WebSocket.Server = require('./lib/websocket-server');
+WebSocket.Receiver = require('./lib/receiver');
+WebSocket.Sender = require('./lib/sender');
+
+WebSocket.WebSocket = WebSocket;
+WebSocket.WebSocketServer = WebSocket.Server;
+
+module.exports = WebSocket;
diff --git a/client/node_modules/ws/lib/buffer-util.js b/client/node_modules/ws/lib/buffer-util.js
new file mode 100644
index 0000000..f7536e2
--- /dev/null
+++ b/client/node_modules/ws/lib/buffer-util.js
@@ -0,0 +1,131 @@
+'use strict';
+
+const { EMPTY_BUFFER } = require('./constants');
+
+const FastBuffer = Buffer[Symbol.species];
+
+/**
+ * Merges an array of buffers into a new buffer.
+ *
+ * @param {Buffer[]} list The array of buffers to concat
+ * @param {Number} totalLength The total length of buffers in the list
+ * @return {Buffer} The resulting buffer
+ * @public
+ */
+function concat(list, totalLength) {
+ if (list.length === 0) return EMPTY_BUFFER;
+ if (list.length === 1) return list[0];
+
+ const target = Buffer.allocUnsafe(totalLength);
+ let offset = 0;
+
+ for (let i = 0; i < list.length; i++) {
+ const buf = list[i];
+ target.set(buf, offset);
+ offset += buf.length;
+ }
+
+ if (offset < totalLength) {
+ return new FastBuffer(target.buffer, target.byteOffset, offset);
+ }
+
+ return target;
+}
+
+/**
+ * Masks a buffer using the given mask.
+ *
+ * @param {Buffer} source The buffer to mask
+ * @param {Buffer} mask The mask to use
+ * @param {Buffer} output The buffer where to store the result
+ * @param {Number} offset The offset at which to start writing
+ * @param {Number} length The number of bytes to mask.
+ * @public
+ */
+function _mask(source, mask, output, offset, length) {
+ for (let i = 0; i < length; i++) {
+ output[offset + i] = source[i] ^ mask[i & 3];
+ }
+}
+
+/**
+ * Unmasks a buffer using the given mask.
+ *
+ * @param {Buffer} buffer The buffer to unmask
+ * @param {Buffer} mask The mask to use
+ * @public
+ */
+function _unmask(buffer, mask) {
+ for (let i = 0; i < buffer.length; i++) {
+ buffer[i] ^= mask[i & 3];
+ }
+}
+
+/**
+ * Converts a buffer to an `ArrayBuffer`.
+ *
+ * @param {Buffer} buf The buffer to convert
+ * @return {ArrayBuffer} Converted buffer
+ * @public
+ */
+function toArrayBuffer(buf) {
+ if (buf.length === buf.buffer.byteLength) {
+ return buf.buffer;
+ }
+
+ return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.length);
+}
+
+/**
+ * Converts `data` to a `Buffer`.
+ *
+ * @param {*} data The data to convert
+ * @return {Buffer} The buffer
+ * @throws {TypeError}
+ * @public
+ */
+function toBuffer(data) {
+ toBuffer.readOnly = true;
+
+ if (Buffer.isBuffer(data)) return data;
+
+ let buf;
+
+ if (data instanceof ArrayBuffer) {
+ buf = new FastBuffer(data);
+ } else if (ArrayBuffer.isView(data)) {
+ buf = new FastBuffer(data.buffer, data.byteOffset, data.byteLength);
+ } else {
+ buf = Buffer.from(data);
+ toBuffer.readOnly = false;
+ }
+
+ return buf;
+}
+
+module.exports = {
+ concat,
+ mask: _mask,
+ toArrayBuffer,
+ toBuffer,
+ unmask: _unmask
+};
+
+/* istanbul ignore else */
+if (!process.env.WS_NO_BUFFER_UTIL) {
+ try {
+ const bufferUtil = require('bufferutil');
+
+ module.exports.mask = function (source, mask, output, offset, length) {
+ if (length < 48) _mask(source, mask, output, offset, length);
+ else bufferUtil.mask(source, mask, output, offset, length);
+ };
+
+ module.exports.unmask = function (buffer, mask) {
+ if (buffer.length < 32) _unmask(buffer, mask);
+ else bufferUtil.unmask(buffer, mask);
+ };
+ } catch (e) {
+ // Continue regardless of the error.
+ }
+}
diff --git a/client/node_modules/ws/lib/constants.js b/client/node_modules/ws/lib/constants.js
new file mode 100644
index 0000000..d691b30
--- /dev/null
+++ b/client/node_modules/ws/lib/constants.js
@@ -0,0 +1,12 @@
+'use strict';
+
+module.exports = {
+ BINARY_TYPES: ['nodebuffer', 'arraybuffer', 'fragments'],
+ EMPTY_BUFFER: Buffer.alloc(0),
+ GUID: '258EAFA5-E914-47DA-95CA-C5AB0DC85B11',
+ kForOnEventAttribute: Symbol('kIsForOnEventAttribute'),
+ kListener: Symbol('kListener'),
+ kStatusCode: Symbol('status-code'),
+ kWebSocket: Symbol('websocket'),
+ NOOP: () => {}
+};
diff --git a/client/node_modules/ws/lib/event-target.js b/client/node_modules/ws/lib/event-target.js
new file mode 100644
index 0000000..fea4cbc
--- /dev/null
+++ b/client/node_modules/ws/lib/event-target.js
@@ -0,0 +1,292 @@
+'use strict';
+
+const { kForOnEventAttribute, kListener } = require('./constants');
+
+const kCode = Symbol('kCode');
+const kData = Symbol('kData');
+const kError = Symbol('kError');
+const kMessage = Symbol('kMessage');
+const kReason = Symbol('kReason');
+const kTarget = Symbol('kTarget');
+const kType = Symbol('kType');
+const kWasClean = Symbol('kWasClean');
+
+/**
+ * Class representing an event.
+ */
+class Event {
+ /**
+ * Create a new `Event`.
+ *
+ * @param {String} type The name of the event
+ * @throws {TypeError} If the `type` argument is not specified
+ */
+ constructor(type) {
+ this[kTarget] = null;
+ this[kType] = type;
+ }
+
+ /**
+ * @type {*}
+ */
+ get target() {
+ return this[kTarget];
+ }
+
+ /**
+ * @type {String}
+ */
+ get type() {
+ return this[kType];
+ }
+}
+
+Object.defineProperty(Event.prototype, 'target', { enumerable: true });
+Object.defineProperty(Event.prototype, 'type', { enumerable: true });
+
+/**
+ * Class representing a close event.
+ *
+ * @extends Event
+ */
+class CloseEvent extends Event {
+ /**
+ * Create a new `CloseEvent`.
+ *
+ * @param {String} type The name of the event
+ * @param {Object} [options] A dictionary object that allows for setting
+ * attributes via object members of the same name
+ * @param {Number} [options.code=0] The status code explaining why the
+ * connection was closed
+ * @param {String} [options.reason=''] A human-readable string explaining why
+ * the connection was closed
+ * @param {Boolean} [options.wasClean=false] Indicates whether or not the
+ * connection was cleanly closed
+ */
+ constructor(type, options = {}) {
+ super(type);
+
+ this[kCode] = options.code === undefined ? 0 : options.code;
+ this[kReason] = options.reason === undefined ? '' : options.reason;
+ this[kWasClean] = options.wasClean === undefined ? false : options.wasClean;
+ }
+
+ /**
+ * @type {Number}
+ */
+ get code() {
+ return this[kCode];
+ }
+
+ /**
+ * @type {String}
+ */
+ get reason() {
+ return this[kReason];
+ }
+
+ /**
+ * @type {Boolean}
+ */
+ get wasClean() {
+ return this[kWasClean];
+ }
+}
+
+Object.defineProperty(CloseEvent.prototype, 'code', { enumerable: true });
+Object.defineProperty(CloseEvent.prototype, 'reason', { enumerable: true });
+Object.defineProperty(CloseEvent.prototype, 'wasClean', { enumerable: true });
+
+/**
+ * Class representing an error event.
+ *
+ * @extends Event
+ */
+class ErrorEvent extends Event {
+ /**
+ * Create a new `ErrorEvent`.
+ *
+ * @param {String} type The name of the event
+ * @param {Object} [options] A dictionary object that allows for setting
+ * attributes via object members of the same name
+ * @param {*} [options.error=null] The error that generated this event
+ * @param {String} [options.message=''] The error message
+ */
+ constructor(type, options = {}) {
+ super(type);
+
+ this[kError] = options.error === undefined ? null : options.error;
+ this[kMessage] = options.message === undefined ? '' : options.message;
+ }
+
+ /**
+ * @type {*}
+ */
+ get error() {
+ return this[kError];
+ }
+
+ /**
+ * @type {String}
+ */
+ get message() {
+ return this[kMessage];
+ }
+}
+
+Object.defineProperty(ErrorEvent.prototype, 'error', { enumerable: true });
+Object.defineProperty(ErrorEvent.prototype, 'message', { enumerable: true });
+
+/**
+ * Class representing a message event.
+ *
+ * @extends Event
+ */
+class MessageEvent extends Event {
+ /**
+ * Create a new `MessageEvent`.
+ *
+ * @param {String} type The name of the event
+ * @param {Object} [options] A dictionary object that allows for setting
+ * attributes via object members of the same name
+ * @param {*} [options.data=null] The message content
+ */
+ constructor(type, options = {}) {
+ super(type);
+
+ this[kData] = options.data === undefined ? null : options.data;
+ }
+
+ /**
+ * @type {*}
+ */
+ get data() {
+ return this[kData];
+ }
+}
+
+Object.defineProperty(MessageEvent.prototype, 'data', { enumerable: true });
+
+/**
+ * This provides methods for emulating the `EventTarget` interface. It's not
+ * meant to be used directly.
+ *
+ * @mixin
+ */
+const EventTarget = {
+ /**
+ * Register an event listener.
+ *
+ * @param {String} type A string representing the event type to listen for
+ * @param {(Function|Object)} handler The listener to add
+ * @param {Object} [options] An options object specifies characteristics about
+ * the event listener
+ * @param {Boolean} [options.once=false] A `Boolean` indicating that the
+ * listener should be invoked at most once after being added. If `true`,
+ * the listener would be automatically removed when invoked.
+ * @public
+ */
+ addEventListener(type, handler, options = {}) {
+ for (const listener of this.listeners(type)) {
+ if (
+ !options[kForOnEventAttribute] &&
+ listener[kListener] === handler &&
+ !listener[kForOnEventAttribute]
+ ) {
+ return;
+ }
+ }
+
+ let wrapper;
+
+ if (type === 'message') {
+ wrapper = function onMessage(data, isBinary) {
+ const event = new MessageEvent('message', {
+ data: isBinary ? data : data.toString()
+ });
+
+ event[kTarget] = this;
+ callListener(handler, this, event);
+ };
+ } else if (type === 'close') {
+ wrapper = function onClose(code, message) {
+ const event = new CloseEvent('close', {
+ code,
+ reason: message.toString(),
+ wasClean: this._closeFrameReceived && this._closeFrameSent
+ });
+
+ event[kTarget] = this;
+ callListener(handler, this, event);
+ };
+ } else if (type === 'error') {
+ wrapper = function onError(error) {
+ const event = new ErrorEvent('error', {
+ error,
+ message: error.message
+ });
+
+ event[kTarget] = this;
+ callListener(handler, this, event);
+ };
+ } else if (type === 'open') {
+ wrapper = function onOpen() {
+ const event = new Event('open');
+
+ event[kTarget] = this;
+ callListener(handler, this, event);
+ };
+ } else {
+ return;
+ }
+
+ wrapper[kForOnEventAttribute] = !!options[kForOnEventAttribute];
+ wrapper[kListener] = handler;
+
+ if (options.once) {
+ this.once(type, wrapper);
+ } else {
+ this.on(type, wrapper);
+ }
+ },
+
+ /**
+ * Remove an event listener.
+ *
+ * @param {String} type A string representing the event type to remove
+ * @param {(Function|Object)} handler The listener to remove
+ * @public
+ */
+ removeEventListener(type, handler) {
+ for (const listener of this.listeners(type)) {
+ if (listener[kListener] === handler && !listener[kForOnEventAttribute]) {
+ this.removeListener(type, listener);
+ break;
+ }
+ }
+ }
+};
+
+module.exports = {
+ CloseEvent,
+ ErrorEvent,
+ Event,
+ EventTarget,
+ MessageEvent
+};
+
+/**
+ * Call an event listener
+ *
+ * @param {(Function|Object)} listener The listener to call
+ * @param {*} thisArg The value to use as `this`` when calling the listener
+ * @param {Event} event The event to pass to the listener
+ * @private
+ */
+function callListener(listener, thisArg, event) {
+ if (typeof listener === 'object' && listener.handleEvent) {
+ listener.handleEvent.call(listener, event);
+ } else {
+ listener.call(thisArg, event);
+ }
+}
diff --git a/client/node_modules/ws/lib/extension.js b/client/node_modules/ws/lib/extension.js
new file mode 100644
index 0000000..3d7895c
--- /dev/null
+++ b/client/node_modules/ws/lib/extension.js
@@ -0,0 +1,203 @@
+'use strict';
+
+const { tokenChars } = require('./validation');
+
+/**
+ * Adds an offer to the map of extension offers or a parameter to the map of
+ * parameters.
+ *
+ * @param {Object} dest The map of extension offers or parameters
+ * @param {String} name The extension or parameter name
+ * @param {(Object|Boolean|String)} elem The extension parameters or the
+ * parameter value
+ * @private
+ */
+function push(dest, name, elem) {
+ if (dest[name] === undefined) dest[name] = [elem];
+ else dest[name].push(elem);
+}
+
+/**
+ * Parses the `Sec-WebSocket-Extensions` header into an object.
+ *
+ * @param {String} header The field value of the header
+ * @return {Object} The parsed object
+ * @public
+ */
+function parse(header) {
+ const offers = Object.create(null);
+ let params = Object.create(null);
+ let mustUnescape = false;
+ let isEscaping = false;
+ let inQuotes = false;
+ let extensionName;
+ let paramName;
+ let start = -1;
+ let code = -1;
+ let end = -1;
+ let i = 0;
+
+ for (; i < header.length; i++) {
+ code = header.charCodeAt(i);
+
+ if (extensionName === undefined) {
+ if (end === -1 && tokenChars[code] === 1) {
+ if (start === -1) start = i;
+ } else if (
+ i !== 0 &&
+ (code === 0x20 /* ' ' */ || code === 0x09) /* '\t' */
+ ) {
+ if (end === -1 && start !== -1) end = i;
+ } else if (code === 0x3b /* ';' */ || code === 0x2c /* ',' */) {
+ if (start === -1) {
+ throw new SyntaxError(`Unexpected character at index ${i}`);
+ }
+
+ if (end === -1) end = i;
+ const name = header.slice(start, end);
+ if (code === 0x2c) {
+ push(offers, name, params);
+ params = Object.create(null);
+ } else {
+ extensionName = name;
+ }
+
+ start = end = -1;
+ } else {
+ throw new SyntaxError(`Unexpected character at index ${i}`);
+ }
+ } else if (paramName === undefined) {
+ if (end === -1 && tokenChars[code] === 1) {
+ if (start === -1) start = i;
+ } else if (code === 0x20 || code === 0x09) {
+ if (end === -1 && start !== -1) end = i;
+ } else if (code === 0x3b || code === 0x2c) {
+ if (start === -1) {
+ throw new SyntaxError(`Unexpected character at index ${i}`);
+ }
+
+ if (end === -1) end = i;
+ push(params, header.slice(start, end), true);
+ if (code === 0x2c) {
+ push(offers, extensionName, params);
+ params = Object.create(null);
+ extensionName = undefined;
+ }
+
+ start = end = -1;
+ } else if (code === 0x3d /* '=' */ && start !== -1 && end === -1) {
+ paramName = header.slice(start, i);
+ start = end = -1;
+ } else {
+ throw new SyntaxError(`Unexpected character at index ${i}`);
+ }
+ } else {
+ //
+ // The value of a quoted-string after unescaping must conform to the
+ // token ABNF, so only token characters are valid.
+ // Ref: https://tools.ietf.org/html/rfc6455#section-9.1
+ //
+ if (isEscaping) {
+ if (tokenChars[code] !== 1) {
+ throw new SyntaxError(`Unexpected character at index ${i}`);
+ }
+ if (start === -1) start = i;
+ else if (!mustUnescape) mustUnescape = true;
+ isEscaping = false;
+ } else if (inQuotes) {
+ if (tokenChars[code] === 1) {
+ if (start === -1) start = i;
+ } else if (code === 0x22 /* '"' */ && start !== -1) {
+ inQuotes = false;
+ end = i;
+ } else if (code === 0x5c /* '\' */) {
+ isEscaping = true;
+ } else {
+ throw new SyntaxError(`Unexpected character at index ${i}`);
+ }
+ } else if (code === 0x22 && header.charCodeAt(i - 1) === 0x3d) {
+ inQuotes = true;
+ } else if (end === -1 && tokenChars[code] === 1) {
+ if (start === -1) start = i;
+ } else if (start !== -1 && (code === 0x20 || code === 0x09)) {
+ if (end === -1) end = i;
+ } else if (code === 0x3b || code === 0x2c) {
+ if (start === -1) {
+ throw new SyntaxError(`Unexpected character at index ${i}`);
+ }
+
+ if (end === -1) end = i;
+ let value = header.slice(start, end);
+ if (mustUnescape) {
+ value = value.replace(/\\/g, '');
+ mustUnescape = false;
+ }
+ push(params, paramName, value);
+ if (code === 0x2c) {
+ push(offers, extensionName, params);
+ params = Object.create(null);
+ extensionName = undefined;
+ }
+
+ paramName = undefined;
+ start = end = -1;
+ } else {
+ throw new SyntaxError(`Unexpected character at index ${i}`);
+ }
+ }
+ }
+
+ if (start === -1 || inQuotes || code === 0x20 || code === 0x09) {
+ throw new SyntaxError('Unexpected end of input');
+ }
+
+ if (end === -1) end = i;
+ const token = header.slice(start, end);
+ if (extensionName === undefined) {
+ push(offers, token, params);
+ } else {
+ if (paramName === undefined) {
+ push(params, token, true);
+ } else if (mustUnescape) {
+ push(params, paramName, token.replace(/\\/g, ''));
+ } else {
+ push(params, paramName, token);
+ }
+ push(offers, extensionName, params);
+ }
+
+ return offers;
+}
+
+/**
+ * Builds the `Sec-WebSocket-Extensions` header field value.
+ *
+ * @param {Object} extensions The map of extensions and parameters to format
+ * @return {String} A string representing the given object
+ * @public
+ */
+function format(extensions) {
+ return Object.keys(extensions)
+ .map((extension) => {
+ let configurations = extensions[extension];
+ if (!Array.isArray(configurations)) configurations = [configurations];
+ return configurations
+ .map((params) => {
+ return [extension]
+ .concat(
+ Object.keys(params).map((k) => {
+ let values = params[k];
+ if (!Array.isArray(values)) values = [values];
+ return values
+ .map((v) => (v === true ? k : `${k}=${v}`))
+ .join('; ');
+ })
+ )
+ .join('; ');
+ })
+ .join(', ');
+ })
+ .join(', ');
+}
+
+module.exports = { format, parse };
diff --git a/client/node_modules/ws/lib/limiter.js b/client/node_modules/ws/lib/limiter.js
new file mode 100644
index 0000000..3fd3578
--- /dev/null
+++ b/client/node_modules/ws/lib/limiter.js
@@ -0,0 +1,55 @@
+'use strict';
+
+const kDone = Symbol('kDone');
+const kRun = Symbol('kRun');
+
+/**
+ * A very simple job queue with adjustable concurrency. Adapted from
+ * https://github.com/STRML/async-limiter
+ */
+class Limiter {
+ /**
+ * Creates a new `Limiter`.
+ *
+ * @param {Number} [concurrency=Infinity] The maximum number of jobs allowed
+ * to run concurrently
+ */
+ constructor(concurrency) {
+ this[kDone] = () => {
+ this.pending--;
+ this[kRun]();
+ };
+ this.concurrency = concurrency || Infinity;
+ this.jobs = [];
+ this.pending = 0;
+ }
+
+ /**
+ * Adds a job to the queue.
+ *
+ * @param {Function} job The job to run
+ * @public
+ */
+ add(job) {
+ this.jobs.push(job);
+ this[kRun]();
+ }
+
+ /**
+ * Removes a job from the queue and runs it if possible.
+ *
+ * @private
+ */
+ [kRun]() {
+ if (this.pending === this.concurrency) return;
+
+ if (this.jobs.length) {
+ const job = this.jobs.shift();
+
+ this.pending++;
+ job(this[kDone]);
+ }
+ }
+}
+
+module.exports = Limiter;
diff --git a/client/node_modules/ws/lib/permessage-deflate.js b/client/node_modules/ws/lib/permessage-deflate.js
new file mode 100644
index 0000000..77d918b
--- /dev/null
+++ b/client/node_modules/ws/lib/permessage-deflate.js
@@ -0,0 +1,514 @@
+'use strict';
+
+const zlib = require('zlib');
+
+const bufferUtil = require('./buffer-util');
+const Limiter = require('./limiter');
+const { kStatusCode } = require('./constants');
+
+const FastBuffer = Buffer[Symbol.species];
+const TRAILER = Buffer.from([0x00, 0x00, 0xff, 0xff]);
+const kPerMessageDeflate = Symbol('permessage-deflate');
+const kTotalLength = Symbol('total-length');
+const kCallback = Symbol('callback');
+const kBuffers = Symbol('buffers');
+const kError = Symbol('error');
+
+//
+// We limit zlib concurrency, which prevents severe memory fragmentation
+// as documented in https://github.com/nodejs/node/issues/8871#issuecomment-250915913
+// and https://github.com/websockets/ws/issues/1202
+//
+// Intentionally global; it's the global thread pool that's an issue.
+//
+let zlibLimiter;
+
+/**
+ * permessage-deflate implementation.
+ */
+class PerMessageDeflate {
+ /**
+ * Creates a PerMessageDeflate instance.
+ *
+ * @param {Object} [options] Configuration options
+ * @param {(Boolean|Number)} [options.clientMaxWindowBits] Advertise support
+ * for, or request, a custom client window size
+ * @param {Boolean} [options.clientNoContextTakeover=false] Advertise/
+ * acknowledge disabling of client context takeover
+ * @param {Number} [options.concurrencyLimit=10] The number of concurrent
+ * calls to zlib
+ * @param {(Boolean|Number)} [options.serverMaxWindowBits] Request/confirm the
+ * use of a custom server window size
+ * @param {Boolean} [options.serverNoContextTakeover=false] Request/accept
+ * disabling of server context takeover
+ * @param {Number} [options.threshold=1024] Size (in bytes) below which
+ * messages should not be compressed if context takeover is disabled
+ * @param {Object} [options.zlibDeflateOptions] Options to pass to zlib on
+ * deflate
+ * @param {Object} [options.zlibInflateOptions] Options to pass to zlib on
+ * inflate
+ * @param {Boolean} [isServer=false] Create the instance in either server or
+ * client mode
+ * @param {Number} [maxPayload=0] The maximum allowed message length
+ */
+ constructor(options, isServer, maxPayload) {
+ this._maxPayload = maxPayload | 0;
+ this._options = options || {};
+ this._threshold =
+ this._options.threshold !== undefined ? this._options.threshold : 1024;
+ this._isServer = !!isServer;
+ this._deflate = null;
+ this._inflate = null;
+
+ this.params = null;
+
+ if (!zlibLimiter) {
+ const concurrency =
+ this._options.concurrencyLimit !== undefined
+ ? this._options.concurrencyLimit
+ : 10;
+ zlibLimiter = new Limiter(concurrency);
+ }
+ }
+
+ /**
+ * @type {String}
+ */
+ static get extensionName() {
+ return 'permessage-deflate';
+ }
+
+ /**
+ * Create an extension negotiation offer.
+ *
+ * @return {Object} Extension parameters
+ * @public
+ */
+ offer() {
+ const params = {};
+
+ if (this._options.serverNoContextTakeover) {
+ params.server_no_context_takeover = true;
+ }
+ if (this._options.clientNoContextTakeover) {
+ params.client_no_context_takeover = true;
+ }
+ if (this._options.serverMaxWindowBits) {
+ params.server_max_window_bits = this._options.serverMaxWindowBits;
+ }
+ if (this._options.clientMaxWindowBits) {
+ params.client_max_window_bits = this._options.clientMaxWindowBits;
+ } else if (this._options.clientMaxWindowBits == null) {
+ params.client_max_window_bits = true;
+ }
+
+ return params;
+ }
+
+ /**
+ * Accept an extension negotiation offer/response.
+ *
+ * @param {Array} configurations The extension negotiation offers/reponse
+ * @return {Object} Accepted configuration
+ * @public
+ */
+ accept(configurations) {
+ configurations = this.normalizeParams(configurations);
+
+ this.params = this._isServer
+ ? this.acceptAsServer(configurations)
+ : this.acceptAsClient(configurations);
+
+ return this.params;
+ }
+
+ /**
+ * Releases all resources used by the extension.
+ *
+ * @public
+ */
+ cleanup() {
+ if (this._inflate) {
+ this._inflate.close();
+ this._inflate = null;
+ }
+
+ if (this._deflate) {
+ const callback = this._deflate[kCallback];
+
+ this._deflate.close();
+ this._deflate = null;
+
+ if (callback) {
+ callback(
+ new Error(
+ 'The deflate stream was closed while data was being processed'
+ )
+ );
+ }
+ }
+ }
+
+ /**
+ * Accept an extension negotiation offer.
+ *
+ * @param {Array} offers The extension negotiation offers
+ * @return {Object} Accepted configuration
+ * @private
+ */
+ acceptAsServer(offers) {
+ const opts = this._options;
+ const accepted = offers.find((params) => {
+ if (
+ (opts.serverNoContextTakeover === false &&
+ params.server_no_context_takeover) ||
+ (params.server_max_window_bits &&
+ (opts.serverMaxWindowBits === false ||
+ (typeof opts.serverMaxWindowBits === 'number' &&
+ opts.serverMaxWindowBits > params.server_max_window_bits))) ||
+ (typeof opts.clientMaxWindowBits === 'number' &&
+ !params.client_max_window_bits)
+ ) {
+ return false;
+ }
+
+ return true;
+ });
+
+ if (!accepted) {
+ throw new Error('None of the extension offers can be accepted');
+ }
+
+ if (opts.serverNoContextTakeover) {
+ accepted.server_no_context_takeover = true;
+ }
+ if (opts.clientNoContextTakeover) {
+ accepted.client_no_context_takeover = true;
+ }
+ if (typeof opts.serverMaxWindowBits === 'number') {
+ accepted.server_max_window_bits = opts.serverMaxWindowBits;
+ }
+ if (typeof opts.clientMaxWindowBits === 'number') {
+ accepted.client_max_window_bits = opts.clientMaxWindowBits;
+ } else if (
+ accepted.client_max_window_bits === true ||
+ opts.clientMaxWindowBits === false
+ ) {
+ delete accepted.client_max_window_bits;
+ }
+
+ return accepted;
+ }
+
+ /**
+ * Accept the extension negotiation response.
+ *
+ * @param {Array} response The extension negotiation response
+ * @return {Object} Accepted configuration
+ * @private
+ */
+ acceptAsClient(response) {
+ const params = response[0];
+
+ if (
+ this._options.clientNoContextTakeover === false &&
+ params.client_no_context_takeover
+ ) {
+ throw new Error('Unexpected parameter "client_no_context_takeover"');
+ }
+
+ if (!params.client_max_window_bits) {
+ if (typeof this._options.clientMaxWindowBits === 'number') {
+ params.client_max_window_bits = this._options.clientMaxWindowBits;
+ }
+ } else if (
+ this._options.clientMaxWindowBits === false ||
+ (typeof this._options.clientMaxWindowBits === 'number' &&
+ params.client_max_window_bits > this._options.clientMaxWindowBits)
+ ) {
+ throw new Error(
+ 'Unexpected or invalid parameter "client_max_window_bits"'
+ );
+ }
+
+ return params;
+ }
+
+ /**
+ * Normalize parameters.
+ *
+ * @param {Array} configurations The extension negotiation offers/reponse
+ * @return {Array} The offers/response with normalized parameters
+ * @private
+ */
+ normalizeParams(configurations) {
+ configurations.forEach((params) => {
+ Object.keys(params).forEach((key) => {
+ let value = params[key];
+
+ if (value.length > 1) {
+ throw new Error(`Parameter "${key}" must have only a single value`);
+ }
+
+ value = value[0];
+
+ if (key === 'client_max_window_bits') {
+ if (value !== true) {
+ const num = +value;
+ if (!Number.isInteger(num) || num < 8 || num > 15) {
+ throw new TypeError(
+ `Invalid value for parameter "${key}": ${value}`
+ );
+ }
+ value = num;
+ } else if (!this._isServer) {
+ throw new TypeError(
+ `Invalid value for parameter "${key}": ${value}`
+ );
+ }
+ } else if (key === 'server_max_window_bits') {
+ const num = +value;
+ if (!Number.isInteger(num) || num < 8 || num > 15) {
+ throw new TypeError(
+ `Invalid value for parameter "${key}": ${value}`
+ );
+ }
+ value = num;
+ } else if (
+ key === 'client_no_context_takeover' ||
+ key === 'server_no_context_takeover'
+ ) {
+ if (value !== true) {
+ throw new TypeError(
+ `Invalid value for parameter "${key}": ${value}`
+ );
+ }
+ } else {
+ throw new Error(`Unknown parameter "${key}"`);
+ }
+
+ params[key] = value;
+ });
+ });
+
+ return configurations;
+ }
+
+ /**
+ * Decompress data. Concurrency limited.
+ *
+ * @param {Buffer} data Compressed data
+ * @param {Boolean} fin Specifies whether or not this is the last fragment
+ * @param {Function} callback Callback
+ * @public
+ */
+ decompress(data, fin, callback) {
+ zlibLimiter.add((done) => {
+ this._decompress(data, fin, (err, result) => {
+ done();
+ callback(err, result);
+ });
+ });
+ }
+
+ /**
+ * Compress data. Concurrency limited.
+ *
+ * @param {(Buffer|String)} data Data to compress
+ * @param {Boolean} fin Specifies whether or not this is the last fragment
+ * @param {Function} callback Callback
+ * @public
+ */
+ compress(data, fin, callback) {
+ zlibLimiter.add((done) => {
+ this._compress(data, fin, (err, result) => {
+ done();
+ callback(err, result);
+ });
+ });
+ }
+
+ /**
+ * Decompress data.
+ *
+ * @param {Buffer} data Compressed data
+ * @param {Boolean} fin Specifies whether or not this is the last fragment
+ * @param {Function} callback Callback
+ * @private
+ */
+ _decompress(data, fin, callback) {
+ const endpoint = this._isServer ? 'client' : 'server';
+
+ if (!this._inflate) {
+ const key = `${endpoint}_max_window_bits`;
+ const windowBits =
+ typeof this.params[key] !== 'number'
+ ? zlib.Z_DEFAULT_WINDOWBITS
+ : this.params[key];
+
+ this._inflate = zlib.createInflateRaw({
+ ...this._options.zlibInflateOptions,
+ windowBits
+ });
+ this._inflate[kPerMessageDeflate] = this;
+ this._inflate[kTotalLength] = 0;
+ this._inflate[kBuffers] = [];
+ this._inflate.on('error', inflateOnError);
+ this._inflate.on('data', inflateOnData);
+ }
+
+ this._inflate[kCallback] = callback;
+
+ this._inflate.write(data);
+ if (fin) this._inflate.write(TRAILER);
+
+ this._inflate.flush(() => {
+ const err = this._inflate[kError];
+
+ if (err) {
+ this._inflate.close();
+ this._inflate = null;
+ callback(err);
+ return;
+ }
+
+ const data = bufferUtil.concat(
+ this._inflate[kBuffers],
+ this._inflate[kTotalLength]
+ );
+
+ if (this._inflate._readableState.endEmitted) {
+ this._inflate.close();
+ this._inflate = null;
+ } else {
+ this._inflate[kTotalLength] = 0;
+ this._inflate[kBuffers] = [];
+
+ if (fin && this.params[`${endpoint}_no_context_takeover`]) {
+ this._inflate.reset();
+ }
+ }
+
+ callback(null, data);
+ });
+ }
+
+ /**
+ * Compress data.
+ *
+ * @param {(Buffer|String)} data Data to compress
+ * @param {Boolean} fin Specifies whether or not this is the last fragment
+ * @param {Function} callback Callback
+ * @private
+ */
+ _compress(data, fin, callback) {
+ const endpoint = this._isServer ? 'server' : 'client';
+
+ if (!this._deflate) {
+ const key = `${endpoint}_max_window_bits`;
+ const windowBits =
+ typeof this.params[key] !== 'number'
+ ? zlib.Z_DEFAULT_WINDOWBITS
+ : this.params[key];
+
+ this._deflate = zlib.createDeflateRaw({
+ ...this._options.zlibDeflateOptions,
+ windowBits
+ });
+
+ this._deflate[kTotalLength] = 0;
+ this._deflate[kBuffers] = [];
+
+ this._deflate.on('data', deflateOnData);
+ }
+
+ this._deflate[kCallback] = callback;
+
+ this._deflate.write(data);
+ this._deflate.flush(zlib.Z_SYNC_FLUSH, () => {
+ if (!this._deflate) {
+ //
+ // The deflate stream was closed while data was being processed.
+ //
+ return;
+ }
+
+ let data = bufferUtil.concat(
+ this._deflate[kBuffers],
+ this._deflate[kTotalLength]
+ );
+
+ if (fin) {
+ data = new FastBuffer(data.buffer, data.byteOffset, data.length - 4);
+ }
+
+ //
+ // Ensure that the callback will not be called again in
+ // `PerMessageDeflate#cleanup()`.
+ //
+ this._deflate[kCallback] = null;
+
+ this._deflate[kTotalLength] = 0;
+ this._deflate[kBuffers] = [];
+
+ if (fin && this.params[`${endpoint}_no_context_takeover`]) {
+ this._deflate.reset();
+ }
+
+ callback(null, data);
+ });
+ }
+}
+
+module.exports = PerMessageDeflate;
+
+/**
+ * The listener of the `zlib.DeflateRaw` stream `'data'` event.
+ *
+ * @param {Buffer} chunk A chunk of data
+ * @private
+ */
+function deflateOnData(chunk) {
+ this[kBuffers].push(chunk);
+ this[kTotalLength] += chunk.length;
+}
+
+/**
+ * The listener of the `zlib.InflateRaw` stream `'data'` event.
+ *
+ * @param {Buffer} chunk A chunk of data
+ * @private
+ */
+function inflateOnData(chunk) {
+ this[kTotalLength] += chunk.length;
+
+ if (
+ this[kPerMessageDeflate]._maxPayload < 1 ||
+ this[kTotalLength] <= this[kPerMessageDeflate]._maxPayload
+ ) {
+ this[kBuffers].push(chunk);
+ return;
+ }
+
+ this[kError] = new RangeError('Max payload size exceeded');
+ this[kError].code = 'WS_ERR_UNSUPPORTED_MESSAGE_LENGTH';
+ this[kError][kStatusCode] = 1009;
+ this.removeListener('data', inflateOnData);
+ this.reset();
+}
+
+/**
+ * The listener of the `zlib.InflateRaw` stream `'error'` event.
+ *
+ * @param {Error} err The emitted error
+ * @private
+ */
+function inflateOnError(err) {
+ //
+ // There is no need to call `Zlib#close()` as the handle is automatically
+ // closed when an error is emitted.
+ //
+ this[kPerMessageDeflate]._inflate = null;
+ err[kStatusCode] = 1007;
+ this[kCallback](err);
+}
diff --git a/client/node_modules/ws/lib/receiver.js b/client/node_modules/ws/lib/receiver.js
new file mode 100644
index 0000000..9e87d81
--- /dev/null
+++ b/client/node_modules/ws/lib/receiver.js
@@ -0,0 +1,742 @@
+'use strict';
+
+const { Writable } = require('stream');
+
+const PerMessageDeflate = require('./permessage-deflate');
+const {
+ BINARY_TYPES,
+ EMPTY_BUFFER,
+ kStatusCode,
+ kWebSocket
+} = require('./constants');
+const { concat, toArrayBuffer, unmask } = require('./buffer-util');
+const { isValidStatusCode, isValidUTF8 } = require('./validation');
+
+const FastBuffer = Buffer[Symbol.species];
+const promise = Promise.resolve();
+
+//
+// `queueMicrotask()` is not available in Node.js < 11.
+//
+const queueTask =
+ typeof queueMicrotask === 'function' ? queueMicrotask : queueMicrotaskShim;
+
+const GET_INFO = 0;
+const GET_PAYLOAD_LENGTH_16 = 1;
+const GET_PAYLOAD_LENGTH_64 = 2;
+const GET_MASK = 3;
+const GET_DATA = 4;
+const INFLATING = 5;
+const DEFER_EVENT = 6;
+
+/**
+ * HyBi Receiver implementation.
+ *
+ * @extends Writable
+ */
+class Receiver extends Writable {
+ /**
+ * Creates a Receiver instance.
+ *
+ * @param {Object} [options] Options object
+ * @param {Boolean} [options.allowSynchronousEvents=false] Specifies whether
+ * any of the `'message'`, `'ping'`, and `'pong'` events can be emitted
+ * multiple times in the same tick
+ * @param {String} [options.binaryType=nodebuffer] The type for binary data
+ * @param {Object} [options.extensions] An object containing the negotiated
+ * extensions
+ * @param {Boolean} [options.isServer=false] Specifies whether to operate in
+ * client or server mode
+ * @param {Number} [options.maxPayload=0] The maximum allowed message length
+ * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or
+ * not to skip UTF-8 validation for text and close messages
+ */
+ constructor(options = {}) {
+ super();
+
+ this._allowSynchronousEvents = !!options.allowSynchronousEvents;
+ this._binaryType = options.binaryType || BINARY_TYPES[0];
+ this._extensions = options.extensions || {};
+ this._isServer = !!options.isServer;
+ this._maxPayload = options.maxPayload | 0;
+ this._skipUTF8Validation = !!options.skipUTF8Validation;
+ this[kWebSocket] = undefined;
+
+ this._bufferedBytes = 0;
+ this._buffers = [];
+
+ this._compressed = false;
+ this._payloadLength = 0;
+ this._mask = undefined;
+ this._fragmented = 0;
+ this._masked = false;
+ this._fin = false;
+ this._opcode = 0;
+
+ this._totalPayloadLength = 0;
+ this._messageLength = 0;
+ this._fragments = [];
+
+ this._errored = false;
+ this._loop = false;
+ this._state = GET_INFO;
+ }
+
+ /**
+ * Implements `Writable.prototype._write()`.
+ *
+ * @param {Buffer} chunk The chunk of data to write
+ * @param {String} encoding The character encoding of `chunk`
+ * @param {Function} cb Callback
+ * @private
+ */
+ _write(chunk, encoding, cb) {
+ if (this._opcode === 0x08 && this._state == GET_INFO) return cb();
+
+ this._bufferedBytes += chunk.length;
+ this._buffers.push(chunk);
+ this.startLoop(cb);
+ }
+
+ /**
+ * Consumes `n` bytes from the buffered data.
+ *
+ * @param {Number} n The number of bytes to consume
+ * @return {Buffer} The consumed bytes
+ * @private
+ */
+ consume(n) {
+ this._bufferedBytes -= n;
+
+ if (n === this._buffers[0].length) return this._buffers.shift();
+
+ if (n < this._buffers[0].length) {
+ const buf = this._buffers[0];
+ this._buffers[0] = new FastBuffer(
+ buf.buffer,
+ buf.byteOffset + n,
+ buf.length - n
+ );
+
+ return new FastBuffer(buf.buffer, buf.byteOffset, n);
+ }
+
+ const dst = Buffer.allocUnsafe(n);
+
+ do {
+ const buf = this._buffers[0];
+ const offset = dst.length - n;
+
+ if (n >= buf.length) {
+ dst.set(this._buffers.shift(), offset);
+ } else {
+ dst.set(new Uint8Array(buf.buffer, buf.byteOffset, n), offset);
+ this._buffers[0] = new FastBuffer(
+ buf.buffer,
+ buf.byteOffset + n,
+ buf.length - n
+ );
+ }
+
+ n -= buf.length;
+ } while (n > 0);
+
+ return dst;
+ }
+
+ /**
+ * Starts the parsing loop.
+ *
+ * @param {Function} cb Callback
+ * @private
+ */
+ startLoop(cb) {
+ this._loop = true;
+
+ do {
+ switch (this._state) {
+ case GET_INFO:
+ this.getInfo(cb);
+ break;
+ case GET_PAYLOAD_LENGTH_16:
+ this.getPayloadLength16(cb);
+ break;
+ case GET_PAYLOAD_LENGTH_64:
+ this.getPayloadLength64(cb);
+ break;
+ case GET_MASK:
+ this.getMask();
+ break;
+ case GET_DATA:
+ this.getData(cb);
+ break;
+ case INFLATING:
+ case DEFER_EVENT:
+ this._loop = false;
+ return;
+ }
+ } while (this._loop);
+
+ if (!this._errored) cb();
+ }
+
+ /**
+ * Reads the first two bytes of a frame.
+ *
+ * @param {Function} cb Callback
+ * @private
+ */
+ getInfo(cb) {
+ if (this._bufferedBytes < 2) {
+ this._loop = false;
+ return;
+ }
+
+ const buf = this.consume(2);
+
+ if ((buf[0] & 0x30) !== 0x00) {
+ const error = this.createError(
+ RangeError,
+ 'RSV2 and RSV3 must be clear',
+ true,
+ 1002,
+ 'WS_ERR_UNEXPECTED_RSV_2_3'
+ );
+
+ cb(error);
+ return;
+ }
+
+ const compressed = (buf[0] & 0x40) === 0x40;
+
+ if (compressed && !this._extensions[PerMessageDeflate.extensionName]) {
+ const error = this.createError(
+ RangeError,
+ 'RSV1 must be clear',
+ true,
+ 1002,
+ 'WS_ERR_UNEXPECTED_RSV_1'
+ );
+
+ cb(error);
+ return;
+ }
+
+ this._fin = (buf[0] & 0x80) === 0x80;
+ this._opcode = buf[0] & 0x0f;
+ this._payloadLength = buf[1] & 0x7f;
+
+ if (this._opcode === 0x00) {
+ if (compressed) {
+ const error = this.createError(
+ RangeError,
+ 'RSV1 must be clear',
+ true,
+ 1002,
+ 'WS_ERR_UNEXPECTED_RSV_1'
+ );
+
+ cb(error);
+ return;
+ }
+
+ if (!this._fragmented) {
+ const error = this.createError(
+ RangeError,
+ 'invalid opcode 0',
+ true,
+ 1002,
+ 'WS_ERR_INVALID_OPCODE'
+ );
+
+ cb(error);
+ return;
+ }
+
+ this._opcode = this._fragmented;
+ } else if (this._opcode === 0x01 || this._opcode === 0x02) {
+ if (this._fragmented) {
+ const error = this.createError(
+ RangeError,
+ `invalid opcode ${this._opcode}`,
+ true,
+ 1002,
+ 'WS_ERR_INVALID_OPCODE'
+ );
+
+ cb(error);
+ return;
+ }
+
+ this._compressed = compressed;
+ } else if (this._opcode > 0x07 && this._opcode < 0x0b) {
+ if (!this._fin) {
+ const error = this.createError(
+ RangeError,
+ 'FIN must be set',
+ true,
+ 1002,
+ 'WS_ERR_EXPECTED_FIN'
+ );
+
+ cb(error);
+ return;
+ }
+
+ if (compressed) {
+ const error = this.createError(
+ RangeError,
+ 'RSV1 must be clear',
+ true,
+ 1002,
+ 'WS_ERR_UNEXPECTED_RSV_1'
+ );
+
+ cb(error);
+ return;
+ }
+
+ if (
+ this._payloadLength > 0x7d ||
+ (this._opcode === 0x08 && this._payloadLength === 1)
+ ) {
+ const error = this.createError(
+ RangeError,
+ `invalid payload length ${this._payloadLength}`,
+ true,
+ 1002,
+ 'WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH'
+ );
+
+ cb(error);
+ return;
+ }
+ } else {
+ const error = this.createError(
+ RangeError,
+ `invalid opcode ${this._opcode}`,
+ true,
+ 1002,
+ 'WS_ERR_INVALID_OPCODE'
+ );
+
+ cb(error);
+ return;
+ }
+
+ if (!this._fin && !this._fragmented) this._fragmented = this._opcode;
+ this._masked = (buf[1] & 0x80) === 0x80;
+
+ if (this._isServer) {
+ if (!this._masked) {
+ const error = this.createError(
+ RangeError,
+ 'MASK must be set',
+ true,
+ 1002,
+ 'WS_ERR_EXPECTED_MASK'
+ );
+
+ cb(error);
+ return;
+ }
+ } else if (this._masked) {
+ const error = this.createError(
+ RangeError,
+ 'MASK must be clear',
+ true,
+ 1002,
+ 'WS_ERR_UNEXPECTED_MASK'
+ );
+
+ cb(error);
+ return;
+ }
+
+ if (this._payloadLength === 126) this._state = GET_PAYLOAD_LENGTH_16;
+ else if (this._payloadLength === 127) this._state = GET_PAYLOAD_LENGTH_64;
+ else this.haveLength(cb);
+ }
+
+ /**
+ * Gets extended payload length (7+16).
+ *
+ * @param {Function} cb Callback
+ * @private
+ */
+ getPayloadLength16(cb) {
+ if (this._bufferedBytes < 2) {
+ this._loop = false;
+ return;
+ }
+
+ this._payloadLength = this.consume(2).readUInt16BE(0);
+ this.haveLength(cb);
+ }
+
+ /**
+ * Gets extended payload length (7+64).
+ *
+ * @param {Function} cb Callback
+ * @private
+ */
+ getPayloadLength64(cb) {
+ if (this._bufferedBytes < 8) {
+ this._loop = false;
+ return;
+ }
+
+ const buf = this.consume(8);
+ const num = buf.readUInt32BE(0);
+
+ //
+ // The maximum safe integer in JavaScript is 2^53 - 1. An error is returned
+ // if payload length is greater than this number.
+ //
+ if (num > Math.pow(2, 53 - 32) - 1) {
+ const error = this.createError(
+ RangeError,
+ 'Unsupported WebSocket frame: payload length > 2^53 - 1',
+ false,
+ 1009,
+ 'WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH'
+ );
+
+ cb(error);
+ return;
+ }
+
+ this._payloadLength = num * Math.pow(2, 32) + buf.readUInt32BE(4);
+ this.haveLength(cb);
+ }
+
+ /**
+ * Payload length has been read.
+ *
+ * @param {Function} cb Callback
+ * @private
+ */
+ haveLength(cb) {
+ if (this._payloadLength && this._opcode < 0x08) {
+ this._totalPayloadLength += this._payloadLength;
+ if (this._totalPayloadLength > this._maxPayload && this._maxPayload > 0) {
+ const error = this.createError(
+ RangeError,
+ 'Max payload size exceeded',
+ false,
+ 1009,
+ 'WS_ERR_UNSUPPORTED_MESSAGE_LENGTH'
+ );
+
+ cb(error);
+ return;
+ }
+ }
+
+ if (this._masked) this._state = GET_MASK;
+ else this._state = GET_DATA;
+ }
+
+ /**
+ * Reads mask bytes.
+ *
+ * @private
+ */
+ getMask() {
+ if (this._bufferedBytes < 4) {
+ this._loop = false;
+ return;
+ }
+
+ this._mask = this.consume(4);
+ this._state = GET_DATA;
+ }
+
+ /**
+ * Reads data bytes.
+ *
+ * @param {Function} cb Callback
+ * @private
+ */
+ getData(cb) {
+ let data = EMPTY_BUFFER;
+
+ if (this._payloadLength) {
+ if (this._bufferedBytes < this._payloadLength) {
+ this._loop = false;
+ return;
+ }
+
+ data = this.consume(this._payloadLength);
+
+ if (
+ this._masked &&
+ (this._mask[0] | this._mask[1] | this._mask[2] | this._mask[3]) !== 0
+ ) {
+ unmask(data, this._mask);
+ }
+ }
+
+ if (this._opcode > 0x07) {
+ this.controlMessage(data, cb);
+ return;
+ }
+
+ if (this._compressed) {
+ this._state = INFLATING;
+ this.decompress(data, cb);
+ return;
+ }
+
+ if (data.length) {
+ //
+ // This message is not compressed so its length is the sum of the payload
+ // length of all fragments.
+ //
+ this._messageLength = this._totalPayloadLength;
+ this._fragments.push(data);
+ }
+
+ this.dataMessage(cb);
+ }
+
+ /**
+ * Decompresses data.
+ *
+ * @param {Buffer} data Compressed data
+ * @param {Function} cb Callback
+ * @private
+ */
+ decompress(data, cb) {
+ const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName];
+
+ perMessageDeflate.decompress(data, this._fin, (err, buf) => {
+ if (err) return cb(err);
+
+ if (buf.length) {
+ this._messageLength += buf.length;
+ if (this._messageLength > this._maxPayload && this._maxPayload > 0) {
+ const error = this.createError(
+ RangeError,
+ 'Max payload size exceeded',
+ false,
+ 1009,
+ 'WS_ERR_UNSUPPORTED_MESSAGE_LENGTH'
+ );
+
+ cb(error);
+ return;
+ }
+
+ this._fragments.push(buf);
+ }
+
+ this.dataMessage(cb);
+ if (this._state === GET_INFO) this.startLoop(cb);
+ });
+ }
+
+ /**
+ * Handles a data message.
+ *
+ * @param {Function} cb Callback
+ * @private
+ */
+ dataMessage(cb) {
+ if (!this._fin) {
+ this._state = GET_INFO;
+ return;
+ }
+
+ const messageLength = this._messageLength;
+ const fragments = this._fragments;
+
+ this._totalPayloadLength = 0;
+ this._messageLength = 0;
+ this._fragmented = 0;
+ this._fragments = [];
+
+ if (this._opcode === 2) {
+ let data;
+
+ if (this._binaryType === 'nodebuffer') {
+ data = concat(fragments, messageLength);
+ } else if (this._binaryType === 'arraybuffer') {
+ data = toArrayBuffer(concat(fragments, messageLength));
+ } else {
+ data = fragments;
+ }
+
+ //
+ // If the state is `INFLATING`, it means that the frame data was
+ // decompressed asynchronously, so there is no need to defer the event
+ // as it will be emitted asynchronously anyway.
+ //
+ if (this._state === INFLATING || this._allowSynchronousEvents) {
+ this.emit('message', data, true);
+ this._state = GET_INFO;
+ } else {
+ this._state = DEFER_EVENT;
+ queueTask(() => {
+ this.emit('message', data, true);
+ this._state = GET_INFO;
+ this.startLoop(cb);
+ });
+ }
+ } else {
+ const buf = concat(fragments, messageLength);
+
+ if (!this._skipUTF8Validation && !isValidUTF8(buf)) {
+ const error = this.createError(
+ Error,
+ 'invalid UTF-8 sequence',
+ true,
+ 1007,
+ 'WS_ERR_INVALID_UTF8'
+ );
+
+ cb(error);
+ return;
+ }
+
+ if (this._state === INFLATING || this._allowSynchronousEvents) {
+ this.emit('message', buf, false);
+ this._state = GET_INFO;
+ } else {
+ this._state = DEFER_EVENT;
+ queueTask(() => {
+ this.emit('message', buf, false);
+ this._state = GET_INFO;
+ this.startLoop(cb);
+ });
+ }
+ }
+ }
+
+ /**
+ * Handles a control message.
+ *
+ * @param {Buffer} data Data to handle
+ * @return {(Error|RangeError|undefined)} A possible error
+ * @private
+ */
+ controlMessage(data, cb) {
+ if (this._opcode === 0x08) {
+ if (data.length === 0) {
+ this._loop = false;
+ this.emit('conclude', 1005, EMPTY_BUFFER);
+ this.end();
+ } else {
+ const code = data.readUInt16BE(0);
+
+ if (!isValidStatusCode(code)) {
+ const error = this.createError(
+ RangeError,
+ `invalid status code ${code}`,
+ true,
+ 1002,
+ 'WS_ERR_INVALID_CLOSE_CODE'
+ );
+
+ cb(error);
+ return;
+ }
+
+ const buf = new FastBuffer(
+ data.buffer,
+ data.byteOffset + 2,
+ data.length - 2
+ );
+
+ if (!this._skipUTF8Validation && !isValidUTF8(buf)) {
+ const error = this.createError(
+ Error,
+ 'invalid UTF-8 sequence',
+ true,
+ 1007,
+ 'WS_ERR_INVALID_UTF8'
+ );
+
+ cb(error);
+ return;
+ }
+
+ this._loop = false;
+ this.emit('conclude', code, buf);
+ this.end();
+ }
+
+ this._state = GET_INFO;
+ return;
+ }
+
+ if (this._allowSynchronousEvents) {
+ this.emit(this._opcode === 0x09 ? 'ping' : 'pong', data);
+ this._state = GET_INFO;
+ } else {
+ this._state = DEFER_EVENT;
+ queueTask(() => {
+ this.emit(this._opcode === 0x09 ? 'ping' : 'pong', data);
+ this._state = GET_INFO;
+ this.startLoop(cb);
+ });
+ }
+ }
+
+ /**
+ * Builds an error object.
+ *
+ * @param {function(new:Error|RangeError)} ErrorCtor The error constructor
+ * @param {String} message The error message
+ * @param {Boolean} prefix Specifies whether or not to add a default prefix to
+ * `message`
+ * @param {Number} statusCode The status code
+ * @param {String} errorCode The exposed error code
+ * @return {(Error|RangeError)} The error
+ * @private
+ */
+ createError(ErrorCtor, message, prefix, statusCode, errorCode) {
+ this._loop = false;
+ this._errored = true;
+
+ const err = new ErrorCtor(
+ prefix ? `Invalid WebSocket frame: ${message}` : message
+ );
+
+ Error.captureStackTrace(err, this.createError);
+ err.code = errorCode;
+ err[kStatusCode] = statusCode;
+ return err;
+ }
+}
+
+module.exports = Receiver;
+
+/**
+ * A shim for `queueMicrotask()`.
+ *
+ * @param {Function} cb Callback
+ */
+function queueMicrotaskShim(cb) {
+ promise.then(cb).catch(throwErrorNextTick);
+}
+
+/**
+ * Throws an error.
+ *
+ * @param {Error} err The error to throw
+ * @private
+ */
+function throwError(err) {
+ throw err;
+}
+
+/**
+ * Throws an error in the next tick.
+ *
+ * @param {Error} err The error to throw
+ * @private
+ */
+function throwErrorNextTick(err) {
+ process.nextTick(throwError, err);
+}
diff --git a/client/node_modules/ws/lib/sender.js b/client/node_modules/ws/lib/sender.js
new file mode 100644
index 0000000..1ed04b0
--- /dev/null
+++ b/client/node_modules/ws/lib/sender.js
@@ -0,0 +1,477 @@
+/* eslint no-unused-vars: ["error", { "varsIgnorePattern": "^Duplex" }] */
+
+'use strict';
+
+const { Duplex } = require('stream');
+const { randomFillSync } = require('crypto');
+
+const PerMessageDeflate = require('./permessage-deflate');
+const { EMPTY_BUFFER } = require('./constants');
+const { isValidStatusCode } = require('./validation');
+const { mask: applyMask, toBuffer } = require('./buffer-util');
+
+const kByteLength = Symbol('kByteLength');
+const maskBuffer = Buffer.alloc(4);
+
+/**
+ * HyBi Sender implementation.
+ */
+class Sender {
+ /**
+ * Creates a Sender instance.
+ *
+ * @param {Duplex} socket The connection socket
+ * @param {Object} [extensions] An object containing the negotiated extensions
+ * @param {Function} [generateMask] The function used to generate the masking
+ * key
+ */
+ constructor(socket, extensions, generateMask) {
+ this._extensions = extensions || {};
+
+ if (generateMask) {
+ this._generateMask = generateMask;
+ this._maskBuffer = Buffer.alloc(4);
+ }
+
+ this._socket = socket;
+
+ this._firstFragment = true;
+ this._compress = false;
+
+ this._bufferedBytes = 0;
+ this._deflating = false;
+ this._queue = [];
+ }
+
+ /**
+ * Frames a piece of data according to the HyBi WebSocket protocol.
+ *
+ * @param {(Buffer|String)} data The data to frame
+ * @param {Object} options Options object
+ * @param {Boolean} [options.fin=false] Specifies whether or not to set the
+ * FIN bit
+ * @param {Function} [options.generateMask] The function used to generate the
+ * masking key
+ * @param {Boolean} [options.mask=false] Specifies whether or not to mask
+ * `data`
+ * @param {Buffer} [options.maskBuffer] The buffer used to store the masking
+ * key
+ * @param {Number} options.opcode The opcode
+ * @param {Boolean} [options.readOnly=false] Specifies whether `data` can be
+ * modified
+ * @param {Boolean} [options.rsv1=false] Specifies whether or not to set the
+ * RSV1 bit
+ * @return {(Buffer|String)[]} The framed data
+ * @public
+ */
+ static frame(data, options) {
+ let mask;
+ let merge = false;
+ let offset = 2;
+ let skipMasking = false;
+
+ if (options.mask) {
+ mask = options.maskBuffer || maskBuffer;
+
+ if (options.generateMask) {
+ options.generateMask(mask);
+ } else {
+ randomFillSync(mask, 0, 4);
+ }
+
+ skipMasking = (mask[0] | mask[1] | mask[2] | mask[3]) === 0;
+ offset = 6;
+ }
+
+ let dataLength;
+
+ if (typeof data === 'string') {
+ if (
+ (!options.mask || skipMasking) &&
+ options[kByteLength] !== undefined
+ ) {
+ dataLength = options[kByteLength];
+ } else {
+ data = Buffer.from(data);
+ dataLength = data.length;
+ }
+ } else {
+ dataLength = data.length;
+ merge = options.mask && options.readOnly && !skipMasking;
+ }
+
+ let payloadLength = dataLength;
+
+ if (dataLength >= 65536) {
+ offset += 8;
+ payloadLength = 127;
+ } else if (dataLength > 125) {
+ offset += 2;
+ payloadLength = 126;
+ }
+
+ const target = Buffer.allocUnsafe(merge ? dataLength + offset : offset);
+
+ target[0] = options.fin ? options.opcode | 0x80 : options.opcode;
+ if (options.rsv1) target[0] |= 0x40;
+
+ target[1] = payloadLength;
+
+ if (payloadLength === 126) {
+ target.writeUInt16BE(dataLength, 2);
+ } else if (payloadLength === 127) {
+ target[2] = target[3] = 0;
+ target.writeUIntBE(dataLength, 4, 6);
+ }
+
+ if (!options.mask) return [target, data];
+
+ target[1] |= 0x80;
+ target[offset - 4] = mask[0];
+ target[offset - 3] = mask[1];
+ target[offset - 2] = mask[2];
+ target[offset - 1] = mask[3];
+
+ if (skipMasking) return [target, data];
+
+ if (merge) {
+ applyMask(data, mask, target, offset, dataLength);
+ return [target];
+ }
+
+ applyMask(data, mask, data, 0, dataLength);
+ return [target, data];
+ }
+
+ /**
+ * Sends a close message to the other peer.
+ *
+ * @param {Number} [code] The status code component of the body
+ * @param {(String|Buffer)} [data] The message component of the body
+ * @param {Boolean} [mask=false] Specifies whether or not to mask the message
+ * @param {Function} [cb] Callback
+ * @public
+ */
+ close(code, data, mask, cb) {
+ let buf;
+
+ if (code === undefined) {
+ buf = EMPTY_BUFFER;
+ } else if (typeof code !== 'number' || !isValidStatusCode(code)) {
+ throw new TypeError('First argument must be a valid error code number');
+ } else if (data === undefined || !data.length) {
+ buf = Buffer.allocUnsafe(2);
+ buf.writeUInt16BE(code, 0);
+ } else {
+ const length = Buffer.byteLength(data);
+
+ if (length > 123) {
+ throw new RangeError('The message must not be greater than 123 bytes');
+ }
+
+ buf = Buffer.allocUnsafe(2 + length);
+ buf.writeUInt16BE(code, 0);
+
+ if (typeof data === 'string') {
+ buf.write(data, 2);
+ } else {
+ buf.set(data, 2);
+ }
+ }
+
+ const options = {
+ [kByteLength]: buf.length,
+ fin: true,
+ generateMask: this._generateMask,
+ mask,
+ maskBuffer: this._maskBuffer,
+ opcode: 0x08,
+ readOnly: false,
+ rsv1: false
+ };
+
+ if (this._deflating) {
+ this.enqueue([this.dispatch, buf, false, options, cb]);
+ } else {
+ this.sendFrame(Sender.frame(buf, options), cb);
+ }
+ }
+
+ /**
+ * Sends a ping message to the other peer.
+ *
+ * @param {*} data The message to send
+ * @param {Boolean} [mask=false] Specifies whether or not to mask `data`
+ * @param {Function} [cb] Callback
+ * @public
+ */
+ ping(data, mask, cb) {
+ let byteLength;
+ let readOnly;
+
+ if (typeof data === 'string') {
+ byteLength = Buffer.byteLength(data);
+ readOnly = false;
+ } else {
+ data = toBuffer(data);
+ byteLength = data.length;
+ readOnly = toBuffer.readOnly;
+ }
+
+ if (byteLength > 125) {
+ throw new RangeError('The data size must not be greater than 125 bytes');
+ }
+
+ const options = {
+ [kByteLength]: byteLength,
+ fin: true,
+ generateMask: this._generateMask,
+ mask,
+ maskBuffer: this._maskBuffer,
+ opcode: 0x09,
+ readOnly,
+ rsv1: false
+ };
+
+ if (this._deflating) {
+ this.enqueue([this.dispatch, data, false, options, cb]);
+ } else {
+ this.sendFrame(Sender.frame(data, options), cb);
+ }
+ }
+
+ /**
+ * Sends a pong message to the other peer.
+ *
+ * @param {*} data The message to send
+ * @param {Boolean} [mask=false] Specifies whether or not to mask `data`
+ * @param {Function} [cb] Callback
+ * @public
+ */
+ pong(data, mask, cb) {
+ let byteLength;
+ let readOnly;
+
+ if (typeof data === 'string') {
+ byteLength = Buffer.byteLength(data);
+ readOnly = false;
+ } else {
+ data = toBuffer(data);
+ byteLength = data.length;
+ readOnly = toBuffer.readOnly;
+ }
+
+ if (byteLength > 125) {
+ throw new RangeError('The data size must not be greater than 125 bytes');
+ }
+
+ const options = {
+ [kByteLength]: byteLength,
+ fin: true,
+ generateMask: this._generateMask,
+ mask,
+ maskBuffer: this._maskBuffer,
+ opcode: 0x0a,
+ readOnly,
+ rsv1: false
+ };
+
+ if (this._deflating) {
+ this.enqueue([this.dispatch, data, false, options, cb]);
+ } else {
+ this.sendFrame(Sender.frame(data, options), cb);
+ }
+ }
+
+ /**
+ * Sends a data message to the other peer.
+ *
+ * @param {*} data The message to send
+ * @param {Object} options Options object
+ * @param {Boolean} [options.binary=false] Specifies whether `data` is binary
+ * or text
+ * @param {Boolean} [options.compress=false] Specifies whether or not to
+ * compress `data`
+ * @param {Boolean} [options.fin=false] Specifies whether the fragment is the
+ * last one
+ * @param {Boolean} [options.mask=false] Specifies whether or not to mask
+ * `data`
+ * @param {Function} [cb] Callback
+ * @public
+ */
+ send(data, options, cb) {
+ const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName];
+ let opcode = options.binary ? 2 : 1;
+ let rsv1 = options.compress;
+
+ let byteLength;
+ let readOnly;
+
+ if (typeof data === 'string') {
+ byteLength = Buffer.byteLength(data);
+ readOnly = false;
+ } else {
+ data = toBuffer(data);
+ byteLength = data.length;
+ readOnly = toBuffer.readOnly;
+ }
+
+ if (this._firstFragment) {
+ this._firstFragment = false;
+ if (
+ rsv1 &&
+ perMessageDeflate &&
+ perMessageDeflate.params[
+ perMessageDeflate._isServer
+ ? 'server_no_context_takeover'
+ : 'client_no_context_takeover'
+ ]
+ ) {
+ rsv1 = byteLength >= perMessageDeflate._threshold;
+ }
+ this._compress = rsv1;
+ } else {
+ rsv1 = false;
+ opcode = 0;
+ }
+
+ if (options.fin) this._firstFragment = true;
+
+ if (perMessageDeflate) {
+ const opts = {
+ [kByteLength]: byteLength,
+ fin: options.fin,
+ generateMask: this._generateMask,
+ mask: options.mask,
+ maskBuffer: this._maskBuffer,
+ opcode,
+ readOnly,
+ rsv1
+ };
+
+ if (this._deflating) {
+ this.enqueue([this.dispatch, data, this._compress, opts, cb]);
+ } else {
+ this.dispatch(data, this._compress, opts, cb);
+ }
+ } else {
+ this.sendFrame(
+ Sender.frame(data, {
+ [kByteLength]: byteLength,
+ fin: options.fin,
+ generateMask: this._generateMask,
+ mask: options.mask,
+ maskBuffer: this._maskBuffer,
+ opcode,
+ readOnly,
+ rsv1: false
+ }),
+ cb
+ );
+ }
+ }
+
+ /**
+ * Dispatches a message.
+ *
+ * @param {(Buffer|String)} data The message to send
+ * @param {Boolean} [compress=false] Specifies whether or not to compress
+ * `data`
+ * @param {Object} options Options object
+ * @param {Boolean} [options.fin=false] Specifies whether or not to set the
+ * FIN bit
+ * @param {Function} [options.generateMask] The function used to generate the
+ * masking key
+ * @param {Boolean} [options.mask=false] Specifies whether or not to mask
+ * `data`
+ * @param {Buffer} [options.maskBuffer] The buffer used to store the masking
+ * key
+ * @param {Number} options.opcode The opcode
+ * @param {Boolean} [options.readOnly=false] Specifies whether `data` can be
+ * modified
+ * @param {Boolean} [options.rsv1=false] Specifies whether or not to set the
+ * RSV1 bit
+ * @param {Function} [cb] Callback
+ * @private
+ */
+ dispatch(data, compress, options, cb) {
+ if (!compress) {
+ this.sendFrame(Sender.frame(data, options), cb);
+ return;
+ }
+
+ const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName];
+
+ this._bufferedBytes += options[kByteLength];
+ this._deflating = true;
+ perMessageDeflate.compress(data, options.fin, (_, buf) => {
+ if (this._socket.destroyed) {
+ const err = new Error(
+ 'The socket was closed while data was being compressed'
+ );
+
+ if (typeof cb === 'function') cb(err);
+
+ for (let i = 0; i < this._queue.length; i++) {
+ const params = this._queue[i];
+ const callback = params[params.length - 1];
+
+ if (typeof callback === 'function') callback(err);
+ }
+
+ return;
+ }
+
+ this._bufferedBytes -= options[kByteLength];
+ this._deflating = false;
+ options.readOnly = false;
+ this.sendFrame(Sender.frame(buf, options), cb);
+ this.dequeue();
+ });
+ }
+
+ /**
+ * Executes queued send operations.
+ *
+ * @private
+ */
+ dequeue() {
+ while (!this._deflating && this._queue.length) {
+ const params = this._queue.shift();
+
+ this._bufferedBytes -= params[3][kByteLength];
+ Reflect.apply(params[0], this, params.slice(1));
+ }
+ }
+
+ /**
+ * Enqueues a send operation.
+ *
+ * @param {Array} params Send operation parameters.
+ * @private
+ */
+ enqueue(params) {
+ this._bufferedBytes += params[3][kByteLength];
+ this._queue.push(params);
+ }
+
+ /**
+ * Sends a frame.
+ *
+ * @param {Buffer[]} list The frame to send
+ * @param {Function} [cb] Callback
+ * @private
+ */
+ sendFrame(list, cb) {
+ if (list.length === 2) {
+ this._socket.cork();
+ this._socket.write(list[0]);
+ this._socket.write(list[1], cb);
+ this._socket.uncork();
+ } else {
+ this._socket.write(list[0], cb);
+ }
+ }
+}
+
+module.exports = Sender;
diff --git a/client/node_modules/ws/lib/stream.js b/client/node_modules/ws/lib/stream.js
new file mode 100644
index 0000000..230734b
--- /dev/null
+++ b/client/node_modules/ws/lib/stream.js
@@ -0,0 +1,159 @@
+'use strict';
+
+const { Duplex } = require('stream');
+
+/**
+ * Emits the `'close'` event on a stream.
+ *
+ * @param {Duplex} stream The stream.
+ * @private
+ */
+function emitClose(stream) {
+ stream.emit('close');
+}
+
+/**
+ * The listener of the `'end'` event.
+ *
+ * @private
+ */
+function duplexOnEnd() {
+ if (!this.destroyed && this._writableState.finished) {
+ this.destroy();
+ }
+}
+
+/**
+ * The listener of the `'error'` event.
+ *
+ * @param {Error} err The error
+ * @private
+ */
+function duplexOnError(err) {
+ this.removeListener('error', duplexOnError);
+ this.destroy();
+ if (this.listenerCount('error') === 0) {
+ // Do not suppress the throwing behavior.
+ this.emit('error', err);
+ }
+}
+
+/**
+ * Wraps a `WebSocket` in a duplex stream.
+ *
+ * @param {WebSocket} ws The `WebSocket` to wrap
+ * @param {Object} [options] The options for the `Duplex` constructor
+ * @return {Duplex} The duplex stream
+ * @public
+ */
+function createWebSocketStream(ws, options) {
+ let terminateOnDestroy = true;
+
+ const duplex = new Duplex({
+ ...options,
+ autoDestroy: false,
+ emitClose: false,
+ objectMode: false,
+ writableObjectMode: false
+ });
+
+ ws.on('message', function message(msg, isBinary) {
+ const data =
+ !isBinary && duplex._readableState.objectMode ? msg.toString() : msg;
+
+ if (!duplex.push(data)) ws.pause();
+ });
+
+ ws.once('error', function error(err) {
+ if (duplex.destroyed) return;
+
+ // Prevent `ws.terminate()` from being called by `duplex._destroy()`.
+ //
+ // - If the `'error'` event is emitted before the `'open'` event, then
+ // `ws.terminate()` is a noop as no socket is assigned.
+ // - Otherwise, the error is re-emitted by the listener of the `'error'`
+ // event of the `Receiver` object. The listener already closes the
+ // connection by calling `ws.close()`. This allows a close frame to be
+ // sent to the other peer. If `ws.terminate()` is called right after this,
+ // then the close frame might not be sent.
+ terminateOnDestroy = false;
+ duplex.destroy(err);
+ });
+
+ ws.once('close', function close() {
+ if (duplex.destroyed) return;
+
+ duplex.push(null);
+ });
+
+ duplex._destroy = function (err, callback) {
+ if (ws.readyState === ws.CLOSED) {
+ callback(err);
+ process.nextTick(emitClose, duplex);
+ return;
+ }
+
+ let called = false;
+
+ ws.once('error', function error(err) {
+ called = true;
+ callback(err);
+ });
+
+ ws.once('close', function close() {
+ if (!called) callback(err);
+ process.nextTick(emitClose, duplex);
+ });
+
+ if (terminateOnDestroy) ws.terminate();
+ };
+
+ duplex._final = function (callback) {
+ if (ws.readyState === ws.CONNECTING) {
+ ws.once('open', function open() {
+ duplex._final(callback);
+ });
+ return;
+ }
+
+ // If the value of the `_socket` property is `null` it means that `ws` is a
+ // client websocket and the handshake failed. In fact, when this happens, a
+ // socket is never assigned to the websocket. Wait for the `'error'` event
+ // that will be emitted by the websocket.
+ if (ws._socket === null) return;
+
+ if (ws._socket._writableState.finished) {
+ callback();
+ if (duplex._readableState.endEmitted) duplex.destroy();
+ } else {
+ ws._socket.once('finish', function finish() {
+ // `duplex` is not destroyed here because the `'end'` event will be
+ // emitted on `duplex` after this `'finish'` event. The EOF signaling
+ // `null` chunk is, in fact, pushed when the websocket emits `'close'`.
+ callback();
+ });
+ ws.close();
+ }
+ };
+
+ duplex._read = function () {
+ if (ws.isPaused) ws.resume();
+ };
+
+ duplex._write = function (chunk, encoding, callback) {
+ if (ws.readyState === ws.CONNECTING) {
+ ws.once('open', function open() {
+ duplex._write(chunk, encoding, callback);
+ });
+ return;
+ }
+
+ ws.send(chunk, callback);
+ };
+
+ duplex.on('end', duplexOnEnd);
+ duplex.on('error', duplexOnError);
+ return duplex;
+}
+
+module.exports = createWebSocketStream;
diff --git a/client/node_modules/ws/lib/subprotocol.js b/client/node_modules/ws/lib/subprotocol.js
new file mode 100644
index 0000000..d4381e8
--- /dev/null
+++ b/client/node_modules/ws/lib/subprotocol.js
@@ -0,0 +1,62 @@
+'use strict';
+
+const { tokenChars } = require('./validation');
+
+/**
+ * Parses the `Sec-WebSocket-Protocol` header into a set of subprotocol names.
+ *
+ * @param {String} header The field value of the header
+ * @return {Set} The subprotocol names
+ * @public
+ */
+function parse(header) {
+ const protocols = new Set();
+ let start = -1;
+ let end = -1;
+ let i = 0;
+
+ for (i; i < header.length; i++) {
+ const code = header.charCodeAt(i);
+
+ if (end === -1 && tokenChars[code] === 1) {
+ if (start === -1) start = i;
+ } else if (
+ i !== 0 &&
+ (code === 0x20 /* ' ' */ || code === 0x09) /* '\t' */
+ ) {
+ if (end === -1 && start !== -1) end = i;
+ } else if (code === 0x2c /* ',' */) {
+ if (start === -1) {
+ throw new SyntaxError(`Unexpected character at index ${i}`);
+ }
+
+ if (end === -1) end = i;
+
+ const protocol = header.slice(start, end);
+
+ if (protocols.has(protocol)) {
+ throw new SyntaxError(`The "${protocol}" subprotocol is duplicated`);
+ }
+
+ protocols.add(protocol);
+ start = end = -1;
+ } else {
+ throw new SyntaxError(`Unexpected character at index ${i}`);
+ }
+ }
+
+ if (start === -1 || end !== -1) {
+ throw new SyntaxError('Unexpected end of input');
+ }
+
+ const protocol = header.slice(start, i);
+
+ if (protocols.has(protocol)) {
+ throw new SyntaxError(`The "${protocol}" subprotocol is duplicated`);
+ }
+
+ protocols.add(protocol);
+ return protocols;
+}
+
+module.exports = { parse };
diff --git a/client/node_modules/ws/lib/validation.js b/client/node_modules/ws/lib/validation.js
new file mode 100644
index 0000000..c352e6e
--- /dev/null
+++ b/client/node_modules/ws/lib/validation.js
@@ -0,0 +1,130 @@
+'use strict';
+
+const { isUtf8 } = require('buffer');
+
+//
+// Allowed token characters:
+//
+// '!', '#', '$', '%', '&', ''', '*', '+', '-',
+// '.', 0-9, A-Z, '^', '_', '`', a-z, '|', '~'
+//
+// tokenChars[32] === 0 // ' '
+// tokenChars[33] === 1 // '!'
+// tokenChars[34] === 0 // '"'
+// ...
+//
+// prettier-ignore
+const tokenChars = [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0 - 15
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 16 - 31
+ 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, // 32 - 47
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, // 48 - 63
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 64 - 79
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, // 80 - 95
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 96 - 111
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0 // 112 - 127
+];
+
+/**
+ * Checks if a status code is allowed in a close frame.
+ *
+ * @param {Number} code The status code
+ * @return {Boolean} `true` if the status code is valid, else `false`
+ * @public
+ */
+function isValidStatusCode(code) {
+ return (
+ (code >= 1000 &&
+ code <= 1014 &&
+ code !== 1004 &&
+ code !== 1005 &&
+ code !== 1006) ||
+ (code >= 3000 && code <= 4999)
+ );
+}
+
+/**
+ * Checks if a given buffer contains only correct UTF-8.
+ * Ported from https://www.cl.cam.ac.uk/%7Emgk25/ucs/utf8_check.c by
+ * Markus Kuhn.
+ *
+ * @param {Buffer} buf The buffer to check
+ * @return {Boolean} `true` if `buf` contains only correct UTF-8, else `false`
+ * @public
+ */
+function _isValidUTF8(buf) {
+ const len = buf.length;
+ let i = 0;
+
+ while (i < len) {
+ if ((buf[i] & 0x80) === 0) {
+ // 0xxxxxxx
+ i++;
+ } else if ((buf[i] & 0xe0) === 0xc0) {
+ // 110xxxxx 10xxxxxx
+ if (
+ i + 1 === len ||
+ (buf[i + 1] & 0xc0) !== 0x80 ||
+ (buf[i] & 0xfe) === 0xc0 // Overlong
+ ) {
+ return false;
+ }
+
+ i += 2;
+ } else if ((buf[i] & 0xf0) === 0xe0) {
+ // 1110xxxx 10xxxxxx 10xxxxxx
+ if (
+ i + 2 >= len ||
+ (buf[i + 1] & 0xc0) !== 0x80 ||
+ (buf[i + 2] & 0xc0) !== 0x80 ||
+ (buf[i] === 0xe0 && (buf[i + 1] & 0xe0) === 0x80) || // Overlong
+ (buf[i] === 0xed && (buf[i + 1] & 0xe0) === 0xa0) // Surrogate (U+D800 - U+DFFF)
+ ) {
+ return false;
+ }
+
+ i += 3;
+ } else if ((buf[i] & 0xf8) === 0xf0) {
+ // 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
+ if (
+ i + 3 >= len ||
+ (buf[i + 1] & 0xc0) !== 0x80 ||
+ (buf[i + 2] & 0xc0) !== 0x80 ||
+ (buf[i + 3] & 0xc0) !== 0x80 ||
+ (buf[i] === 0xf0 && (buf[i + 1] & 0xf0) === 0x80) || // Overlong
+ (buf[i] === 0xf4 && buf[i + 1] > 0x8f) ||
+ buf[i] > 0xf4 // > U+10FFFF
+ ) {
+ return false;
+ }
+
+ i += 4;
+ } else {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+module.exports = {
+ isValidStatusCode,
+ isValidUTF8: _isValidUTF8,
+ tokenChars
+};
+
+if (isUtf8) {
+ module.exports.isValidUTF8 = function (buf) {
+ return buf.length < 24 ? _isValidUTF8(buf) : isUtf8(buf);
+ };
+} /* istanbul ignore else */ else if (!process.env.WS_NO_UTF_8_VALIDATE) {
+ try {
+ const isValidUTF8 = require('utf-8-validate');
+
+ module.exports.isValidUTF8 = function (buf) {
+ return buf.length < 32 ? _isValidUTF8(buf) : isValidUTF8(buf);
+ };
+ } catch (e) {
+ // Continue regardless of the error.
+ }
+}
diff --git a/client/node_modules/ws/lib/websocket-server.js b/client/node_modules/ws/lib/websocket-server.js
new file mode 100644
index 0000000..377c45a
--- /dev/null
+++ b/client/node_modules/ws/lib/websocket-server.js
@@ -0,0 +1,539 @@
+/* eslint no-unused-vars: ["error", { "varsIgnorePattern": "^Duplex$" }] */
+
+'use strict';
+
+const EventEmitter = require('events');
+const http = require('http');
+const { Duplex } = require('stream');
+const { createHash } = require('crypto');
+
+const extension = require('./extension');
+const PerMessageDeflate = require('./permessage-deflate');
+const subprotocol = require('./subprotocol');
+const WebSocket = require('./websocket');
+const { GUID, kWebSocket } = require('./constants');
+
+const keyRegex = /^[+/0-9A-Za-z]{22}==$/;
+
+const RUNNING = 0;
+const CLOSING = 1;
+const CLOSED = 2;
+
+/**
+ * Class representing a WebSocket server.
+ *
+ * @extends EventEmitter
+ */
+class WebSocketServer extends EventEmitter {
+ /**
+ * Create a `WebSocketServer` instance.
+ *
+ * @param {Object} options Configuration options
+ * @param {Boolean} [options.allowSynchronousEvents=false] Specifies whether
+ * any of the `'message'`, `'ping'`, and `'pong'` events can be emitted
+ * multiple times in the same tick
+ * @param {Boolean} [options.autoPong=true] Specifies whether or not to
+ * automatically send a pong in response to a ping
+ * @param {Number} [options.backlog=511] The maximum length of the queue of
+ * pending connections
+ * @param {Boolean} [options.clientTracking=true] Specifies whether or not to
+ * track clients
+ * @param {Function} [options.handleProtocols] A hook to handle protocols
+ * @param {String} [options.host] The hostname where to bind the server
+ * @param {Number} [options.maxPayload=104857600] The maximum allowed message
+ * size
+ * @param {Boolean} [options.noServer=false] Enable no server mode
+ * @param {String} [options.path] Accept only connections matching this path
+ * @param {(Boolean|Object)} [options.perMessageDeflate=false] Enable/disable
+ * permessage-deflate
+ * @param {Number} [options.port] The port where to bind the server
+ * @param {(http.Server|https.Server)} [options.server] A pre-created HTTP/S
+ * server to use
+ * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or
+ * not to skip UTF-8 validation for text and close messages
+ * @param {Function} [options.verifyClient] A hook to reject connections
+ * @param {Function} [options.WebSocket=WebSocket] Specifies the `WebSocket`
+ * class to use. It must be the `WebSocket` class or class that extends it
+ * @param {Function} [callback] A listener for the `listening` event
+ */
+ constructor(options, callback) {
+ super();
+
+ options = {
+ allowSynchronousEvents: false,
+ autoPong: true,
+ maxPayload: 100 * 1024 * 1024,
+ skipUTF8Validation: false,
+ perMessageDeflate: false,
+ handleProtocols: null,
+ clientTracking: true,
+ verifyClient: null,
+ noServer: false,
+ backlog: null, // use default (511 as implemented in net.js)
+ server: null,
+ host: null,
+ path: null,
+ port: null,
+ WebSocket,
+ ...options
+ };
+
+ if (
+ (options.port == null && !options.server && !options.noServer) ||
+ (options.port != null && (options.server || options.noServer)) ||
+ (options.server && options.noServer)
+ ) {
+ throw new TypeError(
+ 'One and only one of the "port", "server", or "noServer" options ' +
+ 'must be specified'
+ );
+ }
+
+ if (options.port != null) {
+ this._server = http.createServer((req, res) => {
+ const body = http.STATUS_CODES[426];
+
+ res.writeHead(426, {
+ 'Content-Length': body.length,
+ 'Content-Type': 'text/plain'
+ });
+ res.end(body);
+ });
+ this._server.listen(
+ options.port,
+ options.host,
+ options.backlog,
+ callback
+ );
+ } else if (options.server) {
+ this._server = options.server;
+ }
+
+ if (this._server) {
+ const emitConnection = this.emit.bind(this, 'connection');
+
+ this._removeListeners = addListeners(this._server, {
+ listening: this.emit.bind(this, 'listening'),
+ error: this.emit.bind(this, 'error'),
+ upgrade: (req, socket, head) => {
+ this.handleUpgrade(req, socket, head, emitConnection);
+ }
+ });
+ }
+
+ if (options.perMessageDeflate === true) options.perMessageDeflate = {};
+ if (options.clientTracking) {
+ this.clients = new Set();
+ this._shouldEmitClose = false;
+ }
+
+ this.options = options;
+ this._state = RUNNING;
+ }
+
+ /**
+ * Returns the bound address, the address family name, and port of the server
+ * as reported by the operating system if listening on an IP socket.
+ * If the server is listening on a pipe or UNIX domain socket, the name is
+ * returned as a string.
+ *
+ * @return {(Object|String|null)} The address of the server
+ * @public
+ */
+ address() {
+ if (this.options.noServer) {
+ throw new Error('The server is operating in "noServer" mode');
+ }
+
+ if (!this._server) return null;
+ return this._server.address();
+ }
+
+ /**
+ * Stop the server from accepting new connections and emit the `'close'` event
+ * when all existing connections are closed.
+ *
+ * @param {Function} [cb] A one-time listener for the `'close'` event
+ * @public
+ */
+ close(cb) {
+ if (this._state === CLOSED) {
+ if (cb) {
+ this.once('close', () => {
+ cb(new Error('The server is not running'));
+ });
+ }
+
+ process.nextTick(emitClose, this);
+ return;
+ }
+
+ if (cb) this.once('close', cb);
+
+ if (this._state === CLOSING) return;
+ this._state = CLOSING;
+
+ if (this.options.noServer || this.options.server) {
+ if (this._server) {
+ this._removeListeners();
+ this._removeListeners = this._server = null;
+ }
+
+ if (this.clients) {
+ if (!this.clients.size) {
+ process.nextTick(emitClose, this);
+ } else {
+ this._shouldEmitClose = true;
+ }
+ } else {
+ process.nextTick(emitClose, this);
+ }
+ } else {
+ const server = this._server;
+
+ this._removeListeners();
+ this._removeListeners = this._server = null;
+
+ //
+ // The HTTP/S server was created internally. Close it, and rely on its
+ // `'close'` event.
+ //
+ server.close(() => {
+ emitClose(this);
+ });
+ }
+ }
+
+ /**
+ * See if a given request should be handled by this server instance.
+ *
+ * @param {http.IncomingMessage} req Request object to inspect
+ * @return {Boolean} `true` if the request is valid, else `false`
+ * @public
+ */
+ shouldHandle(req) {
+ if (this.options.path) {
+ const index = req.url.indexOf('?');
+ const pathname = index !== -1 ? req.url.slice(0, index) : req.url;
+
+ if (pathname !== this.options.path) return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Handle a HTTP Upgrade request.
+ *
+ * @param {http.IncomingMessage} req The request object
+ * @param {Duplex} socket The network socket between the server and client
+ * @param {Buffer} head The first packet of the upgraded stream
+ * @param {Function} cb Callback
+ * @public
+ */
+ handleUpgrade(req, socket, head, cb) {
+ socket.on('error', socketOnError);
+
+ const key = req.headers['sec-websocket-key'];
+ const version = +req.headers['sec-websocket-version'];
+
+ if (req.method !== 'GET') {
+ const message = 'Invalid HTTP method';
+ abortHandshakeOrEmitwsClientError(this, req, socket, 405, message);
+ return;
+ }
+
+ if (req.headers.upgrade.toLowerCase() !== 'websocket') {
+ const message = 'Invalid Upgrade header';
+ abortHandshakeOrEmitwsClientError(this, req, socket, 400, message);
+ return;
+ }
+
+ if (!key || !keyRegex.test(key)) {
+ const message = 'Missing or invalid Sec-WebSocket-Key header';
+ abortHandshakeOrEmitwsClientError(this, req, socket, 400, message);
+ return;
+ }
+
+ if (version !== 8 && version !== 13) {
+ const message = 'Missing or invalid Sec-WebSocket-Version header';
+ abortHandshakeOrEmitwsClientError(this, req, socket, 400, message);
+ return;
+ }
+
+ if (!this.shouldHandle(req)) {
+ abortHandshake(socket, 400);
+ return;
+ }
+
+ const secWebSocketProtocol = req.headers['sec-websocket-protocol'];
+ let protocols = new Set();
+
+ if (secWebSocketProtocol !== undefined) {
+ try {
+ protocols = subprotocol.parse(secWebSocketProtocol);
+ } catch (err) {
+ const message = 'Invalid Sec-WebSocket-Protocol header';
+ abortHandshakeOrEmitwsClientError(this, req, socket, 400, message);
+ return;
+ }
+ }
+
+ const secWebSocketExtensions = req.headers['sec-websocket-extensions'];
+ const extensions = {};
+
+ if (
+ this.options.perMessageDeflate &&
+ secWebSocketExtensions !== undefined
+ ) {
+ const perMessageDeflate = new PerMessageDeflate(
+ this.options.perMessageDeflate,
+ true,
+ this.options.maxPayload
+ );
+
+ try {
+ const offers = extension.parse(secWebSocketExtensions);
+
+ if (offers[PerMessageDeflate.extensionName]) {
+ perMessageDeflate.accept(offers[PerMessageDeflate.extensionName]);
+ extensions[PerMessageDeflate.extensionName] = perMessageDeflate;
+ }
+ } catch (err) {
+ const message =
+ 'Invalid or unacceptable Sec-WebSocket-Extensions header';
+ abortHandshakeOrEmitwsClientError(this, req, socket, 400, message);
+ return;
+ }
+ }
+
+ //
+ // Optionally call external client verification handler.
+ //
+ if (this.options.verifyClient) {
+ const info = {
+ origin:
+ req.headers[`${version === 8 ? 'sec-websocket-origin' : 'origin'}`],
+ secure: !!(req.socket.authorized || req.socket.encrypted),
+ req
+ };
+
+ if (this.options.verifyClient.length === 2) {
+ this.options.verifyClient(info, (verified, code, message, headers) => {
+ if (!verified) {
+ return abortHandshake(socket, code || 401, message, headers);
+ }
+
+ this.completeUpgrade(
+ extensions,
+ key,
+ protocols,
+ req,
+ socket,
+ head,
+ cb
+ );
+ });
+ return;
+ }
+
+ if (!this.options.verifyClient(info)) return abortHandshake(socket, 401);
+ }
+
+ this.completeUpgrade(extensions, key, protocols, req, socket, head, cb);
+ }
+
+ /**
+ * Upgrade the connection to WebSocket.
+ *
+ * @param {Object} extensions The accepted extensions
+ * @param {String} key The value of the `Sec-WebSocket-Key` header
+ * @param {Set} protocols The subprotocols
+ * @param {http.IncomingMessage} req The request object
+ * @param {Duplex} socket The network socket between the server and client
+ * @param {Buffer} head The first packet of the upgraded stream
+ * @param {Function} cb Callback
+ * @throws {Error} If called more than once with the same socket
+ * @private
+ */
+ completeUpgrade(extensions, key, protocols, req, socket, head, cb) {
+ //
+ // Destroy the socket if the client has already sent a FIN packet.
+ //
+ if (!socket.readable || !socket.writable) return socket.destroy();
+
+ if (socket[kWebSocket]) {
+ throw new Error(
+ 'server.handleUpgrade() was called more than once with the same ' +
+ 'socket, possibly due to a misconfiguration'
+ );
+ }
+
+ if (this._state > RUNNING) return abortHandshake(socket, 503);
+
+ const digest = createHash('sha1')
+ .update(key + GUID)
+ .digest('base64');
+
+ const headers = [
+ 'HTTP/1.1 101 Switching Protocols',
+ 'Upgrade: websocket',
+ 'Connection: Upgrade',
+ `Sec-WebSocket-Accept: ${digest}`
+ ];
+
+ const ws = new this.options.WebSocket(null, undefined, this.options);
+
+ if (protocols.size) {
+ //
+ // Optionally call external protocol selection handler.
+ //
+ const protocol = this.options.handleProtocols
+ ? this.options.handleProtocols(protocols, req)
+ : protocols.values().next().value;
+
+ if (protocol) {
+ headers.push(`Sec-WebSocket-Protocol: ${protocol}`);
+ ws._protocol = protocol;
+ }
+ }
+
+ if (extensions[PerMessageDeflate.extensionName]) {
+ const params = extensions[PerMessageDeflate.extensionName].params;
+ const value = extension.format({
+ [PerMessageDeflate.extensionName]: [params]
+ });
+ headers.push(`Sec-WebSocket-Extensions: ${value}`);
+ ws._extensions = extensions;
+ }
+
+ //
+ // Allow external modification/inspection of handshake headers.
+ //
+ this.emit('headers', headers, req);
+
+ socket.write(headers.concat('\r\n').join('\r\n'));
+ socket.removeListener('error', socketOnError);
+
+ ws.setSocket(socket, head, {
+ allowSynchronousEvents: this.options.allowSynchronousEvents,
+ maxPayload: this.options.maxPayload,
+ skipUTF8Validation: this.options.skipUTF8Validation
+ });
+
+ if (this.clients) {
+ this.clients.add(ws);
+ ws.on('close', () => {
+ this.clients.delete(ws);
+
+ if (this._shouldEmitClose && !this.clients.size) {
+ process.nextTick(emitClose, this);
+ }
+ });
+ }
+
+ cb(ws, req);
+ }
+}
+
+module.exports = WebSocketServer;
+
+/**
+ * Add event listeners on an `EventEmitter` using a map of <event, listener>
+ * pairs.
+ *
+ * @param {EventEmitter} server The event emitter
+ * @param {Object.<String, Function>} map The listeners to add
+ * @return {Function} A function that will remove the added listeners when
+ * called
+ * @private
+ */
+function addListeners(server, map) {
+ for (const event of Object.keys(map)) server.on(event, map[event]);
+
+ return function removeListeners() {
+ for (const event of Object.keys(map)) {
+ server.removeListener(event, map[event]);
+ }
+ };
+}
+
+/**
+ * Emit a `'close'` event on an `EventEmitter`.
+ *
+ * @param {EventEmitter} server The event emitter
+ * @private
+ */
+function emitClose(server) {
+ server._state = CLOSED;
+ server.emit('close');
+}
+
+/**
+ * Handle socket errors.
+ *
+ * @private
+ */
+function socketOnError() {
+ this.destroy();
+}
+
+/**
+ * Close the connection when preconditions are not fulfilled.
+ *
+ * @param {Duplex} socket The socket of the upgrade request
+ * @param {Number} code The HTTP response status code
+ * @param {String} [message] The HTTP response body
+ * @param {Object} [headers] Additional HTTP response headers
+ * @private
+ */
+function abortHandshake(socket, code, message, headers) {
+ //
+ // The socket is writable unless the user destroyed or ended it before calling
+ // `server.handleUpgrade()` or in the `verifyClient` function, which is a user
+ // error. Handling this does not make much sense as the worst that can happen
+ // is that some of the data written by the user might be discarded due to the
+ // call to `socket.end()` below, which triggers an `'error'` event that in
+ // turn causes the socket to be destroyed.
+ //
+ message = message || http.STATUS_CODES[code];
+ headers = {
+ Connection: 'close',
+ 'Content-Type': 'text/html',
+ 'Content-Length': Buffer.byteLength(message),
+ ...headers
+ };
+
+ socket.once('finish', socket.destroy);
+
+ socket.end(
+ `HTTP/1.1 ${code} ${http.STATUS_CODES[code]}\r\n` +
+ Object.keys(headers)
+ .map((h) => `${h}: ${headers[h]}`)
+ .join('\r\n') +
+ '\r\n\r\n' +
+ message
+ );
+}
+
+/**
+ * Emit a `'wsClientError'` event on a `WebSocketServer` if there is at least
+ * one listener for it, otherwise call `abortHandshake()`.
+ *
+ * @param {WebSocketServer} server The WebSocket server
+ * @param {http.IncomingMessage} req The request object
+ * @param {Duplex} socket The socket of the upgrade request
+ * @param {Number} code The HTTP response status code
+ * @param {String} message The HTTP response body
+ * @private
+ */
+function abortHandshakeOrEmitwsClientError(server, req, socket, code, message) {
+ if (server.listenerCount('wsClientError')) {
+ const err = new Error(message);
+ Error.captureStackTrace(err, abortHandshakeOrEmitwsClientError);
+
+ server.emit('wsClientError', err, socket, req);
+ } else {
+ abortHandshake(socket, code, message);
+ }
+}
diff --git a/client/node_modules/ws/lib/websocket.js b/client/node_modules/ws/lib/websocket.js
new file mode 100644
index 0000000..df5034c
--- /dev/null
+++ b/client/node_modules/ws/lib/websocket.js
@@ -0,0 +1,1336 @@
+/* eslint no-unused-vars: ["error", { "varsIgnorePattern": "^Duplex|Readable$" }] */
+
+'use strict';
+
+const EventEmitter = require('events');
+const https = require('https');
+const http = require('http');
+const net = require('net');
+const tls = require('tls');
+const { randomBytes, createHash } = require('crypto');
+const { Duplex, Readable } = require('stream');
+const { URL } = require('url');
+
+const PerMessageDeflate = require('./permessage-deflate');
+const Receiver = require('./receiver');
+const Sender = require('./sender');
+const {
+ BINARY_TYPES,
+ EMPTY_BUFFER,
+ GUID,
+ kForOnEventAttribute,
+ kListener,
+ kStatusCode,
+ kWebSocket,
+ NOOP
+} = require('./constants');
+const {
+ EventTarget: { addEventListener, removeEventListener }
+} = require('./event-target');
+const { format, parse } = require('./extension');
+const { toBuffer } = require('./buffer-util');
+
+const closeTimeout = 30 * 1000;
+const kAborted = Symbol('kAborted');
+const protocolVersions = [8, 13];
+const readyStates = ['CONNECTING', 'OPEN', 'CLOSING', 'CLOSED'];
+const subprotocolRegex = /^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/;
+
+/**
+ * Class representing a WebSocket.
+ *
+ * @extends EventEmitter
+ */
+class WebSocket extends EventEmitter {
+ /**
+ * Create a new `WebSocket`.
+ *
+ * @param {(String|URL)} address The URL to which to connect
+ * @param {(String|String[])} [protocols] The subprotocols
+ * @param {Object} [options] Connection options
+ */
+ constructor(address, protocols, options) {
+ super();
+
+ this._binaryType = BINARY_TYPES[0];
+ this._closeCode = 1006;
+ this._closeFrameReceived = false;
+ this._closeFrameSent = false;
+ this._closeMessage = EMPTY_BUFFER;
+ this._closeTimer = null;
+ this._extensions = {};
+ this._paused = false;
+ this._protocol = '';
+ this._readyState = WebSocket.CONNECTING;
+ this._receiver = null;
+ this._sender = null;
+ this._socket = null;
+
+ if (address !== null) {
+ this._bufferedAmount = 0;
+ this._isServer = false;
+ this._redirects = 0;
+
+ if (protocols === undefined) {
+ protocols = [];
+ } else if (!Array.isArray(protocols)) {
+ if (typeof protocols === 'object' && protocols !== null) {
+ options = protocols;
+ protocols = [];
+ } else {
+ protocols = [protocols];
+ }
+ }
+
+ initAsClient(this, address, protocols, options);
+ } else {
+ this._autoPong = options.autoPong;
+ this._isServer = true;
+ }
+ }
+
+ /**
+ * This deviates from the WHATWG interface since ws doesn't support the
+ * required default "blob" type (instead we define a custom "nodebuffer"
+ * type).
+ *
+ * @type {String}
+ */
+ get binaryType() {
+ return this._binaryType;
+ }
+
+ set binaryType(type) {
+ if (!BINARY_TYPES.includes(type)) return;
+
+ this._binaryType = type;
+
+ //
+ // Allow to change `binaryType` on the fly.
+ //
+ if (this._receiver) this._receiver._binaryType = type;
+ }
+
+ /**
+ * @type {Number}
+ */
+ get bufferedAmount() {
+ if (!this._socket) return this._bufferedAmount;
+
+ return this._socket._writableState.length + this._sender._bufferedBytes;
+ }
+
+ /**
+ * @type {String}
+ */
+ get extensions() {
+ return Object.keys(this._extensions).join();
+ }
+
+ /**
+ * @type {Boolean}
+ */
+ get isPaused() {
+ return this._paused;
+ }
+
+ /**
+ * @type {Function}
+ */
+ /* istanbul ignore next */
+ get onclose() {
+ return null;
+ }
+
+ /**
+ * @type {Function}
+ */
+ /* istanbul ignore next */
+ get onerror() {
+ return null;
+ }
+
+ /**
+ * @type {Function}
+ */
+ /* istanbul ignore next */
+ get onopen() {
+ return null;
+ }
+
+ /**
+ * @type {Function}
+ */
+ /* istanbul ignore next */
+ get onmessage() {
+ return null;
+ }
+
+ /**
+ * @type {String}
+ */
+ get protocol() {
+ return this._protocol;
+ }
+
+ /**
+ * @type {Number}
+ */
+ get readyState() {
+ return this._readyState;
+ }
+
+ /**
+ * @type {String}
+ */
+ get url() {
+ return this._url;
+ }
+
+ /**
+ * Set up the socket and the internal resources.
+ *
+ * @param {Duplex} socket The network socket between the server and client
+ * @param {Buffer} head The first packet of the upgraded stream
+ * @param {Object} options Options object
+ * @param {Boolean} [options.allowSynchronousEvents=false] Specifies whether
+ * any of the `'message'`, `'ping'`, and `'pong'` events can be emitted
+ * multiple times in the same tick
+ * @param {Function} [options.generateMask] The function used to generate the
+ * masking key
+ * @param {Number} [options.maxPayload=0] The maximum allowed message size
+ * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or
+ * not to skip UTF-8 validation for text and close messages
+ * @private
+ */
+ setSocket(socket, head, options) {
+ const receiver = new Receiver({
+ allowSynchronousEvents: options.allowSynchronousEvents,
+ binaryType: this.binaryType,
+ extensions: this._extensions,
+ isServer: this._isServer,
+ maxPayload: options.maxPayload,
+ skipUTF8Validation: options.skipUTF8Validation
+ });
+
+ this._sender = new Sender(socket, this._extensions, options.generateMask);
+ this._receiver = receiver;
+ this._socket = socket;
+
+ receiver[kWebSocket] = this;
+ socket[kWebSocket] = this;
+
+ receiver.on('conclude', receiverOnConclude);
+ receiver.on('drain', receiverOnDrain);
+ receiver.on('error', receiverOnError);
+ receiver.on('message', receiverOnMessage);
+ receiver.on('ping', receiverOnPing);
+ receiver.on('pong', receiverOnPong);
+
+ //
+ // These methods may not be available if `socket` is just a `Duplex`.
+ //
+ if (socket.setTimeout) socket.setTimeout(0);
+ if (socket.setNoDelay) socket.setNoDelay();
+
+ if (head.length > 0) socket.unshift(head);
+
+ socket.on('close', socketOnClose);
+ socket.on('data', socketOnData);
+ socket.on('end', socketOnEnd);
+ socket.on('error', socketOnError);
+
+ this._readyState = WebSocket.OPEN;
+ this.emit('open');
+ }
+
+ /**
+ * Emit the `'close'` event.
+ *
+ * @private
+ */
+ emitClose() {
+ if (!this._socket) {
+ this._readyState = WebSocket.CLOSED;
+ this.emit('close', this._closeCode, this._closeMessage);
+ return;
+ }
+
+ if (this._extensions[PerMessageDeflate.extensionName]) {
+ this._extensions[PerMessageDeflate.extensionName].cleanup();
+ }
+
+ this._receiver.removeAllListeners();
+ this._readyState = WebSocket.CLOSED;
+ this.emit('close', this._closeCode, this._closeMessage);
+ }
+
+ /**
+ * Start a closing handshake.
+ *
+ * +----------+ +-----------+ +----------+
+ * - - -|ws.close()|-->|close frame|-->|ws.close()|- - -
+ * | +----------+ +-----------+ +----------+ |
+ * +----------+ +-----------+ |
+ * CLOSING |ws.close()|<--|close frame|<--+-----+ CLOSING
+ * +----------+ +-----------+ |
+ * | | | +---+ |
+ * +------------------------+-->|fin| - - - -
+ * | +---+ | +---+
+ * - - - - -|fin|<---------------------+
+ * +---+
+ *
+ * @param {Number} [code] Status code explaining why the connection is closing
+ * @param {(String|Buffer)} [data] The reason why the connection is
+ * closing
+ * @public
+ */
+ close(code, data) {
+ if (this.readyState === WebSocket.CLOSED) return;
+ if (this.readyState === WebSocket.CONNECTING) {
+ const msg = 'WebSocket was closed before the connection was established';
+ abortHandshake(this, this._req, msg);
+ return;
+ }
+
+ if (this.readyState === WebSocket.CLOSING) {
+ if (
+ this._closeFrameSent &&
+ (this._closeFrameReceived || this._receiver._writableState.errorEmitted)
+ ) {
+ this._socket.end();
+ }
+
+ return;
+ }
+
+ this._readyState = WebSocket.CLOSING;
+ this._sender.close(code, data, !this._isServer, (err) => {
+ //
+ // This error is handled by the `'error'` listener on the socket. We only
+ // want to know if the close frame has been sent here.
+ //
+ if (err) return;
+
+ this._closeFrameSent = true;
+
+ if (
+ this._closeFrameReceived ||
+ this._receiver._writableState.errorEmitted
+ ) {
+ this._socket.end();
+ }
+ });
+
+ //
+ // Specify a timeout for the closing handshake to complete.
+ //
+ this._closeTimer = setTimeout(
+ this._socket.destroy.bind(this._socket),
+ closeTimeout
+ );
+ }
+
+ /**
+ * Pause the socket.
+ *
+ * @public
+ */
+ pause() {
+ if (
+ this.readyState === WebSocket.CONNECTING ||
+ this.readyState === WebSocket.CLOSED
+ ) {
+ return;
+ }
+
+ this._paused = true;
+ this._socket.pause();
+ }
+
+ /**
+ * Send a ping.
+ *
+ * @param {*} [data] The data to send
+ * @param {Boolean} [mask] Indicates whether or not to mask `data`
+ * @param {Function} [cb] Callback which is executed when the ping is sent
+ * @public
+ */
+ ping(data, mask, cb) {
+ if (this.readyState === WebSocket.CONNECTING) {
+ throw new Error('WebSocket is not open: readyState 0 (CONNECTING)');
+ }
+
+ if (typeof data === 'function') {
+ cb = data;
+ data = mask = undefined;
+ } else if (typeof mask === 'function') {
+ cb = mask;
+ mask = undefined;
+ }
+
+ if (typeof data === 'number') data = data.toString();
+
+ if (this.readyState !== WebSocket.OPEN) {
+ sendAfterClose(this, data, cb);
+ return;
+ }
+
+ if (mask === undefined) mask = !this._isServer;
+ this._sender.ping(data || EMPTY_BUFFER, mask, cb);
+ }
+
+ /**
+ * Send a pong.
+ *
+ * @param {*} [data] The data to send
+ * @param {Boolean} [mask] Indicates whether or not to mask `data`
+ * @param {Function} [cb] Callback which is executed when the pong is sent
+ * @public
+ */
+ pong(data, mask, cb) {
+ if (this.readyState === WebSocket.CONNECTING) {
+ throw new Error('WebSocket is not open: readyState 0 (CONNECTING)');
+ }
+
+ if (typeof data === 'function') {
+ cb = data;
+ data = mask = undefined;
+ } else if (typeof mask === 'function') {
+ cb = mask;
+ mask = undefined;
+ }
+
+ if (typeof data === 'number') data = data.toString();
+
+ if (this.readyState !== WebSocket.OPEN) {
+ sendAfterClose(this, data, cb);
+ return;
+ }
+
+ if (mask === undefined) mask = !this._isServer;
+ this._sender.pong(data || EMPTY_BUFFER, mask, cb);
+ }
+
+ /**
+ * Resume the socket.
+ *
+ * @public
+ */
+ resume() {
+ if (
+ this.readyState === WebSocket.CONNECTING ||
+ this.readyState === WebSocket.CLOSED
+ ) {
+ return;
+ }
+
+ this._paused = false;
+ if (!this._receiver._writableState.needDrain) this._socket.resume();
+ }
+
+ /**
+ * Send a data message.
+ *
+ * @param {*} data The message to send
+ * @param {Object} [options] Options object
+ * @param {Boolean} [options.binary] Specifies whether `data` is binary or
+ * text
+ * @param {Boolean} [options.compress] Specifies whether or not to compress
+ * `data`
+ * @param {Boolean} [options.fin=true] Specifies whether the fragment is the
+ * last one
+ * @param {Boolean} [options.mask] Specifies whether or not to mask `data`
+ * @param {Function} [cb] Callback which is executed when data is written out
+ * @public
+ */
+ send(data, options, cb) {
+ if (this.readyState === WebSocket.CONNECTING) {
+ throw new Error('WebSocket is not open: readyState 0 (CONNECTING)');
+ }
+
+ if (typeof options === 'function') {
+ cb = options;
+ options = {};
+ }
+
+ if (typeof data === 'number') data = data.toString();
+
+ if (this.readyState !== WebSocket.OPEN) {
+ sendAfterClose(this, data, cb);
+ return;
+ }
+
+ const opts = {
+ binary: typeof data !== 'string',
+ mask: !this._isServer,
+ compress: true,
+ fin: true,
+ ...options
+ };
+
+ if (!this._extensions[PerMessageDeflate.extensionName]) {
+ opts.compress = false;
+ }
+
+ this._sender.send(data || EMPTY_BUFFER, opts, cb);
+ }
+
+ /**
+ * Forcibly close the connection.
+ *
+ * @public
+ */
+ terminate() {
+ if (this.readyState === WebSocket.CLOSED) return;
+ if (this.readyState === WebSocket.CONNECTING) {
+ const msg = 'WebSocket was closed before the connection was established';
+ abortHandshake(this, this._req, msg);
+ return;
+ }
+
+ if (this._socket) {
+ this._readyState = WebSocket.CLOSING;
+ this._socket.destroy();
+ }
+ }
+}
+
+/**
+ * @constant {Number} CONNECTING
+ * @memberof WebSocket
+ */
+Object.defineProperty(WebSocket, 'CONNECTING', {
+ enumerable: true,
+ value: readyStates.indexOf('CONNECTING')
+});
+
+/**
+ * @constant {Number} CONNECTING
+ * @memberof WebSocket.prototype
+ */
+Object.defineProperty(WebSocket.prototype, 'CONNECTING', {
+ enumerable: true,
+ value: readyStates.indexOf('CONNECTING')
+});
+
+/**
+ * @constant {Number} OPEN
+ * @memberof WebSocket
+ */
+Object.defineProperty(WebSocket, 'OPEN', {
+ enumerable: true,
+ value: readyStates.indexOf('OPEN')
+});
+
+/**
+ * @constant {Number} OPEN
+ * @memberof WebSocket.prototype
+ */
+Object.defineProperty(WebSocket.prototype, 'OPEN', {
+ enumerable: true,
+ value: readyStates.indexOf('OPEN')
+});
+
+/**
+ * @constant {Number} CLOSING
+ * @memberof WebSocket
+ */
+Object.defineProperty(WebSocket, 'CLOSING', {
+ enumerable: true,
+ value: readyStates.indexOf('CLOSING')
+});
+
+/**
+ * @constant {Number} CLOSING
+ * @memberof WebSocket.prototype
+ */
+Object.defineProperty(WebSocket.prototype, 'CLOSING', {
+ enumerable: true,
+ value: readyStates.indexOf('CLOSING')
+});
+
+/**
+ * @constant {Number} CLOSED
+ * @memberof WebSocket
+ */
+Object.defineProperty(WebSocket, 'CLOSED', {
+ enumerable: true,
+ value: readyStates.indexOf('CLOSED')
+});
+
+/**
+ * @constant {Number} CLOSED
+ * @memberof WebSocket.prototype
+ */
+Object.defineProperty(WebSocket.prototype, 'CLOSED', {
+ enumerable: true,
+ value: readyStates.indexOf('CLOSED')
+});
+
+[
+ 'binaryType',
+ 'bufferedAmount',
+ 'extensions',
+ 'isPaused',
+ 'protocol',
+ 'readyState',
+ 'url'
+].forEach((property) => {
+ Object.defineProperty(WebSocket.prototype, property, { enumerable: true });
+});
+
+//
+// Add the `onopen`, `onerror`, `onclose`, and `onmessage` attributes.
+// See https://html.spec.whatwg.org/multipage/comms.html#the-websocket-interface
+//
+['open', 'error', 'close', 'message'].forEach((method) => {
+ Object.defineProperty(WebSocket.prototype, `on${method}`, {
+ enumerable: true,
+ get() {
+ for (const listener of this.listeners(method)) {
+ if (listener[kForOnEventAttribute]) return listener[kListener];
+ }
+
+ return null;
+ },
+ set(handler) {
+ for (const listener of this.listeners(method)) {
+ if (listener[kForOnEventAttribute]) {
+ this.removeListener(method, listener);
+ break;
+ }
+ }
+
+ if (typeof handler !== 'function') return;
+
+ this.addEventListener(method, handler, {
+ [kForOnEventAttribute]: true
+ });
+ }
+ });
+});
+
+WebSocket.prototype.addEventListener = addEventListener;
+WebSocket.prototype.removeEventListener = removeEventListener;
+
+module.exports = WebSocket;
+
+/**
+ * Initialize a WebSocket client.
+ *
+ * @param {WebSocket} websocket The client to initialize
+ * @param {(String|URL)} address The URL to which to connect
+ * @param {Array} protocols The subprotocols
+ * @param {Object} [options] Connection options
+ * @param {Boolean} [options.allowSynchronousEvents=false] Specifies whether any
+ * of the `'message'`, `'ping'`, and `'pong'` events can be emitted multiple
+ * times in the same tick
+ * @param {Boolean} [options.autoPong=true] Specifies whether or not to
+ * automatically send a pong in response to a ping
+ * @param {Function} [options.finishRequest] A function which can be used to
+ * customize the headers of each http request before it is sent
+ * @param {Boolean} [options.followRedirects=false] Whether or not to follow
+ * redirects
+ * @param {Function} [options.generateMask] The function used to generate the
+ * masking key
+ * @param {Number} [options.handshakeTimeout] Timeout in milliseconds for the
+ * handshake request
+ * @param {Number} [options.maxPayload=104857600] The maximum allowed message
+ * size
+ * @param {Number} [options.maxRedirects=10] The maximum number of redirects
+ * allowed
+ * @param {String} [options.origin] Value of the `Origin` or
+ * `Sec-WebSocket-Origin` header
+ * @param {(Boolean|Object)} [options.perMessageDeflate=true] Enable/disable
+ * permessage-deflate
+ * @param {Number} [options.protocolVersion=13] Value of the
+ * `Sec-WebSocket-Version` header
+ * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or
+ * not to skip UTF-8 validation for text and close messages
+ * @private
+ */
+function initAsClient(websocket, address, protocols, options) {
+ const opts = {
+ allowSynchronousEvents: false,
+ autoPong: true,
+ protocolVersion: protocolVersions[1],
+ maxPayload: 100 * 1024 * 1024,
+ skipUTF8Validation: false,
+ perMessageDeflate: true,
+ followRedirects: false,
+ maxRedirects: 10,
+ ...options,
+ createConnection: undefined,
+ socketPath: undefined,
+ hostname: undefined,
+ protocol: undefined,
+ timeout: undefined,
+ method: 'GET',
+ host: undefined,
+ path: undefined,
+ port: undefined
+ };
+
+ websocket._autoPong = opts.autoPong;
+
+ if (!protocolVersions.includes(opts.protocolVersion)) {
+ throw new RangeError(
+ `Unsupported protocol version: ${opts.protocolVersion} ` +
+ `(supported versions: ${protocolVersions.join(', ')})`
+ );
+ }
+
+ let parsedUrl;
+
+ if (address instanceof URL) {
+ parsedUrl = address;
+ } else {
+ try {
+ parsedUrl = new URL(address);
+ } catch (e) {
+ throw new SyntaxError(`Invalid URL: ${address}`);
+ }
+ }
+
+ if (parsedUrl.protocol === 'http:') {
+ parsedUrl.protocol = 'ws:';
+ } else if (parsedUrl.protocol === 'https:') {
+ parsedUrl.protocol = 'wss:';
+ }
+
+ websocket._url = parsedUrl.href;
+
+ const isSecure = parsedUrl.protocol === 'wss:';
+ const isIpcUrl = parsedUrl.protocol === 'ws+unix:';
+ let invalidUrlMessage;
+
+ if (parsedUrl.protocol !== 'ws:' && !isSecure && !isIpcUrl) {
+ invalidUrlMessage =
+ 'The URL\'s protocol must be one of "ws:", "wss:", ' +
+ '"http:", "https", or "ws+unix:"';
+ } else if (isIpcUrl && !parsedUrl.pathname) {
+ invalidUrlMessage = "The URL's pathname is empty";
+ } else if (parsedUrl.hash) {
+ invalidUrlMessage = 'The URL contains a fragment identifier';
+ }
+
+ if (invalidUrlMessage) {
+ const err = new SyntaxError(invalidUrlMessage);
+
+ if (websocket._redirects === 0) {
+ throw err;
+ } else {
+ emitErrorAndClose(websocket, err);
+ return;
+ }
+ }
+
+ const defaultPort = isSecure ? 443 : 80;
+ const key = randomBytes(16).toString('base64');
+ const request = isSecure ? https.request : http.request;
+ const protocolSet = new Set();
+ let perMessageDeflate;
+
+ opts.createConnection = isSecure ? tlsConnect : netConnect;
+ opts.defaultPort = opts.defaultPort || defaultPort;
+ opts.port = parsedUrl.port || defaultPort;
+ opts.host = parsedUrl.hostname.startsWith('[')
+ ? parsedUrl.hostname.slice(1, -1)
+ : parsedUrl.hostname;
+ opts.headers = {
+ ...opts.headers,
+ 'Sec-WebSocket-Version': opts.protocolVersion,
+ 'Sec-WebSocket-Key': key,
+ Connection: 'Upgrade',
+ Upgrade: 'websocket'
+ };
+ opts.path = parsedUrl.pathname + parsedUrl.search;
+ opts.timeout = opts.handshakeTimeout;
+
+ if (opts.perMessageDeflate) {
+ perMessageDeflate = new PerMessageDeflate(
+ opts.perMessageDeflate !== true ? opts.perMessageDeflate : {},
+ false,
+ opts.maxPayload
+ );
+ opts.headers['Sec-WebSocket-Extensions'] = format({
+ [PerMessageDeflate.extensionName]: perMessageDeflate.offer()
+ });
+ }
+ if (protocols.length) {
+ for (const protocol of protocols) {
+ if (
+ typeof protocol !== 'string' ||
+ !subprotocolRegex.test(protocol) ||
+ protocolSet.has(protocol)
+ ) {
+ throw new SyntaxError(
+ 'An invalid or duplicated subprotocol was specified'
+ );
+ }
+
+ protocolSet.add(protocol);
+ }
+
+ opts.headers['Sec-WebSocket-Protocol'] = protocols.join(',');
+ }
+ if (opts.origin) {
+ if (opts.protocolVersion < 13) {
+ opts.headers['Sec-WebSocket-Origin'] = opts.origin;
+ } else {
+ opts.headers.Origin = opts.origin;
+ }
+ }
+ if (parsedUrl.username || parsedUrl.password) {
+ opts.auth = `${parsedUrl.username}:${parsedUrl.password}`;
+ }
+
+ if (isIpcUrl) {
+ const parts = opts.path.split(':');
+
+ opts.socketPath = parts[0];
+ opts.path = parts[1];
+ }
+
+ let req;
+
+ if (opts.followRedirects) {
+ if (websocket._redirects === 0) {
+ websocket._originalIpc = isIpcUrl;
+ websocket._originalSecure = isSecure;
+ websocket._originalHostOrSocketPath = isIpcUrl
+ ? opts.socketPath
+ : parsedUrl.host;
+
+ const headers = options && options.headers;
+
+ //
+ // Shallow copy the user provided options so that headers can be changed
+ // without mutating the original object.
+ //
+ options = { ...options, headers: {} };
+
+ if (headers) {
+ for (const [key, value] of Object.entries(headers)) {
+ options.headers[key.toLowerCase()] = value;
+ }
+ }
+ } else if (websocket.listenerCount('redirect') === 0) {
+ const isSameHost = isIpcUrl
+ ? websocket._originalIpc
+ ? opts.socketPath === websocket._originalHostOrSocketPath
+ : false
+ : websocket._originalIpc
+ ? false
+ : parsedUrl.host === websocket._originalHostOrSocketPath;
+
+ if (!isSameHost || (websocket._originalSecure && !isSecure)) {
+ //
+ // Match curl 7.77.0 behavior and drop the following headers. These
+ // headers are also dropped when following a redirect to a subdomain.
+ //
+ delete opts.headers.authorization;
+ delete opts.headers.cookie;
+
+ if (!isSameHost) delete opts.headers.host;
+
+ opts.auth = undefined;
+ }
+ }
+
+ //
+ // Match curl 7.77.0 behavior and make the first `Authorization` header win.
+ // If the `Authorization` header is set, then there is nothing to do as it
+ // will take precedence.
+ //
+ if (opts.auth && !options.headers.authorization) {
+ options.headers.authorization =
+ 'Basic ' + Buffer.from(opts.auth).toString('base64');
+ }
+
+ req = websocket._req = request(opts);
+
+ if (websocket._redirects) {
+ //
+ // Unlike what is done for the `'upgrade'` event, no early exit is
+ // triggered here if the user calls `websocket.close()` or
+ // `websocket.terminate()` from a listener of the `'redirect'` event. This
+ // is because the user can also call `request.destroy()` with an error
+ // before calling `websocket.close()` or `websocket.terminate()` and this
+ // would result in an error being emitted on the `request` object with no
+ // `'error'` event listeners attached.
+ //
+ websocket.emit('redirect', websocket.url, req);
+ }
+ } else {
+ req = websocket._req = request(opts);
+ }
+
+ if (opts.timeout) {
+ req.on('timeout', () => {
+ abortHandshake(websocket, req, 'Opening handshake has timed out');
+ });
+ }
+
+ req.on('error', (err) => {
+ if (req === null || req[kAborted]) return;
+
+ req = websocket._req = null;
+ emitErrorAndClose(websocket, err);
+ });
+
+ req.on('response', (res) => {
+ const location = res.headers.location;
+ const statusCode = res.statusCode;
+
+ if (
+ location &&
+ opts.followRedirects &&
+ statusCode >= 300 &&
+ statusCode < 400
+ ) {
+ if (++websocket._redirects > opts.maxRedirects) {
+ abortHandshake(websocket, req, 'Maximum redirects exceeded');
+ return;
+ }
+
+ req.abort();
+
+ let addr;
+
+ try {
+ addr = new URL(location, address);
+ } catch (e) {
+ const err = new SyntaxError(`Invalid URL: ${location}`);
+ emitErrorAndClose(websocket, err);
+ return;
+ }
+
+ initAsClient(websocket, addr, protocols, options);
+ } else if (!websocket.emit('unexpected-response', req, res)) {
+ abortHandshake(
+ websocket,
+ req,
+ `Unexpected server response: ${res.statusCode}`
+ );
+ }
+ });
+
+ req.on('upgrade', (res, socket, head) => {
+ websocket.emit('upgrade', res);
+
+ //
+ // The user may have closed the connection from a listener of the
+ // `'upgrade'` event.
+ //
+ if (websocket.readyState !== WebSocket.CONNECTING) return;
+
+ req = websocket._req = null;
+
+ if (res.headers.upgrade.toLowerCase() !== 'websocket') {
+ abortHandshake(websocket, socket, 'Invalid Upgrade header');
+ return;
+ }
+
+ const digest = createHash('sha1')
+ .update(key + GUID)
+ .digest('base64');
+
+ if (res.headers['sec-websocket-accept'] !== digest) {
+ abortHandshake(websocket, socket, 'Invalid Sec-WebSocket-Accept header');
+ return;
+ }
+
+ const serverProt = res.headers['sec-websocket-protocol'];
+ let protError;
+
+ if (serverProt !== undefined) {
+ if (!protocolSet.size) {
+ protError = 'Server sent a subprotocol but none was requested';
+ } else if (!protocolSet.has(serverProt)) {
+ protError = 'Server sent an invalid subprotocol';
+ }
+ } else if (protocolSet.size) {
+ protError = 'Server sent no subprotocol';
+ }
+
+ if (protError) {
+ abortHandshake(websocket, socket, protError);
+ return;
+ }
+
+ if (serverProt) websocket._protocol = serverProt;
+
+ const secWebSocketExtensions = res.headers['sec-websocket-extensions'];
+
+ if (secWebSocketExtensions !== undefined) {
+ if (!perMessageDeflate) {
+ const message =
+ 'Server sent a Sec-WebSocket-Extensions header but no extension ' +
+ 'was requested';
+ abortHandshake(websocket, socket, message);
+ return;
+ }
+
+ let extensions;
+
+ try {
+ extensions = parse(secWebSocketExtensions);
+ } catch (err) {
+ const message = 'Invalid Sec-WebSocket-Extensions header';
+ abortHandshake(websocket, socket, message);
+ return;
+ }
+
+ const extensionNames = Object.keys(extensions);
+
+ if (
+ extensionNames.length !== 1 ||
+ extensionNames[0] !== PerMessageDeflate.extensionName
+ ) {
+ const message = 'Server indicated an extension that was not requested';
+ abortHandshake(websocket, socket, message);
+ return;
+ }
+
+ try {
+ perMessageDeflate.accept(extensions[PerMessageDeflate.extensionName]);
+ } catch (err) {
+ const message = 'Invalid Sec-WebSocket-Extensions header';
+ abortHandshake(websocket, socket, message);
+ return;
+ }
+
+ websocket._extensions[PerMessageDeflate.extensionName] =
+ perMessageDeflate;
+ }
+
+ websocket.setSocket(socket, head, {
+ allowSynchronousEvents: opts.allowSynchronousEvents,
+ generateMask: opts.generateMask,
+ maxPayload: opts.maxPayload,
+ skipUTF8Validation: opts.skipUTF8Validation
+ });
+ });
+
+ if (opts.finishRequest) {
+ opts.finishRequest(req, websocket);
+ } else {
+ req.end();
+ }
+}
+
+/**
+ * Emit the `'error'` and `'close'` events.
+ *
+ * @param {WebSocket} websocket The WebSocket instance
+ * @param {Error} The error to emit
+ * @private
+ */
+function emitErrorAndClose(websocket, err) {
+ websocket._readyState = WebSocket.CLOSING;
+ websocket.emit('error', err);
+ websocket.emitClose();
+}
+
+/**
+ * Create a `net.Socket` and initiate a connection.
+ *
+ * @param {Object} options Connection options
+ * @return {net.Socket} The newly created socket used to start the connection
+ * @private
+ */
+function netConnect(options) {
+ options.path = options.socketPath;
+ return net.connect(options);
+}
+
+/**
+ * Create a `tls.TLSSocket` and initiate a connection.
+ *
+ * @param {Object} options Connection options
+ * @return {tls.TLSSocket} The newly created socket used to start the connection
+ * @private
+ */
+function tlsConnect(options) {
+ options.path = undefined;
+
+ if (!options.servername && options.servername !== '') {
+ options.servername = net.isIP(options.host) ? '' : options.host;
+ }
+
+ return tls.connect(options);
+}
+
+/**
+ * Abort the handshake and emit an error.
+ *
+ * @param {WebSocket} websocket The WebSocket instance
+ * @param {(http.ClientRequest|net.Socket|tls.Socket)} stream The request to
+ * abort or the socket to destroy
+ * @param {String} message The error message
+ * @private
+ */
+function abortHandshake(websocket, stream, message) {
+ websocket._readyState = WebSocket.CLOSING;
+
+ const err = new Error(message);
+ Error.captureStackTrace(err, abortHandshake);
+
+ if (stream.setHeader) {
+ stream[kAborted] = true;
+ stream.abort();
+
+ if (stream.socket && !stream.socket.destroyed) {
+ //
+ // On Node.js >= 14.3.0 `request.abort()` does not destroy the socket if
+ // called after the request completed. See
+ // https://github.com/websockets/ws/issues/1869.
+ //
+ stream.socket.destroy();
+ }
+
+ process.nextTick(emitErrorAndClose, websocket, err);
+ } else {
+ stream.destroy(err);
+ stream.once('error', websocket.emit.bind(websocket, 'error'));
+ stream.once('close', websocket.emitClose.bind(websocket));
+ }
+}
+
+/**
+ * Handle cases where the `ping()`, `pong()`, or `send()` methods are called
+ * when the `readyState` attribute is `CLOSING` or `CLOSED`.
+ *
+ * @param {WebSocket} websocket The WebSocket instance
+ * @param {*} [data] The data to send
+ * @param {Function} [cb] Callback
+ * @private
+ */
+function sendAfterClose(websocket, data, cb) {
+ if (data) {
+ const length = toBuffer(data).length;
+
+ //
+ // The `_bufferedAmount` property is used only when the peer is a client and
+ // the opening handshake fails. Under these circumstances, in fact, the
+ // `setSocket()` method is not called, so the `_socket` and `_sender`
+ // properties are set to `null`.
+ //
+ if (websocket._socket) websocket._sender._bufferedBytes += length;
+ else websocket._bufferedAmount += length;
+ }
+
+ if (cb) {
+ const err = new Error(
+ `WebSocket is not open: readyState ${websocket.readyState} ` +
+ `(${readyStates[websocket.readyState]})`
+ );
+ process.nextTick(cb, err);
+ }
+}
+
+/**
+ * The listener of the `Receiver` `'conclude'` event.
+ *
+ * @param {Number} code The status code
+ * @param {Buffer} reason The reason for closing
+ * @private
+ */
+function receiverOnConclude(code, reason) {
+ const websocket = this[kWebSocket];
+
+ websocket._closeFrameReceived = true;
+ websocket._closeMessage = reason;
+ websocket._closeCode = code;
+
+ if (websocket._socket[kWebSocket] === undefined) return;
+
+ websocket._socket.removeListener('data', socketOnData);
+ process.nextTick(resume, websocket._socket);
+
+ if (code === 1005) websocket.close();
+ else websocket.close(code, reason);
+}
+
+/**
+ * The listener of the `Receiver` `'drain'` event.
+ *
+ * @private
+ */
+function receiverOnDrain() {
+ const websocket = this[kWebSocket];
+
+ if (!websocket.isPaused) websocket._socket.resume();
+}
+
+/**
+ * The listener of the `Receiver` `'error'` event.
+ *
+ * @param {(RangeError|Error)} err The emitted error
+ * @private
+ */
+function receiverOnError(err) {
+ const websocket = this[kWebSocket];
+
+ if (websocket._socket[kWebSocket] !== undefined) {
+ websocket._socket.removeListener('data', socketOnData);
+
+ //
+ // On Node.js < 14.0.0 the `'error'` event is emitted synchronously. See
+ // https://github.com/websockets/ws/issues/1940.
+ //
+ process.nextTick(resume, websocket._socket);
+
+ websocket.close(err[kStatusCode]);
+ }
+
+ websocket.emit('error', err);
+}
+
+/**
+ * The listener of the `Receiver` `'finish'` event.
+ *
+ * @private
+ */
+function receiverOnFinish() {
+ this[kWebSocket].emitClose();
+}
+
+/**
+ * The listener of the `Receiver` `'message'` event.
+ *
+ * @param {Buffer|ArrayBuffer|Buffer[])} data The message
+ * @param {Boolean} isBinary Specifies whether the message is binary or not
+ * @private
+ */
+function receiverOnMessage(data, isBinary) {
+ this[kWebSocket].emit('message', data, isBinary);
+}
+
+/**
+ * The listener of the `Receiver` `'ping'` event.
+ *
+ * @param {Buffer} data The data included in the ping frame
+ * @private
+ */
+function receiverOnPing(data) {
+ const websocket = this[kWebSocket];
+
+ if (websocket._autoPong) websocket.pong(data, !this._isServer, NOOP);
+ websocket.emit('ping', data);
+}
+
+/**
+ * The listener of the `Receiver` `'pong'` event.
+ *
+ * @param {Buffer} data The data included in the pong frame
+ * @private
+ */
+function receiverOnPong(data) {
+ this[kWebSocket].emit('pong', data);
+}
+
+/**
+ * Resume a readable stream
+ *
+ * @param {Readable} stream The readable stream
+ * @private
+ */
+function resume(stream) {
+ stream.resume();
+}
+
+/**
+ * The listener of the socket `'close'` event.
+ *
+ * @private
+ */
+function socketOnClose() {
+ const websocket = this[kWebSocket];
+
+ this.removeListener('close', socketOnClose);
+ this.removeListener('data', socketOnData);
+ this.removeListener('end', socketOnEnd);
+
+ websocket._readyState = WebSocket.CLOSING;
+
+ let chunk;
+
+ //
+ // The close frame might not have been received or the `'end'` event emitted,
+ // for example, if the socket was destroyed due to an error. Ensure that the
+ // `receiver` stream is closed after writing any remaining buffered data to
+ // it. If the readable side of the socket is in flowing mode then there is no
+ // buffered data as everything has been already written and `readable.read()`
+ // will return `null`. If instead, the socket is paused, any possible buffered
+ // data will be read as a single chunk.
+ //
+ if (
+ !this._readableState.endEmitted &&
+ !websocket._closeFrameReceived &&
+ !websocket._receiver._writableState.errorEmitted &&
+ (chunk = websocket._socket.read()) !== null
+ ) {
+ websocket._receiver.write(chunk);
+ }
+
+ websocket._receiver.end();
+
+ this[kWebSocket] = undefined;
+
+ clearTimeout(websocket._closeTimer);
+
+ if (
+ websocket._receiver._writableState.finished ||
+ websocket._receiver._writableState.errorEmitted
+ ) {
+ websocket.emitClose();
+ } else {
+ websocket._receiver.on('error', receiverOnFinish);
+ websocket._receiver.on('finish', receiverOnFinish);
+ }
+}
+
+/**
+ * The listener of the socket `'data'` event.
+ *
+ * @param {Buffer} chunk A chunk of data
+ * @private
+ */
+function socketOnData(chunk) {
+ if (!this[kWebSocket]._receiver.write(chunk)) {
+ this.pause();
+ }
+}
+
+/**
+ * The listener of the socket `'end'` event.
+ *
+ * @private
+ */
+function socketOnEnd() {
+ const websocket = this[kWebSocket];
+
+ websocket._readyState = WebSocket.CLOSING;
+ websocket._receiver.end();
+ this.end();
+}
+
+/**
+ * The listener of the socket `'error'` event.
+ *
+ * @private
+ */
+function socketOnError() {
+ const websocket = this[kWebSocket];
+
+ this.removeListener('error', socketOnError);
+ this.on('error', NOOP);
+
+ if (websocket) {
+ websocket._readyState = WebSocket.CLOSING;
+ this.destroy();
+ }
+}
diff --git a/client/node_modules/ws/package.json b/client/node_modules/ws/package.json
new file mode 100644
index 0000000..a244320
--- /dev/null
+++ b/client/node_modules/ws/package.json
@@ -0,0 +1,68 @@
+{
+ "name": "ws",
+ "version": "8.16.0",
+ "description": "Simple to use, blazing fast and thoroughly tested websocket client and server for Node.js",
+ "keywords": [
+ "HyBi",
+ "Push",
+ "RFC-6455",
+ "WebSocket",
+ "WebSockets",
+ "real-time"
+ ],
+ "homepage": "https://github.com/websockets/ws",
+ "bugs": "https://github.com/websockets/ws/issues",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/websockets/ws.git"
+ },
+ "author": "Einar Otto Stangvik <einaros@gmail.com> (http://2x.io)",
+ "license": "MIT",
+ "main": "index.js",
+ "exports": {
+ ".": {
+ "browser": "./browser.js",
+ "import": "./wrapper.mjs",
+ "require": "./index.js"
+ },
+ "./package.json": "./package.json"
+ },
+ "browser": "browser.js",
+ "engines": {
+ "node": ">=10.0.0"
+ },
+ "files": [
+ "browser.js",
+ "index.js",
+ "lib/*.js",
+ "wrapper.mjs"
+ ],
+ "scripts": {
+ "test": "nyc --reporter=lcov --reporter=text mocha --throw-deprecation test/*.test.js",
+ "integration": "mocha --throw-deprecation test/*.integration.js",
+ "lint": "eslint --ignore-path .gitignore . && prettier --check --ignore-path .gitignore \"**/*.{json,md,yaml,yml}\""
+ },
+ "peerDependencies": {
+ "bufferutil": "^4.0.1",
+ "utf-8-validate": ">=5.0.2"
+ },
+ "peerDependenciesMeta": {
+ "bufferutil": {
+ "optional": true
+ },
+ "utf-8-validate": {
+ "optional": true
+ }
+ },
+ "devDependencies": {
+ "benchmark": "^2.1.4",
+ "bufferutil": "^4.0.1",
+ "eslint": "^8.0.0",
+ "eslint-config-prettier": "^9.0.0",
+ "eslint-plugin-prettier": "^5.0.0",
+ "mocha": "^8.4.0",
+ "nyc": "^15.0.0",
+ "prettier": "^3.0.0",
+ "utf-8-validate": "^6.0.0"
+ }
+}
diff --git a/client/node_modules/ws/wrapper.mjs b/client/node_modules/ws/wrapper.mjs
new file mode 100644
index 0000000..7245ad1
--- /dev/null
+++ b/client/node_modules/ws/wrapper.mjs
@@ -0,0 +1,8 @@
+import createWebSocketStream from './lib/stream.js';
+import Receiver from './lib/receiver.js';
+import Sender from './lib/sender.js';
+import WebSocket from './lib/websocket.js';
+import WebSocketServer from './lib/websocket-server.js';
+
+export { createWebSocketStream, Receiver, Sender, WebSocket, WebSocketServer };
+export default WebSocket;
diff --git a/client/package-lock.json b/client/package-lock.json
index 2e84317..4ceaf04 100644
--- a/client/package-lock.json
+++ b/client/package-lock.json
@@ -6,7 +6,8 @@
"": {
"dependencies": {
"@cliqz/adblocker-electron": "^1.26.12",
- "cross-fetch": "^4.0.0"
+ "cross-fetch": "^4.0.0",
+ "ws": "^8.16.0"
}
},
"node_modules/@cliqz/adblocker": {
@@ -1021,6 +1022,26 @@
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==",
"peer": true
},
+ "node_modules/ws": {
+ "version": "8.16.0",
+ "resolved": "https://registry.npmjs.org/ws/-/ws-8.16.0.tgz",
+ "integrity": "sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ==",
+ "engines": {
+ "node": ">=10.0.0"
+ },
+ "peerDependencies": {
+ "bufferutil": "^4.0.1",
+ "utf-8-validate": ">=5.0.2"
+ },
+ "peerDependenciesMeta": {
+ "bufferutil": {
+ "optional": true
+ },
+ "utf-8-validate": {
+ "optional": true
+ }
+ }
+ },
"node_modules/yallist": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
diff --git a/client/package.json b/client/package.json
index 258cc2b..751c7e5 100644
--- a/client/package.json
+++ b/client/package.json
@@ -1,6 +1,7 @@
{
"dependencies": {
"@cliqz/adblocker-electron": "^1.26.12",
- "cross-fetch": "^4.0.0"
+ "cross-fetch": "^4.0.0",
+ "ws": "^8.16.0"
}
}
diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json
index 9a83ee3..75c0e15 100644
--- a/node_modules/.package-lock.json
+++ b/node_modules/.package-lock.json
@@ -1,6 +1,6 @@
{
- "name": "localchat",
- "lockfileVersion": 2,
+ "name": "chatroom",
+ "lockfileVersion": 3,
"requires": true,
"packages": {
"node_modules/@babel/generator": {
@@ -177,6 +177,11 @@
"node": ">=8"
}
},
+ "node_modules/asynckit": {
+ "version": "0.4.0",
+ "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
+ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="
+ },
"node_modules/at-least-node": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz",
@@ -185,6 +190,16 @@
"node": ">= 4.0.0"
}
},
+ "node_modules/axios": {
+ "version": "1.6.7",
+ "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.7.tgz",
+ "integrity": "sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA==",
+ "dependencies": {
+ "follow-redirects": "^1.15.4",
+ "form-data": "^4.0.0",
+ "proxy-from-env": "^1.1.0"
+ }
+ },
"node_modules/base64-js": {
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
@@ -307,6 +322,17 @@
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
},
+ "node_modules/combined-stream": {
+ "version": "1.0.8",
+ "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
+ "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
+ "dependencies": {
+ "delayed-stream": "~1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
"node_modules/core-util-is": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
@@ -350,6 +376,14 @@
"node": ">=4.0.0"
}
},
+ "node_modules/delayed-stream": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
+ "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==",
+ "engines": {
+ "node": ">=0.4.0"
+ }
+ },
"node_modules/detect-libc": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.1.tgz",
@@ -432,6 +466,38 @@
"node": ">=8"
}
},
+ "node_modules/follow-redirects": {
+ "version": "1.15.5",
+ "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.5.tgz",
+ "integrity": "sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==",
+ "funding": [
+ {
+ "type": "individual",
+ "url": "https://github.com/sponsors/RubenVerborgh"
+ }
+ ],
+ "engines": {
+ "node": ">=4.0"
+ },
+ "peerDependenciesMeta": {
+ "debug": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/form-data": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz",
+ "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==",
+ "dependencies": {
+ "asynckit": "^0.4.0",
+ "combined-stream": "^1.0.8",
+ "mime-types": "^2.1.12"
+ },
+ "engines": {
+ "node": ">= 6"
+ }
+ },
"node_modules/from2": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz",
@@ -700,6 +766,25 @@
"node": ">=8.6"
}
},
+ "node_modules/mime-db": {
+ "version": "1.52.0",
+ "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
+ "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/mime-types": {
+ "version": "2.1.35",
+ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
+ "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
+ "dependencies": {
+ "mime-db": "1.52.0"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
"node_modules/mimic-response": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz",
@@ -928,6 +1013,11 @@
"node": ">=0.4.0"
}
},
+ "node_modules/proxy-from-env": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
+ "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="
+ },
"node_modules/pump": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz",
@@ -1312,6 +1402,26 @@
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="
},
+ "node_modules/ws": {
+ "version": "8.16.0",
+ "resolved": "https://registry.npmjs.org/ws/-/ws-8.16.0.tgz",
+ "integrity": "sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ==",
+ "engines": {
+ "node": ">=10.0.0"
+ },
+ "peerDependencies": {
+ "bufferutil": "^4.0.1",
+ "utf-8-validate": ">=5.0.2"
+ },
+ "peerDependenciesMeta": {
+ "bufferutil": {
+ "optional": true
+ },
+ "utf-8-validate": {
+ "optional": true
+ }
+ }
+ },
"node_modules/y18n": {
"version": "5.0.8",
"resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",
diff --git a/node_modules/asynckit/LICENSE b/node_modules/asynckit/LICENSE
new file mode 100644
index 0000000..c9eca5d
--- /dev/null
+++ b/node_modules/asynckit/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2016 Alex Indigo
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/node_modules/asynckit/README.md b/node_modules/asynckit/README.md
new file mode 100644
index 0000000..ddcc7e6
--- /dev/null
+++ b/node_modules/asynckit/README.md
@@ -0,0 +1,233 @@
+# asynckit [![NPM Module](https://img.shields.io/npm/v/asynckit.svg?style=flat)](https://www.npmjs.com/package/asynckit)
+
+Minimal async jobs utility library, with streams support.
+
+[![PhantomJS Build](https://img.shields.io/travis/alexindigo/asynckit/v0.4.0.svg?label=browser&style=flat)](https://travis-ci.org/alexindigo/asynckit)
+[![Linux Build](https://img.shields.io/travis/alexindigo/asynckit/v0.4.0.svg?label=linux:0.12-6.x&style=flat)](https://travis-ci.org/alexindigo/asynckit)
+[![Windows Build](https://img.shields.io/appveyor/ci/alexindigo/asynckit/v0.4.0.svg?label=windows:0.12-6.x&style=flat)](https://ci.appveyor.com/project/alexindigo/asynckit)
+
+[![Coverage Status](https://img.shields.io/coveralls/alexindigo/asynckit/v0.4.0.svg?label=code+coverage&style=flat)](https://coveralls.io/github/alexindigo/asynckit?branch=master)
+[![Dependency Status](https://img.shields.io/david/alexindigo/asynckit/v0.4.0.svg?style=flat)](https://david-dm.org/alexindigo/asynckit)
+[![bitHound Overall Score](https://www.bithound.io/github/alexindigo/asynckit/badges/score.svg)](https://www.bithound.io/github/alexindigo/asynckit)
+
+<!-- [![Readme](https://img.shields.io/badge/readme-tested-brightgreen.svg?style=flat)](https://www.npmjs.com/package/reamde) -->
+
+AsyncKit provides harness for `parallel` and `serial` iterators over list of items represented by arrays or objects.
+Optionally it accepts abort function (should be synchronously return by iterator for each item), and terminates left over jobs upon an error event. For specific iteration order built-in (`ascending` and `descending`) and custom sort helpers also supported, via `asynckit.serialOrdered` method.
+
+It ensures async operations to keep behavior more stable and prevent `Maximum call stack size exceeded` errors, from sync iterators.
+
+| compression | size |
+| :----------------- | -------: |
+| asynckit.js | 12.34 kB |
+| asynckit.min.js | 4.11 kB |
+| asynckit.min.js.gz | 1.47 kB |
+
+
+## Install
+
+```sh
+$ npm install --save asynckit
+```
+
+## Examples
+
+### Parallel Jobs
+
+Runs iterator over provided array in parallel. Stores output in the `result` array,
+on the matching positions. In unlikely event of an error from one of the jobs,
+will terminate rest of the active jobs (if abort function is provided)
+and return error along with salvaged data to the main callback function.
+
+#### Input Array
+
+```javascript
+var parallel = require('asynckit').parallel
+ , assert = require('assert')
+ ;
+
+var source = [ 1, 1, 4, 16, 64, 32, 8, 2 ]
+ , expectedResult = [ 2, 2, 8, 32, 128, 64, 16, 4 ]
+ , expectedTarget = [ 1, 1, 2, 4, 8, 16, 32, 64 ]
+ , target = []
+ ;
+
+parallel(source, asyncJob, function(err, result)
+{
+ assert.deepEqual(result, expectedResult);
+ assert.deepEqual(target, expectedTarget);
+});
+
+// async job accepts one element from the array
+// and a callback function
+function asyncJob(item, cb)
+{
+ // different delays (in ms) per item
+ var delay = item * 25;
+
+ // pretend different jobs take different time to finish
+ // and not in consequential order
+ var timeoutId = setTimeout(function() {
+ target.push(item);
+ cb(null, item * 2);
+ }, delay);
+
+ // allow to cancel "leftover" jobs upon error
+ // return function, invoking of which will abort this job
+ return clearTimeout.bind(null, timeoutId);
+}
+```
+
+More examples could be found in [test/test-parallel-array.js](test/test-parallel-array.js).
+
+#### Input Object
+
+Also it supports named jobs, listed via object.
+
+```javascript
+var parallel = require('asynckit/parallel')
+ , assert = require('assert')
+ ;
+
+var source = { first: 1, one: 1, four: 4, sixteen: 16, sixtyFour: 64, thirtyTwo: 32, eight: 8, two: 2 }
+ , expectedResult = { first: 2, one: 2, four: 8, sixteen: 32, sixtyFour: 128, thirtyTwo: 64, eight: 16, two: 4 }
+ , expectedTarget = [ 1, 1, 2, 4, 8, 16, 32, 64 ]
+ , expectedKeys = [ 'first', 'one', 'two', 'four', 'eight', 'sixteen', 'thirtyTwo', 'sixtyFour' ]
+ , target = []
+ , keys = []
+ ;
+
+parallel(source, asyncJob, function(err, result)
+{
+ assert.deepEqual(result, expectedResult);
+ assert.deepEqual(target, expectedTarget);
+ assert.deepEqual(keys, expectedKeys);
+});
+
+// supports full value, key, callback (shortcut) interface
+function asyncJob(item, key, cb)
+{
+ // different delays (in ms) per item
+ var delay = item * 25;
+
+ // pretend different jobs take different time to finish
+ // and not in consequential order
+ var timeoutId = setTimeout(function() {
+ keys.push(key);
+ target.push(item);
+ cb(null, item * 2);
+ }, delay);
+
+ // allow to cancel "leftover" jobs upon error
+ // return function, invoking of which will abort this job
+ return clearTimeout.bind(null, timeoutId);
+}
+```
+
+More examples could be found in [test/test-parallel-object.js](test/test-parallel-object.js).
+
+### Serial Jobs
+
+Runs iterator over provided array sequentially. Stores output in the `result` array,
+on the matching positions. In unlikely event of an error from one of the jobs,
+will not proceed to the rest of the items in the list
+and return error along with salvaged data to the main callback function.
+
+#### Input Array
+
+```javascript
+var serial = require('asynckit/serial')
+ , assert = require('assert')
+ ;
+
+var source = [ 1, 1, 4, 16, 64, 32, 8, 2 ]
+ , expectedResult = [ 2, 2, 8, 32, 128, 64, 16, 4 ]
+ , expectedTarget = [ 0, 1, 2, 3, 4, 5, 6, 7 ]
+ , target = []
+ ;
+
+serial(source, asyncJob, function(err, result)
+{
+ assert.deepEqual(result, expectedResult);
+ assert.deepEqual(target, expectedTarget);
+});
+
+// extended interface (item, key, callback)
+// also supported for arrays
+function asyncJob(item, key, cb)
+{
+ target.push(key);
+
+ // it will be automatically made async
+ // even it iterator "returns" in the same event loop
+ cb(null, item * 2);
+}
+```
+
+More examples could be found in [test/test-serial-array.js](test/test-serial-array.js).
+
+#### Input Object
+
+Also it supports named jobs, listed via object.
+
+```javascript
+var serial = require('asynckit').serial
+ , assert = require('assert')
+ ;
+
+var source = [ 1, 1, 4, 16, 64, 32, 8, 2 ]
+ , expectedResult = [ 2, 2, 8, 32, 128, 64, 16, 4 ]
+ , expectedTarget = [ 0, 1, 2, 3, 4, 5, 6, 7 ]
+ , target = []
+ ;
+
+var source = { first: 1, one: 1, four: 4, sixteen: 16, sixtyFour: 64, thirtyTwo: 32, eight: 8, two: 2 }
+ , expectedResult = { first: 2, one: 2, four: 8, sixteen: 32, sixtyFour: 128, thirtyTwo: 64, eight: 16, two: 4 }
+ , expectedTarget = [ 1, 1, 4, 16, 64, 32, 8, 2 ]
+ , target = []
+ ;
+
+
+serial(source, asyncJob, function(err, result)
+{
+ assert.deepEqual(result, expectedResult);
+ assert.deepEqual(target, expectedTarget);
+});
+
+// shortcut interface (item, callback)
+// works for object as well as for the arrays
+function asyncJob(item, cb)
+{
+ target.push(item);
+
+ // it will be automatically made async
+ // even it iterator "returns" in the same event loop
+ cb(null, item * 2);
+}
+```
+
+More examples could be found in [test/test-serial-object.js](test/test-serial-object.js).
+
+_Note: Since _object_ is an _unordered_ collection of properties,
+it may produce unexpected results with sequential iterations.
+Whenever order of the jobs' execution is important please use `serialOrdered` method._
+
+### Ordered Serial Iterations
+
+TBD
+
+For example [compare-property](compare-property) package.
+
+### Streaming interface
+
+TBD
+
+## Want to Know More?
+
+More examples can be found in [test folder](test/).
+
+Or open an [issue](https://github.com/alexindigo/asynckit/issues) with questions and/or suggestions.
+
+## License
+
+AsyncKit is licensed under the MIT license.
diff --git a/node_modules/asynckit/bench.js b/node_modules/asynckit/bench.js
new file mode 100644
index 0000000..c612f1a
--- /dev/null
+++ b/node_modules/asynckit/bench.js
@@ -0,0 +1,76 @@
+/* eslint no-console: "off" */
+
+var asynckit = require('./')
+ , async = require('async')
+ , assert = require('assert')
+ , expected = 0
+ ;
+
+var Benchmark = require('benchmark');
+var suite = new Benchmark.Suite;
+
+var source = [];
+for (var z = 1; z < 100; z++)
+{
+ source.push(z);
+ expected += z;
+}
+
+suite
+// add tests
+
+.add('async.map', function(deferred)
+{
+ var total = 0;
+
+ async.map(source,
+ function(i, cb)
+ {
+ setImmediate(function()
+ {
+ total += i;
+ cb(null, total);
+ });
+ },
+ function(err, result)
+ {
+ assert.ifError(err);
+ assert.equal(result[result.length - 1], expected);
+ deferred.resolve();
+ });
+}, {'defer': true})
+
+
+.add('asynckit.parallel', function(deferred)
+{
+ var total = 0;
+
+ asynckit.parallel(source,
+ function(i, cb)
+ {
+ setImmediate(function()
+ {
+ total += i;
+ cb(null, total);
+ });
+ },
+ function(err, result)
+ {
+ assert.ifError(err);
+ assert.equal(result[result.length - 1], expected);
+ deferred.resolve();
+ });
+}, {'defer': true})
+
+
+// add listeners
+.on('cycle', function(ev)
+{
+ console.log(String(ev.target));
+})
+.on('complete', function()
+{
+ console.log('Fastest is ' + this.filter('fastest').map('name'));
+})
+// run async
+.run({ 'async': true });
diff --git a/node_modules/asynckit/index.js b/node_modules/asynckit/index.js
new file mode 100644
index 0000000..455f945
--- /dev/null
+++ b/node_modules/asynckit/index.js
@@ -0,0 +1,6 @@
+module.exports =
+{
+ parallel : require('./parallel.js'),
+ serial : require('./serial.js'),
+ serialOrdered : require('./serialOrdered.js')
+};
diff --git a/node_modules/asynckit/lib/abort.js b/node_modules/asynckit/lib/abort.js
new file mode 100644
index 0000000..114367e
--- /dev/null
+++ b/node_modules/asynckit/lib/abort.js
@@ -0,0 +1,29 @@
+// API
+module.exports = abort;
+
+/**
+ * Aborts leftover active jobs
+ *
+ * @param {object} state - current state object
+ */
+function abort(state)
+{
+ Object.keys(state.jobs).forEach(clean.bind(state));
+
+ // reset leftover jobs
+ state.jobs = {};
+}
+
+/**
+ * Cleans up leftover job by invoking abort function for the provided job id
+ *
+ * @this state
+ * @param {string|number} key - job id to abort
+ */
+function clean(key)
+{
+ if (typeof this.jobs[key] == 'function')
+ {
+ this.jobs[key]();
+ }
+}
diff --git a/node_modules/asynckit/lib/async.js b/node_modules/asynckit/lib/async.js
new file mode 100644
index 0000000..7f1288a
--- /dev/null
+++ b/node_modules/asynckit/lib/async.js
@@ -0,0 +1,34 @@
+var defer = require('./defer.js');
+
+// API
+module.exports = async;
+
+/**
+ * Runs provided callback asynchronously
+ * even if callback itself is not
+ *
+ * @param {function} callback - callback to invoke
+ * @returns {function} - augmented callback
+ */
+function async(callback)
+{
+ var isAsync = false;
+
+ // check if async happened
+ defer(function() { isAsync = true; });
+
+ return function async_callback(err, result)
+ {
+ if (isAsync)
+ {
+ callback(err, result);
+ }
+ else
+ {
+ defer(function nextTick_callback()
+ {
+ callback(err, result);
+ });
+ }
+ };
+}
diff --git a/node_modules/asynckit/lib/defer.js b/node_modules/asynckit/lib/defer.js
new file mode 100644
index 0000000..b67110c
--- /dev/null
+++ b/node_modules/asynckit/lib/defer.js
@@ -0,0 +1,26 @@
+module.exports = defer;
+
+/**
+ * Runs provided function on next iteration of the event loop
+ *
+ * @param {function} fn - function to run
+ */
+function defer(fn)
+{
+ var nextTick = typeof setImmediate == 'function'
+ ? setImmediate
+ : (
+ typeof process == 'object' && typeof process.nextTick == 'function'
+ ? process.nextTick
+ : null
+ );
+
+ if (nextTick)
+ {
+ nextTick(fn);
+ }
+ else
+ {
+ setTimeout(fn, 0);
+ }
+}
diff --git a/node_modules/asynckit/lib/iterate.js b/node_modules/asynckit/lib/iterate.js
new file mode 100644
index 0000000..5d2839a
--- /dev/null
+++ b/node_modules/asynckit/lib/iterate.js
@@ -0,0 +1,75 @@
+var async = require('./async.js')
+ , abort = require('./abort.js')
+ ;
+
+// API
+module.exports = iterate;
+
+/**
+ * Iterates over each job object
+ *
+ * @param {array|object} list - array or object (named list) to iterate over
+ * @param {function} iterator - iterator to run
+ * @param {object} state - current job status
+ * @param {function} callback - invoked when all elements processed
+ */
+function iterate(list, iterator, state, callback)
+{
+ // store current index
+ var key = state['keyedList'] ? state['keyedList'][state.index] : state.index;
+
+ state.jobs[key] = runJob(iterator, key, list[key], function(error, output)
+ {
+ // don't repeat yourself
+ // skip secondary callbacks
+ if (!(key in state.jobs))
+ {
+ return;
+ }
+
+ // clean up jobs
+ delete state.jobs[key];
+
+ if (error)
+ {
+ // don't process rest of the results
+ // stop still active jobs
+ // and reset the list
+ abort(state);
+ }
+ else
+ {
+ state.results[key] = output;
+ }
+
+ // return salvaged results
+ callback(error, state.results);
+ });
+}
+
+/**
+ * Runs iterator over provided job element
+ *
+ * @param {function} iterator - iterator to invoke
+ * @param {string|number} key - key/index of the element in the list of jobs
+ * @param {mixed} item - job description
+ * @param {function} callback - invoked after iterator is done with the job
+ * @returns {function|mixed} - job abort function or something else
+ */
+function runJob(iterator, key, item, callback)
+{
+ var aborter;
+
+ // allow shortcut if iterator expects only two arguments
+ if (iterator.length == 2)
+ {
+ aborter = iterator(item, async(callback));
+ }
+ // otherwise go with full three arguments
+ else
+ {
+ aborter = iterator(item, key, async(callback));
+ }
+
+ return aborter;
+}
diff --git a/node_modules/asynckit/lib/readable_asynckit.js b/node_modules/asynckit/lib/readable_asynckit.js
new file mode 100644
index 0000000..78ad240
--- /dev/null
+++ b/node_modules/asynckit/lib/readable_asynckit.js
@@ -0,0 +1,91 @@
+var streamify = require('./streamify.js')
+ , defer = require('./defer.js')
+ ;
+
+// API
+module.exports = ReadableAsyncKit;
+
+/**
+ * Base constructor for all streams
+ * used to hold properties/methods
+ */
+function ReadableAsyncKit()
+{
+ ReadableAsyncKit.super_.apply(this, arguments);
+
+ // list of active jobs
+ this.jobs = {};
+
+ // add stream methods
+ this.destroy = destroy;
+ this._start = _start;
+ this._read = _read;
+}
+
+/**
+ * Destroys readable stream,
+ * by aborting outstanding jobs
+ *
+ * @returns {void}
+ */
+function destroy()
+{
+ if (this.destroyed)
+ {
+ return;
+ }
+
+ this.destroyed = true;
+
+ if (typeof this.terminator == 'function')
+ {
+ this.terminator();
+ }
+}
+
+/**
+ * Starts provided jobs in async manner
+ *
+ * @private
+ */
+function _start()
+{
+ // first argument – runner function
+ var runner = arguments[0]
+ // take away first argument
+ , args = Array.prototype.slice.call(arguments, 1)
+ // second argument - input data
+ , input = args[0]
+ // last argument - result callback
+ , endCb = streamify.callback.call(this, args[args.length - 1])
+ ;
+
+ args[args.length - 1] = endCb;
+ // third argument - iterator
+ args[1] = streamify.iterator.call(this, args[1]);
+
+ // allow time for proper setup
+ defer(function()
+ {
+ if (!this.destroyed)
+ {
+ this.terminator = runner.apply(null, args);
+ }
+ else
+ {
+ endCb(null, Array.isArray(input) ? [] : {});
+ }
+ }.bind(this));
+}
+
+
+/**
+ * Implement _read to comply with Readable streams
+ * Doesn't really make sense for flowing object mode
+ *
+ * @private
+ */
+function _read()
+{
+
+}
diff --git a/node_modules/asynckit/lib/readable_parallel.js b/node_modules/asynckit/lib/readable_parallel.js
new file mode 100644
index 0000000..5d2929f
--- /dev/null
+++ b/node_modules/asynckit/lib/readable_parallel.js
@@ -0,0 +1,25 @@
+var parallel = require('../parallel.js');
+
+// API
+module.exports = ReadableParallel;
+
+/**
+ * Streaming wrapper to `asynckit.parallel`
+ *
+ * @param {array|object} list - array or object (named list) to iterate over
+ * @param {function} iterator - iterator to run
+ * @param {function} callback - invoked when all elements processed
+ * @returns {stream.Readable#}
+ */
+function ReadableParallel(list, iterator, callback)
+{
+ if (!(this instanceof ReadableParallel))
+ {
+ return new ReadableParallel(list, iterator, callback);
+ }
+
+ // turn on object mode
+ ReadableParallel.super_.call(this, {objectMode: true});
+
+ this._start(parallel, list, iterator, callback);
+}
diff --git a/node_modules/asynckit/lib/readable_serial.js b/node_modules/asynckit/lib/readable_serial.js
new file mode 100644
index 0000000..7822698
--- /dev/null
+++ b/node_modules/asynckit/lib/readable_serial.js
@@ -0,0 +1,25 @@
+var serial = require('../serial.js');
+
+// API
+module.exports = ReadableSerial;
+
+/**
+ * Streaming wrapper to `asynckit.serial`
+ *
+ * @param {array|object} list - array or object (named list) to iterate over
+ * @param {function} iterator - iterator to run
+ * @param {function} callback - invoked when all elements processed
+ * @returns {stream.Readable#}
+ */
+function ReadableSerial(list, iterator, callback)
+{
+ if (!(this instanceof ReadableSerial))
+ {
+ return new ReadableSerial(list, iterator, callback);
+ }
+
+ // turn on object mode
+ ReadableSerial.super_.call(this, {objectMode: true});
+
+ this._start(serial, list, iterator, callback);
+}
diff --git a/node_modules/asynckit/lib/readable_serial_ordered.js b/node_modules/asynckit/lib/readable_serial_ordered.js
new file mode 100644
index 0000000..3de89c4
--- /dev/null
+++ b/node_modules/asynckit/lib/readable_serial_ordered.js
@@ -0,0 +1,29 @@
+var serialOrdered = require('../serialOrdered.js');
+
+// API
+module.exports = ReadableSerialOrdered;
+// expose sort helpers
+module.exports.ascending = serialOrdered.ascending;
+module.exports.descending = serialOrdered.descending;
+
+/**
+ * Streaming wrapper to `asynckit.serialOrdered`
+ *
+ * @param {array|object} list - array or object (named list) to iterate over
+ * @param {function} iterator - iterator to run
+ * @param {function} sortMethod - custom sort function
+ * @param {function} callback - invoked when all elements processed
+ * @returns {stream.Readable#}
+ */
+function ReadableSerialOrdered(list, iterator, sortMethod, callback)
+{
+ if (!(this instanceof ReadableSerialOrdered))
+ {
+ return new ReadableSerialOrdered(list, iterator, sortMethod, callback);
+ }
+
+ // turn on object mode
+ ReadableSerialOrdered.super_.call(this, {objectMode: true});
+
+ this._start(serialOrdered, list, iterator, sortMethod, callback);
+}
diff --git a/node_modules/asynckit/lib/state.js b/node_modules/asynckit/lib/state.js
new file mode 100644
index 0000000..cbea7ad
--- /dev/null
+++ b/node_modules/asynckit/lib/state.js
@@ -0,0 +1,37 @@
+// API
+module.exports = state;
+
+/**
+ * Creates initial state object
+ * for iteration over list
+ *
+ * @param {array|object} list - list to iterate over
+ * @param {function|null} sortMethod - function to use for keys sort,
+ * or `null` to keep them as is
+ * @returns {object} - initial state object
+ */
+function state(list, sortMethod)
+{
+ var isNamedList = !Array.isArray(list)
+ , initState =
+ {
+ index : 0,
+ keyedList: isNamedList || sortMethod ? Object.keys(list) : null,
+ jobs : {},
+ results : isNamedList ? {} : [],
+ size : isNamedList ? Object.keys(list).length : list.length
+ }
+ ;
+
+ if (sortMethod)
+ {
+ // sort array keys based on it's values
+ // sort object's keys just on own merit
+ initState.keyedList.sort(isNamedList ? sortMethod : function(a, b)
+ {
+ return sortMethod(list[a], list[b]);
+ });
+ }
+
+ return initState;
+}
diff --git a/node_modules/asynckit/lib/streamify.js b/node_modules/asynckit/lib/streamify.js
new file mode 100644
index 0000000..f56a1c9
--- /dev/null
+++ b/node_modules/asynckit/lib/streamify.js
@@ -0,0 +1,141 @@
+var async = require('./async.js');
+
+// API
+module.exports = {
+ iterator: wrapIterator,
+ callback: wrapCallback
+};
+
+/**
+ * Wraps iterators with long signature
+ *
+ * @this ReadableAsyncKit#
+ * @param {function} iterator - function to wrap
+ * @returns {function} - wrapped function
+ */
+function wrapIterator(iterator)
+{
+ var stream = this;
+
+ return function(item, key, cb)
+ {
+ var aborter
+ , wrappedCb = async(wrapIteratorCallback.call(stream, cb, key))
+ ;
+
+ stream.jobs[key] = wrappedCb;
+
+ // it's either shortcut (item, cb)
+ if (iterator.length == 2)
+ {
+ aborter = iterator(item, wrappedCb);
+ }
+ // or long format (item, key, cb)
+ else
+ {
+ aborter = iterator(item, key, wrappedCb);
+ }
+
+ return aborter;
+ };
+}
+
+/**
+ * Wraps provided callback function
+ * allowing to execute snitch function before
+ * real callback
+ *
+ * @this ReadableAsyncKit#
+ * @param {function} callback - function to wrap
+ * @returns {function} - wrapped function
+ */
+function wrapCallback(callback)
+{
+ var stream = this;
+
+ var wrapped = function(error, result)
+ {
+ return finisher.call(stream, error, result, callback);
+ };
+
+ return wrapped;
+}
+
+/**
+ * Wraps provided iterator callback function
+ * makes sure snitch only called once,
+ * but passes secondary calls to the original callback
+ *
+ * @this ReadableAsyncKit#
+ * @param {function} callback - callback to wrap
+ * @param {number|string} key - iteration key
+ * @returns {function} wrapped callback
+ */
+function wrapIteratorCallback(callback, key)
+{
+ var stream = this;
+
+ return function(error, output)
+ {
+ // don't repeat yourself
+ if (!(key in stream.jobs))
+ {
+ callback(error, output);
+ return;
+ }
+
+ // clean up jobs
+ delete stream.jobs[key];
+
+ return streamer.call(stream, error, {key: key, value: output}, callback);
+ };
+}
+
+/**
+ * Stream wrapper for iterator callback
+ *
+ * @this ReadableAsyncKit#
+ * @param {mixed} error - error response
+ * @param {mixed} output - iterator output
+ * @param {function} callback - callback that expects iterator results
+ */
+function streamer(error, output, callback)
+{
+ if (error && !this.error)
+ {
+ this.error = error;
+ this.pause();
+ this.emit('error', error);
+ // send back value only, as expected
+ callback(error, output && output.value);
+ return;
+ }
+
+ // stream stuff
+ this.push(output);
+
+ // back to original track
+ // send back value only, as expected
+ callback(error, output && output.value);
+}
+
+/**
+ * Stream wrapper for finishing callback
+ *
+ * @this ReadableAsyncKit#
+ * @param {mixed} error - error response
+ * @param {mixed} output - iterator output
+ * @param {function} callback - callback that expects final results
+ */
+function finisher(error, output, callback)
+{
+ // signal end of the stream
+ // only for successfully finished streams
+ if (!error)
+ {
+ this.push(null);
+ }
+
+ // back to original track
+ callback(error, output);
+}
diff --git a/node_modules/asynckit/lib/terminator.js b/node_modules/asynckit/lib/terminator.js
new file mode 100644
index 0000000..d6eb992
--- /dev/null
+++ b/node_modules/asynckit/lib/terminator.js
@@ -0,0 +1,29 @@
+var abort = require('./abort.js')
+ , async = require('./async.js')
+ ;
+
+// API
+module.exports = terminator;
+
+/**
+ * Terminates jobs in the attached state context
+ *
+ * @this AsyncKitState#
+ * @param {function} callback - final callback to invoke after termination
+ */
+function terminator(callback)
+{
+ if (!Object.keys(this.jobs).length)
+ {
+ return;
+ }
+
+ // fast forward iteration index
+ this.index = this.size;
+
+ // abort jobs
+ abort(this);
+
+ // send back results we have so far
+ async(callback)(null, this.results);
+}
diff --git a/node_modules/asynckit/package.json b/node_modules/asynckit/package.json
new file mode 100644
index 0000000..51147d6
--- /dev/null
+++ b/node_modules/asynckit/package.json
@@ -0,0 +1,63 @@
+{
+ "name": "asynckit",
+ "version": "0.4.0",
+ "description": "Minimal async jobs utility library, with streams support",
+ "main": "index.js",
+ "scripts": {
+ "clean": "rimraf coverage",
+ "lint": "eslint *.js lib/*.js test/*.js",
+ "test": "istanbul cover --reporter=json tape -- 'test/test-*.js' | tap-spec",
+ "win-test": "tape test/test-*.js",
+ "browser": "browserify -t browserify-istanbul test/lib/browserify_adjustment.js test/test-*.js | obake --coverage | tap-spec",
+ "report": "istanbul report",
+ "size": "browserify index.js | size-table asynckit",
+ "debug": "tape test/test-*.js"
+ },
+ "pre-commit": [
+ "clean",
+ "lint",
+ "test",
+ "browser",
+ "report",
+ "size"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/alexindigo/asynckit.git"
+ },
+ "keywords": [
+ "async",
+ "jobs",
+ "parallel",
+ "serial",
+ "iterator",
+ "array",
+ "object",
+ "stream",
+ "destroy",
+ "terminate",
+ "abort"
+ ],
+ "author": "Alex Indigo <iam@alexindigo.com>",
+ "license": "MIT",
+ "bugs": {
+ "url": "https://github.com/alexindigo/asynckit/issues"
+ },
+ "homepage": "https://github.com/alexindigo/asynckit#readme",
+ "devDependencies": {
+ "browserify": "^13.0.0",
+ "browserify-istanbul": "^2.0.0",
+ "coveralls": "^2.11.9",
+ "eslint": "^2.9.0",
+ "istanbul": "^0.4.3",
+ "obake": "^0.1.2",
+ "phantomjs-prebuilt": "^2.1.7",
+ "pre-commit": "^1.1.3",
+ "reamde": "^1.1.0",
+ "rimraf": "^2.5.2",
+ "size-table": "^0.2.0",
+ "tap-spec": "^4.1.1",
+ "tape": "^4.5.1"
+ },
+ "dependencies": {}
+}
diff --git a/node_modules/asynckit/parallel.js b/node_modules/asynckit/parallel.js
new file mode 100644
index 0000000..3c50344
--- /dev/null
+++ b/node_modules/asynckit/parallel.js
@@ -0,0 +1,43 @@
+var iterate = require('./lib/iterate.js')
+ , initState = require('./lib/state.js')
+ , terminator = require('./lib/terminator.js')
+ ;
+
+// Public API
+module.exports = parallel;
+
+/**
+ * Runs iterator over provided array elements in parallel
+ *
+ * @param {array|object} list - array or object (named list) to iterate over
+ * @param {function} iterator - iterator to run
+ * @param {function} callback - invoked when all elements processed
+ * @returns {function} - jobs terminator
+ */
+function parallel(list, iterator, callback)
+{
+ var state = initState(list);
+
+ while (state.index < (state['keyedList'] || list).length)
+ {
+ iterate(list, iterator, state, function(error, result)
+ {
+ if (error)
+ {
+ callback(error, result);
+ return;
+ }
+
+ // looks like it's the last one
+ if (Object.keys(state.jobs).length === 0)
+ {
+ callback(null, state.results);
+ return;
+ }
+ });
+
+ state.index++;
+ }
+
+ return terminator.bind(state, callback);
+}
diff --git a/node_modules/asynckit/serial.js b/node_modules/asynckit/serial.js
new file mode 100644
index 0000000..6cd949a
--- /dev/null
+++ b/node_modules/asynckit/serial.js
@@ -0,0 +1,17 @@
+var serialOrdered = require('./serialOrdered.js');
+
+// Public API
+module.exports = serial;
+
+/**
+ * Runs iterator over provided array elements in series
+ *
+ * @param {array|object} list - array or object (named list) to iterate over
+ * @param {function} iterator - iterator to run
+ * @param {function} callback - invoked when all elements processed
+ * @returns {function} - jobs terminator
+ */
+function serial(list, iterator, callback)
+{
+ return serialOrdered(list, iterator, null, callback);
+}
diff --git a/node_modules/asynckit/serialOrdered.js b/node_modules/asynckit/serialOrdered.js
new file mode 100644
index 0000000..607eafe
--- /dev/null
+++ b/node_modules/asynckit/serialOrdered.js
@@ -0,0 +1,75 @@
+var iterate = require('./lib/iterate.js')
+ , initState = require('./lib/state.js')
+ , terminator = require('./lib/terminator.js')
+ ;
+
+// Public API
+module.exports = serialOrdered;
+// sorting helpers
+module.exports.ascending = ascending;
+module.exports.descending = descending;
+
+/**
+ * Runs iterator over provided sorted array elements in series
+ *
+ * @param {array|object} list - array or object (named list) to iterate over
+ * @param {function} iterator - iterator to run
+ * @param {function} sortMethod - custom sort function
+ * @param {function} callback - invoked when all elements processed
+ * @returns {function} - jobs terminator
+ */
+function serialOrdered(list, iterator, sortMethod, callback)
+{
+ var state = initState(list, sortMethod);
+
+ iterate(list, iterator, state, function iteratorHandler(error, result)
+ {
+ if (error)
+ {
+ callback(error, result);
+ return;
+ }
+
+ state.index++;
+
+ // are we there yet?
+ if (state.index < (state['keyedList'] || list).length)
+ {
+ iterate(list, iterator, state, iteratorHandler);
+ return;
+ }
+
+ // done here
+ callback(null, state.results);
+ });
+
+ return terminator.bind(state, callback);
+}
+
+/*
+ * -- Sort methods
+ */
+
+/**
+ * sort helper to sort array elements in ascending order
+ *
+ * @param {mixed} a - an item to compare
+ * @param {mixed} b - an item to compare
+ * @returns {number} - comparison result
+ */
+function ascending(a, b)
+{
+ return a < b ? -1 : a > b ? 1 : 0;
+}
+
+/**
+ * sort helper to sort array elements in descending order
+ *
+ * @param {mixed} a - an item to compare
+ * @param {mixed} b - an item to compare
+ * @returns {number} - comparison result
+ */
+function descending(a, b)
+{
+ return -1 * ascending(a, b);
+}
diff --git a/node_modules/asynckit/stream.js b/node_modules/asynckit/stream.js
new file mode 100644
index 0000000..d43465f
--- /dev/null
+++ b/node_modules/asynckit/stream.js
@@ -0,0 +1,21 @@
+var inherits = require('util').inherits
+ , Readable = require('stream').Readable
+ , ReadableAsyncKit = require('./lib/readable_asynckit.js')
+ , ReadableParallel = require('./lib/readable_parallel.js')
+ , ReadableSerial = require('./lib/readable_serial.js')
+ , ReadableSerialOrdered = require('./lib/readable_serial_ordered.js')
+ ;
+
+// API
+module.exports =
+{
+ parallel : ReadableParallel,
+ serial : ReadableSerial,
+ serialOrdered : ReadableSerialOrdered,
+};
+
+inherits(ReadableAsyncKit, Readable);
+
+inherits(ReadableParallel, ReadableAsyncKit);
+inherits(ReadableSerial, ReadableAsyncKit);
+inherits(ReadableSerialOrdered, ReadableAsyncKit);
diff --git a/node_modules/axios/CHANGELOG.md b/node_modules/axios/CHANGELOG.md
new file mode 100644
index 0000000..6fd5c9b
--- /dev/null
+++ b/node_modules/axios/CHANGELOG.md
@@ -0,0 +1,855 @@
+# Changelog
+
+## [1.6.7](https://github.com/axios/axios/compare/v1.6.6...v1.6.7) (2024-01-25)
+
+
+### Bug Fixes
+
+* capture async stack only for rejections with native error objects; ([#6203](https://github.com/axios/axios/issues/6203)) ([1a08f90](https://github.com/axios/axios/commit/1a08f90f402336e4d00e9ee82f211c6adb1640b0))
+
+### Contributors to this release
+
+- <img src="https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+30/-26 (#6203 )")
+- <img src="https://avatars.githubusercontent.com/u/73059627?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [zhoulixiang](https://github.com/zh-lx "+0/-3 (#6186 )")
+
+## [1.6.6](https://github.com/axios/axios/compare/v1.6.5...v1.6.6) (2024-01-24)
+
+
+### Bug Fixes
+
+* fixed missed dispatchBeforeRedirect argument ([#5778](https://github.com/axios/axios/issues/5778)) ([a1938ff](https://github.com/axios/axios/commit/a1938ff073fcb0f89011f001dfbc1fa1dc995e39))
+* wrap errors to improve async stack trace ([#5987](https://github.com/axios/axios/issues/5987)) ([123f354](https://github.com/axios/axios/commit/123f354b920f154a209ea99f76b7b2ef3d9ebbab))
+
+### Contributors to this release
+
+- <img src="https://avatars.githubusercontent.com/u/1186084?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Ilya Priven](https://github.com/ikonst "+91/-8 (#5987 )")
+- <img src="https://avatars.githubusercontent.com/u/1884246?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Zao Soula](https://github.com/zaosoula "+6/-6 (#5778 )")
+
+## [1.6.5](https://github.com/axios/axios/compare/v1.6.4...v1.6.5) (2024-01-05)
+
+
+### Bug Fixes
+
+* **ci:** refactor notify action as a job of publish action; ([#6176](https://github.com/axios/axios/issues/6176)) ([0736f95](https://github.com/axios/axios/commit/0736f95ce8776366dc9ca569f49ba505feb6373c))
+* **dns:** fixed lookup error handling; ([#6175](https://github.com/axios/axios/issues/6175)) ([f4f2b03](https://github.com/axios/axios/commit/f4f2b039dd38eb4829e8583caede4ed6d2dd59be))
+
+### Contributors to this release
+
+- <img src="https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+41/-6 (#6176 #6175 )")
+- <img src="https://avatars.githubusercontent.com/u/4814473?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Jay](https://github.com/jasonsaayman "+6/-1 ()")
+
+## [1.6.4](https://github.com/axios/axios/compare/v1.6.3...v1.6.4) (2024-01-03)
+
+
+### Bug Fixes
+
+* **security:** fixed formToJSON prototype pollution vulnerability; ([#6167](https://github.com/axios/axios/issues/6167)) ([3c0c11c](https://github.com/axios/axios/commit/3c0c11cade045c4412c242b5727308cff9897a0e))
+* **security:** fixed security vulnerability in follow-redirects ([#6163](https://github.com/axios/axios/issues/6163)) ([75af1cd](https://github.com/axios/axios/commit/75af1cdff5b3a6ca3766d3d3afbc3115bb0811b8))
+
+### Contributors to this release
+
+- <img src="https://avatars.githubusercontent.com/u/4814473?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Jay](https://github.com/jasonsaayman "+34/-6 ()")
+- <img src="https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+34/-3 (#6172 #6167 )")
+- <img src="https://avatars.githubusercontent.com/u/1402060?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Guy Nesher](https://github.com/gnesher "+10/-10 (#6163 )")
+
+## [1.6.3](https://github.com/axios/axios/compare/v1.6.2...v1.6.3) (2023-12-26)
+
+
+### Bug Fixes
+
+* Regular Expression Denial of Service (ReDoS) ([#6132](https://github.com/axios/axios/issues/6132)) ([5e7ad38](https://github.com/axios/axios/commit/5e7ad38fb0f819fceb19fb2ee5d5d38f56aa837d))
+
+### Contributors to this release
+
+- <img src="https://avatars.githubusercontent.com/u/4814473?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Jay](https://github.com/jasonsaayman "+15/-6 (#6145 )")
+- <img src="https://avatars.githubusercontent.com/u/22686401?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Willian Agostini](https://github.com/WillianAgostini "+17/-2 (#6132 )")
+- <img src="https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+3/-0 (#6084 )")
+
+## [1.6.2](https://github.com/axios/axios/compare/v1.6.1...v1.6.2) (2023-11-14)
+
+
+### Features
+
+* **withXSRFToken:** added withXSRFToken option as a workaround to achieve the old `withCredentials` behavior; ([#6046](https://github.com/axios/axios/issues/6046)) ([cff9967](https://github.com/axios/axios/commit/cff996779b272a5e94c2b52f5503ccf668bc42dc))
+
+### PRs
+- feat(withXSRFToken): added withXSRFToken option as a workaround to achieve the old &#x60;withCredentials&#x60; behavior; ( [#6046](https://api.github.com/repos/axios/axios/pulls/6046) )
+```
+
+📢 This PR added &#x27;withXSRFToken&#x27; option as a replacement for old withCredentials behaviour.
+You should now use withXSRFToken along with withCredential to get the old behavior.
+This functionality is considered as a fix.
+```
+
+### Contributors to this release
+
+- <img src="https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+271/-146 (#6081 #6080 #6079 #6078 #6046 #6064 #6063 )")
+- <img src="https://avatars.githubusercontent.com/u/79681367?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Ng Choon Khon (CK)](https://github.com/ckng0221 "+4/-4 (#6073 )")
+- <img src="https://avatars.githubusercontent.com/u/9162827?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Muhammad Noman](https://github.com/mnomanmemon "+2/-2 (#6048 )")
+
+## [1.6.1](https://github.com/axios/axios/compare/v1.6.0...v1.6.1) (2023-11-08)
+
+
+### Bug Fixes
+
+* **formdata:** fixed content-type header normalization for non-standard browser environments; ([#6056](https://github.com/axios/axios/issues/6056)) ([dd465ab](https://github.com/axios/axios/commit/dd465ab22bbfa262c6567be6574bf46a057d5288))
+* **platform:** fixed emulated browser detection in node.js environment; ([#6055](https://github.com/axios/axios/issues/6055)) ([3dc8369](https://github.com/axios/axios/commit/3dc8369e505e32a4e12c22f154c55fd63ac67fbb))
+
+### Contributors to this release
+
+- <img src="https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+432/-65 (#6059 #6056 #6055 )")
+- <img src="https://avatars.githubusercontent.com/u/3982806?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Fabian Meyer](https://github.com/meyfa "+5/-2 (#5835 )")
+
+### PRs
+- feat(withXSRFToken): added withXSRFToken option as a workaround to achieve the old &#x60;withCredentials&#x60; behavior; ( [#6046](https://api.github.com/repos/axios/axios/pulls/6046) )
+```
+
+📢 This PR added &#x27;withXSRFToken&#x27; option as a replacement for old withCredentials behaviour.
+You should now use withXSRFToken along with withCredential to get the old behavior.
+This functionality is considered as a fix.
+```
+
+# [1.6.0](https://github.com/axios/axios/compare/v1.5.1...v1.6.0) (2023-10-26)
+
+
+### Bug Fixes
+
+* **CSRF:** fixed CSRF vulnerability CVE-2023-45857 ([#6028](https://github.com/axios/axios/issues/6028)) ([96ee232](https://github.com/axios/axios/commit/96ee232bd3ee4de2e657333d4d2191cd389e14d0))
+* **dns:** fixed lookup function decorator to work properly in node v20; ([#6011](https://github.com/axios/axios/issues/6011)) ([5aaff53](https://github.com/axios/axios/commit/5aaff532a6b820bb9ab6a8cd0f77131b47e2adb8))
+* **types:** fix AxiosHeaders types; ([#5931](https://github.com/axios/axios/issues/5931)) ([a1c8ad0](https://github.com/axios/axios/commit/a1c8ad008b3c13d53e135bbd0862587fb9d3fc09))
+
+### PRs
+- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
+```
+
+⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
+```
+
+### Contributors to this release
+
+- <img src="https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+449/-114 (#6032 #6021 #6011 #5932 #5931 )")
+- <img src="https://avatars.githubusercontent.com/u/63700910?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Valentin Panov](https://github.com/valentin-panov "+4/-4 (#6028 )")
+- <img src="https://avatars.githubusercontent.com/u/76877078?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Rinku Chaudhari](https://github.com/therealrinku "+1/-1 (#5889 )")
+
+## [1.5.1](https://github.com/axios/axios/compare/v1.5.0...v1.5.1) (2023-09-26)
+
+
+### Bug Fixes
+
+* **adapters:** improved adapters loading logic to have clear error messages; ([#5919](https://github.com/axios/axios/issues/5919)) ([e410779](https://github.com/axios/axios/commit/e4107797a7a1376f6209fbecfbbce73d3faa7859))
+* **formdata:** fixed automatic addition of the `Content-Type` header for FormData in non-browser environments; ([#5917](https://github.com/axios/axios/issues/5917)) ([bc9af51](https://github.com/axios/axios/commit/bc9af51b1886d1b3529617702f2a21a6c0ed5d92))
+* **headers:** allow `content-encoding` header to handle case-insensitive values ([#5890](https://github.com/axios/axios/issues/5890)) ([#5892](https://github.com/axios/axios/issues/5892)) ([4c89f25](https://github.com/axios/axios/commit/4c89f25196525e90a6e75eda9cb31ae0a2e18acd))
+* **types:** removed duplicated code ([9e62056](https://github.com/axios/axios/commit/9e6205630e1c9cf863adf141c0edb9e6d8d4b149))
+
+### Contributors to this release
+
+- <img src="https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+89/-18 (#5919 #5917 )")
+- <img src="https://avatars.githubusercontent.com/u/110460234?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [David Dallas](https://github.com/DavidJDallas "+11/-5 ()")
+- <img src="https://avatars.githubusercontent.com/u/71556073?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Sean Sattler](https://github.com/fb-sean "+2/-8 ()")
+- <img src="https://avatars.githubusercontent.com/u/4294069?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Mustafa Ateş Uzun](https://github.com/0o001 "+4/-4 ()")
+- <img src="https://avatars.githubusercontent.com/u/132928043?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Przemyslaw Motacki](https://github.com/sfc-gh-pmotacki "+2/-1 (#5892 )")
+- <img src="https://avatars.githubusercontent.com/u/5492927?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Michael Di Prisco](https://github.com/Cadienvan "+1/-1 ()")
+
+### PRs
+- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
+```
+
+⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
+```
+
+# [1.5.0](https://github.com/axios/axios/compare/v1.4.0...v1.5.0) (2023-08-26)
+
+
+### Bug Fixes
+
+* **adapter:** make adapter loading error more clear by using platform-specific adapters explicitly ([#5837](https://github.com/axios/axios/issues/5837)) ([9a414bb](https://github.com/axios/axios/commit/9a414bb6c81796a95c6c7fe668637825458e8b6d))
+* **dns:** fixed `cacheable-lookup` integration; ([#5836](https://github.com/axios/axios/issues/5836)) ([b3e327d](https://github.com/axios/axios/commit/b3e327dcc9277bdce34c7ef57beedf644b00d628))
+* **headers:** added support for setting header names that overlap with class methods; ([#5831](https://github.com/axios/axios/issues/5831)) ([d8b4ca0](https://github.com/axios/axios/commit/d8b4ca0ea5f2f05efa4edfe1e7684593f9f68273))
+* **headers:** fixed common Content-Type header merging; ([#5832](https://github.com/axios/axios/issues/5832)) ([8fda276](https://github.com/axios/axios/commit/8fda2766b1e6bcb72c3fabc146223083ef13ce17))
+
+
+### Features
+
+* export getAdapter function ([#5324](https://github.com/axios/axios/issues/5324)) ([ca73eb8](https://github.com/axios/axios/commit/ca73eb878df0ae2dace81fe3a7f1fb5986231bf1))
+* **export:** export adapters without `unsafe` prefix ([#5839](https://github.com/axios/axios/issues/5839)) ([1601f4a](https://github.com/axios/axios/commit/1601f4a27a81ab47fea228f1e244b2c4e3ce28bf))
+
+### Contributors to this release
+
+- <img src="https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+66/-29 (#5839 #5837 #5836 #5832 #5831 )")
+- <img src="https://avatars.githubusercontent.com/u/102841186?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [夜葬](https://github.com/geekact "+42/-0 (#5324 )")
+- <img src="https://avatars.githubusercontent.com/u/65978976?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Jonathan Budiman](https://github.com/JBudiman00 "+30/-0 (#5788 )")
+- <img src="https://avatars.githubusercontent.com/u/5492927?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Michael Di Prisco](https://github.com/Cadienvan "+3/-5 (#5791 )")
+
+### PRs
+- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
+```
+
+⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
+```
+
+# [1.4.0](https://github.com/axios/axios/compare/v1.3.6...v1.4.0) (2023-04-27)
+
+
+### Bug Fixes
+
+* **formdata:** add `multipart/form-data` content type for FormData payload on custom client environments; ([#5678](https://github.com/axios/axios/issues/5678)) ([bbb61e7](https://github.com/axios/axios/commit/bbb61e70cb1185adfb1cbbb86eaf6652c48d89d1))
+* **package:** export package internals with unsafe path prefix; ([#5677](https://github.com/axios/axios/issues/5677)) ([df38c94](https://github.com/axios/axios/commit/df38c949f26414d88ba29ec1e353c4d4f97eaf09))
+
+
+### Features
+
+* **dns:** added support for a custom lookup function; ([#5339](https://github.com/axios/axios/issues/5339)) ([2701911](https://github.com/axios/axios/commit/2701911260a1faa5cc5e1afe437121b330a3b7bb))
+* **types:** export `AxiosHeaderValue` type. ([#5525](https://github.com/axios/axios/issues/5525)) ([726f1c8](https://github.com/axios/axios/commit/726f1c8e00cffa0461a8813a9bdcb8f8b9d762cf))
+
+
+### Performance Improvements
+
+* **merge-config:** optimize mergeConfig performance by avoiding duplicate key visits; ([#5679](https://github.com/axios/axios/issues/5679)) ([e6f7053](https://github.com/axios/axios/commit/e6f7053bf1a3e87cf1f9da8677e12e3fe829d68e))
+
+### Contributors to this release
+
+- <img src="https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+151/-16 (#5684 #5339 #5679 #5678 #5677 )")
+- <img src="https://avatars.githubusercontent.com/u/47537704?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Arthur Fiorette](https://github.com/arthurfiorette "+19/-19 (#5525 )")
+- <img src="https://avatars.githubusercontent.com/u/43876655?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [PIYUSH NEGI](https://github.com/npiyush97 "+2/-18 (#5670 )")
+
+### PRs
+- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
+```
+
+⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
+```
+
+## [1.3.6](https://github.com/axios/axios/compare/v1.3.5...v1.3.6) (2023-04-19)
+
+
+### Bug Fixes
+
+* **types:** added transport to RawAxiosRequestConfig ([#5445](https://github.com/axios/axios/issues/5445)) ([6f360a2](https://github.com/axios/axios/commit/6f360a2531d8d70363fd9becef6a45a323f170e2))
+* **utils:** make isFormData detection logic stricter to avoid unnecessary calling of the `toString` method on the target; ([#5661](https://github.com/axios/axios/issues/5661)) ([aa372f7](https://github.com/axios/axios/commit/aa372f7306295dfd1100c1c2c77ce95c95808e76))
+
+### Contributors to this release
+
+- <img src="https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+48/-10 (#5665 #5661 #5663 )")
+- <img src="https://avatars.githubusercontent.com/u/5492927?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Michael Di Prisco](https://github.com/Cadienvan "+2/-0 (#5445 )")
+
+### PRs
+- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
+```
+
+⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
+```
+
+## [1.3.5](https://github.com/axios/axios/compare/v1.3.4...v1.3.5) (2023-04-05)
+
+
+### Bug Fixes
+
+* **headers:** fixed isValidHeaderName to support full list of allowed characters; ([#5584](https://github.com/axios/axios/issues/5584)) ([e7decef](https://github.com/axios/axios/commit/e7decef6a99f4627e27ed9ea5b00ce8e201c3841))
+* **params:** re-added the ability to set the function as `paramsSerializer` config; ([#5633](https://github.com/axios/axios/issues/5633)) ([a56c866](https://github.com/axios/axios/commit/a56c8661209d5ce5a645a05f294a0e08a6c1f6b3))
+
+### Contributors to this release
+
+- <img src="https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+28/-10 (#5633 #5584 )")
+
+### PRs
+- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
+```
+
+⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
+```
+
+## [1.3.4](https://github.com/axios/axios/compare/v1.3.3...v1.3.4) (2023-02-22)
+
+
+### Bug Fixes
+
+* **blob:** added a check to make sure the Blob class is available in the browser's global scope; ([#5548](https://github.com/axios/axios/issues/5548)) ([3772c8f](https://github.com/axios/axios/commit/3772c8fe74112a56e3e9551f894d899bc3a9443a))
+* **http:** fixed regression bug when handling synchronous errors inside the adapter; ([#5564](https://github.com/axios/axios/issues/5564)) ([a3b246c](https://github.com/axios/axios/commit/a3b246c9de5c3bc4b5a742e15add55b375479451))
+
+### Contributors to this release
+
+- <img src="https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+38/-26 (#5564 )")
+- <img src="https://avatars.githubusercontent.com/u/19550000?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [lcysgsg](https://github.com/lcysgsg "+4/-0 (#5548 )")
+- <img src="https://avatars.githubusercontent.com/u/5492927?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Michael Di Prisco](https://github.com/Cadienvan "+3/-0 (#5444 )")
+
+### PRs
+- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
+```
+
+⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
+```
+
+## [1.3.3](https://github.com/axios/axios/compare/v1.3.2...v1.3.3) (2023-02-13)
+
+
+### Bug Fixes
+
+* **formdata:** added a check to make sure the FormData class is available in the browser's global scope; ([#5545](https://github.com/axios/axios/issues/5545)) ([a6dfa72](https://github.com/axios/axios/commit/a6dfa72010db5ad52db8bd13c0f98e537e8fd05d))
+* **formdata:** fixed setting NaN as Content-Length for form payload in some cases; ([#5535](https://github.com/axios/axios/issues/5535)) ([c19f7bf](https://github.com/axios/axios/commit/c19f7bf770f90ae8307f4ea3104f227056912da1))
+* **headers:** fixed the filtering logic of the clear method; ([#5542](https://github.com/axios/axios/issues/5542)) ([ea87ebf](https://github.com/axios/axios/commit/ea87ebfe6d1699af072b9e7cd40faf8f14b0ab93))
+
+### Contributors to this release
+
+- <img src="https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+11/-7 (#5545 #5535 #5542 )")
+- <img src="https://avatars.githubusercontent.com/u/19842213?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [陈若枫](https://github.com/ruofee "+2/-2 (#5467 )")
+
+### PRs
+- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
+```
+
+⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
+```
+
+## [1.3.2](https://github.com/axios/axios/compare/v1.3.1...v1.3.2) (2023-02-03)
+
+
+### Bug Fixes
+
+* **http:** treat http://localhost as base URL for relative paths to avoid `ERR_INVALID_URL` error; ([#5528](https://github.com/axios/axios/issues/5528)) ([128d56f](https://github.com/axios/axios/commit/128d56f4a0fb8f5f2ed6e0dd80bc9225fee9538c))
+* **http:** use explicit import instead of TextEncoder global; ([#5530](https://github.com/axios/axios/issues/5530)) ([6b3c305](https://github.com/axios/axios/commit/6b3c305fc40c56428e0afabedc6f4d29c2830f6f))
+
+### Contributors to this release
+
+- <img src="https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+2/-1 (#5530 #5528 )")
+
+### PRs
+- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
+```
+
+⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
+```
+
+## [1.3.1](https://github.com/axios/axios/compare/v1.3.0...v1.3.1) (2023-02-01)
+
+
+### Bug Fixes
+
+* **formdata:** add hotfix to use the asynchronous API to compute the content-length header value; ([#5521](https://github.com/axios/axios/issues/5521)) ([96d336f](https://github.com/axios/axios/commit/96d336f527619f21da012fe1f117eeb53e5a2120))
+* **serializer:** fixed serialization of array-like objects; ([#5518](https://github.com/axios/axios/issues/5518)) ([08104c0](https://github.com/axios/axios/commit/08104c028c0f9353897b1b6691d74c440fd0c32d))
+
+### Contributors to this release
+
+- <img src="https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+27/-8 (#5521 #5518 )")
+
+### PRs
+- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
+```
+
+⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
+```
+
+# [1.3.0](https://github.com/axios/axios/compare/v1.2.6...v1.3.0) (2023-01-31)
+
+
+### Bug Fixes
+
+* **headers:** fixed & optimized clear method; ([#5507](https://github.com/axios/axios/issues/5507)) ([9915635](https://github.com/axios/axios/commit/9915635c69d0ab70daca5738488421f67ca60959))
+* **http:** add zlib headers if missing ([#5497](https://github.com/axios/axios/issues/5497)) ([65e8d1e](https://github.com/axios/axios/commit/65e8d1e28ce829f47a837e45129730e541950d3c))
+
+
+### Features
+
+* **fomdata:** added support for spec-compliant FormData & Blob types; ([#5316](https://github.com/axios/axios/issues/5316)) ([6ac574e](https://github.com/axios/axios/commit/6ac574e00a06731288347acea1e8246091196953))
+
+### Contributors to this release
+
+- <img src="https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+352/-67 (#5514 #5512 #5510 #5509 #5508 #5316 #5507 )")
+- <img src="https://avatars.githubusercontent.com/u/35015993?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [ItsNotGoodName](https://github.com/ItsNotGoodName "+43/-2 (#5497 )")
+
+### PRs
+- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
+```
+
+⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
+```
+
+## [1.2.6](https://github.com/axios/axios/compare/v1.2.5...v1.2.6) (2023-01-28)
+
+
+### Bug Fixes
+
+* **headers:** added missed Authorization accessor; ([#5502](https://github.com/axios/axios/issues/5502)) ([342c0ba](https://github.com/axios/axios/commit/342c0ba9a16ea50f5ed7d2366c5c1a2c877e3f26))
+* **types:** fixed `CommonRequestHeadersList` & `CommonResponseHeadersList` types to be private in commonJS; ([#5503](https://github.com/axios/axios/issues/5503)) ([5a3d0a3](https://github.com/axios/axios/commit/5a3d0a3234d77361a1bc7cedee2da1e11df08e2c))
+
+### Contributors to this release
+
+- ![avatar](https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;16) [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+24/-9 (#5503 #5502 )")
+
+### PRs
+- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
+```
+
+⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
+```
+
+## [1.2.5](https://github.com/axios/axios/compare/v1.2.4...v1.2.5) (2023-01-26)
+
+
+### Bug Fixes
+
+* **types:** fixed AxiosHeaders to handle spread syntax by making all methods non-enumerable; ([#5499](https://github.com/axios/axios/issues/5499)) ([580f1e8](https://github.com/axios/axios/commit/580f1e8033a61baa38149d59fd16019de3932c22))
+
+### Contributors to this release
+
+- ![avatar](https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;16) [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+82/-54 (#5499 )")
+- ![avatar](https://avatars.githubusercontent.com/u/20516159?v&#x3D;4&amp;s&#x3D;16) [Elliot Ford](https://github.com/EFord36 "+1/-1 (#5462 )")
+
+### PRs
+- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
+```
+
+⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
+```
+
+## [1.2.4](https://github.com/axios/axios/compare/v1.2.3...v1.2.4) (2023-01-22)
+
+
+### Bug Fixes
+
+* **types:** renamed `RawAxiosRequestConfig` back to `AxiosRequestConfig`; ([#5486](https://github.com/axios/axios/issues/5486)) ([2a71f49](https://github.com/axios/axios/commit/2a71f49bc6c68495fa419003a3107ed8bd703ad0))
+* **types:** fix `AxiosRequestConfig` generic; ([#5478](https://github.com/axios/axios/issues/5478)) ([9bce81b](https://github.com/axios/axios/commit/186ea062da8b7d578ae78b1a5c220986b9bce81b))
+
+### Contributors to this release
+
+- ![avatar](https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;16) [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+242/-108 (#5486 #5482 )")
+- ![avatar](https://avatars.githubusercontent.com/u/9430821?v&#x3D;4&amp;s&#x3D;16) [Daniel Hillmann](https://github.com/hilleer "+1/-1 (#5478 )")
+
+### PRs
+- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
+```
+
+⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
+```
+
+## [1.2.3](https://github.com/axios/axios/compare/1.2.2...1.2.3) (2023-01-10)
+
+
+### Bug Fixes
+
+* **types:** fixed AxiosRequestConfig header interface by refactoring it to RawAxiosRequestConfig; ([#5420](https://github.com/axios/axios/issues/5420)) ([0811963](https://github.com/axios/axios/commit/08119634a22f1d5b19f5c9ea0adccb6d3eebc3bc))
+
+### Contributors to this release
+
+- ![avatar](https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;16) [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+938/-442 (#5456 #5455 #5453 #5451 #5449 #5447 #5446 #5443 #5442 #5439 #5420 )")
+
+### PRs
+- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
+```
+
+⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
+```
+
+## [1.2.2] - 2022-12-29
+
+### Fixed
+- fix(ci): fix release script inputs [#5392](https://github.com/axios/axios/pull/5392)
+- fix(ci): prerelease scipts [#5377](https://github.com/axios/axios/pull/5377)
+- fix(ci): release scripts [#5376](https://github.com/axios/axios/pull/5376)
+- fix(ci): typescript tests [#5375](https://github.com/axios/axios/pull/5375)
+- fix: Brotli decompression [#5353](https://github.com/axios/axios/pull/5353)
+- fix: add missing HttpStatusCode [#5345](https://github.com/axios/axios/pull/5345)
+
+### Chores
+- chore(ci): set conventional-changelog header config [#5406](https://github.com/axios/axios/pull/5406)
+- chore(ci): fix automatic contributors resolving [#5403](https://github.com/axios/axios/pull/5403)
+- chore(ci): improved logging for the contributors list generator [#5398](https://github.com/axios/axios/pull/5398)
+- chore(ci): fix release action [#5397](https://github.com/axios/axios/pull/5397)
+- chore(ci): fix version bump script by adding bump argument for target version [#5393](https://github.com/axios/axios/pull/5393)
+- chore(deps): bump decode-uri-component from 0.2.0 to 0.2.2 [#5342](https://github.com/axios/axios/pull/5342)
+- chore(ci): GitHub Actions Release script [#5384](https://github.com/axios/axios/pull/5384)
+- chore(ci): release scripts [#5364](https://github.com/axios/axios/pull/5364)
+
+### Contributors to this release
+- ![avatar](https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;16) [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS)
+- ![avatar](https://avatars.githubusercontent.com/u/1652293?v&#x3D;4&amp;s&#x3D;16) [Winnie](https://github.com/winniehell)
+
+## [1.2.1] - 2022-12-05
+
+### Changed
+- feat(exports): export mergeConfig [#5151](https://github.com/axios/axios/pull/5151)
+
+### Fixed
+- fix(CancelledError): include config [#4922](https://github.com/axios/axios/pull/4922)
+- fix(general): removing multiple/trailing/leading whitespace [#5022](https://github.com/axios/axios/pull/5022)
+- fix(headers): decompression for responses without Content-Length header [#5306](https://github.com/axios/axios/pull/5306)
+- fix(webWorker): exception to sending form data in web worker [#5139](https://github.com/axios/axios/pull/5139)
+
+### Refactors
+- refactor(types): AxiosProgressEvent.event type to any [#5308](https://github.com/axios/axios/pull/5308)
+- refactor(types): add missing types for static AxiosError.from method [#4956](https://github.com/axios/axios/pull/4956)
+
+### Chores
+- chore(docs): remove README link to non-existent upgrade guide [#5307](https://github.com/axios/axios/pull/5307)
+- chore(docs): typo in issue template name [#5159](https://github.com/axios/axios/pull/5159)
+
+### Contributors to this release
+
+- [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS)
+- [Zachary Lysobey](https://github.com/zachlysobey)
+- [Kevin Ennis](https://github.com/kevincennis)
+- [Philipp Loose](https://github.com/phloose)
+- [secondl1ght](https://github.com/secondl1ght)
+- [wenzheng](https://github.com/0x30)
+- [Ivan Barsukov](https://github.com/ovarn)
+- [Arthur Fiorette](https://github.com/arthurfiorette)
+
+### PRs
+- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
+```
+
+⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
+```
+
+## [1.2.0] - 2022-11-10
+
+### Changed
+
+- changed: refactored module exports [#5162](https://github.com/axios/axios/pull/5162)
+- change: re-added support for loading Axios with require('axios').default [#5225](https://github.com/axios/axios/pull/5225)
+
+### Fixed
+
+- fix: improve AxiosHeaders class [#5224](https://github.com/axios/axios/pull/5224)
+- fix: TypeScript type definitions for commonjs [#5196](https://github.com/axios/axios/pull/5196)
+- fix: type definition of use method on AxiosInterceptorManager to match the the README [#5071](https://github.com/axios/axios/pull/5071)
+- fix: __dirname is not defined in the sandbox [#5269](https://github.com/axios/axios/pull/5269)
+- fix: AxiosError.toJSON method to avoid circular references [#5247](https://github.com/axios/axios/pull/5247)
+- fix: Z_BUF_ERROR when content-encoding is set but the response body is empty [#5250](https://github.com/axios/axios/pull/5250)
+
+### Refactors
+- refactor: allowing adapters to be loaded by name [#5277](https://github.com/axios/axios/pull/5277)
+
+### Chores
+
+- chore: force CI restart [#5243](https://github.com/axios/axios/pull/5243)
+- chore: update ECOSYSTEM.md [#5077](https://github.com/axios/axios/pull/5077)
+- chore: update get/index.html [#5116](https://github.com/axios/axios/pull/5116)
+- chore: update Sandbox UI/UX [#5205](https://github.com/axios/axios/pull/5205)
+- chore:(actions): remove git credentials after checkout [#5235](https://github.com/axios/axios/pull/5235)
+- chore(actions): bump actions/dependency-review-action from 2 to 3 [#5266](https://github.com/axios/axios/pull/5266)
+- chore(packages): bump loader-utils from 1.4.1 to 1.4.2 [#5295](https://github.com/axios/axios/pull/5295)
+- chore(packages): bump engine.io from 6.2.0 to 6.2.1 [#5294](https://github.com/axios/axios/pull/5294)
+- chore(packages): bump socket.io-parser from 4.0.4 to 4.0.5 [#5241](https://github.com/axios/axios/pull/5241)
+- chore(packages): bump loader-utils from 1.4.0 to 1.4.1 [#5245](https://github.com/axios/axios/pull/5245)
+- chore(docs): update Resources links in README [#5119](https://github.com/axios/axios/pull/5119)
+- chore(docs): update the link for JSON url [#5265](https://github.com/axios/axios/pull/5265)
+- chore(docs): fix broken links [#5218](https://github.com/axios/axios/pull/5218)
+- chore(docs): update and rename UPGRADE_GUIDE.md to MIGRATION_GUIDE.md [#5170](https://github.com/axios/axios/pull/5170)
+- chore(docs): typo fix line #856 and #920 [#5194](https://github.com/axios/axios/pull/5194)
+- chore(docs): typo fix #800 [#5193](https://github.com/axios/axios/pull/5193)
+- chore(docs): fix typos [#5184](https://github.com/axios/axios/pull/5184)
+- chore(docs): fix punctuation in README.md [#5197](https://github.com/axios/axios/pull/5197)
+- chore(docs): update readme in the Handling Errors section - issue reference #5260 [#5261](https://github.com/axios/axios/pull/5261)
+- chore: remove \b from filename [#5207](https://github.com/axios/axios/pull/5207)
+- chore(docs): update CHANGELOG.md [#5137](https://github.com/axios/axios/pull/5137)
+- chore: add sideEffects false to package.json [#5025](https://github.com/axios/axios/pull/5025)
+
+### Contributors to this release
+
+- [Maddy Miller](https://github.com/me4502)
+- [Amit Saini](https://github.com/amitsainii)
+- [ecyrbe](https://github.com/ecyrbe)
+- [Ikko Ashimine](https://github.com/eltociear)
+- [Geeth Gunnampalli](https://github.com/thetechie7)
+- [Shreem Asati](https://github.com/shreem-123)
+- [Frieder Bluemle](https://github.com/friederbluemle)
+- [윤세영](https://github.com/yunseyeong)
+- [Claudio Busatto](https://github.com/cjcbusatto)
+- [Remco Haszing](https://github.com/remcohaszing)
+- [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS)
+- [Csaba Maulis](https://github.com/om4csaba)
+- [MoPaMo](https://github.com/MoPaMo)
+- [Daniel Fjeldstad](https://github.com/w3bdesign)
+- [Adrien Brunet](https://github.com/adrien-may)
+- [Frazer Smith](https://github.com/Fdawgs)
+- [HaiTao](https://github.com/836334258)
+- [AZM](https://github.com/aziyatali)
+- [relbns](https://github.com/relbns)
+
+### PRs
+- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
+```
+
+⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
+```
+
+## [1.1.3] - 2022-10-15
+
+### Added
+
+- Added custom params serializer support [#5113](https://github.com/axios/axios/pull/5113)
+
+### Fixed
+
+- Fixed top-level export to keep them in-line with static properties [#5109](https://github.com/axios/axios/pull/5109)
+- Stopped including null values to query string. [#5108](https://github.com/axios/axios/pull/5108)
+- Restored proxy config backwards compatibility with 0.x [#5097](https://github.com/axios/axios/pull/5097)
+- Added back AxiosHeaders in AxiosHeaderValue [#5103](https://github.com/axios/axios/pull/5103)
+- Pin CDN install instructions to a specific version [#5060](https://github.com/axios/axios/pull/5060)
+- Handling of array values fixed for AxiosHeaders [#5085](https://github.com/axios/axios/pull/5085)
+
+### Chores
+
+- docs: match badge style, add link to them [#5046](https://github.com/axios/axios/pull/5046)
+- chore: fixing comments typo [#5054](https://github.com/axios/axios/pull/5054)
+- chore: update issue template [#5061](https://github.com/axios/axios/pull/5061)
+- chore: added progress capturing section to the docs; [#5084](https://github.com/axios/axios/pull/5084)
+
+### Contributors to this release
+
+- [Jason Saayman](https://github.com/jasonsaayman)
+- [scarf](https://github.com/scarf005)
+- [Lenz Weber-Tronic](https://github.com/phryneas)
+- [Arvindh](https://github.com/itsarvindh)
+- [Félix Legrelle](https://github.com/FelixLgr)
+- [Patrick Petrovic](https://github.com/ppati000)
+- [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS)
+- [littledian](https://github.com/littledian)
+- [ChronosMasterOfAllTime](https://github.com/ChronosMasterOfAllTime)
+
+### PRs
+- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
+```
+
+⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
+```
+
+## [1.1.2] - 2022-10-07
+
+### Fixed
+
+- Fixed broken exports for UMD builds.
+
+### Contributors to this release
+
+- [Jason Saayman](https://github.com/jasonsaayman)
+
+### PRs
+- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
+```
+
+⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
+```
+
+## [1.1.1] - 2022-10-07
+
+### Fixed
+
+- Fixed broken exports for common js. This fix breaks a prior fix, I will fix both issues ASAP but the commonJS use is more impactful.
+
+### Contributors to this release
+
+- [Jason Saayman](https://github.com/jasonsaayman)
+
+### PRs
+- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
+```
+
+⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
+```
+
+## [1.1.0] - 2022-10-06
+
+### Fixed
+
+- Fixed missing exports in type definition index.d.ts [#5003](https://github.com/axios/axios/pull/5003)
+- Fixed query params composing [#5018](https://github.com/axios/axios/pull/5018)
+- Fixed GenericAbortSignal interface by making it more generic [#5021](https://github.com/axios/axios/pull/5021)
+- Fixed adding "clear" to AxiosInterceptorManager [#5010](https://github.com/axios/axios/pull/5010)
+- Fixed commonjs & umd exports [#5030](https://github.com/axios/axios/pull/5030)
+- Fixed inability to access response headers when using axios 1.x with Jest [#5036](https://github.com/axios/axios/pull/5036)
+
+### Contributors to this release
+
+- [Trim21](https://github.com/trim21)
+- [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS)
+- [shingo.sasaki](https://github.com/s-sasaki-0529)
+- [Ivan Pepelko](https://github.com/ivanpepelko)
+- [Richard Kořínek](https://github.com/risa)
+
+### PRs
+- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
+```
+
+⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
+```
+
+## [1.0.0] - 2022-10-04
+
+### Added
+
+- Added stack trace to AxiosError [#4624](https://github.com/axios/axios/pull/4624)
+- Add AxiosError to AxiosStatic [#4654](https://github.com/axios/axios/pull/4654)
+- Replaced Rollup as our build runner [#4596](https://github.com/axios/axios/pull/4596)
+- Added generic TS types for the exposed toFormData helper [#4668](https://github.com/axios/axios/pull/4668)
+- Added listen callback function [#4096](https://github.com/axios/axios/pull/4096)
+- Added instructions for installing using PNPM [#4207](https://github.com/axios/axios/pull/4207)
+- Added generic AxiosAbortSignal TS interface to avoid importing AbortController polyfill [#4229](https://github.com/axios/axios/pull/4229)
+- Added axios-url-template in ECOSYSTEM.md [#4238](https://github.com/axios/axios/pull/4238)
+- Added a clear() function to the request and response interceptors object so a user can ensure that all interceptors have been removed from an axios instance [#4248](https://github.com/axios/axios/pull/4248)
+- Added react hook plugin [#4319](https://github.com/axios/axios/pull/4319)
+- Adding HTTP status code for transformResponse [#4580](https://github.com/axios/axios/pull/4580)
+- Added blob to the list of protocols supported by the browser [#4678](https://github.com/axios/axios/pull/4678)
+- Resolving proxy from env on redirect [#4436](https://github.com/axios/axios/pull/4436)
+- Added enhanced toFormData implementation with additional options [4704](https://github.com/axios/axios/pull/4704)
+- Adding Canceler parameters config and request [#4711](https://github.com/axios/axios/pull/4711)
+- Added automatic payload serialization to application/x-www-form-urlencoded [#4714](https://github.com/axios/axios/pull/4714)
+- Added the ability for webpack users to overwrite built-ins [#4715](https://github.com/axios/axios/pull/4715)
+- Added string[] to AxiosRequestHeaders type [#4322](https://github.com/axios/axios/pull/4322)
+- Added the ability for the url-encoded-form serializer to respect the formSerializer config [#4721](https://github.com/axios/axios/pull/4721)
+- Added isCancel type assert [#4293](https://github.com/axios/axios/pull/4293)
+- Added data URL support for node.js [#4725](https://github.com/axios/axios/pull/4725)
+- Adding types for progress event callbacks [#4675](https://github.com/axios/axios/pull/4675)
+- URL params serializer [#4734](https://github.com/axios/axios/pull/4734)
+- Added axios.formToJSON method [#4735](https://github.com/axios/axios/pull/4735)
+- Bower platform add data protocol [#4804](https://github.com/axios/axios/pull/4804)
+- Use WHATWG URL API instead of url.parse() [#4852](https://github.com/axios/axios/pull/4852)
+- Add ENUM containing Http Status Codes to typings [#4903](https://github.com/axios/axios/pull/4903)
+- Improve typing of timeout in index.d.ts [#4934](https://github.com/axios/axios/pull/4934)
+
+### Changed
+
+- Updated AxiosError.config to be optional in the type definition [#4665](https://github.com/axios/axios/pull/4665)
+- Updated README emphasizing the URLSearchParam built-in interface over other solutions [#4590](https://github.com/axios/axios/pull/4590)
+- Include request and config when creating a CanceledError instance [#4659](https://github.com/axios/axios/pull/4659)
+- Changed func-names eslint rule to as-needed [#4492](https://github.com/axios/axios/pull/4492)
+- Replacing deprecated substr() with slice() as substr() is deprecated [#4468](https://github.com/axios/axios/pull/4468)
+- Updating HTTP links in README.md to use HTTPS [#4387](https://github.com/axios/axios/pull/4387)
+- Updated to a better trim() polyfill [#4072](https://github.com/axios/axios/pull/4072)
+- Updated types to allow specifying partial default headers on instance create [#4185](https://github.com/axios/axios/pull/4185)
+- Expanded isAxiosError types [#4344](https://github.com/axios/axios/pull/4344)
+- Updated type definition for axios instance methods [#4224](https://github.com/axios/axios/pull/4224)
+- Updated eslint config [#4722](https://github.com/axios/axios/pull/4722)
+- Updated Docs [#4742](https://github.com/axios/axios/pull/4742)
+- Refactored Axios to use ES2017 [#4787](https://github.com/axios/axios/pull/4787)
+
+
+### Deprecated
+- There are multiple deprecations, refactors and fixes provided in this release. Please read through the full release notes to see how this may impact your project and use case.
+
+### Removed
+
+- Removed incorrect argument for NetworkError constructor [#4656](https://github.com/axios/axios/pull/4656)
+- Removed Webpack [#4596](https://github.com/axios/axios/pull/4596)
+- Removed function that transform arguments to array [#4544](https://github.com/axios/axios/pull/4544)
+
+### Fixed
+
+- Fixed grammar in README [#4649](https://github.com/axios/axios/pull/4649)
+- Fixed code error in README [#4599](https://github.com/axios/axios/pull/4599)
+- Optimized the code that checks cancellation [#4587](https://github.com/axios/axios/pull/4587)
+- Fix url pointing to defaults.js in README [#4532](https://github.com/axios/axios/pull/4532)
+- Use type alias instead of interface for AxiosPromise [#4505](https://github.com/axios/axios/pull/4505)
+- Fix some word spelling and lint style in code comments [#4500](https://github.com/axios/axios/pull/4500)
+- Edited readme with 3 updated browser icons of Chrome, FireFox and Safari [#4414](https://github.com/axios/axios/pull/4414)
+- Bump follow-redirects from 1.14.9 to 1.15.0 [#4673](https://github.com/axios/axios/pull/4673)
+- Fixing http tests to avoid hanging when assertions fail [#4435](https://github.com/axios/axios/pull/4435)
+- Fix TS definition for AxiosRequestTransformer [#4201](https://github.com/axios/axios/pull/4201)
+- Fix grammatical issues in README [#4232](https://github.com/axios/axios/pull/4232)
+- Fixing instance.defaults.headers type [#4557](https://github.com/axios/axios/pull/4557)
+- Fixed race condition on immediate requests cancellation [#4261](https://github.com/axios/axios/pull/4261)
+- Fixing Z_BUF_ERROR when no content [#4701](https://github.com/axios/axios/pull/4701)
+- Fixing proxy beforeRedirect regression [#4708](https://github.com/axios/axios/pull/4708)
+- Fixed AxiosError status code type [#4717](https://github.com/axios/axios/pull/4717)
+- Fixed AxiosError stack capturing [#4718](https://github.com/axios/axios/pull/4718)
+- Fixing AxiosRequestHeaders typings [#4334](https://github.com/axios/axios/pull/4334)
+- Fixed max body length defaults [#4731](https://github.com/axios/axios/pull/4731)
+- Fixed toFormData Blob issue on node>v17 [#4728](https://github.com/axios/axios/pull/4728)
+- Bump grunt from 1.5.2 to 1.5.3 [#4743](https://github.com/axios/axios/pull/4743)
+- Fixing content-type header repeated [#4745](https://github.com/axios/axios/pull/4745)
+- Fixed timeout error message for http [4738](https://github.com/axios/axios/pull/4738)
+- Request ignores false, 0 and empty string as body values [#4785](https://github.com/axios/axios/pull/4785)
+- Added back missing minified builds [#4805](https://github.com/axios/axios/pull/4805)
+- Fixed a type error [#4815](https://github.com/axios/axios/pull/4815)
+- Fixed a regression bug with unsubscribing from cancel token; [#4819](https://github.com/axios/axios/pull/4819)
+- Remove repeated compression algorithm [#4820](https://github.com/axios/axios/pull/4820)
+- The error of calling extend to pass parameters [#4857](https://github.com/axios/axios/pull/4857)
+- SerializerOptions.indexes allows boolean | null | undefined [#4862](https://github.com/axios/axios/pull/4862)
+- Require interceptors to return values [#4874](https://github.com/axios/axios/pull/4874)
+- Removed unused imports [#4949](https://github.com/axios/axios/pull/4949)
+- Allow null indexes on formSerializer and paramsSerializer [#4960](https://github.com/axios/axios/pull/4960)
+
+### Chores
+- Set permissions for GitHub actions [#4765](https://github.com/axios/axios/pull/4765)
+- Included githubactions in the dependabot config [#4770](https://github.com/axios/axios/pull/4770)
+- Included dependency review [#4771](https://github.com/axios/axios/pull/4771)
+- Update security.md [#4784](https://github.com/axios/axios/pull/4784)
+- Remove unnecessary spaces [#4854](https://github.com/axios/axios/pull/4854)
+- Simplify the import path of AxiosError [#4875](https://github.com/axios/axios/pull/4875)
+- Fix Gitpod dead link [#4941](https://github.com/axios/axios/pull/4941)
+- Enable syntax highlighting for a code block [#4970](https://github.com/axios/axios/pull/4970)
+- Using Logo Axios in Readme.md [#4993](https://github.com/axios/axios/pull/4993)
+- Fix markup for note in README [#4825](https://github.com/axios/axios/pull/4825)
+- Fix typo and formatting, add colons [#4853](https://github.com/axios/axios/pull/4853)
+- Fix typo in readme [#4942](https://github.com/axios/axios/pull/4942)
+
+### Security
+
+- Update SECURITY.md [#4687](https://github.com/axios/axios/pull/4687)
+
+### Contributors to this release
+
+- [Bertrand Marron](https://github.com/tusbar)
+- [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS)
+- [Dan Mooney](https://github.com/danmooney)
+- [Michael Li](https://github.com/xiaoyu-tamu)
+- [aong](https://github.com/yxwzaxns)
+- [Des Preston](https://github.com/despreston)
+- [Ted Robertson](https://github.com/tredondo)
+- [zhoulixiang](https://github.com/zh-lx)
+- [Arthur Fiorette](https://github.com/arthurfiorette)
+- [Kumar Shanu](https://github.com/Kr-Shanu)
+- [JALAL](https://github.com/JLL32)
+- [Jingyi Lin](https://github.com/MageeLin)
+- [Philipp Loose](https://github.com/phloose)
+- [Alexander Shchukin](https://github.com/sashsvamir)
+- [Dave Cardwell](https://github.com/davecardwell)
+- [Cat Scarlet](https://github.com/catscarlet)
+- [Luca Pizzini](https://github.com/lpizzinidev)
+- [Kai](https://github.com/Schweinepriester)
+- [Maxime Bargiel](https://github.com/mbargiel)
+- [Brian Helba](https://github.com/brianhelba)
+- [reslear](https://github.com/reslear)
+- [Jamie Slome](https://github.com/JamieSlome)
+- [Landro3](https://github.com/Landro3)
+- [rafw87](https://github.com/rafw87)
+- [Afzal Sayed](https://github.com/afzalsayed96)
+- [Koki Oyatsu](https://github.com/kaishuu0123)
+- [Dave](https://github.com/wangcch)
+- [暴走老七](https://github.com/baozouai)
+- [Spencer](https://github.com/spalger)
+- [Adrian Wieprzkowicz](https://github.com/Argeento)
+- [Jamie Telin](https://github.com/lejahmie)
+- [毛呆](https://github.com/aweikalee)
+- [Kirill Shakirov](https://github.com/turisap)
+- [Rraji Abdelbari](https://github.com/estarossa0)
+- [Jelle Schutter](https://github.com/jelleschutter)
+- [Tom Ceuppens](https://github.com/KyorCode)
+- [Johann Cooper](https://github.com/JohannCooper)
+- [Dimitris Halatsis](https://github.com/mitsos1os)
+- [chenjigeng](https://github.com/chenjigeng)
+- [João Gabriel Quaresma](https://github.com/joaoGabriel55)
+- [Victor Augusto](https://github.com/VictorAugDB)
+- [neilnaveen](https://github.com/neilnaveen)
+- [Pavlos](https://github.com/psmoros)
+- [Kiryl Valkovich](https://github.com/visortelle)
+- [Naveen](https://github.com/naveensrinivasan)
+- [wenzheng](https://github.com/0x30)
+- [hcwhan](https://github.com/hcwhan)
+- [Bassel Rachid](https://github.com/basselworkforce)
+- [Grégoire Pineau](https://github.com/lyrixx)
+- [felipedamin](https://github.com/felipedamin)
+- [Karl Horky](https://github.com/karlhorky)
+- [Yue JIN](https://github.com/kingyue737)
+- [Usman Ali Siddiqui](https://github.com/usman250994)
+- [WD](https://github.com/techbirds)
+- [Günther Foidl](https://github.com/gfoidl)
+- [Stephen Jennings](https://github.com/jennings)
+- [C.T.Lin](https://github.com/chentsulin)
+- [mia-z](https://github.com/mia-z)
+- [Parth Banathia](https://github.com/Parth0105)
+- [parth0105pluang](https://github.com/parth0105pluang)
+- [Marco Weber](https://github.com/mrcwbr)
+- [Luca Pizzini](https://github.com/lpizzinidev)
+- [Willian Agostini](https://github.com/WillianAgostini)
+- [Huyen Nguyen](https://github.com/huyenltnguyen) \ No newline at end of file
diff --git a/node_modules/axios/LICENSE b/node_modules/axios/LICENSE
new file mode 100644
index 0000000..05006a5
--- /dev/null
+++ b/node_modules/axios/LICENSE
@@ -0,0 +1,7 @@
+# Copyright (c) 2014-present Matt Zabriskie & Collaborators
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/axios/MIGRATION_GUIDE.md b/node_modules/axios/MIGRATION_GUIDE.md
new file mode 100644
index 0000000..ec3ae0d
--- /dev/null
+++ b/node_modules/axios/MIGRATION_GUIDE.md
@@ -0,0 +1,3 @@
+# Migration Guide
+
+## 0.x.x -> 1.1.0
diff --git a/node_modules/axios/README.md b/node_modules/axios/README.md
new file mode 100644
index 0000000..f012e44
--- /dev/null
+++ b/node_modules/axios/README.md
@@ -0,0 +1,1647 @@
+<h3 align="center">
+ Platinum sponsors
+ <br>
+</h3>
+
+<div align="center">
+ <a href="https://runalloy.com?utm_source=github&utm_medium=referral&utm_campaign=121423_axios">
+ <picture>
+ <source width="400px" media="(prefers-color-scheme: dark)" srcset="https://github.com/axios/axios/assets/4814473/f6067247-7eba-4069-852a-ab1bb85b1780">
+ <source width="400px" media="(prefers-color-scheme: light)" srcset="https://github.com/axios/axios/assets/4814473/75c37f4d-36e6-44f5-a068-3edd77c00a10">
+ <img width="400px" src="https://github.com/axios/axios/assets/4814473/75c37f4d-36e6-44f5-a068-3edd77c00a10" />
+ </picture>
+ </a>
+
+ <p align="center">Alloy is the integration development platform that makes it simple and <br>fast for SaaS companies to launch critical user-facing integrations.</p>
+ <p align="center">
+ <a href="https://runalloy.com/signup?utm_source=github&utm_medium=referral&utm_campaign=11823_axios"><b>Sign up free</b></a> •
+ <a href="https://docs.runalloy.com/docs?utm_source=github&utm_medium=referral&utm_campaign=11823_axios"><b>Documentation</b></a>
+ </p>
+ <br><br>
+</div>
+
+<h3 align="center">
+ Gold sponsors
+ <br><br>
+</h3>
+
+<div align="center">
+ <a href="https://stytch.com?utm_source=oss-sponsorship&utm_medium=paid_sponsorship&utm_content=logo&utm_campaign=axios-http">
+ <picture>
+ <source width="200px" media="(prefers-color-scheme: dark)" srcset="https://github.com/axios/axios/assets/4814473/538d715a-13c7-4668-ae7d-37a4548423f4">
+ <source width="200px" media="(prefers-color-scheme: light)" srcset="https://github.com/axios/axios/assets/4814473/b6a9a7bc-9fb1-4b9b-909f-1b4bee1fd142">
+ <img width="200px" src="https://github.com/axios/axios/assets/4814473/b6a9a7bc-9fb1-4b9b-909f-1b4bee1fd142" />
+ </picture>
+ </a>
+ <p align="center">API-first authentication, authorization, and fraud prevention</p>
+ <p align="center">
+ <a href="https://stytch.com?utm_source=oss-sponsorship&utm_medium=paid_sponsorship&utm_content=website-link&utm_campaign=axios-http"><b>Website</b></a> •
+ <a href="https://stytch.com/docs?utm_source=oss-sponsorship&utm_medium=paid_sponsorship&utm_content=docs-link&utm_campaign=axios-http"><b>Documentation</b></a> • <a href="https://github.com/stytchauth/stytch-node?utm_source=oss-sponsorship&utm_medium=paid_sponsorship&utm_content=node-sdk&utm_campaign=axios-http"><b>Node.js Backend SDK</b></a>
+ </p>
+</div>
+
+
+<br><br>
+<div align="center">
+ <a href="https://axios-http.com"><img src="https://axios-http.com/assets/logo.svg" /></a><br>
+</div>
+
+<p align="center">Promise based HTTP client for the browser and node.js</p>
+
+<p align="center">
+ <a href="https://axios-http.com/"><b>Website</b></a> •
+ <a href="https://axios-http.com/docs/intro"><b>Documentation</b></a>
+</p>
+
+<div align="center">
+
+[![npm version](https://img.shields.io/npm/v/axios.svg?style=flat-square)](https://www.npmjs.org/package/axios)
+[![CDNJS](https://img.shields.io/cdnjs/v/axios.svg?style=flat-square)](https://cdnjs.com/libraries/axios)
+[![Build status](https://img.shields.io/github/actions/workflow/status/axios/axios/ci.yml?branch=v1.x&label=CI&logo=github&style=flat-square)](https://github.com/axios/axios/actions/workflows/ci.yml)
+[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod&style=flat-square)](https://gitpod.io/#https://github.com/axios/axios)
+[![code coverage](https://img.shields.io/coveralls/mzabriskie/axios.svg?style=flat-square)](https://coveralls.io/r/mzabriskie/axios)
+[![install size](https://img.shields.io/badge/dynamic/json?url=https://packagephobia.com/v2/api.json?p=axios&query=$.install.pretty&label=install%20size&style=flat-square)](https://packagephobia.now.sh/result?p=axios)
+[![npm bundle size](https://img.shields.io/bundlephobia/minzip/axios?style=flat-square)](https://bundlephobia.com/package/axios@latest)
+[![npm downloads](https://img.shields.io/npm/dm/axios.svg?style=flat-square)](https://npm-stat.com/charts.html?package=axios)
+[![gitter chat](https://img.shields.io/gitter/room/mzabriskie/axios.svg?style=flat-square)](https://gitter.im/mzabriskie/axios)
+[![code helpers](https://www.codetriage.com/axios/axios/badges/users.svg)](https://www.codetriage.com/axios/axios)
+[![Known Vulnerabilities](https://snyk.io/test/npm/axios/badge.svg)](https://snyk.io/test/npm/axios)
+
+
+
+
+</div>
+
+## Table of Contents
+
+ - [Features](#features)
+ - [Browser Support](#browser-support)
+ - [Installing](#installing)
+ - [Package manager](#package-manager)
+ - [CDN](#cdn)
+ - [Example](#example)
+ - [Axios API](#axios-api)
+ - [Request method aliases](#request-method-aliases)
+ - [Concurrency 👎](#concurrency-deprecated)
+ - [Creating an instance](#creating-an-instance)
+ - [Instance methods](#instance-methods)
+ - [Request Config](#request-config)
+ - [Response Schema](#response-schema)
+ - [Config Defaults](#config-defaults)
+ - [Global axios defaults](#global-axios-defaults)
+ - [Custom instance defaults](#custom-instance-defaults)
+ - [Config order of precedence](#config-order-of-precedence)
+ - [Interceptors](#interceptors)
+ - [Multiple Interceptors](#multiple-interceptors)
+ - [Handling Errors](#handling-errors)
+ - [Cancellation](#cancellation)
+ - [AbortController](#abortcontroller)
+ - [CancelToken 👎](#canceltoken-deprecated)
+ - [Using application/x-www-form-urlencoded format](#using-applicationx-www-form-urlencoded-format)
+ - [URLSearchParams](#urlsearchparams)
+ - [Query string](#query-string-older-browsers)
+ - [🆕 Automatic serialization](#-automatic-serialization-to-urlsearchparams)
+ - [Using multipart/form-data format](#using-multipartform-data-format)
+ - [FormData](#formdata)
+ - [🆕 Automatic serialization](#-automatic-serialization-to-formdata)
+ - [Files Posting](#files-posting)
+ - [HTML Form Posting](#-html-form-posting-browser)
+ - [🆕 Progress capturing](#-progress-capturing)
+ - [🆕 Rate limiting](#-progress-capturing)
+ - [🆕 AxiosHeaders](#-axiosheaders)
+ - [Semver](#semver)
+ - [Promises](#promises)
+ - [TypeScript](#typescript)
+ - [Resources](#resources)
+ - [Credits](#credits)
+ - [License](#license)
+
+## Features
+
+- Make [XMLHttpRequests](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest) from the browser
+- Make [http](https://nodejs.org/api/http.html) requests from node.js
+- Supports the [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) API
+- Intercept request and response
+- Transform request and response data
+- Cancel requests
+- Automatic transforms for [JSON](https://www.json.org/json-en.html) data
+- 🆕 Automatic data object serialization to `multipart/form-data` and `x-www-form-urlencoded` body encodings
+- Client side support for protecting against [XSRF](https://en.wikipedia.org/wiki/Cross-site_request_forgery)
+
+## Browser Support
+
+![Chrome](https://raw.githubusercontent.com/alrra/browser-logos/main/src/chrome/chrome_48x48.png) | ![Firefox](https://raw.githubusercontent.com/alrra/browser-logos/main/src/firefox/firefox_48x48.png) | ![Safari](https://raw.githubusercontent.com/alrra/browser-logos/main/src/safari/safari_48x48.png) | ![Opera](https://raw.githubusercontent.com/alrra/browser-logos/main/src/opera/opera_48x48.png) | ![Edge](https://raw.githubusercontent.com/alrra/browser-logos/main/src/edge/edge_48x48.png) | ![IE](https://raw.githubusercontent.com/alrra/browser-logos/master/src/archive/internet-explorer_9-11/internet-explorer_9-11_48x48.png) |
+--- | --- | --- | --- | --- | --- |
+Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | 11 ✔ |
+
+[![Browser Matrix](https://saucelabs.com/open_sauce/build_matrix/axios.svg)](https://saucelabs.com/u/axios)
+
+## Installing
+
+### Package manager
+
+Using npm:
+
+```bash
+$ npm install axios
+```
+
+Using bower:
+
+```bash
+$ bower install axios
+```
+
+Using yarn:
+
+```bash
+$ yarn add axios
+```
+
+Using pnpm:
+
+```bash
+$ pnpm add axios
+```
+
+Once the package is installed, you can import the library using `import` or `require` approach:
+
+```js
+import axios, {isCancel, AxiosError} from 'axios';
+```
+
+You can also use the default export, since the named export is just a re-export from the Axios factory:
+
+```js
+import axios from 'axios';
+
+console.log(axios.isCancel('something'));
+````
+
+If you use `require` for importing, **only default export is available**:
+
+```js
+const axios = require('axios');
+
+console.log(axios.isCancel('something'));
+```
+
+For cases where something went wrong when trying to import a module into a custom or legacy environment,
+you can try importing the module package directly:
+
+```js
+const axios = require('axios/dist/browser/axios.cjs'); // browser commonJS bundle (ES2017)
+// const axios = require('axios/dist/node/axios.cjs'); // node commonJS bundle (ES2017)
+```
+
+### CDN
+
+Using jsDelivr CDN (ES5 UMD browser module):
+
+```html
+<script src="https://cdn.jsdelivr.net/npm/axios@1.1.2/dist/axios.min.js"></script>
+```
+
+Using unpkg CDN:
+
+```html
+<script src="https://unpkg.com/axios@1.1.2/dist/axios.min.js"></script>
+```
+
+## Example
+
+> **Note**: CommonJS usage
+> In order to gain the TypeScript typings (for intellisense / autocomplete) while using CommonJS imports with `require()`, use the following approach:
+
+```js
+import axios from 'axios';
+//const axios = require('axios'); // legacy way
+
+// Make a request for a user with a given ID
+axios.get('/user?ID=12345')
+ .then(function (response) {
+ // handle success
+ console.log(response);
+ })
+ .catch(function (error) {
+ // handle error
+ console.log(error);
+ })
+ .finally(function () {
+ // always executed
+ });
+
+// Optionally the request above could also be done as
+axios.get('/user', {
+ params: {
+ ID: 12345
+ }
+ })
+ .then(function (response) {
+ console.log(response);
+ })
+ .catch(function (error) {
+ console.log(error);
+ })
+ .finally(function () {
+ // always executed
+ });
+
+// Want to use async/await? Add the `async` keyword to your outer function/method.
+async function getUser() {
+ try {
+ const response = await axios.get('/user?ID=12345');
+ console.log(response);
+ } catch (error) {
+ console.error(error);
+ }
+}
+```
+
+> **Note**: `async/await` is part of ECMAScript 2017 and is not supported in Internet
+> Explorer and older browsers, so use with caution.
+
+Performing a `POST` request
+
+```js
+axios.post('/user', {
+ firstName: 'Fred',
+ lastName: 'Flintstone'
+ })
+ .then(function (response) {
+ console.log(response);
+ })
+ .catch(function (error) {
+ console.log(error);
+ });
+```
+
+Performing multiple concurrent requests
+
+```js
+function getUserAccount() {
+ return axios.get('/user/12345');
+}
+
+function getUserPermissions() {
+ return axios.get('/user/12345/permissions');
+}
+
+Promise.all([getUserAccount(), getUserPermissions()])
+ .then(function (results) {
+ const acct = results[0];
+ const perm = results[1];
+ });
+```
+
+## axios API
+
+Requests can be made by passing the relevant config to `axios`.
+
+##### axios(config)
+
+```js
+// Send a POST request
+axios({
+ method: 'post',
+ url: '/user/12345',
+ data: {
+ firstName: 'Fred',
+ lastName: 'Flintstone'
+ }
+});
+```
+
+```js
+// GET request for remote image in node.js
+axios({
+ method: 'get',
+ url: 'https://bit.ly/2mTM3nY',
+ responseType: 'stream'
+})
+ .then(function (response) {
+ response.data.pipe(fs.createWriteStream('ada_lovelace.jpg'))
+ });
+```
+
+##### axios(url[, config])
+
+```js
+// Send a GET request (default method)
+axios('/user/12345');
+```
+
+### Request method aliases
+
+For convenience, aliases have been provided for all common request methods.
+
+##### axios.request(config)
+##### axios.get(url[, config])
+##### axios.delete(url[, config])
+##### axios.head(url[, config])
+##### axios.options(url[, config])
+##### axios.post(url[, data[, config]])
+##### axios.put(url[, data[, config]])
+##### axios.patch(url[, data[, config]])
+
+###### NOTE
+When using the alias methods `url`, `method`, and `data` properties don't need to be specified in config.
+
+### Concurrency (Deprecated)
+Please use `Promise.all` to replace the below functions.
+
+Helper functions for dealing with concurrent requests.
+
+axios.all(iterable)
+axios.spread(callback)
+
+### Creating an instance
+
+You can create a new instance of axios with a custom config.
+
+##### axios.create([config])
+
+```js
+const instance = axios.create({
+ baseURL: 'https://some-domain.com/api/',
+ timeout: 1000,
+ headers: {'X-Custom-Header': 'foobar'}
+});
+```
+
+### Instance methods
+
+The available instance methods are listed below. The specified config will be merged with the instance config.
+
+##### axios#request(config)
+##### axios#get(url[, config])
+##### axios#delete(url[, config])
+##### axios#head(url[, config])
+##### axios#options(url[, config])
+##### axios#post(url[, data[, config]])
+##### axios#put(url[, data[, config]])
+##### axios#patch(url[, data[, config]])
+##### axios#getUri([config])
+
+## Request Config
+
+These are the available config options for making requests. Only the `url` is required. Requests will default to `GET` if `method` is not specified.
+
+```js
+{
+ // `url` is the server URL that will be used for the request
+ url: '/user',
+
+ // `method` is the request method to be used when making the request
+ method: 'get', // default
+
+ // `baseURL` will be prepended to `url` unless `url` is absolute.
+ // It can be convenient to set `baseURL` for an instance of axios to pass relative URLs
+ // to methods of that instance.
+ baseURL: 'https://some-domain.com/api/',
+
+ // `transformRequest` allows changes to the request data before it is sent to the server
+ // This is only applicable for request methods 'PUT', 'POST', 'PATCH' and 'DELETE'
+ // The last function in the array must return a string or an instance of Buffer, ArrayBuffer,
+ // FormData or Stream
+ // You may modify the headers object.
+ transformRequest: [function (data, headers) {
+ // Do whatever you want to transform the data
+
+ return data;
+ }],
+
+ // `transformResponse` allows changes to the response data to be made before
+ // it is passed to then/catch
+ transformResponse: [function (data) {
+ // Do whatever you want to transform the data
+
+ return data;
+ }],
+
+ // `headers` are custom headers to be sent
+ headers: {'X-Requested-With': 'XMLHttpRequest'},
+
+ // `params` are the URL parameters to be sent with the request
+ // Must be a plain object or a URLSearchParams object
+ params: {
+ ID: 12345
+ },
+
+ // `paramsSerializer` is an optional config that allows you to customize serializing `params`.
+ paramsSerializer: {
+
+ //Custom encoder function which sends key/value pairs in an iterative fashion.
+ encode?: (param: string): string => { /* Do custom operations here and return transformed string */ },
+
+ // Custom serializer function for the entire parameter. Allows user to mimic pre 1.x behaviour.
+ serialize?: (params: Record<string, any>, options?: ParamsSerializerOptions ),
+
+ //Configuration for formatting array indexes in the params.
+ indexes: false // Three available options: (1) indexes: null (leads to no brackets), (2) (default) indexes: false (leads to empty brackets), (3) indexes: true (leads to brackets with indexes).
+ },
+
+ // `data` is the data to be sent as the request body
+ // Only applicable for request methods 'PUT', 'POST', 'DELETE , and 'PATCH'
+ // When no `transformRequest` is set, must be of one of the following types:
+ // - string, plain object, ArrayBuffer, ArrayBufferView, URLSearchParams
+ // - Browser only: FormData, File, Blob
+ // - Node only: Stream, Buffer, FormData (form-data package)
+ data: {
+ firstName: 'Fred'
+ },
+
+ // syntax alternative to send data into the body
+ // method post
+ // only the value is sent, not the key
+ data: 'Country=Brasil&City=Belo Horizonte',
+
+ // `timeout` specifies the number of milliseconds before the request times out.
+ // If the request takes longer than `timeout`, the request will be aborted.
+ timeout: 1000, // default is `0` (no timeout)
+
+ // `withCredentials` indicates whether or not cross-site Access-Control requests
+ // should be made using credentials
+ withCredentials: false, // default
+
+ // `adapter` allows custom handling of requests which makes testing easier.
+ // Return a promise and supply a valid response (see lib/adapters/README.md).
+ adapter: function (config) {
+ /* ... */
+ },
+
+ // `auth` indicates that HTTP Basic auth should be used, and supplies credentials.
+ // This will set an `Authorization` header, overwriting any existing
+ // `Authorization` custom headers you have set using `headers`.
+ // Please note that only HTTP Basic auth is configurable through this parameter.
+ // For Bearer tokens and such, use `Authorization` custom headers instead.
+ auth: {
+ username: 'janedoe',
+ password: 's00pers3cret'
+ },
+
+ // `responseType` indicates the type of data that the server will respond with
+ // options are: 'arraybuffer', 'document', 'json', 'text', 'stream'
+ // browser only: 'blob'
+ responseType: 'json', // default
+
+ // `responseEncoding` indicates encoding to use for decoding responses (Node.js only)
+ // Note: Ignored for `responseType` of 'stream' or client-side requests
+ responseEncoding: 'utf8', // default
+
+ // `xsrfCookieName` is the name of the cookie to use as a value for xsrf token
+ xsrfCookieName: 'XSRF-TOKEN', // default
+
+ // `xsrfHeaderName` is the name of the http header that carries the xsrf token value
+ xsrfHeaderName: 'X-XSRF-TOKEN', // default
+
+ // `undefined` (default) - set XSRF header only for the same origin requests
+ withXSRFToken: boolean | undefined | ((config: InternalAxiosRequestConfig) => boolean | undefined),
+
+ // `onUploadProgress` allows handling of progress events for uploads
+ // browser & node.js
+ onUploadProgress: function ({loaded, total, progress, bytes, estimated, rate, upload = true}) {
+ // Do whatever you want with the Axios progress event
+ },
+
+ // `onDownloadProgress` allows handling of progress events for downloads
+ // browser & node.js
+ onDownloadProgress: function ({loaded, total, progress, bytes, estimated, rate, download = true}) {
+ // Do whatever you want with the Axios progress event
+ },
+
+ // `maxContentLength` defines the max size of the http response content in bytes allowed in node.js
+ maxContentLength: 2000,
+
+ // `maxBodyLength` (Node only option) defines the max size of the http request content in bytes allowed
+ maxBodyLength: 2000,
+
+ // `validateStatus` defines whether to resolve or reject the promise for a given
+ // HTTP response status code. If `validateStatus` returns `true` (or is set to `null`
+ // or `undefined`), the promise will be resolved; otherwise, the promise will be
+ // rejected.
+ validateStatus: function (status) {
+ return status >= 200 && status < 300; // default
+ },
+
+ // `maxRedirects` defines the maximum number of redirects to follow in node.js.
+ // If set to 0, no redirects will be followed.
+ maxRedirects: 21, // default
+
+ // `beforeRedirect` defines a function that will be called before redirect.
+ // Use this to adjust the request options upon redirecting,
+ // to inspect the latest response headers,
+ // or to cancel the request by throwing an error
+ // If maxRedirects is set to 0, `beforeRedirect` is not used.
+ beforeRedirect: (options, { headers }) => {
+ if (options.hostname === "example.com") {
+ options.auth = "user:password";
+ }
+ },
+
+ // `socketPath` defines a UNIX Socket to be used in node.js.
+ // e.g. '/var/run/docker.sock' to send requests to the docker daemon.
+ // Only either `socketPath` or `proxy` can be specified.
+ // If both are specified, `socketPath` is used.
+ socketPath: null, // default
+
+ // `transport` determines the transport method that will be used to make the request. If defined, it will be used. Otherwise, if `maxRedirects` is 0, the default `http` or `https` library will be used, depending on the protocol specified in `protocol`. Otherwise, the `httpFollow` or `httpsFollow` library will be used, again depending on the protocol, which can handle redirects.
+ transport: undefined, // default
+
+ // `httpAgent` and `httpsAgent` define a custom agent to be used when performing http
+ // and https requests, respectively, in node.js. This allows options to be added like
+ // `keepAlive` that are not enabled by default.
+ httpAgent: new http.Agent({ keepAlive: true }),
+ httpsAgent: new https.Agent({ keepAlive: true }),
+
+ // `proxy` defines the hostname, port, and protocol of the proxy server.
+ // You can also define your proxy using the conventional `http_proxy` and
+ // `https_proxy` environment variables. If you are using environment variables
+ // for your proxy configuration, you can also define a `no_proxy` environment
+ // variable as a comma-separated list of domains that should not be proxied.
+ // Use `false` to disable proxies, ignoring environment variables.
+ // `auth` indicates that HTTP Basic auth should be used to connect to the proxy, and
+ // supplies credentials.
+ // This will set an `Proxy-Authorization` header, overwriting any existing
+ // `Proxy-Authorization` custom headers you have set using `headers`.
+ // If the proxy server uses HTTPS, then you must set the protocol to `https`.
+ proxy: {
+ protocol: 'https',
+ host: '127.0.0.1',
+ // hostname: '127.0.0.1' // Takes precedence over 'host' if both are defined
+ port: 9000,
+ auth: {
+ username: 'mikeymike',
+ password: 'rapunz3l'
+ }
+ },
+
+ // `cancelToken` specifies a cancel token that can be used to cancel the request
+ // (see Cancellation section below for details)
+ cancelToken: new CancelToken(function (cancel) {
+ }),
+
+ // an alternative way to cancel Axios requests using AbortController
+ signal: new AbortController().signal,
+
+ // `decompress` indicates whether or not the response body should be decompressed
+ // automatically. If set to `true` will also remove the 'content-encoding' header
+ // from the responses objects of all decompressed responses
+ // - Node only (XHR cannot turn off decompression)
+ decompress: true, // default
+
+ // `insecureHTTPParser` boolean.
+ // Indicates where to use an insecure HTTP parser that accepts invalid HTTP headers.
+ // This may allow interoperability with non-conformant HTTP implementations.
+ // Using the insecure parser should be avoided.
+ // see options https://nodejs.org/dist/latest-v12.x/docs/api/http.html#http_http_request_url_options_callback
+ // see also https://nodejs.org/en/blog/vulnerability/february-2020-security-releases/#strict-http-header-parsing-none
+ insecureHTTPParser: undefined, // default
+
+ // transitional options for backward compatibility that may be removed in the newer versions
+ transitional: {
+ // silent JSON parsing mode
+ // `true` - ignore JSON parsing errors and set response.data to null if parsing failed (old behaviour)
+ // `false` - throw SyntaxError if JSON parsing failed (Note: responseType must be set to 'json')
+ silentJSONParsing: true, // default value for the current Axios version
+
+ // try to parse the response string as JSON even if `responseType` is not 'json'
+ forcedJSONParsing: true,
+
+ // throw ETIMEDOUT error instead of generic ECONNABORTED on request timeouts
+ clarifyTimeoutError: false,
+ },
+
+ env: {
+ // The FormData class to be used to automatically serialize the payload into a FormData object
+ FormData: window?.FormData || global?.FormData
+ },
+
+ formSerializer: {
+ visitor: (value, key, path, helpers) => {}; // custom visitor function to serialize form values
+ dots: boolean; // use dots instead of brackets format
+ metaTokens: boolean; // keep special endings like {} in parameter key
+ indexes: boolean; // array indexes format null - no brackets, false - empty brackets, true - brackets with indexes
+ },
+
+ // http adapter only (node.js)
+ maxRate: [
+ 100 * 1024, // 100KB/s upload limit,
+ 100 * 1024 // 100KB/s download limit
+ ]
+}
+```
+
+## Response Schema
+
+The response for a request contains the following information.
+
+```js
+{
+ // `data` is the response that was provided by the server
+ data: {},
+
+ // `status` is the HTTP status code from the server response
+ status: 200,
+
+ // `statusText` is the HTTP status message from the server response
+ statusText: 'OK',
+
+ // `headers` the HTTP headers that the server responded with
+ // All header names are lowercase and can be accessed using the bracket notation.
+ // Example: `response.headers['content-type']`
+ headers: {},
+
+ // `config` is the config that was provided to `axios` for the request
+ config: {},
+
+ // `request` is the request that generated this response
+ // It is the last ClientRequest instance in node.js (in redirects)
+ // and an XMLHttpRequest instance in the browser
+ request: {}
+}
+```
+
+When using `then`, you will receive the response as follows:
+
+```js
+axios.get('/user/12345')
+ .then(function (response) {
+ console.log(response.data);
+ console.log(response.status);
+ console.log(response.statusText);
+ console.log(response.headers);
+ console.log(response.config);
+ });
+```
+
+When using `catch`, or passing a [rejection callback](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/then) as second parameter of `then`, the response will be available through the `error` object as explained in the [Handling Errors](#handling-errors) section.
+
+## Config Defaults
+
+You can specify config defaults that will be applied to every request.
+
+### Global axios defaults
+
+```js
+axios.defaults.baseURL = 'https://api.example.com';
+
+// Important: If axios is used with multiple domains, the AUTH_TOKEN will be sent to all of them.
+// See below for an example using Custom instance defaults instead.
+axios.defaults.headers.common['Authorization'] = AUTH_TOKEN;
+
+axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
+```
+
+### Custom instance defaults
+
+```js
+// Set config defaults when creating the instance
+const instance = axios.create({
+ baseURL: 'https://api.example.com'
+});
+
+// Alter defaults after instance has been created
+instance.defaults.headers.common['Authorization'] = AUTH_TOKEN;
+```
+
+### Config order of precedence
+
+Config will be merged with an order of precedence. The order is library defaults found in [lib/defaults.js](https://github.com/axios/axios/blob/master/lib/defaults/index.js#L28), then `defaults` property of the instance, and finally `config` argument for the request. The latter will take precedence over the former. Here's an example.
+
+```js
+// Create an instance using the config defaults provided by the library
+// At this point the timeout config value is `0` as is the default for the library
+const instance = axios.create();
+
+// Override timeout default for the library
+// Now all requests using this instance will wait 2.5 seconds before timing out
+instance.defaults.timeout = 2500;
+
+// Override timeout for this request as it's known to take a long time
+instance.get('/longRequest', {
+ timeout: 5000
+});
+```
+
+## Interceptors
+
+You can intercept requests or responses before they are handled by `then` or `catch`.
+
+```js
+// Add a request interceptor
+axios.interceptors.request.use(function (config) {
+ // Do something before request is sent
+ return config;
+ }, function (error) {
+ // Do something with request error
+ return Promise.reject(error);
+ });
+
+// Add a response interceptor
+axios.interceptors.response.use(function (response) {
+ // Any status code that lie within the range of 2xx cause this function to trigger
+ // Do something with response data
+ return response;
+ }, function (error) {
+ // Any status codes that falls outside the range of 2xx cause this function to trigger
+ // Do something with response error
+ return Promise.reject(error);
+ });
+```
+
+If you need to remove an interceptor later you can.
+
+```js
+const myInterceptor = axios.interceptors.request.use(function () {/*...*/});
+axios.interceptors.request.eject(myInterceptor);
+```
+
+You can also clear all interceptors for requests or responses.
+```js
+const instance = axios.create();
+instance.interceptors.request.use(function () {/*...*/});
+instance.interceptors.request.clear(); // Removes interceptors from requests
+instance.interceptors.response.use(function () {/*...*/});
+instance.interceptors.response.clear(); // Removes interceptors from responses
+```
+
+You can add interceptors to a custom instance of axios.
+
+```js
+const instance = axios.create();
+instance.interceptors.request.use(function () {/*...*/});
+```
+
+When you add request interceptors, they are presumed to be asynchronous by default. This can cause a delay
+in the execution of your axios request when the main thread is blocked (a promise is created under the hood for
+the interceptor and your request gets put on the bottom of the call stack). If your request interceptors are synchronous you can add a flag
+to the options object that will tell axios to run the code synchronously and avoid any delays in request execution.
+
+```js
+axios.interceptors.request.use(function (config) {
+ config.headers.test = 'I am only a header!';
+ return config;
+}, null, { synchronous: true });
+```
+
+If you want to execute a particular interceptor based on a runtime check,
+you can add a `runWhen` function to the options object. The interceptor will not be executed **if and only if** the return
+of `runWhen` is `false`. The function will be called with the config
+object (don't forget that you can bind your own arguments to it as well.) This can be handy when you have an
+asynchronous request interceptor that only needs to run at certain times.
+
+```js
+function onGetCall(config) {
+ return config.method === 'get';
+}
+axios.interceptors.request.use(function (config) {
+ config.headers.test = 'special get headers';
+ return config;
+}, null, { runWhen: onGetCall });
+```
+
+### Multiple Interceptors
+
+Given you add multiple response interceptors
+and when the response was fulfilled
+- then each interceptor is executed
+- then they are executed in the order they were added
+- then only the last interceptor's result is returned
+- then every interceptor receives the result of its predecessor
+- and when the fulfillment-interceptor throws
+ - then the following fulfillment-interceptor is not called
+ - then the following rejection-interceptor is called
+ - once caught, another following fulfill-interceptor is called again (just like in a promise chain).
+
+Read [the interceptor tests](./test/specs/interceptors.spec.js) for seeing all this in code.
+
+## Error Types
+
+There are many different axios error messages that can appear that can provide basic information about the specifics of the error and where opportunities may lie in debugging.
+
+The general structure of axios errors is as follows:
+| Property | Definition |
+| -------- | ---------- |
+| message | A quick summary of the error message and the status it failed with. |
+| name | This defines where the error originated from. For axios, it will always be an 'AxiosError'. |
+| stack | Provides the stack trace of the error. |
+| config | An axios config object with specific instance configurations defined by the user from when the request was made |
+| code | Represents an axios identified error. The table below lists out specific definitions for internal axios error. |
+| status | HTTP response status code. See [here](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes) for common HTTP response status code meanings.
+
+Below is a list of potential axios identified error
+| Code | Definition |
+| -------- | ---------- |
+| ERR_BAD_OPTION_VALUE | Invalid or unsupported value provided in axios configuration. |
+| ERR_BAD_OPTION | Invalid option provided in axios configuration. |
+| ECONNABORTED | Request timed out due to exceeding timeout specified in axios configuration. |
+| ETIMEDOUT | Request timed out due to exceeding default axios timelimit. |
+| ERR_NETWORK | Network-related issue.
+| ERR_FR_TOO_MANY_REDIRECTS | Request is redirected too many times; exceeds max redirects specified in axios configuration.
+| ERR_DEPRECATED | Deprecated feature or method used in axios.
+| ERR_BAD_RESPONSE | Response cannot be parsed properly or is in an unexpected format.
+| ERR_BAD_REQUEST | Requested has unexpected format or missing required parameters. |
+| ERR_CANCELED | Feature or method is canceled explicitly by the user.
+| ERR_NOT_SUPPORT | Feature or method not supported in the current axios environment.
+| ERR_INVALID_URL | Invalid URL provided for axios request.
+
+## Handling Errors
+
+the default behavior is to reject every response that returns with a status code that falls out of the range of 2xx and treat it as an error.
+
+```js
+axios.get('/user/12345')
+ .catch(function (error) {
+ if (error.response) {
+ // The request was made and the server responded with a status code
+ // that falls out of the range of 2xx
+ console.log(error.response.data);
+ console.log(error.response.status);
+ console.log(error.response.headers);
+ } else if (error.request) {
+ // The request was made but no response was received
+ // `error.request` is an instance of XMLHttpRequest in the browser and an instance of
+ // http.ClientRequest in node.js
+ console.log(error.request);
+ } else {
+ // Something happened in setting up the request that triggered an Error
+ console.log('Error', error.message);
+ }
+ console.log(error.config);
+ });
+```
+
+Using the `validateStatus` config option, you can override the default condition (status >= 200 && status < 300) and define HTTP code(s) that should throw an error.
+
+```js
+axios.get('/user/12345', {
+ validateStatus: function (status) {
+ return status < 500; // Resolve only if the status code is less than 500
+ }
+})
+```
+
+Using `toJSON` you get an object with more information about the HTTP error.
+
+```js
+axios.get('/user/12345')
+ .catch(function (error) {
+ console.log(error.toJSON());
+ });
+```
+
+## Cancellation
+
+### AbortController
+
+Starting from `v0.22.0` Axios supports AbortController to cancel requests in fetch API way:
+
+```js
+const controller = new AbortController();
+
+axios.get('/foo/bar', {
+ signal: controller.signal
+}).then(function(response) {
+ //...
+});
+// cancel the request
+controller.abort()
+```
+
+### CancelToken `👎deprecated`
+
+You can also cancel a request using a *CancelToken*.
+
+> The axios cancel token API is based on the withdrawn [cancellable promises proposal](https://github.com/tc39/proposal-cancelable-promises).
+
+> This API is deprecated since v0.22.0 and shouldn't be used in new projects
+
+You can create a cancel token using the `CancelToken.source` factory as shown below:
+
+```js
+const CancelToken = axios.CancelToken;
+const source = CancelToken.source();
+
+axios.get('/user/12345', {
+ cancelToken: source.token
+}).catch(function (thrown) {
+ if (axios.isCancel(thrown)) {
+ console.log('Request canceled', thrown.message);
+ } else {
+ // handle error
+ }
+});
+
+axios.post('/user/12345', {
+ name: 'new name'
+}, {
+ cancelToken: source.token
+})
+
+// cancel the request (the message parameter is optional)
+source.cancel('Operation canceled by the user.');
+```
+
+You can also create a cancel token by passing an executor function to the `CancelToken` constructor:
+
+```js
+const CancelToken = axios.CancelToken;
+let cancel;
+
+axios.get('/user/12345', {
+ cancelToken: new CancelToken(function executor(c) {
+ // An executor function receives a cancel function as a parameter
+ cancel = c;
+ })
+});
+
+// cancel the request
+cancel();
+```
+
+> **Note:** you can cancel several requests with the same cancel token/abort controller.
+> If a cancellation token is already cancelled at the moment of starting an Axios request, then the request is cancelled immediately, without any attempts to make a real request.
+
+> During the transition period, you can use both cancellation APIs, even for the same request:
+
+## Using `application/x-www-form-urlencoded` format
+
+### URLSearchParams
+
+By default, axios serializes JavaScript objects to `JSON`. To send data in the [`application/x-www-form-urlencoded` format](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST) instead, you can use the [`URLSearchParams`](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams) API, which is [supported](http://www.caniuse.com/#feat=urlsearchparams) in the vast majority of browsers,and [ Node](https://nodejs.org/api/url.html#url_class_urlsearchparams) starting with v10 (released in 2018).
+
+```js
+const params = new URLSearchParams({ foo: 'bar' });
+params.append('extraparam', 'value');
+axios.post('/foo', params);
+```
+
+### Query string (Older browsers)
+
+For compatibility with very old browsers, there is a [polyfill](https://github.com/WebReflection/url-search-params) available (make sure to polyfill the global environment).
+
+Alternatively, you can encode data using the [`qs`](https://github.com/ljharb/qs) library:
+
+```js
+const qs = require('qs');
+axios.post('/foo', qs.stringify({ 'bar': 123 }));
+```
+
+Or in another way (ES6),
+
+```js
+import qs from 'qs';
+const data = { 'bar': 123 };
+const options = {
+ method: 'POST',
+ headers: { 'content-type': 'application/x-www-form-urlencoded' },
+ data: qs.stringify(data),
+ url,
+};
+axios(options);
+```
+
+### Older Node.js versions
+
+For older Node.js engines, you can use the [`querystring`](https://nodejs.org/api/querystring.html) module as follows:
+
+```js
+const querystring = require('querystring');
+axios.post('https://something.com/', querystring.stringify({ foo: 'bar' }));
+```
+
+You can also use the [`qs`](https://github.com/ljharb/qs) library.
+
+> **Note**: The `qs` library is preferable if you need to stringify nested objects, as the `querystring` method has [known issues](https://github.com/nodejs/node-v0.x-archive/issues/1665) with that use case.
+
+### 🆕 Automatic serialization to URLSearchParams
+
+Axios will automatically serialize the data object to urlencoded format if the content-type header is set to "application/x-www-form-urlencoded".
+
+```js
+const data = {
+ x: 1,
+ arr: [1, 2, 3],
+ arr2: [1, [2], 3],
+ users: [{name: 'Peter', surname: 'Griffin'}, {name: 'Thomas', surname: 'Anderson'}],
+};
+
+await axios.postForm('https://postman-echo.com/post', data,
+ {headers: {'content-type': 'application/x-www-form-urlencoded'}}
+);
+```
+
+The server will handle it as:
+
+```js
+ {
+ x: '1',
+ 'arr[]': [ '1', '2', '3' ],
+ 'arr2[0]': '1',
+ 'arr2[1][0]': '2',
+ 'arr2[2]': '3',
+ 'arr3[]': [ '1', '2', '3' ],
+ 'users[0][name]': 'Peter',
+ 'users[0][surname]': 'griffin',
+ 'users[1][name]': 'Thomas',
+ 'users[1][surname]': 'Anderson'
+ }
+````
+
+If your backend body-parser (like `body-parser` of `express.js`) supports nested objects decoding, you will get the same object on the server-side automatically
+
+```js
+ var app = express();
+
+ app.use(bodyParser.urlencoded({ extended: true })); // support encoded bodies
+
+ app.post('/', function (req, res, next) {
+ // echo body as JSON
+ res.send(JSON.stringify(req.body));
+ });
+
+ server = app.listen(3000);
+```
+
+## Using `multipart/form-data` format
+
+### FormData
+
+To send the data as a `multipart/formdata` you need to pass a formData instance as a payload.
+Setting the `Content-Type` header is not required as Axios guesses it based on the payload type.
+
+```js
+const formData = new FormData();
+formData.append('foo', 'bar');
+
+axios.post('https://httpbin.org/post', formData);
+```
+
+In node.js, you can use the [`form-data`](https://github.com/form-data/form-data) library as follows:
+
+```js
+const FormData = require('form-data');
+
+const form = new FormData();
+form.append('my_field', 'my value');
+form.append('my_buffer', new Buffer(10));
+form.append('my_file', fs.createReadStream('/foo/bar.jpg'));
+
+axios.post('https://example.com', form)
+```
+
+### 🆕 Automatic serialization to FormData
+
+Starting from `v0.27.0`, Axios supports automatic object serialization to a FormData object if the request `Content-Type`
+header is set to `multipart/form-data`.
+
+The following request will submit the data in a FormData format (Browser & Node.js):
+
+```js
+import axios from 'axios';
+
+axios.post('https://httpbin.org/post', {x: 1}, {
+ headers: {
+ 'Content-Type': 'multipart/form-data'
+ }
+}).then(({data}) => console.log(data));
+```
+
+In the `node.js` build, the ([`form-data`](https://github.com/form-data/form-data)) polyfill is used by default.
+
+You can overload the FormData class by setting the `env.FormData` config variable,
+but you probably won't need it in most cases:
+
+```js
+const axios = require('axios');
+var FormData = require('form-data');
+
+axios.post('https://httpbin.org/post', {x: 1, buf: new Buffer(10)}, {
+ headers: {
+ 'Content-Type': 'multipart/form-data'
+ }
+}).then(({data}) => console.log(data));
+```
+
+Axios FormData serializer supports some special endings to perform the following operations:
+
+- `{}` - serialize the value with JSON.stringify
+- `[]` - unwrap the array-like object as separate fields with the same key
+
+> **Note**: unwrap/expand operation will be used by default on arrays and FileList objects
+
+FormData serializer supports additional options via `config.formSerializer: object` property to handle rare cases:
+
+- `visitor: Function` - user-defined visitor function that will be called recursively to serialize the data object
+to a `FormData` object by following custom rules.
+
+- `dots: boolean = false` - use dot notation instead of brackets to serialize arrays and objects;
+
+- `metaTokens: boolean = true` - add the special ending (e.g `user{}: '{"name": "John"}'`) in the FormData key.
+The back-end body-parser could potentially use this meta-information to automatically parse the value as JSON.
+
+- `indexes: null|false|true = false` - controls how indexes will be added to unwrapped keys of `flat` array-like objects
+
+ - `null` - don't add brackets (`arr: 1`, `arr: 2`, `arr: 3`)
+ - `false`(default) - add empty brackets (`arr[]: 1`, `arr[]: 2`, `arr[]: 3`)
+ - `true` - add brackets with indexes (`arr[0]: 1`, `arr[1]: 2`, `arr[2]: 3`)
+
+Let's say we have an object like this one:
+
+```js
+const obj = {
+ x: 1,
+ arr: [1, 2, 3],
+ arr2: [1, [2], 3],
+ users: [{name: 'Peter', surname: 'Griffin'}, {name: 'Thomas', surname: 'Anderson'}],
+ 'obj2{}': [{x:1}]
+};
+```
+
+The following steps will be executed by the Axios serializer internally:
+
+```js
+const formData = new FormData();
+formData.append('x', '1');
+formData.append('arr[]', '1');
+formData.append('arr[]', '2');
+formData.append('arr[]', '3');
+formData.append('arr2[0]', '1');
+formData.append('arr2[1][0]', '2');
+formData.append('arr2[2]', '3');
+formData.append('users[0][name]', 'Peter');
+formData.append('users[0][surname]', 'Griffin');
+formData.append('users[1][name]', 'Thomas');
+formData.append('users[1][surname]', 'Anderson');
+formData.append('obj2{}', '[{"x":1}]');
+```
+
+Axios supports the following shortcut methods: `postForm`, `putForm`, `patchForm`
+which are just the corresponding http methods with the `Content-Type` header preset to `multipart/form-data`.
+
+## Files Posting
+
+You can easily submit a single file:
+
+```js
+await axios.postForm('https://httpbin.org/post', {
+ 'myVar' : 'foo',
+ 'file': document.querySelector('#fileInput').files[0]
+});
+```
+
+or multiple files as `multipart/form-data`:
+
+```js
+await axios.postForm('https://httpbin.org/post', {
+ 'files[]': document.querySelector('#fileInput').files
+});
+```
+
+`FileList` object can be passed directly:
+
+```js
+await axios.postForm('https://httpbin.org/post', document.querySelector('#fileInput').files)
+```
+
+All files will be sent with the same field names: `files[]`.
+
+## 🆕 HTML Form Posting (browser)
+
+Pass HTML Form element as a payload to submit it as `multipart/form-data` content.
+
+```js
+await axios.postForm('https://httpbin.org/post', document.querySelector('#htmlForm'));
+```
+
+`FormData` and `HTMLForm` objects can also be posted as `JSON` by explicitly setting the `Content-Type` header to `application/json`:
+
+```js
+await axios.post('https://httpbin.org/post', document.querySelector('#htmlForm'), {
+ headers: {
+ 'Content-Type': 'application/json'
+ }
+})
+```
+
+For example, the Form
+
+```html
+<form id="form">
+ <input type="text" name="foo" value="1">
+ <input type="text" name="deep.prop" value="2">
+ <input type="text" name="deep prop spaced" value="3">
+ <input type="text" name="baz" value="4">
+ <input type="text" name="baz" value="5">
+
+ <select name="user.age">
+ <option value="value1">Value 1</option>
+ <option value="value2" selected>Value 2</option>
+ <option value="value3">Value 3</option>
+ </select>
+
+ <input type="submit" value="Save">
+</form>
+```
+
+will be submitted as the following JSON object:
+
+```js
+{
+ "foo": "1",
+ "deep": {
+ "prop": {
+ "spaced": "3"
+ }
+ },
+ "baz": [
+ "4",
+ "5"
+ ],
+ "user": {
+ "age": "value2"
+ }
+}
+````
+
+Sending `Blobs`/`Files` as JSON (`base64`) is not currently supported.
+
+## 🆕 Progress capturing
+
+Axios supports both browser and node environments to capture request upload/download progress.
+
+```js
+await axios.post(url, data, {
+ onUploadProgress: function (axiosProgressEvent) {
+ /*{
+ loaded: number;
+ total?: number;
+ progress?: number; // in range [0..1]
+ bytes: number; // how many bytes have been transferred since the last trigger (delta)
+ estimated?: number; // estimated time in seconds
+ rate?: number; // upload speed in bytes
+ upload: true; // upload sign
+ }*/
+ },
+
+ onDownloadProgress: function (axiosProgressEvent) {
+ /*{
+ loaded: number;
+ total?: number;
+ progress?: number;
+ bytes: number;
+ estimated?: number;
+ rate?: number; // download speed in bytes
+ download: true; // download sign
+ }*/
+ }
+});
+```
+
+You can also track stream upload/download progress in node.js:
+
+```js
+const {data} = await axios.post(SERVER_URL, readableStream, {
+ onUploadProgress: ({progress}) => {
+ console.log((progress * 100).toFixed(2));
+ },
+
+ headers: {
+ 'Content-Length': contentLength
+ },
+
+ maxRedirects: 0 // avoid buffering the entire stream
+});
+````
+
+> **Note:**
+> Capturing FormData upload progress is not currently supported in node.js environments.
+
+> **⚠️ Warning**
+> It is recommended to disable redirects by setting maxRedirects: 0 to upload the stream in the **node.js** environment,
+> as follow-redirects package will buffer the entire stream in RAM without following the "backpressure" algorithm.
+
+
+## 🆕 Rate limiting
+
+Download and upload rate limits can only be set for the http adapter (node.js):
+
+```js
+const {data} = await axios.post(LOCAL_SERVER_URL, myBuffer, {
+ onUploadProgress: ({progress, rate}) => {
+ console.log(`Upload [${(progress*100).toFixed(2)}%]: ${(rate / 1024).toFixed(2)}KB/s`)
+ },
+
+ maxRate: [100 * 1024], // 100KB/s limit
+});
+```
+
+## 🆕 AxiosHeaders
+
+Axios has its own `AxiosHeaders` class to manipulate headers using a Map-like API that guarantees caseless work.
+Although HTTP is case-insensitive in headers, Axios will retain the case of the original header for stylistic reasons
+and for a workaround when servers mistakenly consider the header's case.
+The old approach of directly manipulating headers object is still available, but deprecated and not recommended for future usage.
+
+### Working with headers
+
+An AxiosHeaders object instance can contain different types of internal values. that control setting and merging logic.
+The final headers object with string values is obtained by Axios by calling the `toJSON` method.
+
+> Note: By JSON here we mean an object consisting only of string values intended to be sent over the network.
+
+The header value can be one of the following types:
+- `string` - normal string value that will be sent to the server
+- `null` - skip header when rendering to JSON
+- `false` - skip header when rendering to JSON, additionally indicates that `set` method must be called with `rewrite` option set to `true`
+ to overwrite this value (Axios uses this internally to allow users to opt out of installing certain headers like `User-Agent` or `Content-Type`)
+- `undefined` - value is not set
+
+> Note: The header value is considered set if it is not equal to undefined.
+
+The headers object is always initialized inside interceptors and transformers:
+
+```ts
+ axios.interceptors.request.use((request: InternalAxiosRequestConfig) => {
+ request.headers.set('My-header', 'value');
+
+ request.headers.set({
+ "My-set-header1": "my-set-value1",
+ "My-set-header2": "my-set-value2"
+ });
+
+ request.headers.set('User-Agent', false); // disable subsequent setting the header by Axios
+
+ request.headers.setContentType('text/plain');
+
+ request.headers['My-set-header2'] = 'newValue' // direct access is deprecated
+
+ return request;
+ }
+ );
+````
+
+You can iterate over an `AxiosHeaders` instance using a `for...of` statement:
+
+````js
+const headers = new AxiosHeaders({
+ foo: '1',
+ bar: '2',
+ baz: '3'
+});
+
+for(const [header, value] of headers) {
+ console.log(header, value);
+}
+
+// foo 1
+// bar 2
+// baz 3
+````
+
+### new AxiosHeaders(headers?)
+
+Constructs a new `AxiosHeaders` instance.
+
+```
+constructor(headers?: RawAxiosHeaders | AxiosHeaders | string);
+```
+
+If the headers object is a string, it will be parsed as RAW HTTP headers.
+
+````js
+const headers = new AxiosHeaders(`
+Host: www.bing.com
+User-Agent: curl/7.54.0
+Accept: */*`);
+
+console.log(headers);
+
+// Object [AxiosHeaders] {
+// host: 'www.bing.com',
+// 'user-agent': 'curl/7.54.0',
+// accept: '*/*'
+// }
+````
+
+### AxiosHeaders#set
+
+```ts
+set(headerName, value: Axios, rewrite?: boolean);
+set(headerName, value, rewrite?: (this: AxiosHeaders, value: string, name: string, headers: RawAxiosHeaders) => boolean);
+set(headers?: RawAxiosHeaders | AxiosHeaders | string, rewrite?: boolean);
+```
+
+The `rewrite` argument controls the overwriting behavior:
+- `false` - do not overwrite if header's value is set (is not `undefined`)
+- `undefined` (default) - overwrite the header unless its value is set to `false`
+- `true` - rewrite anyway
+
+The option can also accept a user-defined function that determines whether the value should be overwritten or not.
+
+Returns `this`.
+
+### AxiosHeaders#get(header)
+
+```
+ get(headerName: string, matcher?: true | AxiosHeaderMatcher): AxiosHeaderValue;
+ get(headerName: string, parser: RegExp): RegExpExecArray | null;
+````
+
+Returns the internal value of the header. It can take an extra argument to parse the header's value with `RegExp.exec`,
+matcher function or internal key-value parser.
+
+```ts
+const headers = new AxiosHeaders({
+ 'Content-Type': 'multipart/form-data; boundary=Asrf456BGe4h'
+});
+
+console.log(headers.get('Content-Type'));
+// multipart/form-data; boundary=Asrf456BGe4h
+
+console.log(headers.get('Content-Type', true)); // parse key-value pairs from a string separated with \s,;= delimiters:
+// [Object: null prototype] {
+// 'multipart/form-data': undefined,
+// boundary: 'Asrf456BGe4h'
+// }
+
+
+console.log(headers.get('Content-Type', (value, name, headers) => {
+ return String(value).replace(/a/g, 'ZZZ');
+}));
+// multipZZZrt/form-dZZZtZZZ; boundZZZry=Asrf456BGe4h
+
+console.log(headers.get('Content-Type', /boundary=(\w+)/)?.[0]);
+// boundary=Asrf456BGe4h
+
+```
+
+Returns the value of the header.
+
+### AxiosHeaders#has(header, matcher?)
+
+```
+has(header: string, matcher?: AxiosHeaderMatcher): boolean;
+```
+
+Returns `true` if the header is set (has no `undefined` value).
+
+### AxiosHeaders#delete(header, matcher?)
+
+```
+delete(header: string | string[], matcher?: AxiosHeaderMatcher): boolean;
+```
+
+Returns `true` if at least one header has been removed.
+
+### AxiosHeaders#clear(matcher?)
+
+```
+clear(matcher?: AxiosHeaderMatcher): boolean;
+```
+
+Removes all headers.
+Unlike the `delete` method matcher, this optional matcher will be used to match against the header name rather than the value.
+
+```ts
+const headers = new AxiosHeaders({
+ 'foo': '1',
+ 'x-foo': '2',
+ 'x-bar': '3',
+});
+
+console.log(headers.clear(/^x-/)); // true
+
+console.log(headers.toJSON()); // [Object: null prototype] { foo: '1' }
+```
+
+Returns `true` if at least one header has been cleared.
+
+### AxiosHeaders#normalize(format);
+
+If the headers object was changed directly, it can have duplicates with the same name but in different cases.
+This method normalizes the headers object by combining duplicate keys into one.
+Axios uses this method internally after calling each interceptor.
+Set `format` to true for converting headers name to lowercase and capitalize the initial letters (`cOntEnt-type` => `Content-Type`)
+
+```js
+const headers = new AxiosHeaders({
+ 'foo': '1',
+});
+
+headers.Foo = '2';
+headers.FOO = '3';
+
+console.log(headers.toJSON()); // [Object: null prototype] { foo: '1', Foo: '2', FOO: '3' }
+console.log(headers.normalize().toJSON()); // [Object: null prototype] { foo: '3' }
+console.log(headers.normalize(true).toJSON()); // [Object: null prototype] { Foo: '3' }
+```
+
+Returns `this`.
+
+### AxiosHeaders#concat(...targets)
+
+```
+concat(...targets: Array<AxiosHeaders | RawAxiosHeaders | string | undefined | null>): AxiosHeaders;
+```
+
+Merges the instance with targets into a new `AxiosHeaders` instance. If the target is a string, it will be parsed as RAW HTTP headers.
+
+Returns a new `AxiosHeaders` instance.
+
+### AxiosHeaders#toJSON(asStrings?)
+
+````
+toJSON(asStrings?: boolean): RawAxiosHeaders;
+````
+
+Resolve all internal headers values into a new null prototype object.
+Set `asStrings` to true to resolve arrays as a string containing all elements, separated by commas.
+
+### AxiosHeaders.from(thing?)
+
+````
+from(thing?: AxiosHeaders | RawAxiosHeaders | string): AxiosHeaders;
+````
+
+Returns a new `AxiosHeaders` instance created from the raw headers passed in,
+or simply returns the given headers object if it's an `AxiosHeaders` instance.
+
+### AxiosHeaders.concat(...targets)
+
+````
+concat(...targets: Array<AxiosHeaders | RawAxiosHeaders | string | undefined | null>): AxiosHeaders;
+````
+
+Returns a new `AxiosHeaders` instance created by merging the target objects.
+
+### Shortcuts
+
+The following shortcuts are available:
+
+- `setContentType`, `getContentType`, `hasContentType`
+
+- `setContentLength`, `getContentLength`, `hasContentLength`
+
+- `setAccept`, `getAccept`, `hasAccept`
+
+- `setUserAgent`, `getUserAgent`, `hasUserAgent`
+
+- `setContentEncoding`, `getContentEncoding`, `hasContentEncoding`
+
+
+## Semver
+
+Until axios reaches a `1.0` release, breaking changes will be released with a new minor version. For example `0.5.1`, and `0.5.4` will have the same API, but `0.6.0` will have breaking changes.
+
+## Promises
+
+axios depends on a native ES6 Promise implementation to be [supported](https://caniuse.com/promises).
+If your environment doesn't support ES6 Promises, you can [polyfill](https://github.com/jakearchibald/es6-promise).
+
+## TypeScript
+
+axios includes [TypeScript](https://typescriptlang.org) definitions and a type guard for axios errors.
+
+```typescript
+let user: User = null;
+try {
+ const { data } = await axios.get('/user?ID=12345');
+ user = data.userDetails;
+} catch (error) {
+ if (axios.isAxiosError(error)) {
+ handleAxiosError(error);
+ } else {
+ handleUnexpectedError(error);
+ }
+}
+```
+
+Because axios dual publishes with an ESM default export and a CJS `module.exports`, there are some caveats.
+The recommended setting is to use `"moduleResolution": "node16"` (this is implied by `"module": "node16"`). Note that this requires TypeScript 4.7 or greater.
+If use ESM, your settings should be fine.
+If you compile TypeScript to CJS and you can’t use `"moduleResolution": "node 16"`, you have to enable `esModuleInterop`.
+If you use TypeScript to type check CJS JavaScript code, your only option is to use `"moduleResolution": "node16"`.
+
+## Online one-click setup
+
+You can use Gitpod, an online IDE(which is free for Open Source) for contributing or running the examples online.
+
+[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/axios/axios/blob/main/examples/server.js)
+
+
+## Resources
+
+* [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
+* [Ecosystem](https://github.com/axios/axios/blob/v1.x/ECOSYSTEM.md)
+* [Contributing Guide](https://github.com/axios/axios/blob/v1.x/CONTRIBUTING.md)
+* [Code of Conduct](https://github.com/axios/axios/blob/v1.x/CODE_OF_CONDUCT.md)
+
+## Credits
+
+axios is heavily inspired by the [$http service](https://docs.angularjs.org/api/ng/service/$http) provided in [AngularJS](https://angularjs.org/). Ultimately axios is an effort to provide a standalone `$http`-like service for use outside of AngularJS.
+
+## License
+
+[MIT](LICENSE)
diff --git a/node_modules/axios/SECURITY.md b/node_modules/axios/SECURITY.md
new file mode 100644
index 0000000..a5a2b7d
--- /dev/null
+++ b/node_modules/axios/SECURITY.md
@@ -0,0 +1,6 @@
+# Reporting a Vulnerability
+
+If you discover a security vulnerability in axios please disclose it via [our huntr page](https://huntr.dev/repos/axios/axios/). Bounty eligibility, CVE assignment, response times and past reports are all there.
+
+
+Thank you for improving the security of axios.
diff --git a/node_modules/axios/dist/axios.js b/node_modules/axios/dist/axios.js
new file mode 100644
index 0000000..24a83e5
--- /dev/null
+++ b/node_modules/axios/dist/axios.js
@@ -0,0 +1,3422 @@
+// Axios v1.6.7 Copyright (c) 2024 Matt Zabriskie and contributors
+(function (global, factory) {
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
+ typeof define === 'function' && define.amd ? define(factory) :
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.axios = factory());
+})(this, (function () { 'use strict';
+
+ function ownKeys(object, enumerableOnly) {
+ var keys = Object.keys(object);
+ if (Object.getOwnPropertySymbols) {
+ var symbols = Object.getOwnPropertySymbols(object);
+ enumerableOnly && (symbols = symbols.filter(function (sym) {
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
+ })), keys.push.apply(keys, symbols);
+ }
+ return keys;
+ }
+ function _objectSpread2(target) {
+ for (var i = 1; i < arguments.length; i++) {
+ var source = null != arguments[i] ? arguments[i] : {};
+ i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
+ _defineProperty(target, key, source[key]);
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
+ });
+ }
+ return target;
+ }
+ function _regeneratorRuntime() {
+ _regeneratorRuntime = function () {
+ return exports;
+ };
+ var exports = {},
+ Op = Object.prototype,
+ hasOwn = Op.hasOwnProperty,
+ $Symbol = "function" == typeof Symbol ? Symbol : {},
+ iteratorSymbol = $Symbol.iterator || "@@iterator",
+ asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
+ toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
+ function define(obj, key, value) {
+ return Object.defineProperty(obj, key, {
+ value: value,
+ enumerable: !0,
+ configurable: !0,
+ writable: !0
+ }), obj[key];
+ }
+ try {
+ define({}, "");
+ } catch (err) {
+ define = function (obj, key, value) {
+ return obj[key] = value;
+ };
+ }
+ function wrap(innerFn, outerFn, self, tryLocsList) {
+ var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
+ generator = Object.create(protoGenerator.prototype),
+ context = new Context(tryLocsList || []);
+ return generator._invoke = function (innerFn, self, context) {
+ var state = "suspendedStart";
+ return function (method, arg) {
+ if ("executing" === state) throw new Error("Generator is already running");
+ if ("completed" === state) {
+ if ("throw" === method) throw arg;
+ return doneResult();
+ }
+ for (context.method = method, context.arg = arg;;) {
+ var delegate = context.delegate;
+ if (delegate) {
+ var delegateResult = maybeInvokeDelegate(delegate, context);
+ if (delegateResult) {
+ if (delegateResult === ContinueSentinel) continue;
+ return delegateResult;
+ }
+ }
+ if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
+ if ("suspendedStart" === state) throw state = "completed", context.arg;
+ context.dispatchException(context.arg);
+ } else "return" === context.method && context.abrupt("return", context.arg);
+ state = "executing";
+ var record = tryCatch(innerFn, self, context);
+ if ("normal" === record.type) {
+ if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
+ return {
+ value: record.arg,
+ done: context.done
+ };
+ }
+ "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
+ }
+ };
+ }(innerFn, self, context), generator;
+ }
+ function tryCatch(fn, obj, arg) {
+ try {
+ return {
+ type: "normal",
+ arg: fn.call(obj, arg)
+ };
+ } catch (err) {
+ return {
+ type: "throw",
+ arg: err
+ };
+ }
+ }
+ exports.wrap = wrap;
+ var ContinueSentinel = {};
+ function Generator() {}
+ function GeneratorFunction() {}
+ function GeneratorFunctionPrototype() {}
+ var IteratorPrototype = {};
+ define(IteratorPrototype, iteratorSymbol, function () {
+ return this;
+ });
+ var getProto = Object.getPrototypeOf,
+ NativeIteratorPrototype = getProto && getProto(getProto(values([])));
+ NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
+ var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
+ function defineIteratorMethods(prototype) {
+ ["next", "throw", "return"].forEach(function (method) {
+ define(prototype, method, function (arg) {
+ return this._invoke(method, arg);
+ });
+ });
+ }
+ function AsyncIterator(generator, PromiseImpl) {
+ function invoke(method, arg, resolve, reject) {
+ var record = tryCatch(generator[method], generator, arg);
+ if ("throw" !== record.type) {
+ var result = record.arg,
+ value = result.value;
+ return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
+ invoke("next", value, resolve, reject);
+ }, function (err) {
+ invoke("throw", err, resolve, reject);
+ }) : PromiseImpl.resolve(value).then(function (unwrapped) {
+ result.value = unwrapped, resolve(result);
+ }, function (error) {
+ return invoke("throw", error, resolve, reject);
+ });
+ }
+ reject(record.arg);
+ }
+ var previousPromise;
+ this._invoke = function (method, arg) {
+ function callInvokeWithMethodAndArg() {
+ return new PromiseImpl(function (resolve, reject) {
+ invoke(method, arg, resolve, reject);
+ });
+ }
+ return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
+ };
+ }
+ function maybeInvokeDelegate(delegate, context) {
+ var method = delegate.iterator[context.method];
+ if (undefined === method) {
+ if (context.delegate = null, "throw" === context.method) {
+ if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
+ context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
+ }
+ return ContinueSentinel;
+ }
+ var record = tryCatch(method, delegate.iterator, context.arg);
+ if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
+ var info = record.arg;
+ return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
+ }
+ function pushTryEntry(locs) {
+ var entry = {
+ tryLoc: locs[0]
+ };
+ 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
+ }
+ function resetTryEntry(entry) {
+ var record = entry.completion || {};
+ record.type = "normal", delete record.arg, entry.completion = record;
+ }
+ function Context(tryLocsList) {
+ this.tryEntries = [{
+ tryLoc: "root"
+ }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
+ }
+ function values(iterable) {
+ if (iterable) {
+ var iteratorMethod = iterable[iteratorSymbol];
+ if (iteratorMethod) return iteratorMethod.call(iterable);
+ if ("function" == typeof iterable.next) return iterable;
+ if (!isNaN(iterable.length)) {
+ var i = -1,
+ next = function next() {
+ for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
+ return next.value = undefined, next.done = !0, next;
+ };
+ return next.next = next;
+ }
+ }
+ return {
+ next: doneResult
+ };
+ }
+ function doneResult() {
+ return {
+ value: undefined,
+ done: !0
+ };
+ }
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
+ var ctor = "function" == typeof genFun && genFun.constructor;
+ return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
+ }, exports.mark = function (genFun) {
+ return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
+ }, exports.awrap = function (arg) {
+ return {
+ __await: arg
+ };
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
+ return this;
+ }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
+ void 0 === PromiseImpl && (PromiseImpl = Promise);
+ var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
+ return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
+ return result.done ? result.value : iter.next();
+ });
+ }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
+ return this;
+ }), define(Gp, "toString", function () {
+ return "[object Generator]";
+ }), exports.keys = function (object) {
+ var keys = [];
+ for (var key in object) keys.push(key);
+ return keys.reverse(), function next() {
+ for (; keys.length;) {
+ var key = keys.pop();
+ if (key in object) return next.value = key, next.done = !1, next;
+ }
+ return next.done = !0, next;
+ };
+ }, exports.values = values, Context.prototype = {
+ constructor: Context,
+ reset: function (skipTempReset) {
+ if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
+ },
+ stop: function () {
+ this.done = !0;
+ var rootRecord = this.tryEntries[0].completion;
+ if ("throw" === rootRecord.type) throw rootRecord.arg;
+ return this.rval;
+ },
+ dispatchException: function (exception) {
+ if (this.done) throw exception;
+ var context = this;
+ function handle(loc, caught) {
+ return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
+ }
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
+ var entry = this.tryEntries[i],
+ record = entry.completion;
+ if ("root" === entry.tryLoc) return handle("end");
+ if (entry.tryLoc <= this.prev) {
+ var hasCatch = hasOwn.call(entry, "catchLoc"),
+ hasFinally = hasOwn.call(entry, "finallyLoc");
+ if (hasCatch && hasFinally) {
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
+ } else if (hasCatch) {
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
+ } else {
+ if (!hasFinally) throw new Error("try statement without catch or finally");
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
+ }
+ }
+ }
+ },
+ abrupt: function (type, arg) {
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
+ var entry = this.tryEntries[i];
+ if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
+ var finallyEntry = entry;
+ break;
+ }
+ }
+ finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
+ var record = finallyEntry ? finallyEntry.completion : {};
+ return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
+ },
+ complete: function (record, afterLoc) {
+ if ("throw" === record.type) throw record.arg;
+ return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
+ },
+ finish: function (finallyLoc) {
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
+ var entry = this.tryEntries[i];
+ if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
+ }
+ },
+ catch: function (tryLoc) {
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
+ var entry = this.tryEntries[i];
+ if (entry.tryLoc === tryLoc) {
+ var record = entry.completion;
+ if ("throw" === record.type) {
+ var thrown = record.arg;
+ resetTryEntry(entry);
+ }
+ return thrown;
+ }
+ }
+ throw new Error("illegal catch attempt");
+ },
+ delegateYield: function (iterable, resultName, nextLoc) {
+ return this.delegate = {
+ iterator: values(iterable),
+ resultName: resultName,
+ nextLoc: nextLoc
+ }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
+ }
+ }, exports;
+ }
+ function _typeof(obj) {
+ "@babel/helpers - typeof";
+
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
+ return typeof obj;
+ } : function (obj) {
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
+ }, _typeof(obj);
+ }
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
+ try {
+ var info = gen[key](arg);
+ var value = info.value;
+ } catch (error) {
+ reject(error);
+ return;
+ }
+ if (info.done) {
+ resolve(value);
+ } else {
+ Promise.resolve(value).then(_next, _throw);
+ }
+ }
+ function _asyncToGenerator(fn) {
+ return function () {
+ var self = this,
+ args = arguments;
+ return new Promise(function (resolve, reject) {
+ var gen = fn.apply(self, args);
+ function _next(value) {
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
+ }
+ function _throw(err) {
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
+ }
+ _next(undefined);
+ });
+ };
+ }
+ function _classCallCheck(instance, Constructor) {
+ if (!(instance instanceof Constructor)) {
+ throw new TypeError("Cannot call a class as a function");
+ }
+ }
+ function _defineProperties(target, props) {
+ for (var i = 0; i < props.length; i++) {
+ var descriptor = props[i];
+ descriptor.enumerable = descriptor.enumerable || false;
+ descriptor.configurable = true;
+ if ("value" in descriptor) descriptor.writable = true;
+ Object.defineProperty(target, descriptor.key, descriptor);
+ }
+ }
+ function _createClass(Constructor, protoProps, staticProps) {
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
+ if (staticProps) _defineProperties(Constructor, staticProps);
+ Object.defineProperty(Constructor, "prototype", {
+ writable: false
+ });
+ return Constructor;
+ }
+ function _defineProperty(obj, key, value) {
+ if (key in obj) {
+ Object.defineProperty(obj, key, {
+ value: value,
+ enumerable: true,
+ configurable: true,
+ writable: true
+ });
+ } else {
+ obj[key] = value;
+ }
+ return obj;
+ }
+ function _slicedToArray(arr, i) {
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
+ }
+ function _toArray(arr) {
+ return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest();
+ }
+ function _toConsumableArray(arr) {
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
+ }
+ function _arrayWithoutHoles(arr) {
+ if (Array.isArray(arr)) return _arrayLikeToArray(arr);
+ }
+ function _arrayWithHoles(arr) {
+ if (Array.isArray(arr)) return arr;
+ }
+ function _iterableToArray(iter) {
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
+ }
+ function _iterableToArrayLimit(arr, i) {
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
+ if (_i == null) return;
+ var _arr = [];
+ var _n = true;
+ var _d = false;
+ var _s, _e;
+ try {
+ for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
+ _arr.push(_s.value);
+ if (i && _arr.length === i) break;
+ }
+ } catch (err) {
+ _d = true;
+ _e = err;
+ } finally {
+ try {
+ if (!_n && _i["return"] != null) _i["return"]();
+ } finally {
+ if (_d) throw _e;
+ }
+ }
+ return _arr;
+ }
+ function _unsupportedIterableToArray(o, minLen) {
+ if (!o) return;
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
+ var n = Object.prototype.toString.call(o).slice(8, -1);
+ if (n === "Object" && o.constructor) n = o.constructor.name;
+ if (n === "Map" || n === "Set") return Array.from(o);
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
+ }
+ function _arrayLikeToArray(arr, len) {
+ if (len == null || len > arr.length) len = arr.length;
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
+ return arr2;
+ }
+ function _nonIterableSpread() {
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
+ }
+ function _nonIterableRest() {
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
+ }
+
+ function bind(fn, thisArg) {
+ return function wrap() {
+ return fn.apply(thisArg, arguments);
+ };
+ }
+
+ // utils is a library of generic helper functions non-specific to axios
+
+ var toString = Object.prototype.toString;
+ var getPrototypeOf = Object.getPrototypeOf;
+ var kindOf = function (cache) {
+ return function (thing) {
+ var str = toString.call(thing);
+ return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
+ };
+ }(Object.create(null));
+ var kindOfTest = function kindOfTest(type) {
+ type = type.toLowerCase();
+ return function (thing) {
+ return kindOf(thing) === type;
+ };
+ };
+ var typeOfTest = function typeOfTest(type) {
+ return function (thing) {
+ return _typeof(thing) === type;
+ };
+ };
+
+ /**
+ * Determine if a value is an Array
+ *
+ * @param {Object} val The value to test
+ *
+ * @returns {boolean} True if value is an Array, otherwise false
+ */
+ var isArray = Array.isArray;
+
+ /**
+ * Determine if a value is undefined
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if the value is undefined, otherwise false
+ */
+ var isUndefined = typeOfTest('undefined');
+
+ /**
+ * Determine if a value is a Buffer
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a Buffer, otherwise false
+ */
+ function isBuffer(val) {
+ return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);
+ }
+
+ /**
+ * Determine if a value is an ArrayBuffer
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is an ArrayBuffer, otherwise false
+ */
+ var isArrayBuffer = kindOfTest('ArrayBuffer');
+
+ /**
+ * Determine if a value is a view on an ArrayBuffer
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
+ */
+ function isArrayBufferView(val) {
+ var result;
+ if (typeof ArrayBuffer !== 'undefined' && ArrayBuffer.isView) {
+ result = ArrayBuffer.isView(val);
+ } else {
+ result = val && val.buffer && isArrayBuffer(val.buffer);
+ }
+ return result;
+ }
+
+ /**
+ * Determine if a value is a String
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a String, otherwise false
+ */
+ var isString = typeOfTest('string');
+
+ /**
+ * Determine if a value is a Function
+ *
+ * @param {*} val The value to test
+ * @returns {boolean} True if value is a Function, otherwise false
+ */
+ var isFunction = typeOfTest('function');
+
+ /**
+ * Determine if a value is a Number
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a Number, otherwise false
+ */
+ var isNumber = typeOfTest('number');
+
+ /**
+ * Determine if a value is an Object
+ *
+ * @param {*} thing The value to test
+ *
+ * @returns {boolean} True if value is an Object, otherwise false
+ */
+ var isObject = function isObject(thing) {
+ return thing !== null && _typeof(thing) === 'object';
+ };
+
+ /**
+ * Determine if a value is a Boolean
+ *
+ * @param {*} thing The value to test
+ * @returns {boolean} True if value is a Boolean, otherwise false
+ */
+ var isBoolean = function isBoolean(thing) {
+ return thing === true || thing === false;
+ };
+
+ /**
+ * Determine if a value is a plain Object
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a plain Object, otherwise false
+ */
+ var isPlainObject = function isPlainObject(val) {
+ if (kindOf(val) !== 'object') {
+ return false;
+ }
+ var prototype = getPrototypeOf(val);
+ return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);
+ };
+
+ /**
+ * Determine if a value is a Date
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a Date, otherwise false
+ */
+ var isDate = kindOfTest('Date');
+
+ /**
+ * Determine if a value is a File
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a File, otherwise false
+ */
+ var isFile = kindOfTest('File');
+
+ /**
+ * Determine if a value is a Blob
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a Blob, otherwise false
+ */
+ var isBlob = kindOfTest('Blob');
+
+ /**
+ * Determine if a value is a FileList
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a File, otherwise false
+ */
+ var isFileList = kindOfTest('FileList');
+
+ /**
+ * Determine if a value is a Stream
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a Stream, otherwise false
+ */
+ var isStream = function isStream(val) {
+ return isObject(val) && isFunction(val.pipe);
+ };
+
+ /**
+ * Determine if a value is a FormData
+ *
+ * @param {*} thing The value to test
+ *
+ * @returns {boolean} True if value is an FormData, otherwise false
+ */
+ var isFormData = function isFormData(thing) {
+ var kind;
+ return thing && (typeof FormData === 'function' && thing instanceof FormData || isFunction(thing.append) && ((kind = kindOf(thing)) === 'formdata' ||
+ // detect form-data instance
+ kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]'));
+ };
+
+ /**
+ * Determine if a value is a URLSearchParams object
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a URLSearchParams object, otherwise false
+ */
+ var isURLSearchParams = kindOfTest('URLSearchParams');
+
+ /**
+ * Trim excess whitespace off the beginning and end of a string
+ *
+ * @param {String} str The String to trim
+ *
+ * @returns {String} The String freed of excess whitespace
+ */
+ var trim = function trim(str) {
+ return str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
+ };
+
+ /**
+ * Iterate over an Array or an Object invoking a function for each item.
+ *
+ * If `obj` is an Array callback will be called passing
+ * the value, index, and complete array for each item.
+ *
+ * If 'obj' is an Object callback will be called passing
+ * the value, key, and complete object for each property.
+ *
+ * @param {Object|Array} obj The object to iterate
+ * @param {Function} fn The callback to invoke for each item
+ *
+ * @param {Boolean} [allOwnKeys = false]
+ * @returns {any}
+ */
+ function forEach(obj, fn) {
+ var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
+ _ref$allOwnKeys = _ref.allOwnKeys,
+ allOwnKeys = _ref$allOwnKeys === void 0 ? false : _ref$allOwnKeys;
+ // Don't bother if no value provided
+ if (obj === null || typeof obj === 'undefined') {
+ return;
+ }
+ var i;
+ var l;
+
+ // Force an array if not already something iterable
+ if (_typeof(obj) !== 'object') {
+ /*eslint no-param-reassign:0*/
+ obj = [obj];
+ }
+ if (isArray(obj)) {
+ // Iterate over array values
+ for (i = 0, l = obj.length; i < l; i++) {
+ fn.call(null, obj[i], i, obj);
+ }
+ } else {
+ // Iterate over object keys
+ var keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
+ var len = keys.length;
+ var key;
+ for (i = 0; i < len; i++) {
+ key = keys[i];
+ fn.call(null, obj[key], key, obj);
+ }
+ }
+ }
+ function findKey(obj, key) {
+ key = key.toLowerCase();
+ var keys = Object.keys(obj);
+ var i = keys.length;
+ var _key;
+ while (i-- > 0) {
+ _key = keys[i];
+ if (key === _key.toLowerCase()) {
+ return _key;
+ }
+ }
+ return null;
+ }
+ var _global = function () {
+ /*eslint no-undef:0*/
+ if (typeof globalThis !== "undefined") return globalThis;
+ return typeof self !== "undefined" ? self : typeof window !== 'undefined' ? window : global;
+ }();
+ var isContextDefined = function isContextDefined(context) {
+ return !isUndefined(context) && context !== _global;
+ };
+
+ /**
+ * Accepts varargs expecting each argument to be an object, then
+ * immutably merges the properties of each object and returns result.
+ *
+ * When multiple objects contain the same key the later object in
+ * the arguments list will take precedence.
+ *
+ * Example:
+ *
+ * ```js
+ * var result = merge({foo: 123}, {foo: 456});
+ * console.log(result.foo); // outputs 456
+ * ```
+ *
+ * @param {Object} obj1 Object to merge
+ *
+ * @returns {Object} Result of all merge properties
+ */
+ function /* obj1, obj2, obj3, ... */
+ merge() {
+ var _ref2 = isContextDefined(this) && this || {},
+ caseless = _ref2.caseless;
+ var result = {};
+ var assignValue = function assignValue(val, key) {
+ var targetKey = caseless && findKey(result, key) || key;
+ if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
+ result[targetKey] = merge(result[targetKey], val);
+ } else if (isPlainObject(val)) {
+ result[targetKey] = merge({}, val);
+ } else if (isArray(val)) {
+ result[targetKey] = val.slice();
+ } else {
+ result[targetKey] = val;
+ }
+ };
+ for (var i = 0, l = arguments.length; i < l; i++) {
+ arguments[i] && forEach(arguments[i], assignValue);
+ }
+ return result;
+ }
+
+ /**
+ * Extends object a by mutably adding to it the properties of object b.
+ *
+ * @param {Object} a The object to be extended
+ * @param {Object} b The object to copy properties from
+ * @param {Object} thisArg The object to bind function to
+ *
+ * @param {Boolean} [allOwnKeys]
+ * @returns {Object} The resulting value of object a
+ */
+ var extend = function extend(a, b, thisArg) {
+ var _ref3 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},
+ allOwnKeys = _ref3.allOwnKeys;
+ forEach(b, function (val, key) {
+ if (thisArg && isFunction(val)) {
+ a[key] = bind(val, thisArg);
+ } else {
+ a[key] = val;
+ }
+ }, {
+ allOwnKeys: allOwnKeys
+ });
+ return a;
+ };
+
+ /**
+ * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
+ *
+ * @param {string} content with BOM
+ *
+ * @returns {string} content value without BOM
+ */
+ var stripBOM = function stripBOM(content) {
+ if (content.charCodeAt(0) === 0xFEFF) {
+ content = content.slice(1);
+ }
+ return content;
+ };
+
+ /**
+ * Inherit the prototype methods from one constructor into another
+ * @param {function} constructor
+ * @param {function} superConstructor
+ * @param {object} [props]
+ * @param {object} [descriptors]
+ *
+ * @returns {void}
+ */
+ var inherits = function inherits(constructor, superConstructor, props, descriptors) {
+ constructor.prototype = Object.create(superConstructor.prototype, descriptors);
+ constructor.prototype.constructor = constructor;
+ Object.defineProperty(constructor, 'super', {
+ value: superConstructor.prototype
+ });
+ props && Object.assign(constructor.prototype, props);
+ };
+
+ /**
+ * Resolve object with deep prototype chain to a flat object
+ * @param {Object} sourceObj source object
+ * @param {Object} [destObj]
+ * @param {Function|Boolean} [filter]
+ * @param {Function} [propFilter]
+ *
+ * @returns {Object}
+ */
+ var toFlatObject = function toFlatObject(sourceObj, destObj, filter, propFilter) {
+ var props;
+ var i;
+ var prop;
+ var merged = {};
+ destObj = destObj || {};
+ // eslint-disable-next-line no-eq-null,eqeqeq
+ if (sourceObj == null) return destObj;
+ do {
+ props = Object.getOwnPropertyNames(sourceObj);
+ i = props.length;
+ while (i-- > 0) {
+ prop = props[i];
+ if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
+ destObj[prop] = sourceObj[prop];
+ merged[prop] = true;
+ }
+ }
+ sourceObj = filter !== false && getPrototypeOf(sourceObj);
+ } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
+ return destObj;
+ };
+
+ /**
+ * Determines whether a string ends with the characters of a specified string
+ *
+ * @param {String} str
+ * @param {String} searchString
+ * @param {Number} [position= 0]
+ *
+ * @returns {boolean}
+ */
+ var endsWith = function endsWith(str, searchString, position) {
+ str = String(str);
+ if (position === undefined || position > str.length) {
+ position = str.length;
+ }
+ position -= searchString.length;
+ var lastIndex = str.indexOf(searchString, position);
+ return lastIndex !== -1 && lastIndex === position;
+ };
+
+ /**
+ * Returns new array from array like object or null if failed
+ *
+ * @param {*} [thing]
+ *
+ * @returns {?Array}
+ */
+ var toArray = function toArray(thing) {
+ if (!thing) return null;
+ if (isArray(thing)) return thing;
+ var i = thing.length;
+ if (!isNumber(i)) return null;
+ var arr = new Array(i);
+ while (i-- > 0) {
+ arr[i] = thing[i];
+ }
+ return arr;
+ };
+
+ /**
+ * Checking if the Uint8Array exists and if it does, it returns a function that checks if the
+ * thing passed in is an instance of Uint8Array
+ *
+ * @param {TypedArray}
+ *
+ * @returns {Array}
+ */
+ // eslint-disable-next-line func-names
+ var isTypedArray = function (TypedArray) {
+ // eslint-disable-next-line func-names
+ return function (thing) {
+ return TypedArray && thing instanceof TypedArray;
+ };
+ }(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));
+
+ /**
+ * For each entry in the object, call the function with the key and value.
+ *
+ * @param {Object<any, any>} obj - The object to iterate over.
+ * @param {Function} fn - The function to call for each entry.
+ *
+ * @returns {void}
+ */
+ var forEachEntry = function forEachEntry(obj, fn) {
+ var generator = obj && obj[Symbol.iterator];
+ var iterator = generator.call(obj);
+ var result;
+ while ((result = iterator.next()) && !result.done) {
+ var pair = result.value;
+ fn.call(obj, pair[0], pair[1]);
+ }
+ };
+
+ /**
+ * It takes a regular expression and a string, and returns an array of all the matches
+ *
+ * @param {string} regExp - The regular expression to match against.
+ * @param {string} str - The string to search.
+ *
+ * @returns {Array<boolean>}
+ */
+ var matchAll = function matchAll(regExp, str) {
+ var matches;
+ var arr = [];
+ while ((matches = regExp.exec(str)) !== null) {
+ arr.push(matches);
+ }
+ return arr;
+ };
+
+ /* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */
+ var isHTMLForm = kindOfTest('HTMLFormElement');
+ var toCamelCase = function toCamelCase(str) {
+ return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function replacer(m, p1, p2) {
+ return p1.toUpperCase() + p2;
+ });
+ };
+
+ /* Creating a function that will check if an object has a property. */
+ var hasOwnProperty = function (_ref4) {
+ var hasOwnProperty = _ref4.hasOwnProperty;
+ return function (obj, prop) {
+ return hasOwnProperty.call(obj, prop);
+ };
+ }(Object.prototype);
+
+ /**
+ * Determine if a value is a RegExp object
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a RegExp object, otherwise false
+ */
+ var isRegExp = kindOfTest('RegExp');
+ var reduceDescriptors = function reduceDescriptors(obj, reducer) {
+ var descriptors = Object.getOwnPropertyDescriptors(obj);
+ var reducedDescriptors = {};
+ forEach(descriptors, function (descriptor, name) {
+ var ret;
+ if ((ret = reducer(descriptor, name, obj)) !== false) {
+ reducedDescriptors[name] = ret || descriptor;
+ }
+ });
+ Object.defineProperties(obj, reducedDescriptors);
+ };
+
+ /**
+ * Makes all methods read-only
+ * @param {Object} obj
+ */
+
+ var freezeMethods = function freezeMethods(obj) {
+ reduceDescriptors(obj, function (descriptor, name) {
+ // skip restricted props in strict mode
+ if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {
+ return false;
+ }
+ var value = obj[name];
+ if (!isFunction(value)) return;
+ descriptor.enumerable = false;
+ if ('writable' in descriptor) {
+ descriptor.writable = false;
+ return;
+ }
+ if (!descriptor.set) {
+ descriptor.set = function () {
+ throw Error('Can not rewrite read-only method \'' + name + '\'');
+ };
+ }
+ });
+ };
+ var toObjectSet = function toObjectSet(arrayOrString, delimiter) {
+ var obj = {};
+ var define = function define(arr) {
+ arr.forEach(function (value) {
+ obj[value] = true;
+ });
+ };
+ isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
+ return obj;
+ };
+ var noop = function noop() {};
+ var toFiniteNumber = function toFiniteNumber(value, defaultValue) {
+ value = +value;
+ return Number.isFinite(value) ? value : defaultValue;
+ };
+ var ALPHA = 'abcdefghijklmnopqrstuvwxyz';
+ var DIGIT = '0123456789';
+ var ALPHABET = {
+ DIGIT: DIGIT,
+ ALPHA: ALPHA,
+ ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
+ };
+ var generateString = function generateString() {
+ var size = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 16;
+ var alphabet = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ALPHABET.ALPHA_DIGIT;
+ var str = '';
+ var length = alphabet.length;
+ while (size--) {
+ str += alphabet[Math.random() * length | 0];
+ }
+ return str;
+ };
+
+ /**
+ * If the thing is a FormData object, return true, otherwise return false.
+ *
+ * @param {unknown} thing - The thing to check.
+ *
+ * @returns {boolean}
+ */
+ function isSpecCompliantForm(thing) {
+ return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]);
+ }
+ var toJSONObject = function toJSONObject(obj) {
+ var stack = new Array(10);
+ var visit = function visit(source, i) {
+ if (isObject(source)) {
+ if (stack.indexOf(source) >= 0) {
+ return;
+ }
+ if (!('toJSON' in source)) {
+ stack[i] = source;
+ var target = isArray(source) ? [] : {};
+ forEach(source, function (value, key) {
+ var reducedValue = visit(value, i + 1);
+ !isUndefined(reducedValue) && (target[key] = reducedValue);
+ });
+ stack[i] = undefined;
+ return target;
+ }
+ }
+ return source;
+ };
+ return visit(obj, 0);
+ };
+ var isAsyncFn = kindOfTest('AsyncFunction');
+ var isThenable = function isThenable(thing) {
+ return thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing["catch"]);
+ };
+ var utils$1 = {
+ isArray: isArray,
+ isArrayBuffer: isArrayBuffer,
+ isBuffer: isBuffer,
+ isFormData: isFormData,
+ isArrayBufferView: isArrayBufferView,
+ isString: isString,
+ isNumber: isNumber,
+ isBoolean: isBoolean,
+ isObject: isObject,
+ isPlainObject: isPlainObject,
+ isUndefined: isUndefined,
+ isDate: isDate,
+ isFile: isFile,
+ isBlob: isBlob,
+ isRegExp: isRegExp,
+ isFunction: isFunction,
+ isStream: isStream,
+ isURLSearchParams: isURLSearchParams,
+ isTypedArray: isTypedArray,
+ isFileList: isFileList,
+ forEach: forEach,
+ merge: merge,
+ extend: extend,
+ trim: trim,
+ stripBOM: stripBOM,
+ inherits: inherits,
+ toFlatObject: toFlatObject,
+ kindOf: kindOf,
+ kindOfTest: kindOfTest,
+ endsWith: endsWith,
+ toArray: toArray,
+ forEachEntry: forEachEntry,
+ matchAll: matchAll,
+ isHTMLForm: isHTMLForm,
+ hasOwnProperty: hasOwnProperty,
+ hasOwnProp: hasOwnProperty,
+ // an alias to avoid ESLint no-prototype-builtins detection
+ reduceDescriptors: reduceDescriptors,
+ freezeMethods: freezeMethods,
+ toObjectSet: toObjectSet,
+ toCamelCase: toCamelCase,
+ noop: noop,
+ toFiniteNumber: toFiniteNumber,
+ findKey: findKey,
+ global: _global,
+ isContextDefined: isContextDefined,
+ ALPHABET: ALPHABET,
+ generateString: generateString,
+ isSpecCompliantForm: isSpecCompliantForm,
+ toJSONObject: toJSONObject,
+ isAsyncFn: isAsyncFn,
+ isThenable: isThenable
+ };
+
+ /**
+ * Create an Error with the specified message, config, error code, request and response.
+ *
+ * @param {string} message The error message.
+ * @param {string} [code] The error code (for example, 'ECONNABORTED').
+ * @param {Object} [config] The config.
+ * @param {Object} [request] The request.
+ * @param {Object} [response] The response.
+ *
+ * @returns {Error} The created error.
+ */
+ function AxiosError(message, code, config, request, response) {
+ Error.call(this);
+ if (Error.captureStackTrace) {
+ Error.captureStackTrace(this, this.constructor);
+ } else {
+ this.stack = new Error().stack;
+ }
+ this.message = message;
+ this.name = 'AxiosError';
+ code && (this.code = code);
+ config && (this.config = config);
+ request && (this.request = request);
+ response && (this.response = response);
+ }
+ utils$1.inherits(AxiosError, Error, {
+ toJSON: function toJSON() {
+ return {
+ // Standard
+ message: this.message,
+ name: this.name,
+ // Microsoft
+ description: this.description,
+ number: this.number,
+ // Mozilla
+ fileName: this.fileName,
+ lineNumber: this.lineNumber,
+ columnNumber: this.columnNumber,
+ stack: this.stack,
+ // Axios
+ config: utils$1.toJSONObject(this.config),
+ code: this.code,
+ status: this.response && this.response.status ? this.response.status : null
+ };
+ }
+ });
+ var prototype$1 = AxiosError.prototype;
+ var descriptors = {};
+ ['ERR_BAD_OPTION_VALUE', 'ERR_BAD_OPTION', 'ECONNABORTED', 'ETIMEDOUT', 'ERR_NETWORK', 'ERR_FR_TOO_MANY_REDIRECTS', 'ERR_DEPRECATED', 'ERR_BAD_RESPONSE', 'ERR_BAD_REQUEST', 'ERR_CANCELED', 'ERR_NOT_SUPPORT', 'ERR_INVALID_URL'
+ // eslint-disable-next-line func-names
+ ].forEach(function (code) {
+ descriptors[code] = {
+ value: code
+ };
+ });
+ Object.defineProperties(AxiosError, descriptors);
+ Object.defineProperty(prototype$1, 'isAxiosError', {
+ value: true
+ });
+
+ // eslint-disable-next-line func-names
+ AxiosError.from = function (error, code, config, request, response, customProps) {
+ var axiosError = Object.create(prototype$1);
+ utils$1.toFlatObject(error, axiosError, function filter(obj) {
+ return obj !== Error.prototype;
+ }, function (prop) {
+ return prop !== 'isAxiosError';
+ });
+ AxiosError.call(axiosError, error.message, code, config, request, response);
+ axiosError.cause = error;
+ axiosError.name = error.name;
+ customProps && Object.assign(axiosError, customProps);
+ return axiosError;
+ };
+
+ // eslint-disable-next-line strict
+ var httpAdapter = null;
+
+ /**
+ * Determines if the given thing is a array or js object.
+ *
+ * @param {string} thing - The object or array to be visited.
+ *
+ * @returns {boolean}
+ */
+ function isVisitable(thing) {
+ return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
+ }
+
+ /**
+ * It removes the brackets from the end of a string
+ *
+ * @param {string} key - The key of the parameter.
+ *
+ * @returns {string} the key without the brackets.
+ */
+ function removeBrackets(key) {
+ return utils$1.endsWith(key, '[]') ? key.slice(0, -2) : key;
+ }
+
+ /**
+ * It takes a path, a key, and a boolean, and returns a string
+ *
+ * @param {string} path - The path to the current key.
+ * @param {string} key - The key of the current object being iterated over.
+ * @param {string} dots - If true, the key will be rendered with dots instead of brackets.
+ *
+ * @returns {string} The path to the current key.
+ */
+ function renderKey(path, key, dots) {
+ if (!path) return key;
+ return path.concat(key).map(function each(token, i) {
+ // eslint-disable-next-line no-param-reassign
+ token = removeBrackets(token);
+ return !dots && i ? '[' + token + ']' : token;
+ }).join(dots ? '.' : '');
+ }
+
+ /**
+ * If the array is an array and none of its elements are visitable, then it's a flat array.
+ *
+ * @param {Array<any>} arr - The array to check
+ *
+ * @returns {boolean}
+ */
+ function isFlatArray(arr) {
+ return utils$1.isArray(arr) && !arr.some(isVisitable);
+ }
+ var predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {
+ return /^is[A-Z]/.test(prop);
+ });
+
+ /**
+ * Convert a data object to FormData
+ *
+ * @param {Object} obj
+ * @param {?Object} [formData]
+ * @param {?Object} [options]
+ * @param {Function} [options.visitor]
+ * @param {Boolean} [options.metaTokens = true]
+ * @param {Boolean} [options.dots = false]
+ * @param {?Boolean} [options.indexes = false]
+ *
+ * @returns {Object}
+ **/
+
+ /**
+ * It converts an object into a FormData object
+ *
+ * @param {Object<any, any>} obj - The object to convert to form data.
+ * @param {string} formData - The FormData object to append to.
+ * @param {Object<string, any>} options
+ *
+ * @returns
+ */
+ function toFormData(obj, formData, options) {
+ if (!utils$1.isObject(obj)) {
+ throw new TypeError('target must be an object');
+ }
+
+ // eslint-disable-next-line no-param-reassign
+ formData = formData || new (FormData)();
+
+ // eslint-disable-next-line no-param-reassign
+ options = utils$1.toFlatObject(options, {
+ metaTokens: true,
+ dots: false,
+ indexes: false
+ }, false, function defined(option, source) {
+ // eslint-disable-next-line no-eq-null,eqeqeq
+ return !utils$1.isUndefined(source[option]);
+ });
+ var metaTokens = options.metaTokens;
+ // eslint-disable-next-line no-use-before-define
+ var visitor = options.visitor || defaultVisitor;
+ var dots = options.dots;
+ var indexes = options.indexes;
+ var _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;
+ var useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
+ if (!utils$1.isFunction(visitor)) {
+ throw new TypeError('visitor must be a function');
+ }
+ function convertValue(value) {
+ if (value === null) return '';
+ if (utils$1.isDate(value)) {
+ return value.toISOString();
+ }
+ if (!useBlob && utils$1.isBlob(value)) {
+ throw new AxiosError('Blob is not supported. Use a Buffer instead.');
+ }
+ if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
+ return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
+ }
+ return value;
+ }
+
+ /**
+ * Default visitor.
+ *
+ * @param {*} value
+ * @param {String|Number} key
+ * @param {Array<String|Number>} path
+ * @this {FormData}
+ *
+ * @returns {boolean} return true to visit the each prop of the value recursively
+ */
+ function defaultVisitor(value, key, path) {
+ var arr = value;
+ if (value && !path && _typeof(value) === 'object') {
+ if (utils$1.endsWith(key, '{}')) {
+ // eslint-disable-next-line no-param-reassign
+ key = metaTokens ? key : key.slice(0, -2);
+ // eslint-disable-next-line no-param-reassign
+ value = JSON.stringify(value);
+ } else if (utils$1.isArray(value) && isFlatArray(value) || (utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value))) {
+ // eslint-disable-next-line no-param-reassign
+ key = removeBrackets(key);
+ arr.forEach(function each(el, index) {
+ !(utils$1.isUndefined(el) || el === null) && formData.append(
+ // eslint-disable-next-line no-nested-ternary
+ indexes === true ? renderKey([key], index, dots) : indexes === null ? key : key + '[]', convertValue(el));
+ });
+ return false;
+ }
+ }
+ if (isVisitable(value)) {
+ return true;
+ }
+ formData.append(renderKey(path, key, dots), convertValue(value));
+ return false;
+ }
+ var stack = [];
+ var exposedHelpers = Object.assign(predicates, {
+ defaultVisitor: defaultVisitor,
+ convertValue: convertValue,
+ isVisitable: isVisitable
+ });
+ function build(value, path) {
+ if (utils$1.isUndefined(value)) return;
+ if (stack.indexOf(value) !== -1) {
+ throw Error('Circular reference detected in ' + path.join('.'));
+ }
+ stack.push(value);
+ utils$1.forEach(value, function each(el, key) {
+ var result = !(utils$1.isUndefined(el) || el === null) && visitor.call(formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers);
+ if (result === true) {
+ build(el, path ? path.concat(key) : [key]);
+ }
+ });
+ stack.pop();
+ }
+ if (!utils$1.isObject(obj)) {
+ throw new TypeError('data must be an object');
+ }
+ build(obj);
+ return formData;
+ }
+
+ /**
+ * It encodes a string by replacing all characters that are not in the unreserved set with
+ * their percent-encoded equivalents
+ *
+ * @param {string} str - The string to encode.
+ *
+ * @returns {string} The encoded string.
+ */
+ function encode$1(str) {
+ var charMap = {
+ '!': '%21',
+ "'": '%27',
+ '(': '%28',
+ ')': '%29',
+ '~': '%7E',
+ '%20': '+',
+ '%00': '\x00'
+ };
+ return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {
+ return charMap[match];
+ });
+ }
+
+ /**
+ * It takes a params object and converts it to a FormData object
+ *
+ * @param {Object<string, any>} params - The parameters to be converted to a FormData object.
+ * @param {Object<string, any>} options - The options object passed to the Axios constructor.
+ *
+ * @returns {void}
+ */
+ function AxiosURLSearchParams(params, options) {
+ this._pairs = [];
+ params && toFormData(params, this, options);
+ }
+ var prototype = AxiosURLSearchParams.prototype;
+ prototype.append = function append(name, value) {
+ this._pairs.push([name, value]);
+ };
+ prototype.toString = function toString(encoder) {
+ var _encode = encoder ? function (value) {
+ return encoder.call(this, value, encode$1);
+ } : encode$1;
+ return this._pairs.map(function each(pair) {
+ return _encode(pair[0]) + '=' + _encode(pair[1]);
+ }, '').join('&');
+ };
+
+ /**
+ * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their
+ * URI encoded counterparts
+ *
+ * @param {string} val The value to be encoded.
+ *
+ * @returns {string} The encoded value.
+ */
+ function encode(val) {
+ return encodeURIComponent(val).replace(/%3A/gi, ':').replace(/%24/g, '$').replace(/%2C/gi, ',').replace(/%20/g, '+').replace(/%5B/gi, '[').replace(/%5D/gi, ']');
+ }
+
+ /**
+ * Build a URL by appending params to the end
+ *
+ * @param {string} url The base of the url (e.g., http://www.google.com)
+ * @param {object} [params] The params to be appended
+ * @param {?object} options
+ *
+ * @returns {string} The formatted url
+ */
+ function buildURL(url, params, options) {
+ /*eslint no-param-reassign:0*/
+ if (!params) {
+ return url;
+ }
+ var _encode = options && options.encode || encode;
+ var serializeFn = options && options.serialize;
+ var serializedParams;
+ if (serializeFn) {
+ serializedParams = serializeFn(params, options);
+ } else {
+ serializedParams = utils$1.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams(params, options).toString(_encode);
+ }
+ if (serializedParams) {
+ var hashmarkIndex = url.indexOf("#");
+ if (hashmarkIndex !== -1) {
+ url = url.slice(0, hashmarkIndex);
+ }
+ url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
+ }
+ return url;
+ }
+
+ var InterceptorManager = /*#__PURE__*/function () {
+ function InterceptorManager() {
+ _classCallCheck(this, InterceptorManager);
+ this.handlers = [];
+ }
+
+ /**
+ * Add a new interceptor to the stack
+ *
+ * @param {Function} fulfilled The function to handle `then` for a `Promise`
+ * @param {Function} rejected The function to handle `reject` for a `Promise`
+ *
+ * @return {Number} An ID used to remove interceptor later
+ */
+ _createClass(InterceptorManager, [{
+ key: "use",
+ value: function use(fulfilled, rejected, options) {
+ this.handlers.push({
+ fulfilled: fulfilled,
+ rejected: rejected,
+ synchronous: options ? options.synchronous : false,
+ runWhen: options ? options.runWhen : null
+ });
+ return this.handlers.length - 1;
+ }
+
+ /**
+ * Remove an interceptor from the stack
+ *
+ * @param {Number} id The ID that was returned by `use`
+ *
+ * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
+ */
+ }, {
+ key: "eject",
+ value: function eject(id) {
+ if (this.handlers[id]) {
+ this.handlers[id] = null;
+ }
+ }
+
+ /**
+ * Clear all interceptors from the stack
+ *
+ * @returns {void}
+ */
+ }, {
+ key: "clear",
+ value: function clear() {
+ if (this.handlers) {
+ this.handlers = [];
+ }
+ }
+
+ /**
+ * Iterate over all the registered interceptors
+ *
+ * This method is particularly useful for skipping over any
+ * interceptors that may have become `null` calling `eject`.
+ *
+ * @param {Function} fn The function to call for each interceptor
+ *
+ * @returns {void}
+ */
+ }, {
+ key: "forEach",
+ value: function forEach(fn) {
+ utils$1.forEach(this.handlers, function forEachHandler(h) {
+ if (h !== null) {
+ fn(h);
+ }
+ });
+ }
+ }]);
+ return InterceptorManager;
+ }();
+ var InterceptorManager$1 = InterceptorManager;
+
+ var transitionalDefaults = {
+ silentJSONParsing: true,
+ forcedJSONParsing: true,
+ clarifyTimeoutError: false
+ };
+
+ var URLSearchParams$1 = typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;
+
+ var FormData$1 = typeof FormData !== 'undefined' ? FormData : null;
+
+ var Blob$1 = typeof Blob !== 'undefined' ? Blob : null;
+
+ var platform$1 = {
+ isBrowser: true,
+ classes: {
+ URLSearchParams: URLSearchParams$1,
+ FormData: FormData$1,
+ Blob: Blob$1
+ },
+ protocols: ['http', 'https', 'file', 'blob', 'url', 'data']
+ };
+
+ var hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
+
+ /**
+ * Determine if we're running in a standard browser environment
+ *
+ * This allows axios to run in a web worker, and react-native.
+ * Both environments support XMLHttpRequest, but not fully standard globals.
+ *
+ * web workers:
+ * typeof window -> undefined
+ * typeof document -> undefined
+ *
+ * react-native:
+ * navigator.product -> 'ReactNative'
+ * nativescript
+ * navigator.product -> 'NativeScript' or 'NS'
+ *
+ * @returns {boolean}
+ */
+ var hasStandardBrowserEnv = function (product) {
+ return hasBrowserEnv && ['ReactNative', 'NativeScript', 'NS'].indexOf(product) < 0;
+ }(typeof navigator !== 'undefined' && navigator.product);
+
+ /**
+ * Determine if we're running in a standard browser webWorker environment
+ *
+ * Although the `isStandardBrowserEnv` method indicates that
+ * `allows axios to run in a web worker`, the WebWorker will still be
+ * filtered out due to its judgment standard
+ * `typeof window !== 'undefined' && typeof document !== 'undefined'`.
+ * This leads to a problem when axios post `FormData` in webWorker
+ */
+ var hasStandardBrowserWebWorkerEnv = function () {
+ return typeof WorkerGlobalScope !== 'undefined' &&
+ // eslint-disable-next-line no-undef
+ self instanceof WorkerGlobalScope && typeof self.importScripts === 'function';
+ }();
+
+ var utils = /*#__PURE__*/Object.freeze({
+ __proto__: null,
+ hasBrowserEnv: hasBrowserEnv,
+ hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
+ hasStandardBrowserEnv: hasStandardBrowserEnv
+ });
+
+ var platform = _objectSpread2(_objectSpread2({}, utils), platform$1);
+
+ function toURLEncodedForm(data, options) {
+ return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({
+ visitor: function visitor(value, key, path, helpers) {
+ if (platform.isNode && utils$1.isBuffer(value)) {
+ this.append(key, value.toString('base64'));
+ return false;
+ }
+ return helpers.defaultVisitor.apply(this, arguments);
+ }
+ }, options));
+ }
+
+ /**
+ * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']
+ *
+ * @param {string} name - The name of the property to get.
+ *
+ * @returns An array of strings.
+ */
+ function parsePropPath(name) {
+ // foo[x][y][z]
+ // foo.x.y.z
+ // foo-x-y-z
+ // foo x y z
+ return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map(function (match) {
+ return match[0] === '[]' ? '' : match[1] || match[0];
+ });
+ }
+
+ /**
+ * Convert an array to an object.
+ *
+ * @param {Array<any>} arr - The array to convert to an object.
+ *
+ * @returns An object with the same keys and values as the array.
+ */
+ function arrayToObject(arr) {
+ var obj = {};
+ var keys = Object.keys(arr);
+ var i;
+ var len = keys.length;
+ var key;
+ for (i = 0; i < len; i++) {
+ key = keys[i];
+ obj[key] = arr[key];
+ }
+ return obj;
+ }
+
+ /**
+ * It takes a FormData object and returns a JavaScript object
+ *
+ * @param {string} formData The FormData object to convert to JSON.
+ *
+ * @returns {Object<string, any> | null} The converted object.
+ */
+ function formDataToJSON(formData) {
+ function buildPath(path, value, target, index) {
+ var name = path[index++];
+ if (name === '__proto__') return true;
+ var isNumericKey = Number.isFinite(+name);
+ var isLast = index >= path.length;
+ name = !name && utils$1.isArray(target) ? target.length : name;
+ if (isLast) {
+ if (utils$1.hasOwnProp(target, name)) {
+ target[name] = [target[name], value];
+ } else {
+ target[name] = value;
+ }
+ return !isNumericKey;
+ }
+ if (!target[name] || !utils$1.isObject(target[name])) {
+ target[name] = [];
+ }
+ var result = buildPath(path, value, target[name], index);
+ if (result && utils$1.isArray(target[name])) {
+ target[name] = arrayToObject(target[name]);
+ }
+ return !isNumericKey;
+ }
+ if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
+ var obj = {};
+ utils$1.forEachEntry(formData, function (name, value) {
+ buildPath(parsePropPath(name), value, obj, 0);
+ });
+ return obj;
+ }
+ return null;
+ }
+
+ /**
+ * It takes a string, tries to parse it, and if it fails, it returns the stringified version
+ * of the input
+ *
+ * @param {any} rawValue - The value to be stringified.
+ * @param {Function} parser - A function that parses a string into a JavaScript object.
+ * @param {Function} encoder - A function that takes a value and returns a string.
+ *
+ * @returns {string} A stringified version of the rawValue.
+ */
+ function stringifySafely(rawValue, parser, encoder) {
+ if (utils$1.isString(rawValue)) {
+ try {
+ (parser || JSON.parse)(rawValue);
+ return utils$1.trim(rawValue);
+ } catch (e) {
+ if (e.name !== 'SyntaxError') {
+ throw e;
+ }
+ }
+ }
+ return (encoder || JSON.stringify)(rawValue);
+ }
+ var defaults = {
+ transitional: transitionalDefaults,
+ adapter: ['xhr', 'http'],
+ transformRequest: [function transformRequest(data, headers) {
+ var contentType = headers.getContentType() || '';
+ var hasJSONContentType = contentType.indexOf('application/json') > -1;
+ var isObjectPayload = utils$1.isObject(data);
+ if (isObjectPayload && utils$1.isHTMLForm(data)) {
+ data = new FormData(data);
+ }
+ var isFormData = utils$1.isFormData(data);
+ if (isFormData) {
+ return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
+ }
+ if (utils$1.isArrayBuffer(data) || utils$1.isBuffer(data) || utils$1.isStream(data) || utils$1.isFile(data) || utils$1.isBlob(data)) {
+ return data;
+ }
+ if (utils$1.isArrayBufferView(data)) {
+ return data.buffer;
+ }
+ if (utils$1.isURLSearchParams(data)) {
+ headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
+ return data.toString();
+ }
+ var isFileList;
+ if (isObjectPayload) {
+ if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {
+ return toURLEncodedForm(data, this.formSerializer).toString();
+ }
+ if ((isFileList = utils$1.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {
+ var _FormData = this.env && this.env.FormData;
+ return toFormData(isFileList ? {
+ 'files[]': data
+ } : data, _FormData && new _FormData(), this.formSerializer);
+ }
+ }
+ if (isObjectPayload || hasJSONContentType) {
+ headers.setContentType('application/json', false);
+ return stringifySafely(data);
+ }
+ return data;
+ }],
+ transformResponse: [function transformResponse(data) {
+ var transitional = this.transitional || defaults.transitional;
+ var forcedJSONParsing = transitional && transitional.forcedJSONParsing;
+ var JSONRequested = this.responseType === 'json';
+ if (data && utils$1.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) {
+ var silentJSONParsing = transitional && transitional.silentJSONParsing;
+ var strictJSONParsing = !silentJSONParsing && JSONRequested;
+ try {
+ return JSON.parse(data);
+ } catch (e) {
+ if (strictJSONParsing) {
+ if (e.name === 'SyntaxError') {
+ throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);
+ }
+ throw e;
+ }
+ }
+ }
+ return data;
+ }],
+ /**
+ * A timeout in milliseconds to abort a request. If set to 0 (default) a
+ * timeout is not created.
+ */
+ timeout: 0,
+ xsrfCookieName: 'XSRF-TOKEN',
+ xsrfHeaderName: 'X-XSRF-TOKEN',
+ maxContentLength: -1,
+ maxBodyLength: -1,
+ env: {
+ FormData: platform.classes.FormData,
+ Blob: platform.classes.Blob
+ },
+ validateStatus: function validateStatus(status) {
+ return status >= 200 && status < 300;
+ },
+ headers: {
+ common: {
+ 'Accept': 'application/json, text/plain, */*',
+ 'Content-Type': undefined
+ }
+ }
+ };
+ utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], function (method) {
+ defaults.headers[method] = {};
+ });
+ var defaults$1 = defaults;
+
+ // RawAxiosHeaders whose duplicates are ignored by node
+ // c.f. https://nodejs.org/api/http.html#http_message_headers
+ var ignoreDuplicateOf = utils$1.toObjectSet(['age', 'authorization', 'content-length', 'content-type', 'etag', 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', 'last-modified', 'location', 'max-forwards', 'proxy-authorization', 'referer', 'retry-after', 'user-agent']);
+
+ /**
+ * Parse headers into an object
+ *
+ * ```
+ * Date: Wed, 27 Aug 2014 08:58:49 GMT
+ * Content-Type: application/json
+ * Connection: keep-alive
+ * Transfer-Encoding: chunked
+ * ```
+ *
+ * @param {String} rawHeaders Headers needing to be parsed
+ *
+ * @returns {Object} Headers parsed into an object
+ */
+ var parseHeaders = (function (rawHeaders) {
+ var parsed = {};
+ var key;
+ var val;
+ var i;
+ rawHeaders && rawHeaders.split('\n').forEach(function parser(line) {
+ i = line.indexOf(':');
+ key = line.substring(0, i).trim().toLowerCase();
+ val = line.substring(i + 1).trim();
+ if (!key || parsed[key] && ignoreDuplicateOf[key]) {
+ return;
+ }
+ if (key === 'set-cookie') {
+ if (parsed[key]) {
+ parsed[key].push(val);
+ } else {
+ parsed[key] = [val];
+ }
+ } else {
+ parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
+ }
+ });
+ return parsed;
+ });
+
+ var $internals = Symbol('internals');
+ function normalizeHeader(header) {
+ return header && String(header).trim().toLowerCase();
+ }
+ function normalizeValue(value) {
+ if (value === false || value == null) {
+ return value;
+ }
+ return utils$1.isArray(value) ? value.map(normalizeValue) : String(value);
+ }
+ function parseTokens(str) {
+ var tokens = Object.create(null);
+ var tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
+ var match;
+ while (match = tokensRE.exec(str)) {
+ tokens[match[1]] = match[2];
+ }
+ return tokens;
+ }
+ var isValidHeaderName = function isValidHeaderName(str) {
+ return /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
+ };
+ function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
+ if (utils$1.isFunction(filter)) {
+ return filter.call(this, value, header);
+ }
+ if (isHeaderNameFilter) {
+ value = header;
+ }
+ if (!utils$1.isString(value)) return;
+ if (utils$1.isString(filter)) {
+ return value.indexOf(filter) !== -1;
+ }
+ if (utils$1.isRegExp(filter)) {
+ return filter.test(value);
+ }
+ }
+ function formatHeader(header) {
+ return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, function (w, _char, str) {
+ return _char.toUpperCase() + str;
+ });
+ }
+ function buildAccessors(obj, header) {
+ var accessorName = utils$1.toCamelCase(' ' + header);
+ ['get', 'set', 'has'].forEach(function (methodName) {
+ Object.defineProperty(obj, methodName + accessorName, {
+ value: function value(arg1, arg2, arg3) {
+ return this[methodName].call(this, header, arg1, arg2, arg3);
+ },
+ configurable: true
+ });
+ });
+ }
+ var AxiosHeaders = /*#__PURE__*/function (_Symbol$iterator, _Symbol$toStringTag) {
+ function AxiosHeaders(headers) {
+ _classCallCheck(this, AxiosHeaders);
+ headers && this.set(headers);
+ }
+ _createClass(AxiosHeaders, [{
+ key: "set",
+ value: function set(header, valueOrRewrite, rewrite) {
+ var self = this;
+ function setHeader(_value, _header, _rewrite) {
+ var lHeader = normalizeHeader(_header);
+ if (!lHeader) {
+ throw new Error('header name must be a non-empty string');
+ }
+ var key = utils$1.findKey(self, lHeader);
+ if (!key || self[key] === undefined || _rewrite === true || _rewrite === undefined && self[key] !== false) {
+ self[key || _header] = normalizeValue(_value);
+ }
+ }
+ var setHeaders = function setHeaders(headers, _rewrite) {
+ return utils$1.forEach(headers, function (_value, _header) {
+ return setHeader(_value, _header, _rewrite);
+ });
+ };
+ if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
+ setHeaders(header, valueOrRewrite);
+ } else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
+ setHeaders(parseHeaders(header), valueOrRewrite);
+ } else {
+ header != null && setHeader(valueOrRewrite, header, rewrite);
+ }
+ return this;
+ }
+ }, {
+ key: "get",
+ value: function get(header, parser) {
+ header = normalizeHeader(header);
+ if (header) {
+ var key = utils$1.findKey(this, header);
+ if (key) {
+ var value = this[key];
+ if (!parser) {
+ return value;
+ }
+ if (parser === true) {
+ return parseTokens(value);
+ }
+ if (utils$1.isFunction(parser)) {
+ return parser.call(this, value, key);
+ }
+ if (utils$1.isRegExp(parser)) {
+ return parser.exec(value);
+ }
+ throw new TypeError('parser must be boolean|regexp|function');
+ }
+ }
+ }
+ }, {
+ key: "has",
+ value: function has(header, matcher) {
+ header = normalizeHeader(header);
+ if (header) {
+ var key = utils$1.findKey(this, header);
+ return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
+ }
+ return false;
+ }
+ }, {
+ key: "delete",
+ value: function _delete(header, matcher) {
+ var self = this;
+ var deleted = false;
+ function deleteHeader(_header) {
+ _header = normalizeHeader(_header);
+ if (_header) {
+ var key = utils$1.findKey(self, _header);
+ if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {
+ delete self[key];
+ deleted = true;
+ }
+ }
+ }
+ if (utils$1.isArray(header)) {
+ header.forEach(deleteHeader);
+ } else {
+ deleteHeader(header);
+ }
+ return deleted;
+ }
+ }, {
+ key: "clear",
+ value: function clear(matcher) {
+ var keys = Object.keys(this);
+ var i = keys.length;
+ var deleted = false;
+ while (i--) {
+ var key = keys[i];
+ if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
+ delete this[key];
+ deleted = true;
+ }
+ }
+ return deleted;
+ }
+ }, {
+ key: "normalize",
+ value: function normalize(format) {
+ var self = this;
+ var headers = {};
+ utils$1.forEach(this, function (value, header) {
+ var key = utils$1.findKey(headers, header);
+ if (key) {
+ self[key] = normalizeValue(value);
+ delete self[header];
+ return;
+ }
+ var normalized = format ? formatHeader(header) : String(header).trim();
+ if (normalized !== header) {
+ delete self[header];
+ }
+ self[normalized] = normalizeValue(value);
+ headers[normalized] = true;
+ });
+ return this;
+ }
+ }, {
+ key: "concat",
+ value: function concat() {
+ var _this$constructor;
+ for (var _len = arguments.length, targets = new Array(_len), _key = 0; _key < _len; _key++) {
+ targets[_key] = arguments[_key];
+ }
+ return (_this$constructor = this.constructor).concat.apply(_this$constructor, [this].concat(targets));
+ }
+ }, {
+ key: "toJSON",
+ value: function toJSON(asStrings) {
+ var obj = Object.create(null);
+ utils$1.forEach(this, function (value, header) {
+ value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value);
+ });
+ return obj;
+ }
+ }, {
+ key: _Symbol$iterator,
+ value: function value() {
+ return Object.entries(this.toJSON())[Symbol.iterator]();
+ }
+ }, {
+ key: "toString",
+ value: function toString() {
+ return Object.entries(this.toJSON()).map(function (_ref) {
+ var _ref2 = _slicedToArray(_ref, 2),
+ header = _ref2[0],
+ value = _ref2[1];
+ return header + ': ' + value;
+ }).join('\n');
+ }
+ }, {
+ key: _Symbol$toStringTag,
+ get: function get() {
+ return 'AxiosHeaders';
+ }
+ }], [{
+ key: "from",
+ value: function from(thing) {
+ return thing instanceof this ? thing : new this(thing);
+ }
+ }, {
+ key: "concat",
+ value: function concat(first) {
+ var computed = new this(first);
+ for (var _len2 = arguments.length, targets = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
+ targets[_key2 - 1] = arguments[_key2];
+ }
+ targets.forEach(function (target) {
+ return computed.set(target);
+ });
+ return computed;
+ }
+ }, {
+ key: "accessor",
+ value: function accessor(header) {
+ var internals = this[$internals] = this[$internals] = {
+ accessors: {}
+ };
+ var accessors = internals.accessors;
+ var prototype = this.prototype;
+ function defineAccessor(_header) {
+ var lHeader = normalizeHeader(_header);
+ if (!accessors[lHeader]) {
+ buildAccessors(prototype, _header);
+ accessors[lHeader] = true;
+ }
+ }
+ utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
+ return this;
+ }
+ }]);
+ return AxiosHeaders;
+ }(Symbol.iterator, Symbol.toStringTag);
+ AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
+
+ // reserved names hotfix
+ utils$1.reduceDescriptors(AxiosHeaders.prototype, function (_ref3, key) {
+ var value = _ref3.value;
+ var mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
+ return {
+ get: function get() {
+ return value;
+ },
+ set: function set(headerValue) {
+ this[mapped] = headerValue;
+ }
+ };
+ });
+ utils$1.freezeMethods(AxiosHeaders);
+ var AxiosHeaders$1 = AxiosHeaders;
+
+ /**
+ * Transform the data for a request or a response
+ *
+ * @param {Array|Function} fns A single function or Array of functions
+ * @param {?Object} response The response object
+ *
+ * @returns {*} The resulting transformed data
+ */
+ function transformData(fns, response) {
+ var config = this || defaults$1;
+ var context = response || config;
+ var headers = AxiosHeaders$1.from(context.headers);
+ var data = context.data;
+ utils$1.forEach(fns, function transform(fn) {
+ data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);
+ });
+ headers.normalize();
+ return data;
+ }
+
+ function isCancel(value) {
+ return !!(value && value.__CANCEL__);
+ }
+
+ /**
+ * A `CanceledError` is an object that is thrown when an operation is canceled.
+ *
+ * @param {string=} message The message.
+ * @param {Object=} config The config.
+ * @param {Object=} request The request.
+ *
+ * @returns {CanceledError} The created error.
+ */
+ function CanceledError(message, config, request) {
+ // eslint-disable-next-line no-eq-null,eqeqeq
+ AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);
+ this.name = 'CanceledError';
+ }
+ utils$1.inherits(CanceledError, AxiosError, {
+ __CANCEL__: true
+ });
+
+ /**
+ * Resolve or reject a Promise based on response status.
+ *
+ * @param {Function} resolve A function that resolves the promise.
+ * @param {Function} reject A function that rejects the promise.
+ * @param {object} response The response.
+ *
+ * @returns {object} The response.
+ */
+ function settle(resolve, reject, response) {
+ var validateStatus = response.config.validateStatus;
+ if (!response.status || !validateStatus || validateStatus(response.status)) {
+ resolve(response);
+ } else {
+ reject(new AxiosError('Request failed with status code ' + response.status, [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], response.config, response.request, response));
+ }
+ }
+
+ var cookies = platform.hasStandardBrowserEnv ?
+ // Standard browser envs support document.cookie
+ {
+ write: function write(name, value, expires, path, domain, secure) {
+ var cookie = [name + '=' + encodeURIComponent(value)];
+ utils$1.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());
+ utils$1.isString(path) && cookie.push('path=' + path);
+ utils$1.isString(domain) && cookie.push('domain=' + domain);
+ secure === true && cookie.push('secure');
+ document.cookie = cookie.join('; ');
+ },
+ read: function read(name) {
+ var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
+ return match ? decodeURIComponent(match[3]) : null;
+ },
+ remove: function remove(name) {
+ this.write(name, '', Date.now() - 86400000);
+ }
+ } :
+ // Non-standard browser env (web workers, react-native) lack needed support.
+ {
+ write: function write() {},
+ read: function read() {
+ return null;
+ },
+ remove: function remove() {}
+ };
+
+ /**
+ * Determines whether the specified URL is absolute
+ *
+ * @param {string} url The URL to test
+ *
+ * @returns {boolean} True if the specified URL is absolute, otherwise false
+ */
+ function isAbsoluteURL(url) {
+ // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
+ // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
+ // by any combination of letters, digits, plus, period, or hyphen.
+ return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
+ }
+
+ /**
+ * Creates a new URL by combining the specified URLs
+ *
+ * @param {string} baseURL The base URL
+ * @param {string} relativeURL The relative URL
+ *
+ * @returns {string} The combined URL
+ */
+ function combineURLs(baseURL, relativeURL) {
+ return relativeURL ? baseURL.replace(/\/?\/$/, '') + '/' + relativeURL.replace(/^\/+/, '') : baseURL;
+ }
+
+ /**
+ * Creates a new URL by combining the baseURL with the requestedURL,
+ * only when the requestedURL is not already an absolute URL.
+ * If the requestURL is absolute, this function returns the requestedURL untouched.
+ *
+ * @param {string} baseURL The base URL
+ * @param {string} requestedURL Absolute or relative URL to combine
+ *
+ * @returns {string} The combined full path
+ */
+ function buildFullPath(baseURL, requestedURL) {
+ if (baseURL && !isAbsoluteURL(requestedURL)) {
+ return combineURLs(baseURL, requestedURL);
+ }
+ return requestedURL;
+ }
+
+ var isURLSameOrigin = platform.hasStandardBrowserEnv ?
+ // Standard browser envs have full support of the APIs needed to test
+ // whether the request URL is of the same origin as current location.
+ function standardBrowserEnv() {
+ var msie = /(msie|trident)/i.test(navigator.userAgent);
+ var urlParsingNode = document.createElement('a');
+ var originURL;
+
+ /**
+ * Parse a URL to discover its components
+ *
+ * @param {String} url The URL to be parsed
+ * @returns {Object}
+ */
+ function resolveURL(url) {
+ var href = url;
+ if (msie) {
+ // IE needs attribute set twice to normalize properties
+ urlParsingNode.setAttribute('href', href);
+ href = urlParsingNode.href;
+ }
+ urlParsingNode.setAttribute('href', href);
+
+ // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
+ return {
+ href: urlParsingNode.href,
+ protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
+ host: urlParsingNode.host,
+ search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
+ hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
+ hostname: urlParsingNode.hostname,
+ port: urlParsingNode.port,
+ pathname: urlParsingNode.pathname.charAt(0) === '/' ? urlParsingNode.pathname : '/' + urlParsingNode.pathname
+ };
+ }
+ originURL = resolveURL(window.location.href);
+
+ /**
+ * Determine if a URL shares the same origin as the current location
+ *
+ * @param {String} requestURL The URL to test
+ * @returns {boolean} True if URL shares the same origin, otherwise false
+ */
+ return function isURLSameOrigin(requestURL) {
+ var parsed = utils$1.isString(requestURL) ? resolveURL(requestURL) : requestURL;
+ return parsed.protocol === originURL.protocol && parsed.host === originURL.host;
+ };
+ }() :
+ // Non standard browser envs (web workers, react-native) lack needed support.
+ function nonStandardBrowserEnv() {
+ return function isURLSameOrigin() {
+ return true;
+ };
+ }();
+
+ function parseProtocol(url) {
+ var match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
+ return match && match[1] || '';
+ }
+
+ /**
+ * Calculate data maxRate
+ * @param {Number} [samplesCount= 10]
+ * @param {Number} [min= 1000]
+ * @returns {Function}
+ */
+ function speedometer(samplesCount, min) {
+ samplesCount = samplesCount || 10;
+ var bytes = new Array(samplesCount);
+ var timestamps = new Array(samplesCount);
+ var head = 0;
+ var tail = 0;
+ var firstSampleTS;
+ min = min !== undefined ? min : 1000;
+ return function push(chunkLength) {
+ var now = Date.now();
+ var startedAt = timestamps[tail];
+ if (!firstSampleTS) {
+ firstSampleTS = now;
+ }
+ bytes[head] = chunkLength;
+ timestamps[head] = now;
+ var i = tail;
+ var bytesCount = 0;
+ while (i !== head) {
+ bytesCount += bytes[i++];
+ i = i % samplesCount;
+ }
+ head = (head + 1) % samplesCount;
+ if (head === tail) {
+ tail = (tail + 1) % samplesCount;
+ }
+ if (now - firstSampleTS < min) {
+ return;
+ }
+ var passed = startedAt && now - startedAt;
+ return passed ? Math.round(bytesCount * 1000 / passed) : undefined;
+ };
+ }
+
+ function progressEventReducer(listener, isDownloadStream) {
+ var bytesNotified = 0;
+ var _speedometer = speedometer(50, 250);
+ return function (e) {
+ var loaded = e.loaded;
+ var total = e.lengthComputable ? e.total : undefined;
+ var progressBytes = loaded - bytesNotified;
+ var rate = _speedometer(progressBytes);
+ var inRange = loaded <= total;
+ bytesNotified = loaded;
+ var data = {
+ loaded: loaded,
+ total: total,
+ progress: total ? loaded / total : undefined,
+ bytes: progressBytes,
+ rate: rate ? rate : undefined,
+ estimated: rate && total && inRange ? (total - loaded) / rate : undefined,
+ event: e
+ };
+ data[isDownloadStream ? 'download' : 'upload'] = true;
+ listener(data);
+ };
+ }
+ var isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
+ var xhrAdapter = isXHRAdapterSupported && function (config) {
+ return new Promise(function dispatchXhrRequest(resolve, reject) {
+ var requestData = config.data;
+ var requestHeaders = AxiosHeaders$1.from(config.headers).normalize();
+ var responseType = config.responseType,
+ withXSRFToken = config.withXSRFToken;
+ var onCanceled;
+ function done() {
+ if (config.cancelToken) {
+ config.cancelToken.unsubscribe(onCanceled);
+ }
+ if (config.signal) {
+ config.signal.removeEventListener('abort', onCanceled);
+ }
+ }
+ var contentType;
+ if (utils$1.isFormData(requestData)) {
+ if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
+ requestHeaders.setContentType(false); // Let the browser set it
+ } else if ((contentType = requestHeaders.getContentType()) !== false) {
+ // fix semicolon duplication issue for ReactNative FormData implementation
+ var _ref = contentType ? contentType.split(';').map(function (token) {
+ return token.trim();
+ }).filter(Boolean) : [],
+ _ref2 = _toArray(_ref),
+ type = _ref2[0],
+ tokens = _ref2.slice(1);
+ requestHeaders.setContentType([type || 'multipart/form-data'].concat(_toConsumableArray(tokens)).join('; '));
+ }
+ }
+ var request = new XMLHttpRequest();
+
+ // HTTP basic authentication
+ if (config.auth) {
+ var username = config.auth.username || '';
+ var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';
+ requestHeaders.set('Authorization', 'Basic ' + btoa(username + ':' + password));
+ }
+ var fullPath = buildFullPath(config.baseURL, config.url);
+ request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
+
+ // Set the request timeout in MS
+ request.timeout = config.timeout;
+ function onloadend() {
+ if (!request) {
+ return;
+ }
+ // Prepare the response
+ var responseHeaders = AxiosHeaders$1.from('getAllResponseHeaders' in request && request.getAllResponseHeaders());
+ var responseData = !responseType || responseType === 'text' || responseType === 'json' ? request.responseText : request.response;
+ var response = {
+ data: responseData,
+ status: request.status,
+ statusText: request.statusText,
+ headers: responseHeaders,
+ config: config,
+ request: request
+ };
+ settle(function _resolve(value) {
+ resolve(value);
+ done();
+ }, function _reject(err) {
+ reject(err);
+ done();
+ }, response);
+
+ // Clean up request
+ request = null;
+ }
+ if ('onloadend' in request) {
+ // Use onloadend if available
+ request.onloadend = onloadend;
+ } else {
+ // Listen for ready state to emulate onloadend
+ request.onreadystatechange = function handleLoad() {
+ if (!request || request.readyState !== 4) {
+ return;
+ }
+
+ // The request errored out and we didn't get a response, this will be
+ // handled by onerror instead
+ // With one exception: request that using file: protocol, most browsers
+ // will return status as 0 even though it's a successful request
+ if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
+ return;
+ }
+ // readystate handler is calling before onerror or ontimeout handlers,
+ // so we should call onloadend on the next 'tick'
+ setTimeout(onloadend);
+ };
+ }
+
+ // Handle browser request cancellation (as opposed to a manual cancellation)
+ request.onabort = function handleAbort() {
+ if (!request) {
+ return;
+ }
+ reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));
+
+ // Clean up request
+ request = null;
+ };
+
+ // Handle low level network errors
+ request.onerror = function handleError() {
+ // Real errors are hidden from us by the browser
+ // onerror should only fire if it's a network error
+ reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request));
+
+ // Clean up request
+ request = null;
+ };
+
+ // Handle timeout
+ request.ontimeout = function handleTimeout() {
+ var timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';
+ var transitional = config.transitional || transitionalDefaults;
+ if (config.timeoutErrorMessage) {
+ timeoutErrorMessage = config.timeoutErrorMessage;
+ }
+ reject(new AxiosError(timeoutErrorMessage, transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, config, request));
+
+ // Clean up request
+ request = null;
+ };
+
+ // Add xsrf header
+ // This is only done if running in a standard browser environment.
+ // Specifically not if we're in a web worker, or react-native.
+ if (platform.hasStandardBrowserEnv) {
+ withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config));
+ if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin(fullPath)) {
+ // Add xsrf header
+ var xsrfValue = config.xsrfHeaderName && config.xsrfCookieName && cookies.read(config.xsrfCookieName);
+ if (xsrfValue) {
+ requestHeaders.set(config.xsrfHeaderName, xsrfValue);
+ }
+ }
+ }
+
+ // Remove Content-Type if data is undefined
+ requestData === undefined && requestHeaders.setContentType(null);
+
+ // Add headers to the request
+ if ('setRequestHeader' in request) {
+ utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
+ request.setRequestHeader(key, val);
+ });
+ }
+
+ // Add withCredentials to request if needed
+ if (!utils$1.isUndefined(config.withCredentials)) {
+ request.withCredentials = !!config.withCredentials;
+ }
+
+ // Add responseType to request if needed
+ if (responseType && responseType !== 'json') {
+ request.responseType = config.responseType;
+ }
+
+ // Handle progress if needed
+ if (typeof config.onDownloadProgress === 'function') {
+ request.addEventListener('progress', progressEventReducer(config.onDownloadProgress, true));
+ }
+
+ // Not all browsers support upload events
+ if (typeof config.onUploadProgress === 'function' && request.upload) {
+ request.upload.addEventListener('progress', progressEventReducer(config.onUploadProgress));
+ }
+ if (config.cancelToken || config.signal) {
+ // Handle cancellation
+ // eslint-disable-next-line func-names
+ onCanceled = function onCanceled(cancel) {
+ if (!request) {
+ return;
+ }
+ reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);
+ request.abort();
+ request = null;
+ };
+ config.cancelToken && config.cancelToken.subscribe(onCanceled);
+ if (config.signal) {
+ config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);
+ }
+ }
+ var protocol = parseProtocol(fullPath);
+ if (protocol && platform.protocols.indexOf(protocol) === -1) {
+ reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));
+ return;
+ }
+
+ // Send the request
+ request.send(requestData || null);
+ });
+ };
+
+ var knownAdapters = {
+ http: httpAdapter,
+ xhr: xhrAdapter
+ };
+ utils$1.forEach(knownAdapters, function (fn, value) {
+ if (fn) {
+ try {
+ Object.defineProperty(fn, 'name', {
+ value: value
+ });
+ } catch (e) {
+ // eslint-disable-next-line no-empty
+ }
+ Object.defineProperty(fn, 'adapterName', {
+ value: value
+ });
+ }
+ });
+ var renderReason = function renderReason(reason) {
+ return "- ".concat(reason);
+ };
+ var isResolvedHandle = function isResolvedHandle(adapter) {
+ return utils$1.isFunction(adapter) || adapter === null || adapter === false;
+ };
+ var adapters = {
+ getAdapter: function getAdapter(adapters) {
+ adapters = utils$1.isArray(adapters) ? adapters : [adapters];
+ var _adapters = adapters,
+ length = _adapters.length;
+ var nameOrAdapter;
+ var adapter;
+ var rejectedReasons = {};
+ for (var i = 0; i < length; i++) {
+ nameOrAdapter = adapters[i];
+ var id = void 0;
+ adapter = nameOrAdapter;
+ if (!isResolvedHandle(nameOrAdapter)) {
+ adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
+ if (adapter === undefined) {
+ throw new AxiosError("Unknown adapter '".concat(id, "'"));
+ }
+ }
+ if (adapter) {
+ break;
+ }
+ rejectedReasons[id || '#' + i] = adapter;
+ }
+ if (!adapter) {
+ var reasons = Object.entries(rejectedReasons).map(function (_ref) {
+ var _ref2 = _slicedToArray(_ref, 2),
+ id = _ref2[0],
+ state = _ref2[1];
+ return "adapter ".concat(id, " ") + (state === false ? 'is not supported by the environment' : 'is not available in the build');
+ });
+ var s = length ? reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0]) : 'as no adapter specified';
+ throw new AxiosError("There is no suitable adapter to dispatch the request " + s, 'ERR_NOT_SUPPORT');
+ }
+ return adapter;
+ },
+ adapters: knownAdapters
+ };
+
+ /**
+ * Throws a `CanceledError` if cancellation has been requested.
+ *
+ * @param {Object} config The config that is to be used for the request
+ *
+ * @returns {void}
+ */
+ function throwIfCancellationRequested(config) {
+ if (config.cancelToken) {
+ config.cancelToken.throwIfRequested();
+ }
+ if (config.signal && config.signal.aborted) {
+ throw new CanceledError(null, config);
+ }
+ }
+
+ /**
+ * Dispatch a request to the server using the configured adapter.
+ *
+ * @param {object} config The config that is to be used for the request
+ *
+ * @returns {Promise} The Promise to be fulfilled
+ */
+ function dispatchRequest(config) {
+ throwIfCancellationRequested(config);
+ config.headers = AxiosHeaders$1.from(config.headers);
+
+ // Transform request data
+ config.data = transformData.call(config, config.transformRequest);
+ if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {
+ config.headers.setContentType('application/x-www-form-urlencoded', false);
+ }
+ var adapter = adapters.getAdapter(config.adapter || defaults$1.adapter);
+ return adapter(config).then(function onAdapterResolution(response) {
+ throwIfCancellationRequested(config);
+
+ // Transform response data
+ response.data = transformData.call(config, config.transformResponse, response);
+ response.headers = AxiosHeaders$1.from(response.headers);
+ return response;
+ }, function onAdapterRejection(reason) {
+ if (!isCancel(reason)) {
+ throwIfCancellationRequested(config);
+
+ // Transform response data
+ if (reason && reason.response) {
+ reason.response.data = transformData.call(config, config.transformResponse, reason.response);
+ reason.response.headers = AxiosHeaders$1.from(reason.response.headers);
+ }
+ }
+ return Promise.reject(reason);
+ });
+ }
+
+ var headersToObject = function headersToObject(thing) {
+ return thing instanceof AxiosHeaders$1 ? thing.toJSON() : thing;
+ };
+
+ /**
+ * Config-specific merge-function which creates a new config-object
+ * by merging two configuration objects together.
+ *
+ * @param {Object} config1
+ * @param {Object} config2
+ *
+ * @returns {Object} New object resulting from merging config2 to config1
+ */
+ function mergeConfig(config1, config2) {
+ // eslint-disable-next-line no-param-reassign
+ config2 = config2 || {};
+ var config = {};
+ function getMergedValue(target, source, caseless) {
+ if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
+ return utils$1.merge.call({
+ caseless: caseless
+ }, target, source);
+ } else if (utils$1.isPlainObject(source)) {
+ return utils$1.merge({}, source);
+ } else if (utils$1.isArray(source)) {
+ return source.slice();
+ }
+ return source;
+ }
+
+ // eslint-disable-next-line consistent-return
+ function mergeDeepProperties(a, b, caseless) {
+ if (!utils$1.isUndefined(b)) {
+ return getMergedValue(a, b, caseless);
+ } else if (!utils$1.isUndefined(a)) {
+ return getMergedValue(undefined, a, caseless);
+ }
+ }
+
+ // eslint-disable-next-line consistent-return
+ function valueFromConfig2(a, b) {
+ if (!utils$1.isUndefined(b)) {
+ return getMergedValue(undefined, b);
+ }
+ }
+
+ // eslint-disable-next-line consistent-return
+ function defaultToConfig2(a, b) {
+ if (!utils$1.isUndefined(b)) {
+ return getMergedValue(undefined, b);
+ } else if (!utils$1.isUndefined(a)) {
+ return getMergedValue(undefined, a);
+ }
+ }
+
+ // eslint-disable-next-line consistent-return
+ function mergeDirectKeys(a, b, prop) {
+ if (prop in config2) {
+ return getMergedValue(a, b);
+ } else if (prop in config1) {
+ return getMergedValue(undefined, a);
+ }
+ }
+ var mergeMap = {
+ url: valueFromConfig2,
+ method: valueFromConfig2,
+ data: valueFromConfig2,
+ baseURL: defaultToConfig2,
+ transformRequest: defaultToConfig2,
+ transformResponse: defaultToConfig2,
+ paramsSerializer: defaultToConfig2,
+ timeout: defaultToConfig2,
+ timeoutMessage: defaultToConfig2,
+ withCredentials: defaultToConfig2,
+ withXSRFToken: defaultToConfig2,
+ adapter: defaultToConfig2,
+ responseType: defaultToConfig2,
+ xsrfCookieName: defaultToConfig2,
+ xsrfHeaderName: defaultToConfig2,
+ onUploadProgress: defaultToConfig2,
+ onDownloadProgress: defaultToConfig2,
+ decompress: defaultToConfig2,
+ maxContentLength: defaultToConfig2,
+ maxBodyLength: defaultToConfig2,
+ beforeRedirect: defaultToConfig2,
+ transport: defaultToConfig2,
+ httpAgent: defaultToConfig2,
+ httpsAgent: defaultToConfig2,
+ cancelToken: defaultToConfig2,
+ socketPath: defaultToConfig2,
+ responseEncoding: defaultToConfig2,
+ validateStatus: mergeDirectKeys,
+ headers: function headers(a, b) {
+ return mergeDeepProperties(headersToObject(a), headersToObject(b), true);
+ }
+ };
+ utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
+ var merge = mergeMap[prop] || mergeDeepProperties;
+ var configValue = merge(config1[prop], config2[prop], prop);
+ utils$1.isUndefined(configValue) && merge !== mergeDirectKeys || (config[prop] = configValue);
+ });
+ return config;
+ }
+
+ var VERSION = "1.6.7";
+
+ var validators$1 = {};
+
+ // eslint-disable-next-line func-names
+ ['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function (type, i) {
+ validators$1[type] = function validator(thing) {
+ return _typeof(thing) === type || 'a' + (i < 1 ? 'n ' : ' ') + type;
+ };
+ });
+ var deprecatedWarnings = {};
+
+ /**
+ * Transitional option validator
+ *
+ * @param {function|boolean?} validator - set to false if the transitional option has been removed
+ * @param {string?} version - deprecated version / removed since version
+ * @param {string?} message - some message with additional info
+ *
+ * @returns {function}
+ */
+ validators$1.transitional = function transitional(validator, version, message) {
+ function formatMessage(opt, desc) {
+ return '[Axios v' + VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : '');
+ }
+
+ // eslint-disable-next-line func-names
+ return function (value, opt, opts) {
+ if (validator === false) {
+ throw new AxiosError(formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')), AxiosError.ERR_DEPRECATED);
+ }
+ if (version && !deprecatedWarnings[opt]) {
+ deprecatedWarnings[opt] = true;
+ // eslint-disable-next-line no-console
+ console.warn(formatMessage(opt, ' has been deprecated since v' + version + ' and will be removed in the near future'));
+ }
+ return validator ? validator(value, opt, opts) : true;
+ };
+ };
+
+ /**
+ * Assert object's properties type
+ *
+ * @param {object} options
+ * @param {object} schema
+ * @param {boolean?} allowUnknown
+ *
+ * @returns {object}
+ */
+
+ function assertOptions(options, schema, allowUnknown) {
+ if (_typeof(options) !== 'object') {
+ throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);
+ }
+ var keys = Object.keys(options);
+ var i = keys.length;
+ while (i-- > 0) {
+ var opt = keys[i];
+ var validator = schema[opt];
+ if (validator) {
+ var value = options[opt];
+ var result = value === undefined || validator(value, opt, options);
+ if (result !== true) {
+ throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);
+ }
+ continue;
+ }
+ if (allowUnknown !== true) {
+ throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);
+ }
+ }
+ }
+ var validator = {
+ assertOptions: assertOptions,
+ validators: validators$1
+ };
+
+ var validators = validator.validators;
+
+ /**
+ * Create a new instance of Axios
+ *
+ * @param {Object} instanceConfig The default config for the instance
+ *
+ * @return {Axios} A new instance of Axios
+ */
+ var Axios = /*#__PURE__*/function () {
+ function Axios(instanceConfig) {
+ _classCallCheck(this, Axios);
+ this.defaults = instanceConfig;
+ this.interceptors = {
+ request: new InterceptorManager$1(),
+ response: new InterceptorManager$1()
+ };
+ }
+
+ /**
+ * Dispatch a request
+ *
+ * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
+ * @param {?Object} config
+ *
+ * @returns {Promise} The Promise to be fulfilled
+ */
+ _createClass(Axios, [{
+ key: "request",
+ value: function () {
+ var _request2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(configOrUrl, config) {
+ var dummy, stack;
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
+ while (1) {
+ switch (_context.prev = _context.next) {
+ case 0:
+ _context.prev = 0;
+ _context.next = 3;
+ return this._request(configOrUrl, config);
+ case 3:
+ return _context.abrupt("return", _context.sent);
+ case 6:
+ _context.prev = 6;
+ _context.t0 = _context["catch"](0);
+ if (_context.t0 instanceof Error) {
+ Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : dummy = new Error();
+
+ // slice off the Error: ... line
+ stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : '';
+ if (!_context.t0.stack) {
+ _context.t0.stack = stack;
+ // match without the 2 top stack lines
+ } else if (stack && !String(_context.t0.stack).endsWith(stack.replace(/^.+\n.+\n/, ''))) {
+ _context.t0.stack += '\n' + stack;
+ }
+ }
+ throw _context.t0;
+ case 10:
+ case "end":
+ return _context.stop();
+ }
+ }
+ }, _callee, this, [[0, 6]]);
+ }));
+ function request(_x, _x2) {
+ return _request2.apply(this, arguments);
+ }
+ return request;
+ }()
+ }, {
+ key: "_request",
+ value: function _request(configOrUrl, config) {
+ /*eslint no-param-reassign:0*/
+ // Allow for axios('example/url'[, config]) a la fetch API
+ if (typeof configOrUrl === 'string') {
+ config = config || {};
+ config.url = configOrUrl;
+ } else {
+ config = configOrUrl || {};
+ }
+ config = mergeConfig(this.defaults, config);
+ var _config = config,
+ transitional = _config.transitional,
+ paramsSerializer = _config.paramsSerializer,
+ headers = _config.headers;
+ if (transitional !== undefined) {
+ validator.assertOptions(transitional, {
+ silentJSONParsing: validators.transitional(validators["boolean"]),
+ forcedJSONParsing: validators.transitional(validators["boolean"]),
+ clarifyTimeoutError: validators.transitional(validators["boolean"])
+ }, false);
+ }
+ if (paramsSerializer != null) {
+ if (utils$1.isFunction(paramsSerializer)) {
+ config.paramsSerializer = {
+ serialize: paramsSerializer
+ };
+ } else {
+ validator.assertOptions(paramsSerializer, {
+ encode: validators["function"],
+ serialize: validators["function"]
+ }, true);
+ }
+ }
+
+ // Set config.method
+ config.method = (config.method || this.defaults.method || 'get').toLowerCase();
+
+ // Flatten headers
+ var contextHeaders = headers && utils$1.merge(headers.common, headers[config.method]);
+ headers && utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], function (method) {
+ delete headers[method];
+ });
+ config.headers = AxiosHeaders$1.concat(contextHeaders, headers);
+
+ // filter out skipped interceptors
+ var requestInterceptorChain = [];
+ var synchronousRequestInterceptors = true;
+ this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
+ if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {
+ return;
+ }
+ synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
+ requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
+ });
+ var responseInterceptorChain = [];
+ this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
+ responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
+ });
+ var promise;
+ var i = 0;
+ var len;
+ if (!synchronousRequestInterceptors) {
+ var chain = [dispatchRequest.bind(this), undefined];
+ chain.unshift.apply(chain, requestInterceptorChain);
+ chain.push.apply(chain, responseInterceptorChain);
+ len = chain.length;
+ promise = Promise.resolve(config);
+ while (i < len) {
+ promise = promise.then(chain[i++], chain[i++]);
+ }
+ return promise;
+ }
+ len = requestInterceptorChain.length;
+ var newConfig = config;
+ i = 0;
+ while (i < len) {
+ var onFulfilled = requestInterceptorChain[i++];
+ var onRejected = requestInterceptorChain[i++];
+ try {
+ newConfig = onFulfilled(newConfig);
+ } catch (error) {
+ onRejected.call(this, error);
+ break;
+ }
+ }
+ try {
+ promise = dispatchRequest.call(this, newConfig);
+ } catch (error) {
+ return Promise.reject(error);
+ }
+ i = 0;
+ len = responseInterceptorChain.length;
+ while (i < len) {
+ promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);
+ }
+ return promise;
+ }
+ }, {
+ key: "getUri",
+ value: function getUri(config) {
+ config = mergeConfig(this.defaults, config);
+ var fullPath = buildFullPath(config.baseURL, config.url);
+ return buildURL(fullPath, config.params, config.paramsSerializer);
+ }
+ }]);
+ return Axios;
+ }(); // Provide aliases for supported request methods
+ utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
+ /*eslint func-names:0*/
+ Axios.prototype[method] = function (url, config) {
+ return this.request(mergeConfig(config || {}, {
+ method: method,
+ url: url,
+ data: (config || {}).data
+ }));
+ };
+ });
+ utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
+ /*eslint func-names:0*/
+
+ function generateHTTPMethod(isForm) {
+ return function httpMethod(url, data, config) {
+ return this.request(mergeConfig(config || {}, {
+ method: method,
+ headers: isForm ? {
+ 'Content-Type': 'multipart/form-data'
+ } : {},
+ url: url,
+ data: data
+ }));
+ };
+ }
+ Axios.prototype[method] = generateHTTPMethod();
+ Axios.prototype[method + 'Form'] = generateHTTPMethod(true);
+ });
+ var Axios$1 = Axios;
+
+ /**
+ * A `CancelToken` is an object that can be used to request cancellation of an operation.
+ *
+ * @param {Function} executor The executor function.
+ *
+ * @returns {CancelToken}
+ */
+ var CancelToken = /*#__PURE__*/function () {
+ function CancelToken(executor) {
+ _classCallCheck(this, CancelToken);
+ if (typeof executor !== 'function') {
+ throw new TypeError('executor must be a function.');
+ }
+ var resolvePromise;
+ this.promise = new Promise(function promiseExecutor(resolve) {
+ resolvePromise = resolve;
+ });
+ var token = this;
+
+ // eslint-disable-next-line func-names
+ this.promise.then(function (cancel) {
+ if (!token._listeners) return;
+ var i = token._listeners.length;
+ while (i-- > 0) {
+ token._listeners[i](cancel);
+ }
+ token._listeners = null;
+ });
+
+ // eslint-disable-next-line func-names
+ this.promise.then = function (onfulfilled) {
+ var _resolve;
+ // eslint-disable-next-line func-names
+ var promise = new Promise(function (resolve) {
+ token.subscribe(resolve);
+ _resolve = resolve;
+ }).then(onfulfilled);
+ promise.cancel = function reject() {
+ token.unsubscribe(_resolve);
+ };
+ return promise;
+ };
+ executor(function cancel(message, config, request) {
+ if (token.reason) {
+ // Cancellation has already been requested
+ return;
+ }
+ token.reason = new CanceledError(message, config, request);
+ resolvePromise(token.reason);
+ });
+ }
+
+ /**
+ * Throws a `CanceledError` if cancellation has been requested.
+ */
+ _createClass(CancelToken, [{
+ key: "throwIfRequested",
+ value: function throwIfRequested() {
+ if (this.reason) {
+ throw this.reason;
+ }
+ }
+
+ /**
+ * Subscribe to the cancel signal
+ */
+ }, {
+ key: "subscribe",
+ value: function subscribe(listener) {
+ if (this.reason) {
+ listener(this.reason);
+ return;
+ }
+ if (this._listeners) {
+ this._listeners.push(listener);
+ } else {
+ this._listeners = [listener];
+ }
+ }
+
+ /**
+ * Unsubscribe from the cancel signal
+ */
+ }, {
+ key: "unsubscribe",
+ value: function unsubscribe(listener) {
+ if (!this._listeners) {
+ return;
+ }
+ var index = this._listeners.indexOf(listener);
+ if (index !== -1) {
+ this._listeners.splice(index, 1);
+ }
+ }
+
+ /**
+ * Returns an object that contains a new `CancelToken` and a function that, when called,
+ * cancels the `CancelToken`.
+ */
+ }], [{
+ key: "source",
+ value: function source() {
+ var cancel;
+ var token = new CancelToken(function executor(c) {
+ cancel = c;
+ });
+ return {
+ token: token,
+ cancel: cancel
+ };
+ }
+ }]);
+ return CancelToken;
+ }();
+ var CancelToken$1 = CancelToken;
+
+ /**
+ * Syntactic sugar for invoking a function and expanding an array for arguments.
+ *
+ * Common use case would be to use `Function.prototype.apply`.
+ *
+ * ```js
+ * function f(x, y, z) {}
+ * var args = [1, 2, 3];
+ * f.apply(null, args);
+ * ```
+ *
+ * With `spread` this example can be re-written.
+ *
+ * ```js
+ * spread(function(x, y, z) {})([1, 2, 3]);
+ * ```
+ *
+ * @param {Function} callback
+ *
+ * @returns {Function}
+ */
+ function spread(callback) {
+ return function wrap(arr) {
+ return callback.apply(null, arr);
+ };
+ }
+
+ /**
+ * Determines whether the payload is an error thrown by Axios
+ *
+ * @param {*} payload The value to test
+ *
+ * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
+ */
+ function isAxiosError(payload) {
+ return utils$1.isObject(payload) && payload.isAxiosError === true;
+ }
+
+ var HttpStatusCode = {
+ Continue: 100,
+ SwitchingProtocols: 101,
+ Processing: 102,
+ EarlyHints: 103,
+ Ok: 200,
+ Created: 201,
+ Accepted: 202,
+ NonAuthoritativeInformation: 203,
+ NoContent: 204,
+ ResetContent: 205,
+ PartialContent: 206,
+ MultiStatus: 207,
+ AlreadyReported: 208,
+ ImUsed: 226,
+ MultipleChoices: 300,
+ MovedPermanently: 301,
+ Found: 302,
+ SeeOther: 303,
+ NotModified: 304,
+ UseProxy: 305,
+ Unused: 306,
+ TemporaryRedirect: 307,
+ PermanentRedirect: 308,
+ BadRequest: 400,
+ Unauthorized: 401,
+ PaymentRequired: 402,
+ Forbidden: 403,
+ NotFound: 404,
+ MethodNotAllowed: 405,
+ NotAcceptable: 406,
+ ProxyAuthenticationRequired: 407,
+ RequestTimeout: 408,
+ Conflict: 409,
+ Gone: 410,
+ LengthRequired: 411,
+ PreconditionFailed: 412,
+ PayloadTooLarge: 413,
+ UriTooLong: 414,
+ UnsupportedMediaType: 415,
+ RangeNotSatisfiable: 416,
+ ExpectationFailed: 417,
+ ImATeapot: 418,
+ MisdirectedRequest: 421,
+ UnprocessableEntity: 422,
+ Locked: 423,
+ FailedDependency: 424,
+ TooEarly: 425,
+ UpgradeRequired: 426,
+ PreconditionRequired: 428,
+ TooManyRequests: 429,
+ RequestHeaderFieldsTooLarge: 431,
+ UnavailableForLegalReasons: 451,
+ InternalServerError: 500,
+ NotImplemented: 501,
+ BadGateway: 502,
+ ServiceUnavailable: 503,
+ GatewayTimeout: 504,
+ HttpVersionNotSupported: 505,
+ VariantAlsoNegotiates: 506,
+ InsufficientStorage: 507,
+ LoopDetected: 508,
+ NotExtended: 510,
+ NetworkAuthenticationRequired: 511
+ };
+ Object.entries(HttpStatusCode).forEach(function (_ref) {
+ var _ref2 = _slicedToArray(_ref, 2),
+ key = _ref2[0],
+ value = _ref2[1];
+ HttpStatusCode[value] = key;
+ });
+ var HttpStatusCode$1 = HttpStatusCode;
+
+ /**
+ * Create an instance of Axios
+ *
+ * @param {Object} defaultConfig The default config for the instance
+ *
+ * @returns {Axios} A new instance of Axios
+ */
+ function createInstance(defaultConfig) {
+ var context = new Axios$1(defaultConfig);
+ var instance = bind(Axios$1.prototype.request, context);
+
+ // Copy axios.prototype to instance
+ utils$1.extend(instance, Axios$1.prototype, context, {
+ allOwnKeys: true
+ });
+
+ // Copy context to instance
+ utils$1.extend(instance, context, null, {
+ allOwnKeys: true
+ });
+
+ // Factory for creating new instances
+ instance.create = function create(instanceConfig) {
+ return createInstance(mergeConfig(defaultConfig, instanceConfig));
+ };
+ return instance;
+ }
+
+ // Create the default instance to be exported
+ var axios = createInstance(defaults$1);
+
+ // Expose Axios class to allow class inheritance
+ axios.Axios = Axios$1;
+
+ // Expose Cancel & CancelToken
+ axios.CanceledError = CanceledError;
+ axios.CancelToken = CancelToken$1;
+ axios.isCancel = isCancel;
+ axios.VERSION = VERSION;
+ axios.toFormData = toFormData;
+
+ // Expose AxiosError class
+ axios.AxiosError = AxiosError;
+
+ // alias for CanceledError for backward compatibility
+ axios.Cancel = axios.CanceledError;
+
+ // Expose all/spread
+ axios.all = function all(promises) {
+ return Promise.all(promises);
+ };
+ axios.spread = spread;
+
+ // Expose isAxiosError
+ axios.isAxiosError = isAxiosError;
+
+ // Expose mergeConfig
+ axios.mergeConfig = mergeConfig;
+ axios.AxiosHeaders = AxiosHeaders$1;
+ axios.formToJSON = function (thing) {
+ return formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
+ };
+ axios.getAdapter = adapters.getAdapter;
+ axios.HttpStatusCode = HttpStatusCode$1;
+ axios["default"] = axios;
+
+ return axios;
+
+}));
+//# sourceMappingURL=axios.js.map
diff --git a/node_modules/axios/dist/axios.js.map b/node_modules/axios/dist/axios.js.map
new file mode 100644
index 0000000..daef645
--- /dev/null
+++ b/node_modules/axios/dist/axios.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"axios.js","sources":["../lib/helpers/bind.js","../lib/utils.js","../lib/core/AxiosError.js","../lib/helpers/null.js","../lib/helpers/toFormData.js","../lib/helpers/AxiosURLSearchParams.js","../lib/helpers/buildURL.js","../lib/core/InterceptorManager.js","../lib/defaults/transitional.js","../lib/platform/browser/classes/URLSearchParams.js","../lib/platform/browser/classes/FormData.js","../lib/platform/browser/classes/Blob.js","../lib/platform/browser/index.js","../lib/platform/common/utils.js","../lib/platform/index.js","../lib/helpers/toURLEncodedForm.js","../lib/helpers/formDataToJSON.js","../lib/defaults/index.js","../lib/helpers/parseHeaders.js","../lib/core/AxiosHeaders.js","../lib/core/transformData.js","../lib/cancel/isCancel.js","../lib/cancel/CanceledError.js","../lib/core/settle.js","../lib/helpers/cookies.js","../lib/helpers/isAbsoluteURL.js","../lib/helpers/combineURLs.js","../lib/core/buildFullPath.js","../lib/helpers/isURLSameOrigin.js","../lib/helpers/parseProtocol.js","../lib/helpers/speedometer.js","../lib/adapters/xhr.js","../lib/adapters/adapters.js","../lib/core/dispatchRequest.js","../lib/core/mergeConfig.js","../lib/env/data.js","../lib/helpers/validator.js","../lib/core/Axios.js","../lib/cancel/CancelToken.js","../lib/helpers/spread.js","../lib/helpers/isAxiosError.js","../lib/helpers/HttpStatusCode.js","../lib/axios.js"],"sourcesContent":["'use strict';\n\nexport default function bind(fn, thisArg) {\n return function wrap() {\n return fn.apply(thisArg, arguments);\n };\n}\n","'use strict';\n\nimport bind from './helpers/bind.js';\n\n// utils is a library of generic helper functions non-specific to axios\n\nconst {toString} = Object.prototype;\nconst {getPrototypeOf} = Object;\n\nconst kindOf = (cache => thing => {\n const str = toString.call(thing);\n return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());\n})(Object.create(null));\n\nconst kindOfTest = (type) => {\n type = type.toLowerCase();\n return (thing) => kindOf(thing) === type\n}\n\nconst typeOfTest = type => thing => typeof thing === type;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n *\n * @returns {boolean} True if value is an Array, otherwise false\n */\nconst {isArray} = Array;\n\n/**\n * Determine if a value is undefined\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nconst isUndefined = typeOfTest('undefined');\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nconst isArrayBuffer = kindOfTest('ArrayBuffer');\n\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n let result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a String, otherwise false\n */\nconst isString = typeOfTest('string');\n\n/**\n * Determine if a value is a Function\n *\n * @param {*} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nconst isFunction = typeOfTest('function');\n\n/**\n * Determine if a value is a Number\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Number, otherwise false\n */\nconst isNumber = typeOfTest('number');\n\n/**\n * Determine if a value is an Object\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an Object, otherwise false\n */\nconst isObject = (thing) => thing !== null && typeof thing === 'object';\n\n/**\n * Determine if a value is a Boolean\n *\n * @param {*} thing The value to test\n * @returns {boolean} True if value is a Boolean, otherwise false\n */\nconst isBoolean = thing => thing === true || thing === false;\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a plain Object, otherwise false\n */\nconst isPlainObject = (val) => {\n if (kindOf(val) !== 'object') {\n return false;\n }\n\n const prototype = getPrototypeOf(val);\n return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Date, otherwise false\n */\nconst isDate = kindOfTest('Date');\n\n/**\n * Determine if a value is a File\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFile = kindOfTest('File');\n\n/**\n * Determine if a value is a Blob\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nconst isBlob = kindOfTest('Blob');\n\n/**\n * Determine if a value is a FileList\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFileList = kindOfTest('FileList');\n\n/**\n * Determine if a value is a Stream\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nconst isStream = (val) => isObject(val) && isFunction(val.pipe);\n\n/**\n * Determine if a value is a FormData\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nconst isFormData = (thing) => {\n let kind;\n return thing && (\n (typeof FormData === 'function' && thing instanceof FormData) || (\n isFunction(thing.append) && (\n (kind = kindOf(thing)) === 'formdata' ||\n // detect form-data instance\n (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')\n )\n )\n )\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nconst isURLSearchParams = kindOfTest('URLSearchParams');\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n *\n * @returns {String} The String freed of excess whitespace\n */\nconst trim = (str) => str.trim ?\n str.trim() : str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n *\n * @param {Boolean} [allOwnKeys = false]\n * @returns {any}\n */\nfunction forEach(obj, fn, {allOwnKeys = false} = {}) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n let i;\n let l;\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);\n const len = keys.length;\n let key;\n\n for (i = 0; i < len; i++) {\n key = keys[i];\n fn.call(null, obj[key], key, obj);\n }\n }\n}\n\nfunction findKey(obj, key) {\n key = key.toLowerCase();\n const keys = Object.keys(obj);\n let i = keys.length;\n let _key;\n while (i-- > 0) {\n _key = keys[i];\n if (key === _key.toLowerCase()) {\n return _key;\n }\n }\n return null;\n}\n\nconst _global = (() => {\n /*eslint no-undef:0*/\n if (typeof globalThis !== \"undefined\") return globalThis;\n return typeof self !== \"undefined\" ? self : (typeof window !== 'undefined' ? window : global)\n})();\n\nconst isContextDefined = (context) => !isUndefined(context) && context !== _global;\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n *\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n const {caseless} = isContextDefined(this) && this || {};\n const result = {};\n const assignValue = (val, key) => {\n const targetKey = caseless && findKey(result, key) || key;\n if (isPlainObject(result[targetKey]) && isPlainObject(val)) {\n result[targetKey] = merge(result[targetKey], val);\n } else if (isPlainObject(val)) {\n result[targetKey] = merge({}, val);\n } else if (isArray(val)) {\n result[targetKey] = val.slice();\n } else {\n result[targetKey] = val;\n }\n }\n\n for (let i = 0, l = arguments.length; i < l; i++) {\n arguments[i] && forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n *\n * @param {Boolean} [allOwnKeys]\n * @returns {Object} The resulting value of object a\n */\nconst extend = (a, b, thisArg, {allOwnKeys}= {}) => {\n forEach(b, (val, key) => {\n if (thisArg && isFunction(val)) {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n }, {allOwnKeys});\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n *\n * @returns {string} content value without BOM\n */\nconst stripBOM = (content) => {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\n/**\n * Inherit the prototype methods from one constructor into another\n * @param {function} constructor\n * @param {function} superConstructor\n * @param {object} [props]\n * @param {object} [descriptors]\n *\n * @returns {void}\n */\nconst inherits = (constructor, superConstructor, props, descriptors) => {\n constructor.prototype = Object.create(superConstructor.prototype, descriptors);\n constructor.prototype.constructor = constructor;\n Object.defineProperty(constructor, 'super', {\n value: superConstructor.prototype\n });\n props && Object.assign(constructor.prototype, props);\n}\n\n/**\n * Resolve object with deep prototype chain to a flat object\n * @param {Object} sourceObj source object\n * @param {Object} [destObj]\n * @param {Function|Boolean} [filter]\n * @param {Function} [propFilter]\n *\n * @returns {Object}\n */\nconst toFlatObject = (sourceObj, destObj, filter, propFilter) => {\n let props;\n let i;\n let prop;\n const merged = {};\n\n destObj = destObj || {};\n // eslint-disable-next-line no-eq-null,eqeqeq\n if (sourceObj == null) return destObj;\n\n do {\n props = Object.getOwnPropertyNames(sourceObj);\n i = props.length;\n while (i-- > 0) {\n prop = props[i];\n if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {\n destObj[prop] = sourceObj[prop];\n merged[prop] = true;\n }\n }\n sourceObj = filter !== false && getPrototypeOf(sourceObj);\n } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);\n\n return destObj;\n}\n\n/**\n * Determines whether a string ends with the characters of a specified string\n *\n * @param {String} str\n * @param {String} searchString\n * @param {Number} [position= 0]\n *\n * @returns {boolean}\n */\nconst endsWith = (str, searchString, position) => {\n str = String(str);\n if (position === undefined || position > str.length) {\n position = str.length;\n }\n position -= searchString.length;\n const lastIndex = str.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n}\n\n\n/**\n * Returns new array from array like object or null if failed\n *\n * @param {*} [thing]\n *\n * @returns {?Array}\n */\nconst toArray = (thing) => {\n if (!thing) return null;\n if (isArray(thing)) return thing;\n let i = thing.length;\n if (!isNumber(i)) return null;\n const arr = new Array(i);\n while (i-- > 0) {\n arr[i] = thing[i];\n }\n return arr;\n}\n\n/**\n * Checking if the Uint8Array exists and if it does, it returns a function that checks if the\n * thing passed in is an instance of Uint8Array\n *\n * @param {TypedArray}\n *\n * @returns {Array}\n */\n// eslint-disable-next-line func-names\nconst isTypedArray = (TypedArray => {\n // eslint-disable-next-line func-names\n return thing => {\n return TypedArray && thing instanceof TypedArray;\n };\n})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));\n\n/**\n * For each entry in the object, call the function with the key and value.\n *\n * @param {Object<any, any>} obj - The object to iterate over.\n * @param {Function} fn - The function to call for each entry.\n *\n * @returns {void}\n */\nconst forEachEntry = (obj, fn) => {\n const generator = obj && obj[Symbol.iterator];\n\n const iterator = generator.call(obj);\n\n let result;\n\n while ((result = iterator.next()) && !result.done) {\n const pair = result.value;\n fn.call(obj, pair[0], pair[1]);\n }\n}\n\n/**\n * It takes a regular expression and a string, and returns an array of all the matches\n *\n * @param {string} regExp - The regular expression to match against.\n * @param {string} str - The string to search.\n *\n * @returns {Array<boolean>}\n */\nconst matchAll = (regExp, str) => {\n let matches;\n const arr = [];\n\n while ((matches = regExp.exec(str)) !== null) {\n arr.push(matches);\n }\n\n return arr;\n}\n\n/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */\nconst isHTMLForm = kindOfTest('HTMLFormElement');\n\nconst toCamelCase = str => {\n return str.toLowerCase().replace(/[-_\\s]([a-z\\d])(\\w*)/g,\n function replacer(m, p1, p2) {\n return p1.toUpperCase() + p2;\n }\n );\n};\n\n/* Creating a function that will check if an object has a property. */\nconst hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);\n\n/**\n * Determine if a value is a RegExp object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a RegExp object, otherwise false\n */\nconst isRegExp = kindOfTest('RegExp');\n\nconst reduceDescriptors = (obj, reducer) => {\n const descriptors = Object.getOwnPropertyDescriptors(obj);\n const reducedDescriptors = {};\n\n forEach(descriptors, (descriptor, name) => {\n let ret;\n if ((ret = reducer(descriptor, name, obj)) !== false) {\n reducedDescriptors[name] = ret || descriptor;\n }\n });\n\n Object.defineProperties(obj, reducedDescriptors);\n}\n\n/**\n * Makes all methods read-only\n * @param {Object} obj\n */\n\nconst freezeMethods = (obj) => {\n reduceDescriptors(obj, (descriptor, name) => {\n // skip restricted props in strict mode\n if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {\n return false;\n }\n\n const value = obj[name];\n\n if (!isFunction(value)) return;\n\n descriptor.enumerable = false;\n\n if ('writable' in descriptor) {\n descriptor.writable = false;\n return;\n }\n\n if (!descriptor.set) {\n descriptor.set = () => {\n throw Error('Can not rewrite read-only method \\'' + name + '\\'');\n };\n }\n });\n}\n\nconst toObjectSet = (arrayOrString, delimiter) => {\n const obj = {};\n\n const define = (arr) => {\n arr.forEach(value => {\n obj[value] = true;\n });\n }\n\n isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));\n\n return obj;\n}\n\nconst noop = () => {}\n\nconst toFiniteNumber = (value, defaultValue) => {\n value = +value;\n return Number.isFinite(value) ? value : defaultValue;\n}\n\nconst ALPHA = 'abcdefghijklmnopqrstuvwxyz'\n\nconst DIGIT = '0123456789';\n\nconst ALPHABET = {\n DIGIT,\n ALPHA,\n ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT\n}\n\nconst generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {\n let str = '';\n const {length} = alphabet;\n while (size--) {\n str += alphabet[Math.random() * length|0]\n }\n\n return str;\n}\n\n/**\n * If the thing is a FormData object, return true, otherwise return false.\n *\n * @param {unknown} thing - The thing to check.\n *\n * @returns {boolean}\n */\nfunction isSpecCompliantForm(thing) {\n return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]);\n}\n\nconst toJSONObject = (obj) => {\n const stack = new Array(10);\n\n const visit = (source, i) => {\n\n if (isObject(source)) {\n if (stack.indexOf(source) >= 0) {\n return;\n }\n\n if(!('toJSON' in source)) {\n stack[i] = source;\n const target = isArray(source) ? [] : {};\n\n forEach(source, (value, key) => {\n const reducedValue = visit(value, i + 1);\n !isUndefined(reducedValue) && (target[key] = reducedValue);\n });\n\n stack[i] = undefined;\n\n return target;\n }\n }\n\n return source;\n }\n\n return visit(obj, 0);\n}\n\nconst isAsyncFn = kindOfTest('AsyncFunction');\n\nconst isThenable = (thing) =>\n thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);\n\nexport default {\n isArray,\n isArrayBuffer,\n isBuffer,\n isFormData,\n isArrayBufferView,\n isString,\n isNumber,\n isBoolean,\n isObject,\n isPlainObject,\n isUndefined,\n isDate,\n isFile,\n isBlob,\n isRegExp,\n isFunction,\n isStream,\n isURLSearchParams,\n isTypedArray,\n isFileList,\n forEach,\n merge,\n extend,\n trim,\n stripBOM,\n inherits,\n toFlatObject,\n kindOf,\n kindOfTest,\n endsWith,\n toArray,\n forEachEntry,\n matchAll,\n isHTMLForm,\n hasOwnProperty,\n hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection\n reduceDescriptors,\n freezeMethods,\n toObjectSet,\n toCamelCase,\n noop,\n toFiniteNumber,\n findKey,\n global: _global,\n isContextDefined,\n ALPHABET,\n generateString,\n isSpecCompliantForm,\n toJSONObject,\n isAsyncFn,\n isThenable\n};\n","'use strict';\n\nimport utils from '../utils.js';\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [config] The config.\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n *\n * @returns {Error} The created error.\n */\nfunction AxiosError(message, code, config, request, response) {\n Error.call(this);\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n } else {\n this.stack = (new Error()).stack;\n }\n\n this.message = message;\n this.name = 'AxiosError';\n code && (this.code = code);\n config && (this.config = config);\n request && (this.request = request);\n response && (this.response = response);\n}\n\nutils.inherits(AxiosError, Error, {\n toJSON: function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: utils.toJSONObject(this.config),\n code: this.code,\n status: this.response && this.response.status ? this.response.status : null\n };\n }\n});\n\nconst prototype = AxiosError.prototype;\nconst descriptors = {};\n\n[\n 'ERR_BAD_OPTION_VALUE',\n 'ERR_BAD_OPTION',\n 'ECONNABORTED',\n 'ETIMEDOUT',\n 'ERR_NETWORK',\n 'ERR_FR_TOO_MANY_REDIRECTS',\n 'ERR_DEPRECATED',\n 'ERR_BAD_RESPONSE',\n 'ERR_BAD_REQUEST',\n 'ERR_CANCELED',\n 'ERR_NOT_SUPPORT',\n 'ERR_INVALID_URL'\n// eslint-disable-next-line func-names\n].forEach(code => {\n descriptors[code] = {value: code};\n});\n\nObject.defineProperties(AxiosError, descriptors);\nObject.defineProperty(prototype, 'isAxiosError', {value: true});\n\n// eslint-disable-next-line func-names\nAxiosError.from = (error, code, config, request, response, customProps) => {\n const axiosError = Object.create(prototype);\n\n utils.toFlatObject(error, axiosError, function filter(obj) {\n return obj !== Error.prototype;\n }, prop => {\n return prop !== 'isAxiosError';\n });\n\n AxiosError.call(axiosError, error.message, code, config, request, response);\n\n axiosError.cause = error;\n\n axiosError.name = error.name;\n\n customProps && Object.assign(axiosError, customProps);\n\n return axiosError;\n};\n\nexport default AxiosError;\n","// eslint-disable-next-line strict\nexport default null;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\n// temporary hotfix to avoid circular references until AxiosURLSearchParams is refactored\nimport PlatformFormData from '../platform/node/classes/FormData.js';\n\n/**\n * Determines if the given thing is a array or js object.\n *\n * @param {string} thing - The object or array to be visited.\n *\n * @returns {boolean}\n */\nfunction isVisitable(thing) {\n return utils.isPlainObject(thing) || utils.isArray(thing);\n}\n\n/**\n * It removes the brackets from the end of a string\n *\n * @param {string} key - The key of the parameter.\n *\n * @returns {string} the key without the brackets.\n */\nfunction removeBrackets(key) {\n return utils.endsWith(key, '[]') ? key.slice(0, -2) : key;\n}\n\n/**\n * It takes a path, a key, and a boolean, and returns a string\n *\n * @param {string} path - The path to the current key.\n * @param {string} key - The key of the current object being iterated over.\n * @param {string} dots - If true, the key will be rendered with dots instead of brackets.\n *\n * @returns {string} The path to the current key.\n */\nfunction renderKey(path, key, dots) {\n if (!path) return key;\n return path.concat(key).map(function each(token, i) {\n // eslint-disable-next-line no-param-reassign\n token = removeBrackets(token);\n return !dots && i ? '[' + token + ']' : token;\n }).join(dots ? '.' : '');\n}\n\n/**\n * If the array is an array and none of its elements are visitable, then it's a flat array.\n *\n * @param {Array<any>} arr - The array to check\n *\n * @returns {boolean}\n */\nfunction isFlatArray(arr) {\n return utils.isArray(arr) && !arr.some(isVisitable);\n}\n\nconst predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {\n return /^is[A-Z]/.test(prop);\n});\n\n/**\n * Convert a data object to FormData\n *\n * @param {Object} obj\n * @param {?Object} [formData]\n * @param {?Object} [options]\n * @param {Function} [options.visitor]\n * @param {Boolean} [options.metaTokens = true]\n * @param {Boolean} [options.dots = false]\n * @param {?Boolean} [options.indexes = false]\n *\n * @returns {Object}\n **/\n\n/**\n * It converts an object into a FormData object\n *\n * @param {Object<any, any>} obj - The object to convert to form data.\n * @param {string} formData - The FormData object to append to.\n * @param {Object<string, any>} options\n *\n * @returns\n */\nfunction toFormData(obj, formData, options) {\n if (!utils.isObject(obj)) {\n throw new TypeError('target must be an object');\n }\n\n // eslint-disable-next-line no-param-reassign\n formData = formData || new (PlatformFormData || FormData)();\n\n // eslint-disable-next-line no-param-reassign\n options = utils.toFlatObject(options, {\n metaTokens: true,\n dots: false,\n indexes: false\n }, false, function defined(option, source) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n return !utils.isUndefined(source[option]);\n });\n\n const metaTokens = options.metaTokens;\n // eslint-disable-next-line no-use-before-define\n const visitor = options.visitor || defaultVisitor;\n const dots = options.dots;\n const indexes = options.indexes;\n const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;\n const useBlob = _Blob && utils.isSpecCompliantForm(formData);\n\n if (!utils.isFunction(visitor)) {\n throw new TypeError('visitor must be a function');\n }\n\n function convertValue(value) {\n if (value === null) return '';\n\n if (utils.isDate(value)) {\n return value.toISOString();\n }\n\n if (!useBlob && utils.isBlob(value)) {\n throw new AxiosError('Blob is not supported. Use a Buffer instead.');\n }\n\n if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {\n return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);\n }\n\n return value;\n }\n\n /**\n * Default visitor.\n *\n * @param {*} value\n * @param {String|Number} key\n * @param {Array<String|Number>} path\n * @this {FormData}\n *\n * @returns {boolean} return true to visit the each prop of the value recursively\n */\n function defaultVisitor(value, key, path) {\n let arr = value;\n\n if (value && !path && typeof value === 'object') {\n if (utils.endsWith(key, '{}')) {\n // eslint-disable-next-line no-param-reassign\n key = metaTokens ? key : key.slice(0, -2);\n // eslint-disable-next-line no-param-reassign\n value = JSON.stringify(value);\n } else if (\n (utils.isArray(value) && isFlatArray(value)) ||\n ((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value))\n )) {\n // eslint-disable-next-line no-param-reassign\n key = removeBrackets(key);\n\n arr.forEach(function each(el, index) {\n !(utils.isUndefined(el) || el === null) && formData.append(\n // eslint-disable-next-line no-nested-ternary\n indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),\n convertValue(el)\n );\n });\n return false;\n }\n }\n\n if (isVisitable(value)) {\n return true;\n }\n\n formData.append(renderKey(path, key, dots), convertValue(value));\n\n return false;\n }\n\n const stack = [];\n\n const exposedHelpers = Object.assign(predicates, {\n defaultVisitor,\n convertValue,\n isVisitable\n });\n\n function build(value, path) {\n if (utils.isUndefined(value)) return;\n\n if (stack.indexOf(value) !== -1) {\n throw Error('Circular reference detected in ' + path.join('.'));\n }\n\n stack.push(value);\n\n utils.forEach(value, function each(el, key) {\n const result = !(utils.isUndefined(el) || el === null) && visitor.call(\n formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers\n );\n\n if (result === true) {\n build(el, path ? path.concat(key) : [key]);\n }\n });\n\n stack.pop();\n }\n\n if (!utils.isObject(obj)) {\n throw new TypeError('data must be an object');\n }\n\n build(obj);\n\n return formData;\n}\n\nexport default toFormData;\n","'use strict';\n\nimport toFormData from './toFormData.js';\n\n/**\n * It encodes a string by replacing all characters that are not in the unreserved set with\n * their percent-encoded equivalents\n *\n * @param {string} str - The string to encode.\n *\n * @returns {string} The encoded string.\n */\nfunction encode(str) {\n const charMap = {\n '!': '%21',\n \"'\": '%27',\n '(': '%28',\n ')': '%29',\n '~': '%7E',\n '%20': '+',\n '%00': '\\x00'\n };\n return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {\n return charMap[match];\n });\n}\n\n/**\n * It takes a params object and converts it to a FormData object\n *\n * @param {Object<string, any>} params - The parameters to be converted to a FormData object.\n * @param {Object<string, any>} options - The options object passed to the Axios constructor.\n *\n * @returns {void}\n */\nfunction AxiosURLSearchParams(params, options) {\n this._pairs = [];\n\n params && toFormData(params, this, options);\n}\n\nconst prototype = AxiosURLSearchParams.prototype;\n\nprototype.append = function append(name, value) {\n this._pairs.push([name, value]);\n};\n\nprototype.toString = function toString(encoder) {\n const _encode = encoder ? function(value) {\n return encoder.call(this, value, encode);\n } : encode;\n\n return this._pairs.map(function each(pair) {\n return _encode(pair[0]) + '=' + _encode(pair[1]);\n }, '').join('&');\n};\n\nexport default AxiosURLSearchParams;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosURLSearchParams from '../helpers/AxiosURLSearchParams.js';\n\n/**\n * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their\n * URI encoded counterparts\n *\n * @param {string} val The value to be encoded.\n *\n * @returns {string} The encoded value.\n */\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @param {?object} options\n *\n * @returns {string} The formatted url\n */\nexport default function buildURL(url, params, options) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n \n const _encode = options && options.encode || encode;\n\n const serializeFn = options && options.serialize;\n\n let serializedParams;\n\n if (serializeFn) {\n serializedParams = serializeFn(params, options);\n } else {\n serializedParams = utils.isURLSearchParams(params) ?\n params.toString() :\n new AxiosURLSearchParams(params, options).toString(_encode);\n }\n\n if (serializedParams) {\n const hashmarkIndex = url.indexOf(\"#\");\n\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\nclass InterceptorManager {\n constructor() {\n this.handlers = [];\n }\n\n /**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\n use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled,\n rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n }\n\n /**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n *\n * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise\n */\n eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n }\n\n /**\n * Clear all interceptors from the stack\n *\n * @returns {void}\n */\n clear() {\n if (this.handlers) {\n this.handlers = [];\n }\n }\n\n /**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n *\n * @returns {void}\n */\n forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n }\n}\n\nexport default InterceptorManager;\n","'use strict';\n\nexport default {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n};\n","'use strict';\n\nimport AxiosURLSearchParams from '../../../helpers/AxiosURLSearchParams.js';\nexport default typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;\n","'use strict';\n\nexport default typeof FormData !== 'undefined' ? FormData : null;\n","'use strict'\n\nexport default typeof Blob !== 'undefined' ? Blob : null\n","import URLSearchParams from './classes/URLSearchParams.js'\nimport FormData from './classes/FormData.js'\nimport Blob from './classes/Blob.js'\n\nexport default {\n isBrowser: true,\n classes: {\n URLSearchParams,\n FormData,\n Blob\n },\n protocols: ['http', 'https', 'file', 'blob', 'url', 'data']\n};\n","const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n *\n * @returns {boolean}\n */\nconst hasStandardBrowserEnv = (\n (product) => {\n return hasBrowserEnv && ['ReactNative', 'NativeScript', 'NS'].indexOf(product) < 0\n })(typeof navigator !== 'undefined' && navigator.product);\n\n/**\n * Determine if we're running in a standard browser webWorker environment\n *\n * Although the `isStandardBrowserEnv` method indicates that\n * `allows axios to run in a web worker`, the WebWorker will still be\n * filtered out due to its judgment standard\n * `typeof window !== 'undefined' && typeof document !== 'undefined'`.\n * This leads to a problem when axios post `FormData` in webWorker\n */\nconst hasStandardBrowserWebWorkerEnv = (() => {\n return (\n typeof WorkerGlobalScope !== 'undefined' &&\n // eslint-disable-next-line no-undef\n self instanceof WorkerGlobalScope &&\n typeof self.importScripts === 'function'\n );\n})();\n\nexport {\n hasBrowserEnv,\n hasStandardBrowserWebWorkerEnv,\n hasStandardBrowserEnv\n}\n","import platform from './node/index.js';\nimport * as utils from './common/utils.js';\n\nexport default {\n ...utils,\n ...platform\n}\n","'use strict';\n\nimport utils from '../utils.js';\nimport toFormData from './toFormData.js';\nimport platform from '../platform/index.js';\n\nexport default function toURLEncodedForm(data, options) {\n return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({\n visitor: function(value, key, path, helpers) {\n if (platform.isNode && utils.isBuffer(value)) {\n this.append(key, value.toString('base64'));\n return false;\n }\n\n return helpers.defaultVisitor.apply(this, arguments);\n }\n }, options));\n}\n","'use strict';\n\nimport utils from '../utils.js';\n\n/**\n * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']\n *\n * @param {string} name - The name of the property to get.\n *\n * @returns An array of strings.\n */\nfunction parsePropPath(name) {\n // foo[x][y][z]\n // foo.x.y.z\n // foo-x-y-z\n // foo x y z\n return utils.matchAll(/\\w+|\\[(\\w*)]/g, name).map(match => {\n return match[0] === '[]' ? '' : match[1] || match[0];\n });\n}\n\n/**\n * Convert an array to an object.\n *\n * @param {Array<any>} arr - The array to convert to an object.\n *\n * @returns An object with the same keys and values as the array.\n */\nfunction arrayToObject(arr) {\n const obj = {};\n const keys = Object.keys(arr);\n let i;\n const len = keys.length;\n let key;\n for (i = 0; i < len; i++) {\n key = keys[i];\n obj[key] = arr[key];\n }\n return obj;\n}\n\n/**\n * It takes a FormData object and returns a JavaScript object\n *\n * @param {string} formData The FormData object to convert to JSON.\n *\n * @returns {Object<string, any> | null} The converted object.\n */\nfunction formDataToJSON(formData) {\n function buildPath(path, value, target, index) {\n let name = path[index++];\n\n if (name === '__proto__') return true;\n\n const isNumericKey = Number.isFinite(+name);\n const isLast = index >= path.length;\n name = !name && utils.isArray(target) ? target.length : name;\n\n if (isLast) {\n if (utils.hasOwnProp(target, name)) {\n target[name] = [target[name], value];\n } else {\n target[name] = value;\n }\n\n return !isNumericKey;\n }\n\n if (!target[name] || !utils.isObject(target[name])) {\n target[name] = [];\n }\n\n const result = buildPath(path, value, target[name], index);\n\n if (result && utils.isArray(target[name])) {\n target[name] = arrayToObject(target[name]);\n }\n\n return !isNumericKey;\n }\n\n if (utils.isFormData(formData) && utils.isFunction(formData.entries)) {\n const obj = {};\n\n utils.forEachEntry(formData, (name, value) => {\n buildPath(parsePropPath(name), value, obj, 0);\n });\n\n return obj;\n }\n\n return null;\n}\n\nexport default formDataToJSON;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\nimport transitionalDefaults from './transitional.js';\nimport toFormData from '../helpers/toFormData.js';\nimport toURLEncodedForm from '../helpers/toURLEncodedForm.js';\nimport platform from '../platform/index.js';\nimport formDataToJSON from '../helpers/formDataToJSON.js';\n\n/**\n * It takes a string, tries to parse it, and if it fails, it returns the stringified version\n * of the input\n *\n * @param {any} rawValue - The value to be stringified.\n * @param {Function} parser - A function that parses a string into a JavaScript object.\n * @param {Function} encoder - A function that takes a value and returns a string.\n *\n * @returns {string} A stringified version of the rawValue.\n */\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nconst defaults = {\n\n transitional: transitionalDefaults,\n\n adapter: ['xhr', 'http'],\n\n transformRequest: [function transformRequest(data, headers) {\n const contentType = headers.getContentType() || '';\n const hasJSONContentType = contentType.indexOf('application/json') > -1;\n const isObjectPayload = utils.isObject(data);\n\n if (isObjectPayload && utils.isHTMLForm(data)) {\n data = new FormData(data);\n }\n\n const isFormData = utils.isFormData(data);\n\n if (isFormData) {\n return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;\n }\n\n if (utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);\n return data.toString();\n }\n\n let isFileList;\n\n if (isObjectPayload) {\n if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {\n return toURLEncodedForm(data, this.formSerializer).toString();\n }\n\n if ((isFileList = utils.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {\n const _FormData = this.env && this.env.FormData;\n\n return toFormData(\n isFileList ? {'files[]': data} : data,\n _FormData && new _FormData(),\n this.formSerializer\n );\n }\n }\n\n if (isObjectPayload || hasJSONContentType ) {\n headers.setContentType('application/json', false);\n return stringifySafely(data);\n }\n\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n const transitional = this.transitional || defaults.transitional;\n const forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n const JSONRequested = this.responseType === 'json';\n\n if (data && utils.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {\n const silentJSONParsing = transitional && transitional.silentJSONParsing;\n const strictJSONParsing = !silentJSONParsing && JSONRequested;\n\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n env: {\n FormData: platform.classes.FormData,\n Blob: platform.classes.Blob\n },\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n },\n\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*',\n 'Content-Type': undefined\n }\n }\n};\n\nutils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {\n defaults.headers[method] = {};\n});\n\nexport default defaults;\n","'use strict';\n\nimport utils from './../utils.js';\n\n// RawAxiosHeaders whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nconst ignoreDuplicateOf = utils.toObjectSet([\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n]);\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} rawHeaders Headers needing to be parsed\n *\n * @returns {Object} Headers parsed into an object\n */\nexport default rawHeaders => {\n const parsed = {};\n let key;\n let val;\n let i;\n\n rawHeaders && rawHeaders.split('\\n').forEach(function parser(line) {\n i = line.indexOf(':');\n key = line.substring(0, i).trim().toLowerCase();\n val = line.substring(i + 1).trim();\n\n if (!key || (parsed[key] && ignoreDuplicateOf[key])) {\n return;\n }\n\n if (key === 'set-cookie') {\n if (parsed[key]) {\n parsed[key].push(val);\n } else {\n parsed[key] = [val];\n }\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n });\n\n return parsed;\n};\n","'use strict';\n\nimport utils from '../utils.js';\nimport parseHeaders from '../helpers/parseHeaders.js';\n\nconst $internals = Symbol('internals');\n\nfunction normalizeHeader(header) {\n return header && String(header).trim().toLowerCase();\n}\n\nfunction normalizeValue(value) {\n if (value === false || value == null) {\n return value;\n }\n\n return utils.isArray(value) ? value.map(normalizeValue) : String(value);\n}\n\nfunction parseTokens(str) {\n const tokens = Object.create(null);\n const tokensRE = /([^\\s,;=]+)\\s*(?:=\\s*([^,;]+))?/g;\n let match;\n\n while ((match = tokensRE.exec(str))) {\n tokens[match[1]] = match[2];\n }\n\n return tokens;\n}\n\nconst isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());\n\nfunction matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {\n if (utils.isFunction(filter)) {\n return filter.call(this, value, header);\n }\n\n if (isHeaderNameFilter) {\n value = header;\n }\n\n if (!utils.isString(value)) return;\n\n if (utils.isString(filter)) {\n return value.indexOf(filter) !== -1;\n }\n\n if (utils.isRegExp(filter)) {\n return filter.test(value);\n }\n}\n\nfunction formatHeader(header) {\n return header.trim()\n .toLowerCase().replace(/([a-z\\d])(\\w*)/g, (w, char, str) => {\n return char.toUpperCase() + str;\n });\n}\n\nfunction buildAccessors(obj, header) {\n const accessorName = utils.toCamelCase(' ' + header);\n\n ['get', 'set', 'has'].forEach(methodName => {\n Object.defineProperty(obj, methodName + accessorName, {\n value: function(arg1, arg2, arg3) {\n return this[methodName].call(this, header, arg1, arg2, arg3);\n },\n configurable: true\n });\n });\n}\n\nclass AxiosHeaders {\n constructor(headers) {\n headers && this.set(headers);\n }\n\n set(header, valueOrRewrite, rewrite) {\n const self = this;\n\n function setHeader(_value, _header, _rewrite) {\n const lHeader = normalizeHeader(_header);\n\n if (!lHeader) {\n throw new Error('header name must be a non-empty string');\n }\n\n const key = utils.findKey(self, lHeader);\n\n if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {\n self[key || _header] = normalizeValue(_value);\n }\n }\n\n const setHeaders = (headers, _rewrite) =>\n utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));\n\n if (utils.isPlainObject(header) || header instanceof this.constructor) {\n setHeaders(header, valueOrRewrite)\n } else if(utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {\n setHeaders(parseHeaders(header), valueOrRewrite);\n } else {\n header != null && setHeader(valueOrRewrite, header, rewrite);\n }\n\n return this;\n }\n\n get(header, parser) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n if (key) {\n const value = this[key];\n\n if (!parser) {\n return value;\n }\n\n if (parser === true) {\n return parseTokens(value);\n }\n\n if (utils.isFunction(parser)) {\n return parser.call(this, value, key);\n }\n\n if (utils.isRegExp(parser)) {\n return parser.exec(value);\n }\n\n throw new TypeError('parser must be boolean|regexp|function');\n }\n }\n }\n\n has(header, matcher) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));\n }\n\n return false;\n }\n\n delete(header, matcher) {\n const self = this;\n let deleted = false;\n\n function deleteHeader(_header) {\n _header = normalizeHeader(_header);\n\n if (_header) {\n const key = utils.findKey(self, _header);\n\n if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {\n delete self[key];\n\n deleted = true;\n }\n }\n }\n\n if (utils.isArray(header)) {\n header.forEach(deleteHeader);\n } else {\n deleteHeader(header);\n }\n\n return deleted;\n }\n\n clear(matcher) {\n const keys = Object.keys(this);\n let i = keys.length;\n let deleted = false;\n\n while (i--) {\n const key = keys[i];\n if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {\n delete this[key];\n deleted = true;\n }\n }\n\n return deleted;\n }\n\n normalize(format) {\n const self = this;\n const headers = {};\n\n utils.forEach(this, (value, header) => {\n const key = utils.findKey(headers, header);\n\n if (key) {\n self[key] = normalizeValue(value);\n delete self[header];\n return;\n }\n\n const normalized = format ? formatHeader(header) : String(header).trim();\n\n if (normalized !== header) {\n delete self[header];\n }\n\n self[normalized] = normalizeValue(value);\n\n headers[normalized] = true;\n });\n\n return this;\n }\n\n concat(...targets) {\n return this.constructor.concat(this, ...targets);\n }\n\n toJSON(asStrings) {\n const obj = Object.create(null);\n\n utils.forEach(this, (value, header) => {\n value != null && value !== false && (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value);\n });\n\n return obj;\n }\n\n [Symbol.iterator]() {\n return Object.entries(this.toJSON())[Symbol.iterator]();\n }\n\n toString() {\n return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\\n');\n }\n\n get [Symbol.toStringTag]() {\n return 'AxiosHeaders';\n }\n\n static from(thing) {\n return thing instanceof this ? thing : new this(thing);\n }\n\n static concat(first, ...targets) {\n const computed = new this(first);\n\n targets.forEach((target) => computed.set(target));\n\n return computed;\n }\n\n static accessor(header) {\n const internals = this[$internals] = (this[$internals] = {\n accessors: {}\n });\n\n const accessors = internals.accessors;\n const prototype = this.prototype;\n\n function defineAccessor(_header) {\n const lHeader = normalizeHeader(_header);\n\n if (!accessors[lHeader]) {\n buildAccessors(prototype, _header);\n accessors[lHeader] = true;\n }\n }\n\n utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);\n\n return this;\n }\n}\n\nAxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);\n\n// reserved names hotfix\nutils.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {\n let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`\n return {\n get: () => value,\n set(headerValue) {\n this[mapped] = headerValue;\n }\n }\n});\n\nutils.freezeMethods(AxiosHeaders);\n\nexport default AxiosHeaders;\n","'use strict';\n\nimport utils from './../utils.js';\nimport defaults from '../defaults/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Array|Function} fns A single function or Array of functions\n * @param {?Object} response The response object\n *\n * @returns {*} The resulting transformed data\n */\nexport default function transformData(fns, response) {\n const config = this || defaults;\n const context = response || config;\n const headers = AxiosHeaders.from(context.headers);\n let data = context.data;\n\n utils.forEach(fns, function transform(fn) {\n data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);\n });\n\n headers.normalize();\n\n return data;\n}\n","'use strict';\n\nexport default function isCancel(value) {\n return !!(value && value.__CANCEL__);\n}\n","'use strict';\n\nimport AxiosError from '../core/AxiosError.js';\nimport utils from '../utils.js';\n\n/**\n * A `CanceledError` is an object that is thrown when an operation is canceled.\n *\n * @param {string=} message The message.\n * @param {Object=} config The config.\n * @param {Object=} request The request.\n *\n * @returns {CanceledError} The created error.\n */\nfunction CanceledError(message, config, request) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);\n this.name = 'CanceledError';\n}\n\nutils.inherits(CanceledError, AxiosError, {\n __CANCEL__: true\n});\n\nexport default CanceledError;\n","'use strict';\n\nimport AxiosError from './AxiosError.js';\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n *\n * @returns {object} The response.\n */\nexport default function settle(resolve, reject, response) {\n const validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(new AxiosError(\n 'Request failed with status code ' + response.status,\n [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],\n response.config,\n response.request,\n response\n ));\n }\n}\n","import utils from './../utils.js';\nimport platform from '../platform/index.js';\n\nexport default platform.hasStandardBrowserEnv ?\n\n // Standard browser envs support document.cookie\n {\n write(name, value, expires, path, domain, secure) {\n const cookie = [name + '=' + encodeURIComponent(value)];\n\n utils.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());\n\n utils.isString(path) && cookie.push('path=' + path);\n\n utils.isString(domain) && cookie.push('domain=' + domain);\n\n secure === true && cookie.push('secure');\n\n document.cookie = cookie.join('; ');\n },\n\n read(name) {\n const match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n }\n\n :\n\n // Non-standard browser env (web workers, react-native) lack needed support.\n {\n write() {},\n read() {\n return null;\n },\n remove() {}\n };\n\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n *\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nexport default function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"<scheme>://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(url);\n}\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n *\n * @returns {string} The combined URL\n */\nexport default function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/?\\/$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n}\n","'use strict';\n\nimport isAbsoluteURL from '../helpers/isAbsoluteURL.js';\nimport combineURLs from '../helpers/combineURLs.js';\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n *\n * @returns {string} The combined full path\n */\nexport default function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n}\n","'use strict';\n\nimport utils from './../utils.js';\nimport platform from '../platform/index.js';\n\nexport default platform.hasStandardBrowserEnv ?\n\n// Standard browser envs have full support of the APIs needed to test\n// whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n const msie = /(msie|trident)/i.test(navigator.userAgent);\n const urlParsingNode = document.createElement('a');\n let originURL;\n\n /**\n * Parse a URL to discover its components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n let href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n const parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })();\n","'use strict';\n\nexport default function parseProtocol(url) {\n const match = /^([-+\\w]{1,25})(:?\\/\\/|:)/.exec(url);\n return match && match[1] || '';\n}\n","'use strict';\n\n/**\n * Calculate data maxRate\n * @param {Number} [samplesCount= 10]\n * @param {Number} [min= 1000]\n * @returns {Function}\n */\nfunction speedometer(samplesCount, min) {\n samplesCount = samplesCount || 10;\n const bytes = new Array(samplesCount);\n const timestamps = new Array(samplesCount);\n let head = 0;\n let tail = 0;\n let firstSampleTS;\n\n min = min !== undefined ? min : 1000;\n\n return function push(chunkLength) {\n const now = Date.now();\n\n const startedAt = timestamps[tail];\n\n if (!firstSampleTS) {\n firstSampleTS = now;\n }\n\n bytes[head] = chunkLength;\n timestamps[head] = now;\n\n let i = tail;\n let bytesCount = 0;\n\n while (i !== head) {\n bytesCount += bytes[i++];\n i = i % samplesCount;\n }\n\n head = (head + 1) % samplesCount;\n\n if (head === tail) {\n tail = (tail + 1) % samplesCount;\n }\n\n if (now - firstSampleTS < min) {\n return;\n }\n\n const passed = startedAt && now - startedAt;\n\n return passed ? Math.round(bytesCount * 1000 / passed) : undefined;\n };\n}\n\nexport default speedometer;\n","'use strict';\n\nimport utils from './../utils.js';\nimport settle from './../core/settle.js';\nimport cookies from './../helpers/cookies.js';\nimport buildURL from './../helpers/buildURL.js';\nimport buildFullPath from '../core/buildFullPath.js';\nimport isURLSameOrigin from './../helpers/isURLSameOrigin.js';\nimport transitionalDefaults from '../defaults/transitional.js';\nimport AxiosError from '../core/AxiosError.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport parseProtocol from '../helpers/parseProtocol.js';\nimport platform from '../platform/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport speedometer from '../helpers/speedometer.js';\n\nfunction progressEventReducer(listener, isDownloadStream) {\n let bytesNotified = 0;\n const _speedometer = speedometer(50, 250);\n\n return e => {\n const loaded = e.loaded;\n const total = e.lengthComputable ? e.total : undefined;\n const progressBytes = loaded - bytesNotified;\n const rate = _speedometer(progressBytes);\n const inRange = loaded <= total;\n\n bytesNotified = loaded;\n\n const data = {\n loaded,\n total,\n progress: total ? (loaded / total) : undefined,\n bytes: progressBytes,\n rate: rate ? rate : undefined,\n estimated: rate && total && inRange ? (total - loaded) / rate : undefined,\n event: e\n };\n\n data[isDownloadStream ? 'download' : 'upload'] = true;\n\n listener(data);\n };\n}\n\nconst isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';\n\nexport default isXHRAdapterSupported && function (config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n let requestData = config.data;\n const requestHeaders = AxiosHeaders.from(config.headers).normalize();\n let {responseType, withXSRFToken} = config;\n let onCanceled;\n function done() {\n if (config.cancelToken) {\n config.cancelToken.unsubscribe(onCanceled);\n }\n\n if (config.signal) {\n config.signal.removeEventListener('abort', onCanceled);\n }\n }\n\n let contentType;\n\n if (utils.isFormData(requestData)) {\n if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {\n requestHeaders.setContentType(false); // Let the browser set it\n } else if ((contentType = requestHeaders.getContentType()) !== false) {\n // fix semicolon duplication issue for ReactNative FormData implementation\n const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];\n requestHeaders.setContentType([type || 'multipart/form-data', ...tokens].join('; '));\n }\n }\n\n let request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n const username = config.auth.username || '';\n const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.set('Authorization', 'Basic ' + btoa(username + ':' + password));\n }\n\n const fullPath = buildFullPath(config.baseURL, config.url);\n\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n const responseHeaders = AxiosHeaders.from(\n 'getAllResponseHeaders' in request && request.getAllResponseHeaders()\n );\n const responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n const response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config,\n request\n };\n\n settle(function _resolve(value) {\n resolve(value);\n done();\n }, function _reject(err) {\n reject(err);\n done();\n }, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';\n const transitional = config.transitional || transitionalDefaults;\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(new AxiosError(\n timeoutErrorMessage,\n transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,\n config,\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if(platform.hasStandardBrowserEnv) {\n withXSRFToken && utils.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config));\n\n if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(fullPath))) {\n // Add xsrf header\n const xsrfValue = config.xsrfHeaderName && config.xsrfCookieName && cookies.read(config.xsrfCookieName);\n\n if (xsrfValue) {\n requestHeaders.set(config.xsrfHeaderName, xsrfValue);\n }\n }\n }\n\n // Remove Content-Type if data is undefined\n requestData === undefined && requestHeaders.setContentType(null);\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {\n request.setRequestHeader(key, val);\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = config.responseType;\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', progressEventReducer(config.onDownloadProgress, true));\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', progressEventReducer(config.onUploadProgress));\n }\n\n if (config.cancelToken || config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = cancel => {\n if (!request) {\n return;\n }\n reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);\n request.abort();\n request = null;\n };\n\n config.cancelToken && config.cancelToken.subscribe(onCanceled);\n if (config.signal) {\n config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);\n }\n }\n\n const protocol = parseProtocol(fullPath);\n\n if (protocol && platform.protocols.indexOf(protocol) === -1) {\n reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));\n return;\n }\n\n\n // Send the request\n request.send(requestData || null);\n });\n}\n","import utils from '../utils.js';\nimport httpAdapter from './http.js';\nimport xhrAdapter from './xhr.js';\nimport AxiosError from \"../core/AxiosError.js\";\n\nconst knownAdapters = {\n http: httpAdapter,\n xhr: xhrAdapter\n}\n\nutils.forEach(knownAdapters, (fn, value) => {\n if (fn) {\n try {\n Object.defineProperty(fn, 'name', {value});\n } catch (e) {\n // eslint-disable-next-line no-empty\n }\n Object.defineProperty(fn, 'adapterName', {value});\n }\n});\n\nconst renderReason = (reason) => `- ${reason}`;\n\nconst isResolvedHandle = (adapter) => utils.isFunction(adapter) || adapter === null || adapter === false;\n\nexport default {\n getAdapter: (adapters) => {\n adapters = utils.isArray(adapters) ? adapters : [adapters];\n\n const {length} = adapters;\n let nameOrAdapter;\n let adapter;\n\n const rejectedReasons = {};\n\n for (let i = 0; i < length; i++) {\n nameOrAdapter = adapters[i];\n let id;\n\n adapter = nameOrAdapter;\n\n if (!isResolvedHandle(nameOrAdapter)) {\n adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];\n\n if (adapter === undefined) {\n throw new AxiosError(`Unknown adapter '${id}'`);\n }\n }\n\n if (adapter) {\n break;\n }\n\n rejectedReasons[id || '#' + i] = adapter;\n }\n\n if (!adapter) {\n\n const reasons = Object.entries(rejectedReasons)\n .map(([id, state]) => `adapter ${id} ` +\n (state === false ? 'is not supported by the environment' : 'is not available in the build')\n );\n\n let s = length ?\n (reasons.length > 1 ? 'since :\\n' + reasons.map(renderReason).join('\\n') : ' ' + renderReason(reasons[0])) :\n 'as no adapter specified';\n\n throw new AxiosError(\n `There is no suitable adapter to dispatch the request ` + s,\n 'ERR_NOT_SUPPORT'\n );\n }\n\n return adapter;\n },\n adapters: knownAdapters\n}\n","'use strict';\n\nimport transformData from './transformData.js';\nimport isCancel from '../cancel/isCancel.js';\nimport defaults from '../defaults/index.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport adapters from \"../adapters/adapters.js\";\n\n/**\n * Throws a `CanceledError` if cancellation has been requested.\n *\n * @param {Object} config The config that is to be used for the request\n *\n * @returns {void}\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n\n if (config.signal && config.signal.aborted) {\n throw new CanceledError(null, config);\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n *\n * @returns {Promise} The Promise to be fulfilled\n */\nexport default function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n config.headers = AxiosHeaders.from(config.headers);\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.transformRequest\n );\n\n if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {\n config.headers.setContentType('application/x-www-form-urlencoded', false);\n }\n\n const adapter = adapters.getAdapter(config.adapter || defaults.adapter);\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n config.transformResponse,\n response\n );\n\n response.headers = AxiosHeaders.from(response.headers);\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n config.transformResponse,\n reason.response\n );\n reason.response.headers = AxiosHeaders.from(reason.response.headers);\n }\n }\n\n return Promise.reject(reason);\n });\n}\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosHeaders from \"./AxiosHeaders.js\";\n\nconst headersToObject = (thing) => thing instanceof AxiosHeaders ? thing.toJSON() : thing;\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n *\n * @returns {Object} New object resulting from merging config2 to config1\n */\nexport default function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n const config = {};\n\n function getMergedValue(target, source, caseless) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge.call({caseless}, target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDeepProperties(a, b, caseless) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(a, b, caseless);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a, caseless);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function valueFromConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function defaultToConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDirectKeys(a, b, prop) {\n if (prop in config2) {\n return getMergedValue(a, b);\n } else if (prop in config1) {\n return getMergedValue(undefined, a);\n }\n }\n\n const mergeMap = {\n url: valueFromConfig2,\n method: valueFromConfig2,\n data: valueFromConfig2,\n baseURL: defaultToConfig2,\n transformRequest: defaultToConfig2,\n transformResponse: defaultToConfig2,\n paramsSerializer: defaultToConfig2,\n timeout: defaultToConfig2,\n timeoutMessage: defaultToConfig2,\n withCredentials: defaultToConfig2,\n withXSRFToken: defaultToConfig2,\n adapter: defaultToConfig2,\n responseType: defaultToConfig2,\n xsrfCookieName: defaultToConfig2,\n xsrfHeaderName: defaultToConfig2,\n onUploadProgress: defaultToConfig2,\n onDownloadProgress: defaultToConfig2,\n decompress: defaultToConfig2,\n maxContentLength: defaultToConfig2,\n maxBodyLength: defaultToConfig2,\n beforeRedirect: defaultToConfig2,\n transport: defaultToConfig2,\n httpAgent: defaultToConfig2,\n httpsAgent: defaultToConfig2,\n cancelToken: defaultToConfig2,\n socketPath: defaultToConfig2,\n responseEncoding: defaultToConfig2,\n validateStatus: mergeDirectKeys,\n headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)\n };\n\n utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {\n const merge = mergeMap[prop] || mergeDeepProperties;\n const configValue = merge(config1[prop], config2[prop], prop);\n (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);\n });\n\n return config;\n}\n","export const VERSION = \"1.6.7\";","'use strict';\n\nimport {VERSION} from '../env/data.js';\nimport AxiosError from '../core/AxiosError.js';\n\nconst validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nconst deprecatedWarnings = {};\n\n/**\n * Transitional option validator\n *\n * @param {function|boolean?} validator - set to false if the transitional option has been removed\n * @param {string?} version - deprecated version / removed since version\n * @param {string?} message - some message with additional info\n *\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n function formatMessage(opt, desc) {\n return '[Axios v' + VERSION + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return (value, opt, opts) => {\n if (validator === false) {\n throw new AxiosError(\n formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),\n AxiosError.ERR_DEPRECATED\n );\n }\n\n if (version && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n *\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n *\n * @returns {object}\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);\n }\n const keys = Object.keys(options);\n let i = keys.length;\n while (i-- > 0) {\n const opt = keys[i];\n const validator = schema[opt];\n if (validator) {\n const value = options[opt];\n const result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);\n }\n }\n}\n\nexport default {\n assertOptions,\n validators\n};\n","'use strict';\n\nimport utils from './../utils.js';\nimport buildURL from '../helpers/buildURL.js';\nimport InterceptorManager from './InterceptorManager.js';\nimport dispatchRequest from './dispatchRequest.js';\nimport mergeConfig from './mergeConfig.js';\nimport buildFullPath from './buildFullPath.js';\nimport validator from '../helpers/validator.js';\nimport AxiosHeaders from './AxiosHeaders.js';\n\nconst validators = validator.validators;\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n *\n * @return {Axios} A new instance of Axios\n */\nclass Axios {\n constructor(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n }\n\n /**\n * Dispatch a request\n *\n * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)\n * @param {?Object} config\n *\n * @returns {Promise} The Promise to be fulfilled\n */\n async request(configOrUrl, config) {\n try {\n return await this._request(configOrUrl, config);\n } catch (err) {\n if (err instanceof Error) {\n let dummy;\n\n Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : (dummy = new Error());\n\n // slice off the Error: ... line\n const stack = dummy.stack ? dummy.stack.replace(/^.+\\n/, '') : '';\n\n if (!err.stack) {\n err.stack = stack;\n // match without the 2 top stack lines\n } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\\n.+\\n/, ''))) {\n err.stack += '\\n' + stack\n }\n }\n\n throw err;\n }\n }\n\n _request(configOrUrl, config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof configOrUrl === 'string') {\n config = config || {};\n config.url = configOrUrl;\n } else {\n config = configOrUrl || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n const {transitional, paramsSerializer, headers} = config;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean),\n forcedJSONParsing: validators.transitional(validators.boolean),\n clarifyTimeoutError: validators.transitional(validators.boolean)\n }, false);\n }\n\n if (paramsSerializer != null) {\n if (utils.isFunction(paramsSerializer)) {\n config.paramsSerializer = {\n serialize: paramsSerializer\n }\n } else {\n validator.assertOptions(paramsSerializer, {\n encode: validators.function,\n serialize: validators.function\n }, true);\n }\n }\n\n // Set config.method\n config.method = (config.method || this.defaults.method || 'get').toLowerCase();\n\n // Flatten headers\n let contextHeaders = headers && utils.merge(\n headers.common,\n headers[config.method]\n );\n\n headers && utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n (method) => {\n delete headers[method];\n }\n );\n\n config.headers = AxiosHeaders.concat(contextHeaders, headers);\n\n // filter out skipped interceptors\n const requestInterceptorChain = [];\n let synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n const responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n let promise;\n let i = 0;\n let len;\n\n if (!synchronousRequestInterceptors) {\n const chain = [dispatchRequest.bind(this), undefined];\n chain.unshift.apply(chain, requestInterceptorChain);\n chain.push.apply(chain, responseInterceptorChain);\n len = chain.length;\n\n promise = Promise.resolve(config);\n\n while (i < len) {\n promise = promise.then(chain[i++], chain[i++]);\n }\n\n return promise;\n }\n\n len = requestInterceptorChain.length;\n\n let newConfig = config;\n\n i = 0;\n\n while (i < len) {\n const onFulfilled = requestInterceptorChain[i++];\n const onRejected = requestInterceptorChain[i++];\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected.call(this, error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest.call(this, newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n i = 0;\n len = responseInterceptorChain.length;\n\n while (i < len) {\n promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);\n }\n\n return promise;\n }\n\n getUri(config) {\n config = mergeConfig(this.defaults, config);\n const fullPath = buildFullPath(config.baseURL, config.url);\n return buildURL(fullPath, config.params, config.paramsSerializer);\n }\n}\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n\n function generateHTTPMethod(isForm) {\n return function httpMethod(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n headers: isForm ? {\n 'Content-Type': 'multipart/form-data'\n } : {},\n url,\n data\n }));\n };\n }\n\n Axios.prototype[method] = generateHTTPMethod();\n\n Axios.prototype[method + 'Form'] = generateHTTPMethod(true);\n});\n\nexport default Axios;\n","'use strict';\n\nimport CanceledError from './CanceledError.js';\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @param {Function} executor The executor function.\n *\n * @returns {CancelToken}\n */\nclass CancelToken {\n constructor(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n let resolvePromise;\n\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n const token = this;\n\n // eslint-disable-next-line func-names\n this.promise.then(cancel => {\n if (!token._listeners) return;\n\n let i = token._listeners.length;\n\n while (i-- > 0) {\n token._listeners[i](cancel);\n }\n token._listeners = null;\n });\n\n // eslint-disable-next-line func-names\n this.promise.then = onfulfilled => {\n let _resolve;\n // eslint-disable-next-line func-names\n const promise = new Promise(resolve => {\n token.subscribe(resolve);\n _resolve = resolve;\n }).then(onfulfilled);\n\n promise.cancel = function reject() {\n token.unsubscribe(_resolve);\n };\n\n return promise;\n };\n\n executor(function cancel(message, config, request) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new CanceledError(message, config, request);\n resolvePromise(token.reason);\n });\n }\n\n /**\n * Throws a `CanceledError` if cancellation has been requested.\n */\n throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n }\n\n /**\n * Subscribe to the cancel signal\n */\n\n subscribe(listener) {\n if (this.reason) {\n listener(this.reason);\n return;\n }\n\n if (this._listeners) {\n this._listeners.push(listener);\n } else {\n this._listeners = [listener];\n }\n }\n\n /**\n * Unsubscribe from the cancel signal\n */\n\n unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n const index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n }\n\n /**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\n static source() {\n let cancel;\n const token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token,\n cancel\n };\n }\n}\n\nexport default CancelToken;\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n *\n * @returns {Function}\n */\nexport default function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n *\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nexport default function isAxiosError(payload) {\n return utils.isObject(payload) && (payload.isAxiosError === true);\n}\n","const HttpStatusCode = {\n Continue: 100,\n SwitchingProtocols: 101,\n Processing: 102,\n EarlyHints: 103,\n Ok: 200,\n Created: 201,\n Accepted: 202,\n NonAuthoritativeInformation: 203,\n NoContent: 204,\n ResetContent: 205,\n PartialContent: 206,\n MultiStatus: 207,\n AlreadyReported: 208,\n ImUsed: 226,\n MultipleChoices: 300,\n MovedPermanently: 301,\n Found: 302,\n SeeOther: 303,\n NotModified: 304,\n UseProxy: 305,\n Unused: 306,\n TemporaryRedirect: 307,\n PermanentRedirect: 308,\n BadRequest: 400,\n Unauthorized: 401,\n PaymentRequired: 402,\n Forbidden: 403,\n NotFound: 404,\n MethodNotAllowed: 405,\n NotAcceptable: 406,\n ProxyAuthenticationRequired: 407,\n RequestTimeout: 408,\n Conflict: 409,\n Gone: 410,\n LengthRequired: 411,\n PreconditionFailed: 412,\n PayloadTooLarge: 413,\n UriTooLong: 414,\n UnsupportedMediaType: 415,\n RangeNotSatisfiable: 416,\n ExpectationFailed: 417,\n ImATeapot: 418,\n MisdirectedRequest: 421,\n UnprocessableEntity: 422,\n Locked: 423,\n FailedDependency: 424,\n TooEarly: 425,\n UpgradeRequired: 426,\n PreconditionRequired: 428,\n TooManyRequests: 429,\n RequestHeaderFieldsTooLarge: 431,\n UnavailableForLegalReasons: 451,\n InternalServerError: 500,\n NotImplemented: 501,\n BadGateway: 502,\n ServiceUnavailable: 503,\n GatewayTimeout: 504,\n HttpVersionNotSupported: 505,\n VariantAlsoNegotiates: 506,\n InsufficientStorage: 507,\n LoopDetected: 508,\n NotExtended: 510,\n NetworkAuthenticationRequired: 511,\n};\n\nObject.entries(HttpStatusCode).forEach(([key, value]) => {\n HttpStatusCode[value] = key;\n});\n\nexport default HttpStatusCode;\n","'use strict';\n\nimport utils from './utils.js';\nimport bind from './helpers/bind.js';\nimport Axios from './core/Axios.js';\nimport mergeConfig from './core/mergeConfig.js';\nimport defaults from './defaults/index.js';\nimport formDataToJSON from './helpers/formDataToJSON.js';\nimport CanceledError from './cancel/CanceledError.js';\nimport CancelToken from './cancel/CancelToken.js';\nimport isCancel from './cancel/isCancel.js';\nimport {VERSION} from './env/data.js';\nimport toFormData from './helpers/toFormData.js';\nimport AxiosError from './core/AxiosError.js';\nimport spread from './helpers/spread.js';\nimport isAxiosError from './helpers/isAxiosError.js';\nimport AxiosHeaders from \"./core/AxiosHeaders.js\";\nimport adapters from './adapters/adapters.js';\nimport HttpStatusCode from './helpers/HttpStatusCode.js';\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n *\n * @returns {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n const context = new Axios(defaultConfig);\n const instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context, {allOwnKeys: true});\n\n // Copy context to instance\n utils.extend(instance, context, null, {allOwnKeys: true});\n\n // Factory for creating new instances\n instance.create = function create(instanceConfig) {\n return createInstance(mergeConfig(defaultConfig, instanceConfig));\n };\n\n return instance;\n}\n\n// Create the default instance to be exported\nconst axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Expose Cancel & CancelToken\naxios.CanceledError = CanceledError;\naxios.CancelToken = CancelToken;\naxios.isCancel = isCancel;\naxios.VERSION = VERSION;\naxios.toFormData = toFormData;\n\n// Expose AxiosError class\naxios.AxiosError = AxiosError;\n\n// alias for CanceledError for backward compatibility\naxios.Cancel = axios.CanceledError;\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\n\naxios.spread = spread;\n\n// Expose isAxiosError\naxios.isAxiosError = isAxiosError;\n\n// Expose mergeConfig\naxios.mergeConfig = mergeConfig;\n\naxios.AxiosHeaders = AxiosHeaders;\n\naxios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);\n\naxios.getAdapter = adapters.getAdapter;\n\naxios.HttpStatusCode = HttpStatusCode;\n\naxios.default = axios;\n\n// this module should only have a default export\nexport default axios\n"],"names":["bind","fn","thisArg","wrap","apply","arguments","toString","Object","prototype","getPrototypeOf","kindOf","cache","thing","str","call","slice","toLowerCase","create","kindOfTest","type","typeOfTest","isArray","Array","isUndefined","isBuffer","val","constructor","isFunction","isArrayBuffer","isArrayBufferView","result","ArrayBuffer","isView","buffer","isString","isNumber","isObject","isBoolean","isPlainObject","Symbol","toStringTag","iterator","isDate","isFile","isBlob","isFileList","isStream","pipe","isFormData","kind","FormData","append","isURLSearchParams","trim","replace","forEach","obj","allOwnKeys","i","l","length","keys","getOwnPropertyNames","len","key","findKey","_key","_global","globalThis","self","window","global","isContextDefined","context","merge","caseless","assignValue","targetKey","extend","a","b","stripBOM","content","charCodeAt","inherits","superConstructor","props","descriptors","defineProperty","value","assign","toFlatObject","sourceObj","destObj","filter","propFilter","prop","merged","endsWith","searchString","position","String","undefined","lastIndex","indexOf","toArray","arr","isTypedArray","TypedArray","Uint8Array","forEachEntry","generator","next","done","pair","matchAll","regExp","matches","exec","push","isHTMLForm","toCamelCase","replacer","m","p1","p2","toUpperCase","hasOwnProperty","isRegExp","reduceDescriptors","reducer","getOwnPropertyDescriptors","reducedDescriptors","descriptor","name","ret","defineProperties","freezeMethods","enumerable","writable","set","Error","toObjectSet","arrayOrString","delimiter","define","split","noop","toFiniteNumber","defaultValue","Number","isFinite","ALPHA","DIGIT","ALPHABET","ALPHA_DIGIT","generateString","size","alphabet","Math","random","isSpecCompliantForm","toJSONObject","stack","visit","source","target","reducedValue","isAsyncFn","isThenable","then","hasOwnProp","AxiosError","message","code","config","request","response","captureStackTrace","utils","toJSON","description","number","fileName","lineNumber","columnNumber","status","from","error","customProps","axiosError","cause","isVisitable","removeBrackets","renderKey","path","dots","concat","map","each","token","join","isFlatArray","some","predicates","test","toFormData","formData","options","TypeError","metaTokens","indexes","defined","option","visitor","defaultVisitor","_Blob","Blob","useBlob","convertValue","toISOString","Buffer","JSON","stringify","el","index","exposedHelpers","build","pop","encode","charMap","encodeURIComponent","match","AxiosURLSearchParams","params","_pairs","encoder","_encode","buildURL","url","serializeFn","serialize","serializedParams","hashmarkIndex","InterceptorManager","handlers","fulfilled","rejected","synchronous","runWhen","id","forEachHandler","h","silentJSONParsing","forcedJSONParsing","clarifyTimeoutError","URLSearchParams","isBrowser","classes","protocols","hasBrowserEnv","document","hasStandardBrowserEnv","product","navigator","hasStandardBrowserWebWorkerEnv","WorkerGlobalScope","importScripts","platform","toURLEncodedForm","data","helpers","isNode","parsePropPath","arrayToObject","formDataToJSON","buildPath","isNumericKey","isLast","entries","stringifySafely","rawValue","parser","parse","e","defaults","transitional","transitionalDefaults","adapter","transformRequest","headers","contentType","getContentType","hasJSONContentType","isObjectPayload","setContentType","formSerializer","_FormData","env","transformResponse","JSONRequested","responseType","strictJSONParsing","ERR_BAD_RESPONSE","timeout","xsrfCookieName","xsrfHeaderName","maxContentLength","maxBodyLength","validateStatus","common","method","ignoreDuplicateOf","rawHeaders","parsed","line","substring","$internals","normalizeHeader","header","normalizeValue","parseTokens","tokens","tokensRE","isValidHeaderName","matchHeaderValue","isHeaderNameFilter","formatHeader","w","char","buildAccessors","accessorName","methodName","arg1","arg2","arg3","configurable","AxiosHeaders","valueOrRewrite","rewrite","setHeader","_value","_header","_rewrite","lHeader","setHeaders","parseHeaders","matcher","deleted","deleteHeader","format","normalized","targets","asStrings","first","computed","internals","accessors","defineAccessor","accessor","mapped","get","headerValue","transformData","fns","transform","normalize","isCancel","__CANCEL__","CanceledError","ERR_CANCELED","settle","resolve","reject","ERR_BAD_REQUEST","floor","write","expires","domain","secure","cookie","Date","toGMTString","read","RegExp","decodeURIComponent","remove","now","isAbsoluteURL","combineURLs","baseURL","relativeURL","buildFullPath","requestedURL","standardBrowserEnv","msie","userAgent","urlParsingNode","createElement","originURL","resolveURL","href","setAttribute","protocol","host","search","hash","hostname","port","pathname","charAt","location","isURLSameOrigin","requestURL","nonStandardBrowserEnv","parseProtocol","speedometer","samplesCount","min","bytes","timestamps","head","tail","firstSampleTS","chunkLength","startedAt","bytesCount","passed","round","progressEventReducer","listener","isDownloadStream","bytesNotified","_speedometer","loaded","total","lengthComputable","progressBytes","rate","inRange","progress","estimated","event","isXHRAdapterSupported","XMLHttpRequest","Promise","dispatchXhrRequest","requestData","requestHeaders","withXSRFToken","onCanceled","cancelToken","unsubscribe","signal","removeEventListener","Boolean","auth","username","password","unescape","btoa","fullPath","open","paramsSerializer","onloadend","responseHeaders","getAllResponseHeaders","responseData","responseText","statusText","_resolve","_reject","err","onreadystatechange","handleLoad","readyState","responseURL","setTimeout","onabort","handleAbort","ECONNABORTED","onerror","handleError","ERR_NETWORK","ontimeout","handleTimeout","timeoutErrorMessage","ETIMEDOUT","xsrfValue","cookies","setRequestHeader","withCredentials","onDownloadProgress","addEventListener","onUploadProgress","upload","cancel","abort","subscribe","aborted","send","knownAdapters","http","httpAdapter","xhr","xhrAdapter","renderReason","reason","isResolvedHandle","getAdapter","adapters","nameOrAdapter","rejectedReasons","reasons","state","s","throwIfCancellationRequested","throwIfRequested","dispatchRequest","onAdapterResolution","onAdapterRejection","headersToObject","mergeConfig","config1","config2","getMergedValue","mergeDeepProperties","valueFromConfig2","defaultToConfig2","mergeDirectKeys","mergeMap","timeoutMessage","decompress","beforeRedirect","transport","httpAgent","httpsAgent","socketPath","responseEncoding","computeConfigValue","configValue","VERSION","validators","validator","deprecatedWarnings","version","formatMessage","opt","desc","opts","ERR_DEPRECATED","console","warn","assertOptions","schema","allowUnknown","ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","Axios","instanceConfig","interceptors","configOrUrl","_request","dummy","contextHeaders","requestInterceptorChain","synchronousRequestInterceptors","unshiftRequestInterceptors","interceptor","unshift","responseInterceptorChain","pushResponseInterceptors","promise","chain","newConfig","onFulfilled","onRejected","forEachMethodNoData","forEachMethodWithData","generateHTTPMethod","isForm","httpMethod","CancelToken","executor","resolvePromise","promiseExecutor","_listeners","onfulfilled","splice","c","spread","callback","isAxiosError","payload","HttpStatusCode","Continue","SwitchingProtocols","Processing","EarlyHints","Ok","Created","Accepted","NonAuthoritativeInformation","NoContent","ResetContent","PartialContent","MultiStatus","AlreadyReported","ImUsed","MultipleChoices","MovedPermanently","Found","SeeOther","NotModified","UseProxy","Unused","TemporaryRedirect","PermanentRedirect","BadRequest","Unauthorized","PaymentRequired","Forbidden","NotFound","MethodNotAllowed","NotAcceptable","ProxyAuthenticationRequired","RequestTimeout","Conflict","Gone","LengthRequired","PreconditionFailed","PayloadTooLarge","UriTooLong","UnsupportedMediaType","RangeNotSatisfiable","ExpectationFailed","ImATeapot","MisdirectedRequest","UnprocessableEntity","Locked","FailedDependency","TooEarly","UpgradeRequired","PreconditionRequired","TooManyRequests","RequestHeaderFieldsTooLarge","UnavailableForLegalReasons","InternalServerError","NotImplemented","BadGateway","ServiceUnavailable","GatewayTimeout","HttpVersionNotSupported","VariantAlsoNegotiates","InsufficientStorage","LoopDetected","NotExtended","NetworkAuthenticationRequired","createInstance","defaultConfig","instance","axios","Cancel","all","promises","formToJSON"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEe,SAASA,IAAI,CAACC,EAAE,EAAEC,OAAO,EAAE;IACxC,OAAO,SAASC,IAAI,GAAG;EACrB,IAAA,OAAOF,EAAE,CAACG,KAAK,CAACF,OAAO,EAAEG,SAAS,CAAC,CAAA;KACpC,CAAA;EACH;;ECFA;;EAEA,IAAOC,QAAQ,GAAIC,MAAM,CAACC,SAAS,CAA5BF,QAAQ,CAAA;EACf,IAAOG,cAAc,GAAIF,MAAM,CAAxBE,cAAc,CAAA;EAErB,IAAMC,MAAM,GAAI,UAAAC,KAAK,EAAA;IAAA,OAAI,UAAAC,KAAK,EAAI;EAC9B,IAAA,IAAMC,GAAG,GAAGP,QAAQ,CAACQ,IAAI,CAACF,KAAK,CAAC,CA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AAa,CAAA;EACnCoS,KAAK,CAAC/E,WAAW,GAAGA,aAAW,CAAA;EAC/B+E,KAAK,CAACtS,QAAQ,GAAGA,QAAQ,CAAA;EACzBsS,KAAK,CAACxH,OAAO,GAAGA,OAAO,CAAA;EACvBwH,KAAK,CAACvc,UAAU,GAAGA,UAAU,CAAA;;EAE7B;EACAuc,KAAK,CAACze,UAAU,GAAGA,UAAU,CAAA;;EAE7B;EACAye,KAAK,CAACC,MAAM,GAAGD,KAAK,CAACpS,aAAa,CAAA;;EAElC;EACAoS,KAAK,CAACE,GAAG,GAAG,SAASA,GAAG,CAACC,QAAQ,EAAE;EACjC,EAAA,OAAO3N,OAAO,CAAC0N,GAAG,CAACC,QAAQ,CAAC,CAAA;EAC9B,CAAC,CAAA;EAEDH,KAAK,CAACvE,MAAM,GAAGA,MAAM,CAAA;;EAErB;EACAuE,KAAK,CAACrE,YAAY,GAAGA,YAAY,CAAA;;EAEjC;EACAqE,KAAK,CAAC3I,WAAW,GAAGA,WAAW,CAAA;EAE/B2I,KAAK,CAACpU,YAAY,GAAGA,cAAY,CAAA;EAEjCoU,KAAK,CAACI,UAAU,GAAG,UAAA7oB,KAAK,EAAA;EAAA,EAAA,OAAIuQ,cAAc,CAAChG,OAAK,CAAC3D,UAAU,CAAC5G,KAAK,CAAC,GAAG,IAAIsC,QAAQ,CAACtC,KAAK,CAAC,GAAGA,KAAK,CAAC,CAAA;EAAA,CAAA,CAAA;EAEjGyoB,KAAK,CAACxJ,UAAU,GAAGC,QAAQ,CAACD,UAAU,CAAA;EAEtCwJ,KAAK,CAACnE,cAAc,GAAGA,gBAAc,CAAA;EAErCmE,KAAK,CAAA,SAAA,CAAQ,GAAGA,KAAK;;;;;;;;"} \ No newline at end of file
diff --git a/node_modules/axios/dist/axios.min.js b/node_modules/axios/dist/axios.min.js
new file mode 100644
index 0000000..b58abf2
--- /dev/null
+++ b/node_modules/axios/dist/axios.min.js
@@ -0,0 +1,2 @@
+!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).axios=t()}(this,(function(){"use strict";function e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function t(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?e(Object(n),!0).forEach((function(e){u(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):e(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function r(){r=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function u(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var o=t&&t.prototype instanceof h?t:h,i=Object.create(o.prototype),a=new R(n||[]);return i._invoke=function(e,t,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return j()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=E(a,r);if(s){if(s===l)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=f(e,t,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(e,r,a),i}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var l={};function h(){}function d(){}function p(){}var v={};u(v,i,(function(){return this}));var y=Object.getPrototypeOf,m=y&&y(y(A([])));m&&m!==t&&n.call(m,i)&&(v=m);var g=p.prototype=h.prototype=Object.create(v);function b(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){function r(o,i,a,s){var u=f(e[o],e,i);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==typeof l&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(l).then((function(e){c.value=e,a(c)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var o;this._invoke=function(e,n){function i(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(i,i):i()}}function E(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,E(e,t),"throw"===t.method))return l;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var n=f(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,l;var o=n.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,l):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,l)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function R(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function A(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,o=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:j}}function j(){return{value:void 0,done:!0}}return d.prototype=p,u(g,"constructor",p),u(p,"constructor",d),d.displayName=u(p,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,u(e,s,"GeneratorFunction")),e.prototype=Object.create(g),e},e.awrap=function(e){return{__await:e}},b(w.prototype),u(w.prototype,a,(function(){return this})),e.AsyncIterator=w,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new w(c(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},b(g),u(g,s,"Generator"),u(g,i,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=A,R.prototype={constructor:R,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(r,n){return a.type="throw",a.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,l):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),l},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),S(r),l}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:A(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},e}function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function s(e,t,r){return t&&a(e.prototype,t),r&&a(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function u(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c(e,t){return l(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,i=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw o}}return i}(e,t)||d(e,t)||v()}function f(e){return function(e){if(Array.isArray(e))return p(e)}(e)||h(e)||d(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e){if(Array.isArray(e))return e}function h(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function d(e,t){if(e){if("string"==typeof e)return p(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?p(e,t):void 0}}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function v(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function y(e,t){return function(){return e.apply(t,arguments)}}var m,g=Object.prototype.toString,b=Object.getPrototypeOf,w=(m=Object.create(null),function(e){var t=g.call(e);return m[t]||(m[t]=t.slice(8,-1).toLowerCase())}),E=function(e){return e=e.toLowerCase(),function(t){return w(t)===e}},O=function(e){return function(t){return n(t)===e}},S=Array.isArray,R=O("undefined");var A=E("ArrayBuffer");var j=O("string"),x=O("function"),T=O("number"),P=function(e){return null!==e&&"object"===n(e)},N=function(e){if("object"!==w(e))return!1;var t=b(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},k=E("Date"),_=E("File"),L=E("Blob"),C=E("FileList"),F=E("URLSearchParams");function U(e,t){var r,o,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=i.allOwnKeys,s=void 0!==a&&a;if(null!=e)if("object"!==n(e)&&(e=[e]),S(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{var u,c=s?Object.getOwnPropertyNames(e):Object.keys(e),f=c.length;for(r=0;r<f;r++)u=c[r],t.call(null,e[u],u,e)}}function D(e,t){t=t.toLowerCase();for(var r,n=Object.keys(e),o=n.length;o-- >0;)if(t===(r=n[o]).toLowerCase())return r;return null}var B="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,I=function(e){return!R(e)&&e!==B};var q,z=(q="undefined"!=typeof Uint8Array&&b(Uint8Array),function(e){return q&&e instanceof q}),M=E("HTMLFormElement"),H=function(e){var t=Object.prototype.hasOwnProperty;return function(e,r){return t.call(e,r)}}(),J=E("RegExp"),G=function(e,t){var r=Object.getOwnPropertyDescriptors(e),n={};U(r,(function(r,o){var i;!1!==(i=t(r,o,e))&&(n[o]=i||r)})),Object.defineProperties(e,n)},W="abcdefghijklmnopqrstuvwxyz",K="0123456789",V={DIGIT:K,ALPHA:W,ALPHA_DIGIT:W+W.toUpperCase()+K};var X=E("AsyncFunction"),$={isArray:S,isArrayBuffer:A,isBuffer:function(e){return null!==e&&!R(e)&&null!==e.constructor&&!R(e.constructor)&&x(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:function(e){var t;return e&&("function"==typeof FormData&&e instanceof FormData||x(e.append)&&("formdata"===(t=w(e))||"object"===t&&x(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&A(e.buffer)},isString:j,isNumber:T,isBoolean:function(e){return!0===e||!1===e},isObject:P,isPlainObject:N,isUndefined:R,isDate:k,isFile:_,isBlob:L,isRegExp:J,isFunction:x,isStream:function(e){return P(e)&&x(e.pipe)},isURLSearchParams:F,isTypedArray:z,isFileList:C,forEach:U,merge:function e(){for(var t=I(this)&&this||{},r=t.caseless,n={},o=function(t,o){var i=r&&D(n,o)||o;N(n[i])&&N(t)?n[i]=e(n[i],t):N(t)?n[i]=e({},t):S(t)?n[i]=t.slice():n[i]=t},i=0,a=arguments.length;i<a;i++)arguments[i]&&U(arguments[i],o);return n},extend:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=n.allOwnKeys;return U(t,(function(t,n){r&&x(t)?e[n]=y(t,r):e[n]=t}),{allOwnKeys:o}),e},trim:function(e){return e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e},inherits:function(e,t,r,n){e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:function(e,t,r,n){var o,i,a,s={};if(t=t||{},null==e)return t;do{for(i=(o=Object.getOwnPropertyNames(e)).length;i-- >0;)a=o[i],n&&!n(a,e,t)||s[a]||(t[a]=e[a],s[a]=!0);e=!1!==r&&b(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:w,kindOfTest:E,endsWith:function(e,t,r){e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;var n=e.indexOf(t,r);return-1!==n&&n===r},toArray:function(e){if(!e)return null;if(S(e))return e;var t=e.length;if(!T(t))return null;for(var r=new Array(t);t-- >0;)r[t]=e[t];return r},forEachEntry:function(e,t){for(var r,n=(e&&e[Symbol.iterator]).call(e);(r=n.next())&&!r.done;){var o=r.value;t.call(e,o[0],o[1])}},matchAll:function(e,t){for(var r,n=[];null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:M,hasOwnProperty:H,hasOwnProp:H,reduceDescriptors:G,freezeMethods:function(e){G(e,(function(t,r){if(x(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;var n=e[r];x(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=function(){throw Error("Can not rewrite read-only method '"+r+"'")}))}))},toObjectSet:function(e,t){var r={},n=function(e){e.forEach((function(e){r[e]=!0}))};return S(e)?n(e):n(String(e).split(t)),r},toCamelCase:function(e){return e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,r){return t.toUpperCase()+r}))},noop:function(){},toFiniteNumber:function(e,t){return e=+e,Number.isFinite(e)?e:t},findKey:D,global:B,isContextDefined:I,ALPHABET:V,generateString:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:V.ALPHA_DIGIT,r="",n=t.length;e--;)r+=t[Math.random()*n|0];return r},isSpecCompliantForm:function(e){return!!(e&&x(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:function(e){var t=new Array(10);return function e(r,n){if(P(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[n]=r;var o=S(r)?[]:{};return U(r,(function(t,r){var i=e(t,n+1);!R(i)&&(o[r]=i)})),t[n]=void 0,o}}return r}(e,0)},isAsyncFn:X,isThenable:function(e){return e&&(P(e)||x(e))&&x(e.then)&&x(e.catch)}};function Q(e,t,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o)}$.inherits(Q,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:$.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var Y=Q.prototype,Z={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((function(e){Z[e]={value:e}})),Object.defineProperties(Q,Z),Object.defineProperty(Y,"isAxiosError",{value:!0}),Q.from=function(e,t,r,n,o,i){var a=Object.create(Y);return $.toFlatObject(e,a,(function(e){return e!==Error.prototype}),(function(e){return"isAxiosError"!==e})),Q.call(a,e.message,t,r,n,o),a.cause=e,a.name=e.name,i&&Object.assign(a,i),a};function ee(e){return $.isPlainObject(e)||$.isArray(e)}function te(e){return $.endsWith(e,"[]")?e.slice(0,-2):e}function re(e,t,r){return e?e.concat(t).map((function(e,t){return e=te(e),!r&&t?"["+e+"]":e})).join(r?".":""):t}var ne=$.toFlatObject($,{},null,(function(e){return/^is[A-Z]/.test(e)}));function oe(e,t,r){if(!$.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;var o=(r=$.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!$.isUndefined(t[e])}))).metaTokens,i=r.visitor||f,a=r.dots,s=r.indexes,u=(r.Blob||"undefined"!=typeof Blob&&Blob)&&$.isSpecCompliantForm(t);if(!$.isFunction(i))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if($.isDate(e))return e.toISOString();if(!u&&$.isBlob(e))throw new Q("Blob is not supported. Use a Buffer instead.");return $.isArrayBuffer(e)||$.isTypedArray(e)?u&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function f(e,r,i){var u=e;if(e&&!i&&"object"===n(e))if($.endsWith(r,"{}"))r=o?r:r.slice(0,-2),e=JSON.stringify(e);else if($.isArray(e)&&function(e){return $.isArray(e)&&!e.some(ee)}(e)||($.isFileList(e)||$.endsWith(r,"[]"))&&(u=$.toArray(e)))return r=te(r),u.forEach((function(e,n){!$.isUndefined(e)&&null!==e&&t.append(!0===s?re([r],n,a):null===s?r:r+"[]",c(e))})),!1;return!!ee(e)||(t.append(re(i,r,a),c(e)),!1)}var l=[],h=Object.assign(ne,{defaultVisitor:f,convertValue:c,isVisitable:ee});if(!$.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!$.isUndefined(r)){if(-1!==l.indexOf(r))throw Error("Circular reference detected in "+n.join("."));l.push(r),$.forEach(r,(function(r,o){!0===(!($.isUndefined(r)||null===r)&&i.call(t,r,$.isString(o)?o.trim():o,n,h))&&e(r,n?n.concat(o):[o])})),l.pop()}}(e),t}function ie(e){var t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function ae(e,t){this._pairs=[],e&&oe(e,this,t)}var se=ae.prototype;function ue(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ce(e,t,r){if(!t)return e;var n,o=r&&r.encode||ue,i=r&&r.serialize;if(n=i?i(t,r):$.isURLSearchParams(t)?t.toString():new ae(t,r).toString(o)){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+n}return e}se.append=function(e,t){this._pairs.push([e,t])},se.toString=function(e){var t=e?function(t){return e.call(this,t,ie)}:ie;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var fe,le=function(){function e(){i(this,e),this.handlers=[]}return s(e,[{key:"use",value:function(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}},{key:"eject",value:function(e){this.handlers[e]&&(this.handlers[e]=null)}},{key:"clear",value:function(){this.handlers&&(this.handlers=[])}},{key:"forEach",value:function(e){$.forEach(this.handlers,(function(t){null!==t&&e(t)}))}}]),e}(),he={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},de={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:ae,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},pe="undefined"!=typeof window&&"undefined"!=typeof document,ve=(fe="undefined"!=typeof navigator&&navigator.product,pe&&["ReactNative","NativeScript","NS"].indexOf(fe)<0),ye="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,me=t(t({},Object.freeze({__proto__:null,hasBrowserEnv:pe,hasStandardBrowserWebWorkerEnv:ye,hasStandardBrowserEnv:ve})),de);function ge(e){function t(e,r,n,o){var i=e[o++];if("__proto__"===i)return!0;var a=Number.isFinite(+i),s=o>=e.length;return i=!i&&$.isArray(n)?n.length:i,s?($.hasOwnProp(n,i)?n[i]=[n[i],r]:n[i]=r,!a):(n[i]&&$.isObject(n[i])||(n[i]=[]),t(e,r,n[i],o)&&$.isArray(n[i])&&(n[i]=function(e){var t,r,n={},o=Object.keys(e),i=o.length;for(t=0;t<i;t++)n[r=o[t]]=e[r];return n}(n[i])),!a)}if($.isFormData(e)&&$.isFunction(e.entries)){var r={};return $.forEachEntry(e,(function(e,n){t(function(e){return $.matchAll(/\w+|\[(\w*)]/g,e).map((function(e){return"[]"===e[0]?"":e[1]||e[0]}))}(e),n,r,0)})),r}return null}var be={transitional:he,adapter:["xhr","http"],transformRequest:[function(e,t){var r,n=t.getContentType()||"",o=n.indexOf("application/json")>-1,i=$.isObject(e);if(i&&$.isHTMLForm(e)&&(e=new FormData(e)),$.isFormData(e))return o?JSON.stringify(ge(e)):e;if($.isArrayBuffer(e)||$.isBuffer(e)||$.isStream(e)||$.isFile(e)||$.isBlob(e))return e;if($.isArrayBufferView(e))return e.buffer;if($.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return oe(e,new me.classes.URLSearchParams,Object.assign({visitor:function(e,t,r,n){return me.isNode&&$.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((r=$.isFileList(e))||n.indexOf("multipart/form-data")>-1){var a=this.env&&this.env.FormData;return oe(r?{"files[]":e}:e,a&&new a,this.formSerializer)}}return i||o?(t.setContentType("application/json",!1),function(e,t,r){if($.isString(e))try{return(t||JSON.parse)(e),$.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||be.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(e&&$.isString(e)&&(r&&!this.responseType||n)){var o=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e)}catch(e){if(o){if("SyntaxError"===e.name)throw Q.from(e,Q.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:me.classes.FormData,Blob:me.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};$.forEach(["delete","get","head","post","put","patch"],(function(e){be.headers[e]={}}));var we=be,Ee=$.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Oe=Symbol("internals");function Se(e){return e&&String(e).trim().toLowerCase()}function Re(e){return!1===e||null==e?e:$.isArray(e)?e.map(Re):String(e)}function Ae(e,t,r,n,o){return $.isFunction(n)?n.call(this,t,r):(o&&(t=r),$.isString(t)?$.isString(n)?-1!==t.indexOf(n):$.isRegExp(n)?n.test(t):void 0:void 0)}var je=function(e,t){function r(e){i(this,r),e&&this.set(e)}return s(r,[{key:"set",value:function(e,t,r){var n=this;function o(e,t,r){var o=Se(t);if(!o)throw new Error("header name must be a non-empty string");var i=$.findKey(n,o);(!i||void 0===n[i]||!0===r||void 0===r&&!1!==n[i])&&(n[i||t]=Re(e))}var i,a,s,u,c,f=function(e,t){return $.forEach(e,(function(e,r){return o(e,r,t)}))};return $.isPlainObject(e)||e instanceof this.constructor?f(e,t):$.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?f((c={},(i=e)&&i.split("\n").forEach((function(e){u=e.indexOf(":"),a=e.substring(0,u).trim().toLowerCase(),s=e.substring(u+1).trim(),!a||c[a]&&Ee[a]||("set-cookie"===a?c[a]?c[a].push(s):c[a]=[s]:c[a]=c[a]?c[a]+", "+s:s)})),c),t):null!=e&&o(t,e,r),this}},{key:"get",value:function(e,t){if(e=Se(e)){var r=$.findKey(this,e);if(r){var n=this[r];if(!t)return n;if(!0===t)return function(e){for(var t,r=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;t=n.exec(e);)r[t[1]]=t[2];return r}(n);if($.isFunction(t))return t.call(this,n,r);if($.isRegExp(t))return t.exec(n);throw new TypeError("parser must be boolean|regexp|function")}}}},{key:"has",value:function(e,t){if(e=Se(e)){var r=$.findKey(this,e);return!(!r||void 0===this[r]||t&&!Ae(0,this[r],r,t))}return!1}},{key:"delete",value:function(e,t){var r=this,n=!1;function o(e){if(e=Se(e)){var o=$.findKey(r,e);!o||t&&!Ae(0,r[o],o,t)||(delete r[o],n=!0)}}return $.isArray(e)?e.forEach(o):o(e),n}},{key:"clear",value:function(e){for(var t=Object.keys(this),r=t.length,n=!1;r--;){var o=t[r];e&&!Ae(0,this[o],o,e,!0)||(delete this[o],n=!0)}return n}},{key:"normalize",value:function(e){var t=this,r={};return $.forEach(this,(function(n,o){var i=$.findKey(r,o);if(i)return t[i]=Re(n),void delete t[o];var a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(function(e,t,r){return t.toUpperCase()+r}))}(o):String(o).trim();a!==o&&delete t[o],t[a]=Re(n),r[a]=!0})),this}},{key:"concat",value:function(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return(e=this.constructor).concat.apply(e,[this].concat(r))}},{key:"toJSON",value:function(e){var t=Object.create(null);return $.forEach(this,(function(r,n){null!=r&&!1!==r&&(t[n]=e&&$.isArray(r)?r.join(", "):r)})),t}},{key:Symbol.iterator,value:function(){return Object.entries(this.toJSON())[Symbol.iterator]()}},{key:"toString",value:function(){return Object.entries(this.toJSON()).map((function(e){var t=c(e,2);return t[0]+": "+t[1]})).join("\n")}},{key:Symbol.toStringTag,get:function(){return"AxiosHeaders"}}],[{key:"from",value:function(e){return e instanceof this?e:new this(e)}},{key:"concat",value:function(e){for(var t=new this(e),r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return n.forEach((function(e){return t.set(e)})),t}},{key:"accessor",value:function(e){var t=(this[Oe]=this[Oe]={accessors:{}}).accessors,r=this.prototype;function n(e){var n=Se(e);t[n]||(!function(e,t){var r=$.toCamelCase(" "+t);["get","set","has"].forEach((function(n){Object.defineProperty(e,n+r,{value:function(e,r,o){return this[n].call(this,t,e,r,o)},configurable:!0})}))}(r,e),t[n]=!0)}return $.isArray(e)?e.forEach(n):n(e),this}}]),r}();je.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),$.reduceDescriptors(je.prototype,(function(e,t){var r=e.value,n=t[0].toUpperCase()+t.slice(1);return{get:function(){return r},set:function(e){this[n]=e}}})),$.freezeMethods(je);var xe=je;function Te(e,t){var r=this||we,n=t||r,o=xe.from(n.headers),i=n.data;return $.forEach(e,(function(e){i=e.call(r,i,o.normalize(),t?t.status:void 0)})),o.normalize(),i}function Pe(e){return!(!e||!e.__CANCEL__)}function Ne(e,t,r){Q.call(this,null==e?"canceled":e,Q.ERR_CANCELED,t,r),this.name="CanceledError"}$.inherits(Ne,Q,{__CANCEL__:!0});var ke=me.hasStandardBrowserEnv?{write:function(e,t,r,n,o,i){var a=[e+"="+encodeURIComponent(t)];$.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),$.isString(n)&&a.push("path="+n),$.isString(o)&&a.push("domain="+o),!0===i&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function _e(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}var Le=me.hasStandardBrowserEnv?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function n(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=n(window.location.href),function(t){var r=$.isString(t)?n(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0};function Ce(e,t){var r=0,n=function(e,t){e=e||10;var r,n=new Array(e),o=new Array(e),i=0,a=0;return t=void 0!==t?t:1e3,function(s){var u=Date.now(),c=o[a];r||(r=u),n[i]=s,o[i]=u;for(var f=a,l=0;f!==i;)l+=n[f++],f%=e;if((i=(i+1)%e)===a&&(a=(a+1)%e),!(u-r<t)){var h=c&&u-c;return h?Math.round(1e3*l/h):void 0}}}(50,250);return function(o){var i=o.loaded,a=o.lengthComputable?o.total:void 0,s=i-r,u=n(s);r=i;var c={loaded:i,total:a,progress:a?i/a:void 0,bytes:s,rate:u||void 0,estimated:u&&a&&i<=a?(a-i)/u:void 0,event:o};c[t?"download":"upload"]=!0,e(c)}}var Fe={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,r){var n,o,i,a=e.data,s=xe.from(e.headers).normalize(),u=e.responseType,c=e.withXSRFToken;function p(){e.cancelToken&&e.cancelToken.unsubscribe(n),e.signal&&e.signal.removeEventListener("abort",n)}if($.isFormData(a))if(me.hasStandardBrowserEnv||me.hasStandardBrowserWebWorkerEnv)s.setContentType(!1);else if(!1!==(o=s.getContentType())){var y=o?o.split(";").map((function(e){return e.trim()})).filter(Boolean):[],m=l(i=y)||h(i)||d(i)||v(),g=m[0],b=m.slice(1);s.setContentType([g||"multipart/form-data"].concat(f(b)).join("; "))}var w=new XMLHttpRequest;if(e.auth){var E=e.auth.username||"",O=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";s.set("Authorization","Basic "+btoa(E+":"+O))}var S=_e(e.baseURL,e.url);function R(){if(w){var n=xe.from("getAllResponseHeaders"in w&&w.getAllResponseHeaders());!function(e,t,r){var n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new Q("Request failed with status code "+r.status,[Q.ERR_BAD_REQUEST,Q.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}((function(e){t(e),p()}),(function(e){r(e),p()}),{data:u&&"text"!==u&&"json"!==u?w.response:w.responseText,status:w.status,statusText:w.statusText,headers:n,config:e,request:w}),w=null}}if(w.open(e.method.toUpperCase(),ce(S,e.params,e.paramsSerializer),!0),w.timeout=e.timeout,"onloadend"in w?w.onloadend=R:w.onreadystatechange=function(){w&&4===w.readyState&&(0!==w.status||w.responseURL&&0===w.responseURL.indexOf("file:"))&&setTimeout(R)},w.onabort=function(){w&&(r(new Q("Request aborted",Q.ECONNABORTED,e,w)),w=null)},w.onerror=function(){r(new Q("Network Error",Q.ERR_NETWORK,e,w)),w=null},w.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",n=e.transitional||he;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(new Q(t,n.clarifyTimeoutError?Q.ETIMEDOUT:Q.ECONNABORTED,e,w)),w=null},me.hasStandardBrowserEnv&&(c&&$.isFunction(c)&&(c=c(e)),c||!1!==c&&Le(S))){var A=e.xsrfHeaderName&&e.xsrfCookieName&&ke.read(e.xsrfCookieName);A&&s.set(e.xsrfHeaderName,A)}void 0===a&&s.setContentType(null),"setRequestHeader"in w&&$.forEach(s.toJSON(),(function(e,t){w.setRequestHeader(t,e)})),$.isUndefined(e.withCredentials)||(w.withCredentials=!!e.withCredentials),u&&"json"!==u&&(w.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&w.addEventListener("progress",Ce(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&w.upload&&w.upload.addEventListener("progress",Ce(e.onUploadProgress)),(e.cancelToken||e.signal)&&(n=function(t){w&&(r(!t||t.type?new Ne(null,e,w):t),w.abort(),w=null)},e.cancelToken&&e.cancelToken.subscribe(n),e.signal&&(e.signal.aborted?n():e.signal.addEventListener("abort",n)));var j,x=(j=/^([-+\w]{1,25})(:?\/\/|:)/.exec(S))&&j[1]||"";x&&-1===me.protocols.indexOf(x)?r(new Q("Unsupported protocol "+x+":",Q.ERR_BAD_REQUEST,e)):w.send(a||null)}))}};$.forEach(Fe,(function(e,t){if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));var Ue=function(e){return"- ".concat(e)},De=function(e){return $.isFunction(e)||null===e||!1===e},Be=function(e){for(var t,r,n=(e=$.isArray(e)?e:[e]).length,o={},i=0;i<n;i++){var a=void 0;if(r=t=e[i],!De(t)&&void 0===(r=Fe[(a=String(t)).toLowerCase()]))throw new Q("Unknown adapter '".concat(a,"'"));if(r)break;o[a||"#"+i]=r}if(!r){var s=Object.entries(o).map((function(e){var t=c(e,2),r=t[0],n=t[1];return"adapter ".concat(r," ")+(!1===n?"is not supported by the environment":"is not available in the build")}));throw new Q("There is no suitable adapter to dispatch the request "+(n?s.length>1?"since :\n"+s.map(Ue).join("\n"):" "+Ue(s[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return r};function Ie(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ne(null,e)}function qe(e){return Ie(e),e.headers=xe.from(e.headers),e.data=Te.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Be(e.adapter||we.adapter)(e).then((function(t){return Ie(e),t.data=Te.call(e,e.transformResponse,t),t.headers=xe.from(t.headers),t}),(function(t){return Pe(t)||(Ie(e),t&&t.response&&(t.response.data=Te.call(e,e.transformResponse,t.response),t.response.headers=xe.from(t.response.headers))),Promise.reject(t)}))}var ze=function(e){return e instanceof xe?e.toJSON():e};function Me(e,t){t=t||{};var r={};function n(e,t,r){return $.isPlainObject(e)&&$.isPlainObject(t)?$.merge.call({caseless:r},e,t):$.isPlainObject(t)?$.merge({},t):$.isArray(t)?t.slice():t}function o(e,t,r){return $.isUndefined(t)?$.isUndefined(e)?void 0:n(void 0,e,r):n(e,t,r)}function i(e,t){if(!$.isUndefined(t))return n(void 0,t)}function a(e,t){return $.isUndefined(t)?$.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function s(r,o,i){return i in t?n(r,o):i in e?n(void 0,r):void 0}var u={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:function(e,t){return o(ze(e),ze(t),!0)}};return $.forEach(Object.keys(Object.assign({},e,t)),(function(n){var i=u[n]||o,a=i(e[n],t[n],n);$.isUndefined(a)&&i!==s||(r[n]=a)})),r}var He="1.6.7",Je={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){Je[e]=function(r){return n(r)===e||"a"+(t<1?"n ":" ")+e}}));var Ge={};Je.transitional=function(e,t,r){function n(e,t){return"[Axios v1.6.7] Transitional option '"+e+"'"+t+(r?". "+r:"")}return function(r,o,i){if(!1===e)throw new Q(n(o," has been removed"+(t?" in "+t:"")),Q.ERR_DEPRECATED);return t&&!Ge[o]&&(Ge[o]=!0,console.warn(n(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,o,i)}};var We={assertOptions:function(e,t,r){if("object"!==n(e))throw new Q("options must be an object",Q.ERR_BAD_OPTION_VALUE);for(var o=Object.keys(e),i=o.length;i-- >0;){var a=o[i],s=t[a];if(s){var u=e[a],c=void 0===u||s(u,a,e);if(!0!==c)throw new Q("option "+a+" must be "+c,Q.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new Q("Unknown option "+a,Q.ERR_BAD_OPTION)}},validators:Je},Ke=We.validators,Ve=function(){function e(t){i(this,e),this.defaults=t,this.interceptors={request:new le,response:new le}}var t,n;return s(e,[{key:"request",value:(t=r().mark((function e(t,n){var o,i;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._request(t,n);case 3:return e.abrupt("return",e.sent);case 6:throw e.prev=6,e.t0=e.catch(0),e.t0 instanceof Error&&(Error.captureStackTrace?Error.captureStackTrace(o={}):o=new Error,i=o.stack?o.stack.replace(/^.+\n/,""):"",e.t0.stack?i&&!String(e.t0.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(e.t0.stack+="\n"+i):e.t0.stack=i),e.t0;case 10:case"end":return e.stop()}}),e,this,[[0,6]])})),n=function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function s(e){o(a,n,i,s,u,"next",e)}function u(e){o(a,n,i,s,u,"throw",e)}s(void 0)}))},function(e,t){return n.apply(this,arguments)})},{key:"_request",value:function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{};var r=t=Me(this.defaults,t),n=r.transitional,o=r.paramsSerializer,i=r.headers;void 0!==n&&We.assertOptions(n,{silentJSONParsing:Ke.transitional(Ke.boolean),forcedJSONParsing:Ke.transitional(Ke.boolean),clarifyTimeoutError:Ke.transitional(Ke.boolean)},!1),null!=o&&($.isFunction(o)?t.paramsSerializer={serialize:o}:We.assertOptions(o,{encode:Ke.function,serialize:Ke.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();var a=i&&$.merge(i.common,i[t.method]);i&&$.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete i[e]})),t.headers=xe.concat(a,i);var s=[],u=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(u=u&&e.synchronous,s.unshift(e.fulfilled,e.rejected))}));var c,f=[];this.interceptors.response.forEach((function(e){f.push(e.fulfilled,e.rejected)}));var l,h=0;if(!u){var d=[qe.bind(this),void 0];for(d.unshift.apply(d,s),d.push.apply(d,f),l=d.length,c=Promise.resolve(t);h<l;)c=c.then(d[h++],d[h++]);return c}l=s.length;var p=t;for(h=0;h<l;){var v=s[h++],y=s[h++];try{p=v(p)}catch(e){y.call(this,e);break}}try{c=qe.call(this,p)}catch(e){return Promise.reject(e)}for(h=0,l=f.length;h<l;)c=c.then(f[h++],f[h++]);return c}},{key:"getUri",value:function(e){return ce(_e((e=Me(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}]),e}();$.forEach(["delete","get","head","options"],(function(e){Ve.prototype[e]=function(t,r){return this.request(Me(r||{},{method:e,url:t,data:(r||{}).data}))}})),$.forEach(["post","put","patch"],(function(e){function t(t){return function(r,n,o){return this.request(Me(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}Ve.prototype[e]=t(),Ve.prototype[e+"Form"]=t(!0)}));var Xe=Ve,$e=function(){function e(t){if(i(this,e),"function"!=typeof t)throw new TypeError("executor must be a function.");var r;this.promise=new Promise((function(e){r=e}));var n=this;this.promise.then((function(e){if(n._listeners){for(var t=n._listeners.length;t-- >0;)n._listeners[t](e);n._listeners=null}})),this.promise.then=function(e){var t,r=new Promise((function(e){n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},t((function(e,t,o){n.reason||(n.reason=new Ne(e,t,o),r(n.reason))}))}return s(e,[{key:"throwIfRequested",value:function(){if(this.reason)throw this.reason}},{key:"subscribe",value:function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}},{key:"unsubscribe",value:function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}}}],[{key:"source",value:function(){var t;return{token:new e((function(e){t=e})),cancel:t}}}]),e}();var Qe={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Qe).forEach((function(e){var t=c(e,2),r=t[0],n=t[1];Qe[n]=r}));var Ye=Qe;var Ze=function e(t){var r=new Xe(t),n=y(Xe.prototype.request,r);return $.extend(n,Xe.prototype,r,{allOwnKeys:!0}),$.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return e(Me(t,r))},n}(we);return Ze.Axios=Xe,Ze.CanceledError=Ne,Ze.CancelToken=$e,Ze.isCancel=Pe,Ze.VERSION=He,Ze.toFormData=oe,Ze.AxiosError=Q,Ze.Cancel=Ze.CanceledError,Ze.all=function(e){return Promise.all(e)},Ze.spread=function(e){return function(t){return e.apply(null,t)}},Ze.isAxiosError=function(e){return $.isObject(e)&&!0===e.isAxiosError},Ze.mergeConfig=Me,Ze.AxiosHeaders=xe,Ze.formToJSON=function(e){return ge($.isHTMLForm(e)?new FormData(e):e)},Ze.getAdapter=Be,Ze.HttpStatusCode=Ye,Ze.default=Ze,Ze}));
+//# sourceMappingURL=axios.min.js.map
diff --git a/node_modules/axios/dist/axios.min.js.map b/node_modules/axios/dist/axios.min.js.map
new file mode 100644
index 0000000..26ffe03
--- /dev/null
+++ b/node_modules/axios/dist/axios.min.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"axios.min.js","sources":["../lib/helpers/bind.js","../lib/utils.js","../lib/core/AxiosError.js","../lib/helpers/toFormData.js","../lib/helpers/AxiosURLSearchParams.js","../lib/helpers/buildURL.js","../lib/core/InterceptorManager.js","../lib/platform/common/utils.js","../lib/defaults/transitional.js","../lib/platform/browser/index.js","../lib/platform/browser/classes/URLSearchParams.js","../lib/platform/browser/classes/FormData.js","../lib/platform/browser/classes/Blob.js","../lib/platform/index.js","../lib/helpers/formDataToJSON.js","../lib/defaults/index.js","../lib/helpers/toURLEncodedForm.js","../lib/helpers/parseHeaders.js","../lib/core/AxiosHeaders.js","../lib/core/transformData.js","../lib/cancel/isCancel.js","../lib/cancel/CanceledError.js","../lib/helpers/cookies.js","../lib/core/buildFullPath.js","../lib/helpers/isAbsoluteURL.js","../lib/helpers/combineURLs.js","../lib/helpers/isURLSameOrigin.js","../lib/adapters/xhr.js","../lib/helpers/speedometer.js","../lib/adapters/adapters.js","../lib/helpers/null.js","../lib/core/settle.js","../lib/helpers/parseProtocol.js","../lib/core/dispatchRequest.js","../lib/core/mergeConfig.js","../lib/env/data.js","../lib/helpers/validator.js","../lib/core/Axios.js","../lib/cancel/CancelToken.js","../lib/helpers/HttpStatusCode.js","../lib/axios.js","../lib/helpers/spread.js","../lib/helpers/isAxiosError.js"],"sourcesContent":["'use strict';\n\nexport default function bind(fn, thisArg) {\n return function wrap() {\n return fn.apply(thisArg, arguments);\n };\n}\n","'use strict';\n\nimport bind from './helpers/bind.js';\n\n// utils is a library of generic helper functions non-specific to axios\n\nconst {toString} = Object.prototype;\nconst {getPrototypeOf} = Object;\n\nconst kindOf = (cache => thing => {\n const str = toString.call(thing);\n return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());\n})(Object.create(null));\n\nconst kindOfTest = (type) => {\n type = type.toLowerCase();\n return (thing) => kindOf(thing) === type\n}\n\nconst typeOfTest = type => thing => typeof thing === type;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n *\n * @returns {boolean} True if value is an Array, otherwise false\n */\nconst {isArray} = Array;\n\n/**\n * Determine if a value is undefined\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nconst isUndefined = typeOfTest('undefined');\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nconst isArrayBuffer = kindOfTest('ArrayBuffer');\n\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n let result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a String, otherwise false\n */\nconst isString = typeOfTest('string');\n\n/**\n * Determine if a value is a Function\n *\n * @param {*} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nconst isFunction = typeOfTest('function');\n\n/**\n * Determine if a value is a Number\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Number, otherwise false\n */\nconst isNumber = typeOfTest('number');\n\n/**\n * Determine if a value is an Object\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an Object, otherwise false\n */\nconst isObject = (thing) => thing !== null && typeof thing === 'object';\n\n/**\n * Determine if a value is a Boolean\n *\n * @param {*} thing The value to test\n * @returns {boolean} True if value is a Boolean, otherwise false\n */\nconst isBoolean = thing => thing === true || thing === false;\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a plain Object, otherwise false\n */\nconst isPlainObject = (val) => {\n if (kindOf(val) !== 'object') {\n return false;\n }\n\n const prototype = getPrototypeOf(val);\n return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Date, otherwise false\n */\nconst isDate = kindOfTest('Date');\n\n/**\n * Determine if a value is a File\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFile = kindOfTest('File');\n\n/**\n * Determine if a value is a Blob\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nconst isBlob = kindOfTest('Blob');\n\n/**\n * Determine if a value is a FileList\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFileList = kindOfTest('FileList');\n\n/**\n * Determine if a value is a Stream\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nconst isStream = (val) => isObject(val) && isFunction(val.pipe);\n\n/**\n * Determine if a value is a FormData\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nconst isFormData = (thing) => {\n let kind;\n return thing && (\n (typeof FormData === 'function' && thing instanceof FormData) || (\n isFunction(thing.append) && (\n (kind = kindOf(thing)) === 'formdata' ||\n // detect form-data instance\n (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')\n )\n )\n )\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nconst isURLSearchParams = kindOfTest('URLSearchParams');\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n *\n * @returns {String} The String freed of excess whitespace\n */\nconst trim = (str) => str.trim ?\n str.trim() : str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n *\n * @param {Boolean} [allOwnKeys = false]\n * @returns {any}\n */\nfunction forEach(obj, fn, {allOwnKeys = false} = {}) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n let i;\n let l;\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);\n const len = keys.length;\n let key;\n\n for (i = 0; i < len; i++) {\n key = keys[i];\n fn.call(null, obj[key], key, obj);\n }\n }\n}\n\nfunction findKey(obj, key) {\n key = key.toLowerCase();\n const keys = Object.keys(obj);\n let i = keys.length;\n let _key;\n while (i-- > 0) {\n _key = keys[i];\n if (key === _key.toLowerCase()) {\n return _key;\n }\n }\n return null;\n}\n\nconst _global = (() => {\n /*eslint no-undef:0*/\n if (typeof globalThis !== \"undefined\") return globalThis;\n return typeof self !== \"undefined\" ? self : (typeof window !== 'undefined' ? window : global)\n})();\n\nconst isContextDefined = (context) => !isUndefined(context) && context !== _global;\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n *\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n const {caseless} = isContextDefined(this) && this || {};\n const result = {};\n const assignValue = (val, key) => {\n const targetKey = caseless && findKey(result, key) || key;\n if (isPlainObject(result[targetKey]) && isPlainObject(val)) {\n result[targetKey] = merge(result[targetKey], val);\n } else if (isPlainObject(val)) {\n result[targetKey] = merge({}, val);\n } else if (isArray(val)) {\n result[targetKey] = val.slice();\n } else {\n result[targetKey] = val;\n }\n }\n\n for (let i = 0, l = arguments.length; i < l; i++) {\n arguments[i] && forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n *\n * @param {Boolean} [allOwnKeys]\n * @returns {Object} The resulting value of object a\n */\nconst extend = (a, b, thisArg, {allOwnKeys}= {}) => {\n forEach(b, (val, key) => {\n if (thisArg && isFunction(val)) {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n }, {allOwnKeys});\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n *\n * @returns {string} content value without BOM\n */\nconst stripBOM = (content) => {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\n/**\n * Inherit the prototype methods from one constructor into another\n * @param {function} constructor\n * @param {function} superConstructor\n * @param {object} [props]\n * @param {object} [descriptors]\n *\n * @returns {void}\n */\nconst inherits = (constructor, superConstructor, props, descriptors) => {\n constructor.prototype = Object.create(superConstructor.prototype, descriptors);\n constructor.prototype.constructor = constructor;\n Object.defineProperty(constructor, 'super', {\n value: superConstructor.prototype\n });\n props && Object.assign(constructor.prototype, props);\n}\n\n/**\n * Resolve object with deep prototype chain to a flat object\n * @param {Object} sourceObj source object\n * @param {Object} [destObj]\n * @param {Function|Boolean} [filter]\n * @param {Function} [propFilter]\n *\n * @returns {Object}\n */\nconst toFlatObject = (sourceObj, destObj, filter, propFilter) => {\n let props;\n let i;\n let prop;\n const merged = {};\n\n destObj = destObj || {};\n // eslint-disable-next-line no-eq-null,eqeqeq\n if (sourceObj == null) return destObj;\n\n do {\n props = Object.getOwnPropertyNames(sourceObj);\n i = props.length;\n while (i-- > 0) {\n prop = props[i];\n if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {\n destObj[prop] = sourceObj[prop];\n merged[prop] = true;\n }\n }\n sourceObj = filter !== false && getPrototypeOf(sourceObj);\n } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);\n\n return destObj;\n}\n\n/**\n * Determines whether a string ends with the characters of a specified string\n *\n * @param {String} str\n * @param {String} searchString\n * @param {Number} [position= 0]\n *\n * @returns {boolean}\n */\nconst endsWith = (str, searchString, position) => {\n str = String(str);\n if (position === undefined || position > str.length) {\n position = str.length;\n }\n position -= searchString.length;\n const lastIndex = str.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n}\n\n\n/**\n * Returns new array from array like object or null if failed\n *\n * @param {*} [thing]\n *\n * @returns {?Array}\n */\nconst toArray = (thing) => {\n if (!thing) return null;\n if (isArray(thing)) return thing;\n let i = thing.length;\n if (!isNumber(i)) return null;\n const arr = new Array(i);\n while (i-- > 0) {\n arr[i] = thing[i];\n }\n return arr;\n}\n\n/**\n * Checking if the Uint8Array exists and if it does, it returns a function that checks if the\n * thing passed in is an instance of Uint8Array\n *\n * @param {TypedArray}\n *\n * @returns {Array}\n */\n// eslint-disable-next-line func-names\nconst isTypedArray = (TypedArray => {\n // eslint-disable-next-line func-names\n return thing => {\n return TypedArray && thing instanceof TypedArray;\n };\n})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));\n\n/**\n * For each entry in the object, call the function with the key and value.\n *\n * @param {Object<any, any>} obj - The object to iterate over.\n * @param {Function} fn - The function to call for each entry.\n *\n * @returns {void}\n */\nconst forEachEntry = (obj, fn) => {\n const generator = obj && obj[Symbol.iterator];\n\n const iterator = generator.call(obj);\n\n let result;\n\n while ((result = iterator.next()) && !result.done) {\n const pair = result.value;\n fn.call(obj, pair[0], pair[1]);\n }\n}\n\n/**\n * It takes a regular expression and a string, and returns an array of all the matches\n *\n * @param {string} regExp - The regular expression to match against.\n * @param {string} str - The string to search.\n *\n * @returns {Array<boolean>}\n */\nconst matchAll = (regExp, str) => {\n let matches;\n const arr = [];\n\n while ((matches = regExp.exec(str)) !== null) {\n arr.push(matches);\n }\n\n return arr;\n}\n\n/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */\nconst isHTMLForm = kindOfTest('HTMLFormElement');\n\nconst toCamelCase = str => {\n return str.toLowerCase().replace(/[-_\\s]([a-z\\d])(\\w*)/g,\n function replacer(m, p1, p2) {\n return p1.toUpperCase() + p2;\n }\n );\n};\n\n/* Creating a function that will check if an object has a property. */\nconst hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);\n\n/**\n * Determine if a value is a RegExp object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a RegExp object, otherwise false\n */\nconst isRegExp = kindOfTest('RegExp');\n\nconst reduceDescriptors = (obj, reducer) => {\n const descriptors = Object.getOwnPropertyDescriptors(obj);\n const reducedDescriptors = {};\n\n forEach(descriptors, (descriptor, name) => {\n let ret;\n if ((ret = reducer(descriptor, name, obj)) !== false) {\n reducedDescriptors[name] = ret || descriptor;\n }\n });\n\n Object.defineProperties(obj, reducedDescriptors);\n}\n\n/**\n * Makes all methods read-only\n * @param {Object} obj\n */\n\nconst freezeMethods = (obj) => {\n reduceDescriptors(obj, (descriptor, name) => {\n // skip restricted props in strict mode\n if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {\n return false;\n }\n\n const value = obj[name];\n\n if (!isFunction(value)) return;\n\n descriptor.enumerable = false;\n\n if ('writable' in descriptor) {\n descriptor.writable = false;\n return;\n }\n\n if (!descriptor.set) {\n descriptor.set = () => {\n throw Error('Can not rewrite read-only method \\'' + name + '\\'');\n };\n }\n });\n}\n\nconst toObjectSet = (arrayOrString, delimiter) => {\n const obj = {};\n\n const define = (arr) => {\n arr.forEach(value => {\n obj[value] = true;\n });\n }\n\n isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));\n\n return obj;\n}\n\nconst noop = () => {}\n\nconst toFiniteNumber = (value, defaultValue) => {\n value = +value;\n return Number.isFinite(value) ? value : defaultValue;\n}\n\nconst ALPHA = 'abcdefghijklmnopqrstuvwxyz'\n\nconst DIGIT = '0123456789';\n\nconst ALPHABET = {\n DIGIT,\n ALPHA,\n ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT\n}\n\nconst generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {\n let str = '';\n const {length} = alphabet;\n while (size--) {\n str += alphabet[Math.random() * length|0]\n }\n\n return str;\n}\n\n/**\n * If the thing is a FormData object, return true, otherwise return false.\n *\n * @param {unknown} thing - The thing to check.\n *\n * @returns {boolean}\n */\nfunction isSpecCompliantForm(thing) {\n return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]);\n}\n\nconst toJSONObject = (obj) => {\n const stack = new Array(10);\n\n const visit = (source, i) => {\n\n if (isObject(source)) {\n if (stack.indexOf(source) >= 0) {\n return;\n }\n\n if(!('toJSON' in source)) {\n stack[i] = source;\n const target = isArray(source) ? [] : {};\n\n forEach(source, (value, key) => {\n const reducedValue = visit(value, i + 1);\n !isUndefined(reducedValue) && (target[key] = reducedValue);\n });\n\n stack[i] = undefined;\n\n return target;\n }\n }\n\n return source;\n }\n\n return visit(obj, 0);\n}\n\nconst isAsyncFn = kindOfTest('AsyncFunction');\n\nconst isThenable = (thing) =>\n thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);\n\nexport default {\n isArray,\n isArrayBuffer,\n isBuffer,\n isFormData,\n isArrayBufferView,\n isString,\n isNumber,\n isBoolean,\n isObject,\n isPlainObject,\n isUndefined,\n isDate,\n isFile,\n isBlob,\n isRegExp,\n isFunction,\n isStream,\n isURLSearchParams,\n isTypedArray,\n isFileList,\n forEach,\n merge,\n extend,\n trim,\n stripBOM,\n inherits,\n toFlatObject,\n kindOf,\n kindOfTest,\n endsWith,\n toArray,\n forEachEntry,\n matchAll,\n isHTMLForm,\n hasOwnProperty,\n hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection\n reduceDescriptors,\n freezeMethods,\n toObjectSet,\n toCamelCase,\n noop,\n toFiniteNumber,\n findKey,\n global: _global,\n isContextDefined,\n ALPHABET,\n generateString,\n isSpecCompliantForm,\n toJSONObject,\n isAsyncFn,\n isThenable\n};\n","'use strict';\n\nimport utils from '../utils.js';\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [config] The config.\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n *\n * @returns {Error} The created error.\n */\nfunction AxiosError(message, code, config, request, response) {\n Error.call(this);\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n } else {\n this.stack = (new Error()).stack;\n }\n\n this.message = message;\n this.name = 'AxiosError';\n code && (this.code = code);\n config && (this.config = config);\n request && (this.request = request);\n response && (this.response = response);\n}\n\nutils.inherits(AxiosError, Error, {\n toJSON: function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: utils.toJSONObject(this.config),\n code: this.code,\n status: this.response && this.response.status ? this.response.status : null\n };\n }\n});\n\nconst prototype = AxiosError.prototype;\nconst descriptors = {};\n\n[\n 'ERR_BAD_OPTION_VALUE',\n 'ERR_BAD_OPTION',\n 'ECONNABORTED',\n 'ETIMEDOUT',\n 'ERR_NETWORK',\n 'ERR_FR_TOO_MANY_REDIRECTS',\n 'ERR_DEPRECATED',\n 'ERR_BAD_RESPONSE',\n 'ERR_BAD_REQUEST',\n 'ERR_CANCELED',\n 'ERR_NOT_SUPPORT',\n 'ERR_INVALID_URL'\n// eslint-disable-next-line func-names\n].forEach(code => {\n descriptors[code] = {value: code};\n});\n\nObject.defineProperties(AxiosError, descriptors);\nObject.defineProperty(prototype, 'isAxiosError', {value: true});\n\n// eslint-disable-next-line func-names\nAxiosError.from = (error, code, config, request, response, customProps) => {\n const axiosError = Object.create(prototype);\n\n utils.toFlatObject(error, axiosError, function filter(obj) {\n return obj !== Error.prototype;\n }, prop => {\n return prop !== 'isAxiosError';\n });\n\n AxiosError.call(axiosError, error.message, code, config, request, response);\n\n axiosError.cause = error;\n\n axiosError.name = error.name;\n\n customProps && Object.assign(axiosError, customProps);\n\n return axiosError;\n};\n\nexport default AxiosError;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\n// temporary hotfix to avoid circular references until AxiosURLSearchParams is refactored\nimport PlatformFormData from '../platform/node/classes/FormData.js';\n\n/**\n * Determines if the given thing is a array or js object.\n *\n * @param {string} thing - The object or array to be visited.\n *\n * @returns {boolean}\n */\nfunction isVisitable(thing) {\n return utils.isPlainObject(thing) || utils.isArray(thing);\n}\n\n/**\n * It removes the brackets from the end of a string\n *\n * @param {string} key - The key of the parameter.\n *\n * @returns {string} the key without the brackets.\n */\nfunction removeBrackets(key) {\n return utils.endsWith(key, '[]') ? key.slice(0, -2) : key;\n}\n\n/**\n * It takes a path, a key, and a boolean, and returns a string\n *\n * @param {string} path - The path to the current key.\n * @param {string} key - The key of the current object being iterated over.\n * @param {string} dots - If true, the key will be rendered with dots instead of brackets.\n *\n * @returns {string} The path to the current key.\n */\nfunction renderKey(path, key, dots) {\n if (!path) return key;\n return path.concat(key).map(function each(token, i) {\n // eslint-disable-next-line no-param-reassign\n token = removeBrackets(token);\n return !dots && i ? '[' + token + ']' : token;\n }).join(dots ? '.' : '');\n}\n\n/**\n * If the array is an array and none of its elements are visitable, then it's a flat array.\n *\n * @param {Array<any>} arr - The array to check\n *\n * @returns {boolean}\n */\nfunction isFlatArray(arr) {\n return utils.isArray(arr) && !arr.some(isVisitable);\n}\n\nconst predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {\n return /^is[A-Z]/.test(prop);\n});\n\n/**\n * Convert a data object to FormData\n *\n * @param {Object} obj\n * @param {?Object} [formData]\n * @param {?Object} [options]\n * @param {Function} [options.visitor]\n * @param {Boolean} [options.metaTokens = true]\n * @param {Boolean} [options.dots = false]\n * @param {?Boolean} [options.indexes = false]\n *\n * @returns {Object}\n **/\n\n/**\n * It converts an object into a FormData object\n *\n * @param {Object<any, any>} obj - The object to convert to form data.\n * @param {string} formData - The FormData object to append to.\n * @param {Object<string, any>} options\n *\n * @returns\n */\nfunction toFormData(obj, formData, options) {\n if (!utils.isObject(obj)) {\n throw new TypeError('target must be an object');\n }\n\n // eslint-disable-next-line no-param-reassign\n formData = formData || new (PlatformFormData || FormData)();\n\n // eslint-disable-next-line no-param-reassign\n options = utils.toFlatObject(options, {\n metaTokens: true,\n dots: false,\n indexes: false\n }, false, function defined(option, source) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n return !utils.isUndefined(source[option]);\n });\n\n const metaTokens = options.metaTokens;\n // eslint-disable-next-line no-use-before-define\n const visitor = options.visitor || defaultVisitor;\n const dots = options.dots;\n const indexes = options.indexes;\n const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;\n const useBlob = _Blob && utils.isSpecCompliantForm(formData);\n\n if (!utils.isFunction(visitor)) {\n throw new TypeError('visitor must be a function');\n }\n\n function convertValue(value) {\n if (value === null) return '';\n\n if (utils.isDate(value)) {\n return value.toISOString();\n }\n\n if (!useBlob && utils.isBlob(value)) {\n throw new AxiosError('Blob is not supported. Use a Buffer instead.');\n }\n\n if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {\n return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);\n }\n\n return value;\n }\n\n /**\n * Default visitor.\n *\n * @param {*} value\n * @param {String|Number} key\n * @param {Array<String|Number>} path\n * @this {FormData}\n *\n * @returns {boolean} return true to visit the each prop of the value recursively\n */\n function defaultVisitor(value, key, path) {\n let arr = value;\n\n if (value && !path && typeof value === 'object') {\n if (utils.endsWith(key, '{}')) {\n // eslint-disable-next-line no-param-reassign\n key = metaTokens ? key : key.slice(0, -2);\n // eslint-disable-next-line no-param-reassign\n value = JSON.stringify(value);\n } else if (\n (utils.isArray(value) && isFlatArray(value)) ||\n ((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value))\n )) {\n // eslint-disable-next-line no-param-reassign\n key = removeBrackets(key);\n\n arr.forEach(function each(el, index) {\n !(utils.isUndefined(el) || el === null) && formData.append(\n // eslint-disable-next-line no-nested-ternary\n indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),\n convertValue(el)\n );\n });\n return false;\n }\n }\n\n if (isVisitable(value)) {\n return true;\n }\n\n formData.append(renderKey(path, key, dots), convertValue(value));\n\n return false;\n }\n\n const stack = [];\n\n const exposedHelpers = Object.assign(predicates, {\n defaultVisitor,\n convertValue,\n isVisitable\n });\n\n function build(value, path) {\n if (utils.isUndefined(value)) return;\n\n if (stack.indexOf(value) !== -1) {\n throw Error('Circular reference detected in ' + path.join('.'));\n }\n\n stack.push(value);\n\n utils.forEach(value, function each(el, key) {\n const result = !(utils.isUndefined(el) || el === null) && visitor.call(\n formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers\n );\n\n if (result === true) {\n build(el, path ? path.concat(key) : [key]);\n }\n });\n\n stack.pop();\n }\n\n if (!utils.isObject(obj)) {\n throw new TypeError('data must be an object');\n }\n\n build(obj);\n\n return formData;\n}\n\nexport default toFormData;\n","'use strict';\n\nimport toFormData from './toFormData.js';\n\n/**\n * It encodes a string by replacing all characters that are not in the unreserved set with\n * their percent-encoded equivalents\n *\n * @param {string} str - The string to encode.\n *\n * @returns {string} The encoded string.\n */\nfunction encode(str) {\n const charMap = {\n '!': '%21',\n \"'\": '%27',\n '(': '%28',\n ')': '%29',\n '~': '%7E',\n '%20': '+',\n '%00': '\\x00'\n };\n return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {\n return charMap[match];\n });\n}\n\n/**\n * It takes a params object and converts it to a FormData object\n *\n * @param {Object<string, any>} params - The parameters to be converted to a FormData object.\n * @param {Object<string, any>} options - The options object passed to the Axios constructor.\n *\n * @returns {void}\n */\nfunction AxiosURLSearchParams(params, options) {\n this._pairs = [];\n\n params && toFormData(params, this, options);\n}\n\nconst prototype = AxiosURLSearchParams.prototype;\n\nprototype.append = function append(name, value) {\n this._pairs.push([name, value]);\n};\n\nprototype.toString = function toString(encoder) {\n const _encode = encoder ? function(value) {\n return encoder.call(this, value, encode);\n } : encode;\n\n return this._pairs.map(function each(pair) {\n return _encode(pair[0]) + '=' + _encode(pair[1]);\n }, '').join('&');\n};\n\nexport default AxiosURLSearchParams;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosURLSearchParams from '../helpers/AxiosURLSearchParams.js';\n\n/**\n * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their\n * URI encoded counterparts\n *\n * @param {string} val The value to be encoded.\n *\n * @returns {string} The encoded value.\n */\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @param {?object} options\n *\n * @returns {string} The formatted url\n */\nexport default function buildURL(url, params, options) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n \n const _encode = options && options.encode || encode;\n\n const serializeFn = options && options.serialize;\n\n let serializedParams;\n\n if (serializeFn) {\n serializedParams = serializeFn(params, options);\n } else {\n serializedParams = utils.isURLSearchParams(params) ?\n params.toString() :\n new AxiosURLSearchParams(params, options).toString(_encode);\n }\n\n if (serializedParams) {\n const hashmarkIndex = url.indexOf(\"#\");\n\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\nclass InterceptorManager {\n constructor() {\n this.handlers = [];\n }\n\n /**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\n use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled,\n rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n }\n\n /**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n *\n * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise\n */\n eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n }\n\n /**\n * Clear all interceptors from the stack\n *\n * @returns {void}\n */\n clear() {\n if (this.handlers) {\n this.handlers = [];\n }\n }\n\n /**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n *\n * @returns {void}\n */\n forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n }\n}\n\nexport default InterceptorManager;\n","const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n *\n * @returns {boolean}\n */\nconst hasStandardBrowserEnv = (\n (product) => {\n return hasBrowserEnv && ['ReactNative', 'NativeScript', 'NS'].indexOf(product) < 0\n })(typeof navigator !== 'undefined' && navigator.product);\n\n/**\n * Determine if we're running in a standard browser webWorker environment\n *\n * Although the `isStandardBrowserEnv` method indicates that\n * `allows axios to run in a web worker`, the WebWorker will still be\n * filtered out due to its judgment standard\n * `typeof window !== 'undefined' && typeof document !== 'undefined'`.\n * This leads to a problem when axios post `FormData` in webWorker\n */\nconst hasStandardBrowserWebWorkerEnv = (() => {\n return (\n typeof WorkerGlobalScope !== 'undefined' &&\n // eslint-disable-next-line no-undef\n self instanceof WorkerGlobalScope &&\n typeof self.importScripts === 'function'\n );\n})();\n\nexport {\n hasBrowserEnv,\n hasStandardBrowserWebWorkerEnv,\n hasStandardBrowserEnv\n}\n","'use strict';\n\nexport default {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n};\n","import URLSearchParams from './classes/URLSearchParams.js'\nimport FormData from './classes/FormData.js'\nimport Blob from './classes/Blob.js'\n\nexport default {\n isBrowser: true,\n classes: {\n URLSearchParams,\n FormData,\n Blob\n },\n protocols: ['http', 'https', 'file', 'blob', 'url', 'data']\n};\n","'use strict';\n\nimport AxiosURLSearchParams from '../../../helpers/AxiosURLSearchParams.js';\nexport default typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;\n","'use strict';\n\nexport default typeof FormData !== 'undefined' ? FormData : null;\n","'use strict'\n\nexport default typeof Blob !== 'undefined' ? Blob : null\n","import platform from './node/index.js';\nimport * as utils from './common/utils.js';\n\nexport default {\n ...utils,\n ...platform\n}\n","'use strict';\n\nimport utils from '../utils.js';\n\n/**\n * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']\n *\n * @param {string} name - The name of the property to get.\n *\n * @returns An array of strings.\n */\nfunction parsePropPath(name) {\n // foo[x][y][z]\n // foo.x.y.z\n // foo-x-y-z\n // foo x y z\n return utils.matchAll(/\\w+|\\[(\\w*)]/g, name).map(match => {\n return match[0] === '[]' ? '' : match[1] || match[0];\n });\n}\n\n/**\n * Convert an array to an object.\n *\n * @param {Array<any>} arr - The array to convert to an object.\n *\n * @returns An object with the same keys and values as the array.\n */\nfunction arrayToObject(arr) {\n const obj = {};\n const keys = Object.keys(arr);\n let i;\n const len = keys.length;\n let key;\n for (i = 0; i < len; i++) {\n key = keys[i];\n obj[key] = arr[key];\n }\n return obj;\n}\n\n/**\n * It takes a FormData object and returns a JavaScript object\n *\n * @param {string} formData The FormData object to convert to JSON.\n *\n * @returns {Object<string, any> | null} The converted object.\n */\nfunction formDataToJSON(formData) {\n function buildPath(path, value, target, index) {\n let name = path[index++];\n\n if (name === '__proto__') return true;\n\n const isNumericKey = Number.isFinite(+name);\n const isLast = index >= path.length;\n name = !name && utils.isArray(target) ? target.length : name;\n\n if (isLast) {\n if (utils.hasOwnProp(target, name)) {\n target[name] = [target[name], value];\n } else {\n target[name] = value;\n }\n\n return !isNumericKey;\n }\n\n if (!target[name] || !utils.isObject(target[name])) {\n target[name] = [];\n }\n\n const result = buildPath(path, value, target[name], index);\n\n if (result && utils.isArray(target[name])) {\n target[name] = arrayToObject(target[name]);\n }\n\n return !isNumericKey;\n }\n\n if (utils.isFormData(formData) && utils.isFunction(formData.entries)) {\n const obj = {};\n\n utils.forEachEntry(formData, (name, value) => {\n buildPath(parsePropPath(name), value, obj, 0);\n });\n\n return obj;\n }\n\n return null;\n}\n\nexport default formDataToJSON;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\nimport transitionalDefaults from './transitional.js';\nimport toFormData from '../helpers/toFormData.js';\nimport toURLEncodedForm from '../helpers/toURLEncodedForm.js';\nimport platform from '../platform/index.js';\nimport formDataToJSON from '../helpers/formDataToJSON.js';\n\n/**\n * It takes a string, tries to parse it, and if it fails, it returns the stringified version\n * of the input\n *\n * @param {any} rawValue - The value to be stringified.\n * @param {Function} parser - A function that parses a string into a JavaScript object.\n * @param {Function} encoder - A function that takes a value and returns a string.\n *\n * @returns {string} A stringified version of the rawValue.\n */\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nconst defaults = {\n\n transitional: transitionalDefaults,\n\n adapter: ['xhr', 'http'],\n\n transformRequest: [function transformRequest(data, headers) {\n const contentType = headers.getContentType() || '';\n const hasJSONContentType = contentType.indexOf('application/json') > -1;\n const isObjectPayload = utils.isObject(data);\n\n if (isObjectPayload && utils.isHTMLForm(data)) {\n data = new FormData(data);\n }\n\n const isFormData = utils.isFormData(data);\n\n if (isFormData) {\n return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;\n }\n\n if (utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);\n return data.toString();\n }\n\n let isFileList;\n\n if (isObjectPayload) {\n if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {\n return toURLEncodedForm(data, this.formSerializer).toString();\n }\n\n if ((isFileList = utils.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {\n const _FormData = this.env && this.env.FormData;\n\n return toFormData(\n isFileList ? {'files[]': data} : data,\n _FormData && new _FormData(),\n this.formSerializer\n );\n }\n }\n\n if (isObjectPayload || hasJSONContentType ) {\n headers.setContentType('application/json', false);\n return stringifySafely(data);\n }\n\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n const transitional = this.transitional || defaults.transitional;\n const forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n const JSONRequested = this.responseType === 'json';\n\n if (data && utils.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {\n const silentJSONParsing = transitional && transitional.silentJSONParsing;\n const strictJSONParsing = !silentJSONParsing && JSONRequested;\n\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n env: {\n FormData: platform.classes.FormData,\n Blob: platform.classes.Blob\n },\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n },\n\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*',\n 'Content-Type': undefined\n }\n }\n};\n\nutils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {\n defaults.headers[method] = {};\n});\n\nexport default defaults;\n","'use strict';\n\nimport utils from '../utils.js';\nimport toFormData from './toFormData.js';\nimport platform from '../platform/index.js';\n\nexport default function toURLEncodedForm(data, options) {\n return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({\n visitor: function(value, key, path, helpers) {\n if (platform.isNode && utils.isBuffer(value)) {\n this.append(key, value.toString('base64'));\n return false;\n }\n\n return helpers.defaultVisitor.apply(this, arguments);\n }\n }, options));\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\n// RawAxiosHeaders whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nconst ignoreDuplicateOf = utils.toObjectSet([\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n]);\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} rawHeaders Headers needing to be parsed\n *\n * @returns {Object} Headers parsed into an object\n */\nexport default rawHeaders => {\n const parsed = {};\n let key;\n let val;\n let i;\n\n rawHeaders && rawHeaders.split('\\n').forEach(function parser(line) {\n i = line.indexOf(':');\n key = line.substring(0, i).trim().toLowerCase();\n val = line.substring(i + 1).trim();\n\n if (!key || (parsed[key] && ignoreDuplicateOf[key])) {\n return;\n }\n\n if (key === 'set-cookie') {\n if (parsed[key]) {\n parsed[key].push(val);\n } else {\n parsed[key] = [val];\n }\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n });\n\n return parsed;\n};\n","'use strict';\n\nimport utils from '../utils.js';\nimport parseHeaders from '../helpers/parseHeaders.js';\n\nconst $internals = Symbol('internals');\n\nfunction normalizeHeader(header) {\n return header && String(header).trim().toLowerCase();\n}\n\nfunction normalizeValue(value) {\n if (value === false || value == null) {\n return value;\n }\n\n return utils.isArray(value) ? value.map(normalizeValue) : String(value);\n}\n\nfunction parseTokens(str) {\n const tokens = Object.create(null);\n const tokensRE = /([^\\s,;=]+)\\s*(?:=\\s*([^,;]+))?/g;\n let match;\n\n while ((match = tokensRE.exec(str))) {\n tokens[match[1]] = match[2];\n }\n\n return tokens;\n}\n\nconst isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());\n\nfunction matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {\n if (utils.isFunction(filter)) {\n return filter.call(this, value, header);\n }\n\n if (isHeaderNameFilter) {\n value = header;\n }\n\n if (!utils.isString(value)) return;\n\n if (utils.isString(filter)) {\n return value.indexOf(filter) !== -1;\n }\n\n if (utils.isRegExp(filter)) {\n return filter.test(value);\n }\n}\n\nfunction formatHeader(header) {\n return header.trim()\n .toLowerCase().replace(/([a-z\\d])(\\w*)/g, (w, char, str) => {\n return char.toUpperCase() + str;\n });\n}\n\nfunction buildAccessors(obj, header) {\n const accessorName = utils.toCamelCase(' ' + header);\n\n ['get', 'set', 'has'].forEach(methodName => {\n Object.defineProperty(obj, methodName + accessorName, {\n value: function(arg1, arg2, arg3) {\n return this[methodName].call(this, header, arg1, arg2, arg3);\n },\n configurable: true\n });\n });\n}\n\nclass AxiosHeaders {\n constructor(headers) {\n headers && this.set(headers);\n }\n\n set(header, valueOrRewrite, rewrite) {\n const self = this;\n\n function setHeader(_value, _header, _rewrite) {\n const lHeader = normalizeHeader(_header);\n\n if (!lHeader) {\n throw new Error('header name must be a non-empty string');\n }\n\n const key = utils.findKey(self, lHeader);\n\n if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {\n self[key || _header] = normalizeValue(_value);\n }\n }\n\n const setHeaders = (headers, _rewrite) =>\n utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));\n\n if (utils.isPlainObject(header) || header instanceof this.constructor) {\n setHeaders(header, valueOrRewrite)\n } else if(utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {\n setHeaders(parseHeaders(header), valueOrRewrite);\n } else {\n header != null && setHeader(valueOrRewrite, header, rewrite);\n }\n\n return this;\n }\n\n get(header, parser) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n if (key) {\n const value = this[key];\n\n if (!parser) {\n return value;\n }\n\n if (parser === true) {\n return parseTokens(value);\n }\n\n if (utils.isFunction(parser)) {\n return parser.call(this, value, key);\n }\n\n if (utils.isRegExp(parser)) {\n return parser.exec(value);\n }\n\n throw new TypeError('parser must be boolean|regexp|function');\n }\n }\n }\n\n has(header, matcher) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));\n }\n\n return false;\n }\n\n delete(header, matcher) {\n const self = this;\n let deleted = false;\n\n function deleteHeader(_header) {\n _header = normalizeHeader(_header);\n\n if (_header) {\n const key = utils.findKey(self, _header);\n\n if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {\n delete self[key];\n\n deleted = true;\n }\n }\n }\n\n if (utils.isArray(header)) {\n header.forEach(deleteHeader);\n } else {\n deleteHeader(header);\n }\n\n return deleted;\n }\n\n clear(matcher) {\n const keys = Object.keys(this);\n let i = keys.length;\n let deleted = false;\n\n while (i--) {\n const key = keys[i];\n if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {\n delete this[key];\n deleted = true;\n }\n }\n\n return deleted;\n }\n\n normalize(format) {\n const self = this;\n const headers = {};\n\n utils.forEach(this, (value, header) => {\n const key = utils.findKey(headers, header);\n\n if (key) {\n self[key] = normalizeValue(value);\n delete self[header];\n return;\n }\n\n const normalized = format ? formatHeader(header) : String(header).trim();\n\n if (normalized !== header) {\n delete self[header];\n }\n\n self[normalized] = normalizeValue(value);\n\n headers[normalized] = true;\n });\n\n return this;\n }\n\n concat(...targets) {\n return this.constructor.concat(this, ...targets);\n }\n\n toJSON(asStrings) {\n const obj = Object.create(null);\n\n utils.forEach(this, (value, header) => {\n value != null && value !== false && (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value);\n });\n\n return obj;\n }\n\n [Symbol.iterator]() {\n return Object.entries(this.toJSON())[Symbol.iterator]();\n }\n\n toString() {\n return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\\n');\n }\n\n get [Symbol.toStringTag]() {\n return 'AxiosHeaders';\n }\n\n static from(thing) {\n return thing instanceof this ? thing : new this(thing);\n }\n\n static concat(first, ...targets) {\n const computed = new this(first);\n\n targets.forEach((target) => computed.set(target));\n\n return computed;\n }\n\n static accessor(header) {\n const internals = this[$internals] = (this[$internals] = {\n accessors: {}\n });\n\n const accessors = internals.accessors;\n const prototype = this.prototype;\n\n function defineAccessor(_header) {\n const lHeader = normalizeHeader(_header);\n\n if (!accessors[lHeader]) {\n buildAccessors(prototype, _header);\n accessors[lHeader] = true;\n }\n }\n\n utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);\n\n return this;\n }\n}\n\nAxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);\n\n// reserved names hotfix\nutils.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {\n let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`\n return {\n get: () => value,\n set(headerValue) {\n this[mapped] = headerValue;\n }\n }\n});\n\nutils.freezeMethods(AxiosHeaders);\n\nexport default AxiosHeaders;\n","'use strict';\n\nimport utils from './../utils.js';\nimport defaults from '../defaults/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Array|Function} fns A single function or Array of functions\n * @param {?Object} response The response object\n *\n * @returns {*} The resulting transformed data\n */\nexport default function transformData(fns, response) {\n const config = this || defaults;\n const context = response || config;\n const headers = AxiosHeaders.from(context.headers);\n let data = context.data;\n\n utils.forEach(fns, function transform(fn) {\n data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);\n });\n\n headers.normalize();\n\n return data;\n}\n","'use strict';\n\nexport default function isCancel(value) {\n return !!(value && value.__CANCEL__);\n}\n","'use strict';\n\nimport AxiosError from '../core/AxiosError.js';\nimport utils from '../utils.js';\n\n/**\n * A `CanceledError` is an object that is thrown when an operation is canceled.\n *\n * @param {string=} message The message.\n * @param {Object=} config The config.\n * @param {Object=} request The request.\n *\n * @returns {CanceledError} The created error.\n */\nfunction CanceledError(message, config, request) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);\n this.name = 'CanceledError';\n}\n\nutils.inherits(CanceledError, AxiosError, {\n __CANCEL__: true\n});\n\nexport default CanceledError;\n","import utils from './../utils.js';\nimport platform from '../platform/index.js';\n\nexport default platform.hasStandardBrowserEnv ?\n\n // Standard browser envs support document.cookie\n {\n write(name, value, expires, path, domain, secure) {\n const cookie = [name + '=' + encodeURIComponent(value)];\n\n utils.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());\n\n utils.isString(path) && cookie.push('path=' + path);\n\n utils.isString(domain) && cookie.push('domain=' + domain);\n\n secure === true && cookie.push('secure');\n\n document.cookie = cookie.join('; ');\n },\n\n read(name) {\n const match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n }\n\n :\n\n // Non-standard browser env (web workers, react-native) lack needed support.\n {\n write() {},\n read() {\n return null;\n },\n remove() {}\n };\n\n","'use strict';\n\nimport isAbsoluteURL from '../helpers/isAbsoluteURL.js';\nimport combineURLs from '../helpers/combineURLs.js';\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n *\n * @returns {string} The combined full path\n */\nexport default function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n}\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n *\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nexport default function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"<scheme>://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(url);\n}\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n *\n * @returns {string} The combined URL\n */\nexport default function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/?\\/$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n}\n","'use strict';\n\nimport utils from './../utils.js';\nimport platform from '../platform/index.js';\n\nexport default platform.hasStandardBrowserEnv ?\n\n// Standard browser envs have full support of the APIs needed to test\n// whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n const msie = /(msie|trident)/i.test(navigator.userAgent);\n const urlParsingNode = document.createElement('a');\n let originURL;\n\n /**\n * Parse a URL to discover its components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n let href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n const parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })();\n","'use strict';\n\nimport utils from './../utils.js';\nimport settle from './../core/settle.js';\nimport cookies from './../helpers/cookies.js';\nimport buildURL from './../helpers/buildURL.js';\nimport buildFullPath from '../core/buildFullPath.js';\nimport isURLSameOrigin from './../helpers/isURLSameOrigin.js';\nimport transitionalDefaults from '../defaults/transitional.js';\nimport AxiosError from '../core/AxiosError.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport parseProtocol from '../helpers/parseProtocol.js';\nimport platform from '../platform/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport speedometer from '../helpers/speedometer.js';\n\nfunction progressEventReducer(listener, isDownloadStream) {\n let bytesNotified = 0;\n const _speedometer = speedometer(50, 250);\n\n return e => {\n const loaded = e.loaded;\n const total = e.lengthComputable ? e.total : undefined;\n const progressBytes = loaded - bytesNotified;\n const rate = _speedometer(progressBytes);\n const inRange = loaded <= total;\n\n bytesNotified = loaded;\n\n const data = {\n loaded,\n total,\n progress: total ? (loaded / total) : undefined,\n bytes: progressBytes,\n rate: rate ? rate : undefined,\n estimated: rate && total && inRange ? (total - loaded) / rate : undefined,\n event: e\n };\n\n data[isDownloadStream ? 'download' : 'upload'] = true;\n\n listener(data);\n };\n}\n\nconst isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';\n\nexport default isXHRAdapterSupported && function (config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n let requestData = config.data;\n const requestHeaders = AxiosHeaders.from(config.headers).normalize();\n let {responseType, withXSRFToken} = config;\n let onCanceled;\n function done() {\n if (config.cancelToken) {\n config.cancelToken.unsubscribe(onCanceled);\n }\n\n if (config.signal) {\n config.signal.removeEventListener('abort', onCanceled);\n }\n }\n\n let contentType;\n\n if (utils.isFormData(requestData)) {\n if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {\n requestHeaders.setContentType(false); // Let the browser set it\n } else if ((contentType = requestHeaders.getContentType()) !== false) {\n // fix semicolon duplication issue for ReactNative FormData implementation\n const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];\n requestHeaders.setContentType([type || 'multipart/form-data', ...tokens].join('; '));\n }\n }\n\n let request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n const username = config.auth.username || '';\n const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.set('Authorization', 'Basic ' + btoa(username + ':' + password));\n }\n\n const fullPath = buildFullPath(config.baseURL, config.url);\n\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n const responseHeaders = AxiosHeaders.from(\n 'getAllResponseHeaders' in request && request.getAllResponseHeaders()\n );\n const responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n const response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config,\n request\n };\n\n settle(function _resolve(value) {\n resolve(value);\n done();\n }, function _reject(err) {\n reject(err);\n done();\n }, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';\n const transitional = config.transitional || transitionalDefaults;\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(new AxiosError(\n timeoutErrorMessage,\n transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,\n config,\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if(platform.hasStandardBrowserEnv) {\n withXSRFToken && utils.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config));\n\n if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(fullPath))) {\n // Add xsrf header\n const xsrfValue = config.xsrfHeaderName && config.xsrfCookieName && cookies.read(config.xsrfCookieName);\n\n if (xsrfValue) {\n requestHeaders.set(config.xsrfHeaderName, xsrfValue);\n }\n }\n }\n\n // Remove Content-Type if data is undefined\n requestData === undefined && requestHeaders.setContentType(null);\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {\n request.setRequestHeader(key, val);\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = config.responseType;\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', progressEventReducer(config.onDownloadProgress, true));\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', progressEventReducer(config.onUploadProgress));\n }\n\n if (config.cancelToken || config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = cancel => {\n if (!request) {\n return;\n }\n reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);\n request.abort();\n request = null;\n };\n\n config.cancelToken && config.cancelToken.subscribe(onCanceled);\n if (config.signal) {\n config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);\n }\n }\n\n const protocol = parseProtocol(fullPath);\n\n if (protocol && platform.protocols.indexOf(protocol) === -1) {\n reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));\n return;\n }\n\n\n // Send the request\n request.send(requestData || null);\n });\n}\n","'use strict';\n\n/**\n * Calculate data maxRate\n * @param {Number} [samplesCount= 10]\n * @param {Number} [min= 1000]\n * @returns {Function}\n */\nfunction speedometer(samplesCount, min) {\n samplesCount = samplesCount || 10;\n const bytes = new Array(samplesCount);\n const timestamps = new Array(samplesCount);\n let head = 0;\n let tail = 0;\n let firstSampleTS;\n\n min = min !== undefined ? min : 1000;\n\n return function push(chunkLength) {\n const now = Date.now();\n\n const startedAt = timestamps[tail];\n\n if (!firstSampleTS) {\n firstSampleTS = now;\n }\n\n bytes[head] = chunkLength;\n timestamps[head] = now;\n\n let i = tail;\n let bytesCount = 0;\n\n while (i !== head) {\n bytesCount += bytes[i++];\n i = i % samplesCount;\n }\n\n head = (head + 1) % samplesCount;\n\n if (head === tail) {\n tail = (tail + 1) % samplesCount;\n }\n\n if (now - firstSampleTS < min) {\n return;\n }\n\n const passed = startedAt && now - startedAt;\n\n return passed ? Math.round(bytesCount * 1000 / passed) : undefined;\n };\n}\n\nexport default speedometer;\n","import utils from '../utils.js';\nimport httpAdapter from './http.js';\nimport xhrAdapter from './xhr.js';\nimport AxiosError from \"../core/AxiosError.js\";\n\nconst knownAdapters = {\n http: httpAdapter,\n xhr: xhrAdapter\n}\n\nutils.forEach(knownAdapters, (fn, value) => {\n if (fn) {\n try {\n Object.defineProperty(fn, 'name', {value});\n } catch (e) {\n // eslint-disable-next-line no-empty\n }\n Object.defineProperty(fn, 'adapterName', {value});\n }\n});\n\nconst renderReason = (reason) => `- ${reason}`;\n\nconst isResolvedHandle = (adapter) => utils.isFunction(adapter) || adapter === null || adapter === false;\n\nexport default {\n getAdapter: (adapters) => {\n adapters = utils.isArray(adapters) ? adapters : [adapters];\n\n const {length} = adapters;\n let nameOrAdapter;\n let adapter;\n\n const rejectedReasons = {};\n\n for (let i = 0; i < length; i++) {\n nameOrAdapter = adapters[i];\n let id;\n\n adapter = nameOrAdapter;\n\n if (!isResolvedHandle(nameOrAdapter)) {\n adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];\n\n if (adapter === undefined) {\n throw new AxiosError(`Unknown adapter '${id}'`);\n }\n }\n\n if (adapter) {\n break;\n }\n\n rejectedReasons[id || '#' + i] = adapter;\n }\n\n if (!adapter) {\n\n const reasons = Object.entries(rejectedReasons)\n .map(([id, state]) => `adapter ${id} ` +\n (state === false ? 'is not supported by the environment' : 'is not available in the build')\n );\n\n let s = length ?\n (reasons.length > 1 ? 'since :\\n' + reasons.map(renderReason).join('\\n') : ' ' + renderReason(reasons[0])) :\n 'as no adapter specified';\n\n throw new AxiosError(\n `There is no suitable adapter to dispatch the request ` + s,\n 'ERR_NOT_SUPPORT'\n );\n }\n\n return adapter;\n },\n adapters: knownAdapters\n}\n","// eslint-disable-next-line strict\nexport default null;\n","'use strict';\n\nimport AxiosError from './AxiosError.js';\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n *\n * @returns {object} The response.\n */\nexport default function settle(resolve, reject, response) {\n const validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(new AxiosError(\n 'Request failed with status code ' + response.status,\n [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],\n response.config,\n response.request,\n response\n ));\n }\n}\n","'use strict';\n\nexport default function parseProtocol(url) {\n const match = /^([-+\\w]{1,25})(:?\\/\\/|:)/.exec(url);\n return match && match[1] || '';\n}\n","'use strict';\n\nimport transformData from './transformData.js';\nimport isCancel from '../cancel/isCancel.js';\nimport defaults from '../defaults/index.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport adapters from \"../adapters/adapters.js\";\n\n/**\n * Throws a `CanceledError` if cancellation has been requested.\n *\n * @param {Object} config The config that is to be used for the request\n *\n * @returns {void}\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n\n if (config.signal && config.signal.aborted) {\n throw new CanceledError(null, config);\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n *\n * @returns {Promise} The Promise to be fulfilled\n */\nexport default function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n config.headers = AxiosHeaders.from(config.headers);\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.transformRequest\n );\n\n if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {\n config.headers.setContentType('application/x-www-form-urlencoded', false);\n }\n\n const adapter = adapters.getAdapter(config.adapter || defaults.adapter);\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n config.transformResponse,\n response\n );\n\n response.headers = AxiosHeaders.from(response.headers);\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n config.transformResponse,\n reason.response\n );\n reason.response.headers = AxiosHeaders.from(reason.response.headers);\n }\n }\n\n return Promise.reject(reason);\n });\n}\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosHeaders from \"./AxiosHeaders.js\";\n\nconst headersToObject = (thing) => thing instanceof AxiosHeaders ? thing.toJSON() : thing;\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n *\n * @returns {Object} New object resulting from merging config2 to config1\n */\nexport default function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n const config = {};\n\n function getMergedValue(target, source, caseless) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge.call({caseless}, target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDeepProperties(a, b, caseless) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(a, b, caseless);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a, caseless);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function valueFromConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function defaultToConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDirectKeys(a, b, prop) {\n if (prop in config2) {\n return getMergedValue(a, b);\n } else if (prop in config1) {\n return getMergedValue(undefined, a);\n }\n }\n\n const mergeMap = {\n url: valueFromConfig2,\n method: valueFromConfig2,\n data: valueFromConfig2,\n baseURL: defaultToConfig2,\n transformRequest: defaultToConfig2,\n transformResponse: defaultToConfig2,\n paramsSerializer: defaultToConfig2,\n timeout: defaultToConfig2,\n timeoutMessage: defaultToConfig2,\n withCredentials: defaultToConfig2,\n withXSRFToken: defaultToConfig2,\n adapter: defaultToConfig2,\n responseType: defaultToConfig2,\n xsrfCookieName: defaultToConfig2,\n xsrfHeaderName: defaultToConfig2,\n onUploadProgress: defaultToConfig2,\n onDownloadProgress: defaultToConfig2,\n decompress: defaultToConfig2,\n maxContentLength: defaultToConfig2,\n maxBodyLength: defaultToConfig2,\n beforeRedirect: defaultToConfig2,\n transport: defaultToConfig2,\n httpAgent: defaultToConfig2,\n httpsAgent: defaultToConfig2,\n cancelToken: defaultToConfig2,\n socketPath: defaultToConfig2,\n responseEncoding: defaultToConfig2,\n validateStatus: mergeDirectKeys,\n headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)\n };\n\n utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {\n const merge = mergeMap[prop] || mergeDeepProperties;\n const configValue = merge(config1[prop], config2[prop], prop);\n (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);\n });\n\n return config;\n}\n","export const VERSION = \"1.6.7\";","'use strict';\n\nimport {VERSION} from '../env/data.js';\nimport AxiosError from '../core/AxiosError.js';\n\nconst validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nconst deprecatedWarnings = {};\n\n/**\n * Transitional option validator\n *\n * @param {function|boolean?} validator - set to false if the transitional option has been removed\n * @param {string?} version - deprecated version / removed since version\n * @param {string?} message - some message with additional info\n *\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n function formatMessage(opt, desc) {\n return '[Axios v' + VERSION + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return (value, opt, opts) => {\n if (validator === false) {\n throw new AxiosError(\n formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),\n AxiosError.ERR_DEPRECATED\n );\n }\n\n if (version && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n *\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n *\n * @returns {object}\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);\n }\n const keys = Object.keys(options);\n let i = keys.length;\n while (i-- > 0) {\n const opt = keys[i];\n const validator = schema[opt];\n if (validator) {\n const value = options[opt];\n const result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);\n }\n }\n}\n\nexport default {\n assertOptions,\n validators\n};\n","'use strict';\n\nimport utils from './../utils.js';\nimport buildURL from '../helpers/buildURL.js';\nimport InterceptorManager from './InterceptorManager.js';\nimport dispatchRequest from './dispatchRequest.js';\nimport mergeConfig from './mergeConfig.js';\nimport buildFullPath from './buildFullPath.js';\nimport validator from '../helpers/validator.js';\nimport AxiosHeaders from './AxiosHeaders.js';\n\nconst validators = validator.validators;\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n *\n * @return {Axios} A new instance of Axios\n */\nclass Axios {\n constructor(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n }\n\n /**\n * Dispatch a request\n *\n * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)\n * @param {?Object} config\n *\n * @returns {Promise} The Promise to be fulfilled\n */\n async request(configOrUrl, config) {\n try {\n return await this._request(configOrUrl, config);\n } catch (err) {\n if (err instanceof Error) {\n let dummy;\n\n Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : (dummy = new Error());\n\n // slice off the Error: ... line\n const stack = dummy.stack ? dummy.stack.replace(/^.+\\n/, '') : '';\n\n if (!err.stack) {\n err.stack = stack;\n // match without the 2 top stack lines\n } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\\n.+\\n/, ''))) {\n err.stack += '\\n' + stack\n }\n }\n\n throw err;\n }\n }\n\n _request(configOrUrl, config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof configOrUrl === 'string') {\n config = config || {};\n config.url = configOrUrl;\n } else {\n config = configOrUrl || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n const {transitional, paramsSerializer, headers} = config;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean),\n forcedJSONParsing: validators.transitional(validators.boolean),\n clarifyTimeoutError: validators.transitional(validators.boolean)\n }, false);\n }\n\n if (paramsSerializer != null) {\n if (utils.isFunction(paramsSerializer)) {\n config.paramsSerializer = {\n serialize: paramsSerializer\n }\n } else {\n validator.assertOptions(paramsSerializer, {\n encode: validators.function,\n serialize: validators.function\n }, true);\n }\n }\n\n // Set config.method\n config.method = (config.method || this.defaults.method || 'get').toLowerCase();\n\n // Flatten headers\n let contextHeaders = headers && utils.merge(\n headers.common,\n headers[config.method]\n );\n\n headers && utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n (method) => {\n delete headers[method];\n }\n );\n\n config.headers = AxiosHeaders.concat(contextHeaders, headers);\n\n // filter out skipped interceptors\n const requestInterceptorChain = [];\n let synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n const responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n let promise;\n let i = 0;\n let len;\n\n if (!synchronousRequestInterceptors) {\n const chain = [dispatchRequest.bind(this), undefined];\n chain.unshift.apply(chain, requestInterceptorChain);\n chain.push.apply(chain, responseInterceptorChain);\n len = chain.length;\n\n promise = Promise.resolve(config);\n\n while (i < len) {\n promise = promise.then(chain[i++], chain[i++]);\n }\n\n return promise;\n }\n\n len = requestInterceptorChain.length;\n\n let newConfig = config;\n\n i = 0;\n\n while (i < len) {\n const onFulfilled = requestInterceptorChain[i++];\n const onRejected = requestInterceptorChain[i++];\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected.call(this, error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest.call(this, newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n i = 0;\n len = responseInterceptorChain.length;\n\n while (i < len) {\n promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);\n }\n\n return promise;\n }\n\n getUri(config) {\n config = mergeConfig(this.defaults, config);\n const fullPath = buildFullPath(config.baseURL, config.url);\n return buildURL(fullPath, config.params, config.paramsSerializer);\n }\n}\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n\n function generateHTTPMethod(isForm) {\n return function httpMethod(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n headers: isForm ? {\n 'Content-Type': 'multipart/form-data'\n } : {},\n url,\n data\n }));\n };\n }\n\n Axios.prototype[method] = generateHTTPMethod();\n\n Axios.prototype[method + 'Form'] = generateHTTPMethod(true);\n});\n\nexport default Axios;\n","'use strict';\n\nimport CanceledError from './CanceledError.js';\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @param {Function} executor The executor function.\n *\n * @returns {CancelToken}\n */\nclass CancelToken {\n constructor(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n let resolvePromise;\n\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n const token = this;\n\n // eslint-disable-next-line func-names\n this.promise.then(cancel => {\n if (!token._listeners) return;\n\n let i = token._listeners.length;\n\n while (i-- > 0) {\n token._listeners[i](cancel);\n }\n token._listeners = null;\n });\n\n // eslint-disable-next-line func-names\n this.promise.then = onfulfilled => {\n let _resolve;\n // eslint-disable-next-line func-names\n const promise = new Promise(resolve => {\n token.subscribe(resolve);\n _resolve = resolve;\n }).then(onfulfilled);\n\n promise.cancel = function reject() {\n token.unsubscribe(_resolve);\n };\n\n return promise;\n };\n\n executor(function cancel(message, config, request) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new CanceledError(message, config, request);\n resolvePromise(token.reason);\n });\n }\n\n /**\n * Throws a `CanceledError` if cancellation has been requested.\n */\n throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n }\n\n /**\n * Subscribe to the cancel signal\n */\n\n subscribe(listener) {\n if (this.reason) {\n listener(this.reason);\n return;\n }\n\n if (this._listeners) {\n this._listeners.push(listener);\n } else {\n this._listeners = [listener];\n }\n }\n\n /**\n * Unsubscribe from the cancel signal\n */\n\n unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n const index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n }\n\n /**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\n static source() {\n let cancel;\n const token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token,\n cancel\n };\n }\n}\n\nexport default CancelToken;\n","const HttpStatusCode = {\n Continue: 100,\n SwitchingProtocols: 101,\n Processing: 102,\n EarlyHints: 103,\n Ok: 200,\n Created: 201,\n Accepted: 202,\n NonAuthoritativeInformation: 203,\n NoContent: 204,\n ResetContent: 205,\n PartialContent: 206,\n MultiStatus: 207,\n AlreadyReported: 208,\n ImUsed: 226,\n MultipleChoices: 300,\n MovedPermanently: 301,\n Found: 302,\n SeeOther: 303,\n NotModified: 304,\n UseProxy: 305,\n Unused: 306,\n TemporaryRedirect: 307,\n PermanentRedirect: 308,\n BadRequest: 400,\n Unauthorized: 401,\n PaymentRequired: 402,\n Forbidden: 403,\n NotFound: 404,\n MethodNotAllowed: 405,\n NotAcceptable: 406,\n ProxyAuthenticationRequired: 407,\n RequestTimeout: 408,\n Conflict: 409,\n Gone: 410,\n LengthRequired: 411,\n PreconditionFailed: 412,\n PayloadTooLarge: 413,\n UriTooLong: 414,\n UnsupportedMediaType: 415,\n RangeNotSatisfiable: 416,\n ExpectationFailed: 417,\n ImATeapot: 418,\n MisdirectedRequest: 421,\n UnprocessableEntity: 422,\n Locked: 423,\n FailedDependency: 424,\n TooEarly: 425,\n UpgradeRequired: 426,\n PreconditionRequired: 428,\n TooManyRequests: 429,\n RequestHeaderFieldsTooLarge: 431,\n UnavailableForLegalReasons: 451,\n InternalServerError: 500,\n NotImplemented: 501,\n BadGateway: 502,\n ServiceUnavailable: 503,\n GatewayTimeout: 504,\n HttpVersionNotSupported: 505,\n VariantAlsoNegotiates: 506,\n InsufficientStorage: 507,\n LoopDetected: 508,\n NotExtended: 510,\n NetworkAuthenticationRequired: 511,\n};\n\nObject.entries(HttpStatusCode).forEach(([key, value]) => {\n HttpStatusCode[value] = key;\n});\n\nexport default HttpStatusCode;\n","'use strict';\n\nimport utils from './utils.js';\nimport bind from './helpers/bind.js';\nimport Axios from './core/Axios.js';\nimport mergeConfig from './core/mergeConfig.js';\nimport defaults from './defaults/index.js';\nimport formDataToJSON from './helpers/formDataToJSON.js';\nimport CanceledError from './cancel/CanceledError.js';\nimport CancelToken from './cancel/CancelToken.js';\nimport isCancel from './cancel/isCancel.js';\nimport {VERSION} from './env/data.js';\nimport toFormData from './helpers/toFormData.js';\nimport AxiosError from './core/AxiosError.js';\nimport spread from './helpers/spread.js';\nimport isAxiosError from './helpers/isAxiosError.js';\nimport AxiosHeaders from \"./core/AxiosHeaders.js\";\nimport adapters from './adapters/adapters.js';\nimport HttpStatusCode from './helpers/HttpStatusCode.js';\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n *\n * @returns {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n const context = new Axios(defaultConfig);\n const instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context, {allOwnKeys: true});\n\n // Copy context to instance\n utils.extend(instance, context, null, {allOwnKeys: true});\n\n // Factory for creating new instances\n instance.create = function create(instanceConfig) {\n return createInstance(mergeConfig(defaultConfig, instanceConfig));\n };\n\n return instance;\n}\n\n// Create the default instance to be exported\nconst axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Expose Cancel & CancelToken\naxios.CanceledError = CanceledError;\naxios.CancelToken = CancelToken;\naxios.isCancel = isCancel;\naxios.VERSION = VERSION;\naxios.toFormData = toFormData;\n\n// Expose AxiosError class\naxios.AxiosError = AxiosError;\n\n// alias for CanceledError for backward compatibility\naxios.Cancel = axios.CanceledError;\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\n\naxios.spread = spread;\n\n// Expose isAxiosError\naxios.isAxiosError = isAxiosError;\n\n// Expose mergeConfig\naxios.mergeConfig = mergeConfig;\n\naxios.AxiosHeaders = AxiosHeaders;\n\naxios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);\n\naxios.getAdapter = adapters.getAdapter;\n\naxios.HttpStatusCode = HttpStatusCode;\n\naxios.default = axios;\n\n// this module should only have a default export\nexport default axios\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n *\n * @returns {Function}\n */\nexport default function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n *\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nexport default function isAxiosError(payload) {\n return utils.isObject(payload) && (payload.isAxiosError === true);\n}\n"],"names":["bind","fn","thisArg","apply","arguments","cache","toString","Object","prototype","getPrototypeOf","kindOf","create","thing","str","call","slice","toLowerCase","kindOfTest","type","typeOfTest","_typeof","isArray","Array","isUndefined","isArrayBuffer","isString","isFunction","isNumber","isObject","isPlainObject","val","Symbol","toStringTag","iterator","isDate","isFile","isBlob","isFileList","isURLSearchParams","forEach","obj","i","l","_ref","length","undefined","_ref$allOwnKeys","allOwnKeys","key","keys","getOwnPropertyNames","len","findKey","_key","_global","globalThis","self","window","global","isContextDefined","context","TypedArray","isTypedArray","Uint8Array","isHTMLForm","hasOwnProperty","_ref4","prop","isRegExp","reduceDescriptors","reducer","descriptors","getOwnPropertyDescriptors","reducedDescriptors","descriptor","name","ret","defineProperties","ALPHA","DIGIT","ALPHABET","ALPHA_DIGIT","toUpperCase","isAsyncFn","utils$1","isBuffer","constructor","isFormData","kind","FormData","append","isArrayBufferView","ArrayBuffer","isView","buffer","isBoolean","isStream","pipe","merge","this","caseless","result","assignValue","targetKey","extend","a","b","_ref3","trim","replace","stripBOM","content","charCodeAt","inherits","superConstructor","props","defineProperty","value","assign","toFlatObject","sourceObj","destObj","filter","propFilter","merged","endsWith","searchString","position","String","lastIndex","indexOf","toArray","arr","forEachEntry","next","done","pair","matchAll","regExp","matches","exec","push","hasOwnProp","freezeMethods","enumerable","writable","set","Error","toObjectSet","arrayOrString","delimiter","define","split","toCamelCase","m","p1","p2","noop","toFiniteNumber","defaultValue","Number","isFinite","generateString","size","alphabet","Math","random","isSpecCompliantForm","toJSONObject","stack","visit","source","target","reducedValue","isThenable","then","AxiosError","message","code","config","request","response","captureStackTrace","utils","toJSON","description","number","fileName","lineNumber","columnNumber","status","from","error","customProps","axiosError","cause","isVisitable","removeBrackets","renderKey","path","dots","concat","map","token","join","predicates","test","toFormData","formData","options","TypeError","metaTokens","indexes","option","visitor","defaultVisitor","useBlob","Blob","convertValue","toISOString","Buffer","JSON","stringify","some","isFlatArray","el","index","exposedHelpers","build","pop","encode","charMap","encodeURIComponent","match","AxiosURLSearchParams","params","_pairs","buildURL","url","serializedParams","_encode","serializeFn","serialize","hashmarkIndex","encoder","product","InterceptorManager$1","InterceptorManager","_classCallCheck","handlers","_createClass","fulfilled","rejected","synchronous","runWhen","id","h","transitionalDefaults","silentJSONParsing","forcedJSONParsing","clarifyTimeoutError","platform$1","isBrowser","classes","URLSearchParams","protocols","hasBrowserEnv","document","hasStandardBrowserEnv","navigator","hasStandardBrowserWebWorkerEnv","WorkerGlobalScope","importScripts","platform","formDataToJSON","buildPath","isNumericKey","isLast","arrayToObject","entries","parsePropPath","defaults","transitional","adapter","transformRequest","data","headers","contentType","getContentType","hasJSONContentType","isObjectPayload","setContentType","helpers","isNode","toURLEncodedForm","formSerializer","_FormData","env","rawValue","parser","parse","e","stringifySafely","transformResponse","JSONRequested","responseType","strictJSONParsing","ERR_BAD_RESPONSE","timeout","xsrfCookieName","xsrfHeaderName","maxContentLength","maxBodyLength","validateStatus","common","Accept","method","defaults$1","ignoreDuplicateOf","$internals","normalizeHeader","header","normalizeValue","matchHeaderValue","isHeaderNameFilter","AxiosHeaders","_Symbol$iterator","_Symbol$toStringTag","valueOrRewrite","rewrite","setHeader","_value","_header","_rewrite","lHeader","rawHeaders","parsed","setHeaders","line","substring","tokens","tokensRE","parseTokens","matcher","deleted","deleteHeader","format","normalized","w","char","formatHeader","_this$constructor","_len","targets","asStrings","_ref2","_slicedToArray","get","first","computed","_len2","_key2","accessors","defineAccessor","accessorName","methodName","arg1","arg2","arg3","configurable","buildAccessors","accessor","mapped","headerValue","AxiosHeaders$1","transformData","fns","normalize","isCancel","__CANCEL__","CanceledError","ERR_CANCELED","write","expires","domain","secure","cookie","Date","toGMTString","read","RegExp","decodeURIComponent","remove","now","buildFullPath","baseURL","requestedURL","relativeURL","combineURLs","originURL","msie","userAgent","urlParsingNode","createElement","resolveURL","href","setAttribute","protocol","host","search","hash","hostname","port","pathname","charAt","location","requestURL","progressEventReducer","listener","isDownloadStream","bytesNotified","_speedometer","samplesCount","min","firstSampleTS","bytes","timestamps","head","tail","chunkLength","startedAt","bytesCount","passed","round","speedometer","loaded","total","lengthComputable","progressBytes","rate","progress","estimated","event","knownAdapters","http","xhr","XMLHttpRequest","Promise","resolve","reject","onCanceled","requestData","requestHeaders","withXSRFToken","cancelToken","unsubscribe","signal","removeEventListener","Boolean","auth","username","password","unescape","btoa","fullPath","onloadend","responseHeaders","getAllResponseHeaders","ERR_BAD_REQUEST","floor","settle","err","responseText","statusText","open","paramsSerializer","onreadystatechange","readyState","responseURL","setTimeout","onabort","ECONNABORTED","onerror","ERR_NETWORK","ontimeout","timeoutErrorMessage","ETIMEDOUT","isURLSameOrigin","xsrfValue","cookies","setRequestHeader","withCredentials","onDownloadProgress","addEventListener","onUploadProgress","upload","cancel","abort","subscribe","aborted","send","renderReason","reason","isResolvedHandle","adapters","nameOrAdapter","rejectedReasons","reasons","state","throwIfCancellationRequested","throwIfRequested","dispatchRequest","headersToObject","mergeConfig","config1","config2","getMergedValue","mergeDeepProperties","valueFromConfig2","defaultToConfig2","mergeDirectKeys","mergeMap","timeoutMessage","decompress","beforeRedirect","transport","httpAgent","httpsAgent","socketPath","responseEncoding","configValue","VERSION","validators","deprecatedWarnings","validators$1","validator","version","formatMessage","opt","desc","opts","ERR_DEPRECATED","console","warn","assertOptions","schema","allowUnknown","ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","Axios","instanceConfig","interceptors","_request2","_regeneratorRuntime","mark","_callee","configOrUrl","dummy","wrap","_context","prev","_request","abrupt","sent","t0","stop","_x","_x2","_config","contextHeaders","requestInterceptorChain","synchronousRequestInterceptors","interceptor","unshift","promise","responseInterceptorChain","chain","newConfig","onFulfilled","onRejected","generateHTTPMethod","isForm","Axios$1","CancelToken$1","CancelToken","executor","resolvePromise","_listeners","onfulfilled","_resolve","splice","c","HttpStatusCode","Continue","SwitchingProtocols","Processing","EarlyHints","Ok","Created","Accepted","NonAuthoritativeInformation","NoContent","ResetContent","PartialContent","MultiStatus","AlreadyReported","ImUsed","MultipleChoices","MovedPermanently","Found","SeeOther","NotModified","UseProxy","Unused","TemporaryRedirect","PermanentRedirect","BadRequest","Unauthorized","PaymentRequired","Forbidden","NotFound","MethodNotAllowed","NotAcceptable","ProxyAuthenticationRequired","RequestTimeout","Conflict","Gone","LengthRequired","PreconditionFailed","PayloadTooLarge","UriTooLong","UnsupportedMediaType","RangeNotSatisfiable","ExpectationFailed","ImATeapot","MisdirectedRequest","UnprocessableEntity","Locked","FailedDependency","TooEarly","UpgradeRequired","PreconditionRequired","TooManyRequests","RequestHeaderFieldsTooLarge","UnavailableForLegalReasons","InternalServerError","NotImplemented","BadGateway","ServiceUnavailable","GatewayTimeout","HttpVersionNotSupported","VariantAlsoNegotiates","InsufficientStorage","LoopDetected","NotExtended","NetworkAuthenticationRequired","HttpStatusCode$1","axios","createInstance","defaultConfig","instance","Cancel","all","promises","spread","callback","isAxiosError","payload","formToJSON","getAdapter"],"mappings":"+sSAEe,SAASA,EAAKC,EAAIC,GAC/B,OAAO,WACL,OAAOD,EAAGE,MAAMD,EAASE,WAE7B,CCAA,IAGgBC,EAHTC,EAAYC,OAAOC,UAAnBF,SACAG,EAAkBF,OAAlBE,eAEDC,GAAUL,EAGbE,OAAOI,OAAO,MAHQ,SAAAC,GACrB,IAAMC,EAAMP,EAASQ,KAAKF,GAC1B,OAAOP,EAAMQ,KAASR,EAAMQ,GAAOA,EAAIE,MAAM,GAAI,GAAGC,iBAGlDC,EAAa,SAACC,GAElB,OADAA,EAAOA,EAAKF,cACL,SAACJ,GAAK,OAAKF,EAAOE,KAAWM,CAAI,CAC1C,EAEMC,EAAa,SAAAD,GAAI,OAAI,SAAAN,GAAK,OAAIQ,EAAOR,KAAUM,CAAI,CAAA,EASlDG,EAAWC,MAAXD,QASDE,EAAcJ,EAAW,aAqB/B,IAAMK,EAAgBP,EAAW,eA2BjC,IAAMQ,EAAWN,EAAW,UAQtBO,EAAaP,EAA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8G,GACpBC,EAAWppB,EAAKqiB,GAAM7hB,UAAU4K,QAASxH,GAa/C,OAVA2H,EAAM/E,OAAO4iB,EAAU/G,GAAM7hB,UAAWoD,EAAS,CAACb,YAAY,IAG9DwI,EAAM/E,OAAO4iB,EAAUxlB,EAAS,KAAM,CAACb,YAAY,IAGnDqmB,EAASzoB,OAAS,SAAgB2hB,GAChC,OAAO4G,EAAejJ,GAAYkJ,EAAe7G,KAG5C8G,CACT,CAGcF,CAAezX,WAG7BwX,GAAM5G,MAAQA,GAGd4G,GAAMrR,cAAgBA,GACtBqR,GAAMzE,YAAcA,GACpByE,GAAMvR,SAAWA,GACjBuR,GAAM9H,QAAUA,GAChB8H,GAAMlc,WAAaA,GAGnBkc,GAAMje,WAAaA,EAGnBie,GAAMI,OAASJ,GAAMrR,cAGrBqR,GAAMK,IAAM,SAAaC,GACvB,OAAOxN,QAAQuN,IAAIC,EACrB,EAEAN,GAAMO,OC9CS,SAAgBC,GAC7B,OAAO,SAAcrhB,GACnB,OAAOqhB,EAAStpB,MAAM,KAAMiI,GAEhC,ED6CA6gB,GAAMS,aE7DS,SAAsBC,GACnC,OAAOpe,EAAM3J,SAAS+nB,KAAsC,IAAzBA,EAAQD,YAC7C,EF8DAT,GAAMhJ,YAAcA,GAEpBgJ,GAAM5U,aAAeA,GAErB4U,GAAMW,WAAa,SAAAhpB,GAAK,OAAIsQ,GAAe3F,EAAMvH,WAAWpD,GAAS,IAAI6E,SAAS7E,GAASA,EAAM,EAEjGqoB,GAAMY,WAAarK,GAEnByJ,GAAMjE,eAAiBA,GAEvBiE,GAAK,QAAWA"} \ No newline at end of file
diff --git a/node_modules/axios/dist/browser/axios.cjs b/node_modules/axios/dist/browser/axios.cjs
new file mode 100644
index 0000000..7043a0b
--- /dev/null
+++ b/node_modules/axios/dist/browser/axios.cjs
@@ -0,0 +1,3258 @@
+// Axios v1.6.7 Copyright (c) 2024 Matt Zabriskie and contributors
+'use strict';
+
+function bind(fn, thisArg) {
+ return function wrap() {
+ return fn.apply(thisArg, arguments);
+ };
+}
+
+// utils is a library of generic helper functions non-specific to axios
+
+const {toString} = Object.prototype;
+const {getPrototypeOf} = Object;
+
+const kindOf = (cache => thing => {
+ const str = toString.call(thing);
+ return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
+})(Object.create(null));
+
+const kindOfTest = (type) => {
+ type = type.toLowerCase();
+ return (thing) => kindOf(thing) === type
+};
+
+const typeOfTest = type => thing => typeof thing === type;
+
+/**
+ * Determine if a value is an Array
+ *
+ * @param {Object} val The value to test
+ *
+ * @returns {boolean} True if value is an Array, otherwise false
+ */
+const {isArray} = Array;
+
+/**
+ * Determine if a value is undefined
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if the value is undefined, otherwise false
+ */
+const isUndefined = typeOfTest('undefined');
+
+/**
+ * Determine if a value is a Buffer
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a Buffer, otherwise false
+ */
+function isBuffer(val) {
+ return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
+ && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);
+}
+
+/**
+ * Determine if a value is an ArrayBuffer
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is an ArrayBuffer, otherwise false
+ */
+const isArrayBuffer = kindOfTest('ArrayBuffer');
+
+
+/**
+ * Determine if a value is a view on an ArrayBuffer
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
+ */
+function isArrayBufferView(val) {
+ let result;
+ if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
+ result = ArrayBuffer.isView(val);
+ } else {
+ result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));
+ }
+ return result;
+}
+
+/**
+ * Determine if a value is a String
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a String, otherwise false
+ */
+const isString = typeOfTest('string');
+
+/**
+ * Determine if a value is a Function
+ *
+ * @param {*} val The value to test
+ * @returns {boolean} True if value is a Function, otherwise false
+ */
+const isFunction = typeOfTest('function');
+
+/**
+ * Determine if a value is a Number
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a Number, otherwise false
+ */
+const isNumber = typeOfTest('number');
+
+/**
+ * Determine if a value is an Object
+ *
+ * @param {*} thing The value to test
+ *
+ * @returns {boolean} True if value is an Object, otherwise false
+ */
+const isObject = (thing) => thing !== null && typeof thing === 'object';
+
+/**
+ * Determine if a value is a Boolean
+ *
+ * @param {*} thing The value to test
+ * @returns {boolean} True if value is a Boolean, otherwise false
+ */
+const isBoolean = thing => thing === true || thing === false;
+
+/**
+ * Determine if a value is a plain Object
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a plain Object, otherwise false
+ */
+const isPlainObject = (val) => {
+ if (kindOf(val) !== 'object') {
+ return false;
+ }
+
+ const prototype = getPrototypeOf(val);
+ return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);
+};
+
+/**
+ * Determine if a value is a Date
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a Date, otherwise false
+ */
+const isDate = kindOfTest('Date');
+
+/**
+ * Determine if a value is a File
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a File, otherwise false
+ */
+const isFile = kindOfTest('File');
+
+/**
+ * Determine if a value is a Blob
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a Blob, otherwise false
+ */
+const isBlob = kindOfTest('Blob');
+
+/**
+ * Determine if a value is a FileList
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a File, otherwise false
+ */
+const isFileList = kindOfTest('FileList');
+
+/**
+ * Determine if a value is a Stream
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a Stream, otherwise false
+ */
+const isStream = (val) => isObject(val) && isFunction(val.pipe);
+
+/**
+ * Determine if a value is a FormData
+ *
+ * @param {*} thing The value to test
+ *
+ * @returns {boolean} True if value is an FormData, otherwise false
+ */
+const isFormData = (thing) => {
+ let kind;
+ return thing && (
+ (typeof FormData === 'function' && thing instanceof FormData) || (
+ isFunction(thing.append) && (
+ (kind = kindOf(thing)) === 'formdata' ||
+ // detect form-data instance
+ (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')
+ )
+ )
+ )
+};
+
+/**
+ * Determine if a value is a URLSearchParams object
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a URLSearchParams object, otherwise false
+ */
+const isURLSearchParams = kindOfTest('URLSearchParams');
+
+/**
+ * Trim excess whitespace off the beginning and end of a string
+ *
+ * @param {String} str The String to trim
+ *
+ * @returns {String} The String freed of excess whitespace
+ */
+const trim = (str) => str.trim ?
+ str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
+
+/**
+ * Iterate over an Array or an Object invoking a function for each item.
+ *
+ * If `obj` is an Array callback will be called passing
+ * the value, index, and complete array for each item.
+ *
+ * If 'obj' is an Object callback will be called passing
+ * the value, key, and complete object for each property.
+ *
+ * @param {Object|Array} obj The object to iterate
+ * @param {Function} fn The callback to invoke for each item
+ *
+ * @param {Boolean} [allOwnKeys = false]
+ * @returns {any}
+ */
+function forEach(obj, fn, {allOwnKeys = false} = {}) {
+ // Don't bother if no value provided
+ if (obj === null || typeof obj === 'undefined') {
+ return;
+ }
+
+ let i;
+ let l;
+
+ // Force an array if not already something iterable
+ if (typeof obj !== 'object') {
+ /*eslint no-param-reassign:0*/
+ obj = [obj];
+ }
+
+ if (isArray(obj)) {
+ // Iterate over array values
+ for (i = 0, l = obj.length; i < l; i++) {
+ fn.call(null, obj[i], i, obj);
+ }
+ } else {
+ // Iterate over object keys
+ const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
+ const len = keys.length;
+ let key;
+
+ for (i = 0; i < len; i++) {
+ key = keys[i];
+ fn.call(null, obj[key], key, obj);
+ }
+ }
+}
+
+function findKey(obj, key) {
+ key = key.toLowerCase();
+ const keys = Object.keys(obj);
+ let i = keys.length;
+ let _key;
+ while (i-- > 0) {
+ _key = keys[i];
+ if (key === _key.toLowerCase()) {
+ return _key;
+ }
+ }
+ return null;
+}
+
+const _global = (() => {
+ /*eslint no-undef:0*/
+ if (typeof globalThis !== "undefined") return globalThis;
+ return typeof self !== "undefined" ? self : (typeof window !== 'undefined' ? window : global)
+})();
+
+const isContextDefined = (context) => !isUndefined(context) && context !== _global;
+
+/**
+ * Accepts varargs expecting each argument to be an object, then
+ * immutably merges the properties of each object and returns result.
+ *
+ * When multiple objects contain the same key the later object in
+ * the arguments list will take precedence.
+ *
+ * Example:
+ *
+ * ```js
+ * var result = merge({foo: 123}, {foo: 456});
+ * console.log(result.foo); // outputs 456
+ * ```
+ *
+ * @param {Object} obj1 Object to merge
+ *
+ * @returns {Object} Result of all merge properties
+ */
+function merge(/* obj1, obj2, obj3, ... */) {
+ const {caseless} = isContextDefined(this) && this || {};
+ const result = {};
+ const assignValue = (val, key) => {
+ const targetKey = caseless && findKey(result, key) || key;
+ if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
+ result[targetKey] = merge(result[targetKey], val);
+ } else if (isPlainObject(val)) {
+ result[targetKey] = merge({}, val);
+ } else if (isArray(val)) {
+ result[targetKey] = val.slice();
+ } else {
+ result[targetKey] = val;
+ }
+ };
+
+ for (let i = 0, l = arguments.length; i < l; i++) {
+ arguments[i] && forEach(arguments[i], assignValue);
+ }
+ return result;
+}
+
+/**
+ * Extends object a by mutably adding to it the properties of object b.
+ *
+ * @param {Object} a The object to be extended
+ * @param {Object} b The object to copy properties from
+ * @param {Object} thisArg The object to bind function to
+ *
+ * @param {Boolean} [allOwnKeys]
+ * @returns {Object} The resulting value of object a
+ */
+const extend = (a, b, thisArg, {allOwnKeys}= {}) => {
+ forEach(b, (val, key) => {
+ if (thisArg && isFunction(val)) {
+ a[key] = bind(val, thisArg);
+ } else {
+ a[key] = val;
+ }
+ }, {allOwnKeys});
+ return a;
+};
+
+/**
+ * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
+ *
+ * @param {string} content with BOM
+ *
+ * @returns {string} content value without BOM
+ */
+const stripBOM = (content) => {
+ if (content.charCodeAt(0) === 0xFEFF) {
+ content = content.slice(1);
+ }
+ return content;
+};
+
+/**
+ * Inherit the prototype methods from one constructor into another
+ * @param {function} constructor
+ * @param {function} superConstructor
+ * @param {object} [props]
+ * @param {object} [descriptors]
+ *
+ * @returns {void}
+ */
+const inherits = (constructor, superConstructor, props, descriptors) => {
+ constructor.prototype = Object.create(superConstructor.prototype, descriptors);
+ constructor.prototype.constructor = constructor;
+ Object.defineProperty(constructor, 'super', {
+ value: superConstructor.prototype
+ });
+ props && Object.assign(constructor.prototype, props);
+};
+
+/**
+ * Resolve object with deep prototype chain to a flat object
+ * @param {Object} sourceObj source object
+ * @param {Object} [destObj]
+ * @param {Function|Boolean} [filter]
+ * @param {Function} [propFilter]
+ *
+ * @returns {Object}
+ */
+const toFlatObject = (sourceObj, destObj, filter, propFilter) => {
+ let props;
+ let i;
+ let prop;
+ const merged = {};
+
+ destObj = destObj || {};
+ // eslint-disable-next-line no-eq-null,eqeqeq
+ if (sourceObj == null) return destObj;
+
+ do {
+ props = Object.getOwnPropertyNames(sourceObj);
+ i = props.length;
+ while (i-- > 0) {
+ prop = props[i];
+ if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
+ destObj[prop] = sourceObj[prop];
+ merged[prop] = true;
+ }
+ }
+ sourceObj = filter !== false && getPrototypeOf(sourceObj);
+ } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
+
+ return destObj;
+};
+
+/**
+ * Determines whether a string ends with the characters of a specified string
+ *
+ * @param {String} str
+ * @param {String} searchString
+ * @param {Number} [position= 0]
+ *
+ * @returns {boolean}
+ */
+const endsWith = (str, searchString, position) => {
+ str = String(str);
+ if (position === undefined || position > str.length) {
+ position = str.length;
+ }
+ position -= searchString.length;
+ const lastIndex = str.indexOf(searchString, position);
+ return lastIndex !== -1 && lastIndex === position;
+};
+
+
+/**
+ * Returns new array from array like object or null if failed
+ *
+ * @param {*} [thing]
+ *
+ * @returns {?Array}
+ */
+const toArray = (thing) => {
+ if (!thing) return null;
+ if (isArray(thing)) return thing;
+ let i = thing.length;
+ if (!isNumber(i)) return null;
+ const arr = new Array(i);
+ while (i-- > 0) {
+ arr[i] = thing[i];
+ }
+ return arr;
+};
+
+/**
+ * Checking if the Uint8Array exists and if it does, it returns a function that checks if the
+ * thing passed in is an instance of Uint8Array
+ *
+ * @param {TypedArray}
+ *
+ * @returns {Array}
+ */
+// eslint-disable-next-line func-names
+const isTypedArray = (TypedArray => {
+ // eslint-disable-next-line func-names
+ return thing => {
+ return TypedArray && thing instanceof TypedArray;
+ };
+})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));
+
+/**
+ * For each entry in the object, call the function with the key and value.
+ *
+ * @param {Object<any, any>} obj - The object to iterate over.
+ * @param {Function} fn - The function to call for each entry.
+ *
+ * @returns {void}
+ */
+const forEachEntry = (obj, fn) => {
+ const generator = obj && obj[Symbol.iterator];
+
+ const iterator = generator.call(obj);
+
+ let result;
+
+ while ((result = iterator.next()) && !result.done) {
+ const pair = result.value;
+ fn.call(obj, pair[0], pair[1]);
+ }
+};
+
+/**
+ * It takes a regular expression and a string, and returns an array of all the matches
+ *
+ * @param {string} regExp - The regular expression to match against.
+ * @param {string} str - The string to search.
+ *
+ * @returns {Array<boolean>}
+ */
+const matchAll = (regExp, str) => {
+ let matches;
+ const arr = [];
+
+ while ((matches = regExp.exec(str)) !== null) {
+ arr.push(matches);
+ }
+
+ return arr;
+};
+
+/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */
+const isHTMLForm = kindOfTest('HTMLFormElement');
+
+const toCamelCase = str => {
+ return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,
+ function replacer(m, p1, p2) {
+ return p1.toUpperCase() + p2;
+ }
+ );
+};
+
+/* Creating a function that will check if an object has a property. */
+const hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);
+
+/**
+ * Determine if a value is a RegExp object
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a RegExp object, otherwise false
+ */
+const isRegExp = kindOfTest('RegExp');
+
+const reduceDescriptors = (obj, reducer) => {
+ const descriptors = Object.getOwnPropertyDescriptors(obj);
+ const reducedDescriptors = {};
+
+ forEach(descriptors, (descriptor, name) => {
+ let ret;
+ if ((ret = reducer(descriptor, name, obj)) !== false) {
+ reducedDescriptors[name] = ret || descriptor;
+ }
+ });
+
+ Object.defineProperties(obj, reducedDescriptors);
+};
+
+/**
+ * Makes all methods read-only
+ * @param {Object} obj
+ */
+
+const freezeMethods = (obj) => {
+ reduceDescriptors(obj, (descriptor, name) => {
+ // skip restricted props in strict mode
+ if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {
+ return false;
+ }
+
+ const value = obj[name];
+
+ if (!isFunction(value)) return;
+
+ descriptor.enumerable = false;
+
+ if ('writable' in descriptor) {
+ descriptor.writable = false;
+ return;
+ }
+
+ if (!descriptor.set) {
+ descriptor.set = () => {
+ throw Error('Can not rewrite read-only method \'' + name + '\'');
+ };
+ }
+ });
+};
+
+const toObjectSet = (arrayOrString, delimiter) => {
+ const obj = {};
+
+ const define = (arr) => {
+ arr.forEach(value => {
+ obj[value] = true;
+ });
+ };
+
+ isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
+
+ return obj;
+};
+
+const noop = () => {};
+
+const toFiniteNumber = (value, defaultValue) => {
+ value = +value;
+ return Number.isFinite(value) ? value : defaultValue;
+};
+
+const ALPHA = 'abcdefghijklmnopqrstuvwxyz';
+
+const DIGIT = '0123456789';
+
+const ALPHABET = {
+ DIGIT,
+ ALPHA,
+ ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
+};
+
+const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
+ let str = '';
+ const {length} = alphabet;
+ while (size--) {
+ str += alphabet[Math.random() * length|0];
+ }
+
+ return str;
+};
+
+/**
+ * If the thing is a FormData object, return true, otherwise return false.
+ *
+ * @param {unknown} thing - The thing to check.
+ *
+ * @returns {boolean}
+ */
+function isSpecCompliantForm(thing) {
+ return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]);
+}
+
+const toJSONObject = (obj) => {
+ const stack = new Array(10);
+
+ const visit = (source, i) => {
+
+ if (isObject(source)) {
+ if (stack.indexOf(source) >= 0) {
+ return;
+ }
+
+ if(!('toJSON' in source)) {
+ stack[i] = source;
+ const target = isArray(source) ? [] : {};
+
+ forEach(source, (value, key) => {
+ const reducedValue = visit(value, i + 1);
+ !isUndefined(reducedValue) && (target[key] = reducedValue);
+ });
+
+ stack[i] = undefined;
+
+ return target;
+ }
+ }
+
+ return source;
+ };
+
+ return visit(obj, 0);
+};
+
+const isAsyncFn = kindOfTest('AsyncFunction');
+
+const isThenable = (thing) =>
+ thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
+
+var utils$1 = {
+ isArray,
+ isArrayBuffer,
+ isBuffer,
+ isFormData,
+ isArrayBufferView,
+ isString,
+ isNumber,
+ isBoolean,
+ isObject,
+ isPlainObject,
+ isUndefined,
+ isDate,
+ isFile,
+ isBlob,
+ isRegExp,
+ isFunction,
+ isStream,
+ isURLSearchParams,
+ isTypedArray,
+ isFileList,
+ forEach,
+ merge,
+ extend,
+ trim,
+ stripBOM,
+ inherits,
+ toFlatObject,
+ kindOf,
+ kindOfTest,
+ endsWith,
+ toArray,
+ forEachEntry,
+ matchAll,
+ isHTMLForm,
+ hasOwnProperty,
+ hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection
+ reduceDescriptors,
+ freezeMethods,
+ toObjectSet,
+ toCamelCase,
+ noop,
+ toFiniteNumber,
+ findKey,
+ global: _global,
+ isContextDefined,
+ ALPHABET,
+ generateString,
+ isSpecCompliantForm,
+ toJSONObject,
+ isAsyncFn,
+ isThenable
+};
+
+/**
+ * Create an Error with the specified message, config, error code, request and response.
+ *
+ * @param {string} message The error message.
+ * @param {string} [code] The error code (for example, 'ECONNABORTED').
+ * @param {Object} [config] The config.
+ * @param {Object} [request] The request.
+ * @param {Object} [response] The response.
+ *
+ * @returns {Error} The created error.
+ */
+function AxiosError(message, code, config, request, response) {
+ Error.call(this);
+
+ if (Error.captureStackTrace) {
+ Error.captureStackTrace(this, this.constructor);
+ } else {
+ this.stack = (new Error()).stack;
+ }
+
+ this.message = message;
+ this.name = 'AxiosError';
+ code && (this.code = code);
+ config && (this.config = config);
+ request && (this.request = request);
+ response && (this.response = response);
+}
+
+utils$1.inherits(AxiosError, Error, {
+ toJSON: function toJSON() {
+ return {
+ // Standard
+ message: this.message,
+ name: this.name,
+ // Microsoft
+ description: this.description,
+ number: this.number,
+ // Mozilla
+ fileName: this.fileName,
+ lineNumber: this.lineNumber,
+ columnNumber: this.columnNumber,
+ stack: this.stack,
+ // Axios
+ config: utils$1.toJSONObject(this.config),
+ code: this.code,
+ status: this.response && this.response.status ? this.response.status : null
+ };
+ }
+});
+
+const prototype$1 = AxiosError.prototype;
+const descriptors = {};
+
+[
+ 'ERR_BAD_OPTION_VALUE',
+ 'ERR_BAD_OPTION',
+ 'ECONNABORTED',
+ 'ETIMEDOUT',
+ 'ERR_NETWORK',
+ 'ERR_FR_TOO_MANY_REDIRECTS',
+ 'ERR_DEPRECATED',
+ 'ERR_BAD_RESPONSE',
+ 'ERR_BAD_REQUEST',
+ 'ERR_CANCELED',
+ 'ERR_NOT_SUPPORT',
+ 'ERR_INVALID_URL'
+// eslint-disable-next-line func-names
+].forEach(code => {
+ descriptors[code] = {value: code};
+});
+
+Object.defineProperties(AxiosError, descriptors);
+Object.defineProperty(prototype$1, 'isAxiosError', {value: true});
+
+// eslint-disable-next-line func-names
+AxiosError.from = (error, code, config, request, response, customProps) => {
+ const axiosError = Object.create(prototype$1);
+
+ utils$1.toFlatObject(error, axiosError, function filter(obj) {
+ return obj !== Error.prototype;
+ }, prop => {
+ return prop !== 'isAxiosError';
+ });
+
+ AxiosError.call(axiosError, error.message, code, config, request, response);
+
+ axiosError.cause = error;
+
+ axiosError.name = error.name;
+
+ customProps && Object.assign(axiosError, customProps);
+
+ return axiosError;
+};
+
+// eslint-disable-next-line strict
+var httpAdapter = null;
+
+/**
+ * Determines if the given thing is a array or js object.
+ *
+ * @param {string} thing - The object or array to be visited.
+ *
+ * @returns {boolean}
+ */
+function isVisitable(thing) {
+ return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
+}
+
+/**
+ * It removes the brackets from the end of a string
+ *
+ * @param {string} key - The key of the parameter.
+ *
+ * @returns {string} the key without the brackets.
+ */
+function removeBrackets(key) {
+ return utils$1.endsWith(key, '[]') ? key.slice(0, -2) : key;
+}
+
+/**
+ * It takes a path, a key, and a boolean, and returns a string
+ *
+ * @param {string} path - The path to the current key.
+ * @param {string} key - The key of the current object being iterated over.
+ * @param {string} dots - If true, the key will be rendered with dots instead of brackets.
+ *
+ * @returns {string} The path to the current key.
+ */
+function renderKey(path, key, dots) {
+ if (!path) return key;
+ return path.concat(key).map(function each(token, i) {
+ // eslint-disable-next-line no-param-reassign
+ token = removeBrackets(token);
+ return !dots && i ? '[' + token + ']' : token;
+ }).join(dots ? '.' : '');
+}
+
+/**
+ * If the array is an array and none of its elements are visitable, then it's a flat array.
+ *
+ * @param {Array<any>} arr - The array to check
+ *
+ * @returns {boolean}
+ */
+function isFlatArray(arr) {
+ return utils$1.isArray(arr) && !arr.some(isVisitable);
+}
+
+const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {
+ return /^is[A-Z]/.test(prop);
+});
+
+/**
+ * Convert a data object to FormData
+ *
+ * @param {Object} obj
+ * @param {?Object} [formData]
+ * @param {?Object} [options]
+ * @param {Function} [options.visitor]
+ * @param {Boolean} [options.metaTokens = true]
+ * @param {Boolean} [options.dots = false]
+ * @param {?Boolean} [options.indexes = false]
+ *
+ * @returns {Object}
+ **/
+
+/**
+ * It converts an object into a FormData object
+ *
+ * @param {Object<any, any>} obj - The object to convert to form data.
+ * @param {string} formData - The FormData object to append to.
+ * @param {Object<string, any>} options
+ *
+ * @returns
+ */
+function toFormData(obj, formData, options) {
+ if (!utils$1.isObject(obj)) {
+ throw new TypeError('target must be an object');
+ }
+
+ // eslint-disable-next-line no-param-reassign
+ formData = formData || new (FormData)();
+
+ // eslint-disable-next-line no-param-reassign
+ options = utils$1.toFlatObject(options, {
+ metaTokens: true,
+ dots: false,
+ indexes: false
+ }, false, function defined(option, source) {
+ // eslint-disable-next-line no-eq-null,eqeqeq
+ return !utils$1.isUndefined(source[option]);
+ });
+
+ const metaTokens = options.metaTokens;
+ // eslint-disable-next-line no-use-before-define
+ const visitor = options.visitor || defaultVisitor;
+ const dots = options.dots;
+ const indexes = options.indexes;
+ const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;
+ const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
+
+ if (!utils$1.isFunction(visitor)) {
+ throw new TypeError('visitor must be a function');
+ }
+
+ function convertValue(value) {
+ if (value === null) return '';
+
+ if (utils$1.isDate(value)) {
+ return value.toISOString();
+ }
+
+ if (!useBlob && utils$1.isBlob(value)) {
+ throw new AxiosError('Blob is not supported. Use a Buffer instead.');
+ }
+
+ if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
+ return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
+ }
+
+ return value;
+ }
+
+ /**
+ * Default visitor.
+ *
+ * @param {*} value
+ * @param {String|Number} key
+ * @param {Array<String|Number>} path
+ * @this {FormData}
+ *
+ * @returns {boolean} return true to visit the each prop of the value recursively
+ */
+ function defaultVisitor(value, key, path) {
+ let arr = value;
+
+ if (value && !path && typeof value === 'object') {
+ if (utils$1.endsWith(key, '{}')) {
+ // eslint-disable-next-line no-param-reassign
+ key = metaTokens ? key : key.slice(0, -2);
+ // eslint-disable-next-line no-param-reassign
+ value = JSON.stringify(value);
+ } else if (
+ (utils$1.isArray(value) && isFlatArray(value)) ||
+ ((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value))
+ )) {
+ // eslint-disable-next-line no-param-reassign
+ key = removeBrackets(key);
+
+ arr.forEach(function each(el, index) {
+ !(utils$1.isUndefined(el) || el === null) && formData.append(
+ // eslint-disable-next-line no-nested-ternary
+ indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),
+ convertValue(el)
+ );
+ });
+ return false;
+ }
+ }
+
+ if (isVisitable(value)) {
+ return true;
+ }
+
+ formData.append(renderKey(path, key, dots), convertValue(value));
+
+ return false;
+ }
+
+ const stack = [];
+
+ const exposedHelpers = Object.assign(predicates, {
+ defaultVisitor,
+ convertValue,
+ isVisitable
+ });
+
+ function build(value, path) {
+ if (utils$1.isUndefined(value)) return;
+
+ if (stack.indexOf(value) !== -1) {
+ throw Error('Circular reference detected in ' + path.join('.'));
+ }
+
+ stack.push(value);
+
+ utils$1.forEach(value, function each(el, key) {
+ const result = !(utils$1.isUndefined(el) || el === null) && visitor.call(
+ formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers
+ );
+
+ if (result === true) {
+ build(el, path ? path.concat(key) : [key]);
+ }
+ });
+
+ stack.pop();
+ }
+
+ if (!utils$1.isObject(obj)) {
+ throw new TypeError('data must be an object');
+ }
+
+ build(obj);
+
+ return formData;
+}
+
+/**
+ * It encodes a string by replacing all characters that are not in the unreserved set with
+ * their percent-encoded equivalents
+ *
+ * @param {string} str - The string to encode.
+ *
+ * @returns {string} The encoded string.
+ */
+function encode$1(str) {
+ const charMap = {
+ '!': '%21',
+ "'": '%27',
+ '(': '%28',
+ ')': '%29',
+ '~': '%7E',
+ '%20': '+',
+ '%00': '\x00'
+ };
+ return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {
+ return charMap[match];
+ });
+}
+
+/**
+ * It takes a params object and converts it to a FormData object
+ *
+ * @param {Object<string, any>} params - The parameters to be converted to a FormData object.
+ * @param {Object<string, any>} options - The options object passed to the Axios constructor.
+ *
+ * @returns {void}
+ */
+function AxiosURLSearchParams(params, options) {
+ this._pairs = [];
+
+ params && toFormData(params, this, options);
+}
+
+const prototype = AxiosURLSearchParams.prototype;
+
+prototype.append = function append(name, value) {
+ this._pairs.push([name, value]);
+};
+
+prototype.toString = function toString(encoder) {
+ const _encode = encoder ? function(value) {
+ return encoder.call(this, value, encode$1);
+ } : encode$1;
+
+ return this._pairs.map(function each(pair) {
+ return _encode(pair[0]) + '=' + _encode(pair[1]);
+ }, '').join('&');
+};
+
+/**
+ * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their
+ * URI encoded counterparts
+ *
+ * @param {string} val The value to be encoded.
+ *
+ * @returns {string} The encoded value.
+ */
+function encode(val) {
+ return encodeURIComponent(val).
+ replace(/%3A/gi, ':').
+ replace(/%24/g, '$').
+ replace(/%2C/gi, ',').
+ replace(/%20/g, '+').
+ replace(/%5B/gi, '[').
+ replace(/%5D/gi, ']');
+}
+
+/**
+ * Build a URL by appending params to the end
+ *
+ * @param {string} url The base of the url (e.g., http://www.google.com)
+ * @param {object} [params] The params to be appended
+ * @param {?object} options
+ *
+ * @returns {string} The formatted url
+ */
+function buildURL(url, params, options) {
+ /*eslint no-param-reassign:0*/
+ if (!params) {
+ return url;
+ }
+
+ const _encode = options && options.encode || encode;
+
+ const serializeFn = options && options.serialize;
+
+ let serializedParams;
+
+ if (serializeFn) {
+ serializedParams = serializeFn(params, options);
+ } else {
+ serializedParams = utils$1.isURLSearchParams(params) ?
+ params.toString() :
+ new AxiosURLSearchParams(params, options).toString(_encode);
+ }
+
+ if (serializedParams) {
+ const hashmarkIndex = url.indexOf("#");
+
+ if (hashmarkIndex !== -1) {
+ url = url.slice(0, hashmarkIndex);
+ }
+ url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
+ }
+
+ return url;
+}
+
+class InterceptorManager {
+ constructor() {
+ this.handlers = [];
+ }
+
+ /**
+ * Add a new interceptor to the stack
+ *
+ * @param {Function} fulfilled The function to handle `then` for a `Promise`
+ * @param {Function} rejected The function to handle `reject` for a `Promise`
+ *
+ * @return {Number} An ID used to remove interceptor later
+ */
+ use(fulfilled, rejected, options) {
+ this.handlers.push({
+ fulfilled,
+ rejected,
+ synchronous: options ? options.synchronous : false,
+ runWhen: options ? options.runWhen : null
+ });
+ return this.handlers.length - 1;
+ }
+
+ /**
+ * Remove an interceptor from the stack
+ *
+ * @param {Number} id The ID that was returned by `use`
+ *
+ * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
+ */
+ eject(id) {
+ if (this.handlers[id]) {
+ this.handlers[id] = null;
+ }
+ }
+
+ /**
+ * Clear all interceptors from the stack
+ *
+ * @returns {void}
+ */
+ clear() {
+ if (this.handlers) {
+ this.handlers = [];
+ }
+ }
+
+ /**
+ * Iterate over all the registered interceptors
+ *
+ * This method is particularly useful for skipping over any
+ * interceptors that may have become `null` calling `eject`.
+ *
+ * @param {Function} fn The function to call for each interceptor
+ *
+ * @returns {void}
+ */
+ forEach(fn) {
+ utils$1.forEach(this.handlers, function forEachHandler(h) {
+ if (h !== null) {
+ fn(h);
+ }
+ });
+ }
+}
+
+var InterceptorManager$1 = InterceptorManager;
+
+var transitionalDefaults = {
+ silentJSONParsing: true,
+ forcedJSONParsing: true,
+ clarifyTimeoutError: false
+};
+
+var URLSearchParams$1 = typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;
+
+var FormData$1 = typeof FormData !== 'undefined' ? FormData : null;
+
+var Blob$1 = typeof Blob !== 'undefined' ? Blob : null;
+
+var platform$1 = {
+ isBrowser: true,
+ classes: {
+ URLSearchParams: URLSearchParams$1,
+ FormData: FormData$1,
+ Blob: Blob$1
+ },
+ protocols: ['http', 'https', 'file', 'blob', 'url', 'data']
+};
+
+const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
+
+/**
+ * Determine if we're running in a standard browser environment
+ *
+ * This allows axios to run in a web worker, and react-native.
+ * Both environments support XMLHttpRequest, but not fully standard globals.
+ *
+ * web workers:
+ * typeof window -> undefined
+ * typeof document -> undefined
+ *
+ * react-native:
+ * navigator.product -> 'ReactNative'
+ * nativescript
+ * navigator.product -> 'NativeScript' or 'NS'
+ *
+ * @returns {boolean}
+ */
+const hasStandardBrowserEnv = (
+ (product) => {
+ return hasBrowserEnv && ['ReactNative', 'NativeScript', 'NS'].indexOf(product) < 0
+ })(typeof navigator !== 'undefined' && navigator.product);
+
+/**
+ * Determine if we're running in a standard browser webWorker environment
+ *
+ * Although the `isStandardBrowserEnv` method indicates that
+ * `allows axios to run in a web worker`, the WebWorker will still be
+ * filtered out due to its judgment standard
+ * `typeof window !== 'undefined' && typeof document !== 'undefined'`.
+ * This leads to a problem when axios post `FormData` in webWorker
+ */
+const hasStandardBrowserWebWorkerEnv = (() => {
+ return (
+ typeof WorkerGlobalScope !== 'undefined' &&
+ // eslint-disable-next-line no-undef
+ self instanceof WorkerGlobalScope &&
+ typeof self.importScripts === 'function'
+ );
+})();
+
+var utils = /*#__PURE__*/Object.freeze({
+ __proto__: null,
+ hasBrowserEnv: hasBrowserEnv,
+ hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
+ hasStandardBrowserEnv: hasStandardBrowserEnv
+});
+
+var platform = {
+ ...utils,
+ ...platform$1
+};
+
+function toURLEncodedForm(data, options) {
+ return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({
+ visitor: function(value, key, path, helpers) {
+ if (platform.isNode && utils$1.isBuffer(value)) {
+ this.append(key, value.toString('base64'));
+ return false;
+ }
+
+ return helpers.defaultVisitor.apply(this, arguments);
+ }
+ }, options));
+}
+
+/**
+ * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']
+ *
+ * @param {string} name - The name of the property to get.
+ *
+ * @returns An array of strings.
+ */
+function parsePropPath(name) {
+ // foo[x][y][z]
+ // foo.x.y.z
+ // foo-x-y-z
+ // foo x y z
+ return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map(match => {
+ return match[0] === '[]' ? '' : match[1] || match[0];
+ });
+}
+
+/**
+ * Convert an array to an object.
+ *
+ * @param {Array<any>} arr - The array to convert to an object.
+ *
+ * @returns An object with the same keys and values as the array.
+ */
+function arrayToObject(arr) {
+ const obj = {};
+ const keys = Object.keys(arr);
+ let i;
+ const len = keys.length;
+ let key;
+ for (i = 0; i < len; i++) {
+ key = keys[i];
+ obj[key] = arr[key];
+ }
+ return obj;
+}
+
+/**
+ * It takes a FormData object and returns a JavaScript object
+ *
+ * @param {string} formData The FormData object to convert to JSON.
+ *
+ * @returns {Object<string, any> | null} The converted object.
+ */
+function formDataToJSON(formData) {
+ function buildPath(path, value, target, index) {
+ let name = path[index++];
+
+ if (name === '__proto__') return true;
+
+ const isNumericKey = Number.isFinite(+name);
+ const isLast = index >= path.length;
+ name = !name && utils$1.isArray(target) ? target.length : name;
+
+ if (isLast) {
+ if (utils$1.hasOwnProp(target, name)) {
+ target[name] = [target[name], value];
+ } else {
+ target[name] = value;
+ }
+
+ return !isNumericKey;
+ }
+
+ if (!target[name] || !utils$1.isObject(target[name])) {
+ target[name] = [];
+ }
+
+ const result = buildPath(path, value, target[name], index);
+
+ if (result && utils$1.isArray(target[name])) {
+ target[name] = arrayToObject(target[name]);
+ }
+
+ return !isNumericKey;
+ }
+
+ if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
+ const obj = {};
+
+ utils$1.forEachEntry(formData, (name, value) => {
+ buildPath(parsePropPath(name), value, obj, 0);
+ });
+
+ return obj;
+ }
+
+ return null;
+}
+
+/**
+ * It takes a string, tries to parse it, and if it fails, it returns the stringified version
+ * of the input
+ *
+ * @param {any} rawValue - The value to be stringified.
+ * @param {Function} parser - A function that parses a string into a JavaScript object.
+ * @param {Function} encoder - A function that takes a value and returns a string.
+ *
+ * @returns {string} A stringified version of the rawValue.
+ */
+function stringifySafely(rawValue, parser, encoder) {
+ if (utils$1.isString(rawValue)) {
+ try {
+ (parser || JSON.parse)(rawValue);
+ return utils$1.trim(rawValue);
+ } catch (e) {
+ if (e.name !== 'SyntaxError') {
+ throw e;
+ }
+ }
+ }
+
+ return (encoder || JSON.stringify)(rawValue);
+}
+
+const defaults = {
+
+ transitional: transitionalDefaults,
+
+ adapter: ['xhr', 'http'],
+
+ transformRequest: [function transformRequest(data, headers) {
+ const contentType = headers.getContentType() || '';
+ const hasJSONContentType = contentType.indexOf('application/json') > -1;
+ const isObjectPayload = utils$1.isObject(data);
+
+ if (isObjectPayload && utils$1.isHTMLForm(data)) {
+ data = new FormData(data);
+ }
+
+ const isFormData = utils$1.isFormData(data);
+
+ if (isFormData) {
+ return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
+ }
+
+ if (utils$1.isArrayBuffer(data) ||
+ utils$1.isBuffer(data) ||
+ utils$1.isStream(data) ||
+ utils$1.isFile(data) ||
+ utils$1.isBlob(data)
+ ) {
+ return data;
+ }
+ if (utils$1.isArrayBufferView(data)) {
+ return data.buffer;
+ }
+ if (utils$1.isURLSearchParams(data)) {
+ headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
+ return data.toString();
+ }
+
+ let isFileList;
+
+ if (isObjectPayload) {
+ if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {
+ return toURLEncodedForm(data, this.formSerializer).toString();
+ }
+
+ if ((isFileList = utils$1.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {
+ const _FormData = this.env && this.env.FormData;
+
+ return toFormData(
+ isFileList ? {'files[]': data} : data,
+ _FormData && new _FormData(),
+ this.formSerializer
+ );
+ }
+ }
+
+ if (isObjectPayload || hasJSONContentType ) {
+ headers.setContentType('application/json', false);
+ return stringifySafely(data);
+ }
+
+ return data;
+ }],
+
+ transformResponse: [function transformResponse(data) {
+ const transitional = this.transitional || defaults.transitional;
+ const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
+ const JSONRequested = this.responseType === 'json';
+
+ if (data && utils$1.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {
+ const silentJSONParsing = transitional && transitional.silentJSONParsing;
+ const strictJSONParsing = !silentJSONParsing && JSONRequested;
+
+ try {
+ return JSON.parse(data);
+ } catch (e) {
+ if (strictJSONParsing) {
+ if (e.name === 'SyntaxError') {
+ throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);
+ }
+ throw e;
+ }
+ }
+ }
+
+ return data;
+ }],
+
+ /**
+ * A timeout in milliseconds to abort a request. If set to 0 (default) a
+ * timeout is not created.
+ */
+ timeout: 0,
+
+ xsrfCookieName: 'XSRF-TOKEN',
+ xsrfHeaderName: 'X-XSRF-TOKEN',
+
+ maxContentLength: -1,
+ maxBodyLength: -1,
+
+ env: {
+ FormData: platform.classes.FormData,
+ Blob: platform.classes.Blob
+ },
+
+ validateStatus: function validateStatus(status) {
+ return status >= 200 && status < 300;
+ },
+
+ headers: {
+ common: {
+ 'Accept': 'application/json, text/plain, */*',
+ 'Content-Type': undefined
+ }
+ }
+};
+
+utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {
+ defaults.headers[method] = {};
+});
+
+var defaults$1 = defaults;
+
+// RawAxiosHeaders whose duplicates are ignored by node
+// c.f. https://nodejs.org/api/http.html#http_message_headers
+const ignoreDuplicateOf = utils$1.toObjectSet([
+ 'age', 'authorization', 'content-length', 'content-type', 'etag',
+ 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
+ 'last-modified', 'location', 'max-forwards', 'proxy-authorization',
+ 'referer', 'retry-after', 'user-agent'
+]);
+
+/**
+ * Parse headers into an object
+ *
+ * ```
+ * Date: Wed, 27 Aug 2014 08:58:49 GMT
+ * Content-Type: application/json
+ * Connection: keep-alive
+ * Transfer-Encoding: chunked
+ * ```
+ *
+ * @param {String} rawHeaders Headers needing to be parsed
+ *
+ * @returns {Object} Headers parsed into an object
+ */
+var parseHeaders = rawHeaders => {
+ const parsed = {};
+ let key;
+ let val;
+ let i;
+
+ rawHeaders && rawHeaders.split('\n').forEach(function parser(line) {
+ i = line.indexOf(':');
+ key = line.substring(0, i).trim().toLowerCase();
+ val = line.substring(i + 1).trim();
+
+ if (!key || (parsed[key] && ignoreDuplicateOf[key])) {
+ return;
+ }
+
+ if (key === 'set-cookie') {
+ if (parsed[key]) {
+ parsed[key].push(val);
+ } else {
+ parsed[key] = [val];
+ }
+ } else {
+ parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
+ }
+ });
+
+ return parsed;
+};
+
+const $internals = Symbol('internals');
+
+function normalizeHeader(header) {
+ return header && String(header).trim().toLowerCase();
+}
+
+function normalizeValue(value) {
+ if (value === false || value == null) {
+ return value;
+ }
+
+ return utils$1.isArray(value) ? value.map(normalizeValue) : String(value);
+}
+
+function parseTokens(str) {
+ const tokens = Object.create(null);
+ const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
+ let match;
+
+ while ((match = tokensRE.exec(str))) {
+ tokens[match[1]] = match[2];
+ }
+
+ return tokens;
+}
+
+const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
+
+function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
+ if (utils$1.isFunction(filter)) {
+ return filter.call(this, value, header);
+ }
+
+ if (isHeaderNameFilter) {
+ value = header;
+ }
+
+ if (!utils$1.isString(value)) return;
+
+ if (utils$1.isString(filter)) {
+ return value.indexOf(filter) !== -1;
+ }
+
+ if (utils$1.isRegExp(filter)) {
+ return filter.test(value);
+ }
+}
+
+function formatHeader(header) {
+ return header.trim()
+ .toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => {
+ return char.toUpperCase() + str;
+ });
+}
+
+function buildAccessors(obj, header) {
+ const accessorName = utils$1.toCamelCase(' ' + header);
+
+ ['get', 'set', 'has'].forEach(methodName => {
+ Object.defineProperty(obj, methodName + accessorName, {
+ value: function(arg1, arg2, arg3) {
+ return this[methodName].call(this, header, arg1, arg2, arg3);
+ },
+ configurable: true
+ });
+ });
+}
+
+class AxiosHeaders {
+ constructor(headers) {
+ headers && this.set(headers);
+ }
+
+ set(header, valueOrRewrite, rewrite) {
+ const self = this;
+
+ function setHeader(_value, _header, _rewrite) {
+ const lHeader = normalizeHeader(_header);
+
+ if (!lHeader) {
+ throw new Error('header name must be a non-empty string');
+ }
+
+ const key = utils$1.findKey(self, lHeader);
+
+ if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {
+ self[key || _header] = normalizeValue(_value);
+ }
+ }
+
+ const setHeaders = (headers, _rewrite) =>
+ utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
+
+ if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
+ setHeaders(header, valueOrRewrite);
+ } else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
+ setHeaders(parseHeaders(header), valueOrRewrite);
+ } else {
+ header != null && setHeader(valueOrRewrite, header, rewrite);
+ }
+
+ return this;
+ }
+
+ get(header, parser) {
+ header = normalizeHeader(header);
+
+ if (header) {
+ const key = utils$1.findKey(this, header);
+
+ if (key) {
+ const value = this[key];
+
+ if (!parser) {
+ return value;
+ }
+
+ if (parser === true) {
+ return parseTokens(value);
+ }
+
+ if (utils$1.isFunction(parser)) {
+ return parser.call(this, value, key);
+ }
+
+ if (utils$1.isRegExp(parser)) {
+ return parser.exec(value);
+ }
+
+ throw new TypeError('parser must be boolean|regexp|function');
+ }
+ }
+ }
+
+ has(header, matcher) {
+ header = normalizeHeader(header);
+
+ if (header) {
+ const key = utils$1.findKey(this, header);
+
+ return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
+ }
+
+ return false;
+ }
+
+ delete(header, matcher) {
+ const self = this;
+ let deleted = false;
+
+ function deleteHeader(_header) {
+ _header = normalizeHeader(_header);
+
+ if (_header) {
+ const key = utils$1.findKey(self, _header);
+
+ if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {
+ delete self[key];
+
+ deleted = true;
+ }
+ }
+ }
+
+ if (utils$1.isArray(header)) {
+ header.forEach(deleteHeader);
+ } else {
+ deleteHeader(header);
+ }
+
+ return deleted;
+ }
+
+ clear(matcher) {
+ const keys = Object.keys(this);
+ let i = keys.length;
+ let deleted = false;
+
+ while (i--) {
+ const key = keys[i];
+ if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
+ delete this[key];
+ deleted = true;
+ }
+ }
+
+ return deleted;
+ }
+
+ normalize(format) {
+ const self = this;
+ const headers = {};
+
+ utils$1.forEach(this, (value, header) => {
+ const key = utils$1.findKey(headers, header);
+
+ if (key) {
+ self[key] = normalizeValue(value);
+ delete self[header];
+ return;
+ }
+
+ const normalized = format ? formatHeader(header) : String(header).trim();
+
+ if (normalized !== header) {
+ delete self[header];
+ }
+
+ self[normalized] = normalizeValue(value);
+
+ headers[normalized] = true;
+ });
+
+ return this;
+ }
+
+ concat(...targets) {
+ return this.constructor.concat(this, ...targets);
+ }
+
+ toJSON(asStrings) {
+ const obj = Object.create(null);
+
+ utils$1.forEach(this, (value, header) => {
+ value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value);
+ });
+
+ return obj;
+ }
+
+ [Symbol.iterator]() {
+ return Object.entries(this.toJSON())[Symbol.iterator]();
+ }
+
+ toString() {
+ return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n');
+ }
+
+ get [Symbol.toStringTag]() {
+ return 'AxiosHeaders';
+ }
+
+ static from(thing) {
+ return thing instanceof this ? thing : new this(thing);
+ }
+
+ static concat(first, ...targets) {
+ const computed = new this(first);
+
+ targets.forEach((target) => computed.set(target));
+
+ return computed;
+ }
+
+ static accessor(header) {
+ const internals = this[$internals] = (this[$internals] = {
+ accessors: {}
+ });
+
+ const accessors = internals.accessors;
+ const prototype = this.prototype;
+
+ function defineAccessor(_header) {
+ const lHeader = normalizeHeader(_header);
+
+ if (!accessors[lHeader]) {
+ buildAccessors(prototype, _header);
+ accessors[lHeader] = true;
+ }
+ }
+
+ utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
+
+ return this;
+ }
+}
+
+AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
+
+// reserved names hotfix
+utils$1.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {
+ let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
+ return {
+ get: () => value,
+ set(headerValue) {
+ this[mapped] = headerValue;
+ }
+ }
+});
+
+utils$1.freezeMethods(AxiosHeaders);
+
+var AxiosHeaders$1 = AxiosHeaders;
+
+/**
+ * Transform the data for a request or a response
+ *
+ * @param {Array|Function} fns A single function or Array of functions
+ * @param {?Object} response The response object
+ *
+ * @returns {*} The resulting transformed data
+ */
+function transformData(fns, response) {
+ const config = this || defaults$1;
+ const context = response || config;
+ const headers = AxiosHeaders$1.from(context.headers);
+ let data = context.data;
+
+ utils$1.forEach(fns, function transform(fn) {
+ data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);
+ });
+
+ headers.normalize();
+
+ return data;
+}
+
+function isCancel(value) {
+ return !!(value && value.__CANCEL__);
+}
+
+/**
+ * A `CanceledError` is an object that is thrown when an operation is canceled.
+ *
+ * @param {string=} message The message.
+ * @param {Object=} config The config.
+ * @param {Object=} request The request.
+ *
+ * @returns {CanceledError} The created error.
+ */
+function CanceledError(message, config, request) {
+ // eslint-disable-next-line no-eq-null,eqeqeq
+ AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);
+ this.name = 'CanceledError';
+}
+
+utils$1.inherits(CanceledError, AxiosError, {
+ __CANCEL__: true
+});
+
+/**
+ * Resolve or reject a Promise based on response status.
+ *
+ * @param {Function} resolve A function that resolves the promise.
+ * @param {Function} reject A function that rejects the promise.
+ * @param {object} response The response.
+ *
+ * @returns {object} The response.
+ */
+function settle(resolve, reject, response) {
+ const validateStatus = response.config.validateStatus;
+ if (!response.status || !validateStatus || validateStatus(response.status)) {
+ resolve(response);
+ } else {
+ reject(new AxiosError(
+ 'Request failed with status code ' + response.status,
+ [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
+ response.config,
+ response.request,
+ response
+ ));
+ }
+}
+
+var cookies = platform.hasStandardBrowserEnv ?
+
+ // Standard browser envs support document.cookie
+ {
+ write(name, value, expires, path, domain, secure) {
+ const cookie = [name + '=' + encodeURIComponent(value)];
+
+ utils$1.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());
+
+ utils$1.isString(path) && cookie.push('path=' + path);
+
+ utils$1.isString(domain) && cookie.push('domain=' + domain);
+
+ secure === true && cookie.push('secure');
+
+ document.cookie = cookie.join('; ');
+ },
+
+ read(name) {
+ const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
+ return (match ? decodeURIComponent(match[3]) : null);
+ },
+
+ remove(name) {
+ this.write(name, '', Date.now() - 86400000);
+ }
+ }
+
+ :
+
+ // Non-standard browser env (web workers, react-native) lack needed support.
+ {
+ write() {},
+ read() {
+ return null;
+ },
+ remove() {}
+ };
+
+/**
+ * Determines whether the specified URL is absolute
+ *
+ * @param {string} url The URL to test
+ *
+ * @returns {boolean} True if the specified URL is absolute, otherwise false
+ */
+function isAbsoluteURL(url) {
+ // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
+ // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
+ // by any combination of letters, digits, plus, period, or hyphen.
+ return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
+}
+
+/**
+ * Creates a new URL by combining the specified URLs
+ *
+ * @param {string} baseURL The base URL
+ * @param {string} relativeURL The relative URL
+ *
+ * @returns {string} The combined URL
+ */
+function combineURLs(baseURL, relativeURL) {
+ return relativeURL
+ ? baseURL.replace(/\/?\/$/, '') + '/' + relativeURL.replace(/^\/+/, '')
+ : baseURL;
+}
+
+/**
+ * Creates a new URL by combining the baseURL with the requestedURL,
+ * only when the requestedURL is not already an absolute URL.
+ * If the requestURL is absolute, this function returns the requestedURL untouched.
+ *
+ * @param {string} baseURL The base URL
+ * @param {string} requestedURL Absolute or relative URL to combine
+ *
+ * @returns {string} The combined full path
+ */
+function buildFullPath(baseURL, requestedURL) {
+ if (baseURL && !isAbsoluteURL(requestedURL)) {
+ return combineURLs(baseURL, requestedURL);
+ }
+ return requestedURL;
+}
+
+var isURLSameOrigin = platform.hasStandardBrowserEnv ?
+
+// Standard browser envs have full support of the APIs needed to test
+// whether the request URL is of the same origin as current location.
+ (function standardBrowserEnv() {
+ const msie = /(msie|trident)/i.test(navigator.userAgent);
+ const urlParsingNode = document.createElement('a');
+ let originURL;
+
+ /**
+ * Parse a URL to discover its components
+ *
+ * @param {String} url The URL to be parsed
+ * @returns {Object}
+ */
+ function resolveURL(url) {
+ let href = url;
+
+ if (msie) {
+ // IE needs attribute set twice to normalize properties
+ urlParsingNode.setAttribute('href', href);
+ href = urlParsingNode.href;
+ }
+
+ urlParsingNode.setAttribute('href', href);
+
+ // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
+ return {
+ href: urlParsingNode.href,
+ protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
+ host: urlParsingNode.host,
+ search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
+ hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
+ hostname: urlParsingNode.hostname,
+ port: urlParsingNode.port,
+ pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
+ urlParsingNode.pathname :
+ '/' + urlParsingNode.pathname
+ };
+ }
+
+ originURL = resolveURL(window.location.href);
+
+ /**
+ * Determine if a URL shares the same origin as the current location
+ *
+ * @param {String} requestURL The URL to test
+ * @returns {boolean} True if URL shares the same origin, otherwise false
+ */
+ return function isURLSameOrigin(requestURL) {
+ const parsed = (utils$1.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
+ return (parsed.protocol === originURL.protocol &&
+ parsed.host === originURL.host);
+ };
+ })() :
+
+ // Non standard browser envs (web workers, react-native) lack needed support.
+ (function nonStandardBrowserEnv() {
+ return function isURLSameOrigin() {
+ return true;
+ };
+ })();
+
+function parseProtocol(url) {
+ const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
+ return match && match[1] || '';
+}
+
+/**
+ * Calculate data maxRate
+ * @param {Number} [samplesCount= 10]
+ * @param {Number} [min= 1000]
+ * @returns {Function}
+ */
+function speedometer(samplesCount, min) {
+ samplesCount = samplesCount || 10;
+ const bytes = new Array(samplesCount);
+ const timestamps = new Array(samplesCount);
+ let head = 0;
+ let tail = 0;
+ let firstSampleTS;
+
+ min = min !== undefined ? min : 1000;
+
+ return function push(chunkLength) {
+ const now = Date.now();
+
+ const startedAt = timestamps[tail];
+
+ if (!firstSampleTS) {
+ firstSampleTS = now;
+ }
+
+ bytes[head] = chunkLength;
+ timestamps[head] = now;
+
+ let i = tail;
+ let bytesCount = 0;
+
+ while (i !== head) {
+ bytesCount += bytes[i++];
+ i = i % samplesCount;
+ }
+
+ head = (head + 1) % samplesCount;
+
+ if (head === tail) {
+ tail = (tail + 1) % samplesCount;
+ }
+
+ if (now - firstSampleTS < min) {
+ return;
+ }
+
+ const passed = startedAt && now - startedAt;
+
+ return passed ? Math.round(bytesCount * 1000 / passed) : undefined;
+ };
+}
+
+function progressEventReducer(listener, isDownloadStream) {
+ let bytesNotified = 0;
+ const _speedometer = speedometer(50, 250);
+
+ return e => {
+ const loaded = e.loaded;
+ const total = e.lengthComputable ? e.total : undefined;
+ const progressBytes = loaded - bytesNotified;
+ const rate = _speedometer(progressBytes);
+ const inRange = loaded <= total;
+
+ bytesNotified = loaded;
+
+ const data = {
+ loaded,
+ total,
+ progress: total ? (loaded / total) : undefined,
+ bytes: progressBytes,
+ rate: rate ? rate : undefined,
+ estimated: rate && total && inRange ? (total - loaded) / rate : undefined,
+ event: e
+ };
+
+ data[isDownloadStream ? 'download' : 'upload'] = true;
+
+ listener(data);
+ };
+}
+
+const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
+
+var xhrAdapter = isXHRAdapterSupported && function (config) {
+ return new Promise(function dispatchXhrRequest(resolve, reject) {
+ let requestData = config.data;
+ const requestHeaders = AxiosHeaders$1.from(config.headers).normalize();
+ let {responseType, withXSRFToken} = config;
+ let onCanceled;
+ function done() {
+ if (config.cancelToken) {
+ config.cancelToken.unsubscribe(onCanceled);
+ }
+
+ if (config.signal) {
+ config.signal.removeEventListener('abort', onCanceled);
+ }
+ }
+
+ let contentType;
+
+ if (utils$1.isFormData(requestData)) {
+ if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
+ requestHeaders.setContentType(false); // Let the browser set it
+ } else if ((contentType = requestHeaders.getContentType()) !== false) {
+ // fix semicolon duplication issue for ReactNative FormData implementation
+ const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];
+ requestHeaders.setContentType([type || 'multipart/form-data', ...tokens].join('; '));
+ }
+ }
+
+ let request = new XMLHttpRequest();
+
+ // HTTP basic authentication
+ if (config.auth) {
+ const username = config.auth.username || '';
+ const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';
+ requestHeaders.set('Authorization', 'Basic ' + btoa(username + ':' + password));
+ }
+
+ const fullPath = buildFullPath(config.baseURL, config.url);
+
+ request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
+
+ // Set the request timeout in MS
+ request.timeout = config.timeout;
+
+ function onloadend() {
+ if (!request) {
+ return;
+ }
+ // Prepare the response
+ const responseHeaders = AxiosHeaders$1.from(
+ 'getAllResponseHeaders' in request && request.getAllResponseHeaders()
+ );
+ const responseData = !responseType || responseType === 'text' || responseType === 'json' ?
+ request.responseText : request.response;
+ const response = {
+ data: responseData,
+ status: request.status,
+ statusText: request.statusText,
+ headers: responseHeaders,
+ config,
+ request
+ };
+
+ settle(function _resolve(value) {
+ resolve(value);
+ done();
+ }, function _reject(err) {
+ reject(err);
+ done();
+ }, response);
+
+ // Clean up request
+ request = null;
+ }
+
+ if ('onloadend' in request) {
+ // Use onloadend if available
+ request.onloadend = onloadend;
+ } else {
+ // Listen for ready state to emulate onloadend
+ request.onreadystatechange = function handleLoad() {
+ if (!request || request.readyState !== 4) {
+ return;
+ }
+
+ // The request errored out and we didn't get a response, this will be
+ // handled by onerror instead
+ // With one exception: request that using file: protocol, most browsers
+ // will return status as 0 even though it's a successful request
+ if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
+ return;
+ }
+ // readystate handler is calling before onerror or ontimeout handlers,
+ // so we should call onloadend on the next 'tick'
+ setTimeout(onloadend);
+ };
+ }
+
+ // Handle browser request cancellation (as opposed to a manual cancellation)
+ request.onabort = function handleAbort() {
+ if (!request) {
+ return;
+ }
+
+ reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));
+
+ // Clean up request
+ request = null;
+ };
+
+ // Handle low level network errors
+ request.onerror = function handleError() {
+ // Real errors are hidden from us by the browser
+ // onerror should only fire if it's a network error
+ reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request));
+
+ // Clean up request
+ request = null;
+ };
+
+ // Handle timeout
+ request.ontimeout = function handleTimeout() {
+ let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';
+ const transitional = config.transitional || transitionalDefaults;
+ if (config.timeoutErrorMessage) {
+ timeoutErrorMessage = config.timeoutErrorMessage;
+ }
+ reject(new AxiosError(
+ timeoutErrorMessage,
+ transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,
+ config,
+ request));
+
+ // Clean up request
+ request = null;
+ };
+
+ // Add xsrf header
+ // This is only done if running in a standard browser environment.
+ // Specifically not if we're in a web worker, or react-native.
+ if(platform.hasStandardBrowserEnv) {
+ withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config));
+
+ if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(fullPath))) {
+ // Add xsrf header
+ const xsrfValue = config.xsrfHeaderName && config.xsrfCookieName && cookies.read(config.xsrfCookieName);
+
+ if (xsrfValue) {
+ requestHeaders.set(config.xsrfHeaderName, xsrfValue);
+ }
+ }
+ }
+
+ // Remove Content-Type if data is undefined
+ requestData === undefined && requestHeaders.setContentType(null);
+
+ // Add headers to the request
+ if ('setRequestHeader' in request) {
+ utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
+ request.setRequestHeader(key, val);
+ });
+ }
+
+ // Add withCredentials to request if needed
+ if (!utils$1.isUndefined(config.withCredentials)) {
+ request.withCredentials = !!config.withCredentials;
+ }
+
+ // Add responseType to request if needed
+ if (responseType && responseType !== 'json') {
+ request.responseType = config.responseType;
+ }
+
+ // Handle progress if needed
+ if (typeof config.onDownloadProgress === 'function') {
+ request.addEventListener('progress', progressEventReducer(config.onDownloadProgress, true));
+ }
+
+ // Not all browsers support upload events
+ if (typeof config.onUploadProgress === 'function' && request.upload) {
+ request.upload.addEventListener('progress', progressEventReducer(config.onUploadProgress));
+ }
+
+ if (config.cancelToken || config.signal) {
+ // Handle cancellation
+ // eslint-disable-next-line func-names
+ onCanceled = cancel => {
+ if (!request) {
+ return;
+ }
+ reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);
+ request.abort();
+ request = null;
+ };
+
+ config.cancelToken && config.cancelToken.subscribe(onCanceled);
+ if (config.signal) {
+ config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);
+ }
+ }
+
+ const protocol = parseProtocol(fullPath);
+
+ if (protocol && platform.protocols.indexOf(protocol) === -1) {
+ reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));
+ return;
+ }
+
+
+ // Send the request
+ request.send(requestData || null);
+ });
+};
+
+const knownAdapters = {
+ http: httpAdapter,
+ xhr: xhrAdapter
+};
+
+utils$1.forEach(knownAdapters, (fn, value) => {
+ if (fn) {
+ try {
+ Object.defineProperty(fn, 'name', {value});
+ } catch (e) {
+ // eslint-disable-next-line no-empty
+ }
+ Object.defineProperty(fn, 'adapterName', {value});
+ }
+});
+
+const renderReason = (reason) => `- ${reason}`;
+
+const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false;
+
+var adapters = {
+ getAdapter: (adapters) => {
+ adapters = utils$1.isArray(adapters) ? adapters : [adapters];
+
+ const {length} = adapters;
+ let nameOrAdapter;
+ let adapter;
+
+ const rejectedReasons = {};
+
+ for (let i = 0; i < length; i++) {
+ nameOrAdapter = adapters[i];
+ let id;
+
+ adapter = nameOrAdapter;
+
+ if (!isResolvedHandle(nameOrAdapter)) {
+ adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
+
+ if (adapter === undefined) {
+ throw new AxiosError(`Unknown adapter '${id}'`);
+ }
+ }
+
+ if (adapter) {
+ break;
+ }
+
+ rejectedReasons[id || '#' + i] = adapter;
+ }
+
+ if (!adapter) {
+
+ const reasons = Object.entries(rejectedReasons)
+ .map(([id, state]) => `adapter ${id} ` +
+ (state === false ? 'is not supported by the environment' : 'is not available in the build')
+ );
+
+ let s = length ?
+ (reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) :
+ 'as no adapter specified';
+
+ throw new AxiosError(
+ `There is no suitable adapter to dispatch the request ` + s,
+ 'ERR_NOT_SUPPORT'
+ );
+ }
+
+ return adapter;
+ },
+ adapters: knownAdapters
+};
+
+/**
+ * Throws a `CanceledError` if cancellation has been requested.
+ *
+ * @param {Object} config The config that is to be used for the request
+ *
+ * @returns {void}
+ */
+function throwIfCancellationRequested(config) {
+ if (config.cancelToken) {
+ config.cancelToken.throwIfRequested();
+ }
+
+ if (config.signal && config.signal.aborted) {
+ throw new CanceledError(null, config);
+ }
+}
+
+/**
+ * Dispatch a request to the server using the configured adapter.
+ *
+ * @param {object} config The config that is to be used for the request
+ *
+ * @returns {Promise} The Promise to be fulfilled
+ */
+function dispatchRequest(config) {
+ throwIfCancellationRequested(config);
+
+ config.headers = AxiosHeaders$1.from(config.headers);
+
+ // Transform request data
+ config.data = transformData.call(
+ config,
+ config.transformRequest
+ );
+
+ if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {
+ config.headers.setContentType('application/x-www-form-urlencoded', false);
+ }
+
+ const adapter = adapters.getAdapter(config.adapter || defaults$1.adapter);
+
+ return adapter(config).then(function onAdapterResolution(response) {
+ throwIfCancellationRequested(config);
+
+ // Transform response data
+ response.data = transformData.call(
+ config,
+ config.transformResponse,
+ response
+ );
+
+ response.headers = AxiosHeaders$1.from(response.headers);
+
+ return response;
+ }, function onAdapterRejection(reason) {
+ if (!isCancel(reason)) {
+ throwIfCancellationRequested(config);
+
+ // Transform response data
+ if (reason && reason.response) {
+ reason.response.data = transformData.call(
+ config,
+ config.transformResponse,
+ reason.response
+ );
+ reason.response.headers = AxiosHeaders$1.from(reason.response.headers);
+ }
+ }
+
+ return Promise.reject(reason);
+ });
+}
+
+const headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? thing.toJSON() : thing;
+
+/**
+ * Config-specific merge-function which creates a new config-object
+ * by merging two configuration objects together.
+ *
+ * @param {Object} config1
+ * @param {Object} config2
+ *
+ * @returns {Object} New object resulting from merging config2 to config1
+ */
+function mergeConfig(config1, config2) {
+ // eslint-disable-next-line no-param-reassign
+ config2 = config2 || {};
+ const config = {};
+
+ function getMergedValue(target, source, caseless) {
+ if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
+ return utils$1.merge.call({caseless}, target, source);
+ } else if (utils$1.isPlainObject(source)) {
+ return utils$1.merge({}, source);
+ } else if (utils$1.isArray(source)) {
+ return source.slice();
+ }
+ return source;
+ }
+
+ // eslint-disable-next-line consistent-return
+ function mergeDeepProperties(a, b, caseless) {
+ if (!utils$1.isUndefined(b)) {
+ return getMergedValue(a, b, caseless);
+ } else if (!utils$1.isUndefined(a)) {
+ return getMergedValue(undefined, a, caseless);
+ }
+ }
+
+ // eslint-disable-next-line consistent-return
+ function valueFromConfig2(a, b) {
+ if (!utils$1.isUndefined(b)) {
+ return getMergedValue(undefined, b);
+ }
+ }
+
+ // eslint-disable-next-line consistent-return
+ function defaultToConfig2(a, b) {
+ if (!utils$1.isUndefined(b)) {
+ return getMergedValue(undefined, b);
+ } else if (!utils$1.isUndefined(a)) {
+ return getMergedValue(undefined, a);
+ }
+ }
+
+ // eslint-disable-next-line consistent-return
+ function mergeDirectKeys(a, b, prop) {
+ if (prop in config2) {
+ return getMergedValue(a, b);
+ } else if (prop in config1) {
+ return getMergedValue(undefined, a);
+ }
+ }
+
+ const mergeMap = {
+ url: valueFromConfig2,
+ method: valueFromConfig2,
+ data: valueFromConfig2,
+ baseURL: defaultToConfig2,
+ transformRequest: defaultToConfig2,
+ transformResponse: defaultToConfig2,
+ paramsSerializer: defaultToConfig2,
+ timeout: defaultToConfig2,
+ timeoutMessage: defaultToConfig2,
+ withCredentials: defaultToConfig2,
+ withXSRFToken: defaultToConfig2,
+ adapter: defaultToConfig2,
+ responseType: defaultToConfig2,
+ xsrfCookieName: defaultToConfig2,
+ xsrfHeaderName: defaultToConfig2,
+ onUploadProgress: defaultToConfig2,
+ onDownloadProgress: defaultToConfig2,
+ decompress: defaultToConfig2,
+ maxContentLength: defaultToConfig2,
+ maxBodyLength: defaultToConfig2,
+ beforeRedirect: defaultToConfig2,
+ transport: defaultToConfig2,
+ httpAgent: defaultToConfig2,
+ httpsAgent: defaultToConfig2,
+ cancelToken: defaultToConfig2,
+ socketPath: defaultToConfig2,
+ responseEncoding: defaultToConfig2,
+ validateStatus: mergeDirectKeys,
+ headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
+ };
+
+ utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
+ const merge = mergeMap[prop] || mergeDeepProperties;
+ const configValue = merge(config1[prop], config2[prop], prop);
+ (utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
+ });
+
+ return config;
+}
+
+const VERSION = "1.6.7";
+
+const validators$1 = {};
+
+// eslint-disable-next-line func-names
+['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => {
+ validators$1[type] = function validator(thing) {
+ return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;
+ };
+});
+
+const deprecatedWarnings = {};
+
+/**
+ * Transitional option validator
+ *
+ * @param {function|boolean?} validator - set to false if the transitional option has been removed
+ * @param {string?} version - deprecated version / removed since version
+ * @param {string?} message - some message with additional info
+ *
+ * @returns {function}
+ */
+validators$1.transitional = function transitional(validator, version, message) {
+ function formatMessage(opt, desc) {
+ return '[Axios v' + VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : '');
+ }
+
+ // eslint-disable-next-line func-names
+ return (value, opt, opts) => {
+ if (validator === false) {
+ throw new AxiosError(
+ formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),
+ AxiosError.ERR_DEPRECATED
+ );
+ }
+
+ if (version && !deprecatedWarnings[opt]) {
+ deprecatedWarnings[opt] = true;
+ // eslint-disable-next-line no-console
+ console.warn(
+ formatMessage(
+ opt,
+ ' has been deprecated since v' + version + ' and will be removed in the near future'
+ )
+ );
+ }
+
+ return validator ? validator(value, opt, opts) : true;
+ };
+};
+
+/**
+ * Assert object's properties type
+ *
+ * @param {object} options
+ * @param {object} schema
+ * @param {boolean?} allowUnknown
+ *
+ * @returns {object}
+ */
+
+function assertOptions(options, schema, allowUnknown) {
+ if (typeof options !== 'object') {
+ throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);
+ }
+ const keys = Object.keys(options);
+ let i = keys.length;
+ while (i-- > 0) {
+ const opt = keys[i];
+ const validator = schema[opt];
+ if (validator) {
+ const value = options[opt];
+ const result = value === undefined || validator(value, opt, options);
+ if (result !== true) {
+ throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);
+ }
+ continue;
+ }
+ if (allowUnknown !== true) {
+ throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);
+ }
+ }
+}
+
+var validator = {
+ assertOptions,
+ validators: validators$1
+};
+
+const validators = validator.validators;
+
+/**
+ * Create a new instance of Axios
+ *
+ * @param {Object} instanceConfig The default config for the instance
+ *
+ * @return {Axios} A new instance of Axios
+ */
+class Axios {
+ constructor(instanceConfig) {
+ this.defaults = instanceConfig;
+ this.interceptors = {
+ request: new InterceptorManager$1(),
+ response: new InterceptorManager$1()
+ };
+ }
+
+ /**
+ * Dispatch a request
+ *
+ * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
+ * @param {?Object} config
+ *
+ * @returns {Promise} The Promise to be fulfilled
+ */
+ async request(configOrUrl, config) {
+ try {
+ return await this._request(configOrUrl, config);
+ } catch (err) {
+ if (err instanceof Error) {
+ let dummy;
+
+ Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : (dummy = new Error());
+
+ // slice off the Error: ... line
+ const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : '';
+
+ if (!err.stack) {
+ err.stack = stack;
+ // match without the 2 top stack lines
+ } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ''))) {
+ err.stack += '\n' + stack;
+ }
+ }
+
+ throw err;
+ }
+ }
+
+ _request(configOrUrl, config) {
+ /*eslint no-param-reassign:0*/
+ // Allow for axios('example/url'[, config]) a la fetch API
+ if (typeof configOrUrl === 'string') {
+ config = config || {};
+ config.url = configOrUrl;
+ } else {
+ config = configOrUrl || {};
+ }
+
+ config = mergeConfig(this.defaults, config);
+
+ const {transitional, paramsSerializer, headers} = config;
+
+ if (transitional !== undefined) {
+ validator.assertOptions(transitional, {
+ silentJSONParsing: validators.transitional(validators.boolean),
+ forcedJSONParsing: validators.transitional(validators.boolean),
+ clarifyTimeoutError: validators.transitional(validators.boolean)
+ }, false);
+ }
+
+ if (paramsSerializer != null) {
+ if (utils$1.isFunction(paramsSerializer)) {
+ config.paramsSerializer = {
+ serialize: paramsSerializer
+ };
+ } else {
+ validator.assertOptions(paramsSerializer, {
+ encode: validators.function,
+ serialize: validators.function
+ }, true);
+ }
+ }
+
+ // Set config.method
+ config.method = (config.method || this.defaults.method || 'get').toLowerCase();
+
+ // Flatten headers
+ let contextHeaders = headers && utils$1.merge(
+ headers.common,
+ headers[config.method]
+ );
+
+ headers && utils$1.forEach(
+ ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
+ (method) => {
+ delete headers[method];
+ }
+ );
+
+ config.headers = AxiosHeaders$1.concat(contextHeaders, headers);
+
+ // filter out skipped interceptors
+ const requestInterceptorChain = [];
+ let synchronousRequestInterceptors = true;
+ this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
+ if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {
+ return;
+ }
+
+ synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
+
+ requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
+ });
+
+ const responseInterceptorChain = [];
+ this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
+ responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
+ });
+
+ let promise;
+ let i = 0;
+ let len;
+
+ if (!synchronousRequestInterceptors) {
+ const chain = [dispatchRequest.bind(this), undefined];
+ chain.unshift.apply(chain, requestInterceptorChain);
+ chain.push.apply(chain, responseInterceptorChain);
+ len = chain.length;
+
+ promise = Promise.resolve(config);
+
+ while (i < len) {
+ promise = promise.then(chain[i++], chain[i++]);
+ }
+
+ return promise;
+ }
+
+ len = requestInterceptorChain.length;
+
+ let newConfig = config;
+
+ i = 0;
+
+ while (i < len) {
+ const onFulfilled = requestInterceptorChain[i++];
+ const onRejected = requestInterceptorChain[i++];
+ try {
+ newConfig = onFulfilled(newConfig);
+ } catch (error) {
+ onRejected.call(this, error);
+ break;
+ }
+ }
+
+ try {
+ promise = dispatchRequest.call(this, newConfig);
+ } catch (error) {
+ return Promise.reject(error);
+ }
+
+ i = 0;
+ len = responseInterceptorChain.length;
+
+ while (i < len) {
+ promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);
+ }
+
+ return promise;
+ }
+
+ getUri(config) {
+ config = mergeConfig(this.defaults, config);
+ const fullPath = buildFullPath(config.baseURL, config.url);
+ return buildURL(fullPath, config.params, config.paramsSerializer);
+ }
+}
+
+// Provide aliases for supported request methods
+utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
+ /*eslint func-names:0*/
+ Axios.prototype[method] = function(url, config) {
+ return this.request(mergeConfig(config || {}, {
+ method,
+ url,
+ data: (config || {}).data
+ }));
+ };
+});
+
+utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
+ /*eslint func-names:0*/
+
+ function generateHTTPMethod(isForm) {
+ return function httpMethod(url, data, config) {
+ return this.request(mergeConfig(config || {}, {
+ method,
+ headers: isForm ? {
+ 'Content-Type': 'multipart/form-data'
+ } : {},
+ url,
+ data
+ }));
+ };
+ }
+
+ Axios.prototype[method] = generateHTTPMethod();
+
+ Axios.prototype[method + 'Form'] = generateHTTPMethod(true);
+});
+
+var Axios$1 = Axios;
+
+/**
+ * A `CancelToken` is an object that can be used to request cancellation of an operation.
+ *
+ * @param {Function} executor The executor function.
+ *
+ * @returns {CancelToken}
+ */
+class CancelToken {
+ constructor(executor) {
+ if (typeof executor !== 'function') {
+ throw new TypeError('executor must be a function.');
+ }
+
+ let resolvePromise;
+
+ this.promise = new Promise(function promiseExecutor(resolve) {
+ resolvePromise = resolve;
+ });
+
+ const token = this;
+
+ // eslint-disable-next-line func-names
+ this.promise.then(cancel => {
+ if (!token._listeners) return;
+
+ let i = token._listeners.length;
+
+ while (i-- > 0) {
+ token._listeners[i](cancel);
+ }
+ token._listeners = null;
+ });
+
+ // eslint-disable-next-line func-names
+ this.promise.then = onfulfilled => {
+ let _resolve;
+ // eslint-disable-next-line func-names
+ const promise = new Promise(resolve => {
+ token.subscribe(resolve);
+ _resolve = resolve;
+ }).then(onfulfilled);
+
+ promise.cancel = function reject() {
+ token.unsubscribe(_resolve);
+ };
+
+ return promise;
+ };
+
+ executor(function cancel(message, config, request) {
+ if (token.reason) {
+ // Cancellation has already been requested
+ return;
+ }
+
+ token.reason = new CanceledError(message, config, request);
+ resolvePromise(token.reason);
+ });
+ }
+
+ /**
+ * Throws a `CanceledError` if cancellation has been requested.
+ */
+ throwIfRequested() {
+ if (this.reason) {
+ throw this.reason;
+ }
+ }
+
+ /**
+ * Subscribe to the cancel signal
+ */
+
+ subscribe(listener) {
+ if (this.reason) {
+ listener(this.reason);
+ return;
+ }
+
+ if (this._listeners) {
+ this._listeners.push(listener);
+ } else {
+ this._listeners = [listener];
+ }
+ }
+
+ /**
+ * Unsubscribe from the cancel signal
+ */
+
+ unsubscribe(listener) {
+ if (!this._listeners) {
+ return;
+ }
+ const index = this._listeners.indexOf(listener);
+ if (index !== -1) {
+ this._listeners.splice(index, 1);
+ }
+ }
+
+ /**
+ * Returns an object that contains a new `CancelToken` and a function that, when called,
+ * cancels the `CancelToken`.
+ */
+ static source() {
+ let cancel;
+ const token = new CancelToken(function executor(c) {
+ cancel = c;
+ });
+ return {
+ token,
+ cancel
+ };
+ }
+}
+
+var CancelToken$1 = CancelToken;
+
+/**
+ * Syntactic sugar for invoking a function and expanding an array for arguments.
+ *
+ * Common use case would be to use `Function.prototype.apply`.
+ *
+ * ```js
+ * function f(x, y, z) {}
+ * var args = [1, 2, 3];
+ * f.apply(null, args);
+ * ```
+ *
+ * With `spread` this example can be re-written.
+ *
+ * ```js
+ * spread(function(x, y, z) {})([1, 2, 3]);
+ * ```
+ *
+ * @param {Function} callback
+ *
+ * @returns {Function}
+ */
+function spread(callback) {
+ return function wrap(arr) {
+ return callback.apply(null, arr);
+ };
+}
+
+/**
+ * Determines whether the payload is an error thrown by Axios
+ *
+ * @param {*} payload The value to test
+ *
+ * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
+ */
+function isAxiosError(payload) {
+ return utils$1.isObject(payload) && (payload.isAxiosError === true);
+}
+
+const HttpStatusCode = {
+ Continue: 100,
+ SwitchingProtocols: 101,
+ Processing: 102,
+ EarlyHints: 103,
+ Ok: 200,
+ Created: 201,
+ Accepted: 202,
+ NonAuthoritativeInformation: 203,
+ NoContent: 204,
+ ResetContent: 205,
+ PartialContent: 206,
+ MultiStatus: 207,
+ AlreadyReported: 208,
+ ImUsed: 226,
+ MultipleChoices: 300,
+ MovedPermanently: 301,
+ Found: 302,
+ SeeOther: 303,
+ NotModified: 304,
+ UseProxy: 305,
+ Unused: 306,
+ TemporaryRedirect: 307,
+ PermanentRedirect: 308,
+ BadRequest: 400,
+ Unauthorized: 401,
+ PaymentRequired: 402,
+ Forbidden: 403,
+ NotFound: 404,
+ MethodNotAllowed: 405,
+ NotAcceptable: 406,
+ ProxyAuthenticationRequired: 407,
+ RequestTimeout: 408,
+ Conflict: 409,
+ Gone: 410,
+ LengthRequired: 411,
+ PreconditionFailed: 412,
+ PayloadTooLarge: 413,
+ UriTooLong: 414,
+ UnsupportedMediaType: 415,
+ RangeNotSatisfiable: 416,
+ ExpectationFailed: 417,
+ ImATeapot: 418,
+ MisdirectedRequest: 421,
+ UnprocessableEntity: 422,
+ Locked: 423,
+ FailedDependency: 424,
+ TooEarly: 425,
+ UpgradeRequired: 426,
+ PreconditionRequired: 428,
+ TooManyRequests: 429,
+ RequestHeaderFieldsTooLarge: 431,
+ UnavailableForLegalReasons: 451,
+ InternalServerError: 500,
+ NotImplemented: 501,
+ BadGateway: 502,
+ ServiceUnavailable: 503,
+ GatewayTimeout: 504,
+ HttpVersionNotSupported: 505,
+ VariantAlsoNegotiates: 506,
+ InsufficientStorage: 507,
+ LoopDetected: 508,
+ NotExtended: 510,
+ NetworkAuthenticationRequired: 511,
+};
+
+Object.entries(HttpStatusCode).forEach(([key, value]) => {
+ HttpStatusCode[value] = key;
+});
+
+var HttpStatusCode$1 = HttpStatusCode;
+
+/**
+ * Create an instance of Axios
+ *
+ * @param {Object} defaultConfig The default config for the instance
+ *
+ * @returns {Axios} A new instance of Axios
+ */
+function createInstance(defaultConfig) {
+ const context = new Axios$1(defaultConfig);
+ const instance = bind(Axios$1.prototype.request, context);
+
+ // Copy axios.prototype to instance
+ utils$1.extend(instance, Axios$1.prototype, context, {allOwnKeys: true});
+
+ // Copy context to instance
+ utils$1.extend(instance, context, null, {allOwnKeys: true});
+
+ // Factory for creating new instances
+ instance.create = function create(instanceConfig) {
+ return createInstance(mergeConfig(defaultConfig, instanceConfig));
+ };
+
+ return instance;
+}
+
+// Create the default instance to be exported
+const axios = createInstance(defaults$1);
+
+// Expose Axios class to allow class inheritance
+axios.Axios = Axios$1;
+
+// Expose Cancel & CancelToken
+axios.CanceledError = CanceledError;
+axios.CancelToken = CancelToken$1;
+axios.isCancel = isCancel;
+axios.VERSION = VERSION;
+axios.toFormData = toFormData;
+
+// Expose AxiosError class
+axios.AxiosError = AxiosError;
+
+// alias for CanceledError for backward compatibility
+axios.Cancel = axios.CanceledError;
+
+// Expose all/spread
+axios.all = function all(promises) {
+ return Promise.all(promises);
+};
+
+axios.spread = spread;
+
+// Expose isAxiosError
+axios.isAxiosError = isAxiosError;
+
+// Expose mergeConfig
+axios.mergeConfig = mergeConfig;
+
+axios.AxiosHeaders = AxiosHeaders$1;
+
+axios.formToJSON = thing => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
+
+axios.getAdapter = adapters.getAdapter;
+
+axios.HttpStatusCode = HttpStatusCode$1;
+
+axios.default = axios;
+
+module.exports = axios;
+//# sourceMappingURL=axios.cjs.map
diff --git a/node_modules/axios/dist/browser/axios.cjs.map b/node_modules/axios/dist/browser/axios.cjs.map
new file mode 100644
index 0000000..b4b8baa
--- /dev/null
+++ b/node_modules/axios/dist/browser/axios.cjs.map
@@ -0,0 +1 @@
+{"version":3,"file":"axios.cjs","sources":["../../lib/helpers/bind.js","../../lib/utils.js","../../lib/core/AxiosError.js","../../lib/helpers/null.js","../../lib/helpers/toFormData.js","../../lib/helpers/AxiosURLSearchParams.js","../../lib/helpers/buildURL.js","../../lib/core/InterceptorManager.js","../../lib/defaults/transitional.js","../../lib/platform/browser/classes/URLSearchParams.js","../../lib/platform/browser/classes/FormData.js","../../lib/platform/browser/classes/Blob.js","../../lib/platform/browser/index.js","../../lib/platform/common/utils.js","../../lib/platform/index.js","../../lib/helpers/toURLEncodedForm.js","../../lib/helpers/formDataToJSON.js","../../lib/defaults/index.js","../../lib/helpers/parseHeaders.js","../../lib/core/AxiosHeaders.js","../../lib/core/transformData.js","../../lib/cancel/isCancel.js","../../lib/cancel/CanceledError.js","../../lib/core/settle.js","../../lib/helpers/cookies.js","../../lib/helpers/isAbsoluteURL.js","../../lib/helpers/combineURLs.js","../../lib/core/buildFullPath.js","../../lib/helpers/isURLSameOrigin.js","../../lib/helpers/parseProtocol.js","../../lib/helpers/speedometer.js","../../lib/adapters/xhr.js","../../lib/adapters/adapters.js","../../lib/core/dispatchRequest.js","../../lib/core/mergeConfig.js","../../lib/env/data.js","../../lib/helpers/validator.js","../../lib/core/Axios.js","../../lib/cancel/CancelToken.js","../../lib/helpers/spread.js","../../lib/helpers/isAxiosError.js","../../lib/helpers/HttpStatusCode.js","../../lib/axios.js"],"sourcesContent":["'use strict';\n\nexport default function bind(fn, thisArg) {\n return function wrap() {\n return fn.apply(thisArg, arguments);\n };\n}\n","'use strict';\n\nimport bind from './helpers/bind.js';\n\n// utils is a library of generic helper functions non-specific to axios\n\nconst {toString} = Object.prototype;\nconst {getPrototypeOf} = Object;\n\nconst kindOf = (cache => thing => {\n const str = toString.call(thing);\n return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());\n})(Object.create(null));\n\nconst kindOfTest = (type) => {\n type = type.toLowerCase();\n return (thing) => kindOf(thing) === type\n}\n\nconst typeOfTest = type => thing => typeof thing === type;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n *\n * @returns {boolean} True if value is an Array, otherwise false\n */\nconst {isArray} = Array;\n\n/**\n * Determine if a value is undefined\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nconst isUndefined = typeOfTest('undefined');\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nconst isArrayBuffer = kindOfTest('ArrayBuffer');\n\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n let result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a String, otherwise false\n */\nconst isString = typeOfTest('string');\n\n/**\n * Determine if a value is a Function\n *\n * @param {*} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nconst isFunction = typeOfTest('function');\n\n/**\n * Determine if a value is a Number\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Number, otherwise false\n */\nconst isNumber = typeOfTest('number');\n\n/**\n * Determine if a value is an Object\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an Object, otherwise false\n */\nconst isObject = (thing) => thing !== null && typeof thing === 'object';\n\n/**\n * Determine if a value is a Boolean\n *\n * @param {*} thing The value to test\n * @returns {boolean} True if value is a Boolean, otherwise false\n */\nconst isBoolean = thing => thing === true || thing === false;\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a plain Object, otherwise false\n */\nconst isPlainObject = (val) => {\n if (kindOf(val) !== 'object') {\n return false;\n }\n\n const prototype = getPrototypeOf(val);\n return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Date, otherwise false\n */\nconst isDate = kindOfTest('Date');\n\n/**\n * Determine if a value is a File\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFile = kindOfTest('File');\n\n/**\n * Determine if a value is a Blob\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nconst isBlob = kindOfTest('Blob');\n\n/**\n * Determine if a value is a FileList\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFileList = kindOfTest('FileList');\n\n/**\n * Determine if a value is a Stream\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nconst isStream = (val) => isObject(val) && isFunction(val.pipe);\n\n/**\n * Determine if a value is a FormData\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nconst isFormData = (thing) => {\n let kind;\n return thing && (\n (typeof FormData === 'function' && thing instanceof FormData) || (\n isFunction(thing.append) && (\n (kind = kindOf(thing)) === 'formdata' ||\n // detect form-data instance\n (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')\n )\n )\n )\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nconst isURLSearchParams = kindOfTest('URLSearchParams');\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n *\n * @returns {String} The String freed of excess whitespace\n */\nconst trim = (str) => str.trim ?\n str.trim() : str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n *\n * @param {Boolean} [allOwnKeys = false]\n * @returns {any}\n */\nfunction forEach(obj, fn, {allOwnKeys = false} = {}) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n let i;\n let l;\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);\n const len = keys.length;\n let key;\n\n for (i = 0; i < len; i++) {\n key = keys[i];\n fn.call(null, obj[key], key, obj);\n }\n }\n}\n\nfunction findKey(obj, key) {\n key = key.toLowerCase();\n const keys = Object.keys(obj);\n let i = keys.length;\n let _key;\n while (i-- > 0) {\n _key = keys[i];\n if (key === _key.toLowerCase()) {\n return _key;\n }\n }\n return null;\n}\n\nconst _global = (() => {\n /*eslint no-undef:0*/\n if (typeof globalThis !== \"undefined\") return globalThis;\n return typeof self !== \"undefined\" ? self : (typeof window !== 'undefined' ? window : global)\n})();\n\nconst isContextDefined = (context) => !isUndefined(context) && context !== _global;\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n *\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n const {caseless} = isContextDefined(this) && this || {};\n const result = {};\n const assignValue = (val, key) => {\n const targetKey = caseless && findKey(result, key) || key;\n if (isPlainObject(result[targetKey]) && isPlainObject(val)) {\n result[targetKey] = merge(result[targetKey], val);\n } else if (isPlainObject(val)) {\n result[targetKey] = merge({}, val);\n } else if (isArray(val)) {\n result[targetKey] = val.slice();\n } else {\n result[targetKey] = val;\n }\n }\n\n for (let i = 0, l = arguments.length; i < l; i++) {\n arguments[i] && forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n *\n * @param {Boolean} [allOwnKeys]\n * @returns {Object} The resulting value of object a\n */\nconst extend = (a, b, thisArg, {allOwnKeys}= {}) => {\n forEach(b, (val, key) => {\n if (thisArg && isFunction(val)) {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n }, {allOwnKeys});\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n *\n * @returns {string} content value without BOM\n */\nconst stripBOM = (content) => {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\n/**\n * Inherit the prototype methods from one constructor into another\n * @param {function} constructor\n * @param {function} superConstructor\n * @param {object} [props]\n * @param {object} [descriptors]\n *\n * @returns {void}\n */\nconst inherits = (constructor, superConstructor, props, descriptors) => {\n constructor.prototype = Object.create(superConstructor.prototype, descriptors);\n constructor.prototype.constructor = constructor;\n Object.defineProperty(constructor, 'super', {\n value: superConstructor.prototype\n });\n props && Object.assign(constructor.prototype, props);\n}\n\n/**\n * Resolve object with deep prototype chain to a flat object\n * @param {Object} sourceObj source object\n * @param {Object} [destObj]\n * @param {Function|Boolean} [filter]\n * @param {Function} [propFilter]\n *\n * @returns {Object}\n */\nconst toFlatObject = (sourceObj, destObj, filter, propFilter) => {\n let props;\n let i;\n let prop;\n const merged = {};\n\n destObj = destObj || {};\n // eslint-disable-next-line no-eq-null,eqeqeq\n if (sourceObj == null) return destObj;\n\n do {\n props = Object.getOwnPropertyNames(sourceObj);\n i = props.length;\n while (i-- > 0) {\n prop = props[i];\n if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {\n destObj[prop] = sourceObj[prop];\n merged[prop] = true;\n }\n }\n sourceObj = filter !== false && getPrototypeOf(sourceObj);\n } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);\n\n return destObj;\n}\n\n/**\n * Determines whether a string ends with the characters of a specified string\n *\n * @param {String} str\n * @param {String} searchString\n * @param {Number} [position= 0]\n *\n * @returns {boolean}\n */\nconst endsWith = (str, searchString, position) => {\n str = String(str);\n if (position === undefined || position > str.length) {\n position = str.length;\n }\n position -= searchString.length;\n const lastIndex = str.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n}\n\n\n/**\n * Returns new array from array like object or null if failed\n *\n * @param {*} [thing]\n *\n * @returns {?Array}\n */\nconst toArray = (thing) => {\n if (!thing) return null;\n if (isArray(thing)) return thing;\n let i = thing.length;\n if (!isNumber(i)) return null;\n const arr = new Array(i);\n while (i-- > 0) {\n arr[i] = thing[i];\n }\n return arr;\n}\n\n/**\n * Checking if the Uint8Array exists and if it does, it returns a function that checks if the\n * thing passed in is an instance of Uint8Array\n *\n * @param {TypedArray}\n *\n * @returns {Array}\n */\n// eslint-disable-next-line func-names\nconst isTypedArray = (TypedArray => {\n // eslint-disable-next-line func-names\n return thing => {\n return TypedArray && thing instanceof TypedArray;\n };\n})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));\n\n/**\n * For each entry in the object, call the function with the key and value.\n *\n * @param {Object<any, any>} obj - The object to iterate over.\n * @param {Function} fn - The function to call for each entry.\n *\n * @returns {void}\n */\nconst forEachEntry = (obj, fn) => {\n const generator = obj && obj[Symbol.iterator];\n\n const iterator = generator.call(obj);\n\n let result;\n\n while ((result = iterator.next()) && !result.done) {\n const pair = result.value;\n fn.call(obj, pair[0], pair[1]);\n }\n}\n\n/**\n * It takes a regular expression and a string, and returns an array of all the matches\n *\n * @param {string} regExp - The regular expression to match against.\n * @param {string} str - The string to search.\n *\n * @returns {Array<boolean>}\n */\nconst matchAll = (regExp, str) => {\n let matches;\n const arr = [];\n\n while ((matches = regExp.exec(str)) !== null) {\n arr.push(matches);\n }\n\n return arr;\n}\n\n/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */\nconst isHTMLForm = kindOfTest('HTMLFormElement');\n\nconst toCamelCase = str => {\n return str.toLowerCase().replace(/[-_\\s]([a-z\\d])(\\w*)/g,\n function replacer(m, p1, p2) {\n return p1.toUpperCase() + p2;\n }\n );\n};\n\n/* Creating a function that will check if an object has a property. */\nconst hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);\n\n/**\n * Determine if a value is a RegExp object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a RegExp object, otherwise false\n */\nconst isRegExp = kindOfTest('RegExp');\n\nconst reduceDescriptors = (obj, reducer) => {\n const descriptors = Object.getOwnPropertyDescriptors(obj);\n const reducedDescriptors = {};\n\n forEach(descriptors, (descriptor, name) => {\n let ret;\n if ((ret = reducer(descriptor, name, obj)) !== false) {\n reducedDescriptors[name] = ret || descriptor;\n }\n });\n\n Object.defineProperties(obj, reducedDescriptors);\n}\n\n/**\n * Makes all methods read-only\n * @param {Object} obj\n */\n\nconst freezeMethods = (obj) => {\n reduceDescriptors(obj, (descriptor, name) => {\n // skip restricted props in strict mode\n if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {\n return false;\n }\n\n const value = obj[name];\n\n if (!isFunction(value)) return;\n\n descriptor.enumerable = false;\n\n if ('writable' in descriptor) {\n descriptor.writable = false;\n return;\n }\n\n if (!descriptor.set) {\n descriptor.set = () => {\n throw Error('Can not rewrite read-only method \\'' + name + '\\'');\n };\n }\n });\n}\n\nconst toObjectSet = (arrayOrString, delimiter) => {\n const obj = {};\n\n const define = (arr) => {\n arr.forEach(value => {\n obj[value] = true;\n });\n }\n\n isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));\n\n return obj;\n}\n\nconst noop = () => {}\n\nconst toFiniteNumber = (value, defaultValue) => {\n value = +value;\n return Number.isFinite(value) ? value : defaultValue;\n}\n\nconst ALPHA = 'abcdefghijklmnopqrstuvwxyz'\n\nconst DIGIT = '0123456789';\n\nconst ALPHABET = {\n DIGIT,\n ALPHA,\n ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT\n}\n\nconst generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {\n let str = '';\n const {length} = alphabet;\n while (size--) {\n str += alphabet[Math.random() * length|0]\n }\n\n return str;\n}\n\n/**\n * If the thing is a FormData object, return true, otherwise return false.\n *\n * @param {unknown} thing - The thing to check.\n *\n * @returns {boolean}\n */\nfunction isSpecCompliantForm(thing) {\n return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]);\n}\n\nconst toJSONObject = (obj) => {\n const stack = new Array(10);\n\n const visit = (source, i) => {\n\n if (isObject(source)) {\n if (stack.indexOf(source) >= 0) {\n return;\n }\n\n if(!('toJSON' in source)) {\n stack[i] = source;\n const target = isArray(source) ? [] : {};\n\n forEach(source, (value, key) => {\n const reducedValue = visit(value, i + 1);\n !isUndefined(reducedValue) && (target[key] = reducedValue);\n });\n\n stack[i] = undefined;\n\n return target;\n }\n }\n\n return source;\n }\n\n return visit(obj, 0);\n}\n\nconst isAsyncFn = kindOfTest('AsyncFunction');\n\nconst isThenable = (thing) =>\n thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);\n\nexport default {\n isArray,\n isArrayBuffer,\n isBuffer,\n isFormData,\n isArrayBufferView,\n isString,\n isNumber,\n isBoolean,\n isObject,\n isPlainObject,\n isUndefined,\n isDate,\n isFile,\n isBlob,\n isRegExp,\n isFunction,\n isStream,\n isURLSearchParams,\n isTypedArray,\n isFileList,\n forEach,\n merge,\n extend,\n trim,\n stripBOM,\n inherits,\n toFlatObject,\n kindOf,\n kindOfTest,\n endsWith,\n toArray,\n forEachEntry,\n matchAll,\n isHTMLForm,\n hasOwnProperty,\n hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection\n reduceDescriptors,\n freezeMethods,\n toObjectSet,\n toCamelCase,\n noop,\n toFiniteNumber,\n findKey,\n global: _global,\n isContextDefined,\n ALPHABET,\n generateString,\n isSpecCompliantForm,\n toJSONObject,\n isAsyncFn,\n isThenable\n};\n","'use strict';\n\nimport utils from '../utils.js';\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [config] The config.\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n *\n * @returns {Error} The created error.\n */\nfunction AxiosError(message, code, config, request, response) {\n Error.call(this);\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n } else {\n this.stack = (new Error()).stack;\n }\n\n this.message = message;\n this.name = 'AxiosError';\n code && (this.code = code);\n config && (this.config = config);\n request && (this.request = request);\n response && (this.response = response);\n}\n\nutils.inherits(AxiosError, Error, {\n toJSON: function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: utils.toJSONObject(this.config),\n code: this.code,\n status: this.response && this.response.status ? this.response.status : null\n };\n }\n});\n\nconst prototype = AxiosError.prototype;\nconst descriptors = {};\n\n[\n 'ERR_BAD_OPTION_VALUE',\n 'ERR_BAD_OPTION',\n 'ECONNABORTED',\n 'ETIMEDOUT',\n 'ERR_NETWORK',\n 'ERR_FR_TOO_MANY_REDIRECTS',\n 'ERR_DEPRECATED',\n 'ERR_BAD_RESPONSE',\n 'ERR_BAD_REQUEST',\n 'ERR_CANCELED',\n 'ERR_NOT_SUPPORT',\n 'ERR_INVALID_URL'\n// eslint-disable-next-line func-names\n].forEach(code => {\n descriptors[code] = {value: code};\n});\n\nObject.defineProperties(AxiosError, descriptors);\nObject.defineProperty(prototype, 'isAxiosError', {value: true});\n\n// eslint-disable-next-line func-names\nAxiosError.from = (error, code, config, request, response, customProps) => {\n const axiosError = Object.create(prototype);\n\n utils.toFlatObject(error, axiosError, function filter(obj) {\n return obj !== Error.prototype;\n }, prop => {\n return prop !== 'isAxiosError';\n });\n\n AxiosError.call(axiosError, error.message, code, config, request, response);\n\n axiosError.cause = error;\n\n axiosError.name = error.name;\n\n customProps && Object.assign(axiosError, customProps);\n\n return axiosError;\n};\n\nexport default AxiosError;\n","// eslint-disable-next-line strict\nexport default null;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\n// temporary hotfix to avoid circular references until AxiosURLSearchParams is refactored\nimport PlatformFormData from '../platform/node/classes/FormData.js';\n\n/**\n * Determines if the given thing is a array or js object.\n *\n * @param {string} thing - The object or array to be visited.\n *\n * @returns {boolean}\n */\nfunction isVisitable(thing) {\n return utils.isPlainObject(thing) || utils.isArray(thing);\n}\n\n/**\n * It removes the brackets from the end of a string\n *\n * @param {string} key - The key of the parameter.\n *\n * @returns {string} the key without the brackets.\n */\nfunction removeBrackets(key) {\n return utils.endsWith(key, '[]') ? key.slice(0, -2) : key;\n}\n\n/**\n * It takes a path, a key, and a boolean, and returns a string\n *\n * @param {string} path - The path to the current key.\n * @param {string} key - The key of the current object being iterated over.\n * @param {string} dots - If true, the key will be rendered with dots instead of brackets.\n *\n * @returns {string} The path to the current key.\n */\nfunction renderKey(path, key, dots) {\n if (!path) return key;\n return path.concat(key).map(function each(token, i) {\n // eslint-disable-next-line no-param-reassign\n token = removeBrackets(token);\n return !dots && i ? '[' + token + ']' : token;\n }).join(dots ? '.' : '');\n}\n\n/**\n * If the array is an array and none of its elements are visitable, then it's a flat array.\n *\n * @param {Array<any>} arr - The array to check\n *\n * @returns {boolean}\n */\nfunction isFlatArray(arr) {\n return utils.isArray(arr) && !arr.some(isVisitable);\n}\n\nconst predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {\n return /^is[A-Z]/.test(prop);\n});\n\n/**\n * Convert a data object to FormData\n *\n * @param {Object} obj\n * @param {?Object} [formData]\n * @param {?Object} [options]\n * @param {Function} [options.visitor]\n * @param {Boolean} [options.metaTokens = true]\n * @param {Boolean} [options.dots = false]\n * @param {?Boolean} [options.indexes = false]\n *\n * @returns {Object}\n **/\n\n/**\n * It converts an object into a FormData object\n *\n * @param {Object<any, any>} obj - The object to convert to form data.\n * @param {string} formData - The FormData object to append to.\n * @param {Object<string, any>} options\n *\n * @returns\n */\nfunction toFormData(obj, formData, options) {\n if (!utils.isObject(obj)) {\n throw new TypeError('target must be an object');\n }\n\n // eslint-disable-next-line no-param-reassign\n formData = formData || new (PlatformFormData || FormData)();\n\n // eslint-disable-next-line no-param-reassign\n options = utils.toFlatObject(options, {\n metaTokens: true,\n dots: false,\n indexes: false\n }, false, function defined(option, source) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n return !utils.isUndefined(source[option]);\n });\n\n const metaTokens = options.metaTokens;\n // eslint-disable-next-line no-use-before-define\n const visitor = options.visitor || defaultVisitor;\n const dots = options.dots;\n const indexes = options.indexes;\n const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;\n const useBlob = _Blob && utils.isSpecCompliantForm(formData);\n\n if (!utils.isFunction(visitor)) {\n throw new TypeError('visitor must be a function');\n }\n\n function convertValue(value) {\n if (value === null) return '';\n\n if (utils.isDate(value)) {\n return value.toISOString();\n }\n\n if (!useBlob && utils.isBlob(value)) {\n throw new AxiosError('Blob is not supported. Use a Buffer instead.');\n }\n\n if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {\n return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);\n }\n\n return value;\n }\n\n /**\n * Default visitor.\n *\n * @param {*} value\n * @param {String|Number} key\n * @param {Array<String|Number>} path\n * @this {FormData}\n *\n * @returns {boolean} return true to visit the each prop of the value recursively\n */\n function defaultVisitor(value, key, path) {\n let arr = value;\n\n if (value && !path && typeof value === 'object') {\n if (utils.endsWith(key, '{}')) {\n // eslint-disable-next-line no-param-reassign\n key = metaTokens ? key : key.slice(0, -2);\n // eslint-disable-next-line no-param-reassign\n value = JSON.stringify(value);\n } else if (\n (utils.isArray(value) && isFlatArray(value)) ||\n ((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value))\n )) {\n // eslint-disable-next-line no-param-reassign\n key = removeBrackets(key);\n\n arr.forEach(function each(el, index) {\n !(utils.isUndefined(el) || el === null) && formData.append(\n // eslint-disable-next-line no-nested-ternary\n indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),\n convertValue(el)\n );\n });\n return false;\n }\n }\n\n if (isVisitable(value)) {\n return true;\n }\n\n formData.append(renderKey(path, key, dots), convertValue(value));\n\n return false;\n }\n\n const stack = [];\n\n const exposedHelpers = Object.assign(predicates, {\n defaultVisitor,\n convertValue,\n isVisitable\n });\n\n function build(value, path) {\n if (utils.isUndefined(value)) return;\n\n if (stack.indexOf(value) !== -1) {\n throw Error('Circular reference detected in ' + path.join('.'));\n }\n\n stack.push(value);\n\n utils.forEach(value, function each(el, key) {\n const result = !(utils.isUndefined(el) || el === null) && visitor.call(\n formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers\n );\n\n if (result === true) {\n build(el, path ? path.concat(key) : [key]);\n }\n });\n\n stack.pop();\n }\n\n if (!utils.isObject(obj)) {\n throw new TypeError('data must be an object');\n }\n\n build(obj);\n\n return formData;\n}\n\nexport default toFormData;\n","'use strict';\n\nimport toFormData from './toFormData.js';\n\n/**\n * It encodes a string by replacing all characters that are not in the unreserved set with\n * their percent-encoded equivalents\n *\n * @param {string} str - The string to encode.\n *\n * @returns {string} The encoded string.\n */\nfunction encode(str) {\n const charMap = {\n '!': '%21',\n \"'\": '%27',\n '(': '%28',\n ')': '%29',\n '~': '%7E',\n '%20': '+',\n '%00': '\\x00'\n };\n return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {\n return charMap[match];\n });\n}\n\n/**\n * It takes a params object and converts it to a FormData object\n *\n * @param {Object<string, any>} params - The parameters to be converted to a FormData object.\n * @param {Object<string, any>} options - The options object passed to the Axios constructor.\n *\n * @returns {void}\n */\nfunction AxiosURLSearchParams(params, options) {\n this._pairs = [];\n\n params && toFormData(params, this, options);\n}\n\nconst prototype = AxiosURLSearchParams.prototype;\n\nprototype.append = function append(name, value) {\n this._pairs.push([name, value]);\n};\n\nprototype.toString = function toString(encoder) {\n const _encode = encoder ? function(value) {\n return encoder.call(this, value, encode);\n } : encode;\n\n return this._pairs.map(function each(pair) {\n return _encode(pair[0]) + '=' + _encode(pair[1]);\n }, '').join('&');\n};\n\nexport default AxiosURLSearchParams;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosURLSearchParams from '../helpers/AxiosURLSearchParams.js';\n\n/**\n * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their\n * URI encoded counterparts\n *\n * @param {string} val The value to be encoded.\n *\n * @returns {string} The encoded value.\n */\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @param {?object} options\n *\n * @returns {string} The formatted url\n */\nexport default function buildURL(url, params, options) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n \n const _encode = options && options.encode || encode;\n\n const serializeFn = options && options.serialize;\n\n let serializedParams;\n\n if (serializeFn) {\n serializedParams = serializeFn(params, options);\n } else {\n serializedParams = utils.isURLSearchParams(params) ?\n params.toString() :\n new AxiosURLSearchParams(params, options).toString(_encode);\n }\n\n if (serializedParams) {\n const hashmarkIndex = url.indexOf(\"#\");\n\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\nclass InterceptorManager {\n constructor() {\n this.handlers = [];\n }\n\n /**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\n use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled,\n rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n }\n\n /**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n *\n * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise\n */\n eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n }\n\n /**\n * Clear all interceptors from the stack\n *\n * @returns {void}\n */\n clear() {\n if (this.handlers) {\n this.handlers = [];\n }\n }\n\n /**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n *\n * @returns {void}\n */\n forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n }\n}\n\nexport default InterceptorManager;\n","'use strict';\n\nexport default {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n};\n","'use strict';\n\nimport AxiosURLSearchParams from '../../../helpers/AxiosURLSearchParams.js';\nexport default typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;\n","'use strict';\n\nexport default typeof FormData !== 'undefined' ? FormData : null;\n","'use strict'\n\nexport default typeof Blob !== 'undefined' ? Blob : null\n","import URLSearchParams from './classes/URLSearchParams.js'\nimport FormData from './classes/FormData.js'\nimport Blob from './classes/Blob.js'\n\nexport default {\n isBrowser: true,\n classes: {\n URLSearchParams,\n FormData,\n Blob\n },\n protocols: ['http', 'https', 'file', 'blob', 'url', 'data']\n};\n","const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n *\n * @returns {boolean}\n */\nconst hasStandardBrowserEnv = (\n (product) => {\n return hasBrowserEnv && ['ReactNative', 'NativeScript', 'NS'].indexOf(product) < 0\n })(typeof navigator !== 'undefined' && navigator.product);\n\n/**\n * Determine if we're running in a standard browser webWorker environment\n *\n * Although the `isStandardBrowserEnv` method indicates that\n * `allows axios to run in a web worker`, the WebWorker will still be\n * filtered out due to its judgment standard\n * `typeof window !== 'undefined' && typeof document !== 'undefined'`.\n * This leads to a problem when axios post `FormData` in webWorker\n */\nconst hasStandardBrowserWebWorkerEnv = (() => {\n return (\n typeof WorkerGlobalScope !== 'undefined' &&\n // eslint-disable-next-line no-undef\n self instanceof WorkerGlobalScope &&\n typeof self.importScripts === 'function'\n );\n})();\n\nexport {\n hasBrowserEnv,\n hasStandardBrowserWebWorkerEnv,\n hasStandardBrowserEnv\n}\n","import platform from './node/index.js';\nimport * as utils from './common/utils.js';\n\nexport default {\n ...utils,\n ...platform\n}\n","'use strict';\n\nimport utils from '../utils.js';\nimport toFormData from './toFormData.js';\nimport platform from '../platform/index.js';\n\nexport default function toURLEncodedForm(data, options) {\n return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({\n visitor: function(value, key, path, helpers) {\n if (platform.isNode && utils.isBuffer(value)) {\n this.append(key, value.toString('base64'));\n return false;\n }\n\n return helpers.defaultVisitor.apply(this, arguments);\n }\n }, options));\n}\n","'use strict';\n\nimport utils from '../utils.js';\n\n/**\n * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']\n *\n * @param {string} name - The name of the property to get.\n *\n * @returns An array of strings.\n */\nfunction parsePropPath(name) {\n // foo[x][y][z]\n // foo.x.y.z\n // foo-x-y-z\n // foo x y z\n return utils.matchAll(/\\w+|\\[(\\w*)]/g, name).map(match => {\n return match[0] === '[]' ? '' : match[1] || match[0];\n });\n}\n\n/**\n * Convert an array to an object.\n *\n * @param {Array<any>} arr - The array to convert to an object.\n *\n * @returns An object with the same keys and values as the array.\n */\nfunction arrayToObject(arr) {\n const obj = {};\n const keys = Object.keys(arr);\n let i;\n const len = keys.length;\n let key;\n for (i = 0; i < len; i++) {\n key = keys[i];\n obj[key] = arr[key];\n }\n return obj;\n}\n\n/**\n * It takes a FormData object and returns a JavaScript object\n *\n * @param {string} formData The FormData object to convert to JSON.\n *\n * @returns {Object<string, any> | null} The converted object.\n */\nfunction formDataToJSON(formData) {\n function buildPath(path, value, target, index) {\n let name = path[index++];\n\n if (name === '__proto__') return true;\n\n const isNumericKey = Number.isFinite(+name);\n const isLast = index >= path.length;\n name = !name && utils.isArray(target) ? target.length : name;\n\n if (isLast) {\n if (utils.hasOwnProp(target, name)) {\n target[name] = [target[name], value];\n } else {\n target[name] = value;\n }\n\n return !isNumericKey;\n }\n\n if (!target[name] || !utils.isObject(target[name])) {\n target[name] = [];\n }\n\n const result = buildPath(path, value, target[name], index);\n\n if (result && utils.isArray(target[name])) {\n target[name] = arrayToObject(target[name]);\n }\n\n return !isNumericKey;\n }\n\n if (utils.isFormData(formData) && utils.isFunction(formData.entries)) {\n const obj = {};\n\n utils.forEachEntry(formData, (name, value) => {\n buildPath(parsePropPath(name), value, obj, 0);\n });\n\n return obj;\n }\n\n return null;\n}\n\nexport default formDataToJSON;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\nimport transitionalDefaults from './transitional.js';\nimport toFormData from '../helpers/toFormData.js';\nimport toURLEncodedForm from '../helpers/toURLEncodedForm.js';\nimport platform from '../platform/index.js';\nimport formDataToJSON from '../helpers/formDataToJSON.js';\n\n/**\n * It takes a string, tries to parse it, and if it fails, it returns the stringified version\n * of the input\n *\n * @param {any} rawValue - The value to be stringified.\n * @param {Function} parser - A function that parses a string into a JavaScript object.\n * @param {Function} encoder - A function that takes a value and returns a string.\n *\n * @returns {string} A stringified version of the rawValue.\n */\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nconst defaults = {\n\n transitional: transitionalDefaults,\n\n adapter: ['xhr', 'http'],\n\n transformRequest: [function transformRequest(data, headers) {\n const contentType = headers.getContentType() || '';\n const hasJSONContentType = contentType.indexOf('application/json') > -1;\n const isObjectPayload = utils.isObject(data);\n\n if (isObjectPayload && utils.isHTMLForm(data)) {\n data = new FormData(data);\n }\n\n const isFormData = utils.isFormData(data);\n\n if (isFormData) {\n return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;\n }\n\n if (utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);\n return data.toString();\n }\n\n let isFileList;\n\n if (isObjectPayload) {\n if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {\n return toURLEncodedForm(data, this.formSerializer).toString();\n }\n\n if ((isFileList = utils.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {\n const _FormData = this.env && this.env.FormData;\n\n return toFormData(\n isFileList ? {'files[]': data} : data,\n _FormData && new _FormData(),\n this.formSerializer\n );\n }\n }\n\n if (isObjectPayload || hasJSONContentType ) {\n headers.setContentType('application/json', false);\n return stringifySafely(data);\n }\n\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n const transitional = this.transitional || defaults.transitional;\n const forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n const JSONRequested = this.responseType === 'json';\n\n if (data && utils.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {\n const silentJSONParsing = transitional && transitional.silentJSONParsing;\n const strictJSONParsing = !silentJSONParsing && JSONRequested;\n\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n env: {\n FormData: platform.classes.FormData,\n Blob: platform.classes.Blob\n },\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n },\n\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*',\n 'Content-Type': undefined\n }\n }\n};\n\nutils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {\n defaults.headers[method] = {};\n});\n\nexport default defaults;\n","'use strict';\n\nimport utils from './../utils.js';\n\n// RawAxiosHeaders whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nconst ignoreDuplicateOf = utils.toObjectSet([\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n]);\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} rawHeaders Headers needing to be parsed\n *\n * @returns {Object} Headers parsed into an object\n */\nexport default rawHeaders => {\n const parsed = {};\n let key;\n let val;\n let i;\n\n rawHeaders && rawHeaders.split('\\n').forEach(function parser(line) {\n i = line.indexOf(':');\n key = line.substring(0, i).trim().toLowerCase();\n val = line.substring(i + 1).trim();\n\n if (!key || (parsed[key] && ignoreDuplicateOf[key])) {\n return;\n }\n\n if (key === 'set-cookie') {\n if (parsed[key]) {\n parsed[key].push(val);\n } else {\n parsed[key] = [val];\n }\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n });\n\n return parsed;\n};\n","'use strict';\n\nimport utils from '../utils.js';\nimport parseHeaders from '../helpers/parseHeaders.js';\n\nconst $internals = Symbol('internals');\n\nfunction normalizeHeader(header) {\n return header && String(header).trim().toLowerCase();\n}\n\nfunction normalizeValue(value) {\n if (value === false || value == null) {\n return value;\n }\n\n return utils.isArray(value) ? value.map(normalizeValue) : String(value);\n}\n\nfunction parseTokens(str) {\n const tokens = Object.create(null);\n const tokensRE = /([^\\s,;=]+)\\s*(?:=\\s*([^,;]+))?/g;\n let match;\n\n while ((match = tokensRE.exec(str))) {\n tokens[match[1]] = match[2];\n }\n\n return tokens;\n}\n\nconst isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());\n\nfunction matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {\n if (utils.isFunction(filter)) {\n return filter.call(this, value, header);\n }\n\n if (isHeaderNameFilter) {\n value = header;\n }\n\n if (!utils.isString(value)) return;\n\n if (utils.isString(filter)) {\n return value.indexOf(filter) !== -1;\n }\n\n if (utils.isRegExp(filter)) {\n return filter.test(value);\n }\n}\n\nfunction formatHeader(header) {\n return header.trim()\n .toLowerCase().replace(/([a-z\\d])(\\w*)/g, (w, char, str) => {\n return char.toUpperCase() + str;\n });\n}\n\nfunction buildAccessors(obj, header) {\n const accessorName = utils.toCamelCase(' ' + header);\n\n ['get', 'set', 'has'].forEach(methodName => {\n Object.defineProperty(obj, methodName + accessorName, {\n value: function(arg1, arg2, arg3) {\n return this[methodName].call(this, header, arg1, arg2, arg3);\n },\n configurable: true\n });\n });\n}\n\nclass AxiosHeaders {\n constructor(headers) {\n headers && this.set(headers);\n }\n\n set(header, valueOrRewrite, rewrite) {\n const self = this;\n\n function setHeader(_value, _header, _rewrite) {\n const lHeader = normalizeHeader(_header);\n\n if (!lHeader) {\n throw new Error('header name must be a non-empty string');\n }\n\n const key = utils.findKey(self, lHeader);\n\n if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {\n self[key || _header] = normalizeValue(_value);\n }\n }\n\n const setHeaders = (headers, _rewrite) =>\n utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));\n\n if (utils.isPlainObject(header) || header instanceof this.constructor) {\n setHeaders(header, valueOrRewrite)\n } else if(utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {\n setHeaders(parseHeaders(header), valueOrRewrite);\n } else {\n header != null && setHeader(valueOrRewrite, header, rewrite);\n }\n\n return this;\n }\n\n get(header, parser) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n if (key) {\n const value = this[key];\n\n if (!parser) {\n return value;\n }\n\n if (parser === true) {\n return parseTokens(value);\n }\n\n if (utils.isFunction(parser)) {\n return parser.call(this, value, key);\n }\n\n if (utils.isRegExp(parser)) {\n return parser.exec(value);\n }\n\n throw new TypeError('parser must be boolean|regexp|function');\n }\n }\n }\n\n has(header, matcher) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));\n }\n\n return false;\n }\n\n delete(header, matcher) {\n const self = this;\n let deleted = false;\n\n function deleteHeader(_header) {\n _header = normalizeHeader(_header);\n\n if (_header) {\n const key = utils.findKey(self, _header);\n\n if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {\n delete self[key];\n\n deleted = true;\n }\n }\n }\n\n if (utils.isArray(header)) {\n header.forEach(deleteHeader);\n } else {\n deleteHeader(header);\n }\n\n return deleted;\n }\n\n clear(matcher) {\n const keys = Object.keys(this);\n let i = keys.length;\n let deleted = false;\n\n while (i--) {\n const key = keys[i];\n if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {\n delete this[key];\n deleted = true;\n }\n }\n\n return deleted;\n }\n\n normalize(format) {\n const self = this;\n const headers = {};\n\n utils.forEach(this, (value, header) => {\n const key = utils.findKey(headers, header);\n\n if (key) {\n self[key] = normalizeValue(value);\n delete self[header];\n return;\n }\n\n const normalized = format ? formatHeader(header) : String(header).trim();\n\n if (normalized !== header) {\n delete self[header];\n }\n\n self[normalized] = normalizeValue(value);\n\n headers[normalized] = true;\n });\n\n return this;\n }\n\n concat(...targets) {\n return this.constructor.concat(this, ...targets);\n }\n\n toJSON(asStrings) {\n const obj = Object.create(null);\n\n utils.forEach(this, (value, header) => {\n value != null && value !== false && (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value);\n });\n\n return obj;\n }\n\n [Symbol.iterator]() {\n return Object.entries(this.toJSON())[Symbol.iterator]();\n }\n\n toString() {\n return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\\n');\n }\n\n get [Symbol.toStringTag]() {\n return 'AxiosHeaders';\n }\n\n static from(thing) {\n return thing instanceof this ? thing : new this(thing);\n }\n\n static concat(first, ...targets) {\n const computed = new this(first);\n\n targets.forEach((target) => computed.set(target));\n\n return computed;\n }\n\n static accessor(header) {\n const internals = this[$internals] = (this[$internals] = {\n accessors: {}\n });\n\n const accessors = internals.accessors;\n const prototype = this.prototype;\n\n function defineAccessor(_header) {\n const lHeader = normalizeHeader(_header);\n\n if (!accessors[lHeader]) {\n buildAccessors(prototype, _header);\n accessors[lHeader] = true;\n }\n }\n\n utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);\n\n return this;\n }\n}\n\nAxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);\n\n// reserved names hotfix\nutils.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {\n let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`\n return {\n get: () => value,\n set(headerValue) {\n this[mapped] = headerValue;\n }\n }\n});\n\nutils.freezeMethods(AxiosHeaders);\n\nexport default AxiosHeaders;\n","'use strict';\n\nimport utils from './../utils.js';\nimport defaults from '../defaults/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Array|Function} fns A single function or Array of functions\n * @param {?Object} response The response object\n *\n * @returns {*} The resulting transformed data\n */\nexport default function transformData(fns, response) {\n const config = this || defaults;\n const context = response || config;\n const headers = AxiosHeaders.from(context.headers);\n let data = context.data;\n\n utils.forEach(fns, function transform(fn) {\n data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);\n });\n\n headers.normalize();\n\n return data;\n}\n","'use strict';\n\nexport default function isCancel(value) {\n return !!(value && value.__CANCEL__);\n}\n","'use strict';\n\nimport AxiosError from '../core/AxiosError.js';\nimport utils from '../utils.js';\n\n/**\n * A `CanceledError` is an object that is thrown when an operation is canceled.\n *\n * @param {string=} message The message.\n * @param {Object=} config The config.\n * @param {Object=} request The request.\n *\n * @returns {CanceledError} The created error.\n */\nfunction CanceledError(message, config, request) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);\n this.name = 'CanceledError';\n}\n\nutils.inherits(CanceledError, AxiosError, {\n __CANCEL__: true\n});\n\nexport default CanceledError;\n","'use strict';\n\nimport AxiosError from './AxiosError.js';\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n *\n * @returns {object} The response.\n */\nexport default function settle(resolve, reject, response) {\n const validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(new AxiosError(\n 'Request failed with status code ' + response.status,\n [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],\n response.config,\n response.request,\n response\n ));\n }\n}\n","import utils from './../utils.js';\nimport platform from '../platform/index.js';\n\nexport default platform.hasStandardBrowserEnv ?\n\n // Standard browser envs support document.cookie\n {\n write(name, value, expires, path, domain, secure) {\n const cookie = [name + '=' + encodeURIComponent(value)];\n\n utils.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());\n\n utils.isString(path) && cookie.push('path=' + path);\n\n utils.isString(domain) && cookie.push('domain=' + domain);\n\n secure === true && cookie.push('secure');\n\n document.cookie = cookie.join('; ');\n },\n\n read(name) {\n const match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n }\n\n :\n\n // Non-standard browser env (web workers, react-native) lack needed support.\n {\n write() {},\n read() {\n return null;\n },\n remove() {}\n };\n\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n *\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nexport default function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"<scheme>://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(url);\n}\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n *\n * @returns {string} The combined URL\n */\nexport default function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/?\\/$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n}\n","'use strict';\n\nimport isAbsoluteURL from '../helpers/isAbsoluteURL.js';\nimport combineURLs from '../helpers/combineURLs.js';\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n *\n * @returns {string} The combined full path\n */\nexport default function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n}\n","'use strict';\n\nimport utils from './../utils.js';\nimport platform from '../platform/index.js';\n\nexport default platform.hasStandardBrowserEnv ?\n\n// Standard browser envs have full support of the APIs needed to test\n// whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n const msie = /(msie|trident)/i.test(navigator.userAgent);\n const urlParsingNode = document.createElement('a');\n let originURL;\n\n /**\n * Parse a URL to discover its components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n let href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n const parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })();\n","'use strict';\n\nexport default function parseProtocol(url) {\n const match = /^([-+\\w]{1,25})(:?\\/\\/|:)/.exec(url);\n return match && match[1] || '';\n}\n","'use strict';\n\n/**\n * Calculate data maxRate\n * @param {Number} [samplesCount= 10]\n * @param {Number} [min= 1000]\n * @returns {Function}\n */\nfunction speedometer(samplesCount, min) {\n samplesCount = samplesCount || 10;\n const bytes = new Array(samplesCount);\n const timestamps = new Array(samplesCount);\n let head = 0;\n let tail = 0;\n let firstSampleTS;\n\n min = min !== undefined ? min : 1000;\n\n return function push(chunkLength) {\n const now = Date.now();\n\n const startedAt = timestamps[tail];\n\n if (!firstSampleTS) {\n firstSampleTS = now;\n }\n\n bytes[head] = chunkLength;\n timestamps[head] = now;\n\n let i = tail;\n let bytesCount = 0;\n\n while (i !== head) {\n bytesCount += bytes[i++];\n i = i % samplesCount;\n }\n\n head = (head + 1) % samplesCount;\n\n if (head === tail) {\n tail = (tail + 1) % samplesCount;\n }\n\n if (now - firstSampleTS < min) {\n return;\n }\n\n const passed = startedAt && now - startedAt;\n\n return passed ? Math.round(bytesCount * 1000 / passed) : undefined;\n };\n}\n\nexport default speedometer;\n","'use strict';\n\nimport utils from './../utils.js';\nimport settle from './../core/settle.js';\nimport cookies from './../helpers/cookies.js';\nimport buildURL from './../helpers/buildURL.js';\nimport buildFullPath from '../core/buildFullPath.js';\nimport isURLSameOrigin from './../helpers/isURLSameOrigin.js';\nimport transitionalDefaults from '../defaults/transitional.js';\nimport AxiosError from '../core/AxiosError.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport parseProtocol from '../helpers/parseProtocol.js';\nimport platform from '../platform/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport speedometer from '../helpers/speedometer.js';\n\nfunction progressEventReducer(listener, isDownloadStream) {\n let bytesNotified = 0;\n const _speedometer = speedometer(50, 250);\n\n return e => {\n const loaded = e.loaded;\n const total = e.lengthComputable ? e.total : undefined;\n const progressBytes = loaded - bytesNotified;\n const rate = _speedometer(progressBytes);\n const inRange = loaded <= total;\n\n bytesNotified = loaded;\n\n const data = {\n loaded,\n total,\n progress: total ? (loaded / total) : undefined,\n bytes: progressBytes,\n rate: rate ? rate : undefined,\n estimated: rate && total && inRange ? (total - loaded) / rate : undefined,\n event: e\n };\n\n data[isDownloadStream ? 'download' : 'upload'] = true;\n\n listener(data);\n };\n}\n\nconst isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';\n\nexport default isXHRAdapterSupported && function (config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n let requestData = config.data;\n const requestHeaders = AxiosHeaders.from(config.headers).normalize();\n let {responseType, withXSRFToken} = config;\n let onCanceled;\n function done() {\n if (config.cancelToken) {\n config.cancelToken.unsubscribe(onCanceled);\n }\n\n if (config.signal) {\n config.signal.removeEventListener('abort', onCanceled);\n }\n }\n\n let contentType;\n\n if (utils.isFormData(requestData)) {\n if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {\n requestHeaders.setContentType(false); // Let the browser set it\n } else if ((contentType = requestHeaders.getContentType()) !== false) {\n // fix semicolon duplication issue for ReactNative FormData implementation\n const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];\n requestHeaders.setContentType([type || 'multipart/form-data', ...tokens].join('; '));\n }\n }\n\n let request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n const username = config.auth.username || '';\n const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.set('Authorization', 'Basic ' + btoa(username + ':' + password));\n }\n\n const fullPath = buildFullPath(config.baseURL, config.url);\n\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n const responseHeaders = AxiosHeaders.from(\n 'getAllResponseHeaders' in request && request.getAllResponseHeaders()\n );\n const responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n const response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config,\n request\n };\n\n settle(function _resolve(value) {\n resolve(value);\n done();\n }, function _reject(err) {\n reject(err);\n done();\n }, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';\n const transitional = config.transitional || transitionalDefaults;\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(new AxiosError(\n timeoutErrorMessage,\n transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,\n config,\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if(platform.hasStandardBrowserEnv) {\n withXSRFToken && utils.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config));\n\n if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(fullPath))) {\n // Add xsrf header\n const xsrfValue = config.xsrfHeaderName && config.xsrfCookieName && cookies.read(config.xsrfCookieName);\n\n if (xsrfValue) {\n requestHeaders.set(config.xsrfHeaderName, xsrfValue);\n }\n }\n }\n\n // Remove Content-Type if data is undefined\n requestData === undefined && requestHeaders.setContentType(null);\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {\n request.setRequestHeader(key, val);\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = config.responseType;\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', progressEventReducer(config.onDownloadProgress, true));\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', progressEventReducer(config.onUploadProgress));\n }\n\n if (config.cancelToken || config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = cancel => {\n if (!request) {\n return;\n }\n reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);\n request.abort();\n request = null;\n };\n\n config.cancelToken && config.cancelToken.subscribe(onCanceled);\n if (config.signal) {\n config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);\n }\n }\n\n const protocol = parseProtocol(fullPath);\n\n if (protocol && platform.protocols.indexOf(protocol) === -1) {\n reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));\n return;\n }\n\n\n // Send the request\n request.send(requestData || null);\n });\n}\n","import utils from '../utils.js';\nimport httpAdapter from './http.js';\nimport xhrAdapter from './xhr.js';\nimport AxiosError from \"../core/AxiosError.js\";\n\nconst knownAdapters = {\n http: httpAdapter,\n xhr: xhrAdapter\n}\n\nutils.forEach(knownAdapters, (fn, value) => {\n if (fn) {\n try {\n Object.defineProperty(fn, 'name', {value});\n } catch (e) {\n // eslint-disable-next-line no-empty\n }\n Object.defineProperty(fn, 'adapterName', {value});\n }\n});\n\nconst renderReason = (reason) => `- ${reason}`;\n\nconst isResolvedHandle = (adapter) => utils.isFunction(adapter) || adapter === null || adapter === false;\n\nexport default {\n getAdapter: (adapters) => {\n adapters = utils.isArray(adapters) ? adapters : [adapters];\n\n const {length} = adapters;\n let nameOrAdapter;\n let adapter;\n\n const rejectedReasons = {};\n\n for (let i = 0; i < length; i++) {\n nameOrAdapter = adapters[i];\n let id;\n\n adapter = nameOrAdapter;\n\n if (!isResolvedHandle(nameOrAdapter)) {\n adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];\n\n if (adapter === undefined) {\n throw new AxiosError(`Unknown adapter '${id}'`);\n }\n }\n\n if (adapter) {\n break;\n }\n\n rejectedReasons[id || '#' + i] = adapter;\n }\n\n if (!adapter) {\n\n const reasons = Object.entries(rejectedReasons)\n .map(([id, state]) => `adapter ${id} ` +\n (state === false ? 'is not supported by the environment' : 'is not available in the build')\n );\n\n let s = length ?\n (reasons.length > 1 ? 'since :\\n' + reasons.map(renderReason).join('\\n') : ' ' + renderReason(reasons[0])) :\n 'as no adapter specified';\n\n throw new AxiosError(\n `There is no suitable adapter to dispatch the request ` + s,\n 'ERR_NOT_SUPPORT'\n );\n }\n\n return adapter;\n },\n adapters: knownAdapters\n}\n","'use strict';\n\nimport transformData from './transformData.js';\nimport isCancel from '../cancel/isCancel.js';\nimport defaults from '../defaults/index.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport adapters from \"../adapters/adapters.js\";\n\n/**\n * Throws a `CanceledError` if cancellation has been requested.\n *\n * @param {Object} config The config that is to be used for the request\n *\n * @returns {void}\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n\n if (config.signal && config.signal.aborted) {\n throw new CanceledError(null, config);\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n *\n * @returns {Promise} The Promise to be fulfilled\n */\nexport default function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n config.headers = AxiosHeaders.from(config.headers);\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.transformRequest\n );\n\n if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {\n config.headers.setContentType('application/x-www-form-urlencoded', false);\n }\n\n const adapter = adapters.getAdapter(config.adapter || defaults.adapter);\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n config.transformResponse,\n response\n );\n\n response.headers = AxiosHeaders.from(response.headers);\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n config.transformResponse,\n reason.response\n );\n reason.response.headers = AxiosHeaders.from(reason.response.headers);\n }\n }\n\n return Promise.reject(reason);\n });\n}\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosHeaders from \"./AxiosHeaders.js\";\n\nconst headersToObject = (thing) => thing instanceof AxiosHeaders ? thing.toJSON() : thing;\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n *\n * @returns {Object} New object resulting from merging config2 to config1\n */\nexport default function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n const config = {};\n\n function getMergedValue(target, source, caseless) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge.call({caseless}, target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDeepProperties(a, b, caseless) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(a, b, caseless);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a, caseless);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function valueFromConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function defaultToConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDirectKeys(a, b, prop) {\n if (prop in config2) {\n return getMergedValue(a, b);\n } else if (prop in config1) {\n return getMergedValue(undefined, a);\n }\n }\n\n const mergeMap = {\n url: valueFromConfig2,\n method: valueFromConfig2,\n data: valueFromConfig2,\n baseURL: defaultToConfig2,\n transformRequest: defaultToConfig2,\n transformResponse: defaultToConfig2,\n paramsSerializer: defaultToConfig2,\n timeout: defaultToConfig2,\n timeoutMessage: defaultToConfig2,\n withCredentials: defaultToConfig2,\n withXSRFToken: defaultToConfig2,\n adapter: defaultToConfig2,\n responseType: defaultToConfig2,\n xsrfCookieName: defaultToConfig2,\n xsrfHeaderName: defaultToConfig2,\n onUploadProgress: defaultToConfig2,\n onDownloadProgress: defaultToConfig2,\n decompress: defaultToConfig2,\n maxContentLength: defaultToConfig2,\n maxBodyLength: defaultToConfig2,\n beforeRedirect: defaultToConfig2,\n transport: defaultToConfig2,\n httpAgent: defaultToConfig2,\n httpsAgent: defaultToConfig2,\n cancelToken: defaultToConfig2,\n socketPath: defaultToConfig2,\n responseEncoding: defaultToConfig2,\n validateStatus: mergeDirectKeys,\n headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)\n };\n\n utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {\n const merge = mergeMap[prop] || mergeDeepProperties;\n const configValue = merge(config1[prop], config2[prop], prop);\n (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);\n });\n\n return config;\n}\n","export const VERSION = \"1.6.7\";","'use strict';\n\nimport {VERSION} from '../env/data.js';\nimport AxiosError from '../core/AxiosError.js';\n\nconst validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nconst deprecatedWarnings = {};\n\n/**\n * Transitional option validator\n *\n * @param {function|boolean?} validator - set to false if the transitional option has been removed\n * @param {string?} version - deprecated version / removed since version\n * @param {string?} message - some message with additional info\n *\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n function formatMessage(opt, desc) {\n return '[Axios v' + VERSION + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return (value, opt, opts) => {\n if (validator === false) {\n throw new AxiosError(\n formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),\n AxiosError.ERR_DEPRECATED\n );\n }\n\n if (version && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n *\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n *\n * @returns {object}\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);\n }\n const keys = Object.keys(options);\n let i = keys.length;\n while (i-- > 0) {\n const opt = keys[i];\n const validator = schema[opt];\n if (validator) {\n const value = options[opt];\n const result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);\n }\n }\n}\n\nexport default {\n assertOptions,\n validators\n};\n","'use strict';\n\nimport utils from './../utils.js';\nimport buildURL from '../helpers/buildURL.js';\nimport InterceptorManager from './InterceptorManager.js';\nimport dispatchRequest from './dispatchRequest.js';\nimport mergeConfig from './mergeConfig.js';\nimport buildFullPath from './buildFullPath.js';\nimport validator from '../helpers/validator.js';\nimport AxiosHeaders from './AxiosHeaders.js';\n\nconst validators = validator.validators;\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n *\n * @return {Axios} A new instance of Axios\n */\nclass Axios {\n constructor(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n }\n\n /**\n * Dispatch a request\n *\n * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)\n * @param {?Object} config\n *\n * @returns {Promise} The Promise to be fulfilled\n */\n async request(configOrUrl, config) {\n try {\n return await this._request(configOrUrl, config);\n } catch (err) {\n if (err instanceof Error) {\n let dummy;\n\n Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : (dummy = new Error());\n\n // slice off the Error: ... line\n const stack = dummy.stack ? dummy.stack.replace(/^.+\\n/, '') : '';\n\n if (!err.stack) {\n err.stack = stack;\n // match without the 2 top stack lines\n } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\\n.+\\n/, ''))) {\n err.stack += '\\n' + stack\n }\n }\n\n throw err;\n }\n }\n\n _request(configOrUrl, config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof configOrUrl === 'string') {\n config = config || {};\n config.url = configOrUrl;\n } else {\n config = configOrUrl || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n const {transitional, paramsSerializer, headers} = config;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean),\n forcedJSONParsing: validators.transitional(validators.boolean),\n clarifyTimeoutError: validators.transitional(validators.boolean)\n }, false);\n }\n\n if (paramsSerializer != null) {\n if (utils.isFunction(paramsSerializer)) {\n config.paramsSerializer = {\n serialize: paramsSerializer\n }\n } else {\n validator.assertOptions(paramsSerializer, {\n encode: validators.function,\n serialize: validators.function\n }, true);\n }\n }\n\n // Set config.method\n config.method = (config.method || this.defaults.method || 'get').toLowerCase();\n\n // Flatten headers\n let contextHeaders = headers && utils.merge(\n headers.common,\n headers[config.method]\n );\n\n headers && utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n (method) => {\n delete headers[method];\n }\n );\n\n config.headers = AxiosHeaders.concat(contextHeaders, headers);\n\n // filter out skipped interceptors\n const requestInterceptorChain = [];\n let synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n const responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n let promise;\n let i = 0;\n let len;\n\n if (!synchronousRequestInterceptors) {\n const chain = [dispatchRequest.bind(this), undefined];\n chain.unshift.apply(chain, requestInterceptorChain);\n chain.push.apply(chain, responseInterceptorChain);\n len = chain.length;\n\n promise = Promise.resolve(config);\n\n while (i < len) {\n promise = promise.then(chain[i++], chain[i++]);\n }\n\n return promise;\n }\n\n len = requestInterceptorChain.length;\n\n let newConfig = config;\n\n i = 0;\n\n while (i < len) {\n const onFulfilled = requestInterceptorChain[i++];\n const onRejected = requestInterceptorChain[i++];\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected.call(this, error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest.call(this, newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n i = 0;\n len = responseInterceptorChain.length;\n\n while (i < len) {\n promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);\n }\n\n return promise;\n }\n\n getUri(config) {\n config = mergeConfig(this.defaults, config);\n const fullPath = buildFullPath(config.baseURL, config.url);\n return buildURL(fullPath, config.params, config.paramsSerializer);\n }\n}\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n\n function generateHTTPMethod(isForm) {\n return function httpMethod(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n headers: isForm ? {\n 'Content-Type': 'multipart/form-data'\n } : {},\n url,\n data\n }));\n };\n }\n\n Axios.prototype[method] = generateHTTPMethod();\n\n Axios.prototype[method + 'Form'] = generateHTTPMethod(true);\n});\n\nexport default Axios;\n","'use strict';\n\nimport CanceledError from './CanceledError.js';\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @param {Function} executor The executor function.\n *\n * @returns {CancelToken}\n */\nclass CancelToken {\n constructor(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n let resolvePromise;\n\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n const token = this;\n\n // eslint-disable-next-line func-names\n this.promise.then(cancel => {\n if (!token._listeners) return;\n\n let i = token._listeners.length;\n\n while (i-- > 0) {\n token._listeners[i](cancel);\n }\n token._listeners = null;\n });\n\n // eslint-disable-next-line func-names\n this.promise.then = onfulfilled => {\n let _resolve;\n // eslint-disable-next-line func-names\n const promise = new Promise(resolve => {\n token.subscribe(resolve);\n _resolve = resolve;\n }).then(onfulfilled);\n\n promise.cancel = function reject() {\n token.unsubscribe(_resolve);\n };\n\n return promise;\n };\n\n executor(function cancel(message, config, request) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new CanceledError(message, config, request);\n resolvePromise(token.reason);\n });\n }\n\n /**\n * Throws a `CanceledError` if cancellation has been requested.\n */\n throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n }\n\n /**\n * Subscribe to the cancel signal\n */\n\n subscribe(listener) {\n if (this.reason) {\n listener(this.reason);\n return;\n }\n\n if (this._listeners) {\n this._listeners.push(listener);\n } else {\n this._listeners = [listener];\n }\n }\n\n /**\n * Unsubscribe from the cancel signal\n */\n\n unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n const index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n }\n\n /**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\n static source() {\n let cancel;\n const token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token,\n cancel\n };\n }\n}\n\nexport default CancelToken;\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n *\n * @returns {Function}\n */\nexport default function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n *\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nexport default function isAxiosError(payload) {\n return utils.isObject(payload) && (payload.isAxiosError === true);\n}\n","const HttpStatusCode = {\n Continue: 100,\n SwitchingProtocols: 101,\n Processing: 102,\n EarlyHints: 103,\n Ok: 200,\n Created: 201,\n Accepted: 202,\n NonAuthoritativeInformation: 203,\n NoContent: 204,\n ResetContent: 205,\n PartialContent: 206,\n MultiStatus: 207,\n AlreadyReported: 208,\n ImUsed: 226,\n MultipleChoices: 300,\n MovedPermanently: 301,\n Found: 302,\n SeeOther: 303,\n NotModified: 304,\n UseProxy: 305,\n Unused: 306,\n TemporaryRedirect: 307,\n PermanentRedirect: 308,\n BadRequest: 400,\n Unauthorized: 401,\n PaymentRequired: 402,\n Forbidden: 403,\n NotFound: 404,\n MethodNotAllowed: 405,\n NotAcceptable: 406,\n ProxyAuthenticationRequired: 407,\n RequestTimeout: 408,\n Conflict: 409,\n Gone: 410,\n LengthRequired: 411,\n PreconditionFailed: 412,\n PayloadTooLarge: 413,\n UriTooLong: 414,\n UnsupportedMediaType: 415,\n RangeNotSatisfiable: 416,\n ExpectationFailed: 417,\n ImATeapot: 418,\n MisdirectedRequest: 421,\n UnprocessableEntity: 422,\n Locked: 423,\n FailedDependency: 424,\n TooEarly: 425,\n UpgradeRequired: 426,\n PreconditionRequired: 428,\n TooManyRequests: 429,\n RequestHeaderFieldsTooLarge: 431,\n UnavailableForLegalReasons: 451,\n InternalServerError: 500,\n NotImplemented: 501,\n BadGateway: 502,\n ServiceUnavailable: 503,\n GatewayTimeout: 504,\n HttpVersionNotSupported: 505,\n VariantAlsoNegotiates: 506,\n InsufficientStorage: 507,\n LoopDetected: 508,\n NotExtended: 510,\n NetworkAuthenticationRequired: 511,\n};\n\nObject.entries(HttpStatusCode).forEach(([key, value]) => {\n HttpStatusCode[value] = key;\n});\n\nexport default HttpStatusCode;\n","'use strict';\n\nimport utils from './utils.js';\nimport bind from './helpers/bind.js';\nimport Axios from './core/Axios.js';\nimport mergeConfig from './core/mergeConfig.js';\nimport defaults from './defaults/index.js';\nimport formDataToJSON from './helpers/formDataToJSON.js';\nimport CanceledError from './cancel/CanceledError.js';\nimport CancelToken from './cancel/CancelToken.js';\nimport isCancel from './cancel/isCancel.js';\nimport {VERSION} from './env/data.js';\nimport toFormData from './helpers/toFormData.js';\nimport AxiosError from './core/AxiosError.js';\nimport spread from './helpers/spread.js';\nimport isAxiosError from './helpers/isAxiosError.js';\nimport AxiosHeaders from \"./core/AxiosHeaders.js\";\nimport adapters from './adapters/adapters.js';\nimport HttpStatusCode from './helpers/HttpStatusCode.js';\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n *\n * @returns {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n const context = new Axios(defaultConfig);\n const instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context, {allOwnKeys: true});\n\n // Copy context to instance\n utils.extend(instance, context, null, {allOwnKeys: true});\n\n // Factory for creating new instances\n instance.create = function create(instanceConfig) {\n return createInstance(mergeConfig(defaultConfig, instanceConfig));\n };\n\n return instance;\n}\n\n// Create the default instance to be exported\nconst axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Expose Cancel & CancelToken\naxios.CanceledError = CanceledError;\naxios.CancelToken = CancelToken;\naxios.isCancel = isCancel;\naxios.VERSION = VERSION;\naxios.toFormData = toFormData;\n\n// Expose AxiosError class\naxios.AxiosError = AxiosError;\n\n// alias for CanceledError for backward compatibility\naxios.Cancel = axios.CanceledError;\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\n\naxios.spread = spread;\n\n// Expose isAxiosError\naxios.isAxiosError = isAxiosError;\n\n// Expose mergeConfig\naxios.mergeConfig = mergeConfig;\n\naxios.AxiosHeaders = AxiosHeaders;\n\naxios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);\n\naxios.getAdapter = adapters.getAdapter;\n\naxios.HttpStatusCode = HttpStatusCode;\n\naxios.default = axios;\n\n// this module should only have a default export\nexport default axios\n"],"names":["utils","prototype","encode","URLSearchParams","FormData","Blob","platform","defaults","AxiosHeaders","validators","InterceptorManager","Axios","CancelToken","HttpStatusCode"],"mappings":";;;AAEe,SAAS,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE;AAC1C,EAAE,OAAO,SAAS,IAAI,GAAG;AACzB,IAAI,OAAO,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;AACxC,GAAG,CAAC;AACJ;;ACFA;AACA;AACA,MAAM,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC,SAAS,CAAC;AACpC,MAAM,CAAC,cAAc,CAAC,GAAG,MAAM,CAAC;AAChC;AACA,MAAM,MAAM,GAAG,CAAC,KAAK,IAAI,KAAK,IAAI;AAClC,IAAI,MAAM,GAAG,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACrC,IAAI,OAAO,KAAK,CAAC,GAA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,QAAQ,CAAC,UAAU,CAAC;AACvC;AACA,KAAK,CAAC,cAAc,GAAGa,gBAAc,CAAC;AACtC;AACA,KAAK,CAAC,OAAO,GAAG,KAAK;;;;"} \ No newline at end of file
diff --git a/node_modules/axios/dist/esm/axios.js b/node_modules/axios/dist/esm/axios.js
new file mode 100644
index 0000000..18f9a30
--- /dev/null
+++ b/node_modules/axios/dist/esm/axios.js
@@ -0,0 +1,3281 @@
+// Axios v1.6.7 Copyright (c) 2024 Matt Zabriskie and contributors
+function bind(fn, thisArg) {
+ return function wrap() {
+ return fn.apply(thisArg, arguments);
+ };
+}
+
+// utils is a library of generic helper functions non-specific to axios
+
+const {toString} = Object.prototype;
+const {getPrototypeOf} = Object;
+
+const kindOf = (cache => thing => {
+ const str = toString.call(thing);
+ return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
+})(Object.create(null));
+
+const kindOfTest = (type) => {
+ type = type.toLowerCase();
+ return (thing) => kindOf(thing) === type
+};
+
+const typeOfTest = type => thing => typeof thing === type;
+
+/**
+ * Determine if a value is an Array
+ *
+ * @param {Object} val The value to test
+ *
+ * @returns {boolean} True if value is an Array, otherwise false
+ */
+const {isArray} = Array;
+
+/**
+ * Determine if a value is undefined
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if the value is undefined, otherwise false
+ */
+const isUndefined = typeOfTest('undefined');
+
+/**
+ * Determine if a value is a Buffer
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a Buffer, otherwise false
+ */
+function isBuffer(val) {
+ return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
+ && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);
+}
+
+/**
+ * Determine if a value is an ArrayBuffer
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is an ArrayBuffer, otherwise false
+ */
+const isArrayBuffer = kindOfTest('ArrayBuffer');
+
+
+/**
+ * Determine if a value is a view on an ArrayBuffer
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
+ */
+function isArrayBufferView(val) {
+ let result;
+ if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
+ result = ArrayBuffer.isView(val);
+ } else {
+ result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));
+ }
+ return result;
+}
+
+/**
+ * Determine if a value is a String
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a String, otherwise false
+ */
+const isString = typeOfTest('string');
+
+/**
+ * Determine if a value is a Function
+ *
+ * @param {*} val The value to test
+ * @returns {boolean} True if value is a Function, otherwise false
+ */
+const isFunction = typeOfTest('function');
+
+/**
+ * Determine if a value is a Number
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a Number, otherwise false
+ */
+const isNumber = typeOfTest('number');
+
+/**
+ * Determine if a value is an Object
+ *
+ * @param {*} thing The value to test
+ *
+ * @returns {boolean} True if value is an Object, otherwise false
+ */
+const isObject = (thing) => thing !== null && typeof thing === 'object';
+
+/**
+ * Determine if a value is a Boolean
+ *
+ * @param {*} thing The value to test
+ * @returns {boolean} True if value is a Boolean, otherwise false
+ */
+const isBoolean = thing => thing === true || thing === false;
+
+/**
+ * Determine if a value is a plain Object
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a plain Object, otherwise false
+ */
+const isPlainObject = (val) => {
+ if (kindOf(val) !== 'object') {
+ return false;
+ }
+
+ const prototype = getPrototypeOf(val);
+ return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);
+};
+
+/**
+ * Determine if a value is a Date
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a Date, otherwise false
+ */
+const isDate = kindOfTest('Date');
+
+/**
+ * Determine if a value is a File
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a File, otherwise false
+ */
+const isFile = kindOfTest('File');
+
+/**
+ * Determine if a value is a Blob
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a Blob, otherwise false
+ */
+const isBlob = kindOfTest('Blob');
+
+/**
+ * Determine if a value is a FileList
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a File, otherwise false
+ */
+const isFileList = kindOfTest('FileList');
+
+/**
+ * Determine if a value is a Stream
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a Stream, otherwise false
+ */
+const isStream = (val) => isObject(val) && isFunction(val.pipe);
+
+/**
+ * Determine if a value is a FormData
+ *
+ * @param {*} thing The value to test
+ *
+ * @returns {boolean} True if value is an FormData, otherwise false
+ */
+const isFormData = (thing) => {
+ let kind;
+ return thing && (
+ (typeof FormData === 'function' && thing instanceof FormData) || (
+ isFunction(thing.append) && (
+ (kind = kindOf(thing)) === 'formdata' ||
+ // detect form-data instance
+ (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')
+ )
+ )
+ )
+};
+
+/**
+ * Determine if a value is a URLSearchParams object
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a URLSearchParams object, otherwise false
+ */
+const isURLSearchParams = kindOfTest('URLSearchParams');
+
+/**
+ * Trim excess whitespace off the beginning and end of a string
+ *
+ * @param {String} str The String to trim
+ *
+ * @returns {String} The String freed of excess whitespace
+ */
+const trim = (str) => str.trim ?
+ str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
+
+/**
+ * Iterate over an Array or an Object invoking a function for each item.
+ *
+ * If `obj` is an Array callback will be called passing
+ * the value, index, and complete array for each item.
+ *
+ * If 'obj' is an Object callback will be called passing
+ * the value, key, and complete object for each property.
+ *
+ * @param {Object|Array} obj The object to iterate
+ * @param {Function} fn The callback to invoke for each item
+ *
+ * @param {Boolean} [allOwnKeys = false]
+ * @returns {any}
+ */
+function forEach(obj, fn, {allOwnKeys = false} = {}) {
+ // Don't bother if no value provided
+ if (obj === null || typeof obj === 'undefined') {
+ return;
+ }
+
+ let i;
+ let l;
+
+ // Force an array if not already something iterable
+ if (typeof obj !== 'object') {
+ /*eslint no-param-reassign:0*/
+ obj = [obj];
+ }
+
+ if (isArray(obj)) {
+ // Iterate over array values
+ for (i = 0, l = obj.length; i < l; i++) {
+ fn.call(null, obj[i], i, obj);
+ }
+ } else {
+ // Iterate over object keys
+ const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
+ const len = keys.length;
+ let key;
+
+ for (i = 0; i < len; i++) {
+ key = keys[i];
+ fn.call(null, obj[key], key, obj);
+ }
+ }
+}
+
+function findKey(obj, key) {
+ key = key.toLowerCase();
+ const keys = Object.keys(obj);
+ let i = keys.length;
+ let _key;
+ while (i-- > 0) {
+ _key = keys[i];
+ if (key === _key.toLowerCase()) {
+ return _key;
+ }
+ }
+ return null;
+}
+
+const _global = (() => {
+ /*eslint no-undef:0*/
+ if (typeof globalThis !== "undefined") return globalThis;
+ return typeof self !== "undefined" ? self : (typeof window !== 'undefined' ? window : global)
+})();
+
+const isContextDefined = (context) => !isUndefined(context) && context !== _global;
+
+/**
+ * Accepts varargs expecting each argument to be an object, then
+ * immutably merges the properties of each object and returns result.
+ *
+ * When multiple objects contain the same key the later object in
+ * the arguments list will take precedence.
+ *
+ * Example:
+ *
+ * ```js
+ * var result = merge({foo: 123}, {foo: 456});
+ * console.log(result.foo); // outputs 456
+ * ```
+ *
+ * @param {Object} obj1 Object to merge
+ *
+ * @returns {Object} Result of all merge properties
+ */
+function merge(/* obj1, obj2, obj3, ... */) {
+ const {caseless} = isContextDefined(this) && this || {};
+ const result = {};
+ const assignValue = (val, key) => {
+ const targetKey = caseless && findKey(result, key) || key;
+ if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
+ result[targetKey] = merge(result[targetKey], val);
+ } else if (isPlainObject(val)) {
+ result[targetKey] = merge({}, val);
+ } else if (isArray(val)) {
+ result[targetKey] = val.slice();
+ } else {
+ result[targetKey] = val;
+ }
+ };
+
+ for (let i = 0, l = arguments.length; i < l; i++) {
+ arguments[i] && forEach(arguments[i], assignValue);
+ }
+ return result;
+}
+
+/**
+ * Extends object a by mutably adding to it the properties of object b.
+ *
+ * @param {Object} a The object to be extended
+ * @param {Object} b The object to copy properties from
+ * @param {Object} thisArg The object to bind function to
+ *
+ * @param {Boolean} [allOwnKeys]
+ * @returns {Object} The resulting value of object a
+ */
+const extend = (a, b, thisArg, {allOwnKeys}= {}) => {
+ forEach(b, (val, key) => {
+ if (thisArg && isFunction(val)) {
+ a[key] = bind(val, thisArg);
+ } else {
+ a[key] = val;
+ }
+ }, {allOwnKeys});
+ return a;
+};
+
+/**
+ * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
+ *
+ * @param {string} content with BOM
+ *
+ * @returns {string} content value without BOM
+ */
+const stripBOM = (content) => {
+ if (content.charCodeAt(0) === 0xFEFF) {
+ content = content.slice(1);
+ }
+ return content;
+};
+
+/**
+ * Inherit the prototype methods from one constructor into another
+ * @param {function} constructor
+ * @param {function} superConstructor
+ * @param {object} [props]
+ * @param {object} [descriptors]
+ *
+ * @returns {void}
+ */
+const inherits = (constructor, superConstructor, props, descriptors) => {
+ constructor.prototype = Object.create(superConstructor.prototype, descriptors);
+ constructor.prototype.constructor = constructor;
+ Object.defineProperty(constructor, 'super', {
+ value: superConstructor.prototype
+ });
+ props && Object.assign(constructor.prototype, props);
+};
+
+/**
+ * Resolve object with deep prototype chain to a flat object
+ * @param {Object} sourceObj source object
+ * @param {Object} [destObj]
+ * @param {Function|Boolean} [filter]
+ * @param {Function} [propFilter]
+ *
+ * @returns {Object}
+ */
+const toFlatObject = (sourceObj, destObj, filter, propFilter) => {
+ let props;
+ let i;
+ let prop;
+ const merged = {};
+
+ destObj = destObj || {};
+ // eslint-disable-next-line no-eq-null,eqeqeq
+ if (sourceObj == null) return destObj;
+
+ do {
+ props = Object.getOwnPropertyNames(sourceObj);
+ i = props.length;
+ while (i-- > 0) {
+ prop = props[i];
+ if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
+ destObj[prop] = sourceObj[prop];
+ merged[prop] = true;
+ }
+ }
+ sourceObj = filter !== false && getPrototypeOf(sourceObj);
+ } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
+
+ return destObj;
+};
+
+/**
+ * Determines whether a string ends with the characters of a specified string
+ *
+ * @param {String} str
+ * @param {String} searchString
+ * @param {Number} [position= 0]
+ *
+ * @returns {boolean}
+ */
+const endsWith = (str, searchString, position) => {
+ str = String(str);
+ if (position === undefined || position > str.length) {
+ position = str.length;
+ }
+ position -= searchString.length;
+ const lastIndex = str.indexOf(searchString, position);
+ return lastIndex !== -1 && lastIndex === position;
+};
+
+
+/**
+ * Returns new array from array like object or null if failed
+ *
+ * @param {*} [thing]
+ *
+ * @returns {?Array}
+ */
+const toArray = (thing) => {
+ if (!thing) return null;
+ if (isArray(thing)) return thing;
+ let i = thing.length;
+ if (!isNumber(i)) return null;
+ const arr = new Array(i);
+ while (i-- > 0) {
+ arr[i] = thing[i];
+ }
+ return arr;
+};
+
+/**
+ * Checking if the Uint8Array exists and if it does, it returns a function that checks if the
+ * thing passed in is an instance of Uint8Array
+ *
+ * @param {TypedArray}
+ *
+ * @returns {Array}
+ */
+// eslint-disable-next-line func-names
+const isTypedArray = (TypedArray => {
+ // eslint-disable-next-line func-names
+ return thing => {
+ return TypedArray && thing instanceof TypedArray;
+ };
+})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));
+
+/**
+ * For each entry in the object, call the function with the key and value.
+ *
+ * @param {Object<any, any>} obj - The object to iterate over.
+ * @param {Function} fn - The function to call for each entry.
+ *
+ * @returns {void}
+ */
+const forEachEntry = (obj, fn) => {
+ const generator = obj && obj[Symbol.iterator];
+
+ const iterator = generator.call(obj);
+
+ let result;
+
+ while ((result = iterator.next()) && !result.done) {
+ const pair = result.value;
+ fn.call(obj, pair[0], pair[1]);
+ }
+};
+
+/**
+ * It takes a regular expression and a string, and returns an array of all the matches
+ *
+ * @param {string} regExp - The regular expression to match against.
+ * @param {string} str - The string to search.
+ *
+ * @returns {Array<boolean>}
+ */
+const matchAll = (regExp, str) => {
+ let matches;
+ const arr = [];
+
+ while ((matches = regExp.exec(str)) !== null) {
+ arr.push(matches);
+ }
+
+ return arr;
+};
+
+/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */
+const isHTMLForm = kindOfTest('HTMLFormElement');
+
+const toCamelCase = str => {
+ return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,
+ function replacer(m, p1, p2) {
+ return p1.toUpperCase() + p2;
+ }
+ );
+};
+
+/* Creating a function that will check if an object has a property. */
+const hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);
+
+/**
+ * Determine if a value is a RegExp object
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a RegExp object, otherwise false
+ */
+const isRegExp = kindOfTest('RegExp');
+
+const reduceDescriptors = (obj, reducer) => {
+ const descriptors = Object.getOwnPropertyDescriptors(obj);
+ const reducedDescriptors = {};
+
+ forEach(descriptors, (descriptor, name) => {
+ let ret;
+ if ((ret = reducer(descriptor, name, obj)) !== false) {
+ reducedDescriptors[name] = ret || descriptor;
+ }
+ });
+
+ Object.defineProperties(obj, reducedDescriptors);
+};
+
+/**
+ * Makes all methods read-only
+ * @param {Object} obj
+ */
+
+const freezeMethods = (obj) => {
+ reduceDescriptors(obj, (descriptor, name) => {
+ // skip restricted props in strict mode
+ if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {
+ return false;
+ }
+
+ const value = obj[name];
+
+ if (!isFunction(value)) return;
+
+ descriptor.enumerable = false;
+
+ if ('writable' in descriptor) {
+ descriptor.writable = false;
+ return;
+ }
+
+ if (!descriptor.set) {
+ descriptor.set = () => {
+ throw Error('Can not rewrite read-only method \'' + name + '\'');
+ };
+ }
+ });
+};
+
+const toObjectSet = (arrayOrString, delimiter) => {
+ const obj = {};
+
+ const define = (arr) => {
+ arr.forEach(value => {
+ obj[value] = true;
+ });
+ };
+
+ isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
+
+ return obj;
+};
+
+const noop = () => {};
+
+const toFiniteNumber = (value, defaultValue) => {
+ value = +value;
+ return Number.isFinite(value) ? value : defaultValue;
+};
+
+const ALPHA = 'abcdefghijklmnopqrstuvwxyz';
+
+const DIGIT = '0123456789';
+
+const ALPHABET = {
+ DIGIT,
+ ALPHA,
+ ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
+};
+
+const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
+ let str = '';
+ const {length} = alphabet;
+ while (size--) {
+ str += alphabet[Math.random() * length|0];
+ }
+
+ return str;
+};
+
+/**
+ * If the thing is a FormData object, return true, otherwise return false.
+ *
+ * @param {unknown} thing - The thing to check.
+ *
+ * @returns {boolean}
+ */
+function isSpecCompliantForm(thing) {
+ return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]);
+}
+
+const toJSONObject = (obj) => {
+ const stack = new Array(10);
+
+ const visit = (source, i) => {
+
+ if (isObject(source)) {
+ if (stack.indexOf(source) >= 0) {
+ return;
+ }
+
+ if(!('toJSON' in source)) {
+ stack[i] = source;
+ const target = isArray(source) ? [] : {};
+
+ forEach(source, (value, key) => {
+ const reducedValue = visit(value, i + 1);
+ !isUndefined(reducedValue) && (target[key] = reducedValue);
+ });
+
+ stack[i] = undefined;
+
+ return target;
+ }
+ }
+
+ return source;
+ };
+
+ return visit(obj, 0);
+};
+
+const isAsyncFn = kindOfTest('AsyncFunction');
+
+const isThenable = (thing) =>
+ thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
+
+const utils$1 = {
+ isArray,
+ isArrayBuffer,
+ isBuffer,
+ isFormData,
+ isArrayBufferView,
+ isString,
+ isNumber,
+ isBoolean,
+ isObject,
+ isPlainObject,
+ isUndefined,
+ isDate,
+ isFile,
+ isBlob,
+ isRegExp,
+ isFunction,
+ isStream,
+ isURLSearchParams,
+ isTypedArray,
+ isFileList,
+ forEach,
+ merge,
+ extend,
+ trim,
+ stripBOM,
+ inherits,
+ toFlatObject,
+ kindOf,
+ kindOfTest,
+ endsWith,
+ toArray,
+ forEachEntry,
+ matchAll,
+ isHTMLForm,
+ hasOwnProperty,
+ hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection
+ reduceDescriptors,
+ freezeMethods,
+ toObjectSet,
+ toCamelCase,
+ noop,
+ toFiniteNumber,
+ findKey,
+ global: _global,
+ isContextDefined,
+ ALPHABET,
+ generateString,
+ isSpecCompliantForm,
+ toJSONObject,
+ isAsyncFn,
+ isThenable
+};
+
+/**
+ * Create an Error with the specified message, config, error code, request and response.
+ *
+ * @param {string} message The error message.
+ * @param {string} [code] The error code (for example, 'ECONNABORTED').
+ * @param {Object} [config] The config.
+ * @param {Object} [request] The request.
+ * @param {Object} [response] The response.
+ *
+ * @returns {Error} The created error.
+ */
+function AxiosError$1(message, code, config, request, response) {
+ Error.call(this);
+
+ if (Error.captureStackTrace) {
+ Error.captureStackTrace(this, this.constructor);
+ } else {
+ this.stack = (new Error()).stack;
+ }
+
+ this.message = message;
+ this.name = 'AxiosError';
+ code && (this.code = code);
+ config && (this.config = config);
+ request && (this.request = request);
+ response && (this.response = response);
+}
+
+utils$1.inherits(AxiosError$1, Error, {
+ toJSON: function toJSON() {
+ return {
+ // Standard
+ message: this.message,
+ name: this.name,
+ // Microsoft
+ description: this.description,
+ number: this.number,
+ // Mozilla
+ fileName: this.fileName,
+ lineNumber: this.lineNumber,
+ columnNumber: this.columnNumber,
+ stack: this.stack,
+ // Axios
+ config: utils$1.toJSONObject(this.config),
+ code: this.code,
+ status: this.response && this.response.status ? this.response.status : null
+ };
+ }
+});
+
+const prototype$1 = AxiosError$1.prototype;
+const descriptors = {};
+
+[
+ 'ERR_BAD_OPTION_VALUE',
+ 'ERR_BAD_OPTION',
+ 'ECONNABORTED',
+ 'ETIMEDOUT',
+ 'ERR_NETWORK',
+ 'ERR_FR_TOO_MANY_REDIRECTS',
+ 'ERR_DEPRECATED',
+ 'ERR_BAD_RESPONSE',
+ 'ERR_BAD_REQUEST',
+ 'ERR_CANCELED',
+ 'ERR_NOT_SUPPORT',
+ 'ERR_INVALID_URL'
+// eslint-disable-next-line func-names
+].forEach(code => {
+ descriptors[code] = {value: code};
+});
+
+Object.defineProperties(AxiosError$1, descriptors);
+Object.defineProperty(prototype$1, 'isAxiosError', {value: true});
+
+// eslint-disable-next-line func-names
+AxiosError$1.from = (error, code, config, request, response, customProps) => {
+ const axiosError = Object.create(prototype$1);
+
+ utils$1.toFlatObject(error, axiosError, function filter(obj) {
+ return obj !== Error.prototype;
+ }, prop => {
+ return prop !== 'isAxiosError';
+ });
+
+ AxiosError$1.call(axiosError, error.message, code, config, request, response);
+
+ axiosError.cause = error;
+
+ axiosError.name = error.name;
+
+ customProps && Object.assign(axiosError, customProps);
+
+ return axiosError;
+};
+
+// eslint-disable-next-line strict
+const httpAdapter = null;
+
+/**
+ * Determines if the given thing is a array or js object.
+ *
+ * @param {string} thing - The object or array to be visited.
+ *
+ * @returns {boolean}
+ */
+function isVisitable(thing) {
+ return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
+}
+
+/**
+ * It removes the brackets from the end of a string
+ *
+ * @param {string} key - The key of the parameter.
+ *
+ * @returns {string} the key without the brackets.
+ */
+function removeBrackets(key) {
+ return utils$1.endsWith(key, '[]') ? key.slice(0, -2) : key;
+}
+
+/**
+ * It takes a path, a key, and a boolean, and returns a string
+ *
+ * @param {string} path - The path to the current key.
+ * @param {string} key - The key of the current object being iterated over.
+ * @param {string} dots - If true, the key will be rendered with dots instead of brackets.
+ *
+ * @returns {string} The path to the current key.
+ */
+function renderKey(path, key, dots) {
+ if (!path) return key;
+ return path.concat(key).map(function each(token, i) {
+ // eslint-disable-next-line no-param-reassign
+ token = removeBrackets(token);
+ return !dots && i ? '[' + token + ']' : token;
+ }).join(dots ? '.' : '');
+}
+
+/**
+ * If the array is an array and none of its elements are visitable, then it's a flat array.
+ *
+ * @param {Array<any>} arr - The array to check
+ *
+ * @returns {boolean}
+ */
+function isFlatArray(arr) {
+ return utils$1.isArray(arr) && !arr.some(isVisitable);
+}
+
+const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {
+ return /^is[A-Z]/.test(prop);
+});
+
+/**
+ * Convert a data object to FormData
+ *
+ * @param {Object} obj
+ * @param {?Object} [formData]
+ * @param {?Object} [options]
+ * @param {Function} [options.visitor]
+ * @param {Boolean} [options.metaTokens = true]
+ * @param {Boolean} [options.dots = false]
+ * @param {?Boolean} [options.indexes = false]
+ *
+ * @returns {Object}
+ **/
+
+/**
+ * It converts an object into a FormData object
+ *
+ * @param {Object<any, any>} obj - The object to convert to form data.
+ * @param {string} formData - The FormData object to append to.
+ * @param {Object<string, any>} options
+ *
+ * @returns
+ */
+function toFormData$1(obj, formData, options) {
+ if (!utils$1.isObject(obj)) {
+ throw new TypeError('target must be an object');
+ }
+
+ // eslint-disable-next-line no-param-reassign
+ formData = formData || new (FormData)();
+
+ // eslint-disable-next-line no-param-reassign
+ options = utils$1.toFlatObject(options, {
+ metaTokens: true,
+ dots: false,
+ indexes: false
+ }, false, function defined(option, source) {
+ // eslint-disable-next-line no-eq-null,eqeqeq
+ return !utils$1.isUndefined(source[option]);
+ });
+
+ const metaTokens = options.metaTokens;
+ // eslint-disable-next-line no-use-before-define
+ const visitor = options.visitor || defaultVisitor;
+ const dots = options.dots;
+ const indexes = options.indexes;
+ const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;
+ const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
+
+ if (!utils$1.isFunction(visitor)) {
+ throw new TypeError('visitor must be a function');
+ }
+
+ function convertValue(value) {
+ if (value === null) return '';
+
+ if (utils$1.isDate(value)) {
+ return value.toISOString();
+ }
+
+ if (!useBlob && utils$1.isBlob(value)) {
+ throw new AxiosError$1('Blob is not supported. Use a Buffer instead.');
+ }
+
+ if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
+ return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
+ }
+
+ return value;
+ }
+
+ /**
+ * Default visitor.
+ *
+ * @param {*} value
+ * @param {String|Number} key
+ * @param {Array<String|Number>} path
+ * @this {FormData}
+ *
+ * @returns {boolean} return true to visit the each prop of the value recursively
+ */
+ function defaultVisitor(value, key, path) {
+ let arr = value;
+
+ if (value && !path && typeof value === 'object') {
+ if (utils$1.endsWith(key, '{}')) {
+ // eslint-disable-next-line no-param-reassign
+ key = metaTokens ? key : key.slice(0, -2);
+ // eslint-disable-next-line no-param-reassign
+ value = JSON.stringify(value);
+ } else if (
+ (utils$1.isArray(value) && isFlatArray(value)) ||
+ ((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value))
+ )) {
+ // eslint-disable-next-line no-param-reassign
+ key = removeBrackets(key);
+
+ arr.forEach(function each(el, index) {
+ !(utils$1.isUndefined(el) || el === null) && formData.append(
+ // eslint-disable-next-line no-nested-ternary
+ indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),
+ convertValue(el)
+ );
+ });
+ return false;
+ }
+ }
+
+ if (isVisitable(value)) {
+ return true;
+ }
+
+ formData.append(renderKey(path, key, dots), convertValue(value));
+
+ return false;
+ }
+
+ const stack = [];
+
+ const exposedHelpers = Object.assign(predicates, {
+ defaultVisitor,
+ convertValue,
+ isVisitable
+ });
+
+ function build(value, path) {
+ if (utils$1.isUndefined(value)) return;
+
+ if (stack.indexOf(value) !== -1) {
+ throw Error('Circular reference detected in ' + path.join('.'));
+ }
+
+ stack.push(value);
+
+ utils$1.forEach(value, function each(el, key) {
+ const result = !(utils$1.isUndefined(el) || el === null) && visitor.call(
+ formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers
+ );
+
+ if (result === true) {
+ build(el, path ? path.concat(key) : [key]);
+ }
+ });
+
+ stack.pop();
+ }
+
+ if (!utils$1.isObject(obj)) {
+ throw new TypeError('data must be an object');
+ }
+
+ build(obj);
+
+ return formData;
+}
+
+/**
+ * It encodes a string by replacing all characters that are not in the unreserved set with
+ * their percent-encoded equivalents
+ *
+ * @param {string} str - The string to encode.
+ *
+ * @returns {string} The encoded string.
+ */
+function encode$1(str) {
+ const charMap = {
+ '!': '%21',
+ "'": '%27',
+ '(': '%28',
+ ')': '%29',
+ '~': '%7E',
+ '%20': '+',
+ '%00': '\x00'
+ };
+ return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {
+ return charMap[match];
+ });
+}
+
+/**
+ * It takes a params object and converts it to a FormData object
+ *
+ * @param {Object<string, any>} params - The parameters to be converted to a FormData object.
+ * @param {Object<string, any>} options - The options object passed to the Axios constructor.
+ *
+ * @returns {void}
+ */
+function AxiosURLSearchParams(params, options) {
+ this._pairs = [];
+
+ params && toFormData$1(params, this, options);
+}
+
+const prototype = AxiosURLSearchParams.prototype;
+
+prototype.append = function append(name, value) {
+ this._pairs.push([name, value]);
+};
+
+prototype.toString = function toString(encoder) {
+ const _encode = encoder ? function(value) {
+ return encoder.call(this, value, encode$1);
+ } : encode$1;
+
+ return this._pairs.map(function each(pair) {
+ return _encode(pair[0]) + '=' + _encode(pair[1]);
+ }, '').join('&');
+};
+
+/**
+ * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their
+ * URI encoded counterparts
+ *
+ * @param {string} val The value to be encoded.
+ *
+ * @returns {string} The encoded value.
+ */
+function encode(val) {
+ return encodeURIComponent(val).
+ replace(/%3A/gi, ':').
+ replace(/%24/g, '$').
+ replace(/%2C/gi, ',').
+ replace(/%20/g, '+').
+ replace(/%5B/gi, '[').
+ replace(/%5D/gi, ']');
+}
+
+/**
+ * Build a URL by appending params to the end
+ *
+ * @param {string} url The base of the url (e.g., http://www.google.com)
+ * @param {object} [params] The params to be appended
+ * @param {?object} options
+ *
+ * @returns {string} The formatted url
+ */
+function buildURL(url, params, options) {
+ /*eslint no-param-reassign:0*/
+ if (!params) {
+ return url;
+ }
+
+ const _encode = options && options.encode || encode;
+
+ const serializeFn = options && options.serialize;
+
+ let serializedParams;
+
+ if (serializeFn) {
+ serializedParams = serializeFn(params, options);
+ } else {
+ serializedParams = utils$1.isURLSearchParams(params) ?
+ params.toString() :
+ new AxiosURLSearchParams(params, options).toString(_encode);
+ }
+
+ if (serializedParams) {
+ const hashmarkIndex = url.indexOf("#");
+
+ if (hashmarkIndex !== -1) {
+ url = url.slice(0, hashmarkIndex);
+ }
+ url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
+ }
+
+ return url;
+}
+
+class InterceptorManager {
+ constructor() {
+ this.handlers = [];
+ }
+
+ /**
+ * Add a new interceptor to the stack
+ *
+ * @param {Function} fulfilled The function to handle `then` for a `Promise`
+ * @param {Function} rejected The function to handle `reject` for a `Promise`
+ *
+ * @return {Number} An ID used to remove interceptor later
+ */
+ use(fulfilled, rejected, options) {
+ this.handlers.push({
+ fulfilled,
+ rejected,
+ synchronous: options ? options.synchronous : false,
+ runWhen: options ? options.runWhen : null
+ });
+ return this.handlers.length - 1;
+ }
+
+ /**
+ * Remove an interceptor from the stack
+ *
+ * @param {Number} id The ID that was returned by `use`
+ *
+ * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
+ */
+ eject(id) {
+ if (this.handlers[id]) {
+ this.handlers[id] = null;
+ }
+ }
+
+ /**
+ * Clear all interceptors from the stack
+ *
+ * @returns {void}
+ */
+ clear() {
+ if (this.handlers) {
+ this.handlers = [];
+ }
+ }
+
+ /**
+ * Iterate over all the registered interceptors
+ *
+ * This method is particularly useful for skipping over any
+ * interceptors that may have become `null` calling `eject`.
+ *
+ * @param {Function} fn The function to call for each interceptor
+ *
+ * @returns {void}
+ */
+ forEach(fn) {
+ utils$1.forEach(this.handlers, function forEachHandler(h) {
+ if (h !== null) {
+ fn(h);
+ }
+ });
+ }
+}
+
+const InterceptorManager$1 = InterceptorManager;
+
+const transitionalDefaults = {
+ silentJSONParsing: true,
+ forcedJSONParsing: true,
+ clarifyTimeoutError: false
+};
+
+const URLSearchParams$1 = typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;
+
+const FormData$1 = typeof FormData !== 'undefined' ? FormData : null;
+
+const Blob$1 = typeof Blob !== 'undefined' ? Blob : null;
+
+const platform$1 = {
+ isBrowser: true,
+ classes: {
+ URLSearchParams: URLSearchParams$1,
+ FormData: FormData$1,
+ Blob: Blob$1
+ },
+ protocols: ['http', 'https', 'file', 'blob', 'url', 'data']
+};
+
+const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
+
+/**
+ * Determine if we're running in a standard browser environment
+ *
+ * This allows axios to run in a web worker, and react-native.
+ * Both environments support XMLHttpRequest, but not fully standard globals.
+ *
+ * web workers:
+ * typeof window -> undefined
+ * typeof document -> undefined
+ *
+ * react-native:
+ * navigator.product -> 'ReactNative'
+ * nativescript
+ * navigator.product -> 'NativeScript' or 'NS'
+ *
+ * @returns {boolean}
+ */
+const hasStandardBrowserEnv = (
+ (product) => {
+ return hasBrowserEnv && ['ReactNative', 'NativeScript', 'NS'].indexOf(product) < 0
+ })(typeof navigator !== 'undefined' && navigator.product);
+
+/**
+ * Determine if we're running in a standard browser webWorker environment
+ *
+ * Although the `isStandardBrowserEnv` method indicates that
+ * `allows axios to run in a web worker`, the WebWorker will still be
+ * filtered out due to its judgment standard
+ * `typeof window !== 'undefined' && typeof document !== 'undefined'`.
+ * This leads to a problem when axios post `FormData` in webWorker
+ */
+const hasStandardBrowserWebWorkerEnv = (() => {
+ return (
+ typeof WorkerGlobalScope !== 'undefined' &&
+ // eslint-disable-next-line no-undef
+ self instanceof WorkerGlobalScope &&
+ typeof self.importScripts === 'function'
+ );
+})();
+
+const utils = /*#__PURE__*/Object.freeze({
+ __proto__: null,
+ hasBrowserEnv: hasBrowserEnv,
+ hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
+ hasStandardBrowserEnv: hasStandardBrowserEnv
+});
+
+const platform = {
+ ...utils,
+ ...platform$1
+};
+
+function toURLEncodedForm(data, options) {
+ return toFormData$1(data, new platform.classes.URLSearchParams(), Object.assign({
+ visitor: function(value, key, path, helpers) {
+ if (platform.isNode && utils$1.isBuffer(value)) {
+ this.append(key, value.toString('base64'));
+ return false;
+ }
+
+ return helpers.defaultVisitor.apply(this, arguments);
+ }
+ }, options));
+}
+
+/**
+ * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']
+ *
+ * @param {string} name - The name of the property to get.
+ *
+ * @returns An array of strings.
+ */
+function parsePropPath(name) {
+ // foo[x][y][z]
+ // foo.x.y.z
+ // foo-x-y-z
+ // foo x y z
+ return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map(match => {
+ return match[0] === '[]' ? '' : match[1] || match[0];
+ });
+}
+
+/**
+ * Convert an array to an object.
+ *
+ * @param {Array<any>} arr - The array to convert to an object.
+ *
+ * @returns An object with the same keys and values as the array.
+ */
+function arrayToObject(arr) {
+ const obj = {};
+ const keys = Object.keys(arr);
+ let i;
+ const len = keys.length;
+ let key;
+ for (i = 0; i < len; i++) {
+ key = keys[i];
+ obj[key] = arr[key];
+ }
+ return obj;
+}
+
+/**
+ * It takes a FormData object and returns a JavaScript object
+ *
+ * @param {string} formData The FormData object to convert to JSON.
+ *
+ * @returns {Object<string, any> | null} The converted object.
+ */
+function formDataToJSON(formData) {
+ function buildPath(path, value, target, index) {
+ let name = path[index++];
+
+ if (name === '__proto__') return true;
+
+ const isNumericKey = Number.isFinite(+name);
+ const isLast = index >= path.length;
+ name = !name && utils$1.isArray(target) ? target.length : name;
+
+ if (isLast) {
+ if (utils$1.hasOwnProp(target, name)) {
+ target[name] = [target[name], value];
+ } else {
+ target[name] = value;
+ }
+
+ return !isNumericKey;
+ }
+
+ if (!target[name] || !utils$1.isObject(target[name])) {
+ target[name] = [];
+ }
+
+ const result = buildPath(path, value, target[name], index);
+
+ if (result && utils$1.isArray(target[name])) {
+ target[name] = arrayToObject(target[name]);
+ }
+
+ return !isNumericKey;
+ }
+
+ if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
+ const obj = {};
+
+ utils$1.forEachEntry(formData, (name, value) => {
+ buildPath(parsePropPath(name), value, obj, 0);
+ });
+
+ return obj;
+ }
+
+ return null;
+}
+
+/**
+ * It takes a string, tries to parse it, and if it fails, it returns the stringified version
+ * of the input
+ *
+ * @param {any} rawValue - The value to be stringified.
+ * @param {Function} parser - A function that parses a string into a JavaScript object.
+ * @param {Function} encoder - A function that takes a value and returns a string.
+ *
+ * @returns {string} A stringified version of the rawValue.
+ */
+function stringifySafely(rawValue, parser, encoder) {
+ if (utils$1.isString(rawValue)) {
+ try {
+ (parser || JSON.parse)(rawValue);
+ return utils$1.trim(rawValue);
+ } catch (e) {
+ if (e.name !== 'SyntaxError') {
+ throw e;
+ }
+ }
+ }
+
+ return (encoder || JSON.stringify)(rawValue);
+}
+
+const defaults = {
+
+ transitional: transitionalDefaults,
+
+ adapter: ['xhr', 'http'],
+
+ transformRequest: [function transformRequest(data, headers) {
+ const contentType = headers.getContentType() || '';
+ const hasJSONContentType = contentType.indexOf('application/json') > -1;
+ const isObjectPayload = utils$1.isObject(data);
+
+ if (isObjectPayload && utils$1.isHTMLForm(data)) {
+ data = new FormData(data);
+ }
+
+ const isFormData = utils$1.isFormData(data);
+
+ if (isFormData) {
+ return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
+ }
+
+ if (utils$1.isArrayBuffer(data) ||
+ utils$1.isBuffer(data) ||
+ utils$1.isStream(data) ||
+ utils$1.isFile(data) ||
+ utils$1.isBlob(data)
+ ) {
+ return data;
+ }
+ if (utils$1.isArrayBufferView(data)) {
+ return data.buffer;
+ }
+ if (utils$1.isURLSearchParams(data)) {
+ headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
+ return data.toString();
+ }
+
+ let isFileList;
+
+ if (isObjectPayload) {
+ if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {
+ return toURLEncodedForm(data, this.formSerializer).toString();
+ }
+
+ if ((isFileList = utils$1.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {
+ const _FormData = this.env && this.env.FormData;
+
+ return toFormData$1(
+ isFileList ? {'files[]': data} : data,
+ _FormData && new _FormData(),
+ this.formSerializer
+ );
+ }
+ }
+
+ if (isObjectPayload || hasJSONContentType ) {
+ headers.setContentType('application/json', false);
+ return stringifySafely(data);
+ }
+
+ return data;
+ }],
+
+ transformResponse: [function transformResponse(data) {
+ const transitional = this.transitional || defaults.transitional;
+ const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
+ const JSONRequested = this.responseType === 'json';
+
+ if (data && utils$1.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {
+ const silentJSONParsing = transitional && transitional.silentJSONParsing;
+ const strictJSONParsing = !silentJSONParsing && JSONRequested;
+
+ try {
+ return JSON.parse(data);
+ } catch (e) {
+ if (strictJSONParsing) {
+ if (e.name === 'SyntaxError') {
+ throw AxiosError$1.from(e, AxiosError$1.ERR_BAD_RESPONSE, this, null, this.response);
+ }
+ throw e;
+ }
+ }
+ }
+
+ return data;
+ }],
+
+ /**
+ * A timeout in milliseconds to abort a request. If set to 0 (default) a
+ * timeout is not created.
+ */
+ timeout: 0,
+
+ xsrfCookieName: 'XSRF-TOKEN',
+ xsrfHeaderName: 'X-XSRF-TOKEN',
+
+ maxContentLength: -1,
+ maxBodyLength: -1,
+
+ env: {
+ FormData: platform.classes.FormData,
+ Blob: platform.classes.Blob
+ },
+
+ validateStatus: function validateStatus(status) {
+ return status >= 200 && status < 300;
+ },
+
+ headers: {
+ common: {
+ 'Accept': 'application/json, text/plain, */*',
+ 'Content-Type': undefined
+ }
+ }
+};
+
+utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {
+ defaults.headers[method] = {};
+});
+
+const defaults$1 = defaults;
+
+// RawAxiosHeaders whose duplicates are ignored by node
+// c.f. https://nodejs.org/api/http.html#http_message_headers
+const ignoreDuplicateOf = utils$1.toObjectSet([
+ 'age', 'authorization', 'content-length', 'content-type', 'etag',
+ 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
+ 'last-modified', 'location', 'max-forwards', 'proxy-authorization',
+ 'referer', 'retry-after', 'user-agent'
+]);
+
+/**
+ * Parse headers into an object
+ *
+ * ```
+ * Date: Wed, 27 Aug 2014 08:58:49 GMT
+ * Content-Type: application/json
+ * Connection: keep-alive
+ * Transfer-Encoding: chunked
+ * ```
+ *
+ * @param {String} rawHeaders Headers needing to be parsed
+ *
+ * @returns {Object} Headers parsed into an object
+ */
+const parseHeaders = rawHeaders => {
+ const parsed = {};
+ let key;
+ let val;
+ let i;
+
+ rawHeaders && rawHeaders.split('\n').forEach(function parser(line) {
+ i = line.indexOf(':');
+ key = line.substring(0, i).trim().toLowerCase();
+ val = line.substring(i + 1).trim();
+
+ if (!key || (parsed[key] && ignoreDuplicateOf[key])) {
+ return;
+ }
+
+ if (key === 'set-cookie') {
+ if (parsed[key]) {
+ parsed[key].push(val);
+ } else {
+ parsed[key] = [val];
+ }
+ } else {
+ parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
+ }
+ });
+
+ return parsed;
+};
+
+const $internals = Symbol('internals');
+
+function normalizeHeader(header) {
+ return header && String(header).trim().toLowerCase();
+}
+
+function normalizeValue(value) {
+ if (value === false || value == null) {
+ return value;
+ }
+
+ return utils$1.isArray(value) ? value.map(normalizeValue) : String(value);
+}
+
+function parseTokens(str) {
+ const tokens = Object.create(null);
+ const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
+ let match;
+
+ while ((match = tokensRE.exec(str))) {
+ tokens[match[1]] = match[2];
+ }
+
+ return tokens;
+}
+
+const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
+
+function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
+ if (utils$1.isFunction(filter)) {
+ return filter.call(this, value, header);
+ }
+
+ if (isHeaderNameFilter) {
+ value = header;
+ }
+
+ if (!utils$1.isString(value)) return;
+
+ if (utils$1.isString(filter)) {
+ return value.indexOf(filter) !== -1;
+ }
+
+ if (utils$1.isRegExp(filter)) {
+ return filter.test(value);
+ }
+}
+
+function formatHeader(header) {
+ return header.trim()
+ .toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => {
+ return char.toUpperCase() + str;
+ });
+}
+
+function buildAccessors(obj, header) {
+ const accessorName = utils$1.toCamelCase(' ' + header);
+
+ ['get', 'set', 'has'].forEach(methodName => {
+ Object.defineProperty(obj, methodName + accessorName, {
+ value: function(arg1, arg2, arg3) {
+ return this[methodName].call(this, header, arg1, arg2, arg3);
+ },
+ configurable: true
+ });
+ });
+}
+
+class AxiosHeaders$1 {
+ constructor(headers) {
+ headers && this.set(headers);
+ }
+
+ set(header, valueOrRewrite, rewrite) {
+ const self = this;
+
+ function setHeader(_value, _header, _rewrite) {
+ const lHeader = normalizeHeader(_header);
+
+ if (!lHeader) {
+ throw new Error('header name must be a non-empty string');
+ }
+
+ const key = utils$1.findKey(self, lHeader);
+
+ if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {
+ self[key || _header] = normalizeValue(_value);
+ }
+ }
+
+ const setHeaders = (headers, _rewrite) =>
+ utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
+
+ if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
+ setHeaders(header, valueOrRewrite);
+ } else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
+ setHeaders(parseHeaders(header), valueOrRewrite);
+ } else {
+ header != null && setHeader(valueOrRewrite, header, rewrite);
+ }
+
+ return this;
+ }
+
+ get(header, parser) {
+ header = normalizeHeader(header);
+
+ if (header) {
+ const key = utils$1.findKey(this, header);
+
+ if (key) {
+ const value = this[key];
+
+ if (!parser) {
+ return value;
+ }
+
+ if (parser === true) {
+ return parseTokens(value);
+ }
+
+ if (utils$1.isFunction(parser)) {
+ return parser.call(this, value, key);
+ }
+
+ if (utils$1.isRegExp(parser)) {
+ return parser.exec(value);
+ }
+
+ throw new TypeError('parser must be boolean|regexp|function');
+ }
+ }
+ }
+
+ has(header, matcher) {
+ header = normalizeHeader(header);
+
+ if (header) {
+ const key = utils$1.findKey(this, header);
+
+ return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
+ }
+
+ return false;
+ }
+
+ delete(header, matcher) {
+ const self = this;
+ let deleted = false;
+
+ function deleteHeader(_header) {
+ _header = normalizeHeader(_header);
+
+ if (_header) {
+ const key = utils$1.findKey(self, _header);
+
+ if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {
+ delete self[key];
+
+ deleted = true;
+ }
+ }
+ }
+
+ if (utils$1.isArray(header)) {
+ header.forEach(deleteHeader);
+ } else {
+ deleteHeader(header);
+ }
+
+ return deleted;
+ }
+
+ clear(matcher) {
+ const keys = Object.keys(this);
+ let i = keys.length;
+ let deleted = false;
+
+ while (i--) {
+ const key = keys[i];
+ if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
+ delete this[key];
+ deleted = true;
+ }
+ }
+
+ return deleted;
+ }
+
+ normalize(format) {
+ const self = this;
+ const headers = {};
+
+ utils$1.forEach(this, (value, header) => {
+ const key = utils$1.findKey(headers, header);
+
+ if (key) {
+ self[key] = normalizeValue(value);
+ delete self[header];
+ return;
+ }
+
+ const normalized = format ? formatHeader(header) : String(header).trim();
+
+ if (normalized !== header) {
+ delete self[header];
+ }
+
+ self[normalized] = normalizeValue(value);
+
+ headers[normalized] = true;
+ });
+
+ return this;
+ }
+
+ concat(...targets) {
+ return this.constructor.concat(this, ...targets);
+ }
+
+ toJSON(asStrings) {
+ const obj = Object.create(null);
+
+ utils$1.forEach(this, (value, header) => {
+ value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value);
+ });
+
+ return obj;
+ }
+
+ [Symbol.iterator]() {
+ return Object.entries(this.toJSON())[Symbol.iterator]();
+ }
+
+ toString() {
+ return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n');
+ }
+
+ get [Symbol.toStringTag]() {
+ return 'AxiosHeaders';
+ }
+
+ static from(thing) {
+ return thing instanceof this ? thing : new this(thing);
+ }
+
+ static concat(first, ...targets) {
+ const computed = new this(first);
+
+ targets.forEach((target) => computed.set(target));
+
+ return computed;
+ }
+
+ static accessor(header) {
+ const internals = this[$internals] = (this[$internals] = {
+ accessors: {}
+ });
+
+ const accessors = internals.accessors;
+ const prototype = this.prototype;
+
+ function defineAccessor(_header) {
+ const lHeader = normalizeHeader(_header);
+
+ if (!accessors[lHeader]) {
+ buildAccessors(prototype, _header);
+ accessors[lHeader] = true;
+ }
+ }
+
+ utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
+
+ return this;
+ }
+}
+
+AxiosHeaders$1.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
+
+// reserved names hotfix
+utils$1.reduceDescriptors(AxiosHeaders$1.prototype, ({value}, key) => {
+ let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
+ return {
+ get: () => value,
+ set(headerValue) {
+ this[mapped] = headerValue;
+ }
+ }
+});
+
+utils$1.freezeMethods(AxiosHeaders$1);
+
+const AxiosHeaders$2 = AxiosHeaders$1;
+
+/**
+ * Transform the data for a request or a response
+ *
+ * @param {Array|Function} fns A single function or Array of functions
+ * @param {?Object} response The response object
+ *
+ * @returns {*} The resulting transformed data
+ */
+function transformData(fns, response) {
+ const config = this || defaults$1;
+ const context = response || config;
+ const headers = AxiosHeaders$2.from(context.headers);
+ let data = context.data;
+
+ utils$1.forEach(fns, function transform(fn) {
+ data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);
+ });
+
+ headers.normalize();
+
+ return data;
+}
+
+function isCancel$1(value) {
+ return !!(value && value.__CANCEL__);
+}
+
+/**
+ * A `CanceledError` is an object that is thrown when an operation is canceled.
+ *
+ * @param {string=} message The message.
+ * @param {Object=} config The config.
+ * @param {Object=} request The request.
+ *
+ * @returns {CanceledError} The created error.
+ */
+function CanceledError$1(message, config, request) {
+ // eslint-disable-next-line no-eq-null,eqeqeq
+ AxiosError$1.call(this, message == null ? 'canceled' : message, AxiosError$1.ERR_CANCELED, config, request);
+ this.name = 'CanceledError';
+}
+
+utils$1.inherits(CanceledError$1, AxiosError$1, {
+ __CANCEL__: true
+});
+
+/**
+ * Resolve or reject a Promise based on response status.
+ *
+ * @param {Function} resolve A function that resolves the promise.
+ * @param {Function} reject A function that rejects the promise.
+ * @param {object} response The response.
+ *
+ * @returns {object} The response.
+ */
+function settle(resolve, reject, response) {
+ const validateStatus = response.config.validateStatus;
+ if (!response.status || !validateStatus || validateStatus(response.status)) {
+ resolve(response);
+ } else {
+ reject(new AxiosError$1(
+ 'Request failed with status code ' + response.status,
+ [AxiosError$1.ERR_BAD_REQUEST, AxiosError$1.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
+ response.config,
+ response.request,
+ response
+ ));
+ }
+}
+
+const cookies = platform.hasStandardBrowserEnv ?
+
+ // Standard browser envs support document.cookie
+ {
+ write(name, value, expires, path, domain, secure) {
+ const cookie = [name + '=' + encodeURIComponent(value)];
+
+ utils$1.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());
+
+ utils$1.isString(path) && cookie.push('path=' + path);
+
+ utils$1.isString(domain) && cookie.push('domain=' + domain);
+
+ secure === true && cookie.push('secure');
+
+ document.cookie = cookie.join('; ');
+ },
+
+ read(name) {
+ const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
+ return (match ? decodeURIComponent(match[3]) : null);
+ },
+
+ remove(name) {
+ this.write(name, '', Date.now() - 86400000);
+ }
+ }
+
+ :
+
+ // Non-standard browser env (web workers, react-native) lack needed support.
+ {
+ write() {},
+ read() {
+ return null;
+ },
+ remove() {}
+ };
+
+/**
+ * Determines whether the specified URL is absolute
+ *
+ * @param {string} url The URL to test
+ *
+ * @returns {boolean} True if the specified URL is absolute, otherwise false
+ */
+function isAbsoluteURL(url) {
+ // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
+ // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
+ // by any combination of letters, digits, plus, period, or hyphen.
+ return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
+}
+
+/**
+ * Creates a new URL by combining the specified URLs
+ *
+ * @param {string} baseURL The base URL
+ * @param {string} relativeURL The relative URL
+ *
+ * @returns {string} The combined URL
+ */
+function combineURLs(baseURL, relativeURL) {
+ return relativeURL
+ ? baseURL.replace(/\/?\/$/, '') + '/' + relativeURL.replace(/^\/+/, '')
+ : baseURL;
+}
+
+/**
+ * Creates a new URL by combining the baseURL with the requestedURL,
+ * only when the requestedURL is not already an absolute URL.
+ * If the requestURL is absolute, this function returns the requestedURL untouched.
+ *
+ * @param {string} baseURL The base URL
+ * @param {string} requestedURL Absolute or relative URL to combine
+ *
+ * @returns {string} The combined full path
+ */
+function buildFullPath(baseURL, requestedURL) {
+ if (baseURL && !isAbsoluteURL(requestedURL)) {
+ return combineURLs(baseURL, requestedURL);
+ }
+ return requestedURL;
+}
+
+const isURLSameOrigin = platform.hasStandardBrowserEnv ?
+
+// Standard browser envs have full support of the APIs needed to test
+// whether the request URL is of the same origin as current location.
+ (function standardBrowserEnv() {
+ const msie = /(msie|trident)/i.test(navigator.userAgent);
+ const urlParsingNode = document.createElement('a');
+ let originURL;
+
+ /**
+ * Parse a URL to discover its components
+ *
+ * @param {String} url The URL to be parsed
+ * @returns {Object}
+ */
+ function resolveURL(url) {
+ let href = url;
+
+ if (msie) {
+ // IE needs attribute set twice to normalize properties
+ urlParsingNode.setAttribute('href', href);
+ href = urlParsingNode.href;
+ }
+
+ urlParsingNode.setAttribute('href', href);
+
+ // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
+ return {
+ href: urlParsingNode.href,
+ protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
+ host: urlParsingNode.host,
+ search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
+ hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
+ hostname: urlParsingNode.hostname,
+ port: urlParsingNode.port,
+ pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
+ urlParsingNode.pathname :
+ '/' + urlParsingNode.pathname
+ };
+ }
+
+ originURL = resolveURL(window.location.href);
+
+ /**
+ * Determine if a URL shares the same origin as the current location
+ *
+ * @param {String} requestURL The URL to test
+ * @returns {boolean} True if URL shares the same origin, otherwise false
+ */
+ return function isURLSameOrigin(requestURL) {
+ const parsed = (utils$1.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
+ return (parsed.protocol === originURL.protocol &&
+ parsed.host === originURL.host);
+ };
+ })() :
+
+ // Non standard browser envs (web workers, react-native) lack needed support.
+ (function nonStandardBrowserEnv() {
+ return function isURLSameOrigin() {
+ return true;
+ };
+ })();
+
+function parseProtocol(url) {
+ const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
+ return match && match[1] || '';
+}
+
+/**
+ * Calculate data maxRate
+ * @param {Number} [samplesCount= 10]
+ * @param {Number} [min= 1000]
+ * @returns {Function}
+ */
+function speedometer(samplesCount, min) {
+ samplesCount = samplesCount || 10;
+ const bytes = new Array(samplesCount);
+ const timestamps = new Array(samplesCount);
+ let head = 0;
+ let tail = 0;
+ let firstSampleTS;
+
+ min = min !== undefined ? min : 1000;
+
+ return function push(chunkLength) {
+ const now = Date.now();
+
+ const startedAt = timestamps[tail];
+
+ if (!firstSampleTS) {
+ firstSampleTS = now;
+ }
+
+ bytes[head] = chunkLength;
+ timestamps[head] = now;
+
+ let i = tail;
+ let bytesCount = 0;
+
+ while (i !== head) {
+ bytesCount += bytes[i++];
+ i = i % samplesCount;
+ }
+
+ head = (head + 1) % samplesCount;
+
+ if (head === tail) {
+ tail = (tail + 1) % samplesCount;
+ }
+
+ if (now - firstSampleTS < min) {
+ return;
+ }
+
+ const passed = startedAt && now - startedAt;
+
+ return passed ? Math.round(bytesCount * 1000 / passed) : undefined;
+ };
+}
+
+function progressEventReducer(listener, isDownloadStream) {
+ let bytesNotified = 0;
+ const _speedometer = speedometer(50, 250);
+
+ return e => {
+ const loaded = e.loaded;
+ const total = e.lengthComputable ? e.total : undefined;
+ const progressBytes = loaded - bytesNotified;
+ const rate = _speedometer(progressBytes);
+ const inRange = loaded <= total;
+
+ bytesNotified = loaded;
+
+ const data = {
+ loaded,
+ total,
+ progress: total ? (loaded / total) : undefined,
+ bytes: progressBytes,
+ rate: rate ? rate : undefined,
+ estimated: rate && total && inRange ? (total - loaded) / rate : undefined,
+ event: e
+ };
+
+ data[isDownloadStream ? 'download' : 'upload'] = true;
+
+ listener(data);
+ };
+}
+
+const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
+
+const xhrAdapter = isXHRAdapterSupported && function (config) {
+ return new Promise(function dispatchXhrRequest(resolve, reject) {
+ let requestData = config.data;
+ const requestHeaders = AxiosHeaders$2.from(config.headers).normalize();
+ let {responseType, withXSRFToken} = config;
+ let onCanceled;
+ function done() {
+ if (config.cancelToken) {
+ config.cancelToken.unsubscribe(onCanceled);
+ }
+
+ if (config.signal) {
+ config.signal.removeEventListener('abort', onCanceled);
+ }
+ }
+
+ let contentType;
+
+ if (utils$1.isFormData(requestData)) {
+ if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
+ requestHeaders.setContentType(false); // Let the browser set it
+ } else if ((contentType = requestHeaders.getContentType()) !== false) {
+ // fix semicolon duplication issue for ReactNative FormData implementation
+ const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];
+ requestHeaders.setContentType([type || 'multipart/form-data', ...tokens].join('; '));
+ }
+ }
+
+ let request = new XMLHttpRequest();
+
+ // HTTP basic authentication
+ if (config.auth) {
+ const username = config.auth.username || '';
+ const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';
+ requestHeaders.set('Authorization', 'Basic ' + btoa(username + ':' + password));
+ }
+
+ const fullPath = buildFullPath(config.baseURL, config.url);
+
+ request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
+
+ // Set the request timeout in MS
+ request.timeout = config.timeout;
+
+ function onloadend() {
+ if (!request) {
+ return;
+ }
+ // Prepare the response
+ const responseHeaders = AxiosHeaders$2.from(
+ 'getAllResponseHeaders' in request && request.getAllResponseHeaders()
+ );
+ const responseData = !responseType || responseType === 'text' || responseType === 'json' ?
+ request.responseText : request.response;
+ const response = {
+ data: responseData,
+ status: request.status,
+ statusText: request.statusText,
+ headers: responseHeaders,
+ config,
+ request
+ };
+
+ settle(function _resolve(value) {
+ resolve(value);
+ done();
+ }, function _reject(err) {
+ reject(err);
+ done();
+ }, response);
+
+ // Clean up request
+ request = null;
+ }
+
+ if ('onloadend' in request) {
+ // Use onloadend if available
+ request.onloadend = onloadend;
+ } else {
+ // Listen for ready state to emulate onloadend
+ request.onreadystatechange = function handleLoad() {
+ if (!request || request.readyState !== 4) {
+ return;
+ }
+
+ // The request errored out and we didn't get a response, this will be
+ // handled by onerror instead
+ // With one exception: request that using file: protocol, most browsers
+ // will return status as 0 even though it's a successful request
+ if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
+ return;
+ }
+ // readystate handler is calling before onerror or ontimeout handlers,
+ // so we should call onloadend on the next 'tick'
+ setTimeout(onloadend);
+ };
+ }
+
+ // Handle browser request cancellation (as opposed to a manual cancellation)
+ request.onabort = function handleAbort() {
+ if (!request) {
+ return;
+ }
+
+ reject(new AxiosError$1('Request aborted', AxiosError$1.ECONNABORTED, config, request));
+
+ // Clean up request
+ request = null;
+ };
+
+ // Handle low level network errors
+ request.onerror = function handleError() {
+ // Real errors are hidden from us by the browser
+ // onerror should only fire if it's a network error
+ reject(new AxiosError$1('Network Error', AxiosError$1.ERR_NETWORK, config, request));
+
+ // Clean up request
+ request = null;
+ };
+
+ // Handle timeout
+ request.ontimeout = function handleTimeout() {
+ let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';
+ const transitional = config.transitional || transitionalDefaults;
+ if (config.timeoutErrorMessage) {
+ timeoutErrorMessage = config.timeoutErrorMessage;
+ }
+ reject(new AxiosError$1(
+ timeoutErrorMessage,
+ transitional.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED,
+ config,
+ request));
+
+ // Clean up request
+ request = null;
+ };
+
+ // Add xsrf header
+ // This is only done if running in a standard browser environment.
+ // Specifically not if we're in a web worker, or react-native.
+ if(platform.hasStandardBrowserEnv) {
+ withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config));
+
+ if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(fullPath))) {
+ // Add xsrf header
+ const xsrfValue = config.xsrfHeaderName && config.xsrfCookieName && cookies.read(config.xsrfCookieName);
+
+ if (xsrfValue) {
+ requestHeaders.set(config.xsrfHeaderName, xsrfValue);
+ }
+ }
+ }
+
+ // Remove Content-Type if data is undefined
+ requestData === undefined && requestHeaders.setContentType(null);
+
+ // Add headers to the request
+ if ('setRequestHeader' in request) {
+ utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
+ request.setRequestHeader(key, val);
+ });
+ }
+
+ // Add withCredentials to request if needed
+ if (!utils$1.isUndefined(config.withCredentials)) {
+ request.withCredentials = !!config.withCredentials;
+ }
+
+ // Add responseType to request if needed
+ if (responseType && responseType !== 'json') {
+ request.responseType = config.responseType;
+ }
+
+ // Handle progress if needed
+ if (typeof config.onDownloadProgress === 'function') {
+ request.addEventListener('progress', progressEventReducer(config.onDownloadProgress, true));
+ }
+
+ // Not all browsers support upload events
+ if (typeof config.onUploadProgress === 'function' && request.upload) {
+ request.upload.addEventListener('progress', progressEventReducer(config.onUploadProgress));
+ }
+
+ if (config.cancelToken || config.signal) {
+ // Handle cancellation
+ // eslint-disable-next-line func-names
+ onCanceled = cancel => {
+ if (!request) {
+ return;
+ }
+ reject(!cancel || cancel.type ? new CanceledError$1(null, config, request) : cancel);
+ request.abort();
+ request = null;
+ };
+
+ config.cancelToken && config.cancelToken.subscribe(onCanceled);
+ if (config.signal) {
+ config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);
+ }
+ }
+
+ const protocol = parseProtocol(fullPath);
+
+ if (protocol && platform.protocols.indexOf(protocol) === -1) {
+ reject(new AxiosError$1('Unsupported protocol ' + protocol + ':', AxiosError$1.ERR_BAD_REQUEST, config));
+ return;
+ }
+
+
+ // Send the request
+ request.send(requestData || null);
+ });
+};
+
+const knownAdapters = {
+ http: httpAdapter,
+ xhr: xhrAdapter
+};
+
+utils$1.forEach(knownAdapters, (fn, value) => {
+ if (fn) {
+ try {
+ Object.defineProperty(fn, 'name', {value});
+ } catch (e) {
+ // eslint-disable-next-line no-empty
+ }
+ Object.defineProperty(fn, 'adapterName', {value});
+ }
+});
+
+const renderReason = (reason) => `- ${reason}`;
+
+const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false;
+
+const adapters = {
+ getAdapter: (adapters) => {
+ adapters = utils$1.isArray(adapters) ? adapters : [adapters];
+
+ const {length} = adapters;
+ let nameOrAdapter;
+ let adapter;
+
+ const rejectedReasons = {};
+
+ for (let i = 0; i < length; i++) {
+ nameOrAdapter = adapters[i];
+ let id;
+
+ adapter = nameOrAdapter;
+
+ if (!isResolvedHandle(nameOrAdapter)) {
+ adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
+
+ if (adapter === undefined) {
+ throw new AxiosError$1(`Unknown adapter '${id}'`);
+ }
+ }
+
+ if (adapter) {
+ break;
+ }
+
+ rejectedReasons[id || '#' + i] = adapter;
+ }
+
+ if (!adapter) {
+
+ const reasons = Object.entries(rejectedReasons)
+ .map(([id, state]) => `adapter ${id} ` +
+ (state === false ? 'is not supported by the environment' : 'is not available in the build')
+ );
+
+ let s = length ?
+ (reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) :
+ 'as no adapter specified';
+
+ throw new AxiosError$1(
+ `There is no suitable adapter to dispatch the request ` + s,
+ 'ERR_NOT_SUPPORT'
+ );
+ }
+
+ return adapter;
+ },
+ adapters: knownAdapters
+};
+
+/**
+ * Throws a `CanceledError` if cancellation has been requested.
+ *
+ * @param {Object} config The config that is to be used for the request
+ *
+ * @returns {void}
+ */
+function throwIfCancellationRequested(config) {
+ if (config.cancelToken) {
+ config.cancelToken.throwIfRequested();
+ }
+
+ if (config.signal && config.signal.aborted) {
+ throw new CanceledError$1(null, config);
+ }
+}
+
+/**
+ * Dispatch a request to the server using the configured adapter.
+ *
+ * @param {object} config The config that is to be used for the request
+ *
+ * @returns {Promise} The Promise to be fulfilled
+ */
+function dispatchRequest(config) {
+ throwIfCancellationRequested(config);
+
+ config.headers = AxiosHeaders$2.from(config.headers);
+
+ // Transform request data
+ config.data = transformData.call(
+ config,
+ config.transformRequest
+ );
+
+ if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {
+ config.headers.setContentType('application/x-www-form-urlencoded', false);
+ }
+
+ const adapter = adapters.getAdapter(config.adapter || defaults$1.adapter);
+
+ return adapter(config).then(function onAdapterResolution(response) {
+ throwIfCancellationRequested(config);
+
+ // Transform response data
+ response.data = transformData.call(
+ config,
+ config.transformResponse,
+ response
+ );
+
+ response.headers = AxiosHeaders$2.from(response.headers);
+
+ return response;
+ }, function onAdapterRejection(reason) {
+ if (!isCancel$1(reason)) {
+ throwIfCancellationRequested(config);
+
+ // Transform response data
+ if (reason && reason.response) {
+ reason.response.data = transformData.call(
+ config,
+ config.transformResponse,
+ reason.response
+ );
+ reason.response.headers = AxiosHeaders$2.from(reason.response.headers);
+ }
+ }
+
+ return Promise.reject(reason);
+ });
+}
+
+const headersToObject = (thing) => thing instanceof AxiosHeaders$2 ? thing.toJSON() : thing;
+
+/**
+ * Config-specific merge-function which creates a new config-object
+ * by merging two configuration objects together.
+ *
+ * @param {Object} config1
+ * @param {Object} config2
+ *
+ * @returns {Object} New object resulting from merging config2 to config1
+ */
+function mergeConfig$1(config1, config2) {
+ // eslint-disable-next-line no-param-reassign
+ config2 = config2 || {};
+ const config = {};
+
+ function getMergedValue(target, source, caseless) {
+ if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
+ return utils$1.merge.call({caseless}, target, source);
+ } else if (utils$1.isPlainObject(source)) {
+ return utils$1.merge({}, source);
+ } else if (utils$1.isArray(source)) {
+ return source.slice();
+ }
+ return source;
+ }
+
+ // eslint-disable-next-line consistent-return
+ function mergeDeepProperties(a, b, caseless) {
+ if (!utils$1.isUndefined(b)) {
+ return getMergedValue(a, b, caseless);
+ } else if (!utils$1.isUndefined(a)) {
+ return getMergedValue(undefined, a, caseless);
+ }
+ }
+
+ // eslint-disable-next-line consistent-return
+ function valueFromConfig2(a, b) {
+ if (!utils$1.isUndefined(b)) {
+ return getMergedValue(undefined, b);
+ }
+ }
+
+ // eslint-disable-next-line consistent-return
+ function defaultToConfig2(a, b) {
+ if (!utils$1.isUndefined(b)) {
+ return getMergedValue(undefined, b);
+ } else if (!utils$1.isUndefined(a)) {
+ return getMergedValue(undefined, a);
+ }
+ }
+
+ // eslint-disable-next-line consistent-return
+ function mergeDirectKeys(a, b, prop) {
+ if (prop in config2) {
+ return getMergedValue(a, b);
+ } else if (prop in config1) {
+ return getMergedValue(undefined, a);
+ }
+ }
+
+ const mergeMap = {
+ url: valueFromConfig2,
+ method: valueFromConfig2,
+ data: valueFromConfig2,
+ baseURL: defaultToConfig2,
+ transformRequest: defaultToConfig2,
+ transformResponse: defaultToConfig2,
+ paramsSerializer: defaultToConfig2,
+ timeout: defaultToConfig2,
+ timeoutMessage: defaultToConfig2,
+ withCredentials: defaultToConfig2,
+ withXSRFToken: defaultToConfig2,
+ adapter: defaultToConfig2,
+ responseType: defaultToConfig2,
+ xsrfCookieName: defaultToConfig2,
+ xsrfHeaderName: defaultToConfig2,
+ onUploadProgress: defaultToConfig2,
+ onDownloadProgress: defaultToConfig2,
+ decompress: defaultToConfig2,
+ maxContentLength: defaultToConfig2,
+ maxBodyLength: defaultToConfig2,
+ beforeRedirect: defaultToConfig2,
+ transport: defaultToConfig2,
+ httpAgent: defaultToConfig2,
+ httpsAgent: defaultToConfig2,
+ cancelToken: defaultToConfig2,
+ socketPath: defaultToConfig2,
+ responseEncoding: defaultToConfig2,
+ validateStatus: mergeDirectKeys,
+ headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
+ };
+
+ utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
+ const merge = mergeMap[prop] || mergeDeepProperties;
+ const configValue = merge(config1[prop], config2[prop], prop);
+ (utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
+ });
+
+ return config;
+}
+
+const VERSION$1 = "1.6.7";
+
+const validators$1 = {};
+
+// eslint-disable-next-line func-names
+['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => {
+ validators$1[type] = function validator(thing) {
+ return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;
+ };
+});
+
+const deprecatedWarnings = {};
+
+/**
+ * Transitional option validator
+ *
+ * @param {function|boolean?} validator - set to false if the transitional option has been removed
+ * @param {string?} version - deprecated version / removed since version
+ * @param {string?} message - some message with additional info
+ *
+ * @returns {function}
+ */
+validators$1.transitional = function transitional(validator, version, message) {
+ function formatMessage(opt, desc) {
+ return '[Axios v' + VERSION$1 + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : '');
+ }
+
+ // eslint-disable-next-line func-names
+ return (value, opt, opts) => {
+ if (validator === false) {
+ throw new AxiosError$1(
+ formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),
+ AxiosError$1.ERR_DEPRECATED
+ );
+ }
+
+ if (version && !deprecatedWarnings[opt]) {
+ deprecatedWarnings[opt] = true;
+ // eslint-disable-next-line no-console
+ console.warn(
+ formatMessage(
+ opt,
+ ' has been deprecated since v' + version + ' and will be removed in the near future'
+ )
+ );
+ }
+
+ return validator ? validator(value, opt, opts) : true;
+ };
+};
+
+/**
+ * Assert object's properties type
+ *
+ * @param {object} options
+ * @param {object} schema
+ * @param {boolean?} allowUnknown
+ *
+ * @returns {object}
+ */
+
+function assertOptions(options, schema, allowUnknown) {
+ if (typeof options !== 'object') {
+ throw new AxiosError$1('options must be an object', AxiosError$1.ERR_BAD_OPTION_VALUE);
+ }
+ const keys = Object.keys(options);
+ let i = keys.length;
+ while (i-- > 0) {
+ const opt = keys[i];
+ const validator = schema[opt];
+ if (validator) {
+ const value = options[opt];
+ const result = value === undefined || validator(value, opt, options);
+ if (result !== true) {
+ throw new AxiosError$1('option ' + opt + ' must be ' + result, AxiosError$1.ERR_BAD_OPTION_VALUE);
+ }
+ continue;
+ }
+ if (allowUnknown !== true) {
+ throw new AxiosError$1('Unknown option ' + opt, AxiosError$1.ERR_BAD_OPTION);
+ }
+ }
+}
+
+const validator = {
+ assertOptions,
+ validators: validators$1
+};
+
+const validators = validator.validators;
+
+/**
+ * Create a new instance of Axios
+ *
+ * @param {Object} instanceConfig The default config for the instance
+ *
+ * @return {Axios} A new instance of Axios
+ */
+class Axios$1 {
+ constructor(instanceConfig) {
+ this.defaults = instanceConfig;
+ this.interceptors = {
+ request: new InterceptorManager$1(),
+ response: new InterceptorManager$1()
+ };
+ }
+
+ /**
+ * Dispatch a request
+ *
+ * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
+ * @param {?Object} config
+ *
+ * @returns {Promise} The Promise to be fulfilled
+ */
+ async request(configOrUrl, config) {
+ try {
+ return await this._request(configOrUrl, config);
+ } catch (err) {
+ if (err instanceof Error) {
+ let dummy;
+
+ Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : (dummy = new Error());
+
+ // slice off the Error: ... line
+ const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : '';
+
+ if (!err.stack) {
+ err.stack = stack;
+ // match without the 2 top stack lines
+ } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ''))) {
+ err.stack += '\n' + stack;
+ }
+ }
+
+ throw err;
+ }
+ }
+
+ _request(configOrUrl, config) {
+ /*eslint no-param-reassign:0*/
+ // Allow for axios('example/url'[, config]) a la fetch API
+ if (typeof configOrUrl === 'string') {
+ config = config || {};
+ config.url = configOrUrl;
+ } else {
+ config = configOrUrl || {};
+ }
+
+ config = mergeConfig$1(this.defaults, config);
+
+ const {transitional, paramsSerializer, headers} = config;
+
+ if (transitional !== undefined) {
+ validator.assertOptions(transitional, {
+ silentJSONParsing: validators.transitional(validators.boolean),
+ forcedJSONParsing: validators.transitional(validators.boolean),
+ clarifyTimeoutError: validators.transitional(validators.boolean)
+ }, false);
+ }
+
+ if (paramsSerializer != null) {
+ if (utils$1.isFunction(paramsSerializer)) {
+ config.paramsSerializer = {
+ serialize: paramsSerializer
+ };
+ } else {
+ validator.assertOptions(paramsSerializer, {
+ encode: validators.function,
+ serialize: validators.function
+ }, true);
+ }
+ }
+
+ // Set config.method
+ config.method = (config.method || this.defaults.method || 'get').toLowerCase();
+
+ // Flatten headers
+ let contextHeaders = headers && utils$1.merge(
+ headers.common,
+ headers[config.method]
+ );
+
+ headers && utils$1.forEach(
+ ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
+ (method) => {
+ delete headers[method];
+ }
+ );
+
+ config.headers = AxiosHeaders$2.concat(contextHeaders, headers);
+
+ // filter out skipped interceptors
+ const requestInterceptorChain = [];
+ let synchronousRequestInterceptors = true;
+ this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
+ if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {
+ return;
+ }
+
+ synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
+
+ requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
+ });
+
+ const responseInterceptorChain = [];
+ this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
+ responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
+ });
+
+ let promise;
+ let i = 0;
+ let len;
+
+ if (!synchronousRequestInterceptors) {
+ const chain = [dispatchRequest.bind(this), undefined];
+ chain.unshift.apply(chain, requestInterceptorChain);
+ chain.push.apply(chain, responseInterceptorChain);
+ len = chain.length;
+
+ promise = Promise.resolve(config);
+
+ while (i < len) {
+ promise = promise.then(chain[i++], chain[i++]);
+ }
+
+ return promise;
+ }
+
+ len = requestInterceptorChain.length;
+
+ let newConfig = config;
+
+ i = 0;
+
+ while (i < len) {
+ const onFulfilled = requestInterceptorChain[i++];
+ const onRejected = requestInterceptorChain[i++];
+ try {
+ newConfig = onFulfilled(newConfig);
+ } catch (error) {
+ onRejected.call(this, error);
+ break;
+ }
+ }
+
+ try {
+ promise = dispatchRequest.call(this, newConfig);
+ } catch (error) {
+ return Promise.reject(error);
+ }
+
+ i = 0;
+ len = responseInterceptorChain.length;
+
+ while (i < len) {
+ promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);
+ }
+
+ return promise;
+ }
+
+ getUri(config) {
+ config = mergeConfig$1(this.defaults, config);
+ const fullPath = buildFullPath(config.baseURL, config.url);
+ return buildURL(fullPath, config.params, config.paramsSerializer);
+ }
+}
+
+// Provide aliases for supported request methods
+utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
+ /*eslint func-names:0*/
+ Axios$1.prototype[method] = function(url, config) {
+ return this.request(mergeConfig$1(config || {}, {
+ method,
+ url,
+ data: (config || {}).data
+ }));
+ };
+});
+
+utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
+ /*eslint func-names:0*/
+
+ function generateHTTPMethod(isForm) {
+ return function httpMethod(url, data, config) {
+ return this.request(mergeConfig$1(config || {}, {
+ method,
+ headers: isForm ? {
+ 'Content-Type': 'multipart/form-data'
+ } : {},
+ url,
+ data
+ }));
+ };
+ }
+
+ Axios$1.prototype[method] = generateHTTPMethod();
+
+ Axios$1.prototype[method + 'Form'] = generateHTTPMethod(true);
+});
+
+const Axios$2 = Axios$1;
+
+/**
+ * A `CancelToken` is an object that can be used to request cancellation of an operation.
+ *
+ * @param {Function} executor The executor function.
+ *
+ * @returns {CancelToken}
+ */
+class CancelToken$1 {
+ constructor(executor) {
+ if (typeof executor !== 'function') {
+ throw new TypeError('executor must be a function.');
+ }
+
+ let resolvePromise;
+
+ this.promise = new Promise(function promiseExecutor(resolve) {
+ resolvePromise = resolve;
+ });
+
+ const token = this;
+
+ // eslint-disable-next-line func-names
+ this.promise.then(cancel => {
+ if (!token._listeners) return;
+
+ let i = token._listeners.length;
+
+ while (i-- > 0) {
+ token._listeners[i](cancel);
+ }
+ token._listeners = null;
+ });
+
+ // eslint-disable-next-line func-names
+ this.promise.then = onfulfilled => {
+ let _resolve;
+ // eslint-disable-next-line func-names
+ const promise = new Promise(resolve => {
+ token.subscribe(resolve);
+ _resolve = resolve;
+ }).then(onfulfilled);
+
+ promise.cancel = function reject() {
+ token.unsubscribe(_resolve);
+ };
+
+ return promise;
+ };
+
+ executor(function cancel(message, config, request) {
+ if (token.reason) {
+ // Cancellation has already been requested
+ return;
+ }
+
+ token.reason = new CanceledError$1(message, config, request);
+ resolvePromise(token.reason);
+ });
+ }
+
+ /**
+ * Throws a `CanceledError` if cancellation has been requested.
+ */
+ throwIfRequested() {
+ if (this.reason) {
+ throw this.reason;
+ }
+ }
+
+ /**
+ * Subscribe to the cancel signal
+ */
+
+ subscribe(listener) {
+ if (this.reason) {
+ listener(this.reason);
+ return;
+ }
+
+ if (this._listeners) {
+ this._listeners.push(listener);
+ } else {
+ this._listeners = [listener];
+ }
+ }
+
+ /**
+ * Unsubscribe from the cancel signal
+ */
+
+ unsubscribe(listener) {
+ if (!this._listeners) {
+ return;
+ }
+ const index = this._listeners.indexOf(listener);
+ if (index !== -1) {
+ this._listeners.splice(index, 1);
+ }
+ }
+
+ /**
+ * Returns an object that contains a new `CancelToken` and a function that, when called,
+ * cancels the `CancelToken`.
+ */
+ static source() {
+ let cancel;
+ const token = new CancelToken$1(function executor(c) {
+ cancel = c;
+ });
+ return {
+ token,
+ cancel
+ };
+ }
+}
+
+const CancelToken$2 = CancelToken$1;
+
+/**
+ * Syntactic sugar for invoking a function and expanding an array for arguments.
+ *
+ * Common use case would be to use `Function.prototype.apply`.
+ *
+ * ```js
+ * function f(x, y, z) {}
+ * var args = [1, 2, 3];
+ * f.apply(null, args);
+ * ```
+ *
+ * With `spread` this example can be re-written.
+ *
+ * ```js
+ * spread(function(x, y, z) {})([1, 2, 3]);
+ * ```
+ *
+ * @param {Function} callback
+ *
+ * @returns {Function}
+ */
+function spread$1(callback) {
+ return function wrap(arr) {
+ return callback.apply(null, arr);
+ };
+}
+
+/**
+ * Determines whether the payload is an error thrown by Axios
+ *
+ * @param {*} payload The value to test
+ *
+ * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
+ */
+function isAxiosError$1(payload) {
+ return utils$1.isObject(payload) && (payload.isAxiosError === true);
+}
+
+const HttpStatusCode$1 = {
+ Continue: 100,
+ SwitchingProtocols: 101,
+ Processing: 102,
+ EarlyHints: 103,
+ Ok: 200,
+ Created: 201,
+ Accepted: 202,
+ NonAuthoritativeInformation: 203,
+ NoContent: 204,
+ ResetContent: 205,
+ PartialContent: 206,
+ MultiStatus: 207,
+ AlreadyReported: 208,
+ ImUsed: 226,
+ MultipleChoices: 300,
+ MovedPermanently: 301,
+ Found: 302,
+ SeeOther: 303,
+ NotModified: 304,
+ UseProxy: 305,
+ Unused: 306,
+ TemporaryRedirect: 307,
+ PermanentRedirect: 308,
+ BadRequest: 400,
+ Unauthorized: 401,
+ PaymentRequired: 402,
+ Forbidden: 403,
+ NotFound: 404,
+ MethodNotAllowed: 405,
+ NotAcceptable: 406,
+ ProxyAuthenticationRequired: 407,
+ RequestTimeout: 408,
+ Conflict: 409,
+ Gone: 410,
+ LengthRequired: 411,
+ PreconditionFailed: 412,
+ PayloadTooLarge: 413,
+ UriTooLong: 414,
+ UnsupportedMediaType: 415,
+ RangeNotSatisfiable: 416,
+ ExpectationFailed: 417,
+ ImATeapot: 418,
+ MisdirectedRequest: 421,
+ UnprocessableEntity: 422,
+ Locked: 423,
+ FailedDependency: 424,
+ TooEarly: 425,
+ UpgradeRequired: 426,
+ PreconditionRequired: 428,
+ TooManyRequests: 429,
+ RequestHeaderFieldsTooLarge: 431,
+ UnavailableForLegalReasons: 451,
+ InternalServerError: 500,
+ NotImplemented: 501,
+ BadGateway: 502,
+ ServiceUnavailable: 503,
+ GatewayTimeout: 504,
+ HttpVersionNotSupported: 505,
+ VariantAlsoNegotiates: 506,
+ InsufficientStorage: 507,
+ LoopDetected: 508,
+ NotExtended: 510,
+ NetworkAuthenticationRequired: 511,
+};
+
+Object.entries(HttpStatusCode$1).forEach(([key, value]) => {
+ HttpStatusCode$1[value] = key;
+});
+
+const HttpStatusCode$2 = HttpStatusCode$1;
+
+/**
+ * Create an instance of Axios
+ *
+ * @param {Object} defaultConfig The default config for the instance
+ *
+ * @returns {Axios} A new instance of Axios
+ */
+function createInstance(defaultConfig) {
+ const context = new Axios$2(defaultConfig);
+ const instance = bind(Axios$2.prototype.request, context);
+
+ // Copy axios.prototype to instance
+ utils$1.extend(instance, Axios$2.prototype, context, {allOwnKeys: true});
+
+ // Copy context to instance
+ utils$1.extend(instance, context, null, {allOwnKeys: true});
+
+ // Factory for creating new instances
+ instance.create = function create(instanceConfig) {
+ return createInstance(mergeConfig$1(defaultConfig, instanceConfig));
+ };
+
+ return instance;
+}
+
+// Create the default instance to be exported
+const axios = createInstance(defaults$1);
+
+// Expose Axios class to allow class inheritance
+axios.Axios = Axios$2;
+
+// Expose Cancel & CancelToken
+axios.CanceledError = CanceledError$1;
+axios.CancelToken = CancelToken$2;
+axios.isCancel = isCancel$1;
+axios.VERSION = VERSION$1;
+axios.toFormData = toFormData$1;
+
+// Expose AxiosError class
+axios.AxiosError = AxiosError$1;
+
+// alias for CanceledError for backward compatibility
+axios.Cancel = axios.CanceledError;
+
+// Expose all/spread
+axios.all = function all(promises) {
+ return Promise.all(promises);
+};
+
+axios.spread = spread$1;
+
+// Expose isAxiosError
+axios.isAxiosError = isAxiosError$1;
+
+// Expose mergeConfig
+axios.mergeConfig = mergeConfig$1;
+
+axios.AxiosHeaders = AxiosHeaders$2;
+
+axios.formToJSON = thing => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
+
+axios.getAdapter = adapters.getAdapter;
+
+axios.HttpStatusCode = HttpStatusCode$2;
+
+axios.default = axios;
+
+// this module should only have a default export
+const axios$1 = axios;
+
+// This module is intended to unwrap Axios default export as named.
+// Keep top-level export same with static properties
+// so that it can keep same with es module or cjs
+const {
+ Axios,
+ AxiosError,
+ CanceledError,
+ isCancel,
+ CancelToken,
+ VERSION,
+ all,
+ Cancel,
+ isAxiosError,
+ spread,
+ toFormData,
+ AxiosHeaders,
+ HttpStatusCode,
+ formToJSON,
+ getAdapter,
+ mergeConfig
+} = axios$1;
+
+export { Axios, AxiosError, AxiosHeaders, Cancel, CancelToken, CanceledError, HttpStatusCode, VERSION, all, axios$1 as default, formToJSON, getAdapter, isAxiosError, isCancel, mergeConfig, spread, toFormData };
+//# sourceMappingURL=axios.js.map
diff --git a/node_modules/axios/dist/esm/axios.js.map b/node_modules/axios/dist/esm/axios.js.map
new file mode 100644
index 0000000..7031b7d
--- /dev/null
+++ b/node_modules/axios/dist/esm/axios.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"axios.js","sources":["../../lib/helpers/bind.js","../../lib/utils.js","../../lib/core/AxiosError.js","../../lib/helpers/null.js","../../lib/helpers/toFormData.js","../../lib/helpers/AxiosURLSearchParams.js","../../lib/helpers/buildURL.js","../../lib/core/InterceptorManager.js","../../lib/defaults/transitional.js","../../lib/platform/browser/classes/URLSearchParams.js","../../lib/platform/browser/classes/FormData.js","../../lib/platform/browser/classes/Blob.js","../../lib/platform/browser/index.js","../../lib/platform/common/utils.js","../../lib/platform/index.js","../../lib/helpers/toURLEncodedForm.js","../../lib/helpers/formDataToJSON.js","../../lib/defaults/index.js","../../lib/helpers/parseHeaders.js","../../lib/core/AxiosHeaders.js","../../lib/core/transformData.js","../../lib/cancel/isCancel.js","../../lib/cancel/CanceledError.js","../../lib/core/settle.js","../../lib/helpers/cookies.js","../../lib/helpers/isAbsoluteURL.js","../../lib/helpers/combineURLs.js","../../lib/core/buildFullPath.js","../../lib/helpers/isURLSameOrigin.js","../../lib/helpers/parseProtocol.js","../../lib/helpers/speedometer.js","../../lib/adapters/xhr.js","../../lib/adapters/adapters.js","../../lib/core/dispatchRequest.js","../../lib/core/mergeConfig.js","../../lib/env/data.js","../../lib/helpers/validator.js","../../lib/core/Axios.js","../../lib/cancel/CancelToken.js","../../lib/helpers/spread.js","../../lib/helpers/isAxiosError.js","../../lib/helpers/HttpStatusCode.js","../../lib/axios.js","../../index.js"],"sourcesContent":["'use strict';\n\nexport default function bind(fn, thisArg) {\n return function wrap() {\n return fn.apply(thisArg, arguments);\n };\n}\n","'use strict';\n\nimport bind from './helpers/bind.js';\n\n// utils is a library of generic helper functions non-specific to axios\n\nconst {toString} = Object.prototype;\nconst {getPrototypeOf} = Object;\n\nconst kindOf = (cache => thing => {\n const str = toString.call(thing);\n return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());\n})(Object.create(null));\n\nconst kindOfTest = (type) => {\n type = type.toLowerCase();\n return (thing) => kindOf(thing) === type\n}\n\nconst typeOfTest = type => thing => typeof thing === type;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n *\n * @returns {boolean} True if value is an Array, otherwise false\n */\nconst {isArray} = Array;\n\n/**\n * Determine if a value is undefined\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nconst isUndefined = typeOfTest('undefined');\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nconst isArrayBuffer = kindOfTest('ArrayBuffer');\n\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n let result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a String, otherwise false\n */\nconst isString = typeOfTest('string');\n\n/**\n * Determine if a value is a Function\n *\n * @param {*} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nconst isFunction = typeOfTest('function');\n\n/**\n * Determine if a value is a Number\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Number, otherwise false\n */\nconst isNumber = typeOfTest('number');\n\n/**\n * Determine if a value is an Object\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an Object, otherwise false\n */\nconst isObject = (thing) => thing !== null && typeof thing === 'object';\n\n/**\n * Determine if a value is a Boolean\n *\n * @param {*} thing The value to test\n * @returns {boolean} True if value is a Boolean, otherwise false\n */\nconst isBoolean = thing => thing === true || thing === false;\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a plain Object, otherwise false\n */\nconst isPlainObject = (val) => {\n if (kindOf(val) !== 'object') {\n return false;\n }\n\n const prototype = getPrototypeOf(val);\n return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Date, otherwise false\n */\nconst isDate = kindOfTest('Date');\n\n/**\n * Determine if a value is a File\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFile = kindOfTest('File');\n\n/**\n * Determine if a value is a Blob\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nconst isBlob = kindOfTest('Blob');\n\n/**\n * Determine if a value is a FileList\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFileList = kindOfTest('FileList');\n\n/**\n * Determine if a value is a Stream\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nconst isStream = (val) => isObject(val) && isFunction(val.pipe);\n\n/**\n * Determine if a value is a FormData\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nconst isFormData = (thing) => {\n let kind;\n return thing && (\n (typeof FormData === 'function' && thing instanceof FormData) || (\n isFunction(thing.append) && (\n (kind = kindOf(thing)) === 'formdata' ||\n // detect form-data instance\n (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')\n )\n )\n )\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nconst isURLSearchParams = kindOfTest('URLSearchParams');\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n *\n * @returns {String} The String freed of excess whitespace\n */\nconst trim = (str) => str.trim ?\n str.trim() : str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n *\n * @param {Boolean} [allOwnKeys = false]\n * @returns {any}\n */\nfunction forEach(obj, fn, {allOwnKeys = false} = {}) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n let i;\n let l;\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);\n const len = keys.length;\n let key;\n\n for (i = 0; i < len; i++) {\n key = keys[i];\n fn.call(null, obj[key], key, obj);\n }\n }\n}\n\nfunction findKey(obj, key) {\n key = key.toLowerCase();\n const keys = Object.keys(obj);\n let i = keys.length;\n let _key;\n while (i-- > 0) {\n _key = keys[i];\n if (key === _key.toLowerCase()) {\n return _key;\n }\n }\n return null;\n}\n\nconst _global = (() => {\n /*eslint no-undef:0*/\n if (typeof globalThis !== \"undefined\") return globalThis;\n return typeof self !== \"undefined\" ? self : (typeof window !== 'undefined' ? window : global)\n})();\n\nconst isContextDefined = (context) => !isUndefined(context) && context !== _global;\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n *\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n const {caseless} = isContextDefined(this) && this || {};\n const result = {};\n const assignValue = (val, key) => {\n const targetKey = caseless && findKey(result, key) || key;\n if (isPlainObject(result[targetKey]) && isPlainObject(val)) {\n result[targetKey] = merge(result[targetKey], val);\n } else if (isPlainObject(val)) {\n result[targetKey] = merge({}, val);\n } else if (isArray(val)) {\n result[targetKey] = val.slice();\n } else {\n result[targetKey] = val;\n }\n }\n\n for (let i = 0, l = arguments.length; i < l; i++) {\n arguments[i] && forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n *\n * @param {Boolean} [allOwnKeys]\n * @returns {Object} The resulting value of object a\n */\nconst extend = (a, b, thisArg, {allOwnKeys}= {}) => {\n forEach(b, (val, key) => {\n if (thisArg && isFunction(val)) {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n }, {allOwnKeys});\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n *\n * @returns {string} content value without BOM\n */\nconst stripBOM = (content) => {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\n/**\n * Inherit the prototype methods from one constructor into another\n * @param {function} constructor\n * @param {function} superConstructor\n * @param {object} [props]\n * @param {object} [descriptors]\n *\n * @returns {void}\n */\nconst inherits = (constructor, superConstructor, props, descriptors) => {\n constructor.prototype = Object.create(superConstructor.prototype, descriptors);\n constructor.prototype.constructor = constructor;\n Object.defineProperty(constructor, 'super', {\n value: superConstructor.prototype\n });\n props && Object.assign(constructor.prototype, props);\n}\n\n/**\n * Resolve object with deep prototype chain to a flat object\n * @param {Object} sourceObj source object\n * @param {Object} [destObj]\n * @param {Function|Boolean} [filter]\n * @param {Function} [propFilter]\n *\n * @returns {Object}\n */\nconst toFlatObject = (sourceObj, destObj, filter, propFilter) => {\n let props;\n let i;\n let prop;\n const merged = {};\n\n destObj = destObj || {};\n // eslint-disable-next-line no-eq-null,eqeqeq\n if (sourceObj == null) return destObj;\n\n do {\n props = Object.getOwnPropertyNames(sourceObj);\n i = props.length;\n while (i-- > 0) {\n prop = props[i];\n if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {\n destObj[prop] = sourceObj[prop];\n merged[prop] = true;\n }\n }\n sourceObj = filter !== false && getPrototypeOf(sourceObj);\n } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);\n\n return destObj;\n}\n\n/**\n * Determines whether a string ends with the characters of a specified string\n *\n * @param {String} str\n * @param {String} searchString\n * @param {Number} [position= 0]\n *\n * @returns {boolean}\n */\nconst endsWith = (str, searchString, position) => {\n str = String(str);\n if (position === undefined || position > str.length) {\n position = str.length;\n }\n position -= searchString.length;\n const lastIndex = str.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n}\n\n\n/**\n * Returns new array from array like object or null if failed\n *\n * @param {*} [thing]\n *\n * @returns {?Array}\n */\nconst toArray = (thing) => {\n if (!thing) return null;\n if (isArray(thing)) return thing;\n let i = thing.length;\n if (!isNumber(i)) return null;\n const arr = new Array(i);\n while (i-- > 0) {\n arr[i] = thing[i];\n }\n return arr;\n}\n\n/**\n * Checking if the Uint8Array exists and if it does, it returns a function that checks if the\n * thing passed in is an instance of Uint8Array\n *\n * @param {TypedArray}\n *\n * @returns {Array}\n */\n// eslint-disable-next-line func-names\nconst isTypedArray = (TypedArray => {\n // eslint-disable-next-line func-names\n return thing => {\n return TypedArray && thing instanceof TypedArray;\n };\n})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));\n\n/**\n * For each entry in the object, call the function with the key and value.\n *\n * @param {Object<any, any>} obj - The object to iterate over.\n * @param {Function} fn - The function to call for each entry.\n *\n * @returns {void}\n */\nconst forEachEntry = (obj, fn) => {\n const generator = obj && obj[Symbol.iterator];\n\n const iterator = generator.call(obj);\n\n let result;\n\n while ((result = iterator.next()) && !result.done) {\n const pair = result.value;\n fn.call(obj, pair[0], pair[1]);\n }\n}\n\n/**\n * It takes a regular expression and a string, and returns an array of all the matches\n *\n * @param {string} regExp - The regular expression to match against.\n * @param {string} str - The string to search.\n *\n * @returns {Array<boolean>}\n */\nconst matchAll = (regExp, str) => {\n let matches;\n const arr = [];\n\n while ((matches = regExp.exec(str)) !== null) {\n arr.push(matches);\n }\n\n return arr;\n}\n\n/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */\nconst isHTMLForm = kindOfTest('HTMLFormElement');\n\nconst toCamelCase = str => {\n return str.toLowerCase().replace(/[-_\\s]([a-z\\d])(\\w*)/g,\n function replacer(m, p1, p2) {\n return p1.toUpperCase() + p2;\n }\n );\n};\n\n/* Creating a function that will check if an object has a property. */\nconst hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);\n\n/**\n * Determine if a value is a RegExp object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a RegExp object, otherwise false\n */\nconst isRegExp = kindOfTest('RegExp');\n\nconst reduceDescriptors = (obj, reducer) => {\n const descriptors = Object.getOwnPropertyDescriptors(obj);\n const reducedDescriptors = {};\n\n forEach(descriptors, (descriptor, name) => {\n let ret;\n if ((ret = reducer(descriptor, name, obj)) !== false) {\n reducedDescriptors[name] = ret || descriptor;\n }\n });\n\n Object.defineProperties(obj, reducedDescriptors);\n}\n\n/**\n * Makes all methods read-only\n * @param {Object} obj\n */\n\nconst freezeMethods = (obj) => {\n reduceDescriptors(obj, (descriptor, name) => {\n // skip restricted props in strict mode\n if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {\n return false;\n }\n\n const value = obj[name];\n\n if (!isFunction(value)) return;\n\n descriptor.enumerable = false;\n\n if ('writable' in descriptor) {\n descriptor.writable = false;\n return;\n }\n\n if (!descriptor.set) {\n descriptor.set = () => {\n throw Error('Can not rewrite read-only method \\'' + name + '\\'');\n };\n }\n });\n}\n\nconst toObjectSet = (arrayOrString, delimiter) => {\n const obj = {};\n\n const define = (arr) => {\n arr.forEach(value => {\n obj[value] = true;\n });\n }\n\n isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));\n\n return obj;\n}\n\nconst noop = () => {}\n\nconst toFiniteNumber = (value, defaultValue) => {\n value = +value;\n return Number.isFinite(value) ? value : defaultValue;\n}\n\nconst ALPHA = 'abcdefghijklmnopqrstuvwxyz'\n\nconst DIGIT = '0123456789';\n\nconst ALPHABET = {\n DIGIT,\n ALPHA,\n ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT\n}\n\nconst generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {\n let str = '';\n const {length} = alphabet;\n while (size--) {\n str += alphabet[Math.random() * length|0]\n }\n\n return str;\n}\n\n/**\n * If the thing is a FormData object, return true, otherwise return false.\n *\n * @param {unknown} thing - The thing to check.\n *\n * @returns {boolean}\n */\nfunction isSpecCompliantForm(thing) {\n return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]);\n}\n\nconst toJSONObject = (obj) => {\n const stack = new Array(10);\n\n const visit = (source, i) => {\n\n if (isObject(source)) {\n if (stack.indexOf(source) >= 0) {\n return;\n }\n\n if(!('toJSON' in source)) {\n stack[i] = source;\n const target = isArray(source) ? [] : {};\n\n forEach(source, (value, key) => {\n const reducedValue = visit(value, i + 1);\n !isUndefined(reducedValue) && (target[key] = reducedValue);\n });\n\n stack[i] = undefined;\n\n return target;\n }\n }\n\n return source;\n }\n\n return visit(obj, 0);\n}\n\nconst isAsyncFn = kindOfTest('AsyncFunction');\n\nconst isThenable = (thing) =>\n thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);\n\nexport default {\n isArray,\n isArrayBuffer,\n isBuffer,\n isFormData,\n isArrayBufferView,\n isString,\n isNumber,\n isBoolean,\n isObject,\n isPlainObject,\n isUndefined,\n isDate,\n isFile,\n isBlob,\n isRegExp,\n isFunction,\n isStream,\n isURLSearchParams,\n isTypedArray,\n isFileList,\n forEach,\n merge,\n extend,\n trim,\n stripBOM,\n inherits,\n toFlatObject,\n kindOf,\n kindOfTest,\n endsWith,\n toArray,\n forEachEntry,\n matchAll,\n isHTMLForm,\n hasOwnProperty,\n hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection\n reduceDescriptors,\n freezeMethods,\n toObjectSet,\n toCamelCase,\n noop,\n toFiniteNumber,\n findKey,\n global: _global,\n isContextDefined,\n ALPHABET,\n generateString,\n isSpecCompliantForm,\n toJSONObject,\n isAsyncFn,\n isThenable\n};\n","'use strict';\n\nimport utils from '../utils.js';\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [config] The config.\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n *\n * @returns {Error} The created error.\n */\nfunction AxiosError(message, code, config, request, response) {\n Error.call(this);\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n } else {\n this.stack = (new Error()).stack;\n }\n\n this.message = message;\n this.name = 'AxiosError';\n code && (this.code = code);\n config && (this.config = config);\n request && (this.request = request);\n response && (this.response = response);\n}\n\nutils.inherits(AxiosError, Error, {\n toJSON: function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: utils.toJSONObject(this.config),\n code: this.code,\n status: this.response && this.response.status ? this.response.status : null\n };\n }\n});\n\nconst prototype = AxiosError.prototype;\nconst descriptors = {};\n\n[\n 'ERR_BAD_OPTION_VALUE',\n 'ERR_BAD_OPTION',\n 'ECONNABORTED',\n 'ETIMEDOUT',\n 'ERR_NETWORK',\n 'ERR_FR_TOO_MANY_REDIRECTS',\n 'ERR_DEPRECATED',\n 'ERR_BAD_RESPONSE',\n 'ERR_BAD_REQUEST',\n 'ERR_CANCELED',\n 'ERR_NOT_SUPPORT',\n 'ERR_INVALID_URL'\n// eslint-disable-next-line func-names\n].forEach(code => {\n descriptors[code] = {value: code};\n});\n\nObject.defineProperties(AxiosError, descriptors);\nObject.defineProperty(prototype, 'isAxiosError', {value: true});\n\n// eslint-disable-next-line func-names\nAxiosError.from = (error, code, config, request, response, customProps) => {\n const axiosError = Object.create(prototype);\n\n utils.toFlatObject(error, axiosError, function filter(obj) {\n return obj !== Error.prototype;\n }, prop => {\n return prop !== 'isAxiosError';\n });\n\n AxiosError.call(axiosError, error.message, code, config, request, response);\n\n axiosError.cause = error;\n\n axiosError.name = error.name;\n\n customProps && Object.assign(axiosError, customProps);\n\n return axiosError;\n};\n\nexport default AxiosError;\n","// eslint-disable-next-line strict\nexport default null;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\n// temporary hotfix to avoid circular references until AxiosURLSearchParams is refactored\nimport PlatformFormData from '../platform/node/classes/FormData.js';\n\n/**\n * Determines if the given thing is a array or js object.\n *\n * @param {string} thing - The object or array to be visited.\n *\n * @returns {boolean}\n */\nfunction isVisitable(thing) {\n return utils.isPlainObject(thing) || utils.isArray(thing);\n}\n\n/**\n * It removes the brackets from the end of a string\n *\n * @param {string} key - The key of the parameter.\n *\n * @returns {string} the key without the brackets.\n */\nfunction removeBrackets(key) {\n return utils.endsWith(key, '[]') ? key.slice(0, -2) : key;\n}\n\n/**\n * It takes a path, a key, and a boolean, and returns a string\n *\n * @param {string} path - The path to the current key.\n * @param {string} key - The key of the current object being iterated over.\n * @param {string} dots - If true, the key will be rendered with dots instead of brackets.\n *\n * @returns {string} The path to the current key.\n */\nfunction renderKey(path, key, dots) {\n if (!path) return key;\n return path.concat(key).map(function each(token, i) {\n // eslint-disable-next-line no-param-reassign\n token = removeBrackets(token);\n return !dots && i ? '[' + token + ']' : token;\n }).join(dots ? '.' : '');\n}\n\n/**\n * If the array is an array and none of its elements are visitable, then it's a flat array.\n *\n * @param {Array<any>} arr - The array to check\n *\n * @returns {boolean}\n */\nfunction isFlatArray(arr) {\n return utils.isArray(arr) && !arr.some(isVisitable);\n}\n\nconst predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {\n return /^is[A-Z]/.test(prop);\n});\n\n/**\n * Convert a data object to FormData\n *\n * @param {Object} obj\n * @param {?Object} [formData]\n * @param {?Object} [options]\n * @param {Function} [options.visitor]\n * @param {Boolean} [options.metaTokens = true]\n * @param {Boolean} [options.dots = false]\n * @param {?Boolean} [options.indexes = false]\n *\n * @returns {Object}\n **/\n\n/**\n * It converts an object into a FormData object\n *\n * @param {Object<any, any>} obj - The object to convert to form data.\n * @param {string} formData - The FormData object to append to.\n * @param {Object<string, any>} options\n *\n * @returns\n */\nfunction toFormData(obj, formData, options) {\n if (!utils.isObject(obj)) {\n throw new TypeError('target must be an object');\n }\n\n // eslint-disable-next-line no-param-reassign\n formData = formData || new (PlatformFormData || FormData)();\n\n // eslint-disable-next-line no-param-reassign\n options = utils.toFlatObject(options, {\n metaTokens: true,\n dots: false,\n indexes: false\n }, false, function defined(option, source) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n return !utils.isUndefined(source[option]);\n });\n\n const metaTokens = options.metaTokens;\n // eslint-disable-next-line no-use-before-define\n const visitor = options.visitor || defaultVisitor;\n const dots = options.dots;\n const indexes = options.indexes;\n const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;\n const useBlob = _Blob && utils.isSpecCompliantForm(formData);\n\n if (!utils.isFunction(visitor)) {\n throw new TypeError('visitor must be a function');\n }\n\n function convertValue(value) {\n if (value === null) return '';\n\n if (utils.isDate(value)) {\n return value.toISOString();\n }\n\n if (!useBlob && utils.isBlob(value)) {\n throw new AxiosError('Blob is not supported. Use a Buffer instead.');\n }\n\n if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {\n return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);\n }\n\n return value;\n }\n\n /**\n * Default visitor.\n *\n * @param {*} value\n * @param {String|Number} key\n * @param {Array<String|Number>} path\n * @this {FormData}\n *\n * @returns {boolean} return true to visit the each prop of the value recursively\n */\n function defaultVisitor(value, key, path) {\n let arr = value;\n\n if (value && !path && typeof value === 'object') {\n if (utils.endsWith(key, '{}')) {\n // eslint-disable-next-line no-param-reassign\n key = metaTokens ? key : key.slice(0, -2);\n // eslint-disable-next-line no-param-reassign\n value = JSON.stringify(value);\n } else if (\n (utils.isArray(value) && isFlatArray(value)) ||\n ((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value))\n )) {\n // eslint-disable-next-line no-param-reassign\n key = removeBrackets(key);\n\n arr.forEach(function each(el, index) {\n !(utils.isUndefined(el) || el === null) && formData.append(\n // eslint-disable-next-line no-nested-ternary\n indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),\n convertValue(el)\n );\n });\n return false;\n }\n }\n\n if (isVisitable(value)) {\n return true;\n }\n\n formData.append(renderKey(path, key, dots), convertValue(value));\n\n return false;\n }\n\n const stack = [];\n\n const exposedHelpers = Object.assign(predicates, {\n defaultVisitor,\n convertValue,\n isVisitable\n });\n\n function build(value, path) {\n if (utils.isUndefined(value)) return;\n\n if (stack.indexOf(value) !== -1) {\n throw Error('Circular reference detected in ' + path.join('.'));\n }\n\n stack.push(value);\n\n utils.forEach(value, function each(el, key) {\n const result = !(utils.isUndefined(el) || el === null) && visitor.call(\n formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers\n );\n\n if (result === true) {\n build(el, path ? path.concat(key) : [key]);\n }\n });\n\n stack.pop();\n }\n\n if (!utils.isObject(obj)) {\n throw new TypeError('data must be an object');\n }\n\n build(obj);\n\n return formData;\n}\n\nexport default toFormData;\n","'use strict';\n\nimport toFormData from './toFormData.js';\n\n/**\n * It encodes a string by replacing all characters that are not in the unreserved set with\n * their percent-encoded equivalents\n *\n * @param {string} str - The string to encode.\n *\n * @returns {string} The encoded string.\n */\nfunction encode(str) {\n const charMap = {\n '!': '%21',\n \"'\": '%27',\n '(': '%28',\n ')': '%29',\n '~': '%7E',\n '%20': '+',\n '%00': '\\x00'\n };\n return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {\n return charMap[match];\n });\n}\n\n/**\n * It takes a params object and converts it to a FormData object\n *\n * @param {Object<string, any>} params - The parameters to be converted to a FormData object.\n * @param {Object<string, any>} options - The options object passed to the Axios constructor.\n *\n * @returns {void}\n */\nfunction AxiosURLSearchParams(params, options) {\n this._pairs = [];\n\n params && toFormData(params, this, options);\n}\n\nconst prototype = AxiosURLSearchParams.prototype;\n\nprototype.append = function append(name, value) {\n this._pairs.push([name, value]);\n};\n\nprototype.toString = function toString(encoder) {\n const _encode = encoder ? function(value) {\n return encoder.call(this, value, encode);\n } : encode;\n\n return this._pairs.map(function each(pair) {\n return _encode(pair[0]) + '=' + _encode(pair[1]);\n }, '').join('&');\n};\n\nexport default AxiosURLSearchParams;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosURLSearchParams from '../helpers/AxiosURLSearchParams.js';\n\n/**\n * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their\n * URI encoded counterparts\n *\n * @param {string} val The value to be encoded.\n *\n * @returns {string} The encoded value.\n */\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @param {?object} options\n *\n * @returns {string} The formatted url\n */\nexport default function buildURL(url, params, options) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n \n const _encode = options && options.encode || encode;\n\n const serializeFn = options && options.serialize;\n\n let serializedParams;\n\n if (serializeFn) {\n serializedParams = serializeFn(params, options);\n } else {\n serializedParams = utils.isURLSearchParams(params) ?\n params.toString() :\n new AxiosURLSearchParams(params, options).toString(_encode);\n }\n\n if (serializedParams) {\n const hashmarkIndex = url.indexOf(\"#\");\n\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\nclass InterceptorManager {\n constructor() {\n this.handlers = [];\n }\n\n /**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\n use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled,\n rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n }\n\n /**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n *\n * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise\n */\n eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n }\n\n /**\n * Clear all interceptors from the stack\n *\n * @returns {void}\n */\n clear() {\n if (this.handlers) {\n this.handlers = [];\n }\n }\n\n /**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n *\n * @returns {void}\n */\n forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n }\n}\n\nexport default InterceptorManager;\n","'use strict';\n\nexport default {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n};\n","'use strict';\n\nimport AxiosURLSearchParams from '../../../helpers/AxiosURLSearchParams.js';\nexport default typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;\n","'use strict';\n\nexport default typeof FormData !== 'undefined' ? FormData : null;\n","'use strict'\n\nexport default typeof Blob !== 'undefined' ? Blob : null\n","import URLSearchParams from './classes/URLSearchParams.js'\nimport FormData from './classes/FormData.js'\nimport Blob from './classes/Blob.js'\n\nexport default {\n isBrowser: true,\n classes: {\n URLSearchParams,\n FormData,\n Blob\n },\n protocols: ['http', 'https', 'file', 'blob', 'url', 'data']\n};\n","const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n *\n * @returns {boolean}\n */\nconst hasStandardBrowserEnv = (\n (product) => {\n return hasBrowserEnv && ['ReactNative', 'NativeScript', 'NS'].indexOf(product) < 0\n })(typeof navigator !== 'undefined' && navigator.product);\n\n/**\n * Determine if we're running in a standard browser webWorker environment\n *\n * Although the `isStandardBrowserEnv` method indicates that\n * `allows axios to run in a web worker`, the WebWorker will still be\n * filtered out due to its judgment standard\n * `typeof window !== 'undefined' && typeof document !== 'undefined'`.\n * This leads to a problem when axios post `FormData` in webWorker\n */\nconst hasStandardBrowserWebWorkerEnv = (() => {\n return (\n typeof WorkerGlobalScope !== 'undefined' &&\n // eslint-disable-next-line no-undef\n self instanceof WorkerGlobalScope &&\n typeof self.importScripts === 'function'\n );\n})();\n\nexport {\n hasBrowserEnv,\n hasStandardBrowserWebWorkerEnv,\n hasStandardBrowserEnv\n}\n","import platform from './node/index.js';\nimport * as utils from './common/utils.js';\n\nexport default {\n ...utils,\n ...platform\n}\n","'use strict';\n\nimport utils from '../utils.js';\nimport toFormData from './toFormData.js';\nimport platform from '../platform/index.js';\n\nexport default function toURLEncodedForm(data, options) {\n return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({\n visitor: function(value, key, path, helpers) {\n if (platform.isNode && utils.isBuffer(value)) {\n this.append(key, value.toString('base64'));\n return false;\n }\n\n return helpers.defaultVisitor.apply(this, arguments);\n }\n }, options));\n}\n","'use strict';\n\nimport utils from '../utils.js';\n\n/**\n * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']\n *\n * @param {string} name - The name of the property to get.\n *\n * @returns An array of strings.\n */\nfunction parsePropPath(name) {\n // foo[x][y][z]\n // foo.x.y.z\n // foo-x-y-z\n // foo x y z\n return utils.matchAll(/\\w+|\\[(\\w*)]/g, name).map(match => {\n return match[0] === '[]' ? '' : match[1] || match[0];\n });\n}\n\n/**\n * Convert an array to an object.\n *\n * @param {Array<any>} arr - The array to convert to an object.\n *\n * @returns An object with the same keys and values as the array.\n */\nfunction arrayToObject(arr) {\n const obj = {};\n const keys = Object.keys(arr);\n let i;\n const len = keys.length;\n let key;\n for (i = 0; i < len; i++) {\n key = keys[i];\n obj[key] = arr[key];\n }\n return obj;\n}\n\n/**\n * It takes a FormData object and returns a JavaScript object\n *\n * @param {string} formData The FormData object to convert to JSON.\n *\n * @returns {Object<string, any> | null} The converted object.\n */\nfunction formDataToJSON(formData) {\n function buildPath(path, value, target, index) {\n let name = path[index++];\n\n if (name === '__proto__') return true;\n\n const isNumericKey = Number.isFinite(+name);\n const isLast = index >= path.length;\n name = !name && utils.isArray(target) ? target.length : name;\n\n if (isLast) {\n if (utils.hasOwnProp(target, name)) {\n target[name] = [target[name], value];\n } else {\n target[name] = value;\n }\n\n return !isNumericKey;\n }\n\n if (!target[name] || !utils.isObject(target[name])) {\n target[name] = [];\n }\n\n const result = buildPath(path, value, target[name], index);\n\n if (result && utils.isArray(target[name])) {\n target[name] = arrayToObject(target[name]);\n }\n\n return !isNumericKey;\n }\n\n if (utils.isFormData(formData) && utils.isFunction(formData.entries)) {\n const obj = {};\n\n utils.forEachEntry(formData, (name, value) => {\n buildPath(parsePropPath(name), value, obj, 0);\n });\n\n return obj;\n }\n\n return null;\n}\n\nexport default formDataToJSON;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\nimport transitionalDefaults from './transitional.js';\nimport toFormData from '../helpers/toFormData.js';\nimport toURLEncodedForm from '../helpers/toURLEncodedForm.js';\nimport platform from '../platform/index.js';\nimport formDataToJSON from '../helpers/formDataToJSON.js';\n\n/**\n * It takes a string, tries to parse it, and if it fails, it returns the stringified version\n * of the input\n *\n * @param {any} rawValue - The value to be stringified.\n * @param {Function} parser - A function that parses a string into a JavaScript object.\n * @param {Function} encoder - A function that takes a value and returns a string.\n *\n * @returns {string} A stringified version of the rawValue.\n */\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nconst defaults = {\n\n transitional: transitionalDefaults,\n\n adapter: ['xhr', 'http'],\n\n transformRequest: [function transformRequest(data, headers) {\n const contentType = headers.getContentType() || '';\n const hasJSONContentType = contentType.indexOf('application/json') > -1;\n const isObjectPayload = utils.isObject(data);\n\n if (isObjectPayload && utils.isHTMLForm(data)) {\n data = new FormData(data);\n }\n\n const isFormData = utils.isFormData(data);\n\n if (isFormData) {\n return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;\n }\n\n if (utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);\n return data.toString();\n }\n\n let isFileList;\n\n if (isObjectPayload) {\n if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {\n return toURLEncodedForm(data, this.formSerializer).toString();\n }\n\n if ((isFileList = utils.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {\n const _FormData = this.env && this.env.FormData;\n\n return toFormData(\n isFileList ? {'files[]': data} : data,\n _FormData && new _FormData(),\n this.formSerializer\n );\n }\n }\n\n if (isObjectPayload || hasJSONContentType ) {\n headers.setContentType('application/json', false);\n return stringifySafely(data);\n }\n\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n const transitional = this.transitional || defaults.transitional;\n const forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n const JSONRequested = this.responseType === 'json';\n\n if (data && utils.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {\n const silentJSONParsing = transitional && transitional.silentJSONParsing;\n const strictJSONParsing = !silentJSONParsing && JSONRequested;\n\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n env: {\n FormData: platform.classes.FormData,\n Blob: platform.classes.Blob\n },\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n },\n\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*',\n 'Content-Type': undefined\n }\n }\n};\n\nutils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {\n defaults.headers[method] = {};\n});\n\nexport default defaults;\n","'use strict';\n\nimport utils from './../utils.js';\n\n// RawAxiosHeaders whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nconst ignoreDuplicateOf = utils.toObjectSet([\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n]);\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} rawHeaders Headers needing to be parsed\n *\n * @returns {Object} Headers parsed into an object\n */\nexport default rawHeaders => {\n const parsed = {};\n let key;\n let val;\n let i;\n\n rawHeaders && rawHeaders.split('\\n').forEach(function parser(line) {\n i = line.indexOf(':');\n key = line.substring(0, i).trim().toLowerCase();\n val = line.substring(i + 1).trim();\n\n if (!key || (parsed[key] && ignoreDuplicateOf[key])) {\n return;\n }\n\n if (key === 'set-cookie') {\n if (parsed[key]) {\n parsed[key].push(val);\n } else {\n parsed[key] = [val];\n }\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n });\n\n return parsed;\n};\n","'use strict';\n\nimport utils from '../utils.js';\nimport parseHeaders from '../helpers/parseHeaders.js';\n\nconst $internals = Symbol('internals');\n\nfunction normalizeHeader(header) {\n return header && String(header).trim().toLowerCase();\n}\n\nfunction normalizeValue(value) {\n if (value === false || value == null) {\n return value;\n }\n\n return utils.isArray(value) ? value.map(normalizeValue) : String(value);\n}\n\nfunction parseTokens(str) {\n const tokens = Object.create(null);\n const tokensRE = /([^\\s,;=]+)\\s*(?:=\\s*([^,;]+))?/g;\n let match;\n\n while ((match = tokensRE.exec(str))) {\n tokens[match[1]] = match[2];\n }\n\n return tokens;\n}\n\nconst isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());\n\nfunction matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {\n if (utils.isFunction(filter)) {\n return filter.call(this, value, header);\n }\n\n if (isHeaderNameFilter) {\n value = header;\n }\n\n if (!utils.isString(value)) return;\n\n if (utils.isString(filter)) {\n return value.indexOf(filter) !== -1;\n }\n\n if (utils.isRegExp(filter)) {\n return filter.test(value);\n }\n}\n\nfunction formatHeader(header) {\n return header.trim()\n .toLowerCase().replace(/([a-z\\d])(\\w*)/g, (w, char, str) => {\n return char.toUpperCase() + str;\n });\n}\n\nfunction buildAccessors(obj, header) {\n const accessorName = utils.toCamelCase(' ' + header);\n\n ['get', 'set', 'has'].forEach(methodName => {\n Object.defineProperty(obj, methodName + accessorName, {\n value: function(arg1, arg2, arg3) {\n return this[methodName].call(this, header, arg1, arg2, arg3);\n },\n configurable: true\n });\n });\n}\n\nclass AxiosHeaders {\n constructor(headers) {\n headers && this.set(headers);\n }\n\n set(header, valueOrRewrite, rewrite) {\n const self = this;\n\n function setHeader(_value, _header, _rewrite) {\n const lHeader = normalizeHeader(_header);\n\n if (!lHeader) {\n throw new Error('header name must be a non-empty string');\n }\n\n const key = utils.findKey(self, lHeader);\n\n if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {\n self[key || _header] = normalizeValue(_value);\n }\n }\n\n const setHeaders = (headers, _rewrite) =>\n utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));\n\n if (utils.isPlainObject(header) || header instanceof this.constructor) {\n setHeaders(header, valueOrRewrite)\n } else if(utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {\n setHeaders(parseHeaders(header), valueOrRewrite);\n } else {\n header != null && setHeader(valueOrRewrite, header, rewrite);\n }\n\n return this;\n }\n\n get(header, parser) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n if (key) {\n const value = this[key];\n\n if (!parser) {\n return value;\n }\n\n if (parser === true) {\n return parseTokens(value);\n }\n\n if (utils.isFunction(parser)) {\n return parser.call(this, value, key);\n }\n\n if (utils.isRegExp(parser)) {\n return parser.exec(value);\n }\n\n throw new TypeError('parser must be boolean|regexp|function');\n }\n }\n }\n\n has(header, matcher) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));\n }\n\n return false;\n }\n\n delete(header, matcher) {\n const self = this;\n let deleted = false;\n\n function deleteHeader(_header) {\n _header = normalizeHeader(_header);\n\n if (_header) {\n const key = utils.findKey(self, _header);\n\n if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {\n delete self[key];\n\n deleted = true;\n }\n }\n }\n\n if (utils.isArray(header)) {\n header.forEach(deleteHeader);\n } else {\n deleteHeader(header);\n }\n\n return deleted;\n }\n\n clear(matcher) {\n const keys = Object.keys(this);\n let i = keys.length;\n let deleted = false;\n\n while (i--) {\n const key = keys[i];\n if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {\n delete this[key];\n deleted = true;\n }\n }\n\n return deleted;\n }\n\n normalize(format) {\n const self = this;\n const headers = {};\n\n utils.forEach(this, (value, header) => {\n const key = utils.findKey(headers, header);\n\n if (key) {\n self[key] = normalizeValue(value);\n delete self[header];\n return;\n }\n\n const normalized = format ? formatHeader(header) : String(header).trim();\n\n if (normalized !== header) {\n delete self[header];\n }\n\n self[normalized] = normalizeValue(value);\n\n headers[normalized] = true;\n });\n\n return this;\n }\n\n concat(...targets) {\n return this.constructor.concat(this, ...targets);\n }\n\n toJSON(asStrings) {\n const obj = Object.create(null);\n\n utils.forEach(this, (value, header) => {\n value != null && value !== false && (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value);\n });\n\n return obj;\n }\n\n [Symbol.iterator]() {\n return Object.entries(this.toJSON())[Symbol.iterator]();\n }\n\n toString() {\n return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\\n');\n }\n\n get [Symbol.toStringTag]() {\n return 'AxiosHeaders';\n }\n\n static from(thing) {\n return thing instanceof this ? thing : new this(thing);\n }\n\n static concat(first, ...targets) {\n const computed = new this(first);\n\n targets.forEach((target) => computed.set(target));\n\n return computed;\n }\n\n static accessor(header) {\n const internals = this[$internals] = (this[$internals] = {\n accessors: {}\n });\n\n const accessors = internals.accessors;\n const prototype = this.prototype;\n\n function defineAccessor(_header) {\n const lHeader = normalizeHeader(_header);\n\n if (!accessors[lHeader]) {\n buildAccessors(prototype, _header);\n accessors[lHeader] = true;\n }\n }\n\n utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);\n\n return this;\n }\n}\n\nAxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);\n\n// reserved names hotfix\nutils.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {\n let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`\n return {\n get: () => value,\n set(headerValue) {\n this[mapped] = headerValue;\n }\n }\n});\n\nutils.freezeMethods(AxiosHeaders);\n\nexport default AxiosHeaders;\n","'use strict';\n\nimport utils from './../utils.js';\nimport defaults from '../defaults/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Array|Function} fns A single function or Array of functions\n * @param {?Object} response The response object\n *\n * @returns {*} The resulting transformed data\n */\nexport default function transformData(fns, response) {\n const config = this || defaults;\n const context = response || config;\n const headers = AxiosHeaders.from(context.headers);\n let data = context.data;\n\n utils.forEach(fns, function transform(fn) {\n data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);\n });\n\n headers.normalize();\n\n return data;\n}\n","'use strict';\n\nexport default function isCancel(value) {\n return !!(value && value.__CANCEL__);\n}\n","'use strict';\n\nimport AxiosError from '../core/AxiosError.js';\nimport utils from '../utils.js';\n\n/**\n * A `CanceledError` is an object that is thrown when an operation is canceled.\n *\n * @param {string=} message The message.\n * @param {Object=} config The config.\n * @param {Object=} request The request.\n *\n * @returns {CanceledError} The created error.\n */\nfunction CanceledError(message, config, request) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);\n this.name = 'CanceledError';\n}\n\nutils.inherits(CanceledError, AxiosError, {\n __CANCEL__: true\n});\n\nexport default CanceledError;\n","'use strict';\n\nimport AxiosError from './AxiosError.js';\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n *\n * @returns {object} The response.\n */\nexport default function settle(resolve, reject, response) {\n const validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(new AxiosError(\n 'Request failed with status code ' + response.status,\n [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],\n response.config,\n response.request,\n response\n ));\n }\n}\n","import utils from './../utils.js';\nimport platform from '../platform/index.js';\n\nexport default platform.hasStandardBrowserEnv ?\n\n // Standard browser envs support document.cookie\n {\n write(name, value, expires, path, domain, secure) {\n const cookie = [name + '=' + encodeURIComponent(value)];\n\n utils.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());\n\n utils.isString(path) && cookie.push('path=' + path);\n\n utils.isString(domain) && cookie.push('domain=' + domain);\n\n secure === true && cookie.push('secure');\n\n document.cookie = cookie.join('; ');\n },\n\n read(name) {\n const match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n }\n\n :\n\n // Non-standard browser env (web workers, react-native) lack needed support.\n {\n write() {},\n read() {\n return null;\n },\n remove() {}\n };\n\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n *\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nexport default function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"<scheme>://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(url);\n}\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n *\n * @returns {string} The combined URL\n */\nexport default function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/?\\/$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n}\n","'use strict';\n\nimport isAbsoluteURL from '../helpers/isAbsoluteURL.js';\nimport combineURLs from '../helpers/combineURLs.js';\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n *\n * @returns {string} The combined full path\n */\nexport default function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n}\n","'use strict';\n\nimport utils from './../utils.js';\nimport platform from '../platform/index.js';\n\nexport default platform.hasStandardBrowserEnv ?\n\n// Standard browser envs have full support of the APIs needed to test\n// whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n const msie = /(msie|trident)/i.test(navigator.userAgent);\n const urlParsingNode = document.createElement('a');\n let originURL;\n\n /**\n * Parse a URL to discover its components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n let href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n const parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })();\n","'use strict';\n\nexport default function parseProtocol(url) {\n const match = /^([-+\\w]{1,25})(:?\\/\\/|:)/.exec(url);\n return match && match[1] || '';\n}\n","'use strict';\n\n/**\n * Calculate data maxRate\n * @param {Number} [samplesCount= 10]\n * @param {Number} [min= 1000]\n * @returns {Function}\n */\nfunction speedometer(samplesCount, min) {\n samplesCount = samplesCount || 10;\n const bytes = new Array(samplesCount);\n const timestamps = new Array(samplesCount);\n let head = 0;\n let tail = 0;\n let firstSampleTS;\n\n min = min !== undefined ? min : 1000;\n\n return function push(chunkLength) {\n const now = Date.now();\n\n const startedAt = timestamps[tail];\n\n if (!firstSampleTS) {\n firstSampleTS = now;\n }\n\n bytes[head] = chunkLength;\n timestamps[head] = now;\n\n let i = tail;\n let bytesCount = 0;\n\n while (i !== head) {\n bytesCount += bytes[i++];\n i = i % samplesCount;\n }\n\n head = (head + 1) % samplesCount;\n\n if (head === tail) {\n tail = (tail + 1) % samplesCount;\n }\n\n if (now - firstSampleTS < min) {\n return;\n }\n\n const passed = startedAt && now - startedAt;\n\n return passed ? Math.round(bytesCount * 1000 / passed) : undefined;\n };\n}\n\nexport default speedometer;\n","'use strict';\n\nimport utils from './../utils.js';\nimport settle from './../core/settle.js';\nimport cookies from './../helpers/cookies.js';\nimport buildURL from './../helpers/buildURL.js';\nimport buildFullPath from '../core/buildFullPath.js';\nimport isURLSameOrigin from './../helpers/isURLSameOrigin.js';\nimport transitionalDefaults from '../defaults/transitional.js';\nimport AxiosError from '../core/AxiosError.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport parseProtocol from '../helpers/parseProtocol.js';\nimport platform from '../platform/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport speedometer from '../helpers/speedometer.js';\n\nfunction progressEventReducer(listener, isDownloadStream) {\n let bytesNotified = 0;\n const _speedometer = speedometer(50, 250);\n\n return e => {\n const loaded = e.loaded;\n const total = e.lengthComputable ? e.total : undefined;\n const progressBytes = loaded - bytesNotified;\n const rate = _speedometer(progressBytes);\n const inRange = loaded <= total;\n\n bytesNotified = loaded;\n\n const data = {\n loaded,\n total,\n progress: total ? (loaded / total) : undefined,\n bytes: progressBytes,\n rate: rate ? rate : undefined,\n estimated: rate && total && inRange ? (total - loaded) / rate : undefined,\n event: e\n };\n\n data[isDownloadStream ? 'download' : 'upload'] = true;\n\n listener(data);\n };\n}\n\nconst isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';\n\nexport default isXHRAdapterSupported && function (config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n let requestData = config.data;\n const requestHeaders = AxiosHeaders.from(config.headers).normalize();\n let {responseType, withXSRFToken} = config;\n let onCanceled;\n function done() {\n if (config.cancelToken) {\n config.cancelToken.unsubscribe(onCanceled);\n }\n\n if (config.signal) {\n config.signal.removeEventListener('abort', onCanceled);\n }\n }\n\n let contentType;\n\n if (utils.isFormData(requestData)) {\n if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {\n requestHeaders.setContentType(false); // Let the browser set it\n } else if ((contentType = requestHeaders.getContentType()) !== false) {\n // fix semicolon duplication issue for ReactNative FormData implementation\n const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];\n requestHeaders.setContentType([type || 'multipart/form-data', ...tokens].join('; '));\n }\n }\n\n let request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n const username = config.auth.username || '';\n const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.set('Authorization', 'Basic ' + btoa(username + ':' + password));\n }\n\n const fullPath = buildFullPath(config.baseURL, config.url);\n\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n const responseHeaders = AxiosHeaders.from(\n 'getAllResponseHeaders' in request && request.getAllResponseHeaders()\n );\n const responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n const response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config,\n request\n };\n\n settle(function _resolve(value) {\n resolve(value);\n done();\n }, function _reject(err) {\n reject(err);\n done();\n }, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';\n const transitional = config.transitional || transitionalDefaults;\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(new AxiosError(\n timeoutErrorMessage,\n transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,\n config,\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if(platform.hasStandardBrowserEnv) {\n withXSRFToken && utils.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config));\n\n if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(fullPath))) {\n // Add xsrf header\n const xsrfValue = config.xsrfHeaderName && config.xsrfCookieName && cookies.read(config.xsrfCookieName);\n\n if (xsrfValue) {\n requestHeaders.set(config.xsrfHeaderName, xsrfValue);\n }\n }\n }\n\n // Remove Content-Type if data is undefined\n requestData === undefined && requestHeaders.setContentType(null);\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {\n request.setRequestHeader(key, val);\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = config.responseType;\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', progressEventReducer(config.onDownloadProgress, true));\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', progressEventReducer(config.onUploadProgress));\n }\n\n if (config.cancelToken || config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = cancel => {\n if (!request) {\n return;\n }\n reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);\n request.abort();\n request = null;\n };\n\n config.cancelToken && config.cancelToken.subscribe(onCanceled);\n if (config.signal) {\n config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);\n }\n }\n\n const protocol = parseProtocol(fullPath);\n\n if (protocol && platform.protocols.indexOf(protocol) === -1) {\n reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));\n return;\n }\n\n\n // Send the request\n request.send(requestData || null);\n });\n}\n","import utils from '../utils.js';\nimport httpAdapter from './http.js';\nimport xhrAdapter from './xhr.js';\nimport AxiosError from \"../core/AxiosError.js\";\n\nconst knownAdapters = {\n http: httpAdapter,\n xhr: xhrAdapter\n}\n\nutils.forEach(knownAdapters, (fn, value) => {\n if (fn) {\n try {\n Object.defineProperty(fn, 'name', {value});\n } catch (e) {\n // eslint-disable-next-line no-empty\n }\n Object.defineProperty(fn, 'adapterName', {value});\n }\n});\n\nconst renderReason = (reason) => `- ${reason}`;\n\nconst isResolvedHandle = (adapter) => utils.isFunction(adapter) || adapter === null || adapter === false;\n\nexport default {\n getAdapter: (adapters) => {\n adapters = utils.isArray(adapters) ? adapters : [adapters];\n\n const {length} = adapters;\n let nameOrAdapter;\n let adapter;\n\n const rejectedReasons = {};\n\n for (let i = 0; i < length; i++) {\n nameOrAdapter = adapters[i];\n let id;\n\n adapter = nameOrAdapter;\n\n if (!isResolvedHandle(nameOrAdapter)) {\n adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];\n\n if (adapter === undefined) {\n throw new AxiosError(`Unknown adapter '${id}'`);\n }\n }\n\n if (adapter) {\n break;\n }\n\n rejectedReasons[id || '#' + i] = adapter;\n }\n\n if (!adapter) {\n\n const reasons = Object.entries(rejectedReasons)\n .map(([id, state]) => `adapter ${id} ` +\n (state === false ? 'is not supported by the environment' : 'is not available in the build')\n );\n\n let s = length ?\n (reasons.length > 1 ? 'since :\\n' + reasons.map(renderReason).join('\\n') : ' ' + renderReason(reasons[0])) :\n 'as no adapter specified';\n\n throw new AxiosError(\n `There is no suitable adapter to dispatch the request ` + s,\n 'ERR_NOT_SUPPORT'\n );\n }\n\n return adapter;\n },\n adapters: knownAdapters\n}\n","'use strict';\n\nimport transformData from './transformData.js';\nimport isCancel from '../cancel/isCancel.js';\nimport defaults from '../defaults/index.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport adapters from \"../adapters/adapters.js\";\n\n/**\n * Throws a `CanceledError` if cancellation has been requested.\n *\n * @param {Object} config The config that is to be used for the request\n *\n * @returns {void}\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n\n if (config.signal && config.signal.aborted) {\n throw new CanceledError(null, config);\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n *\n * @returns {Promise} The Promise to be fulfilled\n */\nexport default function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n config.headers = AxiosHeaders.from(config.headers);\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.transformRequest\n );\n\n if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {\n config.headers.setContentType('application/x-www-form-urlencoded', false);\n }\n\n const adapter = adapters.getAdapter(config.adapter || defaults.adapter);\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n config.transformResponse,\n response\n );\n\n response.headers = AxiosHeaders.from(response.headers);\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n config.transformResponse,\n reason.response\n );\n reason.response.headers = AxiosHeaders.from(reason.response.headers);\n }\n }\n\n return Promise.reject(reason);\n });\n}\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosHeaders from \"./AxiosHeaders.js\";\n\nconst headersToObject = (thing) => thing instanceof AxiosHeaders ? thing.toJSON() : thing;\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n *\n * @returns {Object} New object resulting from merging config2 to config1\n */\nexport default function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n const config = {};\n\n function getMergedValue(target, source, caseless) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge.call({caseless}, target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDeepProperties(a, b, caseless) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(a, b, caseless);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a, caseless);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function valueFromConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function defaultToConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDirectKeys(a, b, prop) {\n if (prop in config2) {\n return getMergedValue(a, b);\n } else if (prop in config1) {\n return getMergedValue(undefined, a);\n }\n }\n\n const mergeMap = {\n url: valueFromConfig2,\n method: valueFromConfig2,\n data: valueFromConfig2,\n baseURL: defaultToConfig2,\n transformRequest: defaultToConfig2,\n transformResponse: defaultToConfig2,\n paramsSerializer: defaultToConfig2,\n timeout: defaultToConfig2,\n timeoutMessage: defaultToConfig2,\n withCredentials: defaultToConfig2,\n withXSRFToken: defaultToConfig2,\n adapter: defaultToConfig2,\n responseType: defaultToConfig2,\n xsrfCookieName: defaultToConfig2,\n xsrfHeaderName: defaultToConfig2,\n onUploadProgress: defaultToConfig2,\n onDownloadProgress: defaultToConfig2,\n decompress: defaultToConfig2,\n maxContentLength: defaultToConfig2,\n maxBodyLength: defaultToConfig2,\n beforeRedirect: defaultToConfig2,\n transport: defaultToConfig2,\n httpAgent: defaultToConfig2,\n httpsAgent: defaultToConfig2,\n cancelToken: defaultToConfig2,\n socketPath: defaultToConfig2,\n responseEncoding: defaultToConfig2,\n validateStatus: mergeDirectKeys,\n headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)\n };\n\n utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {\n const merge = mergeMap[prop] || mergeDeepProperties;\n const configValue = merge(config1[prop], config2[prop], prop);\n (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);\n });\n\n return config;\n}\n","export const VERSION = \"1.6.7\";","'use strict';\n\nimport {VERSION} from '../env/data.js';\nimport AxiosError from '../core/AxiosError.js';\n\nconst validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nconst deprecatedWarnings = {};\n\n/**\n * Transitional option validator\n *\n * @param {function|boolean?} validator - set to false if the transitional option has been removed\n * @param {string?} version - deprecated version / removed since version\n * @param {string?} message - some message with additional info\n *\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n function formatMessage(opt, desc) {\n return '[Axios v' + VERSION + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return (value, opt, opts) => {\n if (validator === false) {\n throw new AxiosError(\n formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),\n AxiosError.ERR_DEPRECATED\n );\n }\n\n if (version && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n *\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n *\n * @returns {object}\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);\n }\n const keys = Object.keys(options);\n let i = keys.length;\n while (i-- > 0) {\n const opt = keys[i];\n const validator = schema[opt];\n if (validator) {\n const value = options[opt];\n const result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);\n }\n }\n}\n\nexport default {\n assertOptions,\n validators\n};\n","'use strict';\n\nimport utils from './../utils.js';\nimport buildURL from '../helpers/buildURL.js';\nimport InterceptorManager from './InterceptorManager.js';\nimport dispatchRequest from './dispatchRequest.js';\nimport mergeConfig from './mergeConfig.js';\nimport buildFullPath from './buildFullPath.js';\nimport validator from '../helpers/validator.js';\nimport AxiosHeaders from './AxiosHeaders.js';\n\nconst validators = validator.validators;\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n *\n * @return {Axios} A new instance of Axios\n */\nclass Axios {\n constructor(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n }\n\n /**\n * Dispatch a request\n *\n * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)\n * @param {?Object} config\n *\n * @returns {Promise} The Promise to be fulfilled\n */\n async request(configOrUrl, config) {\n try {\n return await this._request(configOrUrl, config);\n } catch (err) {\n if (err instanceof Error) {\n let dummy;\n\n Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : (dummy = new Error());\n\n // slice off the Error: ... line\n const stack = dummy.stack ? dummy.stack.replace(/^.+\\n/, '') : '';\n\n if (!err.stack) {\n err.stack = stack;\n // match without the 2 top stack lines\n } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\\n.+\\n/, ''))) {\n err.stack += '\\n' + stack\n }\n }\n\n throw err;\n }\n }\n\n _request(configOrUrl, config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof configOrUrl === 'string') {\n config = config || {};\n config.url = configOrUrl;\n } else {\n config = configOrUrl || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n const {transitional, paramsSerializer, headers} = config;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean),\n forcedJSONParsing: validators.transitional(validators.boolean),\n clarifyTimeoutError: validators.transitional(validators.boolean)\n }, false);\n }\n\n if (paramsSerializer != null) {\n if (utils.isFunction(paramsSerializer)) {\n config.paramsSerializer = {\n serialize: paramsSerializer\n }\n } else {\n validator.assertOptions(paramsSerializer, {\n encode: validators.function,\n serialize: validators.function\n }, true);\n }\n }\n\n // Set config.method\n config.method = (config.method || this.defaults.method || 'get').toLowerCase();\n\n // Flatten headers\n let contextHeaders = headers && utils.merge(\n headers.common,\n headers[config.method]\n );\n\n headers && utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n (method) => {\n delete headers[method];\n }\n );\n\n config.headers = AxiosHeaders.concat(contextHeaders, headers);\n\n // filter out skipped interceptors\n const requestInterceptorChain = [];\n let synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n const responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n let promise;\n let i = 0;\n let len;\n\n if (!synchronousRequestInterceptors) {\n const chain = [dispatchRequest.bind(this), undefined];\n chain.unshift.apply(chain, requestInterceptorChain);\n chain.push.apply(chain, responseInterceptorChain);\n len = chain.length;\n\n promise = Promise.resolve(config);\n\n while (i < len) {\n promise = promise.then(chain[i++], chain[i++]);\n }\n\n return promise;\n }\n\n len = requestInterceptorChain.length;\n\n let newConfig = config;\n\n i = 0;\n\n while (i < len) {\n const onFulfilled = requestInterceptorChain[i++];\n const onRejected = requestInterceptorChain[i++];\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected.call(this, error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest.call(this, newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n i = 0;\n len = responseInterceptorChain.length;\n\n while (i < len) {\n promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);\n }\n\n return promise;\n }\n\n getUri(config) {\n config = mergeConfig(this.defaults, config);\n const fullPath = buildFullPath(config.baseURL, config.url);\n return buildURL(fullPath, config.params, config.paramsSerializer);\n }\n}\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n\n function generateHTTPMethod(isForm) {\n return function httpMethod(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n headers: isForm ? {\n 'Content-Type': 'multipart/form-data'\n } : {},\n url,\n data\n }));\n };\n }\n\n Axios.prototype[method] = generateHTTPMethod();\n\n Axios.prototype[method + 'Form'] = generateHTTPMethod(true);\n});\n\nexport default Axios;\n","'use strict';\n\nimport CanceledError from './CanceledError.js';\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @param {Function} executor The executor function.\n *\n * @returns {CancelToken}\n */\nclass CancelToken {\n constructor(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n let resolvePromise;\n\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n const token = this;\n\n // eslint-disable-next-line func-names\n this.promise.then(cancel => {\n if (!token._listeners) return;\n\n let i = token._listeners.length;\n\n while (i-- > 0) {\n token._listeners[i](cancel);\n }\n token._listeners = null;\n });\n\n // eslint-disable-next-line func-names\n this.promise.then = onfulfilled => {\n let _resolve;\n // eslint-disable-next-line func-names\n const promise = new Promise(resolve => {\n token.subscribe(resolve);\n _resolve = resolve;\n }).then(onfulfilled);\n\n promise.cancel = function reject() {\n token.unsubscribe(_resolve);\n };\n\n return promise;\n };\n\n executor(function cancel(message, config, request) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new CanceledError(message, config, request);\n resolvePromise(token.reason);\n });\n }\n\n /**\n * Throws a `CanceledError` if cancellation has been requested.\n */\n throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n }\n\n /**\n * Subscribe to the cancel signal\n */\n\n subscribe(listener) {\n if (this.reason) {\n listener(this.reason);\n return;\n }\n\n if (this._listeners) {\n this._listeners.push(listener);\n } else {\n this._listeners = [listener];\n }\n }\n\n /**\n * Unsubscribe from the cancel signal\n */\n\n unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n const index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n }\n\n /**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\n static source() {\n let cancel;\n const token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token,\n cancel\n };\n }\n}\n\nexport default CancelToken;\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n *\n * @returns {Function}\n */\nexport default function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n *\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nexport default function isAxiosError(payload) {\n return utils.isObject(payload) && (payload.isAxiosError === true);\n}\n","const HttpStatusCode = {\n Continue: 100,\n SwitchingProtocols: 101,\n Processing: 102,\n EarlyHints: 103,\n Ok: 200,\n Created: 201,\n Accepted: 202,\n NonAuthoritativeInformation: 203,\n NoContent: 204,\n ResetContent: 205,\n PartialContent: 206,\n MultiStatus: 207,\n AlreadyReported: 208,\n ImUsed: 226,\n MultipleChoices: 300,\n MovedPermanently: 301,\n Found: 302,\n SeeOther: 303,\n NotModified: 304,\n UseProxy: 305,\n Unused: 306,\n TemporaryRedirect: 307,\n PermanentRedirect: 308,\n BadRequest: 400,\n Unauthorized: 401,\n PaymentRequired: 402,\n Forbidden: 403,\n NotFound: 404,\n MethodNotAllowed: 405,\n NotAcceptable: 406,\n ProxyAuthenticationRequired: 407,\n RequestTimeout: 408,\n Conflict: 409,\n Gone: 410,\n LengthRequired: 411,\n PreconditionFailed: 412,\n PayloadTooLarge: 413,\n UriTooLong: 414,\n UnsupportedMediaType: 415,\n RangeNotSatisfiable: 416,\n ExpectationFailed: 417,\n ImATeapot: 418,\n MisdirectedRequest: 421,\n UnprocessableEntity: 422,\n Locked: 423,\n FailedDependency: 424,\n TooEarly: 425,\n UpgradeRequired: 426,\n PreconditionRequired: 428,\n TooManyRequests: 429,\n RequestHeaderFieldsTooLarge: 431,\n UnavailableForLegalReasons: 451,\n InternalServerError: 500,\n NotImplemented: 501,\n BadGateway: 502,\n ServiceUnavailable: 503,\n GatewayTimeout: 504,\n HttpVersionNotSupported: 505,\n VariantAlsoNegotiates: 506,\n InsufficientStorage: 507,\n LoopDetected: 508,\n NotExtended: 510,\n NetworkAuthenticationRequired: 511,\n};\n\nObject.entries(HttpStatusCode).forEach(([key, value]) => {\n HttpStatusCode[value] = key;\n});\n\nexport default HttpStatusCode;\n","'use strict';\n\nimport utils from './utils.js';\nimport bind from './helpers/bind.js';\nimport Axios from './core/Axios.js';\nimport mergeConfig from './core/mergeConfig.js';\nimport defaults from './defaults/index.js';\nimport formDataToJSON from './helpers/formDataToJSON.js';\nimport CanceledError from './cancel/CanceledError.js';\nimport CancelToken from './cancel/CancelToken.js';\nimport isCancel from './cancel/isCancel.js';\nimport {VERSION} from './env/data.js';\nimport toFormData from './helpers/toFormData.js';\nimport AxiosError from './core/AxiosError.js';\nimport spread from './helpers/spread.js';\nimport isAxiosError from './helpers/isAxiosError.js';\nimport AxiosHeaders from \"./core/AxiosHeaders.js\";\nimport adapters from './adapters/adapters.js';\nimport HttpStatusCode from './helpers/HttpStatusCode.js';\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n *\n * @returns {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n const context = new Axios(defaultConfig);\n const instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context, {allOwnKeys: true});\n\n // Copy context to instance\n utils.extend(instance, context, null, {allOwnKeys: true});\n\n // Factory for creating new instances\n instance.create = function create(instanceConfig) {\n return createInstance(mergeConfig(defaultConfig, instanceConfig));\n };\n\n return instance;\n}\n\n// Create the default instance to be exported\nconst axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Expose Cancel & CancelToken\naxios.CanceledError = CanceledError;\naxios.CancelToken = CancelToken;\naxios.isCancel = isCancel;\naxios.VERSION = VERSION;\naxios.toFormData = toFormData;\n\n// Expose AxiosError class\naxios.AxiosError = AxiosError;\n\n// alias for CanceledError for backward compatibility\naxios.Cancel = axios.CanceledError;\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\n\naxios.spread = spread;\n\n// Expose isAxiosError\naxios.isAxiosError = isAxiosError;\n\n// Expose mergeConfig\naxios.mergeConfig = mergeConfig;\n\naxios.AxiosHeaders = AxiosHeaders;\n\naxios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);\n\naxios.getAdapter = adapters.getAdapter;\n\naxios.HttpStatusCode = HttpStatusCode;\n\naxios.default = axios;\n\n// this module should only have a default export\nexport default axios\n","import axios from './lib/axios.js';\n\n// This module is intended to unwrap Axios default export as named.\n// Keep top-level export same with static properties\n// so that it can keep same with es module or cjs\nconst {\n Axios,\n AxiosError,\n CanceledError,\n isCancel,\n CancelToken,\n VERSION,\n all,\n Cancel,\n isAxiosError,\n spread,\n toFormData,\n AxiosHeaders,\n HttpStatusCode,\n formToJSON,\n getAdapter,\n mergeConfig\n} = axios;\n\nexport {\n axios as default,\n Axios,\n AxiosError,\n CanceledError,\n isCancel,\n CancelToken,\n VERSION,\n all,\n Cancel,\n isAxiosError,\n spread,\n toFormData,\n AxiosHeaders,\n HttpStatusCode,\n formToJSON,\n getAdapter,\n mergeConfig\n}\n"],"names":["AxiosError","utils","prototype","toFormData","encode","URLSearchParams","FormData","Blob","platform","AxiosHeaders","defaults","isCancel","CanceledError","mergeConfig","VERSION","validators","Axios","InterceptorManager","CancelToken","spread","isAxiosError","HttpStatusCode","axios"],"mappings":";AAEe,SAAS,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE;AAC1C,EAAE,OAAO,SAAS,IAAI,GAAG;AACzB,IAAI,OAAO,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;AACxC,GAAG,CAAC;AACJ;;ACFA;AACA;AACA,MAAM,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC,SAAS,CAAC;AACpC,MAAM,CAAC,cAAc,CAAC,GAAG,MAAM,CAAC;AAChC;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W,GAAGP,aAAW,CAAC;AAChC;AACA,KAAK,CAAC,YAAY,GAAGJ,cAAY,CAAC;AAClC;AACA,KAAK,CAAC,UAAU,GAAG,KAAK,IAAI,cAAc,CAACR,OAAK,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,IAAI,QAAQ,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,CAAC;AAClG;AACA,KAAK,CAAC,UAAU,GAAG,QAAQ,CAAC,UAAU,CAAC;AACvC;AACA,KAAK,CAAC,cAAc,GAAGoB,gBAAc,CAAC;AACtC;AACA,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC;AACtB;AACA;AACA,gBAAe;;ACtFf;AACA;AACA;AACK,MAAC;AACN,EAAE,KAAK;AACP,EAAE,UAAU;AACZ,EAAE,aAAa;AACf,EAAE,QAAQ;AACV,EAAE,WAAW;AACb,EAAE,OAAO;AACT,EAAE,GAAG;AACL,EAAE,MAAM;AACR,EAAE,YAAY;AACd,EAAE,MAAM;AACR,EAAE,UAAU;AACZ,EAAE,YAAY;AACd,EAAE,cAAc;AAChB,EAAE,UAAU;AACZ,EAAE,UAAU;AACZ,EAAE,WAAW;AACb,CAAC,GAAGC;;;;"} \ No newline at end of file
diff --git a/node_modules/axios/dist/esm/axios.min.js b/node_modules/axios/dist/esm/axios.min.js
new file mode 100644
index 0000000..a4caede
--- /dev/null
+++ b/node_modules/axios/dist/esm/axios.min.js
@@ -0,0 +1,2 @@
+function e(e,t){return function(){return e.apply(t,arguments)}}const{toString:t}=Object.prototype,{getPrototypeOf:n}=Object,r=(o=Object.create(null),e=>{const n=t.call(e);return o[n]||(o[n]=n.slice(8,-1).toLowerCase())});var o;const s=e=>(e=e.toLowerCase(),t=>r(t)===e),i=e=>t=>typeof t===e,{isArray:a}=Array,c=i("undefined");const u=s("ArrayBuffer");const l=i("string"),f=i("function"),d=i("number"),p=e=>null!==e&&"object"==typeof e,h=e=>{if("object"!==r(e))return!1;const t=n(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},m=s("Date"),y=s("File"),g=s("Blob"),b=s("FileList"),E=s("URLSearchParams");function w(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),a(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{const o=n?Object.getOwnPropertyNames(e):Object.keys(e),s=o.length;let i;for(r=0;r<s;r++)i=o[r],t.call(null,e[i],i,e)}}function O(e,t){t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const S="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,R=e=>!c(e)&&e!==S;const A=(T="undefined"!=typeof Uint8Array&&n(Uint8Array),e=>T&&e instanceof T);var T;const j=s("HTMLFormElement"),C=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),N=s("RegExp"),v=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};w(n,((n,o)=>{let s;!1!==(s=t(n,o,e))&&(r[o]=s||n)})),Object.defineProperties(e,r)},x="abcdefghijklmnopqrstuvwxyz",P={DIGIT:"0123456789",ALPHA:x,ALPHA_DIGIT:x+x.toUpperCase()+"0123456789"};const _=s("AsyncFunction"),F={isArray:a,isArrayBuffer:u,isBuffer:function(e){return null!==e&&!c(e)&&null!==e.constructor&&!c(e.constructor)&&f(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||f(e.append)&&("formdata"===(t=r(e))||"object"===t&&f(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&u(e.buffer),t},isString:l,isNumber:d,isBoolean:e=>!0===e||!1===e,isObject:p,isPlainObject:h,isUndefined:c,isDate:m,isFile:y,isBlob:g,isRegExp:N,isFunction:f,isStream:e=>p(e)&&f(e.pipe),isURLSearchParams:E,isTypedArray:A,isFileList:b,forEach:w,merge:function e(){const{caseless:t}=R(this)&&this||{},n={},r=(r,o)=>{const s=t&&O(n,o)||o;h(n[s])&&h(r)?n[s]=e(n[s],r):h(r)?n[s]=e({},r):a(r)?n[s]=r.slice():n[s]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&w(arguments[e],r);return n},extend:(t,n,r,{allOwnKeys:o}={})=>(w(n,((n,o)=>{r&&f(n)?t[o]=e(n,r):t[o]=n}),{allOwnKeys:o}),t),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,r,o)=>{let s,i,a;const c={};if(t=t||{},null==e)return t;do{for(s=Object.getOwnPropertyNames(e),i=s.length;i-- >0;)a=s[i],o&&!o(a,e,t)||c[a]||(t[a]=e[a],c[a]=!0);e=!1!==r&&n(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:r,kindOfTest:s,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(a(e))return e;let t=e.length;if(!d(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:j,hasOwnProperty:C,hasOwnProp:C,reduceDescriptors:v,freezeMethods:e=>{v(e,((t,n)=>{if(f(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];f(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return a(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:O,global:S,isContextDefined:R,ALPHABET:P,generateString:(e=16,t=P.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n},isSpecCompliantForm:function(e){return!!(e&&f(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(p(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const o=a(e)?[]:{};return w(e,((e,t)=>{const s=n(e,r+1);!c(s)&&(o[t]=s)})),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:_,isThenable:e=>e&&(p(e)||f(e))&&f(e.then)&&f(e.catch)};function U(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o)}F.inherits(U,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:F.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const B=U.prototype,D={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{D[e]={value:e}})),Object.defineProperties(U,D),Object.defineProperty(B,"isAxiosError",{value:!0}),U.from=(e,t,n,r,o,s)=>{const i=Object.create(B);return F.toFlatObject(e,i,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),U.call(i,e.message,t,n,r,o),i.cause=e,i.name=e.name,s&&Object.assign(i,s),i};function L(e){return F.isPlainObject(e)||F.isArray(e)}function k(e){return F.endsWith(e,"[]")?e.slice(0,-2):e}function q(e,t,n){return e?e.concat(t).map((function(e,t){return e=k(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const I=F.toFlatObject(F,{},null,(function(e){return/^is[A-Z]/.test(e)}));function z(e,t,n){if(!F.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=F.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!F.isUndefined(t[e])}))).metaTokens,o=n.visitor||u,s=n.dots,i=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&F.isSpecCompliantForm(t);if(!F.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(F.isDate(e))return e.toISOString();if(!a&&F.isBlob(e))throw new U("Blob is not supported. Use a Buffer instead.");return F.isArrayBuffer(e)||F.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function u(e,n,o){let a=e;if(e&&!o&&"object"==typeof e)if(F.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(F.isArray(e)&&function(e){return F.isArray(e)&&!e.some(L)}(e)||(F.isFileList(e)||F.endsWith(n,"[]"))&&(a=F.toArray(e)))return n=k(n),a.forEach((function(e,r){!F.isUndefined(e)&&null!==e&&t.append(!0===i?q([n],r,s):null===i?n:n+"[]",c(e))})),!1;return!!L(e)||(t.append(q(o,n,s),c(e)),!1)}const l=[],f=Object.assign(I,{defaultVisitor:u,convertValue:c,isVisitable:L});if(!F.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!F.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),F.forEach(n,(function(n,s){!0===(!(F.isUndefined(n)||null===n)&&o.call(t,n,F.isString(s)?s.trim():s,r,f))&&e(n,r?r.concat(s):[s])})),l.pop()}}(e),t}function M(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function H(e,t){this._pairs=[],e&&z(e,this,t)}const J=H.prototype;function W(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function V(e,t,n){if(!t)return e;const r=n&&n.encode||W,o=n&&n.serialize;let s;if(s=o?o(t,n):F.isURLSearchParams(t)?t.toString():new H(t,n).toString(r),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}J.append=function(e,t){this._pairs.push([e,t])},J.toString=function(e){const t=e?function(t){return e.call(this,t,M)}:M;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const K=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){F.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},G={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},$={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:H,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},X="undefined"!=typeof window&&"undefined"!=typeof document,Q=(Z="undefined"!=typeof navigator&&navigator.product,X&&["ReactNative","NativeScript","NS"].indexOf(Z)<0);var Z;const Y="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,ee={...Object.freeze({__proto__:null,hasBrowserEnv:X,hasStandardBrowserWebWorkerEnv:Y,hasStandardBrowserEnv:Q}),...$};function te(e){function t(e,n,r,o){let s=e[o++];if("__proto__"===s)return!0;const i=Number.isFinite(+s),a=o>=e.length;if(s=!s&&F.isArray(r)?r.length:s,a)return F.hasOwnProp(r,s)?r[s]=[r[s],n]:r[s]=n,!i;r[s]&&F.isObject(r[s])||(r[s]=[]);return t(e,n,r[s],o)&&F.isArray(r[s])&&(r[s]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let s;for(r=0;r<o;r++)s=n[r],t[s]=e[s];return t}(r[s])),!i}if(F.isFormData(e)&&F.isFunction(e.entries)){const n={};return F.forEachEntry(e,((e,r)=>{t(function(e){return F.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null}const ne={transitional:G,adapter:["xhr","http"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=F.isObject(e);o&&F.isHTMLForm(e)&&(e=new FormData(e));if(F.isFormData(e))return r?JSON.stringify(te(e)):e;if(F.isArrayBuffer(e)||F.isBuffer(e)||F.isStream(e)||F.isFile(e)||F.isBlob(e))return e;if(F.isArrayBufferView(e))return e.buffer;if(F.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return z(e,new ee.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return ee.isNode&&F.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((s=F.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return z(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(F.isString(e))try{return(t||JSON.parse)(e),F.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||ne.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(e&&F.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw U.from(e,U.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ee.classes.FormData,Blob:ee.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};F.forEach(["delete","get","head","post","put","patch"],(e=>{ne.headers[e]={}}));const re=ne,oe=F.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),se=Symbol("internals");function ie(e){return e&&String(e).trim().toLowerCase()}function ae(e){return!1===e||null==e?e:F.isArray(e)?e.map(ae):String(e)}function ce(e,t,n,r,o){return F.isFunction(r)?r.call(this,t,n):(o&&(t=n),F.isString(t)?F.isString(r)?-1!==t.indexOf(r):F.isRegExp(r)?r.test(t):void 0:void 0)}class ue{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=ie(t);if(!o)throw new Error("header name must be a non-empty string");const s=F.findKey(r,o);(!s||void 0===r[s]||!0===n||void 0===n&&!1!==r[s])&&(r[s||t]=ae(e))}const s=(e,t)=>F.forEach(e,((e,n)=>o(e,n,t)));return F.isPlainObject(e)||e instanceof this.constructor?s(e,t):F.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?s((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach((function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&oe[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t):null!=e&&o(t,e,n),this}get(e,t){if(e=ie(e)){const n=F.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(F.isFunction(t))return t.call(this,e,n);if(F.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=ie(e)){const n=F.findKey(this,e);return!(!n||void 0===this[n]||t&&!ce(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=ie(e)){const o=F.findKey(n,e);!o||t&&!ce(0,n[o],o,t)||(delete n[o],r=!0)}}return F.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!ce(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return F.forEach(this,((r,o)=>{const s=F.findKey(n,o);if(s)return t[s]=ae(r),void delete t[o];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(o):String(o).trim();i!==o&&delete t[o],t[i]=ae(r),n[i]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return F.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&F.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[se]=this[se]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=ie(e);t[r]||(!function(e,t){const n=F.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})}))}(n,e),t[r]=!0)}return F.isArray(e)?e.forEach(r):r(e),this}}ue.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),F.reduceDescriptors(ue.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),F.freezeMethods(ue);const le=ue;function fe(e,t){const n=this||re,r=t||n,o=le.from(r.headers);let s=r.data;return F.forEach(e,(function(e){s=e.call(n,s,o.normalize(),t?t.status:void 0)})),o.normalize(),s}function de(e){return!(!e||!e.__CANCEL__)}function pe(e,t,n){U.call(this,null==e?"canceled":e,U.ERR_CANCELED,t,n),this.name="CanceledError"}F.inherits(pe,U,{__CANCEL__:!0});const he=ee.hasStandardBrowserEnv?{write(e,t,n,r,o,s){const i=[e+"="+encodeURIComponent(t)];F.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),F.isString(r)&&i.push("path="+r),F.isString(o)&&i.push("domain="+o),!0===s&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function me(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const ye=ee.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let n;function r(n){let r=n;return e&&(t.setAttribute("href",r),r=t.href),t.setAttribute("href",r),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return n=r(window.location.href),function(e){const t=F.isString(e)?r(e):e;return t.protocol===n.protocol&&t.host===n.host}}():function(){return!0};function ge(e,t){let n=0;const r=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,s=0,i=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),u=r[i];o||(o=c),n[s]=a,r[s]=c;let l=i,f=0;for(;l!==s;)f+=n[l++],l%=e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),c-o<t)return;const d=u&&c-u;return d?Math.round(1e3*f/d):void 0}}(50,250);return o=>{const s=o.loaded,i=o.lengthComputable?o.total:void 0,a=s-n,c=r(a);n=s;const u={loaded:s,total:i,progress:i?s/i:void 0,bytes:a,rate:c||void 0,estimated:c&&i&&s<=i?(i-s)/c:void 0,event:o};u[t?"download":"upload"]=!0,e(u)}}const be={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){let r=e.data;const o=le.from(e.headers).normalize();let s,i,{responseType:a,withXSRFToken:c}=e;function u(){e.cancelToken&&e.cancelToken.unsubscribe(s),e.signal&&e.signal.removeEventListener("abort",s)}if(F.isFormData(r))if(ee.hasStandardBrowserEnv||ee.hasStandardBrowserWebWorkerEnv)o.setContentType(!1);else if(!1!==(i=o.getContentType())){const[e,...t]=i?i.split(";").map((e=>e.trim())).filter(Boolean):[];o.setContentType([e||"multipart/form-data",...t].join("; "))}let l=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",n=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.set("Authorization","Basic "+btoa(t+":"+n))}const f=me(e.baseURL,e.url);function d(){if(!l)return;const r=le.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders());!function(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new U("Request failed with status code "+n.status,[U.ERR_BAD_REQUEST,U.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}((function(e){t(e),u()}),(function(e){n(e),u()}),{data:a&&"text"!==a&&"json"!==a?l.response:l.responseText,status:l.status,statusText:l.statusText,headers:r,config:e,request:l}),l=null}if(l.open(e.method.toUpperCase(),V(f,e.params,e.paramsSerializer),!0),l.timeout=e.timeout,"onloadend"in l?l.onloadend=d:l.onreadystatechange=function(){l&&4===l.readyState&&(0!==l.status||l.responseURL&&0===l.responseURL.indexOf("file:"))&&setTimeout(d)},l.onabort=function(){l&&(n(new U("Request aborted",U.ECONNABORTED,e,l)),l=null)},l.onerror=function(){n(new U("Network Error",U.ERR_NETWORK,e,l)),l=null},l.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const r=e.transitional||G;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(new U(t,r.clarifyTimeoutError?U.ETIMEDOUT:U.ECONNABORTED,e,l)),l=null},ee.hasStandardBrowserEnv&&(c&&F.isFunction(c)&&(c=c(e)),c||!1!==c&&ye(f))){const t=e.xsrfHeaderName&&e.xsrfCookieName&&he.read(e.xsrfCookieName);t&&o.set(e.xsrfHeaderName,t)}void 0===r&&o.setContentType(null),"setRequestHeader"in l&&F.forEach(o.toJSON(),(function(e,t){l.setRequestHeader(t,e)})),F.isUndefined(e.withCredentials)||(l.withCredentials=!!e.withCredentials),a&&"json"!==a&&(l.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&l.addEventListener("progress",ge(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&l.upload&&l.upload.addEventListener("progress",ge(e.onUploadProgress)),(e.cancelToken||e.signal)&&(s=t=>{l&&(n(!t||t.type?new pe(null,e,l):t),l.abort(),l=null)},e.cancelToken&&e.cancelToken.subscribe(s),e.signal&&(e.signal.aborted?s():e.signal.addEventListener("abort",s)));const p=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(f);p&&-1===ee.protocols.indexOf(p)?n(new U("Unsupported protocol "+p+":",U.ERR_BAD_REQUEST,e)):l.send(r||null)}))}};F.forEach(be,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const Ee=e=>`- ${e}`,we=e=>F.isFunction(e)||null===e||!1===e,Oe=e=>{e=F.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let s=0;s<t;s++){let t;if(n=e[s],r=n,!we(n)&&(r=be[(t=String(n)).toLowerCase()],void 0===r))throw new U(`Unknown adapter '${t}'`);if(r)break;o[t||"#"+s]=r}if(!r){const e=Object.entries(o).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));throw new U("There is no suitable adapter to dispatch the request "+(t?e.length>1?"since :\n"+e.map(Ee).join("\n"):" "+Ee(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return r};function Se(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new pe(null,e)}function Re(e){Se(e),e.headers=le.from(e.headers),e.data=fe.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Oe(e.adapter||re.adapter)(e).then((function(t){return Se(e),t.data=fe.call(e,e.transformResponse,t),t.headers=le.from(t.headers),t}),(function(t){return de(t)||(Se(e),t&&t.response&&(t.response.data=fe.call(e,e.transformResponse,t.response),t.response.headers=le.from(t.response.headers))),Promise.reject(t)}))}const Ae=e=>e instanceof le?e.toJSON():e;function Te(e,t){t=t||{};const n={};function r(e,t,n){return F.isPlainObject(e)&&F.isPlainObject(t)?F.merge.call({caseless:n},e,t):F.isPlainObject(t)?F.merge({},t):F.isArray(t)?t.slice():t}function o(e,t,n){return F.isUndefined(t)?F.isUndefined(e)?void 0:r(void 0,e,n):r(e,t,n)}function s(e,t){if(!F.isUndefined(t))return r(void 0,t)}function i(e,t){return F.isUndefined(t)?F.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,o,s){return s in t?r(n,o):s in e?r(void 0,n):void 0}const c={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(e,t)=>o(Ae(e),Ae(t),!0)};return F.forEach(Object.keys(Object.assign({},e,t)),(function(r){const s=c[r]||o,i=s(e[r],t[r],r);F.isUndefined(i)&&s!==a||(n[r]=i)})),n}const je={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{je[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const Ce={};je.transitional=function(e,t,n){function r(e,t){return"[Axios v1.6.7] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,s)=>{if(!1===e)throw new U(r(o," has been removed"+(t?" in "+t:"")),U.ERR_DEPRECATED);return t&&!Ce[o]&&(Ce[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,s)}};const Ne={assertOptions:function(e,t,n){if("object"!=typeof e)throw new U("options must be an object",U.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const s=r[o],i=t[s];if(i){const t=e[s],n=void 0===t||i(t,s,e);if(!0!==n)throw new U("option "+s+" must be "+n,U.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new U("Unknown option "+s,U.ERR_BAD_OPTION)}},validators:je},ve=Ne.validators;class xe{constructor(e){this.defaults=e,this.interceptors={request:new K,response:new K}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t;Error.captureStackTrace?Error.captureStackTrace(t={}):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Te(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&Ne.assertOptions(n,{silentJSONParsing:ve.transitional(ve.boolean),forcedJSONParsing:ve.transitional(ve.boolean),clarifyTimeoutError:ve.transitional(ve.boolean)},!1),null!=r&&(F.isFunction(r)?t.paramsSerializer={serialize:r}:Ne.assertOptions(r,{encode:ve.function,serialize:ve.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=o&&F.merge(o.common,o[t.method]);o&&F.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete o[e]})),t.headers=le.concat(s,o);const i=[];let a=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,i.unshift(e.fulfilled,e.rejected))}));const c=[];let u;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let l,f=0;if(!a){const e=[Re.bind(this),void 0];for(e.unshift.apply(e,i),e.push.apply(e,c),l=e.length,u=Promise.resolve(t);f<l;)u=u.then(e[f++],e[f++]);return u}l=i.length;let d=t;for(f=0;f<l;){const e=i[f++],t=i[f++];try{d=e(d)}catch(e){t.call(this,e);break}}try{u=Re.call(this,d)}catch(e){return Promise.reject(e)}for(f=0,l=c.length;f<l;)u=u.then(c[f++],c[f++]);return u}getUri(e){return V(me((e=Te(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}F.forEach(["delete","get","head","options"],(function(e){xe.prototype[e]=function(t,n){return this.request(Te(n||{},{method:e,url:t,data:(n||{}).data}))}})),F.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,o){return this.request(Te(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}xe.prototype[e]=t(),xe.prototype[e+"Form"]=t(!0)}));const Pe=xe;class _e{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,o){n.reason||(n.reason=new pe(e,r,o),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;return{token:new _e((function(t){e=t})),cancel:e}}}const Fe=_e;const Ue={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ue).forEach((([e,t])=>{Ue[t]=e}));const Be=Ue;const De=function t(n){const r=new Pe(n),o=e(Pe.prototype.request,r);return F.extend(o,Pe.prototype,r,{allOwnKeys:!0}),F.extend(o,r,null,{allOwnKeys:!0}),o.create=function(e){return t(Te(n,e))},o}(re);De.Axios=Pe,De.CanceledError=pe,De.CancelToken=Fe,De.isCancel=de,De.VERSION="1.6.7",De.toFormData=z,De.AxiosError=U,De.Cancel=De.CanceledError,De.all=function(e){return Promise.all(e)},De.spread=function(e){return function(t){return e.apply(null,t)}},De.isAxiosError=function(e){return F.isObject(e)&&!0===e.isAxiosError},De.mergeConfig=Te,De.AxiosHeaders=le,De.formToJSON=e=>te(F.isHTMLForm(e)?new FormData(e):e),De.getAdapter=Oe,De.HttpStatusCode=Be,De.default=De;const Le=De,{Axios:ke,AxiosError:qe,CanceledError:Ie,isCancel:ze,CancelToken:Me,VERSION:He,all:Je,Cancel:We,isAxiosError:Ve,spread:Ke,toFormData:Ge,AxiosHeaders:$e,HttpStatusCode:Xe,formToJSON:Qe,getAdapter:Ze,mergeConfig:Ye}=Le;export{ke as Axios,qe as AxiosError,$e as AxiosHeaders,We as Cancel,Me as CancelToken,Ie as CanceledError,Xe as HttpStatusCode,He as VERSION,Je as all,Le as default,Qe as formToJSON,Ze as getAdapter,Ve as isAxiosError,ze as isCancel,Ye as mergeConfig,Ke as spread,Ge as toFormData};
+//# sourceMappingURL=axios.min.js.map
diff --git a/node_modules/axios/dist/esm/axios.min.js.map b/node_modules/axios/dist/esm/axios.min.js.map
new file mode 100644
index 0000000..6a87c76
--- /dev/null
+++ b/node_modules/axios/dist/esm/axios.min.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"axios.min.js","sources":["../../lib/helpers/bind.js","../../lib/utils.js","../../lib/core/AxiosError.js","../../lib/helpers/toFormData.js","../../lib/helpers/AxiosURLSearchParams.js","../../lib/helpers/buildURL.js","../../lib/core/InterceptorManager.js","../../lib/defaults/transitional.js","../../lib/platform/browser/index.js","../../lib/platform/browser/classes/URLSearchParams.js","../../lib/platform/browser/classes/FormData.js","../../lib/platform/browser/classes/Blob.js","../../lib/platform/common/utils.js","../../lib/platform/index.js","../../lib/helpers/formDataToJSON.js","../../lib/defaults/index.js","../../lib/helpers/toURLEncodedForm.js","../../lib/helpers/parseHeaders.js","../../lib/core/AxiosHeaders.js","../../lib/core/transformData.js","../../lib/cancel/isCancel.js","../../lib/cancel/CanceledError.js","../../lib/helpers/cookies.js","../../lib/core/buildFullPath.js","../../lib/helpers/isAbsoluteURL.js","../../lib/helpers/combineURLs.js","../../lib/helpers/isURLSameOrigin.js","../../lib/adapters/xhr.js","../../lib/helpers/speedometer.js","../../lib/adapters/adapters.js","../../lib/helpers/null.js","../../lib/core/settle.js","../../lib/helpers/parseProtocol.js","../../lib/core/dispatchRequest.js","../../lib/core/mergeConfig.js","../../lib/env/data.js","../../lib/helpers/validator.js","../../lib/core/Axios.js","../../lib/cancel/CancelToken.js","../../lib/helpers/HttpStatusCode.js","../../lib/axios.js","../../lib/helpers/spread.js","../../lib/helpers/isAxiosError.js","../../index.js"],"sourcesContent":["'use strict';\n\nexport default function bind(fn, thisArg) {\n return function wrap() {\n return fn.apply(thisArg, arguments);\n };\n}\n","'use strict';\n\nimport bind from './helpers/bind.js';\n\n// utils is a library of generic helper functions non-specific to axios\n\nconst {toString} = Object.prototype;\nconst {getPrototypeOf} = Object;\n\nconst kindOf = (cache => thing => {\n const str = toString.call(thing);\n return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());\n})(Object.create(null));\n\nconst kindOfTest = (type) => {\n type = type.toLowerCase();\n return (thing) => kindOf(thing) === type\n}\n\nconst typeOfTest = type => thing => typeof thing === type;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n *\n * @returns {boolean} True if value is an Array, otherwise false\n */\nconst {isArray} = Array;\n\n/**\n * Determine if a value is undefined\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nconst isUndefined = typeOfTest('undefined');\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nconst isArrayBuffer = kindOfTest('ArrayBuffer');\n\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n let result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a String, otherwise false\n */\nconst isString = typeOfTest('string');\n\n/**\n * Determine if a value is a Function\n *\n * @param {*} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nconst isFunction = typeOfTest('function');\n\n/**\n * Determine if a value is a Number\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Number, otherwise false\n */\nconst isNumber = typeOfTest('number');\n\n/**\n * Determine if a value is an Object\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an Object, otherwise false\n */\nconst isObject = (thing) => thing !== null && typeof thing === 'object';\n\n/**\n * Determine if a value is a Boolean\n *\n * @param {*} thing The value to test\n * @returns {boolean} True if value is a Boolean, otherwise false\n */\nconst isBoolean = thing => thing === true || thing === false;\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a plain Object, otherwise false\n */\nconst isPlainObject = (val) => {\n if (kindOf(val) !== 'object') {\n return false;\n }\n\n const prototype = getPrototypeOf(val);\n return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Date, otherwise false\n */\nconst isDate = kindOfTest('Date');\n\n/**\n * Determine if a value is a File\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFile = kindOfTest('File');\n\n/**\n * Determine if a value is a Blob\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nconst isBlob = kindOfTest('Blob');\n\n/**\n * Determine if a value is a FileList\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFileList = kindOfTest('FileList');\n\n/**\n * Determine if a value is a Stream\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nconst isStream = (val) => isObject(val) && isFunction(val.pipe);\n\n/**\n * Determine if a value is a FormData\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nconst isFormData = (thing) => {\n let kind;\n return thing && (\n (typeof FormData === 'function' && thing instanceof FormData) || (\n isFunction(thing.append) && (\n (kind = kindOf(thing)) === 'formdata' ||\n // detect form-data instance\n (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')\n )\n )\n )\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nconst isURLSearchParams = kindOfTest('URLSearchParams');\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n *\n * @returns {String} The String freed of excess whitespace\n */\nconst trim = (str) => str.trim ?\n str.trim() : str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n *\n * @param {Boolean} [allOwnKeys = false]\n * @returns {any}\n */\nfunction forEach(obj, fn, {allOwnKeys = false} = {}) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n let i;\n let l;\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);\n const len = keys.length;\n let key;\n\n for (i = 0; i < len; i++) {\n key = keys[i];\n fn.call(null, obj[key], key, obj);\n }\n }\n}\n\nfunction findKey(obj, key) {\n key = key.toLowerCase();\n const keys = Object.keys(obj);\n let i = keys.length;\n let _key;\n while (i-- > 0) {\n _key = keys[i];\n if (key === _key.toLowerCase()) {\n return _key;\n }\n }\n return null;\n}\n\nconst _global = (() => {\n /*eslint no-undef:0*/\n if (typeof globalThis !== \"undefined\") return globalThis;\n return typeof self !== \"undefined\" ? self : (typeof window !== 'undefined' ? window : global)\n})();\n\nconst isContextDefined = (context) => !isUndefined(context) && context !== _global;\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n *\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n const {caseless} = isContextDefined(this) && this || {};\n const result = {};\n const assignValue = (val, key) => {\n const targetKey = caseless && findKey(result, key) || key;\n if (isPlainObject(result[targetKey]) && isPlainObject(val)) {\n result[targetKey] = merge(result[targetKey], val);\n } else if (isPlainObject(val)) {\n result[targetKey] = merge({}, val);\n } else if (isArray(val)) {\n result[targetKey] = val.slice();\n } else {\n result[targetKey] = val;\n }\n }\n\n for (let i = 0, l = arguments.length; i < l; i++) {\n arguments[i] && forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n *\n * @param {Boolean} [allOwnKeys]\n * @returns {Object} The resulting value of object a\n */\nconst extend = (a, b, thisArg, {allOwnKeys}= {}) => {\n forEach(b, (val, key) => {\n if (thisArg && isFunction(val)) {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n }, {allOwnKeys});\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n *\n * @returns {string} content value without BOM\n */\nconst stripBOM = (content) => {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\n/**\n * Inherit the prototype methods from one constructor into another\n * @param {function} constructor\n * @param {function} superConstructor\n * @param {object} [props]\n * @param {object} [descriptors]\n *\n * @returns {void}\n */\nconst inherits = (constructor, superConstructor, props, descriptors) => {\n constructor.prototype = Object.create(superConstructor.prototype, descriptors);\n constructor.prototype.constructor = constructor;\n Object.defineProperty(constructor, 'super', {\n value: superConstructor.prototype\n });\n props && Object.assign(constructor.prototype, props);\n}\n\n/**\n * Resolve object with deep prototype chain to a flat object\n * @param {Object} sourceObj source object\n * @param {Object} [destObj]\n * @param {Function|Boolean} [filter]\n * @param {Function} [propFilter]\n *\n * @returns {Object}\n */\nconst toFlatObject = (sourceObj, destObj, filter, propFilter) => {\n let props;\n let i;\n let prop;\n const merged = {};\n\n destObj = destObj || {};\n // eslint-disable-next-line no-eq-null,eqeqeq\n if (sourceObj == null) return destObj;\n\n do {\n props = Object.getOwnPropertyNames(sourceObj);\n i = props.length;\n while (i-- > 0) {\n prop = props[i];\n if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {\n destObj[prop] = sourceObj[prop];\n merged[prop] = true;\n }\n }\n sourceObj = filter !== false && getPrototypeOf(sourceObj);\n } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);\n\n return destObj;\n}\n\n/**\n * Determines whether a string ends with the characters of a specified string\n *\n * @param {String} str\n * @param {String} searchString\n * @param {Number} [position= 0]\n *\n * @returns {boolean}\n */\nconst endsWith = (str, searchString, position) => {\n str = String(str);\n if (position === undefined || position > str.length) {\n position = str.length;\n }\n position -= searchString.length;\n const lastIndex = str.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n}\n\n\n/**\n * Returns new array from array like object or null if failed\n *\n * @param {*} [thing]\n *\n * @returns {?Array}\n */\nconst toArray = (thing) => {\n if (!thing) return null;\n if (isArray(thing)) return thing;\n let i = thing.length;\n if (!isNumber(i)) return null;\n const arr = new Array(i);\n while (i-- > 0) {\n arr[i] = thing[i];\n }\n return arr;\n}\n\n/**\n * Checking if the Uint8Array exists and if it does, it returns a function that checks if the\n * thing passed in is an instance of Uint8Array\n *\n * @param {TypedArray}\n *\n * @returns {Array}\n */\n// eslint-disable-next-line func-names\nconst isTypedArray = (TypedArray => {\n // eslint-disable-next-line func-names\n return thing => {\n return TypedArray && thing instanceof TypedArray;\n };\n})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));\n\n/**\n * For each entry in the object, call the function with the key and value.\n *\n * @param {Object<any, any>} obj - The object to iterate over.\n * @param {Function} fn - The function to call for each entry.\n *\n * @returns {void}\n */\nconst forEachEntry = (obj, fn) => {\n const generator = obj && obj[Symbol.iterator];\n\n const iterator = generator.call(obj);\n\n let result;\n\n while ((result = iterator.next()) && !result.done) {\n const pair = result.value;\n fn.call(obj, pair[0], pair[1]);\n }\n}\n\n/**\n * It takes a regular expression and a string, and returns an array of all the matches\n *\n * @param {string} regExp - The regular expression to match against.\n * @param {string} str - The string to search.\n *\n * @returns {Array<boolean>}\n */\nconst matchAll = (regExp, str) => {\n let matches;\n const arr = [];\n\n while ((matches = regExp.exec(str)) !== null) {\n arr.push(matches);\n }\n\n return arr;\n}\n\n/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */\nconst isHTMLForm = kindOfTest('HTMLFormElement');\n\nconst toCamelCase = str => {\n return str.toLowerCase().replace(/[-_\\s]([a-z\\d])(\\w*)/g,\n function replacer(m, p1, p2) {\n return p1.toUpperCase() + p2;\n }\n );\n};\n\n/* Creating a function that will check if an object has a property. */\nconst hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);\n\n/**\n * Determine if a value is a RegExp object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a RegExp object, otherwise false\n */\nconst isRegExp = kindOfTest('RegExp');\n\nconst reduceDescriptors = (obj, reducer) => {\n const descriptors = Object.getOwnPropertyDescriptors(obj);\n const reducedDescriptors = {};\n\n forEach(descriptors, (descriptor, name) => {\n let ret;\n if ((ret = reducer(descriptor, name, obj)) !== false) {\n reducedDescriptors[name] = ret || descriptor;\n }\n });\n\n Object.defineProperties(obj, reducedDescriptors);\n}\n\n/**\n * Makes all methods read-only\n * @param {Object} obj\n */\n\nconst freezeMethods = (obj) => {\n reduceDescriptors(obj, (descriptor, name) => {\n // skip restricted props in strict mode\n if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {\n return false;\n }\n\n const value = obj[name];\n\n if (!isFunction(value)) return;\n\n descriptor.enumerable = false;\n\n if ('writable' in descriptor) {\n descriptor.writable = false;\n return;\n }\n\n if (!descriptor.set) {\n descriptor.set = () => {\n throw Error('Can not rewrite read-only method \\'' + name + '\\'');\n };\n }\n });\n}\n\nconst toObjectSet = (arrayOrString, delimiter) => {\n const obj = {};\n\n const define = (arr) => {\n arr.forEach(value => {\n obj[value] = true;\n });\n }\n\n isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));\n\n return obj;\n}\n\nconst noop = () => {}\n\nconst toFiniteNumber = (value, defaultValue) => {\n value = +value;\n return Number.isFinite(value) ? value : defaultValue;\n}\n\nconst ALPHA = 'abcdefghijklmnopqrstuvwxyz'\n\nconst DIGIT = '0123456789';\n\nconst ALPHABET = {\n DIGIT,\n ALPHA,\n ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT\n}\n\nconst generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {\n let str = '';\n const {length} = alphabet;\n while (size--) {\n str += alphabet[Math.random() * length|0]\n }\n\n return str;\n}\n\n/**\n * If the thing is a FormData object, return true, otherwise return false.\n *\n * @param {unknown} thing - The thing to check.\n *\n * @returns {boolean}\n */\nfunction isSpecCompliantForm(thing) {\n return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]);\n}\n\nconst toJSONObject = (obj) => {\n const stack = new Array(10);\n\n const visit = (source, i) => {\n\n if (isObject(source)) {\n if (stack.indexOf(source) >= 0) {\n return;\n }\n\n if(!('toJSON' in source)) {\n stack[i] = source;\n const target = isArray(source) ? [] : {};\n\n forEach(source, (value, key) => {\n const reducedValue = visit(value, i + 1);\n !isUndefined(reducedValue) && (target[key] = reducedValue);\n });\n\n stack[i] = undefined;\n\n return target;\n }\n }\n\n return source;\n }\n\n return visit(obj, 0);\n}\n\nconst isAsyncFn = kindOfTest('AsyncFunction');\n\nconst isThenable = (thing) =>\n thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);\n\nexport default {\n isArray,\n isArrayBuffer,\n isBuffer,\n isFormData,\n isArrayBufferView,\n isString,\n isNumber,\n isBoolean,\n isObject,\n isPlainObject,\n isUndefined,\n isDate,\n isFile,\n isBlob,\n isRegExp,\n isFunction,\n isStream,\n isURLSearchParams,\n isTypedArray,\n isFileList,\n forEach,\n merge,\n extend,\n trim,\n stripBOM,\n inherits,\n toFlatObject,\n kindOf,\n kindOfTest,\n endsWith,\n toArray,\n forEachEntry,\n matchAll,\n isHTMLForm,\n hasOwnProperty,\n hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection\n reduceDescriptors,\n freezeMethods,\n toObjectSet,\n toCamelCase,\n noop,\n toFiniteNumber,\n findKey,\n global: _global,\n isContextDefined,\n ALPHABET,\n generateString,\n isSpecCompliantForm,\n toJSONObject,\n isAsyncFn,\n isThenable\n};\n","'use strict';\n\nimport utils from '../utils.js';\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [config] The config.\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n *\n * @returns {Error} The created error.\n */\nfunction AxiosError(message, code, config, request, response) {\n Error.call(this);\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n } else {\n this.stack = (new Error()).stack;\n }\n\n this.message = message;\n this.name = 'AxiosError';\n code && (this.code = code);\n config && (this.config = config);\n request && (this.request = request);\n response && (this.response = response);\n}\n\nutils.inherits(AxiosError, Error, {\n toJSON: function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: utils.toJSONObject(this.config),\n code: this.code,\n status: this.response && this.response.status ? this.response.status : null\n };\n }\n});\n\nconst prototype = AxiosError.prototype;\nconst descriptors = {};\n\n[\n 'ERR_BAD_OPTION_VALUE',\n 'ERR_BAD_OPTION',\n 'ECONNABORTED',\n 'ETIMEDOUT',\n 'ERR_NETWORK',\n 'ERR_FR_TOO_MANY_REDIRECTS',\n 'ERR_DEPRECATED',\n 'ERR_BAD_RESPONSE',\n 'ERR_BAD_REQUEST',\n 'ERR_CANCELED',\n 'ERR_NOT_SUPPORT',\n 'ERR_INVALID_URL'\n// eslint-disable-next-line func-names\n].forEach(code => {\n descriptors[code] = {value: code};\n});\n\nObject.defineProperties(AxiosError, descriptors);\nObject.defineProperty(prototype, 'isAxiosError', {value: true});\n\n// eslint-disable-next-line func-names\nAxiosError.from = (error, code, config, request, response, customProps) => {\n const axiosError = Object.create(prototype);\n\n utils.toFlatObject(error, axiosError, function filter(obj) {\n return obj !== Error.prototype;\n }, prop => {\n return prop !== 'isAxiosError';\n });\n\n AxiosError.call(axiosError, error.message, code, config, request, response);\n\n axiosError.cause = error;\n\n axiosError.name = error.name;\n\n customProps && Object.assign(axiosError, customProps);\n\n return axiosError;\n};\n\nexport default AxiosError;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\n// temporary hotfix to avoid circular references until AxiosURLSearchParams is refactored\nimport PlatformFormData from '../platform/node/classes/FormData.js';\n\n/**\n * Determines if the given thing is a array or js object.\n *\n * @param {string} thing - The object or array to be visited.\n *\n * @returns {boolean}\n */\nfunction isVisitable(thing) {\n return utils.isPlainObject(thing) || utils.isArray(thing);\n}\n\n/**\n * It removes the brackets from the end of a string\n *\n * @param {string} key - The key of the parameter.\n *\n * @returns {string} the key without the brackets.\n */\nfunction removeBrackets(key) {\n return utils.endsWith(key, '[]') ? key.slice(0, -2) : key;\n}\n\n/**\n * It takes a path, a key, and a boolean, and returns a string\n *\n * @param {string} path - The path to the current key.\n * @param {string} key - The key of the current object being iterated over.\n * @param {string} dots - If true, the key will be rendered with dots instead of brackets.\n *\n * @returns {string} The path to the current key.\n */\nfunction renderKey(path, key, dots) {\n if (!path) return key;\n return path.concat(key).map(function each(token, i) {\n // eslint-disable-next-line no-param-reassign\n token = removeBrackets(token);\n return !dots && i ? '[' + token + ']' : token;\n }).join(dots ? '.' : '');\n}\n\n/**\n * If the array is an array and none of its elements are visitable, then it's a flat array.\n *\n * @param {Array<any>} arr - The array to check\n *\n * @returns {boolean}\n */\nfunction isFlatArray(arr) {\n return utils.isArray(arr) && !arr.some(isVisitable);\n}\n\nconst predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {\n return /^is[A-Z]/.test(prop);\n});\n\n/**\n * Convert a data object to FormData\n *\n * @param {Object} obj\n * @param {?Object} [formData]\n * @param {?Object} [options]\n * @param {Function} [options.visitor]\n * @param {Boolean} [options.metaTokens = true]\n * @param {Boolean} [options.dots = false]\n * @param {?Boolean} [options.indexes = false]\n *\n * @returns {Object}\n **/\n\n/**\n * It converts an object into a FormData object\n *\n * @param {Object<any, any>} obj - The object to convert to form data.\n * @param {string} formData - The FormData object to append to.\n * @param {Object<string, any>} options\n *\n * @returns\n */\nfunction toFormData(obj, formData, options) {\n if (!utils.isObject(obj)) {\n throw new TypeError('target must be an object');\n }\n\n // eslint-disable-next-line no-param-reassign\n formData = formData || new (PlatformFormData || FormData)();\n\n // eslint-disable-next-line no-param-reassign\n options = utils.toFlatObject(options, {\n metaTokens: true,\n dots: false,\n indexes: false\n }, false, function defined(option, source) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n return !utils.isUndefined(source[option]);\n });\n\n const metaTokens = options.metaTokens;\n // eslint-disable-next-line no-use-before-define\n const visitor = options.visitor || defaultVisitor;\n const dots = options.dots;\n const indexes = options.indexes;\n const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;\n const useBlob = _Blob && utils.isSpecCompliantForm(formData);\n\n if (!utils.isFunction(visitor)) {\n throw new TypeError('visitor must be a function');\n }\n\n function convertValue(value) {\n if (value === null) return '';\n\n if (utils.isDate(value)) {\n return value.toISOString();\n }\n\n if (!useBlob && utils.isBlob(value)) {\n throw new AxiosError('Blob is not supported. Use a Buffer instead.');\n }\n\n if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {\n return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);\n }\n\n return value;\n }\n\n /**\n * Default visitor.\n *\n * @param {*} value\n * @param {String|Number} key\n * @param {Array<String|Number>} path\n * @this {FormData}\n *\n * @returns {boolean} return true to visit the each prop of the value recursively\n */\n function defaultVisitor(value, key, path) {\n let arr = value;\n\n if (value && !path && typeof value === 'object') {\n if (utils.endsWith(key, '{}')) {\n // eslint-disable-next-line no-param-reassign\n key = metaTokens ? key : key.slice(0, -2);\n // eslint-disable-next-line no-param-reassign\n value = JSON.stringify(value);\n } else if (\n (utils.isArray(value) && isFlatArray(value)) ||\n ((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value))\n )) {\n // eslint-disable-next-line no-param-reassign\n key = removeBrackets(key);\n\n arr.forEach(function each(el, index) {\n !(utils.isUndefined(el) || el === null) && formData.append(\n // eslint-disable-next-line no-nested-ternary\n indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),\n convertValue(el)\n );\n });\n return false;\n }\n }\n\n if (isVisitable(value)) {\n return true;\n }\n\n formData.append(renderKey(path, key, dots), convertValue(value));\n\n return false;\n }\n\n const stack = [];\n\n const exposedHelpers = Object.assign(predicates, {\n defaultVisitor,\n convertValue,\n isVisitable\n });\n\n function build(value, path) {\n if (utils.isUndefined(value)) return;\n\n if (stack.indexOf(value) !== -1) {\n throw Error('Circular reference detected in ' + path.join('.'));\n }\n\n stack.push(value);\n\n utils.forEach(value, function each(el, key) {\n const result = !(utils.isUndefined(el) || el === null) && visitor.call(\n formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers\n );\n\n if (result === true) {\n build(el, path ? path.concat(key) : [key]);\n }\n });\n\n stack.pop();\n }\n\n if (!utils.isObject(obj)) {\n throw new TypeError('data must be an object');\n }\n\n build(obj);\n\n return formData;\n}\n\nexport default toFormData;\n","'use strict';\n\nimport toFormData from './toFormData.js';\n\n/**\n * It encodes a string by replacing all characters that are not in the unreserved set with\n * their percent-encoded equivalents\n *\n * @param {string} str - The string to encode.\n *\n * @returns {string} The encoded string.\n */\nfunction encode(str) {\n const charMap = {\n '!': '%21',\n \"'\": '%27',\n '(': '%28',\n ')': '%29',\n '~': '%7E',\n '%20': '+',\n '%00': '\\x00'\n };\n return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {\n return charMap[match];\n });\n}\n\n/**\n * It takes a params object and converts it to a FormData object\n *\n * @param {Object<string, any>} params - The parameters to be converted to a FormData object.\n * @param {Object<string, any>} options - The options object passed to the Axios constructor.\n *\n * @returns {void}\n */\nfunction AxiosURLSearchParams(params, options) {\n this._pairs = [];\n\n params && toFormData(params, this, options);\n}\n\nconst prototype = AxiosURLSearchParams.prototype;\n\nprototype.append = function append(name, value) {\n this._pairs.push([name, value]);\n};\n\nprototype.toString = function toString(encoder) {\n const _encode = encoder ? function(value) {\n return encoder.call(this, value, encode);\n } : encode;\n\n return this._pairs.map(function each(pair) {\n return _encode(pair[0]) + '=' + _encode(pair[1]);\n }, '').join('&');\n};\n\nexport default AxiosURLSearchParams;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosURLSearchParams from '../helpers/AxiosURLSearchParams.js';\n\n/**\n * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their\n * URI encoded counterparts\n *\n * @param {string} val The value to be encoded.\n *\n * @returns {string} The encoded value.\n */\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @param {?object} options\n *\n * @returns {string} The formatted url\n */\nexport default function buildURL(url, params, options) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n \n const _encode = options && options.encode || encode;\n\n const serializeFn = options && options.serialize;\n\n let serializedParams;\n\n if (serializeFn) {\n serializedParams = serializeFn(params, options);\n } else {\n serializedParams = utils.isURLSearchParams(params) ?\n params.toString() :\n new AxiosURLSearchParams(params, options).toString(_encode);\n }\n\n if (serializedParams) {\n const hashmarkIndex = url.indexOf(\"#\");\n\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\nclass InterceptorManager {\n constructor() {\n this.handlers = [];\n }\n\n /**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\n use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled,\n rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n }\n\n /**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n *\n * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise\n */\n eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n }\n\n /**\n * Clear all interceptors from the stack\n *\n * @returns {void}\n */\n clear() {\n if (this.handlers) {\n this.handlers = [];\n }\n }\n\n /**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n *\n * @returns {void}\n */\n forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n }\n}\n\nexport default InterceptorManager;\n","'use strict';\n\nexport default {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n};\n","import URLSearchParams from './classes/URLSearchParams.js'\nimport FormData from './classes/FormData.js'\nimport Blob from './classes/Blob.js'\n\nexport default {\n isBrowser: true,\n classes: {\n URLSearchParams,\n FormData,\n Blob\n },\n protocols: ['http', 'https', 'file', 'blob', 'url', 'data']\n};\n","'use strict';\n\nimport AxiosURLSearchParams from '../../../helpers/AxiosURLSearchParams.js';\nexport default typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;\n","'use strict';\n\nexport default typeof FormData !== 'undefined' ? FormData : null;\n","'use strict'\n\nexport default typeof Blob !== 'undefined' ? Blob : null\n","const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n *\n * @returns {boolean}\n */\nconst hasStandardBrowserEnv = (\n (product) => {\n return hasBrowserEnv && ['ReactNative', 'NativeScript', 'NS'].indexOf(product) < 0\n })(typeof navigator !== 'undefined' && navigator.product);\n\n/**\n * Determine if we're running in a standard browser webWorker environment\n *\n * Although the `isStandardBrowserEnv` method indicates that\n * `allows axios to run in a web worker`, the WebWorker will still be\n * filtered out due to its judgment standard\n * `typeof window !== 'undefined' && typeof document !== 'undefined'`.\n * This leads to a problem when axios post `FormData` in webWorker\n */\nconst hasStandardBrowserWebWorkerEnv = (() => {\n return (\n typeof WorkerGlobalScope !== 'undefined' &&\n // eslint-disable-next-line no-undef\n self instanceof WorkerGlobalScope &&\n typeof self.importScripts === 'function'\n );\n})();\n\nexport {\n hasBrowserEnv,\n hasStandardBrowserWebWorkerEnv,\n hasStandardBrowserEnv\n}\n","import platform from './node/index.js';\nimport * as utils from './common/utils.js';\n\nexport default {\n ...utils,\n ...platform\n}\n","'use strict';\n\nimport utils from '../utils.js';\n\n/**\n * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']\n *\n * @param {string} name - The name of the property to get.\n *\n * @returns An array of strings.\n */\nfunction parsePropPath(name) {\n // foo[x][y][z]\n // foo.x.y.z\n // foo-x-y-z\n // foo x y z\n return utils.matchAll(/\\w+|\\[(\\w*)]/g, name).map(match => {\n return match[0] === '[]' ? '' : match[1] || match[0];\n });\n}\n\n/**\n * Convert an array to an object.\n *\n * @param {Array<any>} arr - The array to convert to an object.\n *\n * @returns An object with the same keys and values as the array.\n */\nfunction arrayToObject(arr) {\n const obj = {};\n const keys = Object.keys(arr);\n let i;\n const len = keys.length;\n let key;\n for (i = 0; i < len; i++) {\n key = keys[i];\n obj[key] = arr[key];\n }\n return obj;\n}\n\n/**\n * It takes a FormData object and returns a JavaScript object\n *\n * @param {string} formData The FormData object to convert to JSON.\n *\n * @returns {Object<string, any> | null} The converted object.\n */\nfunction formDataToJSON(formData) {\n function buildPath(path, value, target, index) {\n let name = path[index++];\n\n if (name === '__proto__') return true;\n\n const isNumericKey = Number.isFinite(+name);\n const isLast = index >= path.length;\n name = !name && utils.isArray(target) ? target.length : name;\n\n if (isLast) {\n if (utils.hasOwnProp(target, name)) {\n target[name] = [target[name], value];\n } else {\n target[name] = value;\n }\n\n return !isNumericKey;\n }\n\n if (!target[name] || !utils.isObject(target[name])) {\n target[name] = [];\n }\n\n const result = buildPath(path, value, target[name], index);\n\n if (result && utils.isArray(target[name])) {\n target[name] = arrayToObject(target[name]);\n }\n\n return !isNumericKey;\n }\n\n if (utils.isFormData(formData) && utils.isFunction(formData.entries)) {\n const obj = {};\n\n utils.forEachEntry(formData, (name, value) => {\n buildPath(parsePropPath(name), value, obj, 0);\n });\n\n return obj;\n }\n\n return null;\n}\n\nexport default formDataToJSON;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\nimport transitionalDefaults from './transitional.js';\nimport toFormData from '../helpers/toFormData.js';\nimport toURLEncodedForm from '../helpers/toURLEncodedForm.js';\nimport platform from '../platform/index.js';\nimport formDataToJSON from '../helpers/formDataToJSON.js';\n\n/**\n * It takes a string, tries to parse it, and if it fails, it returns the stringified version\n * of the input\n *\n * @param {any} rawValue - The value to be stringified.\n * @param {Function} parser - A function that parses a string into a JavaScript object.\n * @param {Function} encoder - A function that takes a value and returns a string.\n *\n * @returns {string} A stringified version of the rawValue.\n */\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nconst defaults = {\n\n transitional: transitionalDefaults,\n\n adapter: ['xhr', 'http'],\n\n transformRequest: [function transformRequest(data, headers) {\n const contentType = headers.getContentType() || '';\n const hasJSONContentType = contentType.indexOf('application/json') > -1;\n const isObjectPayload = utils.isObject(data);\n\n if (isObjectPayload && utils.isHTMLForm(data)) {\n data = new FormData(data);\n }\n\n const isFormData = utils.isFormData(data);\n\n if (isFormData) {\n return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;\n }\n\n if (utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);\n return data.toString();\n }\n\n let isFileList;\n\n if (isObjectPayload) {\n if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {\n return toURLEncodedForm(data, this.formSerializer).toString();\n }\n\n if ((isFileList = utils.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {\n const _FormData = this.env && this.env.FormData;\n\n return toFormData(\n isFileList ? {'files[]': data} : data,\n _FormData && new _FormData(),\n this.formSerializer\n );\n }\n }\n\n if (isObjectPayload || hasJSONContentType ) {\n headers.setContentType('application/json', false);\n return stringifySafely(data);\n }\n\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n const transitional = this.transitional || defaults.transitional;\n const forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n const JSONRequested = this.responseType === 'json';\n\n if (data && utils.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {\n const silentJSONParsing = transitional && transitional.silentJSONParsing;\n const strictJSONParsing = !silentJSONParsing && JSONRequested;\n\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n env: {\n FormData: platform.classes.FormData,\n Blob: platform.classes.Blob\n },\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n },\n\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*',\n 'Content-Type': undefined\n }\n }\n};\n\nutils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {\n defaults.headers[method] = {};\n});\n\nexport default defaults;\n","'use strict';\n\nimport utils from '../utils.js';\nimport toFormData from './toFormData.js';\nimport platform from '../platform/index.js';\n\nexport default function toURLEncodedForm(data, options) {\n return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({\n visitor: function(value, key, path, helpers) {\n if (platform.isNode && utils.isBuffer(value)) {\n this.append(key, value.toString('base64'));\n return false;\n }\n\n return helpers.defaultVisitor.apply(this, arguments);\n }\n }, options));\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\n// RawAxiosHeaders whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nconst ignoreDuplicateOf = utils.toObjectSet([\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n]);\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} rawHeaders Headers needing to be parsed\n *\n * @returns {Object} Headers parsed into an object\n */\nexport default rawHeaders => {\n const parsed = {};\n let key;\n let val;\n let i;\n\n rawHeaders && rawHeaders.split('\\n').forEach(function parser(line) {\n i = line.indexOf(':');\n key = line.substring(0, i).trim().toLowerCase();\n val = line.substring(i + 1).trim();\n\n if (!key || (parsed[key] && ignoreDuplicateOf[key])) {\n return;\n }\n\n if (key === 'set-cookie') {\n if (parsed[key]) {\n parsed[key].push(val);\n } else {\n parsed[key] = [val];\n }\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n });\n\n return parsed;\n};\n","'use strict';\n\nimport utils from '../utils.js';\nimport parseHeaders from '../helpers/parseHeaders.js';\n\nconst $internals = Symbol('internals');\n\nfunction normalizeHeader(header) {\n return header && String(header).trim().toLowerCase();\n}\n\nfunction normalizeValue(value) {\n if (value === false || value == null) {\n return value;\n }\n\n return utils.isArray(value) ? value.map(normalizeValue) : String(value);\n}\n\nfunction parseTokens(str) {\n const tokens = Object.create(null);\n const tokensRE = /([^\\s,;=]+)\\s*(?:=\\s*([^,;]+))?/g;\n let match;\n\n while ((match = tokensRE.exec(str))) {\n tokens[match[1]] = match[2];\n }\n\n return tokens;\n}\n\nconst isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());\n\nfunction matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {\n if (utils.isFunction(filter)) {\n return filter.call(this, value, header);\n }\n\n if (isHeaderNameFilter) {\n value = header;\n }\n\n if (!utils.isString(value)) return;\n\n if (utils.isString(filter)) {\n return value.indexOf(filter) !== -1;\n }\n\n if (utils.isRegExp(filter)) {\n return filter.test(value);\n }\n}\n\nfunction formatHeader(header) {\n return header.trim()\n .toLowerCase().replace(/([a-z\\d])(\\w*)/g, (w, char, str) => {\n return char.toUpperCase() + str;\n });\n}\n\nfunction buildAccessors(obj, header) {\n const accessorName = utils.toCamelCase(' ' + header);\n\n ['get', 'set', 'has'].forEach(methodName => {\n Object.defineProperty(obj, methodName + accessorName, {\n value: function(arg1, arg2, arg3) {\n return this[methodName].call(this, header, arg1, arg2, arg3);\n },\n configurable: true\n });\n });\n}\n\nclass AxiosHeaders {\n constructor(headers) {\n headers && this.set(headers);\n }\n\n set(header, valueOrRewrite, rewrite) {\n const self = this;\n\n function setHeader(_value, _header, _rewrite) {\n const lHeader = normalizeHeader(_header);\n\n if (!lHeader) {\n throw new Error('header name must be a non-empty string');\n }\n\n const key = utils.findKey(self, lHeader);\n\n if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {\n self[key || _header] = normalizeValue(_value);\n }\n }\n\n const setHeaders = (headers, _rewrite) =>\n utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));\n\n if (utils.isPlainObject(header) || header instanceof this.constructor) {\n setHeaders(header, valueOrRewrite)\n } else if(utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {\n setHeaders(parseHeaders(header), valueOrRewrite);\n } else {\n header != null && setHeader(valueOrRewrite, header, rewrite);\n }\n\n return this;\n }\n\n get(header, parser) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n if (key) {\n const value = this[key];\n\n if (!parser) {\n return value;\n }\n\n if (parser === true) {\n return parseTokens(value);\n }\n\n if (utils.isFunction(parser)) {\n return parser.call(this, value, key);\n }\n\n if (utils.isRegExp(parser)) {\n return parser.exec(value);\n }\n\n throw new TypeError('parser must be boolean|regexp|function');\n }\n }\n }\n\n has(header, matcher) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));\n }\n\n return false;\n }\n\n delete(header, matcher) {\n const self = this;\n let deleted = false;\n\n function deleteHeader(_header) {\n _header = normalizeHeader(_header);\n\n if (_header) {\n const key = utils.findKey(self, _header);\n\n if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {\n delete self[key];\n\n deleted = true;\n }\n }\n }\n\n if (utils.isArray(header)) {\n header.forEach(deleteHeader);\n } else {\n deleteHeader(header);\n }\n\n return deleted;\n }\n\n clear(matcher) {\n const keys = Object.keys(this);\n let i = keys.length;\n let deleted = false;\n\n while (i--) {\n const key = keys[i];\n if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {\n delete this[key];\n deleted = true;\n }\n }\n\n return deleted;\n }\n\n normalize(format) {\n const self = this;\n const headers = {};\n\n utils.forEach(this, (value, header) => {\n const key = utils.findKey(headers, header);\n\n if (key) {\n self[key] = normalizeValue(value);\n delete self[header];\n return;\n }\n\n const normalized = format ? formatHeader(header) : String(header).trim();\n\n if (normalized !== header) {\n delete self[header];\n }\n\n self[normalized] = normalizeValue(value);\n\n headers[normalized] = true;\n });\n\n return this;\n }\n\n concat(...targets) {\n return this.constructor.concat(this, ...targets);\n }\n\n toJSON(asStrings) {\n const obj = Object.create(null);\n\n utils.forEach(this, (value, header) => {\n value != null && value !== false && (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value);\n });\n\n return obj;\n }\n\n [Symbol.iterator]() {\n return Object.entries(this.toJSON())[Symbol.iterator]();\n }\n\n toString() {\n return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\\n');\n }\n\n get [Symbol.toStringTag]() {\n return 'AxiosHeaders';\n }\n\n static from(thing) {\n return thing instanceof this ? thing : new this(thing);\n }\n\n static concat(first, ...targets) {\n const computed = new this(first);\n\n targets.forEach((target) => computed.set(target));\n\n return computed;\n }\n\n static accessor(header) {\n const internals = this[$internals] = (this[$internals] = {\n accessors: {}\n });\n\n const accessors = internals.accessors;\n const prototype = this.prototype;\n\n function defineAccessor(_header) {\n const lHeader = normalizeHeader(_header);\n\n if (!accessors[lHeader]) {\n buildAccessors(prototype, _header);\n accessors[lHeader] = true;\n }\n }\n\n utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);\n\n return this;\n }\n}\n\nAxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);\n\n// reserved names hotfix\nutils.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {\n let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`\n return {\n get: () => value,\n set(headerValue) {\n this[mapped] = headerValue;\n }\n }\n});\n\nutils.freezeMethods(AxiosHeaders);\n\nexport default AxiosHeaders;\n","'use strict';\n\nimport utils from './../utils.js';\nimport defaults from '../defaults/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Array|Function} fns A single function or Array of functions\n * @param {?Object} response The response object\n *\n * @returns {*} The resulting transformed data\n */\nexport default function transformData(fns, response) {\n const config = this || defaults;\n const context = response || config;\n const headers = AxiosHeaders.from(context.headers);\n let data = context.data;\n\n utils.forEach(fns, function transform(fn) {\n data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);\n });\n\n headers.normalize();\n\n return data;\n}\n","'use strict';\n\nexport default function isCancel(value) {\n return !!(value && value.__CANCEL__);\n}\n","'use strict';\n\nimport AxiosError from '../core/AxiosError.js';\nimport utils from '../utils.js';\n\n/**\n * A `CanceledError` is an object that is thrown when an operation is canceled.\n *\n * @param {string=} message The message.\n * @param {Object=} config The config.\n * @param {Object=} request The request.\n *\n * @returns {CanceledError} The created error.\n */\nfunction CanceledError(message, config, request) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);\n this.name = 'CanceledError';\n}\n\nutils.inherits(CanceledError, AxiosError, {\n __CANCEL__: true\n});\n\nexport default CanceledError;\n","import utils from './../utils.js';\nimport platform from '../platform/index.js';\n\nexport default platform.hasStandardBrowserEnv ?\n\n // Standard browser envs support document.cookie\n {\n write(name, value, expires, path, domain, secure) {\n const cookie = [name + '=' + encodeURIComponent(value)];\n\n utils.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());\n\n utils.isString(path) && cookie.push('path=' + path);\n\n utils.isString(domain) && cookie.push('domain=' + domain);\n\n secure === true && cookie.push('secure');\n\n document.cookie = cookie.join('; ');\n },\n\n read(name) {\n const match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n }\n\n :\n\n // Non-standard browser env (web workers, react-native) lack needed support.\n {\n write() {},\n read() {\n return null;\n },\n remove() {}\n };\n\n","'use strict';\n\nimport isAbsoluteURL from '../helpers/isAbsoluteURL.js';\nimport combineURLs from '../helpers/combineURLs.js';\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n *\n * @returns {string} The combined full path\n */\nexport default function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n}\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n *\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nexport default function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"<scheme>://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(url);\n}\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n *\n * @returns {string} The combined URL\n */\nexport default function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/?\\/$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n}\n","'use strict';\n\nimport utils from './../utils.js';\nimport platform from '../platform/index.js';\n\nexport default platform.hasStandardBrowserEnv ?\n\n// Standard browser envs have full support of the APIs needed to test\n// whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n const msie = /(msie|trident)/i.test(navigator.userAgent);\n const urlParsingNode = document.createElement('a');\n let originURL;\n\n /**\n * Parse a URL to discover its components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n let href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n const parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })();\n","'use strict';\n\nimport utils from './../utils.js';\nimport settle from './../core/settle.js';\nimport cookies from './../helpers/cookies.js';\nimport buildURL from './../helpers/buildURL.js';\nimport buildFullPath from '../core/buildFullPath.js';\nimport isURLSameOrigin from './../helpers/isURLSameOrigin.js';\nimport transitionalDefaults from '../defaults/transitional.js';\nimport AxiosError from '../core/AxiosError.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport parseProtocol from '../helpers/parseProtocol.js';\nimport platform from '../platform/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport speedometer from '../helpers/speedometer.js';\n\nfunction progressEventReducer(listener, isDownloadStream) {\n let bytesNotified = 0;\n const _speedometer = speedometer(50, 250);\n\n return e => {\n const loaded = e.loaded;\n const total = e.lengthComputable ? e.total : undefined;\n const progressBytes = loaded - bytesNotified;\n const rate = _speedometer(progressBytes);\n const inRange = loaded <= total;\n\n bytesNotified = loaded;\n\n const data = {\n loaded,\n total,\n progress: total ? (loaded / total) : undefined,\n bytes: progressBytes,\n rate: rate ? rate : undefined,\n estimated: rate && total && inRange ? (total - loaded) / rate : undefined,\n event: e\n };\n\n data[isDownloadStream ? 'download' : 'upload'] = true;\n\n listener(data);\n };\n}\n\nconst isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';\n\nexport default isXHRAdapterSupported && function (config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n let requestData = config.data;\n const requestHeaders = AxiosHeaders.from(config.headers).normalize();\n let {responseType, withXSRFToken} = config;\n let onCanceled;\n function done() {\n if (config.cancelToken) {\n config.cancelToken.unsubscribe(onCanceled);\n }\n\n if (config.signal) {\n config.signal.removeEventListener('abort', onCanceled);\n }\n }\n\n let contentType;\n\n if (utils.isFormData(requestData)) {\n if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {\n requestHeaders.setContentType(false); // Let the browser set it\n } else if ((contentType = requestHeaders.getContentType()) !== false) {\n // fix semicolon duplication issue for ReactNative FormData implementation\n const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];\n requestHeaders.setContentType([type || 'multipart/form-data', ...tokens].join('; '));\n }\n }\n\n let request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n const username = config.auth.username || '';\n const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.set('Authorization', 'Basic ' + btoa(username + ':' + password));\n }\n\n const fullPath = buildFullPath(config.baseURL, config.url);\n\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n const responseHeaders = AxiosHeaders.from(\n 'getAllResponseHeaders' in request && request.getAllResponseHeaders()\n );\n const responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n const response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config,\n request\n };\n\n settle(function _resolve(value) {\n resolve(value);\n done();\n }, function _reject(err) {\n reject(err);\n done();\n }, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';\n const transitional = config.transitional || transitionalDefaults;\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(new AxiosError(\n timeoutErrorMessage,\n transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,\n config,\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if(platform.hasStandardBrowserEnv) {\n withXSRFToken && utils.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config));\n\n if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(fullPath))) {\n // Add xsrf header\n const xsrfValue = config.xsrfHeaderName && config.xsrfCookieName && cookies.read(config.xsrfCookieName);\n\n if (xsrfValue) {\n requestHeaders.set(config.xsrfHeaderName, xsrfValue);\n }\n }\n }\n\n // Remove Content-Type if data is undefined\n requestData === undefined && requestHeaders.setContentType(null);\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {\n request.setRequestHeader(key, val);\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = config.responseType;\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', progressEventReducer(config.onDownloadProgress, true));\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', progressEventReducer(config.onUploadProgress));\n }\n\n if (config.cancelToken || config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = cancel => {\n if (!request) {\n return;\n }\n reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);\n request.abort();\n request = null;\n };\n\n config.cancelToken && config.cancelToken.subscribe(onCanceled);\n if (config.signal) {\n config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);\n }\n }\n\n const protocol = parseProtocol(fullPath);\n\n if (protocol && platform.protocols.indexOf(protocol) === -1) {\n reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));\n return;\n }\n\n\n // Send the request\n request.send(requestData || null);\n });\n}\n","'use strict';\n\n/**\n * Calculate data maxRate\n * @param {Number} [samplesCount= 10]\n * @param {Number} [min= 1000]\n * @returns {Function}\n */\nfunction speedometer(samplesCount, min) {\n samplesCount = samplesCount || 10;\n const bytes = new Array(samplesCount);\n const timestamps = new Array(samplesCount);\n let head = 0;\n let tail = 0;\n let firstSampleTS;\n\n min = min !== undefined ? min : 1000;\n\n return function push(chunkLength) {\n const now = Date.now();\n\n const startedAt = timestamps[tail];\n\n if (!firstSampleTS) {\n firstSampleTS = now;\n }\n\n bytes[head] = chunkLength;\n timestamps[head] = now;\n\n let i = tail;\n let bytesCount = 0;\n\n while (i !== head) {\n bytesCount += bytes[i++];\n i = i % samplesCount;\n }\n\n head = (head + 1) % samplesCount;\n\n if (head === tail) {\n tail = (tail + 1) % samplesCount;\n }\n\n if (now - firstSampleTS < min) {\n return;\n }\n\n const passed = startedAt && now - startedAt;\n\n return passed ? Math.round(bytesCount * 1000 / passed) : undefined;\n };\n}\n\nexport default speedometer;\n","import utils from '../utils.js';\nimport httpAdapter from './http.js';\nimport xhrAdapter from './xhr.js';\nimport AxiosError from \"../core/AxiosError.js\";\n\nconst knownAdapters = {\n http: httpAdapter,\n xhr: xhrAdapter\n}\n\nutils.forEach(knownAdapters, (fn, value) => {\n if (fn) {\n try {\n Object.defineProperty(fn, 'name', {value});\n } catch (e) {\n // eslint-disable-next-line no-empty\n }\n Object.defineProperty(fn, 'adapterName', {value});\n }\n});\n\nconst renderReason = (reason) => `- ${reason}`;\n\nconst isResolvedHandle = (adapter) => utils.isFunction(adapter) || adapter === null || adapter === false;\n\nexport default {\n getAdapter: (adapters) => {\n adapters = utils.isArray(adapters) ? adapters : [adapters];\n\n const {length} = adapters;\n let nameOrAdapter;\n let adapter;\n\n const rejectedReasons = {};\n\n for (let i = 0; i < length; i++) {\n nameOrAdapter = adapters[i];\n let id;\n\n adapter = nameOrAdapter;\n\n if (!isResolvedHandle(nameOrAdapter)) {\n adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];\n\n if (adapter === undefined) {\n throw new AxiosError(`Unknown adapter '${id}'`);\n }\n }\n\n if (adapter) {\n break;\n }\n\n rejectedReasons[id || '#' + i] = adapter;\n }\n\n if (!adapter) {\n\n const reasons = Object.entries(rejectedReasons)\n .map(([id, state]) => `adapter ${id} ` +\n (state === false ? 'is not supported by the environment' : 'is not available in the build')\n );\n\n let s = length ?\n (reasons.length > 1 ? 'since :\\n' + reasons.map(renderReason).join('\\n') : ' ' + renderReason(reasons[0])) :\n 'as no adapter specified';\n\n throw new AxiosError(\n `There is no suitable adapter to dispatch the request ` + s,\n 'ERR_NOT_SUPPORT'\n );\n }\n\n return adapter;\n },\n adapters: knownAdapters\n}\n","// eslint-disable-next-line strict\nexport default null;\n","'use strict';\n\nimport AxiosError from './AxiosError.js';\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n *\n * @returns {object} The response.\n */\nexport default function settle(resolve, reject, response) {\n const validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(new AxiosError(\n 'Request failed with status code ' + response.status,\n [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],\n response.config,\n response.request,\n response\n ));\n }\n}\n","'use strict';\n\nexport default function parseProtocol(url) {\n const match = /^([-+\\w]{1,25})(:?\\/\\/|:)/.exec(url);\n return match && match[1] || '';\n}\n","'use strict';\n\nimport transformData from './transformData.js';\nimport isCancel from '../cancel/isCancel.js';\nimport defaults from '../defaults/index.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport adapters from \"../adapters/adapters.js\";\n\n/**\n * Throws a `CanceledError` if cancellation has been requested.\n *\n * @param {Object} config The config that is to be used for the request\n *\n * @returns {void}\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n\n if (config.signal && config.signal.aborted) {\n throw new CanceledError(null, config);\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n *\n * @returns {Promise} The Promise to be fulfilled\n */\nexport default function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n config.headers = AxiosHeaders.from(config.headers);\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.transformRequest\n );\n\n if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {\n config.headers.setContentType('application/x-www-form-urlencoded', false);\n }\n\n const adapter = adapters.getAdapter(config.adapter || defaults.adapter);\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n config.transformResponse,\n response\n );\n\n response.headers = AxiosHeaders.from(response.headers);\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n config.transformResponse,\n reason.response\n );\n reason.response.headers = AxiosHeaders.from(reason.response.headers);\n }\n }\n\n return Promise.reject(reason);\n });\n}\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosHeaders from \"./AxiosHeaders.js\";\n\nconst headersToObject = (thing) => thing instanceof AxiosHeaders ? thing.toJSON() : thing;\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n *\n * @returns {Object} New object resulting from merging config2 to config1\n */\nexport default function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n const config = {};\n\n function getMergedValue(target, source, caseless) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge.call({caseless}, target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDeepProperties(a, b, caseless) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(a, b, caseless);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a, caseless);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function valueFromConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function defaultToConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDirectKeys(a, b, prop) {\n if (prop in config2) {\n return getMergedValue(a, b);\n } else if (prop in config1) {\n return getMergedValue(undefined, a);\n }\n }\n\n const mergeMap = {\n url: valueFromConfig2,\n method: valueFromConfig2,\n data: valueFromConfig2,\n baseURL: defaultToConfig2,\n transformRequest: defaultToConfig2,\n transformResponse: defaultToConfig2,\n paramsSerializer: defaultToConfig2,\n timeout: defaultToConfig2,\n timeoutMessage: defaultToConfig2,\n withCredentials: defaultToConfig2,\n withXSRFToken: defaultToConfig2,\n adapter: defaultToConfig2,\n responseType: defaultToConfig2,\n xsrfCookieName: defaultToConfig2,\n xsrfHeaderName: defaultToConfig2,\n onUploadProgress: defaultToConfig2,\n onDownloadProgress: defaultToConfig2,\n decompress: defaultToConfig2,\n maxContentLength: defaultToConfig2,\n maxBodyLength: defaultToConfig2,\n beforeRedirect: defaultToConfig2,\n transport: defaultToConfig2,\n httpAgent: defaultToConfig2,\n httpsAgent: defaultToConfig2,\n cancelToken: defaultToConfig2,\n socketPath: defaultToConfig2,\n responseEncoding: defaultToConfig2,\n validateStatus: mergeDirectKeys,\n headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)\n };\n\n utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {\n const merge = mergeMap[prop] || mergeDeepProperties;\n const configValue = merge(config1[prop], config2[prop], prop);\n (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);\n });\n\n return config;\n}\n","export const VERSION = \"1.6.7\";","'use strict';\n\nimport {VERSION} from '../env/data.js';\nimport AxiosError from '../core/AxiosError.js';\n\nconst validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nconst deprecatedWarnings = {};\n\n/**\n * Transitional option validator\n *\n * @param {function|boolean?} validator - set to false if the transitional option has been removed\n * @param {string?} version - deprecated version / removed since version\n * @param {string?} message - some message with additional info\n *\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n function formatMessage(opt, desc) {\n return '[Axios v' + VERSION + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return (value, opt, opts) => {\n if (validator === false) {\n throw new AxiosError(\n formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),\n AxiosError.ERR_DEPRECATED\n );\n }\n\n if (version && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n *\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n *\n * @returns {object}\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);\n }\n const keys = Object.keys(options);\n let i = keys.length;\n while (i-- > 0) {\n const opt = keys[i];\n const validator = schema[opt];\n if (validator) {\n const value = options[opt];\n const result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);\n }\n }\n}\n\nexport default {\n assertOptions,\n validators\n};\n","'use strict';\n\nimport utils from './../utils.js';\nimport buildURL from '../helpers/buildURL.js';\nimport InterceptorManager from './InterceptorManager.js';\nimport dispatchRequest from './dispatchRequest.js';\nimport mergeConfig from './mergeConfig.js';\nimport buildFullPath from './buildFullPath.js';\nimport validator from '../helpers/validator.js';\nimport AxiosHeaders from './AxiosHeaders.js';\n\nconst validators = validator.validators;\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n *\n * @return {Axios} A new instance of Axios\n */\nclass Axios {\n constructor(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n }\n\n /**\n * Dispatch a request\n *\n * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)\n * @param {?Object} config\n *\n * @returns {Promise} The Promise to be fulfilled\n */\n async request(configOrUrl, config) {\n try {\n return await this._request(configOrUrl, config);\n } catch (err) {\n if (err instanceof Error) {\n let dummy;\n\n Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : (dummy = new Error());\n\n // slice off the Error: ... line\n const stack = dummy.stack ? dummy.stack.replace(/^.+\\n/, '') : '';\n\n if (!err.stack) {\n err.stack = stack;\n // match without the 2 top stack lines\n } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\\n.+\\n/, ''))) {\n err.stack += '\\n' + stack\n }\n }\n\n throw err;\n }\n }\n\n _request(configOrUrl, config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof configOrUrl === 'string') {\n config = config || {};\n config.url = configOrUrl;\n } else {\n config = configOrUrl || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n const {transitional, paramsSerializer, headers} = config;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean),\n forcedJSONParsing: validators.transitional(validators.boolean),\n clarifyTimeoutError: validators.transitional(validators.boolean)\n }, false);\n }\n\n if (paramsSerializer != null) {\n if (utils.isFunction(paramsSerializer)) {\n config.paramsSerializer = {\n serialize: paramsSerializer\n }\n } else {\n validator.assertOptions(paramsSerializer, {\n encode: validators.function,\n serialize: validators.function\n }, true);\n }\n }\n\n // Set config.method\n config.method = (config.method || this.defaults.method || 'get').toLowerCase();\n\n // Flatten headers\n let contextHeaders = headers && utils.merge(\n headers.common,\n headers[config.method]\n );\n\n headers && utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n (method) => {\n delete headers[method];\n }\n );\n\n config.headers = AxiosHeaders.concat(contextHeaders, headers);\n\n // filter out skipped interceptors\n const requestInterceptorChain = [];\n let synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n const responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n let promise;\n let i = 0;\n let len;\n\n if (!synchronousRequestInterceptors) {\n const chain = [dispatchRequest.bind(this), undefined];\n chain.unshift.apply(chain, requestInterceptorChain);\n chain.push.apply(chain, responseInterceptorChain);\n len = chain.length;\n\n promise = Promise.resolve(config);\n\n while (i < len) {\n promise = promise.then(chain[i++], chain[i++]);\n }\n\n return promise;\n }\n\n len = requestInterceptorChain.length;\n\n let newConfig = config;\n\n i = 0;\n\n while (i < len) {\n const onFulfilled = requestInterceptorChain[i++];\n const onRejected = requestInterceptorChain[i++];\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected.call(this, error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest.call(this, newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n i = 0;\n len = responseInterceptorChain.length;\n\n while (i < len) {\n promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);\n }\n\n return promise;\n }\n\n getUri(config) {\n config = mergeConfig(this.defaults, config);\n const fullPath = buildFullPath(config.baseURL, config.url);\n return buildURL(fullPath, config.params, config.paramsSerializer);\n }\n}\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n\n function generateHTTPMethod(isForm) {\n return function httpMethod(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n headers: isForm ? {\n 'Content-Type': 'multipart/form-data'\n } : {},\n url,\n data\n }));\n };\n }\n\n Axios.prototype[method] = generateHTTPMethod();\n\n Axios.prototype[method + 'Form'] = generateHTTPMethod(true);\n});\n\nexport default Axios;\n","'use strict';\n\nimport CanceledError from './CanceledError.js';\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @param {Function} executor The executor function.\n *\n * @returns {CancelToken}\n */\nclass CancelToken {\n constructor(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n let resolvePromise;\n\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n const token = this;\n\n // eslint-disable-next-line func-names\n this.promise.then(cancel => {\n if (!token._listeners) return;\n\n let i = token._listeners.length;\n\n while (i-- > 0) {\n token._listeners[i](cancel);\n }\n token._listeners = null;\n });\n\n // eslint-disable-next-line func-names\n this.promise.then = onfulfilled => {\n let _resolve;\n // eslint-disable-next-line func-names\n const promise = new Promise(resolve => {\n token.subscribe(resolve);\n _resolve = resolve;\n }).then(onfulfilled);\n\n promise.cancel = function reject() {\n token.unsubscribe(_resolve);\n };\n\n return promise;\n };\n\n executor(function cancel(message, config, request) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new CanceledError(message, config, request);\n resolvePromise(token.reason);\n });\n }\n\n /**\n * Throws a `CanceledError` if cancellation has been requested.\n */\n throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n }\n\n /**\n * Subscribe to the cancel signal\n */\n\n subscribe(listener) {\n if (this.reason) {\n listener(this.reason);\n return;\n }\n\n if (this._listeners) {\n this._listeners.push(listener);\n } else {\n this._listeners = [listener];\n }\n }\n\n /**\n * Unsubscribe from the cancel signal\n */\n\n unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n const index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n }\n\n /**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\n static source() {\n let cancel;\n const token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token,\n cancel\n };\n }\n}\n\nexport default CancelToken;\n","const HttpStatusCode = {\n Continue: 100,\n SwitchingProtocols: 101,\n Processing: 102,\n EarlyHints: 103,\n Ok: 200,\n Created: 201,\n Accepted: 202,\n NonAuthoritativeInformation: 203,\n NoContent: 204,\n ResetContent: 205,\n PartialContent: 206,\n MultiStatus: 207,\n AlreadyReported: 208,\n ImUsed: 226,\n MultipleChoices: 300,\n MovedPermanently: 301,\n Found: 302,\n SeeOther: 303,\n NotModified: 304,\n UseProxy: 305,\n Unused: 306,\n TemporaryRedirect: 307,\n PermanentRedirect: 308,\n BadRequest: 400,\n Unauthorized: 401,\n PaymentRequired: 402,\n Forbidden: 403,\n NotFound: 404,\n MethodNotAllowed: 405,\n NotAcceptable: 406,\n ProxyAuthenticationRequired: 407,\n RequestTimeout: 408,\n Conflict: 409,\n Gone: 410,\n LengthRequired: 411,\n PreconditionFailed: 412,\n PayloadTooLarge: 413,\n UriTooLong: 414,\n UnsupportedMediaType: 415,\n RangeNotSatisfiable: 416,\n ExpectationFailed: 417,\n ImATeapot: 418,\n MisdirectedRequest: 421,\n UnprocessableEntity: 422,\n Locked: 423,\n FailedDependency: 424,\n TooEarly: 425,\n UpgradeRequired: 426,\n PreconditionRequired: 428,\n TooManyRequests: 429,\n RequestHeaderFieldsTooLarge: 431,\n UnavailableForLegalReasons: 451,\n InternalServerError: 500,\n NotImplemented: 501,\n BadGateway: 502,\n ServiceUnavailable: 503,\n GatewayTimeout: 504,\n HttpVersionNotSupported: 505,\n VariantAlsoNegotiates: 506,\n InsufficientStorage: 507,\n LoopDetected: 508,\n NotExtended: 510,\n NetworkAuthenticationRequired: 511,\n};\n\nObject.entries(HttpStatusCode).forEach(([key, value]) => {\n HttpStatusCode[value] = key;\n});\n\nexport default HttpStatusCode;\n","'use strict';\n\nimport utils from './utils.js';\nimport bind from './helpers/bind.js';\nimport Axios from './core/Axios.js';\nimport mergeConfig from './core/mergeConfig.js';\nimport defaults from './defaults/index.js';\nimport formDataToJSON from './helpers/formDataToJSON.js';\nimport CanceledError from './cancel/CanceledError.js';\nimport CancelToken from './cancel/CancelToken.js';\nimport isCancel from './cancel/isCancel.js';\nimport {VERSION} from './env/data.js';\nimport toFormData from './helpers/toFormData.js';\nimport AxiosError from './core/AxiosError.js';\nimport spread from './helpers/spread.js';\nimport isAxiosError from './helpers/isAxiosError.js';\nimport AxiosHeaders from \"./core/AxiosHeaders.js\";\nimport adapters from './adapters/adapters.js';\nimport HttpStatusCode from './helpers/HttpStatusCode.js';\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n *\n * @returns {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n const context = new Axios(defaultConfig);\n const instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context, {allOwnKeys: true});\n\n // Copy context to instance\n utils.extend(instance, context, null, {allOwnKeys: true});\n\n // Factory for creating new instances\n instance.create = function create(instanceConfig) {\n return createInstance(mergeConfig(defaultConfig, instanceConfig));\n };\n\n return instance;\n}\n\n// Create the default instance to be exported\nconst axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Expose Cancel & CancelToken\naxios.CanceledError = CanceledError;\naxios.CancelToken = CancelToken;\naxios.isCancel = isCancel;\naxios.VERSION = VERSION;\naxios.toFormData = toFormData;\n\n// Expose AxiosError class\naxios.AxiosError = AxiosError;\n\n// alias for CanceledError for backward compatibility\naxios.Cancel = axios.CanceledError;\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\n\naxios.spread = spread;\n\n// Expose isAxiosError\naxios.isAxiosError = isAxiosError;\n\n// Expose mergeConfig\naxios.mergeConfig = mergeConfig;\n\naxios.AxiosHeaders = AxiosHeaders;\n\naxios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);\n\naxios.getAdapter = adapters.getAdapter;\n\naxios.HttpStatusCode = HttpStatusCode;\n\naxios.default = axios;\n\n// this module should only have a default export\nexport default axios\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n *\n * @returns {Function}\n */\nexport default function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n *\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nexport default function isAxiosError(payload) {\n return utils.isObject(payload) && (payload.isAxiosError === true);\n}\n","import axios from './lib/axios.js';\n\n// This module is intended to unwrap Axios default export as named.\n// Keep top-level export same with static properties\n// so that it can keep same with es module or cjs\nconst {\n Axios,\n AxiosError,\n CanceledError,\n isCancel,\n CancelToken,\n VERSION,\n all,\n Cancel,\n isAxiosError,\n spread,\n toFormData,\n AxiosHeaders,\n HttpStatusCode,\n formToJSON,\n getAdapter,\n mergeConfig\n} = axios;\n\nexport {\n axios as default,\n Axios,\n AxiosError,\n CanceledError,\n isCancel,\n CancelToken,\n VERSION,\n all,\n Cancel,\n isAxiosError,\n spread,\n toFormData,\n AxiosHeaders,\n HttpStatusCode,\n formToJSON,\n getAdapter,\n mergeConfig\n}\n"],"names":["bind","fn","thisArg","apply","arguments","toString","Object","prototype","getPrototypeOf","kindOf","cache","create","thing","str","call","slice","toLowerCase","kindOfTest","type","typeOfTest","isArray","Array","isUndefined","isArrayBuffer","isString","isFunction","isNumber","isObject","isPlainObject","val","Symbol","toStringTag","iterator","isDate","isFile","isBlob","isFileList","isURLSearchParams","forEach","obj","allOwnKeys","i","l","length","keys","getOwnPropertyNames","len","key","findKey","_key","_global","globalThis","self","window","global","isContextDefined","context","isTypedArray","TypedArray","Uint8Array","isHTMLForm","hasOwnProperty","prop","isRegExp","reduceDescriptors","reducer","descriptors","getOwnPropertyDescriptors","reducedDescriptors","descriptor","name","ret","defineProperties","ALPHA","ALPHABET","DIGIT","ALPHA_DIGIT","toUpperCase","isAsyncFn","utils$1","isBuffer","constructor","isFormData","kind","FormData","append","isArrayBufferView","result","ArrayBuffer","isView","buffer","isBoolean","isStream","pipe","merge","caseless","this","assignValue","targetKey","extend","a","b","trim","replace","stripBOM","content","charCodeAt","inherits","superConstructor","props","defineProperty","value","assign","toFlatObject","sourceObj","destObj","filter","propFilter","merged","endsWith","searchString","position","String","undefined","lastIndex","indexOf","toArray","arr","forEachEntry","next","done","pair","matchAll","regExp","matches","exec","push","hasOwnProp","freezeMethods","enumerable","writable","set","Error","toObjectSet","arrayOrString","delimiter","define","split","toCamelCase","m","p1","p2","noop","toFiniteNumber","defaultValue","Number","isFinite","generateString","size","alphabet","Math","random","isSpecCompliantForm","toJSONObject","stack","visit","source","target","reducedValue","isThenable","then","catch","AxiosError","message","code","config","request","response","captureStackTrace","utils","toJSON","description","number","fileName","lineNumber","columnNumber","status","from","error","customProps","axiosError","cause","isVisitable","removeBrackets","renderKey","path","dots","concat","map","token","join","predicates","test","toFormData","formData","options","TypeError","metaTokens","indexes","option","visitor","defaultVisitor","useBlob","Blob","convertValue","toISOString","Buffer","JSON","stringify","some","isFlatArray","el","index","exposedHelpers","build","pop","encode","charMap","encodeURIComponent","match","AxiosURLSearchParams","params","_pairs","buildURL","url","_encode","serializeFn","serialize","serializedParams","hashmarkIndex","encoder","InterceptorManager$1","handlers","use","fulfilled","rejected","synchronous","runWhen","eject","id","clear","h","transitionalDefaults","silentJSONParsing","forcedJSONParsing","clarifyTimeoutError","platform$1","isBrowser","classes","URLSearchParams","protocols","hasBrowserEnv","document","hasStandardBrowserEnv","product","navigator","hasStandardBrowserWebWorkerEnv","WorkerGlobalScope","importScripts","platform","formDataToJSON","buildPath","isNumericKey","isLast","arrayToObject","entries","parsePropPath","defaults","transitional","adapter","transformRequest","data","headers","contentType","getContentType","hasJSONContentType","isObjectPayload","setContentType","helpers","isNode","toURLEncodedForm","formSerializer","_FormData","env","rawValue","parser","parse","e","stringifySafely","transformResponse","JSONRequested","responseType","strictJSONParsing","ERR_BAD_RESPONSE","timeout","xsrfCookieName","xsrfHeaderName","maxContentLength","maxBodyLength","validateStatus","common","Accept","method","defaults$1","ignoreDuplicateOf","$internals","normalizeHeader","header","normalizeValue","matchHeaderValue","isHeaderNameFilter","AxiosHeaders","valueOrRewrite","rewrite","setHeader","_value","_header","_rewrite","lHeader","setHeaders","rawHeaders","parsed","line","substring","parseHeaders","get","tokens","tokensRE","parseTokens","has","matcher","delete","deleted","deleteHeader","normalize","format","normalized","w","char","formatHeader","targets","asStrings","static","first","computed","accessors","defineAccessor","accessorName","methodName","arg1","arg2","arg3","configurable","buildAccessors","accessor","mapped","headerValue","AxiosHeaders$2","transformData","fns","isCancel","__CANCEL__","CanceledError","ERR_CANCELED","cookies","write","expires","domain","secure","cookie","Date","toGMTString","read","RegExp","decodeURIComponent","remove","now","buildFullPath","baseURL","requestedURL","relativeURL","combineURLs","isURLSameOrigin","msie","userAgent","urlParsingNode","createElement","originURL","resolveURL","href","setAttribute","protocol","host","search","hash","hostname","port","pathname","charAt","location","requestURL","progressEventReducer","listener","isDownloadStream","bytesNotified","_speedometer","samplesCount","min","bytes","timestamps","firstSampleTS","head","tail","chunkLength","startedAt","bytesCount","passed","round","speedometer","loaded","total","lengthComputable","progressBytes","rate","progress","estimated","event","knownAdapters","http","xhr","XMLHttpRequest","Promise","resolve","reject","requestData","requestHeaders","onCanceled","withXSRFToken","cancelToken","unsubscribe","signal","removeEventListener","Boolean","auth","username","password","unescape","btoa","fullPath","onloadend","responseHeaders","getAllResponseHeaders","ERR_BAD_REQUEST","floor","settle","err","responseText","statusText","open","paramsSerializer","onreadystatechange","readyState","responseURL","setTimeout","onabort","ECONNABORTED","onerror","ERR_NETWORK","ontimeout","timeoutErrorMessage","ETIMEDOUT","xsrfValue","setRequestHeader","withCredentials","onDownloadProgress","addEventListener","onUploadProgress","upload","cancel","abort","subscribe","aborted","parseProtocol","send","renderReason","reason","isResolvedHandle","adapters","nameOrAdapter","rejectedReasons","reasons","state","throwIfCancellationRequested","throwIfRequested","dispatchRequest","headersToObject","mergeConfig","config1","config2","getMergedValue","mergeDeepProperties","valueFromConfig2","defaultToConfig2","mergeDirectKeys","mergeMap","timeoutMessage","decompress","beforeRedirect","transport","httpAgent","httpsAgent","socketPath","responseEncoding","configValue","validators","deprecatedWarnings","validator","version","formatMessage","opt","desc","opts","ERR_DEPRECATED","console","warn","assertOptions","schema","allowUnknown","ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","Axios","instanceConfig","interceptors","InterceptorManager","async","configOrUrl","_request","dummy","boolean","function","contextHeaders","requestInterceptorChain","synchronousRequestInterceptors","interceptor","unshift","responseInterceptorChain","promise","chain","newConfig","onFulfilled","onRejected","getUri","generateHTTPMethod","isForm","Axios$2","CancelToken","executor","resolvePromise","_listeners","onfulfilled","_resolve","splice","c","CancelToken$2","HttpStatusCode","Continue","SwitchingProtocols","Processing","EarlyHints","Ok","Created","Accepted","NonAuthoritativeInformation","NoContent","ResetContent","PartialContent","MultiStatus","AlreadyReported","ImUsed","MultipleChoices","MovedPermanently","Found","SeeOther","NotModified","UseProxy","Unused","TemporaryRedirect","PermanentRedirect","BadRequest","Unauthorized","PaymentRequired","Forbidden","NotFound","MethodNotAllowed","NotAcceptable","ProxyAuthenticationRequired","RequestTimeout","Conflict","Gone","LengthRequired","PreconditionFailed","PayloadTooLarge","UriTooLong","UnsupportedMediaType","RangeNotSatisfiable","ExpectationFailed","ImATeapot","MisdirectedRequest","UnprocessableEntity","Locked","FailedDependency","TooEarly","UpgradeRequired","PreconditionRequired","TooManyRequests","RequestHeaderFieldsTooLarge","UnavailableForLegalReasons","InternalServerError","NotImplemented","BadGateway","ServiceUnavailable","GatewayTimeout","HttpVersionNotSupported","VariantAlsoNegotiates","InsufficientStorage","LoopDetected","NotExtended","NetworkAuthenticationRequired","HttpStatusCode$2","axios","createInstance","defaultConfig","instance","VERSION","Cancel","all","promises","spread","callback","isAxiosError","payload","formToJSON","getAdapter","default","axios$1"],"mappings":"AAEe,SAASA,EAAKC,EAAIC,GAC/B,OAAO,WACL,OAAOD,EAAGE,MAAMD,EAASE,UAC7B,CACA,CCAA,MAAMC,SAACA,GAAYC,OAAOC,WACpBC,eAACA,GAAkBF,OAEnBG,GAAUC,EAGbJ,OAAOK,OAAO,MAHQC,IACrB,MAAMC,EAAMR,EAASS,KAAKF,GAC1B,OAAOF,EAAMG,KAASH,EAAMG,GAAOA,EAAIE,MAAM,GAAI,GAAGC,cAAc,GAFvD,IAACN,EAKhB,MAAMO,EAAcC,IAClBA,EAAOA,EAAKF,cACJJ,GAAUH,EAAOG,KAAWM,GAGhCC,EAAaD,GAAQN,UAAgBA,IAAUM,GAS/CE,QAACA,GAAWC,MASZC,EAAcH,EAAW,aAqB/B,MAAMI,EAAgBN,EAAW,eA2BjC,MAAMO,EAAWL,EAAW,UAQtBM,EAAaN,EAAW,YASxBO,EAAWP,EAAW,UAStBQ,EAAYf,GAAoB,OAAVA,GAAmC,iBAAVA,EAiB/CgB,EAAiBC,IACrB,GAAoB,WAAhBpB,EAAOoB,GACT,OAAO,EAGT,MAAMtB,EAAYC,EAAeqB,GACjC,QAAsB,OAAdtB,GAAsBA,IAAcD,OAAOC,WAAkD,OAArCD,OAAOE,eAAeD,IAA0BuB,OAAOC,eAAeF,GAAUC,OAAOE,YAAYH,EAAI,EAUnKI,EAAShB,EAAW,QASpBiB,EAASjB,EAAW,QASpBkB,EAASlB,EAAW,QASpBmB,EAAanB,EAAW,YAsCxBoB,EAAoBpB,EAAW,mBA2BrC,SAASqB,EAAQC,EAAKtC,GAAIuC,WAACA,GAAa,GAAS,IAE/C,GAAID,QACF,OAGF,I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A,GAEvBiE,GAAMc,QAAUd,GAGhB,MAAee,GAAAf,IGnFTnG,MACJA,GAAKhX,WACLA,GAAUwM,cACVA,GAAaF,SACbA,GAAQmM,YACRA,GAAW8E,QACXA,GAAOE,IACPA,GAAGD,OACHA,GAAMK,aACNA,GAAYF,OACZA,GAAM5b,WACNA,GAAUsH,aACVA,GAAY6P,eACZA,GAAc6E,WACdA,GAAUC,WACVA,GAAUlJ,YACVA,IACEqI"} \ No newline at end of file
diff --git a/node_modules/axios/dist/node/axios.cjs b/node_modules/axios/dist/node/axios.cjs
new file mode 100644
index 0000000..9099d87
--- /dev/null
+++ b/node_modules/axios/dist/node/axios.cjs
@@ -0,0 +1,4355 @@
+// Axios v1.6.7 Copyright (c) 2024 Matt Zabriskie and contributors
+'use strict';
+
+const FormData$1 = require('form-data');
+const url = require('url');
+const proxyFromEnv = require('proxy-from-env');
+const http = require('http');
+const https = require('https');
+const util = require('util');
+const followRedirects = require('follow-redirects');
+const zlib = require('zlib');
+const stream = require('stream');
+const EventEmitter = require('events');
+
+function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
+
+const FormData__default = /*#__PURE__*/_interopDefaultLegacy(FormData$1);
+const url__default = /*#__PURE__*/_interopDefaultLegacy(url);
+const http__default = /*#__PURE__*/_interopDefaultLegacy(http);
+const https__default = /*#__PURE__*/_interopDefaultLegacy(https);
+const util__default = /*#__PURE__*/_interopDefaultLegacy(util);
+const followRedirects__default = /*#__PURE__*/_interopDefaultLegacy(followRedirects);
+const zlib__default = /*#__PURE__*/_interopDefaultLegacy(zlib);
+const stream__default = /*#__PURE__*/_interopDefaultLegacy(stream);
+const EventEmitter__default = /*#__PURE__*/_interopDefaultLegacy(EventEmitter);
+
+function bind(fn, thisArg) {
+ return function wrap() {
+ return fn.apply(thisArg, arguments);
+ };
+}
+
+// utils is a library of generic helper functions non-specific to axios
+
+const {toString} = Object.prototype;
+const {getPrototypeOf} = Object;
+
+const kindOf = (cache => thing => {
+ const str = toString.call(thing);
+ return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
+})(Object.create(null));
+
+const kindOfTest = (type) => {
+ type = type.toLowerCase();
+ return (thing) => kindOf(thing) === type
+};
+
+const typeOfTest = type => thing => typeof thing === type;
+
+/**
+ * Determine if a value is an Array
+ *
+ * @param {Object} val The value to test
+ *
+ * @returns {boolean} True if value is an Array, otherwise false
+ */
+const {isArray} = Array;
+
+/**
+ * Determine if a value is undefined
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if the value is undefined, otherwise false
+ */
+const isUndefined = typeOfTest('undefined');
+
+/**
+ * Determine if a value is a Buffer
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a Buffer, otherwise false
+ */
+function isBuffer(val) {
+ return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
+ && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);
+}
+
+/**
+ * Determine if a value is an ArrayBuffer
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is an ArrayBuffer, otherwise false
+ */
+const isArrayBuffer = kindOfTest('ArrayBuffer');
+
+
+/**
+ * Determine if a value is a view on an ArrayBuffer
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
+ */
+function isArrayBufferView(val) {
+ let result;
+ if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
+ result = ArrayBuffer.isView(val);
+ } else {
+ result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));
+ }
+ return result;
+}
+
+/**
+ * Determine if a value is a String
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a String, otherwise false
+ */
+const isString = typeOfTest('string');
+
+/**
+ * Determine if a value is a Function
+ *
+ * @param {*} val The value to test
+ * @returns {boolean} True if value is a Function, otherwise false
+ */
+const isFunction = typeOfTest('function');
+
+/**
+ * Determine if a value is a Number
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a Number, otherwise false
+ */
+const isNumber = typeOfTest('number');
+
+/**
+ * Determine if a value is an Object
+ *
+ * @param {*} thing The value to test
+ *
+ * @returns {boolean} True if value is an Object, otherwise false
+ */
+const isObject = (thing) => thing !== null && typeof thing === 'object';
+
+/**
+ * Determine if a value is a Boolean
+ *
+ * @param {*} thing The value to test
+ * @returns {boolean} True if value is a Boolean, otherwise false
+ */
+const isBoolean = thing => thing === true || thing === false;
+
+/**
+ * Determine if a value is a plain Object
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a plain Object, otherwise false
+ */
+const isPlainObject = (val) => {
+ if (kindOf(val) !== 'object') {
+ return false;
+ }
+
+ const prototype = getPrototypeOf(val);
+ return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);
+};
+
+/**
+ * Determine if a value is a Date
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a Date, otherwise false
+ */
+const isDate = kindOfTest('Date');
+
+/**
+ * Determine if a value is a File
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a File, otherwise false
+ */
+const isFile = kindOfTest('File');
+
+/**
+ * Determine if a value is a Blob
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a Blob, otherwise false
+ */
+const isBlob = kindOfTest('Blob');
+
+/**
+ * Determine if a value is a FileList
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a File, otherwise false
+ */
+const isFileList = kindOfTest('FileList');
+
+/**
+ * Determine if a value is a Stream
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a Stream, otherwise false
+ */
+const isStream = (val) => isObject(val) && isFunction(val.pipe);
+
+/**
+ * Determine if a value is a FormData
+ *
+ * @param {*} thing The value to test
+ *
+ * @returns {boolean} True if value is an FormData, otherwise false
+ */
+const isFormData = (thing) => {
+ let kind;
+ return thing && (
+ (typeof FormData === 'function' && thing instanceof FormData) || (
+ isFunction(thing.append) && (
+ (kind = kindOf(thing)) === 'formdata' ||
+ // detect form-data instance
+ (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')
+ )
+ )
+ )
+};
+
+/**
+ * Determine if a value is a URLSearchParams object
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a URLSearchParams object, otherwise false
+ */
+const isURLSearchParams = kindOfTest('URLSearchParams');
+
+/**
+ * Trim excess whitespace off the beginning and end of a string
+ *
+ * @param {String} str The String to trim
+ *
+ * @returns {String} The String freed of excess whitespace
+ */
+const trim = (str) => str.trim ?
+ str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
+
+/**
+ * Iterate over an Array or an Object invoking a function for each item.
+ *
+ * If `obj` is an Array callback will be called passing
+ * the value, index, and complete array for each item.
+ *
+ * If 'obj' is an Object callback will be called passing
+ * the value, key, and complete object for each property.
+ *
+ * @param {Object|Array} obj The object to iterate
+ * @param {Function} fn The callback to invoke for each item
+ *
+ * @param {Boolean} [allOwnKeys = false]
+ * @returns {any}
+ */
+function forEach(obj, fn, {allOwnKeys = false} = {}) {
+ // Don't bother if no value provided
+ if (obj === null || typeof obj === 'undefined') {
+ return;
+ }
+
+ let i;
+ let l;
+
+ // Force an array if not already something iterable
+ if (typeof obj !== 'object') {
+ /*eslint no-param-reassign:0*/
+ obj = [obj];
+ }
+
+ if (isArray(obj)) {
+ // Iterate over array values
+ for (i = 0, l = obj.length; i < l; i++) {
+ fn.call(null, obj[i], i, obj);
+ }
+ } else {
+ // Iterate over object keys
+ const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
+ const len = keys.length;
+ let key;
+
+ for (i = 0; i < len; i++) {
+ key = keys[i];
+ fn.call(null, obj[key], key, obj);
+ }
+ }
+}
+
+function findKey(obj, key) {
+ key = key.toLowerCase();
+ const keys = Object.keys(obj);
+ let i = keys.length;
+ let _key;
+ while (i-- > 0) {
+ _key = keys[i];
+ if (key === _key.toLowerCase()) {
+ return _key;
+ }
+ }
+ return null;
+}
+
+const _global = (() => {
+ /*eslint no-undef:0*/
+ if (typeof globalThis !== "undefined") return globalThis;
+ return typeof self !== "undefined" ? self : (typeof window !== 'undefined' ? window : global)
+})();
+
+const isContextDefined = (context) => !isUndefined(context) && context !== _global;
+
+/**
+ * Accepts varargs expecting each argument to be an object, then
+ * immutably merges the properties of each object and returns result.
+ *
+ * When multiple objects contain the same key the later object in
+ * the arguments list will take precedence.
+ *
+ * Example:
+ *
+ * ```js
+ * var result = merge({foo: 123}, {foo: 456});
+ * console.log(result.foo); // outputs 456
+ * ```
+ *
+ * @param {Object} obj1 Object to merge
+ *
+ * @returns {Object} Result of all merge properties
+ */
+function merge(/* obj1, obj2, obj3, ... */) {
+ const {caseless} = isContextDefined(this) && this || {};
+ const result = {};
+ const assignValue = (val, key) => {
+ const targetKey = caseless && findKey(result, key) || key;
+ if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
+ result[targetKey] = merge(result[targetKey], val);
+ } else if (isPlainObject(val)) {
+ result[targetKey] = merge({}, val);
+ } else if (isArray(val)) {
+ result[targetKey] = val.slice();
+ } else {
+ result[targetKey] = val;
+ }
+ };
+
+ for (let i = 0, l = arguments.length; i < l; i++) {
+ arguments[i] && forEach(arguments[i], assignValue);
+ }
+ return result;
+}
+
+/**
+ * Extends object a by mutably adding to it the properties of object b.
+ *
+ * @param {Object} a The object to be extended
+ * @param {Object} b The object to copy properties from
+ * @param {Object} thisArg The object to bind function to
+ *
+ * @param {Boolean} [allOwnKeys]
+ * @returns {Object} The resulting value of object a
+ */
+const extend = (a, b, thisArg, {allOwnKeys}= {}) => {
+ forEach(b, (val, key) => {
+ if (thisArg && isFunction(val)) {
+ a[key] = bind(val, thisArg);
+ } else {
+ a[key] = val;
+ }
+ }, {allOwnKeys});
+ return a;
+};
+
+/**
+ * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
+ *
+ * @param {string} content with BOM
+ *
+ * @returns {string} content value without BOM
+ */
+const stripBOM = (content) => {
+ if (content.charCodeAt(0) === 0xFEFF) {
+ content = content.slice(1);
+ }
+ return content;
+};
+
+/**
+ * Inherit the prototype methods from one constructor into another
+ * @param {function} constructor
+ * @param {function} superConstructor
+ * @param {object} [props]
+ * @param {object} [descriptors]
+ *
+ * @returns {void}
+ */
+const inherits = (constructor, superConstructor, props, descriptors) => {
+ constructor.prototype = Object.create(superConstructor.prototype, descriptors);
+ constructor.prototype.constructor = constructor;
+ Object.defineProperty(constructor, 'super', {
+ value: superConstructor.prototype
+ });
+ props && Object.assign(constructor.prototype, props);
+};
+
+/**
+ * Resolve object with deep prototype chain to a flat object
+ * @param {Object} sourceObj source object
+ * @param {Object} [destObj]
+ * @param {Function|Boolean} [filter]
+ * @param {Function} [propFilter]
+ *
+ * @returns {Object}
+ */
+const toFlatObject = (sourceObj, destObj, filter, propFilter) => {
+ let props;
+ let i;
+ let prop;
+ const merged = {};
+
+ destObj = destObj || {};
+ // eslint-disable-next-line no-eq-null,eqeqeq
+ if (sourceObj == null) return destObj;
+
+ do {
+ props = Object.getOwnPropertyNames(sourceObj);
+ i = props.length;
+ while (i-- > 0) {
+ prop = props[i];
+ if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
+ destObj[prop] = sourceObj[prop];
+ merged[prop] = true;
+ }
+ }
+ sourceObj = filter !== false && getPrototypeOf(sourceObj);
+ } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
+
+ return destObj;
+};
+
+/**
+ * Determines whether a string ends with the characters of a specified string
+ *
+ * @param {String} str
+ * @param {String} searchString
+ * @param {Number} [position= 0]
+ *
+ * @returns {boolean}
+ */
+const endsWith = (str, searchString, position) => {
+ str = String(str);
+ if (position === undefined || position > str.length) {
+ position = str.length;
+ }
+ position -= searchString.length;
+ const lastIndex = str.indexOf(searchString, position);
+ return lastIndex !== -1 && lastIndex === position;
+};
+
+
+/**
+ * Returns new array from array like object or null if failed
+ *
+ * @param {*} [thing]
+ *
+ * @returns {?Array}
+ */
+const toArray = (thing) => {
+ if (!thing) return null;
+ if (isArray(thing)) return thing;
+ let i = thing.length;
+ if (!isNumber(i)) return null;
+ const arr = new Array(i);
+ while (i-- > 0) {
+ arr[i] = thing[i];
+ }
+ return arr;
+};
+
+/**
+ * Checking if the Uint8Array exists and if it does, it returns a function that checks if the
+ * thing passed in is an instance of Uint8Array
+ *
+ * @param {TypedArray}
+ *
+ * @returns {Array}
+ */
+// eslint-disable-next-line func-names
+const isTypedArray = (TypedArray => {
+ // eslint-disable-next-line func-names
+ return thing => {
+ return TypedArray && thing instanceof TypedArray;
+ };
+})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));
+
+/**
+ * For each entry in the object, call the function with the key and value.
+ *
+ * @param {Object<any, any>} obj - The object to iterate over.
+ * @param {Function} fn - The function to call for each entry.
+ *
+ * @returns {void}
+ */
+const forEachEntry = (obj, fn) => {
+ const generator = obj && obj[Symbol.iterator];
+
+ const iterator = generator.call(obj);
+
+ let result;
+
+ while ((result = iterator.next()) && !result.done) {
+ const pair = result.value;
+ fn.call(obj, pair[0], pair[1]);
+ }
+};
+
+/**
+ * It takes a regular expression and a string, and returns an array of all the matches
+ *
+ * @param {string} regExp - The regular expression to match against.
+ * @param {string} str - The string to search.
+ *
+ * @returns {Array<boolean>}
+ */
+const matchAll = (regExp, str) => {
+ let matches;
+ const arr = [];
+
+ while ((matches = regExp.exec(str)) !== null) {
+ arr.push(matches);
+ }
+
+ return arr;
+};
+
+/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */
+const isHTMLForm = kindOfTest('HTMLFormElement');
+
+const toCamelCase = str => {
+ return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,
+ function replacer(m, p1, p2) {
+ return p1.toUpperCase() + p2;
+ }
+ );
+};
+
+/* Creating a function that will check if an object has a property. */
+const hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);
+
+/**
+ * Determine if a value is a RegExp object
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a RegExp object, otherwise false
+ */
+const isRegExp = kindOfTest('RegExp');
+
+const reduceDescriptors = (obj, reducer) => {
+ const descriptors = Object.getOwnPropertyDescriptors(obj);
+ const reducedDescriptors = {};
+
+ forEach(descriptors, (descriptor, name) => {
+ let ret;
+ if ((ret = reducer(descriptor, name, obj)) !== false) {
+ reducedDescriptors[name] = ret || descriptor;
+ }
+ });
+
+ Object.defineProperties(obj, reducedDescriptors);
+};
+
+/**
+ * Makes all methods read-only
+ * @param {Object} obj
+ */
+
+const freezeMethods = (obj) => {
+ reduceDescriptors(obj, (descriptor, name) => {
+ // skip restricted props in strict mode
+ if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {
+ return false;
+ }
+
+ const value = obj[name];
+
+ if (!isFunction(value)) return;
+
+ descriptor.enumerable = false;
+
+ if ('writable' in descriptor) {
+ descriptor.writable = false;
+ return;
+ }
+
+ if (!descriptor.set) {
+ descriptor.set = () => {
+ throw Error('Can not rewrite read-only method \'' + name + '\'');
+ };
+ }
+ });
+};
+
+const toObjectSet = (arrayOrString, delimiter) => {
+ const obj = {};
+
+ const define = (arr) => {
+ arr.forEach(value => {
+ obj[value] = true;
+ });
+ };
+
+ isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
+
+ return obj;
+};
+
+const noop = () => {};
+
+const toFiniteNumber = (value, defaultValue) => {
+ value = +value;
+ return Number.isFinite(value) ? value : defaultValue;
+};
+
+const ALPHA = 'abcdefghijklmnopqrstuvwxyz';
+
+const DIGIT = '0123456789';
+
+const ALPHABET = {
+ DIGIT,
+ ALPHA,
+ ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
+};
+
+const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
+ let str = '';
+ const {length} = alphabet;
+ while (size--) {
+ str += alphabet[Math.random() * length|0];
+ }
+
+ return str;
+};
+
+/**
+ * If the thing is a FormData object, return true, otherwise return false.
+ *
+ * @param {unknown} thing - The thing to check.
+ *
+ * @returns {boolean}
+ */
+function isSpecCompliantForm(thing) {
+ return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]);
+}
+
+const toJSONObject = (obj) => {
+ const stack = new Array(10);
+
+ const visit = (source, i) => {
+
+ if (isObject(source)) {
+ if (stack.indexOf(source) >= 0) {
+ return;
+ }
+
+ if(!('toJSON' in source)) {
+ stack[i] = source;
+ const target = isArray(source) ? [] : {};
+
+ forEach(source, (value, key) => {
+ const reducedValue = visit(value, i + 1);
+ !isUndefined(reducedValue) && (target[key] = reducedValue);
+ });
+
+ stack[i] = undefined;
+
+ return target;
+ }
+ }
+
+ return source;
+ };
+
+ return visit(obj, 0);
+};
+
+const isAsyncFn = kindOfTest('AsyncFunction');
+
+const isThenable = (thing) =>
+ thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
+
+const utils$1 = {
+ isArray,
+ isArrayBuffer,
+ isBuffer,
+ isFormData,
+ isArrayBufferView,
+ isString,
+ isNumber,
+ isBoolean,
+ isObject,
+ isPlainObject,
+ isUndefined,
+ isDate,
+ isFile,
+ isBlob,
+ isRegExp,
+ isFunction,
+ isStream,
+ isURLSearchParams,
+ isTypedArray,
+ isFileList,
+ forEach,
+ merge,
+ extend,
+ trim,
+ stripBOM,
+ inherits,
+ toFlatObject,
+ kindOf,
+ kindOfTest,
+ endsWith,
+ toArray,
+ forEachEntry,
+ matchAll,
+ isHTMLForm,
+ hasOwnProperty,
+ hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection
+ reduceDescriptors,
+ freezeMethods,
+ toObjectSet,
+ toCamelCase,
+ noop,
+ toFiniteNumber,
+ findKey,
+ global: _global,
+ isContextDefined,
+ ALPHABET,
+ generateString,
+ isSpecCompliantForm,
+ toJSONObject,
+ isAsyncFn,
+ isThenable
+};
+
+/**
+ * Create an Error with the specified message, config, error code, request and response.
+ *
+ * @param {string} message The error message.
+ * @param {string} [code] The error code (for example, 'ECONNABORTED').
+ * @param {Object} [config] The config.
+ * @param {Object} [request] The request.
+ * @param {Object} [response] The response.
+ *
+ * @returns {Error} The created error.
+ */
+function AxiosError(message, code, config, request, response) {
+ Error.call(this);
+
+ if (Error.captureStackTrace) {
+ Error.captureStackTrace(this, this.constructor);
+ } else {
+ this.stack = (new Error()).stack;
+ }
+
+ this.message = message;
+ this.name = 'AxiosError';
+ code && (this.code = code);
+ config && (this.config = config);
+ request && (this.request = request);
+ response && (this.response = response);
+}
+
+utils$1.inherits(AxiosError, Error, {
+ toJSON: function toJSON() {
+ return {
+ // Standard
+ message: this.message,
+ name: this.name,
+ // Microsoft
+ description: this.description,
+ number: this.number,
+ // Mozilla
+ fileName: this.fileName,
+ lineNumber: this.lineNumber,
+ columnNumber: this.columnNumber,
+ stack: this.stack,
+ // Axios
+ config: utils$1.toJSONObject(this.config),
+ code: this.code,
+ status: this.response && this.response.status ? this.response.status : null
+ };
+ }
+});
+
+const prototype$1 = AxiosError.prototype;
+const descriptors = {};
+
+[
+ 'ERR_BAD_OPTION_VALUE',
+ 'ERR_BAD_OPTION',
+ 'ECONNABORTED',
+ 'ETIMEDOUT',
+ 'ERR_NETWORK',
+ 'ERR_FR_TOO_MANY_REDIRECTS',
+ 'ERR_DEPRECATED',
+ 'ERR_BAD_RESPONSE',
+ 'ERR_BAD_REQUEST',
+ 'ERR_CANCELED',
+ 'ERR_NOT_SUPPORT',
+ 'ERR_INVALID_URL'
+// eslint-disable-next-line func-names
+].forEach(code => {
+ descriptors[code] = {value: code};
+});
+
+Object.defineProperties(AxiosError, descriptors);
+Object.defineProperty(prototype$1, 'isAxiosError', {value: true});
+
+// eslint-disable-next-line func-names
+AxiosError.from = (error, code, config, request, response, customProps) => {
+ const axiosError = Object.create(prototype$1);
+
+ utils$1.toFlatObject(error, axiosError, function filter(obj) {
+ return obj !== Error.prototype;
+ }, prop => {
+ return prop !== 'isAxiosError';
+ });
+
+ AxiosError.call(axiosError, error.message, code, config, request, response);
+
+ axiosError.cause = error;
+
+ axiosError.name = error.name;
+
+ customProps && Object.assign(axiosError, customProps);
+
+ return axiosError;
+};
+
+/**
+ * Determines if the given thing is a array or js object.
+ *
+ * @param {string} thing - The object or array to be visited.
+ *
+ * @returns {boolean}
+ */
+function isVisitable(thing) {
+ return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
+}
+
+/**
+ * It removes the brackets from the end of a string
+ *
+ * @param {string} key - The key of the parameter.
+ *
+ * @returns {string} the key without the brackets.
+ */
+function removeBrackets(key) {
+ return utils$1.endsWith(key, '[]') ? key.slice(0, -2) : key;
+}
+
+/**
+ * It takes a path, a key, and a boolean, and returns a string
+ *
+ * @param {string} path - The path to the current key.
+ * @param {string} key - The key of the current object being iterated over.
+ * @param {string} dots - If true, the key will be rendered with dots instead of brackets.
+ *
+ * @returns {string} The path to the current key.
+ */
+function renderKey(path, key, dots) {
+ if (!path) return key;
+ return path.concat(key).map(function each(token, i) {
+ // eslint-disable-next-line no-param-reassign
+ token = removeBrackets(token);
+ return !dots && i ? '[' + token + ']' : token;
+ }).join(dots ? '.' : '');
+}
+
+/**
+ * If the array is an array and none of its elements are visitable, then it's a flat array.
+ *
+ * @param {Array<any>} arr - The array to check
+ *
+ * @returns {boolean}
+ */
+function isFlatArray(arr) {
+ return utils$1.isArray(arr) && !arr.some(isVisitable);
+}
+
+const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {
+ return /^is[A-Z]/.test(prop);
+});
+
+/**
+ * Convert a data object to FormData
+ *
+ * @param {Object} obj
+ * @param {?Object} [formData]
+ * @param {?Object} [options]
+ * @param {Function} [options.visitor]
+ * @param {Boolean} [options.metaTokens = true]
+ * @param {Boolean} [options.dots = false]
+ * @param {?Boolean} [options.indexes = false]
+ *
+ * @returns {Object}
+ **/
+
+/**
+ * It converts an object into a FormData object
+ *
+ * @param {Object<any, any>} obj - The object to convert to form data.
+ * @param {string} formData - The FormData object to append to.
+ * @param {Object<string, any>} options
+ *
+ * @returns
+ */
+function toFormData(obj, formData, options) {
+ if (!utils$1.isObject(obj)) {
+ throw new TypeError('target must be an object');
+ }
+
+ // eslint-disable-next-line no-param-reassign
+ formData = formData || new (FormData__default["default"] || FormData)();
+
+ // eslint-disable-next-line no-param-reassign
+ options = utils$1.toFlatObject(options, {
+ metaTokens: true,
+ dots: false,
+ indexes: false
+ }, false, function defined(option, source) {
+ // eslint-disable-next-line no-eq-null,eqeqeq
+ return !utils$1.isUndefined(source[option]);
+ });
+
+ const metaTokens = options.metaTokens;
+ // eslint-disable-next-line no-use-before-define
+ const visitor = options.visitor || defaultVisitor;
+ const dots = options.dots;
+ const indexes = options.indexes;
+ const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;
+ const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
+
+ if (!utils$1.isFunction(visitor)) {
+ throw new TypeError('visitor must be a function');
+ }
+
+ function convertValue(value) {
+ if (value === null) return '';
+
+ if (utils$1.isDate(value)) {
+ return value.toISOString();
+ }
+
+ if (!useBlob && utils$1.isBlob(value)) {
+ throw new AxiosError('Blob is not supported. Use a Buffer instead.');
+ }
+
+ if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
+ return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
+ }
+
+ return value;
+ }
+
+ /**
+ * Default visitor.
+ *
+ * @param {*} value
+ * @param {String|Number} key
+ * @param {Array<String|Number>} path
+ * @this {FormData}
+ *
+ * @returns {boolean} return true to visit the each prop of the value recursively
+ */
+ function defaultVisitor(value, key, path) {
+ let arr = value;
+
+ if (value && !path && typeof value === 'object') {
+ if (utils$1.endsWith(key, '{}')) {
+ // eslint-disable-next-line no-param-reassign
+ key = metaTokens ? key : key.slice(0, -2);
+ // eslint-disable-next-line no-param-reassign
+ value = JSON.stringify(value);
+ } else if (
+ (utils$1.isArray(value) && isFlatArray(value)) ||
+ ((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value))
+ )) {
+ // eslint-disable-next-line no-param-reassign
+ key = removeBrackets(key);
+
+ arr.forEach(function each(el, index) {
+ !(utils$1.isUndefined(el) || el === null) && formData.append(
+ // eslint-disable-next-line no-nested-ternary
+ indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),
+ convertValue(el)
+ );
+ });
+ return false;
+ }
+ }
+
+ if (isVisitable(value)) {
+ return true;
+ }
+
+ formData.append(renderKey(path, key, dots), convertValue(value));
+
+ return false;
+ }
+
+ const stack = [];
+
+ const exposedHelpers = Object.assign(predicates, {
+ defaultVisitor,
+ convertValue,
+ isVisitable
+ });
+
+ function build(value, path) {
+ if (utils$1.isUndefined(value)) return;
+
+ if (stack.indexOf(value) !== -1) {
+ throw Error('Circular reference detected in ' + path.join('.'));
+ }
+
+ stack.push(value);
+
+ utils$1.forEach(value, function each(el, key) {
+ const result = !(utils$1.isUndefined(el) || el === null) && visitor.call(
+ formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers
+ );
+
+ if (result === true) {
+ build(el, path ? path.concat(key) : [key]);
+ }
+ });
+
+ stack.pop();
+ }
+
+ if (!utils$1.isObject(obj)) {
+ throw new TypeError('data must be an object');
+ }
+
+ build(obj);
+
+ return formData;
+}
+
+/**
+ * It encodes a string by replacing all characters that are not in the unreserved set with
+ * their percent-encoded equivalents
+ *
+ * @param {string} str - The string to encode.
+ *
+ * @returns {string} The encoded string.
+ */
+function encode$1(str) {
+ const charMap = {
+ '!': '%21',
+ "'": '%27',
+ '(': '%28',
+ ')': '%29',
+ '~': '%7E',
+ '%20': '+',
+ '%00': '\x00'
+ };
+ return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {
+ return charMap[match];
+ });
+}
+
+/**
+ * It takes a params object and converts it to a FormData object
+ *
+ * @param {Object<string, any>} params - The parameters to be converted to a FormData object.
+ * @param {Object<string, any>} options - The options object passed to the Axios constructor.
+ *
+ * @returns {void}
+ */
+function AxiosURLSearchParams(params, options) {
+ this._pairs = [];
+
+ params && toFormData(params, this, options);
+}
+
+const prototype = AxiosURLSearchParams.prototype;
+
+prototype.append = function append(name, value) {
+ this._pairs.push([name, value]);
+};
+
+prototype.toString = function toString(encoder) {
+ const _encode = encoder ? function(value) {
+ return encoder.call(this, value, encode$1);
+ } : encode$1;
+
+ return this._pairs.map(function each(pair) {
+ return _encode(pair[0]) + '=' + _encode(pair[1]);
+ }, '').join('&');
+};
+
+/**
+ * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their
+ * URI encoded counterparts
+ *
+ * @param {string} val The value to be encoded.
+ *
+ * @returns {string} The encoded value.
+ */
+function encode(val) {
+ return encodeURIComponent(val).
+ replace(/%3A/gi, ':').
+ replace(/%24/g, '$').
+ replace(/%2C/gi, ',').
+ replace(/%20/g, '+').
+ replace(/%5B/gi, '[').
+ replace(/%5D/gi, ']');
+}
+
+/**
+ * Build a URL by appending params to the end
+ *
+ * @param {string} url The base of the url (e.g., http://www.google.com)
+ * @param {object} [params] The params to be appended
+ * @param {?object} options
+ *
+ * @returns {string} The formatted url
+ */
+function buildURL(url, params, options) {
+ /*eslint no-param-reassign:0*/
+ if (!params) {
+ return url;
+ }
+
+ const _encode = options && options.encode || encode;
+
+ const serializeFn = options && options.serialize;
+
+ let serializedParams;
+
+ if (serializeFn) {
+ serializedParams = serializeFn(params, options);
+ } else {
+ serializedParams = utils$1.isURLSearchParams(params) ?
+ params.toString() :
+ new AxiosURLSearchParams(params, options).toString(_encode);
+ }
+
+ if (serializedParams) {
+ const hashmarkIndex = url.indexOf("#");
+
+ if (hashmarkIndex !== -1) {
+ url = url.slice(0, hashmarkIndex);
+ }
+ url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
+ }
+
+ return url;
+}
+
+class InterceptorManager {
+ constructor() {
+ this.handlers = [];
+ }
+
+ /**
+ * Add a new interceptor to the stack
+ *
+ * @param {Function} fulfilled The function to handle `then` for a `Promise`
+ * @param {Function} rejected The function to handle `reject` for a `Promise`
+ *
+ * @return {Number} An ID used to remove interceptor later
+ */
+ use(fulfilled, rejected, options) {
+ this.handlers.push({
+ fulfilled,
+ rejected,
+ synchronous: options ? options.synchronous : false,
+ runWhen: options ? options.runWhen : null
+ });
+ return this.handlers.length - 1;
+ }
+
+ /**
+ * Remove an interceptor from the stack
+ *
+ * @param {Number} id The ID that was returned by `use`
+ *
+ * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
+ */
+ eject(id) {
+ if (this.handlers[id]) {
+ this.handlers[id] = null;
+ }
+ }
+
+ /**
+ * Clear all interceptors from the stack
+ *
+ * @returns {void}
+ */
+ clear() {
+ if (this.handlers) {
+ this.handlers = [];
+ }
+ }
+
+ /**
+ * Iterate over all the registered interceptors
+ *
+ * This method is particularly useful for skipping over any
+ * interceptors that may have become `null` calling `eject`.
+ *
+ * @param {Function} fn The function to call for each interceptor
+ *
+ * @returns {void}
+ */
+ forEach(fn) {
+ utils$1.forEach(this.handlers, function forEachHandler(h) {
+ if (h !== null) {
+ fn(h);
+ }
+ });
+ }
+}
+
+const InterceptorManager$1 = InterceptorManager;
+
+const transitionalDefaults = {
+ silentJSONParsing: true,
+ forcedJSONParsing: true,
+ clarifyTimeoutError: false
+};
+
+const URLSearchParams = url__default["default"].URLSearchParams;
+
+const platform$1 = {
+ isNode: true,
+ classes: {
+ URLSearchParams,
+ FormData: FormData__default["default"],
+ Blob: typeof Blob !== 'undefined' && Blob || null
+ },
+ protocols: [ 'http', 'https', 'file', 'data' ]
+};
+
+const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
+
+/**
+ * Determine if we're running in a standard browser environment
+ *
+ * This allows axios to run in a web worker, and react-native.
+ * Both environments support XMLHttpRequest, but not fully standard globals.
+ *
+ * web workers:
+ * typeof window -> undefined
+ * typeof document -> undefined
+ *
+ * react-native:
+ * navigator.product -> 'ReactNative'
+ * nativescript
+ * navigator.product -> 'NativeScript' or 'NS'
+ *
+ * @returns {boolean}
+ */
+const hasStandardBrowserEnv = (
+ (product) => {
+ return hasBrowserEnv && ['ReactNative', 'NativeScript', 'NS'].indexOf(product) < 0
+ })(typeof navigator !== 'undefined' && navigator.product);
+
+/**
+ * Determine if we're running in a standard browser webWorker environment
+ *
+ * Although the `isStandardBrowserEnv` method indicates that
+ * `allows axios to run in a web worker`, the WebWorker will still be
+ * filtered out due to its judgment standard
+ * `typeof window !== 'undefined' && typeof document !== 'undefined'`.
+ * This leads to a problem when axios post `FormData` in webWorker
+ */
+const hasStandardBrowserWebWorkerEnv = (() => {
+ return (
+ typeof WorkerGlobalScope !== 'undefined' &&
+ // eslint-disable-next-line no-undef
+ self instanceof WorkerGlobalScope &&
+ typeof self.importScripts === 'function'
+ );
+})();
+
+const utils = /*#__PURE__*/Object.freeze({
+ __proto__: null,
+ hasBrowserEnv: hasBrowserEnv,
+ hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
+ hasStandardBrowserEnv: hasStandardBrowserEnv
+});
+
+const platform = {
+ ...utils,
+ ...platform$1
+};
+
+function toURLEncodedForm(data, options) {
+ return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({
+ visitor: function(value, key, path, helpers) {
+ if (platform.isNode && utils$1.isBuffer(value)) {
+ this.append(key, value.toString('base64'));
+ return false;
+ }
+
+ return helpers.defaultVisitor.apply(this, arguments);
+ }
+ }, options));
+}
+
+/**
+ * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']
+ *
+ * @param {string} name - The name of the property to get.
+ *
+ * @returns An array of strings.
+ */
+function parsePropPath(name) {
+ // foo[x][y][z]
+ // foo.x.y.z
+ // foo-x-y-z
+ // foo x y z
+ return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map(match => {
+ return match[0] === '[]' ? '' : match[1] || match[0];
+ });
+}
+
+/**
+ * Convert an array to an object.
+ *
+ * @param {Array<any>} arr - The array to convert to an object.
+ *
+ * @returns An object with the same keys and values as the array.
+ */
+function arrayToObject(arr) {
+ const obj = {};
+ const keys = Object.keys(arr);
+ let i;
+ const len = keys.length;
+ let key;
+ for (i = 0; i < len; i++) {
+ key = keys[i];
+ obj[key] = arr[key];
+ }
+ return obj;
+}
+
+/**
+ * It takes a FormData object and returns a JavaScript object
+ *
+ * @param {string} formData The FormData object to convert to JSON.
+ *
+ * @returns {Object<string, any> | null} The converted object.
+ */
+function formDataToJSON(formData) {
+ function buildPath(path, value, target, index) {
+ let name = path[index++];
+
+ if (name === '__proto__') return true;
+
+ const isNumericKey = Number.isFinite(+name);
+ const isLast = index >= path.length;
+ name = !name && utils$1.isArray(target) ? target.length : name;
+
+ if (isLast) {
+ if (utils$1.hasOwnProp(target, name)) {
+ target[name] = [target[name], value];
+ } else {
+ target[name] = value;
+ }
+
+ return !isNumericKey;
+ }
+
+ if (!target[name] || !utils$1.isObject(target[name])) {
+ target[name] = [];
+ }
+
+ const result = buildPath(path, value, target[name], index);
+
+ if (result && utils$1.isArray(target[name])) {
+ target[name] = arrayToObject(target[name]);
+ }
+
+ return !isNumericKey;
+ }
+
+ if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
+ const obj = {};
+
+ utils$1.forEachEntry(formData, (name, value) => {
+ buildPath(parsePropPath(name), value, obj, 0);
+ });
+
+ return obj;
+ }
+
+ return null;
+}
+
+/**
+ * It takes a string, tries to parse it, and if it fails, it returns the stringified version
+ * of the input
+ *
+ * @param {any} rawValue - The value to be stringified.
+ * @param {Function} parser - A function that parses a string into a JavaScript object.
+ * @param {Function} encoder - A function that takes a value and returns a string.
+ *
+ * @returns {string} A stringified version of the rawValue.
+ */
+function stringifySafely(rawValue, parser, encoder) {
+ if (utils$1.isString(rawValue)) {
+ try {
+ (parser || JSON.parse)(rawValue);
+ return utils$1.trim(rawValue);
+ } catch (e) {
+ if (e.name !== 'SyntaxError') {
+ throw e;
+ }
+ }
+ }
+
+ return (encoder || JSON.stringify)(rawValue);
+}
+
+const defaults = {
+
+ transitional: transitionalDefaults,
+
+ adapter: ['xhr', 'http'],
+
+ transformRequest: [function transformRequest(data, headers) {
+ const contentType = headers.getContentType() || '';
+ const hasJSONContentType = contentType.indexOf('application/json') > -1;
+ const isObjectPayload = utils$1.isObject(data);
+
+ if (isObjectPayload && utils$1.isHTMLForm(data)) {
+ data = new FormData(data);
+ }
+
+ const isFormData = utils$1.isFormData(data);
+
+ if (isFormData) {
+ return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
+ }
+
+ if (utils$1.isArrayBuffer(data) ||
+ utils$1.isBuffer(data) ||
+ utils$1.isStream(data) ||
+ utils$1.isFile(data) ||
+ utils$1.isBlob(data)
+ ) {
+ return data;
+ }
+ if (utils$1.isArrayBufferView(data)) {
+ return data.buffer;
+ }
+ if (utils$1.isURLSearchParams(data)) {
+ headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
+ return data.toString();
+ }
+
+ let isFileList;
+
+ if (isObjectPayload) {
+ if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {
+ return toURLEncodedForm(data, this.formSerializer).toString();
+ }
+
+ if ((isFileList = utils$1.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {
+ const _FormData = this.env && this.env.FormData;
+
+ return toFormData(
+ isFileList ? {'files[]': data} : data,
+ _FormData && new _FormData(),
+ this.formSerializer
+ );
+ }
+ }
+
+ if (isObjectPayload || hasJSONContentType ) {
+ headers.setContentType('application/json', false);
+ return stringifySafely(data);
+ }
+
+ return data;
+ }],
+
+ transformResponse: [function transformResponse(data) {
+ const transitional = this.transitional || defaults.transitional;
+ const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
+ const JSONRequested = this.responseType === 'json';
+
+ if (data && utils$1.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {
+ const silentJSONParsing = transitional && transitional.silentJSONParsing;
+ const strictJSONParsing = !silentJSONParsing && JSONRequested;
+
+ try {
+ return JSON.parse(data);
+ } catch (e) {
+ if (strictJSONParsing) {
+ if (e.name === 'SyntaxError') {
+ throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);
+ }
+ throw e;
+ }
+ }
+ }
+
+ return data;
+ }],
+
+ /**
+ * A timeout in milliseconds to abort a request. If set to 0 (default) a
+ * timeout is not created.
+ */
+ timeout: 0,
+
+ xsrfCookieName: 'XSRF-TOKEN',
+ xsrfHeaderName: 'X-XSRF-TOKEN',
+
+ maxContentLength: -1,
+ maxBodyLength: -1,
+
+ env: {
+ FormData: platform.classes.FormData,
+ Blob: platform.classes.Blob
+ },
+
+ validateStatus: function validateStatus(status) {
+ return status >= 200 && status < 300;
+ },
+
+ headers: {
+ common: {
+ 'Accept': 'application/json, text/plain, */*',
+ 'Content-Type': undefined
+ }
+ }
+};
+
+utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {
+ defaults.headers[method] = {};
+});
+
+const defaults$1 = defaults;
+
+// RawAxiosHeaders whose duplicates are ignored by node
+// c.f. https://nodejs.org/api/http.html#http_message_headers
+const ignoreDuplicateOf = utils$1.toObjectSet([
+ 'age', 'authorization', 'content-length', 'content-type', 'etag',
+ 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
+ 'last-modified', 'location', 'max-forwards', 'proxy-authorization',
+ 'referer', 'retry-after', 'user-agent'
+]);
+
+/**
+ * Parse headers into an object
+ *
+ * ```
+ * Date: Wed, 27 Aug 2014 08:58:49 GMT
+ * Content-Type: application/json
+ * Connection: keep-alive
+ * Transfer-Encoding: chunked
+ * ```
+ *
+ * @param {String} rawHeaders Headers needing to be parsed
+ *
+ * @returns {Object} Headers parsed into an object
+ */
+const parseHeaders = rawHeaders => {
+ const parsed = {};
+ let key;
+ let val;
+ let i;
+
+ rawHeaders && rawHeaders.split('\n').forEach(function parser(line) {
+ i = line.indexOf(':');
+ key = line.substring(0, i).trim().toLowerCase();
+ val = line.substring(i + 1).trim();
+
+ if (!key || (parsed[key] && ignoreDuplicateOf[key])) {
+ return;
+ }
+
+ if (key === 'set-cookie') {
+ if (parsed[key]) {
+ parsed[key].push(val);
+ } else {
+ parsed[key] = [val];
+ }
+ } else {
+ parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
+ }
+ });
+
+ return parsed;
+};
+
+const $internals = Symbol('internals');
+
+function normalizeHeader(header) {
+ return header && String(header).trim().toLowerCase();
+}
+
+function normalizeValue(value) {
+ if (value === false || value == null) {
+ return value;
+ }
+
+ return utils$1.isArray(value) ? value.map(normalizeValue) : String(value);
+}
+
+function parseTokens(str) {
+ const tokens = Object.create(null);
+ const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
+ let match;
+
+ while ((match = tokensRE.exec(str))) {
+ tokens[match[1]] = match[2];
+ }
+
+ return tokens;
+}
+
+const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
+
+function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
+ if (utils$1.isFunction(filter)) {
+ return filter.call(this, value, header);
+ }
+
+ if (isHeaderNameFilter) {
+ value = header;
+ }
+
+ if (!utils$1.isString(value)) return;
+
+ if (utils$1.isString(filter)) {
+ return value.indexOf(filter) !== -1;
+ }
+
+ if (utils$1.isRegExp(filter)) {
+ return filter.test(value);
+ }
+}
+
+function formatHeader(header) {
+ return header.trim()
+ .toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => {
+ return char.toUpperCase() + str;
+ });
+}
+
+function buildAccessors(obj, header) {
+ const accessorName = utils$1.toCamelCase(' ' + header);
+
+ ['get', 'set', 'has'].forEach(methodName => {
+ Object.defineProperty(obj, methodName + accessorName, {
+ value: function(arg1, arg2, arg3) {
+ return this[methodName].call(this, header, arg1, arg2, arg3);
+ },
+ configurable: true
+ });
+ });
+}
+
+class AxiosHeaders {
+ constructor(headers) {
+ headers && this.set(headers);
+ }
+
+ set(header, valueOrRewrite, rewrite) {
+ const self = this;
+
+ function setHeader(_value, _header, _rewrite) {
+ const lHeader = normalizeHeader(_header);
+
+ if (!lHeader) {
+ throw new Error('header name must be a non-empty string');
+ }
+
+ const key = utils$1.findKey(self, lHeader);
+
+ if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {
+ self[key || _header] = normalizeValue(_value);
+ }
+ }
+
+ const setHeaders = (headers, _rewrite) =>
+ utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
+
+ if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
+ setHeaders(header, valueOrRewrite);
+ } else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
+ setHeaders(parseHeaders(header), valueOrRewrite);
+ } else {
+ header != null && setHeader(valueOrRewrite, header, rewrite);
+ }
+
+ return this;
+ }
+
+ get(header, parser) {
+ header = normalizeHeader(header);
+
+ if (header) {
+ const key = utils$1.findKey(this, header);
+
+ if (key) {
+ const value = this[key];
+
+ if (!parser) {
+ return value;
+ }
+
+ if (parser === true) {
+ return parseTokens(value);
+ }
+
+ if (utils$1.isFunction(parser)) {
+ return parser.call(this, value, key);
+ }
+
+ if (utils$1.isRegExp(parser)) {
+ return parser.exec(value);
+ }
+
+ throw new TypeError('parser must be boolean|regexp|function');
+ }
+ }
+ }
+
+ has(header, matcher) {
+ header = normalizeHeader(header);
+
+ if (header) {
+ const key = utils$1.findKey(this, header);
+
+ return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
+ }
+
+ return false;
+ }
+
+ delete(header, matcher) {
+ const self = this;
+ let deleted = false;
+
+ function deleteHeader(_header) {
+ _header = normalizeHeader(_header);
+
+ if (_header) {
+ const key = utils$1.findKey(self, _header);
+
+ if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {
+ delete self[key];
+
+ deleted = true;
+ }
+ }
+ }
+
+ if (utils$1.isArray(header)) {
+ header.forEach(deleteHeader);
+ } else {
+ deleteHeader(header);
+ }
+
+ return deleted;
+ }
+
+ clear(matcher) {
+ const keys = Object.keys(this);
+ let i = keys.length;
+ let deleted = false;
+
+ while (i--) {
+ const key = keys[i];
+ if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
+ delete this[key];
+ deleted = true;
+ }
+ }
+
+ return deleted;
+ }
+
+ normalize(format) {
+ const self = this;
+ const headers = {};
+
+ utils$1.forEach(this, (value, header) => {
+ const key = utils$1.findKey(headers, header);
+
+ if (key) {
+ self[key] = normalizeValue(value);
+ delete self[header];
+ return;
+ }
+
+ const normalized = format ? formatHeader(header) : String(header).trim();
+
+ if (normalized !== header) {
+ delete self[header];
+ }
+
+ self[normalized] = normalizeValue(value);
+
+ headers[normalized] = true;
+ });
+
+ return this;
+ }
+
+ concat(...targets) {
+ return this.constructor.concat(this, ...targets);
+ }
+
+ toJSON(asStrings) {
+ const obj = Object.create(null);
+
+ utils$1.forEach(this, (value, header) => {
+ value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value);
+ });
+
+ return obj;
+ }
+
+ [Symbol.iterator]() {
+ return Object.entries(this.toJSON())[Symbol.iterator]();
+ }
+
+ toString() {
+ return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n');
+ }
+
+ get [Symbol.toStringTag]() {
+ return 'AxiosHeaders';
+ }
+
+ static from(thing) {
+ return thing instanceof this ? thing : new this(thing);
+ }
+
+ static concat(first, ...targets) {
+ const computed = new this(first);
+
+ targets.forEach((target) => computed.set(target));
+
+ return computed;
+ }
+
+ static accessor(header) {
+ const internals = this[$internals] = (this[$internals] = {
+ accessors: {}
+ });
+
+ const accessors = internals.accessors;
+ const prototype = this.prototype;
+
+ function defineAccessor(_header) {
+ const lHeader = normalizeHeader(_header);
+
+ if (!accessors[lHeader]) {
+ buildAccessors(prototype, _header);
+ accessors[lHeader] = true;
+ }
+ }
+
+ utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
+
+ return this;
+ }
+}
+
+AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
+
+// reserved names hotfix
+utils$1.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {
+ let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
+ return {
+ get: () => value,
+ set(headerValue) {
+ this[mapped] = headerValue;
+ }
+ }
+});
+
+utils$1.freezeMethods(AxiosHeaders);
+
+const AxiosHeaders$1 = AxiosHeaders;
+
+/**
+ * Transform the data for a request or a response
+ *
+ * @param {Array|Function} fns A single function or Array of functions
+ * @param {?Object} response The response object
+ *
+ * @returns {*} The resulting transformed data
+ */
+function transformData(fns, response) {
+ const config = this || defaults$1;
+ const context = response || config;
+ const headers = AxiosHeaders$1.from(context.headers);
+ let data = context.data;
+
+ utils$1.forEach(fns, function transform(fn) {
+ data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);
+ });
+
+ headers.normalize();
+
+ return data;
+}
+
+function isCancel(value) {
+ return !!(value && value.__CANCEL__);
+}
+
+/**
+ * A `CanceledError` is an object that is thrown when an operation is canceled.
+ *
+ * @param {string=} message The message.
+ * @param {Object=} config The config.
+ * @param {Object=} request The request.
+ *
+ * @returns {CanceledError} The created error.
+ */
+function CanceledError(message, config, request) {
+ // eslint-disable-next-line no-eq-null,eqeqeq
+ AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);
+ this.name = 'CanceledError';
+}
+
+utils$1.inherits(CanceledError, AxiosError, {
+ __CANCEL__: true
+});
+
+/**
+ * Resolve or reject a Promise based on response status.
+ *
+ * @param {Function} resolve A function that resolves the promise.
+ * @param {Function} reject A function that rejects the promise.
+ * @param {object} response The response.
+ *
+ * @returns {object} The response.
+ */
+function settle(resolve, reject, response) {
+ const validateStatus = response.config.validateStatus;
+ if (!response.status || !validateStatus || validateStatus(response.status)) {
+ resolve(response);
+ } else {
+ reject(new AxiosError(
+ 'Request failed with status code ' + response.status,
+ [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
+ response.config,
+ response.request,
+ response
+ ));
+ }
+}
+
+/**
+ * Determines whether the specified URL is absolute
+ *
+ * @param {string} url The URL to test
+ *
+ * @returns {boolean} True if the specified URL is absolute, otherwise false
+ */
+function isAbsoluteURL(url) {
+ // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
+ // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
+ // by any combination of letters, digits, plus, period, or hyphen.
+ return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
+}
+
+/**
+ * Creates a new URL by combining the specified URLs
+ *
+ * @param {string} baseURL The base URL
+ * @param {string} relativeURL The relative URL
+ *
+ * @returns {string} The combined URL
+ */
+function combineURLs(baseURL, relativeURL) {
+ return relativeURL
+ ? baseURL.replace(/\/?\/$/, '') + '/' + relativeURL.replace(/^\/+/, '')
+ : baseURL;
+}
+
+/**
+ * Creates a new URL by combining the baseURL with the requestedURL,
+ * only when the requestedURL is not already an absolute URL.
+ * If the requestURL is absolute, this function returns the requestedURL untouched.
+ *
+ * @param {string} baseURL The base URL
+ * @param {string} requestedURL Absolute or relative URL to combine
+ *
+ * @returns {string} The combined full path
+ */
+function buildFullPath(baseURL, requestedURL) {
+ if (baseURL && !isAbsoluteURL(requestedURL)) {
+ return combineURLs(baseURL, requestedURL);
+ }
+ return requestedURL;
+}
+
+const VERSION = "1.6.7";
+
+function parseProtocol(url) {
+ const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
+ return match && match[1] || '';
+}
+
+const DATA_URL_PATTERN = /^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;
+
+/**
+ * Parse data uri to a Buffer or Blob
+ *
+ * @param {String} uri
+ * @param {?Boolean} asBlob
+ * @param {?Object} options
+ * @param {?Function} options.Blob
+ *
+ * @returns {Buffer|Blob}
+ */
+function fromDataURI(uri, asBlob, options) {
+ const _Blob = options && options.Blob || platform.classes.Blob;
+ const protocol = parseProtocol(uri);
+
+ if (asBlob === undefined && _Blob) {
+ asBlob = true;
+ }
+
+ if (protocol === 'data') {
+ uri = protocol.length ? uri.slice(protocol.length + 1) : uri;
+
+ const match = DATA_URL_PATTERN.exec(uri);
+
+ if (!match) {
+ throw new AxiosError('Invalid URL', AxiosError.ERR_INVALID_URL);
+ }
+
+ const mime = match[1];
+ const isBase64 = match[2];
+ const body = match[3];
+ const buffer = Buffer.from(decodeURIComponent(body), isBase64 ? 'base64' : 'utf8');
+
+ if (asBlob) {
+ if (!_Blob) {
+ throw new AxiosError('Blob is not supported', AxiosError.ERR_NOT_SUPPORT);
+ }
+
+ return new _Blob([buffer], {type: mime});
+ }
+
+ return buffer;
+ }
+
+ throw new AxiosError('Unsupported protocol ' + protocol, AxiosError.ERR_NOT_SUPPORT);
+}
+
+/**
+ * Throttle decorator
+ * @param {Function} fn
+ * @param {Number} freq
+ * @return {Function}
+ */
+function throttle(fn, freq) {
+ let timestamp = 0;
+ const threshold = 1000 / freq;
+ let timer = null;
+ return function throttled(force, args) {
+ const now = Date.now();
+ if (force || now - timestamp > threshold) {
+ if (timer) {
+ clearTimeout(timer);
+ timer = null;
+ }
+ timestamp = now;
+ return fn.apply(null, args);
+ }
+ if (!timer) {
+ timer = setTimeout(() => {
+ timer = null;
+ timestamp = Date.now();
+ return fn.apply(null, args);
+ }, threshold - (now - timestamp));
+ }
+ };
+}
+
+/**
+ * Calculate data maxRate
+ * @param {Number} [samplesCount= 10]
+ * @param {Number} [min= 1000]
+ * @returns {Function}
+ */
+function speedometer(samplesCount, min) {
+ samplesCount = samplesCount || 10;
+ const bytes = new Array(samplesCount);
+ const timestamps = new Array(samplesCount);
+ let head = 0;
+ let tail = 0;
+ let firstSampleTS;
+
+ min = min !== undefined ? min : 1000;
+
+ return function push(chunkLength) {
+ const now = Date.now();
+
+ const startedAt = timestamps[tail];
+
+ if (!firstSampleTS) {
+ firstSampleTS = now;
+ }
+
+ bytes[head] = chunkLength;
+ timestamps[head] = now;
+
+ let i = tail;
+ let bytesCount = 0;
+
+ while (i !== head) {
+ bytesCount += bytes[i++];
+ i = i % samplesCount;
+ }
+
+ head = (head + 1) % samplesCount;
+
+ if (head === tail) {
+ tail = (tail + 1) % samplesCount;
+ }
+
+ if (now - firstSampleTS < min) {
+ return;
+ }
+
+ const passed = startedAt && now - startedAt;
+
+ return passed ? Math.round(bytesCount * 1000 / passed) : undefined;
+ };
+}
+
+const kInternals = Symbol('internals');
+
+class AxiosTransformStream extends stream__default["default"].Transform{
+ constructor(options) {
+ options = utils$1.toFlatObject(options, {
+ maxRate: 0,
+ chunkSize: 64 * 1024,
+ minChunkSize: 100,
+ timeWindow: 500,
+ ticksRate: 2,
+ samplesCount: 15
+ }, null, (prop, source) => {
+ return !utils$1.isUndefined(source[prop]);
+ });
+
+ super({
+ readableHighWaterMark: options.chunkSize
+ });
+
+ const self = this;
+
+ const internals = this[kInternals] = {
+ length: options.length,
+ timeWindow: options.timeWindow,
+ ticksRate: options.ticksRate,
+ chunkSize: options.chunkSize,
+ maxRate: options.maxRate,
+ minChunkSize: options.minChunkSize,
+ bytesSeen: 0,
+ isCaptured: false,
+ notifiedBytesLoaded: 0,
+ ts: Date.now(),
+ bytes: 0,
+ onReadCallback: null
+ };
+
+ const _speedometer = speedometer(internals.ticksRate * options.samplesCount, internals.timeWindow);
+
+ this.on('newListener', event => {
+ if (event === 'progress') {
+ if (!internals.isCaptured) {
+ internals.isCaptured = true;
+ }
+ }
+ });
+
+ let bytesNotified = 0;
+
+ internals.updateProgress = throttle(function throttledHandler() {
+ const totalBytes = internals.length;
+ const bytesTransferred = internals.bytesSeen;
+ const progressBytes = bytesTransferred - bytesNotified;
+ if (!progressBytes || self.destroyed) return;
+
+ const rate = _speedometer(progressBytes);
+
+ bytesNotified = bytesTransferred;
+
+ process.nextTick(() => {
+ self.emit('progress', {
+ 'loaded': bytesTransferred,
+ 'total': totalBytes,
+ 'progress': totalBytes ? (bytesTransferred / totalBytes) : undefined,
+ 'bytes': progressBytes,
+ 'rate': rate ? rate : undefined,
+ 'estimated': rate && totalBytes && bytesTransferred <= totalBytes ?
+ (totalBytes - bytesTransferred) / rate : undefined
+ });
+ });
+ }, internals.ticksRate);
+
+ const onFinish = () => {
+ internals.updateProgress(true);
+ };
+
+ this.once('end', onFinish);
+ this.once('error', onFinish);
+ }
+
+ _read(size) {
+ const internals = this[kInternals];
+
+ if (internals.onReadCallback) {
+ internals.onReadCallback();
+ }
+
+ return super._read(size);
+ }
+
+ _transform(chunk, encoding, callback) {
+ const self = this;
+ const internals = this[kInternals];
+ const maxRate = internals.maxRate;
+
+ const readableHighWaterMark = this.readableHighWaterMark;
+
+ const timeWindow = internals.timeWindow;
+
+ const divider = 1000 / timeWindow;
+ const bytesThreshold = (maxRate / divider);
+ const minChunkSize = internals.minChunkSize !== false ? Math.max(internals.minChunkSize, bytesThreshold * 0.01) : 0;
+
+ function pushChunk(_chunk, _callback) {
+ const bytes = Buffer.byteLength(_chunk);
+ internals.bytesSeen += bytes;
+ internals.bytes += bytes;
+
+ if (internals.isCaptured) {
+ internals.updateProgress();
+ }
+
+ if (self.push(_chunk)) {
+ process.nextTick(_callback);
+ } else {
+ internals.onReadCallback = () => {
+ internals.onReadCallback = null;
+ process.nextTick(_callback);
+ };
+ }
+ }
+
+ const transformChunk = (_chunk, _callback) => {
+ const chunkSize = Buffer.byteLength(_chunk);
+ let chunkRemainder = null;
+ let maxChunkSize = readableHighWaterMark;
+ let bytesLeft;
+ let passed = 0;
+
+ if (maxRate) {
+ const now = Date.now();
+
+ if (!internals.ts || (passed = (now - internals.ts)) >= timeWindow) {
+ internals.ts = now;
+ bytesLeft = bytesThreshold - internals.bytes;
+ internals.bytes = bytesLeft < 0 ? -bytesLeft : 0;
+ passed = 0;
+ }
+
+ bytesLeft = bytesThreshold - internals.bytes;
+ }
+
+ if (maxRate) {
+ if (bytesLeft <= 0) {
+ // next time window
+ return setTimeout(() => {
+ _callback(null, _chunk);
+ }, timeWindow - passed);
+ }
+
+ if (bytesLeft < maxChunkSize) {
+ maxChunkSize = bytesLeft;
+ }
+ }
+
+ if (maxChunkSize && chunkSize > maxChunkSize && (chunkSize - maxChunkSize) > minChunkSize) {
+ chunkRemainder = _chunk.subarray(maxChunkSize);
+ _chunk = _chunk.subarray(0, maxChunkSize);
+ }
+
+ pushChunk(_chunk, chunkRemainder ? () => {
+ process.nextTick(_callback, null, chunkRemainder);
+ } : _callback);
+ };
+
+ transformChunk(chunk, function transformNextChunk(err, _chunk) {
+ if (err) {
+ return callback(err);
+ }
+
+ if (_chunk) {
+ transformChunk(_chunk, transformNextChunk);
+ } else {
+ callback(null);
+ }
+ });
+ }
+
+ setLength(length) {
+ this[kInternals].length = +length;
+ return this;
+ }
+}
+
+const AxiosTransformStream$1 = AxiosTransformStream;
+
+const {asyncIterator} = Symbol;
+
+const readBlob = async function* (blob) {
+ if (blob.stream) {
+ yield* blob.stream();
+ } else if (blob.arrayBuffer) {
+ yield await blob.arrayBuffer();
+ } else if (blob[asyncIterator]) {
+ yield* blob[asyncIterator]();
+ } else {
+ yield blob;
+ }
+};
+
+const readBlob$1 = readBlob;
+
+const BOUNDARY_ALPHABET = utils$1.ALPHABET.ALPHA_DIGIT + '-_';
+
+const textEncoder = new util.TextEncoder();
+
+const CRLF = '\r\n';
+const CRLF_BYTES = textEncoder.encode(CRLF);
+const CRLF_BYTES_COUNT = 2;
+
+class FormDataPart {
+ constructor(name, value) {
+ const {escapeName} = this.constructor;
+ const isStringValue = utils$1.isString(value);
+
+ let headers = `Content-Disposition: form-data; name="${escapeName(name)}"${
+ !isStringValue && value.name ? `; filename="${escapeName(value.name)}"` : ''
+ }${CRLF}`;
+
+ if (isStringValue) {
+ value = textEncoder.encode(String(value).replace(/\r?\n|\r\n?/g, CRLF));
+ } else {
+ headers += `Content-Type: ${value.type || "application/octet-stream"}${CRLF}`;
+ }
+
+ this.headers = textEncoder.encode(headers + CRLF);
+
+ this.contentLength = isStringValue ? value.byteLength : value.size;
+
+ this.size = this.headers.byteLength + this.contentLength + CRLF_BYTES_COUNT;
+
+ this.name = name;
+ this.value = value;
+ }
+
+ async *encode(){
+ yield this.headers;
+
+ const {value} = this;
+
+ if(utils$1.isTypedArray(value)) {
+ yield value;
+ } else {
+ yield* readBlob$1(value);
+ }
+
+ yield CRLF_BYTES;
+ }
+
+ static escapeName(name) {
+ return String(name).replace(/[\r\n"]/g, (match) => ({
+ '\r' : '%0D',
+ '\n' : '%0A',
+ '"' : '%22',
+ }[match]));
+ }
+}
+
+const formDataToStream = (form, headersHandler, options) => {
+ const {
+ tag = 'form-data-boundary',
+ size = 25,
+ boundary = tag + '-' + utils$1.generateString(size, BOUNDARY_ALPHABET)
+ } = options || {};
+
+ if(!utils$1.isFormData(form)) {
+ throw TypeError('FormData instance required');
+ }
+
+ if (boundary.length < 1 || boundary.length > 70) {
+ throw Error('boundary must be 10-70 characters long')
+ }
+
+ const boundaryBytes = textEncoder.encode('--' + boundary + CRLF);
+ const footerBytes = textEncoder.encode('--' + boundary + '--' + CRLF + CRLF);
+ let contentLength = footerBytes.byteLength;
+
+ const parts = Array.from(form.entries()).map(([name, value]) => {
+ const part = new FormDataPart(name, value);
+ contentLength += part.size;
+ return part;
+ });
+
+ contentLength += boundaryBytes.byteLength * parts.length;
+
+ contentLength = utils$1.toFiniteNumber(contentLength);
+
+ const computedHeaders = {
+ 'Content-Type': `multipart/form-data; boundary=${boundary}`
+ };
+
+ if (Number.isFinite(contentLength)) {
+ computedHeaders['Content-Length'] = contentLength;
+ }
+
+ headersHandler && headersHandler(computedHeaders);
+
+ return stream.Readable.from((async function *() {
+ for(const part of parts) {
+ yield boundaryBytes;
+ yield* part.encode();
+ }
+
+ yield footerBytes;
+ })());
+};
+
+const formDataToStream$1 = formDataToStream;
+
+class ZlibHeaderTransformStream extends stream__default["default"].Transform {
+ __transform(chunk, encoding, callback) {
+ this.push(chunk);
+ callback();
+ }
+
+ _transform(chunk, encoding, callback) {
+ if (chunk.length !== 0) {
+ this._transform = this.__transform;
+
+ // Add Default Compression headers if no zlib headers are present
+ if (chunk[0] !== 120) { // Hex: 78
+ const header = Buffer.alloc(2);
+ header[0] = 120; // Hex: 78
+ header[1] = 156; // Hex: 9C
+ this.push(header, encoding);
+ }
+ }
+
+ this.__transform(chunk, encoding, callback);
+ }
+}
+
+const ZlibHeaderTransformStream$1 = ZlibHeaderTransformStream;
+
+const callbackify = (fn, reducer) => {
+ return utils$1.isAsyncFn(fn) ? function (...args) {
+ const cb = args.pop();
+ fn.apply(this, args).then((value) => {
+ try {
+ reducer ? cb(null, ...reducer(value)) : cb(null, value);
+ } catch (err) {
+ cb(err);
+ }
+ }, cb);
+ } : fn;
+};
+
+const callbackify$1 = callbackify;
+
+const zlibOptions = {
+ flush: zlib__default["default"].constants.Z_SYNC_FLUSH,
+ finishFlush: zlib__default["default"].constants.Z_SYNC_FLUSH
+};
+
+const brotliOptions = {
+ flush: zlib__default["default"].constants.BROTLI_OPERATION_FLUSH,
+ finishFlush: zlib__default["default"].constants.BROTLI_OPERATION_FLUSH
+};
+
+const isBrotliSupported = utils$1.isFunction(zlib__default["default"].createBrotliDecompress);
+
+const {http: httpFollow, https: httpsFollow} = followRedirects__default["default"];
+
+const isHttps = /https:?/;
+
+const supportedProtocols = platform.protocols.map(protocol => {
+ return protocol + ':';
+});
+
+/**
+ * If the proxy or config beforeRedirects functions are defined, call them with the options
+ * object.
+ *
+ * @param {Object<string, any>} options - The options object that was passed to the request.
+ *
+ * @returns {Object<string, any>}
+ */
+function dispatchBeforeRedirect(options, responseDetails) {
+ if (options.beforeRedirects.proxy) {
+ options.beforeRedirects.proxy(options);
+ }
+ if (options.beforeRedirects.config) {
+ options.beforeRedirects.config(options, responseDetails);
+ }
+}
+
+/**
+ * If the proxy or config afterRedirects functions are defined, call them with the options
+ *
+ * @param {http.ClientRequestArgs} options
+ * @param {AxiosProxyConfig} configProxy configuration from Axios options object
+ * @param {string} location
+ *
+ * @returns {http.ClientRequestArgs}
+ */
+function setProxy(options, configProxy, location) {
+ let proxy = configProxy;
+ if (!proxy && proxy !== false) {
+ const proxyUrl = proxyFromEnv.getProxyForUrl(location);
+ if (proxyUrl) {
+ proxy = new URL(proxyUrl);
+ }
+ }
+ if (proxy) {
+ // Basic proxy authorization
+ if (proxy.username) {
+ proxy.auth = (proxy.username || '') + ':' + (proxy.password || '');
+ }
+
+ if (proxy.auth) {
+ // Support proxy auth object form
+ if (proxy.auth.username || proxy.auth.password) {
+ proxy.auth = (proxy.auth.username || '') + ':' + (proxy.auth.password || '');
+ }
+ const base64 = Buffer
+ .from(proxy.auth, 'utf8')
+ .toString('base64');
+ options.headers['Proxy-Authorization'] = 'Basic ' + base64;
+ }
+
+ options.headers.host = options.hostname + (options.port ? ':' + options.port : '');
+ const proxyHost = proxy.hostname || proxy.host;
+ options.hostname = proxyHost;
+ // Replace 'host' since options is not a URL object
+ options.host = proxyHost;
+ options.port = proxy.port;
+ options.path = location;
+ if (proxy.protocol) {
+ options.protocol = proxy.protocol.includes(':') ? proxy.protocol : `${proxy.protocol}:`;
+ }
+ }
+
+ options.beforeRedirects.proxy = function beforeRedirect(redirectOptions) {
+ // Configure proxy for redirected request, passing the original config proxy to apply
+ // the exact same logic as if the redirected request was performed by axios directly.
+ setProxy(redirectOptions, configProxy, redirectOptions.href);
+ };
+}
+
+const isHttpAdapterSupported = typeof process !== 'undefined' && utils$1.kindOf(process) === 'process';
+
+// temporary hotfix
+
+const wrapAsync = (asyncExecutor) => {
+ return new Promise((resolve, reject) => {
+ let onDone;
+ let isDone;
+
+ const done = (value, isRejected) => {
+ if (isDone) return;
+ isDone = true;
+ onDone && onDone(value, isRejected);
+ };
+
+ const _resolve = (value) => {
+ done(value);
+ resolve(value);
+ };
+
+ const _reject = (reason) => {
+ done(reason, true);
+ reject(reason);
+ };
+
+ asyncExecutor(_resolve, _reject, (onDoneHandler) => (onDone = onDoneHandler)).catch(_reject);
+ })
+};
+
+const resolveFamily = ({address, family}) => {
+ if (!utils$1.isString(address)) {
+ throw TypeError('address must be a string');
+ }
+ return ({
+ address,
+ family: family || (address.indexOf('.') < 0 ? 6 : 4)
+ });
+};
+
+const buildAddressEntry = (address, family) => resolveFamily(utils$1.isObject(address) ? address : {address, family});
+
+/*eslint consistent-return:0*/
+const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
+ return wrapAsync(async function dispatchHttpRequest(resolve, reject, onDone) {
+ let {data, lookup, family} = config;
+ const {responseType, responseEncoding} = config;
+ const method = config.method.toUpperCase();
+ let isDone;
+ let rejected = false;
+ let req;
+
+ if (lookup) {
+ const _lookup = callbackify$1(lookup, (value) => utils$1.isArray(value) ? value : [value]);
+ // hotfix to support opt.all option which is required for node 20.x
+ lookup = (hostname, opt, cb) => {
+ _lookup(hostname, opt, (err, arg0, arg1) => {
+ if (err) {
+ return cb(err);
+ }
+
+ const addresses = utils$1.isArray(arg0) ? arg0.map(addr => buildAddressEntry(addr)) : [buildAddressEntry(arg0, arg1)];
+
+ opt.all ? cb(err, addresses) : cb(err, addresses[0].address, addresses[0].family);
+ });
+ };
+ }
+
+ // temporary internal emitter until the AxiosRequest class will be implemented
+ const emitter = new EventEmitter__default["default"]();
+
+ const onFinished = () => {
+ if (config.cancelToken) {
+ config.cancelToken.unsubscribe(abort);
+ }
+
+ if (config.signal) {
+ config.signal.removeEventListener('abort', abort);
+ }
+
+ emitter.removeAllListeners();
+ };
+
+ onDone((value, isRejected) => {
+ isDone = true;
+ if (isRejected) {
+ rejected = true;
+ onFinished();
+ }
+ });
+
+ function abort(reason) {
+ emitter.emit('abort', !reason || reason.type ? new CanceledError(null, config, req) : reason);
+ }
+
+ emitter.once('abort', reject);
+
+ if (config.cancelToken || config.signal) {
+ config.cancelToken && config.cancelToken.subscribe(abort);
+ if (config.signal) {
+ config.signal.aborted ? abort() : config.signal.addEventListener('abort', abort);
+ }
+ }
+
+ // Parse url
+ const fullPath = buildFullPath(config.baseURL, config.url);
+ const parsed = new URL(fullPath, 'http://localhost');
+ const protocol = parsed.protocol || supportedProtocols[0];
+
+ if (protocol === 'data:') {
+ let convertedData;
+
+ if (method !== 'GET') {
+ return settle(resolve, reject, {
+ status: 405,
+ statusText: 'method not allowed',
+ headers: {},
+ config
+ });
+ }
+
+ try {
+ convertedData = fromDataURI(config.url, responseType === 'blob', {
+ Blob: config.env && config.env.Blob
+ });
+ } catch (err) {
+ throw AxiosError.from(err, AxiosError.ERR_BAD_REQUEST, config);
+ }
+
+ if (responseType === 'text') {
+ convertedData = convertedData.toString(responseEncoding);
+
+ if (!responseEncoding || responseEncoding === 'utf8') {
+ convertedData = utils$1.stripBOM(convertedData);
+ }
+ } else if (responseType === 'stream') {
+ convertedData = stream__default["default"].Readable.from(convertedData);
+ }
+
+ return settle(resolve, reject, {
+ data: convertedData,
+ status: 200,
+ statusText: 'OK',
+ headers: new AxiosHeaders$1(),
+ config
+ });
+ }
+
+ if (supportedProtocols.indexOf(protocol) === -1) {
+ return reject(new AxiosError(
+ 'Unsupported protocol ' + protocol,
+ AxiosError.ERR_BAD_REQUEST,
+ config
+ ));
+ }
+
+ const headers = AxiosHeaders$1.from(config.headers).normalize();
+
+ // Set User-Agent (required by some servers)
+ // See https://github.com/axios/axios/issues/69
+ // User-Agent is specified; handle case where no UA header is desired
+ // Only set header if it hasn't been set in config
+ headers.set('User-Agent', 'axios/' + VERSION, false);
+
+ const onDownloadProgress = config.onDownloadProgress;
+ const onUploadProgress = config.onUploadProgress;
+ const maxRate = config.maxRate;
+ let maxUploadRate = undefined;
+ let maxDownloadRate = undefined;
+
+ // support for spec compliant FormData objects
+ if (utils$1.isSpecCompliantForm(data)) {
+ const userBoundary = headers.getContentType(/boundary=([-_\w\d]{10,70})/i);
+
+ data = formDataToStream$1(data, (formHeaders) => {
+ headers.set(formHeaders);
+ }, {
+ tag: `axios-${VERSION}-boundary`,
+ boundary: userBoundary && userBoundary[1] || undefined
+ });
+ // support for https://www.npmjs.com/package/form-data api
+ } else if (utils$1.isFormData(data) && utils$1.isFunction(data.getHeaders)) {
+ headers.set(data.getHeaders());
+
+ if (!headers.hasContentLength()) {
+ try {
+ const knownLength = await util__default["default"].promisify(data.getLength).call(data);
+ Number.isFinite(knownLength) && knownLength >= 0 && headers.setContentLength(knownLength);
+ /*eslint no-empty:0*/
+ } catch (e) {
+ }
+ }
+ } else if (utils$1.isBlob(data)) {
+ data.size && headers.setContentType(data.type || 'application/octet-stream');
+ headers.setContentLength(data.size || 0);
+ data = stream__default["default"].Readable.from(readBlob$1(data));
+ } else if (data && !utils$1.isStream(data)) {
+ if (Buffer.isBuffer(data)) ; else if (utils$1.isArrayBuffer(data)) {
+ data = Buffer.from(new Uint8Array(data));
+ } else if (utils$1.isString(data)) {
+ data = Buffer.from(data, 'utf-8');
+ } else {
+ return reject(new AxiosError(
+ 'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream',
+ AxiosError.ERR_BAD_REQUEST,
+ config
+ ));
+ }
+
+ // Add Content-Length header if data exists
+ headers.setContentLength(data.length, false);
+
+ if (config.maxBodyLength > -1 && data.length > config.maxBodyLength) {
+ return reject(new AxiosError(
+ 'Request body larger than maxBodyLength limit',
+ AxiosError.ERR_BAD_REQUEST,
+ config
+ ));
+ }
+ }
+
+ const contentLength = utils$1.toFiniteNumber(headers.getContentLength());
+
+ if (utils$1.isArray(maxRate)) {
+ maxUploadRate = maxRate[0];
+ maxDownloadRate = maxRate[1];
+ } else {
+ maxUploadRate = maxDownloadRate = maxRate;
+ }
+
+ if (data && (onUploadProgress || maxUploadRate)) {
+ if (!utils$1.isStream(data)) {
+ data = stream__default["default"].Readable.from(data, {objectMode: false});
+ }
+
+ data = stream__default["default"].pipeline([data, new AxiosTransformStream$1({
+ length: contentLength,
+ maxRate: utils$1.toFiniteNumber(maxUploadRate)
+ })], utils$1.noop);
+
+ onUploadProgress && data.on('progress', progress => {
+ onUploadProgress(Object.assign(progress, {
+ upload: true
+ }));
+ });
+ }
+
+ // HTTP basic authentication
+ let auth = undefined;
+ if (config.auth) {
+ const username = config.auth.username || '';
+ const password = config.auth.password || '';
+ auth = username + ':' + password;
+ }
+
+ if (!auth && parsed.username) {
+ const urlUsername = parsed.username;
+ const urlPassword = parsed.password;
+ auth = urlUsername + ':' + urlPassword;
+ }
+
+ auth && headers.delete('authorization');
+
+ let path;
+
+ try {
+ path = buildURL(
+ parsed.pathname + parsed.search,
+ config.params,
+ config.paramsSerializer
+ ).replace(/^\?/, '');
+ } catch (err) {
+ const customErr = new Error(err.message);
+ customErr.config = config;
+ customErr.url = config.url;
+ customErr.exists = true;
+ return reject(customErr);
+ }
+
+ headers.set(
+ 'Accept-Encoding',
+ 'gzip, compress, deflate' + (isBrotliSupported ? ', br' : ''), false
+ );
+
+ const options = {
+ path,
+ method: method,
+ headers: headers.toJSON(),
+ agents: { http: config.httpAgent, https: config.httpsAgent },
+ auth,
+ protocol,
+ family,
+ beforeRedirect: dispatchBeforeRedirect,
+ beforeRedirects: {}
+ };
+
+ // cacheable-lookup integration hotfix
+ !utils$1.isUndefined(lookup) && (options.lookup = lookup);
+
+ if (config.socketPath) {
+ options.socketPath = config.socketPath;
+ } else {
+ options.hostname = parsed.hostname;
+ options.port = parsed.port;
+ setProxy(options, config.proxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path);
+ }
+
+ let transport;
+ const isHttpsRequest = isHttps.test(options.protocol);
+ options.agent = isHttpsRequest ? config.httpsAgent : config.httpAgent;
+ if (config.transport) {
+ transport = config.transport;
+ } else if (config.maxRedirects === 0) {
+ transport = isHttpsRequest ? https__default["default"] : http__default["default"];
+ } else {
+ if (config.maxRedirects) {
+ options.maxRedirects = config.maxRedirects;
+ }
+ if (config.beforeRedirect) {
+ options.beforeRedirects.config = config.beforeRedirect;
+ }
+ transport = isHttpsRequest ? httpsFollow : httpFollow;
+ }
+
+ if (config.maxBodyLength > -1) {
+ options.maxBodyLength = config.maxBodyLength;
+ } else {
+ // follow-redirects does not skip comparison, so it should always succeed for axios -1 unlimited
+ options.maxBodyLength = Infinity;
+ }
+
+ if (config.insecureHTTPParser) {
+ options.insecureHTTPParser = config.insecureHTTPParser;
+ }
+
+ // Create the request
+ req = transport.request(options, function handleResponse(res) {
+ if (req.destroyed) return;
+
+ const streams = [res];
+
+ const responseLength = +res.headers['content-length'];
+
+ if (onDownloadProgress) {
+ const transformStream = new AxiosTransformStream$1({
+ length: utils$1.toFiniteNumber(responseLength),
+ maxRate: utils$1.toFiniteNumber(maxDownloadRate)
+ });
+
+ onDownloadProgress && transformStream.on('progress', progress => {
+ onDownloadProgress(Object.assign(progress, {
+ download: true
+ }));
+ });
+
+ streams.push(transformStream);
+ }
+
+ // decompress the response body transparently if required
+ let responseStream = res;
+
+ // return the last request in case of redirects
+ const lastRequest = res.req || req;
+
+ // if decompress disabled we should not decompress
+ if (config.decompress !== false && res.headers['content-encoding']) {
+ // if no content, but headers still say that it is encoded,
+ // remove the header not confuse downstream operations
+ if (method === 'HEAD' || res.statusCode === 204) {
+ delete res.headers['content-encoding'];
+ }
+
+ switch ((res.headers['content-encoding'] || '').toLowerCase()) {
+ /*eslint default-case:0*/
+ case 'gzip':
+ case 'x-gzip':
+ case 'compress':
+ case 'x-compress':
+ // add the unzipper to the body stream processing pipeline
+ streams.push(zlib__default["default"].createUnzip(zlibOptions));
+
+ // remove the content-encoding in order to not confuse downstream operations
+ delete res.headers['content-encoding'];
+ break;
+ case 'deflate':
+ streams.push(new ZlibHeaderTransformStream$1());
+
+ // add the unzipper to the body stream processing pipeline
+ streams.push(zlib__default["default"].createUnzip(zlibOptions));
+
+ // remove the content-encoding in order to not confuse downstream operations
+ delete res.headers['content-encoding'];
+ break;
+ case 'br':
+ if (isBrotliSupported) {
+ streams.push(zlib__default["default"].createBrotliDecompress(brotliOptions));
+ delete res.headers['content-encoding'];
+ }
+ }
+ }
+
+ responseStream = streams.length > 1 ? stream__default["default"].pipeline(streams, utils$1.noop) : streams[0];
+
+ const offListeners = stream__default["default"].finished(responseStream, () => {
+ offListeners();
+ onFinished();
+ });
+
+ const response = {
+ status: res.statusCode,
+ statusText: res.statusMessage,
+ headers: new AxiosHeaders$1(res.headers),
+ config,
+ request: lastRequest
+ };
+
+ if (responseType === 'stream') {
+ response.data = responseStream;
+ settle(resolve, reject, response);
+ } else {
+ const responseBuffer = [];
+ let totalResponseBytes = 0;
+
+ responseStream.on('data', function handleStreamData(chunk) {
+ responseBuffer.push(chunk);
+ totalResponseBytes += chunk.length;
+
+ // make sure the content length is not over the maxContentLength if specified
+ if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) {
+ // stream.destroy() emit aborted event before calling reject() on Node.js v16
+ rejected = true;
+ responseStream.destroy();
+ reject(new AxiosError('maxContentLength size of ' + config.maxContentLength + ' exceeded',
+ AxiosError.ERR_BAD_RESPONSE, config, lastRequest));
+ }
+ });
+
+ responseStream.on('aborted', function handlerStreamAborted() {
+ if (rejected) {
+ return;
+ }
+
+ const err = new AxiosError(
+ 'maxContentLength size of ' + config.maxContentLength + ' exceeded',
+ AxiosError.ERR_BAD_RESPONSE,
+ config,
+ lastRequest
+ );
+ responseStream.destroy(err);
+ reject(err);
+ });
+
+ responseStream.on('error', function handleStreamError(err) {
+ if (req.destroyed) return;
+ reject(AxiosError.from(err, null, config, lastRequest));
+ });
+
+ responseStream.on('end', function handleStreamEnd() {
+ try {
+ let responseData = responseBuffer.length === 1 ? responseBuffer[0] : Buffer.concat(responseBuffer);
+ if (responseType !== 'arraybuffer') {
+ responseData = responseData.toString(responseEncoding);
+ if (!responseEncoding || responseEncoding === 'utf8') {
+ responseData = utils$1.stripBOM(responseData);
+ }
+ }
+ response.data = responseData;
+ } catch (err) {
+ return reject(AxiosError.from(err, null, config, response.request, response));
+ }
+ settle(resolve, reject, response);
+ });
+ }
+
+ emitter.once('abort', err => {
+ if (!responseStream.destroyed) {
+ responseStream.emit('error', err);
+ responseStream.destroy();
+ }
+ });
+ });
+
+ emitter.once('abort', err => {
+ reject(err);
+ req.destroy(err);
+ });
+
+ // Handle errors
+ req.on('error', function handleRequestError(err) {
+ // @todo remove
+ // if (req.aborted && err.code !== AxiosError.ERR_FR_TOO_MANY_REDIRECTS) return;
+ reject(AxiosError.from(err, null, config, req));
+ });
+
+ // set tcp keep alive to prevent drop connection by peer
+ req.on('socket', function handleRequestSocket(socket) {
+ // default interval of sending ack packet is 1 minute
+ socket.setKeepAlive(true, 1000 * 60);
+ });
+
+ // Handle request timeout
+ if (config.timeout) {
+ // This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types.
+ const timeout = parseInt(config.timeout, 10);
+
+ if (Number.isNaN(timeout)) {
+ reject(new AxiosError(
+ 'error trying to parse `config.timeout` to int',
+ AxiosError.ERR_BAD_OPTION_VALUE,
+ config,
+ req
+ ));
+
+ return;
+ }
+
+ // Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system.
+ // And timer callback will be fired, and abort() will be invoked before connection, then get "socket hang up" and code ECONNRESET.
+ // At this time, if we have a large number of request, nodejs will hang up some socket on background. and the number will up and up.
+ // And then these socket which be hang up will devouring CPU little by little.
+ // ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect.
+ req.setTimeout(timeout, function handleRequestTimeout() {
+ if (isDone) return;
+ let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';
+ const transitional = config.transitional || transitionalDefaults;
+ if (config.timeoutErrorMessage) {
+ timeoutErrorMessage = config.timeoutErrorMessage;
+ }
+ reject(new AxiosError(
+ timeoutErrorMessage,
+ transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,
+ config,
+ req
+ ));
+ abort();
+ });
+ }
+
+
+ // Send the request
+ if (utils$1.isStream(data)) {
+ let ended = false;
+ let errored = false;
+
+ data.on('end', () => {
+ ended = true;
+ });
+
+ data.once('error', err => {
+ errored = true;
+ req.destroy(err);
+ });
+
+ data.on('close', () => {
+ if (!ended && !errored) {
+ abort(new CanceledError('Request stream has been aborted', config, req));
+ }
+ });
+
+ data.pipe(req);
+ } else {
+ req.end(data);
+ }
+ });
+};
+
+const cookies = platform.hasStandardBrowserEnv ?
+
+ // Standard browser envs support document.cookie
+ {
+ write(name, value, expires, path, domain, secure) {
+ const cookie = [name + '=' + encodeURIComponent(value)];
+
+ utils$1.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());
+
+ utils$1.isString(path) && cookie.push('path=' + path);
+
+ utils$1.isString(domain) && cookie.push('domain=' + domain);
+
+ secure === true && cookie.push('secure');
+
+ document.cookie = cookie.join('; ');
+ },
+
+ read(name) {
+ const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
+ return (match ? decodeURIComponent(match[3]) : null);
+ },
+
+ remove(name) {
+ this.write(name, '', Date.now() - 86400000);
+ }
+ }
+
+ :
+
+ // Non-standard browser env (web workers, react-native) lack needed support.
+ {
+ write() {},
+ read() {
+ return null;
+ },
+ remove() {}
+ };
+
+const isURLSameOrigin = platform.hasStandardBrowserEnv ?
+
+// Standard browser envs have full support of the APIs needed to test
+// whether the request URL is of the same origin as current location.
+ (function standardBrowserEnv() {
+ const msie = /(msie|trident)/i.test(navigator.userAgent);
+ const urlParsingNode = document.createElement('a');
+ let originURL;
+
+ /**
+ * Parse a URL to discover its components
+ *
+ * @param {String} url The URL to be parsed
+ * @returns {Object}
+ */
+ function resolveURL(url) {
+ let href = url;
+
+ if (msie) {
+ // IE needs attribute set twice to normalize properties
+ urlParsingNode.setAttribute('href', href);
+ href = urlParsingNode.href;
+ }
+
+ urlParsingNode.setAttribute('href', href);
+
+ // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
+ return {
+ href: urlParsingNode.href,
+ protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
+ host: urlParsingNode.host,
+ search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
+ hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
+ hostname: urlParsingNode.hostname,
+ port: urlParsingNode.port,
+ pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
+ urlParsingNode.pathname :
+ '/' + urlParsingNode.pathname
+ };
+ }
+
+ originURL = resolveURL(window.location.href);
+
+ /**
+ * Determine if a URL shares the same origin as the current location
+ *
+ * @param {String} requestURL The URL to test
+ * @returns {boolean} True if URL shares the same origin, otherwise false
+ */
+ return function isURLSameOrigin(requestURL) {
+ const parsed = (utils$1.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
+ return (parsed.protocol === originURL.protocol &&
+ parsed.host === originURL.host);
+ };
+ })() :
+
+ // Non standard browser envs (web workers, react-native) lack needed support.
+ (function nonStandardBrowserEnv() {
+ return function isURLSameOrigin() {
+ return true;
+ };
+ })();
+
+function progressEventReducer(listener, isDownloadStream) {
+ let bytesNotified = 0;
+ const _speedometer = speedometer(50, 250);
+
+ return e => {
+ const loaded = e.loaded;
+ const total = e.lengthComputable ? e.total : undefined;
+ const progressBytes = loaded - bytesNotified;
+ const rate = _speedometer(progressBytes);
+ const inRange = loaded <= total;
+
+ bytesNotified = loaded;
+
+ const data = {
+ loaded,
+ total,
+ progress: total ? (loaded / total) : undefined,
+ bytes: progressBytes,
+ rate: rate ? rate : undefined,
+ estimated: rate && total && inRange ? (total - loaded) / rate : undefined,
+ event: e
+ };
+
+ data[isDownloadStream ? 'download' : 'upload'] = true;
+
+ listener(data);
+ };
+}
+
+const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
+
+const xhrAdapter = isXHRAdapterSupported && function (config) {
+ return new Promise(function dispatchXhrRequest(resolve, reject) {
+ let requestData = config.data;
+ const requestHeaders = AxiosHeaders$1.from(config.headers).normalize();
+ let {responseType, withXSRFToken} = config;
+ let onCanceled;
+ function done() {
+ if (config.cancelToken) {
+ config.cancelToken.unsubscribe(onCanceled);
+ }
+
+ if (config.signal) {
+ config.signal.removeEventListener('abort', onCanceled);
+ }
+ }
+
+ let contentType;
+
+ if (utils$1.isFormData(requestData)) {
+ if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
+ requestHeaders.setContentType(false); // Let the browser set it
+ } else if ((contentType = requestHeaders.getContentType()) !== false) {
+ // fix semicolon duplication issue for ReactNative FormData implementation
+ const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];
+ requestHeaders.setContentType([type || 'multipart/form-data', ...tokens].join('; '));
+ }
+ }
+
+ let request = new XMLHttpRequest();
+
+ // HTTP basic authentication
+ if (config.auth) {
+ const username = config.auth.username || '';
+ const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';
+ requestHeaders.set('Authorization', 'Basic ' + btoa(username + ':' + password));
+ }
+
+ const fullPath = buildFullPath(config.baseURL, config.url);
+
+ request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
+
+ // Set the request timeout in MS
+ request.timeout = config.timeout;
+
+ function onloadend() {
+ if (!request) {
+ return;
+ }
+ // Prepare the response
+ const responseHeaders = AxiosHeaders$1.from(
+ 'getAllResponseHeaders' in request && request.getAllResponseHeaders()
+ );
+ const responseData = !responseType || responseType === 'text' || responseType === 'json' ?
+ request.responseText : request.response;
+ const response = {
+ data: responseData,
+ status: request.status,
+ statusText: request.statusText,
+ headers: responseHeaders,
+ config,
+ request
+ };
+
+ settle(function _resolve(value) {
+ resolve(value);
+ done();
+ }, function _reject(err) {
+ reject(err);
+ done();
+ }, response);
+
+ // Clean up request
+ request = null;
+ }
+
+ if ('onloadend' in request) {
+ // Use onloadend if available
+ request.onloadend = onloadend;
+ } else {
+ // Listen for ready state to emulate onloadend
+ request.onreadystatechange = function handleLoad() {
+ if (!request || request.readyState !== 4) {
+ return;
+ }
+
+ // The request errored out and we didn't get a response, this will be
+ // handled by onerror instead
+ // With one exception: request that using file: protocol, most browsers
+ // will return status as 0 even though it's a successful request
+ if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
+ return;
+ }
+ // readystate handler is calling before onerror or ontimeout handlers,
+ // so we should call onloadend on the next 'tick'
+ setTimeout(onloadend);
+ };
+ }
+
+ // Handle browser request cancellation (as opposed to a manual cancellation)
+ request.onabort = function handleAbort() {
+ if (!request) {
+ return;
+ }
+
+ reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));
+
+ // Clean up request
+ request = null;
+ };
+
+ // Handle low level network errors
+ request.onerror = function handleError() {
+ // Real errors are hidden from us by the browser
+ // onerror should only fire if it's a network error
+ reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request));
+
+ // Clean up request
+ request = null;
+ };
+
+ // Handle timeout
+ request.ontimeout = function handleTimeout() {
+ let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';
+ const transitional = config.transitional || transitionalDefaults;
+ if (config.timeoutErrorMessage) {
+ timeoutErrorMessage = config.timeoutErrorMessage;
+ }
+ reject(new AxiosError(
+ timeoutErrorMessage,
+ transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,
+ config,
+ request));
+
+ // Clean up request
+ request = null;
+ };
+
+ // Add xsrf header
+ // This is only done if running in a standard browser environment.
+ // Specifically not if we're in a web worker, or react-native.
+ if(platform.hasStandardBrowserEnv) {
+ withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config));
+
+ if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(fullPath))) {
+ // Add xsrf header
+ const xsrfValue = config.xsrfHeaderName && config.xsrfCookieName && cookies.read(config.xsrfCookieName);
+
+ if (xsrfValue) {
+ requestHeaders.set(config.xsrfHeaderName, xsrfValue);
+ }
+ }
+ }
+
+ // Remove Content-Type if data is undefined
+ requestData === undefined && requestHeaders.setContentType(null);
+
+ // Add headers to the request
+ if ('setRequestHeader' in request) {
+ utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
+ request.setRequestHeader(key, val);
+ });
+ }
+
+ // Add withCredentials to request if needed
+ if (!utils$1.isUndefined(config.withCredentials)) {
+ request.withCredentials = !!config.withCredentials;
+ }
+
+ // Add responseType to request if needed
+ if (responseType && responseType !== 'json') {
+ request.responseType = config.responseType;
+ }
+
+ // Handle progress if needed
+ if (typeof config.onDownloadProgress === 'function') {
+ request.addEventListener('progress', progressEventReducer(config.onDownloadProgress, true));
+ }
+
+ // Not all browsers support upload events
+ if (typeof config.onUploadProgress === 'function' && request.upload) {
+ request.upload.addEventListener('progress', progressEventReducer(config.onUploadProgress));
+ }
+
+ if (config.cancelToken || config.signal) {
+ // Handle cancellation
+ // eslint-disable-next-line func-names
+ onCanceled = cancel => {
+ if (!request) {
+ return;
+ }
+ reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);
+ request.abort();
+ request = null;
+ };
+
+ config.cancelToken && config.cancelToken.subscribe(onCanceled);
+ if (config.signal) {
+ config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);
+ }
+ }
+
+ const protocol = parseProtocol(fullPath);
+
+ if (protocol && platform.protocols.indexOf(protocol) === -1) {
+ reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));
+ return;
+ }
+
+
+ // Send the request
+ request.send(requestData || null);
+ });
+};
+
+const knownAdapters = {
+ http: httpAdapter,
+ xhr: xhrAdapter
+};
+
+utils$1.forEach(knownAdapters, (fn, value) => {
+ if (fn) {
+ try {
+ Object.defineProperty(fn, 'name', {value});
+ } catch (e) {
+ // eslint-disable-next-line no-empty
+ }
+ Object.defineProperty(fn, 'adapterName', {value});
+ }
+});
+
+const renderReason = (reason) => `- ${reason}`;
+
+const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false;
+
+const adapters = {
+ getAdapter: (adapters) => {
+ adapters = utils$1.isArray(adapters) ? adapters : [adapters];
+
+ const {length} = adapters;
+ let nameOrAdapter;
+ let adapter;
+
+ const rejectedReasons = {};
+
+ for (let i = 0; i < length; i++) {
+ nameOrAdapter = adapters[i];
+ let id;
+
+ adapter = nameOrAdapter;
+
+ if (!isResolvedHandle(nameOrAdapter)) {
+ adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
+
+ if (adapter === undefined) {
+ throw new AxiosError(`Unknown adapter '${id}'`);
+ }
+ }
+
+ if (adapter) {
+ break;
+ }
+
+ rejectedReasons[id || '#' + i] = adapter;
+ }
+
+ if (!adapter) {
+
+ const reasons = Object.entries(rejectedReasons)
+ .map(([id, state]) => `adapter ${id} ` +
+ (state === false ? 'is not supported by the environment' : 'is not available in the build')
+ );
+
+ let s = length ?
+ (reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) :
+ 'as no adapter specified';
+
+ throw new AxiosError(
+ `There is no suitable adapter to dispatch the request ` + s,
+ 'ERR_NOT_SUPPORT'
+ );
+ }
+
+ return adapter;
+ },
+ adapters: knownAdapters
+};
+
+/**
+ * Throws a `CanceledError` if cancellation has been requested.
+ *
+ * @param {Object} config The config that is to be used for the request
+ *
+ * @returns {void}
+ */
+function throwIfCancellationRequested(config) {
+ if (config.cancelToken) {
+ config.cancelToken.throwIfRequested();
+ }
+
+ if (config.signal && config.signal.aborted) {
+ throw new CanceledError(null, config);
+ }
+}
+
+/**
+ * Dispatch a request to the server using the configured adapter.
+ *
+ * @param {object} config The config that is to be used for the request
+ *
+ * @returns {Promise} The Promise to be fulfilled
+ */
+function dispatchRequest(config) {
+ throwIfCancellationRequested(config);
+
+ config.headers = AxiosHeaders$1.from(config.headers);
+
+ // Transform request data
+ config.data = transformData.call(
+ config,
+ config.transformRequest
+ );
+
+ if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {
+ config.headers.setContentType('application/x-www-form-urlencoded', false);
+ }
+
+ const adapter = adapters.getAdapter(config.adapter || defaults$1.adapter);
+
+ return adapter(config).then(function onAdapterResolution(response) {
+ throwIfCancellationRequested(config);
+
+ // Transform response data
+ response.data = transformData.call(
+ config,
+ config.transformResponse,
+ response
+ );
+
+ response.headers = AxiosHeaders$1.from(response.headers);
+
+ return response;
+ }, function onAdapterRejection(reason) {
+ if (!isCancel(reason)) {
+ throwIfCancellationRequested(config);
+
+ // Transform response data
+ if (reason && reason.response) {
+ reason.response.data = transformData.call(
+ config,
+ config.transformResponse,
+ reason.response
+ );
+ reason.response.headers = AxiosHeaders$1.from(reason.response.headers);
+ }
+ }
+
+ return Promise.reject(reason);
+ });
+}
+
+const headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? thing.toJSON() : thing;
+
+/**
+ * Config-specific merge-function which creates a new config-object
+ * by merging two configuration objects together.
+ *
+ * @param {Object} config1
+ * @param {Object} config2
+ *
+ * @returns {Object} New object resulting from merging config2 to config1
+ */
+function mergeConfig(config1, config2) {
+ // eslint-disable-next-line no-param-reassign
+ config2 = config2 || {};
+ const config = {};
+
+ function getMergedValue(target, source, caseless) {
+ if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
+ return utils$1.merge.call({caseless}, target, source);
+ } else if (utils$1.isPlainObject(source)) {
+ return utils$1.merge({}, source);
+ } else if (utils$1.isArray(source)) {
+ return source.slice();
+ }
+ return source;
+ }
+
+ // eslint-disable-next-line consistent-return
+ function mergeDeepProperties(a, b, caseless) {
+ if (!utils$1.isUndefined(b)) {
+ return getMergedValue(a, b, caseless);
+ } else if (!utils$1.isUndefined(a)) {
+ return getMergedValue(undefined, a, caseless);
+ }
+ }
+
+ // eslint-disable-next-line consistent-return
+ function valueFromConfig2(a, b) {
+ if (!utils$1.isUndefined(b)) {
+ return getMergedValue(undefined, b);
+ }
+ }
+
+ // eslint-disable-next-line consistent-return
+ function defaultToConfig2(a, b) {
+ if (!utils$1.isUndefined(b)) {
+ return getMergedValue(undefined, b);
+ } else if (!utils$1.isUndefined(a)) {
+ return getMergedValue(undefined, a);
+ }
+ }
+
+ // eslint-disable-next-line consistent-return
+ function mergeDirectKeys(a, b, prop) {
+ if (prop in config2) {
+ return getMergedValue(a, b);
+ } else if (prop in config1) {
+ return getMergedValue(undefined, a);
+ }
+ }
+
+ const mergeMap = {
+ url: valueFromConfig2,
+ method: valueFromConfig2,
+ data: valueFromConfig2,
+ baseURL: defaultToConfig2,
+ transformRequest: defaultToConfig2,
+ transformResponse: defaultToConfig2,
+ paramsSerializer: defaultToConfig2,
+ timeout: defaultToConfig2,
+ timeoutMessage: defaultToConfig2,
+ withCredentials: defaultToConfig2,
+ withXSRFToken: defaultToConfig2,
+ adapter: defaultToConfig2,
+ responseType: defaultToConfig2,
+ xsrfCookieName: defaultToConfig2,
+ xsrfHeaderName: defaultToConfig2,
+ onUploadProgress: defaultToConfig2,
+ onDownloadProgress: defaultToConfig2,
+ decompress: defaultToConfig2,
+ maxContentLength: defaultToConfig2,
+ maxBodyLength: defaultToConfig2,
+ beforeRedirect: defaultToConfig2,
+ transport: defaultToConfig2,
+ httpAgent: defaultToConfig2,
+ httpsAgent: defaultToConfig2,
+ cancelToken: defaultToConfig2,
+ socketPath: defaultToConfig2,
+ responseEncoding: defaultToConfig2,
+ validateStatus: mergeDirectKeys,
+ headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
+ };
+
+ utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
+ const merge = mergeMap[prop] || mergeDeepProperties;
+ const configValue = merge(config1[prop], config2[prop], prop);
+ (utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
+ });
+
+ return config;
+}
+
+const validators$1 = {};
+
+// eslint-disable-next-line func-names
+['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => {
+ validators$1[type] = function validator(thing) {
+ return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;
+ };
+});
+
+const deprecatedWarnings = {};
+
+/**
+ * Transitional option validator
+ *
+ * @param {function|boolean?} validator - set to false if the transitional option has been removed
+ * @param {string?} version - deprecated version / removed since version
+ * @param {string?} message - some message with additional info
+ *
+ * @returns {function}
+ */
+validators$1.transitional = function transitional(validator, version, message) {
+ function formatMessage(opt, desc) {
+ return '[Axios v' + VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : '');
+ }
+
+ // eslint-disable-next-line func-names
+ return (value, opt, opts) => {
+ if (validator === false) {
+ throw new AxiosError(
+ formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),
+ AxiosError.ERR_DEPRECATED
+ );
+ }
+
+ if (version && !deprecatedWarnings[opt]) {
+ deprecatedWarnings[opt] = true;
+ // eslint-disable-next-line no-console
+ console.warn(
+ formatMessage(
+ opt,
+ ' has been deprecated since v' + version + ' and will be removed in the near future'
+ )
+ );
+ }
+
+ return validator ? validator(value, opt, opts) : true;
+ };
+};
+
+/**
+ * Assert object's properties type
+ *
+ * @param {object} options
+ * @param {object} schema
+ * @param {boolean?} allowUnknown
+ *
+ * @returns {object}
+ */
+
+function assertOptions(options, schema, allowUnknown) {
+ if (typeof options !== 'object') {
+ throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);
+ }
+ const keys = Object.keys(options);
+ let i = keys.length;
+ while (i-- > 0) {
+ const opt = keys[i];
+ const validator = schema[opt];
+ if (validator) {
+ const value = options[opt];
+ const result = value === undefined || validator(value, opt, options);
+ if (result !== true) {
+ throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);
+ }
+ continue;
+ }
+ if (allowUnknown !== true) {
+ throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);
+ }
+ }
+}
+
+const validator = {
+ assertOptions,
+ validators: validators$1
+};
+
+const validators = validator.validators;
+
+/**
+ * Create a new instance of Axios
+ *
+ * @param {Object} instanceConfig The default config for the instance
+ *
+ * @return {Axios} A new instance of Axios
+ */
+class Axios {
+ constructor(instanceConfig) {
+ this.defaults = instanceConfig;
+ this.interceptors = {
+ request: new InterceptorManager$1(),
+ response: new InterceptorManager$1()
+ };
+ }
+
+ /**
+ * Dispatch a request
+ *
+ * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
+ * @param {?Object} config
+ *
+ * @returns {Promise} The Promise to be fulfilled
+ */
+ async request(configOrUrl, config) {
+ try {
+ return await this._request(configOrUrl, config);
+ } catch (err) {
+ if (err instanceof Error) {
+ let dummy;
+
+ Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : (dummy = new Error());
+
+ // slice off the Error: ... line
+ const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : '';
+
+ if (!err.stack) {
+ err.stack = stack;
+ // match without the 2 top stack lines
+ } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ''))) {
+ err.stack += '\n' + stack;
+ }
+ }
+
+ throw err;
+ }
+ }
+
+ _request(configOrUrl, config) {
+ /*eslint no-param-reassign:0*/
+ // Allow for axios('example/url'[, config]) a la fetch API
+ if (typeof configOrUrl === 'string') {
+ config = config || {};
+ config.url = configOrUrl;
+ } else {
+ config = configOrUrl || {};
+ }
+
+ config = mergeConfig(this.defaults, config);
+
+ const {transitional, paramsSerializer, headers} = config;
+
+ if (transitional !== undefined) {
+ validator.assertOptions(transitional, {
+ silentJSONParsing: validators.transitional(validators.boolean),
+ forcedJSONParsing: validators.transitional(validators.boolean),
+ clarifyTimeoutError: validators.transitional(validators.boolean)
+ }, false);
+ }
+
+ if (paramsSerializer != null) {
+ if (utils$1.isFunction(paramsSerializer)) {
+ config.paramsSerializer = {
+ serialize: paramsSerializer
+ };
+ } else {
+ validator.assertOptions(paramsSerializer, {
+ encode: validators.function,
+ serialize: validators.function
+ }, true);
+ }
+ }
+
+ // Set config.method
+ config.method = (config.method || this.defaults.method || 'get').toLowerCase();
+
+ // Flatten headers
+ let contextHeaders = headers && utils$1.merge(
+ headers.common,
+ headers[config.method]
+ );
+
+ headers && utils$1.forEach(
+ ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
+ (method) => {
+ delete headers[method];
+ }
+ );
+
+ config.headers = AxiosHeaders$1.concat(contextHeaders, headers);
+
+ // filter out skipped interceptors
+ const requestInterceptorChain = [];
+ let synchronousRequestInterceptors = true;
+ this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
+ if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {
+ return;
+ }
+
+ synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
+
+ requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
+ });
+
+ const responseInterceptorChain = [];
+ this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
+ responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
+ });
+
+ let promise;
+ let i = 0;
+ let len;
+
+ if (!synchronousRequestInterceptors) {
+ const chain = [dispatchRequest.bind(this), undefined];
+ chain.unshift.apply(chain, requestInterceptorChain);
+ chain.push.apply(chain, responseInterceptorChain);
+ len = chain.length;
+
+ promise = Promise.resolve(config);
+
+ while (i < len) {
+ promise = promise.then(chain[i++], chain[i++]);
+ }
+
+ return promise;
+ }
+
+ len = requestInterceptorChain.length;
+
+ let newConfig = config;
+
+ i = 0;
+
+ while (i < len) {
+ const onFulfilled = requestInterceptorChain[i++];
+ const onRejected = requestInterceptorChain[i++];
+ try {
+ newConfig = onFulfilled(newConfig);
+ } catch (error) {
+ onRejected.call(this, error);
+ break;
+ }
+ }
+
+ try {
+ promise = dispatchRequest.call(this, newConfig);
+ } catch (error) {
+ return Promise.reject(error);
+ }
+
+ i = 0;
+ len = responseInterceptorChain.length;
+
+ while (i < len) {
+ promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);
+ }
+
+ return promise;
+ }
+
+ getUri(config) {
+ config = mergeConfig(this.defaults, config);
+ const fullPath = buildFullPath(config.baseURL, config.url);
+ return buildURL(fullPath, config.params, config.paramsSerializer);
+ }
+}
+
+// Provide aliases for supported request methods
+utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
+ /*eslint func-names:0*/
+ Axios.prototype[method] = function(url, config) {
+ return this.request(mergeConfig(config || {}, {
+ method,
+ url,
+ data: (config || {}).data
+ }));
+ };
+});
+
+utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
+ /*eslint func-names:0*/
+
+ function generateHTTPMethod(isForm) {
+ return function httpMethod(url, data, config) {
+ return this.request(mergeConfig(config || {}, {
+ method,
+ headers: isForm ? {
+ 'Content-Type': 'multipart/form-data'
+ } : {},
+ url,
+ data
+ }));
+ };
+ }
+
+ Axios.prototype[method] = generateHTTPMethod();
+
+ Axios.prototype[method + 'Form'] = generateHTTPMethod(true);
+});
+
+const Axios$1 = Axios;
+
+/**
+ * A `CancelToken` is an object that can be used to request cancellation of an operation.
+ *
+ * @param {Function} executor The executor function.
+ *
+ * @returns {CancelToken}
+ */
+class CancelToken {
+ constructor(executor) {
+ if (typeof executor !== 'function') {
+ throw new TypeError('executor must be a function.');
+ }
+
+ let resolvePromise;
+
+ this.promise = new Promise(function promiseExecutor(resolve) {
+ resolvePromise = resolve;
+ });
+
+ const token = this;
+
+ // eslint-disable-next-line func-names
+ this.promise.then(cancel => {
+ if (!token._listeners) return;
+
+ let i = token._listeners.length;
+
+ while (i-- > 0) {
+ token._listeners[i](cancel);
+ }
+ token._listeners = null;
+ });
+
+ // eslint-disable-next-line func-names
+ this.promise.then = onfulfilled => {
+ let _resolve;
+ // eslint-disable-next-line func-names
+ const promise = new Promise(resolve => {
+ token.subscribe(resolve);
+ _resolve = resolve;
+ }).then(onfulfilled);
+
+ promise.cancel = function reject() {
+ token.unsubscribe(_resolve);
+ };
+
+ return promise;
+ };
+
+ executor(function cancel(message, config, request) {
+ if (token.reason) {
+ // Cancellation has already been requested
+ return;
+ }
+
+ token.reason = new CanceledError(message, config, request);
+ resolvePromise(token.reason);
+ });
+ }
+
+ /**
+ * Throws a `CanceledError` if cancellation has been requested.
+ */
+ throwIfRequested() {
+ if (this.reason) {
+ throw this.reason;
+ }
+ }
+
+ /**
+ * Subscribe to the cancel signal
+ */
+
+ subscribe(listener) {
+ if (this.reason) {
+ listener(this.reason);
+ return;
+ }
+
+ if (this._listeners) {
+ this._listeners.push(listener);
+ } else {
+ this._listeners = [listener];
+ }
+ }
+
+ /**
+ * Unsubscribe from the cancel signal
+ */
+
+ unsubscribe(listener) {
+ if (!this._listeners) {
+ return;
+ }
+ const index = this._listeners.indexOf(listener);
+ if (index !== -1) {
+ this._listeners.splice(index, 1);
+ }
+ }
+
+ /**
+ * Returns an object that contains a new `CancelToken` and a function that, when called,
+ * cancels the `CancelToken`.
+ */
+ static source() {
+ let cancel;
+ const token = new CancelToken(function executor(c) {
+ cancel = c;
+ });
+ return {
+ token,
+ cancel
+ };
+ }
+}
+
+const CancelToken$1 = CancelToken;
+
+/**
+ * Syntactic sugar for invoking a function and expanding an array for arguments.
+ *
+ * Common use case would be to use `Function.prototype.apply`.
+ *
+ * ```js
+ * function f(x, y, z) {}
+ * var args = [1, 2, 3];
+ * f.apply(null, args);
+ * ```
+ *
+ * With `spread` this example can be re-written.
+ *
+ * ```js
+ * spread(function(x, y, z) {})([1, 2, 3]);
+ * ```
+ *
+ * @param {Function} callback
+ *
+ * @returns {Function}
+ */
+function spread(callback) {
+ return function wrap(arr) {
+ return callback.apply(null, arr);
+ };
+}
+
+/**
+ * Determines whether the payload is an error thrown by Axios
+ *
+ * @param {*} payload The value to test
+ *
+ * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
+ */
+function isAxiosError(payload) {
+ return utils$1.isObject(payload) && (payload.isAxiosError === true);
+}
+
+const HttpStatusCode = {
+ Continue: 100,
+ SwitchingProtocols: 101,
+ Processing: 102,
+ EarlyHints: 103,
+ Ok: 200,
+ Created: 201,
+ Accepted: 202,
+ NonAuthoritativeInformation: 203,
+ NoContent: 204,
+ ResetContent: 205,
+ PartialContent: 206,
+ MultiStatus: 207,
+ AlreadyReported: 208,
+ ImUsed: 226,
+ MultipleChoices: 300,
+ MovedPermanently: 301,
+ Found: 302,
+ SeeOther: 303,
+ NotModified: 304,
+ UseProxy: 305,
+ Unused: 306,
+ TemporaryRedirect: 307,
+ PermanentRedirect: 308,
+ BadRequest: 400,
+ Unauthorized: 401,
+ PaymentRequired: 402,
+ Forbidden: 403,
+ NotFound: 404,
+ MethodNotAllowed: 405,
+ NotAcceptable: 406,
+ ProxyAuthenticationRequired: 407,
+ RequestTimeout: 408,
+ Conflict: 409,
+ Gone: 410,
+ LengthRequired: 411,
+ PreconditionFailed: 412,
+ PayloadTooLarge: 413,
+ UriTooLong: 414,
+ UnsupportedMediaType: 415,
+ RangeNotSatisfiable: 416,
+ ExpectationFailed: 417,
+ ImATeapot: 418,
+ MisdirectedRequest: 421,
+ UnprocessableEntity: 422,
+ Locked: 423,
+ FailedDependency: 424,
+ TooEarly: 425,
+ UpgradeRequired: 426,
+ PreconditionRequired: 428,
+ TooManyRequests: 429,
+ RequestHeaderFieldsTooLarge: 431,
+ UnavailableForLegalReasons: 451,
+ InternalServerError: 500,
+ NotImplemented: 501,
+ BadGateway: 502,
+ ServiceUnavailable: 503,
+ GatewayTimeout: 504,
+ HttpVersionNotSupported: 505,
+ VariantAlsoNegotiates: 506,
+ InsufficientStorage: 507,
+ LoopDetected: 508,
+ NotExtended: 510,
+ NetworkAuthenticationRequired: 511,
+};
+
+Object.entries(HttpStatusCode).forEach(([key, value]) => {
+ HttpStatusCode[value] = key;
+});
+
+const HttpStatusCode$1 = HttpStatusCode;
+
+/**
+ * Create an instance of Axios
+ *
+ * @param {Object} defaultConfig The default config for the instance
+ *
+ * @returns {Axios} A new instance of Axios
+ */
+function createInstance(defaultConfig) {
+ const context = new Axios$1(defaultConfig);
+ const instance = bind(Axios$1.prototype.request, context);
+
+ // Copy axios.prototype to instance
+ utils$1.extend(instance, Axios$1.prototype, context, {allOwnKeys: true});
+
+ // Copy context to instance
+ utils$1.extend(instance, context, null, {allOwnKeys: true});
+
+ // Factory for creating new instances
+ instance.create = function create(instanceConfig) {
+ return createInstance(mergeConfig(defaultConfig, instanceConfig));
+ };
+
+ return instance;
+}
+
+// Create the default instance to be exported
+const axios = createInstance(defaults$1);
+
+// Expose Axios class to allow class inheritance
+axios.Axios = Axios$1;
+
+// Expose Cancel & CancelToken
+axios.CanceledError = CanceledError;
+axios.CancelToken = CancelToken$1;
+axios.isCancel = isCancel;
+axios.VERSION = VERSION;
+axios.toFormData = toFormData;
+
+// Expose AxiosError class
+axios.AxiosError = AxiosError;
+
+// alias for CanceledError for backward compatibility
+axios.Cancel = axios.CanceledError;
+
+// Expose all/spread
+axios.all = function all(promises) {
+ return Promise.all(promises);
+};
+
+axios.spread = spread;
+
+// Expose isAxiosError
+axios.isAxiosError = isAxiosError;
+
+// Expose mergeConfig
+axios.mergeConfig = mergeConfig;
+
+axios.AxiosHeaders = AxiosHeaders$1;
+
+axios.formToJSON = thing => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
+
+axios.getAdapter = adapters.getAdapter;
+
+axios.HttpStatusCode = HttpStatusCode$1;
+
+axios.default = axios;
+
+module.exports = axios;
+//# sourceMappingURL=axios.cjs.map
diff --git a/node_modules/axios/dist/node/axios.cjs.map b/node_modules/axios/dist/node/axios.cjs.map
new file mode 100644
index 0000000..ab531c8
--- /dev/null
+++ b/node_modules/axios/dist/node/axios.cjs.map
@@ -0,0 +1 @@
+{"version":3,"file":"axios.cjs","sources":["../../lib/helpers/bind.js","../../lib/utils.js","../../lib/core/AxiosError.js","../../lib/helpers/toFormData.js","../../lib/helpers/AxiosURLSearchParams.js","../../lib/helpers/buildURL.js","../../lib/core/InterceptorManager.js","../../lib/defaults/transitional.js","../../lib/platform/node/classes/URLSearchParams.js","../../lib/platform/node/index.js","../../lib/platform/common/utils.js","../../lib/platform/index.js","../../lib/helpers/toURLEncodedForm.js","../../lib/helpers/formDataToJSON.js","../../lib/defaults/index.js","../../lib/helpers/parseHeaders.js","../../lib/core/AxiosHeaders.js","../../lib/core/transformData.js","../../lib/cancel/isCancel.js","../../lib/cancel/CanceledError.js","../../lib/core/settle.js","../../lib/helpers/isAbsoluteURL.js","../../lib/helpers/combineURLs.js","../../lib/core/buildFullPath.js","../../lib/env/data.js","../../lib/helpers/parseProtocol.js","../../lib/helpers/fromDataURI.js","../../lib/helpers/throttle.js","../../lib/helpers/speedometer.js","../../lib/helpers/AxiosTransformStream.js","../../lib/helpers/readBlob.js","../../lib/helpers/formDataToStream.js","../../lib/helpers/ZlibHeaderTransformStream.js","../../lib/helpers/callbackify.js","../../lib/adapters/http.js","../../lib/helpers/cookies.js","../../lib/helpers/isURLSameOrigin.js","../../lib/adapters/xhr.js","../../lib/adapters/adapters.js","../../lib/core/dispatchRequest.js","../../lib/core/mergeConfig.js","../../lib/helpers/validator.js","../../lib/core/Axios.js","../../lib/cancel/CancelToken.js","../../lib/helpers/spread.js","../../lib/helpers/isAxiosError.js","../../lib/helpers/HttpStatusCode.js","../../lib/axios.js"],"sourcesContent":["'use strict';\n\nexport default function bind(fn, thisArg) {\n return function wrap() {\n return fn.apply(thisArg, arguments);\n };\n}\n","'use strict';\n\nimport bind from './helpers/bind.js';\n\n// utils is a library of generic helper functions non-specific to axios\n\nconst {toString} = Object.prototype;\nconst {getPrototypeOf} = Object;\n\nconst kindOf = (cache => thing => {\n const str = toString.call(thing);\n return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());\n})(Object.create(null));\n\nconst kindOfTest = (type) => {\n type = type.toLowerCase();\n return (thing) => kindOf(thing) === type\n}\n\nconst typeOfTest = type => thing => typeof thing === type;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n *\n * @returns {boolean} True if value is an Array, otherwise false\n */\nconst {isArray} = Array;\n\n/**\n * Determine if a value is undefined\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nconst isUndefined = typeOfTest('undefined');\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nconst isArrayBuffer = kindOfTest('ArrayBuffer');\n\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n let result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a String, otherwise false\n */\nconst isString = typeOfTest('string');\n\n/**\n * Determine if a value is a Function\n *\n * @param {*} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nconst isFunction = typeOfTest('function');\n\n/**\n * Determine if a value is a Number\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Number, otherwise false\n */\nconst isNumber = typeOfTest('number');\n\n/**\n * Determine if a value is an Object\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an Object, otherwise false\n */\nconst isObject = (thing) => thing !== null && typeof thing === 'object';\n\n/**\n * Determine if a value is a Boolean\n *\n * @param {*} thing The value to test\n * @returns {boolean} True if value is a Boolean, otherwise false\n */\nconst isBoolean = thing => thing === true || thing === false;\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a plain Object, otherwise false\n */\nconst isPlainObject = (val) => {\n if (kindOf(val) !== 'object') {\n return false;\n }\n\n const prototype = getPrototypeOf(val);\n return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Date, otherwise false\n */\nconst isDate = kindOfTest('Date');\n\n/**\n * Determine if a value is a File\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFile = kindOfTest('File');\n\n/**\n * Determine if a value is a Blob\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nconst isBlob = kindOfTest('Blob');\n\n/**\n * Determine if a value is a FileList\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFileList = kindOfTest('FileList');\n\n/**\n * Determine if a value is a Stream\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nconst isStream = (val) => isObject(val) && isFunction(val.pipe);\n\n/**\n * Determine if a value is a FormData\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nconst isFormData = (thing) => {\n let kind;\n return thing && (\n (typeof FormData === 'function' && thing instanceof FormData) || (\n isFunction(thing.append) && (\n (kind = kindOf(thing)) === 'formdata' ||\n // detect form-data instance\n (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')\n )\n )\n )\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nconst isURLSearchParams = kindOfTest('URLSearchParams');\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n *\n * @returns {String} The String freed of excess whitespace\n */\nconst trim = (str) => str.trim ?\n str.trim() : str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n *\n * @param {Boolean} [allOwnKeys = false]\n * @returns {any}\n */\nfunction forEach(obj, fn, {allOwnKeys = false} = {}) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n let i;\n let l;\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);\n const len = keys.length;\n let key;\n\n for (i = 0; i < len; i++) {\n key = keys[i];\n fn.call(null, obj[key], key, obj);\n }\n }\n}\n\nfunction findKey(obj, key) {\n key = key.toLowerCase();\n const keys = Object.keys(obj);\n let i = keys.length;\n let _key;\n while (i-- > 0) {\n _key = keys[i];\n if (key === _key.toLowerCase()) {\n return _key;\n }\n }\n return null;\n}\n\nconst _global = (() => {\n /*eslint no-undef:0*/\n if (typeof globalThis !== \"undefined\") return globalThis;\n return typeof self !== \"undefined\" ? self : (typeof window !== 'undefined' ? window : global)\n})();\n\nconst isContextDefined = (context) => !isUndefined(context) && context !== _global;\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n *\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n const {caseless} = isContextDefined(this) && this || {};\n const result = {};\n const assignValue = (val, key) => {\n const targetKey = caseless && findKey(result, key) || key;\n if (isPlainObject(result[targetKey]) && isPlainObject(val)) {\n result[targetKey] = merge(result[targetKey], val);\n } else if (isPlainObject(val)) {\n result[targetKey] = merge({}, val);\n } else if (isArray(val)) {\n result[targetKey] = val.slice();\n } else {\n result[targetKey] = val;\n }\n }\n\n for (let i = 0, l = arguments.length; i < l; i++) {\n arguments[i] && forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n *\n * @param {Boolean} [allOwnKeys]\n * @returns {Object} The resulting value of object a\n */\nconst extend = (a, b, thisArg, {allOwnKeys}= {}) => {\n forEach(b, (val, key) => {\n if (thisArg && isFunction(val)) {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n }, {allOwnKeys});\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n *\n * @returns {string} content value without BOM\n */\nconst stripBOM = (content) => {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\n/**\n * Inherit the prototype methods from one constructor into another\n * @param {function} constructor\n * @param {function} superConstructor\n * @param {object} [props]\n * @param {object} [descriptors]\n *\n * @returns {void}\n */\nconst inherits = (constructor, superConstructor, props, descriptors) => {\n constructor.prototype = Object.create(superConstructor.prototype, descriptors);\n constructor.prototype.constructor = constructor;\n Object.defineProperty(constructor, 'super', {\n value: superConstructor.prototype\n });\n props && Object.assign(constructor.prototype, props);\n}\n\n/**\n * Resolve object with deep prototype chain to a flat object\n * @param {Object} sourceObj source object\n * @param {Object} [destObj]\n * @param {Function|Boolean} [filter]\n * @param {Function} [propFilter]\n *\n * @returns {Object}\n */\nconst toFlatObject = (sourceObj, destObj, filter, propFilter) => {\n let props;\n let i;\n let prop;\n const merged = {};\n\n destObj = destObj || {};\n // eslint-disable-next-line no-eq-null,eqeqeq\n if (sourceObj == null) return destObj;\n\n do {\n props = Object.getOwnPropertyNames(sourceObj);\n i = props.length;\n while (i-- > 0) {\n prop = props[i];\n if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {\n destObj[prop] = sourceObj[prop];\n merged[prop] = true;\n }\n }\n sourceObj = filter !== false && getPrototypeOf(sourceObj);\n } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);\n\n return destObj;\n}\n\n/**\n * Determines whether a string ends with the characters of a specified string\n *\n * @param {String} str\n * @param {String} searchString\n * @param {Number} [position= 0]\n *\n * @returns {boolean}\n */\nconst endsWith = (str, searchString, position) => {\n str = String(str);\n if (position === undefined || position > str.length) {\n position = str.length;\n }\n position -= searchString.length;\n const lastIndex = str.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n}\n\n\n/**\n * Returns new array from array like object or null if failed\n *\n * @param {*} [thing]\n *\n * @returns {?Array}\n */\nconst toArray = (thing) => {\n if (!thing) return null;\n if (isArray(thing)) return thing;\n let i = thing.length;\n if (!isNumber(i)) return null;\n const arr = new Array(i);\n while (i-- > 0) {\n arr[i] = thing[i];\n }\n return arr;\n}\n\n/**\n * Checking if the Uint8Array exists and if it does, it returns a function that checks if the\n * thing passed in is an instance of Uint8Array\n *\n * @param {TypedArray}\n *\n * @returns {Array}\n */\n// eslint-disable-next-line func-names\nconst isTypedArray = (TypedArray => {\n // eslint-disable-next-line func-names\n return thing => {\n return TypedArray && thing instanceof TypedArray;\n };\n})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));\n\n/**\n * For each entry in the object, call the function with the key and value.\n *\n * @param {Object<any, any>} obj - The object to iterate over.\n * @param {Function} fn - The function to call for each entry.\n *\n * @returns {void}\n */\nconst forEachEntry = (obj, fn) => {\n const generator = obj && obj[Symbol.iterator];\n\n const iterator = generator.call(obj);\n\n let result;\n\n while ((result = iterator.next()) && !result.done) {\n const pair = result.value;\n fn.call(obj, pair[0], pair[1]);\n }\n}\n\n/**\n * It takes a regular expression and a string, and returns an array of all the matches\n *\n * @param {string} regExp - The regular expression to match against.\n * @param {string} str - The string to search.\n *\n * @returns {Array<boolean>}\n */\nconst matchAll = (regExp, str) => {\n let matches;\n const arr = [];\n\n while ((matches = regExp.exec(str)) !== null) {\n arr.push(matches);\n }\n\n return arr;\n}\n\n/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */\nconst isHTMLForm = kindOfTest('HTMLFormElement');\n\nconst toCamelCase = str => {\n return str.toLowerCase().replace(/[-_\\s]([a-z\\d])(\\w*)/g,\n function replacer(m, p1, p2) {\n return p1.toUpperCase() + p2;\n }\n );\n};\n\n/* Creating a function that will check if an object has a property. */\nconst hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);\n\n/**\n * Determine if a value is a RegExp object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a RegExp object, otherwise false\n */\nconst isRegExp = kindOfTest('RegExp');\n\nconst reduceDescriptors = (obj, reducer) => {\n const descriptors = Object.getOwnPropertyDescriptors(obj);\n const reducedDescriptors = {};\n\n forEach(descriptors, (descriptor, name) => {\n let ret;\n if ((ret = reducer(descriptor, name, obj)) !== false) {\n reducedDescriptors[name] = ret || descriptor;\n }\n });\n\n Object.defineProperties(obj, reducedDescriptors);\n}\n\n/**\n * Makes all methods read-only\n * @param {Object} obj\n */\n\nconst freezeMethods = (obj) => {\n reduceDescriptors(obj, (descriptor, name) => {\n // skip restricted props in strict mode\n if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {\n return false;\n }\n\n const value = obj[name];\n\n if (!isFunction(value)) return;\n\n descriptor.enumerable = false;\n\n if ('writable' in descriptor) {\n descriptor.writable = false;\n return;\n }\n\n if (!descriptor.set) {\n descriptor.set = () => {\n throw Error('Can not rewrite read-only method \\'' + name + '\\'');\n };\n }\n });\n}\n\nconst toObjectSet = (arrayOrString, delimiter) => {\n const obj = {};\n\n const define = (arr) => {\n arr.forEach(value => {\n obj[value] = true;\n });\n }\n\n isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));\n\n return obj;\n}\n\nconst noop = () => {}\n\nconst toFiniteNumber = (value, defaultValue) => {\n value = +value;\n return Number.isFinite(value) ? value : defaultValue;\n}\n\nconst ALPHA = 'abcdefghijklmnopqrstuvwxyz'\n\nconst DIGIT = '0123456789';\n\nconst ALPHABET = {\n DIGIT,\n ALPHA,\n ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT\n}\n\nconst generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {\n let str = '';\n const {length} = alphabet;\n while (size--) {\n str += alphabet[Math.random() * length|0]\n }\n\n return str;\n}\n\n/**\n * If the thing is a FormData object, return true, otherwise return false.\n *\n * @param {unknown} thing - The thing to check.\n *\n * @returns {boolean}\n */\nfunction isSpecCompliantForm(thing) {\n return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]);\n}\n\nconst toJSONObject = (obj) => {\n const stack = new Array(10);\n\n const visit = (source, i) => {\n\n if (isObject(source)) {\n if (stack.indexOf(source) >= 0) {\n return;\n }\n\n if(!('toJSON' in source)) {\n stack[i] = source;\n const target = isArray(source) ? [] : {};\n\n forEach(source, (value, key) => {\n const reducedValue = visit(value, i + 1);\n !isUndefined(reducedValue) && (target[key] = reducedValue);\n });\n\n stack[i] = undefined;\n\n return target;\n }\n }\n\n return source;\n }\n\n return visit(obj, 0);\n}\n\nconst isAsyncFn = kindOfTest('AsyncFunction');\n\nconst isThenable = (thing) =>\n thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);\n\nexport default {\n isArray,\n isArrayBuffer,\n isBuffer,\n isFormData,\n isArrayBufferView,\n isString,\n isNumber,\n isBoolean,\n isObject,\n isPlainObject,\n isUndefined,\n isDate,\n isFile,\n isBlob,\n isRegExp,\n isFunction,\n isStream,\n isURLSearchParams,\n isTypedArray,\n isFileList,\n forEach,\n merge,\n extend,\n trim,\n stripBOM,\n inherits,\n toFlatObject,\n kindOf,\n kindOfTest,\n endsWith,\n toArray,\n forEachEntry,\n matchAll,\n isHTMLForm,\n hasOwnProperty,\n hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection\n reduceDescriptors,\n freezeMethods,\n toObjectSet,\n toCamelCase,\n noop,\n toFiniteNumber,\n findKey,\n global: _global,\n isContextDefined,\n ALPHABET,\n generateString,\n isSpecCompliantForm,\n toJSONObject,\n isAsyncFn,\n isThenable\n};\n","'use strict';\n\nimport utils from '../utils.js';\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [config] The config.\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n *\n * @returns {Error} The created error.\n */\nfunction AxiosError(message, code, config, request, response) {\n Error.call(this);\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n } else {\n this.stack = (new Error()).stack;\n }\n\n this.message = message;\n this.name = 'AxiosError';\n code && (this.code = code);\n config && (this.config = config);\n request && (this.request = request);\n response && (this.response = response);\n}\n\nutils.inherits(AxiosError, Error, {\n toJSON: function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: utils.toJSONObject(this.config),\n code: this.code,\n status: this.response && this.response.status ? this.response.status : null\n };\n }\n});\n\nconst prototype = AxiosError.prototype;\nconst descriptors = {};\n\n[\n 'ERR_BAD_OPTION_VALUE',\n 'ERR_BAD_OPTION',\n 'ECONNABORTED',\n 'ETIMEDOUT',\n 'ERR_NETWORK',\n 'ERR_FR_TOO_MANY_REDIRECTS',\n 'ERR_DEPRECATED',\n 'ERR_BAD_RESPONSE',\n 'ERR_BAD_REQUEST',\n 'ERR_CANCELED',\n 'ERR_NOT_SUPPORT',\n 'ERR_INVALID_URL'\n// eslint-disable-next-line func-names\n].forEach(code => {\n descriptors[code] = {value: code};\n});\n\nObject.defineProperties(AxiosError, descriptors);\nObject.defineProperty(prototype, 'isAxiosError', {value: true});\n\n// eslint-disable-next-line func-names\nAxiosError.from = (error, code, config, request, response, customProps) => {\n const axiosError = Object.create(prototype);\n\n utils.toFlatObject(error, axiosError, function filter(obj) {\n return obj !== Error.prototype;\n }, prop => {\n return prop !== 'isAxiosError';\n });\n\n AxiosError.call(axiosError, error.message, code, config, request, response);\n\n axiosError.cause = error;\n\n axiosError.name = error.name;\n\n customProps && Object.assign(axiosError, customProps);\n\n return axiosError;\n};\n\nexport default AxiosError;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\n// temporary hotfix to avoid circular references until AxiosURLSearchParams is refactored\nimport PlatformFormData from '../platform/node/classes/FormData.js';\n\n/**\n * Determines if the given thing is a array or js object.\n *\n * @param {string} thing - The object or array to be visited.\n *\n * @returns {boolean}\n */\nfunction isVisitable(thing) {\n return utils.isPlainObject(thing) || utils.isArray(thing);\n}\n\n/**\n * It removes the brackets from the end of a string\n *\n * @param {string} key - The key of the parameter.\n *\n * @returns {string} the key without the brackets.\n */\nfunction removeBrackets(key) {\n return utils.endsWith(key, '[]') ? key.slice(0, -2) : key;\n}\n\n/**\n * It takes a path, a key, and a boolean, and returns a string\n *\n * @param {string} path - The path to the current key.\n * @param {string} key - The key of the current object being iterated over.\n * @param {string} dots - If true, the key will be rendered with dots instead of brackets.\n *\n * @returns {string} The path to the current key.\n */\nfunction renderKey(path, key, dots) {\n if (!path) return key;\n return path.concat(key).map(function each(token, i) {\n // eslint-disable-next-line no-param-reassign\n token = removeBrackets(token);\n return !dots && i ? '[' + token + ']' : token;\n }).join(dots ? '.' : '');\n}\n\n/**\n * If the array is an array and none of its elements are visitable, then it's a flat array.\n *\n * @param {Array<any>} arr - The array to check\n *\n * @returns {boolean}\n */\nfunction isFlatArray(arr) {\n return utils.isArray(arr) && !arr.some(isVisitable);\n}\n\nconst predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {\n return /^is[A-Z]/.test(prop);\n});\n\n/**\n * Convert a data object to FormData\n *\n * @param {Object} obj\n * @param {?Object} [formData]\n * @param {?Object} [options]\n * @param {Function} [options.visitor]\n * @param {Boolean} [options.metaTokens = true]\n * @param {Boolean} [options.dots = false]\n * @param {?Boolean} [options.indexes = false]\n *\n * @returns {Object}\n **/\n\n/**\n * It converts an object into a FormData object\n *\n * @param {Object<any, any>} obj - The object to convert to form data.\n * @param {string} formData - The FormData object to append to.\n * @param {Object<string, any>} options\n *\n * @returns\n */\nfunction toFormData(obj, formData, options) {\n if (!utils.isObject(obj)) {\n throw new TypeError('target must be an object');\n }\n\n // eslint-disable-next-line no-param-reassign\n formData = formData || new (PlatformFormData || FormData)();\n\n // eslint-disable-next-line no-param-reassign\n options = utils.toFlatObject(options, {\n metaTokens: true,\n dots: false,\n indexes: false\n }, false, function defined(option, source) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n return !utils.isUndefined(source[option]);\n });\n\n const metaTokens = options.metaTokens;\n // eslint-disable-next-line no-use-before-define\n const visitor = options.visitor || defaultVisitor;\n const dots = options.dots;\n const indexes = options.indexes;\n const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;\n const useBlob = _Blob && utils.isSpecCompliantForm(formData);\n\n if (!utils.isFunction(visitor)) {\n throw new TypeError('visitor must be a function');\n }\n\n function convertValue(value) {\n if (value === null) return '';\n\n if (utils.isDate(value)) {\n return value.toISOString();\n }\n\n if (!useBlob && utils.isBlob(value)) {\n throw new AxiosError('Blob is not supported. Use a Buffer instead.');\n }\n\n if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {\n return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);\n }\n\n return value;\n }\n\n /**\n * Default visitor.\n *\n * @param {*} value\n * @param {String|Number} key\n * @param {Array<String|Number>} path\n * @this {FormData}\n *\n * @returns {boolean} return true to visit the each prop of the value recursively\n */\n function defaultVisitor(value, key, path) {\n let arr = value;\n\n if (value && !path && typeof value === 'object') {\n if (utils.endsWith(key, '{}')) {\n // eslint-disable-next-line no-param-reassign\n key = metaTokens ? key : key.slice(0, -2);\n // eslint-disable-next-line no-param-reassign\n value = JSON.stringify(value);\n } else if (\n (utils.isArray(value) && isFlatArray(value)) ||\n ((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value))\n )) {\n // eslint-disable-next-line no-param-reassign\n key = removeBrackets(key);\n\n arr.forEach(function each(el, index) {\n !(utils.isUndefined(el) || el === null) && formData.append(\n // eslint-disable-next-line no-nested-ternary\n indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),\n convertValue(el)\n );\n });\n return false;\n }\n }\n\n if (isVisitable(value)) {\n return true;\n }\n\n formData.append(renderKey(path, key, dots), convertValue(value));\n\n return false;\n }\n\n const stack = [];\n\n const exposedHelpers = Object.assign(predicates, {\n defaultVisitor,\n convertValue,\n isVisitable\n });\n\n function build(value, path) {\n if (utils.isUndefined(value)) return;\n\n if (stack.indexOf(value) !== -1) {\n throw Error('Circular reference detected in ' + path.join('.'));\n }\n\n stack.push(value);\n\n utils.forEach(value, function each(el, key) {\n const result = !(utils.isUndefined(el) || el === null) && visitor.call(\n formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers\n );\n\n if (result === true) {\n build(el, path ? path.concat(key) : [key]);\n }\n });\n\n stack.pop();\n }\n\n if (!utils.isObject(obj)) {\n throw new TypeError('data must be an object');\n }\n\n build(obj);\n\n return formData;\n}\n\nexport default toFormData;\n","'use strict';\n\nimport toFormData from './toFormData.js';\n\n/**\n * It encodes a string by replacing all characters that are not in the unreserved set with\n * their percent-encoded equivalents\n *\n * @param {string} str - The string to encode.\n *\n * @returns {string} The encoded string.\n */\nfunction encode(str) {\n const charMap = {\n '!': '%21',\n \"'\": '%27',\n '(': '%28',\n ')': '%29',\n '~': '%7E',\n '%20': '+',\n '%00': '\\x00'\n };\n return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {\n return charMap[match];\n });\n}\n\n/**\n * It takes a params object and converts it to a FormData object\n *\n * @param {Object<string, any>} params - The parameters to be converted to a FormData object.\n * @param {Object<string, any>} options - The options object passed to the Axios constructor.\n *\n * @returns {void}\n */\nfunction AxiosURLSearchParams(params, options) {\n this._pairs = [];\n\n params && toFormData(params, this, options);\n}\n\nconst prototype = AxiosURLSearchParams.prototype;\n\nprototype.append = function append(name, value) {\n this._pairs.push([name, value]);\n};\n\nprototype.toString = function toString(encoder) {\n const _encode = encoder ? function(value) {\n return encoder.call(this, value, encode);\n } : encode;\n\n return this._pairs.map(function each(pair) {\n return _encode(pair[0]) + '=' + _encode(pair[1]);\n }, '').join('&');\n};\n\nexport default AxiosURLSearchParams;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosURLSearchParams from '../helpers/AxiosURLSearchParams.js';\n\n/**\n * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their\n * URI encoded counterparts\n *\n * @param {string} val The value to be encoded.\n *\n * @returns {string} The encoded value.\n */\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @param {?object} options\n *\n * @returns {string} The formatted url\n */\nexport default function buildURL(url, params, options) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n \n const _encode = options && options.encode || encode;\n\n const serializeFn = options && options.serialize;\n\n let serializedParams;\n\n if (serializeFn) {\n serializedParams = serializeFn(params, options);\n } else {\n serializedParams = utils.isURLSearchParams(params) ?\n params.toString() :\n new AxiosURLSearchParams(params, options).toString(_encode);\n }\n\n if (serializedParams) {\n const hashmarkIndex = url.indexOf(\"#\");\n\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\nclass InterceptorManager {\n constructor() {\n this.handlers = [];\n }\n\n /**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\n use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled,\n rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n }\n\n /**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n *\n * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise\n */\n eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n }\n\n /**\n * Clear all interceptors from the stack\n *\n * @returns {void}\n */\n clear() {\n if (this.handlers) {\n this.handlers = [];\n }\n }\n\n /**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n *\n * @returns {void}\n */\n forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n }\n}\n\nexport default InterceptorManager;\n","'use strict';\n\nexport default {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n};\n","'use strict';\n\nimport url from 'url';\nexport default url.URLSearchParams;\n","import URLSearchParams from './classes/URLSearchParams.js'\nimport FormData from './classes/FormData.js'\n\nexport default {\n isNode: true,\n classes: {\n URLSearchParams,\n FormData,\n Blob: typeof Blob !== 'undefined' && Blob || null\n },\n protocols: [ 'http', 'https', 'file', 'data' ]\n};\n","const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n *\n * @returns {boolean}\n */\nconst hasStandardBrowserEnv = (\n (product) => {\n return hasBrowserEnv && ['ReactNative', 'NativeScript', 'NS'].indexOf(product) < 0\n })(typeof navigator !== 'undefined' && navigator.product);\n\n/**\n * Determine if we're running in a standard browser webWorker environment\n *\n * Although the `isStandardBrowserEnv` method indicates that\n * `allows axios to run in a web worker`, the WebWorker will still be\n * filtered out due to its judgment standard\n * `typeof window !== 'undefined' && typeof document !== 'undefined'`.\n * This leads to a problem when axios post `FormData` in webWorker\n */\nconst hasStandardBrowserWebWorkerEnv = (() => {\n return (\n typeof WorkerGlobalScope !== 'undefined' &&\n // eslint-disable-next-line no-undef\n self instanceof WorkerGlobalScope &&\n typeof self.importScripts === 'function'\n );\n})();\n\nexport {\n hasBrowserEnv,\n hasStandardBrowserWebWorkerEnv,\n hasStandardBrowserEnv\n}\n","import platform from './node/index.js';\nimport * as utils from './common/utils.js';\n\nexport default {\n ...utils,\n ...platform\n}\n","'use strict';\n\nimport utils from '../utils.js';\nimport toFormData from './toFormData.js';\nimport platform from '../platform/index.js';\n\nexport default function toURLEncodedForm(data, options) {\n return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({\n visitor: function(value, key, path, helpers) {\n if (platform.isNode && utils.isBuffer(value)) {\n this.append(key, value.toString('base64'));\n return false;\n }\n\n return helpers.defaultVisitor.apply(this, arguments);\n }\n }, options));\n}\n","'use strict';\n\nimport utils from '../utils.js';\n\n/**\n * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']\n *\n * @param {string} name - The name of the property to get.\n *\n * @returns An array of strings.\n */\nfunction parsePropPath(name) {\n // foo[x][y][z]\n // foo.x.y.z\n // foo-x-y-z\n // foo x y z\n return utils.matchAll(/\\w+|\\[(\\w*)]/g, name).map(match => {\n return match[0] === '[]' ? '' : match[1] || match[0];\n });\n}\n\n/**\n * Convert an array to an object.\n *\n * @param {Array<any>} arr - The array to convert to an object.\n *\n * @returns An object with the same keys and values as the array.\n */\nfunction arrayToObject(arr) {\n const obj = {};\n const keys = Object.keys(arr);\n let i;\n const len = keys.length;\n let key;\n for (i = 0; i < len; i++) {\n key = keys[i];\n obj[key] = arr[key];\n }\n return obj;\n}\n\n/**\n * It takes a FormData object and returns a JavaScript object\n *\n * @param {string} formData The FormData object to convert to JSON.\n *\n * @returns {Object<string, any> | null} The converted object.\n */\nfunction formDataToJSON(formData) {\n function buildPath(path, value, target, index) {\n let name = path[index++];\n\n if (name === '__proto__') return true;\n\n const isNumericKey = Number.isFinite(+name);\n const isLast = index >= path.length;\n name = !name && utils.isArray(target) ? target.length : name;\n\n if (isLast) {\n if (utils.hasOwnProp(target, name)) {\n target[name] = [target[name], value];\n } else {\n target[name] = value;\n }\n\n return !isNumericKey;\n }\n\n if (!target[name] || !utils.isObject(target[name])) {\n target[name] = [];\n }\n\n const result = buildPath(path, value, target[name], index);\n\n if (result && utils.isArray(target[name])) {\n target[name] = arrayToObject(target[name]);\n }\n\n return !isNumericKey;\n }\n\n if (utils.isFormData(formData) && utils.isFunction(formData.entries)) {\n const obj = {};\n\n utils.forEachEntry(formData, (name, value) => {\n buildPath(parsePropPath(name), value, obj, 0);\n });\n\n return obj;\n }\n\n return null;\n}\n\nexport default formDataToJSON;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\nimport transitionalDefaults from './transitional.js';\nimport toFormData from '../helpers/toFormData.js';\nimport toURLEncodedForm from '../helpers/toURLEncodedForm.js';\nimport platform from '../platform/index.js';\nimport formDataToJSON from '../helpers/formDataToJSON.js';\n\n/**\n * It takes a string, tries to parse it, and if it fails, it returns the stringified version\n * of the input\n *\n * @param {any} rawValue - The value to be stringified.\n * @param {Function} parser - A function that parses a string into a JavaScript object.\n * @param {Function} encoder - A function that takes a value and returns a string.\n *\n * @returns {string} A stringified version of the rawValue.\n */\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nconst defaults = {\n\n transitional: transitionalDefaults,\n\n adapter: ['xhr', 'http'],\n\n transformRequest: [function transformRequest(data, headers) {\n const contentType = headers.getContentType() || '';\n const hasJSONContentType = contentType.indexOf('application/json') > -1;\n const isObjectPayload = utils.isObject(data);\n\n if (isObjectPayload && utils.isHTMLForm(data)) {\n data = new FormData(data);\n }\n\n const isFormData = utils.isFormData(data);\n\n if (isFormData) {\n return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;\n }\n\n if (utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);\n return data.toString();\n }\n\n let isFileList;\n\n if (isObjectPayload) {\n if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {\n return toURLEncodedForm(data, this.formSerializer).toString();\n }\n\n if ((isFileList = utils.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {\n const _FormData = this.env && this.env.FormData;\n\n return toFormData(\n isFileList ? {'files[]': data} : data,\n _FormData && new _FormData(),\n this.formSerializer\n );\n }\n }\n\n if (isObjectPayload || hasJSONContentType ) {\n headers.setContentType('application/json', false);\n return stringifySafely(data);\n }\n\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n const transitional = this.transitional || defaults.transitional;\n const forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n const JSONRequested = this.responseType === 'json';\n\n if (data && utils.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {\n const silentJSONParsing = transitional && transitional.silentJSONParsing;\n const strictJSONParsing = !silentJSONParsing && JSONRequested;\n\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n env: {\n FormData: platform.classes.FormData,\n Blob: platform.classes.Blob\n },\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n },\n\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*',\n 'Content-Type': undefined\n }\n }\n};\n\nutils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {\n defaults.headers[method] = {};\n});\n\nexport default defaults;\n","'use strict';\n\nimport utils from './../utils.js';\n\n// RawAxiosHeaders whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nconst ignoreDuplicateOf = utils.toObjectSet([\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n]);\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} rawHeaders Headers needing to be parsed\n *\n * @returns {Object} Headers parsed into an object\n */\nexport default rawHeaders => {\n const parsed = {};\n let key;\n let val;\n let i;\n\n rawHeaders && rawHeaders.split('\\n').forEach(function parser(line) {\n i = line.indexOf(':');\n key = line.substring(0, i).trim().toLowerCase();\n val = line.substring(i + 1).trim();\n\n if (!key || (parsed[key] && ignoreDuplicateOf[key])) {\n return;\n }\n\n if (key === 'set-cookie') {\n if (parsed[key]) {\n parsed[key].push(val);\n } else {\n parsed[key] = [val];\n }\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n });\n\n return parsed;\n};\n","'use strict';\n\nimport utils from '../utils.js';\nimport parseHeaders from '../helpers/parseHeaders.js';\n\nconst $internals = Symbol('internals');\n\nfunction normalizeHeader(header) {\n return header && String(header).trim().toLowerCase();\n}\n\nfunction normalizeValue(value) {\n if (value === false || value == null) {\n return value;\n }\n\n return utils.isArray(value) ? value.map(normalizeValue) : String(value);\n}\n\nfunction parseTokens(str) {\n const tokens = Object.create(null);\n const tokensRE = /([^\\s,;=]+)\\s*(?:=\\s*([^,;]+))?/g;\n let match;\n\n while ((match = tokensRE.exec(str))) {\n tokens[match[1]] = match[2];\n }\n\n return tokens;\n}\n\nconst isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());\n\nfunction matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {\n if (utils.isFunction(filter)) {\n return filter.call(this, value, header);\n }\n\n if (isHeaderNameFilter) {\n value = header;\n }\n\n if (!utils.isString(value)) return;\n\n if (utils.isString(filter)) {\n return value.indexOf(filter) !== -1;\n }\n\n if (utils.isRegExp(filter)) {\n return filter.test(value);\n }\n}\n\nfunction formatHeader(header) {\n return header.trim()\n .toLowerCase().replace(/([a-z\\d])(\\w*)/g, (w, char, str) => {\n return char.toUpperCase() + str;\n });\n}\n\nfunction buildAccessors(obj, header) {\n const accessorName = utils.toCamelCase(' ' + header);\n\n ['get', 'set', 'has'].forEach(methodName => {\n Object.defineProperty(obj, methodName + accessorName, {\n value: function(arg1, arg2, arg3) {\n return this[methodName].call(this, header, arg1, arg2, arg3);\n },\n configurable: true\n });\n });\n}\n\nclass AxiosHeaders {\n constructor(headers) {\n headers && this.set(headers);\n }\n\n set(header, valueOrRewrite, rewrite) {\n const self = this;\n\n function setHeader(_value, _header, _rewrite) {\n const lHeader = normalizeHeader(_header);\n\n if (!lHeader) {\n throw new Error('header name must be a non-empty string');\n }\n\n const key = utils.findKey(self, lHeader);\n\n if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {\n self[key || _header] = normalizeValue(_value);\n }\n }\n\n const setHeaders = (headers, _rewrite) =>\n utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));\n\n if (utils.isPlainObject(header) || header instanceof this.constructor) {\n setHeaders(header, valueOrRewrite)\n } else if(utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {\n setHeaders(parseHeaders(header), valueOrRewrite);\n } else {\n header != null && setHeader(valueOrRewrite, header, rewrite);\n }\n\n return this;\n }\n\n get(header, parser) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n if (key) {\n const value = this[key];\n\n if (!parser) {\n return value;\n }\n\n if (parser === true) {\n return parseTokens(value);\n }\n\n if (utils.isFunction(parser)) {\n return parser.call(this, value, key);\n }\n\n if (utils.isRegExp(parser)) {\n return parser.exec(value);\n }\n\n throw new TypeError('parser must be boolean|regexp|function');\n }\n }\n }\n\n has(header, matcher) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));\n }\n\n return false;\n }\n\n delete(header, matcher) {\n const self = this;\n let deleted = false;\n\n function deleteHeader(_header) {\n _header = normalizeHeader(_header);\n\n if (_header) {\n const key = utils.findKey(self, _header);\n\n if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {\n delete self[key];\n\n deleted = true;\n }\n }\n }\n\n if (utils.isArray(header)) {\n header.forEach(deleteHeader);\n } else {\n deleteHeader(header);\n }\n\n return deleted;\n }\n\n clear(matcher) {\n const keys = Object.keys(this);\n let i = keys.length;\n let deleted = false;\n\n while (i--) {\n const key = keys[i];\n if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {\n delete this[key];\n deleted = true;\n }\n }\n\n return deleted;\n }\n\n normalize(format) {\n const self = this;\n const headers = {};\n\n utils.forEach(this, (value, header) => {\n const key = utils.findKey(headers, header);\n\n if (key) {\n self[key] = normalizeValue(value);\n delete self[header];\n return;\n }\n\n const normalized = format ? formatHeader(header) : String(header).trim();\n\n if (normalized !== header) {\n delete self[header];\n }\n\n self[normalized] = normalizeValue(value);\n\n headers[normalized] = true;\n });\n\n return this;\n }\n\n concat(...targets) {\n return this.constructor.concat(this, ...targets);\n }\n\n toJSON(asStrings) {\n const obj = Object.create(null);\n\n utils.forEach(this, (value, header) => {\n value != null && value !== false && (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value);\n });\n\n return obj;\n }\n\n [Symbol.iterator]() {\n return Object.entries(this.toJSON())[Symbol.iterator]();\n }\n\n toString() {\n return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\\n');\n }\n\n get [Symbol.toStringTag]() {\n return 'AxiosHeaders';\n }\n\n static from(thing) {\n return thing instanceof this ? thing : new this(thing);\n }\n\n static concat(first, ...targets) {\n const computed = new this(first);\n\n targets.forEach((target) => computed.set(target));\n\n return computed;\n }\n\n static accessor(header) {\n const internals = this[$internals] = (this[$internals] = {\n accessors: {}\n });\n\n const accessors = internals.accessors;\n const prototype = this.prototype;\n\n function defineAccessor(_header) {\n const lHeader = normalizeHeader(_header);\n\n if (!accessors[lHeader]) {\n buildAccessors(prototype, _header);\n accessors[lHeader] = true;\n }\n }\n\n utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);\n\n return this;\n }\n}\n\nAxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);\n\n// reserved names hotfix\nutils.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {\n let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`\n return {\n get: () => value,\n set(headerValue) {\n this[mapped] = headerValue;\n }\n }\n});\n\nutils.freezeMethods(AxiosHeaders);\n\nexport default AxiosHeaders;\n","'use strict';\n\nimport utils from './../utils.js';\nimport defaults from '../defaults/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Array|Function} fns A single function or Array of functions\n * @param {?Object} response The response object\n *\n * @returns {*} The resulting transformed data\n */\nexport default function transformData(fns, response) {\n const config = this || defaults;\n const context = response || config;\n const headers = AxiosHeaders.from(context.headers);\n let data = context.data;\n\n utils.forEach(fns, function transform(fn) {\n data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);\n });\n\n headers.normalize();\n\n return data;\n}\n","'use strict';\n\nexport default function isCancel(value) {\n return !!(value && value.__CANCEL__);\n}\n","'use strict';\n\nimport AxiosError from '../core/AxiosError.js';\nimport utils from '../utils.js';\n\n/**\n * A `CanceledError` is an object that is thrown when an operation is canceled.\n *\n * @param {string=} message The message.\n * @param {Object=} config The config.\n * @param {Object=} request The request.\n *\n * @returns {CanceledError} The created error.\n */\nfunction CanceledError(message, config, request) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);\n this.name = 'CanceledError';\n}\n\nutils.inherits(CanceledError, AxiosError, {\n __CANCEL__: true\n});\n\nexport default CanceledError;\n","'use strict';\n\nimport AxiosError from './AxiosError.js';\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n *\n * @returns {object} The response.\n */\nexport default function settle(resolve, reject, response) {\n const validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(new AxiosError(\n 'Request failed with status code ' + response.status,\n [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],\n response.config,\n response.request,\n response\n ));\n }\n}\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n *\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nexport default function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"<scheme>://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(url);\n}\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n *\n * @returns {string} The combined URL\n */\nexport default function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/?\\/$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n}\n","'use strict';\n\nimport isAbsoluteURL from '../helpers/isAbsoluteURL.js';\nimport combineURLs from '../helpers/combineURLs.js';\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n *\n * @returns {string} The combined full path\n */\nexport default function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n}\n","export const VERSION = \"1.6.7\";","'use strict';\n\nexport default function parseProtocol(url) {\n const match = /^([-+\\w]{1,25})(:?\\/\\/|:)/.exec(url);\n return match && match[1] || '';\n}\n","'use strict';\n\nimport AxiosError from '../core/AxiosError.js';\nimport parseProtocol from './parseProtocol.js';\nimport platform from '../platform/index.js';\n\nconst DATA_URL_PATTERN = /^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\\s\\S]*)$/;\n\n/**\n * Parse data uri to a Buffer or Blob\n *\n * @param {String} uri\n * @param {?Boolean} asBlob\n * @param {?Object} options\n * @param {?Function} options.Blob\n *\n * @returns {Buffer|Blob}\n */\nexport default function fromDataURI(uri, asBlob, options) {\n const _Blob = options && options.Blob || platform.classes.Blob;\n const protocol = parseProtocol(uri);\n\n if (asBlob === undefined && _Blob) {\n asBlob = true;\n }\n\n if (protocol === 'data') {\n uri = protocol.length ? uri.slice(protocol.length + 1) : uri;\n\n const match = DATA_URL_PATTERN.exec(uri);\n\n if (!match) {\n throw new AxiosError('Invalid URL', AxiosError.ERR_INVALID_URL);\n }\n\n const mime = match[1];\n const isBase64 = match[2];\n const body = match[3];\n const buffer = Buffer.from(decodeURIComponent(body), isBase64 ? 'base64' : 'utf8');\n\n if (asBlob) {\n if (!_Blob) {\n throw new AxiosError('Blob is not supported', AxiosError.ERR_NOT_SUPPORT);\n }\n\n return new _Blob([buffer], {type: mime});\n }\n\n return buffer;\n }\n\n throw new AxiosError('Unsupported protocol ' + protocol, AxiosError.ERR_NOT_SUPPORT);\n}\n","'use strict';\n\n/**\n * Throttle decorator\n * @param {Function} fn\n * @param {Number} freq\n * @return {Function}\n */\nfunction throttle(fn, freq) {\n let timestamp = 0;\n const threshold = 1000 / freq;\n let timer = null;\n return function throttled(force, args) {\n const now = Date.now();\n if (force || now - timestamp > threshold) {\n if (timer) {\n clearTimeout(timer);\n timer = null;\n }\n timestamp = now;\n return fn.apply(null, args);\n }\n if (!timer) {\n timer = setTimeout(() => {\n timer = null;\n timestamp = Date.now();\n return fn.apply(null, args);\n }, threshold - (now - timestamp));\n }\n };\n}\n\nexport default throttle;\n","'use strict';\n\n/**\n * Calculate data maxRate\n * @param {Number} [samplesCount= 10]\n * @param {Number} [min= 1000]\n * @returns {Function}\n */\nfunction speedometer(samplesCount, min) {\n samplesCount = samplesCount || 10;\n const bytes = new Array(samplesCount);\n const timestamps = new Array(samplesCount);\n let head = 0;\n let tail = 0;\n let firstSampleTS;\n\n min = min !== undefined ? min : 1000;\n\n return function push(chunkLength) {\n const now = Date.now();\n\n const startedAt = timestamps[tail];\n\n if (!firstSampleTS) {\n firstSampleTS = now;\n }\n\n bytes[head] = chunkLength;\n timestamps[head] = now;\n\n let i = tail;\n let bytesCount = 0;\n\n while (i !== head) {\n bytesCount += bytes[i++];\n i = i % samplesCount;\n }\n\n head = (head + 1) % samplesCount;\n\n if (head === tail) {\n tail = (tail + 1) % samplesCount;\n }\n\n if (now - firstSampleTS < min) {\n return;\n }\n\n const passed = startedAt && now - startedAt;\n\n return passed ? Math.round(bytesCount * 1000 / passed) : undefined;\n };\n}\n\nexport default speedometer;\n","'use strict';\n\nimport stream from 'stream';\nimport utils from '../utils.js';\nimport throttle from './throttle.js';\nimport speedometer from './speedometer.js';\n\nconst kInternals = Symbol('internals');\n\nclass AxiosTransformStream extends stream.Transform{\n constructor(options) {\n options = utils.toFlatObject(options, {\n maxRate: 0,\n chunkSize: 64 * 1024,\n minChunkSize: 100,\n timeWindow: 500,\n ticksRate: 2,\n samplesCount: 15\n }, null, (prop, source) => {\n return !utils.isUndefined(source[prop]);\n });\n\n super({\n readableHighWaterMark: options.chunkSize\n });\n\n const self = this;\n\n const internals = this[kInternals] = {\n length: options.length,\n timeWindow: options.timeWindow,\n ticksRate: options.ticksRate,\n chunkSize: options.chunkSize,\n maxRate: options.maxRate,\n minChunkSize: options.minChunkSize,\n bytesSeen: 0,\n isCaptured: false,\n notifiedBytesLoaded: 0,\n ts: Date.now(),\n bytes: 0,\n onReadCallback: null\n };\n\n const _speedometer = speedometer(internals.ticksRate * options.samplesCount, internals.timeWindow);\n\n this.on('newListener', event => {\n if (event === 'progress') {\n if (!internals.isCaptured) {\n internals.isCaptured = true;\n }\n }\n });\n\n let bytesNotified = 0;\n\n internals.updateProgress = throttle(function throttledHandler() {\n const totalBytes = internals.length;\n const bytesTransferred = internals.bytesSeen;\n const progressBytes = bytesTransferred - bytesNotified;\n if (!progressBytes || self.destroyed) return;\n\n const rate = _speedometer(progressBytes);\n\n bytesNotified = bytesTransferred;\n\n process.nextTick(() => {\n self.emit('progress', {\n 'loaded': bytesTransferred,\n 'total': totalBytes,\n 'progress': totalBytes ? (bytesTransferred / totalBytes) : undefined,\n 'bytes': progressBytes,\n 'rate': rate ? rate : undefined,\n 'estimated': rate && totalBytes && bytesTransferred <= totalBytes ?\n (totalBytes - bytesTransferred) / rate : undefined\n });\n });\n }, internals.ticksRate);\n\n const onFinish = () => {\n internals.updateProgress(true);\n };\n\n this.once('end', onFinish);\n this.once('error', onFinish);\n }\n\n _read(size) {\n const internals = this[kInternals];\n\n if (internals.onReadCallback) {\n internals.onReadCallback();\n }\n\n return super._read(size);\n }\n\n _transform(chunk, encoding, callback) {\n const self = this;\n const internals = this[kInternals];\n const maxRate = internals.maxRate;\n\n const readableHighWaterMark = this.readableHighWaterMark;\n\n const timeWindow = internals.timeWindow;\n\n const divider = 1000 / timeWindow;\n const bytesThreshold = (maxRate / divider);\n const minChunkSize = internals.minChunkSize !== false ? Math.max(internals.minChunkSize, bytesThreshold * 0.01) : 0;\n\n function pushChunk(_chunk, _callback) {\n const bytes = Buffer.byteLength(_chunk);\n internals.bytesSeen += bytes;\n internals.bytes += bytes;\n\n if (internals.isCaptured) {\n internals.updateProgress();\n }\n\n if (self.push(_chunk)) {\n process.nextTick(_callback);\n } else {\n internals.onReadCallback = () => {\n internals.onReadCallback = null;\n process.nextTick(_callback);\n };\n }\n }\n\n const transformChunk = (_chunk, _callback) => {\n const chunkSize = Buffer.byteLength(_chunk);\n let chunkRemainder = null;\n let maxChunkSize = readableHighWaterMark;\n let bytesLeft;\n let passed = 0;\n\n if (maxRate) {\n const now = Date.now();\n\n if (!internals.ts || (passed = (now - internals.ts)) >= timeWindow) {\n internals.ts = now;\n bytesLeft = bytesThreshold - internals.bytes;\n internals.bytes = bytesLeft < 0 ? -bytesLeft : 0;\n passed = 0;\n }\n\n bytesLeft = bytesThreshold - internals.bytes;\n }\n\n if (maxRate) {\n if (bytesLeft <= 0) {\n // next time window\n return setTimeout(() => {\n _callback(null, _chunk);\n }, timeWindow - passed);\n }\n\n if (bytesLeft < maxChunkSize) {\n maxChunkSize = bytesLeft;\n }\n }\n\n if (maxChunkSize && chunkSize > maxChunkSize && (chunkSize - maxChunkSize) > minChunkSize) {\n chunkRemainder = _chunk.subarray(maxChunkSize);\n _chunk = _chunk.subarray(0, maxChunkSize);\n }\n\n pushChunk(_chunk, chunkRemainder ? () => {\n process.nextTick(_callback, null, chunkRemainder);\n } : _callback);\n };\n\n transformChunk(chunk, function transformNextChunk(err, _chunk) {\n if (err) {\n return callback(err);\n }\n\n if (_chunk) {\n transformChunk(_chunk, transformNextChunk);\n } else {\n callback(null);\n }\n });\n }\n\n setLength(length) {\n this[kInternals].length = +length;\n return this;\n }\n}\n\nexport default AxiosTransformStream;\n","const {asyncIterator} = Symbol;\n\nconst readBlob = async function* (blob) {\n if (blob.stream) {\n yield* blob.stream()\n } else if (blob.arrayBuffer) {\n yield await blob.arrayBuffer()\n } else if (blob[asyncIterator]) {\n yield* blob[asyncIterator]();\n } else {\n yield blob;\n }\n}\n\nexport default readBlob;\n","import {TextEncoder} from 'util';\nimport {Readable} from 'stream';\nimport utils from \"../utils.js\";\nimport readBlob from \"./readBlob.js\";\n\nconst BOUNDARY_ALPHABET = utils.ALPHABET.ALPHA_DIGIT + '-_';\n\nconst textEncoder = new TextEncoder();\n\nconst CRLF = '\\r\\n';\nconst CRLF_BYTES = textEncoder.encode(CRLF);\nconst CRLF_BYTES_COUNT = 2;\n\nclass FormDataPart {\n constructor(name, value) {\n const {escapeName} = this.constructor;\n const isStringValue = utils.isString(value);\n\n let headers = `Content-Disposition: form-data; name=\"${escapeName(name)}\"${\n !isStringValue && value.name ? `; filename=\"${escapeName(value.name)}\"` : ''\n }${CRLF}`;\n\n if (isStringValue) {\n value = textEncoder.encode(String(value).replace(/\\r?\\n|\\r\\n?/g, CRLF));\n } else {\n headers += `Content-Type: ${value.type || \"application/octet-stream\"}${CRLF}`\n }\n\n this.headers = textEncoder.encode(headers + CRLF);\n\n this.contentLength = isStringValue ? value.byteLength : value.size;\n\n this.size = this.headers.byteLength + this.contentLength + CRLF_BYTES_COUNT;\n\n this.name = name;\n this.value = value;\n }\n\n async *encode(){\n yield this.headers;\n\n const {value} = this;\n\n if(utils.isTypedArray(value)) {\n yield value;\n } else {\n yield* readBlob(value);\n }\n\n yield CRLF_BYTES;\n }\n\n static escapeName(name) {\n return String(name).replace(/[\\r\\n\"]/g, (match) => ({\n '\\r' : '%0D',\n '\\n' : '%0A',\n '\"' : '%22',\n }[match]));\n }\n}\n\nconst formDataToStream = (form, headersHandler, options) => {\n const {\n tag = 'form-data-boundary',\n size = 25,\n boundary = tag + '-' + utils.generateString(size, BOUNDARY_ALPHABET)\n } = options || {};\n\n if(!utils.isFormData(form)) {\n throw TypeError('FormData instance required');\n }\n\n if (boundary.length < 1 || boundary.length > 70) {\n throw Error('boundary must be 10-70 characters long')\n }\n\n const boundaryBytes = textEncoder.encode('--' + boundary + CRLF);\n const footerBytes = textEncoder.encode('--' + boundary + '--' + CRLF + CRLF);\n let contentLength = footerBytes.byteLength;\n\n const parts = Array.from(form.entries()).map(([name, value]) => {\n const part = new FormDataPart(name, value);\n contentLength += part.size;\n return part;\n });\n\n contentLength += boundaryBytes.byteLength * parts.length;\n\n contentLength = utils.toFiniteNumber(contentLength);\n\n const computedHeaders = {\n 'Content-Type': `multipart/form-data; boundary=${boundary}`\n }\n\n if (Number.isFinite(contentLength)) {\n computedHeaders['Content-Length'] = contentLength;\n }\n\n headersHandler && headersHandler(computedHeaders);\n\n return Readable.from((async function *() {\n for(const part of parts) {\n yield boundaryBytes;\n yield* part.encode();\n }\n\n yield footerBytes;\n })());\n};\n\nexport default formDataToStream;\n","\"use strict\";\n\nimport stream from \"stream\";\n\nclass ZlibHeaderTransformStream extends stream.Transform {\n __transform(chunk, encoding, callback) {\n this.push(chunk);\n callback();\n }\n\n _transform(chunk, encoding, callback) {\n if (chunk.length !== 0) {\n this._transform = this.__transform;\n\n // Add Default Compression headers if no zlib headers are present\n if (chunk[0] !== 120) { // Hex: 78\n const header = Buffer.alloc(2);\n header[0] = 120; // Hex: 78\n header[1] = 156; // Hex: 9C \n this.push(header, encoding);\n }\n }\n\n this.__transform(chunk, encoding, callback);\n }\n}\n\nexport default ZlibHeaderTransformStream;\n","import utils from \"../utils.js\";\n\nconst callbackify = (fn, reducer) => {\n return utils.isAsyncFn(fn) ? function (...args) {\n const cb = args.pop();\n fn.apply(this, args).then((value) => {\n try {\n reducer ? cb(null, ...reducer(value)) : cb(null, value);\n } catch (err) {\n cb(err);\n }\n }, cb);\n } : fn;\n}\n\nexport default callbackify;\n","'use strict';\n\nimport utils from './../utils.js';\nimport settle from './../core/settle.js';\nimport buildFullPath from '../core/buildFullPath.js';\nimport buildURL from './../helpers/buildURL.js';\nimport {getProxyForUrl} from 'proxy-from-env';\nimport http from 'http';\nimport https from 'https';\nimport util from 'util';\nimport followRedirects from 'follow-redirects';\nimport zlib from 'zlib';\nimport {VERSION} from '../env/data.js';\nimport transitionalDefaults from '../defaults/transitional.js';\nimport AxiosError from '../core/AxiosError.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport platform from '../platform/index.js';\nimport fromDataURI from '../helpers/fromDataURI.js';\nimport stream from 'stream';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport AxiosTransformStream from '../helpers/AxiosTransformStream.js';\nimport EventEmitter from 'events';\nimport formDataToStream from \"../helpers/formDataToStream.js\";\nimport readBlob from \"../helpers/readBlob.js\";\nimport ZlibHeaderTransformStream from '../helpers/ZlibHeaderTransformStream.js';\nimport callbackify from \"../helpers/callbackify.js\";\n\nconst zlibOptions = {\n flush: zlib.constants.Z_SYNC_FLUSH,\n finishFlush: zlib.constants.Z_SYNC_FLUSH\n};\n\nconst brotliOptions = {\n flush: zlib.constants.BROTLI_OPERATION_FLUSH,\n finishFlush: zlib.constants.BROTLI_OPERATION_FLUSH\n}\n\nconst isBrotliSupported = utils.isFunction(zlib.createBrotliDecompress);\n\nconst {http: httpFollow, https: httpsFollow} = followRedirects;\n\nconst isHttps = /https:?/;\n\nconst supportedProtocols = platform.protocols.map(protocol => {\n return protocol + ':';\n});\n\n/**\n * If the proxy or config beforeRedirects functions are defined, call them with the options\n * object.\n *\n * @param {Object<string, any>} options - The options object that was passed to the request.\n *\n * @returns {Object<string, any>}\n */\nfunction dispatchBeforeRedirect(options, responseDetails) {\n if (options.beforeRedirects.proxy) {\n options.beforeRedirects.proxy(options);\n }\n if (options.beforeRedirects.config) {\n options.beforeRedirects.config(options, responseDetails);\n }\n}\n\n/**\n * If the proxy or config afterRedirects functions are defined, call them with the options\n *\n * @param {http.ClientRequestArgs} options\n * @param {AxiosProxyConfig} configProxy configuration from Axios options object\n * @param {string} location\n *\n * @returns {http.ClientRequestArgs}\n */\nfunction setProxy(options, configProxy, location) {\n let proxy = configProxy;\n if (!proxy && proxy !== false) {\n const proxyUrl = getProxyForUrl(location);\n if (proxyUrl) {\n proxy = new URL(proxyUrl);\n }\n }\n if (proxy) {\n // Basic proxy authorization\n if (proxy.username) {\n proxy.auth = (proxy.username || '') + ':' + (proxy.password || '');\n }\n\n if (proxy.auth) {\n // Support proxy auth object form\n if (proxy.auth.username || proxy.auth.password) {\n proxy.auth = (proxy.auth.username || '') + ':' + (proxy.auth.password || '');\n }\n const base64 = Buffer\n .from(proxy.auth, 'utf8')\n .toString('base64');\n options.headers['Proxy-Authorization'] = 'Basic ' + base64;\n }\n\n options.headers.host = options.hostname + (options.port ? ':' + options.port : '');\n const proxyHost = proxy.hostname || proxy.host;\n options.hostname = proxyHost;\n // Replace 'host' since options is not a URL object\n options.host = proxyHost;\n options.port = proxy.port;\n options.path = location;\n if (proxy.protocol) {\n options.protocol = proxy.protocol.includes(':') ? proxy.protocol : `${proxy.protocol}:`;\n }\n }\n\n options.beforeRedirects.proxy = function beforeRedirect(redirectOptions) {\n // Configure proxy for redirected request, passing the original config proxy to apply\n // the exact same logic as if the redirected request was performed by axios directly.\n setProxy(redirectOptions, configProxy, redirectOptions.href);\n };\n}\n\nconst isHttpAdapterSupported = typeof process !== 'undefined' && utils.kindOf(process) === 'process';\n\n// temporary hotfix\n\nconst wrapAsync = (asyncExecutor) => {\n return new Promise((resolve, reject) => {\n let onDone;\n let isDone;\n\n const done = (value, isRejected) => {\n if (isDone) return;\n isDone = true;\n onDone && onDone(value, isRejected);\n }\n\n const _resolve = (value) => {\n done(value);\n resolve(value);\n };\n\n const _reject = (reason) => {\n done(reason, true);\n reject(reason);\n }\n\n asyncExecutor(_resolve, _reject, (onDoneHandler) => (onDone = onDoneHandler)).catch(_reject);\n })\n};\n\nconst resolveFamily = ({address, family}) => {\n if (!utils.isString(address)) {\n throw TypeError('address must be a string');\n }\n return ({\n address,\n family: family || (address.indexOf('.') < 0 ? 6 : 4)\n });\n}\n\nconst buildAddressEntry = (address, family) => resolveFamily(utils.isObject(address) ? address : {address, family});\n\n/*eslint consistent-return:0*/\nexport default isHttpAdapterSupported && function httpAdapter(config) {\n return wrapAsync(async function dispatchHttpRequest(resolve, reject, onDone) {\n let {data, lookup, family} = config;\n const {responseType, responseEncoding} = config;\n const method = config.method.toUpperCase();\n let isDone;\n let rejected = false;\n let req;\n\n if (lookup) {\n const _lookup = callbackify(lookup, (value) => utils.isArray(value) ? value : [value]);\n // hotfix to support opt.all option which is required for node 20.x\n lookup = (hostname, opt, cb) => {\n _lookup(hostname, opt, (err, arg0, arg1) => {\n if (err) {\n return cb(err);\n }\n\n const addresses = utils.isArray(arg0) ? arg0.map(addr => buildAddressEntry(addr)) : [buildAddressEntry(arg0, arg1)];\n\n opt.all ? cb(err, addresses) : cb(err, addresses[0].address, addresses[0].family);\n });\n }\n }\n\n // temporary internal emitter until the AxiosRequest class will be implemented\n const emitter = new EventEmitter();\n\n const onFinished = () => {\n if (config.cancelToken) {\n config.cancelToken.unsubscribe(abort);\n }\n\n if (config.signal) {\n config.signal.removeEventListener('abort', abort);\n }\n\n emitter.removeAllListeners();\n }\n\n onDone((value, isRejected) => {\n isDone = true;\n if (isRejected) {\n rejected = true;\n onFinished();\n }\n });\n\n function abort(reason) {\n emitter.emit('abort', !reason || reason.type ? new CanceledError(null, config, req) : reason);\n }\n\n emitter.once('abort', reject);\n\n if (config.cancelToken || config.signal) {\n config.cancelToken && config.cancelToken.subscribe(abort);\n if (config.signal) {\n config.signal.aborted ? abort() : config.signal.addEventListener('abort', abort);\n }\n }\n\n // Parse url\n const fullPath = buildFullPath(config.baseURL, config.url);\n const parsed = new URL(fullPath, 'http://localhost');\n const protocol = parsed.protocol || supportedProtocols[0];\n\n if (protocol === 'data:') {\n let convertedData;\n\n if (method !== 'GET') {\n return settle(resolve, reject, {\n status: 405,\n statusText: 'method not allowed',\n headers: {},\n config\n });\n }\n\n try {\n convertedData = fromDataURI(config.url, responseType === 'blob', {\n Blob: config.env && config.env.Blob\n });\n } catch (err) {\n throw AxiosError.from(err, AxiosError.ERR_BAD_REQUEST, config);\n }\n\n if (responseType === 'text') {\n convertedData = convertedData.toString(responseEncoding);\n\n if (!responseEncoding || responseEncoding === 'utf8') {\n convertedData = utils.stripBOM(convertedData);\n }\n } else if (responseType === 'stream') {\n convertedData = stream.Readable.from(convertedData);\n }\n\n return settle(resolve, reject, {\n data: convertedData,\n status: 200,\n statusText: 'OK',\n headers: new AxiosHeaders(),\n config\n });\n }\n\n if (supportedProtocols.indexOf(protocol) === -1) {\n return reject(new AxiosError(\n 'Unsupported protocol ' + protocol,\n AxiosError.ERR_BAD_REQUEST,\n config\n ));\n }\n\n const headers = AxiosHeaders.from(config.headers).normalize();\n\n // Set User-Agent (required by some servers)\n // See https://github.com/axios/axios/issues/69\n // User-Agent is specified; handle case where no UA header is desired\n // Only set header if it hasn't been set in config\n headers.set('User-Agent', 'axios/' + VERSION, false);\n\n const onDownloadProgress = config.onDownloadProgress;\n const onUploadProgress = config.onUploadProgress;\n const maxRate = config.maxRate;\n let maxUploadRate = undefined;\n let maxDownloadRate = undefined;\n\n // support for spec compliant FormData objects\n if (utils.isSpecCompliantForm(data)) {\n const userBoundary = headers.getContentType(/boundary=([-_\\w\\d]{10,70})/i);\n\n data = formDataToStream(data, (formHeaders) => {\n headers.set(formHeaders);\n }, {\n tag: `axios-${VERSION}-boundary`,\n boundary: userBoundary && userBoundary[1] || undefined\n });\n // support for https://www.npmjs.com/package/form-data api\n } else if (utils.isFormData(data) && utils.isFunction(data.getHeaders)) {\n headers.set(data.getHeaders());\n\n if (!headers.hasContentLength()) {\n try {\n const knownLength = await util.promisify(data.getLength).call(data);\n Number.isFinite(knownLength) && knownLength >= 0 && headers.setContentLength(knownLength);\n /*eslint no-empty:0*/\n } catch (e) {\n }\n }\n } else if (utils.isBlob(data)) {\n data.size && headers.setContentType(data.type || 'application/octet-stream');\n headers.setContentLength(data.size || 0);\n data = stream.Readable.from(readBlob(data));\n } else if (data && !utils.isStream(data)) {\n if (Buffer.isBuffer(data)) {\n // Nothing to do...\n } else if (utils.isArrayBuffer(data)) {\n data = Buffer.from(new Uint8Array(data));\n } else if (utils.isString(data)) {\n data = Buffer.from(data, 'utf-8');\n } else {\n return reject(new AxiosError(\n 'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream',\n AxiosError.ERR_BAD_REQUEST,\n config\n ));\n }\n\n // Add Content-Length header if data exists\n headers.setContentLength(data.length, false);\n\n if (config.maxBodyLength > -1 && data.length > config.maxBodyLength) {\n return reject(new AxiosError(\n 'Request body larger than maxBodyLength limit',\n AxiosError.ERR_BAD_REQUEST,\n config\n ));\n }\n }\n\n const contentLength = utils.toFiniteNumber(headers.getContentLength());\n\n if (utils.isArray(maxRate)) {\n maxUploadRate = maxRate[0];\n maxDownloadRate = maxRate[1];\n } else {\n maxUploadRate = maxDownloadRate = maxRate;\n }\n\n if (data && (onUploadProgress || maxUploadRate)) {\n if (!utils.isStream(data)) {\n data = stream.Readable.from(data, {objectMode: false});\n }\n\n data = stream.pipeline([data, new AxiosTransformStream({\n length: contentLength,\n maxRate: utils.toFiniteNumber(maxUploadRate)\n })], utils.noop);\n\n onUploadProgress && data.on('progress', progress => {\n onUploadProgress(Object.assign(progress, {\n upload: true\n }));\n });\n }\n\n // HTTP basic authentication\n let auth = undefined;\n if (config.auth) {\n const username = config.auth.username || '';\n const password = config.auth.password || '';\n auth = username + ':' + password;\n }\n\n if (!auth && parsed.username) {\n const urlUsername = parsed.username;\n const urlPassword = parsed.password;\n auth = urlUsername + ':' + urlPassword;\n }\n\n auth && headers.delete('authorization');\n\n let path;\n\n try {\n path = buildURL(\n parsed.pathname + parsed.search,\n config.params,\n config.paramsSerializer\n ).replace(/^\\?/, '');\n } catch (err) {\n const customErr = new Error(err.message);\n customErr.config = config;\n customErr.url = config.url;\n customErr.exists = true;\n return reject(customErr);\n }\n\n headers.set(\n 'Accept-Encoding',\n 'gzip, compress, deflate' + (isBrotliSupported ? ', br' : ''), false\n );\n\n const options = {\n path,\n method: method,\n headers: headers.toJSON(),\n agents: { http: config.httpAgent, https: config.httpsAgent },\n auth,\n protocol,\n family,\n beforeRedirect: dispatchBeforeRedirect,\n beforeRedirects: {}\n };\n\n // cacheable-lookup integration hotfix\n !utils.isUndefined(lookup) && (options.lookup = lookup);\n\n if (config.socketPath) {\n options.socketPath = config.socketPath;\n } else {\n options.hostname = parsed.hostname;\n options.port = parsed.port;\n setProxy(options, config.proxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path);\n }\n\n let transport;\n const isHttpsRequest = isHttps.test(options.protocol);\n options.agent = isHttpsRequest ? config.httpsAgent : config.httpAgent;\n if (config.transport) {\n transport = config.transport;\n } else if (config.maxRedirects === 0) {\n transport = isHttpsRequest ? https : http;\n } else {\n if (config.maxRedirects) {\n options.maxRedirects = config.maxRedirects;\n }\n if (config.beforeRedirect) {\n options.beforeRedirects.config = config.beforeRedirect;\n }\n transport = isHttpsRequest ? httpsFollow : httpFollow;\n }\n\n if (config.maxBodyLength > -1) {\n options.maxBodyLength = config.maxBodyLength;\n } else {\n // follow-redirects does not skip comparison, so it should always succeed for axios -1 unlimited\n options.maxBodyLength = Infinity;\n }\n\n if (config.insecureHTTPParser) {\n options.insecureHTTPParser = config.insecureHTTPParser;\n }\n\n // Create the request\n req = transport.request(options, function handleResponse(res) {\n if (req.destroyed) return;\n\n const streams = [res];\n\n const responseLength = +res.headers['content-length'];\n\n if (onDownloadProgress) {\n const transformStream = new AxiosTransformStream({\n length: utils.toFiniteNumber(responseLength),\n maxRate: utils.toFiniteNumber(maxDownloadRate)\n });\n\n onDownloadProgress && transformStream.on('progress', progress => {\n onDownloadProgress(Object.assign(progress, {\n download: true\n }));\n });\n\n streams.push(transformStream);\n }\n\n // decompress the response body transparently if required\n let responseStream = res;\n\n // return the last request in case of redirects\n const lastRequest = res.req || req;\n\n // if decompress disabled we should not decompress\n if (config.decompress !== false && res.headers['content-encoding']) {\n // if no content, but headers still say that it is encoded,\n // remove the header not confuse downstream operations\n if (method === 'HEAD' || res.statusCode === 204) {\n delete res.headers['content-encoding'];\n }\n\n switch ((res.headers['content-encoding'] || '').toLowerCase()) {\n /*eslint default-case:0*/\n case 'gzip':\n case 'x-gzip':\n case 'compress':\n case 'x-compress':\n // add the unzipper to the body stream processing pipeline\n streams.push(zlib.createUnzip(zlibOptions));\n\n // remove the content-encoding in order to not confuse downstream operations\n delete res.headers['content-encoding'];\n break;\n case 'deflate':\n streams.push(new ZlibHeaderTransformStream());\n\n // add the unzipper to the body stream processing pipeline\n streams.push(zlib.createUnzip(zlibOptions));\n\n // remove the content-encoding in order to not confuse downstream operations\n delete res.headers['content-encoding'];\n break;\n case 'br':\n if (isBrotliSupported) {\n streams.push(zlib.createBrotliDecompress(brotliOptions));\n delete res.headers['content-encoding'];\n }\n }\n }\n\n responseStream = streams.length > 1 ? stream.pipeline(streams, utils.noop) : streams[0];\n\n const offListeners = stream.finished(responseStream, () => {\n offListeners();\n onFinished();\n });\n\n const response = {\n status: res.statusCode,\n statusText: res.statusMessage,\n headers: new AxiosHeaders(res.headers),\n config,\n request: lastRequest\n };\n\n if (responseType === 'stream') {\n response.data = responseStream;\n settle(resolve, reject, response);\n } else {\n const responseBuffer = [];\n let totalResponseBytes = 0;\n\n responseStream.on('data', function handleStreamData(chunk) {\n responseBuffer.push(chunk);\n totalResponseBytes += chunk.length;\n\n // make sure the content length is not over the maxContentLength if specified\n if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) {\n // stream.destroy() emit aborted event before calling reject() on Node.js v16\n rejected = true;\n responseStream.destroy();\n reject(new AxiosError('maxContentLength size of ' + config.maxContentLength + ' exceeded',\n AxiosError.ERR_BAD_RESPONSE, config, lastRequest));\n }\n });\n\n responseStream.on('aborted', function handlerStreamAborted() {\n if (rejected) {\n return;\n }\n\n const err = new AxiosError(\n 'maxContentLength size of ' + config.maxContentLength + ' exceeded',\n AxiosError.ERR_BAD_RESPONSE,\n config,\n lastRequest\n );\n responseStream.destroy(err);\n reject(err);\n });\n\n responseStream.on('error', function handleStreamError(err) {\n if (req.destroyed) return;\n reject(AxiosError.from(err, null, config, lastRequest));\n });\n\n responseStream.on('end', function handleStreamEnd() {\n try {\n let responseData = responseBuffer.length === 1 ? responseBuffer[0] : Buffer.concat(responseBuffer);\n if (responseType !== 'arraybuffer') {\n responseData = responseData.toString(responseEncoding);\n if (!responseEncoding || responseEncoding === 'utf8') {\n responseData = utils.stripBOM(responseData);\n }\n }\n response.data = responseData;\n } catch (err) {\n return reject(AxiosError.from(err, null, config, response.request, response));\n }\n settle(resolve, reject, response);\n });\n }\n\n emitter.once('abort', err => {\n if (!responseStream.destroyed) {\n responseStream.emit('error', err);\n responseStream.destroy();\n }\n });\n });\n\n emitter.once('abort', err => {\n reject(err);\n req.destroy(err);\n });\n\n // Handle errors\n req.on('error', function handleRequestError(err) {\n // @todo remove\n // if (req.aborted && err.code !== AxiosError.ERR_FR_TOO_MANY_REDIRECTS) return;\n reject(AxiosError.from(err, null, config, req));\n });\n\n // set tcp keep alive to prevent drop connection by peer\n req.on('socket', function handleRequestSocket(socket) {\n // default interval of sending ack packet is 1 minute\n socket.setKeepAlive(true, 1000 * 60);\n });\n\n // Handle request timeout\n if (config.timeout) {\n // This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types.\n const timeout = parseInt(config.timeout, 10);\n\n if (Number.isNaN(timeout)) {\n reject(new AxiosError(\n 'error trying to parse `config.timeout` to int',\n AxiosError.ERR_BAD_OPTION_VALUE,\n config,\n req\n ));\n\n return;\n }\n\n // Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system.\n // And timer callback will be fired, and abort() will be invoked before connection, then get \"socket hang up\" and code ECONNRESET.\n // At this time, if we have a large number of request, nodejs will hang up some socket on background. and the number will up and up.\n // And then these socket which be hang up will devouring CPU little by little.\n // ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect.\n req.setTimeout(timeout, function handleRequestTimeout() {\n if (isDone) return;\n let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';\n const transitional = config.transitional || transitionalDefaults;\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(new AxiosError(\n timeoutErrorMessage,\n transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,\n config,\n req\n ));\n abort();\n });\n }\n\n\n // Send the request\n if (utils.isStream(data)) {\n let ended = false;\n let errored = false;\n\n data.on('end', () => {\n ended = true;\n });\n\n data.once('error', err => {\n errored = true;\n req.destroy(err);\n });\n\n data.on('close', () => {\n if (!ended && !errored) {\n abort(new CanceledError('Request stream has been aborted', config, req));\n }\n });\n\n data.pipe(req);\n } else {\n req.end(data);\n }\n });\n}\n\nexport const __setProxy = setProxy;\n","import utils from './../utils.js';\nimport platform from '../platform/index.js';\n\nexport default platform.hasStandardBrowserEnv ?\n\n // Standard browser envs support document.cookie\n {\n write(name, value, expires, path, domain, secure) {\n const cookie = [name + '=' + encodeURIComponent(value)];\n\n utils.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());\n\n utils.isString(path) && cookie.push('path=' + path);\n\n utils.isString(domain) && cookie.push('domain=' + domain);\n\n secure === true && cookie.push('secure');\n\n document.cookie = cookie.join('; ');\n },\n\n read(name) {\n const match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n }\n\n :\n\n // Non-standard browser env (web workers, react-native) lack needed support.\n {\n write() {},\n read() {\n return null;\n },\n remove() {}\n };\n\n","'use strict';\n\nimport utils from './../utils.js';\nimport platform from '../platform/index.js';\n\nexport default platform.hasStandardBrowserEnv ?\n\n// Standard browser envs have full support of the APIs needed to test\n// whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n const msie = /(msie|trident)/i.test(navigator.userAgent);\n const urlParsingNode = document.createElement('a');\n let originURL;\n\n /**\n * Parse a URL to discover its components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n let href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n const parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })();\n","'use strict';\n\nimport utils from './../utils.js';\nimport settle from './../core/settle.js';\nimport cookies from './../helpers/cookies.js';\nimport buildURL from './../helpers/buildURL.js';\nimport buildFullPath from '../core/buildFullPath.js';\nimport isURLSameOrigin from './../helpers/isURLSameOrigin.js';\nimport transitionalDefaults from '../defaults/transitional.js';\nimport AxiosError from '../core/AxiosError.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport parseProtocol from '../helpers/parseProtocol.js';\nimport platform from '../platform/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport speedometer from '../helpers/speedometer.js';\n\nfunction progressEventReducer(listener, isDownloadStream) {\n let bytesNotified = 0;\n const _speedometer = speedometer(50, 250);\n\n return e => {\n const loaded = e.loaded;\n const total = e.lengthComputable ? e.total : undefined;\n const progressBytes = loaded - bytesNotified;\n const rate = _speedometer(progressBytes);\n const inRange = loaded <= total;\n\n bytesNotified = loaded;\n\n const data = {\n loaded,\n total,\n progress: total ? (loaded / total) : undefined,\n bytes: progressBytes,\n rate: rate ? rate : undefined,\n estimated: rate && total && inRange ? (total - loaded) / rate : undefined,\n event: e\n };\n\n data[isDownloadStream ? 'download' : 'upload'] = true;\n\n listener(data);\n };\n}\n\nconst isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';\n\nexport default isXHRAdapterSupported && function (config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n let requestData = config.data;\n const requestHeaders = AxiosHeaders.from(config.headers).normalize();\n let {responseType, withXSRFToken} = config;\n let onCanceled;\n function done() {\n if (config.cancelToken) {\n config.cancelToken.unsubscribe(onCanceled);\n }\n\n if (config.signal) {\n config.signal.removeEventListener('abort', onCanceled);\n }\n }\n\n let contentType;\n\n if (utils.isFormData(requestData)) {\n if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {\n requestHeaders.setContentType(false); // Let the browser set it\n } else if ((contentType = requestHeaders.getContentType()) !== false) {\n // fix semicolon duplication issue for ReactNative FormData implementation\n const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];\n requestHeaders.setContentType([type || 'multipart/form-data', ...tokens].join('; '));\n }\n }\n\n let request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n const username = config.auth.username || '';\n const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.set('Authorization', 'Basic ' + btoa(username + ':' + password));\n }\n\n const fullPath = buildFullPath(config.baseURL, config.url);\n\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n const responseHeaders = AxiosHeaders.from(\n 'getAllResponseHeaders' in request && request.getAllResponseHeaders()\n );\n const responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n const response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config,\n request\n };\n\n settle(function _resolve(value) {\n resolve(value);\n done();\n }, function _reject(err) {\n reject(err);\n done();\n }, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';\n const transitional = config.transitional || transitionalDefaults;\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(new AxiosError(\n timeoutErrorMessage,\n transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,\n config,\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if(platform.hasStandardBrowserEnv) {\n withXSRFToken && utils.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config));\n\n if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(fullPath))) {\n // Add xsrf header\n const xsrfValue = config.xsrfHeaderName && config.xsrfCookieName && cookies.read(config.xsrfCookieName);\n\n if (xsrfValue) {\n requestHeaders.set(config.xsrfHeaderName, xsrfValue);\n }\n }\n }\n\n // Remove Content-Type if data is undefined\n requestData === undefined && requestHeaders.setContentType(null);\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {\n request.setRequestHeader(key, val);\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = config.responseType;\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', progressEventReducer(config.onDownloadProgress, true));\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', progressEventReducer(config.onUploadProgress));\n }\n\n if (config.cancelToken || config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = cancel => {\n if (!request) {\n return;\n }\n reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);\n request.abort();\n request = null;\n };\n\n config.cancelToken && config.cancelToken.subscribe(onCanceled);\n if (config.signal) {\n config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);\n }\n }\n\n const protocol = parseProtocol(fullPath);\n\n if (protocol && platform.protocols.indexOf(protocol) === -1) {\n reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));\n return;\n }\n\n\n // Send the request\n request.send(requestData || null);\n });\n}\n","import utils from '../utils.js';\nimport httpAdapter from './http.js';\nimport xhrAdapter from './xhr.js';\nimport AxiosError from \"../core/AxiosError.js\";\n\nconst knownAdapters = {\n http: httpAdapter,\n xhr: xhrAdapter\n}\n\nutils.forEach(knownAdapters, (fn, value) => {\n if (fn) {\n try {\n Object.defineProperty(fn, 'name', {value});\n } catch (e) {\n // eslint-disable-next-line no-empty\n }\n Object.defineProperty(fn, 'adapterName', {value});\n }\n});\n\nconst renderReason = (reason) => `- ${reason}`;\n\nconst isResolvedHandle = (adapter) => utils.isFunction(adapter) || adapter === null || adapter === false;\n\nexport default {\n getAdapter: (adapters) => {\n adapters = utils.isArray(adapters) ? adapters : [adapters];\n\n const {length} = adapters;\n let nameOrAdapter;\n let adapter;\n\n const rejectedReasons = {};\n\n for (let i = 0; i < length; i++) {\n nameOrAdapter = adapters[i];\n let id;\n\n adapter = nameOrAdapter;\n\n if (!isResolvedHandle(nameOrAdapter)) {\n adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];\n\n if (adapter === undefined) {\n throw new AxiosError(`Unknown adapter '${id}'`);\n }\n }\n\n if (adapter) {\n break;\n }\n\n rejectedReasons[id || '#' + i] = adapter;\n }\n\n if (!adapter) {\n\n const reasons = Object.entries(rejectedReasons)\n .map(([id, state]) => `adapter ${id} ` +\n (state === false ? 'is not supported by the environment' : 'is not available in the build')\n );\n\n let s = length ?\n (reasons.length > 1 ? 'since :\\n' + reasons.map(renderReason).join('\\n') : ' ' + renderReason(reasons[0])) :\n 'as no adapter specified';\n\n throw new AxiosError(\n `There is no suitable adapter to dispatch the request ` + s,\n 'ERR_NOT_SUPPORT'\n );\n }\n\n return adapter;\n },\n adapters: knownAdapters\n}\n","'use strict';\n\nimport transformData from './transformData.js';\nimport isCancel from '../cancel/isCancel.js';\nimport defaults from '../defaults/index.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport adapters from \"../adapters/adapters.js\";\n\n/**\n * Throws a `CanceledError` if cancellation has been requested.\n *\n * @param {Object} config The config that is to be used for the request\n *\n * @returns {void}\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n\n if (config.signal && config.signal.aborted) {\n throw new CanceledError(null, config);\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n *\n * @returns {Promise} The Promise to be fulfilled\n */\nexport default function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n config.headers = AxiosHeaders.from(config.headers);\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.transformRequest\n );\n\n if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {\n config.headers.setContentType('application/x-www-form-urlencoded', false);\n }\n\n const adapter = adapters.getAdapter(config.adapter || defaults.adapter);\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n config.transformResponse,\n response\n );\n\n response.headers = AxiosHeaders.from(response.headers);\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n config.transformResponse,\n reason.response\n );\n reason.response.headers = AxiosHeaders.from(reason.response.headers);\n }\n }\n\n return Promise.reject(reason);\n });\n}\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosHeaders from \"./AxiosHeaders.js\";\n\nconst headersToObject = (thing) => thing instanceof AxiosHeaders ? thing.toJSON() : thing;\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n *\n * @returns {Object} New object resulting from merging config2 to config1\n */\nexport default function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n const config = {};\n\n function getMergedValue(target, source, caseless) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge.call({caseless}, target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDeepProperties(a, b, caseless) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(a, b, caseless);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a, caseless);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function valueFromConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function defaultToConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDirectKeys(a, b, prop) {\n if (prop in config2) {\n return getMergedValue(a, b);\n } else if (prop in config1) {\n return getMergedValue(undefined, a);\n }\n }\n\n const mergeMap = {\n url: valueFromConfig2,\n method: valueFromConfig2,\n data: valueFromConfig2,\n baseURL: defaultToConfig2,\n transformRequest: defaultToConfig2,\n transformResponse: defaultToConfig2,\n paramsSerializer: defaultToConfig2,\n timeout: defaultToConfig2,\n timeoutMessage: defaultToConfig2,\n withCredentials: defaultToConfig2,\n withXSRFToken: defaultToConfig2,\n adapter: defaultToConfig2,\n responseType: defaultToConfig2,\n xsrfCookieName: defaultToConfig2,\n xsrfHeaderName: defaultToConfig2,\n onUploadProgress: defaultToConfig2,\n onDownloadProgress: defaultToConfig2,\n decompress: defaultToConfig2,\n maxContentLength: defaultToConfig2,\n maxBodyLength: defaultToConfig2,\n beforeRedirect: defaultToConfig2,\n transport: defaultToConfig2,\n httpAgent: defaultToConfig2,\n httpsAgent: defaultToConfig2,\n cancelToken: defaultToConfig2,\n socketPath: defaultToConfig2,\n responseEncoding: defaultToConfig2,\n validateStatus: mergeDirectKeys,\n headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)\n };\n\n utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {\n const merge = mergeMap[prop] || mergeDeepProperties;\n const configValue = merge(config1[prop], config2[prop], prop);\n (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);\n });\n\n return config;\n}\n","'use strict';\n\nimport {VERSION} from '../env/data.js';\nimport AxiosError from '../core/AxiosError.js';\n\nconst validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nconst deprecatedWarnings = {};\n\n/**\n * Transitional option validator\n *\n * @param {function|boolean?} validator - set to false if the transitional option has been removed\n * @param {string?} version - deprecated version / removed since version\n * @param {string?} message - some message with additional info\n *\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n function formatMessage(opt, desc) {\n return '[Axios v' + VERSION + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return (value, opt, opts) => {\n if (validator === false) {\n throw new AxiosError(\n formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),\n AxiosError.ERR_DEPRECATED\n );\n }\n\n if (version && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n *\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n *\n * @returns {object}\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);\n }\n const keys = Object.keys(options);\n let i = keys.length;\n while (i-- > 0) {\n const opt = keys[i];\n const validator = schema[opt];\n if (validator) {\n const value = options[opt];\n const result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);\n }\n }\n}\n\nexport default {\n assertOptions,\n validators\n};\n","'use strict';\n\nimport utils from './../utils.js';\nimport buildURL from '../helpers/buildURL.js';\nimport InterceptorManager from './InterceptorManager.js';\nimport dispatchRequest from './dispatchRequest.js';\nimport mergeConfig from './mergeConfig.js';\nimport buildFullPath from './buildFullPath.js';\nimport validator from '../helpers/validator.js';\nimport AxiosHeaders from './AxiosHeaders.js';\n\nconst validators = validator.validators;\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n *\n * @return {Axios} A new instance of Axios\n */\nclass Axios {\n constructor(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n }\n\n /**\n * Dispatch a request\n *\n * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)\n * @param {?Object} config\n *\n * @returns {Promise} The Promise to be fulfilled\n */\n async request(configOrUrl, config) {\n try {\n return await this._request(configOrUrl, config);\n } catch (err) {\n if (err instanceof Error) {\n let dummy;\n\n Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : (dummy = new Error());\n\n // slice off the Error: ... line\n const stack = dummy.stack ? dummy.stack.replace(/^.+\\n/, '') : '';\n\n if (!err.stack) {\n err.stack = stack;\n // match without the 2 top stack lines\n } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\\n.+\\n/, ''))) {\n err.stack += '\\n' + stack\n }\n }\n\n throw err;\n }\n }\n\n _request(configOrUrl, config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof configOrUrl === 'string') {\n config = config || {};\n config.url = configOrUrl;\n } else {\n config = configOrUrl || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n const {transitional, paramsSerializer, headers} = config;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean),\n forcedJSONParsing: validators.transitional(validators.boolean),\n clarifyTimeoutError: validators.transitional(validators.boolean)\n }, false);\n }\n\n if (paramsSerializer != null) {\n if (utils.isFunction(paramsSerializer)) {\n config.paramsSerializer = {\n serialize: paramsSerializer\n }\n } else {\n validator.assertOptions(paramsSerializer, {\n encode: validators.function,\n serialize: validators.function\n }, true);\n }\n }\n\n // Set config.method\n config.method = (config.method || this.defaults.method || 'get').toLowerCase();\n\n // Flatten headers\n let contextHeaders = headers && utils.merge(\n headers.common,\n headers[config.method]\n );\n\n headers && utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n (method) => {\n delete headers[method];\n }\n );\n\n config.headers = AxiosHeaders.concat(contextHeaders, headers);\n\n // filter out skipped interceptors\n const requestInterceptorChain = [];\n let synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n const responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n let promise;\n let i = 0;\n let len;\n\n if (!synchronousRequestInterceptors) {\n const chain = [dispatchRequest.bind(this), undefined];\n chain.unshift.apply(chain, requestInterceptorChain);\n chain.push.apply(chain, responseInterceptorChain);\n len = chain.length;\n\n promise = Promise.resolve(config);\n\n while (i < len) {\n promise = promise.then(chain[i++], chain[i++]);\n }\n\n return promise;\n }\n\n len = requestInterceptorChain.length;\n\n let newConfig = config;\n\n i = 0;\n\n while (i < len) {\n const onFulfilled = requestInterceptorChain[i++];\n const onRejected = requestInterceptorChain[i++];\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected.call(this, error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest.call(this, newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n i = 0;\n len = responseInterceptorChain.length;\n\n while (i < len) {\n promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);\n }\n\n return promise;\n }\n\n getUri(config) {\n config = mergeConfig(this.defaults, config);\n const fullPath = buildFullPath(config.baseURL, config.url);\n return buildURL(fullPath, config.params, config.paramsSerializer);\n }\n}\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n\n function generateHTTPMethod(isForm) {\n return function httpMethod(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n headers: isForm ? {\n 'Content-Type': 'multipart/form-data'\n } : {},\n url,\n data\n }));\n };\n }\n\n Axios.prototype[method] = generateHTTPMethod();\n\n Axios.prototype[method + 'Form'] = generateHTTPMethod(true);\n});\n\nexport default Axios;\n","'use strict';\n\nimport CanceledError from './CanceledError.js';\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @param {Function} executor The executor function.\n *\n * @returns {CancelToken}\n */\nclass CancelToken {\n constructor(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n let resolvePromise;\n\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n const token = this;\n\n // eslint-disable-next-line func-names\n this.promise.then(cancel => {\n if (!token._listeners) return;\n\n let i = token._listeners.length;\n\n while (i-- > 0) {\n token._listeners[i](cancel);\n }\n token._listeners = null;\n });\n\n // eslint-disable-next-line func-names\n this.promise.then = onfulfilled => {\n let _resolve;\n // eslint-disable-next-line func-names\n const promise = new Promise(resolve => {\n token.subscribe(resolve);\n _resolve = resolve;\n }).then(onfulfilled);\n\n promise.cancel = function reject() {\n token.unsubscribe(_resolve);\n };\n\n return promise;\n };\n\n executor(function cancel(message, config, request) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new CanceledError(message, config, request);\n resolvePromise(token.reason);\n });\n }\n\n /**\n * Throws a `CanceledError` if cancellation has been requested.\n */\n throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n }\n\n /**\n * Subscribe to the cancel signal\n */\n\n subscribe(listener) {\n if (this.reason) {\n listener(this.reason);\n return;\n }\n\n if (this._listeners) {\n this._listeners.push(listener);\n } else {\n this._listeners = [listener];\n }\n }\n\n /**\n * Unsubscribe from the cancel signal\n */\n\n unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n const index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n }\n\n /**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\n static source() {\n let cancel;\n const token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token,\n cancel\n };\n }\n}\n\nexport default CancelToken;\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n *\n * @returns {Function}\n */\nexport default function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n *\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nexport default function isAxiosError(payload) {\n return utils.isObject(payload) && (payload.isAxiosError === true);\n}\n","const HttpStatusCode = {\n Continue: 100,\n SwitchingProtocols: 101,\n Processing: 102,\n EarlyHints: 103,\n Ok: 200,\n Created: 201,\n Accepted: 202,\n NonAuthoritativeInformation: 203,\n NoContent: 204,\n ResetContent: 205,\n PartialContent: 206,\n MultiStatus: 207,\n AlreadyReported: 208,\n ImUsed: 226,\n MultipleChoices: 300,\n MovedPermanently: 301,\n Found: 302,\n SeeOther: 303,\n NotModified: 304,\n UseProxy: 305,\n Unused: 306,\n TemporaryRedirect: 307,\n PermanentRedirect: 308,\n BadRequest: 400,\n Unauthorized: 401,\n PaymentRequired: 402,\n Forbidden: 403,\n NotFound: 404,\n MethodNotAllowed: 405,\n NotAcceptable: 406,\n ProxyAuthenticationRequired: 407,\n RequestTimeout: 408,\n Conflict: 409,\n Gone: 410,\n LengthRequired: 411,\n PreconditionFailed: 412,\n PayloadTooLarge: 413,\n UriTooLong: 414,\n UnsupportedMediaType: 415,\n RangeNotSatisfiable: 416,\n ExpectationFailed: 417,\n ImATeapot: 418,\n MisdirectedRequest: 421,\n UnprocessableEntity: 422,\n Locked: 423,\n FailedDependency: 424,\n TooEarly: 425,\n UpgradeRequired: 426,\n PreconditionRequired: 428,\n TooManyRequests: 429,\n RequestHeaderFieldsTooLarge: 431,\n UnavailableForLegalReasons: 451,\n InternalServerError: 500,\n NotImplemented: 501,\n BadGateway: 502,\n ServiceUnavailable: 503,\n GatewayTimeout: 504,\n HttpVersionNotSupported: 505,\n VariantAlsoNegotiates: 506,\n InsufficientStorage: 507,\n LoopDetected: 508,\n NotExtended: 510,\n NetworkAuthenticationRequired: 511,\n};\n\nObject.entries(HttpStatusCode).forEach(([key, value]) => {\n HttpStatusCode[value] = key;\n});\n\nexport default HttpStatusCode;\n","'use strict';\n\nimport utils from './utils.js';\nimport bind from './helpers/bind.js';\nimport Axios from './core/Axios.js';\nimport mergeConfig from './core/mergeConfig.js';\nimport defaults from './defaults/index.js';\nimport formDataToJSON from './helpers/formDataToJSON.js';\nimport CanceledError from './cancel/CanceledError.js';\nimport CancelToken from './cancel/CancelToken.js';\nimport isCancel from './cancel/isCancel.js';\nimport {VERSION} from './env/data.js';\nimport toFormData from './helpers/toFormData.js';\nimport AxiosError from './core/AxiosError.js';\nimport spread from './helpers/spread.js';\nimport isAxiosError from './helpers/isAxiosError.js';\nimport AxiosHeaders from \"./core/AxiosHeaders.js\";\nimport adapters from './adapters/adapters.js';\nimport HttpStatusCode from './helpers/HttpStatusCode.js';\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n *\n * @returns {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n const context = new Axios(defaultConfig);\n const instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context, {allOwnKeys: true});\n\n // Copy context to instance\n utils.extend(instance, context, null, {allOwnKeys: true});\n\n // Factory for creating new instances\n instance.create = function create(instanceConfig) {\n return createInstance(mergeConfig(defaultConfig, instanceConfig));\n };\n\n return instance;\n}\n\n// Create the default instance to be exported\nconst axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Expose Cancel & CancelToken\naxios.CanceledError = CanceledError;\naxios.CancelToken = CancelToken;\naxios.isCancel = isCancel;\naxios.VERSION = VERSION;\naxios.toFormData = toFormData;\n\n// Expose AxiosError class\naxios.AxiosError = AxiosError;\n\n// alias for CanceledError for backward compatibility\naxios.Cancel = axios.CanceledError;\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\n\naxios.spread = spread;\n\n// Expose isAxiosError\naxios.isAxiosError = isAxiosError;\n\n// Expose mergeConfig\naxios.mergeConfig = mergeConfig;\n\naxios.AxiosHeaders = AxiosHeaders;\n\naxios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);\n\naxios.getAdapter = adapters.getAdapter;\n\naxios.HttpStatusCode = HttpStatusCode;\n\naxios.default = axios;\n\n// this module should only have a default export\nexport default axios\n"],"names":["utils","prototype","PlatformFormData","encode","url","FormData","platform","defaults","AxiosHeaders","stream","TextEncoder","readBlob","Readable","zlib","followRedirects","getProxyForUrl","callbackify","EventEmitter","formDataToStream","util","AxiosTransformStream","https","http","ZlibHeaderTransformStream","validators","InterceptorManager","Axios","CancelToken","HttpStatusCode"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAEe,SAAS,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE;AAC1C,EAAE,OAAO,SAAS,IAAI,GAAG;AACzB,IAAI,OAAO,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;AACxC,GAAG,CAAC;AACJ;;ACFA;AACA;AACA,MAAM,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC,SAAS,CAAC;AACpC,MAAM,CAAC,cAAc,CAAC,GAAG,MAAM,CAAC;AAChC;AACA,MAAM,MAAM,GAAG,CAAC,KAAK,IAAI,KAAK,IAAI;AAClC,IAAI,MAAM,GAAG,GAAG,QAAQ,CAAC,IAA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AC,UAAU,GAAG,UAAU,CAAC;AAC9B;AACA;AACA,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,aAAa,CAAC;AACnC;AACA;AACA,KAAK,CAAC,GAAG,GAAG,SAAS,GAAG,CAAC,QAAQ,EAAE;AACnC,EAAE,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC/B,CAAC,CAAC;AACF;AACA,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;AACtB;AACA;AACA,KAAK,CAAC,YAAY,GAAG,YAAY,CAAC;AAClC;AACA;AACA,KAAK,CAAC,WAAW,GAAG,WAAW,CAAC;AAChC;AACA,KAAK,CAAC,YAAY,GAAGnB,cAAY,CAAC;AAClC;AACA,KAAK,CAAC,UAAU,GAAG,KAAK,IAAI,cAAc,CAACR,OAAK,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,IAAI,QAAQ,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,CAAC;AAClG;AACA,KAAK,CAAC,UAAU,GAAG,QAAQ,CAAC,UAAU,CAAC;AACvC;AACA,KAAK,CAAC,cAAc,GAAG4B,gBAAc,CAAC;AACtC;AACA,KAAK,CAAC,OAAO,GAAG,KAAK;;;;"} \ No newline at end of file
diff --git a/node_modules/axios/index.d.cts b/node_modules/axios/index.d.cts
new file mode 100644
index 0000000..d95e6ef
--- /dev/null
+++ b/node_modules/axios/index.d.cts
@@ -0,0 +1,542 @@
+interface RawAxiosHeaders {
+ [key: string]: axios.AxiosHeaderValue;
+}
+
+type MethodsHeaders = Partial<{
+ [Key in axios.Method as Lowercase<Key>]: AxiosHeaders;
+} & {common: AxiosHeaders}>;
+
+type AxiosHeaderMatcher = (this: AxiosHeaders, value: string, name: string, headers: RawAxiosHeaders) => boolean;
+
+type AxiosHeaderParser = (this: AxiosHeaders, value: axios.AxiosHeaderValue, header: string) => any;
+
+type CommonRequestHeadersList = 'Accept' | 'Content-Length' | 'User-Agent'| 'Content-Encoding' | 'Authorization';
+
+type ContentType = axios.AxiosHeaderValue | 'text/html' | 'text/plain' | 'multipart/form-data' | 'application/json' | 'application/x-www-form-urlencoded' | 'application/octet-stream';
+
+type CommonResponseHeadersList = 'Server' | 'Content-Type' | 'Content-Length' | 'Cache-Control'| 'Content-Encoding';
+
+declare class AxiosHeaders {
+ constructor(
+ headers?: RawAxiosHeaders | AxiosHeaders | string
+ );
+
+ [key: string]: any;
+
+ set(headerName?: string, value?: axios.AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
+ set(headers?: RawAxiosHeaders | AxiosHeaders | string, rewrite?: boolean): AxiosHeaders;
+
+ get(headerName: string, parser: RegExp): RegExpExecArray | null;
+ get(headerName: string, matcher?: true | AxiosHeaderParser): axios.AxiosHeaderValue;
+
+ has(header: string, matcher?: AxiosHeaderMatcher): boolean;
+
+ delete(header: string | string[], matcher?: AxiosHeaderMatcher): boolean;
+
+ clear(matcher?: AxiosHeaderMatcher): boolean;
+
+ normalize(format: boolean): AxiosHeaders;
+
+ concat(...targets: Array<AxiosHeaders | RawAxiosHeaders | string | undefined | null>): AxiosHeaders;
+
+ toJSON(asStrings?: boolean): RawAxiosHeaders;
+
+ static from(thing?: AxiosHeaders | RawAxiosHeaders | string): AxiosHeaders;
+
+ static accessor(header: string | string[]): AxiosHeaders;
+
+ static concat(...targets: Array<AxiosHeaders | RawAxiosHeaders | string | undefined | null>): AxiosHeaders;
+
+ setContentType(value: ContentType, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
+ getContentType(parser?: RegExp): RegExpExecArray | null;
+ getContentType(matcher?: AxiosHeaderMatcher): axios.AxiosHeaderValue;
+ hasContentType(matcher?: AxiosHeaderMatcher): boolean;
+
+ setContentLength(value: axios.AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
+ getContentLength(parser?: RegExp): RegExpExecArray | null;
+ getContentLength(matcher?: AxiosHeaderMatcher): axios.AxiosHeaderValue;
+ hasContentLength(matcher?: AxiosHeaderMatcher): boolean;
+
+ setAccept(value: axios.AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
+ getAccept(parser?: RegExp): RegExpExecArray | null;
+ getAccept(matcher?: AxiosHeaderMatcher): axios.AxiosHeaderValue;
+ hasAccept(matcher?: AxiosHeaderMatcher): boolean;
+
+ setUserAgent(value: axios.AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
+ getUserAgent(parser?: RegExp): RegExpExecArray | null;
+ getUserAgent(matcher?: AxiosHeaderMatcher): axios.AxiosHeaderValue;
+ hasUserAgent(matcher?: AxiosHeaderMatcher): boolean;
+
+ setContentEncoding(value: axios.AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
+ getContentEncoding(parser?: RegExp): RegExpExecArray | null;
+ getContentEncoding(matcher?: AxiosHeaderMatcher): axios.AxiosHeaderValue;
+ hasContentEncoding(matcher?: AxiosHeaderMatcher): boolean;
+
+ setAuthorization(value: axios.AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
+ getAuthorization(parser?: RegExp): RegExpExecArray | null;
+ getAuthorization(matcher?: AxiosHeaderMatcher): axios.AxiosHeaderValue;
+ hasAuthorization(matcher?: AxiosHeaderMatcher): boolean;
+
+ [Symbol.iterator](): IterableIterator<[string, axios.AxiosHeaderValue]>;
+}
+
+declare class AxiosError<T = unknown, D = any> extends Error {
+ constructor(
+ message?: string,
+ code?: string,
+ config?: axios.InternalAxiosRequestConfig<D>,
+ request?: any,
+ response?: axios.AxiosResponse<T, D>
+ );
+
+ config?: axios.InternalAxiosRequestConfig<D>;
+ code?: string;
+ request?: any;
+ response?: axios.AxiosResponse<T, D>;
+ isAxiosError: boolean;
+ status?: number;
+ toJSON: () => object;
+ cause?: Error;
+ static readonly ERR_FR_TOO_MANY_REDIRECTS = "ERR_FR_TOO_MANY_REDIRECTS";
+ static readonly ERR_BAD_OPTION_VALUE = "ERR_BAD_OPTION_VALUE";
+ static readonly ERR_BAD_OPTION = "ERR_BAD_OPTION";
+ static readonly ERR_NETWORK = "ERR_NETWORK";
+ static readonly ERR_DEPRECATED = "ERR_DEPRECATED";
+ static readonly ERR_BAD_RESPONSE = "ERR_BAD_RESPONSE";
+ static readonly ERR_BAD_REQUEST = "ERR_BAD_REQUEST";
+ static readonly ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT";
+ static readonly ERR_INVALID_URL = "ERR_INVALID_URL";
+ static readonly ERR_CANCELED = "ERR_CANCELED";
+ static readonly ECONNABORTED = "ECONNABORTED";
+ static readonly ETIMEDOUT = "ETIMEDOUT";
+}
+
+declare class CanceledError<T> extends AxiosError<T> {
+}
+
+declare class Axios {
+ constructor(config?: axios.AxiosRequestConfig);
+ defaults: axios.AxiosDefaults;
+ interceptors: {
+ request: axios.AxiosInterceptorManager<axios.InternalAxiosRequestConfig>;
+ response: axios.AxiosInterceptorManager<axios.AxiosResponse>;
+ };
+ getUri(config?: axios.AxiosRequestConfig): string;
+ request<T = any, R = axios.AxiosResponse<T>, D = any>(config: axios.AxiosRequestConfig<D>): Promise<R>;
+ get<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, config?: axios.AxiosRequestConfig<D>): Promise<R>;
+ delete<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, config?: axios.AxiosRequestConfig<D>): Promise<R>;
+ head<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, config?: axios.AxiosRequestConfig<D>): Promise<R>;
+ options<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, config?: axios.AxiosRequestConfig<D>): Promise<R>;
+ post<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, data?: D, config?: axios.AxiosRequestConfig<D>): Promise<R>;
+ put<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, data?: D, config?: axios.AxiosRequestConfig<D>): Promise<R>;
+ patch<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, data?: D, config?: axios.AxiosRequestConfig<D>): Promise<R>;
+ postForm<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, data?: D, config?: axios.AxiosRequestConfig<D>): Promise<R>;
+ putForm<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, data?: D, config?: axios.AxiosRequestConfig<D>): Promise<R>;
+ patchForm<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, data?: D, config?: axios.AxiosRequestConfig<D>): Promise<R>;
+}
+
+declare enum HttpStatusCode {
+ Continue = 100,
+ SwitchingProtocols = 101,
+ Processing = 102,
+ EarlyHints = 103,
+ Ok = 200,
+ Created = 201,
+ Accepted = 202,
+ NonAuthoritativeInformation = 203,
+ NoContent = 204,
+ ResetContent = 205,
+ PartialContent = 206,
+ MultiStatus = 207,
+ AlreadyReported = 208,
+ ImUsed = 226,
+ MultipleChoices = 300,
+ MovedPermanently = 301,
+ Found = 302,
+ SeeOther = 303,
+ NotModified = 304,
+ UseProxy = 305,
+ Unused = 306,
+ TemporaryRedirect = 307,
+ PermanentRedirect = 308,
+ BadRequest = 400,
+ Unauthorized = 401,
+ PaymentRequired = 402,
+ Forbidden = 403,
+ NotFound = 404,
+ MethodNotAllowed = 405,
+ NotAcceptable = 406,
+ ProxyAuthenticationRequired = 407,
+ RequestTimeout = 408,
+ Conflict = 409,
+ Gone = 410,
+ LengthRequired = 411,
+ PreconditionFailed = 412,
+ PayloadTooLarge = 413,
+ UriTooLong = 414,
+ UnsupportedMediaType = 415,
+ RangeNotSatisfiable = 416,
+ ExpectationFailed = 417,
+ ImATeapot = 418,
+ MisdirectedRequest = 421,
+ UnprocessableEntity = 422,
+ Locked = 423,
+ FailedDependency = 424,
+ TooEarly = 425,
+ UpgradeRequired = 426,
+ PreconditionRequired = 428,
+ TooManyRequests = 429,
+ RequestHeaderFieldsTooLarge = 431,
+ UnavailableForLegalReasons = 451,
+ InternalServerError = 500,
+ NotImplemented = 501,
+ BadGateway = 502,
+ ServiceUnavailable = 503,
+ GatewayTimeout = 504,
+ HttpVersionNotSupported = 505,
+ VariantAlsoNegotiates = 506,
+ InsufficientStorage = 507,
+ LoopDetected = 508,
+ NotExtended = 510,
+ NetworkAuthenticationRequired = 511,
+}
+
+type InternalAxiosError<T = unknown, D = any> = AxiosError<T, D>;
+
+declare namespace axios {
+ type AxiosError<T = unknown, D = any> = InternalAxiosError<T, D>;
+
+ type RawAxiosRequestHeaders = Partial<RawAxiosHeaders & {
+ [Key in CommonRequestHeadersList]: AxiosHeaderValue;
+ } & {
+ 'Content-Type': ContentType
+ }>;
+
+ type AxiosRequestHeaders = RawAxiosRequestHeaders & AxiosHeaders;
+
+ type AxiosHeaderValue = AxiosHeaders | string | string[] | number | boolean | null;
+
+ type RawCommonResponseHeaders = {
+ [Key in CommonResponseHeadersList]: AxiosHeaderValue;
+ } & {
+ "set-cookie": string[];
+ };
+
+ type RawAxiosResponseHeaders = Partial<RawAxiosHeaders & RawCommonResponseHeaders>;
+
+ type AxiosResponseHeaders = RawAxiosResponseHeaders & AxiosHeaders;
+
+ interface AxiosRequestTransformer {
+ (this: InternalAxiosRequestConfig, data: any, headers: AxiosRequestHeaders): any;
+ }
+
+ interface AxiosResponseTransformer {
+ (this: InternalAxiosRequestConfig, data: any, headers: AxiosResponseHeaders, status?: number): any;
+ }
+
+ interface AxiosAdapter {
+ (config: InternalAxiosRequestConfig): AxiosPromise;
+ }
+
+ interface AxiosBasicCredentials {
+ username: string;
+ password: string;
+ }
+
+ interface AxiosProxyConfig {
+ host: string;
+ port: number;
+ auth?: AxiosBasicCredentials;
+ protocol?: string;
+ }
+
+ type Method =
+ | 'get' | 'GET'
+ | 'delete' | 'DELETE'
+ | 'head' | 'HEAD'
+ | 'options' | 'OPTIONS'
+ | 'post' | 'POST'
+ | 'put' | 'PUT'
+ | 'patch' | 'PATCH'
+ | 'purge' | 'PURGE'
+ | 'link' | 'LINK'
+ | 'unlink' | 'UNLINK';
+
+ type ResponseType =
+ | 'arraybuffer'
+ | 'blob'
+ | 'document'
+ | 'json'
+ | 'text'
+ | 'stream';
+
+ type responseEncoding =
+ | 'ascii' | 'ASCII'
+ | 'ansi' | 'ANSI'
+ | 'binary' | 'BINARY'
+ | 'base64' | 'BASE64'
+ | 'base64url' | 'BASE64URL'
+ | 'hex' | 'HEX'
+ | 'latin1' | 'LATIN1'
+ | 'ucs-2' | 'UCS-2'
+ | 'ucs2' | 'UCS2'
+ | 'utf-8' | 'UTF-8'
+ | 'utf8' | 'UTF8'
+ | 'utf16le' | 'UTF16LE';
+
+ interface TransitionalOptions {
+ silentJSONParsing?: boolean;
+ forcedJSONParsing?: boolean;
+ clarifyTimeoutError?: boolean;
+ }
+
+ interface GenericAbortSignal {
+ readonly aborted: boolean;
+ onabort?: ((...args: any) => any) | null;
+ addEventListener?: (...args: any) => any;
+ removeEventListener?: (...args: any) => any;
+ }
+
+ interface FormDataVisitorHelpers {
+ defaultVisitor: SerializerVisitor;
+ convertValue: (value: any) => any;
+ isVisitable: (value: any) => boolean;
+ }
+
+ interface SerializerVisitor {
+ (
+ this: GenericFormData,
+ value: any,
+ key: string | number,
+ path: null | Array<string | number>,
+ helpers: FormDataVisitorHelpers
+ ): boolean;
+ }
+
+ interface SerializerOptions {
+ visitor?: SerializerVisitor;
+ dots?: boolean;
+ metaTokens?: boolean;
+ indexes?: boolean | null;
+ }
+
+ // tslint:disable-next-line
+ interface FormSerializerOptions extends SerializerOptions {
+ }
+
+ interface ParamEncoder {
+ (value: any, defaultEncoder: (value: any) => any): any;
+ }
+
+ interface CustomParamsSerializer {
+ (params: Record<string, any>, options?: ParamsSerializerOptions): string;
+ }
+
+ interface ParamsSerializerOptions extends SerializerOptions {
+ encode?: ParamEncoder;
+ serialize?: CustomParamsSerializer;
+ }
+
+ type MaxUploadRate = number;
+
+ type MaxDownloadRate = number;
+
+ type BrowserProgressEvent = any;
+
+ interface AxiosProgressEvent {
+ loaded: number;
+ total?: number;
+ progress?: number;
+ bytes: number;
+ rate?: number;
+ estimated?: number;
+ upload?: boolean;
+ download?: boolean;
+ event?: BrowserProgressEvent;
+ }
+
+ type Milliseconds = number;
+
+ type AxiosAdapterName = 'xhr' | 'http' | string;
+
+ type AxiosAdapterConfig = AxiosAdapter | AxiosAdapterName;
+
+ type AddressFamily = 4 | 6 | undefined;
+
+ interface LookupAddressEntry {
+ address: string;
+ family?: AddressFamily;
+ }
+
+ type LookupAddress = string | LookupAddressEntry;
+
+ interface AxiosRequestConfig<D = any> {
+ url?: string;
+ method?: Method | string;
+ baseURL?: string;
+ transformRequest?: AxiosRequestTransformer | AxiosRequestTransformer[];
+ transformResponse?: AxiosResponseTransformer | AxiosResponseTransformer[];
+ headers?: (RawAxiosRequestHeaders & MethodsHeaders) | AxiosHeaders;
+ params?: any;
+ paramsSerializer?: ParamsSerializerOptions | CustomParamsSerializer;
+ data?: D;
+ timeout?: Milliseconds;
+ timeoutErrorMessage?: string;
+ withCredentials?: boolean;
+ adapter?: AxiosAdapterConfig | AxiosAdapterConfig[];
+ auth?: AxiosBasicCredentials;
+ responseType?: ResponseType;
+ responseEncoding?: responseEncoding | string;
+ xsrfCookieName?: string;
+ xsrfHeaderName?: string;
+ onUploadProgress?: (progressEvent: AxiosProgressEvent) => void;
+ onDownloadProgress?: (progressEvent: AxiosProgressEvent) => void;
+ maxContentLength?: number;
+ validateStatus?: ((status: number) => boolean) | null;
+ maxBodyLength?: number;
+ maxRedirects?: number;
+ maxRate?: number | [MaxUploadRate, MaxDownloadRate];
+ beforeRedirect?: (options: Record<string, any>, responseDetails: {headers: Record<string, string>, statusCode: HttpStatusCode}) => void;
+ socketPath?: string | null;
+ transport?: any;
+ httpAgent?: any;
+ httpsAgent?: any;
+ proxy?: AxiosProxyConfig | false;
+ cancelToken?: CancelToken;
+ decompress?: boolean;
+ transitional?: TransitionalOptions;
+ signal?: GenericAbortSignal;
+ insecureHTTPParser?: boolean;
+ env?: {
+ FormData?: new (...args: any[]) => object;
+ };
+ formSerializer?: FormSerializerOptions;
+ family?: AddressFamily;
+ lookup?: ((hostname: string, options: object, cb: (err: Error | null, address: LookupAddress | LookupAddress[], family?: AddressFamily) => void) => void) |
+ ((hostname: string, options: object) => Promise<[address: LookupAddressEntry | LookupAddressEntry[], family?: AddressFamily] | LookupAddress>);
+ withXSRFToken?: boolean | ((config: InternalAxiosRequestConfig) => boolean | undefined);
+ }
+
+ // Alias
+ type RawAxiosRequestConfig<D = any> = AxiosRequestConfig<D>;
+
+ interface InternalAxiosRequestConfig<D = any> extends AxiosRequestConfig {
+ headers: AxiosRequestHeaders;
+ }
+
+ interface HeadersDefaults {
+ common: RawAxiosRequestHeaders;
+ delete: RawAxiosRequestHeaders;
+ get: RawAxiosRequestHeaders;
+ head: RawAxiosRequestHeaders;
+ post: RawAxiosRequestHeaders;
+ put: RawAxiosRequestHeaders;
+ patch: RawAxiosRequestHeaders;
+ options?: RawAxiosRequestHeaders;
+ purge?: RawAxiosRequestHeaders;
+ link?: RawAxiosRequestHeaders;
+ unlink?: RawAxiosRequestHeaders;
+ }
+
+ interface AxiosDefaults<D = any> extends Omit<AxiosRequestConfig<D>, 'headers'> {
+ headers: HeadersDefaults;
+ }
+
+ interface CreateAxiosDefaults<D = any> extends Omit<AxiosRequestConfig<D>, 'headers'> {
+ headers?: RawAxiosRequestHeaders | AxiosHeaders | Partial<HeadersDefaults>;
+ }
+
+ interface AxiosResponse<T = any, D = any> {
+ data: T;
+ status: number;
+ statusText: string;
+ headers: RawAxiosResponseHeaders | AxiosResponseHeaders;
+ config: InternalAxiosRequestConfig<D>;
+ request?: any;
+ }
+
+ type AxiosPromise<T = any> = Promise<AxiosResponse<T>>;
+
+ interface CancelStatic {
+ new (message?: string): Cancel;
+ }
+
+ interface Cancel {
+ message: string | undefined;
+ }
+
+ interface Canceler {
+ (message?: string, config?: AxiosRequestConfig, request?: any): void;
+ }
+
+ interface CancelTokenStatic {
+ new (executor: (cancel: Canceler) => void): CancelToken;
+ source(): CancelTokenSource;
+ }
+
+ interface CancelToken {
+ promise: Promise<Cancel>;
+ reason?: Cancel;
+ throwIfRequested(): void;
+ }
+
+ interface CancelTokenSource {
+ token: CancelToken;
+ cancel: Canceler;
+ }
+
+ interface AxiosInterceptorOptions {
+ synchronous?: boolean;
+ runWhen?: (config: InternalAxiosRequestConfig) => boolean;
+ }
+
+ interface AxiosInterceptorManager<V> {
+ use(onFulfilled?: (value: V) => V | Promise<V>, onRejected?: (error: any) => any, options?: AxiosInterceptorOptions): number;
+ eject(id: number): void;
+ clear(): void;
+ }
+
+ interface AxiosInstance extends Axios {
+ <T = any, R = AxiosResponse<T>, D = any>(config: AxiosRequestConfig<D>): Promise<R>;
+ <T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>;
+
+ defaults: Omit<AxiosDefaults, 'headers'> & {
+ headers: HeadersDefaults & {
+ [key: string]: AxiosHeaderValue
+ }
+ };
+ }
+
+ interface GenericFormData {
+ append(name: string, value: any, options?: any): any;
+ }
+
+ interface GenericHTMLFormElement {
+ name: string;
+ method: string;
+ submit(): void;
+ }
+
+ interface AxiosStatic extends AxiosInstance {
+ create(config?: CreateAxiosDefaults): AxiosInstance;
+ Cancel: CancelStatic;
+ CancelToken: CancelTokenStatic;
+ Axios: typeof Axios;
+ AxiosError: typeof AxiosError;
+ CanceledError: typeof CanceledError;
+ HttpStatusCode: typeof HttpStatusCode;
+ readonly VERSION: string;
+ isCancel(value: any): value is Cancel;
+ all<T>(values: Array<T | Promise<T>>): Promise<T[]>;
+ spread<T, R>(callback: (...args: T[]) => R): (array: T[]) => R;
+ isAxiosError<T = any, D = any>(payload: any): payload is AxiosError<T, D>;
+ toFormData(sourceObj: object, targetFormData?: GenericFormData, options?: FormSerializerOptions): GenericFormData;
+ formToJSON(form: GenericFormData|GenericHTMLFormElement): object;
+ getAdapter(adapters: AxiosAdapterConfig | AxiosAdapterConfig[] | undefined): AxiosAdapter;
+ AxiosHeaders: typeof AxiosHeaders;
+ }
+}
+
+declare const axios: axios.AxiosStatic;
+
+export = axios;
diff --git a/node_modules/axios/index.d.ts b/node_modules/axios/index.d.ts
new file mode 100644
index 0000000..02a8c09
--- /dev/null
+++ b/node_modules/axios/index.d.ts
@@ -0,0 +1,559 @@
+// TypeScript Version: 4.7
+export type AxiosHeaderValue = AxiosHeaders | string | string[] | number | boolean | null;
+
+interface RawAxiosHeaders {
+ [key: string]: AxiosHeaderValue;
+}
+
+type MethodsHeaders = Partial<{
+ [Key in Method as Lowercase<Key>]: AxiosHeaders;
+} & {common: AxiosHeaders}>;
+
+type AxiosHeaderMatcher = string | RegExp | ((this: AxiosHeaders, value: string, name: string) => boolean);
+
+type AxiosHeaderParser = (this: AxiosHeaders, value: AxiosHeaderValue, header: string) => any;
+
+export class AxiosHeaders {
+ constructor(
+ headers?: RawAxiosHeaders | AxiosHeaders | string
+ );
+
+ [key: string]: any;
+
+ set(headerName?: string, value?: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
+ set(headers?: RawAxiosHeaders | AxiosHeaders | string, rewrite?: boolean): AxiosHeaders;
+
+ get(headerName: string, parser: RegExp): RegExpExecArray | null;
+ get(headerName: string, matcher?: true | AxiosHeaderParser): AxiosHeaderValue;
+
+ has(header: string, matcher?: AxiosHeaderMatcher): boolean;
+
+ delete(header: string | string[], matcher?: AxiosHeaderMatcher): boolean;
+
+ clear(matcher?: AxiosHeaderMatcher): boolean;
+
+ normalize(format: boolean): AxiosHeaders;
+
+ concat(...targets: Array<AxiosHeaders | RawAxiosHeaders | string | undefined | null>): AxiosHeaders;
+
+ toJSON(asStrings?: boolean): RawAxiosHeaders;
+
+ static from(thing?: AxiosHeaders | RawAxiosHeaders | string): AxiosHeaders;
+
+ static accessor(header: string | string[]): AxiosHeaders;
+
+ static concat(...targets: Array<AxiosHeaders | RawAxiosHeaders | string | undefined | null>): AxiosHeaders;
+
+ setContentType(value: ContentType, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
+ getContentType(parser?: RegExp): RegExpExecArray | null;
+ getContentType(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
+ hasContentType(matcher?: AxiosHeaderMatcher): boolean;
+
+ setContentLength(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
+ getContentLength(parser?: RegExp): RegExpExecArray | null;
+ getContentLength(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
+ hasContentLength(matcher?: AxiosHeaderMatcher): boolean;
+
+ setAccept(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
+ getAccept(parser?: RegExp): RegExpExecArray | null;
+ getAccept(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
+ hasAccept(matcher?: AxiosHeaderMatcher): boolean;
+
+ setUserAgent(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
+ getUserAgent(parser?: RegExp): RegExpExecArray | null;
+ getUserAgent(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
+ hasUserAgent(matcher?: AxiosHeaderMatcher): boolean;
+
+ setContentEncoding(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
+ getContentEncoding(parser?: RegExp): RegExpExecArray | null;
+ getContentEncoding(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
+ hasContentEncoding(matcher?: AxiosHeaderMatcher): boolean;
+
+ setAuthorization(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
+ getAuthorization(parser?: RegExp): RegExpExecArray | null;
+ getAuthorization(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
+ hasAuthorization(matcher?: AxiosHeaderMatcher): boolean;
+
+ [Symbol.iterator](): IterableIterator<[string, AxiosHeaderValue]>;
+}
+
+type CommonRequestHeadersList = 'Accept' | 'Content-Length' | 'User-Agent' | 'Content-Encoding' | 'Authorization';
+
+type ContentType = AxiosHeaderValue | 'text/html' | 'text/plain' | 'multipart/form-data' | 'application/json' | 'application/x-www-form-urlencoded' | 'application/octet-stream';
+
+export type RawAxiosRequestHeaders = Partial<RawAxiosHeaders & {
+ [Key in CommonRequestHeadersList]: AxiosHeaderValue;
+} & {
+ 'Content-Type': ContentType
+}>;
+
+export type AxiosRequestHeaders = RawAxiosRequestHeaders & AxiosHeaders;
+
+type CommonResponseHeadersList = 'Server' | 'Content-Type' | 'Content-Length' | 'Cache-Control'| 'Content-Encoding';
+
+type RawCommonResponseHeaders = {
+ [Key in CommonResponseHeadersList]: AxiosHeaderValue;
+} & {
+ "set-cookie": string[];
+};
+
+export type RawAxiosResponseHeaders = Partial<RawAxiosHeaders & RawCommonResponseHeaders>;
+
+export type AxiosResponseHeaders = RawAxiosResponseHeaders & AxiosHeaders;
+
+export interface AxiosRequestTransformer {
+ (this: InternalAxiosRequestConfig, data: any, headers: AxiosRequestHeaders): any;
+}
+
+export interface AxiosResponseTransformer {
+ (this: InternalAxiosRequestConfig, data: any, headers: AxiosResponseHeaders, status?: number): any;
+}
+
+export interface AxiosAdapter {
+ (config: InternalAxiosRequestConfig): AxiosPromise;
+}
+
+export interface AxiosBasicCredentials {
+ username: string;
+ password: string;
+}
+
+export interface AxiosProxyConfig {
+ host: string;
+ port: number;
+ auth?: AxiosBasicCredentials;
+ protocol?: string;
+}
+
+export enum HttpStatusCode {
+ Continue = 100,
+ SwitchingProtocols = 101,
+ Processing = 102,
+ EarlyHints = 103,
+ Ok = 200,
+ Created = 201,
+ Accepted = 202,
+ NonAuthoritativeInformation = 203,
+ NoContent = 204,
+ ResetContent = 205,
+ PartialContent = 206,
+ MultiStatus = 207,
+ AlreadyReported = 208,
+ ImUsed = 226,
+ MultipleChoices = 300,
+ MovedPermanently = 301,
+ Found = 302,
+ SeeOther = 303,
+ NotModified = 304,
+ UseProxy = 305,
+ Unused = 306,
+ TemporaryRedirect = 307,
+ PermanentRedirect = 308,
+ BadRequest = 400,
+ Unauthorized = 401,
+ PaymentRequired = 402,
+ Forbidden = 403,
+ NotFound = 404,
+ MethodNotAllowed = 405,
+ NotAcceptable = 406,
+ ProxyAuthenticationRequired = 407,
+ RequestTimeout = 408,
+ Conflict = 409,
+ Gone = 410,
+ LengthRequired = 411,
+ PreconditionFailed = 412,
+ PayloadTooLarge = 413,
+ UriTooLong = 414,
+ UnsupportedMediaType = 415,
+ RangeNotSatisfiable = 416,
+ ExpectationFailed = 417,
+ ImATeapot = 418,
+ MisdirectedRequest = 421,
+ UnprocessableEntity = 422,
+ Locked = 423,
+ FailedDependency = 424,
+ TooEarly = 425,
+ UpgradeRequired = 426,
+ PreconditionRequired = 428,
+ TooManyRequests = 429,
+ RequestHeaderFieldsTooLarge = 431,
+ UnavailableForLegalReasons = 451,
+ InternalServerError = 500,
+ NotImplemented = 501,
+ BadGateway = 502,
+ ServiceUnavailable = 503,
+ GatewayTimeout = 504,
+ HttpVersionNotSupported = 505,
+ VariantAlsoNegotiates = 506,
+ InsufficientStorage = 507,
+ LoopDetected = 508,
+ NotExtended = 510,
+ NetworkAuthenticationRequired = 511,
+}
+
+export type Method =
+ | 'get' | 'GET'
+ | 'delete' | 'DELETE'
+ | 'head' | 'HEAD'
+ | 'options' | 'OPTIONS'
+ | 'post' | 'POST'
+ | 'put' | 'PUT'
+ | 'patch' | 'PATCH'
+ | 'purge' | 'PURGE'
+ | 'link' | 'LINK'
+ | 'unlink' | 'UNLINK';
+
+export type ResponseType =
+ | 'arraybuffer'
+ | 'blob'
+ | 'document'
+ | 'json'
+ | 'text'
+ | 'stream';
+
+export type responseEncoding =
+ | 'ascii' | 'ASCII'
+ | 'ansi' | 'ANSI'
+ | 'binary' | 'BINARY'
+ | 'base64' | 'BASE64'
+ | 'base64url' | 'BASE64URL'
+ | 'hex' | 'HEX'
+ | 'latin1' | 'LATIN1'
+ | 'ucs-2' | 'UCS-2'
+ | 'ucs2' | 'UCS2'
+ | 'utf-8' | 'UTF-8'
+ | 'utf8' | 'UTF8'
+ | 'utf16le' | 'UTF16LE';
+
+export interface TransitionalOptions {
+ silentJSONParsing?: boolean;
+ forcedJSONParsing?: boolean;
+ clarifyTimeoutError?: boolean;
+}
+
+export interface GenericAbortSignal {
+ readonly aborted: boolean;
+ onabort?: ((...args: any) => any) | null;
+ addEventListener?: (...args: any) => any;
+ removeEventListener?: (...args: any) => any;
+}
+
+export interface FormDataVisitorHelpers {
+ defaultVisitor: SerializerVisitor;
+ convertValue: (value: any) => any;
+ isVisitable: (value: any) => boolean;
+}
+
+export interface SerializerVisitor {
+ (
+ this: GenericFormData,
+ value: any,
+ key: string | number,
+ path: null | Array<string | number>,
+ helpers: FormDataVisitorHelpers
+ ): boolean;
+}
+
+export interface SerializerOptions {
+ visitor?: SerializerVisitor;
+ dots?: boolean;
+ metaTokens?: boolean;
+ indexes?: boolean | null;
+}
+
+// tslint:disable-next-line
+export interface FormSerializerOptions extends SerializerOptions {
+}
+
+export interface ParamEncoder {
+ (value: any, defaultEncoder: (value: any) => any): any;
+}
+
+export interface CustomParamsSerializer {
+ (params: Record<string, any>, options?: ParamsSerializerOptions): string;
+}
+
+export interface ParamsSerializerOptions extends SerializerOptions {
+ encode?: ParamEncoder;
+ serialize?: CustomParamsSerializer;
+}
+
+type MaxUploadRate = number;
+
+type MaxDownloadRate = number;
+
+type BrowserProgressEvent = any;
+
+export interface AxiosProgressEvent {
+ loaded: number;
+ total?: number;
+ progress?: number;
+ bytes: number;
+ rate?: number;
+ estimated?: number;
+ upload?: boolean;
+ download?: boolean;
+ event?: BrowserProgressEvent;
+}
+
+type Milliseconds = number;
+
+type AxiosAdapterName = 'xhr' | 'http' | string;
+
+type AxiosAdapterConfig = AxiosAdapter | AxiosAdapterName;
+
+export type AddressFamily = 4 | 6 | undefined;
+
+export interface LookupAddressEntry {
+ address: string;
+ family?: AddressFamily;
+}
+
+export type LookupAddress = string | LookupAddressEntry;
+
+export interface AxiosRequestConfig<D = any> {
+ url?: string;
+ method?: Method | string;
+ baseURL?: string;
+ transformRequest?: AxiosRequestTransformer | AxiosRequestTransformer[];
+ transformResponse?: AxiosResponseTransformer | AxiosResponseTransformer[];
+ headers?: (RawAxiosRequestHeaders & MethodsHeaders) | AxiosHeaders;
+ params?: any;
+ paramsSerializer?: ParamsSerializerOptions | CustomParamsSerializer;
+ data?: D;
+ timeout?: Milliseconds;
+ timeoutErrorMessage?: string;
+ withCredentials?: boolean;
+ adapter?: AxiosAdapterConfig | AxiosAdapterConfig[];
+ auth?: AxiosBasicCredentials;
+ responseType?: ResponseType;
+ responseEncoding?: responseEncoding | string;
+ xsrfCookieName?: string;
+ xsrfHeaderName?: string;
+ onUploadProgress?: (progressEvent: AxiosProgressEvent) => void;
+ onDownloadProgress?: (progressEvent: AxiosProgressEvent) => void;
+ maxContentLength?: number;
+ validateStatus?: ((status: number) => boolean) | null;
+ maxBodyLength?: number;
+ maxRedirects?: number;
+ maxRate?: number | [MaxUploadRate, MaxDownloadRate];
+ beforeRedirect?: (options: Record<string, any>, responseDetails: {headers: Record<string, string>, statusCode: HttpStatusCode}) => void;
+ socketPath?: string | null;
+ transport?: any;
+ httpAgent?: any;
+ httpsAgent?: any;
+ proxy?: AxiosProxyConfig | false;
+ cancelToken?: CancelToken;
+ decompress?: boolean;
+ transitional?: TransitionalOptions;
+ signal?: GenericAbortSignal;
+ insecureHTTPParser?: boolean;
+ env?: {
+ FormData?: new (...args: any[]) => object;
+ };
+ formSerializer?: FormSerializerOptions;
+ family?: AddressFamily;
+ lookup?: ((hostname: string, options: object, cb: (err: Error | null, address: LookupAddress | LookupAddress[], family?: AddressFamily) => void) => void) |
+ ((hostname: string, options: object) => Promise<[address: LookupAddressEntry | LookupAddressEntry[], family?: AddressFamily] | LookupAddress>);
+ withXSRFToken?: boolean | ((config: InternalAxiosRequestConfig) => boolean | undefined);
+}
+
+// Alias
+export type RawAxiosRequestConfig<D = any> = AxiosRequestConfig<D>;
+
+export interface InternalAxiosRequestConfig<D = any> extends AxiosRequestConfig<D> {
+ headers: AxiosRequestHeaders;
+}
+
+export interface HeadersDefaults {
+ common: RawAxiosRequestHeaders;
+ delete: RawAxiosRequestHeaders;
+ get: RawAxiosRequestHeaders;
+ head: RawAxiosRequestHeaders;
+ post: RawAxiosRequestHeaders;
+ put: RawAxiosRequestHeaders;
+ patch: RawAxiosRequestHeaders;
+ options?: RawAxiosRequestHeaders;
+ purge?: RawAxiosRequestHeaders;
+ link?: RawAxiosRequestHeaders;
+ unlink?: RawAxiosRequestHeaders;
+}
+
+export interface AxiosDefaults<D = any> extends Omit<AxiosRequestConfig<D>, 'headers'> {
+ headers: HeadersDefaults;
+}
+
+export interface CreateAxiosDefaults<D = any> extends Omit<AxiosRequestConfig<D>, 'headers'> {
+ headers?: RawAxiosRequestHeaders | AxiosHeaders | Partial<HeadersDefaults>;
+}
+
+export interface AxiosResponse<T = any, D = any> {
+ data: T;
+ status: number;
+ statusText: string;
+ headers: RawAxiosResponseHeaders | AxiosResponseHeaders;
+ config: InternalAxiosRequestConfig<D>;
+ request?: any;
+}
+
+export class AxiosError<T = unknown, D = any> extends Error {
+ constructor(
+ message?: string,
+ code?: string,
+ config?: InternalAxiosRequestConfig<D>,
+ request?: any,
+ response?: AxiosResponse<T, D>
+ );
+
+ config?: InternalAxiosRequestConfig<D>;
+ code?: string;
+ request?: any;
+ response?: AxiosResponse<T, D>;
+ isAxiosError: boolean;
+ status?: number;
+ toJSON: () => object;
+ cause?: Error;
+ static from<T = unknown, D = any>(
+ error: Error | unknown,
+ code?: string,
+ config?: InternalAxiosRequestConfig<D>,
+ request?: any,
+ response?: AxiosResponse<T, D>,
+ customProps?: object,
+): AxiosError<T, D>;
+ static readonly ERR_FR_TOO_MANY_REDIRECTS = "ERR_FR_TOO_MANY_REDIRECTS";
+ static readonly ERR_BAD_OPTION_VALUE = "ERR_BAD_OPTION_VALUE";
+ static readonly ERR_BAD_OPTION = "ERR_BAD_OPTION";
+ static readonly ERR_NETWORK = "ERR_NETWORK";
+ static readonly ERR_DEPRECATED = "ERR_DEPRECATED";
+ static readonly ERR_BAD_RESPONSE = "ERR_BAD_RESPONSE";
+ static readonly ERR_BAD_REQUEST = "ERR_BAD_REQUEST";
+ static readonly ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT";
+ static readonly ERR_INVALID_URL = "ERR_INVALID_URL";
+ static readonly ERR_CANCELED = "ERR_CANCELED";
+ static readonly ECONNABORTED = "ECONNABORTED";
+ static readonly ETIMEDOUT = "ETIMEDOUT";
+}
+
+export class CanceledError<T> extends AxiosError<T> {
+}
+
+export type AxiosPromise<T = any> = Promise<AxiosResponse<T>>;
+
+export interface CancelStatic {
+ new (message?: string): Cancel;
+}
+
+export interface Cancel {
+ message: string | undefined;
+}
+
+export interface Canceler {
+ (message?: string, config?: AxiosRequestConfig, request?: any): void;
+}
+
+export interface CancelTokenStatic {
+ new (executor: (cancel: Canceler) => void): CancelToken;
+ source(): CancelTokenSource;
+}
+
+export interface CancelToken {
+ promise: Promise<Cancel>;
+ reason?: Cancel;
+ throwIfRequested(): void;
+}
+
+export interface CancelTokenSource {
+ token: CancelToken;
+ cancel: Canceler;
+}
+
+export interface AxiosInterceptorOptions {
+ synchronous?: boolean;
+ runWhen?: (config: InternalAxiosRequestConfig) => boolean;
+}
+
+export interface AxiosInterceptorManager<V> {
+ use(onFulfilled?: ((value: V) => V | Promise<V>) | null, onRejected?: ((error: any) => any) | null, options?: AxiosInterceptorOptions): number;
+ eject(id: number): void;
+ clear(): void;
+}
+
+export class Axios {
+ constructor(config?: AxiosRequestConfig);
+ defaults: AxiosDefaults;
+ interceptors: {
+ request: AxiosInterceptorManager<InternalAxiosRequestConfig>;
+ response: AxiosInterceptorManager<AxiosResponse>;
+ };
+ getUri(config?: AxiosRequestConfig): string;
+ request<T = any, R = AxiosResponse<T>, D = any>(config: AxiosRequestConfig<D>): Promise<R>;
+ get<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>;
+ delete<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>;
+ head<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>;
+ options<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>;
+ post<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
+ put<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
+ patch<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
+ postForm<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
+ putForm<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
+ patchForm<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
+}
+
+export interface AxiosInstance extends Axios {
+ <T = any, R = AxiosResponse<T>, D = any>(config: AxiosRequestConfig<D>): Promise<R>;
+ <T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>;
+
+ defaults: Omit<AxiosDefaults, 'headers'> & {
+ headers: HeadersDefaults & {
+ [key: string]: AxiosHeaderValue
+ }
+ };
+}
+
+export interface GenericFormData {
+ append(name: string, value: any, options?: any): any;
+}
+
+export interface GenericHTMLFormElement {
+ name: string;
+ method: string;
+ submit(): void;
+}
+
+export function getAdapter(adapters: AxiosAdapterConfig | AxiosAdapterConfig[] | undefined): AxiosAdapter;
+
+export function toFormData(sourceObj: object, targetFormData?: GenericFormData, options?: FormSerializerOptions): GenericFormData;
+
+export function formToJSON(form: GenericFormData|GenericHTMLFormElement): object;
+
+export function isAxiosError<T = any, D = any>(payload: any): payload is AxiosError<T, D>;
+
+export function spread<T, R>(callback: (...args: T[]) => R): (array: T[]) => R;
+
+export function isCancel(value: any): value is Cancel;
+
+export function all<T>(values: Array<T | Promise<T>>): Promise<T[]>;
+
+export interface AxiosStatic extends AxiosInstance {
+ create(config?: CreateAxiosDefaults): AxiosInstance;
+ Cancel: CancelStatic;
+ CancelToken: CancelTokenStatic;
+ Axios: typeof Axios;
+ AxiosError: typeof AxiosError;
+ HttpStatusCode: typeof HttpStatusCode;
+ readonly VERSION: string;
+ isCancel: typeof isCancel;
+ all: typeof all;
+ spread: typeof spread;
+ isAxiosError: typeof isAxiosError;
+ toFormData: typeof toFormData;
+ formToJSON: typeof formToJSON;
+ getAdapter: typeof getAdapter;
+ CanceledError: typeof CanceledError;
+ AxiosHeaders: typeof AxiosHeaders;
+}
+
+declare const axios: AxiosStatic;
+
+export default axios;
diff --git a/node_modules/axios/index.js b/node_modules/axios/index.js
new file mode 100644
index 0000000..fba3990
--- /dev/null
+++ b/node_modules/axios/index.js
@@ -0,0 +1,43 @@
+import axios from './lib/axios.js';
+
+// This module is intended to unwrap Axios default export as named.
+// Keep top-level export same with static properties
+// so that it can keep same with es module or cjs
+const {
+ Axios,
+ AxiosError,
+ CanceledError,
+ isCancel,
+ CancelToken,
+ VERSION,
+ all,
+ Cancel,
+ isAxiosError,
+ spread,
+ toFormData,
+ AxiosHeaders,
+ HttpStatusCode,
+ formToJSON,
+ getAdapter,
+ mergeConfig
+} = axios;
+
+export {
+ axios as default,
+ Axios,
+ AxiosError,
+ CanceledError,
+ isCancel,
+ CancelToken,
+ VERSION,
+ all,
+ Cancel,
+ isAxiosError,
+ spread,
+ toFormData,
+ AxiosHeaders,
+ HttpStatusCode,
+ formToJSON,
+ getAdapter,
+ mergeConfig
+}
diff --git a/node_modules/axios/lib/adapters/README.md b/node_modules/axios/lib/adapters/README.md
new file mode 100644
index 0000000..68f1118
--- /dev/null
+++ b/node_modules/axios/lib/adapters/README.md
@@ -0,0 +1,37 @@
+# axios // adapters
+
+The modules under `adapters/` are modules that handle dispatching a request and settling a returned `Promise` once a response is received.
+
+## Example
+
+```js
+var settle = require('./../core/settle');
+
+module.exports = function myAdapter(config) {
+ // At this point:
+ // - config has been merged with defaults
+ // - request transformers have already run
+ // - request interceptors have already run
+
+ // Make the request using config provided
+ // Upon response settle the Promise
+
+ return new Promise(function(resolve, reject) {
+
+ var response = {
+ data: responseData,
+ status: request.status,
+ statusText: request.statusText,
+ headers: responseHeaders,
+ config: config,
+ request: request
+ };
+
+ settle(resolve, reject, response);
+
+ // From here:
+ // - response transformers will run
+ // - response interceptors will run
+ });
+}
+```
diff --git a/node_modules/axios/lib/adapters/adapters.js b/node_modules/axios/lib/adapters/adapters.js
new file mode 100644
index 0000000..550997d
--- /dev/null
+++ b/node_modules/axios/lib/adapters/adapters.js
@@ -0,0 +1,77 @@
+import utils from '../utils.js';
+import httpAdapter from './http.js';
+import xhrAdapter from './xhr.js';
+import AxiosError from "../core/AxiosError.js";
+
+const knownAdapters = {
+ http: httpAdapter,
+ xhr: xhrAdapter
+}
+
+utils.forEach(knownAdapters, (fn, value) => {
+ if (fn) {
+ try {
+ Object.defineProperty(fn, 'name', {value});
+ } catch (e) {
+ // eslint-disable-next-line no-empty
+ }
+ Object.defineProperty(fn, 'adapterName', {value});
+ }
+});
+
+const renderReason = (reason) => `- ${reason}`;
+
+const isResolvedHandle = (adapter) => utils.isFunction(adapter) || adapter === null || adapter === false;
+
+export default {
+ getAdapter: (adapters) => {
+ adapters = utils.isArray(adapters) ? adapters : [adapters];
+
+ const {length} = adapters;
+ let nameOrAdapter;
+ let adapter;
+
+ const rejectedReasons = {};
+
+ for (let i = 0; i < length; i++) {
+ nameOrAdapter = adapters[i];
+ let id;
+
+ adapter = nameOrAdapter;
+
+ if (!isResolvedHandle(nameOrAdapter)) {
+ adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
+
+ if (adapter === undefined) {
+ throw new AxiosError(`Unknown adapter '${id}'`);
+ }
+ }
+
+ if (adapter) {
+ break;
+ }
+
+ rejectedReasons[id || '#' + i] = adapter;
+ }
+
+ if (!adapter) {
+
+ const reasons = Object.entries(rejectedReasons)
+ .map(([id, state]) => `adapter ${id} ` +
+ (state === false ? 'is not supported by the environment' : 'is not available in the build')
+ );
+
+ let s = length ?
+ (reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) :
+ 'as no adapter specified';
+
+ throw new AxiosError(
+ `There is no suitable adapter to dispatch the request ` + s,
+ 'ERR_NOT_SUPPORT'
+ );
+ }
+
+ return adapter;
+ },
+ adapters: knownAdapters
+}
diff --git a/node_modules/axios/lib/adapters/http.js b/node_modules/axios/lib/adapters/http.js
new file mode 100755
index 0000000..21d6458
--- /dev/null
+++ b/node_modules/axios/lib/adapters/http.js
@@ -0,0 +1,685 @@
+'use strict';
+
+import utils from './../utils.js';
+import settle from './../core/settle.js';
+import buildFullPath from '../core/buildFullPath.js';
+import buildURL from './../helpers/buildURL.js';
+import {getProxyForUrl} from 'proxy-from-env';
+import http from 'http';
+import https from 'https';
+import util from 'util';
+import followRedirects from 'follow-redirects';
+import zlib from 'zlib';
+import {VERSION} from '../env/data.js';
+import transitionalDefaults from '../defaults/transitional.js';
+import AxiosError from '../core/AxiosError.js';
+import CanceledError from '../cancel/CanceledError.js';
+import platform from '../platform/index.js';
+import fromDataURI from '../helpers/fromDataURI.js';
+import stream from 'stream';
+import AxiosHeaders from '../core/AxiosHeaders.js';
+import AxiosTransformStream from '../helpers/AxiosTransformStream.js';
+import EventEmitter from 'events';
+import formDataToStream from "../helpers/formDataToStream.js";
+import readBlob from "../helpers/readBlob.js";
+import ZlibHeaderTransformStream from '../helpers/ZlibHeaderTransformStream.js';
+import callbackify from "../helpers/callbackify.js";
+
+const zlibOptions = {
+ flush: zlib.constants.Z_SYNC_FLUSH,
+ finishFlush: zlib.constants.Z_SYNC_FLUSH
+};
+
+const brotliOptions = {
+ flush: zlib.constants.BROTLI_OPERATION_FLUSH,
+ finishFlush: zlib.constants.BROTLI_OPERATION_FLUSH
+}
+
+const isBrotliSupported = utils.isFunction(zlib.createBrotliDecompress);
+
+const {http: httpFollow, https: httpsFollow} = followRedirects;
+
+const isHttps = /https:?/;
+
+const supportedProtocols = platform.protocols.map(protocol => {
+ return protocol + ':';
+});
+
+/**
+ * If the proxy or config beforeRedirects functions are defined, call them with the options
+ * object.
+ *
+ * @param {Object<string, any>} options - The options object that was passed to the request.
+ *
+ * @returns {Object<string, any>}
+ */
+function dispatchBeforeRedirect(options, responseDetails) {
+ if (options.beforeRedirects.proxy) {
+ options.beforeRedirects.proxy(options);
+ }
+ if (options.beforeRedirects.config) {
+ options.beforeRedirects.config(options, responseDetails);
+ }
+}
+
+/**
+ * If the proxy or config afterRedirects functions are defined, call them with the options
+ *
+ * @param {http.ClientRequestArgs} options
+ * @param {AxiosProxyConfig} configProxy configuration from Axios options object
+ * @param {string} location
+ *
+ * @returns {http.ClientRequestArgs}
+ */
+function setProxy(options, configProxy, location) {
+ let proxy = configProxy;
+ if (!proxy && proxy !== false) {
+ const proxyUrl = getProxyForUrl(location);
+ if (proxyUrl) {
+ proxy = new URL(proxyUrl);
+ }
+ }
+ if (proxy) {
+ // Basic proxy authorization
+ if (proxy.username) {
+ proxy.auth = (proxy.username || '') + ':' + (proxy.password || '');
+ }
+
+ if (proxy.auth) {
+ // Support proxy auth object form
+ if (proxy.auth.username || proxy.auth.password) {
+ proxy.auth = (proxy.auth.username || '') + ':' + (proxy.auth.password || '');
+ }
+ const base64 = Buffer
+ .from(proxy.auth, 'utf8')
+ .toString('base64');
+ options.headers['Proxy-Authorization'] = 'Basic ' + base64;
+ }
+
+ options.headers.host = options.hostname + (options.port ? ':' + options.port : '');
+ const proxyHost = proxy.hostname || proxy.host;
+ options.hostname = proxyHost;
+ // Replace 'host' since options is not a URL object
+ options.host = proxyHost;
+ options.port = proxy.port;
+ options.path = location;
+ if (proxy.protocol) {
+ options.protocol = proxy.protocol.includes(':') ? proxy.protocol : `${proxy.protocol}:`;
+ }
+ }
+
+ options.beforeRedirects.proxy = function beforeRedirect(redirectOptions) {
+ // Configure proxy for redirected request, passing the original config proxy to apply
+ // the exact same logic as if the redirected request was performed by axios directly.
+ setProxy(redirectOptions, configProxy, redirectOptions.href);
+ };
+}
+
+const isHttpAdapterSupported = typeof process !== 'undefined' && utils.kindOf(process) === 'process';
+
+// temporary hotfix
+
+const wrapAsync = (asyncExecutor) => {
+ return new Promise((resolve, reject) => {
+ let onDone;
+ let isDone;
+
+ const done = (value, isRejected) => {
+ if (isDone) return;
+ isDone = true;
+ onDone && onDone(value, isRejected);
+ }
+
+ const _resolve = (value) => {
+ done(value);
+ resolve(value);
+ };
+
+ const _reject = (reason) => {
+ done(reason, true);
+ reject(reason);
+ }
+
+ asyncExecutor(_resolve, _reject, (onDoneHandler) => (onDone = onDoneHandler)).catch(_reject);
+ })
+};
+
+const resolveFamily = ({address, family}) => {
+ if (!utils.isString(address)) {
+ throw TypeError('address must be a string');
+ }
+ return ({
+ address,
+ family: family || (address.indexOf('.') < 0 ? 6 : 4)
+ });
+}
+
+const buildAddressEntry = (address, family) => resolveFamily(utils.isObject(address) ? address : {address, family});
+
+/*eslint consistent-return:0*/
+export default isHttpAdapterSupported && function httpAdapter(config) {
+ return wrapAsync(async function dispatchHttpRequest(resolve, reject, onDone) {
+ let {data, lookup, family} = config;
+ const {responseType, responseEncoding} = config;
+ const method = config.method.toUpperCase();
+ let isDone;
+ let rejected = false;
+ let req;
+
+ if (lookup) {
+ const _lookup = callbackify(lookup, (value) => utils.isArray(value) ? value : [value]);
+ // hotfix to support opt.all option which is required for node 20.x
+ lookup = (hostname, opt, cb) => {
+ _lookup(hostname, opt, (err, arg0, arg1) => {
+ if (err) {
+ return cb(err);
+ }
+
+ const addresses = utils.isArray(arg0) ? arg0.map(addr => buildAddressEntry(addr)) : [buildAddressEntry(arg0, arg1)];
+
+ opt.all ? cb(err, addresses) : cb(err, addresses[0].address, addresses[0].family);
+ });
+ }
+ }
+
+ // temporary internal emitter until the AxiosRequest class will be implemented
+ const emitter = new EventEmitter();
+
+ const onFinished = () => {
+ if (config.cancelToken) {
+ config.cancelToken.unsubscribe(abort);
+ }
+
+ if (config.signal) {
+ config.signal.removeEventListener('abort', abort);
+ }
+
+ emitter.removeAllListeners();
+ }
+
+ onDone((value, isRejected) => {
+ isDone = true;
+ if (isRejected) {
+ rejected = true;
+ onFinished();
+ }
+ });
+
+ function abort(reason) {
+ emitter.emit('abort', !reason || reason.type ? new CanceledError(null, config, req) : reason);
+ }
+
+ emitter.once('abort', reject);
+
+ if (config.cancelToken || config.signal) {
+ config.cancelToken && config.cancelToken.subscribe(abort);
+ if (config.signal) {
+ config.signal.aborted ? abort() : config.signal.addEventListener('abort', abort);
+ }
+ }
+
+ // Parse url
+ const fullPath = buildFullPath(config.baseURL, config.url);
+ const parsed = new URL(fullPath, 'http://localhost');
+ const protocol = parsed.protocol || supportedProtocols[0];
+
+ if (protocol === 'data:') {
+ let convertedData;
+
+ if (method !== 'GET') {
+ return settle(resolve, reject, {
+ status: 405,
+ statusText: 'method not allowed',
+ headers: {},
+ config
+ });
+ }
+
+ try {
+ convertedData = fromDataURI(config.url, responseType === 'blob', {
+ Blob: config.env && config.env.Blob
+ });
+ } catch (err) {
+ throw AxiosError.from(err, AxiosError.ERR_BAD_REQUEST, config);
+ }
+
+ if (responseType === 'text') {
+ convertedData = convertedData.toString(responseEncoding);
+
+ if (!responseEncoding || responseEncoding === 'utf8') {
+ convertedData = utils.stripBOM(convertedData);
+ }
+ } else if (responseType === 'stream') {
+ convertedData = stream.Readable.from(convertedData);
+ }
+
+ return settle(resolve, reject, {
+ data: convertedData,
+ status: 200,
+ statusText: 'OK',
+ headers: new AxiosHeaders(),
+ config
+ });
+ }
+
+ if (supportedProtocols.indexOf(protocol) === -1) {
+ return reject(new AxiosError(
+ 'Unsupported protocol ' + protocol,
+ AxiosError.ERR_BAD_REQUEST,
+ config
+ ));
+ }
+
+ const headers = AxiosHeaders.from(config.headers).normalize();
+
+ // Set User-Agent (required by some servers)
+ // See https://github.com/axios/axios/issues/69
+ // User-Agent is specified; handle case where no UA header is desired
+ // Only set header if it hasn't been set in config
+ headers.set('User-Agent', 'axios/' + VERSION, false);
+
+ const onDownloadProgress = config.onDownloadProgress;
+ const onUploadProgress = config.onUploadProgress;
+ const maxRate = config.maxRate;
+ let maxUploadRate = undefined;
+ let maxDownloadRate = undefined;
+
+ // support for spec compliant FormData objects
+ if (utils.isSpecCompliantForm(data)) {
+ const userBoundary = headers.getContentType(/boundary=([-_\w\d]{10,70})/i);
+
+ data = formDataToStream(data, (formHeaders) => {
+ headers.set(formHeaders);
+ }, {
+ tag: `axios-${VERSION}-boundary`,
+ boundary: userBoundary && userBoundary[1] || undefined
+ });
+ // support for https://www.npmjs.com/package/form-data api
+ } else if (utils.isFormData(data) && utils.isFunction(data.getHeaders)) {
+ headers.set(data.getHeaders());
+
+ if (!headers.hasContentLength()) {
+ try {
+ const knownLength = await util.promisify(data.getLength).call(data);
+ Number.isFinite(knownLength) && knownLength >= 0 && headers.setContentLength(knownLength);
+ /*eslint no-empty:0*/
+ } catch (e) {
+ }
+ }
+ } else if (utils.isBlob(data)) {
+ data.size && headers.setContentType(data.type || 'application/octet-stream');
+ headers.setContentLength(data.size || 0);
+ data = stream.Readable.from(readBlob(data));
+ } else if (data && !utils.isStream(data)) {
+ if (Buffer.isBuffer(data)) {
+ // Nothing to do...
+ } else if (utils.isArrayBuffer(data)) {
+ data = Buffer.from(new Uint8Array(data));
+ } else if (utils.isString(data)) {
+ data = Buffer.from(data, 'utf-8');
+ } else {
+ return reject(new AxiosError(
+ 'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream',
+ AxiosError.ERR_BAD_REQUEST,
+ config
+ ));
+ }
+
+ // Add Content-Length header if data exists
+ headers.setContentLength(data.length, false);
+
+ if (config.maxBodyLength > -1 && data.length > config.maxBodyLength) {
+ return reject(new AxiosError(
+ 'Request body larger than maxBodyLength limit',
+ AxiosError.ERR_BAD_REQUEST,
+ config
+ ));
+ }
+ }
+
+ const contentLength = utils.toFiniteNumber(headers.getContentLength());
+
+ if (utils.isArray(maxRate)) {
+ maxUploadRate = maxRate[0];
+ maxDownloadRate = maxRate[1];
+ } else {
+ maxUploadRate = maxDownloadRate = maxRate;
+ }
+
+ if (data && (onUploadProgress || maxUploadRate)) {
+ if (!utils.isStream(data)) {
+ data = stream.Readable.from(data, {objectMode: false});
+ }
+
+ data = stream.pipeline([data, new AxiosTransformStream({
+ length: contentLength,
+ maxRate: utils.toFiniteNumber(maxUploadRate)
+ })], utils.noop);
+
+ onUploadProgress && data.on('progress', progress => {
+ onUploadProgress(Object.assign(progress, {
+ upload: true
+ }));
+ });
+ }
+
+ // HTTP basic authentication
+ let auth = undefined;
+ if (config.auth) {
+ const username = config.auth.username || '';
+ const password = config.auth.password || '';
+ auth = username + ':' + password;
+ }
+
+ if (!auth && parsed.username) {
+ const urlUsername = parsed.username;
+ const urlPassword = parsed.password;
+ auth = urlUsername + ':' + urlPassword;
+ }
+
+ auth && headers.delete('authorization');
+
+ let path;
+
+ try {
+ path = buildURL(
+ parsed.pathname + parsed.search,
+ config.params,
+ config.paramsSerializer
+ ).replace(/^\?/, '');
+ } catch (err) {
+ const customErr = new Error(err.message);
+ customErr.config = config;
+ customErr.url = config.url;
+ customErr.exists = true;
+ return reject(customErr);
+ }
+
+ headers.set(
+ 'Accept-Encoding',
+ 'gzip, compress, deflate' + (isBrotliSupported ? ', br' : ''), false
+ );
+
+ const options = {
+ path,
+ method: method,
+ headers: headers.toJSON(),
+ agents: { http: config.httpAgent, https: config.httpsAgent },
+ auth,
+ protocol,
+ family,
+ beforeRedirect: dispatchBeforeRedirect,
+ beforeRedirects: {}
+ };
+
+ // cacheable-lookup integration hotfix
+ !utils.isUndefined(lookup) && (options.lookup = lookup);
+
+ if (config.socketPath) {
+ options.socketPath = config.socketPath;
+ } else {
+ options.hostname = parsed.hostname;
+ options.port = parsed.port;
+ setProxy(options, config.proxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path);
+ }
+
+ let transport;
+ const isHttpsRequest = isHttps.test(options.protocol);
+ options.agent = isHttpsRequest ? config.httpsAgent : config.httpAgent;
+ if (config.transport) {
+ transport = config.transport;
+ } else if (config.maxRedirects === 0) {
+ transport = isHttpsRequest ? https : http;
+ } else {
+ if (config.maxRedirects) {
+ options.maxRedirects = config.maxRedirects;
+ }
+ if (config.beforeRedirect) {
+ options.beforeRedirects.config = config.beforeRedirect;
+ }
+ transport = isHttpsRequest ? httpsFollow : httpFollow;
+ }
+
+ if (config.maxBodyLength > -1) {
+ options.maxBodyLength = config.maxBodyLength;
+ } else {
+ // follow-redirects does not skip comparison, so it should always succeed for axios -1 unlimited
+ options.maxBodyLength = Infinity;
+ }
+
+ if (config.insecureHTTPParser) {
+ options.insecureHTTPParser = config.insecureHTTPParser;
+ }
+
+ // Create the request
+ req = transport.request(options, function handleResponse(res) {
+ if (req.destroyed) return;
+
+ const streams = [res];
+
+ const responseLength = +res.headers['content-length'];
+
+ if (onDownloadProgress) {
+ const transformStream = new AxiosTransformStream({
+ length: utils.toFiniteNumber(responseLength),
+ maxRate: utils.toFiniteNumber(maxDownloadRate)
+ });
+
+ onDownloadProgress && transformStream.on('progress', progress => {
+ onDownloadProgress(Object.assign(progress, {
+ download: true
+ }));
+ });
+
+ streams.push(transformStream);
+ }
+
+ // decompress the response body transparently if required
+ let responseStream = res;
+
+ // return the last request in case of redirects
+ const lastRequest = res.req || req;
+
+ // if decompress disabled we should not decompress
+ if (config.decompress !== false && res.headers['content-encoding']) {
+ // if no content, but headers still say that it is encoded,
+ // remove the header not confuse downstream operations
+ if (method === 'HEAD' || res.statusCode === 204) {
+ delete res.headers['content-encoding'];
+ }
+
+ switch ((res.headers['content-encoding'] || '').toLowerCase()) {
+ /*eslint default-case:0*/
+ case 'gzip':
+ case 'x-gzip':
+ case 'compress':
+ case 'x-compress':
+ // add the unzipper to the body stream processing pipeline
+ streams.push(zlib.createUnzip(zlibOptions));
+
+ // remove the content-encoding in order to not confuse downstream operations
+ delete res.headers['content-encoding'];
+ break;
+ case 'deflate':
+ streams.push(new ZlibHeaderTransformStream());
+
+ // add the unzipper to the body stream processing pipeline
+ streams.push(zlib.createUnzip(zlibOptions));
+
+ // remove the content-encoding in order to not confuse downstream operations
+ delete res.headers['content-encoding'];
+ break;
+ case 'br':
+ if (isBrotliSupported) {
+ streams.push(zlib.createBrotliDecompress(brotliOptions));
+ delete res.headers['content-encoding'];
+ }
+ }
+ }
+
+ responseStream = streams.length > 1 ? stream.pipeline(streams, utils.noop) : streams[0];
+
+ const offListeners = stream.finished(responseStream, () => {
+ offListeners();
+ onFinished();
+ });
+
+ const response = {
+ status: res.statusCode,
+ statusText: res.statusMessage,
+ headers: new AxiosHeaders(res.headers),
+ config,
+ request: lastRequest
+ };
+
+ if (responseType === 'stream') {
+ response.data = responseStream;
+ settle(resolve, reject, response);
+ } else {
+ const responseBuffer = [];
+ let totalResponseBytes = 0;
+
+ responseStream.on('data', function handleStreamData(chunk) {
+ responseBuffer.push(chunk);
+ totalResponseBytes += chunk.length;
+
+ // make sure the content length is not over the maxContentLength if specified
+ if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) {
+ // stream.destroy() emit aborted event before calling reject() on Node.js v16
+ rejected = true;
+ responseStream.destroy();
+ reject(new AxiosError('maxContentLength size of ' + config.maxContentLength + ' exceeded',
+ AxiosError.ERR_BAD_RESPONSE, config, lastRequest));
+ }
+ });
+
+ responseStream.on('aborted', function handlerStreamAborted() {
+ if (rejected) {
+ return;
+ }
+
+ const err = new AxiosError(
+ 'maxContentLength size of ' + config.maxContentLength + ' exceeded',
+ AxiosError.ERR_BAD_RESPONSE,
+ config,
+ lastRequest
+ );
+ responseStream.destroy(err);
+ reject(err);
+ });
+
+ responseStream.on('error', function handleStreamError(err) {
+ if (req.destroyed) return;
+ reject(AxiosError.from(err, null, config, lastRequest));
+ });
+
+ responseStream.on('end', function handleStreamEnd() {
+ try {
+ let responseData = responseBuffer.length === 1 ? responseBuffer[0] : Buffer.concat(responseBuffer);
+ if (responseType !== 'arraybuffer') {
+ responseData = responseData.toString(responseEncoding);
+ if (!responseEncoding || responseEncoding === 'utf8') {
+ responseData = utils.stripBOM(responseData);
+ }
+ }
+ response.data = responseData;
+ } catch (err) {
+ return reject(AxiosError.from(err, null, config, response.request, response));
+ }
+ settle(resolve, reject, response);
+ });
+ }
+
+ emitter.once('abort', err => {
+ if (!responseStream.destroyed) {
+ responseStream.emit('error', err);
+ responseStream.destroy();
+ }
+ });
+ });
+
+ emitter.once('abort', err => {
+ reject(err);
+ req.destroy(err);
+ });
+
+ // Handle errors
+ req.on('error', function handleRequestError(err) {
+ // @todo remove
+ // if (req.aborted && err.code !== AxiosError.ERR_FR_TOO_MANY_REDIRECTS) return;
+ reject(AxiosError.from(err, null, config, req));
+ });
+
+ // set tcp keep alive to prevent drop connection by peer
+ req.on('socket', function handleRequestSocket(socket) {
+ // default interval of sending ack packet is 1 minute
+ socket.setKeepAlive(true, 1000 * 60);
+ });
+
+ // Handle request timeout
+ if (config.timeout) {
+ // This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types.
+ const timeout = parseInt(config.timeout, 10);
+
+ if (Number.isNaN(timeout)) {
+ reject(new AxiosError(
+ 'error trying to parse `config.timeout` to int',
+ AxiosError.ERR_BAD_OPTION_VALUE,
+ config,
+ req
+ ));
+
+ return;
+ }
+
+ // Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system.
+ // And timer callback will be fired, and abort() will be invoked before connection, then get "socket hang up" and code ECONNRESET.
+ // At this time, if we have a large number of request, nodejs will hang up some socket on background. and the number will up and up.
+ // And then these socket which be hang up will devouring CPU little by little.
+ // ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect.
+ req.setTimeout(timeout, function handleRequestTimeout() {
+ if (isDone) return;
+ let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';
+ const transitional = config.transitional || transitionalDefaults;
+ if (config.timeoutErrorMessage) {
+ timeoutErrorMessage = config.timeoutErrorMessage;
+ }
+ reject(new AxiosError(
+ timeoutErrorMessage,
+ transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,
+ config,
+ req
+ ));
+ abort();
+ });
+ }
+
+
+ // Send the request
+ if (utils.isStream(data)) {
+ let ended = false;
+ let errored = false;
+
+ data.on('end', () => {
+ ended = true;
+ });
+
+ data.once('error', err => {
+ errored = true;
+ req.destroy(err);
+ });
+
+ data.on('close', () => {
+ if (!ended && !errored) {
+ abort(new CanceledError('Request stream has been aborted', config, req));
+ }
+ });
+
+ data.pipe(req);
+ } else {
+ req.end(data);
+ }
+ });
+}
+
+export const __setProxy = setProxy;
diff --git a/node_modules/axios/lib/adapters/xhr.js b/node_modules/axios/lib/adapters/xhr.js
new file mode 100644
index 0000000..26126b2
--- /dev/null
+++ b/node_modules/axios/lib/adapters/xhr.js
@@ -0,0 +1,260 @@
+'use strict';
+
+import utils from './../utils.js';
+import settle from './../core/settle.js';
+import cookies from './../helpers/cookies.js';
+import buildURL from './../helpers/buildURL.js';
+import buildFullPath from '../core/buildFullPath.js';
+import isURLSameOrigin from './../helpers/isURLSameOrigin.js';
+import transitionalDefaults from '../defaults/transitional.js';
+import AxiosError from '../core/AxiosError.js';
+import CanceledError from '../cancel/CanceledError.js';
+import parseProtocol from '../helpers/parseProtocol.js';
+import platform from '../platform/index.js';
+import AxiosHeaders from '../core/AxiosHeaders.js';
+import speedometer from '../helpers/speedometer.js';
+
+function progressEventReducer(listener, isDownloadStream) {
+ let bytesNotified = 0;
+ const _speedometer = speedometer(50, 250);
+
+ return e => {
+ const loaded = e.loaded;
+ const total = e.lengthComputable ? e.total : undefined;
+ const progressBytes = loaded - bytesNotified;
+ const rate = _speedometer(progressBytes);
+ const inRange = loaded <= total;
+
+ bytesNotified = loaded;
+
+ const data = {
+ loaded,
+ total,
+ progress: total ? (loaded / total) : undefined,
+ bytes: progressBytes,
+ rate: rate ? rate : undefined,
+ estimated: rate && total && inRange ? (total - loaded) / rate : undefined,
+ event: e
+ };
+
+ data[isDownloadStream ? 'download' : 'upload'] = true;
+
+ listener(data);
+ };
+}
+
+const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
+
+export default isXHRAdapterSupported && function (config) {
+ return new Promise(function dispatchXhrRequest(resolve, reject) {
+ let requestData = config.data;
+ const requestHeaders = AxiosHeaders.from(config.headers).normalize();
+ let {responseType, withXSRFToken} = config;
+ let onCanceled;
+ function done() {
+ if (config.cancelToken) {
+ config.cancelToken.unsubscribe(onCanceled);
+ }
+
+ if (config.signal) {
+ config.signal.removeEventListener('abort', onCanceled);
+ }
+ }
+
+ let contentType;
+
+ if (utils.isFormData(requestData)) {
+ if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
+ requestHeaders.setContentType(false); // Let the browser set it
+ } else if ((contentType = requestHeaders.getContentType()) !== false) {
+ // fix semicolon duplication issue for ReactNative FormData implementation
+ const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];
+ requestHeaders.setContentType([type || 'multipart/form-data', ...tokens].join('; '));
+ }
+ }
+
+ let request = new XMLHttpRequest();
+
+ // HTTP basic authentication
+ if (config.auth) {
+ const username = config.auth.username || '';
+ const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';
+ requestHeaders.set('Authorization', 'Basic ' + btoa(username + ':' + password));
+ }
+
+ const fullPath = buildFullPath(config.baseURL, config.url);
+
+ request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
+
+ // Set the request timeout in MS
+ request.timeout = config.timeout;
+
+ function onloadend() {
+ if (!request) {
+ return;
+ }
+ // Prepare the response
+ const responseHeaders = AxiosHeaders.from(
+ 'getAllResponseHeaders' in request && request.getAllResponseHeaders()
+ );
+ const responseData = !responseType || responseType === 'text' || responseType === 'json' ?
+ request.responseText : request.response;
+ const response = {
+ data: responseData,
+ status: request.status,
+ statusText: request.statusText,
+ headers: responseHeaders,
+ config,
+ request
+ };
+
+ settle(function _resolve(value) {
+ resolve(value);
+ done();
+ }, function _reject(err) {
+ reject(err);
+ done();
+ }, response);
+
+ // Clean up request
+ request = null;
+ }
+
+ if ('onloadend' in request) {
+ // Use onloadend if available
+ request.onloadend = onloadend;
+ } else {
+ // Listen for ready state to emulate onloadend
+ request.onreadystatechange = function handleLoad() {
+ if (!request || request.readyState !== 4) {
+ return;
+ }
+
+ // The request errored out and we didn't get a response, this will be
+ // handled by onerror instead
+ // With one exception: request that using file: protocol, most browsers
+ // will return status as 0 even though it's a successful request
+ if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
+ return;
+ }
+ // readystate handler is calling before onerror or ontimeout handlers,
+ // so we should call onloadend on the next 'tick'
+ setTimeout(onloadend);
+ };
+ }
+
+ // Handle browser request cancellation (as opposed to a manual cancellation)
+ request.onabort = function handleAbort() {
+ if (!request) {
+ return;
+ }
+
+ reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));
+
+ // Clean up request
+ request = null;
+ };
+
+ // Handle low level network errors
+ request.onerror = function handleError() {
+ // Real errors are hidden from us by the browser
+ // onerror should only fire if it's a network error
+ reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request));
+
+ // Clean up request
+ request = null;
+ };
+
+ // Handle timeout
+ request.ontimeout = function handleTimeout() {
+ let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';
+ const transitional = config.transitional || transitionalDefaults;
+ if (config.timeoutErrorMessage) {
+ timeoutErrorMessage = config.timeoutErrorMessage;
+ }
+ reject(new AxiosError(
+ timeoutErrorMessage,
+ transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,
+ config,
+ request));
+
+ // Clean up request
+ request = null;
+ };
+
+ // Add xsrf header
+ // This is only done if running in a standard browser environment.
+ // Specifically not if we're in a web worker, or react-native.
+ if(platform.hasStandardBrowserEnv) {
+ withXSRFToken && utils.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config));
+
+ if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(fullPath))) {
+ // Add xsrf header
+ const xsrfValue = config.xsrfHeaderName && config.xsrfCookieName && cookies.read(config.xsrfCookieName);
+
+ if (xsrfValue) {
+ requestHeaders.set(config.xsrfHeaderName, xsrfValue);
+ }
+ }
+ }
+
+ // Remove Content-Type if data is undefined
+ requestData === undefined && requestHeaders.setContentType(null);
+
+ // Add headers to the request
+ if ('setRequestHeader' in request) {
+ utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
+ request.setRequestHeader(key, val);
+ });
+ }
+
+ // Add withCredentials to request if needed
+ if (!utils.isUndefined(config.withCredentials)) {
+ request.withCredentials = !!config.withCredentials;
+ }
+
+ // Add responseType to request if needed
+ if (responseType && responseType !== 'json') {
+ request.responseType = config.responseType;
+ }
+
+ // Handle progress if needed
+ if (typeof config.onDownloadProgress === 'function') {
+ request.addEventListener('progress', progressEventReducer(config.onDownloadProgress, true));
+ }
+
+ // Not all browsers support upload events
+ if (typeof config.onUploadProgress === 'function' && request.upload) {
+ request.upload.addEventListener('progress', progressEventReducer(config.onUploadProgress));
+ }
+
+ if (config.cancelToken || config.signal) {
+ // Handle cancellation
+ // eslint-disable-next-line func-names
+ onCanceled = cancel => {
+ if (!request) {
+ return;
+ }
+ reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);
+ request.abort();
+ request = null;
+ };
+
+ config.cancelToken && config.cancelToken.subscribe(onCanceled);
+ if (config.signal) {
+ config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);
+ }
+ }
+
+ const protocol = parseProtocol(fullPath);
+
+ if (protocol && platform.protocols.indexOf(protocol) === -1) {
+ reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));
+ return;
+ }
+
+
+ // Send the request
+ request.send(requestData || null);
+ });
+}
diff --git a/node_modules/axios/lib/axios.js b/node_modules/axios/lib/axios.js
new file mode 100644
index 0000000..873f246
--- /dev/null
+++ b/node_modules/axios/lib/axios.js
@@ -0,0 +1,89 @@
+'use strict';
+
+import utils from './utils.js';
+import bind from './helpers/bind.js';
+import Axios from './core/Axios.js';
+import mergeConfig from './core/mergeConfig.js';
+import defaults from './defaults/index.js';
+import formDataToJSON from './helpers/formDataToJSON.js';
+import CanceledError from './cancel/CanceledError.js';
+import CancelToken from './cancel/CancelToken.js';
+import isCancel from './cancel/isCancel.js';
+import {VERSION} from './env/data.js';
+import toFormData from './helpers/toFormData.js';
+import AxiosError from './core/AxiosError.js';
+import spread from './helpers/spread.js';
+import isAxiosError from './helpers/isAxiosError.js';
+import AxiosHeaders from "./core/AxiosHeaders.js";
+import adapters from './adapters/adapters.js';
+import HttpStatusCode from './helpers/HttpStatusCode.js';
+
+/**
+ * Create an instance of Axios
+ *
+ * @param {Object} defaultConfig The default config for the instance
+ *
+ * @returns {Axios} A new instance of Axios
+ */
+function createInstance(defaultConfig) {
+ const context = new Axios(defaultConfig);
+ const instance = bind(Axios.prototype.request, context);
+
+ // Copy axios.prototype to instance
+ utils.extend(instance, Axios.prototype, context, {allOwnKeys: true});
+
+ // Copy context to instance
+ utils.extend(instance, context, null, {allOwnKeys: true});
+
+ // Factory for creating new instances
+ instance.create = function create(instanceConfig) {
+ return createInstance(mergeConfig(defaultConfig, instanceConfig));
+ };
+
+ return instance;
+}
+
+// Create the default instance to be exported
+const axios = createInstance(defaults);
+
+// Expose Axios class to allow class inheritance
+axios.Axios = Axios;
+
+// Expose Cancel & CancelToken
+axios.CanceledError = CanceledError;
+axios.CancelToken = CancelToken;
+axios.isCancel = isCancel;
+axios.VERSION = VERSION;
+axios.toFormData = toFormData;
+
+// Expose AxiosError class
+axios.AxiosError = AxiosError;
+
+// alias for CanceledError for backward compatibility
+axios.Cancel = axios.CanceledError;
+
+// Expose all/spread
+axios.all = function all(promises) {
+ return Promise.all(promises);
+};
+
+axios.spread = spread;
+
+// Expose isAxiosError
+axios.isAxiosError = isAxiosError;
+
+// Expose mergeConfig
+axios.mergeConfig = mergeConfig;
+
+axios.AxiosHeaders = AxiosHeaders;
+
+axios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);
+
+axios.getAdapter = adapters.getAdapter;
+
+axios.HttpStatusCode = HttpStatusCode;
+
+axios.default = axios;
+
+// this module should only have a default export
+export default axios
diff --git a/node_modules/axios/lib/cancel/CancelToken.js b/node_modules/axios/lib/cancel/CancelToken.js
new file mode 100644
index 0000000..20d8f68
--- /dev/null
+++ b/node_modules/axios/lib/cancel/CancelToken.js
@@ -0,0 +1,121 @@
+'use strict';
+
+import CanceledError from './CanceledError.js';
+
+/**
+ * A `CancelToken` is an object that can be used to request cancellation of an operation.
+ *
+ * @param {Function} executor The executor function.
+ *
+ * @returns {CancelToken}
+ */
+class CancelToken {
+ constructor(executor) {
+ if (typeof executor !== 'function') {
+ throw new TypeError('executor must be a function.');
+ }
+
+ let resolvePromise;
+
+ this.promise = new Promise(function promiseExecutor(resolve) {
+ resolvePromise = resolve;
+ });
+
+ const token = this;
+
+ // eslint-disable-next-line func-names
+ this.promise.then(cancel => {
+ if (!token._listeners) return;
+
+ let i = token._listeners.length;
+
+ while (i-- > 0) {
+ token._listeners[i](cancel);
+ }
+ token._listeners = null;
+ });
+
+ // eslint-disable-next-line func-names
+ this.promise.then = onfulfilled => {
+ let _resolve;
+ // eslint-disable-next-line func-names
+ const promise = new Promise(resolve => {
+ token.subscribe(resolve);
+ _resolve = resolve;
+ }).then(onfulfilled);
+
+ promise.cancel = function reject() {
+ token.unsubscribe(_resolve);
+ };
+
+ return promise;
+ };
+
+ executor(function cancel(message, config, request) {
+ if (token.reason) {
+ // Cancellation has already been requested
+ return;
+ }
+
+ token.reason = new CanceledError(message, config, request);
+ resolvePromise(token.reason);
+ });
+ }
+
+ /**
+ * Throws a `CanceledError` if cancellation has been requested.
+ */
+ throwIfRequested() {
+ if (this.reason) {
+ throw this.reason;
+ }
+ }
+
+ /**
+ * Subscribe to the cancel signal
+ */
+
+ subscribe(listener) {
+ if (this.reason) {
+ listener(this.reason);
+ return;
+ }
+
+ if (this._listeners) {
+ this._listeners.push(listener);
+ } else {
+ this._listeners = [listener];
+ }
+ }
+
+ /**
+ * Unsubscribe from the cancel signal
+ */
+
+ unsubscribe(listener) {
+ if (!this._listeners) {
+ return;
+ }
+ const index = this._listeners.indexOf(listener);
+ if (index !== -1) {
+ this._listeners.splice(index, 1);
+ }
+ }
+
+ /**
+ * Returns an object that contains a new `CancelToken` and a function that, when called,
+ * cancels the `CancelToken`.
+ */
+ static source() {
+ let cancel;
+ const token = new CancelToken(function executor(c) {
+ cancel = c;
+ });
+ return {
+ token,
+ cancel
+ };
+ }
+}
+
+export default CancelToken;
diff --git a/node_modules/axios/lib/cancel/CanceledError.js b/node_modules/axios/lib/cancel/CanceledError.js
new file mode 100644
index 0000000..880066e
--- /dev/null
+++ b/node_modules/axios/lib/cancel/CanceledError.js
@@ -0,0 +1,25 @@
+'use strict';
+
+import AxiosError from '../core/AxiosError.js';
+import utils from '../utils.js';
+
+/**
+ * A `CanceledError` is an object that is thrown when an operation is canceled.
+ *
+ * @param {string=} message The message.
+ * @param {Object=} config The config.
+ * @param {Object=} request The request.
+ *
+ * @returns {CanceledError} The created error.
+ */
+function CanceledError(message, config, request) {
+ // eslint-disable-next-line no-eq-null,eqeqeq
+ AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);
+ this.name = 'CanceledError';
+}
+
+utils.inherits(CanceledError, AxiosError, {
+ __CANCEL__: true
+});
+
+export default CanceledError;
diff --git a/node_modules/axios/lib/cancel/isCancel.js b/node_modules/axios/lib/cancel/isCancel.js
new file mode 100644
index 0000000..a444a12
--- /dev/null
+++ b/node_modules/axios/lib/cancel/isCancel.js
@@ -0,0 +1,5 @@
+'use strict';
+
+export default function isCancel(value) {
+ return !!(value && value.__CANCEL__);
+}
diff --git a/node_modules/axios/lib/core/Axios.js b/node_modules/axios/lib/core/Axios.js
new file mode 100644
index 0000000..2713364
--- /dev/null
+++ b/node_modules/axios/lib/core/Axios.js
@@ -0,0 +1,225 @@
+'use strict';
+
+import utils from './../utils.js';
+import buildURL from '../helpers/buildURL.js';
+import InterceptorManager from './InterceptorManager.js';
+import dispatchRequest from './dispatchRequest.js';
+import mergeConfig from './mergeConfig.js';
+import buildFullPath from './buildFullPath.js';
+import validator from '../helpers/validator.js';
+import AxiosHeaders from './AxiosHeaders.js';
+
+const validators = validator.validators;
+
+/**
+ * Create a new instance of Axios
+ *
+ * @param {Object} instanceConfig The default config for the instance
+ *
+ * @return {Axios} A new instance of Axios
+ */
+class Axios {
+ constructor(instanceConfig) {
+ this.defaults = instanceConfig;
+ this.interceptors = {
+ request: new InterceptorManager(),
+ response: new InterceptorManager()
+ };
+ }
+
+ /**
+ * Dispatch a request
+ *
+ * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
+ * @param {?Object} config
+ *
+ * @returns {Promise} The Promise to be fulfilled
+ */
+ async request(configOrUrl, config) {
+ try {
+ return await this._request(configOrUrl, config);
+ } catch (err) {
+ if (err instanceof Error) {
+ let dummy;
+
+ Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : (dummy = new Error());
+
+ // slice off the Error: ... line
+ const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : '';
+
+ if (!err.stack) {
+ err.stack = stack;
+ // match without the 2 top stack lines
+ } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ''))) {
+ err.stack += '\n' + stack
+ }
+ }
+
+ throw err;
+ }
+ }
+
+ _request(configOrUrl, config) {
+ /*eslint no-param-reassign:0*/
+ // Allow for axios('example/url'[, config]) a la fetch API
+ if (typeof configOrUrl === 'string') {
+ config = config || {};
+ config.url = configOrUrl;
+ } else {
+ config = configOrUrl || {};
+ }
+
+ config = mergeConfig(this.defaults, config);
+
+ const {transitional, paramsSerializer, headers} = config;
+
+ if (transitional !== undefined) {
+ validator.assertOptions(transitional, {
+ silentJSONParsing: validators.transitional(validators.boolean),
+ forcedJSONParsing: validators.transitional(validators.boolean),
+ clarifyTimeoutError: validators.transitional(validators.boolean)
+ }, false);
+ }
+
+ if (paramsSerializer != null) {
+ if (utils.isFunction(paramsSerializer)) {
+ config.paramsSerializer = {
+ serialize: paramsSerializer
+ }
+ } else {
+ validator.assertOptions(paramsSerializer, {
+ encode: validators.function,
+ serialize: validators.function
+ }, true);
+ }
+ }
+
+ // Set config.method
+ config.method = (config.method || this.defaults.method || 'get').toLowerCase();
+
+ // Flatten headers
+ let contextHeaders = headers && utils.merge(
+ headers.common,
+ headers[config.method]
+ );
+
+ headers && utils.forEach(
+ ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
+ (method) => {
+ delete headers[method];
+ }
+ );
+
+ config.headers = AxiosHeaders.concat(contextHeaders, headers);
+
+ // filter out skipped interceptors
+ const requestInterceptorChain = [];
+ let synchronousRequestInterceptors = true;
+ this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
+ if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {
+ return;
+ }
+
+ synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
+
+ requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
+ });
+
+ const responseInterceptorChain = [];
+ this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
+ responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
+ });
+
+ let promise;
+ let i = 0;
+ let len;
+
+ if (!synchronousRequestInterceptors) {
+ const chain = [dispatchRequest.bind(this), undefined];
+ chain.unshift.apply(chain, requestInterceptorChain);
+ chain.push.apply(chain, responseInterceptorChain);
+ len = chain.length;
+
+ promise = Promise.resolve(config);
+
+ while (i < len) {
+ promise = promise.then(chain[i++], chain[i++]);
+ }
+
+ return promise;
+ }
+
+ len = requestInterceptorChain.length;
+
+ let newConfig = config;
+
+ i = 0;
+
+ while (i < len) {
+ const onFulfilled = requestInterceptorChain[i++];
+ const onRejected = requestInterceptorChain[i++];
+ try {
+ newConfig = onFulfilled(newConfig);
+ } catch (error) {
+ onRejected.call(this, error);
+ break;
+ }
+ }
+
+ try {
+ promise = dispatchRequest.call(this, newConfig);
+ } catch (error) {
+ return Promise.reject(error);
+ }
+
+ i = 0;
+ len = responseInterceptorChain.length;
+
+ while (i < len) {
+ promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);
+ }
+
+ return promise;
+ }
+
+ getUri(config) {
+ config = mergeConfig(this.defaults, config);
+ const fullPath = buildFullPath(config.baseURL, config.url);
+ return buildURL(fullPath, config.params, config.paramsSerializer);
+ }
+}
+
+// Provide aliases for supported request methods
+utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
+ /*eslint func-names:0*/
+ Axios.prototype[method] = function(url, config) {
+ return this.request(mergeConfig(config || {}, {
+ method,
+ url,
+ data: (config || {}).data
+ }));
+ };
+});
+
+utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
+ /*eslint func-names:0*/
+
+ function generateHTTPMethod(isForm) {
+ return function httpMethod(url, data, config) {
+ return this.request(mergeConfig(config || {}, {
+ method,
+ headers: isForm ? {
+ 'Content-Type': 'multipart/form-data'
+ } : {},
+ url,
+ data
+ }));
+ };
+ }
+
+ Axios.prototype[method] = generateHTTPMethod();
+
+ Axios.prototype[method + 'Form'] = generateHTTPMethod(true);
+});
+
+export default Axios;
diff --git a/node_modules/axios/lib/core/AxiosError.js b/node_modules/axios/lib/core/AxiosError.js
new file mode 100644
index 0000000..7141a8c
--- /dev/null
+++ b/node_modules/axios/lib/core/AxiosError.js
@@ -0,0 +1,100 @@
+'use strict';
+
+import utils from '../utils.js';
+
+/**
+ * Create an Error with the specified message, config, error code, request and response.
+ *
+ * @param {string} message The error message.
+ * @param {string} [code] The error code (for example, 'ECONNABORTED').
+ * @param {Object} [config] The config.
+ * @param {Object} [request] The request.
+ * @param {Object} [response] The response.
+ *
+ * @returns {Error} The created error.
+ */
+function AxiosError(message, code, config, request, response) {
+ Error.call(this);
+
+ if (Error.captureStackTrace) {
+ Error.captureStackTrace(this, this.constructor);
+ } else {
+ this.stack = (new Error()).stack;
+ }
+
+ this.message = message;
+ this.name = 'AxiosError';
+ code && (this.code = code);
+ config && (this.config = config);
+ request && (this.request = request);
+ response && (this.response = response);
+}
+
+utils.inherits(AxiosError, Error, {
+ toJSON: function toJSON() {
+ return {
+ // Standard
+ message: this.message,
+ name: this.name,
+ // Microsoft
+ description: this.description,
+ number: this.number,
+ // Mozilla
+ fileName: this.fileName,
+ lineNumber: this.lineNumber,
+ columnNumber: this.columnNumber,
+ stack: this.stack,
+ // Axios
+ config: utils.toJSONObject(this.config),
+ code: this.code,
+ status: this.response && this.response.status ? this.response.status : null
+ };
+ }
+});
+
+const prototype = AxiosError.prototype;
+const descriptors = {};
+
+[
+ 'ERR_BAD_OPTION_VALUE',
+ 'ERR_BAD_OPTION',
+ 'ECONNABORTED',
+ 'ETIMEDOUT',
+ 'ERR_NETWORK',
+ 'ERR_FR_TOO_MANY_REDIRECTS',
+ 'ERR_DEPRECATED',
+ 'ERR_BAD_RESPONSE',
+ 'ERR_BAD_REQUEST',
+ 'ERR_CANCELED',
+ 'ERR_NOT_SUPPORT',
+ 'ERR_INVALID_URL'
+// eslint-disable-next-line func-names
+].forEach(code => {
+ descriptors[code] = {value: code};
+});
+
+Object.defineProperties(AxiosError, descriptors);
+Object.defineProperty(prototype, 'isAxiosError', {value: true});
+
+// eslint-disable-next-line func-names
+AxiosError.from = (error, code, config, request, response, customProps) => {
+ const axiosError = Object.create(prototype);
+
+ utils.toFlatObject(error, axiosError, function filter(obj) {
+ return obj !== Error.prototype;
+ }, prop => {
+ return prop !== 'isAxiosError';
+ });
+
+ AxiosError.call(axiosError, error.message, code, config, request, response);
+
+ axiosError.cause = error;
+
+ axiosError.name = error.name;
+
+ customProps && Object.assign(axiosError, customProps);
+
+ return axiosError;
+};
+
+export default AxiosError;
diff --git a/node_modules/axios/lib/core/AxiosHeaders.js b/node_modules/axios/lib/core/AxiosHeaders.js
new file mode 100644
index 0000000..558ad8f
--- /dev/null
+++ b/node_modules/axios/lib/core/AxiosHeaders.js
@@ -0,0 +1,298 @@
+'use strict';
+
+import utils from '../utils.js';
+import parseHeaders from '../helpers/parseHeaders.js';
+
+const $internals = Symbol('internals');
+
+function normalizeHeader(header) {
+ return header && String(header).trim().toLowerCase();
+}
+
+function normalizeValue(value) {
+ if (value === false || value == null) {
+ return value;
+ }
+
+ return utils.isArray(value) ? value.map(normalizeValue) : String(value);
+}
+
+function parseTokens(str) {
+ const tokens = Object.create(null);
+ const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
+ let match;
+
+ while ((match = tokensRE.exec(str))) {
+ tokens[match[1]] = match[2];
+ }
+
+ return tokens;
+}
+
+const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
+
+function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
+ if (utils.isFunction(filter)) {
+ return filter.call(this, value, header);
+ }
+
+ if (isHeaderNameFilter) {
+ value = header;
+ }
+
+ if (!utils.isString(value)) return;
+
+ if (utils.isString(filter)) {
+ return value.indexOf(filter) !== -1;
+ }
+
+ if (utils.isRegExp(filter)) {
+ return filter.test(value);
+ }
+}
+
+function formatHeader(header) {
+ return header.trim()
+ .toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => {
+ return char.toUpperCase() + str;
+ });
+}
+
+function buildAccessors(obj, header) {
+ const accessorName = utils.toCamelCase(' ' + header);
+
+ ['get', 'set', 'has'].forEach(methodName => {
+ Object.defineProperty(obj, methodName + accessorName, {
+ value: function(arg1, arg2, arg3) {
+ return this[methodName].call(this, header, arg1, arg2, arg3);
+ },
+ configurable: true
+ });
+ });
+}
+
+class AxiosHeaders {
+ constructor(headers) {
+ headers && this.set(headers);
+ }
+
+ set(header, valueOrRewrite, rewrite) {
+ const self = this;
+
+ function setHeader(_value, _header, _rewrite) {
+ const lHeader = normalizeHeader(_header);
+
+ if (!lHeader) {
+ throw new Error('header name must be a non-empty string');
+ }
+
+ const key = utils.findKey(self, lHeader);
+
+ if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {
+ self[key || _header] = normalizeValue(_value);
+ }
+ }
+
+ const setHeaders = (headers, _rewrite) =>
+ utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
+
+ if (utils.isPlainObject(header) || header instanceof this.constructor) {
+ setHeaders(header, valueOrRewrite)
+ } else if(utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
+ setHeaders(parseHeaders(header), valueOrRewrite);
+ } else {
+ header != null && setHeader(valueOrRewrite, header, rewrite);
+ }
+
+ return this;
+ }
+
+ get(header, parser) {
+ header = normalizeHeader(header);
+
+ if (header) {
+ const key = utils.findKey(this, header);
+
+ if (key) {
+ const value = this[key];
+
+ if (!parser) {
+ return value;
+ }
+
+ if (parser === true) {
+ return parseTokens(value);
+ }
+
+ if (utils.isFunction(parser)) {
+ return parser.call(this, value, key);
+ }
+
+ if (utils.isRegExp(parser)) {
+ return parser.exec(value);
+ }
+
+ throw new TypeError('parser must be boolean|regexp|function');
+ }
+ }
+ }
+
+ has(header, matcher) {
+ header = normalizeHeader(header);
+
+ if (header) {
+ const key = utils.findKey(this, header);
+
+ return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
+ }
+
+ return false;
+ }
+
+ delete(header, matcher) {
+ const self = this;
+ let deleted = false;
+
+ function deleteHeader(_header) {
+ _header = normalizeHeader(_header);
+
+ if (_header) {
+ const key = utils.findKey(self, _header);
+
+ if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {
+ delete self[key];
+
+ deleted = true;
+ }
+ }
+ }
+
+ if (utils.isArray(header)) {
+ header.forEach(deleteHeader);
+ } else {
+ deleteHeader(header);
+ }
+
+ return deleted;
+ }
+
+ clear(matcher) {
+ const keys = Object.keys(this);
+ let i = keys.length;
+ let deleted = false;
+
+ while (i--) {
+ const key = keys[i];
+ if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
+ delete this[key];
+ deleted = true;
+ }
+ }
+
+ return deleted;
+ }
+
+ normalize(format) {
+ const self = this;
+ const headers = {};
+
+ utils.forEach(this, (value, header) => {
+ const key = utils.findKey(headers, header);
+
+ if (key) {
+ self[key] = normalizeValue(value);
+ delete self[header];
+ return;
+ }
+
+ const normalized = format ? formatHeader(header) : String(header).trim();
+
+ if (normalized !== header) {
+ delete self[header];
+ }
+
+ self[normalized] = normalizeValue(value);
+
+ headers[normalized] = true;
+ });
+
+ return this;
+ }
+
+ concat(...targets) {
+ return this.constructor.concat(this, ...targets);
+ }
+
+ toJSON(asStrings) {
+ const obj = Object.create(null);
+
+ utils.forEach(this, (value, header) => {
+ value != null && value !== false && (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value);
+ });
+
+ return obj;
+ }
+
+ [Symbol.iterator]() {
+ return Object.entries(this.toJSON())[Symbol.iterator]();
+ }
+
+ toString() {
+ return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n');
+ }
+
+ get [Symbol.toStringTag]() {
+ return 'AxiosHeaders';
+ }
+
+ static from(thing) {
+ return thing instanceof this ? thing : new this(thing);
+ }
+
+ static concat(first, ...targets) {
+ const computed = new this(first);
+
+ targets.forEach((target) => computed.set(target));
+
+ return computed;
+ }
+
+ static accessor(header) {
+ const internals = this[$internals] = (this[$internals] = {
+ accessors: {}
+ });
+
+ const accessors = internals.accessors;
+ const prototype = this.prototype;
+
+ function defineAccessor(_header) {
+ const lHeader = normalizeHeader(_header);
+
+ if (!accessors[lHeader]) {
+ buildAccessors(prototype, _header);
+ accessors[lHeader] = true;
+ }
+ }
+
+ utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
+
+ return this;
+ }
+}
+
+AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
+
+// reserved names hotfix
+utils.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {
+ let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
+ return {
+ get: () => value,
+ set(headerValue) {
+ this[mapped] = headerValue;
+ }
+ }
+});
+
+utils.freezeMethods(AxiosHeaders);
+
+export default AxiosHeaders;
diff --git a/node_modules/axios/lib/core/InterceptorManager.js b/node_modules/axios/lib/core/InterceptorManager.js
new file mode 100644
index 0000000..6657a9d
--- /dev/null
+++ b/node_modules/axios/lib/core/InterceptorManager.js
@@ -0,0 +1,71 @@
+'use strict';
+
+import utils from './../utils.js';
+
+class InterceptorManager {
+ constructor() {
+ this.handlers = [];
+ }
+
+ /**
+ * Add a new interceptor to the stack
+ *
+ * @param {Function} fulfilled The function to handle `then` for a `Promise`
+ * @param {Function} rejected The function to handle `reject` for a `Promise`
+ *
+ * @return {Number} An ID used to remove interceptor later
+ */
+ use(fulfilled, rejected, options) {
+ this.handlers.push({
+ fulfilled,
+ rejected,
+ synchronous: options ? options.synchronous : false,
+ runWhen: options ? options.runWhen : null
+ });
+ return this.handlers.length - 1;
+ }
+
+ /**
+ * Remove an interceptor from the stack
+ *
+ * @param {Number} id The ID that was returned by `use`
+ *
+ * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
+ */
+ eject(id) {
+ if (this.handlers[id]) {
+ this.handlers[id] = null;
+ }
+ }
+
+ /**
+ * Clear all interceptors from the stack
+ *
+ * @returns {void}
+ */
+ clear() {
+ if (this.handlers) {
+ this.handlers = [];
+ }
+ }
+
+ /**
+ * Iterate over all the registered interceptors
+ *
+ * This method is particularly useful for skipping over any
+ * interceptors that may have become `null` calling `eject`.
+ *
+ * @param {Function} fn The function to call for each interceptor
+ *
+ * @returns {void}
+ */
+ forEach(fn) {
+ utils.forEach(this.handlers, function forEachHandler(h) {
+ if (h !== null) {
+ fn(h);
+ }
+ });
+ }
+}
+
+export default InterceptorManager;
diff --git a/node_modules/axios/lib/core/README.md b/node_modules/axios/lib/core/README.md
new file mode 100644
index 0000000..84559ce
--- /dev/null
+++ b/node_modules/axios/lib/core/README.md
@@ -0,0 +1,8 @@
+# axios // core
+
+The modules found in `core/` should be modules that are specific to the domain logic of axios. These modules would most likely not make sense to be consumed outside of the axios module, as their logic is too specific. Some examples of core modules are:
+
+- Dispatching requests
+ - Requests sent via `adapters/` (see lib/adapters/README.md)
+- Managing interceptors
+- Handling config
diff --git a/node_modules/axios/lib/core/buildFullPath.js b/node_modules/axios/lib/core/buildFullPath.js
new file mode 100644
index 0000000..b60927c
--- /dev/null
+++ b/node_modules/axios/lib/core/buildFullPath.js
@@ -0,0 +1,21 @@
+'use strict';
+
+import isAbsoluteURL from '../helpers/isAbsoluteURL.js';
+import combineURLs from '../helpers/combineURLs.js';
+
+/**
+ * Creates a new URL by combining the baseURL with the requestedURL,
+ * only when the requestedURL is not already an absolute URL.
+ * If the requestURL is absolute, this function returns the requestedURL untouched.
+ *
+ * @param {string} baseURL The base URL
+ * @param {string} requestedURL Absolute or relative URL to combine
+ *
+ * @returns {string} The combined full path
+ */
+export default function buildFullPath(baseURL, requestedURL) {
+ if (baseURL && !isAbsoluteURL(requestedURL)) {
+ return combineURLs(baseURL, requestedURL);
+ }
+ return requestedURL;
+}
diff --git a/node_modules/axios/lib/core/dispatchRequest.js b/node_modules/axios/lib/core/dispatchRequest.js
new file mode 100644
index 0000000..9e306aa
--- /dev/null
+++ b/node_modules/axios/lib/core/dispatchRequest.js
@@ -0,0 +1,81 @@
+'use strict';
+
+import transformData from './transformData.js';
+import isCancel from '../cancel/isCancel.js';
+import defaults from '../defaults/index.js';
+import CanceledError from '../cancel/CanceledError.js';
+import AxiosHeaders from '../core/AxiosHeaders.js';
+import adapters from "../adapters/adapters.js";
+
+/**
+ * Throws a `CanceledError` if cancellation has been requested.
+ *
+ * @param {Object} config The config that is to be used for the request
+ *
+ * @returns {void}
+ */
+function throwIfCancellationRequested(config) {
+ if (config.cancelToken) {
+ config.cancelToken.throwIfRequested();
+ }
+
+ if (config.signal && config.signal.aborted) {
+ throw new CanceledError(null, config);
+ }
+}
+
+/**
+ * Dispatch a request to the server using the configured adapter.
+ *
+ * @param {object} config The config that is to be used for the request
+ *
+ * @returns {Promise} The Promise to be fulfilled
+ */
+export default function dispatchRequest(config) {
+ throwIfCancellationRequested(config);
+
+ config.headers = AxiosHeaders.from(config.headers);
+
+ // Transform request data
+ config.data = transformData.call(
+ config,
+ config.transformRequest
+ );
+
+ if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {
+ config.headers.setContentType('application/x-www-form-urlencoded', false);
+ }
+
+ const adapter = adapters.getAdapter(config.adapter || defaults.adapter);
+
+ return adapter(config).then(function onAdapterResolution(response) {
+ throwIfCancellationRequested(config);
+
+ // Transform response data
+ response.data = transformData.call(
+ config,
+ config.transformResponse,
+ response
+ );
+
+ response.headers = AxiosHeaders.from(response.headers);
+
+ return response;
+ }, function onAdapterRejection(reason) {
+ if (!isCancel(reason)) {
+ throwIfCancellationRequested(config);
+
+ // Transform response data
+ if (reason && reason.response) {
+ reason.response.data = transformData.call(
+ config,
+ config.transformResponse,
+ reason.response
+ );
+ reason.response.headers = AxiosHeaders.from(reason.response.headers);
+ }
+ }
+
+ return Promise.reject(reason);
+ });
+}
diff --git a/node_modules/axios/lib/core/mergeConfig.js b/node_modules/axios/lib/core/mergeConfig.js
new file mode 100644
index 0000000..bbbf96d
--- /dev/null
+++ b/node_modules/axios/lib/core/mergeConfig.js
@@ -0,0 +1,106 @@
+'use strict';
+
+import utils from '../utils.js';
+import AxiosHeaders from "./AxiosHeaders.js";
+
+const headersToObject = (thing) => thing instanceof AxiosHeaders ? thing.toJSON() : thing;
+
+/**
+ * Config-specific merge-function which creates a new config-object
+ * by merging two configuration objects together.
+ *
+ * @param {Object} config1
+ * @param {Object} config2
+ *
+ * @returns {Object} New object resulting from merging config2 to config1
+ */
+export default function mergeConfig(config1, config2) {
+ // eslint-disable-next-line no-param-reassign
+ config2 = config2 || {};
+ const config = {};
+
+ function getMergedValue(target, source, caseless) {
+ if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
+ return utils.merge.call({caseless}, target, source);
+ } else if (utils.isPlainObject(source)) {
+ return utils.merge({}, source);
+ } else if (utils.isArray(source)) {
+ return source.slice();
+ }
+ return source;
+ }
+
+ // eslint-disable-next-line consistent-return
+ function mergeDeepProperties(a, b, caseless) {
+ if (!utils.isUndefined(b)) {
+ return getMergedValue(a, b, caseless);
+ } else if (!utils.isUndefined(a)) {
+ return getMergedValue(undefined, a, caseless);
+ }
+ }
+
+ // eslint-disable-next-line consistent-return
+ function valueFromConfig2(a, b) {
+ if (!utils.isUndefined(b)) {
+ return getMergedValue(undefined, b);
+ }
+ }
+
+ // eslint-disable-next-line consistent-return
+ function defaultToConfig2(a, b) {
+ if (!utils.isUndefined(b)) {
+ return getMergedValue(undefined, b);
+ } else if (!utils.isUndefined(a)) {
+ return getMergedValue(undefined, a);
+ }
+ }
+
+ // eslint-disable-next-line consistent-return
+ function mergeDirectKeys(a, b, prop) {
+ if (prop in config2) {
+ return getMergedValue(a, b);
+ } else if (prop in config1) {
+ return getMergedValue(undefined, a);
+ }
+ }
+
+ const mergeMap = {
+ url: valueFromConfig2,
+ method: valueFromConfig2,
+ data: valueFromConfig2,
+ baseURL: defaultToConfig2,
+ transformRequest: defaultToConfig2,
+ transformResponse: defaultToConfig2,
+ paramsSerializer: defaultToConfig2,
+ timeout: defaultToConfig2,
+ timeoutMessage: defaultToConfig2,
+ withCredentials: defaultToConfig2,
+ withXSRFToken: defaultToConfig2,
+ adapter: defaultToConfig2,
+ responseType: defaultToConfig2,
+ xsrfCookieName: defaultToConfig2,
+ xsrfHeaderName: defaultToConfig2,
+ onUploadProgress: defaultToConfig2,
+ onDownloadProgress: defaultToConfig2,
+ decompress: defaultToConfig2,
+ maxContentLength: defaultToConfig2,
+ maxBodyLength: defaultToConfig2,
+ beforeRedirect: defaultToConfig2,
+ transport: defaultToConfig2,
+ httpAgent: defaultToConfig2,
+ httpsAgent: defaultToConfig2,
+ cancelToken: defaultToConfig2,
+ socketPath: defaultToConfig2,
+ responseEncoding: defaultToConfig2,
+ validateStatus: mergeDirectKeys,
+ headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
+ };
+
+ utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
+ const merge = mergeMap[prop] || mergeDeepProperties;
+ const configValue = merge(config1[prop], config2[prop], prop);
+ (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
+ });
+
+ return config;
+}
diff --git a/node_modules/axios/lib/core/settle.js b/node_modules/axios/lib/core/settle.js
new file mode 100644
index 0000000..ac905c4
--- /dev/null
+++ b/node_modules/axios/lib/core/settle.js
@@ -0,0 +1,27 @@
+'use strict';
+
+import AxiosError from './AxiosError.js';
+
+/**
+ * Resolve or reject a Promise based on response status.
+ *
+ * @param {Function} resolve A function that resolves the promise.
+ * @param {Function} reject A function that rejects the promise.
+ * @param {object} response The response.
+ *
+ * @returns {object} The response.
+ */
+export default function settle(resolve, reject, response) {
+ const validateStatus = response.config.validateStatus;
+ if (!response.status || !validateStatus || validateStatus(response.status)) {
+ resolve(response);
+ } else {
+ reject(new AxiosError(
+ 'Request failed with status code ' + response.status,
+ [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
+ response.config,
+ response.request,
+ response
+ ));
+ }
+}
diff --git a/node_modules/axios/lib/core/transformData.js b/node_modules/axios/lib/core/transformData.js
new file mode 100644
index 0000000..eeb5a8a
--- /dev/null
+++ b/node_modules/axios/lib/core/transformData.js
@@ -0,0 +1,28 @@
+'use strict';
+
+import utils from './../utils.js';
+import defaults from '../defaults/index.js';
+import AxiosHeaders from '../core/AxiosHeaders.js';
+
+/**
+ * Transform the data for a request or a response
+ *
+ * @param {Array|Function} fns A single function or Array of functions
+ * @param {?Object} response The response object
+ *
+ * @returns {*} The resulting transformed data
+ */
+export default function transformData(fns, response) {
+ const config = this || defaults;
+ const context = response || config;
+ const headers = AxiosHeaders.from(context.headers);
+ let data = context.data;
+
+ utils.forEach(fns, function transform(fn) {
+ data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);
+ });
+
+ headers.normalize();
+
+ return data;
+}
diff --git a/node_modules/axios/lib/defaults/index.js b/node_modules/axios/lib/defaults/index.js
new file mode 100644
index 0000000..774893a
--- /dev/null
+++ b/node_modules/axios/lib/defaults/index.js
@@ -0,0 +1,156 @@
+'use strict';
+
+import utils from '../utils.js';
+import AxiosError from '../core/AxiosError.js';
+import transitionalDefaults from './transitional.js';
+import toFormData from '../helpers/toFormData.js';
+import toURLEncodedForm from '../helpers/toURLEncodedForm.js';
+import platform from '../platform/index.js';
+import formDataToJSON from '../helpers/formDataToJSON.js';
+
+/**
+ * It takes a string, tries to parse it, and if it fails, it returns the stringified version
+ * of the input
+ *
+ * @param {any} rawValue - The value to be stringified.
+ * @param {Function} parser - A function that parses a string into a JavaScript object.
+ * @param {Function} encoder - A function that takes a value and returns a string.
+ *
+ * @returns {string} A stringified version of the rawValue.
+ */
+function stringifySafely(rawValue, parser, encoder) {
+ if (utils.isString(rawValue)) {
+ try {
+ (parser || JSON.parse)(rawValue);
+ return utils.trim(rawValue);
+ } catch (e) {
+ if (e.name !== 'SyntaxError') {
+ throw e;
+ }
+ }
+ }
+
+ return (encoder || JSON.stringify)(rawValue);
+}
+
+const defaults = {
+
+ transitional: transitionalDefaults,
+
+ adapter: ['xhr', 'http'],
+
+ transformRequest: [function transformRequest(data, headers) {
+ const contentType = headers.getContentType() || '';
+ const hasJSONContentType = contentType.indexOf('application/json') > -1;
+ const isObjectPayload = utils.isObject(data);
+
+ if (isObjectPayload && utils.isHTMLForm(data)) {
+ data = new FormData(data);
+ }
+
+ const isFormData = utils.isFormData(data);
+
+ if (isFormData) {
+ return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
+ }
+
+ if (utils.isArrayBuffer(data) ||
+ utils.isBuffer(data) ||
+ utils.isStream(data) ||
+ utils.isFile(data) ||
+ utils.isBlob(data)
+ ) {
+ return data;
+ }
+ if (utils.isArrayBufferView(data)) {
+ return data.buffer;
+ }
+ if (utils.isURLSearchParams(data)) {
+ headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
+ return data.toString();
+ }
+
+ let isFileList;
+
+ if (isObjectPayload) {
+ if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {
+ return toURLEncodedForm(data, this.formSerializer).toString();
+ }
+
+ if ((isFileList = utils.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {
+ const _FormData = this.env && this.env.FormData;
+
+ return toFormData(
+ isFileList ? {'files[]': data} : data,
+ _FormData && new _FormData(),
+ this.formSerializer
+ );
+ }
+ }
+
+ if (isObjectPayload || hasJSONContentType ) {
+ headers.setContentType('application/json', false);
+ return stringifySafely(data);
+ }
+
+ return data;
+ }],
+
+ transformResponse: [function transformResponse(data) {
+ const transitional = this.transitional || defaults.transitional;
+ const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
+ const JSONRequested = this.responseType === 'json';
+
+ if (data && utils.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {
+ const silentJSONParsing = transitional && transitional.silentJSONParsing;
+ const strictJSONParsing = !silentJSONParsing && JSONRequested;
+
+ try {
+ return JSON.parse(data);
+ } catch (e) {
+ if (strictJSONParsing) {
+ if (e.name === 'SyntaxError') {
+ throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);
+ }
+ throw e;
+ }
+ }
+ }
+
+ return data;
+ }],
+
+ /**
+ * A timeout in milliseconds to abort a request. If set to 0 (default) a
+ * timeout is not created.
+ */
+ timeout: 0,
+
+ xsrfCookieName: 'XSRF-TOKEN',
+ xsrfHeaderName: 'X-XSRF-TOKEN',
+
+ maxContentLength: -1,
+ maxBodyLength: -1,
+
+ env: {
+ FormData: platform.classes.FormData,
+ Blob: platform.classes.Blob
+ },
+
+ validateStatus: function validateStatus(status) {
+ return status >= 200 && status < 300;
+ },
+
+ headers: {
+ common: {
+ 'Accept': 'application/json, text/plain, */*',
+ 'Content-Type': undefined
+ }
+ }
+};
+
+utils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {
+ defaults.headers[method] = {};
+});
+
+export default defaults;
diff --git a/node_modules/axios/lib/defaults/transitional.js b/node_modules/axios/lib/defaults/transitional.js
new file mode 100644
index 0000000..f891331
--- /dev/null
+++ b/node_modules/axios/lib/defaults/transitional.js
@@ -0,0 +1,7 @@
+'use strict';
+
+export default {
+ silentJSONParsing: true,
+ forcedJSONParsing: true,
+ clarifyTimeoutError: false
+};
diff --git a/node_modules/axios/lib/env/README.md b/node_modules/axios/lib/env/README.md
new file mode 100644
index 0000000..b41baff
--- /dev/null
+++ b/node_modules/axios/lib/env/README.md
@@ -0,0 +1,3 @@
+# axios // env
+
+The `data.js` file is updated automatically when the package version is upgrading. Please do not edit it manually.
diff --git a/node_modules/axios/lib/env/classes/FormData.js b/node_modules/axios/lib/env/classes/FormData.js
new file mode 100644
index 0000000..862adb9
--- /dev/null
+++ b/node_modules/axios/lib/env/classes/FormData.js
@@ -0,0 +1,2 @@
+import _FormData from 'form-data';
+export default typeof FormData !== 'undefined' ? FormData : _FormData;
diff --git a/node_modules/axios/lib/env/data.js b/node_modules/axios/lib/env/data.js
new file mode 100644
index 0000000..7f15ca6
--- /dev/null
+++ b/node_modules/axios/lib/env/data.js
@@ -0,0 +1 @@
+export const VERSION = "1.6.7"; \ No newline at end of file
diff --git a/node_modules/axios/lib/helpers/AxiosTransformStream.js b/node_modules/axios/lib/helpers/AxiosTransformStream.js
new file mode 100644
index 0000000..8e8c6d4
--- /dev/null
+++ b/node_modules/axios/lib/helpers/AxiosTransformStream.js
@@ -0,0 +1,191 @@
+'use strict';
+
+import stream from 'stream';
+import utils from '../utils.js';
+import throttle from './throttle.js';
+import speedometer from './speedometer.js';
+
+const kInternals = Symbol('internals');
+
+class AxiosTransformStream extends stream.Transform{
+ constructor(options) {
+ options = utils.toFlatObject(options, {
+ maxRate: 0,
+ chunkSize: 64 * 1024,
+ minChunkSize: 100,
+ timeWindow: 500,
+ ticksRate: 2,
+ samplesCount: 15
+ }, null, (prop, source) => {
+ return !utils.isUndefined(source[prop]);
+ });
+
+ super({
+ readableHighWaterMark: options.chunkSize
+ });
+
+ const self = this;
+
+ const internals = this[kInternals] = {
+ length: options.length,
+ timeWindow: options.timeWindow,
+ ticksRate: options.ticksRate,
+ chunkSize: options.chunkSize,
+ maxRate: options.maxRate,
+ minChunkSize: options.minChunkSize,
+ bytesSeen: 0,
+ isCaptured: false,
+ notifiedBytesLoaded: 0,
+ ts: Date.now(),
+ bytes: 0,
+ onReadCallback: null
+ };
+
+ const _speedometer = speedometer(internals.ticksRate * options.samplesCount, internals.timeWindow);
+
+ this.on('newListener', event => {
+ if (event === 'progress') {
+ if (!internals.isCaptured) {
+ internals.isCaptured = true;
+ }
+ }
+ });
+
+ let bytesNotified = 0;
+
+ internals.updateProgress = throttle(function throttledHandler() {
+ const totalBytes = internals.length;
+ const bytesTransferred = internals.bytesSeen;
+ const progressBytes = bytesTransferred - bytesNotified;
+ if (!progressBytes || self.destroyed) return;
+
+ const rate = _speedometer(progressBytes);
+
+ bytesNotified = bytesTransferred;
+
+ process.nextTick(() => {
+ self.emit('progress', {
+ 'loaded': bytesTransferred,
+ 'total': totalBytes,
+ 'progress': totalBytes ? (bytesTransferred / totalBytes) : undefined,
+ 'bytes': progressBytes,
+ 'rate': rate ? rate : undefined,
+ 'estimated': rate && totalBytes && bytesTransferred <= totalBytes ?
+ (totalBytes - bytesTransferred) / rate : undefined
+ });
+ });
+ }, internals.ticksRate);
+
+ const onFinish = () => {
+ internals.updateProgress(true);
+ };
+
+ this.once('end', onFinish);
+ this.once('error', onFinish);
+ }
+
+ _read(size) {
+ const internals = this[kInternals];
+
+ if (internals.onReadCallback) {
+ internals.onReadCallback();
+ }
+
+ return super._read(size);
+ }
+
+ _transform(chunk, encoding, callback) {
+ const self = this;
+ const internals = this[kInternals];
+ const maxRate = internals.maxRate;
+
+ const readableHighWaterMark = this.readableHighWaterMark;
+
+ const timeWindow = internals.timeWindow;
+
+ const divider = 1000 / timeWindow;
+ const bytesThreshold = (maxRate / divider);
+ const minChunkSize = internals.minChunkSize !== false ? Math.max(internals.minChunkSize, bytesThreshold * 0.01) : 0;
+
+ function pushChunk(_chunk, _callback) {
+ const bytes = Buffer.byteLength(_chunk);
+ internals.bytesSeen += bytes;
+ internals.bytes += bytes;
+
+ if (internals.isCaptured) {
+ internals.updateProgress();
+ }
+
+ if (self.push(_chunk)) {
+ process.nextTick(_callback);
+ } else {
+ internals.onReadCallback = () => {
+ internals.onReadCallback = null;
+ process.nextTick(_callback);
+ };
+ }
+ }
+
+ const transformChunk = (_chunk, _callback) => {
+ const chunkSize = Buffer.byteLength(_chunk);
+ let chunkRemainder = null;
+ let maxChunkSize = readableHighWaterMark;
+ let bytesLeft;
+ let passed = 0;
+
+ if (maxRate) {
+ const now = Date.now();
+
+ if (!internals.ts || (passed = (now - internals.ts)) >= timeWindow) {
+ internals.ts = now;
+ bytesLeft = bytesThreshold - internals.bytes;
+ internals.bytes = bytesLeft < 0 ? -bytesLeft : 0;
+ passed = 0;
+ }
+
+ bytesLeft = bytesThreshold - internals.bytes;
+ }
+
+ if (maxRate) {
+ if (bytesLeft <= 0) {
+ // next time window
+ return setTimeout(() => {
+ _callback(null, _chunk);
+ }, timeWindow - passed);
+ }
+
+ if (bytesLeft < maxChunkSize) {
+ maxChunkSize = bytesLeft;
+ }
+ }
+
+ if (maxChunkSize && chunkSize > maxChunkSize && (chunkSize - maxChunkSize) > minChunkSize) {
+ chunkRemainder = _chunk.subarray(maxChunkSize);
+ _chunk = _chunk.subarray(0, maxChunkSize);
+ }
+
+ pushChunk(_chunk, chunkRemainder ? () => {
+ process.nextTick(_callback, null, chunkRemainder);
+ } : _callback);
+ };
+
+ transformChunk(chunk, function transformNextChunk(err, _chunk) {
+ if (err) {
+ return callback(err);
+ }
+
+ if (_chunk) {
+ transformChunk(_chunk, transformNextChunk);
+ } else {
+ callback(null);
+ }
+ });
+ }
+
+ setLength(length) {
+ this[kInternals].length = +length;
+ return this;
+ }
+}
+
+export default AxiosTransformStream;
diff --git a/node_modules/axios/lib/helpers/AxiosURLSearchParams.js b/node_modules/axios/lib/helpers/AxiosURLSearchParams.js
new file mode 100644
index 0000000..b9aa9f0
--- /dev/null
+++ b/node_modules/axios/lib/helpers/AxiosURLSearchParams.js
@@ -0,0 +1,58 @@
+'use strict';
+
+import toFormData from './toFormData.js';
+
+/**
+ * It encodes a string by replacing all characters that are not in the unreserved set with
+ * their percent-encoded equivalents
+ *
+ * @param {string} str - The string to encode.
+ *
+ * @returns {string} The encoded string.
+ */
+function encode(str) {
+ const charMap = {
+ '!': '%21',
+ "'": '%27',
+ '(': '%28',
+ ')': '%29',
+ '~': '%7E',
+ '%20': '+',
+ '%00': '\x00'
+ };
+ return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {
+ return charMap[match];
+ });
+}
+
+/**
+ * It takes a params object and converts it to a FormData object
+ *
+ * @param {Object<string, any>} params - The parameters to be converted to a FormData object.
+ * @param {Object<string, any>} options - The options object passed to the Axios constructor.
+ *
+ * @returns {void}
+ */
+function AxiosURLSearchParams(params, options) {
+ this._pairs = [];
+
+ params && toFormData(params, this, options);
+}
+
+const prototype = AxiosURLSearchParams.prototype;
+
+prototype.append = function append(name, value) {
+ this._pairs.push([name, value]);
+};
+
+prototype.toString = function toString(encoder) {
+ const _encode = encoder ? function(value) {
+ return encoder.call(this, value, encode);
+ } : encode;
+
+ return this._pairs.map(function each(pair) {
+ return _encode(pair[0]) + '=' + _encode(pair[1]);
+ }, '').join('&');
+};
+
+export default AxiosURLSearchParams;
diff --git a/node_modules/axios/lib/helpers/HttpStatusCode.js b/node_modules/axios/lib/helpers/HttpStatusCode.js
new file mode 100644
index 0000000..b3e7adc
--- /dev/null
+++ b/node_modules/axios/lib/helpers/HttpStatusCode.js
@@ -0,0 +1,71 @@
+const HttpStatusCode = {
+ Continue: 100,
+ SwitchingProtocols: 101,
+ Processing: 102,
+ EarlyHints: 103,
+ Ok: 200,
+ Created: 201,
+ Accepted: 202,
+ NonAuthoritativeInformation: 203,
+ NoContent: 204,
+ ResetContent: 205,
+ PartialContent: 206,
+ MultiStatus: 207,
+ AlreadyReported: 208,
+ ImUsed: 226,
+ MultipleChoices: 300,
+ MovedPermanently: 301,
+ Found: 302,
+ SeeOther: 303,
+ NotModified: 304,
+ UseProxy: 305,
+ Unused: 306,
+ TemporaryRedirect: 307,
+ PermanentRedirect: 308,
+ BadRequest: 400,
+ Unauthorized: 401,
+ PaymentRequired: 402,
+ Forbidden: 403,
+ NotFound: 404,
+ MethodNotAllowed: 405,
+ NotAcceptable: 406,
+ ProxyAuthenticationRequired: 407,
+ RequestTimeout: 408,
+ Conflict: 409,
+ Gone: 410,
+ LengthRequired: 411,
+ PreconditionFailed: 412,
+ PayloadTooLarge: 413,
+ UriTooLong: 414,
+ UnsupportedMediaType: 415,
+ RangeNotSatisfiable: 416,
+ ExpectationFailed: 417,
+ ImATeapot: 418,
+ MisdirectedRequest: 421,
+ UnprocessableEntity: 422,
+ Locked: 423,
+ FailedDependency: 424,
+ TooEarly: 425,
+ UpgradeRequired: 426,
+ PreconditionRequired: 428,
+ TooManyRequests: 429,
+ RequestHeaderFieldsTooLarge: 431,
+ UnavailableForLegalReasons: 451,
+ InternalServerError: 500,
+ NotImplemented: 501,
+ BadGateway: 502,
+ ServiceUnavailable: 503,
+ GatewayTimeout: 504,
+ HttpVersionNotSupported: 505,
+ VariantAlsoNegotiates: 506,
+ InsufficientStorage: 507,
+ LoopDetected: 508,
+ NotExtended: 510,
+ NetworkAuthenticationRequired: 511,
+};
+
+Object.entries(HttpStatusCode).forEach(([key, value]) => {
+ HttpStatusCode[value] = key;
+});
+
+export default HttpStatusCode;
diff --git a/node_modules/axios/lib/helpers/README.md b/node_modules/axios/lib/helpers/README.md
new file mode 100644
index 0000000..4ae3419
--- /dev/null
+++ b/node_modules/axios/lib/helpers/README.md
@@ -0,0 +1,7 @@
+# axios // helpers
+
+The modules found in `helpers/` should be generic modules that are _not_ specific to the domain logic of axios. These modules could theoretically be published to npm on their own and consumed by other modules or apps. Some examples of generic modules are things like:
+
+- Browser polyfills
+- Managing cookies
+- Parsing HTTP headers
diff --git a/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js b/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js
new file mode 100644
index 0000000..d1791f0
--- /dev/null
+++ b/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js
@@ -0,0 +1,28 @@
+"use strict";
+
+import stream from "stream";
+
+class ZlibHeaderTransformStream extends stream.Transform {
+ __transform(chunk, encoding, callback) {
+ this.push(chunk);
+ callback();
+ }
+
+ _transform(chunk, encoding, callback) {
+ if (chunk.length !== 0) {
+ this._transform = this.__transform;
+
+ // Add Default Compression headers if no zlib headers are present
+ if (chunk[0] !== 120) { // Hex: 78
+ const header = Buffer.alloc(2);
+ header[0] = 120; // Hex: 78
+ header[1] = 156; // Hex: 9C
+ this.push(header, encoding);
+ }
+ }
+
+ this.__transform(chunk, encoding, callback);
+ }
+}
+
+export default ZlibHeaderTransformStream;
diff --git a/node_modules/axios/lib/helpers/bind.js b/node_modules/axios/lib/helpers/bind.js
new file mode 100644
index 0000000..b3aa83b
--- /dev/null
+++ b/node_modules/axios/lib/helpers/bind.js
@@ -0,0 +1,7 @@
+'use strict';
+
+export default function bind(fn, thisArg) {
+ return function wrap() {
+ return fn.apply(thisArg, arguments);
+ };
+}
diff --git a/node_modules/axios/lib/helpers/buildURL.js b/node_modules/axios/lib/helpers/buildURL.js
new file mode 100644
index 0000000..d769fdf
--- /dev/null
+++ b/node_modules/axios/lib/helpers/buildURL.js
@@ -0,0 +1,63 @@
+'use strict';
+
+import utils from '../utils.js';
+import AxiosURLSearchParams from '../helpers/AxiosURLSearchParams.js';
+
+/**
+ * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their
+ * URI encoded counterparts
+ *
+ * @param {string} val The value to be encoded.
+ *
+ * @returns {string} The encoded value.
+ */
+function encode(val) {
+ return encodeURIComponent(val).
+ replace(/%3A/gi, ':').
+ replace(/%24/g, '$').
+ replace(/%2C/gi, ',').
+ replace(/%20/g, '+').
+ replace(/%5B/gi, '[').
+ replace(/%5D/gi, ']');
+}
+
+/**
+ * Build a URL by appending params to the end
+ *
+ * @param {string} url The base of the url (e.g., http://www.google.com)
+ * @param {object} [params] The params to be appended
+ * @param {?object} options
+ *
+ * @returns {string} The formatted url
+ */
+export default function buildURL(url, params, options) {
+ /*eslint no-param-reassign:0*/
+ if (!params) {
+ return url;
+ }
+
+ const _encode = options && options.encode || encode;
+
+ const serializeFn = options && options.serialize;
+
+ let serializedParams;
+
+ if (serializeFn) {
+ serializedParams = serializeFn(params, options);
+ } else {
+ serializedParams = utils.isURLSearchParams(params) ?
+ params.toString() :
+ new AxiosURLSearchParams(params, options).toString(_encode);
+ }
+
+ if (serializedParams) {
+ const hashmarkIndex = url.indexOf("#");
+
+ if (hashmarkIndex !== -1) {
+ url = url.slice(0, hashmarkIndex);
+ }
+ url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
+ }
+
+ return url;
+}
diff --git a/node_modules/axios/lib/helpers/callbackify.js b/node_modules/axios/lib/helpers/callbackify.js
new file mode 100644
index 0000000..4603bad
--- /dev/null
+++ b/node_modules/axios/lib/helpers/callbackify.js
@@ -0,0 +1,16 @@
+import utils from "../utils.js";
+
+const callbackify = (fn, reducer) => {
+ return utils.isAsyncFn(fn) ? function (...args) {
+ const cb = args.pop();
+ fn.apply(this, args).then((value) => {
+ try {
+ reducer ? cb(null, ...reducer(value)) : cb(null, value);
+ } catch (err) {
+ cb(err);
+ }
+ }, cb);
+ } : fn;
+}
+
+export default callbackify;
diff --git a/node_modules/axios/lib/helpers/combineURLs.js b/node_modules/axios/lib/helpers/combineURLs.js
new file mode 100644
index 0000000..9f04f02
--- /dev/null
+++ b/node_modules/axios/lib/helpers/combineURLs.js
@@ -0,0 +1,15 @@
+'use strict';
+
+/**
+ * Creates a new URL by combining the specified URLs
+ *
+ * @param {string} baseURL The base URL
+ * @param {string} relativeURL The relative URL
+ *
+ * @returns {string} The combined URL
+ */
+export default function combineURLs(baseURL, relativeURL) {
+ return relativeURL
+ ? baseURL.replace(/\/?\/$/, '') + '/' + relativeURL.replace(/^\/+/, '')
+ : baseURL;
+}
diff --git a/node_modules/axios/lib/helpers/cookies.js b/node_modules/axios/lib/helpers/cookies.js
new file mode 100644
index 0000000..d039ac4
--- /dev/null
+++ b/node_modules/axios/lib/helpers/cookies.js
@@ -0,0 +1,42 @@
+import utils from './../utils.js';
+import platform from '../platform/index.js';
+
+export default platform.hasStandardBrowserEnv ?
+
+ // Standard browser envs support document.cookie
+ {
+ write(name, value, expires, path, domain, secure) {
+ const cookie = [name + '=' + encodeURIComponent(value)];
+
+ utils.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());
+
+ utils.isString(path) && cookie.push('path=' + path);
+
+ utils.isString(domain) && cookie.push('domain=' + domain);
+
+ secure === true && cookie.push('secure');
+
+ document.cookie = cookie.join('; ');
+ },
+
+ read(name) {
+ const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
+ return (match ? decodeURIComponent(match[3]) : null);
+ },
+
+ remove(name) {
+ this.write(name, '', Date.now() - 86400000);
+ }
+ }
+
+ :
+
+ // Non-standard browser env (web workers, react-native) lack needed support.
+ {
+ write() {},
+ read() {
+ return null;
+ },
+ remove() {}
+ };
+
diff --git a/node_modules/axios/lib/helpers/deprecatedMethod.js b/node_modules/axios/lib/helpers/deprecatedMethod.js
new file mode 100644
index 0000000..9e8fae6
--- /dev/null
+++ b/node_modules/axios/lib/helpers/deprecatedMethod.js
@@ -0,0 +1,26 @@
+'use strict';
+
+/*eslint no-console:0*/
+
+/**
+ * Supply a warning to the developer that a method they are using
+ * has been deprecated.
+ *
+ * @param {string} method The name of the deprecated method
+ * @param {string} [instead] The alternate method to use if applicable
+ * @param {string} [docs] The documentation URL to get further details
+ *
+ * @returns {void}
+ */
+export default function deprecatedMethod(method, instead, docs) {
+ try {
+ console.warn(
+ 'DEPRECATED method `' + method + '`.' +
+ (instead ? ' Use `' + instead + '` instead.' : '') +
+ ' This method will be removed in a future release.');
+
+ if (docs) {
+ console.warn('For more information about usage see ' + docs);
+ }
+ } catch (e) { /* Ignore */ }
+}
diff --git a/node_modules/axios/lib/helpers/formDataToJSON.js b/node_modules/axios/lib/helpers/formDataToJSON.js
new file mode 100644
index 0000000..906ce60
--- /dev/null
+++ b/node_modules/axios/lib/helpers/formDataToJSON.js
@@ -0,0 +1,95 @@
+'use strict';
+
+import utils from '../utils.js';
+
+/**
+ * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']
+ *
+ * @param {string} name - The name of the property to get.
+ *
+ * @returns An array of strings.
+ */
+function parsePropPath(name) {
+ // foo[x][y][z]
+ // foo.x.y.z
+ // foo-x-y-z
+ // foo x y z
+ return utils.matchAll(/\w+|\[(\w*)]/g, name).map(match => {
+ return match[0] === '[]' ? '' : match[1] || match[0];
+ });
+}
+
+/**
+ * Convert an array to an object.
+ *
+ * @param {Array<any>} arr - The array to convert to an object.
+ *
+ * @returns An object with the same keys and values as the array.
+ */
+function arrayToObject(arr) {
+ const obj = {};
+ const keys = Object.keys(arr);
+ let i;
+ const len = keys.length;
+ let key;
+ for (i = 0; i < len; i++) {
+ key = keys[i];
+ obj[key] = arr[key];
+ }
+ return obj;
+}
+
+/**
+ * It takes a FormData object and returns a JavaScript object
+ *
+ * @param {string} formData The FormData object to convert to JSON.
+ *
+ * @returns {Object<string, any> | null} The converted object.
+ */
+function formDataToJSON(formData) {
+ function buildPath(path, value, target, index) {
+ let name = path[index++];
+
+ if (name === '__proto__') return true;
+
+ const isNumericKey = Number.isFinite(+name);
+ const isLast = index >= path.length;
+ name = !name && utils.isArray(target) ? target.length : name;
+
+ if (isLast) {
+ if (utils.hasOwnProp(target, name)) {
+ target[name] = [target[name], value];
+ } else {
+ target[name] = value;
+ }
+
+ return !isNumericKey;
+ }
+
+ if (!target[name] || !utils.isObject(target[name])) {
+ target[name] = [];
+ }
+
+ const result = buildPath(path, value, target[name], index);
+
+ if (result && utils.isArray(target[name])) {
+ target[name] = arrayToObject(target[name]);
+ }
+
+ return !isNumericKey;
+ }
+
+ if (utils.isFormData(formData) && utils.isFunction(formData.entries)) {
+ const obj = {};
+
+ utils.forEachEntry(formData, (name, value) => {
+ buildPath(parsePropPath(name), value, obj, 0);
+ });
+
+ return obj;
+ }
+
+ return null;
+}
+
+export default formDataToJSON;
diff --git a/node_modules/axios/lib/helpers/formDataToStream.js b/node_modules/axios/lib/helpers/formDataToStream.js
new file mode 100644
index 0000000..9187e73
--- /dev/null
+++ b/node_modules/axios/lib/helpers/formDataToStream.js
@@ -0,0 +1,111 @@
+import {TextEncoder} from 'util';
+import {Readable} from 'stream';
+import utils from "../utils.js";
+import readBlob from "./readBlob.js";
+
+const BOUNDARY_ALPHABET = utils.ALPHABET.ALPHA_DIGIT + '-_';
+
+const textEncoder = new TextEncoder();
+
+const CRLF = '\r\n';
+const CRLF_BYTES = textEncoder.encode(CRLF);
+const CRLF_BYTES_COUNT = 2;
+
+class FormDataPart {
+ constructor(name, value) {
+ const {escapeName} = this.constructor;
+ const isStringValue = utils.isString(value);
+
+ let headers = `Content-Disposition: form-data; name="${escapeName(name)}"${
+ !isStringValue && value.name ? `; filename="${escapeName(value.name)}"` : ''
+ }${CRLF}`;
+
+ if (isStringValue) {
+ value = textEncoder.encode(String(value).replace(/\r?\n|\r\n?/g, CRLF));
+ } else {
+ headers += `Content-Type: ${value.type || "application/octet-stream"}${CRLF}`
+ }
+
+ this.headers = textEncoder.encode(headers + CRLF);
+
+ this.contentLength = isStringValue ? value.byteLength : value.size;
+
+ this.size = this.headers.byteLength + this.contentLength + CRLF_BYTES_COUNT;
+
+ this.name = name;
+ this.value = value;
+ }
+
+ async *encode(){
+ yield this.headers;
+
+ const {value} = this;
+
+ if(utils.isTypedArray(value)) {
+ yield value;
+ } else {
+ yield* readBlob(value);
+ }
+
+ yield CRLF_BYTES;
+ }
+
+ static escapeName(name) {
+ return String(name).replace(/[\r\n"]/g, (match) => ({
+ '\r' : '%0D',
+ '\n' : '%0A',
+ '"' : '%22',
+ }[match]));
+ }
+}
+
+const formDataToStream = (form, headersHandler, options) => {
+ const {
+ tag = 'form-data-boundary',
+ size = 25,
+ boundary = tag + '-' + utils.generateString(size, BOUNDARY_ALPHABET)
+ } = options || {};
+
+ if(!utils.isFormData(form)) {
+ throw TypeError('FormData instance required');
+ }
+
+ if (boundary.length < 1 || boundary.length > 70) {
+ throw Error('boundary must be 10-70 characters long')
+ }
+
+ const boundaryBytes = textEncoder.encode('--' + boundary + CRLF);
+ const footerBytes = textEncoder.encode('--' + boundary + '--' + CRLF + CRLF);
+ let contentLength = footerBytes.byteLength;
+
+ const parts = Array.from(form.entries()).map(([name, value]) => {
+ const part = new FormDataPart(name, value);
+ contentLength += part.size;
+ return part;
+ });
+
+ contentLength += boundaryBytes.byteLength * parts.length;
+
+ contentLength = utils.toFiniteNumber(contentLength);
+
+ const computedHeaders = {
+ 'Content-Type': `multipart/form-data; boundary=${boundary}`
+ }
+
+ if (Number.isFinite(contentLength)) {
+ computedHeaders['Content-Length'] = contentLength;
+ }
+
+ headersHandler && headersHandler(computedHeaders);
+
+ return Readable.from((async function *() {
+ for(const part of parts) {
+ yield boundaryBytes;
+ yield* part.encode();
+ }
+
+ yield footerBytes;
+ })());
+};
+
+export default formDataToStream;
diff --git a/node_modules/axios/lib/helpers/fromDataURI.js b/node_modules/axios/lib/helpers/fromDataURI.js
new file mode 100644
index 0000000..eb71d3f
--- /dev/null
+++ b/node_modules/axios/lib/helpers/fromDataURI.js
@@ -0,0 +1,53 @@
+'use strict';
+
+import AxiosError from '../core/AxiosError.js';
+import parseProtocol from './parseProtocol.js';
+import platform from '../platform/index.js';
+
+const DATA_URL_PATTERN = /^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;
+
+/**
+ * Parse data uri to a Buffer or Blob
+ *
+ * @param {String} uri
+ * @param {?Boolean} asBlob
+ * @param {?Object} options
+ * @param {?Function} options.Blob
+ *
+ * @returns {Buffer|Blob}
+ */
+export default function fromDataURI(uri, asBlob, options) {
+ const _Blob = options && options.Blob || platform.classes.Blob;
+ const protocol = parseProtocol(uri);
+
+ if (asBlob === undefined && _Blob) {
+ asBlob = true;
+ }
+
+ if (protocol === 'data') {
+ uri = protocol.length ? uri.slice(protocol.length + 1) : uri;
+
+ const match = DATA_URL_PATTERN.exec(uri);
+
+ if (!match) {
+ throw new AxiosError('Invalid URL', AxiosError.ERR_INVALID_URL);
+ }
+
+ const mime = match[1];
+ const isBase64 = match[2];
+ const body = match[3];
+ const buffer = Buffer.from(decodeURIComponent(body), isBase64 ? 'base64' : 'utf8');
+
+ if (asBlob) {
+ if (!_Blob) {
+ throw new AxiosError('Blob is not supported', AxiosError.ERR_NOT_SUPPORT);
+ }
+
+ return new _Blob([buffer], {type: mime});
+ }
+
+ return buffer;
+ }
+
+ throw new AxiosError('Unsupported protocol ' + protocol, AxiosError.ERR_NOT_SUPPORT);
+}
diff --git a/node_modules/axios/lib/helpers/isAbsoluteURL.js b/node_modules/axios/lib/helpers/isAbsoluteURL.js
new file mode 100644
index 0000000..4747a45
--- /dev/null
+++ b/node_modules/axios/lib/helpers/isAbsoluteURL.js
@@ -0,0 +1,15 @@
+'use strict';
+
+/**
+ * Determines whether the specified URL is absolute
+ *
+ * @param {string} url The URL to test
+ *
+ * @returns {boolean} True if the specified URL is absolute, otherwise false
+ */
+export default function isAbsoluteURL(url) {
+ // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
+ // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
+ // by any combination of letters, digits, plus, period, or hyphen.
+ return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
+}
diff --git a/node_modules/axios/lib/helpers/isAxiosError.js b/node_modules/axios/lib/helpers/isAxiosError.js
new file mode 100644
index 0000000..da6cd63
--- /dev/null
+++ b/node_modules/axios/lib/helpers/isAxiosError.js
@@ -0,0 +1,14 @@
+'use strict';
+
+import utils from './../utils.js';
+
+/**
+ * Determines whether the payload is an error thrown by Axios
+ *
+ * @param {*} payload The value to test
+ *
+ * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
+ */
+export default function isAxiosError(payload) {
+ return utils.isObject(payload) && (payload.isAxiosError === true);
+}
diff --git a/node_modules/axios/lib/helpers/isURLSameOrigin.js b/node_modules/axios/lib/helpers/isURLSameOrigin.js
new file mode 100644
index 0000000..a8678a4
--- /dev/null
+++ b/node_modules/axios/lib/helpers/isURLSameOrigin.js
@@ -0,0 +1,67 @@
+'use strict';
+
+import utils from './../utils.js';
+import platform from '../platform/index.js';
+
+export default platform.hasStandardBrowserEnv ?
+
+// Standard browser envs have full support of the APIs needed to test
+// whether the request URL is of the same origin as current location.
+ (function standardBrowserEnv() {
+ const msie = /(msie|trident)/i.test(navigator.userAgent);
+ const urlParsingNode = document.createElement('a');
+ let originURL;
+
+ /**
+ * Parse a URL to discover its components
+ *
+ * @param {String} url The URL to be parsed
+ * @returns {Object}
+ */
+ function resolveURL(url) {
+ let href = url;
+
+ if (msie) {
+ // IE needs attribute set twice to normalize properties
+ urlParsingNode.setAttribute('href', href);
+ href = urlParsingNode.href;
+ }
+
+ urlParsingNode.setAttribute('href', href);
+
+ // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
+ return {
+ href: urlParsingNode.href,
+ protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
+ host: urlParsingNode.host,
+ search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
+ hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
+ hostname: urlParsingNode.hostname,
+ port: urlParsingNode.port,
+ pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
+ urlParsingNode.pathname :
+ '/' + urlParsingNode.pathname
+ };
+ }
+
+ originURL = resolveURL(window.location.href);
+
+ /**
+ * Determine if a URL shares the same origin as the current location
+ *
+ * @param {String} requestURL The URL to test
+ * @returns {boolean} True if URL shares the same origin, otherwise false
+ */
+ return function isURLSameOrigin(requestURL) {
+ const parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
+ return (parsed.protocol === originURL.protocol &&
+ parsed.host === originURL.host);
+ };
+ })() :
+
+ // Non standard browser envs (web workers, react-native) lack needed support.
+ (function nonStandardBrowserEnv() {
+ return function isURLSameOrigin() {
+ return true;
+ };
+ })();
diff --git a/node_modules/axios/lib/helpers/null.js b/node_modules/axios/lib/helpers/null.js
new file mode 100644
index 0000000..b9f82c4
--- /dev/null
+++ b/node_modules/axios/lib/helpers/null.js
@@ -0,0 +1,2 @@
+// eslint-disable-next-line strict
+export default null;
diff --git a/node_modules/axios/lib/helpers/parseHeaders.js b/node_modules/axios/lib/helpers/parseHeaders.js
new file mode 100644
index 0000000..50af948
--- /dev/null
+++ b/node_modules/axios/lib/helpers/parseHeaders.js
@@ -0,0 +1,55 @@
+'use strict';
+
+import utils from './../utils.js';
+
+// RawAxiosHeaders whose duplicates are ignored by node
+// c.f. https://nodejs.org/api/http.html#http_message_headers
+const ignoreDuplicateOf = utils.toObjectSet([
+ 'age', 'authorization', 'content-length', 'content-type', 'etag',
+ 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
+ 'last-modified', 'location', 'max-forwards', 'proxy-authorization',
+ 'referer', 'retry-after', 'user-agent'
+]);
+
+/**
+ * Parse headers into an object
+ *
+ * ```
+ * Date: Wed, 27 Aug 2014 08:58:49 GMT
+ * Content-Type: application/json
+ * Connection: keep-alive
+ * Transfer-Encoding: chunked
+ * ```
+ *
+ * @param {String} rawHeaders Headers needing to be parsed
+ *
+ * @returns {Object} Headers parsed into an object
+ */
+export default rawHeaders => {
+ const parsed = {};
+ let key;
+ let val;
+ let i;
+
+ rawHeaders && rawHeaders.split('\n').forEach(function parser(line) {
+ i = line.indexOf(':');
+ key = line.substring(0, i).trim().toLowerCase();
+ val = line.substring(i + 1).trim();
+
+ if (!key || (parsed[key] && ignoreDuplicateOf[key])) {
+ return;
+ }
+
+ if (key === 'set-cookie') {
+ if (parsed[key]) {
+ parsed[key].push(val);
+ } else {
+ parsed[key] = [val];
+ }
+ } else {
+ parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
+ }
+ });
+
+ return parsed;
+};
diff --git a/node_modules/axios/lib/helpers/parseProtocol.js b/node_modules/axios/lib/helpers/parseProtocol.js
new file mode 100644
index 0000000..586ec96
--- /dev/null
+++ b/node_modules/axios/lib/helpers/parseProtocol.js
@@ -0,0 +1,6 @@
+'use strict';
+
+export default function parseProtocol(url) {
+ const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
+ return match && match[1] || '';
+}
diff --git a/node_modules/axios/lib/helpers/readBlob.js b/node_modules/axios/lib/helpers/readBlob.js
new file mode 100644
index 0000000..6de748e
--- /dev/null
+++ b/node_modules/axios/lib/helpers/readBlob.js
@@ -0,0 +1,15 @@
+const {asyncIterator} = Symbol;
+
+const readBlob = async function* (blob) {
+ if (blob.stream) {
+ yield* blob.stream()
+ } else if (blob.arrayBuffer) {
+ yield await blob.arrayBuffer()
+ } else if (blob[asyncIterator]) {
+ yield* blob[asyncIterator]();
+ } else {
+ yield blob;
+ }
+}
+
+export default readBlob;
diff --git a/node_modules/axios/lib/helpers/speedometer.js b/node_modules/axios/lib/helpers/speedometer.js
new file mode 100644
index 0000000..3b3c666
--- /dev/null
+++ b/node_modules/axios/lib/helpers/speedometer.js
@@ -0,0 +1,55 @@
+'use strict';
+
+/**
+ * Calculate data maxRate
+ * @param {Number} [samplesCount= 10]
+ * @param {Number} [min= 1000]
+ * @returns {Function}
+ */
+function speedometer(samplesCount, min) {
+ samplesCount = samplesCount || 10;
+ const bytes = new Array(samplesCount);
+ const timestamps = new Array(samplesCount);
+ let head = 0;
+ let tail = 0;
+ let firstSampleTS;
+
+ min = min !== undefined ? min : 1000;
+
+ return function push(chunkLength) {
+ const now = Date.now();
+
+ const startedAt = timestamps[tail];
+
+ if (!firstSampleTS) {
+ firstSampleTS = now;
+ }
+
+ bytes[head] = chunkLength;
+ timestamps[head] = now;
+
+ let i = tail;
+ let bytesCount = 0;
+
+ while (i !== head) {
+ bytesCount += bytes[i++];
+ i = i % samplesCount;
+ }
+
+ head = (head + 1) % samplesCount;
+
+ if (head === tail) {
+ tail = (tail + 1) % samplesCount;
+ }
+
+ if (now - firstSampleTS < min) {
+ return;
+ }
+
+ const passed = startedAt && now - startedAt;
+
+ return passed ? Math.round(bytesCount * 1000 / passed) : undefined;
+ };
+}
+
+export default speedometer;
diff --git a/node_modules/axios/lib/helpers/spread.js b/node_modules/axios/lib/helpers/spread.js
new file mode 100644
index 0000000..13479cb
--- /dev/null
+++ b/node_modules/axios/lib/helpers/spread.js
@@ -0,0 +1,28 @@
+'use strict';
+
+/**
+ * Syntactic sugar for invoking a function and expanding an array for arguments.
+ *
+ * Common use case would be to use `Function.prototype.apply`.
+ *
+ * ```js
+ * function f(x, y, z) {}
+ * var args = [1, 2, 3];
+ * f.apply(null, args);
+ * ```
+ *
+ * With `spread` this example can be re-written.
+ *
+ * ```js
+ * spread(function(x, y, z) {})([1, 2, 3]);
+ * ```
+ *
+ * @param {Function} callback
+ *
+ * @returns {Function}
+ */
+export default function spread(callback) {
+ return function wrap(arr) {
+ return callback.apply(null, arr);
+ };
+}
diff --git a/node_modules/axios/lib/helpers/throttle.js b/node_modules/axios/lib/helpers/throttle.js
new file mode 100644
index 0000000..6969df1
--- /dev/null
+++ b/node_modules/axios/lib/helpers/throttle.js
@@ -0,0 +1,33 @@
+'use strict';
+
+/**
+ * Throttle decorator
+ * @param {Function} fn
+ * @param {Number} freq
+ * @return {Function}
+ */
+function throttle(fn, freq) {
+ let timestamp = 0;
+ const threshold = 1000 / freq;
+ let timer = null;
+ return function throttled(force, args) {
+ const now = Date.now();
+ if (force || now - timestamp > threshold) {
+ if (timer) {
+ clearTimeout(timer);
+ timer = null;
+ }
+ timestamp = now;
+ return fn.apply(null, args);
+ }
+ if (!timer) {
+ timer = setTimeout(() => {
+ timer = null;
+ timestamp = Date.now();
+ return fn.apply(null, args);
+ }, threshold - (now - timestamp));
+ }
+ };
+}
+
+export default throttle;
diff --git a/node_modules/axios/lib/helpers/toFormData.js b/node_modules/axios/lib/helpers/toFormData.js
new file mode 100644
index 0000000..a41e966
--- /dev/null
+++ b/node_modules/axios/lib/helpers/toFormData.js
@@ -0,0 +1,219 @@
+'use strict';
+
+import utils from '../utils.js';
+import AxiosError from '../core/AxiosError.js';
+// temporary hotfix to avoid circular references until AxiosURLSearchParams is refactored
+import PlatformFormData from '../platform/node/classes/FormData.js';
+
+/**
+ * Determines if the given thing is a array or js object.
+ *
+ * @param {string} thing - The object or array to be visited.
+ *
+ * @returns {boolean}
+ */
+function isVisitable(thing) {
+ return utils.isPlainObject(thing) || utils.isArray(thing);
+}
+
+/**
+ * It removes the brackets from the end of a string
+ *
+ * @param {string} key - The key of the parameter.
+ *
+ * @returns {string} the key without the brackets.
+ */
+function removeBrackets(key) {
+ return utils.endsWith(key, '[]') ? key.slice(0, -2) : key;
+}
+
+/**
+ * It takes a path, a key, and a boolean, and returns a string
+ *
+ * @param {string} path - The path to the current key.
+ * @param {string} key - The key of the current object being iterated over.
+ * @param {string} dots - If true, the key will be rendered with dots instead of brackets.
+ *
+ * @returns {string} The path to the current key.
+ */
+function renderKey(path, key, dots) {
+ if (!path) return key;
+ return path.concat(key).map(function each(token, i) {
+ // eslint-disable-next-line no-param-reassign
+ token = removeBrackets(token);
+ return !dots && i ? '[' + token + ']' : token;
+ }).join(dots ? '.' : '');
+}
+
+/**
+ * If the array is an array and none of its elements are visitable, then it's a flat array.
+ *
+ * @param {Array<any>} arr - The array to check
+ *
+ * @returns {boolean}
+ */
+function isFlatArray(arr) {
+ return utils.isArray(arr) && !arr.some(isVisitable);
+}
+
+const predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {
+ return /^is[A-Z]/.test(prop);
+});
+
+/**
+ * Convert a data object to FormData
+ *
+ * @param {Object} obj
+ * @param {?Object} [formData]
+ * @param {?Object} [options]
+ * @param {Function} [options.visitor]
+ * @param {Boolean} [options.metaTokens = true]
+ * @param {Boolean} [options.dots = false]
+ * @param {?Boolean} [options.indexes = false]
+ *
+ * @returns {Object}
+ **/
+
+/**
+ * It converts an object into a FormData object
+ *
+ * @param {Object<any, any>} obj - The object to convert to form data.
+ * @param {string} formData - The FormData object to append to.
+ * @param {Object<string, any>} options
+ *
+ * @returns
+ */
+function toFormData(obj, formData, options) {
+ if (!utils.isObject(obj)) {
+ throw new TypeError('target must be an object');
+ }
+
+ // eslint-disable-next-line no-param-reassign
+ formData = formData || new (PlatformFormData || FormData)();
+
+ // eslint-disable-next-line no-param-reassign
+ options = utils.toFlatObject(options, {
+ metaTokens: true,
+ dots: false,
+ indexes: false
+ }, false, function defined(option, source) {
+ // eslint-disable-next-line no-eq-null,eqeqeq
+ return !utils.isUndefined(source[option]);
+ });
+
+ const metaTokens = options.metaTokens;
+ // eslint-disable-next-line no-use-before-define
+ const visitor = options.visitor || defaultVisitor;
+ const dots = options.dots;
+ const indexes = options.indexes;
+ const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;
+ const useBlob = _Blob && utils.isSpecCompliantForm(formData);
+
+ if (!utils.isFunction(visitor)) {
+ throw new TypeError('visitor must be a function');
+ }
+
+ function convertValue(value) {
+ if (value === null) return '';
+
+ if (utils.isDate(value)) {
+ return value.toISOString();
+ }
+
+ if (!useBlob && utils.isBlob(value)) {
+ throw new AxiosError('Blob is not supported. Use a Buffer instead.');
+ }
+
+ if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {
+ return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
+ }
+
+ return value;
+ }
+
+ /**
+ * Default visitor.
+ *
+ * @param {*} value
+ * @param {String|Number} key
+ * @param {Array<String|Number>} path
+ * @this {FormData}
+ *
+ * @returns {boolean} return true to visit the each prop of the value recursively
+ */
+ function defaultVisitor(value, key, path) {
+ let arr = value;
+
+ if (value && !path && typeof value === 'object') {
+ if (utils.endsWith(key, '{}')) {
+ // eslint-disable-next-line no-param-reassign
+ key = metaTokens ? key : key.slice(0, -2);
+ // eslint-disable-next-line no-param-reassign
+ value = JSON.stringify(value);
+ } else if (
+ (utils.isArray(value) && isFlatArray(value)) ||
+ ((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value))
+ )) {
+ // eslint-disable-next-line no-param-reassign
+ key = removeBrackets(key);
+
+ arr.forEach(function each(el, index) {
+ !(utils.isUndefined(el) || el === null) && formData.append(
+ // eslint-disable-next-line no-nested-ternary
+ indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),
+ convertValue(el)
+ );
+ });
+ return false;
+ }
+ }
+
+ if (isVisitable(value)) {
+ return true;
+ }
+
+ formData.append(renderKey(path, key, dots), convertValue(value));
+
+ return false;
+ }
+
+ const stack = [];
+
+ const exposedHelpers = Object.assign(predicates, {
+ defaultVisitor,
+ convertValue,
+ isVisitable
+ });
+
+ function build(value, path) {
+ if (utils.isUndefined(value)) return;
+
+ if (stack.indexOf(value) !== -1) {
+ throw Error('Circular reference detected in ' + path.join('.'));
+ }
+
+ stack.push(value);
+
+ utils.forEach(value, function each(el, key) {
+ const result = !(utils.isUndefined(el) || el === null) && visitor.call(
+ formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers
+ );
+
+ if (result === true) {
+ build(el, path ? path.concat(key) : [key]);
+ }
+ });
+
+ stack.pop();
+ }
+
+ if (!utils.isObject(obj)) {
+ throw new TypeError('data must be an object');
+ }
+
+ build(obj);
+
+ return formData;
+}
+
+export default toFormData;
diff --git a/node_modules/axios/lib/helpers/toURLEncodedForm.js b/node_modules/axios/lib/helpers/toURLEncodedForm.js
new file mode 100644
index 0000000..988a38a
--- /dev/null
+++ b/node_modules/axios/lib/helpers/toURLEncodedForm.js
@@ -0,0 +1,18 @@
+'use strict';
+
+import utils from '../utils.js';
+import toFormData from './toFormData.js';
+import platform from '../platform/index.js';
+
+export default function toURLEncodedForm(data, options) {
+ return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({
+ visitor: function(value, key, path, helpers) {
+ if (platform.isNode && utils.isBuffer(value)) {
+ this.append(key, value.toString('base64'));
+ return false;
+ }
+
+ return helpers.defaultVisitor.apply(this, arguments);
+ }
+ }, options));
+}
diff --git a/node_modules/axios/lib/helpers/validator.js b/node_modules/axios/lib/helpers/validator.js
new file mode 100644
index 0000000..14b4696
--- /dev/null
+++ b/node_modules/axios/lib/helpers/validator.js
@@ -0,0 +1,91 @@
+'use strict';
+
+import {VERSION} from '../env/data.js';
+import AxiosError from '../core/AxiosError.js';
+
+const validators = {};
+
+// eslint-disable-next-line func-names
+['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => {
+ validators[type] = function validator(thing) {
+ return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;
+ };
+});
+
+const deprecatedWarnings = {};
+
+/**
+ * Transitional option validator
+ *
+ * @param {function|boolean?} validator - set to false if the transitional option has been removed
+ * @param {string?} version - deprecated version / removed since version
+ * @param {string?} message - some message with additional info
+ *
+ * @returns {function}
+ */
+validators.transitional = function transitional(validator, version, message) {
+ function formatMessage(opt, desc) {
+ return '[Axios v' + VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : '');
+ }
+
+ // eslint-disable-next-line func-names
+ return (value, opt, opts) => {
+ if (validator === false) {
+ throw new AxiosError(
+ formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),
+ AxiosError.ERR_DEPRECATED
+ );
+ }
+
+ if (version && !deprecatedWarnings[opt]) {
+ deprecatedWarnings[opt] = true;
+ // eslint-disable-next-line no-console
+ console.warn(
+ formatMessage(
+ opt,
+ ' has been deprecated since v' + version + ' and will be removed in the near future'
+ )
+ );
+ }
+
+ return validator ? validator(value, opt, opts) : true;
+ };
+};
+
+/**
+ * Assert object's properties type
+ *
+ * @param {object} options
+ * @param {object} schema
+ * @param {boolean?} allowUnknown
+ *
+ * @returns {object}
+ */
+
+function assertOptions(options, schema, allowUnknown) {
+ if (typeof options !== 'object') {
+ throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);
+ }
+ const keys = Object.keys(options);
+ let i = keys.length;
+ while (i-- > 0) {
+ const opt = keys[i];
+ const validator = schema[opt];
+ if (validator) {
+ const value = options[opt];
+ const result = value === undefined || validator(value, opt, options);
+ if (result !== true) {
+ throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);
+ }
+ continue;
+ }
+ if (allowUnknown !== true) {
+ throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);
+ }
+ }
+}
+
+export default {
+ assertOptions,
+ validators
+};
diff --git a/node_modules/axios/lib/platform/browser/classes/Blob.js b/node_modules/axios/lib/platform/browser/classes/Blob.js
new file mode 100644
index 0000000..6c506c4
--- /dev/null
+++ b/node_modules/axios/lib/platform/browser/classes/Blob.js
@@ -0,0 +1,3 @@
+'use strict'
+
+export default typeof Blob !== 'undefined' ? Blob : null
diff --git a/node_modules/axios/lib/platform/browser/classes/FormData.js b/node_modules/axios/lib/platform/browser/classes/FormData.js
new file mode 100644
index 0000000..f36d31b
--- /dev/null
+++ b/node_modules/axios/lib/platform/browser/classes/FormData.js
@@ -0,0 +1,3 @@
+'use strict';
+
+export default typeof FormData !== 'undefined' ? FormData : null;
diff --git a/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js b/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js
new file mode 100644
index 0000000..b7dae95
--- /dev/null
+++ b/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js
@@ -0,0 +1,4 @@
+'use strict';
+
+import AxiosURLSearchParams from '../../../helpers/AxiosURLSearchParams.js';
+export default typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;
diff --git a/node_modules/axios/lib/platform/browser/index.js b/node_modules/axios/lib/platform/browser/index.js
new file mode 100644
index 0000000..08c206f
--- /dev/null
+++ b/node_modules/axios/lib/platform/browser/index.js
@@ -0,0 +1,13 @@
+import URLSearchParams from './classes/URLSearchParams.js'
+import FormData from './classes/FormData.js'
+import Blob from './classes/Blob.js'
+
+export default {
+ isBrowser: true,
+ classes: {
+ URLSearchParams,
+ FormData,
+ Blob
+ },
+ protocols: ['http', 'https', 'file', 'blob', 'url', 'data']
+};
diff --git a/node_modules/axios/lib/platform/common/utils.js b/node_modules/axios/lib/platform/common/utils.js
new file mode 100644
index 0000000..56fe79a
--- /dev/null
+++ b/node_modules/axios/lib/platform/common/utils.js
@@ -0,0 +1,47 @@
+const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
+
+/**
+ * Determine if we're running in a standard browser environment
+ *
+ * This allows axios to run in a web worker, and react-native.
+ * Both environments support XMLHttpRequest, but not fully standard globals.
+ *
+ * web workers:
+ * typeof window -> undefined
+ * typeof document -> undefined
+ *
+ * react-native:
+ * navigator.product -> 'ReactNative'
+ * nativescript
+ * navigator.product -> 'NativeScript' or 'NS'
+ *
+ * @returns {boolean}
+ */
+const hasStandardBrowserEnv = (
+ (product) => {
+ return hasBrowserEnv && ['ReactNative', 'NativeScript', 'NS'].indexOf(product) < 0
+ })(typeof navigator !== 'undefined' && navigator.product);
+
+/**
+ * Determine if we're running in a standard browser webWorker environment
+ *
+ * Although the `isStandardBrowserEnv` method indicates that
+ * `allows axios to run in a web worker`, the WebWorker will still be
+ * filtered out due to its judgment standard
+ * `typeof window !== 'undefined' && typeof document !== 'undefined'`.
+ * This leads to a problem when axios post `FormData` in webWorker
+ */
+const hasStandardBrowserWebWorkerEnv = (() => {
+ return (
+ typeof WorkerGlobalScope !== 'undefined' &&
+ // eslint-disable-next-line no-undef
+ self instanceof WorkerGlobalScope &&
+ typeof self.importScripts === 'function'
+ );
+})();
+
+export {
+ hasBrowserEnv,
+ hasStandardBrowserWebWorkerEnv,
+ hasStandardBrowserEnv
+}
diff --git a/node_modules/axios/lib/platform/index.js b/node_modules/axios/lib/platform/index.js
new file mode 100644
index 0000000..860ba21
--- /dev/null
+++ b/node_modules/axios/lib/platform/index.js
@@ -0,0 +1,7 @@
+import platform from './node/index.js';
+import * as utils from './common/utils.js';
+
+export default {
+ ...utils,
+ ...platform
+}
diff --git a/node_modules/axios/lib/platform/node/classes/FormData.js b/node_modules/axios/lib/platform/node/classes/FormData.js
new file mode 100644
index 0000000..b07f947
--- /dev/null
+++ b/node_modules/axios/lib/platform/node/classes/FormData.js
@@ -0,0 +1,3 @@
+import FormData from 'form-data';
+
+export default FormData;
diff --git a/node_modules/axios/lib/platform/node/classes/URLSearchParams.js b/node_modules/axios/lib/platform/node/classes/URLSearchParams.js
new file mode 100644
index 0000000..fba5842
--- /dev/null
+++ b/node_modules/axios/lib/platform/node/classes/URLSearchParams.js
@@ -0,0 +1,4 @@
+'use strict';
+
+import url from 'url';
+export default url.URLSearchParams;
diff --git a/node_modules/axios/lib/platform/node/index.js b/node_modules/axios/lib/platform/node/index.js
new file mode 100644
index 0000000..aef514a
--- /dev/null
+++ b/node_modules/axios/lib/platform/node/index.js
@@ -0,0 +1,12 @@
+import URLSearchParams from './classes/URLSearchParams.js'
+import FormData from './classes/FormData.js'
+
+export default {
+ isNode: true,
+ classes: {
+ URLSearchParams,
+ FormData,
+ Blob: typeof Blob !== 'undefined' && Blob || null
+ },
+ protocols: [ 'http', 'https', 'file', 'data' ]
+};
diff --git a/node_modules/axios/lib/utils.js b/node_modules/axios/lib/utils.js
new file mode 100644
index 0000000..a386b77
--- /dev/null
+++ b/node_modules/axios/lib/utils.js
@@ -0,0 +1,723 @@
+'use strict';
+
+import bind from './helpers/bind.js';
+
+// utils is a library of generic helper functions non-specific to axios
+
+const {toString} = Object.prototype;
+const {getPrototypeOf} = Object;
+
+const kindOf = (cache => thing => {
+ const str = toString.call(thing);
+ return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
+})(Object.create(null));
+
+const kindOfTest = (type) => {
+ type = type.toLowerCase();
+ return (thing) => kindOf(thing) === type
+}
+
+const typeOfTest = type => thing => typeof thing === type;
+
+/**
+ * Determine if a value is an Array
+ *
+ * @param {Object} val The value to test
+ *
+ * @returns {boolean} True if value is an Array, otherwise false
+ */
+const {isArray} = Array;
+
+/**
+ * Determine if a value is undefined
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if the value is undefined, otherwise false
+ */
+const isUndefined = typeOfTest('undefined');
+
+/**
+ * Determine if a value is a Buffer
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a Buffer, otherwise false
+ */
+function isBuffer(val) {
+ return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
+ && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);
+}
+
+/**
+ * Determine if a value is an ArrayBuffer
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is an ArrayBuffer, otherwise false
+ */
+const isArrayBuffer = kindOfTest('ArrayBuffer');
+
+
+/**
+ * Determine if a value is a view on an ArrayBuffer
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
+ */
+function isArrayBufferView(val) {
+ let result;
+ if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
+ result = ArrayBuffer.isView(val);
+ } else {
+ result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));
+ }
+ return result;
+}
+
+/**
+ * Determine if a value is a String
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a String, otherwise false
+ */
+const isString = typeOfTest('string');
+
+/**
+ * Determine if a value is a Function
+ *
+ * @param {*} val The value to test
+ * @returns {boolean} True if value is a Function, otherwise false
+ */
+const isFunction = typeOfTest('function');
+
+/**
+ * Determine if a value is a Number
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a Number, otherwise false
+ */
+const isNumber = typeOfTest('number');
+
+/**
+ * Determine if a value is an Object
+ *
+ * @param {*} thing The value to test
+ *
+ * @returns {boolean} True if value is an Object, otherwise false
+ */
+const isObject = (thing) => thing !== null && typeof thing === 'object';
+
+/**
+ * Determine if a value is a Boolean
+ *
+ * @param {*} thing The value to test
+ * @returns {boolean} True if value is a Boolean, otherwise false
+ */
+const isBoolean = thing => thing === true || thing === false;
+
+/**
+ * Determine if a value is a plain Object
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a plain Object, otherwise false
+ */
+const isPlainObject = (val) => {
+ if (kindOf(val) !== 'object') {
+ return false;
+ }
+
+ const prototype = getPrototypeOf(val);
+ return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);
+}
+
+/**
+ * Determine if a value is a Date
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a Date, otherwise false
+ */
+const isDate = kindOfTest('Date');
+
+/**
+ * Determine if a value is a File
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a File, otherwise false
+ */
+const isFile = kindOfTest('File');
+
+/**
+ * Determine if a value is a Blob
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a Blob, otherwise false
+ */
+const isBlob = kindOfTest('Blob');
+
+/**
+ * Determine if a value is a FileList
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a File, otherwise false
+ */
+const isFileList = kindOfTest('FileList');
+
+/**
+ * Determine if a value is a Stream
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a Stream, otherwise false
+ */
+const isStream = (val) => isObject(val) && isFunction(val.pipe);
+
+/**
+ * Determine if a value is a FormData
+ *
+ * @param {*} thing The value to test
+ *
+ * @returns {boolean} True if value is an FormData, otherwise false
+ */
+const isFormData = (thing) => {
+ let kind;
+ return thing && (
+ (typeof FormData === 'function' && thing instanceof FormData) || (
+ isFunction(thing.append) && (
+ (kind = kindOf(thing)) === 'formdata' ||
+ // detect form-data instance
+ (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')
+ )
+ )
+ )
+}
+
+/**
+ * Determine if a value is a URLSearchParams object
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a URLSearchParams object, otherwise false
+ */
+const isURLSearchParams = kindOfTest('URLSearchParams');
+
+/**
+ * Trim excess whitespace off the beginning and end of a string
+ *
+ * @param {String} str The String to trim
+ *
+ * @returns {String} The String freed of excess whitespace
+ */
+const trim = (str) => str.trim ?
+ str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
+
+/**
+ * Iterate over an Array or an Object invoking a function for each item.
+ *
+ * If `obj` is an Array callback will be called passing
+ * the value, index, and complete array for each item.
+ *
+ * If 'obj' is an Object callback will be called passing
+ * the value, key, and complete object for each property.
+ *
+ * @param {Object|Array} obj The object to iterate
+ * @param {Function} fn The callback to invoke for each item
+ *
+ * @param {Boolean} [allOwnKeys = false]
+ * @returns {any}
+ */
+function forEach(obj, fn, {allOwnKeys = false} = {}) {
+ // Don't bother if no value provided
+ if (obj === null || typeof obj === 'undefined') {
+ return;
+ }
+
+ let i;
+ let l;
+
+ // Force an array if not already something iterable
+ if (typeof obj !== 'object') {
+ /*eslint no-param-reassign:0*/
+ obj = [obj];
+ }
+
+ if (isArray(obj)) {
+ // Iterate over array values
+ for (i = 0, l = obj.length; i < l; i++) {
+ fn.call(null, obj[i], i, obj);
+ }
+ } else {
+ // Iterate over object keys
+ const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
+ const len = keys.length;
+ let key;
+
+ for (i = 0; i < len; i++) {
+ key = keys[i];
+ fn.call(null, obj[key], key, obj);
+ }
+ }
+}
+
+function findKey(obj, key) {
+ key = key.toLowerCase();
+ const keys = Object.keys(obj);
+ let i = keys.length;
+ let _key;
+ while (i-- > 0) {
+ _key = keys[i];
+ if (key === _key.toLowerCase()) {
+ return _key;
+ }
+ }
+ return null;
+}
+
+const _global = (() => {
+ /*eslint no-undef:0*/
+ if (typeof globalThis !== "undefined") return globalThis;
+ return typeof self !== "undefined" ? self : (typeof window !== 'undefined' ? window : global)
+})();
+
+const isContextDefined = (context) => !isUndefined(context) && context !== _global;
+
+/**
+ * Accepts varargs expecting each argument to be an object, then
+ * immutably merges the properties of each object and returns result.
+ *
+ * When multiple objects contain the same key the later object in
+ * the arguments list will take precedence.
+ *
+ * Example:
+ *
+ * ```js
+ * var result = merge({foo: 123}, {foo: 456});
+ * console.log(result.foo); // outputs 456
+ * ```
+ *
+ * @param {Object} obj1 Object to merge
+ *
+ * @returns {Object} Result of all merge properties
+ */
+function merge(/* obj1, obj2, obj3, ... */) {
+ const {caseless} = isContextDefined(this) && this || {};
+ const result = {};
+ const assignValue = (val, key) => {
+ const targetKey = caseless && findKey(result, key) || key;
+ if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
+ result[targetKey] = merge(result[targetKey], val);
+ } else if (isPlainObject(val)) {
+ result[targetKey] = merge({}, val);
+ } else if (isArray(val)) {
+ result[targetKey] = val.slice();
+ } else {
+ result[targetKey] = val;
+ }
+ }
+
+ for (let i = 0, l = arguments.length; i < l; i++) {
+ arguments[i] && forEach(arguments[i], assignValue);
+ }
+ return result;
+}
+
+/**
+ * Extends object a by mutably adding to it the properties of object b.
+ *
+ * @param {Object} a The object to be extended
+ * @param {Object} b The object to copy properties from
+ * @param {Object} thisArg The object to bind function to
+ *
+ * @param {Boolean} [allOwnKeys]
+ * @returns {Object} The resulting value of object a
+ */
+const extend = (a, b, thisArg, {allOwnKeys}= {}) => {
+ forEach(b, (val, key) => {
+ if (thisArg && isFunction(val)) {
+ a[key] = bind(val, thisArg);
+ } else {
+ a[key] = val;
+ }
+ }, {allOwnKeys});
+ return a;
+}
+
+/**
+ * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
+ *
+ * @param {string} content with BOM
+ *
+ * @returns {string} content value without BOM
+ */
+const stripBOM = (content) => {
+ if (content.charCodeAt(0) === 0xFEFF) {
+ content = content.slice(1);
+ }
+ return content;
+}
+
+/**
+ * Inherit the prototype methods from one constructor into another
+ * @param {function} constructor
+ * @param {function} superConstructor
+ * @param {object} [props]
+ * @param {object} [descriptors]
+ *
+ * @returns {void}
+ */
+const inherits = (constructor, superConstructor, props, descriptors) => {
+ constructor.prototype = Object.create(superConstructor.prototype, descriptors);
+ constructor.prototype.constructor = constructor;
+ Object.defineProperty(constructor, 'super', {
+ value: superConstructor.prototype
+ });
+ props && Object.assign(constructor.prototype, props);
+}
+
+/**
+ * Resolve object with deep prototype chain to a flat object
+ * @param {Object} sourceObj source object
+ * @param {Object} [destObj]
+ * @param {Function|Boolean} [filter]
+ * @param {Function} [propFilter]
+ *
+ * @returns {Object}
+ */
+const toFlatObject = (sourceObj, destObj, filter, propFilter) => {
+ let props;
+ let i;
+ let prop;
+ const merged = {};
+
+ destObj = destObj || {};
+ // eslint-disable-next-line no-eq-null,eqeqeq
+ if (sourceObj == null) return destObj;
+
+ do {
+ props = Object.getOwnPropertyNames(sourceObj);
+ i = props.length;
+ while (i-- > 0) {
+ prop = props[i];
+ if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
+ destObj[prop] = sourceObj[prop];
+ merged[prop] = true;
+ }
+ }
+ sourceObj = filter !== false && getPrototypeOf(sourceObj);
+ } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
+
+ return destObj;
+}
+
+/**
+ * Determines whether a string ends with the characters of a specified string
+ *
+ * @param {String} str
+ * @param {String} searchString
+ * @param {Number} [position= 0]
+ *
+ * @returns {boolean}
+ */
+const endsWith = (str, searchString, position) => {
+ str = String(str);
+ if (position === undefined || position > str.length) {
+ position = str.length;
+ }
+ position -= searchString.length;
+ const lastIndex = str.indexOf(searchString, position);
+ return lastIndex !== -1 && lastIndex === position;
+}
+
+
+/**
+ * Returns new array from array like object or null if failed
+ *
+ * @param {*} [thing]
+ *
+ * @returns {?Array}
+ */
+const toArray = (thing) => {
+ if (!thing) return null;
+ if (isArray(thing)) return thing;
+ let i = thing.length;
+ if (!isNumber(i)) return null;
+ const arr = new Array(i);
+ while (i-- > 0) {
+ arr[i] = thing[i];
+ }
+ return arr;
+}
+
+/**
+ * Checking if the Uint8Array exists and if it does, it returns a function that checks if the
+ * thing passed in is an instance of Uint8Array
+ *
+ * @param {TypedArray}
+ *
+ * @returns {Array}
+ */
+// eslint-disable-next-line func-names
+const isTypedArray = (TypedArray => {
+ // eslint-disable-next-line func-names
+ return thing => {
+ return TypedArray && thing instanceof TypedArray;
+ };
+})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));
+
+/**
+ * For each entry in the object, call the function with the key and value.
+ *
+ * @param {Object<any, any>} obj - The object to iterate over.
+ * @param {Function} fn - The function to call for each entry.
+ *
+ * @returns {void}
+ */
+const forEachEntry = (obj, fn) => {
+ const generator = obj && obj[Symbol.iterator];
+
+ const iterator = generator.call(obj);
+
+ let result;
+
+ while ((result = iterator.next()) && !result.done) {
+ const pair = result.value;
+ fn.call(obj, pair[0], pair[1]);
+ }
+}
+
+/**
+ * It takes a regular expression and a string, and returns an array of all the matches
+ *
+ * @param {string} regExp - The regular expression to match against.
+ * @param {string} str - The string to search.
+ *
+ * @returns {Array<boolean>}
+ */
+const matchAll = (regExp, str) => {
+ let matches;
+ const arr = [];
+
+ while ((matches = regExp.exec(str)) !== null) {
+ arr.push(matches);
+ }
+
+ return arr;
+}
+
+/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */
+const isHTMLForm = kindOfTest('HTMLFormElement');
+
+const toCamelCase = str => {
+ return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,
+ function replacer(m, p1, p2) {
+ return p1.toUpperCase() + p2;
+ }
+ );
+};
+
+/* Creating a function that will check if an object has a property. */
+const hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);
+
+/**
+ * Determine if a value is a RegExp object
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a RegExp object, otherwise false
+ */
+const isRegExp = kindOfTest('RegExp');
+
+const reduceDescriptors = (obj, reducer) => {
+ const descriptors = Object.getOwnPropertyDescriptors(obj);
+ const reducedDescriptors = {};
+
+ forEach(descriptors, (descriptor, name) => {
+ let ret;
+ if ((ret = reducer(descriptor, name, obj)) !== false) {
+ reducedDescriptors[name] = ret || descriptor;
+ }
+ });
+
+ Object.defineProperties(obj, reducedDescriptors);
+}
+
+/**
+ * Makes all methods read-only
+ * @param {Object} obj
+ */
+
+const freezeMethods = (obj) => {
+ reduceDescriptors(obj, (descriptor, name) => {
+ // skip restricted props in strict mode
+ if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {
+ return false;
+ }
+
+ const value = obj[name];
+
+ if (!isFunction(value)) return;
+
+ descriptor.enumerable = false;
+
+ if ('writable' in descriptor) {
+ descriptor.writable = false;
+ return;
+ }
+
+ if (!descriptor.set) {
+ descriptor.set = () => {
+ throw Error('Can not rewrite read-only method \'' + name + '\'');
+ };
+ }
+ });
+}
+
+const toObjectSet = (arrayOrString, delimiter) => {
+ const obj = {};
+
+ const define = (arr) => {
+ arr.forEach(value => {
+ obj[value] = true;
+ });
+ }
+
+ isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
+
+ return obj;
+}
+
+const noop = () => {}
+
+const toFiniteNumber = (value, defaultValue) => {
+ value = +value;
+ return Number.isFinite(value) ? value : defaultValue;
+}
+
+const ALPHA = 'abcdefghijklmnopqrstuvwxyz'
+
+const DIGIT = '0123456789';
+
+const ALPHABET = {
+ DIGIT,
+ ALPHA,
+ ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
+}
+
+const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
+ let str = '';
+ const {length} = alphabet;
+ while (size--) {
+ str += alphabet[Math.random() * length|0]
+ }
+
+ return str;
+}
+
+/**
+ * If the thing is a FormData object, return true, otherwise return false.
+ *
+ * @param {unknown} thing - The thing to check.
+ *
+ * @returns {boolean}
+ */
+function isSpecCompliantForm(thing) {
+ return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]);
+}
+
+const toJSONObject = (obj) => {
+ const stack = new Array(10);
+
+ const visit = (source, i) => {
+
+ if (isObject(source)) {
+ if (stack.indexOf(source) >= 0) {
+ return;
+ }
+
+ if(!('toJSON' in source)) {
+ stack[i] = source;
+ const target = isArray(source) ? [] : {};
+
+ forEach(source, (value, key) => {
+ const reducedValue = visit(value, i + 1);
+ !isUndefined(reducedValue) && (target[key] = reducedValue);
+ });
+
+ stack[i] = undefined;
+
+ return target;
+ }
+ }
+
+ return source;
+ }
+
+ return visit(obj, 0);
+}
+
+const isAsyncFn = kindOfTest('AsyncFunction');
+
+const isThenable = (thing) =>
+ thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
+
+export default {
+ isArray,
+ isArrayBuffer,
+ isBuffer,
+ isFormData,
+ isArrayBufferView,
+ isString,
+ isNumber,
+ isBoolean,
+ isObject,
+ isPlainObject,
+ isUndefined,
+ isDate,
+ isFile,
+ isBlob,
+ isRegExp,
+ isFunction,
+ isStream,
+ isURLSearchParams,
+ isTypedArray,
+ isFileList,
+ forEach,
+ merge,
+ extend,
+ trim,
+ stripBOM,
+ inherits,
+ toFlatObject,
+ kindOf,
+ kindOfTest,
+ endsWith,
+ toArray,
+ forEachEntry,
+ matchAll,
+ isHTMLForm,
+ hasOwnProperty,
+ hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection
+ reduceDescriptors,
+ freezeMethods,
+ toObjectSet,
+ toCamelCase,
+ noop,
+ toFiniteNumber,
+ findKey,
+ global: _global,
+ isContextDefined,
+ ALPHABET,
+ generateString,
+ isSpecCompliantForm,
+ toJSONObject,
+ isAsyncFn,
+ isThenable
+};
diff --git a/node_modules/axios/package.json b/node_modules/axios/package.json
new file mode 100644
index 0000000..cf185bd
--- /dev/null
+++ b/node_modules/axios/package.json
@@ -0,0 +1,218 @@
+{
+ "name": "axios",
+ "version": "1.6.7",
+ "description": "Promise based HTTP client for the browser and node.js",
+ "main": "index.js",
+ "exports": {
+ ".": {
+ "types": {
+ "require": "./index.d.cts",
+ "default": "./index.d.ts"
+ },
+ "browser": {
+ "require": "./dist/browser/axios.cjs",
+ "default": "./index.js"
+ },
+ "default": {
+ "require": "./dist/node/axios.cjs",
+ "default": "./index.js"
+ }
+ },
+ "./lib/adapters/http.js": "./lib/adapters/http.js",
+ "./lib/adapters/xhr.js": "./lib/adapters/xhr.js",
+ "./unsafe/*": "./lib/*",
+ "./unsafe/core/settle.js": "./lib/core/settle.js",
+ "./unsafe/core/buildFullPath.js": "./lib/core/buildFullPath.js",
+ "./unsafe/helpers/isAbsoluteURL.js": "./lib/helpers/isAbsoluteURL.js",
+ "./unsafe/helpers/buildURL.js": "./lib/helpers/buildURL.js",
+ "./unsafe/helpers/combineURLs.js": "./lib/helpers/combineURLs.js",
+ "./unsafe/adapters/http.js": "./lib/adapters/http.js",
+ "./unsafe/adapters/xhr.js": "./lib/adapters/xhr.js",
+ "./unsafe/utils.js": "./lib/utils.js",
+ "./package.json": "./package.json"
+ },
+ "type": "module",
+ "types": "index.d.ts",
+ "scripts": {
+ "test": "npm run test:eslint && npm run test:mocha && npm run test:karma && npm run test:dtslint && npm run test:exports",
+ "test:eslint": "node bin/ssl_hotfix.js eslint lib/**/*.js",
+ "test:dtslint": "dtslint --localTs node_modules/typescript/lib",
+ "test:mocha": "node bin/ssl_hotfix.js mocha test/unit/**/*.js --timeout 30000 --exit",
+ "test:exports": "node bin/ssl_hotfix.js mocha test/module/test.js --timeout 30000 --exit",
+ "test:karma": "node bin/ssl_hotfix.js cross-env LISTEN_ADDR=:: karma start karma.conf.cjs --single-run",
+ "test:karma:firefox": "node bin/ssl_hotfix.js cross-env LISTEN_ADDR=:: Browsers=Firefox karma start karma.conf.cjs --single-run",
+ "test:karma:server": "node bin/ssl_hotfix.js cross-env karma start karma.conf.cjs",
+ "test:build:version": "node ./bin/check-build-version.js",
+ "start": "node ./sandbox/server.js",
+ "preversion": "gulp version",
+ "version": "npm run build && git add dist && git add package.json",
+ "prepublishOnly": "npm run test:build:version",
+ "postpublish": "git push && git push --tags",
+ "build": "gulp clear && cross-env NODE_ENV=production rollup -c -m",
+ "examples": "node ./examples/server.js",
+ "coveralls": "cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",
+ "fix": "eslint --fix lib/**/*.js",
+ "prepare": "husky install && npm run prepare:hooks",
+ "prepare:hooks": "npx husky set .husky/commit-msg \"npx commitlint --edit $1\"",
+ "release:dry": "release-it --dry-run --no-npm",
+ "release:info": "release-it --release-version",
+ "release:beta:no-npm": "release-it --preRelease=beta --no-npm",
+ "release:beta": "release-it --preRelease=beta",
+ "release:no-npm": "release-it --no-npm",
+ "release:changelog:fix": "node ./bin/injectContributorsList.js && git add CHANGELOG.md",
+ "release": "release-it"
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/axios/axios.git"
+ },
+ "keywords": [
+ "xhr",
+ "http",
+ "ajax",
+ "promise",
+ "node"
+ ],
+ "author": "Matt Zabriskie",
+ "license": "MIT",
+ "bugs": {
+ "url": "https://github.com/axios/axios/issues"
+ },
+ "homepage": "https://axios-http.com",
+ "devDependencies": {
+ "@babel/core": "^7.18.2",
+ "@babel/preset-env": "^7.18.2",
+ "@commitlint/cli": "^17.3.0",
+ "@commitlint/config-conventional": "^17.3.0",
+ "@release-it/conventional-changelog": "^5.1.1",
+ "@rollup/plugin-babel": "^5.3.1",
+ "@rollup/plugin-commonjs": "^15.1.0",
+ "@rollup/plugin-json": "^4.1.0",
+ "@rollup/plugin-multi-entry": "^4.0.0",
+ "@rollup/plugin-node-resolve": "^9.0.0",
+ "abortcontroller-polyfill": "^1.7.3",
+ "auto-changelog": "^2.4.0",
+ "body-parser": "^1.20.0",
+ "chalk": "^5.2.0",
+ "coveralls": "^3.1.1",
+ "cross-env": "^7.0.3",
+ "dev-null": "^0.1.1",
+ "dtslint": "^4.2.1",
+ "es6-promise": "^4.2.8",
+ "eslint": "^8.17.0",
+ "express": "^4.18.1",
+ "formdata-node": "^5.0.0",
+ "formidable": "^2.0.1",
+ "fs-extra": "^10.1.0",
+ "get-stream": "^3.0.0",
+ "gulp": "^4.0.2",
+ "gzip-size": "^7.0.0",
+ "handlebars": "^4.7.7",
+ "husky": "^8.0.2",
+ "istanbul-instrumenter-loader": "^3.0.1",
+ "jasmine-core": "^2.4.1",
+ "karma": "^6.3.17",
+ "karma-chrome-launcher": "^3.1.1",
+ "karma-firefox-launcher": "^2.1.2",
+ "karma-jasmine": "^1.1.1",
+ "karma-jasmine-ajax": "^0.1.13",
+ "karma-rollup-preprocessor": "^7.0.8",
+ "karma-safari-launcher": "^1.0.0",
+ "karma-sauce-launcher": "^4.3.6",
+ "karma-sinon": "^1.0.5",
+ "karma-sourcemap-loader": "^0.3.8",
+ "memoizee": "^0.4.15",
+ "minimist": "^1.2.7",
+ "mocha": "^10.0.0",
+ "multer": "^1.4.4",
+ "pretty-bytes": "^6.0.0",
+ "release-it": "^15.5.1",
+ "rollup": "^2.67.0",
+ "rollup-plugin-auto-external": "^2.0.0",
+ "rollup-plugin-bundle-size": "^1.0.3",
+ "rollup-plugin-terser": "^7.0.2",
+ "sinon": "^4.5.0",
+ "stream-throttle": "^0.1.3",
+ "string-replace-async": "^3.0.2",
+ "terser-webpack-plugin": "^4.2.3",
+ "typescript": "^4.8.4"
+ },
+ "browser": {
+ "./lib/adapters/http.js": "./lib/helpers/null.js",
+ "./lib/platform/node/index.js": "./lib/platform/browser/index.js",
+ "./lib/platform/node/classes/FormData.js": "./lib/helpers/null.js"
+ },
+ "jsdelivr": "dist/axios.min.js",
+ "unpkg": "dist/axios.min.js",
+ "typings": "./index.d.ts",
+ "dependencies": {
+ "follow-redirects": "^1.15.4",
+ "form-data": "^4.0.0",
+ "proxy-from-env": "^1.1.0"
+ },
+ "bundlesize": [
+ {
+ "path": "./dist/axios.min.js",
+ "threshold": "5kB"
+ }
+ ],
+ "contributors": [
+ "Matt Zabriskie (https://github.com/mzabriskie)",
+ "Nick Uraltsev (https://github.com/nickuraltsev)",
+ "Jay (https://github.com/jasonsaayman)",
+ "Dmitriy Mozgovoy (https://github.com/DigitalBrainJS)",
+ "Emily Morehouse (https://github.com/emilyemorehouse)",
+ "Rubén Norte (https://github.com/rubennorte)",
+ "Justin Beckwith (https://github.com/JustinBeckwith)",
+ "Martti Laine (https://github.com/codeclown)",
+ "Xianming Zhong (https://github.com/chinesedfan)",
+ "Rikki Gibson (https://github.com/RikkiGibson)",
+ "Remco Haszing (https://github.com/remcohaszing)",
+ "Yasu Flores (https://github.com/yasuf)",
+ "Ben Carp (https://github.com/carpben)"
+ ],
+ "sideEffects": false,
+ "release-it": {
+ "git": {
+ "commitMessage": "chore(release): v${version}",
+ "push": true,
+ "commit": true,
+ "tag": true,
+ "requireCommits": false,
+ "requireCleanWorkingDir": false
+ },
+ "github": {
+ "release": true,
+ "draft": true
+ },
+ "npm": {
+ "publish": false,
+ "ignoreVersion": false
+ },
+ "plugins": {
+ "@release-it/conventional-changelog": {
+ "preset": "angular",
+ "infile": "CHANGELOG.md",
+ "header": "# Changelog"
+ }
+ },
+ "hooks": {
+ "before:init": "npm test",
+ "after:bump": "gulp version --bump ${version} && npm run build && npm run test:build:version && git add ./dist && git add ./package-lock.json",
+ "before:release": "npm run release:changelog:fix",
+ "after:release": "echo Successfully released ${name} v${version} to ${repo.repository}."
+ }
+ },
+ "commitlint": {
+ "rules": {
+ "header-max-length": [
+ 2,
+ "always",
+ 130
+ ]
+ },
+ "extends": [
+ "@commitlint/config-conventional"
+ ]
+ }
+} \ No newline at end of file
diff --git a/node_modules/combined-stream/License b/node_modules/combined-stream/License
new file mode 100644
index 0000000..4804b7a
--- /dev/null
+++ b/node_modules/combined-stream/License
@@ -0,0 +1,19 @@
+Copyright (c) 2011 Debuggable Limited <felix@debuggable.com>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/combined-stream/Readme.md b/node_modules/combined-stream/Readme.md
new file mode 100644
index 0000000..9e367b5
--- /dev/null
+++ b/node_modules/combined-stream/Readme.md
@@ -0,0 +1,138 @@
+# combined-stream
+
+A stream that emits multiple other streams one after another.
+
+**NB** Currently `combined-stream` works with streams version 1 only. There is ongoing effort to switch this library to streams version 2. Any help is welcome. :) Meanwhile you can explore other libraries that provide streams2 support with more or less compatibility with `combined-stream`.
+
+- [combined-stream2](https://www.npmjs.com/package/combined-stream2): A drop-in streams2-compatible replacement for the combined-stream module.
+
+- [multistream](https://www.npmjs.com/package/multistream): A stream that emits multiple other streams one after another.
+
+## Installation
+
+``` bash
+npm install combined-stream
+```
+
+## Usage
+
+Here is a simple example that shows how you can use combined-stream to combine
+two files into one:
+
+``` javascript
+var CombinedStream = require('combined-stream');
+var fs = require('fs');
+
+var combinedStream = CombinedStream.create();
+combinedStream.append(fs.createReadStream('file1.txt'));
+combinedStream.append(fs.createReadStream('file2.txt'));
+
+combinedStream.pipe(fs.createWriteStream('combined.txt'));
+```
+
+While the example above works great, it will pause all source streams until
+they are needed. If you don't want that to happen, you can set `pauseStreams`
+to `false`:
+
+``` javascript
+var CombinedStream = require('combined-stream');
+var fs = require('fs');
+
+var combinedStream = CombinedStream.create({pauseStreams: false});
+combinedStream.append(fs.createReadStream('file1.txt'));
+combinedStream.append(fs.createReadStream('file2.txt'));
+
+combinedStream.pipe(fs.createWriteStream('combined.txt'));
+```
+
+However, what if you don't have all the source streams yet, or you don't want
+to allocate the resources (file descriptors, memory, etc.) for them right away?
+Well, in that case you can simply provide a callback that supplies the stream
+by calling a `next()` function:
+
+``` javascript
+var CombinedStream = require('combined-stream');
+var fs = require('fs');
+
+var combinedStream = CombinedStream.create();
+combinedStream.append(function(next) {
+ next(fs.createReadStream('file1.txt'));
+});
+combinedStream.append(function(next) {
+ next(fs.createReadStream('file2.txt'));
+});
+
+combinedStream.pipe(fs.createWriteStream('combined.txt'));
+```
+
+## API
+
+### CombinedStream.create([options])
+
+Returns a new combined stream object. Available options are:
+
+* `maxDataSize`
+* `pauseStreams`
+
+The effect of those options is described below.
+
+### combinedStream.pauseStreams = `true`
+
+Whether to apply back pressure to the underlaying streams. If set to `false`,
+the underlaying streams will never be paused. If set to `true`, the
+underlaying streams will be paused right after being appended, as well as when
+`delayedStream.pipe()` wants to throttle.
+
+### combinedStream.maxDataSize = `2 * 1024 * 1024`
+
+The maximum amount of bytes (or characters) to buffer for all source streams.
+If this value is exceeded, `combinedStream` emits an `'error'` event.
+
+### combinedStream.dataSize = `0`
+
+The amount of bytes (or characters) currently buffered by `combinedStream`.
+
+### combinedStream.append(stream)
+
+Appends the given `stream` to the combinedStream object. If `pauseStreams` is
+set to `true, this stream will also be paused right away.
+
+`streams` can also be a function that takes one parameter called `next`. `next`
+is a function that must be invoked in order to provide the `next` stream, see
+example above.
+
+Regardless of how the `stream` is appended, combined-stream always attaches an
+`'error'` listener to it, so you don't have to do that manually.
+
+Special case: `stream` can also be a String or Buffer.
+
+### combinedStream.write(data)
+
+You should not call this, `combinedStream` takes care of piping the appended
+streams into itself for you.
+
+### combinedStream.resume()
+
+Causes `combinedStream` to start drain the streams it manages. The function is
+idempotent, and also emits a `'resume'` event each time which usually goes to
+the stream that is currently being drained.
+
+### combinedStream.pause();
+
+If `combinedStream.pauseStreams` is set to `false`, this does nothing.
+Otherwise a `'pause'` event is emitted, this goes to the stream that is
+currently being drained, so you can use it to apply back pressure.
+
+### combinedStream.end();
+
+Sets `combinedStream.writable` to false, emits an `'end'` event, and removes
+all streams from the queue.
+
+### combinedStream.destroy();
+
+Same as `combinedStream.end()`, except it emits a `'close'` event instead of
+`'end'`.
+
+## License
+
+combined-stream is licensed under the MIT license.
diff --git a/node_modules/combined-stream/lib/combined_stream.js b/node_modules/combined-stream/lib/combined_stream.js
new file mode 100644
index 0000000..125f097
--- /dev/null
+++ b/node_modules/combined-stream/lib/combined_stream.js
@@ -0,0 +1,208 @@
+var util = require('util');
+var Stream = require('stream').Stream;
+var DelayedStream = require('delayed-stream');
+
+module.exports = CombinedStream;
+function CombinedStream() {
+ this.writable = false;
+ this.readable = true;
+ this.dataSize = 0;
+ this.maxDataSize = 2 * 1024 * 1024;
+ this.pauseStreams = true;
+
+ this._released = false;
+ this._streams = [];
+ this._currentStream = null;
+ this._insideLoop = false;
+ this._pendingNext = false;
+}
+util.inherits(CombinedStream, Stream);
+
+CombinedStream.create = function(options) {
+ var combinedStream = new this();
+
+ options = options || {};
+ for (var option in options) {
+ combinedStream[option] = options[option];
+ }
+
+ return combinedStream;
+};
+
+CombinedStream.isStreamLike = function(stream) {
+ return (typeof stream !== 'function')
+ && (typeof stream !== 'string')
+ && (typeof stream !== 'boolean')
+ && (typeof stream !== 'number')
+ && (!Buffer.isBuffer(stream));
+};
+
+CombinedStream.prototype.append = function(stream) {
+ var isStreamLike = CombinedStream.isStreamLike(stream);
+
+ if (isStreamLike) {
+ if (!(stream instanceof DelayedStream)) {
+ var newStream = DelayedStream.create(stream, {
+ maxDataSize: Infinity,
+ pauseStream: this.pauseStreams,
+ });
+ stream.on('data', this._checkDataSize.bind(this));
+ stream = newStream;
+ }
+
+ this._handleErrors(stream);
+
+ if (this.pauseStreams) {
+ stream.pause();
+ }
+ }
+
+ this._streams.push(stream);
+ return this;
+};
+
+CombinedStream.prototype.pipe = function(dest, options) {
+ Stream.prototype.pipe.call(this, dest, options);
+ this.resume();
+ return dest;
+};
+
+CombinedStream.prototype._getNext = function() {
+ this._currentStream = null;
+
+ if (this._insideLoop) {
+ this._pendingNext = true;
+ return; // defer call
+ }
+
+ this._insideLoop = true;
+ try {
+ do {
+ this._pendingNext = false;
+ this._realGetNext();
+ } while (this._pendingNext);
+ } finally {
+ this._insideLoop = false;
+ }
+};
+
+CombinedStream.prototype._realGetNext = function() {
+ var stream = this._streams.shift();
+
+
+ if (typeof stream == 'undefined') {
+ this.end();
+ return;
+ }
+
+ if (typeof stream !== 'function') {
+ this._pipeNext(stream);
+ return;
+ }
+
+ var getStream = stream;
+ getStream(function(stream) {
+ var isStreamLike = CombinedStream.isStreamLike(stream);
+ if (isStreamLike) {
+ stream.on('data', this._checkDataSize.bind(this));
+ this._handleErrors(stream);
+ }
+
+ this._pipeNext(stream);
+ }.bind(this));
+};
+
+CombinedStream.prototype._pipeNext = function(stream) {
+ this._currentStream = stream;
+
+ var isStreamLike = CombinedStream.isStreamLike(stream);
+ if (isStreamLike) {
+ stream.on('end', this._getNext.bind(this));
+ stream.pipe(this, {end: false});
+ return;
+ }
+
+ var value = stream;
+ this.write(value);
+ this._getNext();
+};
+
+CombinedStream.prototype._handleErrors = function(stream) {
+ var self = this;
+ stream.on('error', function(err) {
+ self._emitError(err);
+ });
+};
+
+CombinedStream.prototype.write = function(data) {
+ this.emit('data', data);
+};
+
+CombinedStream.prototype.pause = function() {
+ if (!this.pauseStreams) {
+ return;
+ }
+
+ if(this.pauseStreams && this._currentStream && typeof(this._currentStream.pause) == 'function') this._currentStream.pause();
+ this.emit('pause');
+};
+
+CombinedStream.prototype.resume = function() {
+ if (!this._released) {
+ this._released = true;
+ this.writable = true;
+ this._getNext();
+ }
+
+ if(this.pauseStreams && this._currentStream && typeof(this._currentStream.resume) == 'function') this._currentStream.resume();
+ this.emit('resume');
+};
+
+CombinedStream.prototype.end = function() {
+ this._reset();
+ this.emit('end');
+};
+
+CombinedStream.prototype.destroy = function() {
+ this._reset();
+ this.emit('close');
+};
+
+CombinedStream.prototype._reset = function() {
+ this.writable = false;
+ this._streams = [];
+ this._currentStream = null;
+};
+
+CombinedStream.prototype._checkDataSize = function() {
+ this._updateDataSize();
+ if (this.dataSize <= this.maxDataSize) {
+ return;
+ }
+
+ var message =
+ 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.';
+ this._emitError(new Error(message));
+};
+
+CombinedStream.prototype._updateDataSize = function() {
+ this.dataSize = 0;
+
+ var self = this;
+ this._streams.forEach(function(stream) {
+ if (!stream.dataSize) {
+ return;
+ }
+
+ self.dataSize += stream.dataSize;
+ });
+
+ if (this._currentStream && this._currentStream.dataSize) {
+ this.dataSize += this._currentStream.dataSize;
+ }
+};
+
+CombinedStream.prototype._emitError = function(err) {
+ this._reset();
+ this.emit('error', err);
+};
diff --git a/node_modules/combined-stream/package.json b/node_modules/combined-stream/package.json
new file mode 100644
index 0000000..6982b6d
--- /dev/null
+++ b/node_modules/combined-stream/package.json
@@ -0,0 +1,25 @@
+{
+ "author": "Felix Geisendörfer <felix@debuggable.com> (http://debuggable.com/)",
+ "name": "combined-stream",
+ "description": "A stream that emits multiple other streams one after another.",
+ "version": "1.0.8",
+ "homepage": "https://github.com/felixge/node-combined-stream",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/felixge/node-combined-stream.git"
+ },
+ "main": "./lib/combined_stream",
+ "scripts": {
+ "test": "node test/run.js"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ },
+ "dependencies": {
+ "delayed-stream": "~1.0.0"
+ },
+ "devDependencies": {
+ "far": "~0.0.7"
+ },
+ "license": "MIT"
+}
diff --git a/node_modules/combined-stream/yarn.lock b/node_modules/combined-stream/yarn.lock
new file mode 100644
index 0000000..7edf418
--- /dev/null
+++ b/node_modules/combined-stream/yarn.lock
@@ -0,0 +1,17 @@
+# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
+# yarn lockfile v1
+
+
+delayed-stream@~1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619"
+
+far@~0.0.7:
+ version "0.0.7"
+ resolved "https://registry.yarnpkg.com/far/-/far-0.0.7.tgz#01c1fd362bcd26ce9cf161af3938aa34619f79a7"
+ dependencies:
+ oop "0.0.3"
+
+oop@0.0.3:
+ version "0.0.3"
+ resolved "https://registry.yarnpkg.com/oop/-/oop-0.0.3.tgz#70fa405a5650891a194fdc82ca68dad6dabf4401"
diff --git a/node_modules/delayed-stream/.npmignore b/node_modules/delayed-stream/.npmignore
new file mode 100644
index 0000000..9daeafb
--- /dev/null
+++ b/node_modules/delayed-stream/.npmignore
@@ -0,0 +1 @@
+test
diff --git a/node_modules/delayed-stream/License b/node_modules/delayed-stream/License
new file mode 100644
index 0000000..4804b7a
--- /dev/null
+++ b/node_modules/delayed-stream/License
@@ -0,0 +1,19 @@
+Copyright (c) 2011 Debuggable Limited <felix@debuggable.com>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/delayed-stream/Makefile b/node_modules/delayed-stream/Makefile
new file mode 100644
index 0000000..b4ff85a
--- /dev/null
+++ b/node_modules/delayed-stream/Makefile
@@ -0,0 +1,7 @@
+SHELL := /bin/bash
+
+test:
+ @./test/run.js
+
+.PHONY: test
+
diff --git a/node_modules/delayed-stream/Readme.md b/node_modules/delayed-stream/Readme.md
new file mode 100644
index 0000000..aca36f9
--- /dev/null
+++ b/node_modules/delayed-stream/Readme.md
@@ -0,0 +1,141 @@
+# delayed-stream
+
+Buffers events from a stream until you are ready to handle them.
+
+## Installation
+
+``` bash
+npm install delayed-stream
+```
+
+## Usage
+
+The following example shows how to write a http echo server that delays its
+response by 1000 ms.
+
+``` javascript
+var DelayedStream = require('delayed-stream');
+var http = require('http');
+
+http.createServer(function(req, res) {
+ var delayed = DelayedStream.create(req);
+
+ setTimeout(function() {
+ res.writeHead(200);
+ delayed.pipe(res);
+ }, 1000);
+});
+```
+
+If you are not using `Stream#pipe`, you can also manually release the buffered
+events by calling `delayedStream.resume()`:
+
+``` javascript
+var delayed = DelayedStream.create(req);
+
+setTimeout(function() {
+ // Emit all buffered events and resume underlaying source
+ delayed.resume();
+}, 1000);
+```
+
+## Implementation
+
+In order to use this meta stream properly, here are a few things you should
+know about the implementation.
+
+### Event Buffering / Proxying
+
+All events of the `source` stream are hijacked by overwriting the `source.emit`
+method. Until node implements a catch-all event listener, this is the only way.
+
+However, delayed-stream still continues to emit all events it captures on the
+`source`, regardless of whether you have released the delayed stream yet or
+not.
+
+Upon creation, delayed-stream captures all `source` events and stores them in
+an internal event buffer. Once `delayedStream.release()` is called, all
+buffered events are emitted on the `delayedStream`, and the event buffer is
+cleared. After that, delayed-stream merely acts as a proxy for the underlaying
+source.
+
+### Error handling
+
+Error events on `source` are buffered / proxied just like any other events.
+However, `delayedStream.create` attaches a no-op `'error'` listener to the
+`source`. This way you only have to handle errors on the `delayedStream`
+object, rather than in two places.
+
+### Buffer limits
+
+delayed-stream provides a `maxDataSize` property that can be used to limit
+the amount of data being buffered. In order to protect you from bad `source`
+streams that don't react to `source.pause()`, this feature is enabled by
+default.
+
+## API
+
+### DelayedStream.create(source, [options])
+
+Returns a new `delayedStream`. Available options are:
+
+* `pauseStream`
+* `maxDataSize`
+
+The description for those properties can be found below.
+
+### delayedStream.source
+
+The `source` stream managed by this object. This is useful if you are
+passing your `delayedStream` around, and you still want to access properties
+on the `source` object.
+
+### delayedStream.pauseStream = true
+
+Whether to pause the underlaying `source` when calling
+`DelayedStream.create()`. Modifying this property afterwards has no effect.
+
+### delayedStream.maxDataSize = 1024 * 1024
+
+The amount of data to buffer before emitting an `error`.
+
+If the underlaying source is emitting `Buffer` objects, the `maxDataSize`
+refers to bytes.
+
+If the underlaying source is emitting JavaScript strings, the size refers to
+characters.
+
+If you know what you are doing, you can set this property to `Infinity` to
+disable this feature. You can also modify this property during runtime.
+
+### delayedStream.dataSize = 0
+
+The amount of data buffered so far.
+
+### delayedStream.readable
+
+An ECMA5 getter that returns the value of `source.readable`.
+
+### delayedStream.resume()
+
+If the `delayedStream` has not been released so far, `delayedStream.release()`
+is called.
+
+In either case, `source.resume()` is called.
+
+### delayedStream.pause()
+
+Calls `source.pause()`.
+
+### delayedStream.pipe(dest)
+
+Calls `delayedStream.resume()` and then proxies the arguments to `source.pipe`.
+
+### delayedStream.release()
+
+Emits and clears all events that have been buffered up so far. This does not
+resume the underlaying source, use `delayedStream.resume()` instead.
+
+## License
+
+delayed-stream is licensed under the MIT license.
diff --git a/node_modules/delayed-stream/lib/delayed_stream.js b/node_modules/delayed-stream/lib/delayed_stream.js
new file mode 100644
index 0000000..b38fc85
--- /dev/null
+++ b/node_modules/delayed-stream/lib/delayed_stream.js
@@ -0,0 +1,107 @@
+var Stream = require('stream').Stream;
+var util = require('util');
+
+module.exports = DelayedStream;
+function DelayedStream() {
+ this.source = null;
+ this.dataSize = 0;
+ this.maxDataSize = 1024 * 1024;
+ this.pauseStream = true;
+
+ this._maxDataSizeExceeded = false;
+ this._released = false;
+ this._bufferedEvents = [];
+}
+util.inherits(DelayedStream, Stream);
+
+DelayedStream.create = function(source, options) {
+ var delayedStream = new this();
+
+ options = options || {};
+ for (var option in options) {
+ delayedStream[option] = options[option];
+ }
+
+ delayedStream.source = source;
+
+ var realEmit = source.emit;
+ source.emit = function() {
+ delayedStream._handleEmit(arguments);
+ return realEmit.apply(source, arguments);
+ };
+
+ source.on('error', function() {});
+ if (delayedStream.pauseStream) {
+ source.pause();
+ }
+
+ return delayedStream;
+};
+
+Object.defineProperty(DelayedStream.prototype, 'readable', {
+ configurable: true,
+ enumerable: true,
+ get: function() {
+ return this.source.readable;
+ }
+});
+
+DelayedStream.prototype.setEncoding = function() {
+ return this.source.setEncoding.apply(this.source, arguments);
+};
+
+DelayedStream.prototype.resume = function() {
+ if (!this._released) {
+ this.release();
+ }
+
+ this.source.resume();
+};
+
+DelayedStream.prototype.pause = function() {
+ this.source.pause();
+};
+
+DelayedStream.prototype.release = function() {
+ this._released = true;
+
+ this._bufferedEvents.forEach(function(args) {
+ this.emit.apply(this, args);
+ }.bind(this));
+ this._bufferedEvents = [];
+};
+
+DelayedStream.prototype.pipe = function() {
+ var r = Stream.prototype.pipe.apply(this, arguments);
+ this.resume();
+ return r;
+};
+
+DelayedStream.prototype._handleEmit = function(args) {
+ if (this._released) {
+ this.emit.apply(this, args);
+ return;
+ }
+
+ if (args[0] === 'data') {
+ this.dataSize += args[1].length;
+ this._checkIfMaxDataSizeExceeded();
+ }
+
+ this._bufferedEvents.push(args);
+};
+
+DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() {
+ if (this._maxDataSizeExceeded) {
+ return;
+ }
+
+ if (this.dataSize <= this.maxDataSize) {
+ return;
+ }
+
+ this._maxDataSizeExceeded = true;
+ var message =
+ 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.'
+ this.emit('error', new Error(message));
+};
diff --git a/node_modules/delayed-stream/package.json b/node_modules/delayed-stream/package.json
new file mode 100644
index 0000000..eea3291
--- /dev/null
+++ b/node_modules/delayed-stream/package.json
@@ -0,0 +1,27 @@
+{
+ "author": "Felix Geisendörfer <felix@debuggable.com> (http://debuggable.com/)",
+ "contributors": [
+ "Mike Atkins <apeherder@gmail.com>"
+ ],
+ "name": "delayed-stream",
+ "description": "Buffers events from a stream until you are ready to handle them.",
+ "license": "MIT",
+ "version": "1.0.0",
+ "homepage": "https://github.com/felixge/node-delayed-stream",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/felixge/node-delayed-stream.git"
+ },
+ "main": "./lib/delayed_stream",
+ "engines": {
+ "node": ">=0.4.0"
+ },
+ "scripts": {
+ "test": "make test"
+ },
+ "dependencies": {},
+ "devDependencies": {
+ "fake": "0.2.0",
+ "far": "0.0.1"
+ }
+}
diff --git a/node_modules/follow-redirects/LICENSE b/node_modules/follow-redirects/LICENSE
new file mode 100644
index 0000000..742cbad
--- /dev/null
+++ b/node_modules/follow-redirects/LICENSE
@@ -0,0 +1,18 @@
+Copyright 2014–present Olivier Lalonde <olalonde@gmail.com>, James Talmage <james@talmage.io>, Ruben Verborgh
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/follow-redirects/README.md b/node_modules/follow-redirects/README.md
new file mode 100644
index 0000000..eb869a6
--- /dev/null
+++ b/node_modules/follow-redirects/README.md
@@ -0,0 +1,155 @@
+## Follow Redirects
+
+Drop-in replacement for Node's `http` and `https` modules that automatically follows redirects.
+
+[![npm version](https://img.shields.io/npm/v/follow-redirects.svg)](https://www.npmjs.com/package/follow-redirects)
+[![Build Status](https://github.com/follow-redirects/follow-redirects/workflows/CI/badge.svg)](https://github.com/follow-redirects/follow-redirects/actions)
+[![Coverage Status](https://coveralls.io/repos/follow-redirects/follow-redirects/badge.svg?branch=master)](https://coveralls.io/r/follow-redirects/follow-redirects?branch=master)
+[![npm downloads](https://img.shields.io/npm/dm/follow-redirects.svg)](https://www.npmjs.com/package/follow-redirects)
+[![Sponsor on GitHub](https://img.shields.io/static/v1?label=Sponsor&message=%F0%9F%92%96&logo=GitHub)](https://github.com/sponsors/RubenVerborgh)
+
+`follow-redirects` provides [request](https://nodejs.org/api/http.html#http_http_request_options_callback) and [get](https://nodejs.org/api/http.html#http_http_get_options_callback)
+ methods that behave identically to those found on the native [http](https://nodejs.org/api/http.html#http_http_request_options_callback) and [https](https://nodejs.org/api/https.html#https_https_request_options_callback)
+ modules, with the exception that they will seamlessly follow redirects.
+
+```javascript
+const { http, https } = require('follow-redirects');
+
+http.get('http://bit.ly/900913', response => {
+ response.on('data', chunk => {
+ console.log(chunk);
+ });
+}).on('error', err => {
+ console.error(err);
+});
+```
+
+You can inspect the final redirected URL through the `responseUrl` property on the `response`.
+If no redirection happened, `responseUrl` is the original request URL.
+
+```javascript
+const request = https.request({
+ host: 'bitly.com',
+ path: '/UHfDGO',
+}, response => {
+ console.log(response.responseUrl);
+ // 'http://duckduckgo.com/robots.txt'
+});
+request.end();
+```
+
+## Options
+### Global options
+Global options are set directly on the `follow-redirects` module:
+
+```javascript
+const followRedirects = require('follow-redirects');
+followRedirects.maxRedirects = 10;
+followRedirects.maxBodyLength = 20 * 1024 * 1024; // 20 MB
+```
+
+The following global options are supported:
+
+- `maxRedirects` (default: `21`) – sets the maximum number of allowed redirects; if exceeded, an error will be emitted.
+
+- `maxBodyLength` (default: 10MB) – sets the maximum size of the request body; if exceeded, an error will be emitted.
+
+### Per-request options
+Per-request options are set by passing an `options` object:
+
+```javascript
+const url = require('url');
+const { http, https } = require('follow-redirects');
+
+const options = url.parse('http://bit.ly/900913');
+options.maxRedirects = 10;
+options.beforeRedirect = (options, response, request) => {
+ // Use this to adjust the request options upon redirecting,
+ // to inspect the latest response headers,
+ // or to cancel the request by throwing an error
+
+ // response.headers = the redirect response headers
+ // response.statusCode = the redirect response code (eg. 301, 307, etc.)
+
+ // request.url = the requested URL that resulted in a redirect
+ // request.headers = the headers in the request that resulted in a redirect
+ // request.method = the method of the request that resulted in a redirect
+ if (options.hostname === "example.com") {
+ options.auth = "user:password";
+ }
+};
+http.request(options);
+```
+
+In addition to the [standard HTTP](https://nodejs.org/api/http.html#http_http_request_options_callback) and [HTTPS options](https://nodejs.org/api/https.html#https_https_request_options_callback),
+the following per-request options are supported:
+- `followRedirects` (default: `true`) – whether redirects should be followed.
+
+- `maxRedirects` (default: `21`) – sets the maximum number of allowed redirects; if exceeded, an error will be emitted.
+
+- `maxBodyLength` (default: 10MB) – sets the maximum size of the request body; if exceeded, an error will be emitted.
+
+- `beforeRedirect` (default: `undefined`) – optionally change the request `options` on redirects, or abort the request by throwing an error.
+
+- `agents` (default: `undefined`) – sets the `agent` option per protocol, since HTTP and HTTPS use different agents. Example value: `{ http: new http.Agent(), https: new https.Agent() }`
+
+- `trackRedirects` (default: `false`) – whether to store the redirected response details into the `redirects` array on the response object.
+
+
+### Advanced usage
+By default, `follow-redirects` will use the Node.js default implementations
+of [`http`](https://nodejs.org/api/http.html)
+and [`https`](https://nodejs.org/api/https.html).
+To enable features such as caching and/or intermediate request tracking,
+you might instead want to wrap `follow-redirects` around custom protocol implementations:
+
+```javascript
+const { http, https } = require('follow-redirects').wrap({
+ http: require('your-custom-http'),
+ https: require('your-custom-https'),
+});
+```
+
+Such custom protocols only need an implementation of the `request` method.
+
+## Browser Usage
+
+Due to the way the browser works,
+the `http` and `https` browser equivalents perform redirects by default.
+
+By requiring `follow-redirects` this way:
+```javascript
+const http = require('follow-redirects/http');
+const https = require('follow-redirects/https');
+```
+you can easily tell webpack and friends to replace
+`follow-redirect` by the built-in versions:
+
+```json
+{
+ "follow-redirects/http" : "http",
+ "follow-redirects/https" : "https"
+}
+```
+
+## Contributing
+
+Pull Requests are always welcome. Please [file an issue](https://github.com/follow-redirects/follow-redirects/issues)
+ detailing your proposal before you invest your valuable time. Additional features and bug fixes should be accompanied
+ by tests. You can run the test suite locally with a simple `npm test` command.
+
+## Debug Logging
+
+`follow-redirects` uses the excellent [debug](https://www.npmjs.com/package/debug) for logging. To turn on logging
+ set the environment variable `DEBUG=follow-redirects` for debug output from just this module. When running the test
+ suite it is sometimes advantageous to set `DEBUG=*` to see output from the express server as well.
+
+## Authors
+
+- [Ruben Verborgh](https://ruben.verborgh.org/)
+- [Olivier Lalonde](mailto:olalonde@gmail.com)
+- [James Talmage](mailto:james@talmage.io)
+
+## License
+
+[MIT License](https://github.com/follow-redirects/follow-redirects/blob/master/LICENSE)
diff --git a/node_modules/follow-redirects/debug.js b/node_modules/follow-redirects/debug.js
new file mode 100644
index 0000000..decb77d
--- /dev/null
+++ b/node_modules/follow-redirects/debug.js
@@ -0,0 +1,15 @@
+var debug;
+
+module.exports = function () {
+ if (!debug) {
+ try {
+ /* eslint global-require: off */
+ debug = require("debug")("follow-redirects");
+ }
+ catch (error) { /* */ }
+ if (typeof debug !== "function") {
+ debug = function () { /* */ };
+ }
+ }
+ debug.apply(null, arguments);
+};
diff --git a/node_modules/follow-redirects/http.js b/node_modules/follow-redirects/http.js
new file mode 100644
index 0000000..695e356
--- /dev/null
+++ b/node_modules/follow-redirects/http.js
@@ -0,0 +1 @@
+module.exports = require("./").http;
diff --git a/node_modules/follow-redirects/https.js b/node_modules/follow-redirects/https.js
new file mode 100644
index 0000000..d21c921
--- /dev/null
+++ b/node_modules/follow-redirects/https.js
@@ -0,0 +1 @@
+module.exports = require("./").https;
diff --git a/node_modules/follow-redirects/index.js b/node_modules/follow-redirects/index.js
new file mode 100644
index 0000000..f58b933
--- /dev/null
+++ b/node_modules/follow-redirects/index.js
@@ -0,0 +1,672 @@
+var url = require("url");
+var URL = url.URL;
+var http = require("http");
+var https = require("https");
+var Writable = require("stream").Writable;
+var assert = require("assert");
+var debug = require("./debug");
+
+// Whether to use the native URL object or the legacy url module
+var useNativeURL = false;
+try {
+ assert(new URL());
+}
+catch (error) {
+ useNativeURL = error.code === "ERR_INVALID_URL";
+}
+
+// URL fields to preserve in copy operations
+var preservedUrlFields = [
+ "auth",
+ "host",
+ "hostname",
+ "href",
+ "path",
+ "pathname",
+ "port",
+ "protocol",
+ "query",
+ "search",
+ "hash",
+];
+
+// Create handlers that pass events from native requests
+var events = ["abort", "aborted", "connect", "error", "socket", "timeout"];
+var eventHandlers = Object.create(null);
+events.forEach(function (event) {
+ eventHandlers[event] = function (arg1, arg2, arg3) {
+ this._redirectable.emit(event, arg1, arg2, arg3);
+ };
+});
+
+// Error types with codes
+var InvalidUrlError = createErrorType(
+ "ERR_INVALID_URL",
+ "Invalid URL",
+ TypeError
+);
+var RedirectionError = createErrorType(
+ "ERR_FR_REDIRECTION_FAILURE",
+ "Redirected request failed"
+);
+var TooManyRedirectsError = createErrorType(
+ "ERR_FR_TOO_MANY_REDIRECTS",
+ "Maximum number of redirects exceeded",
+ RedirectionError
+);
+var MaxBodyLengthExceededError = createErrorType(
+ "ERR_FR_MAX_BODY_LENGTH_EXCEEDED",
+ "Request body larger than maxBodyLength limit"
+);
+var WriteAfterEndError = createErrorType(
+ "ERR_STREAM_WRITE_AFTER_END",
+ "write after end"
+);
+
+// istanbul ignore next
+var destroy = Writable.prototype.destroy || noop;
+
+// An HTTP(S) request that can be redirected
+function RedirectableRequest(options, responseCallback) {
+ // Initialize the request
+ Writable.call(this);
+ this._sanitizeOptions(options);
+ this._options = options;
+ this._ended = false;
+ this._ending = false;
+ this._redirectCount = 0;
+ this._redirects = [];
+ this._requestBodyLength = 0;
+ this._requestBodyBuffers = [];
+
+ // Attach a callback if passed
+ if (responseCallback) {
+ this.on("response", responseCallback);
+ }
+
+ // React to responses of native requests
+ var self = this;
+ this._onNativeResponse = function (response) {
+ try {
+ self._processResponse(response);
+ }
+ catch (cause) {
+ self.emit("error", cause instanceof RedirectionError ?
+ cause : new RedirectionError({ cause: cause }));
+ }
+ };
+
+ // Perform the first request
+ this._performRequest();
+}
+RedirectableRequest.prototype = Object.create(Writable.prototype);
+
+RedirectableRequest.prototype.abort = function () {
+ destroyRequest(this._currentRequest);
+ this._currentRequest.abort();
+ this.emit("abort");
+};
+
+RedirectableRequest.prototype.destroy = function (error) {
+ destroyRequest(this._currentRequest, error);
+ destroy.call(this, error);
+ return this;
+};
+
+// Writes buffered data to the current native request
+RedirectableRequest.prototype.write = function (data, encoding, callback) {
+ // Writing is not allowed if end has been called
+ if (this._ending) {
+ throw new WriteAfterEndError();
+ }
+
+ // Validate input and shift parameters if necessary
+ if (!isString(data) && !isBuffer(data)) {
+ throw new TypeError("data should be a string, Buffer or Uint8Array");
+ }
+ if (isFunction(encoding)) {
+ callback = encoding;
+ encoding = null;
+ }
+
+ // Ignore empty buffers, since writing them doesn't invoke the callback
+ // https://github.com/nodejs/node/issues/22066
+ if (data.length === 0) {
+ if (callback) {
+ callback();
+ }
+ return;
+ }
+ // Only write when we don't exceed the maximum body length
+ if (this._requestBodyLength + data.length <= this._options.maxBodyLength) {
+ this._requestBodyLength += data.length;
+ this._requestBodyBuffers.push({ data: data, encoding: encoding });
+ this._currentRequest.write(data, encoding, callback);
+ }
+ // Error when we exceed the maximum body length
+ else {
+ this.emit("error", new MaxBodyLengthExceededError());
+ this.abort();
+ }
+};
+
+// Ends the current native request
+RedirectableRequest.prototype.end = function (data, encoding, callback) {
+ // Shift parameters if necessary
+ if (isFunction(data)) {
+ callback = data;
+ data = encoding = null;
+ }
+ else if (isFunction(encoding)) {
+ callback = encoding;
+ encoding = null;
+ }
+
+ // Write data if needed and end
+ if (!data) {
+ this._ended = this._ending = true;
+ this._currentRequest.end(null, null, callback);
+ }
+ else {
+ var self = this;
+ var currentRequest = this._currentRequest;
+ this.write(data, encoding, function () {
+ self._ended = true;
+ currentRequest.end(null, null, callback);
+ });
+ this._ending = true;
+ }
+};
+
+// Sets a header value on the current native request
+RedirectableRequest.prototype.setHeader = function (name, value) {
+ this._options.headers[name] = value;
+ this._currentRequest.setHeader(name, value);
+};
+
+// Clears a header value on the current native request
+RedirectableRequest.prototype.removeHeader = function (name) {
+ delete this._options.headers[name];
+ this._currentRequest.removeHeader(name);
+};
+
+// Global timeout for all underlying requests
+RedirectableRequest.prototype.setTimeout = function (msecs, callback) {
+ var self = this;
+
+ // Destroys the socket on timeout
+ function destroyOnTimeout(socket) {
+ socket.setTimeout(msecs);
+ socket.removeListener("timeout", socket.destroy);
+ socket.addListener("timeout", socket.destroy);
+ }
+
+ // Sets up a timer to trigger a timeout event
+ function startTimer(socket) {
+ if (self._timeout) {
+ clearTimeout(self._timeout);
+ }
+ self._timeout = setTimeout(function () {
+ self.emit("timeout");
+ clearTimer();
+ }, msecs);
+ destroyOnTimeout(socket);
+ }
+
+ // Stops a timeout from triggering
+ function clearTimer() {
+ // Clear the timeout
+ if (self._timeout) {
+ clearTimeout(self._timeout);
+ self._timeout = null;
+ }
+
+ // Clean up all attached listeners
+ self.removeListener("abort", clearTimer);
+ self.removeListener("error", clearTimer);
+ self.removeListener("response", clearTimer);
+ self.removeListener("close", clearTimer);
+ if (callback) {
+ self.removeListener("timeout", callback);
+ }
+ if (!self.socket) {
+ self._currentRequest.removeListener("socket", startTimer);
+ }
+ }
+
+ // Attach callback if passed
+ if (callback) {
+ this.on("timeout", callback);
+ }
+
+ // Start the timer if or when the socket is opened
+ if (this.socket) {
+ startTimer(this.socket);
+ }
+ else {
+ this._currentRequest.once("socket", startTimer);
+ }
+
+ // Clean up on events
+ this.on("socket", destroyOnTimeout);
+ this.on("abort", clearTimer);
+ this.on("error", clearTimer);
+ this.on("response", clearTimer);
+ this.on("close", clearTimer);
+
+ return this;
+};
+
+// Proxy all other public ClientRequest methods
+[
+ "flushHeaders", "getHeader",
+ "setNoDelay", "setSocketKeepAlive",
+].forEach(function (method) {
+ RedirectableRequest.prototype[method] = function (a, b) {
+ return this._currentRequest[method](a, b);
+ };
+});
+
+// Proxy all public ClientRequest properties
+["aborted", "connection", "socket"].forEach(function (property) {
+ Object.defineProperty(RedirectableRequest.prototype, property, {
+ get: function () { return this._currentRequest[property]; },
+ });
+});
+
+RedirectableRequest.prototype._sanitizeOptions = function (options) {
+ // Ensure headers are always present
+ if (!options.headers) {
+ options.headers = {};
+ }
+
+ // Since http.request treats host as an alias of hostname,
+ // but the url module interprets host as hostname plus port,
+ // eliminate the host property to avoid confusion.
+ if (options.host) {
+ // Use hostname if set, because it has precedence
+ if (!options.hostname) {
+ options.hostname = options.host;
+ }
+ delete options.host;
+ }
+
+ // Complete the URL object when necessary
+ if (!options.pathname && options.path) {
+ var searchPos = options.path.indexOf("?");
+ if (searchPos < 0) {
+ options.pathname = options.path;
+ }
+ else {
+ options.pathname = options.path.substring(0, searchPos);
+ options.search = options.path.substring(searchPos);
+ }
+ }
+};
+
+
+// Executes the next native request (initial or redirect)
+RedirectableRequest.prototype._performRequest = function () {
+ // Load the native protocol
+ var protocol = this._options.protocol;
+ var nativeProtocol = this._options.nativeProtocols[protocol];
+ if (!nativeProtocol) {
+ throw new TypeError("Unsupported protocol " + protocol);
+ }
+
+ // If specified, use the agent corresponding to the protocol
+ // (HTTP and HTTPS use different types of agents)
+ if (this._options.agents) {
+ var scheme = protocol.slice(0, -1);
+ this._options.agent = this._options.agents[scheme];
+ }
+
+ // Create the native request and set up its event handlers
+ var request = this._currentRequest =
+ nativeProtocol.request(this._options, this._onNativeResponse);
+ request._redirectable = this;
+ for (var event of events) {
+ request.on(event, eventHandlers[event]);
+ }
+
+ // RFC7230§5.3.1: When making a request directly to an origin server, […]
+ // a client MUST send only the absolute path […] as the request-target.
+ this._currentUrl = /^\//.test(this._options.path) ?
+ url.format(this._options) :
+ // When making a request to a proxy, […]
+ // a client MUST send the target URI in absolute-form […].
+ this._options.path;
+
+ // End a redirected request
+ // (The first request must be ended explicitly with RedirectableRequest#end)
+ if (this._isRedirect) {
+ // Write the request entity and end
+ var i = 0;
+ var self = this;
+ var buffers = this._requestBodyBuffers;
+ (function writeNext(error) {
+ // Only write if this request has not been redirected yet
+ /* istanbul ignore else */
+ if (request === self._currentRequest) {
+ // Report any write errors
+ /* istanbul ignore if */
+ if (error) {
+ self.emit("error", error);
+ }
+ // Write the next buffer if there are still left
+ else if (i < buffers.length) {
+ var buffer = buffers[i++];
+ /* istanbul ignore else */
+ if (!request.finished) {
+ request.write(buffer.data, buffer.encoding, writeNext);
+ }
+ }
+ // End the request if `end` has been called on us
+ else if (self._ended) {
+ request.end();
+ }
+ }
+ }());
+ }
+};
+
+// Processes a response from the current native request
+RedirectableRequest.prototype._processResponse = function (response) {
+ // Store the redirected response
+ var statusCode = response.statusCode;
+ if (this._options.trackRedirects) {
+ this._redirects.push({
+ url: this._currentUrl,
+ headers: response.headers,
+ statusCode: statusCode,
+ });
+ }
+
+ // RFC7231§6.4: The 3xx (Redirection) class of status code indicates
+ // that further action needs to be taken by the user agent in order to
+ // fulfill the request. If a Location header field is provided,
+ // the user agent MAY automatically redirect its request to the URI
+ // referenced by the Location field value,
+ // even if the specific status code is not understood.
+
+ // If the response is not a redirect; return it as-is
+ var location = response.headers.location;
+ if (!location || this._options.followRedirects === false ||
+ statusCode < 300 || statusCode >= 400) {
+ response.responseUrl = this._currentUrl;
+ response.redirects = this._redirects;
+ this.emit("response", response);
+
+ // Clean up
+ this._requestBodyBuffers = [];
+ return;
+ }
+
+ // The response is a redirect, so abort the current request
+ destroyRequest(this._currentRequest);
+ // Discard the remainder of the response to avoid waiting for data
+ response.destroy();
+
+ // RFC7231§6.4: A client SHOULD detect and intervene
+ // in cyclical redirections (i.e., "infinite" redirection loops).
+ if (++this._redirectCount > this._options.maxRedirects) {
+ throw new TooManyRedirectsError();
+ }
+
+ // Store the request headers if applicable
+ var requestHeaders;
+ var beforeRedirect = this._options.beforeRedirect;
+ if (beforeRedirect) {
+ requestHeaders = Object.assign({
+ // The Host header was set by nativeProtocol.request
+ Host: response.req.getHeader("host"),
+ }, this._options.headers);
+ }
+
+ // RFC7231§6.4: Automatic redirection needs to done with
+ // care for methods not known to be safe, […]
+ // RFC7231§6.4.2–3: For historical reasons, a user agent MAY change
+ // the request method from POST to GET for the subsequent request.
+ var method = this._options.method;
+ if ((statusCode === 301 || statusCode === 302) && this._options.method === "POST" ||
+ // RFC7231§6.4.4: The 303 (See Other) status code indicates that
+ // the server is redirecting the user agent to a different resource […]
+ // A user agent can perform a retrieval request targeting that URI
+ // (a GET or HEAD request if using HTTP) […]
+ (statusCode === 303) && !/^(?:GET|HEAD)$/.test(this._options.method)) {
+ this._options.method = "GET";
+ // Drop a possible entity and headers related to it
+ this._requestBodyBuffers = [];
+ removeMatchingHeaders(/^content-/i, this._options.headers);
+ }
+
+ // Drop the Host header, as the redirect might lead to a different host
+ var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers);
+
+ // If the redirect is relative, carry over the host of the last request
+ var currentUrlParts = parseUrl(this._currentUrl);
+ var currentHost = currentHostHeader || currentUrlParts.host;
+ var currentUrl = /^\w+:/.test(location) ? this._currentUrl :
+ url.format(Object.assign(currentUrlParts, { host: currentHost }));
+
+ // Create the redirected request
+ var redirectUrl = resolveUrl(location, currentUrl);
+ debug("redirecting to", redirectUrl.href);
+ this._isRedirect = true;
+ spreadUrlObject(redirectUrl, this._options);
+
+ // Drop confidential headers when redirecting to a less secure protocol
+ // or to a different domain that is not a superdomain
+ if (redirectUrl.protocol !== currentUrlParts.protocol &&
+ redirectUrl.protocol !== "https:" ||
+ redirectUrl.host !== currentHost &&
+ !isSubdomain(redirectUrl.host, currentHost)) {
+ removeMatchingHeaders(/^(?:authorization|cookie)$/i, this._options.headers);
+ }
+
+ // Evaluate the beforeRedirect callback
+ if (isFunction(beforeRedirect)) {
+ var responseDetails = {
+ headers: response.headers,
+ statusCode: statusCode,
+ };
+ var requestDetails = {
+ url: currentUrl,
+ method: method,
+ headers: requestHeaders,
+ };
+ beforeRedirect(this._options, responseDetails, requestDetails);
+ this._sanitizeOptions(this._options);
+ }
+
+ // Perform the redirected request
+ this._performRequest();
+};
+
+// Wraps the key/value object of protocols with redirect functionality
+function wrap(protocols) {
+ // Default settings
+ var exports = {
+ maxRedirects: 21,
+ maxBodyLength: 10 * 1024 * 1024,
+ };
+
+ // Wrap each protocol
+ var nativeProtocols = {};
+ Object.keys(protocols).forEach(function (scheme) {
+ var protocol = scheme + ":";
+ var nativeProtocol = nativeProtocols[protocol] = protocols[scheme];
+ var wrappedProtocol = exports[scheme] = Object.create(nativeProtocol);
+
+ // Executes a request, following redirects
+ function request(input, options, callback) {
+ // Parse parameters, ensuring that input is an object
+ if (isURL(input)) {
+ input = spreadUrlObject(input);
+ }
+ else if (isString(input)) {
+ input = spreadUrlObject(parseUrl(input));
+ }
+ else {
+ callback = options;
+ options = validateUrl(input);
+ input = { protocol: protocol };
+ }
+ if (isFunction(options)) {
+ callback = options;
+ options = null;
+ }
+
+ // Set defaults
+ options = Object.assign({
+ maxRedirects: exports.maxRedirects,
+ maxBodyLength: exports.maxBodyLength,
+ }, input, options);
+ options.nativeProtocols = nativeProtocols;
+ if (!isString(options.host) && !isString(options.hostname)) {
+ options.hostname = "::1";
+ }
+
+ assert.equal(options.protocol, protocol, "protocol mismatch");
+ debug("options", options);
+ return new RedirectableRequest(options, callback);
+ }
+
+ // Executes a GET request, following redirects
+ function get(input, options, callback) {
+ var wrappedRequest = wrappedProtocol.request(input, options, callback);
+ wrappedRequest.end();
+ return wrappedRequest;
+ }
+
+ // Expose the properties on the wrapped protocol
+ Object.defineProperties(wrappedProtocol, {
+ request: { value: request, configurable: true, enumerable: true, writable: true },
+ get: { value: get, configurable: true, enumerable: true, writable: true },
+ });
+ });
+ return exports;
+}
+
+function noop() { /* empty */ }
+
+function parseUrl(input) {
+ var parsed;
+ /* istanbul ignore else */
+ if (useNativeURL) {
+ parsed = new URL(input);
+ }
+ else {
+ // Ensure the URL is valid and absolute
+ parsed = validateUrl(url.parse(input));
+ if (!isString(parsed.protocol)) {
+ throw new InvalidUrlError({ input });
+ }
+ }
+ return parsed;
+}
+
+function resolveUrl(relative, base) {
+ /* istanbul ignore next */
+ return useNativeURL ? new URL(relative, base) : parseUrl(url.resolve(base, relative));
+}
+
+function validateUrl(input) {
+ if (/^\[/.test(input.hostname) && !/^\[[:0-9a-f]+\]$/i.test(input.hostname)) {
+ throw new InvalidUrlError({ input: input.href || input });
+ }
+ if (/^\[/.test(input.host) && !/^\[[:0-9a-f]+\](:\d+)?$/i.test(input.host)) {
+ throw new InvalidUrlError({ input: input.href || input });
+ }
+ return input;
+}
+
+function spreadUrlObject(urlObject, target) {
+ var spread = target || {};
+ for (var key of preservedUrlFields) {
+ spread[key] = urlObject[key];
+ }
+
+ // Fix IPv6 hostname
+ if (spread.hostname.startsWith("[")) {
+ spread.hostname = spread.hostname.slice(1, -1);
+ }
+ // Ensure port is a number
+ if (spread.port !== "") {
+ spread.port = Number(spread.port);
+ }
+ // Concatenate path
+ spread.path = spread.search ? spread.pathname + spread.search : spread.pathname;
+
+ return spread;
+}
+
+function removeMatchingHeaders(regex, headers) {
+ var lastValue;
+ for (var header in headers) {
+ if (regex.test(header)) {
+ lastValue = headers[header];
+ delete headers[header];
+ }
+ }
+ return (lastValue === null || typeof lastValue === "undefined") ?
+ undefined : String(lastValue).trim();
+}
+
+function createErrorType(code, message, baseClass) {
+ // Create constructor
+ function CustomError(properties) {
+ Error.captureStackTrace(this, this.constructor);
+ Object.assign(this, properties || {});
+ this.code = code;
+ this.message = this.cause ? message + ": " + this.cause.message : message;
+ }
+
+ // Attach constructor and set default properties
+ CustomError.prototype = new (baseClass || Error)();
+ Object.defineProperties(CustomError.prototype, {
+ constructor: {
+ value: CustomError,
+ enumerable: false,
+ },
+ name: {
+ value: "Error [" + code + "]",
+ enumerable: false,
+ },
+ });
+ return CustomError;
+}
+
+function destroyRequest(request, error) {
+ for (var event of events) {
+ request.removeListener(event, eventHandlers[event]);
+ }
+ request.on("error", noop);
+ request.destroy(error);
+}
+
+function isSubdomain(subdomain, domain) {
+ assert(isString(subdomain) && isString(domain));
+ var dot = subdomain.length - domain.length - 1;
+ return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain);
+}
+
+function isString(value) {
+ return typeof value === "string" || value instanceof String;
+}
+
+function isFunction(value) {
+ return typeof value === "function";
+}
+
+function isBuffer(value) {
+ return typeof value === "object" && ("length" in value);
+}
+
+function isURL(value) {
+ return URL && value instanceof URL;
+}
+
+// Exports
+module.exports = wrap({ http: http, https: https });
+module.exports.wrap = wrap;
diff --git a/node_modules/follow-redirects/package.json b/node_modules/follow-redirects/package.json
new file mode 100644
index 0000000..9b87663
--- /dev/null
+++ b/node_modules/follow-redirects/package.json
@@ -0,0 +1,58 @@
+{
+ "name": "follow-redirects",
+ "version": "1.15.5",
+ "description": "HTTP and HTTPS modules that follow redirects.",
+ "license": "MIT",
+ "main": "index.js",
+ "files": [
+ "*.js"
+ ],
+ "engines": {
+ "node": ">=4.0"
+ },
+ "scripts": {
+ "lint": "eslint *.js test",
+ "test": "nyc mocha"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git@github.com:follow-redirects/follow-redirects.git"
+ },
+ "homepage": "https://github.com/follow-redirects/follow-redirects",
+ "bugs": {
+ "url": "https://github.com/follow-redirects/follow-redirects/issues"
+ },
+ "keywords": [
+ "http",
+ "https",
+ "url",
+ "redirect",
+ "client",
+ "location",
+ "utility"
+ ],
+ "author": "Ruben Verborgh <ruben@verborgh.org> (https://ruben.verborgh.org/)",
+ "contributors": [
+ "Olivier Lalonde <olalonde@gmail.com> (http://www.syskall.com)",
+ "James Talmage <james@talmage.io>"
+ ],
+ "funding": [
+ {
+ "type": "individual",
+ "url": "https://github.com/sponsors/RubenVerborgh"
+ }
+ ],
+ "peerDependenciesMeta": {
+ "debug": {
+ "optional": true
+ }
+ },
+ "devDependencies": {
+ "concat-stream": "^2.0.0",
+ "eslint": "^5.16.0",
+ "express": "^4.16.4",
+ "lolex": "^3.1.0",
+ "mocha": "^6.0.2",
+ "nyc": "^14.1.1"
+ }
+}
diff --git a/node_modules/form-data/License b/node_modules/form-data/License
new file mode 100644
index 0000000..c7ff12a
--- /dev/null
+++ b/node_modules/form-data/License
@@ -0,0 +1,19 @@
+Copyright (c) 2012 Felix Geisendörfer (felix@debuggable.com) and contributors
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
diff --git a/node_modules/form-data/README.md.bak b/node_modules/form-data/README.md.bak
new file mode 100644
index 0000000..298a1a2
--- /dev/null
+++ b/node_modules/form-data/README.md.bak
@@ -0,0 +1,358 @@
+# Form-Data [![NPM Module](https://img.shields.io/npm/v/form-data.svg)](https://www.npmjs.com/package/form-data) [![Join the chat at https://gitter.im/form-data/form-data](http://form-data.github.io/images/gitterbadge.svg)](https://gitter.im/form-data/form-data)
+
+A library to create readable ```"multipart/form-data"``` streams. Can be used to submit forms and file uploads to other web applications.
+
+The API of this library is inspired by the [XMLHttpRequest-2 FormData Interface][xhr2-fd].
+
+[xhr2-fd]: http://dev.w3.org/2006/webapi/XMLHttpRequest-2/Overview.html#the-formdata-interface
+
+[![Linux Build](https://img.shields.io/travis/form-data/form-data/v4.0.0.svg?label=linux:6.x-12.x)](https://travis-ci.org/form-data/form-data)
+[![MacOS Build](https://img.shields.io/travis/form-data/form-data/v4.0.0.svg?label=macos:6.x-12.x)](https://travis-ci.org/form-data/form-data)
+[![Windows Build](https://img.shields.io/travis/form-data/form-data/v4.0.0.svg?label=windows:6.x-12.x)](https://travis-ci.org/form-data/form-data)
+
+[![Coverage Status](https://img.shields.io/coveralls/form-data/form-data/v4.0.0.svg?label=code+coverage)](https://coveralls.io/github/form-data/form-data?branch=master)
+[![Dependency Status](https://img.shields.io/david/form-data/form-data.svg)](https://david-dm.org/form-data/form-data)
+
+## Install
+
+```
+npm install --save form-data
+```
+
+## Usage
+
+In this example we are constructing a form with 3 fields that contain a string,
+a buffer and a file stream.
+
+``` javascript
+var FormData = require('form-data');
+var fs = require('fs');
+
+var form = new FormData();
+form.append('my_field', 'my value');
+form.append('my_buffer', new Buffer(10));
+form.append('my_file', fs.createReadStream('/foo/bar.jpg'));
+```
+
+Also you can use http-response stream:
+
+``` javascript
+var FormData = require('form-data');
+var http = require('http');
+
+var form = new FormData();
+
+http.request('http://nodejs.org/images/logo.png', function(response) {
+ form.append('my_field', 'my value');
+ form.append('my_buffer', new Buffer(10));
+ form.append('my_logo', response);
+});
+```
+
+Or @mikeal's [request](https://github.com/request/request) stream:
+
+``` javascript
+var FormData = require('form-data');
+var request = require('request');
+
+var form = new FormData();
+
+form.append('my_field', 'my value');
+form.append('my_buffer', new Buffer(10));
+form.append('my_logo', request('http://nodejs.org/images/logo.png'));
+```
+
+In order to submit this form to a web application, call ```submit(url, [callback])``` method:
+
+``` javascript
+form.submit('http://example.org/', function(err, res) {
+ // res – response object (http.IncomingMessage) //
+ res.resume();
+});
+
+```
+
+For more advanced request manipulations ```submit()``` method returns ```http.ClientRequest``` object, or you can choose from one of the alternative submission methods.
+
+### Custom options
+
+You can provide custom options, such as `maxDataSize`:
+
+``` javascript
+var FormData = require('form-data');
+
+var form = new FormData({ maxDataSize: 20971520 });
+form.append('my_field', 'my value');
+form.append('my_buffer', /* something big */);
+```
+
+List of available options could be found in [combined-stream](https://github.com/felixge/node-combined-stream/blob/master/lib/combined_stream.js#L7-L15)
+
+### Alternative submission methods
+
+You can use node's http client interface:
+
+``` javascript
+var http = require('http');
+
+var request = http.request({
+ method: 'post',
+ host: 'example.org',
+ path: '/upload',
+ headers: form.getHeaders()
+});
+
+form.pipe(request);
+
+request.on('response', function(res) {
+ console.log(res.statusCode);
+});
+```
+
+Or if you would prefer the `'Content-Length'` header to be set for you:
+
+``` javascript
+form.submit('example.org/upload', function(err, res) {
+ console.log(res.statusCode);
+});
+```
+
+To use custom headers and pre-known length in parts:
+
+``` javascript
+var CRLF = '\r\n';
+var form = new FormData();
+
+var options = {
+ header: CRLF + '--' + form.getBoundary() + CRLF + 'X-Custom-Header: 123' + CRLF + CRLF,
+ knownLength: 1
+};
+
+form.append('my_buffer', buffer, options);
+
+form.submit('http://example.com/', function(err, res) {
+ if (err) throw err;
+ console.log('Done');
+});
+```
+
+Form-Data can recognize and fetch all the required information from common types of streams (```fs.readStream```, ```http.response``` and ```mikeal's request```), for some other types of streams you'd need to provide "file"-related information manually:
+
+``` javascript
+someModule.stream(function(err, stdout, stderr) {
+ if (err) throw err;
+
+ var form = new FormData();
+
+ form.append('file', stdout, {
+ filename: 'unicycle.jpg', // ... or:
+ filepath: 'photos/toys/unicycle.jpg',
+ contentType: 'image/jpeg',
+ knownLength: 19806
+ });
+
+ form.submit('http://example.com/', function(err, res) {
+ if (err) throw err;
+ console.log('Done');
+ });
+});
+```
+
+The `filepath` property overrides `filename` and may contain a relative path. This is typically used when uploading [multiple files from a directory](https://wicg.github.io/entries-api/#dom-htmlinputelement-webkitdirectory).
+
+For edge cases, like POST request to URL with query string or to pass HTTP auth credentials, object can be passed to `form.submit()` as first parameter:
+
+``` javascript
+form.submit({
+ host: 'example.com',
+ path: '/probably.php?extra=params',
+ auth: 'username:password'
+}, function(err, res) {
+ console.log(res.statusCode);
+});
+```
+
+In case you need to also send custom HTTP headers with the POST request, you can use the `headers` key in first parameter of `form.submit()`:
+
+``` javascript
+form.submit({
+ host: 'example.com',
+ path: '/surelynot.php',
+ headers: {'x-test-header': 'test-header-value'}
+}, function(err, res) {
+ console.log(res.statusCode);
+});
+```
+
+### Methods
+
+- [_Void_ append( **String** _field_, **Mixed** _value_ [, **Mixed** _options_] )](https://github.com/form-data/form-data#void-append-string-field-mixed-value--mixed-options-).
+- [_Headers_ getHeaders( [**Headers** _userHeaders_] )](https://github.com/form-data/form-data#array-getheaders-array-userheaders-)
+- [_String_ getBoundary()](https://github.com/form-data/form-data#string-getboundary)
+- [_Void_ setBoundary()](https://github.com/form-data/form-data#void-setboundary)
+- [_Buffer_ getBuffer()](https://github.com/form-data/form-data#buffer-getbuffer)
+- [_Integer_ getLengthSync()](https://github.com/form-data/form-data#integer-getlengthsync)
+- [_Integer_ getLength( **function** _callback_ )](https://github.com/form-data/form-data#integer-getlength-function-callback-)
+- [_Boolean_ hasKnownLength()](https://github.com/form-data/form-data#boolean-hasknownlength)
+- [_Request_ submit( _params_, **function** _callback_ )](https://github.com/form-data/form-data#request-submit-params-function-callback-)
+- [_String_ toString()](https://github.com/form-data/form-data#string-tostring)
+
+#### _Void_ append( **String** _field_, **Mixed** _value_ [, **Mixed** _options_] )
+Append data to the form. You can submit about any format (string, integer, boolean, buffer, etc.). However, Arrays are not supported and need to be turned into strings by the user.
+```javascript
+var form = new FormData();
+form.append( 'my_string', 'my value' );
+form.append( 'my_integer', 1 );
+form.append( 'my_boolean', true );
+form.append( 'my_buffer', new Buffer(10) );
+form.append( 'my_array_as_json', JSON.stringify( ['bird','cute'] ) )
+```
+
+You may provide a string for options, or an object.
+```javascript
+// Set filename by providing a string for options
+form.append( 'my_file', fs.createReadStream('/foo/bar.jpg'), 'bar.jpg' );
+
+// provide an object.
+form.append( 'my_file', fs.createReadStream('/foo/bar.jpg'), {filename: 'bar.jpg', contentType: 'image/jpeg', knownLength: 19806} );
+```
+
+#### _Headers_ getHeaders( [**Headers** _userHeaders_] )
+This method adds the correct `content-type` header to the provided array of `userHeaders`.
+
+#### _String_ getBoundary()
+Return the boundary of the formData. By default, the boundary consists of 26 `-` followed by 24 numbers
+for example:
+```javascript
+--------------------------515890814546601021194782
+```
+
+#### _Void_ setBoundary(String _boundary_)
+Set the boundary string, overriding the default behavior described above.
+
+_Note: The boundary must be unique and may not appear in the data._
+
+#### _Buffer_ getBuffer()
+Return the full formdata request package, as a Buffer. You can insert this Buffer in e.g. Axios to send multipart data.
+```javascript
+var form = new FormData();
+form.append( 'my_buffer', Buffer.from([0x4a,0x42,0x20,0x52,0x6f,0x63,0x6b,0x73]) );
+form.append( 'my_file', fs.readFileSync('/foo/bar.jpg') );
+
+axios.post( 'https://example.com/path/to/api',
+ form.getBuffer(),
+ form.getHeaders()
+ )
+```
+**Note:** Because the output is of type Buffer, you can only append types that are accepted by Buffer: *string, Buffer, ArrayBuffer, Array, or Array-like Object*. A ReadStream for example will result in an error.
+
+#### _Integer_ getLengthSync()
+Same as `getLength` but synchronous.
+
+_Note: getLengthSync __doesn't__ calculate streams length._
+
+#### _Integer_ getLength( **function** _callback_ )
+Returns the `Content-Length` async. The callback is used to handle errors and continue once the length has been calculated
+```javascript
+this.getLength(function(err, length) {
+ if (err) {
+ this._error(err);
+ return;
+ }
+
+ // add content length
+ request.setHeader('Content-Length', length);
+
+ ...
+}.bind(this));
+```
+
+#### _Boolean_ hasKnownLength()
+Checks if the length of added values is known.
+
+#### _Request_ submit( _params_, **function** _callback_ )
+Submit the form to a web application.
+```javascript
+var form = new FormData();
+form.append( 'my_string', 'Hello World' );
+
+form.submit( 'http://example.com/', function(err, res) {
+ // res – response object (http.IncomingMessage) //
+ res.resume();
+} );
+```
+
+#### _String_ toString()
+Returns the form data as a string. Don't use this if you are sending files or buffers, use `getBuffer()` instead.
+
+### Integration with other libraries
+
+#### Request
+
+Form submission using [request](https://github.com/request/request):
+
+```javascript
+var formData = {
+ my_field: 'my_value',
+ my_file: fs.createReadStream(__dirname + '/unicycle.jpg'),
+};
+
+request.post({url:'http://service.com/upload', formData: formData}, function(err, httpResponse, body) {
+ if (err) {
+ return console.error('upload failed:', err);
+ }
+ console.log('Upload successful! Server responded with:', body);
+});
+```
+
+For more details see [request readme](https://github.com/request/request#multipartform-data-multipart-form-uploads).
+
+#### node-fetch
+
+You can also submit a form using [node-fetch](https://github.com/bitinn/node-fetch):
+
+```javascript
+var form = new FormData();
+
+form.append('a', 1);
+
+fetch('http://example.com', { method: 'POST', body: form })
+ .then(function(res) {
+ return res.json();
+ }).then(function(json) {
+ console.log(json);
+ });
+```
+
+#### axios
+
+In Node.js you can post a file using [axios](https://github.com/axios/axios):
+```javascript
+const form = new FormData();
+const stream = fs.createReadStream(PATH_TO_FILE);
+
+form.append('image', stream);
+
+// In Node.js environment you need to set boundary in the header field 'Content-Type' by calling method `getHeaders`
+const formHeaders = form.getHeaders();
+
+axios.post('http://example.com', form, {
+ headers: {
+ ...formHeaders,
+ },
+})
+.then(response => response)
+.catch(error => error)
+```
+
+## Notes
+
+- ```getLengthSync()``` method DOESN'T calculate length for streams, use ```knownLength``` options as workaround.
+- ```getLength(cb)``` will send an error as first parameter of callback if stream length cannot be calculated (e.g. send in custom streams w/o using ```knownLength```).
+- ```submit``` will not add `content-length` if form length is unknown or not calculable.
+- Starting version `2.x` FormData has dropped support for `node@0.10.x`.
+- Starting version `3.x` FormData has dropped support for `node@4.x`.
+
+## License
+
+Form-Data is released under the [MIT](License) license.
diff --git a/node_modules/form-data/Readme.md b/node_modules/form-data/Readme.md
new file mode 100644
index 0000000..298a1a2
--- /dev/null
+++ b/node_modules/form-data/Readme.md
@@ -0,0 +1,358 @@
+# Form-Data [![NPM Module](https://img.shields.io/npm/v/form-data.svg)](https://www.npmjs.com/package/form-data) [![Join the chat at https://gitter.im/form-data/form-data](http://form-data.github.io/images/gitterbadge.svg)](https://gitter.im/form-data/form-data)
+
+A library to create readable ```"multipart/form-data"``` streams. Can be used to submit forms and file uploads to other web applications.
+
+The API of this library is inspired by the [XMLHttpRequest-2 FormData Interface][xhr2-fd].
+
+[xhr2-fd]: http://dev.w3.org/2006/webapi/XMLHttpRequest-2/Overview.html#the-formdata-interface
+
+[![Linux Build](https://img.shields.io/travis/form-data/form-data/v4.0.0.svg?label=linux:6.x-12.x)](https://travis-ci.org/form-data/form-data)
+[![MacOS Build](https://img.shields.io/travis/form-data/form-data/v4.0.0.svg?label=macos:6.x-12.x)](https://travis-ci.org/form-data/form-data)
+[![Windows Build](https://img.shields.io/travis/form-data/form-data/v4.0.0.svg?label=windows:6.x-12.x)](https://travis-ci.org/form-data/form-data)
+
+[![Coverage Status](https://img.shields.io/coveralls/form-data/form-data/v4.0.0.svg?label=code+coverage)](https://coveralls.io/github/form-data/form-data?branch=master)
+[![Dependency Status](https://img.shields.io/david/form-data/form-data.svg)](https://david-dm.org/form-data/form-data)
+
+## Install
+
+```
+npm install --save form-data
+```
+
+## Usage
+
+In this example we are constructing a form with 3 fields that contain a string,
+a buffer and a file stream.
+
+``` javascript
+var FormData = require('form-data');
+var fs = require('fs');
+
+var form = new FormData();
+form.append('my_field', 'my value');
+form.append('my_buffer', new Buffer(10));
+form.append('my_file', fs.createReadStream('/foo/bar.jpg'));
+```
+
+Also you can use http-response stream:
+
+``` javascript
+var FormData = require('form-data');
+var http = require('http');
+
+var form = new FormData();
+
+http.request('http://nodejs.org/images/logo.png', function(response) {
+ form.append('my_field', 'my value');
+ form.append('my_buffer', new Buffer(10));
+ form.append('my_logo', response);
+});
+```
+
+Or @mikeal's [request](https://github.com/request/request) stream:
+
+``` javascript
+var FormData = require('form-data');
+var request = require('request');
+
+var form = new FormData();
+
+form.append('my_field', 'my value');
+form.append('my_buffer', new Buffer(10));
+form.append('my_logo', request('http://nodejs.org/images/logo.png'));
+```
+
+In order to submit this form to a web application, call ```submit(url, [callback])``` method:
+
+``` javascript
+form.submit('http://example.org/', function(err, res) {
+ // res – response object (http.IncomingMessage) //
+ res.resume();
+});
+
+```
+
+For more advanced request manipulations ```submit()``` method returns ```http.ClientRequest``` object, or you can choose from one of the alternative submission methods.
+
+### Custom options
+
+You can provide custom options, such as `maxDataSize`:
+
+``` javascript
+var FormData = require('form-data');
+
+var form = new FormData({ maxDataSize: 20971520 });
+form.append('my_field', 'my value');
+form.append('my_buffer', /* something big */);
+```
+
+List of available options could be found in [combined-stream](https://github.com/felixge/node-combined-stream/blob/master/lib/combined_stream.js#L7-L15)
+
+### Alternative submission methods
+
+You can use node's http client interface:
+
+``` javascript
+var http = require('http');
+
+var request = http.request({
+ method: 'post',
+ host: 'example.org',
+ path: '/upload',
+ headers: form.getHeaders()
+});
+
+form.pipe(request);
+
+request.on('response', function(res) {
+ console.log(res.statusCode);
+});
+```
+
+Or if you would prefer the `'Content-Length'` header to be set for you:
+
+``` javascript
+form.submit('example.org/upload', function(err, res) {
+ console.log(res.statusCode);
+});
+```
+
+To use custom headers and pre-known length in parts:
+
+``` javascript
+var CRLF = '\r\n';
+var form = new FormData();
+
+var options = {
+ header: CRLF + '--' + form.getBoundary() + CRLF + 'X-Custom-Header: 123' + CRLF + CRLF,
+ knownLength: 1
+};
+
+form.append('my_buffer', buffer, options);
+
+form.submit('http://example.com/', function(err, res) {
+ if (err) throw err;
+ console.log('Done');
+});
+```
+
+Form-Data can recognize and fetch all the required information from common types of streams (```fs.readStream```, ```http.response``` and ```mikeal's request```), for some other types of streams you'd need to provide "file"-related information manually:
+
+``` javascript
+someModule.stream(function(err, stdout, stderr) {
+ if (err) throw err;
+
+ var form = new FormData();
+
+ form.append('file', stdout, {
+ filename: 'unicycle.jpg', // ... or:
+ filepath: 'photos/toys/unicycle.jpg',
+ contentType: 'image/jpeg',
+ knownLength: 19806
+ });
+
+ form.submit('http://example.com/', function(err, res) {
+ if (err) throw err;
+ console.log('Done');
+ });
+});
+```
+
+The `filepath` property overrides `filename` and may contain a relative path. This is typically used when uploading [multiple files from a directory](https://wicg.github.io/entries-api/#dom-htmlinputelement-webkitdirectory).
+
+For edge cases, like POST request to URL with query string or to pass HTTP auth credentials, object can be passed to `form.submit()` as first parameter:
+
+``` javascript
+form.submit({
+ host: 'example.com',
+ path: '/probably.php?extra=params',
+ auth: 'username:password'
+}, function(err, res) {
+ console.log(res.statusCode);
+});
+```
+
+In case you need to also send custom HTTP headers with the POST request, you can use the `headers` key in first parameter of `form.submit()`:
+
+``` javascript
+form.submit({
+ host: 'example.com',
+ path: '/surelynot.php',
+ headers: {'x-test-header': 'test-header-value'}
+}, function(err, res) {
+ console.log(res.statusCode);
+});
+```
+
+### Methods
+
+- [_Void_ append( **String** _field_, **Mixed** _value_ [, **Mixed** _options_] )](https://github.com/form-data/form-data#void-append-string-field-mixed-value--mixed-options-).
+- [_Headers_ getHeaders( [**Headers** _userHeaders_] )](https://github.com/form-data/form-data#array-getheaders-array-userheaders-)
+- [_String_ getBoundary()](https://github.com/form-data/form-data#string-getboundary)
+- [_Void_ setBoundary()](https://github.com/form-data/form-data#void-setboundary)
+- [_Buffer_ getBuffer()](https://github.com/form-data/form-data#buffer-getbuffer)
+- [_Integer_ getLengthSync()](https://github.com/form-data/form-data#integer-getlengthsync)
+- [_Integer_ getLength( **function** _callback_ )](https://github.com/form-data/form-data#integer-getlength-function-callback-)
+- [_Boolean_ hasKnownLength()](https://github.com/form-data/form-data#boolean-hasknownlength)
+- [_Request_ submit( _params_, **function** _callback_ )](https://github.com/form-data/form-data#request-submit-params-function-callback-)
+- [_String_ toString()](https://github.com/form-data/form-data#string-tostring)
+
+#### _Void_ append( **String** _field_, **Mixed** _value_ [, **Mixed** _options_] )
+Append data to the form. You can submit about any format (string, integer, boolean, buffer, etc.). However, Arrays are not supported and need to be turned into strings by the user.
+```javascript
+var form = new FormData();
+form.append( 'my_string', 'my value' );
+form.append( 'my_integer', 1 );
+form.append( 'my_boolean', true );
+form.append( 'my_buffer', new Buffer(10) );
+form.append( 'my_array_as_json', JSON.stringify( ['bird','cute'] ) )
+```
+
+You may provide a string for options, or an object.
+```javascript
+// Set filename by providing a string for options
+form.append( 'my_file', fs.createReadStream('/foo/bar.jpg'), 'bar.jpg' );
+
+// provide an object.
+form.append( 'my_file', fs.createReadStream('/foo/bar.jpg'), {filename: 'bar.jpg', contentType: 'image/jpeg', knownLength: 19806} );
+```
+
+#### _Headers_ getHeaders( [**Headers** _userHeaders_] )
+This method adds the correct `content-type` header to the provided array of `userHeaders`.
+
+#### _String_ getBoundary()
+Return the boundary of the formData. By default, the boundary consists of 26 `-` followed by 24 numbers
+for example:
+```javascript
+--------------------------515890814546601021194782
+```
+
+#### _Void_ setBoundary(String _boundary_)
+Set the boundary string, overriding the default behavior described above.
+
+_Note: The boundary must be unique and may not appear in the data._
+
+#### _Buffer_ getBuffer()
+Return the full formdata request package, as a Buffer. You can insert this Buffer in e.g. Axios to send multipart data.
+```javascript
+var form = new FormData();
+form.append( 'my_buffer', Buffer.from([0x4a,0x42,0x20,0x52,0x6f,0x63,0x6b,0x73]) );
+form.append( 'my_file', fs.readFileSync('/foo/bar.jpg') );
+
+axios.post( 'https://example.com/path/to/api',
+ form.getBuffer(),
+ form.getHeaders()
+ )
+```
+**Note:** Because the output is of type Buffer, you can only append types that are accepted by Buffer: *string, Buffer, ArrayBuffer, Array, or Array-like Object*. A ReadStream for example will result in an error.
+
+#### _Integer_ getLengthSync()
+Same as `getLength` but synchronous.
+
+_Note: getLengthSync __doesn't__ calculate streams length._
+
+#### _Integer_ getLength( **function** _callback_ )
+Returns the `Content-Length` async. The callback is used to handle errors and continue once the length has been calculated
+```javascript
+this.getLength(function(err, length) {
+ if (err) {
+ this._error(err);
+ return;
+ }
+
+ // add content length
+ request.setHeader('Content-Length', length);
+
+ ...
+}.bind(this));
+```
+
+#### _Boolean_ hasKnownLength()
+Checks if the length of added values is known.
+
+#### _Request_ submit( _params_, **function** _callback_ )
+Submit the form to a web application.
+```javascript
+var form = new FormData();
+form.append( 'my_string', 'Hello World' );
+
+form.submit( 'http://example.com/', function(err, res) {
+ // res – response object (http.IncomingMessage) //
+ res.resume();
+} );
+```
+
+#### _String_ toString()
+Returns the form data as a string. Don't use this if you are sending files or buffers, use `getBuffer()` instead.
+
+### Integration with other libraries
+
+#### Request
+
+Form submission using [request](https://github.com/request/request):
+
+```javascript
+var formData = {
+ my_field: 'my_value',
+ my_file: fs.createReadStream(__dirname + '/unicycle.jpg'),
+};
+
+request.post({url:'http://service.com/upload', formData: formData}, function(err, httpResponse, body) {
+ if (err) {
+ return console.error('upload failed:', err);
+ }
+ console.log('Upload successful! Server responded with:', body);
+});
+```
+
+For more details see [request readme](https://github.com/request/request#multipartform-data-multipart-form-uploads).
+
+#### node-fetch
+
+You can also submit a form using [node-fetch](https://github.com/bitinn/node-fetch):
+
+```javascript
+var form = new FormData();
+
+form.append('a', 1);
+
+fetch('http://example.com', { method: 'POST', body: form })
+ .then(function(res) {
+ return res.json();
+ }).then(function(json) {
+ console.log(json);
+ });
+```
+
+#### axios
+
+In Node.js you can post a file using [axios](https://github.com/axios/axios):
+```javascript
+const form = new FormData();
+const stream = fs.createReadStream(PATH_TO_FILE);
+
+form.append('image', stream);
+
+// In Node.js environment you need to set boundary in the header field 'Content-Type' by calling method `getHeaders`
+const formHeaders = form.getHeaders();
+
+axios.post('http://example.com', form, {
+ headers: {
+ ...formHeaders,
+ },
+})
+.then(response => response)
+.catch(error => error)
+```
+
+## Notes
+
+- ```getLengthSync()``` method DOESN'T calculate length for streams, use ```knownLength``` options as workaround.
+- ```getLength(cb)``` will send an error as first parameter of callback if stream length cannot be calculated (e.g. send in custom streams w/o using ```knownLength```).
+- ```submit``` will not add `content-length` if form length is unknown or not calculable.
+- Starting version `2.x` FormData has dropped support for `node@0.10.x`.
+- Starting version `3.x` FormData has dropped support for `node@4.x`.
+
+## License
+
+Form-Data is released under the [MIT](License) license.
diff --git a/node_modules/form-data/index.d.ts b/node_modules/form-data/index.d.ts
new file mode 100644
index 0000000..295e9e9
--- /dev/null
+++ b/node_modules/form-data/index.d.ts
@@ -0,0 +1,62 @@
+// Definitions by: Carlos Ballesteros Velasco <https://github.com/soywiz>
+// Leon Yu <https://github.com/leonyu>
+// BendingBender <https://github.com/BendingBender>
+// Maple Miao <https://github.com/mapleeit>
+
+/// <reference types="node" />
+import * as stream from 'stream';
+import * as http from 'http';
+
+export = FormData;
+
+// Extracted because @types/node doesn't export interfaces.
+interface ReadableOptions {
+ highWaterMark?: number;
+ encoding?: string;
+ objectMode?: boolean;
+ read?(this: stream.Readable, size: number): void;
+ destroy?(this: stream.Readable, error: Error | null, callback: (error: Error | null) => void): void;
+ autoDestroy?: boolean;
+}
+
+interface Options extends ReadableOptions {
+ writable?: boolean;
+ readable?: boolean;
+ dataSize?: number;
+ maxDataSize?: number;
+ pauseStreams?: boolean;
+}
+
+declare class FormData extends stream.Readable {
+ constructor(options?: Options);
+ append(key: string, value: any, options?: FormData.AppendOptions | string): void;
+ getHeaders(userHeaders?: FormData.Headers): FormData.Headers;
+ submit(
+ params: string | FormData.SubmitOptions,
+ callback?: (error: Error | null, response: http.IncomingMessage) => void
+ ): http.ClientRequest;
+ getBuffer(): Buffer;
+ setBoundary(boundary: string): void;
+ getBoundary(): string;
+ getLength(callback: (err: Error | null, length: number) => void): void;
+ getLengthSync(): number;
+ hasKnownLength(): boolean;
+}
+
+declare namespace FormData {
+ interface Headers {
+ [key: string]: any;
+ }
+
+ interface AppendOptions {
+ header?: string | Headers;
+ knownLength?: number;
+ filename?: string;
+ filepath?: string;
+ contentType?: string;
+ }
+
+ interface SubmitOptions extends http.RequestOptions {
+ protocol?: 'https:' | 'http:';
+ }
+}
diff --git a/node_modules/form-data/lib/browser.js b/node_modules/form-data/lib/browser.js
new file mode 100644
index 0000000..09e7c70
--- /dev/null
+++ b/node_modules/form-data/lib/browser.js
@@ -0,0 +1,2 @@
+/* eslint-env browser */
+module.exports = typeof self == 'object' ? self.FormData : window.FormData;
diff --git a/node_modules/form-data/lib/form_data.js b/node_modules/form-data/lib/form_data.js
new file mode 100644
index 0000000..18dc819
--- /dev/null
+++ b/node_modules/form-data/lib/form_data.js
@@ -0,0 +1,501 @@
+var CombinedStream = require('combined-stream');
+var util = require('util');
+var path = require('path');
+var http = require('http');
+var https = require('https');
+var parseUrl = require('url').parse;
+var fs = require('fs');
+var Stream = require('stream').Stream;
+var mime = require('mime-types');
+var asynckit = require('asynckit');
+var populate = require('./populate.js');
+
+// Public API
+module.exports = FormData;
+
+// make it a Stream
+util.inherits(FormData, CombinedStream);
+
+/**
+ * Create readable "multipart/form-data" streams.
+ * Can be used to submit forms
+ * and file uploads to other web applications.
+ *
+ * @constructor
+ * @param {Object} options - Properties to be added/overriden for FormData and CombinedStream
+ */
+function FormData(options) {
+ if (!(this instanceof FormData)) {
+ return new FormData(options);
+ }
+
+ this._overheadLength = 0;
+ this._valueLength = 0;
+ this._valuesToMeasure = [];
+
+ CombinedStream.call(this);
+
+ options = options || {};
+ for (var option in options) {
+ this[option] = options[option];
+ }
+}
+
+FormData.LINE_BREAK = '\r\n';
+FormData.DEFAULT_CONTENT_TYPE = 'application/octet-stream';
+
+FormData.prototype.append = function(field, value, options) {
+
+ options = options || {};
+
+ // allow filename as single option
+ if (typeof options == 'string') {
+ options = {filename: options};
+ }
+
+ var append = CombinedStream.prototype.append.bind(this);
+
+ // all that streamy business can't handle numbers
+ if (typeof value == 'number') {
+ value = '' + value;
+ }
+
+ // https://github.com/felixge/node-form-data/issues/38
+ if (util.isArray(value)) {
+ // Please convert your array into string
+ // the way web server expects it
+ this._error(new Error('Arrays are not supported.'));
+ return;
+ }
+
+ var header = this._multiPartHeader(field, value, options);
+ var footer = this._multiPartFooter();
+
+ append(header);
+ append(value);
+ append(footer);
+
+ // pass along options.knownLength
+ this._trackLength(header, value, options);
+};
+
+FormData.prototype._trackLength = function(header, value, options) {
+ var valueLength = 0;
+
+ // used w/ getLengthSync(), when length is known.
+ // e.g. for streaming directly from a remote server,
+ // w/ a known file a size, and not wanting to wait for
+ // incoming file to finish to get its size.
+ if (options.knownLength != null) {
+ valueLength += +options.knownLength;
+ } else if (Buffer.isBuffer(value)) {
+ valueLength = value.length;
+ } else if (typeof value === 'string') {
+ valueLength = Buffer.byteLength(value);
+ }
+
+ this._valueLength += valueLength;
+
+ // @check why add CRLF? does this account for custom/multiple CRLFs?
+ this._overheadLength +=
+ Buffer.byteLength(header) +
+ FormData.LINE_BREAK.length;
+
+ // empty or either doesn't have path or not an http response or not a stream
+ if (!value || ( !value.path && !(value.readable && value.hasOwnProperty('httpVersion')) && !(value instanceof Stream))) {
+ return;
+ }
+
+ // no need to bother with the length
+ if (!options.knownLength) {
+ this._valuesToMeasure.push(value);
+ }
+};
+
+FormData.prototype._lengthRetriever = function(value, callback) {
+
+ if (value.hasOwnProperty('fd')) {
+
+ // take read range into a account
+ // `end` = Infinity –> read file till the end
+ //
+ // TODO: Looks like there is bug in Node fs.createReadStream
+ // it doesn't respect `end` options without `start` options
+ // Fix it when node fixes it.
+ // https://github.com/joyent/node/issues/7819
+ if (value.end != undefined && value.end != Infinity && value.start != undefined) {
+
+ // when end specified
+ // no need to calculate range
+ // inclusive, starts with 0
+ callback(null, value.end + 1 - (value.start ? value.start : 0));
+
+ // not that fast snoopy
+ } else {
+ // still need to fetch file size from fs
+ fs.stat(value.path, function(err, stat) {
+
+ var fileSize;
+
+ if (err) {
+ callback(err);
+ return;
+ }
+
+ // update final size based on the range options
+ fileSize = stat.size - (value.start ? value.start : 0);
+ callback(null, fileSize);
+ });
+ }
+
+ // or http response
+ } else if (value.hasOwnProperty('httpVersion')) {
+ callback(null, +value.headers['content-length']);
+
+ // or request stream http://github.com/mikeal/request
+ } else if (value.hasOwnProperty('httpModule')) {
+ // wait till response come back
+ value.on('response', function(response) {
+ value.pause();
+ callback(null, +response.headers['content-length']);
+ });
+ value.resume();
+
+ // something else
+ } else {
+ callback('Unknown stream');
+ }
+};
+
+FormData.prototype._multiPartHeader = function(field, value, options) {
+ // custom header specified (as string)?
+ // it becomes responsible for boundary
+ // (e.g. to handle extra CRLFs on .NET servers)
+ if (typeof options.header == 'string') {
+ return options.header;
+ }
+
+ var contentDisposition = this._getContentDisposition(value, options);
+ var contentType = this._getContentType(value, options);
+
+ var contents = '';
+ var headers = {
+ // add custom disposition as third element or keep it two elements if not
+ 'Content-Disposition': ['form-data', 'name="' + field + '"'].concat(contentDisposition || []),
+ // if no content type. allow it to be empty array
+ 'Content-Type': [].concat(contentType || [])
+ };
+
+ // allow custom headers.
+ if (typeof options.header == 'object') {
+ populate(headers, options.header);
+ }
+
+ var header;
+ for (var prop in headers) {
+ if (!headers.hasOwnProperty(prop)) continue;
+ header = headers[prop];
+
+ // skip nullish headers.
+ if (header == null) {
+ continue;
+ }
+
+ // convert all headers to arrays.
+ if (!Array.isArray(header)) {
+ header = [header];
+ }
+
+ // add non-empty headers.
+ if (header.length) {
+ contents += prop + ': ' + header.join('; ') + FormData.LINE_BREAK;
+ }
+ }
+
+ return '--' + this.getBoundary() + FormData.LINE_BREAK + contents + FormData.LINE_BREAK;
+};
+
+FormData.prototype._getContentDisposition = function(value, options) {
+
+ var filename
+ , contentDisposition
+ ;
+
+ if (typeof options.filepath === 'string') {
+ // custom filepath for relative paths
+ filename = path.normalize(options.filepath).replace(/\\/g, '/');
+ } else if (options.filename || value.name || value.path) {
+ // custom filename take precedence
+ // formidable and the browser add a name property
+ // fs- and request- streams have path property
+ filename = path.basename(options.filename || value.name || value.path);
+ } else if (value.readable && value.hasOwnProperty('httpVersion')) {
+ // or try http response
+ filename = path.basename(value.client._httpMessage.path || '');
+ }
+
+ if (filename) {
+ contentDisposition = 'filename="' + filename + '"';
+ }
+
+ return contentDisposition;
+};
+
+FormData.prototype._getContentType = function(value, options) {
+
+ // use custom content-type above all
+ var contentType = options.contentType;
+
+ // or try `name` from formidable, browser
+ if (!contentType && value.name) {
+ contentType = mime.lookup(value.name);
+ }
+
+ // or try `path` from fs-, request- streams
+ if (!contentType && value.path) {
+ contentType = mime.lookup(value.path);
+ }
+
+ // or if it's http-reponse
+ if (!contentType && value.readable && value.hasOwnProperty('httpVersion')) {
+ contentType = value.headers['content-type'];
+ }
+
+ // or guess it from the filepath or filename
+ if (!contentType && (options.filepath || options.filename)) {
+ contentType = mime.lookup(options.filepath || options.filename);
+ }
+
+ // fallback to the default content type if `value` is not simple value
+ if (!contentType && typeof value == 'object') {
+ contentType = FormData.DEFAULT_CONTENT_TYPE;
+ }
+
+ return contentType;
+};
+
+FormData.prototype._multiPartFooter = function() {
+ return function(next) {
+ var footer = FormData.LINE_BREAK;
+
+ var lastPart = (this._streams.length === 0);
+ if (lastPart) {
+ footer += this._lastBoundary();
+ }
+
+ next(footer);
+ }.bind(this);
+};
+
+FormData.prototype._lastBoundary = function() {
+ return '--' + this.getBoundary() + '--' + FormData.LINE_BREAK;
+};
+
+FormData.prototype.getHeaders = function(userHeaders) {
+ var header;
+ var formHeaders = {
+ 'content-type': 'multipart/form-data; boundary=' + this.getBoundary()
+ };
+
+ for (header in userHeaders) {
+ if (userHeaders.hasOwnProperty(header)) {
+ formHeaders[header.toLowerCase()] = userHeaders[header];
+ }
+ }
+
+ return formHeaders;
+};
+
+FormData.prototype.setBoundary = function(boundary) {
+ this._boundary = boundary;
+};
+
+FormData.prototype.getBoundary = function() {
+ if (!this._boundary) {
+ this._generateBoundary();
+ }
+
+ return this._boundary;
+};
+
+FormData.prototype.getBuffer = function() {
+ var dataBuffer = new Buffer.alloc( 0 );
+ var boundary = this.getBoundary();
+
+ // Create the form content. Add Line breaks to the end of data.
+ for (var i = 0, len = this._streams.length; i < len; i++) {
+ if (typeof this._streams[i] !== 'function') {
+
+ // Add content to the buffer.
+ if(Buffer.isBuffer(this._streams[i])) {
+ dataBuffer = Buffer.concat( [dataBuffer, this._streams[i]]);
+ }else {
+ dataBuffer = Buffer.concat( [dataBuffer, Buffer.from(this._streams[i])]);
+ }
+
+ // Add break after content.
+ if (typeof this._streams[i] !== 'string' || this._streams[i].substring( 2, boundary.length + 2 ) !== boundary) {
+ dataBuffer = Buffer.concat( [dataBuffer, Buffer.from(FormData.LINE_BREAK)] );
+ }
+ }
+ }
+
+ // Add the footer and return the Buffer object.
+ return Buffer.concat( [dataBuffer, Buffer.from(this._lastBoundary())] );
+};
+
+FormData.prototype._generateBoundary = function() {
+ // This generates a 50 character boundary similar to those used by Firefox.
+ // They are optimized for boyer-moore parsing.
+ var boundary = '--------------------------';
+ for (var i = 0; i < 24; i++) {
+ boundary += Math.floor(Math.random() * 10).toString(16);
+ }
+
+ this._boundary = boundary;
+};
+
+// Note: getLengthSync DOESN'T calculate streams length
+// As workaround one can calculate file size manually
+// and add it as knownLength option
+FormData.prototype.getLengthSync = function() {
+ var knownLength = this._overheadLength + this._valueLength;
+
+ // Don't get confused, there are 3 "internal" streams for each keyval pair
+ // so it basically checks if there is any value added to the form
+ if (this._streams.length) {
+ knownLength += this._lastBoundary().length;
+ }
+
+ // https://github.com/form-data/form-data/issues/40
+ if (!this.hasKnownLength()) {
+ // Some async length retrievers are present
+ // therefore synchronous length calculation is false.
+ // Please use getLength(callback) to get proper length
+ this._error(new Error('Cannot calculate proper length in synchronous way.'));
+ }
+
+ return knownLength;
+};
+
+// Public API to check if length of added values is known
+// https://github.com/form-data/form-data/issues/196
+// https://github.com/form-data/form-data/issues/262
+FormData.prototype.hasKnownLength = function() {
+ var hasKnownLength = true;
+
+ if (this._valuesToMeasure.length) {
+ hasKnownLength = false;
+ }
+
+ return hasKnownLength;
+};
+
+FormData.prototype.getLength = function(cb) {
+ var knownLength = this._overheadLength + this._valueLength;
+
+ if (this._streams.length) {
+ knownLength += this._lastBoundary().length;
+ }
+
+ if (!this._valuesToMeasure.length) {
+ process.nextTick(cb.bind(this, null, knownLength));
+ return;
+ }
+
+ asynckit.parallel(this._valuesToMeasure, this._lengthRetriever, function(err, values) {
+ if (err) {
+ cb(err);
+ return;
+ }
+
+ values.forEach(function(length) {
+ knownLength += length;
+ });
+
+ cb(null, knownLength);
+ });
+};
+
+FormData.prototype.submit = function(params, cb) {
+ var request
+ , options
+ , defaults = {method: 'post'}
+ ;
+
+ // parse provided url if it's string
+ // or treat it as options object
+ if (typeof params == 'string') {
+
+ params = parseUrl(params);
+ options = populate({
+ port: params.port,
+ path: params.pathname,
+ host: params.hostname,
+ protocol: params.protocol
+ }, defaults);
+
+ // use custom params
+ } else {
+
+ options = populate(params, defaults);
+ // if no port provided use default one
+ if (!options.port) {
+ options.port = options.protocol == 'https:' ? 443 : 80;
+ }
+ }
+
+ // put that good code in getHeaders to some use
+ options.headers = this.getHeaders(params.headers);
+
+ // https if specified, fallback to http in any other case
+ if (options.protocol == 'https:') {
+ request = https.request(options);
+ } else {
+ request = http.request(options);
+ }
+
+ // get content length and fire away
+ this.getLength(function(err, length) {
+ if (err && err !== 'Unknown stream') {
+ this._error(err);
+ return;
+ }
+
+ // add content length
+ if (length) {
+ request.setHeader('Content-Length', length);
+ }
+
+ this.pipe(request);
+ if (cb) {
+ var onResponse;
+
+ var callback = function (error, responce) {
+ request.removeListener('error', callback);
+ request.removeListener('response', onResponse);
+
+ return cb.call(this, error, responce);
+ };
+
+ onResponse = callback.bind(this, null);
+
+ request.on('error', callback);
+ request.on('response', onResponse);
+ }
+ }.bind(this));
+
+ return request;
+};
+
+FormData.prototype._error = function(err) {
+ if (!this.error) {
+ this.error = err;
+ this.pause();
+ this.emit('error', err);
+ }
+};
+
+FormData.prototype.toString = function () {
+ return '[object FormData]';
+};
diff --git a/node_modules/form-data/lib/populate.js b/node_modules/form-data/lib/populate.js
new file mode 100644
index 0000000..4d35738
--- /dev/null
+++ b/node_modules/form-data/lib/populate.js
@@ -0,0 +1,10 @@
+// populates missing values
+module.exports = function(dst, src) {
+
+ Object.keys(src).forEach(function(prop)
+ {
+ dst[prop] = dst[prop] || src[prop];
+ });
+
+ return dst;
+};
diff --git a/node_modules/form-data/package.json b/node_modules/form-data/package.json
new file mode 100644
index 0000000..0f20240
--- /dev/null
+++ b/node_modules/form-data/package.json
@@ -0,0 +1,68 @@
+{
+ "author": "Felix Geisendörfer <felix@debuggable.com> (http://debuggable.com/)",
+ "name": "form-data",
+ "description": "A library to create readable \"multipart/form-data\" streams. Can be used to submit forms and file uploads to other web applications.",
+ "version": "4.0.0",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/form-data/form-data.git"
+ },
+ "main": "./lib/form_data",
+ "browser": "./lib/browser",
+ "typings": "./index.d.ts",
+ "scripts": {
+ "pretest": "rimraf coverage test/tmp",
+ "test": "istanbul cover test/run.js",
+ "posttest": "istanbul report lcov text",
+ "lint": "eslint lib/*.js test/*.js test/integration/*.js",
+ "report": "istanbul report lcov text",
+ "ci-lint": "is-node-modern 8 && npm run lint || is-node-not-modern 8",
+ "ci-test": "npm run test && npm run browser && npm run report",
+ "predebug": "rimraf coverage test/tmp",
+ "debug": "verbose=1 ./test/run.js",
+ "browser": "browserify -t browserify-istanbul test/run-browser.js | obake --coverage",
+ "check": "istanbul check-coverage coverage/coverage*.json",
+ "files": "pkgfiles --sort=name",
+ "get-version": "node -e \"console.log(require('./package.json').version)\"",
+ "update-readme": "sed -i.bak 's/\\/master\\.svg/\\/v'$(npm --silent run get-version)'.svg/g' README.md",
+ "restore-readme": "mv README.md.bak README.md",
+ "prepublish": "in-publish && npm run update-readme || not-in-publish",
+ "postpublish": "npm run restore-readme"
+ },
+ "pre-commit": [
+ "lint",
+ "ci-test",
+ "check"
+ ],
+ "engines": {
+ "node": ">= 6"
+ },
+ "dependencies": {
+ "asynckit": "^0.4.0",
+ "combined-stream": "^1.0.8",
+ "mime-types": "^2.1.12"
+ },
+ "devDependencies": {
+ "@types/node": "^12.0.10",
+ "browserify": "^13.1.1",
+ "browserify-istanbul": "^2.0.0",
+ "coveralls": "^3.0.4",
+ "cross-spawn": "^6.0.5",
+ "eslint": "^6.0.1",
+ "fake": "^0.2.2",
+ "far": "^0.0.7",
+ "formidable": "^1.0.17",
+ "in-publish": "^2.0.0",
+ "is-node-modern": "^1.0.0",
+ "istanbul": "^0.4.5",
+ "obake": "^0.1.2",
+ "puppeteer": "^1.19.0",
+ "pkgfiles": "^2.3.0",
+ "pre-commit": "^1.1.3",
+ "request": "^2.88.0",
+ "rimraf": "^2.7.1",
+ "tape": "^4.6.2",
+ "typescript": "^3.5.2"
+ },
+ "license": "MIT"
+}
diff --git a/node_modules/mime-db/HISTORY.md b/node_modules/mime-db/HISTORY.md
new file mode 100644
index 0000000..7436f64
--- /dev/null
+++ b/node_modules/mime-db/HISTORY.md
@@ -0,0 +1,507 @@
+1.52.0 / 2022-02-21
+===================
+
+ * Add extensions from IANA for more `image/*` types
+ * Add extension `.asc` to `application/pgp-keys`
+ * Add extensions to various XML types
+ * Add new upstream MIME types
+
+1.51.0 / 2021-11-08
+===================
+
+ * Add new upstream MIME types
+ * Mark `image/vnd.microsoft.icon` as compressible
+ * Mark `image/vnd.ms-dds` as compressible
+
+1.50.0 / 2021-09-15
+===================
+
+ * Add deprecated iWorks mime types and extensions
+ * Add new upstream MIME types
+
+1.49.0 / 2021-07-26
+===================
+
+ * Add extension `.trig` to `application/trig`
+ * Add new upstream MIME types
+
+1.48.0 / 2021-05-30
+===================
+
+ * Add extension `.mvt` to `application/vnd.mapbox-vector-tile`
+ * Add new upstream MIME types
+ * Mark `text/yaml` as compressible
+
+1.47.0 / 2021-04-01
+===================
+
+ * Add new upstream MIME types
+ * Remove ambigious extensions from IANA for `application/*+xml` types
+ * Update primary extension to `.es` for `application/ecmascript`
+
+1.46.0 / 2021-02-13
+===================
+
+ * Add extension `.amr` to `audio/amr`
+ * Add extension `.m4s` to `video/iso.segment`
+ * Add extension `.opus` to `audio/ogg`
+ * Add new upstream MIME types
+
+1.45.0 / 2020-09-22
+===================
+
+ * Add `application/ubjson` with extension `.ubj`
+ * Add `image/avif` with extension `.avif`
+ * Add `image/ktx2` with extension `.ktx2`
+ * Add extension `.dbf` to `application/vnd.dbf`
+ * Add extension `.rar` to `application/vnd.rar`
+ * Add extension `.td` to `application/urc-targetdesc+xml`
+ * Add new upstream MIME types
+ * Fix extension of `application/vnd.apple.keynote` to be `.key`
+
+1.44.0 / 2020-04-22
+===================
+
+ * Add charsets from IANA
+ * Add extension `.cjs` to `application/node`
+ * Add new upstream MIME types
+
+1.43.0 / 2020-01-05
+===================
+
+ * Add `application/x-keepass2` with extension `.kdbx`
+ * Add extension `.mxmf` to `audio/mobile-xmf`
+ * Add extensions from IANA for `application/*+xml` types
+ * Add new upstream MIME types
+
+1.42.0 / 2019-09-25
+===================
+
+ * Add `image/vnd.ms-dds` with extension `.dds`
+ * Add new upstream MIME types
+ * Remove compressible from `multipart/mixed`
+
+1.41.0 / 2019-08-30
+===================
+
+ * Add new upstream MIME types
+ * Add `application/toml` with extension `.toml`
+ * Mark `font/ttf` as compressible
+
+1.40.0 / 2019-04-20
+===================
+
+ * Add extensions from IANA for `model/*` types
+ * Add `text/mdx` with extension `.mdx`
+
+1.39.0 / 2019-04-04
+===================
+
+ * Add extensions `.siv` and `.sieve` to `application/sieve`
+ * Add new upstream MIME types
+
+1.38.0 / 2019-02-04
+===================
+
+ * Add extension `.nq` to `application/n-quads`
+ * Add extension `.nt` to `application/n-triples`
+ * Add new upstream MIME types
+ * Mark `text/less` as compressible
+
+1.37.0 / 2018-10-19
+===================
+
+ * Add extensions to HEIC image types
+ * Add new upstream MIME types
+
+1.36.0 / 2018-08-20
+===================
+
+ * Add Apple file extensions from IANA
+ * Add extensions from IANA for `image/*` types
+ * Add new upstream MIME types
+
+1.35.0 / 2018-07-15
+===================
+
+ * Add extension `.owl` to `application/rdf+xml`
+ * Add new upstream MIME types
+ - Removes extension `.woff` from `application/font-woff`
+
+1.34.0 / 2018-06-03
+===================
+
+ * Add extension `.csl` to `application/vnd.citationstyles.style+xml`
+ * Add extension `.es` to `application/ecmascript`
+ * Add new upstream MIME types
+ * Add `UTF-8` as default charset for `text/turtle`
+ * Mark all XML-derived types as compressible
+
+1.33.0 / 2018-02-15
+===================
+
+ * Add extensions from IANA for `message/*` types
+ * Add new upstream MIME types
+ * Fix some incorrect OOXML types
+ * Remove `application/font-woff2`
+
+1.32.0 / 2017-11-29
+===================
+
+ * Add new upstream MIME types
+ * Update `text/hjson` to registered `application/hjson`
+ * Add `text/shex` with extension `.shex`
+
+1.31.0 / 2017-10-25
+===================
+
+ * Add `application/raml+yaml` with extension `.raml`
+ * Add `application/wasm` with extension `.wasm`
+ * Add new `font` type from IANA
+ * Add new upstream font extensions
+ * Add new upstream MIME types
+ * Add extensions for JPEG-2000 images
+
+1.30.0 / 2017-08-27
+===================
+
+ * Add `application/vnd.ms-outlook`
+ * Add `application/x-arj`
+ * Add extension `.mjs` to `application/javascript`
+ * Add glTF types and extensions
+ * Add new upstream MIME types
+ * Add `text/x-org`
+ * Add VirtualBox MIME types
+ * Fix `source` records for `video/*` types that are IANA
+ * Update `font/opentype` to registered `font/otf`
+
+1.29.0 / 2017-07-10
+===================
+
+ * Add `application/fido.trusted-apps+json`
+ * Add extension `.wadl` to `application/vnd.sun.wadl+xml`
+ * Add new upstream MIME types
+ * Add `UTF-8` as default charset for `text/css`
+
+1.28.0 / 2017-05-14
+===================
+
+ * Add new upstream MIME types
+ * Add extension `.gz` to `application/gzip`
+ * Update extensions `.md` and `.markdown` to be `text/markdown`
+
+1.27.0 / 2017-03-16
+===================
+
+ * Add new upstream MIME types
+ * Add `image/apng` with extension `.apng`
+
+1.26.0 / 2017-01-14
+===================
+
+ * Add new upstream MIME types
+ * Add extension `.geojson` to `application/geo+json`
+
+1.25.0 / 2016-11-11
+===================
+
+ * Add new upstream MIME types
+
+1.24.0 / 2016-09-18
+===================
+
+ * Add `audio/mp3`
+ * Add new upstream MIME types
+
+1.23.0 / 2016-05-01
+===================
+
+ * Add new upstream MIME types
+ * Add extension `.3gpp` to `audio/3gpp`
+
+1.22.0 / 2016-02-15
+===================
+
+ * Add `text/slim`
+ * Add extension `.rng` to `application/xml`
+ * Add new upstream MIME types
+ * Fix extension of `application/dash+xml` to be `.mpd`
+ * Update primary extension to `.m4a` for `audio/mp4`
+
+1.21.0 / 2016-01-06
+===================
+
+ * Add Google document types
+ * Add new upstream MIME types
+
+1.20.0 / 2015-11-10
+===================
+
+ * Add `text/x-suse-ymp`
+ * Add new upstream MIME types
+
+1.19.0 / 2015-09-17
+===================
+
+ * Add `application/vnd.apple.pkpass`
+ * Add new upstream MIME types
+
+1.18.0 / 2015-09-03
+===================
+
+ * Add new upstream MIME types
+
+1.17.0 / 2015-08-13
+===================
+
+ * Add `application/x-msdos-program`
+ * Add `audio/g711-0`
+ * Add `image/vnd.mozilla.apng`
+ * Add extension `.exe` to `application/x-msdos-program`
+
+1.16.0 / 2015-07-29
+===================
+
+ * Add `application/vnd.uri-map`
+
+1.15.0 / 2015-07-13
+===================
+
+ * Add `application/x-httpd-php`
+
+1.14.0 / 2015-06-25
+===================
+
+ * Add `application/scim+json`
+ * Add `application/vnd.3gpp.ussd+xml`
+ * Add `application/vnd.biopax.rdf+xml`
+ * Add `text/x-processing`
+
+1.13.0 / 2015-06-07
+===================
+
+ * Add nginx as a source
+ * Add `application/x-cocoa`
+ * Add `application/x-java-archive-diff`
+ * Add `application/x-makeself`
+ * Add `application/x-perl`
+ * Add `application/x-pilot`
+ * Add `application/x-redhat-package-manager`
+ * Add `application/x-sea`
+ * Add `audio/x-m4a`
+ * Add `audio/x-realaudio`
+ * Add `image/x-jng`
+ * Add `text/mathml`
+
+1.12.0 / 2015-06-05
+===================
+
+ * Add `application/bdoc`
+ * Add `application/vnd.hyperdrive+json`
+ * Add `application/x-bdoc`
+ * Add extension `.rtf` to `text/rtf`
+
+1.11.0 / 2015-05-31
+===================
+
+ * Add `audio/wav`
+ * Add `audio/wave`
+ * Add extension `.litcoffee` to `text/coffeescript`
+ * Add extension `.sfd-hdstx` to `application/vnd.hydrostatix.sof-data`
+ * Add extension `.n-gage` to `application/vnd.nokia.n-gage.symbian.install`
+
+1.10.0 / 2015-05-19
+===================
+
+ * Add `application/vnd.balsamiq.bmpr`
+ * Add `application/vnd.microsoft.portable-executable`
+ * Add `application/x-ns-proxy-autoconfig`
+
+1.9.1 / 2015-04-19
+==================
+
+ * Remove `.json` extension from `application/manifest+json`
+ - This is causing bugs downstream
+
+1.9.0 / 2015-04-19
+==================
+
+ * Add `application/manifest+json`
+ * Add `application/vnd.micro+json`
+ * Add `image/vnd.zbrush.pcx`
+ * Add `image/x-ms-bmp`
+
+1.8.0 / 2015-03-13
+==================
+
+ * Add `application/vnd.citationstyles.style+xml`
+ * Add `application/vnd.fastcopy-disk-image`
+ * Add `application/vnd.gov.sk.xmldatacontainer+xml`
+ * Add extension `.jsonld` to `application/ld+json`
+
+1.7.0 / 2015-02-08
+==================
+
+ * Add `application/vnd.gerber`
+ * Add `application/vnd.msa-disk-image`
+
+1.6.1 / 2015-02-05
+==================
+
+ * Community extensions ownership transferred from `node-mime`
+
+1.6.0 / 2015-01-29
+==================
+
+ * Add `application/jose`
+ * Add `application/jose+json`
+ * Add `application/json-seq`
+ * Add `application/jwk+json`
+ * Add `application/jwk-set+json`
+ * Add `application/jwt`
+ * Add `application/rdap+json`
+ * Add `application/vnd.gov.sk.e-form+xml`
+ * Add `application/vnd.ims.imsccv1p3`
+
+1.5.0 / 2014-12-30
+==================
+
+ * Add `application/vnd.oracle.resource+json`
+ * Fix various invalid MIME type entries
+ - `application/mbox+xml`
+ - `application/oscp-response`
+ - `application/vwg-multiplexed`
+ - `audio/g721`
+
+1.4.0 / 2014-12-21
+==================
+
+ * Add `application/vnd.ims.imsccv1p2`
+ * Fix various invalid MIME type entries
+ - `application/vnd-acucobol`
+ - `application/vnd-curl`
+ - `application/vnd-dart`
+ - `application/vnd-dxr`
+ - `application/vnd-fdf`
+ - `application/vnd-mif`
+ - `application/vnd-sema`
+ - `application/vnd-wap-wmlc`
+ - `application/vnd.adobe.flash-movie`
+ - `application/vnd.dece-zip`
+ - `application/vnd.dvb_service`
+ - `application/vnd.micrografx-igx`
+ - `application/vnd.sealed-doc`
+ - `application/vnd.sealed-eml`
+ - `application/vnd.sealed-mht`
+ - `application/vnd.sealed-ppt`
+ - `application/vnd.sealed-tiff`
+ - `application/vnd.sealed-xls`
+ - `application/vnd.sealedmedia.softseal-html`
+ - `application/vnd.sealedmedia.softseal-pdf`
+ - `application/vnd.wap-slc`
+ - `application/vnd.wap-wbxml`
+ - `audio/vnd.sealedmedia.softseal-mpeg`
+ - `image/vnd-djvu`
+ - `image/vnd-svf`
+ - `image/vnd-wap-wbmp`
+ - `image/vnd.sealed-png`
+ - `image/vnd.sealedmedia.softseal-gif`
+ - `image/vnd.sealedmedia.softseal-jpg`
+ - `model/vnd-dwf`
+ - `model/vnd.parasolid.transmit-binary`
+ - `model/vnd.parasolid.transmit-text`
+ - `text/vnd-a`
+ - `text/vnd-curl`
+ - `text/vnd.wap-wml`
+ * Remove example template MIME types
+ - `application/example`
+ - `audio/example`
+ - `image/example`
+ - `message/example`
+ - `model/example`
+ - `multipart/example`
+ - `text/example`
+ - `video/example`
+
+1.3.1 / 2014-12-16
+==================
+
+ * Fix missing extensions
+ - `application/json5`
+ - `text/hjson`
+
+1.3.0 / 2014-12-07
+==================
+
+ * Add `application/a2l`
+ * Add `application/aml`
+ * Add `application/atfx`
+ * Add `application/atxml`
+ * Add `application/cdfx+xml`
+ * Add `application/dii`
+ * Add `application/json5`
+ * Add `application/lxf`
+ * Add `application/mf4`
+ * Add `application/vnd.apache.thrift.compact`
+ * Add `application/vnd.apache.thrift.json`
+ * Add `application/vnd.coffeescript`
+ * Add `application/vnd.enphase.envoy`
+ * Add `application/vnd.ims.imsccv1p1`
+ * Add `text/csv-schema`
+ * Add `text/hjson`
+ * Add `text/markdown`
+ * Add `text/yaml`
+
+1.2.0 / 2014-11-09
+==================
+
+ * Add `application/cea`
+ * Add `application/dit`
+ * Add `application/vnd.gov.sk.e-form+zip`
+ * Add `application/vnd.tmd.mediaflex.api+xml`
+ * Type `application/epub+zip` is now IANA-registered
+
+1.1.2 / 2014-10-23
+==================
+
+ * Rebuild database for `application/x-www-form-urlencoded` change
+
+1.1.1 / 2014-10-20
+==================
+
+ * Mark `application/x-www-form-urlencoded` as compressible.
+
+1.1.0 / 2014-09-28
+==================
+
+ * Add `application/font-woff2`
+
+1.0.3 / 2014-09-25
+==================
+
+ * Fix engine requirement in package
+
+1.0.2 / 2014-09-25
+==================
+
+ * Add `application/coap-group+json`
+ * Add `application/dcd`
+ * Add `application/vnd.apache.thrift.binary`
+ * Add `image/vnd.tencent.tap`
+ * Mark all JSON-derived types as compressible
+ * Update `text/vtt` data
+
+1.0.1 / 2014-08-30
+==================
+
+ * Fix extension ordering
+
+1.0.0 / 2014-08-30
+==================
+
+ * Add `application/atf`
+ * Add `application/merge-patch+json`
+ * Add `multipart/x-mixed-replace`
+ * Add `source: 'apache'` metadata
+ * Add `source: 'iana'` metadata
+ * Remove badly-assumed charset data
diff --git a/node_modules/mime-db/LICENSE b/node_modules/mime-db/LICENSE
new file mode 100644
index 0000000..0751cb1
--- /dev/null
+++ b/node_modules/mime-db/LICENSE
@@ -0,0 +1,23 @@
+(The MIT License)
+
+Copyright (c) 2014 Jonathan Ong <me@jongleberry.com>
+Copyright (c) 2015-2022 Douglas Christopher Wilson <doug@somethingdoug.com>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/mime-db/README.md b/node_modules/mime-db/README.md
new file mode 100644
index 0000000..5a8fcfe
--- /dev/null
+++ b/node_modules/mime-db/README.md
@@ -0,0 +1,100 @@
+# mime-db
+
+[![NPM Version][npm-version-image]][npm-url]
+[![NPM Downloads][npm-downloads-image]][npm-url]
+[![Node.js Version][node-image]][node-url]
+[![Build Status][ci-image]][ci-url]
+[![Coverage Status][coveralls-image]][coveralls-url]
+
+This is a large database of mime types and information about them.
+It consists of a single, public JSON file and does not include any logic,
+allowing it to remain as un-opinionated as possible with an API.
+It aggregates data from the following sources:
+
+- http://www.iana.org/assignments/media-types/media-types.xhtml
+- http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types
+- http://hg.nginx.org/nginx/raw-file/default/conf/mime.types
+
+## Installation
+
+```bash
+npm install mime-db
+```
+
+### Database Download
+
+If you're crazy enough to use this in the browser, you can just grab the
+JSON file using [jsDelivr](https://www.jsdelivr.com/). It is recommended to
+replace `master` with [a release tag](https://github.com/jshttp/mime-db/tags)
+as the JSON format may change in the future.
+
+```
+https://cdn.jsdelivr.net/gh/jshttp/mime-db@master/db.json
+```
+
+## Usage
+
+```js
+var db = require('mime-db')
+
+// grab data on .js files
+var data = db['application/javascript']
+```
+
+## Data Structure
+
+The JSON file is a map lookup for lowercased mime types.
+Each mime type has the following properties:
+
+- `.source` - where the mime type is defined.
+ If not set, it's probably a custom media type.
+ - `apache` - [Apache common media types](http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types)
+ - `iana` - [IANA-defined media types](http://www.iana.org/assignments/media-types/media-types.xhtml)
+ - `nginx` - [nginx media types](http://hg.nginx.org/nginx/raw-file/default/conf/mime.types)
+- `.extensions[]` - known extensions associated with this mime type.
+- `.compressible` - whether a file of this type can be gzipped.
+- `.charset` - the default charset associated with this type, if any.
+
+If unknown, every property could be `undefined`.
+
+## Contributing
+
+To edit the database, only make PRs against `src/custom-types.json` or
+`src/custom-suffix.json`.
+
+The `src/custom-types.json` file is a JSON object with the MIME type as the
+keys and the values being an object with the following keys:
+
+- `compressible` - leave out if you don't know, otherwise `true`/`false` to
+ indicate whether the data represented by the type is typically compressible.
+- `extensions` - include an array of file extensions that are associated with
+ the type.
+- `notes` - human-readable notes about the type, typically what the type is.
+- `sources` - include an array of URLs of where the MIME type and the associated
+ extensions are sourced from. This needs to be a [primary source](https://en.wikipedia.org/wiki/Primary_source);
+ links to type aggregating sites and Wikipedia are _not acceptable_.
+
+To update the build, run `npm run build`.
+
+### Adding Custom Media Types
+
+The best way to get new media types included in this library is to register
+them with the IANA. The community registration procedure is outlined in
+[RFC 6838 section 5](http://tools.ietf.org/html/rfc6838#section-5). Types
+registered with the IANA are automatically pulled into this library.
+
+If that is not possible / feasible, they can be added directly here as a
+"custom" type. To do this, it is required to have a primary source that
+definitively lists the media type. If an extension is going to be listed as
+associateed with this media type, the source must definitively link the
+media type and extension as well.
+
+[ci-image]: https://badgen.net/github/checks/jshttp/mime-db/master?label=ci
+[ci-url]: https://github.com/jshttp/mime-db/actions?query=workflow%3Aci
+[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/mime-db/master
+[coveralls-url]: https://coveralls.io/r/jshttp/mime-db?branch=master
+[node-image]: https://badgen.net/npm/node/mime-db
+[node-url]: https://nodejs.org/en/download
+[npm-downloads-image]: https://badgen.net/npm/dm/mime-db
+[npm-url]: https://npmjs.org/package/mime-db
+[npm-version-image]: https://badgen.net/npm/v/mime-db
diff --git a/node_modules/mime-db/db.json b/node_modules/mime-db/db.json
new file mode 100644
index 0000000..eb9c42c
--- /dev/null
+++ b/node_modules/mime-db/db.json
@@ -0,0 +1,8519 @@
+{
+ "application/1d-interleaved-parityfec": {
+ "source": "iana"
+ },
+ "application/3gpdash-qoe-report+xml": {
+ "source": "iana",
+ "charset": "UTF-8",
+ "compressible": true
+ },
+ "application/3gpp-ims+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/3gpphal+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/3gpphalforms+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/a2l": {
+ "source": "iana"
+ },
+ "application/ace+cbor": {
+ "source": "iana"
+ },
+ "application/activemessage": {
+ "source": "iana"
+ },
+ "application/activity+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/alto-costmap+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/alto-costmapfilter+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/alto-directory+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/alto-endpointcost+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/alto-endpointcostparams+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/alto-endpointprop+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/alto-endpointpropparams+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/alto-error+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/alto-networkmap+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/alto-networkmapfilter+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/alto-updatestreamcontrol+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/alto-updatestreamparams+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/aml": {
+ "source": "iana"
+ },
+ "application/andrew-inset": {
+ "source": "iana",
+ "extensions": ["ez"]
+ },
+ "application/applefile": {
+ "source": "iana"
+ },
+ "application/applixware": {
+ "source": "apache",
+ "extensions": ["aw"]
+ },
+ "application/at+jwt": {
+ "source": "iana"
+ },
+ "application/atf": {
+ "source": "iana"
+ },
+ "application/atfx": {
+ "source": "iana"
+ },
+ "application/atom+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["atom"]
+ },
+ "application/atomcat+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["atomcat"]
+ },
+ "application/atomdeleted+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["atomdeleted"]
+ },
+ "application/atomicmail": {
+ "source": "iana"
+ },
+ "application/atomsvc+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["atomsvc"]
+ },
+ "application/atsc-dwd+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["dwd"]
+ },
+ "application/atsc-dynamic-event-message": {
+ "source": "iana"
+ },
+ "application/atsc-held+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["held"]
+ },
+ "application/atsc-rdt+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/atsc-rsat+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["rsat"]
+ },
+ "application/atxml": {
+ "source": "iana"
+ },
+ "application/auth-policy+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/bacnet-xdd+zip": {
+ "source": "iana",
+ "compressible": false
+ },
+ "application/batch-smtp": {
+ "source": "iana"
+ },
+ "application/bdoc": {
+ "compressible": false,
+ "extensions": ["bdoc"]
+ },
+ "application/beep+xml": {
+ "source": "iana",
+ "charset": "UTF-8",
+ "compressible": true
+ },
+ "application/calendar+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/calendar+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["xcs"]
+ },
+ "application/call-completion": {
+ "source": "iana"
+ },
+ "application/cals-1840": {
+ "source": "iana"
+ },
+ "application/captive+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/cbor": {
+ "source": "iana"
+ },
+ "application/cbor-seq": {
+ "source": "iana"
+ },
+ "application/cccex": {
+ "source": "iana"
+ },
+ "application/ccmp+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/ccxml+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["ccxml"]
+ },
+ "application/cdfx+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["cdfx"]
+ },
+ "application/cdmi-capability": {
+ "source": "iana",
+ "extensions": ["cdmia"]
+ },
+ "application/cdmi-container": {
+ "source": "iana",
+ "extensions": ["cdmic"]
+ },
+ "application/cdmi-domain": {
+ "source": "iana",
+ "extensions": ["cdmid"]
+ },
+ "application/cdmi-object": {
+ "source": "iana",
+ "extensions": ["cdmio"]
+ },
+ "application/cdmi-queue": {
+ "source": "iana",
+ "extensions": ["cdmiq"]
+ },
+ "application/cdni": {
+ "source": "iana"
+ },
+ "application/cea": {
+ "source": "iana"
+ },
+ "application/cea-2018+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/cellml+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/cfw": {
+ "source": "iana"
+ },
+ "application/city+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/clr": {
+ "source": "iana"
+ },
+ "application/clue+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/clue_info+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/cms": {
+ "source": "iana"
+ },
+ "application/cnrp+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/coap-group+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/coap-payload": {
+ "source": "iana"
+ },
+ "application/commonground": {
+ "source": "iana"
+ },
+ "application/conference-info+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/cose": {
+ "source": "iana"
+ },
+ "application/cose-key": {
+ "source": "iana"
+ },
+ "application/cose-key-set": {
+ "source": "iana"
+ },
+ "application/cpl+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["cpl"]
+ },
+ "application/csrattrs": {
+ "source": "iana"
+ },
+ "application/csta+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/cstadata+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/csvm+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/cu-seeme": {
+ "source": "apache",
+ "extensions": ["cu"]
+ },
+ "application/cwt": {
+ "source": "iana"
+ },
+ "application/cybercash": {
+ "source": "iana"
+ },
+ "application/dart": {
+ "compressible": true
+ },
+ "application/dash+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["mpd"]
+ },
+ "application/dash-patch+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["mpp"]
+ },
+ "application/dashdelta": {
+ "source": "iana"
+ },
+ "application/davmount+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["davmount"]
+ },
+ "application/dca-rft": {
+ "source": "iana"
+ },
+ "application/dcd": {
+ "source": "iana"
+ },
+ "application/dec-dx": {
+ "source": "iana"
+ },
+ "application/dialog-info+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/dicom": {
+ "source": "iana"
+ },
+ "application/dicom+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/dicom+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/dii": {
+ "source": "iana"
+ },
+ "application/dit": {
+ "source": "iana"
+ },
+ "application/dns": {
+ "source": "iana"
+ },
+ "application/dns+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/dns-message": {
+ "source": "iana"
+ },
+ "application/docbook+xml": {
+ "source": "apache",
+ "compressible": true,
+ "extensions": ["dbk"]
+ },
+ "application/dots+cbor": {
+ "source": "iana"
+ },
+ "application/dskpp+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/dssc+der": {
+ "source": "iana",
+ "extensions": ["dssc"]
+ },
+ "application/dssc+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["xdssc"]
+ },
+ "application/dvcs": {
+ "source": "iana"
+ },
+ "application/ecmascript": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["es","ecma"]
+ },
+ "application/edi-consent": {
+ "source": "iana"
+ },
+ "application/edi-x12": {
+ "source": "iana",
+ "compressible": false
+ },
+ "application/edifact": {
+ "source": "iana",
+ "compressible": false
+ },
+ "application/efi": {
+ "source": "iana"
+ },
+ "application/elm+json": {
+ "source": "iana",
+ "charset": "UTF-8",
+ "compressible": true
+ },
+ "application/elm+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/emergencycalldata.cap+xml": {
+ "source": "iana",
+ "charset": "UTF-8",
+ "compressible": true
+ },
+ "application/emergencycalldata.comment+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/emergencycalldata.control+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/emergencycalldata.deviceinfo+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/emergencycalldata.ecall.msd": {
+ "source": "iana"
+ },
+ "application/emergencycalldata.providerinfo+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/emergencycalldata.serviceinfo+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/emergencycalldata.subscriberinfo+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/emergencycalldata.veds+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/emma+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["emma"]
+ },
+ "application/emotionml+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["emotionml"]
+ },
+ "application/encaprtp": {
+ "source": "iana"
+ },
+ "application/epp+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/epub+zip": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["epub"]
+ },
+ "application/eshop": {
+ "source": "iana"
+ },
+ "application/exi": {
+ "source": "iana",
+ "extensions": ["exi"]
+ },
+ "application/expect-ct-report+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/express": {
+ "source": "iana",
+ "extensions": ["exp"]
+ },
+ "application/fastinfoset": {
+ "source": "iana"
+ },
+ "application/fastsoap": {
+ "source": "iana"
+ },
+ "application/fdt+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["fdt"]
+ },
+ "application/fhir+json": {
+ "source": "iana",
+ "charset": "UTF-8",
+ "compressible": true
+ },
+ "application/fhir+xml": {
+ "source": "iana",
+ "charset": "UTF-8",
+ "compressible": true
+ },
+ "application/fido.trusted-apps+json": {
+ "compressible": true
+ },
+ "application/fits": {
+ "source": "iana"
+ },
+ "application/flexfec": {
+ "source": "iana"
+ },
+ "application/font-sfnt": {
+ "source": "iana"
+ },
+ "application/font-tdpfr": {
+ "source": "iana",
+ "extensions": ["pfr"]
+ },
+ "application/font-woff": {
+ "source": "iana",
+ "compressible": false
+ },
+ "application/framework-attributes+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/geo+json": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["geojson"]
+ },
+ "application/geo+json-seq": {
+ "source": "iana"
+ },
+ "application/geopackage+sqlite3": {
+ "source": "iana"
+ },
+ "application/geoxacml+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/gltf-buffer": {
+ "source": "iana"
+ },
+ "application/gml+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["gml"]
+ },
+ "application/gpx+xml": {
+ "source": "apache",
+ "compressible": true,
+ "extensions": ["gpx"]
+ },
+ "application/gxf": {
+ "source": "apache",
+ "extensions": ["gxf"]
+ },
+ "application/gzip": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["gz"]
+ },
+ "application/h224": {
+ "source": "iana"
+ },
+ "application/held+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/hjson": {
+ "extensions": ["hjson"]
+ },
+ "application/http": {
+ "source": "iana"
+ },
+ "application/hyperstudio": {
+ "source": "iana",
+ "extensions": ["stk"]
+ },
+ "application/ibe-key-request+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/ibe-pkg-reply+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/ibe-pp-data": {
+ "source": "iana"
+ },
+ "application/iges": {
+ "source": "iana"
+ },
+ "application/im-iscomposing+xml": {
+ "source": "iana",
+ "charset": "UTF-8",
+ "compressible": true
+ },
+ "application/index": {
+ "source": "iana"
+ },
+ "application/index.cmd": {
+ "source": "iana"
+ },
+ "application/index.obj": {
+ "source": "iana"
+ },
+ "application/index.response": {
+ "source": "iana"
+ },
+ "application/index.vnd": {
+ "source": "iana"
+ },
+ "application/inkml+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["ink","inkml"]
+ },
+ "application/iotp": {
+ "source": "iana"
+ },
+ "application/ipfix": {
+ "source": "iana",
+ "extensions": ["ipfix"]
+ },
+ "application/ipp": {
+ "source": "iana"
+ },
+ "application/isup": {
+ "source": "iana"
+ },
+ "application/its+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["its"]
+ },
+ "application/java-archive": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["jar","war","ear"]
+ },
+ "application/java-serialized-object": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["ser"]
+ },
+ "application/java-vm": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["class"]
+ },
+ "application/javascript": {
+ "source": "iana",
+ "charset": "UTF-8",
+ "compressible": true,
+ "extensions": ["js","mjs"]
+ },
+ "application/jf2feed+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/jose": {
+ "source": "iana"
+ },
+ "application/jose+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/jrd+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/jscalendar+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/json": {
+ "source": "iana",
+ "charset": "UTF-8",
+ "compressible": true,
+ "extensions": ["json","map"]
+ },
+ "application/json-patch+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/json-seq": {
+ "source": "iana"
+ },
+ "application/json5": {
+ "extensions": ["json5"]
+ },
+ "application/jsonml+json": {
+ "source": "apache",
+ "compressible": true,
+ "extensions": ["jsonml"]
+ },
+ "application/jwk+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/jwk-set+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/jwt": {
+ "source": "iana"
+ },
+ "application/kpml-request+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/kpml-response+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/ld+json": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["jsonld"]
+ },
+ "application/lgr+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["lgr"]
+ },
+ "application/link-format": {
+ "source": "iana"
+ },
+ "application/load-control+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/lost+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["lostxml"]
+ },
+ "application/lostsync+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/lpf+zip": {
+ "source": "iana",
+ "compressible": false
+ },
+ "application/lxf": {
+ "source": "iana"
+ },
+ "application/mac-binhex40": {
+ "source": "iana",
+ "extensions": ["hqx"]
+ },
+ "application/mac-compactpro": {
+ "source": "apache",
+ "extensions": ["cpt"]
+ },
+ "application/macwriteii": {
+ "source": "iana"
+ },
+ "application/mads+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["mads"]
+ },
+ "application/manifest+json": {
+ "source": "iana",
+ "charset": "UTF-8",
+ "compressible": true,
+ "extensions": ["webmanifest"]
+ },
+ "application/marc": {
+ "source": "iana",
+ "extensions": ["mrc"]
+ },
+ "application/marcxml+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["mrcx"]
+ },
+ "application/mathematica": {
+ "source": "iana",
+ "extensions": ["ma","nb","mb"]
+ },
+ "application/mathml+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["mathml"]
+ },
+ "application/mathml-content+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/mathml-presentation+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/mbms-associated-procedure-description+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/mbms-deregister+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/mbms-envelope+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/mbms-msk+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/mbms-msk-response+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/mbms-protection-description+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/mbms-reception-report+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/mbms-register+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/mbms-register-response+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/mbms-schedule+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/mbms-user-service-description+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/mbox": {
+ "source": "iana",
+ "extensions": ["mbox"]
+ },
+ "application/media-policy-dataset+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["mpf"]
+ },
+ "application/media_control+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/mediaservercontrol+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["mscml"]
+ },
+ "application/merge-patch+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/metalink+xml": {
+ "source": "apache",
+ "compressible": true,
+ "extensions": ["metalink"]
+ },
+ "application/metalink4+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["meta4"]
+ },
+ "application/mets+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["mets"]
+ },
+ "application/mf4": {
+ "source": "iana"
+ },
+ "application/mikey": {
+ "source": "iana"
+ },
+ "application/mipc": {
+ "source": "iana"
+ },
+ "application/missing-blocks+cbor-seq": {
+ "source": "iana"
+ },
+ "application/mmt-aei+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["maei"]
+ },
+ "application/mmt-usd+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["musd"]
+ },
+ "application/mods+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["mods"]
+ },
+ "application/moss-keys": {
+ "source": "iana"
+ },
+ "application/moss-signature": {
+ "source": "iana"
+ },
+ "application/mosskey-data": {
+ "source": "iana"
+ },
+ "application/mosskey-request": {
+ "source": "iana"
+ },
+ "application/mp21": {
+ "source": "iana",
+ "extensions": ["m21","mp21"]
+ },
+ "application/mp4": {
+ "source": "iana",
+ "extensions": ["mp4s","m4p"]
+ },
+ "application/mpeg4-generic": {
+ "source": "iana"
+ },
+ "application/mpeg4-iod": {
+ "source": "iana"
+ },
+ "application/mpeg4-iod-xmt": {
+ "source": "iana"
+ },
+ "application/mrb-consumer+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/mrb-publish+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/msc-ivr+xml": {
+ "source": "iana",
+ "charset": "UTF-8",
+ "compressible": true
+ },
+ "application/msc-mixer+xml": {
+ "source": "iana",
+ "charset": "UTF-8",
+ "compressible": true
+ },
+ "application/msword": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["doc","dot"]
+ },
+ "application/mud+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/multipart-core": {
+ "source": "iana"
+ },
+ "application/mxf": {
+ "source": "iana",
+ "extensions": ["mxf"]
+ },
+ "application/n-quads": {
+ "source": "iana",
+ "extensions": ["nq"]
+ },
+ "application/n-triples": {
+ "source": "iana",
+ "extensions": ["nt"]
+ },
+ "application/nasdata": {
+ "source": "iana"
+ },
+ "application/news-checkgroups": {
+ "source": "iana",
+ "charset": "US-ASCII"
+ },
+ "application/news-groupinfo": {
+ "source": "iana",
+ "charset": "US-ASCII"
+ },
+ "application/news-transmission": {
+ "source": "iana"
+ },
+ "application/nlsml+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/node": {
+ "source": "iana",
+ "extensions": ["cjs"]
+ },
+ "application/nss": {
+ "source": "iana"
+ },
+ "application/oauth-authz-req+jwt": {
+ "source": "iana"
+ },
+ "application/oblivious-dns-message": {
+ "source": "iana"
+ },
+ "application/ocsp-request": {
+ "source": "iana"
+ },
+ "application/ocsp-response": {
+ "source": "iana"
+ },
+ "application/octet-stream": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]
+ },
+ "application/oda": {
+ "source": "iana",
+ "extensions": ["oda"]
+ },
+ "application/odm+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/odx": {
+ "source": "iana"
+ },
+ "application/oebps-package+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["opf"]
+ },
+ "application/ogg": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["ogx"]
+ },
+ "application/omdoc+xml": {
+ "source": "apache",
+ "compressible": true,
+ "extensions": ["omdoc"]
+ },
+ "application/onenote": {
+ "source": "apache",
+ "extensions": ["onetoc","onetoc2","onetmp","onepkg"]
+ },
+ "application/opc-nodeset+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/oscore": {
+ "source": "iana"
+ },
+ "application/oxps": {
+ "source": "iana",
+ "extensions": ["oxps"]
+ },
+ "application/p21": {
+ "source": "iana"
+ },
+ "application/p21+zip": {
+ "source": "iana",
+ "compressible": false
+ },
+ "application/p2p-overlay+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["relo"]
+ },
+ "application/parityfec": {
+ "source": "iana"
+ },
+ "application/passport": {
+ "source": "iana"
+ },
+ "application/patch-ops-error+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["xer"]
+ },
+ "application/pdf": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["pdf"]
+ },
+ "application/pdx": {
+ "source": "iana"
+ },
+ "application/pem-certificate-chain": {
+ "source": "iana"
+ },
+ "application/pgp-encrypted": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["pgp"]
+ },
+ "application/pgp-keys": {
+ "source": "iana",
+ "extensions": ["asc"]
+ },
+ "application/pgp-signature": {
+ "source": "iana",
+ "extensions": ["asc","sig"]
+ },
+ "application/pics-rules": {
+ "source": "apache",
+ "extensions": ["prf"]
+ },
+ "application/pidf+xml": {
+ "source": "iana",
+ "charset": "UTF-8",
+ "compressible": true
+ },
+ "application/pidf-diff+xml": {
+ "source": "iana",
+ "charset": "UTF-8",
+ "compressible": true
+ },
+ "application/pkcs10": {
+ "source": "iana",
+ "extensions": ["p10"]
+ },
+ "application/pkcs12": {
+ "source": "iana"
+ },
+ "application/pkcs7-mime": {
+ "source": "iana",
+ "extensions": ["p7m","p7c"]
+ },
+ "application/pkcs7-signature": {
+ "source": "iana",
+ "extensions": ["p7s"]
+ },
+ "application/pkcs8": {
+ "source": "iana",
+ "extensions": ["p8"]
+ },
+ "application/pkcs8-encrypted": {
+ "source": "iana"
+ },
+ "application/pkix-attr-cert": {
+ "source": "iana",
+ "extensions": ["ac"]
+ },
+ "application/pkix-cert": {
+ "source": "iana",
+ "extensions": ["cer"]
+ },
+ "application/pkix-crl": {
+ "source": "iana",
+ "extensions": ["crl"]
+ },
+ "application/pkix-pkipath": {
+ "source": "iana",
+ "extensions": ["pkipath"]
+ },
+ "application/pkixcmp": {
+ "source": "iana",
+ "extensions": ["pki"]
+ },
+ "application/pls+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["pls"]
+ },
+ "application/poc-settings+xml": {
+ "source": "iana",
+ "charset": "UTF-8",
+ "compressible": true
+ },
+ "application/postscript": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["ai","eps","ps"]
+ },
+ "application/ppsp-tracker+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/problem+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/problem+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/provenance+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["provx"]
+ },
+ "application/prs.alvestrand.titrax-sheet": {
+ "source": "iana"
+ },
+ "application/prs.cww": {
+ "source": "iana",
+ "extensions": ["cww"]
+ },
+ "application/prs.cyn": {
+ "source": "iana",
+ "charset": "7-BIT"
+ },
+ "application/prs.hpub+zip": {
+ "source": "iana",
+ "compressible": false
+ },
+ "application/prs.nprend": {
+ "source": "iana"
+ },
+ "application/prs.plucker": {
+ "source": "iana"
+ },
+ "application/prs.rdf-xml-crypt": {
+ "source": "iana"
+ },
+ "application/prs.xsf+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/pskc+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["pskcxml"]
+ },
+ "application/pvd+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/qsig": {
+ "source": "iana"
+ },
+ "application/raml+yaml": {
+ "compressible": true,
+ "extensions": ["raml"]
+ },
+ "application/raptorfec": {
+ "source": "iana"
+ },
+ "application/rdap+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/rdf+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["rdf","owl"]
+ },
+ "application/reginfo+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["rif"]
+ },
+ "application/relax-ng-compact-syntax": {
+ "source": "iana",
+ "extensions": ["rnc"]
+ },
+ "application/remote-printing": {
+ "source": "iana"
+ },
+ "application/reputon+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/resource-lists+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["rl"]
+ },
+ "application/resource-lists-diff+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["rld"]
+ },
+ "application/rfc+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/riscos": {
+ "source": "iana"
+ },
+ "application/rlmi+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/rls-services+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["rs"]
+ },
+ "application/route-apd+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["rapd"]
+ },
+ "application/route-s-tsid+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["sls"]
+ },
+ "application/route-usd+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["rusd"]
+ },
+ "application/rpki-ghostbusters": {
+ "source": "iana",
+ "extensions": ["gbr"]
+ },
+ "application/rpki-manifest": {
+ "source": "iana",
+ "extensions": ["mft"]
+ },
+ "application/rpki-publication": {
+ "source": "iana"
+ },
+ "application/rpki-roa": {
+ "source": "iana",
+ "extensions": ["roa"]
+ },
+ "application/rpki-updown": {
+ "source": "iana"
+ },
+ "application/rsd+xml": {
+ "source": "apache",
+ "compressible": true,
+ "extensions": ["rsd"]
+ },
+ "application/rss+xml": {
+ "source": "apache",
+ "compressible": true,
+ "extensions": ["rss"]
+ },
+ "application/rtf": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["rtf"]
+ },
+ "application/rtploopback": {
+ "source": "iana"
+ },
+ "application/rtx": {
+ "source": "iana"
+ },
+ "application/samlassertion+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/samlmetadata+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/sarif+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/sarif-external-properties+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/sbe": {
+ "source": "iana"
+ },
+ "application/sbml+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["sbml"]
+ },
+ "application/scaip+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/scim+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/scvp-cv-request": {
+ "source": "iana",
+ "extensions": ["scq"]
+ },
+ "application/scvp-cv-response": {
+ "source": "iana",
+ "extensions": ["scs"]
+ },
+ "application/scvp-vp-request": {
+ "source": "iana",
+ "extensions": ["spq"]
+ },
+ "application/scvp-vp-response": {
+ "source": "iana",
+ "extensions": ["spp"]
+ },
+ "application/sdp": {
+ "source": "iana",
+ "extensions": ["sdp"]
+ },
+ "application/secevent+jwt": {
+ "source": "iana"
+ },
+ "application/senml+cbor": {
+ "source": "iana"
+ },
+ "application/senml+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/senml+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["senmlx"]
+ },
+ "application/senml-etch+cbor": {
+ "source": "iana"
+ },
+ "application/senml-etch+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/senml-exi": {
+ "source": "iana"
+ },
+ "application/sensml+cbor": {
+ "source": "iana"
+ },
+ "application/sensml+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/sensml+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["sensmlx"]
+ },
+ "application/sensml-exi": {
+ "source": "iana"
+ },
+ "application/sep+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/sep-exi": {
+ "source": "iana"
+ },
+ "application/session-info": {
+ "source": "iana"
+ },
+ "application/set-payment": {
+ "source": "iana"
+ },
+ "application/set-payment-initiation": {
+ "source": "iana",
+ "extensions": ["setpay"]
+ },
+ "application/set-registration": {
+ "source": "iana"
+ },
+ "application/set-registration-initiation": {
+ "source": "iana",
+ "extensions": ["setreg"]
+ },
+ "application/sgml": {
+ "source": "iana"
+ },
+ "application/sgml-open-catalog": {
+ "source": "iana"
+ },
+ "application/shf+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["shf"]
+ },
+ "application/sieve": {
+ "source": "iana",
+ "extensions": ["siv","sieve"]
+ },
+ "application/simple-filter+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/simple-message-summary": {
+ "source": "iana"
+ },
+ "application/simplesymbolcontainer": {
+ "source": "iana"
+ },
+ "application/sipc": {
+ "source": "iana"
+ },
+ "application/slate": {
+ "source": "iana"
+ },
+ "application/smil": {
+ "source": "iana"
+ },
+ "application/smil+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["smi","smil"]
+ },
+ "application/smpte336m": {
+ "source": "iana"
+ },
+ "application/soap+fastinfoset": {
+ "source": "iana"
+ },
+ "application/soap+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/sparql-query": {
+ "source": "iana",
+ "extensions": ["rq"]
+ },
+ "application/sparql-results+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["srx"]
+ },
+ "application/spdx+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/spirits-event+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/sql": {
+ "source": "iana"
+ },
+ "application/srgs": {
+ "source": "iana",
+ "extensions": ["gram"]
+ },
+ "application/srgs+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["grxml"]
+ },
+ "application/sru+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["sru"]
+ },
+ "application/ssdl+xml": {
+ "source": "apache",
+ "compressible": true,
+ "extensions": ["ssdl"]
+ },
+ "application/ssml+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["ssml"]
+ },
+ "application/stix+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/swid+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["swidtag"]
+ },
+ "application/tamp-apex-update": {
+ "source": "iana"
+ },
+ "application/tamp-apex-update-confirm": {
+ "source": "iana"
+ },
+ "application/tamp-community-update": {
+ "source": "iana"
+ },
+ "application/tamp-community-update-confirm": {
+ "source": "iana"
+ },
+ "application/tamp-error": {
+ "source": "iana"
+ },
+ "application/tamp-sequence-adjust": {
+ "source": "iana"
+ },
+ "application/tamp-sequence-adjust-confirm": {
+ "source": "iana"
+ },
+ "application/tamp-status-query": {
+ "source": "iana"
+ },
+ "application/tamp-status-response": {
+ "source": "iana"
+ },
+ "application/tamp-update": {
+ "source": "iana"
+ },
+ "application/tamp-update-confirm": {
+ "source": "iana"
+ },
+ "application/tar": {
+ "compressible": true
+ },
+ "application/taxii+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/td+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/tei+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["tei","teicorpus"]
+ },
+ "application/tetra_isi": {
+ "source": "iana"
+ },
+ "application/thraud+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["tfi"]
+ },
+ "application/timestamp-query": {
+ "source": "iana"
+ },
+ "application/timestamp-reply": {
+ "source": "iana"
+ },
+ "application/timestamped-data": {
+ "source": "iana",
+ "extensions": ["tsd"]
+ },
+ "application/tlsrpt+gzip": {
+ "source": "iana"
+ },
+ "application/tlsrpt+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/tnauthlist": {
+ "source": "iana"
+ },
+ "application/token-introspection+jwt": {
+ "source": "iana"
+ },
+ "application/toml": {
+ "compressible": true,
+ "extensions": ["toml"]
+ },
+ "application/trickle-ice-sdpfrag": {
+ "source": "iana"
+ },
+ "application/trig": {
+ "source": "iana",
+ "extensions": ["trig"]
+ },
+ "application/ttml+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["ttml"]
+ },
+ "application/tve-trigger": {
+ "source": "iana"
+ },
+ "application/tzif": {
+ "source": "iana"
+ },
+ "application/tzif-leap": {
+ "source": "iana"
+ },
+ "application/ubjson": {
+ "compressible": false,
+ "extensions": ["ubj"]
+ },
+ "application/ulpfec": {
+ "source": "iana"
+ },
+ "application/urc-grpsheet+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/urc-ressheet+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["rsheet"]
+ },
+ "application/urc-targetdesc+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["td"]
+ },
+ "application/urc-uisocketdesc+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vcard+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vcard+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vemmi": {
+ "source": "iana"
+ },
+ "application/vividence.scriptfile": {
+ "source": "apache"
+ },
+ "application/vnd.1000minds.decision-model+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["1km"]
+ },
+ "application/vnd.3gpp-prose+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.3gpp-prose-pc3ch+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.3gpp-v2x-local-service-information": {
+ "source": "iana"
+ },
+ "application/vnd.3gpp.5gnas": {
+ "source": "iana"
+ },
+ "application/vnd.3gpp.access-transfer-events+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.3gpp.bsf+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.3gpp.gmop+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.3gpp.gtpc": {
+ "source": "iana"
+ },
+ "application/vnd.3gpp.interworking-data": {
+ "source": "iana"
+ },
+ "application/vnd.3gpp.lpp": {
+ "source": "iana"
+ },
+ "application/vnd.3gpp.mc-signalling-ear": {
+ "source": "iana"
+ },
+ "application/vnd.3gpp.mcdata-affiliation-command+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.3gpp.mcdata-info+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.3gpp.mcdata-payload": {
+ "source": "iana"
+ },
+ "application/vnd.3gpp.mcdata-service-config+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.3gpp.mcdata-signalling": {
+ "source": "iana"
+ },
+ "application/vnd.3gpp.mcdata-ue-config+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.3gpp.mcdata-user-profile+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.3gpp.mcptt-affiliation-command+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.3gpp.mcptt-floor-request+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.3gpp.mcptt-info+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.3gpp.mcptt-location-info+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.3gpp.mcptt-mbms-usage-info+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.3gpp.mcptt-service-config+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.3gpp.mcptt-signed+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.3gpp.mcptt-ue-config+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.3gpp.mcptt-ue-init-config+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.3gpp.mcptt-user-profile+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.3gpp.mcvideo-affiliation-command+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.3gpp.mcvideo-affiliation-info+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.3gpp.mcvideo-info+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.3gpp.mcvideo-location-info+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.3gpp.mcvideo-mbms-usage-info+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.3gpp.mcvideo-service-config+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.3gpp.mcvideo-transmission-request+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.3gpp.mcvideo-ue-config+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.3gpp.mcvideo-user-profile+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.3gpp.mid-call+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.3gpp.ngap": {
+ "source": "iana"
+ },
+ "application/vnd.3gpp.pfcp": {
+ "source": "iana"
+ },
+ "application/vnd.3gpp.pic-bw-large": {
+ "source": "iana",
+ "extensions": ["plb"]
+ },
+ "application/vnd.3gpp.pic-bw-small": {
+ "source": "iana",
+ "extensions": ["psb"]
+ },
+ "application/vnd.3gpp.pic-bw-var": {
+ "source": "iana",
+ "extensions": ["pvb"]
+ },
+ "application/vnd.3gpp.s1ap": {
+ "source": "iana"
+ },
+ "application/vnd.3gpp.sms": {
+ "source": "iana"
+ },
+ "application/vnd.3gpp.sms+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.3gpp.srvcc-ext+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.3gpp.srvcc-info+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.3gpp.state-and-event-info+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.3gpp.ussd+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.3gpp2.bcmcsinfo+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.3gpp2.sms": {
+ "source": "iana"
+ },
+ "application/vnd.3gpp2.tcap": {
+ "source": "iana",
+ "extensions": ["tcap"]
+ },
+ "application/vnd.3lightssoftware.imagescal": {
+ "source": "iana"
+ },
+ "application/vnd.3m.post-it-notes": {
+ "source": "iana",
+ "extensions": ["pwn"]
+ },
+ "application/vnd.accpac.simply.aso": {
+ "source": "iana",
+ "extensions": ["aso"]
+ },
+ "application/vnd.accpac.simply.imp": {
+ "source": "iana",
+ "extensions": ["imp"]
+ },
+ "application/vnd.acucobol": {
+ "source": "iana",
+ "extensions": ["acu"]
+ },
+ "application/vnd.acucorp": {
+ "source": "iana",
+ "extensions": ["atc","acutc"]
+ },
+ "application/vnd.adobe.air-application-installer-package+zip": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["air"]
+ },
+ "application/vnd.adobe.flash.movie": {
+ "source": "iana"
+ },
+ "application/vnd.adobe.formscentral.fcdt": {
+ "source": "iana",
+ "extensions": ["fcdt"]
+ },
+ "application/vnd.adobe.fxp": {
+ "source": "iana",
+ "extensions": ["fxp","fxpl"]
+ },
+ "application/vnd.adobe.partial-upload": {
+ "source": "iana"
+ },
+ "application/vnd.adobe.xdp+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["xdp"]
+ },
+ "application/vnd.adobe.xfdf": {
+ "source": "iana",
+ "extensions": ["xfdf"]
+ },
+ "application/vnd.aether.imp": {
+ "source": "iana"
+ },
+ "application/vnd.afpc.afplinedata": {
+ "source": "iana"
+ },
+ "application/vnd.afpc.afplinedata-pagedef": {
+ "source": "iana"
+ },
+ "application/vnd.afpc.cmoca-cmresource": {
+ "source": "iana"
+ },
+ "application/vnd.afpc.foca-charset": {
+ "source": "iana"
+ },
+ "application/vnd.afpc.foca-codedfont": {
+ "source": "iana"
+ },
+ "application/vnd.afpc.foca-codepage": {
+ "source": "iana"
+ },
+ "application/vnd.afpc.modca": {
+ "source": "iana"
+ },
+ "application/vnd.afpc.modca-cmtable": {
+ "source": "iana"
+ },
+ "application/vnd.afpc.modca-formdef": {
+ "source": "iana"
+ },
+ "application/vnd.afpc.modca-mediummap": {
+ "source": "iana"
+ },
+ "application/vnd.afpc.modca-objectcontainer": {
+ "source": "iana"
+ },
+ "application/vnd.afpc.modca-overlay": {
+ "source": "iana"
+ },
+ "application/vnd.afpc.modca-pagesegment": {
+ "source": "iana"
+ },
+ "application/vnd.age": {
+ "source": "iana",
+ "extensions": ["age"]
+ },
+ "application/vnd.ah-barcode": {
+ "source": "iana"
+ },
+ "application/vnd.ahead.space": {
+ "source": "iana",
+ "extensions": ["ahead"]
+ },
+ "application/vnd.airzip.filesecure.azf": {
+ "source": "iana",
+ "extensions": ["azf"]
+ },
+ "application/vnd.airzip.filesecure.azs": {
+ "source": "iana",
+ "extensions": ["azs"]
+ },
+ "application/vnd.amadeus+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.amazon.ebook": {
+ "source": "apache",
+ "extensions": ["azw"]
+ },
+ "application/vnd.amazon.mobi8-ebook": {
+ "source": "iana"
+ },
+ "application/vnd.americandynamics.acc": {
+ "source": "iana",
+ "extensions": ["acc"]
+ },
+ "application/vnd.amiga.ami": {
+ "source": "iana",
+ "extensions": ["ami"]
+ },
+ "application/vnd.amundsen.maze+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.android.ota": {
+ "source": "iana"
+ },
+ "application/vnd.android.package-archive": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["apk"]
+ },
+ "application/vnd.anki": {
+ "source": "iana"
+ },
+ "application/vnd.anser-web-certificate-issue-initiation": {
+ "source": "iana",
+ "extensions": ["cii"]
+ },
+ "application/vnd.anser-web-funds-transfer-initiation": {
+ "source": "apache",
+ "extensions": ["fti"]
+ },
+ "application/vnd.antix.game-component": {
+ "source": "iana",
+ "extensions": ["atx"]
+ },
+ "application/vnd.apache.arrow.file": {
+ "source": "iana"
+ },
+ "application/vnd.apache.arrow.stream": {
+ "source": "iana"
+ },
+ "application/vnd.apache.thrift.binary": {
+ "source": "iana"
+ },
+ "application/vnd.apache.thrift.compact": {
+ "source": "iana"
+ },
+ "application/vnd.apache.thrift.json": {
+ "source": "iana"
+ },
+ "application/vnd.api+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.aplextor.warrp+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.apothekende.reservation+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.apple.installer+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["mpkg"]
+ },
+ "application/vnd.apple.keynote": {
+ "source": "iana",
+ "extensions": ["key"]
+ },
+ "application/vnd.apple.mpegurl": {
+ "source": "iana",
+ "extensions": ["m3u8"]
+ },
+ "application/vnd.apple.numbers": {
+ "source": "iana",
+ "extensions": ["numbers"]
+ },
+ "application/vnd.apple.pages": {
+ "source": "iana",
+ "extensions": ["pages"]
+ },
+ "application/vnd.apple.pkpass": {
+ "compressible": false,
+ "extensions": ["pkpass"]
+ },
+ "application/vnd.arastra.swi": {
+ "source": "iana"
+ },
+ "application/vnd.aristanetworks.swi": {
+ "source": "iana",
+ "extensions": ["swi"]
+ },
+ "application/vnd.artisan+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.artsquare": {
+ "source": "iana"
+ },
+ "application/vnd.astraea-software.iota": {
+ "source": "iana",
+ "extensions": ["iota"]
+ },
+ "application/vnd.audiograph": {
+ "source": "iana",
+ "extensions": ["aep"]
+ },
+ "application/vnd.autopackage": {
+ "source": "iana"
+ },
+ "application/vnd.avalon+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.avistar+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.balsamiq.bmml+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["bmml"]
+ },
+ "application/vnd.balsamiq.bmpr": {
+ "source": "iana"
+ },
+ "application/vnd.banana-accounting": {
+ "source": "iana"
+ },
+ "application/vnd.bbf.usp.error": {
+ "source": "iana"
+ },
+ "application/vnd.bbf.usp.msg": {
+ "source": "iana"
+ },
+ "application/vnd.bbf.usp.msg+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.bekitzur-stech+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.bint.med-content": {
+ "source": "iana"
+ },
+ "application/vnd.biopax.rdf+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.blink-idb-value-wrapper": {
+ "source": "iana"
+ },
+ "application/vnd.blueice.multipass": {
+ "source": "iana",
+ "extensions": ["mpm"]
+ },
+ "application/vnd.bluetooth.ep.oob": {
+ "source": "iana"
+ },
+ "application/vnd.bluetooth.le.oob": {
+ "source": "iana"
+ },
+ "application/vnd.bmi": {
+ "source": "iana",
+ "extensions": ["bmi"]
+ },
+ "application/vnd.bpf": {
+ "source": "iana"
+ },
+ "application/vnd.bpf3": {
+ "source": "iana"
+ },
+ "application/vnd.businessobjects": {
+ "source": "iana",
+ "extensions": ["rep"]
+ },
+ "application/vnd.byu.uapi+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.cab-jscript": {
+ "source": "iana"
+ },
+ "application/vnd.canon-cpdl": {
+ "source": "iana"
+ },
+ "application/vnd.canon-lips": {
+ "source": "iana"
+ },
+ "application/vnd.capasystems-pg+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.cendio.thinlinc.clientconf": {
+ "source": "iana"
+ },
+ "application/vnd.century-systems.tcp_stream": {
+ "source": "iana"
+ },
+ "application/vnd.chemdraw+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["cdxml"]
+ },
+ "application/vnd.chess-pgn": {
+ "source": "iana"
+ },
+ "application/vnd.chipnuts.karaoke-mmd": {
+ "source": "iana",
+ "extensions": ["mmd"]
+ },
+ "application/vnd.ciedi": {
+ "source": "iana"
+ },
+ "application/vnd.cinderella": {
+ "source": "iana",
+ "extensions": ["cdy"]
+ },
+ "application/vnd.cirpack.isdn-ext": {
+ "source": "iana"
+ },
+ "application/vnd.citationstyles.style+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["csl"]
+ },
+ "application/vnd.claymore": {
+ "source": "iana",
+ "extensions": ["cla"]
+ },
+ "application/vnd.cloanto.rp9": {
+ "source": "iana",
+ "extensions": ["rp9"]
+ },
+ "application/vnd.clonk.c4group": {
+ "source": "iana",
+ "extensions": ["c4g","c4d","c4f","c4p","c4u"]
+ },
+ "application/vnd.cluetrust.cartomobile-config": {
+ "source": "iana",
+ "extensions": ["c11amc"]
+ },
+ "application/vnd.cluetrust.cartomobile-config-pkg": {
+ "source": "iana",
+ "extensions": ["c11amz"]
+ },
+ "application/vnd.coffeescript": {
+ "source": "iana"
+ },
+ "application/vnd.collabio.xodocuments.document": {
+ "source": "iana"
+ },
+ "application/vnd.collabio.xodocuments.document-template": {
+ "source": "iana"
+ },
+ "application/vnd.collabio.xodocuments.presentation": {
+ "source": "iana"
+ },
+ "application/vnd.collabio.xodocuments.presentation-template": {
+ "source": "iana"
+ },
+ "application/vnd.collabio.xodocuments.spreadsheet": {
+ "source": "iana"
+ },
+ "application/vnd.collabio.xodocuments.spreadsheet-template": {
+ "source": "iana"
+ },
+ "application/vnd.collection+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.collection.doc+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.collection.next+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.comicbook+zip": {
+ "source": "iana",
+ "compressible": false
+ },
+ "application/vnd.comicbook-rar": {
+ "source": "iana"
+ },
+ "application/vnd.commerce-battelle": {
+ "source": "iana"
+ },
+ "application/vnd.commonspace": {
+ "source": "iana",
+ "extensions": ["csp"]
+ },
+ "application/vnd.contact.cmsg": {
+ "source": "iana",
+ "extensions": ["cdbcmsg"]
+ },
+ "application/vnd.coreos.ignition+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.cosmocaller": {
+ "source": "iana",
+ "extensions": ["cmc"]
+ },
+ "application/vnd.crick.clicker": {
+ "source": "iana",
+ "extensions": ["clkx"]
+ },
+ "application/vnd.crick.clicker.keyboard": {
+ "source": "iana",
+ "extensions": ["clkk"]
+ },
+ "application/vnd.crick.clicker.palette": {
+ "source": "iana",
+ "extensions": ["clkp"]
+ },
+ "application/vnd.crick.clicker.template": {
+ "source": "iana",
+ "extensions": ["clkt"]
+ },
+ "application/vnd.crick.clicker.wordbank": {
+ "source": "iana",
+ "extensions": ["clkw"]
+ },
+ "application/vnd.criticaltools.wbs+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["wbs"]
+ },
+ "application/vnd.cryptii.pipe+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.crypto-shade-file": {
+ "source": "iana"
+ },
+ "application/vnd.cryptomator.encrypted": {
+ "source": "iana"
+ },
+ "application/vnd.cryptomator.vault": {
+ "source": "iana"
+ },
+ "application/vnd.ctc-posml": {
+ "source": "iana",
+ "extensions": ["pml"]
+ },
+ "application/vnd.ctct.ws+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.cups-pdf": {
+ "source": "iana"
+ },
+ "application/vnd.cups-postscript": {
+ "source": "iana"
+ },
+ "application/vnd.cups-ppd": {
+ "source": "iana",
+ "extensions": ["ppd"]
+ },
+ "application/vnd.cups-raster": {
+ "source": "iana"
+ },
+ "application/vnd.cups-raw": {
+ "source": "iana"
+ },
+ "application/vnd.curl": {
+ "source": "iana"
+ },
+ "application/vnd.curl.car": {
+ "source": "apache",
+ "extensions": ["car"]
+ },
+ "application/vnd.curl.pcurl": {
+ "source": "apache",
+ "extensions": ["pcurl"]
+ },
+ "application/vnd.cyan.dean.root+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.cybank": {
+ "source": "iana"
+ },
+ "application/vnd.cyclonedx+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.cyclonedx+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.d2l.coursepackage1p0+zip": {
+ "source": "iana",
+ "compressible": false
+ },
+ "application/vnd.d3m-dataset": {
+ "source": "iana"
+ },
+ "application/vnd.d3m-problem": {
+ "source": "iana"
+ },
+ "application/vnd.dart": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["dart"]
+ },
+ "application/vnd.data-vision.rdz": {
+ "source": "iana",
+ "extensions": ["rdz"]
+ },
+ "application/vnd.datapackage+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.dataresource+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.dbf": {
+ "source": "iana",
+ "extensions": ["dbf"]
+ },
+ "application/vnd.debian.binary-package": {
+ "source": "iana"
+ },
+ "application/vnd.dece.data": {
+ "source": "iana",
+ "extensions": ["uvf","uvvf","uvd","uvvd"]
+ },
+ "application/vnd.dece.ttml+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["uvt","uvvt"]
+ },
+ "application/vnd.dece.unspecified": {
+ "source": "iana",
+ "extensions": ["uvx","uvvx"]
+ },
+ "application/vnd.dece.zip": {
+ "source": "iana",
+ "extensions": ["uvz","uvvz"]
+ },
+ "application/vnd.denovo.fcselayout-link": {
+ "source": "iana",
+ "extensions": ["fe_launch"]
+ },
+ "application/vnd.desmume.movie": {
+ "source": "iana"
+ },
+ "application/vnd.dir-bi.plate-dl-nosuffix": {
+ "source": "iana"
+ },
+ "application/vnd.dm.delegation+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.dna": {
+ "source": "iana",
+ "extensions": ["dna"]
+ },
+ "application/vnd.document+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.dolby.mlp": {
+ "source": "apache",
+ "extensions": ["mlp"]
+ },
+ "application/vnd.dolby.mobile.1": {
+ "source": "iana"
+ },
+ "application/vnd.dolby.mobile.2": {
+ "source": "iana"
+ },
+ "application/vnd.doremir.scorecloud-binary-document": {
+ "source": "iana"
+ },
+ "application/vnd.dpgraph": {
+ "source": "iana",
+ "extensions": ["dpg"]
+ },
+ "application/vnd.dreamfactory": {
+ "source": "iana",
+ "extensions": ["dfac"]
+ },
+ "application/vnd.drive+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.ds-keypoint": {
+ "source": "apache",
+ "extensions": ["kpxx"]
+ },
+ "application/vnd.dtg.local": {
+ "source": "iana"
+ },
+ "application/vnd.dtg.local.flash": {
+ "source": "iana"
+ },
+ "application/vnd.dtg.local.html": {
+ "source": "iana"
+ },
+ "application/vnd.dvb.ait": {
+ "source": "iana",
+ "extensions": ["ait"]
+ },
+ "application/vnd.dvb.dvbisl+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.dvb.dvbj": {
+ "source": "iana"
+ },
+ "application/vnd.dvb.esgcontainer": {
+ "source": "iana"
+ },
+ "application/vnd.dvb.ipdcdftnotifaccess": {
+ "source": "iana"
+ },
+ "application/vnd.dvb.ipdcesgaccess": {
+ "source": "iana"
+ },
+ "application/vnd.dvb.ipdcesgaccess2": {
+ "source": "iana"
+ },
+ "application/vnd.dvb.ipdcesgpdd": {
+ "source": "iana"
+ },
+ "application/vnd.dvb.ipdcroaming": {
+ "source": "iana"
+ },
+ "application/vnd.dvb.iptv.alfec-base": {
+ "source": "iana"
+ },
+ "application/vnd.dvb.iptv.alfec-enhancement": {
+ "source": "iana"
+ },
+ "application/vnd.dvb.notif-aggregate-root+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.dvb.notif-container+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.dvb.notif-generic+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.dvb.notif-ia-msglist+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.dvb.notif-ia-registration-request+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.dvb.notif-ia-registration-response+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.dvb.notif-init+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.dvb.pfr": {
+ "source": "iana"
+ },
+ "application/vnd.dvb.service": {
+ "source": "iana",
+ "extensions": ["svc"]
+ },
+ "application/vnd.dxr": {
+ "source": "iana"
+ },
+ "application/vnd.dynageo": {
+ "source": "iana",
+ "extensions": ["geo"]
+ },
+ "application/vnd.dzr": {
+ "source": "iana"
+ },
+ "application/vnd.easykaraoke.cdgdownload": {
+ "source": "iana"
+ },
+ "application/vnd.ecdis-update": {
+ "source": "iana"
+ },
+ "application/vnd.ecip.rlp": {
+ "source": "iana"
+ },
+ "application/vnd.eclipse.ditto+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.ecowin.chart": {
+ "source": "iana",
+ "extensions": ["mag"]
+ },
+ "application/vnd.ecowin.filerequest": {
+ "source": "iana"
+ },
+ "application/vnd.ecowin.fileupdate": {
+ "source": "iana"
+ },
+ "application/vnd.ecowin.series": {
+ "source": "iana"
+ },
+ "application/vnd.ecowin.seriesrequest": {
+ "source": "iana"
+ },
+ "application/vnd.ecowin.seriesupdate": {
+ "source": "iana"
+ },
+ "application/vnd.efi.img": {
+ "source": "iana"
+ },
+ "application/vnd.efi.iso": {
+ "source": "iana"
+ },
+ "application/vnd.emclient.accessrequest+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.enliven": {
+ "source": "iana",
+ "extensions": ["nml"]
+ },
+ "application/vnd.enphase.envoy": {
+ "source": "iana"
+ },
+ "application/vnd.eprints.data+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.epson.esf": {
+ "source": "iana",
+ "extensions": ["esf"]
+ },
+ "application/vnd.epson.msf": {
+ "source": "iana",
+ "extensions": ["msf"]
+ },
+ "application/vnd.epson.quickanime": {
+ "source": "iana",
+ "extensions": ["qam"]
+ },
+ "application/vnd.epson.salt": {
+ "source": "iana",
+ "extensions": ["slt"]
+ },
+ "application/vnd.epson.ssf": {
+ "source": "iana",
+ "extensions": ["ssf"]
+ },
+ "application/vnd.ericsson.quickcall": {
+ "source": "iana"
+ },
+ "application/vnd.espass-espass+zip": {
+ "source": "iana",
+ "compressible": false
+ },
+ "application/vnd.eszigno3+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["es3","et3"]
+ },
+ "application/vnd.etsi.aoc+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.etsi.asic-e+zip": {
+ "source": "iana",
+ "compressible": false
+ },
+ "application/vnd.etsi.asic-s+zip": {
+ "source": "iana",
+ "compressible": false
+ },
+ "application/vnd.etsi.cug+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.etsi.iptvcommand+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.etsi.iptvdiscovery+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.etsi.iptvprofile+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.etsi.iptvsad-bc+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.etsi.iptvsad-cod+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.etsi.iptvsad-npvr+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.etsi.iptvservice+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.etsi.iptvsync+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.etsi.iptvueprofile+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.etsi.mcid+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.etsi.mheg5": {
+ "source": "iana"
+ },
+ "application/vnd.etsi.overload-control-policy-dataset+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.etsi.pstn+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.etsi.sci+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.etsi.simservs+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.etsi.timestamp-token": {
+ "source": "iana"
+ },
+ "application/vnd.etsi.tsl+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.etsi.tsl.der": {
+ "source": "iana"
+ },
+ "application/vnd.eu.kasparian.car+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.eudora.data": {
+ "source": "iana"
+ },
+ "application/vnd.evolv.ecig.profile": {
+ "source": "iana"
+ },
+ "application/vnd.evolv.ecig.settings": {
+ "source": "iana"
+ },
+ "application/vnd.evolv.ecig.theme": {
+ "source": "iana"
+ },
+ "application/vnd.exstream-empower+zip": {
+ "source": "iana",
+ "compressible": false
+ },
+ "application/vnd.exstream-package": {
+ "source": "iana"
+ },
+ "application/vnd.ezpix-album": {
+ "source": "iana",
+ "extensions": ["ez2"]
+ },
+ "application/vnd.ezpix-package": {
+ "source": "iana",
+ "extensions": ["ez3"]
+ },
+ "application/vnd.f-secure.mobile": {
+ "source": "iana"
+ },
+ "application/vnd.familysearch.gedcom+zip": {
+ "source": "iana",
+ "compressible": false
+ },
+ "application/vnd.fastcopy-disk-image": {
+ "source": "iana"
+ },
+ "application/vnd.fdf": {
+ "source": "iana",
+ "extensions": ["fdf"]
+ },
+ "application/vnd.fdsn.mseed": {
+ "source": "iana",
+ "extensions": ["mseed"]
+ },
+ "application/vnd.fdsn.seed": {
+ "source": "iana",
+ "extensions": ["seed","dataless"]
+ },
+ "application/vnd.ffsns": {
+ "source": "iana"
+ },
+ "application/vnd.ficlab.flb+zip": {
+ "source": "iana",
+ "compressible": false
+ },
+ "application/vnd.filmit.zfc": {
+ "source": "iana"
+ },
+ "application/vnd.fints": {
+ "source": "iana"
+ },
+ "application/vnd.firemonkeys.cloudcell": {
+ "source": "iana"
+ },
+ "application/vnd.flographit": {
+ "source": "iana",
+ "extensions": ["gph"]
+ },
+ "application/vnd.fluxtime.clip": {
+ "source": "iana",
+ "extensions": ["ftc"]
+ },
+ "application/vnd.font-fontforge-sfd": {
+ "source": "iana"
+ },
+ "application/vnd.framemaker": {
+ "source": "iana",
+ "extensions": ["fm","frame","maker","book"]
+ },
+ "application/vnd.frogans.fnc": {
+ "source": "iana",
+ "extensions": ["fnc"]
+ },
+ "application/vnd.frogans.ltf": {
+ "source": "iana",
+ "extensions": ["ltf"]
+ },
+ "application/vnd.fsc.weblaunch": {
+ "source": "iana",
+ "extensions": ["fsc"]
+ },
+ "application/vnd.fujifilm.fb.docuworks": {
+ "source": "iana"
+ },
+ "application/vnd.fujifilm.fb.docuworks.binder": {
+ "source": "iana"
+ },
+ "application/vnd.fujifilm.fb.docuworks.container": {
+ "source": "iana"
+ },
+ "application/vnd.fujifilm.fb.jfi+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.fujitsu.oasys": {
+ "source": "iana",
+ "extensions": ["oas"]
+ },
+ "application/vnd.fujitsu.oasys2": {
+ "source": "iana",
+ "extensions": ["oa2"]
+ },
+ "application/vnd.fujitsu.oasys3": {
+ "source": "iana",
+ "extensions": ["oa3"]
+ },
+ "application/vnd.fujitsu.oasysgp": {
+ "source": "iana",
+ "extensions": ["fg5"]
+ },
+ "application/vnd.fujitsu.oasysprs": {
+ "source": "iana",
+ "extensions": ["bh2"]
+ },
+ "application/vnd.fujixerox.art-ex": {
+ "source": "iana"
+ },
+ "application/vnd.fujixerox.art4": {
+ "source": "iana"
+ },
+ "application/vnd.fujixerox.ddd": {
+ "source": "iana",
+ "extensions": ["ddd"]
+ },
+ "application/vnd.fujixerox.docuworks": {
+ "source": "iana",
+ "extensions": ["xdw"]
+ },
+ "application/vnd.fujixerox.docuworks.binder": {
+ "source": "iana",
+ "extensions": ["xbd"]
+ },
+ "application/vnd.fujixerox.docuworks.container": {
+ "source": "iana"
+ },
+ "application/vnd.fujixerox.hbpl": {
+ "source": "iana"
+ },
+ "application/vnd.fut-misnet": {
+ "source": "iana"
+ },
+ "application/vnd.futoin+cbor": {
+ "source": "iana"
+ },
+ "application/vnd.futoin+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.fuzzysheet": {
+ "source": "iana",
+ "extensions": ["fzs"]
+ },
+ "application/vnd.genomatix.tuxedo": {
+ "source": "iana",
+ "extensions": ["txd"]
+ },
+ "application/vnd.gentics.grd+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.geo+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.geocube+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.geogebra.file": {
+ "source": "iana",
+ "extensions": ["ggb"]
+ },
+ "application/vnd.geogebra.slides": {
+ "source": "iana"
+ },
+ "application/vnd.geogebra.tool": {
+ "source": "iana",
+ "extensions": ["ggt"]
+ },
+ "application/vnd.geometry-explorer": {
+ "source": "iana",
+ "extensions": ["gex","gre"]
+ },
+ "application/vnd.geonext": {
+ "source": "iana",
+ "extensions": ["gxt"]
+ },
+ "application/vnd.geoplan": {
+ "source": "iana",
+ "extensions": ["g2w"]
+ },
+ "application/vnd.geospace": {
+ "source": "iana",
+ "extensions": ["g3w"]
+ },
+ "application/vnd.gerber": {
+ "source": "iana"
+ },
+ "application/vnd.globalplatform.card-content-mgt": {
+ "source": "iana"
+ },
+ "application/vnd.globalplatform.card-content-mgt-response": {
+ "source": "iana"
+ },
+ "application/vnd.gmx": {
+ "source": "iana",
+ "extensions": ["gmx"]
+ },
+ "application/vnd.google-apps.document": {
+ "compressible": false,
+ "extensions": ["gdoc"]
+ },
+ "application/vnd.google-apps.presentation": {
+ "compressible": false,
+ "extensions": ["gslides"]
+ },
+ "application/vnd.google-apps.spreadsheet": {
+ "compressible": false,
+ "extensions": ["gsheet"]
+ },
+ "application/vnd.google-earth.kml+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["kml"]
+ },
+ "application/vnd.google-earth.kmz": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["kmz"]
+ },
+ "application/vnd.gov.sk.e-form+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.gov.sk.e-form+zip": {
+ "source": "iana",
+ "compressible": false
+ },
+ "application/vnd.gov.sk.xmldatacontainer+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.grafeq": {
+ "source": "iana",
+ "extensions": ["gqf","gqs"]
+ },
+ "application/vnd.gridmp": {
+ "source": "iana"
+ },
+ "application/vnd.groove-account": {
+ "source": "iana",
+ "extensions": ["gac"]
+ },
+ "application/vnd.groove-help": {
+ "source": "iana",
+ "extensions": ["ghf"]
+ },
+ "application/vnd.groove-identity-message": {
+ "source": "iana",
+ "extensions": ["gim"]
+ },
+ "application/vnd.groove-injector": {
+ "source": "iana",
+ "extensions": ["grv"]
+ },
+ "application/vnd.groove-tool-message": {
+ "source": "iana",
+ "extensions": ["gtm"]
+ },
+ "application/vnd.groove-tool-template": {
+ "source": "iana",
+ "extensions": ["tpl"]
+ },
+ "application/vnd.groove-vcard": {
+ "source": "iana",
+ "extensions": ["vcg"]
+ },
+ "application/vnd.hal+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.hal+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["hal"]
+ },
+ "application/vnd.handheld-entertainment+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["zmm"]
+ },
+ "application/vnd.hbci": {
+ "source": "iana",
+ "extensions": ["hbci"]
+ },
+ "application/vnd.hc+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.hcl-bireports": {
+ "source": "iana"
+ },
+ "application/vnd.hdt": {
+ "source": "iana"
+ },
+ "application/vnd.heroku+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.hhe.lesson-player": {
+ "source": "iana",
+ "extensions": ["les"]
+ },
+ "application/vnd.hl7cda+xml": {
+ "source": "iana",
+ "charset": "UTF-8",
+ "compressible": true
+ },
+ "application/vnd.hl7v2+xml": {
+ "source": "iana",
+ "charset": "UTF-8",
+ "compressible": true
+ },
+ "application/vnd.hp-hpgl": {
+ "source": "iana",
+ "extensions": ["hpgl"]
+ },
+ "application/vnd.hp-hpid": {
+ "source": "iana",
+ "extensions": ["hpid"]
+ },
+ "application/vnd.hp-hps": {
+ "source": "iana",
+ "extensions": ["hps"]
+ },
+ "application/vnd.hp-jlyt": {
+ "source": "iana",
+ "extensions": ["jlt"]
+ },
+ "application/vnd.hp-pcl": {
+ "source": "iana",
+ "extensions": ["pcl"]
+ },
+ "application/vnd.hp-pclxl": {
+ "source": "iana",
+ "extensions": ["pclxl"]
+ },
+ "application/vnd.httphone": {
+ "source": "iana"
+ },
+ "application/vnd.hydrostatix.sof-data": {
+ "source": "iana",
+ "extensions": ["sfd-hdstx"]
+ },
+ "application/vnd.hyper+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.hyper-item+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.hyperdrive+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.hzn-3d-crossword": {
+ "source": "iana"
+ },
+ "application/vnd.ibm.afplinedata": {
+ "source": "iana"
+ },
+ "application/vnd.ibm.electronic-media": {
+ "source": "iana"
+ },
+ "application/vnd.ibm.minipay": {
+ "source": "iana",
+ "extensions": ["mpy"]
+ },
+ "application/vnd.ibm.modcap": {
+ "source": "iana",
+ "extensions": ["afp","listafp","list3820"]
+ },
+ "application/vnd.ibm.rights-management": {
+ "source": "iana",
+ "extensions": ["irm"]
+ },
+ "application/vnd.ibm.secure-container": {
+ "source": "iana",
+ "extensions": ["sc"]
+ },
+ "application/vnd.iccprofile": {
+ "source": "iana",
+ "extensions": ["icc","icm"]
+ },
+ "application/vnd.ieee.1905": {
+ "source": "iana"
+ },
+ "application/vnd.igloader": {
+ "source": "iana",
+ "extensions": ["igl"]
+ },
+ "application/vnd.imagemeter.folder+zip": {
+ "source": "iana",
+ "compressible": false
+ },
+ "application/vnd.imagemeter.image+zip": {
+ "source": "iana",
+ "compressible": false
+ },
+ "application/vnd.immervision-ivp": {
+ "source": "iana",
+ "extensions": ["ivp"]
+ },
+ "application/vnd.immervision-ivu": {
+ "source": "iana",
+ "extensions": ["ivu"]
+ },
+ "application/vnd.ims.imsccv1p1": {
+ "source": "iana"
+ },
+ "application/vnd.ims.imsccv1p2": {
+ "source": "iana"
+ },
+ "application/vnd.ims.imsccv1p3": {
+ "source": "iana"
+ },
+ "application/vnd.ims.lis.v2.result+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.ims.lti.v2.toolconsumerprofile+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.ims.lti.v2.toolproxy+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.ims.lti.v2.toolproxy.id+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.ims.lti.v2.toolsettings+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.ims.lti.v2.toolsettings.simple+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.informedcontrol.rms+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.informix-visionary": {
+ "source": "iana"
+ },
+ "application/vnd.infotech.project": {
+ "source": "iana"
+ },
+ "application/vnd.infotech.project+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.innopath.wamp.notification": {
+ "source": "iana"
+ },
+ "application/vnd.insors.igm": {
+ "source": "iana",
+ "extensions": ["igm"]
+ },
+ "application/vnd.intercon.formnet": {
+ "source": "iana",
+ "extensions": ["xpw","xpx"]
+ },
+ "application/vnd.intergeo": {
+ "source": "iana",
+ "extensions": ["i2g"]
+ },
+ "application/vnd.intertrust.digibox": {
+ "source": "iana"
+ },
+ "application/vnd.intertrust.nncp": {
+ "source": "iana"
+ },
+ "application/vnd.intu.qbo": {
+ "source": "iana",
+ "extensions": ["qbo"]
+ },
+ "application/vnd.intu.qfx": {
+ "source": "iana",
+ "extensions": ["qfx"]
+ },
+ "application/vnd.iptc.g2.catalogitem+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.iptc.g2.conceptitem+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.iptc.g2.knowledgeitem+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.iptc.g2.newsitem+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.iptc.g2.newsmessage+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.iptc.g2.packageitem+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.iptc.g2.planningitem+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.ipunplugged.rcprofile": {
+ "source": "iana",
+ "extensions": ["rcprofile"]
+ },
+ "application/vnd.irepository.package+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["irp"]
+ },
+ "application/vnd.is-xpr": {
+ "source": "iana",
+ "extensions": ["xpr"]
+ },
+ "application/vnd.isac.fcs": {
+ "source": "iana",
+ "extensions": ["fcs"]
+ },
+ "application/vnd.iso11783-10+zip": {
+ "source": "iana",
+ "compressible": false
+ },
+ "application/vnd.jam": {
+ "source": "iana",
+ "extensions": ["jam"]
+ },
+ "application/vnd.japannet-directory-service": {
+ "source": "iana"
+ },
+ "application/vnd.japannet-jpnstore-wakeup": {
+ "source": "iana"
+ },
+ "application/vnd.japannet-payment-wakeup": {
+ "source": "iana"
+ },
+ "application/vnd.japannet-registration": {
+ "source": "iana"
+ },
+ "application/vnd.japannet-registration-wakeup": {
+ "source": "iana"
+ },
+ "application/vnd.japannet-setstore-wakeup": {
+ "source": "iana"
+ },
+ "application/vnd.japannet-verification": {
+ "source": "iana"
+ },
+ "application/vnd.japannet-verification-wakeup": {
+ "source": "iana"
+ },
+ "application/vnd.jcp.javame.midlet-rms": {
+ "source": "iana",
+ "extensions": ["rms"]
+ },
+ "application/vnd.jisp": {
+ "source": "iana",
+ "extensions": ["jisp"]
+ },
+ "application/vnd.joost.joda-archive": {
+ "source": "iana",
+ "extensions": ["joda"]
+ },
+ "application/vnd.jsk.isdn-ngn": {
+ "source": "iana"
+ },
+ "application/vnd.kahootz": {
+ "source": "iana",
+ "extensions": ["ktz","ktr"]
+ },
+ "application/vnd.kde.karbon": {
+ "source": "iana",
+ "extensions": ["karbon"]
+ },
+ "application/vnd.kde.kchart": {
+ "source": "iana",
+ "extensions": ["chrt"]
+ },
+ "application/vnd.kde.kformula": {
+ "source": "iana",
+ "extensions": ["kfo"]
+ },
+ "application/vnd.kde.kivio": {
+ "source": "iana",
+ "extensions": ["flw"]
+ },
+ "application/vnd.kde.kontour": {
+ "source": "iana",
+ "extensions": ["kon"]
+ },
+ "application/vnd.kde.kpresenter": {
+ "source": "iana",
+ "extensions": ["kpr","kpt"]
+ },
+ "application/vnd.kde.kspread": {
+ "source": "iana",
+ "extensions": ["ksp"]
+ },
+ "application/vnd.kde.kword": {
+ "source": "iana",
+ "extensions": ["kwd","kwt"]
+ },
+ "application/vnd.kenameaapp": {
+ "source": "iana",
+ "extensions": ["htke"]
+ },
+ "application/vnd.kidspiration": {
+ "source": "iana",
+ "extensions": ["kia"]
+ },
+ "application/vnd.kinar": {
+ "source": "iana",
+ "extensions": ["kne","knp"]
+ },
+ "application/vnd.koan": {
+ "source": "iana",
+ "extensions": ["skp","skd","skt","skm"]
+ },
+ "application/vnd.kodak-descriptor": {
+ "source": "iana",
+ "extensions": ["sse"]
+ },
+ "application/vnd.las": {
+ "source": "iana"
+ },
+ "application/vnd.las.las+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.las.las+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["lasxml"]
+ },
+ "application/vnd.laszip": {
+ "source": "iana"
+ },
+ "application/vnd.leap+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.liberty-request+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.llamagraphics.life-balance.desktop": {
+ "source": "iana",
+ "extensions": ["lbd"]
+ },
+ "application/vnd.llamagraphics.life-balance.exchange+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["lbe"]
+ },
+ "application/vnd.logipipe.circuit+zip": {
+ "source": "iana",
+ "compressible": false
+ },
+ "application/vnd.loom": {
+ "source": "iana"
+ },
+ "application/vnd.lotus-1-2-3": {
+ "source": "iana",
+ "extensions": ["123"]
+ },
+ "application/vnd.lotus-approach": {
+ "source": "iana",
+ "extensions": ["apr"]
+ },
+ "application/vnd.lotus-freelance": {
+ "source": "iana",
+ "extensions": ["pre"]
+ },
+ "application/vnd.lotus-notes": {
+ "source": "iana",
+ "extensions": ["nsf"]
+ },
+ "application/vnd.lotus-organizer": {
+ "source": "iana",
+ "extensions": ["org"]
+ },
+ "application/vnd.lotus-screencam": {
+ "source": "iana",
+ "extensions": ["scm"]
+ },
+ "application/vnd.lotus-wordpro": {
+ "source": "iana",
+ "extensions": ["lwp"]
+ },
+ "application/vnd.macports.portpkg": {
+ "source": "iana",
+ "extensions": ["portpkg"]
+ },
+ "application/vnd.mapbox-vector-tile": {
+ "source": "iana",
+ "extensions": ["mvt"]
+ },
+ "application/vnd.marlin.drm.actiontoken+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.marlin.drm.conftoken+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.marlin.drm.license+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.marlin.drm.mdcf": {
+ "source": "iana"
+ },
+ "application/vnd.mason+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.maxar.archive.3tz+zip": {
+ "source": "iana",
+ "compressible": false
+ },
+ "application/vnd.maxmind.maxmind-db": {
+ "source": "iana"
+ },
+ "application/vnd.mcd": {
+ "source": "iana",
+ "extensions": ["mcd"]
+ },
+ "application/vnd.medcalcdata": {
+ "source": "iana",
+ "extensions": ["mc1"]
+ },
+ "application/vnd.mediastation.cdkey": {
+ "source": "iana",
+ "extensions": ["cdkey"]
+ },
+ "application/vnd.meridian-slingshot": {
+ "source": "iana"
+ },
+ "application/vnd.mfer": {
+ "source": "iana",
+ "extensions": ["mwf"]
+ },
+ "application/vnd.mfmp": {
+ "source": "iana",
+ "extensions": ["mfm"]
+ },
+ "application/vnd.micro+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.micrografx.flo": {
+ "source": "iana",
+ "extensions": ["flo"]
+ },
+ "application/vnd.micrografx.igx": {
+ "source": "iana",
+ "extensions": ["igx"]
+ },
+ "application/vnd.microsoft.portable-executable": {
+ "source": "iana"
+ },
+ "application/vnd.microsoft.windows.thumbnail-cache": {
+ "source": "iana"
+ },
+ "application/vnd.miele+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.mif": {
+ "source": "iana",
+ "extensions": ["mif"]
+ },
+ "application/vnd.minisoft-hp3000-save": {
+ "source": "iana"
+ },
+ "application/vnd.mitsubishi.misty-guard.trustweb": {
+ "source": "iana"
+ },
+ "application/vnd.mobius.daf": {
+ "source": "iana",
+ "extensions": ["daf"]
+ },
+ "application/vnd.mobius.dis": {
+ "source": "iana",
+ "extensions": ["dis"]
+ },
+ "application/vnd.mobius.mbk": {
+ "source": "iana",
+ "extensions": ["mbk"]
+ },
+ "application/vnd.mobius.mqy": {
+ "source": "iana",
+ "extensions": ["mqy"]
+ },
+ "application/vnd.mobius.msl": {
+ "source": "iana",
+ "extensions": ["msl"]
+ },
+ "application/vnd.mobius.plc": {
+ "source": "iana",
+ "extensions": ["plc"]
+ },
+ "application/vnd.mobius.txf": {
+ "source": "iana",
+ "extensions": ["txf"]
+ },
+ "application/vnd.mophun.application": {
+ "source": "iana",
+ "extensions": ["mpn"]
+ },
+ "application/vnd.mophun.certificate": {
+ "source": "iana",
+ "extensions": ["mpc"]
+ },
+ "application/vnd.motorola.flexsuite": {
+ "source": "iana"
+ },
+ "application/vnd.motorola.flexsuite.adsi": {
+ "source": "iana"
+ },
+ "application/vnd.motorola.flexsuite.fis": {
+ "source": "iana"
+ },
+ "application/vnd.motorola.flexsuite.gotap": {
+ "source": "iana"
+ },
+ "application/vnd.motorola.flexsuite.kmr": {
+ "source": "iana"
+ },
+ "application/vnd.motorola.flexsuite.ttc": {
+ "source": "iana"
+ },
+ "application/vnd.motorola.flexsuite.wem": {
+ "source": "iana"
+ },
+ "application/vnd.motorola.iprm": {
+ "source": "iana"
+ },
+ "application/vnd.mozilla.xul+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["xul"]
+ },
+ "application/vnd.ms-3mfdocument": {
+ "source": "iana"
+ },
+ "application/vnd.ms-artgalry": {
+ "source": "iana",
+ "extensions": ["cil"]
+ },
+ "application/vnd.ms-asf": {
+ "source": "iana"
+ },
+ "application/vnd.ms-cab-compressed": {
+ "source": "iana",
+ "extensions": ["cab"]
+ },
+ "application/vnd.ms-color.iccprofile": {
+ "source": "apache"
+ },
+ "application/vnd.ms-excel": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["xls","xlm","xla","xlc","xlt","xlw"]
+ },
+ "application/vnd.ms-excel.addin.macroenabled.12": {
+ "source": "iana",
+ "extensions": ["xlam"]
+ },
+ "application/vnd.ms-excel.sheet.binary.macroenabled.12": {
+ "source": "iana",
+ "extensions": ["xlsb"]
+ },
+ "application/vnd.ms-excel.sheet.macroenabled.12": {
+ "source": "iana",
+ "extensions": ["xlsm"]
+ },
+ "application/vnd.ms-excel.template.macroenabled.12": {
+ "source": "iana",
+ "extensions": ["xltm"]
+ },
+ "application/vnd.ms-fontobject": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["eot"]
+ },
+ "application/vnd.ms-htmlhelp": {
+ "source": "iana",
+ "extensions": ["chm"]
+ },
+ "application/vnd.ms-ims": {
+ "source": "iana",
+ "extensions": ["ims"]
+ },
+ "application/vnd.ms-lrm": {
+ "source": "iana",
+ "extensions": ["lrm"]
+ },
+ "application/vnd.ms-office.activex+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.ms-officetheme": {
+ "source": "iana",
+ "extensions": ["thmx"]
+ },
+ "application/vnd.ms-opentype": {
+ "source": "apache",
+ "compressible": true
+ },
+ "application/vnd.ms-outlook": {
+ "compressible": false,
+ "extensions": ["msg"]
+ },
+ "application/vnd.ms-package.obfuscated-opentype": {
+ "source": "apache"
+ },
+ "application/vnd.ms-pki.seccat": {
+ "source": "apache",
+ "extensions": ["cat"]
+ },
+ "application/vnd.ms-pki.stl": {
+ "source": "apache",
+ "extensions": ["stl"]
+ },
+ "application/vnd.ms-playready.initiator+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.ms-powerpoint": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["ppt","pps","pot"]
+ },
+ "application/vnd.ms-powerpoint.addin.macroenabled.12": {
+ "source": "iana",
+ "extensions": ["ppam"]
+ },
+ "application/vnd.ms-powerpoint.presentation.macroenabled.12": {
+ "source": "iana",
+ "extensions": ["pptm"]
+ },
+ "application/vnd.ms-powerpoint.slide.macroenabled.12": {
+ "source": "iana",
+ "extensions": ["sldm"]
+ },
+ "application/vnd.ms-powerpoint.slideshow.macroenabled.12": {
+ "source": "iana",
+ "extensions": ["ppsm"]
+ },
+ "application/vnd.ms-powerpoint.template.macroenabled.12": {
+ "source": "iana",
+ "extensions": ["potm"]
+ },
+ "application/vnd.ms-printdevicecapabilities+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.ms-printing.printticket+xml": {
+ "source": "apache",
+ "compressible": true
+ },
+ "application/vnd.ms-printschematicket+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.ms-project": {
+ "source": "iana",
+ "extensions": ["mpp","mpt"]
+ },
+ "application/vnd.ms-tnef": {
+ "source": "iana"
+ },
+ "application/vnd.ms-windows.devicepairing": {
+ "source": "iana"
+ },
+ "application/vnd.ms-windows.nwprinting.oob": {
+ "source": "iana"
+ },
+ "application/vnd.ms-windows.printerpairing": {
+ "source": "iana"
+ },
+ "application/vnd.ms-windows.wsd.oob": {
+ "source": "iana"
+ },
+ "application/vnd.ms-wmdrm.lic-chlg-req": {
+ "source": "iana"
+ },
+ "application/vnd.ms-wmdrm.lic-resp": {
+ "source": "iana"
+ },
+ "application/vnd.ms-wmdrm.meter-chlg-req": {
+ "source": "iana"
+ },
+ "application/vnd.ms-wmdrm.meter-resp": {
+ "source": "iana"
+ },
+ "application/vnd.ms-word.document.macroenabled.12": {
+ "source": "iana",
+ "extensions": ["docm"]
+ },
+ "application/vnd.ms-word.template.macroenabled.12": {
+ "source": "iana",
+ "extensions": ["dotm"]
+ },
+ "application/vnd.ms-works": {
+ "source": "iana",
+ "extensions": ["wps","wks","wcm","wdb"]
+ },
+ "application/vnd.ms-wpl": {
+ "source": "iana",
+ "extensions": ["wpl"]
+ },
+ "application/vnd.ms-xpsdocument": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["xps"]
+ },
+ "application/vnd.msa-disk-image": {
+ "source": "iana"
+ },
+ "application/vnd.mseq": {
+ "source": "iana",
+ "extensions": ["mseq"]
+ },
+ "application/vnd.msign": {
+ "source": "iana"
+ },
+ "application/vnd.multiad.creator": {
+ "source": "iana"
+ },
+ "application/vnd.multiad.creator.cif": {
+ "source": "iana"
+ },
+ "application/vnd.music-niff": {
+ "source": "iana"
+ },
+ "application/vnd.musician": {
+ "source": "iana",
+ "extensions": ["mus"]
+ },
+ "application/vnd.muvee.style": {
+ "source": "iana",
+ "extensions": ["msty"]
+ },
+ "application/vnd.mynfc": {
+ "source": "iana",
+ "extensions": ["taglet"]
+ },
+ "application/vnd.nacamar.ybrid+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.ncd.control": {
+ "source": "iana"
+ },
+ "application/vnd.ncd.reference": {
+ "source": "iana"
+ },
+ "application/vnd.nearst.inv+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.nebumind.line": {
+ "source": "iana"
+ },
+ "application/vnd.nervana": {
+ "source": "iana"
+ },
+ "application/vnd.netfpx": {
+ "source": "iana"
+ },
+ "application/vnd.neurolanguage.nlu": {
+ "source": "iana",
+ "extensions": ["nlu"]
+ },
+ "application/vnd.nimn": {
+ "source": "iana"
+ },
+ "application/vnd.nintendo.nitro.rom": {
+ "source": "iana"
+ },
+ "application/vnd.nintendo.snes.rom": {
+ "source": "iana"
+ },
+ "application/vnd.nitf": {
+ "source": "iana",
+ "extensions": ["ntf","nitf"]
+ },
+ "application/vnd.noblenet-directory": {
+ "source": "iana",
+ "extensions": ["nnd"]
+ },
+ "application/vnd.noblenet-sealer": {
+ "source": "iana",
+ "extensions": ["nns"]
+ },
+ "application/vnd.noblenet-web": {
+ "source": "iana",
+ "extensions": ["nnw"]
+ },
+ "application/vnd.nokia.catalogs": {
+ "source": "iana"
+ },
+ "application/vnd.nokia.conml+wbxml": {
+ "source": "iana"
+ },
+ "application/vnd.nokia.conml+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.nokia.iptv.config+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.nokia.isds-radio-presets": {
+ "source": "iana"
+ },
+ "application/vnd.nokia.landmark+wbxml": {
+ "source": "iana"
+ },
+ "application/vnd.nokia.landmark+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.nokia.landmarkcollection+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.nokia.n-gage.ac+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["ac"]
+ },
+ "application/vnd.nokia.n-gage.data": {
+ "source": "iana",
+ "extensions": ["ngdat"]
+ },
+ "application/vnd.nokia.n-gage.symbian.install": {
+ "source": "iana",
+ "extensions": ["n-gage"]
+ },
+ "application/vnd.nokia.ncd": {
+ "source": "iana"
+ },
+ "application/vnd.nokia.pcd+wbxml": {
+ "source": "iana"
+ },
+ "application/vnd.nokia.pcd+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.nokia.radio-preset": {
+ "source": "iana",
+ "extensions": ["rpst"]
+ },
+ "application/vnd.nokia.radio-presets": {
+ "source": "iana",
+ "extensions": ["rpss"]
+ },
+ "application/vnd.novadigm.edm": {
+ "source": "iana",
+ "extensions": ["edm"]
+ },
+ "application/vnd.novadigm.edx": {
+ "source": "iana",
+ "extensions": ["edx"]
+ },
+ "application/vnd.novadigm.ext": {
+ "source": "iana",
+ "extensions": ["ext"]
+ },
+ "application/vnd.ntt-local.content-share": {
+ "source": "iana"
+ },
+ "application/vnd.ntt-local.file-transfer": {
+ "source": "iana"
+ },
+ "application/vnd.ntt-local.ogw_remote-access": {
+ "source": "iana"
+ },
+ "application/vnd.ntt-local.sip-ta_remote": {
+ "source": "iana"
+ },
+ "application/vnd.ntt-local.sip-ta_tcp_stream": {
+ "source": "iana"
+ },
+ "application/vnd.oasis.opendocument.chart": {
+ "source": "iana",
+ "extensions": ["odc"]
+ },
+ "application/vnd.oasis.opendocument.chart-template": {
+ "source": "iana",
+ "extensions": ["otc"]
+ },
+ "application/vnd.oasis.opendocument.database": {
+ "source": "iana",
+ "extensions": ["odb"]
+ },
+ "application/vnd.oasis.opendocument.formula": {
+ "source": "iana",
+ "extensions": ["odf"]
+ },
+ "application/vnd.oasis.opendocument.formula-template": {
+ "source": "iana",
+ "extensions": ["odft"]
+ },
+ "application/vnd.oasis.opendocument.graphics": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["odg"]
+ },
+ "application/vnd.oasis.opendocument.graphics-template": {
+ "source": "iana",
+ "extensions": ["otg"]
+ },
+ "application/vnd.oasis.opendocument.image": {
+ "source": "iana",
+ "extensions": ["odi"]
+ },
+ "application/vnd.oasis.opendocument.image-template": {
+ "source": "iana",
+ "extensions": ["oti"]
+ },
+ "application/vnd.oasis.opendocument.presentation": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["odp"]
+ },
+ "application/vnd.oasis.opendocument.presentation-template": {
+ "source": "iana",
+ "extensions": ["otp"]
+ },
+ "application/vnd.oasis.opendocument.spreadsheet": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["ods"]
+ },
+ "application/vnd.oasis.opendocument.spreadsheet-template": {
+ "source": "iana",
+ "extensions": ["ots"]
+ },
+ "application/vnd.oasis.opendocument.text": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["odt"]
+ },
+ "application/vnd.oasis.opendocument.text-master": {
+ "source": "iana",
+ "extensions": ["odm"]
+ },
+ "application/vnd.oasis.opendocument.text-template": {
+ "source": "iana",
+ "extensions": ["ott"]
+ },
+ "application/vnd.oasis.opendocument.text-web": {
+ "source": "iana",
+ "extensions": ["oth"]
+ },
+ "application/vnd.obn": {
+ "source": "iana"
+ },
+ "application/vnd.ocf+cbor": {
+ "source": "iana"
+ },
+ "application/vnd.oci.image.manifest.v1+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.oftn.l10n+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.oipf.contentaccessdownload+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.oipf.contentaccessstreaming+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.oipf.cspg-hexbinary": {
+ "source": "iana"
+ },
+ "application/vnd.oipf.dae.svg+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.oipf.dae.xhtml+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.oipf.mippvcontrolmessage+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.oipf.pae.gem": {
+ "source": "iana"
+ },
+ "application/vnd.oipf.spdiscovery+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.oipf.spdlist+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.oipf.ueprofile+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.oipf.userprofile+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.olpc-sugar": {
+ "source": "iana",
+ "extensions": ["xo"]
+ },
+ "application/vnd.oma-scws-config": {
+ "source": "iana"
+ },
+ "application/vnd.oma-scws-http-request": {
+ "source": "iana"
+ },
+ "application/vnd.oma-scws-http-response": {
+ "source": "iana"
+ },
+ "application/vnd.oma.bcast.associated-procedure-parameter+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.oma.bcast.drm-trigger+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.oma.bcast.imd+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.oma.bcast.ltkm": {
+ "source": "iana"
+ },
+ "application/vnd.oma.bcast.notification+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.oma.bcast.provisioningtrigger": {
+ "source": "iana"
+ },
+ "application/vnd.oma.bcast.sgboot": {
+ "source": "iana"
+ },
+ "application/vnd.oma.bcast.sgdd+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.oma.bcast.sgdu": {
+ "source": "iana"
+ },
+ "application/vnd.oma.bcast.simple-symbol-container": {
+ "source": "iana"
+ },
+ "application/vnd.oma.bcast.smartcard-trigger+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.oma.bcast.sprov+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.oma.bcast.stkm": {
+ "source": "iana"
+ },
+ "application/vnd.oma.cab-address-book+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.oma.cab-feature-handler+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.oma.cab-pcc+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.oma.cab-subs-invite+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.oma.cab-user-prefs+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.oma.dcd": {
+ "source": "iana"
+ },
+ "application/vnd.oma.dcdc": {
+ "source": "iana"
+ },
+ "application/vnd.oma.dd2+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["dd2"]
+ },
+ "application/vnd.oma.drm.risd+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.oma.group-usage-list+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.oma.lwm2m+cbor": {
+ "source": "iana"
+ },
+ "application/vnd.oma.lwm2m+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.oma.lwm2m+tlv": {
+ "source": "iana"
+ },
+ "application/vnd.oma.pal+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.oma.poc.detailed-progress-report+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.oma.poc.final-report+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.oma.poc.groups+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.oma.poc.invocation-descriptor+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.oma.poc.optimized-progress-report+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.oma.push": {
+ "source": "iana"
+ },
+ "application/vnd.oma.scidm.messages+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.oma.xcap-directory+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.omads-email+xml": {
+ "source": "iana",
+ "charset": "UTF-8",
+ "compressible": true
+ },
+ "application/vnd.omads-file+xml": {
+ "source": "iana",
+ "charset": "UTF-8",
+ "compressible": true
+ },
+ "application/vnd.omads-folder+xml": {
+ "source": "iana",
+ "charset": "UTF-8",
+ "compressible": true
+ },
+ "application/vnd.omaloc-supl-init": {
+ "source": "iana"
+ },
+ "application/vnd.onepager": {
+ "source": "iana"
+ },
+ "application/vnd.onepagertamp": {
+ "source": "iana"
+ },
+ "application/vnd.onepagertamx": {
+ "source": "iana"
+ },
+ "application/vnd.onepagertat": {
+ "source": "iana"
+ },
+ "application/vnd.onepagertatp": {
+ "source": "iana"
+ },
+ "application/vnd.onepagertatx": {
+ "source": "iana"
+ },
+ "application/vnd.openblox.game+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["obgx"]
+ },
+ "application/vnd.openblox.game-binary": {
+ "source": "iana"
+ },
+ "application/vnd.openeye.oeb": {
+ "source": "iana"
+ },
+ "application/vnd.openofficeorg.extension": {
+ "source": "apache",
+ "extensions": ["oxt"]
+ },
+ "application/vnd.openstreetmap.data+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["osm"]
+ },
+ "application/vnd.opentimestamps.ots": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.custom-properties+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.customxmlproperties+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.drawing+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.drawingml.chart+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.extended-properties+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml.comments+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml.presentation": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["pptx"]
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml.presprops+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml.slide": {
+ "source": "iana",
+ "extensions": ["sldx"]
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml.slide+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml.slideshow": {
+ "source": "iana",
+ "extensions": ["ppsx"]
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml.tags+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml.template": {
+ "source": "iana",
+ "extensions": ["potx"]
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml.template.main+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["xlsx"]
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.template": {
+ "source": "iana",
+ "extensions": ["xltx"]
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.theme+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.themeoverride+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.vmldrawing": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.document": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["docx"]
+ },
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.template": {
+ "source": "iana",
+ "extensions": ["dotx"]
+ },
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-package.core-properties+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.openxmlformats-package.relationships+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.oracle.resource+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.orange.indata": {
+ "source": "iana"
+ },
+ "application/vnd.osa.netdeploy": {
+ "source": "iana"
+ },
+ "application/vnd.osgeo.mapguide.package": {
+ "source": "iana",
+ "extensions": ["mgp"]
+ },
+ "application/vnd.osgi.bundle": {
+ "source": "iana"
+ },
+ "application/vnd.osgi.dp": {
+ "source": "iana",
+ "extensions": ["dp"]
+ },
+ "application/vnd.osgi.subsystem": {
+ "source": "iana",
+ "extensions": ["esa"]
+ },
+ "application/vnd.otps.ct-kip+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.oxli.countgraph": {
+ "source": "iana"
+ },
+ "application/vnd.pagerduty+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.palm": {
+ "source": "iana",
+ "extensions": ["pdb","pqa","oprc"]
+ },
+ "application/vnd.panoply": {
+ "source": "iana"
+ },
+ "application/vnd.paos.xml": {
+ "source": "iana"
+ },
+ "application/vnd.patentdive": {
+ "source": "iana"
+ },
+ "application/vnd.patientecommsdoc": {
+ "source": "iana"
+ },
+ "application/vnd.pawaafile": {
+ "source": "iana",
+ "extensions": ["paw"]
+ },
+ "application/vnd.pcos": {
+ "source": "iana"
+ },
+ "application/vnd.pg.format": {
+ "source": "iana",
+ "extensions": ["str"]
+ },
+ "application/vnd.pg.osasli": {
+ "source": "iana",
+ "extensions": ["ei6"]
+ },
+ "application/vnd.piaccess.application-licence": {
+ "source": "iana"
+ },
+ "application/vnd.picsel": {
+ "source": "iana",
+ "extensions": ["efif"]
+ },
+ "application/vnd.pmi.widget": {
+ "source": "iana",
+ "extensions": ["wg"]
+ },
+ "application/vnd.poc.group-advertisement+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.pocketlearn": {
+ "source": "iana",
+ "extensions": ["plf"]
+ },
+ "application/vnd.powerbuilder6": {
+ "source": "iana",
+ "extensions": ["pbd"]
+ },
+ "application/vnd.powerbuilder6-s": {
+ "source": "iana"
+ },
+ "application/vnd.powerbuilder7": {
+ "source": "iana"
+ },
+ "application/vnd.powerbuilder7-s": {
+ "source": "iana"
+ },
+ "application/vnd.powerbuilder75": {
+ "source": "iana"
+ },
+ "application/vnd.powerbuilder75-s": {
+ "source": "iana"
+ },
+ "application/vnd.preminet": {
+ "source": "iana"
+ },
+ "application/vnd.previewsystems.box": {
+ "source": "iana",
+ "extensions": ["box"]
+ },
+ "application/vnd.proteus.magazine": {
+ "source": "iana",
+ "extensions": ["mgz"]
+ },
+ "application/vnd.psfs": {
+ "source": "iana"
+ },
+ "application/vnd.publishare-delta-tree": {
+ "source": "iana",
+ "extensions": ["qps"]
+ },
+ "application/vnd.pvi.ptid1": {
+ "source": "iana",
+ "extensions": ["ptid"]
+ },
+ "application/vnd.pwg-multiplexed": {
+ "source": "iana"
+ },
+ "application/vnd.pwg-xhtml-print+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.qualcomm.brew-app-res": {
+ "source": "iana"
+ },
+ "application/vnd.quarantainenet": {
+ "source": "iana"
+ },
+ "application/vnd.quark.quarkxpress": {
+ "source": "iana",
+ "extensions": ["qxd","qxt","qwd","qwt","qxl","qxb"]
+ },
+ "application/vnd.quobject-quoxdocument": {
+ "source": "iana"
+ },
+ "application/vnd.radisys.moml+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.radisys.msml+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.radisys.msml-audit+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.radisys.msml-audit-conf+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.radisys.msml-audit-conn+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.radisys.msml-audit-dialog+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.radisys.msml-audit-stream+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.radisys.msml-conf+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.radisys.msml-dialog+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.radisys.msml-dialog-base+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.radisys.msml-dialog-fax-detect+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.radisys.msml-dialog-fax-sendrecv+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.radisys.msml-dialog-group+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.radisys.msml-dialog-speech+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.radisys.msml-dialog-transform+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.rainstor.data": {
+ "source": "iana"
+ },
+ "application/vnd.rapid": {
+ "source": "iana"
+ },
+ "application/vnd.rar": {
+ "source": "iana",
+ "extensions": ["rar"]
+ },
+ "application/vnd.realvnc.bed": {
+ "source": "iana",
+ "extensions": ["bed"]
+ },
+ "application/vnd.recordare.musicxml": {
+ "source": "iana",
+ "extensions": ["mxl"]
+ },
+ "application/vnd.recordare.musicxml+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["musicxml"]
+ },
+ "application/vnd.renlearn.rlprint": {
+ "source": "iana"
+ },
+ "application/vnd.resilient.logic": {
+ "source": "iana"
+ },
+ "application/vnd.restful+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.rig.cryptonote": {
+ "source": "iana",
+ "extensions": ["cryptonote"]
+ },
+ "application/vnd.rim.cod": {
+ "source": "apache",
+ "extensions": ["cod"]
+ },
+ "application/vnd.rn-realmedia": {
+ "source": "apache",
+ "extensions": ["rm"]
+ },
+ "application/vnd.rn-realmedia-vbr": {
+ "source": "apache",
+ "extensions": ["rmvb"]
+ },
+ "application/vnd.route66.link66+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["link66"]
+ },
+ "application/vnd.rs-274x": {
+ "source": "iana"
+ },
+ "application/vnd.ruckus.download": {
+ "source": "iana"
+ },
+ "application/vnd.s3sms": {
+ "source": "iana"
+ },
+ "application/vnd.sailingtracker.track": {
+ "source": "iana",
+ "extensions": ["st"]
+ },
+ "application/vnd.sar": {
+ "source": "iana"
+ },
+ "application/vnd.sbm.cid": {
+ "source": "iana"
+ },
+ "application/vnd.sbm.mid2": {
+ "source": "iana"
+ },
+ "application/vnd.scribus": {
+ "source": "iana"
+ },
+ "application/vnd.sealed.3df": {
+ "source": "iana"
+ },
+ "application/vnd.sealed.csf": {
+ "source": "iana"
+ },
+ "application/vnd.sealed.doc": {
+ "source": "iana"
+ },
+ "application/vnd.sealed.eml": {
+ "source": "iana"
+ },
+ "application/vnd.sealed.mht": {
+ "source": "iana"
+ },
+ "application/vnd.sealed.net": {
+ "source": "iana"
+ },
+ "application/vnd.sealed.ppt": {
+ "source": "iana"
+ },
+ "application/vnd.sealed.tiff": {
+ "source": "iana"
+ },
+ "application/vnd.sealed.xls": {
+ "source": "iana"
+ },
+ "application/vnd.sealedmedia.softseal.html": {
+ "source": "iana"
+ },
+ "application/vnd.sealedmedia.softseal.pdf": {
+ "source": "iana"
+ },
+ "application/vnd.seemail": {
+ "source": "iana",
+ "extensions": ["see"]
+ },
+ "application/vnd.seis+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.sema": {
+ "source": "iana",
+ "extensions": ["sema"]
+ },
+ "application/vnd.semd": {
+ "source": "iana",
+ "extensions": ["semd"]
+ },
+ "application/vnd.semf": {
+ "source": "iana",
+ "extensions": ["semf"]
+ },
+ "application/vnd.shade-save-file": {
+ "source": "iana"
+ },
+ "application/vnd.shana.informed.formdata": {
+ "source": "iana",
+ "extensions": ["ifm"]
+ },
+ "application/vnd.shana.informed.formtemplate": {
+ "source": "iana",
+ "extensions": ["itp"]
+ },
+ "application/vnd.shana.informed.interchange": {
+ "source": "iana",
+ "extensions": ["iif"]
+ },
+ "application/vnd.shana.informed.package": {
+ "source": "iana",
+ "extensions": ["ipk"]
+ },
+ "application/vnd.shootproof+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.shopkick+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.shp": {
+ "source": "iana"
+ },
+ "application/vnd.shx": {
+ "source": "iana"
+ },
+ "application/vnd.sigrok.session": {
+ "source": "iana"
+ },
+ "application/vnd.simtech-mindmapper": {
+ "source": "iana",
+ "extensions": ["twd","twds"]
+ },
+ "application/vnd.siren+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.smaf": {
+ "source": "iana",
+ "extensions": ["mmf"]
+ },
+ "application/vnd.smart.notebook": {
+ "source": "iana"
+ },
+ "application/vnd.smart.teacher": {
+ "source": "iana",
+ "extensions": ["teacher"]
+ },
+ "application/vnd.snesdev-page-table": {
+ "source": "iana"
+ },
+ "application/vnd.software602.filler.form+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["fo"]
+ },
+ "application/vnd.software602.filler.form-xml-zip": {
+ "source": "iana"
+ },
+ "application/vnd.solent.sdkm+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["sdkm","sdkd"]
+ },
+ "application/vnd.spotfire.dxp": {
+ "source": "iana",
+ "extensions": ["dxp"]
+ },
+ "application/vnd.spotfire.sfs": {
+ "source": "iana",
+ "extensions": ["sfs"]
+ },
+ "application/vnd.sqlite3": {
+ "source": "iana"
+ },
+ "application/vnd.sss-cod": {
+ "source": "iana"
+ },
+ "application/vnd.sss-dtf": {
+ "source": "iana"
+ },
+ "application/vnd.sss-ntf": {
+ "source": "iana"
+ },
+ "application/vnd.stardivision.calc": {
+ "source": "apache",
+ "extensions": ["sdc"]
+ },
+ "application/vnd.stardivision.draw": {
+ "source": "apache",
+ "extensions": ["sda"]
+ },
+ "application/vnd.stardivision.impress": {
+ "source": "apache",
+ "extensions": ["sdd"]
+ },
+ "application/vnd.stardivision.math": {
+ "source": "apache",
+ "extensions": ["smf"]
+ },
+ "application/vnd.stardivision.writer": {
+ "source": "apache",
+ "extensions": ["sdw","vor"]
+ },
+ "application/vnd.stardivision.writer-global": {
+ "source": "apache",
+ "extensions": ["sgl"]
+ },
+ "application/vnd.stepmania.package": {
+ "source": "iana",
+ "extensions": ["smzip"]
+ },
+ "application/vnd.stepmania.stepchart": {
+ "source": "iana",
+ "extensions": ["sm"]
+ },
+ "application/vnd.street-stream": {
+ "source": "iana"
+ },
+ "application/vnd.sun.wadl+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["wadl"]
+ },
+ "application/vnd.sun.xml.calc": {
+ "source": "apache",
+ "extensions": ["sxc"]
+ },
+ "application/vnd.sun.xml.calc.template": {
+ "source": "apache",
+ "extensions": ["stc"]
+ },
+ "application/vnd.sun.xml.draw": {
+ "source": "apache",
+ "extensions": ["sxd"]
+ },
+ "application/vnd.sun.xml.draw.template": {
+ "source": "apache",
+ "extensions": ["std"]
+ },
+ "application/vnd.sun.xml.impress": {
+ "source": "apache",
+ "extensions": ["sxi"]
+ },
+ "application/vnd.sun.xml.impress.template": {
+ "source": "apache",
+ "extensions": ["sti"]
+ },
+ "application/vnd.sun.xml.math": {
+ "source": "apache",
+ "extensions": ["sxm"]
+ },
+ "application/vnd.sun.xml.writer": {
+ "source": "apache",
+ "extensions": ["sxw"]
+ },
+ "application/vnd.sun.xml.writer.global": {
+ "source": "apache",
+ "extensions": ["sxg"]
+ },
+ "application/vnd.sun.xml.writer.template": {
+ "source": "apache",
+ "extensions": ["stw"]
+ },
+ "application/vnd.sus-calendar": {
+ "source": "iana",
+ "extensions": ["sus","susp"]
+ },
+ "application/vnd.svd": {
+ "source": "iana",
+ "extensions": ["svd"]
+ },
+ "application/vnd.swiftview-ics": {
+ "source": "iana"
+ },
+ "application/vnd.sycle+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.syft+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.symbian.install": {
+ "source": "apache",
+ "extensions": ["sis","sisx"]
+ },
+ "application/vnd.syncml+xml": {
+ "source": "iana",
+ "charset": "UTF-8",
+ "compressible": true,
+ "extensions": ["xsm"]
+ },
+ "application/vnd.syncml.dm+wbxml": {
+ "source": "iana",
+ "charset": "UTF-8",
+ "extensions": ["bdm"]
+ },
+ "application/vnd.syncml.dm+xml": {
+ "source": "iana",
+ "charset": "UTF-8",
+ "compressible": true,
+ "extensions": ["xdm"]
+ },
+ "application/vnd.syncml.dm.notification": {
+ "source": "iana"
+ },
+ "application/vnd.syncml.dmddf+wbxml": {
+ "source": "iana"
+ },
+ "application/vnd.syncml.dmddf+xml": {
+ "source": "iana",
+ "charset": "UTF-8",
+ "compressible": true,
+ "extensions": ["ddf"]
+ },
+ "application/vnd.syncml.dmtnds+wbxml": {
+ "source": "iana"
+ },
+ "application/vnd.syncml.dmtnds+xml": {
+ "source": "iana",
+ "charset": "UTF-8",
+ "compressible": true
+ },
+ "application/vnd.syncml.ds.notification": {
+ "source": "iana"
+ },
+ "application/vnd.tableschema+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.tao.intent-module-archive": {
+ "source": "iana",
+ "extensions": ["tao"]
+ },
+ "application/vnd.tcpdump.pcap": {
+ "source": "iana",
+ "extensions": ["pcap","cap","dmp"]
+ },
+ "application/vnd.think-cell.ppttc+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.tmd.mediaflex.api+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.tml": {
+ "source": "iana"
+ },
+ "application/vnd.tmobile-livetv": {
+ "source": "iana",
+ "extensions": ["tmo"]
+ },
+ "application/vnd.tri.onesource": {
+ "source": "iana"
+ },
+ "application/vnd.trid.tpt": {
+ "source": "iana",
+ "extensions": ["tpt"]
+ },
+ "application/vnd.triscape.mxs": {
+ "source": "iana",
+ "extensions": ["mxs"]
+ },
+ "application/vnd.trueapp": {
+ "source": "iana",
+ "extensions": ["tra"]
+ },
+ "application/vnd.truedoc": {
+ "source": "iana"
+ },
+ "application/vnd.ubisoft.webplayer": {
+ "source": "iana"
+ },
+ "application/vnd.ufdl": {
+ "source": "iana",
+ "extensions": ["ufd","ufdl"]
+ },
+ "application/vnd.uiq.theme": {
+ "source": "iana",
+ "extensions": ["utz"]
+ },
+ "application/vnd.umajin": {
+ "source": "iana",
+ "extensions": ["umj"]
+ },
+ "application/vnd.unity": {
+ "source": "iana",
+ "extensions": ["unityweb"]
+ },
+ "application/vnd.uoml+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["uoml"]
+ },
+ "application/vnd.uplanet.alert": {
+ "source": "iana"
+ },
+ "application/vnd.uplanet.alert-wbxml": {
+ "source": "iana"
+ },
+ "application/vnd.uplanet.bearer-choice": {
+ "source": "iana"
+ },
+ "application/vnd.uplanet.bearer-choice-wbxml": {
+ "source": "iana"
+ },
+ "application/vnd.uplanet.cacheop": {
+ "source": "iana"
+ },
+ "application/vnd.uplanet.cacheop-wbxml": {
+ "source": "iana"
+ },
+ "application/vnd.uplanet.channel": {
+ "source": "iana"
+ },
+ "application/vnd.uplanet.channel-wbxml": {
+ "source": "iana"
+ },
+ "application/vnd.uplanet.list": {
+ "source": "iana"
+ },
+ "application/vnd.uplanet.list-wbxml": {
+ "source": "iana"
+ },
+ "application/vnd.uplanet.listcmd": {
+ "source": "iana"
+ },
+ "application/vnd.uplanet.listcmd-wbxml": {
+ "source": "iana"
+ },
+ "application/vnd.uplanet.signal": {
+ "source": "iana"
+ },
+ "application/vnd.uri-map": {
+ "source": "iana"
+ },
+ "application/vnd.valve.source.material": {
+ "source": "iana"
+ },
+ "application/vnd.vcx": {
+ "source": "iana",
+ "extensions": ["vcx"]
+ },
+ "application/vnd.vd-study": {
+ "source": "iana"
+ },
+ "application/vnd.vectorworks": {
+ "source": "iana"
+ },
+ "application/vnd.vel+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.verimatrix.vcas": {
+ "source": "iana"
+ },
+ "application/vnd.veritone.aion+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.veryant.thin": {
+ "source": "iana"
+ },
+ "application/vnd.ves.encrypted": {
+ "source": "iana"
+ },
+ "application/vnd.vidsoft.vidconference": {
+ "source": "iana"
+ },
+ "application/vnd.visio": {
+ "source": "iana",
+ "extensions": ["vsd","vst","vss","vsw"]
+ },
+ "application/vnd.visionary": {
+ "source": "iana",
+ "extensions": ["vis"]
+ },
+ "application/vnd.vividence.scriptfile": {
+ "source": "iana"
+ },
+ "application/vnd.vsf": {
+ "source": "iana",
+ "extensions": ["vsf"]
+ },
+ "application/vnd.wap.sic": {
+ "source": "iana"
+ },
+ "application/vnd.wap.slc": {
+ "source": "iana"
+ },
+ "application/vnd.wap.wbxml": {
+ "source": "iana",
+ "charset": "UTF-8",
+ "extensions": ["wbxml"]
+ },
+ "application/vnd.wap.wmlc": {
+ "source": "iana",
+ "extensions": ["wmlc"]
+ },
+ "application/vnd.wap.wmlscriptc": {
+ "source": "iana",
+ "extensions": ["wmlsc"]
+ },
+ "application/vnd.webturbo": {
+ "source": "iana",
+ "extensions": ["wtb"]
+ },
+ "application/vnd.wfa.dpp": {
+ "source": "iana"
+ },
+ "application/vnd.wfa.p2p": {
+ "source": "iana"
+ },
+ "application/vnd.wfa.wsc": {
+ "source": "iana"
+ },
+ "application/vnd.windows.devicepairing": {
+ "source": "iana"
+ },
+ "application/vnd.wmc": {
+ "source": "iana"
+ },
+ "application/vnd.wmf.bootstrap": {
+ "source": "iana"
+ },
+ "application/vnd.wolfram.mathematica": {
+ "source": "iana"
+ },
+ "application/vnd.wolfram.mathematica.package": {
+ "source": "iana"
+ },
+ "application/vnd.wolfram.player": {
+ "source": "iana",
+ "extensions": ["nbp"]
+ },
+ "application/vnd.wordperfect": {
+ "source": "iana",
+ "extensions": ["wpd"]
+ },
+ "application/vnd.wqd": {
+ "source": "iana",
+ "extensions": ["wqd"]
+ },
+ "application/vnd.wrq-hp3000-labelled": {
+ "source": "iana"
+ },
+ "application/vnd.wt.stf": {
+ "source": "iana",
+ "extensions": ["stf"]
+ },
+ "application/vnd.wv.csp+wbxml": {
+ "source": "iana"
+ },
+ "application/vnd.wv.csp+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.wv.ssp+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.xacml+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.xara": {
+ "source": "iana",
+ "extensions": ["xar"]
+ },
+ "application/vnd.xfdl": {
+ "source": "iana",
+ "extensions": ["xfdl"]
+ },
+ "application/vnd.xfdl.webform": {
+ "source": "iana"
+ },
+ "application/vnd.xmi+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.xmpie.cpkg": {
+ "source": "iana"
+ },
+ "application/vnd.xmpie.dpkg": {
+ "source": "iana"
+ },
+ "application/vnd.xmpie.plan": {
+ "source": "iana"
+ },
+ "application/vnd.xmpie.ppkg": {
+ "source": "iana"
+ },
+ "application/vnd.xmpie.xlim": {
+ "source": "iana"
+ },
+ "application/vnd.yamaha.hv-dic": {
+ "source": "iana",
+ "extensions": ["hvd"]
+ },
+ "application/vnd.yamaha.hv-script": {
+ "source": "iana",
+ "extensions": ["hvs"]
+ },
+ "application/vnd.yamaha.hv-voice": {
+ "source": "iana",
+ "extensions": ["hvp"]
+ },
+ "application/vnd.yamaha.openscoreformat": {
+ "source": "iana",
+ "extensions": ["osf"]
+ },
+ "application/vnd.yamaha.openscoreformat.osfpvg+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["osfpvg"]
+ },
+ "application/vnd.yamaha.remote-setup": {
+ "source": "iana"
+ },
+ "application/vnd.yamaha.smaf-audio": {
+ "source": "iana",
+ "extensions": ["saf"]
+ },
+ "application/vnd.yamaha.smaf-phrase": {
+ "source": "iana",
+ "extensions": ["spf"]
+ },
+ "application/vnd.yamaha.through-ngn": {
+ "source": "iana"
+ },
+ "application/vnd.yamaha.tunnel-udpencap": {
+ "source": "iana"
+ },
+ "application/vnd.yaoweme": {
+ "source": "iana"
+ },
+ "application/vnd.yellowriver-custom-menu": {
+ "source": "iana",
+ "extensions": ["cmp"]
+ },
+ "application/vnd.youtube.yt": {
+ "source": "iana"
+ },
+ "application/vnd.zul": {
+ "source": "iana",
+ "extensions": ["zir","zirz"]
+ },
+ "application/vnd.zzazz.deck+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["zaz"]
+ },
+ "application/voicexml+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["vxml"]
+ },
+ "application/voucher-cms+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vq-rtcpxr": {
+ "source": "iana"
+ },
+ "application/wasm": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["wasm"]
+ },
+ "application/watcherinfo+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["wif"]
+ },
+ "application/webpush-options+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/whoispp-query": {
+ "source": "iana"
+ },
+ "application/whoispp-response": {
+ "source": "iana"
+ },
+ "application/widget": {
+ "source": "iana",
+ "extensions": ["wgt"]
+ },
+ "application/winhlp": {
+ "source": "apache",
+ "extensions": ["hlp"]
+ },
+ "application/wita": {
+ "source": "iana"
+ },
+ "application/wordperfect5.1": {
+ "source": "iana"
+ },
+ "application/wsdl+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["wsdl"]
+ },
+ "application/wspolicy+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["wspolicy"]
+ },
+ "application/x-7z-compressed": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["7z"]
+ },
+ "application/x-abiword": {
+ "source": "apache",
+ "extensions": ["abw"]
+ },
+ "application/x-ace-compressed": {
+ "source": "apache",
+ "extensions": ["ace"]
+ },
+ "application/x-amf": {
+ "source": "apache"
+ },
+ "application/x-apple-diskimage": {
+ "source": "apache",
+ "extensions": ["dmg"]
+ },
+ "application/x-arj": {
+ "compressible": false,
+ "extensions": ["arj"]
+ },
+ "application/x-authorware-bin": {
+ "source": "apache",
+ "extensions": ["aab","x32","u32","vox"]
+ },
+ "application/x-authorware-map": {
+ "source": "apache",
+ "extensions": ["aam"]
+ },
+ "application/x-authorware-seg": {
+ "source": "apache",
+ "extensions": ["aas"]
+ },
+ "application/x-bcpio": {
+ "source": "apache",
+ "extensions": ["bcpio"]
+ },
+ "application/x-bdoc": {
+ "compressible": false,
+ "extensions": ["bdoc"]
+ },
+ "application/x-bittorrent": {
+ "source": "apache",
+ "extensions": ["torrent"]
+ },
+ "application/x-blorb": {
+ "source": "apache",
+ "extensions": ["blb","blorb"]
+ },
+ "application/x-bzip": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["bz"]
+ },
+ "application/x-bzip2": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["bz2","boz"]
+ },
+ "application/x-cbr": {
+ "source": "apache",
+ "extensions": ["cbr","cba","cbt","cbz","cb7"]
+ },
+ "application/x-cdlink": {
+ "source": "apache",
+ "extensions": ["vcd"]
+ },
+ "application/x-cfs-compressed": {
+ "source": "apache",
+ "extensions": ["cfs"]
+ },
+ "application/x-chat": {
+ "source": "apache",
+ "extensions": ["chat"]
+ },
+ "application/x-chess-pgn": {
+ "source": "apache",
+ "extensions": ["pgn"]
+ },
+ "application/x-chrome-extension": {
+ "extensions": ["crx"]
+ },
+ "application/x-cocoa": {
+ "source": "nginx",
+ "extensions": ["cco"]
+ },
+ "application/x-compress": {
+ "source": "apache"
+ },
+ "application/x-conference": {
+ "source": "apache",
+ "extensions": ["nsc"]
+ },
+ "application/x-cpio": {
+ "source": "apache",
+ "extensions": ["cpio"]
+ },
+ "application/x-csh": {
+ "source": "apache",
+ "extensions": ["csh"]
+ },
+ "application/x-deb": {
+ "compressible": false
+ },
+ "application/x-debian-package": {
+ "source": "apache",
+ "extensions": ["deb","udeb"]
+ },
+ "application/x-dgc-compressed": {
+ "source": "apache",
+ "extensions": ["dgc"]
+ },
+ "application/x-director": {
+ "source": "apache",
+ "extensions": ["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]
+ },
+ "application/x-doom": {
+ "source": "apache",
+ "extensions": ["wad"]
+ },
+ "application/x-dtbncx+xml": {
+ "source": "apache",
+ "compressible": true,
+ "extensions": ["ncx"]
+ },
+ "application/x-dtbook+xml": {
+ "source": "apache",
+ "compressible": true,
+ "extensions": ["dtb"]
+ },
+ "application/x-dtbresource+xml": {
+ "source": "apache",
+ "compressible": true,
+ "extensions": ["res"]
+ },
+ "application/x-dvi": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["dvi"]
+ },
+ "application/x-envoy": {
+ "source": "apache",
+ "extensions": ["evy"]
+ },
+ "application/x-eva": {
+ "source": "apache",
+ "extensions": ["eva"]
+ },
+ "application/x-font-bdf": {
+ "source": "apache",
+ "extensions": ["bdf"]
+ },
+ "application/x-font-dos": {
+ "source": "apache"
+ },
+ "application/x-font-framemaker": {
+ "source": "apache"
+ },
+ "application/x-font-ghostscript": {
+ "source": "apache",
+ "extensions": ["gsf"]
+ },
+ "application/x-font-libgrx": {
+ "source": "apache"
+ },
+ "application/x-font-linux-psf": {
+ "source": "apache",
+ "extensions": ["psf"]
+ },
+ "application/x-font-pcf": {
+ "source": "apache",
+ "extensions": ["pcf"]
+ },
+ "application/x-font-snf": {
+ "source": "apache",
+ "extensions": ["snf"]
+ },
+ "application/x-font-speedo": {
+ "source": "apache"
+ },
+ "application/x-font-sunos-news": {
+ "source": "apache"
+ },
+ "application/x-font-type1": {
+ "source": "apache",
+ "extensions": ["pfa","pfb","pfm","afm"]
+ },
+ "application/x-font-vfont": {
+ "source": "apache"
+ },
+ "application/x-freearc": {
+ "source": "apache",
+ "extensions": ["arc"]
+ },
+ "application/x-futuresplash": {
+ "source": "apache",
+ "extensions": ["spl"]
+ },
+ "application/x-gca-compressed": {
+ "source": "apache",
+ "extensions": ["gca"]
+ },
+ "application/x-glulx": {
+ "source": "apache",
+ "extensions": ["ulx"]
+ },
+ "application/x-gnumeric": {
+ "source": "apache",
+ "extensions": ["gnumeric"]
+ },
+ "application/x-gramps-xml": {
+ "source": "apache",
+ "extensions": ["gramps"]
+ },
+ "application/x-gtar": {
+ "source": "apache",
+ "extensions": ["gtar"]
+ },
+ "application/x-gzip": {
+ "source": "apache"
+ },
+ "application/x-hdf": {
+ "source": "apache",
+ "extensions": ["hdf"]
+ },
+ "application/x-httpd-php": {
+ "compressible": true,
+ "extensions": ["php"]
+ },
+ "application/x-install-instructions": {
+ "source": "apache",
+ "extensions": ["install"]
+ },
+ "application/x-iso9660-image": {
+ "source": "apache",
+ "extensions": ["iso"]
+ },
+ "application/x-iwork-keynote-sffkey": {
+ "extensions": ["key"]
+ },
+ "application/x-iwork-numbers-sffnumbers": {
+ "extensions": ["numbers"]
+ },
+ "application/x-iwork-pages-sffpages": {
+ "extensions": ["pages"]
+ },
+ "application/x-java-archive-diff": {
+ "source": "nginx",
+ "extensions": ["jardiff"]
+ },
+ "application/x-java-jnlp-file": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["jnlp"]
+ },
+ "application/x-javascript": {
+ "compressible": true
+ },
+ "application/x-keepass2": {
+ "extensions": ["kdbx"]
+ },
+ "application/x-latex": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["latex"]
+ },
+ "application/x-lua-bytecode": {
+ "extensions": ["luac"]
+ },
+ "application/x-lzh-compressed": {
+ "source": "apache",
+ "extensions": ["lzh","lha"]
+ },
+ "application/x-makeself": {
+ "source": "nginx",
+ "extensions": ["run"]
+ },
+ "application/x-mie": {
+ "source": "apache",
+ "extensions": ["mie"]
+ },
+ "application/x-mobipocket-ebook": {
+ "source": "apache",
+ "extensions": ["prc","mobi"]
+ },
+ "application/x-mpegurl": {
+ "compressible": false
+ },
+ "application/x-ms-application": {
+ "source": "apache",
+ "extensions": ["application"]
+ },
+ "application/x-ms-shortcut": {
+ "source": "apache",
+ "extensions": ["lnk"]
+ },
+ "application/x-ms-wmd": {
+ "source": "apache",
+ "extensions": ["wmd"]
+ },
+ "application/x-ms-wmz": {
+ "source": "apache",
+ "extensions": ["wmz"]
+ },
+ "application/x-ms-xbap": {
+ "source": "apache",
+ "extensions": ["xbap"]
+ },
+ "application/x-msaccess": {
+ "source": "apache",
+ "extensions": ["mdb"]
+ },
+ "application/x-msbinder": {
+ "source": "apache",
+ "extensions": ["obd"]
+ },
+ "application/x-mscardfile": {
+ "source": "apache",
+ "extensions": ["crd"]
+ },
+ "application/x-msclip": {
+ "source": "apache",
+ "extensions": ["clp"]
+ },
+ "application/x-msdos-program": {
+ "extensions": ["exe"]
+ },
+ "application/x-msdownload": {
+ "source": "apache",
+ "extensions": ["exe","dll","com","bat","msi"]
+ },
+ "application/x-msmediaview": {
+ "source": "apache",
+ "extensions": ["mvb","m13","m14"]
+ },
+ "application/x-msmetafile": {
+ "source": "apache",
+ "extensions": ["wmf","wmz","emf","emz"]
+ },
+ "application/x-msmoney": {
+ "source": "apache",
+ "extensions": ["mny"]
+ },
+ "application/x-mspublisher": {
+ "source": "apache",
+ "extensions": ["pub"]
+ },
+ "application/x-msschedule": {
+ "source": "apache",
+ "extensions": ["scd"]
+ },
+ "application/x-msterminal": {
+ "source": "apache",
+ "extensions": ["trm"]
+ },
+ "application/x-mswrite": {
+ "source": "apache",
+ "extensions": ["wri"]
+ },
+ "application/x-netcdf": {
+ "source": "apache",
+ "extensions": ["nc","cdf"]
+ },
+ "application/x-ns-proxy-autoconfig": {
+ "compressible": true,
+ "extensions": ["pac"]
+ },
+ "application/x-nzb": {
+ "source": "apache",
+ "extensions": ["nzb"]
+ },
+ "application/x-perl": {
+ "source": "nginx",
+ "extensions": ["pl","pm"]
+ },
+ "application/x-pilot": {
+ "source": "nginx",
+ "extensions": ["prc","pdb"]
+ },
+ "application/x-pkcs12": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["p12","pfx"]
+ },
+ "application/x-pkcs7-certificates": {
+ "source": "apache",
+ "extensions": ["p7b","spc"]
+ },
+ "application/x-pkcs7-certreqresp": {
+ "source": "apache",
+ "extensions": ["p7r"]
+ },
+ "application/x-pki-message": {
+ "source": "iana"
+ },
+ "application/x-rar-compressed": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["rar"]
+ },
+ "application/x-redhat-package-manager": {
+ "source": "nginx",
+ "extensions": ["rpm"]
+ },
+ "application/x-research-info-systems": {
+ "source": "apache",
+ "extensions": ["ris"]
+ },
+ "application/x-sea": {
+ "source": "nginx",
+ "extensions": ["sea"]
+ },
+ "application/x-sh": {
+ "source": "apache",
+ "compressible": true,
+ "extensions": ["sh"]
+ },
+ "application/x-shar": {
+ "source": "apache",
+ "extensions": ["shar"]
+ },
+ "application/x-shockwave-flash": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["swf"]
+ },
+ "application/x-silverlight-app": {
+ "source": "apache",
+ "extensions": ["xap"]
+ },
+ "application/x-sql": {
+ "source": "apache",
+ "extensions": ["sql"]
+ },
+ "application/x-stuffit": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["sit"]
+ },
+ "application/x-stuffitx": {
+ "source": "apache",
+ "extensions": ["sitx"]
+ },
+ "application/x-subrip": {
+ "source": "apache",
+ "extensions": ["srt"]
+ },
+ "application/x-sv4cpio": {
+ "source": "apache",
+ "extensions": ["sv4cpio"]
+ },
+ "application/x-sv4crc": {
+ "source": "apache",
+ "extensions": ["sv4crc"]
+ },
+ "application/x-t3vm-image": {
+ "source": "apache",
+ "extensions": ["t3"]
+ },
+ "application/x-tads": {
+ "source": "apache",
+ "extensions": ["gam"]
+ },
+ "application/x-tar": {
+ "source": "apache",
+ "compressible": true,
+ "extensions": ["tar"]
+ },
+ "application/x-tcl": {
+ "source": "apache",
+ "extensions": ["tcl","tk"]
+ },
+ "application/x-tex": {
+ "source": "apache",
+ "extensions": ["tex"]
+ },
+ "application/x-tex-tfm": {
+ "source": "apache",
+ "extensions": ["tfm"]
+ },
+ "application/x-texinfo": {
+ "source": "apache",
+ "extensions": ["texinfo","texi"]
+ },
+ "application/x-tgif": {
+ "source": "apache",
+ "extensions": ["obj"]
+ },
+ "application/x-ustar": {
+ "source": "apache",
+ "extensions": ["ustar"]
+ },
+ "application/x-virtualbox-hdd": {
+ "compressible": true,
+ "extensions": ["hdd"]
+ },
+ "application/x-virtualbox-ova": {
+ "compressible": true,
+ "extensions": ["ova"]
+ },
+ "application/x-virtualbox-ovf": {
+ "compressible": true,
+ "extensions": ["ovf"]
+ },
+ "application/x-virtualbox-vbox": {
+ "compressible": true,
+ "extensions": ["vbox"]
+ },
+ "application/x-virtualbox-vbox-extpack": {
+ "compressible": false,
+ "extensions": ["vbox-extpack"]
+ },
+ "application/x-virtualbox-vdi": {
+ "compressible": true,
+ "extensions": ["vdi"]
+ },
+ "application/x-virtualbox-vhd": {
+ "compressible": true,
+ "extensions": ["vhd"]
+ },
+ "application/x-virtualbox-vmdk": {
+ "compressible": true,
+ "extensions": ["vmdk"]
+ },
+ "application/x-wais-source": {
+ "source": "apache",
+ "extensions": ["src"]
+ },
+ "application/x-web-app-manifest+json": {
+ "compressible": true,
+ "extensions": ["webapp"]
+ },
+ "application/x-www-form-urlencoded": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/x-x509-ca-cert": {
+ "source": "iana",
+ "extensions": ["der","crt","pem"]
+ },
+ "application/x-x509-ca-ra-cert": {
+ "source": "iana"
+ },
+ "application/x-x509-next-ca-cert": {
+ "source": "iana"
+ },
+ "application/x-xfig": {
+ "source": "apache",
+ "extensions": ["fig"]
+ },
+ "application/x-xliff+xml": {
+ "source": "apache",
+ "compressible": true,
+ "extensions": ["xlf"]
+ },
+ "application/x-xpinstall": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["xpi"]
+ },
+ "application/x-xz": {
+ "source": "apache",
+ "extensions": ["xz"]
+ },
+ "application/x-zmachine": {
+ "source": "apache",
+ "extensions": ["z1","z2","z3","z4","z5","z6","z7","z8"]
+ },
+ "application/x400-bp": {
+ "source": "iana"
+ },
+ "application/xacml+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/xaml+xml": {
+ "source": "apache",
+ "compressible": true,
+ "extensions": ["xaml"]
+ },
+ "application/xcap-att+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["xav"]
+ },
+ "application/xcap-caps+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["xca"]
+ },
+ "application/xcap-diff+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["xdf"]
+ },
+ "application/xcap-el+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["xel"]
+ },
+ "application/xcap-error+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/xcap-ns+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["xns"]
+ },
+ "application/xcon-conference-info+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/xcon-conference-info-diff+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/xenc+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["xenc"]
+ },
+ "application/xhtml+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["xhtml","xht"]
+ },
+ "application/xhtml-voice+xml": {
+ "source": "apache",
+ "compressible": true
+ },
+ "application/xliff+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["xlf"]
+ },
+ "application/xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["xml","xsl","xsd","rng"]
+ },
+ "application/xml-dtd": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["dtd"]
+ },
+ "application/xml-external-parsed-entity": {
+ "source": "iana"
+ },
+ "application/xml-patch+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/xmpp+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/xop+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["xop"]
+ },
+ "application/xproc+xml": {
+ "source": "apache",
+ "compressible": true,
+ "extensions": ["xpl"]
+ },
+ "application/xslt+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["xsl","xslt"]
+ },
+ "application/xspf+xml": {
+ "source": "apache",
+ "compressible": true,
+ "extensions": ["xspf"]
+ },
+ "application/xv+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["mxml","xhvml","xvml","xvm"]
+ },
+ "application/yang": {
+ "source": "iana",
+ "extensions": ["yang"]
+ },
+ "application/yang-data+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/yang-data+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/yang-patch+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/yang-patch+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/yin+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["yin"]
+ },
+ "application/zip": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["zip"]
+ },
+ "application/zlib": {
+ "source": "iana"
+ },
+ "application/zstd": {
+ "source": "iana"
+ },
+ "audio/1d-interleaved-parityfec": {
+ "source": "iana"
+ },
+ "audio/32kadpcm": {
+ "source": "iana"
+ },
+ "audio/3gpp": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["3gpp"]
+ },
+ "audio/3gpp2": {
+ "source": "iana"
+ },
+ "audio/aac": {
+ "source": "iana"
+ },
+ "audio/ac3": {
+ "source": "iana"
+ },
+ "audio/adpcm": {
+ "source": "apache",
+ "extensions": ["adp"]
+ },
+ "audio/amr": {
+ "source": "iana",
+ "extensions": ["amr"]
+ },
+ "audio/amr-wb": {
+ "source": "iana"
+ },
+ "audio/amr-wb+": {
+ "source": "iana"
+ },
+ "audio/aptx": {
+ "source": "iana"
+ },
+ "audio/asc": {
+ "source": "iana"
+ },
+ "audio/atrac-advanced-lossless": {
+ "source": "iana"
+ },
+ "audio/atrac-x": {
+ "source": "iana"
+ },
+ "audio/atrac3": {
+ "source": "iana"
+ },
+ "audio/basic": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["au","snd"]
+ },
+ "audio/bv16": {
+ "source": "iana"
+ },
+ "audio/bv32": {
+ "source": "iana"
+ },
+ "audio/clearmode": {
+ "source": "iana"
+ },
+ "audio/cn": {
+ "source": "iana"
+ },
+ "audio/dat12": {
+ "source": "iana"
+ },
+ "audio/dls": {
+ "source": "iana"
+ },
+ "audio/dsr-es201108": {
+ "source": "iana"
+ },
+ "audio/dsr-es202050": {
+ "source": "iana"
+ },
+ "audio/dsr-es202211": {
+ "source": "iana"
+ },
+ "audio/dsr-es202212": {
+ "source": "iana"
+ },
+ "audio/dv": {
+ "source": "iana"
+ },
+ "audio/dvi4": {
+ "source": "iana"
+ },
+ "audio/eac3": {
+ "source": "iana"
+ },
+ "audio/encaprtp": {
+ "source": "iana"
+ },
+ "audio/evrc": {
+ "source": "iana"
+ },
+ "audio/evrc-qcp": {
+ "source": "iana"
+ },
+ "audio/evrc0": {
+ "source": "iana"
+ },
+ "audio/evrc1": {
+ "source": "iana"
+ },
+ "audio/evrcb": {
+ "source": "iana"
+ },
+ "audio/evrcb0": {
+ "source": "iana"
+ },
+ "audio/evrcb1": {
+ "source": "iana"
+ },
+ "audio/evrcnw": {
+ "source": "iana"
+ },
+ "audio/evrcnw0": {
+ "source": "iana"
+ },
+ "audio/evrcnw1": {
+ "source": "iana"
+ },
+ "audio/evrcwb": {
+ "source": "iana"
+ },
+ "audio/evrcwb0": {
+ "source": "iana"
+ },
+ "audio/evrcwb1": {
+ "source": "iana"
+ },
+ "audio/evs": {
+ "source": "iana"
+ },
+ "audio/flexfec": {
+ "source": "iana"
+ },
+ "audio/fwdred": {
+ "source": "iana"
+ },
+ "audio/g711-0": {
+ "source": "iana"
+ },
+ "audio/g719": {
+ "source": "iana"
+ },
+ "audio/g722": {
+ "source": "iana"
+ },
+ "audio/g7221": {
+ "source": "iana"
+ },
+ "audio/g723": {
+ "source": "iana"
+ },
+ "audio/g726-16": {
+ "source": "iana"
+ },
+ "audio/g726-24": {
+ "source": "iana"
+ },
+ "audio/g726-32": {
+ "source": "iana"
+ },
+ "audio/g726-40": {
+ "source": "iana"
+ },
+ "audio/g728": {
+ "source": "iana"
+ },
+ "audio/g729": {
+ "source": "iana"
+ },
+ "audio/g7291": {
+ "source": "iana"
+ },
+ "audio/g729d": {
+ "source": "iana"
+ },
+ "audio/g729e": {
+ "source": "iana"
+ },
+ "audio/gsm": {
+ "source": "iana"
+ },
+ "audio/gsm-efr": {
+ "source": "iana"
+ },
+ "audio/gsm-hr-08": {
+ "source": "iana"
+ },
+ "audio/ilbc": {
+ "source": "iana"
+ },
+ "audio/ip-mr_v2.5": {
+ "source": "iana"
+ },
+ "audio/isac": {
+ "source": "apache"
+ },
+ "audio/l16": {
+ "source": "iana"
+ },
+ "audio/l20": {
+ "source": "iana"
+ },
+ "audio/l24": {
+ "source": "iana",
+ "compressible": false
+ },
+ "audio/l8": {
+ "source": "iana"
+ },
+ "audio/lpc": {
+ "source": "iana"
+ },
+ "audio/melp": {
+ "source": "iana"
+ },
+ "audio/melp1200": {
+ "source": "iana"
+ },
+ "audio/melp2400": {
+ "source": "iana"
+ },
+ "audio/melp600": {
+ "source": "iana"
+ },
+ "audio/mhas": {
+ "source": "iana"
+ },
+ "audio/midi": {
+ "source": "apache",
+ "extensions": ["mid","midi","kar","rmi"]
+ },
+ "audio/mobile-xmf": {
+ "source": "iana",
+ "extensions": ["mxmf"]
+ },
+ "audio/mp3": {
+ "compressible": false,
+ "extensions": ["mp3"]
+ },
+ "audio/mp4": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["m4a","mp4a"]
+ },
+ "audio/mp4a-latm": {
+ "source": "iana"
+ },
+ "audio/mpa": {
+ "source": "iana"
+ },
+ "audio/mpa-robust": {
+ "source": "iana"
+ },
+ "audio/mpeg": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["mpga","mp2","mp2a","mp3","m2a","m3a"]
+ },
+ "audio/mpeg4-generic": {
+ "source": "iana"
+ },
+ "audio/musepack": {
+ "source": "apache"
+ },
+ "audio/ogg": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["oga","ogg","spx","opus"]
+ },
+ "audio/opus": {
+ "source": "iana"
+ },
+ "audio/parityfec": {
+ "source": "iana"
+ },
+ "audio/pcma": {
+ "source": "iana"
+ },
+ "audio/pcma-wb": {
+ "source": "iana"
+ },
+ "audio/pcmu": {
+ "source": "iana"
+ },
+ "audio/pcmu-wb": {
+ "source": "iana"
+ },
+ "audio/prs.sid": {
+ "source": "iana"
+ },
+ "audio/qcelp": {
+ "source": "iana"
+ },
+ "audio/raptorfec": {
+ "source": "iana"
+ },
+ "audio/red": {
+ "source": "iana"
+ },
+ "audio/rtp-enc-aescm128": {
+ "source": "iana"
+ },
+ "audio/rtp-midi": {
+ "source": "iana"
+ },
+ "audio/rtploopback": {
+ "source": "iana"
+ },
+ "audio/rtx": {
+ "source": "iana"
+ },
+ "audio/s3m": {
+ "source": "apache",
+ "extensions": ["s3m"]
+ },
+ "audio/scip": {
+ "source": "iana"
+ },
+ "audio/silk": {
+ "source": "apache",
+ "extensions": ["sil"]
+ },
+ "audio/smv": {
+ "source": "iana"
+ },
+ "audio/smv-qcp": {
+ "source": "iana"
+ },
+ "audio/smv0": {
+ "source": "iana"
+ },
+ "audio/sofa": {
+ "source": "iana"
+ },
+ "audio/sp-midi": {
+ "source": "iana"
+ },
+ "audio/speex": {
+ "source": "iana"
+ },
+ "audio/t140c": {
+ "source": "iana"
+ },
+ "audio/t38": {
+ "source": "iana"
+ },
+ "audio/telephone-event": {
+ "source": "iana"
+ },
+ "audio/tetra_acelp": {
+ "source": "iana"
+ },
+ "audio/tetra_acelp_bb": {
+ "source": "iana"
+ },
+ "audio/tone": {
+ "source": "iana"
+ },
+ "audio/tsvcis": {
+ "source": "iana"
+ },
+ "audio/uemclip": {
+ "source": "iana"
+ },
+ "audio/ulpfec": {
+ "source": "iana"
+ },
+ "audio/usac": {
+ "source": "iana"
+ },
+ "audio/vdvi": {
+ "source": "iana"
+ },
+ "audio/vmr-wb": {
+ "source": "iana"
+ },
+ "audio/vnd.3gpp.iufp": {
+ "source": "iana"
+ },
+ "audio/vnd.4sb": {
+ "source": "iana"
+ },
+ "audio/vnd.audiokoz": {
+ "source": "iana"
+ },
+ "audio/vnd.celp": {
+ "source": "iana"
+ },
+ "audio/vnd.cisco.nse": {
+ "source": "iana"
+ },
+ "audio/vnd.cmles.radio-events": {
+ "source": "iana"
+ },
+ "audio/vnd.cns.anp1": {
+ "source": "iana"
+ },
+ "audio/vnd.cns.inf1": {
+ "source": "iana"
+ },
+ "audio/vnd.dece.audio": {
+ "source": "iana",
+ "extensions": ["uva","uvva"]
+ },
+ "audio/vnd.digital-winds": {
+ "source": "iana",
+ "extensions": ["eol"]
+ },
+ "audio/vnd.dlna.adts": {
+ "source": "iana"
+ },
+ "audio/vnd.dolby.heaac.1": {
+ "source": "iana"
+ },
+ "audio/vnd.dolby.heaac.2": {
+ "source": "iana"
+ },
+ "audio/vnd.dolby.mlp": {
+ "source": "iana"
+ },
+ "audio/vnd.dolby.mps": {
+ "source": "iana"
+ },
+ "audio/vnd.dolby.pl2": {
+ "source": "iana"
+ },
+ "audio/vnd.dolby.pl2x": {
+ "source": "iana"
+ },
+ "audio/vnd.dolby.pl2z": {
+ "source": "iana"
+ },
+ "audio/vnd.dolby.pulse.1": {
+ "source": "iana"
+ },
+ "audio/vnd.dra": {
+ "source": "iana",
+ "extensions": ["dra"]
+ },
+ "audio/vnd.dts": {
+ "source": "iana",
+ "extensions": ["dts"]
+ },
+ "audio/vnd.dts.hd": {
+ "source": "iana",
+ "extensions": ["dtshd"]
+ },
+ "audio/vnd.dts.uhd": {
+ "source": "iana"
+ },
+ "audio/vnd.dvb.file": {
+ "source": "iana"
+ },
+ "audio/vnd.everad.plj": {
+ "source": "iana"
+ },
+ "audio/vnd.hns.audio": {
+ "source": "iana"
+ },
+ "audio/vnd.lucent.voice": {
+ "source": "iana",
+ "extensions": ["lvp"]
+ },
+ "audio/vnd.ms-playready.media.pya": {
+ "source": "iana",
+ "extensions": ["pya"]
+ },
+ "audio/vnd.nokia.mobile-xmf": {
+ "source": "iana"
+ },
+ "audio/vnd.nortel.vbk": {
+ "source": "iana"
+ },
+ "audio/vnd.nuera.ecelp4800": {
+ "source": "iana",
+ "extensions": ["ecelp4800"]
+ },
+ "audio/vnd.nuera.ecelp7470": {
+ "source": "iana",
+ "extensions": ["ecelp7470"]
+ },
+ "audio/vnd.nuera.ecelp9600": {
+ "source": "iana",
+ "extensions": ["ecelp9600"]
+ },
+ "audio/vnd.octel.sbc": {
+ "source": "iana"
+ },
+ "audio/vnd.presonus.multitrack": {
+ "source": "iana"
+ },
+ "audio/vnd.qcelp": {
+ "source": "iana"
+ },
+ "audio/vnd.rhetorex.32kadpcm": {
+ "source": "iana"
+ },
+ "audio/vnd.rip": {
+ "source": "iana",
+ "extensions": ["rip"]
+ },
+ "audio/vnd.rn-realaudio": {
+ "compressible": false
+ },
+ "audio/vnd.sealedmedia.softseal.mpeg": {
+ "source": "iana"
+ },
+ "audio/vnd.vmx.cvsd": {
+ "source": "iana"
+ },
+ "audio/vnd.wave": {
+ "compressible": false
+ },
+ "audio/vorbis": {
+ "source": "iana",
+ "compressible": false
+ },
+ "audio/vorbis-config": {
+ "source": "iana"
+ },
+ "audio/wav": {
+ "compressible": false,
+ "extensions": ["wav"]
+ },
+ "audio/wave": {
+ "compressible": false,
+ "extensions": ["wav"]
+ },
+ "audio/webm": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["weba"]
+ },
+ "audio/x-aac": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["aac"]
+ },
+ "audio/x-aiff": {
+ "source": "apache",
+ "extensions": ["aif","aiff","aifc"]
+ },
+ "audio/x-caf": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["caf"]
+ },
+ "audio/x-flac": {
+ "source": "apache",
+ "extensions": ["flac"]
+ },
+ "audio/x-m4a": {
+ "source": "nginx",
+ "extensions": ["m4a"]
+ },
+ "audio/x-matroska": {
+ "source": "apache",
+ "extensions": ["mka"]
+ },
+ "audio/x-mpegurl": {
+ "source": "apache",
+ "extensions": ["m3u"]
+ },
+ "audio/x-ms-wax": {
+ "source": "apache",
+ "extensions": ["wax"]
+ },
+ "audio/x-ms-wma": {
+ "source": "apache",
+ "extensions": ["wma"]
+ },
+ "audio/x-pn-realaudio": {
+ "source": "apache",
+ "extensions": ["ram","ra"]
+ },
+ "audio/x-pn-realaudio-plugin": {
+ "source": "apache",
+ "extensions": ["rmp"]
+ },
+ "audio/x-realaudio": {
+ "source": "nginx",
+ "extensions": ["ra"]
+ },
+ "audio/x-tta": {
+ "source": "apache"
+ },
+ "audio/x-wav": {
+ "source": "apache",
+ "extensions": ["wav"]
+ },
+ "audio/xm": {
+ "source": "apache",
+ "extensions": ["xm"]
+ },
+ "chemical/x-cdx": {
+ "source": "apache",
+ "extensions": ["cdx"]
+ },
+ "chemical/x-cif": {
+ "source": "apache",
+ "extensions": ["cif"]
+ },
+ "chemical/x-cmdf": {
+ "source": "apache",
+ "extensions": ["cmdf"]
+ },
+ "chemical/x-cml": {
+ "source": "apache",
+ "extensions": ["cml"]
+ },
+ "chemical/x-csml": {
+ "source": "apache",
+ "extensions": ["csml"]
+ },
+ "chemical/x-pdb": {
+ "source": "apache"
+ },
+ "chemical/x-xyz": {
+ "source": "apache",
+ "extensions": ["xyz"]
+ },
+ "font/collection": {
+ "source": "iana",
+ "extensions": ["ttc"]
+ },
+ "font/otf": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["otf"]
+ },
+ "font/sfnt": {
+ "source": "iana"
+ },
+ "font/ttf": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["ttf"]
+ },
+ "font/woff": {
+ "source": "iana",
+ "extensions": ["woff"]
+ },
+ "font/woff2": {
+ "source": "iana",
+ "extensions": ["woff2"]
+ },
+ "image/aces": {
+ "source": "iana",
+ "extensions": ["exr"]
+ },
+ "image/apng": {
+ "compressible": false,
+ "extensions": ["apng"]
+ },
+ "image/avci": {
+ "source": "iana",
+ "extensions": ["avci"]
+ },
+ "image/avcs": {
+ "source": "iana",
+ "extensions": ["avcs"]
+ },
+ "image/avif": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["avif"]
+ },
+ "image/bmp": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["bmp"]
+ },
+ "image/cgm": {
+ "source": "iana",
+ "extensions": ["cgm"]
+ },
+ "image/dicom-rle": {
+ "source": "iana",
+ "extensions": ["drle"]
+ },
+ "image/emf": {
+ "source": "iana",
+ "extensions": ["emf"]
+ },
+ "image/fits": {
+ "source": "iana",
+ "extensions": ["fits"]
+ },
+ "image/g3fax": {
+ "source": "iana",
+ "extensions": ["g3"]
+ },
+ "image/gif": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["gif"]
+ },
+ "image/heic": {
+ "source": "iana",
+ "extensions": ["heic"]
+ },
+ "image/heic-sequence": {
+ "source": "iana",
+ "extensions": ["heics"]
+ },
+ "image/heif": {
+ "source": "iana",
+ "extensions": ["heif"]
+ },
+ "image/heif-sequence": {
+ "source": "iana",
+ "extensions": ["heifs"]
+ },
+ "image/hej2k": {
+ "source": "iana",
+ "extensions": ["hej2"]
+ },
+ "image/hsj2": {
+ "source": "iana",
+ "extensions": ["hsj2"]
+ },
+ "image/ief": {
+ "source": "iana",
+ "extensions": ["ief"]
+ },
+ "image/jls": {
+ "source": "iana",
+ "extensions": ["jls"]
+ },
+ "image/jp2": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["jp2","jpg2"]
+ },
+ "image/jpeg": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["jpeg","jpg","jpe"]
+ },
+ "image/jph": {
+ "source": "iana",
+ "extensions": ["jph"]
+ },
+ "image/jphc": {
+ "source": "iana",
+ "extensions": ["jhc"]
+ },
+ "image/jpm": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["jpm"]
+ },
+ "image/jpx": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["jpx","jpf"]
+ },
+ "image/jxr": {
+ "source": "iana",
+ "extensions": ["jxr"]
+ },
+ "image/jxra": {
+ "source": "iana",
+ "extensions": ["jxra"]
+ },
+ "image/jxrs": {
+ "source": "iana",
+ "extensions": ["jxrs"]
+ },
+ "image/jxs": {
+ "source": "iana",
+ "extensions": ["jxs"]
+ },
+ "image/jxsc": {
+ "source": "iana",
+ "extensions": ["jxsc"]
+ },
+ "image/jxsi": {
+ "source": "iana",
+ "extensions": ["jxsi"]
+ },
+ "image/jxss": {
+ "source": "iana",
+ "extensions": ["jxss"]
+ },
+ "image/ktx": {
+ "source": "iana",
+ "extensions": ["ktx"]
+ },
+ "image/ktx2": {
+ "source": "iana",
+ "extensions": ["ktx2"]
+ },
+ "image/naplps": {
+ "source": "iana"
+ },
+ "image/pjpeg": {
+ "compressible": false
+ },
+ "image/png": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["png"]
+ },
+ "image/prs.btif": {
+ "source": "iana",
+ "extensions": ["btif"]
+ },
+ "image/prs.pti": {
+ "source": "iana",
+ "extensions": ["pti"]
+ },
+ "image/pwg-raster": {
+ "source": "iana"
+ },
+ "image/sgi": {
+ "source": "apache",
+ "extensions": ["sgi"]
+ },
+ "image/svg+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["svg","svgz"]
+ },
+ "image/t38": {
+ "source": "iana",
+ "extensions": ["t38"]
+ },
+ "image/tiff": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["tif","tiff"]
+ },
+ "image/tiff-fx": {
+ "source": "iana",
+ "extensions": ["tfx"]
+ },
+ "image/vnd.adobe.photoshop": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["psd"]
+ },
+ "image/vnd.airzip.accelerator.azv": {
+ "source": "iana",
+ "extensions": ["azv"]
+ },
+ "image/vnd.cns.inf2": {
+ "source": "iana"
+ },
+ "image/vnd.dece.graphic": {
+ "source": "iana",
+ "extensions": ["uvi","uvvi","uvg","uvvg"]
+ },
+ "image/vnd.djvu": {
+ "source": "iana",
+ "extensions": ["djvu","djv"]
+ },
+ "image/vnd.dvb.subtitle": {
+ "source": "iana",
+ "extensions": ["sub"]
+ },
+ "image/vnd.dwg": {
+ "source": "iana",
+ "extensions": ["dwg"]
+ },
+ "image/vnd.dxf": {
+ "source": "iana",
+ "extensions": ["dxf"]
+ },
+ "image/vnd.fastbidsheet": {
+ "source": "iana",
+ "extensions": ["fbs"]
+ },
+ "image/vnd.fpx": {
+ "source": "iana",
+ "extensions": ["fpx"]
+ },
+ "image/vnd.fst": {
+ "source": "iana",
+ "extensions": ["fst"]
+ },
+ "image/vnd.fujixerox.edmics-mmr": {
+ "source": "iana",
+ "extensions": ["mmr"]
+ },
+ "image/vnd.fujixerox.edmics-rlc": {
+ "source": "iana",
+ "extensions": ["rlc"]
+ },
+ "image/vnd.globalgraphics.pgb": {
+ "source": "iana"
+ },
+ "image/vnd.microsoft.icon": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["ico"]
+ },
+ "image/vnd.mix": {
+ "source": "iana"
+ },
+ "image/vnd.mozilla.apng": {
+ "source": "iana"
+ },
+ "image/vnd.ms-dds": {
+ "compressible": true,
+ "extensions": ["dds"]
+ },
+ "image/vnd.ms-modi": {
+ "source": "iana",
+ "extensions": ["mdi"]
+ },
+ "image/vnd.ms-photo": {
+ "source": "apache",
+ "extensions": ["wdp"]
+ },
+ "image/vnd.net-fpx": {
+ "source": "iana",
+ "extensions": ["npx"]
+ },
+ "image/vnd.pco.b16": {
+ "source": "iana",
+ "extensions": ["b16"]
+ },
+ "image/vnd.radiance": {
+ "source": "iana"
+ },
+ "image/vnd.sealed.png": {
+ "source": "iana"
+ },
+ "image/vnd.sealedmedia.softseal.gif": {
+ "source": "iana"
+ },
+ "image/vnd.sealedmedia.softseal.jpg": {
+ "source": "iana"
+ },
+ "image/vnd.svf": {
+ "source": "iana"
+ },
+ "image/vnd.tencent.tap": {
+ "source": "iana",
+ "extensions": ["tap"]
+ },
+ "image/vnd.valve.source.texture": {
+ "source": "iana",
+ "extensions": ["vtf"]
+ },
+ "image/vnd.wap.wbmp": {
+ "source": "iana",
+ "extensions": ["wbmp"]
+ },
+ "image/vnd.xiff": {
+ "source": "iana",
+ "extensions": ["xif"]
+ },
+ "image/vnd.zbrush.pcx": {
+ "source": "iana",
+ "extensions": ["pcx"]
+ },
+ "image/webp": {
+ "source": "apache",
+ "extensions": ["webp"]
+ },
+ "image/wmf": {
+ "source": "iana",
+ "extensions": ["wmf"]
+ },
+ "image/x-3ds": {
+ "source": "apache",
+ "extensions": ["3ds"]
+ },
+ "image/x-cmu-raster": {
+ "source": "apache",
+ "extensions": ["ras"]
+ },
+ "image/x-cmx": {
+ "source": "apache",
+ "extensions": ["cmx"]
+ },
+ "image/x-freehand": {
+ "source": "apache",
+ "extensions": ["fh","fhc","fh4","fh5","fh7"]
+ },
+ "image/x-icon": {
+ "source": "apache",
+ "compressible": true,
+ "extensions": ["ico"]
+ },
+ "image/x-jng": {
+ "source": "nginx",
+ "extensions": ["jng"]
+ },
+ "image/x-mrsid-image": {
+ "source": "apache",
+ "extensions": ["sid"]
+ },
+ "image/x-ms-bmp": {
+ "source": "nginx",
+ "compressible": true,
+ "extensions": ["bmp"]
+ },
+ "image/x-pcx": {
+ "source": "apache",
+ "extensions": ["pcx"]
+ },
+ "image/x-pict": {
+ "source": "apache",
+ "extensions": ["pic","pct"]
+ },
+ "image/x-portable-anymap": {
+ "source": "apache",
+ "extensions": ["pnm"]
+ },
+ "image/x-portable-bitmap": {
+ "source": "apache",
+ "extensions": ["pbm"]
+ },
+ "image/x-portable-graymap": {
+ "source": "apache",
+ "extensions": ["pgm"]
+ },
+ "image/x-portable-pixmap": {
+ "source": "apache",
+ "extensions": ["ppm"]
+ },
+ "image/x-rgb": {
+ "source": "apache",
+ "extensions": ["rgb"]
+ },
+ "image/x-tga": {
+ "source": "apache",
+ "extensions": ["tga"]
+ },
+ "image/x-xbitmap": {
+ "source": "apache",
+ "extensions": ["xbm"]
+ },
+ "image/x-xcf": {
+ "compressible": false
+ },
+ "image/x-xpixmap": {
+ "source": "apache",
+ "extensions": ["xpm"]
+ },
+ "image/x-xwindowdump": {
+ "source": "apache",
+ "extensions": ["xwd"]
+ },
+ "message/cpim": {
+ "source": "iana"
+ },
+ "message/delivery-status": {
+ "source": "iana"
+ },
+ "message/disposition-notification": {
+ "source": "iana",
+ "extensions": [
+ "disposition-notification"
+ ]
+ },
+ "message/external-body": {
+ "source": "iana"
+ },
+ "message/feedback-report": {
+ "source": "iana"
+ },
+ "message/global": {
+ "source": "iana",
+ "extensions": ["u8msg"]
+ },
+ "message/global-delivery-status": {
+ "source": "iana",
+ "extensions": ["u8dsn"]
+ },
+ "message/global-disposition-notification": {
+ "source": "iana",
+ "extensions": ["u8mdn"]
+ },
+ "message/global-headers": {
+ "source": "iana",
+ "extensions": ["u8hdr"]
+ },
+ "message/http": {
+ "source": "iana",
+ "compressible": false
+ },
+ "message/imdn+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "message/news": {
+ "source": "iana"
+ },
+ "message/partial": {
+ "source": "iana",
+ "compressible": false
+ },
+ "message/rfc822": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["eml","mime"]
+ },
+ "message/s-http": {
+ "source": "iana"
+ },
+ "message/sip": {
+ "source": "iana"
+ },
+ "message/sipfrag": {
+ "source": "iana"
+ },
+ "message/tracking-status": {
+ "source": "iana"
+ },
+ "message/vnd.si.simp": {
+ "source": "iana"
+ },
+ "message/vnd.wfa.wsc": {
+ "source": "iana",
+ "extensions": ["wsc"]
+ },
+ "model/3mf": {
+ "source": "iana",
+ "extensions": ["3mf"]
+ },
+ "model/e57": {
+ "source": "iana"
+ },
+ "model/gltf+json": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["gltf"]
+ },
+ "model/gltf-binary": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["glb"]
+ },
+ "model/iges": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["igs","iges"]
+ },
+ "model/mesh": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["msh","mesh","silo"]
+ },
+ "model/mtl": {
+ "source": "iana",
+ "extensions": ["mtl"]
+ },
+ "model/obj": {
+ "source": "iana",
+ "extensions": ["obj"]
+ },
+ "model/step": {
+ "source": "iana"
+ },
+ "model/step+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["stpx"]
+ },
+ "model/step+zip": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["stpz"]
+ },
+ "model/step-xml+zip": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["stpxz"]
+ },
+ "model/stl": {
+ "source": "iana",
+ "extensions": ["stl"]
+ },
+ "model/vnd.collada+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["dae"]
+ },
+ "model/vnd.dwf": {
+ "source": "iana",
+ "extensions": ["dwf"]
+ },
+ "model/vnd.flatland.3dml": {
+ "source": "iana"
+ },
+ "model/vnd.gdl": {
+ "source": "iana",
+ "extensions": ["gdl"]
+ },
+ "model/vnd.gs-gdl": {
+ "source": "apache"
+ },
+ "model/vnd.gs.gdl": {
+ "source": "iana"
+ },
+ "model/vnd.gtw": {
+ "source": "iana",
+ "extensions": ["gtw"]
+ },
+ "model/vnd.moml+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "model/vnd.mts": {
+ "source": "iana",
+ "extensions": ["mts"]
+ },
+ "model/vnd.opengex": {
+ "source": "iana",
+ "extensions": ["ogex"]
+ },
+ "model/vnd.parasolid.transmit.binary": {
+ "source": "iana",
+ "extensions": ["x_b"]
+ },
+ "model/vnd.parasolid.transmit.text": {
+ "source": "iana",
+ "extensions": ["x_t"]
+ },
+ "model/vnd.pytha.pyox": {
+ "source": "iana"
+ },
+ "model/vnd.rosette.annotated-data-model": {
+ "source": "iana"
+ },
+ "model/vnd.sap.vds": {
+ "source": "iana",
+ "extensions": ["vds"]
+ },
+ "model/vnd.usdz+zip": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["usdz"]
+ },
+ "model/vnd.valve.source.compiled-map": {
+ "source": "iana",
+ "extensions": ["bsp"]
+ },
+ "model/vnd.vtu": {
+ "source": "iana",
+ "extensions": ["vtu"]
+ },
+ "model/vrml": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["wrl","vrml"]
+ },
+ "model/x3d+binary": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["x3db","x3dbz"]
+ },
+ "model/x3d+fastinfoset": {
+ "source": "iana",
+ "extensions": ["x3db"]
+ },
+ "model/x3d+vrml": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["x3dv","x3dvz"]
+ },
+ "model/x3d+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["x3d","x3dz"]
+ },
+ "model/x3d-vrml": {
+ "source": "iana",
+ "extensions": ["x3dv"]
+ },
+ "multipart/alternative": {
+ "source": "iana",
+ "compressible": false
+ },
+ "multipart/appledouble": {
+ "source": "iana"
+ },
+ "multipart/byteranges": {
+ "source": "iana"
+ },
+ "multipart/digest": {
+ "source": "iana"
+ },
+ "multipart/encrypted": {
+ "source": "iana",
+ "compressible": false
+ },
+ "multipart/form-data": {
+ "source": "iana",
+ "compressible": false
+ },
+ "multipart/header-set": {
+ "source": "iana"
+ },
+ "multipart/mixed": {
+ "source": "iana"
+ },
+ "multipart/multilingual": {
+ "source": "iana"
+ },
+ "multipart/parallel": {
+ "source": "iana"
+ },
+ "multipart/related": {
+ "source": "iana",
+ "compressible": false
+ },
+ "multipart/report": {
+ "source": "iana"
+ },
+ "multipart/signed": {
+ "source": "iana",
+ "compressible": false
+ },
+ "multipart/vnd.bint.med-plus": {
+ "source": "iana"
+ },
+ "multipart/voice-message": {
+ "source": "iana"
+ },
+ "multipart/x-mixed-replace": {
+ "source": "iana"
+ },
+ "text/1d-interleaved-parityfec": {
+ "source": "iana"
+ },
+ "text/cache-manifest": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["appcache","manifest"]
+ },
+ "text/calendar": {
+ "source": "iana",
+ "extensions": ["ics","ifb"]
+ },
+ "text/calender": {
+ "compressible": true
+ },
+ "text/cmd": {
+ "compressible": true
+ },
+ "text/coffeescript": {
+ "extensions": ["coffee","litcoffee"]
+ },
+ "text/cql": {
+ "source": "iana"
+ },
+ "text/cql-expression": {
+ "source": "iana"
+ },
+ "text/cql-identifier": {
+ "source": "iana"
+ },
+ "text/css": {
+ "source": "iana",
+ "charset": "UTF-8",
+ "compressible": true,
+ "extensions": ["css"]
+ },
+ "text/csv": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["csv"]
+ },
+ "text/csv-schema": {
+ "source": "iana"
+ },
+ "text/directory": {
+ "source": "iana"
+ },
+ "text/dns": {
+ "source": "iana"
+ },
+ "text/ecmascript": {
+ "source": "iana"
+ },
+ "text/encaprtp": {
+ "source": "iana"
+ },
+ "text/enriched": {
+ "source": "iana"
+ },
+ "text/fhirpath": {
+ "source": "iana"
+ },
+ "text/flexfec": {
+ "source": "iana"
+ },
+ "text/fwdred": {
+ "source": "iana"
+ },
+ "text/gff3": {
+ "source": "iana"
+ },
+ "text/grammar-ref-list": {
+ "source": "iana"
+ },
+ "text/html": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["html","htm","shtml"]
+ },
+ "text/jade": {
+ "extensions": ["jade"]
+ },
+ "text/javascript": {
+ "source": "iana",
+ "compressible": true
+ },
+ "text/jcr-cnd": {
+ "source": "iana"
+ },
+ "text/jsx": {
+ "compressible": true,
+ "extensions": ["jsx"]
+ },
+ "text/less": {
+ "compressible": true,
+ "extensions": ["less"]
+ },
+ "text/markdown": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["markdown","md"]
+ },
+ "text/mathml": {
+ "source": "nginx",
+ "extensions": ["mml"]
+ },
+ "text/mdx": {
+ "compressible": true,
+ "extensions": ["mdx"]
+ },
+ "text/mizar": {
+ "source": "iana"
+ },
+ "text/n3": {
+ "source": "iana",
+ "charset": "UTF-8",
+ "compressible": true,
+ "extensions": ["n3"]
+ },
+ "text/parameters": {
+ "source": "iana",
+ "charset": "UTF-8"
+ },
+ "text/parityfec": {
+ "source": "iana"
+ },
+ "text/plain": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["txt","text","conf","def","list","log","in","ini"]
+ },
+ "text/provenance-notation": {
+ "source": "iana",
+ "charset": "UTF-8"
+ },
+ "text/prs.fallenstein.rst": {
+ "source": "iana"
+ },
+ "text/prs.lines.tag": {
+ "source": "iana",
+ "extensions": ["dsc"]
+ },
+ "text/prs.prop.logic": {
+ "source": "iana"
+ },
+ "text/raptorfec": {
+ "source": "iana"
+ },
+ "text/red": {
+ "source": "iana"
+ },
+ "text/rfc822-headers": {
+ "source": "iana"
+ },
+ "text/richtext": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["rtx"]
+ },
+ "text/rtf": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["rtf"]
+ },
+ "text/rtp-enc-aescm128": {
+ "source": "iana"
+ },
+ "text/rtploopback": {
+ "source": "iana"
+ },
+ "text/rtx": {
+ "source": "iana"
+ },
+ "text/sgml": {
+ "source": "iana",
+ "extensions": ["sgml","sgm"]
+ },
+ "text/shaclc": {
+ "source": "iana"
+ },
+ "text/shex": {
+ "source": "iana",
+ "extensions": ["shex"]
+ },
+ "text/slim": {
+ "extensions": ["slim","slm"]
+ },
+ "text/spdx": {
+ "source": "iana",
+ "extensions": ["spdx"]
+ },
+ "text/strings": {
+ "source": "iana"
+ },
+ "text/stylus": {
+ "extensions": ["stylus","styl"]
+ },
+ "text/t140": {
+ "source": "iana"
+ },
+ "text/tab-separated-values": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["tsv"]
+ },
+ "text/troff": {
+ "source": "iana",
+ "extensions": ["t","tr","roff","man","me","ms"]
+ },
+ "text/turtle": {
+ "source": "iana",
+ "charset": "UTF-8",
+ "extensions": ["ttl"]
+ },
+ "text/ulpfec": {
+ "source": "iana"
+ },
+ "text/uri-list": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["uri","uris","urls"]
+ },
+ "text/vcard": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["vcard"]
+ },
+ "text/vnd.a": {
+ "source": "iana"
+ },
+ "text/vnd.abc": {
+ "source": "iana"
+ },
+ "text/vnd.ascii-art": {
+ "source": "iana"
+ },
+ "text/vnd.curl": {
+ "source": "iana",
+ "extensions": ["curl"]
+ },
+ "text/vnd.curl.dcurl": {
+ "source": "apache",
+ "extensions": ["dcurl"]
+ },
+ "text/vnd.curl.mcurl": {
+ "source": "apache",
+ "extensions": ["mcurl"]
+ },
+ "text/vnd.curl.scurl": {
+ "source": "apache",
+ "extensions": ["scurl"]
+ },
+ "text/vnd.debian.copyright": {
+ "source": "iana",
+ "charset": "UTF-8"
+ },
+ "text/vnd.dmclientscript": {
+ "source": "iana"
+ },
+ "text/vnd.dvb.subtitle": {
+ "source": "iana",
+ "extensions": ["sub"]
+ },
+ "text/vnd.esmertec.theme-descriptor": {
+ "source": "iana",
+ "charset": "UTF-8"
+ },
+ "text/vnd.familysearch.gedcom": {
+ "source": "iana",
+ "extensions": ["ged"]
+ },
+ "text/vnd.ficlab.flt": {
+ "source": "iana"
+ },
+ "text/vnd.fly": {
+ "source": "iana",
+ "extensions": ["fly"]
+ },
+ "text/vnd.fmi.flexstor": {
+ "source": "iana",
+ "extensions": ["flx"]
+ },
+ "text/vnd.gml": {
+ "source": "iana"
+ },
+ "text/vnd.graphviz": {
+ "source": "iana",
+ "extensions": ["gv"]
+ },
+ "text/vnd.hans": {
+ "source": "iana"
+ },
+ "text/vnd.hgl": {
+ "source": "iana"
+ },
+ "text/vnd.in3d.3dml": {
+ "source": "iana",
+ "extensions": ["3dml"]
+ },
+ "text/vnd.in3d.spot": {
+ "source": "iana",
+ "extensions": ["spot"]
+ },
+ "text/vnd.iptc.newsml": {
+ "source": "iana"
+ },
+ "text/vnd.iptc.nitf": {
+ "source": "iana"
+ },
+ "text/vnd.latex-z": {
+ "source": "iana"
+ },
+ "text/vnd.motorola.reflex": {
+ "source": "iana"
+ },
+ "text/vnd.ms-mediapackage": {
+ "source": "iana"
+ },
+ "text/vnd.net2phone.commcenter.command": {
+ "source": "iana"
+ },
+ "text/vnd.radisys.msml-basic-layout": {
+ "source": "iana"
+ },
+ "text/vnd.senx.warpscript": {
+ "source": "iana"
+ },
+ "text/vnd.si.uricatalogue": {
+ "source": "iana"
+ },
+ "text/vnd.sosi": {
+ "source": "iana"
+ },
+ "text/vnd.sun.j2me.app-descriptor": {
+ "source": "iana",
+ "charset": "UTF-8",
+ "extensions": ["jad"]
+ },
+ "text/vnd.trolltech.linguist": {
+ "source": "iana",
+ "charset": "UTF-8"
+ },
+ "text/vnd.wap.si": {
+ "source": "iana"
+ },
+ "text/vnd.wap.sl": {
+ "source": "iana"
+ },
+ "text/vnd.wap.wml": {
+ "source": "iana",
+ "extensions": ["wml"]
+ },
+ "text/vnd.wap.wmlscript": {
+ "source": "iana",
+ "extensions": ["wmls"]
+ },
+ "text/vtt": {
+ "source": "iana",
+ "charset": "UTF-8",
+ "compressible": true,
+ "extensions": ["vtt"]
+ },
+ "text/x-asm": {
+ "source": "apache",
+ "extensions": ["s","asm"]
+ },
+ "text/x-c": {
+ "source": "apache",
+ "extensions": ["c","cc","cxx","cpp","h","hh","dic"]
+ },
+ "text/x-component": {
+ "source": "nginx",
+ "extensions": ["htc"]
+ },
+ "text/x-fortran": {
+ "source": "apache",
+ "extensions": ["f","for","f77","f90"]
+ },
+ "text/x-gwt-rpc": {
+ "compressible": true
+ },
+ "text/x-handlebars-template": {
+ "extensions": ["hbs"]
+ },
+ "text/x-java-source": {
+ "source": "apache",
+ "extensions": ["java"]
+ },
+ "text/x-jquery-tmpl": {
+ "compressible": true
+ },
+ "text/x-lua": {
+ "extensions": ["lua"]
+ },
+ "text/x-markdown": {
+ "compressible": true,
+ "extensions": ["mkd"]
+ },
+ "text/x-nfo": {
+ "source": "apache",
+ "extensions": ["nfo"]
+ },
+ "text/x-opml": {
+ "source": "apache",
+ "extensions": ["opml"]
+ },
+ "text/x-org": {
+ "compressible": true,
+ "extensions": ["org"]
+ },
+ "text/x-pascal": {
+ "source": "apache",
+ "extensions": ["p","pas"]
+ },
+ "text/x-processing": {
+ "compressible": true,
+ "extensions": ["pde"]
+ },
+ "text/x-sass": {
+ "extensions": ["sass"]
+ },
+ "text/x-scss": {
+ "extensions": ["scss"]
+ },
+ "text/x-setext": {
+ "source": "apache",
+ "extensions": ["etx"]
+ },
+ "text/x-sfv": {
+ "source": "apache",
+ "extensions": ["sfv"]
+ },
+ "text/x-suse-ymp": {
+ "compressible": true,
+ "extensions": ["ymp"]
+ },
+ "text/x-uuencode": {
+ "source": "apache",
+ "extensions": ["uu"]
+ },
+ "text/x-vcalendar": {
+ "source": "apache",
+ "extensions": ["vcs"]
+ },
+ "text/x-vcard": {
+ "source": "apache",
+ "extensions": ["vcf"]
+ },
+ "text/xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["xml"]
+ },
+ "text/xml-external-parsed-entity": {
+ "source": "iana"
+ },
+ "text/yaml": {
+ "compressible": true,
+ "extensions": ["yaml","yml"]
+ },
+ "video/1d-interleaved-parityfec": {
+ "source": "iana"
+ },
+ "video/3gpp": {
+ "source": "iana",
+ "extensions": ["3gp","3gpp"]
+ },
+ "video/3gpp-tt": {
+ "source": "iana"
+ },
+ "video/3gpp2": {
+ "source": "iana",
+ "extensions": ["3g2"]
+ },
+ "video/av1": {
+ "source": "iana"
+ },
+ "video/bmpeg": {
+ "source": "iana"
+ },
+ "video/bt656": {
+ "source": "iana"
+ },
+ "video/celb": {
+ "source": "iana"
+ },
+ "video/dv": {
+ "source": "iana"
+ },
+ "video/encaprtp": {
+ "source": "iana"
+ },
+ "video/ffv1": {
+ "source": "iana"
+ },
+ "video/flexfec": {
+ "source": "iana"
+ },
+ "video/h261": {
+ "source": "iana",
+ "extensions": ["h261"]
+ },
+ "video/h263": {
+ "source": "iana",
+ "extensions": ["h263"]
+ },
+ "video/h263-1998": {
+ "source": "iana"
+ },
+ "video/h263-2000": {
+ "source": "iana"
+ },
+ "video/h264": {
+ "source": "iana",
+ "extensions": ["h264"]
+ },
+ "video/h264-rcdo": {
+ "source": "iana"
+ },
+ "video/h264-svc": {
+ "source": "iana"
+ },
+ "video/h265": {
+ "source": "iana"
+ },
+ "video/iso.segment": {
+ "source": "iana",
+ "extensions": ["m4s"]
+ },
+ "video/jpeg": {
+ "source": "iana",
+ "extensions": ["jpgv"]
+ },
+ "video/jpeg2000": {
+ "source": "iana"
+ },
+ "video/jpm": {
+ "source": "apache",
+ "extensions": ["jpm","jpgm"]
+ },
+ "video/jxsv": {
+ "source": "iana"
+ },
+ "video/mj2": {
+ "source": "iana",
+ "extensions": ["mj2","mjp2"]
+ },
+ "video/mp1s": {
+ "source": "iana"
+ },
+ "video/mp2p": {
+ "source": "iana"
+ },
+ "video/mp2t": {
+ "source": "iana",
+ "extensions": ["ts"]
+ },
+ "video/mp4": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["mp4","mp4v","mpg4"]
+ },
+ "video/mp4v-es": {
+ "source": "iana"
+ },
+ "video/mpeg": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["mpeg","mpg","mpe","m1v","m2v"]
+ },
+ "video/mpeg4-generic": {
+ "source": "iana"
+ },
+ "video/mpv": {
+ "source": "iana"
+ },
+ "video/nv": {
+ "source": "iana"
+ },
+ "video/ogg": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["ogv"]
+ },
+ "video/parityfec": {
+ "source": "iana"
+ },
+ "video/pointer": {
+ "source": "iana"
+ },
+ "video/quicktime": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["qt","mov"]
+ },
+ "video/raptorfec": {
+ "source": "iana"
+ },
+ "video/raw": {
+ "source": "iana"
+ },
+ "video/rtp-enc-aescm128": {
+ "source": "iana"
+ },
+ "video/rtploopback": {
+ "source": "iana"
+ },
+ "video/rtx": {
+ "source": "iana"
+ },
+ "video/scip": {
+ "source": "iana"
+ },
+ "video/smpte291": {
+ "source": "iana"
+ },
+ "video/smpte292m": {
+ "source": "iana"
+ },
+ "video/ulpfec": {
+ "source": "iana"
+ },
+ "video/vc1": {
+ "source": "iana"
+ },
+ "video/vc2": {
+ "source": "iana"
+ },
+ "video/vnd.cctv": {
+ "source": "iana"
+ },
+ "video/vnd.dece.hd": {
+ "source": "iana",
+ "extensions": ["uvh","uvvh"]
+ },
+ "video/vnd.dece.mobile": {
+ "source": "iana",
+ "extensions": ["uvm","uvvm"]
+ },
+ "video/vnd.dece.mp4": {
+ "source": "iana"
+ },
+ "video/vnd.dece.pd": {
+ "source": "iana",
+ "extensions": ["uvp","uvvp"]
+ },
+ "video/vnd.dece.sd": {
+ "source": "iana",
+ "extensions": ["uvs","uvvs"]
+ },
+ "video/vnd.dece.video": {
+ "source": "iana",
+ "extensions": ["uvv","uvvv"]
+ },
+ "video/vnd.directv.mpeg": {
+ "source": "iana"
+ },
+ "video/vnd.directv.mpeg-tts": {
+ "source": "iana"
+ },
+ "video/vnd.dlna.mpeg-tts": {
+ "source": "iana"
+ },
+ "video/vnd.dvb.file": {
+ "source": "iana",
+ "extensions": ["dvb"]
+ },
+ "video/vnd.fvt": {
+ "source": "iana",
+ "extensions": ["fvt"]
+ },
+ "video/vnd.hns.video": {
+ "source": "iana"
+ },
+ "video/vnd.iptvforum.1dparityfec-1010": {
+ "source": "iana"
+ },
+ "video/vnd.iptvforum.1dparityfec-2005": {
+ "source": "iana"
+ },
+ "video/vnd.iptvforum.2dparityfec-1010": {
+ "source": "iana"
+ },
+ "video/vnd.iptvforum.2dparityfec-2005": {
+ "source": "iana"
+ },
+ "video/vnd.iptvforum.ttsavc": {
+ "source": "iana"
+ },
+ "video/vnd.iptvforum.ttsmpeg2": {
+ "source": "iana"
+ },
+ "video/vnd.motorola.video": {
+ "source": "iana"
+ },
+ "video/vnd.motorola.videop": {
+ "source": "iana"
+ },
+ "video/vnd.mpegurl": {
+ "source": "iana",
+ "extensions": ["mxu","m4u"]
+ },
+ "video/vnd.ms-playready.media.pyv": {
+ "source": "iana",
+ "extensions": ["pyv"]
+ },
+ "video/vnd.nokia.interleaved-multimedia": {
+ "source": "iana"
+ },
+ "video/vnd.nokia.mp4vr": {
+ "source": "iana"
+ },
+ "video/vnd.nokia.videovoip": {
+ "source": "iana"
+ },
+ "video/vnd.objectvideo": {
+ "source": "iana"
+ },
+ "video/vnd.radgamettools.bink": {
+ "source": "iana"
+ },
+ "video/vnd.radgamettools.smacker": {
+ "source": "iana"
+ },
+ "video/vnd.sealed.mpeg1": {
+ "source": "iana"
+ },
+ "video/vnd.sealed.mpeg4": {
+ "source": "iana"
+ },
+ "video/vnd.sealed.swf": {
+ "source": "iana"
+ },
+ "video/vnd.sealedmedia.softseal.mov": {
+ "source": "iana"
+ },
+ "video/vnd.uvvu.mp4": {
+ "source": "iana",
+ "extensions": ["uvu","uvvu"]
+ },
+ "video/vnd.vivo": {
+ "source": "iana",
+ "extensions": ["viv"]
+ },
+ "video/vnd.youtube.yt": {
+ "source": "iana"
+ },
+ "video/vp8": {
+ "source": "iana"
+ },
+ "video/vp9": {
+ "source": "iana"
+ },
+ "video/webm": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["webm"]
+ },
+ "video/x-f4v": {
+ "source": "apache",
+ "extensions": ["f4v"]
+ },
+ "video/x-fli": {
+ "source": "apache",
+ "extensions": ["fli"]
+ },
+ "video/x-flv": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["flv"]
+ },
+ "video/x-m4v": {
+ "source": "apache",
+ "extensions": ["m4v"]
+ },
+ "video/x-matroska": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["mkv","mk3d","mks"]
+ },
+ "video/x-mng": {
+ "source": "apache",
+ "extensions": ["mng"]
+ },
+ "video/x-ms-asf": {
+ "source": "apache",
+ "extensions": ["asf","asx"]
+ },
+ "video/x-ms-vob": {
+ "source": "apache",
+ "extensions": ["vob"]
+ },
+ "video/x-ms-wm": {
+ "source": "apache",
+ "extensions": ["wm"]
+ },
+ "video/x-ms-wmv": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["wmv"]
+ },
+ "video/x-ms-wmx": {
+ "source": "apache",
+ "extensions": ["wmx"]
+ },
+ "video/x-ms-wvx": {
+ "source": "apache",
+ "extensions": ["wvx"]
+ },
+ "video/x-msvideo": {
+ "source": "apache",
+ "extensions": ["avi"]
+ },
+ "video/x-sgi-movie": {
+ "source": "apache",
+ "extensions": ["movie"]
+ },
+ "video/x-smv": {
+ "source": "apache",
+ "extensions": ["smv"]
+ },
+ "x-conference/x-cooltalk": {
+ "source": "apache",
+ "extensions": ["ice"]
+ },
+ "x-shader/x-fragment": {
+ "compressible": true
+ },
+ "x-shader/x-vertex": {
+ "compressible": true
+ }
+}
diff --git a/node_modules/mime-db/index.js b/node_modules/mime-db/index.js
new file mode 100644
index 0000000..ec2be30
--- /dev/null
+++ b/node_modules/mime-db/index.js
@@ -0,0 +1,12 @@
+/*!
+ * mime-db
+ * Copyright(c) 2014 Jonathan Ong
+ * Copyright(c) 2015-2022 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+/**
+ * Module exports.
+ */
+
+module.exports = require('./db.json')
diff --git a/node_modules/mime-db/package.json b/node_modules/mime-db/package.json
new file mode 100644
index 0000000..32c14b8
--- /dev/null
+++ b/node_modules/mime-db/package.json
@@ -0,0 +1,60 @@
+{
+ "name": "mime-db",
+ "description": "Media Type Database",
+ "version": "1.52.0",
+ "contributors": [
+ "Douglas Christopher Wilson <doug@somethingdoug.com>",
+ "Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)",
+ "Robert Kieffer <robert@broofa.com> (http://github.com/broofa)"
+ ],
+ "license": "MIT",
+ "keywords": [
+ "mime",
+ "db",
+ "type",
+ "types",
+ "database",
+ "charset",
+ "charsets"
+ ],
+ "repository": "jshttp/mime-db",
+ "devDependencies": {
+ "bluebird": "3.7.2",
+ "co": "4.6.0",
+ "cogent": "1.0.1",
+ "csv-parse": "4.16.3",
+ "eslint": "7.32.0",
+ "eslint-config-standard": "15.0.1",
+ "eslint-plugin-import": "2.25.4",
+ "eslint-plugin-markdown": "2.2.1",
+ "eslint-plugin-node": "11.1.0",
+ "eslint-plugin-promise": "5.1.1",
+ "eslint-plugin-standard": "4.1.0",
+ "gnode": "0.1.2",
+ "media-typer": "1.1.0",
+ "mocha": "9.2.1",
+ "nyc": "15.1.0",
+ "raw-body": "2.5.0",
+ "stream-to-array": "2.3.0"
+ },
+ "files": [
+ "HISTORY.md",
+ "LICENSE",
+ "README.md",
+ "db.json",
+ "index.js"
+ ],
+ "engines": {
+ "node": ">= 0.6"
+ },
+ "scripts": {
+ "build": "node scripts/build",
+ "fetch": "node scripts/fetch-apache && gnode scripts/fetch-iana && node scripts/fetch-nginx",
+ "lint": "eslint .",
+ "test": "mocha --reporter spec --bail --check-leaks test/",
+ "test-ci": "nyc --reporter=lcov --reporter=text npm test",
+ "test-cov": "nyc --reporter=html --reporter=text npm test",
+ "update": "npm run fetch && npm run build",
+ "version": "node scripts/version-history.js && git add HISTORY.md"
+ }
+}
diff --git a/node_modules/mime-types/HISTORY.md b/node_modules/mime-types/HISTORY.md
new file mode 100644
index 0000000..c5043b7
--- /dev/null
+++ b/node_modules/mime-types/HISTORY.md
@@ -0,0 +1,397 @@
+2.1.35 / 2022-03-12
+===================
+
+ * deps: mime-db@1.52.0
+ - Add extensions from IANA for more `image/*` types
+ - Add extension `.asc` to `application/pgp-keys`
+ - Add extensions to various XML types
+ - Add new upstream MIME types
+
+2.1.34 / 2021-11-08
+===================
+
+ * deps: mime-db@1.51.0
+ - Add new upstream MIME types
+
+2.1.33 / 2021-10-01
+===================
+
+ * deps: mime-db@1.50.0
+ - Add deprecated iWorks mime types and extensions
+ - Add new upstream MIME types
+
+2.1.32 / 2021-07-27
+===================
+
+ * deps: mime-db@1.49.0
+ - Add extension `.trig` to `application/trig`
+ - Add new upstream MIME types
+
+2.1.31 / 2021-06-01
+===================
+
+ * deps: mime-db@1.48.0
+ - Add extension `.mvt` to `application/vnd.mapbox-vector-tile`
+ - Add new upstream MIME types
+
+2.1.30 / 2021-04-02
+===================
+
+ * deps: mime-db@1.47.0
+ - Add extension `.amr` to `audio/amr`
+ - Remove ambigious extensions from IANA for `application/*+xml` types
+ - Update primary extension to `.es` for `application/ecmascript`
+
+2.1.29 / 2021-02-17
+===================
+
+ * deps: mime-db@1.46.0
+ - Add extension `.amr` to `audio/amr`
+ - Add extension `.m4s` to `video/iso.segment`
+ - Add extension `.opus` to `audio/ogg`
+ - Add new upstream MIME types
+
+2.1.28 / 2021-01-01
+===================
+
+ * deps: mime-db@1.45.0
+ - Add `application/ubjson` with extension `.ubj`
+ - Add `image/avif` with extension `.avif`
+ - Add `image/ktx2` with extension `.ktx2`
+ - Add extension `.dbf` to `application/vnd.dbf`
+ - Add extension `.rar` to `application/vnd.rar`
+ - Add extension `.td` to `application/urc-targetdesc+xml`
+ - Add new upstream MIME types
+ - Fix extension of `application/vnd.apple.keynote` to be `.key`
+
+2.1.27 / 2020-04-23
+===================
+
+ * deps: mime-db@1.44.0
+ - Add charsets from IANA
+ - Add extension `.cjs` to `application/node`
+ - Add new upstream MIME types
+
+2.1.26 / 2020-01-05
+===================
+
+ * deps: mime-db@1.43.0
+ - Add `application/x-keepass2` with extension `.kdbx`
+ - Add extension `.mxmf` to `audio/mobile-xmf`
+ - Add extensions from IANA for `application/*+xml` types
+ - Add new upstream MIME types
+
+2.1.25 / 2019-11-12
+===================
+
+ * deps: mime-db@1.42.0
+ - Add new upstream MIME types
+ - Add `application/toml` with extension `.toml`
+ - Add `image/vnd.ms-dds` with extension `.dds`
+
+2.1.24 / 2019-04-20
+===================
+
+ * deps: mime-db@1.40.0
+ - Add extensions from IANA for `model/*` types
+ - Add `text/mdx` with extension `.mdx`
+
+2.1.23 / 2019-04-17
+===================
+
+ * deps: mime-db@~1.39.0
+ - Add extensions `.siv` and `.sieve` to `application/sieve`
+ - Add new upstream MIME types
+
+2.1.22 / 2019-02-14
+===================
+
+ * deps: mime-db@~1.38.0
+ - Add extension `.nq` to `application/n-quads`
+ - Add extension `.nt` to `application/n-triples`
+ - Add new upstream MIME types
+
+2.1.21 / 2018-10-19
+===================
+
+ * deps: mime-db@~1.37.0
+ - Add extensions to HEIC image types
+ - Add new upstream MIME types
+
+2.1.20 / 2018-08-26
+===================
+
+ * deps: mime-db@~1.36.0
+ - Add Apple file extensions from IANA
+ - Add extensions from IANA for `image/*` types
+ - Add new upstream MIME types
+
+2.1.19 / 2018-07-17
+===================
+
+ * deps: mime-db@~1.35.0
+ - Add extension `.csl` to `application/vnd.citationstyles.style+xml`
+ - Add extension `.es` to `application/ecmascript`
+ - Add extension `.owl` to `application/rdf+xml`
+ - Add new upstream MIME types
+ - Add UTF-8 as default charset for `text/turtle`
+
+2.1.18 / 2018-02-16
+===================
+
+ * deps: mime-db@~1.33.0
+ - Add `application/raml+yaml` with extension `.raml`
+ - Add `application/wasm` with extension `.wasm`
+ - Add `text/shex` with extension `.shex`
+ - Add extensions for JPEG-2000 images
+ - Add extensions from IANA for `message/*` types
+ - Add new upstream MIME types
+ - Update font MIME types
+ - Update `text/hjson` to registered `application/hjson`
+
+2.1.17 / 2017-09-01
+===================
+
+ * deps: mime-db@~1.30.0
+ - Add `application/vnd.ms-outlook`
+ - Add `application/x-arj`
+ - Add extension `.mjs` to `application/javascript`
+ - Add glTF types and extensions
+ - Add new upstream MIME types
+ - Add `text/x-org`
+ - Add VirtualBox MIME types
+ - Fix `source` records for `video/*` types that are IANA
+ - Update `font/opentype` to registered `font/otf`
+
+2.1.16 / 2017-07-24
+===================
+
+ * deps: mime-db@~1.29.0
+ - Add `application/fido.trusted-apps+json`
+ - Add extension `.wadl` to `application/vnd.sun.wadl+xml`
+ - Add extension `.gz` to `application/gzip`
+ - Add new upstream MIME types
+ - Update extensions `.md` and `.markdown` to be `text/markdown`
+
+2.1.15 / 2017-03-23
+===================
+
+ * deps: mime-db@~1.27.0
+ - Add new mime types
+ - Add `image/apng`
+
+2.1.14 / 2017-01-14
+===================
+
+ * deps: mime-db@~1.26.0
+ - Add new mime types
+
+2.1.13 / 2016-11-18
+===================
+
+ * deps: mime-db@~1.25.0
+ - Add new mime types
+
+2.1.12 / 2016-09-18
+===================
+
+ * deps: mime-db@~1.24.0
+ - Add new mime types
+ - Add `audio/mp3`
+
+2.1.11 / 2016-05-01
+===================
+
+ * deps: mime-db@~1.23.0
+ - Add new mime types
+
+2.1.10 / 2016-02-15
+===================
+
+ * deps: mime-db@~1.22.0
+ - Add new mime types
+ - Fix extension of `application/dash+xml`
+ - Update primary extension for `audio/mp4`
+
+2.1.9 / 2016-01-06
+==================
+
+ * deps: mime-db@~1.21.0
+ - Add new mime types
+
+2.1.8 / 2015-11-30
+==================
+
+ * deps: mime-db@~1.20.0
+ - Add new mime types
+
+2.1.7 / 2015-09-20
+==================
+
+ * deps: mime-db@~1.19.0
+ - Add new mime types
+
+2.1.6 / 2015-09-03
+==================
+
+ * deps: mime-db@~1.18.0
+ - Add new mime types
+
+2.1.5 / 2015-08-20
+==================
+
+ * deps: mime-db@~1.17.0
+ - Add new mime types
+
+2.1.4 / 2015-07-30
+==================
+
+ * deps: mime-db@~1.16.0
+ - Add new mime types
+
+2.1.3 / 2015-07-13
+==================
+
+ * deps: mime-db@~1.15.0
+ - Add new mime types
+
+2.1.2 / 2015-06-25
+==================
+
+ * deps: mime-db@~1.14.0
+ - Add new mime types
+
+2.1.1 / 2015-06-08
+==================
+
+ * perf: fix deopt during mapping
+
+2.1.0 / 2015-06-07
+==================
+
+ * Fix incorrectly treating extension-less file name as extension
+ - i.e. `'path/to/json'` will no longer return `application/json`
+ * Fix `.charset(type)` to accept parameters
+ * Fix `.charset(type)` to match case-insensitive
+ * Improve generation of extension to MIME mapping
+ * Refactor internals for readability and no argument reassignment
+ * Prefer `application/*` MIME types from the same source
+ * Prefer any type over `application/octet-stream`
+ * deps: mime-db@~1.13.0
+ - Add nginx as a source
+ - Add new mime types
+
+2.0.14 / 2015-06-06
+===================
+
+ * deps: mime-db@~1.12.0
+ - Add new mime types
+
+2.0.13 / 2015-05-31
+===================
+
+ * deps: mime-db@~1.11.0
+ - Add new mime types
+
+2.0.12 / 2015-05-19
+===================
+
+ * deps: mime-db@~1.10.0
+ - Add new mime types
+
+2.0.11 / 2015-05-05
+===================
+
+ * deps: mime-db@~1.9.1
+ - Add new mime types
+
+2.0.10 / 2015-03-13
+===================
+
+ * deps: mime-db@~1.8.0
+ - Add new mime types
+
+2.0.9 / 2015-02-09
+==================
+
+ * deps: mime-db@~1.7.0
+ - Add new mime types
+ - Community extensions ownership transferred from `node-mime`
+
+2.0.8 / 2015-01-29
+==================
+
+ * deps: mime-db@~1.6.0
+ - Add new mime types
+
+2.0.7 / 2014-12-30
+==================
+
+ * deps: mime-db@~1.5.0
+ - Add new mime types
+ - Fix various invalid MIME type entries
+
+2.0.6 / 2014-12-30
+==================
+
+ * deps: mime-db@~1.4.0
+ - Add new mime types
+ - Fix various invalid MIME type entries
+ - Remove example template MIME types
+
+2.0.5 / 2014-12-29
+==================
+
+ * deps: mime-db@~1.3.1
+ - Fix missing extensions
+
+2.0.4 / 2014-12-10
+==================
+
+ * deps: mime-db@~1.3.0
+ - Add new mime types
+
+2.0.3 / 2014-11-09
+==================
+
+ * deps: mime-db@~1.2.0
+ - Add new mime types
+
+2.0.2 / 2014-09-28
+==================
+
+ * deps: mime-db@~1.1.0
+ - Add new mime types
+ - Update charsets
+
+2.0.1 / 2014-09-07
+==================
+
+ * Support Node.js 0.6
+
+2.0.0 / 2014-09-02
+==================
+
+ * Use `mime-db`
+ * Remove `.define()`
+
+1.0.2 / 2014-08-04
+==================
+
+ * Set charset=utf-8 for `text/javascript`
+
+1.0.1 / 2014-06-24
+==================
+
+ * Add `text/jsx` type
+
+1.0.0 / 2014-05-12
+==================
+
+ * Return `false` for unknown types
+ * Set charset=utf-8 for `application/json`
+
+0.1.0 / 2014-05-02
+==================
+
+ * Initial release
diff --git a/node_modules/mime-types/LICENSE b/node_modules/mime-types/LICENSE
new file mode 100644
index 0000000..0616607
--- /dev/null
+++ b/node_modules/mime-types/LICENSE
@@ -0,0 +1,23 @@
+(The MIT License)
+
+Copyright (c) 2014 Jonathan Ong <me@jongleberry.com>
+Copyright (c) 2015 Douglas Christopher Wilson <doug@somethingdoug.com>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/mime-types/README.md b/node_modules/mime-types/README.md
new file mode 100644
index 0000000..48d2fb4
--- /dev/null
+++ b/node_modules/mime-types/README.md
@@ -0,0 +1,113 @@
+# mime-types
+
+[![NPM Version][npm-version-image]][npm-url]
+[![NPM Downloads][npm-downloads-image]][npm-url]
+[![Node.js Version][node-version-image]][node-version-url]
+[![Build Status][ci-image]][ci-url]
+[![Test Coverage][coveralls-image]][coveralls-url]
+
+The ultimate javascript content-type utility.
+
+Similar to [the `mime@1.x` module](https://www.npmjs.com/package/mime), except:
+
+- __No fallbacks.__ Instead of naively returning the first available type,
+ `mime-types` simply returns `false`, so do
+ `var type = mime.lookup('unrecognized') || 'application/octet-stream'`.
+- No `new Mime()` business, so you could do `var lookup = require('mime-types').lookup`.
+- No `.define()` functionality
+- Bug fixes for `.lookup(path)`
+
+Otherwise, the API is compatible with `mime` 1.x.
+
+## Install
+
+This is a [Node.js](https://nodejs.org/en/) module available through the
+[npm registry](https://www.npmjs.com/). Installation is done using the
+[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
+
+```sh
+$ npm install mime-types
+```
+
+## Adding Types
+
+All mime types are based on [mime-db](https://www.npmjs.com/package/mime-db),
+so open a PR there if you'd like to add mime types.
+
+## API
+
+```js
+var mime = require('mime-types')
+```
+
+All functions return `false` if input is invalid or not found.
+
+### mime.lookup(path)
+
+Lookup the content-type associated with a file.
+
+```js
+mime.lookup('json') // 'application/json'
+mime.lookup('.md') // 'text/markdown'
+mime.lookup('file.html') // 'text/html'
+mime.lookup('folder/file.js') // 'application/javascript'
+mime.lookup('folder/.htaccess') // false
+
+mime.lookup('cats') // false
+```
+
+### mime.contentType(type)
+
+Create a full content-type header given a content-type or extension.
+When given an extension, `mime.lookup` is used to get the matching
+content-type, otherwise the given content-type is used. Then if the
+content-type does not already have a `charset` parameter, `mime.charset`
+is used to get the default charset and add to the returned content-type.
+
+```js
+mime.contentType('markdown') // 'text/x-markdown; charset=utf-8'
+mime.contentType('file.json') // 'application/json; charset=utf-8'
+mime.contentType('text/html') // 'text/html; charset=utf-8'
+mime.contentType('text/html; charset=iso-8859-1') // 'text/html; charset=iso-8859-1'
+
+// from a full path
+mime.contentType(path.extname('/path/to/file.json')) // 'application/json; charset=utf-8'
+```
+
+### mime.extension(type)
+
+Get the default extension for a content-type.
+
+```js
+mime.extension('application/octet-stream') // 'bin'
+```
+
+### mime.charset(type)
+
+Lookup the implied default charset of a content-type.
+
+```js
+mime.charset('text/markdown') // 'UTF-8'
+```
+
+### var type = mime.types[extension]
+
+A map of content-types by extension.
+
+### [extensions...] = mime.extensions[type]
+
+A map of extensions by content-type.
+
+## License
+
+[MIT](LICENSE)
+
+[ci-image]: https://badgen.net/github/checks/jshttp/mime-types/master?label=ci
+[ci-url]: https://github.com/jshttp/mime-types/actions/workflows/ci.yml
+[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/mime-types/master
+[coveralls-url]: https://coveralls.io/r/jshttp/mime-types?branch=master
+[node-version-image]: https://badgen.net/npm/node/mime-types
+[node-version-url]: https://nodejs.org/en/download
+[npm-downloads-image]: https://badgen.net/npm/dm/mime-types
+[npm-url]: https://npmjs.org/package/mime-types
+[npm-version-image]: https://badgen.net/npm/v/mime-types
diff --git a/node_modules/mime-types/index.js b/node_modules/mime-types/index.js
new file mode 100644
index 0000000..b9f34d5
--- /dev/null
+++ b/node_modules/mime-types/index.js
@@ -0,0 +1,188 @@
+/*!
+ * mime-types
+ * Copyright(c) 2014 Jonathan Ong
+ * Copyright(c) 2015 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict'
+
+/**
+ * Module dependencies.
+ * @private
+ */
+
+var db = require('mime-db')
+var extname = require('path').extname
+
+/**
+ * Module variables.
+ * @private
+ */
+
+var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/
+var TEXT_TYPE_REGEXP = /^text\//i
+
+/**
+ * Module exports.
+ * @public
+ */
+
+exports.charset = charset
+exports.charsets = { lookup: charset }
+exports.contentType = contentType
+exports.extension = extension
+exports.extensions = Object.create(null)
+exports.lookup = lookup
+exports.types = Object.create(null)
+
+// Populate the extensions/types maps
+populateMaps(exports.extensions, exports.types)
+
+/**
+ * Get the default charset for a MIME type.
+ *
+ * @param {string} type
+ * @return {boolean|string}
+ */
+
+function charset (type) {
+ if (!type || typeof type !== 'string') {
+ return false
+ }
+
+ // TODO: use media-typer
+ var match = EXTRACT_TYPE_REGEXP.exec(type)
+ var mime = match && db[match[1].toLowerCase()]
+
+ if (mime && mime.charset) {
+ return mime.charset
+ }
+
+ // default text/* to utf-8
+ if (match && TEXT_TYPE_REGEXP.test(match[1])) {
+ return 'UTF-8'
+ }
+
+ return false
+}
+
+/**
+ * Create a full Content-Type header given a MIME type or extension.
+ *
+ * @param {string} str
+ * @return {boolean|string}
+ */
+
+function contentType (str) {
+ // TODO: should this even be in this module?
+ if (!str || typeof str !== 'string') {
+ return false
+ }
+
+ var mime = str.indexOf('/') === -1
+ ? exports.lookup(str)
+ : str
+
+ if (!mime) {
+ return false
+ }
+
+ // TODO: use content-type or other module
+ if (mime.indexOf('charset') === -1) {
+ var charset = exports.charset(mime)
+ if (charset) mime += '; charset=' + charset.toLowerCase()
+ }
+
+ return mime
+}
+
+/**
+ * Get the default extension for a MIME type.
+ *
+ * @param {string} type
+ * @return {boolean|string}
+ */
+
+function extension (type) {
+ if (!type || typeof type !== 'string') {
+ return false
+ }
+
+ // TODO: use media-typer
+ var match = EXTRACT_TYPE_REGEXP.exec(type)
+
+ // get extensions
+ var exts = match && exports.extensions[match[1].toLowerCase()]
+
+ if (!exts || !exts.length) {
+ return false
+ }
+
+ return exts[0]
+}
+
+/**
+ * Lookup the MIME type for a file path/extension.
+ *
+ * @param {string} path
+ * @return {boolean|string}
+ */
+
+function lookup (path) {
+ if (!path || typeof path !== 'string') {
+ return false
+ }
+
+ // get the extension ("ext" or ".ext" or full path)
+ var extension = extname('x.' + path)
+ .toLowerCase()
+ .substr(1)
+
+ if (!extension) {
+ return false
+ }
+
+ return exports.types[extension] || false
+}
+
+/**
+ * Populate the extensions and types maps.
+ * @private
+ */
+
+function populateMaps (extensions, types) {
+ // source preference (least -> most)
+ var preference = ['nginx', 'apache', undefined, 'iana']
+
+ Object.keys(db).forEach(function forEachMimeType (type) {
+ var mime = db[type]
+ var exts = mime.extensions
+
+ if (!exts || !exts.length) {
+ return
+ }
+
+ // mime -> extensions
+ extensions[type] = exts
+
+ // extension -> mime
+ for (var i = 0; i < exts.length; i++) {
+ var extension = exts[i]
+
+ if (types[extension]) {
+ var from = preference.indexOf(db[types[extension]].source)
+ var to = preference.indexOf(mime.source)
+
+ if (types[extension] !== 'application/octet-stream' &&
+ (from > to || (from === to && types[extension].substr(0, 12) === 'application/'))) {
+ // skip the remapping
+ continue
+ }
+ }
+
+ // set the extension -> mime
+ types[extension] = type
+ }
+ })
+}
diff --git a/node_modules/mime-types/package.json b/node_modules/mime-types/package.json
new file mode 100644
index 0000000..bbef696
--- /dev/null
+++ b/node_modules/mime-types/package.json
@@ -0,0 +1,44 @@
+{
+ "name": "mime-types",
+ "description": "The ultimate javascript content-type utility.",
+ "version": "2.1.35",
+ "contributors": [
+ "Douglas Christopher Wilson <doug@somethingdoug.com>",
+ "Jeremiah Senkpiel <fishrock123@rocketmail.com> (https://searchbeam.jit.su)",
+ "Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)"
+ ],
+ "license": "MIT",
+ "keywords": [
+ "mime",
+ "types"
+ ],
+ "repository": "jshttp/mime-types",
+ "dependencies": {
+ "mime-db": "1.52.0"
+ },
+ "devDependencies": {
+ "eslint": "7.32.0",
+ "eslint-config-standard": "14.1.1",
+ "eslint-plugin-import": "2.25.4",
+ "eslint-plugin-markdown": "2.2.1",
+ "eslint-plugin-node": "11.1.0",
+ "eslint-plugin-promise": "5.2.0",
+ "eslint-plugin-standard": "4.1.0",
+ "mocha": "9.2.2",
+ "nyc": "15.1.0"
+ },
+ "files": [
+ "HISTORY.md",
+ "LICENSE",
+ "index.js"
+ ],
+ "engines": {
+ "node": ">= 0.6"
+ },
+ "scripts": {
+ "lint": "eslint .",
+ "test": "mocha --reporter spec test/test.js",
+ "test-ci": "nyc --reporter=lcov --reporter=text npm test",
+ "test-cov": "nyc --reporter=html --reporter=text npm test"
+ }
+}
diff --git a/node_modules/proxy-from-env/.eslintrc b/node_modules/proxy-from-env/.eslintrc
new file mode 100644
index 0000000..a51449b
--- /dev/null
+++ b/node_modules/proxy-from-env/.eslintrc
@@ -0,0 +1,29 @@
+{
+ "env": {
+ "node": true
+ },
+ "rules": {
+ "array-bracket-spacing": [2, "never"],
+ "block-scoped-var": 2,
+ "brace-style": [2, "1tbs"],
+ "camelcase": 1,
+ "computed-property-spacing": [2, "never"],
+ "curly": 2,
+ "eol-last": 2,
+ "eqeqeq": [2, "smart"],
+ "max-depth": [1, 3],
+ "max-len": [1, 80],
+ "max-statements": [1, 15],
+ "new-cap": 1,
+ "no-extend-native": 2,
+ "no-mixed-spaces-and-tabs": 2,
+ "no-trailing-spaces": 2,
+ "no-unused-vars": 1,
+ "no-use-before-define": [2, "nofunc"],
+ "object-curly-spacing": [2, "never"],
+ "quotes": [2, "single", "avoid-escape"],
+ "semi": [2, "always"],
+ "keyword-spacing": [2, {"before": true, "after": true}],
+ "space-unary-ops": 2
+ }
+}
diff --git a/node_modules/proxy-from-env/.travis.yml b/node_modules/proxy-from-env/.travis.yml
new file mode 100644
index 0000000..64a05f9
--- /dev/null
+++ b/node_modules/proxy-from-env/.travis.yml
@@ -0,0 +1,10 @@
+language: node_js
+node_js:
+ - node
+ - lts/*
+script:
+ - npm run lint
+ # test-coverage will also run the tests, but does not print helpful output upon test failure.
+ # So we also run the tests separately.
+ - npm run test
+ - npm run test-coverage && cat coverage/lcov.info | ./node_modules/.bin/coveralls && rm -rf coverage
diff --git a/node_modules/proxy-from-env/LICENSE b/node_modules/proxy-from-env/LICENSE
new file mode 100644
index 0000000..8f25097
--- /dev/null
+++ b/node_modules/proxy-from-env/LICENSE
@@ -0,0 +1,20 @@
+The MIT License
+
+Copyright (C) 2016-2018 Rob Wu <rob@robwu.nl>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/proxy-from-env/README.md b/node_modules/proxy-from-env/README.md
new file mode 100644
index 0000000..e82520c
--- /dev/null
+++ b/node_modules/proxy-from-env/README.md
@@ -0,0 +1,131 @@
+# proxy-from-env
+
+[![Build Status](https://travis-ci.org/Rob--W/proxy-from-env.svg?branch=master)](https://travis-ci.org/Rob--W/proxy-from-env)
+[![Coverage Status](https://coveralls.io/repos/github/Rob--W/proxy-from-env/badge.svg?branch=master)](https://coveralls.io/github/Rob--W/proxy-from-env?branch=master)
+
+`proxy-from-env` is a Node.js package that exports a function (`getProxyForUrl`)
+that takes an input URL (a string or
+[`url.parse`](https://nodejs.org/docs/latest/api/url.html#url_url_parsing)'s
+return value) and returns the desired proxy URL (also a string) based on
+standard proxy environment variables. If no proxy is set, an empty string is
+returned.
+
+It is your responsibility to actually proxy the request using the given URL.
+
+Installation:
+
+```sh
+npm install proxy-from-env
+```
+
+## Example
+This example shows how the data for a URL can be fetched via the
+[`http` module](https://nodejs.org/api/http.html), in a proxy-aware way.
+
+```javascript
+var http = require('http');
+var parseUrl = require('url').parse;
+var getProxyForUrl = require('proxy-from-env').getProxyForUrl;
+
+var some_url = 'http://example.com/something';
+
+// // Example, if there is a proxy server at 10.0.0.1:1234, then setting the
+// // http_proxy environment variable causes the request to go through a proxy.
+// process.env.http_proxy = 'http://10.0.0.1:1234';
+//
+// // But if the host to be proxied is listed in NO_PROXY, then the request is
+// // not proxied (but a direct request is made).
+// process.env.no_proxy = 'example.com';
+
+var proxy_url = getProxyForUrl(some_url); // <-- Our magic.
+if (proxy_url) {
+ // Should be proxied through proxy_url.
+ var parsed_some_url = parseUrl(some_url);
+ var parsed_proxy_url = parseUrl(proxy_url);
+ // A HTTP proxy is quite simple. It is similar to a normal request, except the
+ // path is an absolute URL, and the proxied URL's host is put in the header
+ // instead of the server's actual host.
+ httpOptions = {
+ protocol: parsed_proxy_url.protocol,
+ hostname: parsed_proxy_url.hostname,
+ port: parsed_proxy_url.port,
+ path: parsed_some_url.href,
+ headers: {
+ Host: parsed_some_url.host, // = host name + optional port.
+ },
+ };
+} else {
+ // Direct request.
+ httpOptions = some_url;
+}
+http.get(httpOptions, function(res) {
+ var responses = [];
+ res.on('data', function(chunk) { responses.push(chunk); });
+ res.on('end', function() { console.log(responses.join('')); });
+});
+
+```
+
+## Environment variables
+The environment variables can be specified in lowercase or uppercase, with the
+lowercase name having precedence over the uppercase variant. A variable that is
+not set has the same meaning as a variable that is set but has no value.
+
+### NO\_PROXY
+
+`NO_PROXY` is a list of host names (optionally with a port). If the input URL
+matches any of the entries in `NO_PROXY`, then the input URL should be fetched
+by a direct request (i.e. without a proxy).
+
+Matching follows the following rules:
+
+- `NO_PROXY=*` disables all proxies.
+- Space and commas may be used to separate the entries in the `NO_PROXY` list.
+- If `NO_PROXY` does not contain any entries, then proxies are never disabled.
+- If a port is added after the host name, then the ports must match. If the URL
+ does not have an explicit port name, the protocol's default port is used.
+- Generally, the proxy is only disabled if the host name is an exact match for
+ an entry in the `NO_PROXY` list. The only exceptions are entries that start
+ with a dot or with a wildcard; then the proxy is disabled if the host name
+ ends with the entry.
+
+See `test.js` for examples of what should match and what does not.
+
+### \*\_PROXY
+
+The environment variable used for the proxy depends on the protocol of the URL.
+For example, `https://example.com` uses the "https" protocol, and therefore the
+proxy to be used is `HTTPS_PROXY` (_NOT_ `HTTP_PROXY`, which is _only_ used for
+http:-URLs).
+
+The library is not limited to http(s), other schemes such as
+`FTP_PROXY` (ftp:),
+`WSS_PROXY` (wss:),
+`WS_PROXY` (ws:)
+are also supported.
+
+If present, `ALL_PROXY` is used as fallback if there is no other match.
+
+
+## External resources
+The exact way of parsing the environment variables is not codified in any
+standard. This library is designed to be compatible with formats as expected by
+existing software.
+The following resources were used to determine the desired behavior:
+
+- cURL:
+ https://curl.haxx.se/docs/manpage.html#ENVIRONMENT
+ https://github.com/curl/curl/blob/4af40b3646d3b09f68e419f7ca866ff395d1f897/lib/url.c#L4446-L4514
+ https://github.com/curl/curl/blob/4af40b3646d3b09f68e419f7ca866ff395d1f897/lib/url.c#L4608-L4638
+
+- wget:
+ https://www.gnu.org/software/wget/manual/wget.html#Proxies
+ http://git.savannah.gnu.org/cgit/wget.git/tree/src/init.c?id=636a5f9a1c508aa39e35a3a8e9e54520a284d93d#n383
+ http://git.savannah.gnu.org/cgit/wget.git/tree/src/retr.c?id=93c1517c4071c4288ba5a4b038e7634e4c6b5482#n1278
+
+- W3:
+ https://www.w3.org/Daemon/User/Proxies/ProxyClients.html
+
+- Python's urllib:
+ https://github.com/python/cpython/blob/936135bb97fe04223aa30ca6e98eac8f3ed6b349/Lib/urllib/request.py#L755-L782
+ https://github.com/python/cpython/blob/936135bb97fe04223aa30ca6e98eac8f3ed6b349/Lib/urllib/request.py#L2444-L2479
diff --git a/node_modules/proxy-from-env/index.js b/node_modules/proxy-from-env/index.js
new file mode 100644
index 0000000..df75004
--- /dev/null
+++ b/node_modules/proxy-from-env/index.js
@@ -0,0 +1,108 @@
+'use strict';
+
+var parseUrl = require('url').parse;
+
+var DEFAULT_PORTS = {
+ ftp: 21,
+ gopher: 70,
+ http: 80,
+ https: 443,
+ ws: 80,
+ wss: 443,
+};
+
+var stringEndsWith = String.prototype.endsWith || function(s) {
+ return s.length <= this.length &&
+ this.indexOf(s, this.length - s.length) !== -1;
+};
+
+/**
+ * @param {string|object} url - The URL, or the result from url.parse.
+ * @return {string} The URL of the proxy that should handle the request to the
+ * given URL. If no proxy is set, this will be an empty string.
+ */
+function getProxyForUrl(url) {
+ var parsedUrl = typeof url === 'string' ? parseUrl(url) : url || {};
+ var proto = parsedUrl.protocol;
+ var hostname = parsedUrl.host;
+ var port = parsedUrl.port;
+ if (typeof hostname !== 'string' || !hostname || typeof proto !== 'string') {
+ return ''; // Don't proxy URLs without a valid scheme or host.
+ }
+
+ proto = proto.split(':', 1)[0];
+ // Stripping ports in this way instead of using parsedUrl.hostname to make
+ // sure that the brackets around IPv6 addresses are kept.
+ hostname = hostname.replace(/:\d*$/, '');
+ port = parseInt(port) || DEFAULT_PORTS[proto] || 0;
+ if (!shouldProxy(hostname, port)) {
+ return ''; // Don't proxy URLs that match NO_PROXY.
+ }
+
+ var proxy =
+ getEnv('npm_config_' + proto + '_proxy') ||
+ getEnv(proto + '_proxy') ||
+ getEnv('npm_config_proxy') ||
+ getEnv('all_proxy');
+ if (proxy && proxy.indexOf('://') === -1) {
+ // Missing scheme in proxy, default to the requested URL's scheme.
+ proxy = proto + '://' + proxy;
+ }
+ return proxy;
+}
+
+/**
+ * Determines whether a given URL should be proxied.
+ *
+ * @param {string} hostname - The host name of the URL.
+ * @param {number} port - The effective port of the URL.
+ * @returns {boolean} Whether the given URL should be proxied.
+ * @private
+ */
+function shouldProxy(hostname, port) {
+ var NO_PROXY =
+ (getEnv('npm_config_no_proxy') || getEnv('no_proxy')).toLowerCase();
+ if (!NO_PROXY) {
+ return true; // Always proxy if NO_PROXY is not set.
+ }
+ if (NO_PROXY === '*') {
+ return false; // Never proxy if wildcard is set.
+ }
+
+ return NO_PROXY.split(/[,\s]/).every(function(proxy) {
+ if (!proxy) {
+ return true; // Skip zero-length hosts.
+ }
+ var parsedProxy = proxy.match(/^(.+):(\d+)$/);
+ var parsedProxyHostname = parsedProxy ? parsedProxy[1] : proxy;
+ var parsedProxyPort = parsedProxy ? parseInt(parsedProxy[2]) : 0;
+ if (parsedProxyPort && parsedProxyPort !== port) {
+ return true; // Skip if ports don't match.
+ }
+
+ if (!/^[.*]/.test(parsedProxyHostname)) {
+ // No wildcards, so stop proxying if there is an exact match.
+ return hostname !== parsedProxyHostname;
+ }
+
+ if (parsedProxyHostname.charAt(0) === '*') {
+ // Remove leading wildcard.
+ parsedProxyHostname = parsedProxyHostname.slice(1);
+ }
+ // Stop proxying if the hostname ends with the no_proxy host.
+ return !stringEndsWith.call(hostname, parsedProxyHostname);
+ });
+}
+
+/**
+ * Get the value for an environment variable.
+ *
+ * @param {string} key - The name of the environment variable.
+ * @return {string} The value of the environment variable.
+ * @private
+ */
+function getEnv(key) {
+ return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || '';
+}
+
+exports.getProxyForUrl = getProxyForUrl;
diff --git a/node_modules/proxy-from-env/package.json b/node_modules/proxy-from-env/package.json
new file mode 100644
index 0000000..be2b845
--- /dev/null
+++ b/node_modules/proxy-from-env/package.json
@@ -0,0 +1,34 @@
+{
+ "name": "proxy-from-env",
+ "version": "1.1.0",
+ "description": "Offers getProxyForUrl to get the proxy URL for a URL, respecting the *_PROXY (e.g. HTTP_PROXY) and NO_PROXY environment variables.",
+ "main": "index.js",
+ "scripts": {
+ "lint": "eslint *.js",
+ "test": "mocha ./test.js --reporter spec",
+ "test-coverage": "istanbul cover ./node_modules/.bin/_mocha -- --reporter spec"
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/Rob--W/proxy-from-env.git"
+ },
+ "keywords": [
+ "proxy",
+ "http_proxy",
+ "https_proxy",
+ "no_proxy",
+ "environment"
+ ],
+ "author": "Rob Wu <rob@robwu.nl> (https://robwu.nl/)",
+ "license": "MIT",
+ "bugs": {
+ "url": "https://github.com/Rob--W/proxy-from-env/issues"
+ },
+ "homepage": "https://github.com/Rob--W/proxy-from-env#readme",
+ "devDependencies": {
+ "coveralls": "^3.0.9",
+ "eslint": "^6.8.0",
+ "istanbul": "^0.4.5",
+ "mocha": "^7.1.0"
+ }
+}
diff --git a/node_modules/proxy-from-env/test.js b/node_modules/proxy-from-env/test.js
new file mode 100644
index 0000000..abf6542
--- /dev/null
+++ b/node_modules/proxy-from-env/test.js
@@ -0,0 +1,483 @@
+/* eslint max-statements:0 */
+'use strict';
+
+var assert = require('assert');
+var parseUrl = require('url').parse;
+
+var getProxyForUrl = require('./').getProxyForUrl;
+
+// Runs the callback with process.env temporarily set to env.
+function runWithEnv(env, callback) {
+ var originalEnv = process.env;
+ process.env = env;
+ try {
+ callback();
+ } finally {
+ process.env = originalEnv;
+ }
+}
+
+// Defines a test case that checks whether getProxyForUrl(input) === expected.
+function testProxyUrl(env, expected, input) {
+ assert(typeof env === 'object' && env !== null);
+ // Copy object to make sure that the in param does not get modified between
+ // the call of this function and the use of it below.
+ env = JSON.parse(JSON.stringify(env));
+
+ var title = 'getProxyForUrl(' + JSON.stringify(input) + ')' +
+ ' === ' + JSON.stringify(expected);
+
+ // Save call stack for later use.
+ var stack = {};
+ Error.captureStackTrace(stack, testProxyUrl);
+ // Only use the last stack frame because that shows where this function is
+ // called, and that is sufficient for our purpose. No need to flood the logs
+ // with an uninteresting stack trace.
+ stack = stack.stack.split('\n', 2)[1];
+
+ it(title, function() {
+ var actual;
+ runWithEnv(env, function() {
+ actual = getProxyForUrl(input);
+ });
+ if (expected === actual) {
+ return; // Good!
+ }
+ try {
+ assert.strictEqual(expected, actual); // Create a formatted error message.
+ // Should not happen because previously we determined expected !== actual.
+ throw new Error('assert.strictEqual passed. This is impossible!');
+ } catch (e) {
+ // Use the original stack trace, so we can see a helpful line number.
+ e.stack = e.message + stack;
+ throw e;
+ }
+ });
+}
+
+describe('getProxyForUrl', function() {
+ describe('No proxy variables', function() {
+ var env = {};
+ testProxyUrl(env, '', 'http://example.com');
+ testProxyUrl(env, '', 'https://example.com');
+ testProxyUrl(env, '', 'ftp://example.com');
+ });
+
+ describe('Invalid URLs', function() {
+ var env = {};
+ env.ALL_PROXY = 'http://unexpected.proxy';
+ testProxyUrl(env, '', 'bogus');
+ testProxyUrl(env, '', '//example.com');
+ testProxyUrl(env, '', '://example.com');
+ testProxyUrl(env, '', '://');
+ testProxyUrl(env, '', '/path');
+ testProxyUrl(env, '', '');
+ testProxyUrl(env, '', 'http:');
+ testProxyUrl(env, '', 'http:/');
+ testProxyUrl(env, '', 'http://');
+ testProxyUrl(env, '', 'prototype://');
+ testProxyUrl(env, '', 'hasOwnProperty://');
+ testProxyUrl(env, '', '__proto__://');
+ testProxyUrl(env, '', undefined);
+ testProxyUrl(env, '', null);
+ testProxyUrl(env, '', {});
+ testProxyUrl(env, '', {host: 'x', protocol: 1});
+ testProxyUrl(env, '', {host: 1, protocol: 'x'});
+ });
+
+ describe('http_proxy and HTTP_PROXY', function() {
+ var env = {};
+ env.HTTP_PROXY = 'http://http-proxy';
+
+ testProxyUrl(env, '', 'https://example');
+ testProxyUrl(env, 'http://http-proxy', 'http://example');
+ testProxyUrl(env, 'http://http-proxy', parseUrl('http://example'));
+
+ // eslint-disable-next-line camelcase
+ env.http_proxy = 'http://priority';
+ testProxyUrl(env, 'http://priority', 'http://example');
+ });
+
+ describe('http_proxy with non-sensical value', function() {
+ var env = {};
+ // Crazy values should be passed as-is. It is the responsibility of the
+ // one who launches the application that the value makes sense.
+ // TODO: Should we be stricter and perform validation?
+ env.HTTP_PROXY = 'Crazy \n!() { ::// }';
+ testProxyUrl(env, 'Crazy \n!() { ::// }', 'http://wow');
+
+ // The implementation assumes that the HTTP_PROXY environment variable is
+ // somewhat reasonable, and if the scheme is missing, it is added.
+ // Garbage in, garbage out some would say...
+ env.HTTP_PROXY = 'crazy without colon slash slash';
+ testProxyUrl(env, 'http://crazy without colon slash slash', 'http://wow');
+ });
+
+ describe('https_proxy and HTTPS_PROXY', function() {
+ var env = {};
+ // Assert that there is no fall back to http_proxy
+ env.HTTP_PROXY = 'http://unexpected.proxy';
+ testProxyUrl(env, '', 'https://example');
+
+ env.HTTPS_PROXY = 'http://https-proxy';
+ testProxyUrl(env, 'http://https-proxy', 'https://example');
+
+ // eslint-disable-next-line camelcase
+ env.https_proxy = 'http://priority';
+ testProxyUrl(env, 'http://priority', 'https://example');
+ });
+
+ describe('ftp_proxy', function() {
+ var env = {};
+ // Something else than http_proxy / https, as a sanity check.
+ env.FTP_PROXY = 'http://ftp-proxy';
+
+ testProxyUrl(env, 'http://ftp-proxy', 'ftp://example');
+ testProxyUrl(env, '', 'ftps://example');
+ });
+
+ describe('all_proxy', function() {
+ var env = {};
+ env.ALL_PROXY = 'http://catch-all';
+ testProxyUrl(env, 'http://catch-all', 'https://example');
+
+ // eslint-disable-next-line camelcase
+ env.all_proxy = 'http://priority';
+ testProxyUrl(env, 'http://priority', 'https://example');
+ });
+
+ describe('all_proxy without scheme', function() {
+ var env = {};
+ env.ALL_PROXY = 'noscheme';
+ testProxyUrl(env, 'http://noscheme', 'http://example');
+ testProxyUrl(env, 'https://noscheme', 'https://example');
+
+ // The module does not impose restrictions on the scheme.
+ testProxyUrl(env, 'bogus-scheme://noscheme', 'bogus-scheme://example');
+
+ // But the URL should still be valid.
+ testProxyUrl(env, '', 'bogus');
+ });
+
+ describe('no_proxy empty', function() {
+ var env = {};
+ env.HTTPS_PROXY = 'http://proxy';
+
+ // NO_PROXY set but empty.
+ env.NO_PROXY = '';
+ testProxyUrl(env, 'http://proxy', 'https://example');
+
+ // No entries in NO_PROXY (comma).
+ env.NO_PROXY = ',';
+ testProxyUrl(env, 'http://proxy', 'https://example');
+
+ // No entries in NO_PROXY (whitespace).
+ env.NO_PROXY = ' ';
+ testProxyUrl(env, 'http://proxy', 'https://example');
+
+ // No entries in NO_PROXY (multiple whitespace / commas).
+ env.NO_PROXY = ',\t,,,\n, ,\r';
+ testProxyUrl(env, 'http://proxy', 'https://example');
+ });
+
+ describe('no_proxy=example (single host)', function() {
+ var env = {};
+ env.HTTP_PROXY = 'http://proxy';
+
+ env.NO_PROXY = 'example';
+ testProxyUrl(env, '', 'http://example');
+ testProxyUrl(env, '', 'http://example:80');
+ testProxyUrl(env, '', 'http://example:0');
+ testProxyUrl(env, '', 'http://example:1337');
+ testProxyUrl(env, 'http://proxy', 'http://sub.example');
+ testProxyUrl(env, 'http://proxy', 'http://prefexample');
+ testProxyUrl(env, 'http://proxy', 'http://example.no');
+ testProxyUrl(env, 'http://proxy', 'http://a.b.example');
+ testProxyUrl(env, 'http://proxy', 'http://host/example');
+ });
+
+ describe('no_proxy=sub.example (subdomain)', function() {
+ var env = {};
+ env.HTTP_PROXY = 'http://proxy';
+
+ env.NO_PROXY = 'sub.example';
+ testProxyUrl(env, 'http://proxy', 'http://example');
+ testProxyUrl(env, 'http://proxy', 'http://example:80');
+ testProxyUrl(env, 'http://proxy', 'http://example:0');
+ testProxyUrl(env, 'http://proxy', 'http://example:1337');
+ testProxyUrl(env, '', 'http://sub.example');
+ testProxyUrl(env, 'http://proxy', 'http://no.sub.example');
+ testProxyUrl(env, 'http://proxy', 'http://sub-example');
+ testProxyUrl(env, 'http://proxy', 'http://example.sub');
+ });
+
+ describe('no_proxy=example:80 (host + port)', function() {
+ var env = {};
+ env.HTTP_PROXY = 'http://proxy';
+
+ env.NO_PROXY = 'example:80';
+ testProxyUrl(env, '', 'http://example');
+ testProxyUrl(env, '', 'http://example:80');
+ testProxyUrl(env, '', 'http://example:0');
+ testProxyUrl(env, 'http://proxy', 'http://example:1337');
+ testProxyUrl(env, 'http://proxy', 'http://sub.example');
+ testProxyUrl(env, 'http://proxy', 'http://prefexample');
+ testProxyUrl(env, 'http://proxy', 'http://example.no');
+ testProxyUrl(env, 'http://proxy', 'http://a.b.example');
+ });
+
+ describe('no_proxy=.example (host suffix)', function() {
+ var env = {};
+ env.HTTP_PROXY = 'http://proxy';
+
+ env.NO_PROXY = '.example';
+ testProxyUrl(env, 'http://proxy', 'http://example');
+ testProxyUrl(env, 'http://proxy', 'http://example:80');
+ testProxyUrl(env, 'http://proxy', 'http://example:1337');
+ testProxyUrl(env, '', 'http://sub.example');
+ testProxyUrl(env, '', 'http://sub.example:80');
+ testProxyUrl(env, '', 'http://sub.example:1337');
+ testProxyUrl(env, 'http://proxy', 'http://prefexample');
+ testProxyUrl(env, 'http://proxy', 'http://example.no');
+ testProxyUrl(env, '', 'http://a.b.example');
+ });
+
+ describe('no_proxy=*', function() {
+ var env = {};
+ env.HTTP_PROXY = 'http://proxy';
+ env.NO_PROXY = '*';
+ testProxyUrl(env, '', 'http://example.com');
+ });
+
+ describe('no_proxy=*.example (host suffix with *.)', function() {
+ var env = {};
+ env.HTTP_PROXY = 'http://proxy';
+
+ env.NO_PROXY = '*.example';
+ testProxyUrl(env, 'http://proxy', 'http://example');
+ testProxyUrl(env, 'http://proxy', 'http://example:80');
+ testProxyUrl(env, 'http://proxy', 'http://example:1337');
+ testProxyUrl(env, '', 'http://sub.example');
+ testProxyUrl(env, '', 'http://sub.example:80');
+ testProxyUrl(env, '', 'http://sub.example:1337');
+ testProxyUrl(env, 'http://proxy', 'http://prefexample');
+ testProxyUrl(env, 'http://proxy', 'http://example.no');
+ testProxyUrl(env, '', 'http://a.b.example');
+ });
+
+ describe('no_proxy=*example (substring suffix)', function() {
+ var env = {};
+ env.HTTP_PROXY = 'http://proxy';
+
+ env.NO_PROXY = '*example';
+ testProxyUrl(env, '', 'http://example');
+ testProxyUrl(env, '', 'http://example:80');
+ testProxyUrl(env, '', 'http://example:1337');
+ testProxyUrl(env, '', 'http://sub.example');
+ testProxyUrl(env, '', 'http://sub.example:80');
+ testProxyUrl(env, '', 'http://sub.example:1337');
+ testProxyUrl(env, '', 'http://prefexample');
+ testProxyUrl(env, '', 'http://a.b.example');
+ testProxyUrl(env, 'http://proxy', 'http://example.no');
+ testProxyUrl(env, 'http://proxy', 'http://host/example');
+ });
+
+ describe('no_proxy=.*example (arbitrary wildcards are NOT supported)',
+ function() {
+ var env = {};
+ env.HTTP_PROXY = 'http://proxy';
+
+ env.NO_PROXY = '.*example';
+ testProxyUrl(env, 'http://proxy', 'http://example');
+ testProxyUrl(env, 'http://proxy', 'http://sub.example');
+ testProxyUrl(env, 'http://proxy', 'http://sub.example');
+ testProxyUrl(env, 'http://proxy', 'http://prefexample');
+ testProxyUrl(env, 'http://proxy', 'http://x.prefexample');
+ testProxyUrl(env, 'http://proxy', 'http://a.b.example');
+ });
+
+ describe('no_proxy=[::1],[::2]:80,10.0.0.1,10.0.0.2:80 (IP addresses)',
+ function() {
+ var env = {};
+ env.HTTP_PROXY = 'http://proxy';
+
+ env.NO_PROXY = '[::1],[::2]:80,10.0.0.1,10.0.0.2:80';
+ testProxyUrl(env, '', 'http://[::1]/');
+ testProxyUrl(env, '', 'http://[::1]:80/');
+ testProxyUrl(env, '', 'http://[::1]:1337/');
+
+ testProxyUrl(env, '', 'http://[::2]/');
+ testProxyUrl(env, '', 'http://[::2]:80/');
+ testProxyUrl(env, 'http://proxy', 'http://[::2]:1337/');
+
+ testProxyUrl(env, '', 'http://10.0.0.1/');
+ testProxyUrl(env, '', 'http://10.0.0.1:80/');
+ testProxyUrl(env, '', 'http://10.0.0.1:1337/');
+
+ testProxyUrl(env, '', 'http://10.0.0.2/');
+ testProxyUrl(env, '', 'http://10.0.0.2:80/');
+ testProxyUrl(env, 'http://proxy', 'http://10.0.0.2:1337/');
+ });
+
+ describe('no_proxy=127.0.0.1/32 (CIDR is NOT supported)', function() {
+ var env = {};
+ env.HTTP_PROXY = 'http://proxy';
+
+ env.NO_PROXY = '127.0.0.1/32';
+ testProxyUrl(env, 'http://proxy', 'http://127.0.0.1');
+ testProxyUrl(env, 'http://proxy', 'http://127.0.0.1/32');
+ });
+
+ describe('no_proxy=127.0.0.1 does NOT match localhost', function() {
+ var env = {};
+ env.HTTP_PROXY = 'http://proxy';
+
+ env.NO_PROXY = '127.0.0.1';
+ testProxyUrl(env, '', 'http://127.0.0.1');
+ // We're not performing DNS queries, so this shouldn't match.
+ testProxyUrl(env, 'http://proxy', 'http://localhost');
+ });
+
+ describe('no_proxy with protocols that have a default port', function() {
+ var env = {};
+ env.WS_PROXY = 'http://ws';
+ env.WSS_PROXY = 'http://wss';
+ env.HTTP_PROXY = 'http://http';
+ env.HTTPS_PROXY = 'http://https';
+ env.GOPHER_PROXY = 'http://gopher';
+ env.FTP_PROXY = 'http://ftp';
+ env.ALL_PROXY = 'http://all';
+
+ env.NO_PROXY = 'xxx:21,xxx:70,xxx:80,xxx:443';
+
+ testProxyUrl(env, '', 'http://xxx');
+ testProxyUrl(env, '', 'http://xxx:80');
+ testProxyUrl(env, 'http://http', 'http://xxx:1337');
+
+ testProxyUrl(env, '', 'ws://xxx');
+ testProxyUrl(env, '', 'ws://xxx:80');
+ testProxyUrl(env, 'http://ws', 'ws://xxx:1337');
+
+ testProxyUrl(env, '', 'https://xxx');
+ testProxyUrl(env, '', 'https://xxx:443');
+ testProxyUrl(env, 'http://https', 'https://xxx:1337');
+
+ testProxyUrl(env, '', 'wss://xxx');
+ testProxyUrl(env, '', 'wss://xxx:443');
+ testProxyUrl(env, 'http://wss', 'wss://xxx:1337');
+
+ testProxyUrl(env, '', 'gopher://xxx');
+ testProxyUrl(env, '', 'gopher://xxx:70');
+ testProxyUrl(env, 'http://gopher', 'gopher://xxx:1337');
+
+ testProxyUrl(env, '', 'ftp://xxx');
+ testProxyUrl(env, '', 'ftp://xxx:21');
+ testProxyUrl(env, 'http://ftp', 'ftp://xxx:1337');
+ });
+
+ describe('no_proxy should not be case-sensitive', function() {
+ var env = {};
+ env.HTTP_PROXY = 'http://proxy';
+ env.NO_PROXY = 'XXX,YYY,ZzZ';
+
+ testProxyUrl(env, '', 'http://xxx');
+ testProxyUrl(env, '', 'http://XXX');
+ testProxyUrl(env, '', 'http://yyy');
+ testProxyUrl(env, '', 'http://YYY');
+ testProxyUrl(env, '', 'http://ZzZ');
+ testProxyUrl(env, '', 'http://zZz');
+ });
+
+ describe('NPM proxy configuration', function() {
+ describe('npm_config_http_proxy should work', function() {
+ var env = {};
+ // eslint-disable-next-line camelcase
+ env.npm_config_http_proxy = 'http://http-proxy';
+
+ testProxyUrl(env, '', 'https://example');
+ testProxyUrl(env, 'http://http-proxy', 'http://example');
+
+ // eslint-disable-next-line camelcase
+ env.npm_config_http_proxy = 'http://priority';
+ testProxyUrl(env, 'http://priority', 'http://example');
+ });
+ // eslint-disable-next-line max-len
+ describe('npm_config_http_proxy should take precedence over HTTP_PROXY and npm_config_proxy', function() {
+ var env = {};
+ // eslint-disable-next-line camelcase
+ env.npm_config_http_proxy = 'http://http-proxy';
+ // eslint-disable-next-line camelcase
+ env.npm_config_proxy = 'http://unexpected-proxy';
+ env.HTTP_PROXY = 'http://unexpected-proxy';
+
+ testProxyUrl(env, 'http://http-proxy', 'http://example');
+ });
+ describe('npm_config_https_proxy should work', function() {
+ var env = {};
+ // eslint-disable-next-line camelcase
+ env.npm_config_http_proxy = 'http://unexpected.proxy';
+ testProxyUrl(env, '', 'https://example');
+
+ // eslint-disable-next-line camelcase
+ env.npm_config_https_proxy = 'http://https-proxy';
+ testProxyUrl(env, 'http://https-proxy', 'https://example');
+
+ // eslint-disable-next-line camelcase
+ env.npm_config_https_proxy = 'http://priority';
+ testProxyUrl(env, 'http://priority', 'https://example');
+ });
+ // eslint-disable-next-line max-len
+ describe('npm_config_https_proxy should take precedence over HTTPS_PROXY and npm_config_proxy', function() {
+ var env = {};
+ // eslint-disable-next-line camelcase
+ env.npm_config_https_proxy = 'http://https-proxy';
+ // eslint-disable-next-line camelcase
+ env.npm_config_proxy = 'http://unexpected-proxy';
+ env.HTTPS_PROXY = 'http://unexpected-proxy';
+
+ testProxyUrl(env, 'http://https-proxy', 'https://example');
+ });
+ describe('npm_config_proxy should work', function() {
+ var env = {};
+ // eslint-disable-next-line camelcase
+ env.npm_config_proxy = 'http://http-proxy';
+ testProxyUrl(env, 'http://http-proxy', 'http://example');
+ testProxyUrl(env, 'http://http-proxy', 'https://example');
+
+ // eslint-disable-next-line camelcase
+ env.npm_config_proxy = 'http://priority';
+ testProxyUrl(env, 'http://priority', 'http://example');
+ testProxyUrl(env, 'http://priority', 'https://example');
+ });
+ // eslint-disable-next-line max-len
+ describe('HTTP_PROXY and HTTPS_PROXY should take precedence over npm_config_proxy', function() {
+ var env = {};
+ env.HTTP_PROXY = 'http://http-proxy';
+ env.HTTPS_PROXY = 'http://https-proxy';
+ // eslint-disable-next-line camelcase
+ env.npm_config_proxy = 'http://unexpected-proxy';
+ testProxyUrl(env, 'http://http-proxy', 'http://example');
+ testProxyUrl(env, 'http://https-proxy', 'https://example');
+ });
+ describe('npm_config_no_proxy should work', function() {
+ var env = {};
+ env.HTTP_PROXY = 'http://proxy';
+ // eslint-disable-next-line camelcase
+ env.npm_config_no_proxy = 'example';
+
+ testProxyUrl(env, '', 'http://example');
+ testProxyUrl(env, 'http://proxy', 'http://otherwebsite');
+ });
+ // eslint-disable-next-line max-len
+ describe('npm_config_no_proxy should take precedence over NO_PROXY', function() {
+ var env = {};
+ env.HTTP_PROXY = 'http://proxy';
+ env.NO_PROXY = 'otherwebsite';
+ // eslint-disable-next-line camelcase
+ env.npm_config_no_proxy = 'example';
+
+ testProxyUrl(env, '', 'http://example');
+ testProxyUrl(env, 'http://proxy', 'http://otherwebsite');
+ });
+ });
+});
diff --git a/node_modules/ws/LICENSE b/node_modules/ws/LICENSE
new file mode 100644
index 0000000..1da5b96
--- /dev/null
+++ b/node_modules/ws/LICENSE
@@ -0,0 +1,20 @@
+Copyright (c) 2011 Einar Otto Stangvik <einaros@gmail.com>
+Copyright (c) 2013 Arnout Kazemier and contributors
+Copyright (c) 2016 Luigi Pinca and contributors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/ws/README.md b/node_modules/ws/README.md
new file mode 100644
index 0000000..80d9886
--- /dev/null
+++ b/node_modules/ws/README.md
@@ -0,0 +1,549 @@
+# ws: a Node.js WebSocket library
+
+[![Version npm](https://img.shields.io/npm/v/ws.svg?logo=npm)](https://www.npmjs.com/package/ws)
+[![CI](https://img.shields.io/github/actions/workflow/status/websockets/ws/ci.yml?branch=master&label=CI&logo=github)](https://github.com/websockets/ws/actions?query=workflow%3ACI+branch%3Amaster)
+[![Coverage Status](https://img.shields.io/coveralls/websockets/ws/master.svg?logo=coveralls)](https://coveralls.io/github/websockets/ws)
+
+ws is a simple to use, blazing fast, and thoroughly tested WebSocket client and
+server implementation.
+
+Passes the quite extensive Autobahn test suite: [server][server-report],
+[client][client-report].
+
+**Note**: This module does not work in the browser. The client in the docs is a
+reference to a back end with the role of a client in the WebSocket
+communication. Browser clients must use the native
+[`WebSocket`](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket)
+object. To make the same code work seamlessly on Node.js and the browser, you
+can use one of the many wrappers available on npm, like
+[isomorphic-ws](https://github.com/heineiuo/isomorphic-ws).
+
+## Table of Contents
+
+- [Protocol support](#protocol-support)
+- [Installing](#installing)
+ - [Opt-in for performance](#opt-in-for-performance)
+ - [Legacy opt-in for performance](#legacy-opt-in-for-performance)
+- [API docs](#api-docs)
+- [WebSocket compression](#websocket-compression)
+- [Usage examples](#usage-examples)
+ - [Sending and receiving text data](#sending-and-receiving-text-data)
+ - [Sending binary data](#sending-binary-data)
+ - [Simple server](#simple-server)
+ - [External HTTP/S server](#external-https-server)
+ - [Multiple servers sharing a single HTTP/S server](#multiple-servers-sharing-a-single-https-server)
+ - [Client authentication](#client-authentication)
+ - [Server broadcast](#server-broadcast)
+ - [Round-trip time](#round-trip-time)
+ - [Use the Node.js streams API](#use-the-nodejs-streams-api)
+ - [Other examples](#other-examples)
+- [FAQ](#faq)
+ - [How to get the IP address of the client?](#how-to-get-the-ip-address-of-the-client)
+ - [How to detect and close broken connections?](#how-to-detect-and-close-broken-connections)
+ - [How to connect via a proxy?](#how-to-connect-via-a-proxy)
+- [Changelog](#changelog)
+- [License](#license)
+
+## Protocol support
+
+- **HyBi drafts 07-12** (Use the option `protocolVersion: 8`)
+- **HyBi drafts 13-17** (Current default, alternatively option
+ `protocolVersion: 13`)
+
+## Installing
+
+```
+npm install ws
+```
+
+### Opt-in for performance
+
+[bufferutil][] is an optional module that can be installed alongside the ws
+module:
+
+```
+npm install --save-optional bufferutil
+```
+
+This is a binary addon that improves the performance of certain operations such
+as masking and unmasking the data payload of the WebSocket frames. Prebuilt
+binaries are available for the most popular platforms, so you don't necessarily
+need to have a C++ compiler installed on your machine.
+
+To force ws to not use bufferutil, use the
+[`WS_NO_BUFFER_UTIL`](./doc/ws.md#ws_no_buffer_util) environment variable. This
+can be useful to enhance security in systems where a user can put a package in
+the package search path of an application of another user, due to how the
+Node.js resolver algorithm works.
+
+#### Legacy opt-in for performance
+
+If you are running on an old version of Node.js (prior to v18.14.0), ws also
+supports the [utf-8-validate][] module:
+
+```
+npm install --save-optional utf-8-validate
+```
+
+This contains a binary polyfill for [`buffer.isUtf8()`][].
+
+To force ws to not use utf-8-validate, use the
+[`WS_NO_UTF_8_VALIDATE`](./doc/ws.md#ws_no_utf_8_validate) environment variable.
+
+## API docs
+
+See [`/doc/ws.md`](./doc/ws.md) for Node.js-like documentation of ws classes and
+utility functions.
+
+## WebSocket compression
+
+ws supports the [permessage-deflate extension][permessage-deflate] which enables
+the client and server to negotiate a compression algorithm and its parameters,
+and then selectively apply it to the data payloads of each WebSocket message.
+
+The extension is disabled by default on the server and enabled by default on the
+client. It adds a significant overhead in terms of performance and memory
+consumption so we suggest to enable it only if it is really needed.
+
+Note that Node.js has a variety of issues with high-performance compression,
+where increased concurrency, especially on Linux, can lead to [catastrophic
+memory fragmentation][node-zlib-bug] and slow performance. If you intend to use
+permessage-deflate in production, it is worthwhile to set up a test
+representative of your workload and ensure Node.js/zlib will handle it with
+acceptable performance and memory usage.
+
+Tuning of permessage-deflate can be done via the options defined below. You can
+also use `zlibDeflateOptions` and `zlibInflateOptions`, which is passed directly
+into the creation of [raw deflate/inflate streams][node-zlib-deflaterawdocs].
+
+See [the docs][ws-server-options] for more options.
+
+```js
+import WebSocket, { WebSocketServer } from 'ws';
+
+const wss = new WebSocketServer({
+ port: 8080,
+ perMessageDeflate: {
+ zlibDeflateOptions: {
+ // See zlib defaults.
+ chunkSize: 1024,
+ memLevel: 7,
+ level: 3
+ },
+ zlibInflateOptions: {
+ chunkSize: 10 * 1024
+ },
+ // Other options settable:
+ clientNoContextTakeover: true, // Defaults to negotiated value.
+ serverNoContextTakeover: true, // Defaults to negotiated value.
+ serverMaxWindowBits: 10, // Defaults to negotiated value.
+ // Below options specified as default values.
+ concurrencyLimit: 10, // Limits zlib concurrency for perf.
+ threshold: 1024 // Size (in bytes) below which messages
+ // should not be compressed if context takeover is disabled.
+ }
+});
+```
+
+The client will only use the extension if it is supported and enabled on the
+server. To always disable the extension on the client set the
+`perMessageDeflate` option to `false`.
+
+```js
+import WebSocket from 'ws';
+
+const ws = new WebSocket('ws://www.host.com/path', {
+ perMessageDeflate: false
+});
+```
+
+## Usage examples
+
+### Sending and receiving text data
+
+```js
+import WebSocket from 'ws';
+
+const ws = new WebSocket('ws://www.host.com/path');
+
+ws.on('error', console.error);
+
+ws.on('open', function open() {
+ ws.send('something');
+});
+
+ws.on('message', function message(data) {
+ console.log('received: %s', data);
+});
+```
+
+### Sending binary data
+
+```js
+import WebSocket from 'ws';
+
+const ws = new WebSocket('ws://www.host.com/path');
+
+ws.on('error', console.error);
+
+ws.on('open', function open() {
+ const array = new Float32Array(5);
+
+ for (var i = 0; i < array.length; ++i) {
+ array[i] = i / 2;
+ }
+
+ ws.send(array);
+});
+```
+
+### Simple server
+
+```js
+import { WebSocketServer } from 'ws';
+
+const wss = new WebSocketServer({ port: 8080 });
+
+wss.on('connection', function connection(ws) {
+ ws.on('error', console.error);
+
+ ws.on('message', function message(data) {
+ console.log('received: %s', data);
+ });
+
+ ws.send('something');
+});
+```
+
+### External HTTP/S server
+
+```js
+import { createServer } from 'https';
+import { readFileSync } from 'fs';
+import { WebSocketServer } from 'ws';
+
+const server = createServer({
+ cert: readFileSync('/path/to/cert.pem'),
+ key: readFileSync('/path/to/key.pem')
+});
+const wss = new WebSocketServer({ server });
+
+wss.on('connection', function connection(ws) {
+ ws.on('error', console.error);
+
+ ws.on('message', function message(data) {
+ console.log('received: %s', data);
+ });
+
+ ws.send('something');
+});
+
+server.listen(8080);
+```
+
+### Multiple servers sharing a single HTTP/S server
+
+```js
+import { createServer } from 'http';
+import { parse } from 'url';
+import { WebSocketServer } from 'ws';
+
+const server = createServer();
+const wss1 = new WebSocketServer({ noServer: true });
+const wss2 = new WebSocketServer({ noServer: true });
+
+wss1.on('connection', function connection(ws) {
+ ws.on('error', console.error);
+
+ // ...
+});
+
+wss2.on('connection', function connection(ws) {
+ ws.on('error', console.error);
+
+ // ...
+});
+
+server.on('upgrade', function upgrade(request, socket, head) {
+ const { pathname } = parse(request.url);
+
+ if (pathname === '/foo') {
+ wss1.handleUpgrade(request, socket, head, function done(ws) {
+ wss1.emit('connection', ws, request);
+ });
+ } else if (pathname === '/bar') {
+ wss2.handleUpgrade(request, socket, head, function done(ws) {
+ wss2.emit('connection', ws, request);
+ });
+ } else {
+ socket.destroy();
+ }
+});
+
+server.listen(8080);
+```
+
+### Client authentication
+
+```js
+import { createServer } from 'http';
+import { WebSocketServer } from 'ws';
+
+function onSocketError(err) {
+ console.error(err);
+}
+
+const server = createServer();
+const wss = new WebSocketServer({ noServer: true });
+
+wss.on('connection', function connection(ws, request, client) {
+ ws.on('error', console.error);
+
+ ws.on('message', function message(data) {
+ console.log(`Received message ${data} from user ${client}`);
+ });
+});
+
+server.on('upgrade', function upgrade(request, socket, head) {
+ socket.on('error', onSocketError);
+
+ // This function is not defined on purpose. Implement it with your own logic.
+ authenticate(request, function next(err, client) {
+ if (err || !client) {
+ socket.write('HTTP/1.1 401 Unauthorized\r\n\r\n');
+ socket.destroy();
+ return;
+ }
+
+ socket.removeListener('error', onSocketError);
+
+ wss.handleUpgrade(request, socket, head, function done(ws) {
+ wss.emit('connection', ws, request, client);
+ });
+ });
+});
+
+server.listen(8080);
+```
+
+Also see the provided [example][session-parse-example] using `express-session`.
+
+### Server broadcast
+
+A client WebSocket broadcasting to all connected WebSocket clients, including
+itself.
+
+```js
+import WebSocket, { WebSocketServer } from 'ws';
+
+const wss = new WebSocketServer({ port: 8080 });
+
+wss.on('connection', function connection(ws) {
+ ws.on('error', console.error);
+
+ ws.on('message', function message(data, isBinary) {
+ wss.clients.forEach(function each(client) {
+ if (client.readyState === WebSocket.OPEN) {
+ client.send(data, { binary: isBinary });
+ }
+ });
+ });
+});
+```
+
+A client WebSocket broadcasting to every other connected WebSocket clients,
+excluding itself.
+
+```js
+import WebSocket, { WebSocketServer } from 'ws';
+
+const wss = new WebSocketServer({ port: 8080 });
+
+wss.on('connection', function connection(ws) {
+ ws.on('error', console.error);
+
+ ws.on('message', function message(data, isBinary) {
+ wss.clients.forEach(function each(client) {
+ if (client !== ws && client.readyState === WebSocket.OPEN) {
+ client.send(data, { binary: isBinary });
+ }
+ });
+ });
+});
+```
+
+### Round-trip time
+
+```js
+import WebSocket from 'ws';
+
+const ws = new WebSocket('wss://websocket-echo.com/');
+
+ws.on('error', console.error);
+
+ws.on('open', function open() {
+ console.log('connected');
+ ws.send(Date.now());
+});
+
+ws.on('close', function close() {
+ console.log('disconnected');
+});
+
+ws.on('message', function message(data) {
+ console.log(`Round-trip time: ${Date.now() - data} ms`);
+
+ setTimeout(function timeout() {
+ ws.send(Date.now());
+ }, 500);
+});
+```
+
+### Use the Node.js streams API
+
+```js
+import WebSocket, { createWebSocketStream } from 'ws';
+
+const ws = new WebSocket('wss://websocket-echo.com/');
+
+const duplex = createWebSocketStream(ws, { encoding: 'utf8' });
+
+duplex.on('error', console.error);
+
+duplex.pipe(process.stdout);
+process.stdin.pipe(duplex);
+```
+
+### Other examples
+
+For a full example with a browser client communicating with a ws server, see the
+examples folder.
+
+Otherwise, see the test cases.
+
+## FAQ
+
+### How to get the IP address of the client?
+
+The remote IP address can be obtained from the raw socket.
+
+```js
+import { WebSocketServer } from 'ws';
+
+const wss = new WebSocketServer({ port: 8080 });
+
+wss.on('connection', function connection(ws, req) {
+ const ip = req.socket.remoteAddress;
+
+ ws.on('error', console.error);
+});
+```
+
+When the server runs behind a proxy like NGINX, the de-facto standard is to use
+the `X-Forwarded-For` header.
+
+```js
+wss.on('connection', function connection(ws, req) {
+ const ip = req.headers['x-forwarded-for'].split(',')[0].trim();
+
+ ws.on('error', console.error);
+});
+```
+
+### How to detect and close broken connections?
+
+Sometimes the link between the server and the client can be interrupted in a way
+that keeps both the server and the client unaware of the broken state of the
+connection (e.g. when pulling the cord).
+
+In these cases ping messages can be used as a means to verify that the remote
+endpoint is still responsive.
+
+```js
+import { WebSocketServer } from 'ws';
+
+function heartbeat() {
+ this.isAlive = true;
+}
+
+const wss = new WebSocketServer({ port: 8080 });
+
+wss.on('connection', function connection(ws) {
+ ws.isAlive = true;
+ ws.on('error', console.error);
+ ws.on('pong', heartbeat);
+});
+
+const interval = setInterval(function ping() {
+ wss.clients.forEach(function each(ws) {
+ if (ws.isAlive === false) return ws.terminate();
+
+ ws.isAlive = false;
+ ws.ping();
+ });
+}, 30000);
+
+wss.on('close', function close() {
+ clearInterval(interval);
+});
+```
+
+Pong messages are automatically sent in response to ping messages as required by
+the spec.
+
+Just like the server example above your clients might as well lose connection
+without knowing it. You might want to add a ping listener on your clients to
+prevent that. A simple implementation would be:
+
+```js
+import WebSocket from 'ws';
+
+function heartbeat() {
+ clearTimeout(this.pingTimeout);
+
+ // Use `WebSocket#terminate()`, which immediately destroys the connection,
+ // instead of `WebSocket#close()`, which waits for the close timer.
+ // Delay should be equal to the interval at which your server
+ // sends out pings plus a conservative assumption of the latency.
+ this.pingTimeout = setTimeout(() => {
+ this.terminate();
+ }, 30000 + 1000);
+}
+
+const client = new WebSocket('wss://websocket-echo.com/');
+
+client.on('error', console.error);
+client.on('open', heartbeat);
+client.on('ping', heartbeat);
+client.on('close', function clear() {
+ clearTimeout(this.pingTimeout);
+});
+```
+
+### How to connect via a proxy?
+
+Use a custom `http.Agent` implementation like [https-proxy-agent][] or
+[socks-proxy-agent][].
+
+## Changelog
+
+We're using the GitHub [releases][changelog] for changelog entries.
+
+## License
+
+[MIT](LICENSE)
+
+[`buffer.isutf8()`]: https://nodejs.org/api/buffer.html#bufferisutf8input
+[bufferutil]: https://github.com/websockets/bufferutil
+[changelog]: https://github.com/websockets/ws/releases
+[client-report]: http://websockets.github.io/ws/autobahn/clients/
+[https-proxy-agent]: https://github.com/TooTallNate/node-https-proxy-agent
+[node-zlib-bug]: https://github.com/nodejs/node/issues/8871
+[node-zlib-deflaterawdocs]:
+ https://nodejs.org/api/zlib.html#zlib_zlib_createdeflateraw_options
+[permessage-deflate]: https://tools.ietf.org/html/rfc7692
+[server-report]: http://websockets.github.io/ws/autobahn/servers/
+[session-parse-example]: ./examples/express-session-parse
+[socks-proxy-agent]: https://github.com/TooTallNate/node-socks-proxy-agent
+[utf-8-validate]: https://github.com/websockets/utf-8-validate
+[ws-server-options]: ./doc/ws.md#new-websocketserveroptions-callback
diff --git a/node_modules/ws/browser.js b/node_modules/ws/browser.js
new file mode 100644
index 0000000..ca4f628
--- /dev/null
+++ b/node_modules/ws/browser.js
@@ -0,0 +1,8 @@
+'use strict';
+
+module.exports = function () {
+ throw new Error(
+ 'ws does not work in the browser. Browser clients must use the native ' +
+ 'WebSocket object'
+ );
+};
diff --git a/node_modules/ws/index.js b/node_modules/ws/index.js
new file mode 100644
index 0000000..41edb3b
--- /dev/null
+++ b/node_modules/ws/index.js
@@ -0,0 +1,13 @@
+'use strict';
+
+const WebSocket = require('./lib/websocket');
+
+WebSocket.createWebSocketStream = require('./lib/stream');
+WebSocket.Server = require('./lib/websocket-server');
+WebSocket.Receiver = require('./lib/receiver');
+WebSocket.Sender = require('./lib/sender');
+
+WebSocket.WebSocket = WebSocket;
+WebSocket.WebSocketServer = WebSocket.Server;
+
+module.exports = WebSocket;
diff --git a/node_modules/ws/lib/buffer-util.js b/node_modules/ws/lib/buffer-util.js
new file mode 100644
index 0000000..f7536e2
--- /dev/null
+++ b/node_modules/ws/lib/buffer-util.js
@@ -0,0 +1,131 @@
+'use strict';
+
+const { EMPTY_BUFFER } = require('./constants');
+
+const FastBuffer = Buffer[Symbol.species];
+
+/**
+ * Merges an array of buffers into a new buffer.
+ *
+ * @param {Buffer[]} list The array of buffers to concat
+ * @param {Number} totalLength The total length of buffers in the list
+ * @return {Buffer} The resulting buffer
+ * @public
+ */
+function concat(list, totalLength) {
+ if (list.length === 0) return EMPTY_BUFFER;
+ if (list.length === 1) return list[0];
+
+ const target = Buffer.allocUnsafe(totalLength);
+ let offset = 0;
+
+ for (let i = 0; i < list.length; i++) {
+ const buf = list[i];
+ target.set(buf, offset);
+ offset += buf.length;
+ }
+
+ if (offset < totalLength) {
+ return new FastBuffer(target.buffer, target.byteOffset, offset);
+ }
+
+ return target;
+}
+
+/**
+ * Masks a buffer using the given mask.
+ *
+ * @param {Buffer} source The buffer to mask
+ * @param {Buffer} mask The mask to use
+ * @param {Buffer} output The buffer where to store the result
+ * @param {Number} offset The offset at which to start writing
+ * @param {Number} length The number of bytes to mask.
+ * @public
+ */
+function _mask(source, mask, output, offset, length) {
+ for (let i = 0; i < length; i++) {
+ output[offset + i] = source[i] ^ mask[i & 3];
+ }
+}
+
+/**
+ * Unmasks a buffer using the given mask.
+ *
+ * @param {Buffer} buffer The buffer to unmask
+ * @param {Buffer} mask The mask to use
+ * @public
+ */
+function _unmask(buffer, mask) {
+ for (let i = 0; i < buffer.length; i++) {
+ buffer[i] ^= mask[i & 3];
+ }
+}
+
+/**
+ * Converts a buffer to an `ArrayBuffer`.
+ *
+ * @param {Buffer} buf The buffer to convert
+ * @return {ArrayBuffer} Converted buffer
+ * @public
+ */
+function toArrayBuffer(buf) {
+ if (buf.length === buf.buffer.byteLength) {
+ return buf.buffer;
+ }
+
+ return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.length);
+}
+
+/**
+ * Converts `data` to a `Buffer`.
+ *
+ * @param {*} data The data to convert
+ * @return {Buffer} The buffer
+ * @throws {TypeError}
+ * @public
+ */
+function toBuffer(data) {
+ toBuffer.readOnly = true;
+
+ if (Buffer.isBuffer(data)) return data;
+
+ let buf;
+
+ if (data instanceof ArrayBuffer) {
+ buf = new FastBuffer(data);
+ } else if (ArrayBuffer.isView(data)) {
+ buf = new FastBuffer(data.buffer, data.byteOffset, data.byteLength);
+ } else {
+ buf = Buffer.from(data);
+ toBuffer.readOnly = false;
+ }
+
+ return buf;
+}
+
+module.exports = {
+ concat,
+ mask: _mask,
+ toArrayBuffer,
+ toBuffer,
+ unmask: _unmask
+};
+
+/* istanbul ignore else */
+if (!process.env.WS_NO_BUFFER_UTIL) {
+ try {
+ const bufferUtil = require('bufferutil');
+
+ module.exports.mask = function (source, mask, output, offset, length) {
+ if (length < 48) _mask(source, mask, output, offset, length);
+ else bufferUtil.mask(source, mask, output, offset, length);
+ };
+
+ module.exports.unmask = function (buffer, mask) {
+ if (buffer.length < 32) _unmask(buffer, mask);
+ else bufferUtil.unmask(buffer, mask);
+ };
+ } catch (e) {
+ // Continue regardless of the error.
+ }
+}
diff --git a/node_modules/ws/lib/constants.js b/node_modules/ws/lib/constants.js
new file mode 100644
index 0000000..d691b30
--- /dev/null
+++ b/node_modules/ws/lib/constants.js
@@ -0,0 +1,12 @@
+'use strict';
+
+module.exports = {
+ BINARY_TYPES: ['nodebuffer', 'arraybuffer', 'fragments'],
+ EMPTY_BUFFER: Buffer.alloc(0),
+ GUID: '258EAFA5-E914-47DA-95CA-C5AB0DC85B11',
+ kForOnEventAttribute: Symbol('kIsForOnEventAttribute'),
+ kListener: Symbol('kListener'),
+ kStatusCode: Symbol('status-code'),
+ kWebSocket: Symbol('websocket'),
+ NOOP: () => {}
+};
diff --git a/node_modules/ws/lib/event-target.js b/node_modules/ws/lib/event-target.js
new file mode 100644
index 0000000..fea4cbc
--- /dev/null
+++ b/node_modules/ws/lib/event-target.js
@@ -0,0 +1,292 @@
+'use strict';
+
+const { kForOnEventAttribute, kListener } = require('./constants');
+
+const kCode = Symbol('kCode');
+const kData = Symbol('kData');
+const kError = Symbol('kError');
+const kMessage = Symbol('kMessage');
+const kReason = Symbol('kReason');
+const kTarget = Symbol('kTarget');
+const kType = Symbol('kType');
+const kWasClean = Symbol('kWasClean');
+
+/**
+ * Class representing an event.
+ */
+class Event {
+ /**
+ * Create a new `Event`.
+ *
+ * @param {String} type The name of the event
+ * @throws {TypeError} If the `type` argument is not specified
+ */
+ constructor(type) {
+ this[kTarget] = null;
+ this[kType] = type;
+ }
+
+ /**
+ * @type {*}
+ */
+ get target() {
+ return this[kTarget];
+ }
+
+ /**
+ * @type {String}
+ */
+ get type() {
+ return this[kType];
+ }
+}
+
+Object.defineProperty(Event.prototype, 'target', { enumerable: true });
+Object.defineProperty(Event.prototype, 'type', { enumerable: true });
+
+/**
+ * Class representing a close event.
+ *
+ * @extends Event
+ */
+class CloseEvent extends Event {
+ /**
+ * Create a new `CloseEvent`.
+ *
+ * @param {String} type The name of the event
+ * @param {Object} [options] A dictionary object that allows for setting
+ * attributes via object members of the same name
+ * @param {Number} [options.code=0] The status code explaining why the
+ * connection was closed
+ * @param {String} [options.reason=''] A human-readable string explaining why
+ * the connection was closed
+ * @param {Boolean} [options.wasClean=false] Indicates whether or not the
+ * connection was cleanly closed
+ */
+ constructor(type, options = {}) {
+ super(type);
+
+ this[kCode] = options.code === undefined ? 0 : options.code;
+ this[kReason] = options.reason === undefined ? '' : options.reason;
+ this[kWasClean] = options.wasClean === undefined ? false : options.wasClean;
+ }
+
+ /**
+ * @type {Number}
+ */
+ get code() {
+ return this[kCode];
+ }
+
+ /**
+ * @type {String}
+ */
+ get reason() {
+ return this[kReason];
+ }
+
+ /**
+ * @type {Boolean}
+ */
+ get wasClean() {
+ return this[kWasClean];
+ }
+}
+
+Object.defineProperty(CloseEvent.prototype, 'code', { enumerable: true });
+Object.defineProperty(CloseEvent.prototype, 'reason', { enumerable: true });
+Object.defineProperty(CloseEvent.prototype, 'wasClean', { enumerable: true });
+
+/**
+ * Class representing an error event.
+ *
+ * @extends Event
+ */
+class ErrorEvent extends Event {
+ /**
+ * Create a new `ErrorEvent`.
+ *
+ * @param {String} type The name of the event
+ * @param {Object} [options] A dictionary object that allows for setting
+ * attributes via object members of the same name
+ * @param {*} [options.error=null] The error that generated this event
+ * @param {String} [options.message=''] The error message
+ */
+ constructor(type, options = {}) {
+ super(type);
+
+ this[kError] = options.error === undefined ? null : options.error;
+ this[kMessage] = options.message === undefined ? '' : options.message;
+ }
+
+ /**
+ * @type {*}
+ */
+ get error() {
+ return this[kError];
+ }
+
+ /**
+ * @type {String}
+ */
+ get message() {
+ return this[kMessage];
+ }
+}
+
+Object.defineProperty(ErrorEvent.prototype, 'error', { enumerable: true });
+Object.defineProperty(ErrorEvent.prototype, 'message', { enumerable: true });
+
+/**
+ * Class representing a message event.
+ *
+ * @extends Event
+ */
+class MessageEvent extends Event {
+ /**
+ * Create a new `MessageEvent`.
+ *
+ * @param {String} type The name of the event
+ * @param {Object} [options] A dictionary object that allows for setting
+ * attributes via object members of the same name
+ * @param {*} [options.data=null] The message content
+ */
+ constructor(type, options = {}) {
+ super(type);
+
+ this[kData] = options.data === undefined ? null : options.data;
+ }
+
+ /**
+ * @type {*}
+ */
+ get data() {
+ return this[kData];
+ }
+}
+
+Object.defineProperty(MessageEvent.prototype, 'data', { enumerable: true });
+
+/**
+ * This provides methods for emulating the `EventTarget` interface. It's not
+ * meant to be used directly.
+ *
+ * @mixin
+ */
+const EventTarget = {
+ /**
+ * Register an event listener.
+ *
+ * @param {String} type A string representing the event type to listen for
+ * @param {(Function|Object)} handler The listener to add
+ * @param {Object} [options] An options object specifies characteristics about
+ * the event listener
+ * @param {Boolean} [options.once=false] A `Boolean` indicating that the
+ * listener should be invoked at most once after being added. If `true`,
+ * the listener would be automatically removed when invoked.
+ * @public
+ */
+ addEventListener(type, handler, options = {}) {
+ for (const listener of this.listeners(type)) {
+ if (
+ !options[kForOnEventAttribute] &&
+ listener[kListener] === handler &&
+ !listener[kForOnEventAttribute]
+ ) {
+ return;
+ }
+ }
+
+ let wrapper;
+
+ if (type === 'message') {
+ wrapper = function onMessage(data, isBinary) {
+ const event = new MessageEvent('message', {
+ data: isBinary ? data : data.toString()
+ });
+
+ event[kTarget] = this;
+ callListener(handler, this, event);
+ };
+ } else if (type === 'close') {
+ wrapper = function onClose(code, message) {
+ const event = new CloseEvent('close', {
+ code,
+ reason: message.toString(),
+ wasClean: this._closeFrameReceived && this._closeFrameSent
+ });
+
+ event[kTarget] = this;
+ callListener(handler, this, event);
+ };
+ } else if (type === 'error') {
+ wrapper = function onError(error) {
+ const event = new ErrorEvent('error', {
+ error,
+ message: error.message
+ });
+
+ event[kTarget] = this;
+ callListener(handler, this, event);
+ };
+ } else if (type === 'open') {
+ wrapper = function onOpen() {
+ const event = new Event('open');
+
+ event[kTarget] = this;
+ callListener(handler, this, event);
+ };
+ } else {
+ return;
+ }
+
+ wrapper[kForOnEventAttribute] = !!options[kForOnEventAttribute];
+ wrapper[kListener] = handler;
+
+ if (options.once) {
+ this.once(type, wrapper);
+ } else {
+ this.on(type, wrapper);
+ }
+ },
+
+ /**
+ * Remove an event listener.
+ *
+ * @param {String} type A string representing the event type to remove
+ * @param {(Function|Object)} handler The listener to remove
+ * @public
+ */
+ removeEventListener(type, handler) {
+ for (const listener of this.listeners(type)) {
+ if (listener[kListener] === handler && !listener[kForOnEventAttribute]) {
+ this.removeListener(type, listener);
+ break;
+ }
+ }
+ }
+};
+
+module.exports = {
+ CloseEvent,
+ ErrorEvent,
+ Event,
+ EventTarget,
+ MessageEvent
+};
+
+/**
+ * Call an event listener
+ *
+ * @param {(Function|Object)} listener The listener to call
+ * @param {*} thisArg The value to use as `this`` when calling the listener
+ * @param {Event} event The event to pass to the listener
+ * @private
+ */
+function callListener(listener, thisArg, event) {
+ if (typeof listener === 'object' && listener.handleEvent) {
+ listener.handleEvent.call(listener, event);
+ } else {
+ listener.call(thisArg, event);
+ }
+}
diff --git a/node_modules/ws/lib/extension.js b/node_modules/ws/lib/extension.js
new file mode 100644
index 0000000..3d7895c
--- /dev/null
+++ b/node_modules/ws/lib/extension.js
@@ -0,0 +1,203 @@
+'use strict';
+
+const { tokenChars } = require('./validation');
+
+/**
+ * Adds an offer to the map of extension offers or a parameter to the map of
+ * parameters.
+ *
+ * @param {Object} dest The map of extension offers or parameters
+ * @param {String} name The extension or parameter name
+ * @param {(Object|Boolean|String)} elem The extension parameters or the
+ * parameter value
+ * @private
+ */
+function push(dest, name, elem) {
+ if (dest[name] === undefined) dest[name] = [elem];
+ else dest[name].push(elem);
+}
+
+/**
+ * Parses the `Sec-WebSocket-Extensions` header into an object.
+ *
+ * @param {String} header The field value of the header
+ * @return {Object} The parsed object
+ * @public
+ */
+function parse(header) {
+ const offers = Object.create(null);
+ let params = Object.create(null);
+ let mustUnescape = false;
+ let isEscaping = false;
+ let inQuotes = false;
+ let extensionName;
+ let paramName;
+ let start = -1;
+ let code = -1;
+ let end = -1;
+ let i = 0;
+
+ for (; i < header.length; i++) {
+ code = header.charCodeAt(i);
+
+ if (extensionName === undefined) {
+ if (end === -1 && tokenChars[code] === 1) {
+ if (start === -1) start = i;
+ } else if (
+ i !== 0 &&
+ (code === 0x20 /* ' ' */ || code === 0x09) /* '\t' */
+ ) {
+ if (end === -1 && start !== -1) end = i;
+ } else if (code === 0x3b /* ';' */ || code === 0x2c /* ',' */) {
+ if (start === -1) {
+ throw new SyntaxError(`Unexpected character at index ${i}`);
+ }
+
+ if (end === -1) end = i;
+ const name = header.slice(start, end);
+ if (code === 0x2c) {
+ push(offers, name, params);
+ params = Object.create(null);
+ } else {
+ extensionName = name;
+ }
+
+ start = end = -1;
+ } else {
+ throw new SyntaxError(`Unexpected character at index ${i}`);
+ }
+ } else if (paramName === undefined) {
+ if (end === -1 && tokenChars[code] === 1) {
+ if (start === -1) start = i;
+ } else if (code === 0x20 || code === 0x09) {
+ if (end === -1 && start !== -1) end = i;
+ } else if (code === 0x3b || code === 0x2c) {
+ if (start === -1) {
+ throw new SyntaxError(`Unexpected character at index ${i}`);
+ }
+
+ if (end === -1) end = i;
+ push(params, header.slice(start, end), true);
+ if (code === 0x2c) {
+ push(offers, extensionName, params);
+ params = Object.create(null);
+ extensionName = undefined;
+ }
+
+ start = end = -1;
+ } else if (code === 0x3d /* '=' */ && start !== -1 && end === -1) {
+ paramName = header.slice(start, i);
+ start = end = -1;
+ } else {
+ throw new SyntaxError(`Unexpected character at index ${i}`);
+ }
+ } else {
+ //
+ // The value of a quoted-string after unescaping must conform to the
+ // token ABNF, so only token characters are valid.
+ // Ref: https://tools.ietf.org/html/rfc6455#section-9.1
+ //
+ if (isEscaping) {
+ if (tokenChars[code] !== 1) {
+ throw new SyntaxError(`Unexpected character at index ${i}`);
+ }
+ if (start === -1) start = i;
+ else if (!mustUnescape) mustUnescape = true;
+ isEscaping = false;
+ } else if (inQuotes) {
+ if (tokenChars[code] === 1) {
+ if (start === -1) start = i;
+ } else if (code === 0x22 /* '"' */ && start !== -1) {
+ inQuotes = false;
+ end = i;
+ } else if (code === 0x5c /* '\' */) {
+ isEscaping = true;
+ } else {
+ throw new SyntaxError(`Unexpected character at index ${i}`);
+ }
+ } else if (code === 0x22 && header.charCodeAt(i - 1) === 0x3d) {
+ inQuotes = true;
+ } else if (end === -1 && tokenChars[code] === 1) {
+ if (start === -1) start = i;
+ } else if (start !== -1 && (code === 0x20 || code === 0x09)) {
+ if (end === -1) end = i;
+ } else if (code === 0x3b || code === 0x2c) {
+ if (start === -1) {
+ throw new SyntaxError(`Unexpected character at index ${i}`);
+ }
+
+ if (end === -1) end = i;
+ let value = header.slice(start, end);
+ if (mustUnescape) {
+ value = value.replace(/\\/g, '');
+ mustUnescape = false;
+ }
+ push(params, paramName, value);
+ if (code === 0x2c) {
+ push(offers, extensionName, params);
+ params = Object.create(null);
+ extensionName = undefined;
+ }
+
+ paramName = undefined;
+ start = end = -1;
+ } else {
+ throw new SyntaxError(`Unexpected character at index ${i}`);
+ }
+ }
+ }
+
+ if (start === -1 || inQuotes || code === 0x20 || code === 0x09) {
+ throw new SyntaxError('Unexpected end of input');
+ }
+
+ if (end === -1) end = i;
+ const token = header.slice(start, end);
+ if (extensionName === undefined) {
+ push(offers, token, params);
+ } else {
+ if (paramName === undefined) {
+ push(params, token, true);
+ } else if (mustUnescape) {
+ push(params, paramName, token.replace(/\\/g, ''));
+ } else {
+ push(params, paramName, token);
+ }
+ push(offers, extensionName, params);
+ }
+
+ return offers;
+}
+
+/**
+ * Builds the `Sec-WebSocket-Extensions` header field value.
+ *
+ * @param {Object} extensions The map of extensions and parameters to format
+ * @return {String} A string representing the given object
+ * @public
+ */
+function format(extensions) {
+ return Object.keys(extensions)
+ .map((extension) => {
+ let configurations = extensions[extension];
+ if (!Array.isArray(configurations)) configurations = [configurations];
+ return configurations
+ .map((params) => {
+ return [extension]
+ .concat(
+ Object.keys(params).map((k) => {
+ let values = params[k];
+ if (!Array.isArray(values)) values = [values];
+ return values
+ .map((v) => (v === true ? k : `${k}=${v}`))
+ .join('; ');
+ })
+ )
+ .join('; ');
+ })
+ .join(', ');
+ })
+ .join(', ');
+}
+
+module.exports = { format, parse };
diff --git a/node_modules/ws/lib/limiter.js b/node_modules/ws/lib/limiter.js
new file mode 100644
index 0000000..3fd3578
--- /dev/null
+++ b/node_modules/ws/lib/limiter.js
@@ -0,0 +1,55 @@
+'use strict';
+
+const kDone = Symbol('kDone');
+const kRun = Symbol('kRun');
+
+/**
+ * A very simple job queue with adjustable concurrency. Adapted from
+ * https://github.com/STRML/async-limiter
+ */
+class Limiter {
+ /**
+ * Creates a new `Limiter`.
+ *
+ * @param {Number} [concurrency=Infinity] The maximum number of jobs allowed
+ * to run concurrently
+ */
+ constructor(concurrency) {
+ this[kDone] = () => {
+ this.pending--;
+ this[kRun]();
+ };
+ this.concurrency = concurrency || Infinity;
+ this.jobs = [];
+ this.pending = 0;
+ }
+
+ /**
+ * Adds a job to the queue.
+ *
+ * @param {Function} job The job to run
+ * @public
+ */
+ add(job) {
+ this.jobs.push(job);
+ this[kRun]();
+ }
+
+ /**
+ * Removes a job from the queue and runs it if possible.
+ *
+ * @private
+ */
+ [kRun]() {
+ if (this.pending === this.concurrency) return;
+
+ if (this.jobs.length) {
+ const job = this.jobs.shift();
+
+ this.pending++;
+ job(this[kDone]);
+ }
+ }
+}
+
+module.exports = Limiter;
diff --git a/node_modules/ws/lib/permessage-deflate.js b/node_modules/ws/lib/permessage-deflate.js
new file mode 100644
index 0000000..77d918b
--- /dev/null
+++ b/node_modules/ws/lib/permessage-deflate.js
@@ -0,0 +1,514 @@
+'use strict';
+
+const zlib = require('zlib');
+
+const bufferUtil = require('./buffer-util');
+const Limiter = require('./limiter');
+const { kStatusCode } = require('./constants');
+
+const FastBuffer = Buffer[Symbol.species];
+const TRAILER = Buffer.from([0x00, 0x00, 0xff, 0xff]);
+const kPerMessageDeflate = Symbol('permessage-deflate');
+const kTotalLength = Symbol('total-length');
+const kCallback = Symbol('callback');
+const kBuffers = Symbol('buffers');
+const kError = Symbol('error');
+
+//
+// We limit zlib concurrency, which prevents severe memory fragmentation
+// as documented in https://github.com/nodejs/node/issues/8871#issuecomment-250915913
+// and https://github.com/websockets/ws/issues/1202
+//
+// Intentionally global; it's the global thread pool that's an issue.
+//
+let zlibLimiter;
+
+/**
+ * permessage-deflate implementation.
+ */
+class PerMessageDeflate {
+ /**
+ * Creates a PerMessageDeflate instance.
+ *
+ * @param {Object} [options] Configuration options
+ * @param {(Boolean|Number)} [options.clientMaxWindowBits] Advertise support
+ * for, or request, a custom client window size
+ * @param {Boolean} [options.clientNoContextTakeover=false] Advertise/
+ * acknowledge disabling of client context takeover
+ * @param {Number} [options.concurrencyLimit=10] The number of concurrent
+ * calls to zlib
+ * @param {(Boolean|Number)} [options.serverMaxWindowBits] Request/confirm the
+ * use of a custom server window size
+ * @param {Boolean} [options.serverNoContextTakeover=false] Request/accept
+ * disabling of server context takeover
+ * @param {Number} [options.threshold=1024] Size (in bytes) below which
+ * messages should not be compressed if context takeover is disabled
+ * @param {Object} [options.zlibDeflateOptions] Options to pass to zlib on
+ * deflate
+ * @param {Object} [options.zlibInflateOptions] Options to pass to zlib on
+ * inflate
+ * @param {Boolean} [isServer=false] Create the instance in either server or
+ * client mode
+ * @param {Number} [maxPayload=0] The maximum allowed message length
+ */
+ constructor(options, isServer, maxPayload) {
+ this._maxPayload = maxPayload | 0;
+ this._options = options || {};
+ this._threshold =
+ this._options.threshold !== undefined ? this._options.threshold : 1024;
+ this._isServer = !!isServer;
+ this._deflate = null;
+ this._inflate = null;
+
+ this.params = null;
+
+ if (!zlibLimiter) {
+ const concurrency =
+ this._options.concurrencyLimit !== undefined
+ ? this._options.concurrencyLimit
+ : 10;
+ zlibLimiter = new Limiter(concurrency);
+ }
+ }
+
+ /**
+ * @type {String}
+ */
+ static get extensionName() {
+ return 'permessage-deflate';
+ }
+
+ /**
+ * Create an extension negotiation offer.
+ *
+ * @return {Object} Extension parameters
+ * @public
+ */
+ offer() {
+ const params = {};
+
+ if (this._options.serverNoContextTakeover) {
+ params.server_no_context_takeover = true;
+ }
+ if (this._options.clientNoContextTakeover) {
+ params.client_no_context_takeover = true;
+ }
+ if (this._options.serverMaxWindowBits) {
+ params.server_max_window_bits = this._options.serverMaxWindowBits;
+ }
+ if (this._options.clientMaxWindowBits) {
+ params.client_max_window_bits = this._options.clientMaxWindowBits;
+ } else if (this._options.clientMaxWindowBits == null) {
+ params.client_max_window_bits = true;
+ }
+
+ return params;
+ }
+
+ /**
+ * Accept an extension negotiation offer/response.
+ *
+ * @param {Array} configurations The extension negotiation offers/reponse
+ * @return {Object} Accepted configuration
+ * @public
+ */
+ accept(configurations) {
+ configurations = this.normalizeParams(configurations);
+
+ this.params = this._isServer
+ ? this.acceptAsServer(configurations)
+ : this.acceptAsClient(configurations);
+
+ return this.params;
+ }
+
+ /**
+ * Releases all resources used by the extension.
+ *
+ * @public
+ */
+ cleanup() {
+ if (this._inflate) {
+ this._inflate.close();
+ this._inflate = null;
+ }
+
+ if (this._deflate) {
+ const callback = this._deflate[kCallback];
+
+ this._deflate.close();
+ this._deflate = null;
+
+ if (callback) {
+ callback(
+ new Error(
+ 'The deflate stream was closed while data was being processed'
+ )
+ );
+ }
+ }
+ }
+
+ /**
+ * Accept an extension negotiation offer.
+ *
+ * @param {Array} offers The extension negotiation offers
+ * @return {Object} Accepted configuration
+ * @private
+ */
+ acceptAsServer(offers) {
+ const opts = this._options;
+ const accepted = offers.find((params) => {
+ if (
+ (opts.serverNoContextTakeover === false &&
+ params.server_no_context_takeover) ||
+ (params.server_max_window_bits &&
+ (opts.serverMaxWindowBits === false ||
+ (typeof opts.serverMaxWindowBits === 'number' &&
+ opts.serverMaxWindowBits > params.server_max_window_bits))) ||
+ (typeof opts.clientMaxWindowBits === 'number' &&
+ !params.client_max_window_bits)
+ ) {
+ return false;
+ }
+
+ return true;
+ });
+
+ if (!accepted) {
+ throw new Error('None of the extension offers can be accepted');
+ }
+
+ if (opts.serverNoContextTakeover) {
+ accepted.server_no_context_takeover = true;
+ }
+ if (opts.clientNoContextTakeover) {
+ accepted.client_no_context_takeover = true;
+ }
+ if (typeof opts.serverMaxWindowBits === 'number') {
+ accepted.server_max_window_bits = opts.serverMaxWindowBits;
+ }
+ if (typeof opts.clientMaxWindowBits === 'number') {
+ accepted.client_max_window_bits = opts.clientMaxWindowBits;
+ } else if (
+ accepted.client_max_window_bits === true ||
+ opts.clientMaxWindowBits === false
+ ) {
+ delete accepted.client_max_window_bits;
+ }
+
+ return accepted;
+ }
+
+ /**
+ * Accept the extension negotiation response.
+ *
+ * @param {Array} response The extension negotiation response
+ * @return {Object} Accepted configuration
+ * @private
+ */
+ acceptAsClient(response) {
+ const params = response[0];
+
+ if (
+ this._options.clientNoContextTakeover === false &&
+ params.client_no_context_takeover
+ ) {
+ throw new Error('Unexpected parameter "client_no_context_takeover"');
+ }
+
+ if (!params.client_max_window_bits) {
+ if (typeof this._options.clientMaxWindowBits === 'number') {
+ params.client_max_window_bits = this._options.clientMaxWindowBits;
+ }
+ } else if (
+ this._options.clientMaxWindowBits === false ||
+ (typeof this._options.clientMaxWindowBits === 'number' &&
+ params.client_max_window_bits > this._options.clientMaxWindowBits)
+ ) {
+ throw new Error(
+ 'Unexpected or invalid parameter "client_max_window_bits"'
+ );
+ }
+
+ return params;
+ }
+
+ /**
+ * Normalize parameters.
+ *
+ * @param {Array} configurations The extension negotiation offers/reponse
+ * @return {Array} The offers/response with normalized parameters
+ * @private
+ */
+ normalizeParams(configurations) {
+ configurations.forEach((params) => {
+ Object.keys(params).forEach((key) => {
+ let value = params[key];
+
+ if (value.length > 1) {
+ throw new Error(`Parameter "${key}" must have only a single value`);
+ }
+
+ value = value[0];
+
+ if (key === 'client_max_window_bits') {
+ if (value !== true) {
+ const num = +value;
+ if (!Number.isInteger(num) || num < 8 || num > 15) {
+ throw new TypeError(
+ `Invalid value for parameter "${key}": ${value}`
+ );
+ }
+ value = num;
+ } else if (!this._isServer) {
+ throw new TypeError(
+ `Invalid value for parameter "${key}": ${value}`
+ );
+ }
+ } else if (key === 'server_max_window_bits') {
+ const num = +value;
+ if (!Number.isInteger(num) || num < 8 || num > 15) {
+ throw new TypeError(
+ `Invalid value for parameter "${key}": ${value}`
+ );
+ }
+ value = num;
+ } else if (
+ key === 'client_no_context_takeover' ||
+ key === 'server_no_context_takeover'
+ ) {
+ if (value !== true) {
+ throw new TypeError(
+ `Invalid value for parameter "${key}": ${value}`
+ );
+ }
+ } else {
+ throw new Error(`Unknown parameter "${key}"`);
+ }
+
+ params[key] = value;
+ });
+ });
+
+ return configurations;
+ }
+
+ /**
+ * Decompress data. Concurrency limited.
+ *
+ * @param {Buffer} data Compressed data
+ * @param {Boolean} fin Specifies whether or not this is the last fragment
+ * @param {Function} callback Callback
+ * @public
+ */
+ decompress(data, fin, callback) {
+ zlibLimiter.add((done) => {
+ this._decompress(data, fin, (err, result) => {
+ done();
+ callback(err, result);
+ });
+ });
+ }
+
+ /**
+ * Compress data. Concurrency limited.
+ *
+ * @param {(Buffer|String)} data Data to compress
+ * @param {Boolean} fin Specifies whether or not this is the last fragment
+ * @param {Function} callback Callback
+ * @public
+ */
+ compress(data, fin, callback) {
+ zlibLimiter.add((done) => {
+ this._compress(data, fin, (err, result) => {
+ done();
+ callback(err, result);
+ });
+ });
+ }
+
+ /**
+ * Decompress data.
+ *
+ * @param {Buffer} data Compressed data
+ * @param {Boolean} fin Specifies whether or not this is the last fragment
+ * @param {Function} callback Callback
+ * @private
+ */
+ _decompress(data, fin, callback) {
+ const endpoint = this._isServer ? 'client' : 'server';
+
+ if (!this._inflate) {
+ const key = `${endpoint}_max_window_bits`;
+ const windowBits =
+ typeof this.params[key] !== 'number'
+ ? zlib.Z_DEFAULT_WINDOWBITS
+ : this.params[key];
+
+ this._inflate = zlib.createInflateRaw({
+ ...this._options.zlibInflateOptions,
+ windowBits
+ });
+ this._inflate[kPerMessageDeflate] = this;
+ this._inflate[kTotalLength] = 0;
+ this._inflate[kBuffers] = [];
+ this._inflate.on('error', inflateOnError);
+ this._inflate.on('data', inflateOnData);
+ }
+
+ this._inflate[kCallback] = callback;
+
+ this._inflate.write(data);
+ if (fin) this._inflate.write(TRAILER);
+
+ this._inflate.flush(() => {
+ const err = this._inflate[kError];
+
+ if (err) {
+ this._inflate.close();
+ this._inflate = null;
+ callback(err);
+ return;
+ }
+
+ const data = bufferUtil.concat(
+ this._inflate[kBuffers],
+ this._inflate[kTotalLength]
+ );
+
+ if (this._inflate._readableState.endEmitted) {
+ this._inflate.close();
+ this._inflate = null;
+ } else {
+ this._inflate[kTotalLength] = 0;
+ this._inflate[kBuffers] = [];
+
+ if (fin && this.params[`${endpoint}_no_context_takeover`]) {
+ this._inflate.reset();
+ }
+ }
+
+ callback(null, data);
+ });
+ }
+
+ /**
+ * Compress data.
+ *
+ * @param {(Buffer|String)} data Data to compress
+ * @param {Boolean} fin Specifies whether or not this is the last fragment
+ * @param {Function} callback Callback
+ * @private
+ */
+ _compress(data, fin, callback) {
+ const endpoint = this._isServer ? 'server' : 'client';
+
+ if (!this._deflate) {
+ const key = `${endpoint}_max_window_bits`;
+ const windowBits =
+ typeof this.params[key] !== 'number'
+ ? zlib.Z_DEFAULT_WINDOWBITS
+ : this.params[key];
+
+ this._deflate = zlib.createDeflateRaw({
+ ...this._options.zlibDeflateOptions,
+ windowBits
+ });
+
+ this._deflate[kTotalLength] = 0;
+ this._deflate[kBuffers] = [];
+
+ this._deflate.on('data', deflateOnData);
+ }
+
+ this._deflate[kCallback] = callback;
+
+ this._deflate.write(data);
+ this._deflate.flush(zlib.Z_SYNC_FLUSH, () => {
+ if (!this._deflate) {
+ //
+ // The deflate stream was closed while data was being processed.
+ //
+ return;
+ }
+
+ let data = bufferUtil.concat(
+ this._deflate[kBuffers],
+ this._deflate[kTotalLength]
+ );
+
+ if (fin) {
+ data = new FastBuffer(data.buffer, data.byteOffset, data.length - 4);
+ }
+
+ //
+ // Ensure that the callback will not be called again in
+ // `PerMessageDeflate#cleanup()`.
+ //
+ this._deflate[kCallback] = null;
+
+ this._deflate[kTotalLength] = 0;
+ this._deflate[kBuffers] = [];
+
+ if (fin && this.params[`${endpoint}_no_context_takeover`]) {
+ this._deflate.reset();
+ }
+
+ callback(null, data);
+ });
+ }
+}
+
+module.exports = PerMessageDeflate;
+
+/**
+ * The listener of the `zlib.DeflateRaw` stream `'data'` event.
+ *
+ * @param {Buffer} chunk A chunk of data
+ * @private
+ */
+function deflateOnData(chunk) {
+ this[kBuffers].push(chunk);
+ this[kTotalLength] += chunk.length;
+}
+
+/**
+ * The listener of the `zlib.InflateRaw` stream `'data'` event.
+ *
+ * @param {Buffer} chunk A chunk of data
+ * @private
+ */
+function inflateOnData(chunk) {
+ this[kTotalLength] += chunk.length;
+
+ if (
+ this[kPerMessageDeflate]._maxPayload < 1 ||
+ this[kTotalLength] <= this[kPerMessageDeflate]._maxPayload
+ ) {
+ this[kBuffers].push(chunk);
+ return;
+ }
+
+ this[kError] = new RangeError('Max payload size exceeded');
+ this[kError].code = 'WS_ERR_UNSUPPORTED_MESSAGE_LENGTH';
+ this[kError][kStatusCode] = 1009;
+ this.removeListener('data', inflateOnData);
+ this.reset();
+}
+
+/**
+ * The listener of the `zlib.InflateRaw` stream `'error'` event.
+ *
+ * @param {Error} err The emitted error
+ * @private
+ */
+function inflateOnError(err) {
+ //
+ // There is no need to call `Zlib#close()` as the handle is automatically
+ // closed when an error is emitted.
+ //
+ this[kPerMessageDeflate]._inflate = null;
+ err[kStatusCode] = 1007;
+ this[kCallback](err);
+}
diff --git a/node_modules/ws/lib/receiver.js b/node_modules/ws/lib/receiver.js
new file mode 100644
index 0000000..9e87d81
--- /dev/null
+++ b/node_modules/ws/lib/receiver.js
@@ -0,0 +1,742 @@
+'use strict';
+
+const { Writable } = require('stream');
+
+const PerMessageDeflate = require('./permessage-deflate');
+const {
+ BINARY_TYPES,
+ EMPTY_BUFFER,
+ kStatusCode,
+ kWebSocket
+} = require('./constants');
+const { concat, toArrayBuffer, unmask } = require('./buffer-util');
+const { isValidStatusCode, isValidUTF8 } = require('./validation');
+
+const FastBuffer = Buffer[Symbol.species];
+const promise = Promise.resolve();
+
+//
+// `queueMicrotask()` is not available in Node.js < 11.
+//
+const queueTask =
+ typeof queueMicrotask === 'function' ? queueMicrotask : queueMicrotaskShim;
+
+const GET_INFO = 0;
+const GET_PAYLOAD_LENGTH_16 = 1;
+const GET_PAYLOAD_LENGTH_64 = 2;
+const GET_MASK = 3;
+const GET_DATA = 4;
+const INFLATING = 5;
+const DEFER_EVENT = 6;
+
+/**
+ * HyBi Receiver implementation.
+ *
+ * @extends Writable
+ */
+class Receiver extends Writable {
+ /**
+ * Creates a Receiver instance.
+ *
+ * @param {Object} [options] Options object
+ * @param {Boolean} [options.allowSynchronousEvents=false] Specifies whether
+ * any of the `'message'`, `'ping'`, and `'pong'` events can be emitted
+ * multiple times in the same tick
+ * @param {String} [options.binaryType=nodebuffer] The type for binary data
+ * @param {Object} [options.extensions] An object containing the negotiated
+ * extensions
+ * @param {Boolean} [options.isServer=false] Specifies whether to operate in
+ * client or server mode
+ * @param {Number} [options.maxPayload=0] The maximum allowed message length
+ * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or
+ * not to skip UTF-8 validation for text and close messages
+ */
+ constructor(options = {}) {
+ super();
+
+ this._allowSynchronousEvents = !!options.allowSynchronousEvents;
+ this._binaryType = options.binaryType || BINARY_TYPES[0];
+ this._extensions = options.extensions || {};
+ this._isServer = !!options.isServer;
+ this._maxPayload = options.maxPayload | 0;
+ this._skipUTF8Validation = !!options.skipUTF8Validation;
+ this[kWebSocket] = undefined;
+
+ this._bufferedBytes = 0;
+ this._buffers = [];
+
+ this._compressed = false;
+ this._payloadLength = 0;
+ this._mask = undefined;
+ this._fragmented = 0;
+ this._masked = false;
+ this._fin = false;
+ this._opcode = 0;
+
+ this._totalPayloadLength = 0;
+ this._messageLength = 0;
+ this._fragments = [];
+
+ this._errored = false;
+ this._loop = false;
+ this._state = GET_INFO;
+ }
+
+ /**
+ * Implements `Writable.prototype._write()`.
+ *
+ * @param {Buffer} chunk The chunk of data to write
+ * @param {String} encoding The character encoding of `chunk`
+ * @param {Function} cb Callback
+ * @private
+ */
+ _write(chunk, encoding, cb) {
+ if (this._opcode === 0x08 && this._state == GET_INFO) return cb();
+
+ this._bufferedBytes += chunk.length;
+ this._buffers.push(chunk);
+ this.startLoop(cb);
+ }
+
+ /**
+ * Consumes `n` bytes from the buffered data.
+ *
+ * @param {Number} n The number of bytes to consume
+ * @return {Buffer} The consumed bytes
+ * @private
+ */
+ consume(n) {
+ this._bufferedBytes -= n;
+
+ if (n === this._buffers[0].length) return this._buffers.shift();
+
+ if (n < this._buffers[0].length) {
+ const buf = this._buffers[0];
+ this._buffers[0] = new FastBuffer(
+ buf.buffer,
+ buf.byteOffset + n,
+ buf.length - n
+ );
+
+ return new FastBuffer(buf.buffer, buf.byteOffset, n);
+ }
+
+ const dst = Buffer.allocUnsafe(n);
+
+ do {
+ const buf = this._buffers[0];
+ const offset = dst.length - n;
+
+ if (n >= buf.length) {
+ dst.set(this._buffers.shift(), offset);
+ } else {
+ dst.set(new Uint8Array(buf.buffer, buf.byteOffset, n), offset);
+ this._buffers[0] = new FastBuffer(
+ buf.buffer,
+ buf.byteOffset + n,
+ buf.length - n
+ );
+ }
+
+ n -= buf.length;
+ } while (n > 0);
+
+ return dst;
+ }
+
+ /**
+ * Starts the parsing loop.
+ *
+ * @param {Function} cb Callback
+ * @private
+ */
+ startLoop(cb) {
+ this._loop = true;
+
+ do {
+ switch (this._state) {
+ case GET_INFO:
+ this.getInfo(cb);
+ break;
+ case GET_PAYLOAD_LENGTH_16:
+ this.getPayloadLength16(cb);
+ break;
+ case GET_PAYLOAD_LENGTH_64:
+ this.getPayloadLength64(cb);
+ break;
+ case GET_MASK:
+ this.getMask();
+ break;
+ case GET_DATA:
+ this.getData(cb);
+ break;
+ case INFLATING:
+ case DEFER_EVENT:
+ this._loop = false;
+ return;
+ }
+ } while (this._loop);
+
+ if (!this._errored) cb();
+ }
+
+ /**
+ * Reads the first two bytes of a frame.
+ *
+ * @param {Function} cb Callback
+ * @private
+ */
+ getInfo(cb) {
+ if (this._bufferedBytes < 2) {
+ this._loop = false;
+ return;
+ }
+
+ const buf = this.consume(2);
+
+ if ((buf[0] & 0x30) !== 0x00) {
+ const error = this.createError(
+ RangeError,
+ 'RSV2 and RSV3 must be clear',
+ true,
+ 1002,
+ 'WS_ERR_UNEXPECTED_RSV_2_3'
+ );
+
+ cb(error);
+ return;
+ }
+
+ const compressed = (buf[0] & 0x40) === 0x40;
+
+ if (compressed && !this._extensions[PerMessageDeflate.extensionName]) {
+ const error = this.createError(
+ RangeError,
+ 'RSV1 must be clear',
+ true,
+ 1002,
+ 'WS_ERR_UNEXPECTED_RSV_1'
+ );
+
+ cb(error);
+ return;
+ }
+
+ this._fin = (buf[0] & 0x80) === 0x80;
+ this._opcode = buf[0] & 0x0f;
+ this._payloadLength = buf[1] & 0x7f;
+
+ if (this._opcode === 0x00) {
+ if (compressed) {
+ const error = this.createError(
+ RangeError,
+ 'RSV1 must be clear',
+ true,
+ 1002,
+ 'WS_ERR_UNEXPECTED_RSV_1'
+ );
+
+ cb(error);
+ return;
+ }
+
+ if (!this._fragmented) {
+ const error = this.createError(
+ RangeError,
+ 'invalid opcode 0',
+ true,
+ 1002,
+ 'WS_ERR_INVALID_OPCODE'
+ );
+
+ cb(error);
+ return;
+ }
+
+ this._opcode = this._fragmented;
+ } else if (this._opcode === 0x01 || this._opcode === 0x02) {
+ if (this._fragmented) {
+ const error = this.createError(
+ RangeError,
+ `invalid opcode ${this._opcode}`,
+ true,
+ 1002,
+ 'WS_ERR_INVALID_OPCODE'
+ );
+
+ cb(error);
+ return;
+ }
+
+ this._compressed = compressed;
+ } else if (this._opcode > 0x07 && this._opcode < 0x0b) {
+ if (!this._fin) {
+ const error = this.createError(
+ RangeError,
+ 'FIN must be set',
+ true,
+ 1002,
+ 'WS_ERR_EXPECTED_FIN'
+ );
+
+ cb(error);
+ return;
+ }
+
+ if (compressed) {
+ const error = this.createError(
+ RangeError,
+ 'RSV1 must be clear',
+ true,
+ 1002,
+ 'WS_ERR_UNEXPECTED_RSV_1'
+ );
+
+ cb(error);
+ return;
+ }
+
+ if (
+ this._payloadLength > 0x7d ||
+ (this._opcode === 0x08 && this._payloadLength === 1)
+ ) {
+ const error = this.createError(
+ RangeError,
+ `invalid payload length ${this._payloadLength}`,
+ true,
+ 1002,
+ 'WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH'
+ );
+
+ cb(error);
+ return;
+ }
+ } else {
+ const error = this.createError(
+ RangeError,
+ `invalid opcode ${this._opcode}`,
+ true,
+ 1002,
+ 'WS_ERR_INVALID_OPCODE'
+ );
+
+ cb(error);
+ return;
+ }
+
+ if (!this._fin && !this._fragmented) this._fragmented = this._opcode;
+ this._masked = (buf[1] & 0x80) === 0x80;
+
+ if (this._isServer) {
+ if (!this._masked) {
+ const error = this.createError(
+ RangeError,
+ 'MASK must be set',
+ true,
+ 1002,
+ 'WS_ERR_EXPECTED_MASK'
+ );
+
+ cb(error);
+ return;
+ }
+ } else if (this._masked) {
+ const error = this.createError(
+ RangeError,
+ 'MASK must be clear',
+ true,
+ 1002,
+ 'WS_ERR_UNEXPECTED_MASK'
+ );
+
+ cb(error);
+ return;
+ }
+
+ if (this._payloadLength === 126) this._state = GET_PAYLOAD_LENGTH_16;
+ else if (this._payloadLength === 127) this._state = GET_PAYLOAD_LENGTH_64;
+ else this.haveLength(cb);
+ }
+
+ /**
+ * Gets extended payload length (7+16).
+ *
+ * @param {Function} cb Callback
+ * @private
+ */
+ getPayloadLength16(cb) {
+ if (this._bufferedBytes < 2) {
+ this._loop = false;
+ return;
+ }
+
+ this._payloadLength = this.consume(2).readUInt16BE(0);
+ this.haveLength(cb);
+ }
+
+ /**
+ * Gets extended payload length (7+64).
+ *
+ * @param {Function} cb Callback
+ * @private
+ */
+ getPayloadLength64(cb) {
+ if (this._bufferedBytes < 8) {
+ this._loop = false;
+ return;
+ }
+
+ const buf = this.consume(8);
+ const num = buf.readUInt32BE(0);
+
+ //
+ // The maximum safe integer in JavaScript is 2^53 - 1. An error is returned
+ // if payload length is greater than this number.
+ //
+ if (num > Math.pow(2, 53 - 32) - 1) {
+ const error = this.createError(
+ RangeError,
+ 'Unsupported WebSocket frame: payload length > 2^53 - 1',
+ false,
+ 1009,
+ 'WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH'
+ );
+
+ cb(error);
+ return;
+ }
+
+ this._payloadLength = num * Math.pow(2, 32) + buf.readUInt32BE(4);
+ this.haveLength(cb);
+ }
+
+ /**
+ * Payload length has been read.
+ *
+ * @param {Function} cb Callback
+ * @private
+ */
+ haveLength(cb) {
+ if (this._payloadLength && this._opcode < 0x08) {
+ this._totalPayloadLength += this._payloadLength;
+ if (this._totalPayloadLength > this._maxPayload && this._maxPayload > 0) {
+ const error = this.createError(
+ RangeError,
+ 'Max payload size exceeded',
+ false,
+ 1009,
+ 'WS_ERR_UNSUPPORTED_MESSAGE_LENGTH'
+ );
+
+ cb(error);
+ return;
+ }
+ }
+
+ if (this._masked) this._state = GET_MASK;
+ else this._state = GET_DATA;
+ }
+
+ /**
+ * Reads mask bytes.
+ *
+ * @private
+ */
+ getMask() {
+ if (this._bufferedBytes < 4) {
+ this._loop = false;
+ return;
+ }
+
+ this._mask = this.consume(4);
+ this._state = GET_DATA;
+ }
+
+ /**
+ * Reads data bytes.
+ *
+ * @param {Function} cb Callback
+ * @private
+ */
+ getData(cb) {
+ let data = EMPTY_BUFFER;
+
+ if (this._payloadLength) {
+ if (this._bufferedBytes < this._payloadLength) {
+ this._loop = false;
+ return;
+ }
+
+ data = this.consume(this._payloadLength);
+
+ if (
+ this._masked &&
+ (this._mask[0] | this._mask[1] | this._mask[2] | this._mask[3]) !== 0
+ ) {
+ unmask(data, this._mask);
+ }
+ }
+
+ if (this._opcode > 0x07) {
+ this.controlMessage(data, cb);
+ return;
+ }
+
+ if (this._compressed) {
+ this._state = INFLATING;
+ this.decompress(data, cb);
+ return;
+ }
+
+ if (data.length) {
+ //
+ // This message is not compressed so its length is the sum of the payload
+ // length of all fragments.
+ //
+ this._messageLength = this._totalPayloadLength;
+ this._fragments.push(data);
+ }
+
+ this.dataMessage(cb);
+ }
+
+ /**
+ * Decompresses data.
+ *
+ * @param {Buffer} data Compressed data
+ * @param {Function} cb Callback
+ * @private
+ */
+ decompress(data, cb) {
+ const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName];
+
+ perMessageDeflate.decompress(data, this._fin, (err, buf) => {
+ if (err) return cb(err);
+
+ if (buf.length) {
+ this._messageLength += buf.length;
+ if (this._messageLength > this._maxPayload && this._maxPayload > 0) {
+ const error = this.createError(
+ RangeError,
+ 'Max payload size exceeded',
+ false,
+ 1009,
+ 'WS_ERR_UNSUPPORTED_MESSAGE_LENGTH'
+ );
+
+ cb(error);
+ return;
+ }
+
+ this._fragments.push(buf);
+ }
+
+ this.dataMessage(cb);
+ if (this._state === GET_INFO) this.startLoop(cb);
+ });
+ }
+
+ /**
+ * Handles a data message.
+ *
+ * @param {Function} cb Callback
+ * @private
+ */
+ dataMessage(cb) {
+ if (!this._fin) {
+ this._state = GET_INFO;
+ return;
+ }
+
+ const messageLength = this._messageLength;
+ const fragments = this._fragments;
+
+ this._totalPayloadLength = 0;
+ this._messageLength = 0;
+ this._fragmented = 0;
+ this._fragments = [];
+
+ if (this._opcode === 2) {
+ let data;
+
+ if (this._binaryType === 'nodebuffer') {
+ data = concat(fragments, messageLength);
+ } else if (this._binaryType === 'arraybuffer') {
+ data = toArrayBuffer(concat(fragments, messageLength));
+ } else {
+ data = fragments;
+ }
+
+ //
+ // If the state is `INFLATING`, it means that the frame data was
+ // decompressed asynchronously, so there is no need to defer the event
+ // as it will be emitted asynchronously anyway.
+ //
+ if (this._state === INFLATING || this._allowSynchronousEvents) {
+ this.emit('message', data, true);
+ this._state = GET_INFO;
+ } else {
+ this._state = DEFER_EVENT;
+ queueTask(() => {
+ this.emit('message', data, true);
+ this._state = GET_INFO;
+ this.startLoop(cb);
+ });
+ }
+ } else {
+ const buf = concat(fragments, messageLength);
+
+ if (!this._skipUTF8Validation && !isValidUTF8(buf)) {
+ const error = this.createError(
+ Error,
+ 'invalid UTF-8 sequence',
+ true,
+ 1007,
+ 'WS_ERR_INVALID_UTF8'
+ );
+
+ cb(error);
+ return;
+ }
+
+ if (this._state === INFLATING || this._allowSynchronousEvents) {
+ this.emit('message', buf, false);
+ this._state = GET_INFO;
+ } else {
+ this._state = DEFER_EVENT;
+ queueTask(() => {
+ this.emit('message', buf, false);
+ this._state = GET_INFO;
+ this.startLoop(cb);
+ });
+ }
+ }
+ }
+
+ /**
+ * Handles a control message.
+ *
+ * @param {Buffer} data Data to handle
+ * @return {(Error|RangeError|undefined)} A possible error
+ * @private
+ */
+ controlMessage(data, cb) {
+ if (this._opcode === 0x08) {
+ if (data.length === 0) {
+ this._loop = false;
+ this.emit('conclude', 1005, EMPTY_BUFFER);
+ this.end();
+ } else {
+ const code = data.readUInt16BE(0);
+
+ if (!isValidStatusCode(code)) {
+ const error = this.createError(
+ RangeError,
+ `invalid status code ${code}`,
+ true,
+ 1002,
+ 'WS_ERR_INVALID_CLOSE_CODE'
+ );
+
+ cb(error);
+ return;
+ }
+
+ const buf = new FastBuffer(
+ data.buffer,
+ data.byteOffset + 2,
+ data.length - 2
+ );
+
+ if (!this._skipUTF8Validation && !isValidUTF8(buf)) {
+ const error = this.createError(
+ Error,
+ 'invalid UTF-8 sequence',
+ true,
+ 1007,
+ 'WS_ERR_INVALID_UTF8'
+ );
+
+ cb(error);
+ return;
+ }
+
+ this._loop = false;
+ this.emit('conclude', code, buf);
+ this.end();
+ }
+
+ this._state = GET_INFO;
+ return;
+ }
+
+ if (this._allowSynchronousEvents) {
+ this.emit(this._opcode === 0x09 ? 'ping' : 'pong', data);
+ this._state = GET_INFO;
+ } else {
+ this._state = DEFER_EVENT;
+ queueTask(() => {
+ this.emit(this._opcode === 0x09 ? 'ping' : 'pong', data);
+ this._state = GET_INFO;
+ this.startLoop(cb);
+ });
+ }
+ }
+
+ /**
+ * Builds an error object.
+ *
+ * @param {function(new:Error|RangeError)} ErrorCtor The error constructor
+ * @param {String} message The error message
+ * @param {Boolean} prefix Specifies whether or not to add a default prefix to
+ * `message`
+ * @param {Number} statusCode The status code
+ * @param {String} errorCode The exposed error code
+ * @return {(Error|RangeError)} The error
+ * @private
+ */
+ createError(ErrorCtor, message, prefix, statusCode, errorCode) {
+ this._loop = false;
+ this._errored = true;
+
+ const err = new ErrorCtor(
+ prefix ? `Invalid WebSocket frame: ${message}` : message
+ );
+
+ Error.captureStackTrace(err, this.createError);
+ err.code = errorCode;
+ err[kStatusCode] = statusCode;
+ return err;
+ }
+}
+
+module.exports = Receiver;
+
+/**
+ * A shim for `queueMicrotask()`.
+ *
+ * @param {Function} cb Callback
+ */
+function queueMicrotaskShim(cb) {
+ promise.then(cb).catch(throwErrorNextTick);
+}
+
+/**
+ * Throws an error.
+ *
+ * @param {Error} err The error to throw
+ * @private
+ */
+function throwError(err) {
+ throw err;
+}
+
+/**
+ * Throws an error in the next tick.
+ *
+ * @param {Error} err The error to throw
+ * @private
+ */
+function throwErrorNextTick(err) {
+ process.nextTick(throwError, err);
+}
diff --git a/node_modules/ws/lib/sender.js b/node_modules/ws/lib/sender.js
new file mode 100644
index 0000000..1ed04b0
--- /dev/null
+++ b/node_modules/ws/lib/sender.js
@@ -0,0 +1,477 @@
+/* eslint no-unused-vars: ["error", { "varsIgnorePattern": "^Duplex" }] */
+
+'use strict';
+
+const { Duplex } = require('stream');
+const { randomFillSync } = require('crypto');
+
+const PerMessageDeflate = require('./permessage-deflate');
+const { EMPTY_BUFFER } = require('./constants');
+const { isValidStatusCode } = require('./validation');
+const { mask: applyMask, toBuffer } = require('./buffer-util');
+
+const kByteLength = Symbol('kByteLength');
+const maskBuffer = Buffer.alloc(4);
+
+/**
+ * HyBi Sender implementation.
+ */
+class Sender {
+ /**
+ * Creates a Sender instance.
+ *
+ * @param {Duplex} socket The connection socket
+ * @param {Object} [extensions] An object containing the negotiated extensions
+ * @param {Function} [generateMask] The function used to generate the masking
+ * key
+ */
+ constructor(socket, extensions, generateMask) {
+ this._extensions = extensions || {};
+
+ if (generateMask) {
+ this._generateMask = generateMask;
+ this._maskBuffer = Buffer.alloc(4);
+ }
+
+ this._socket = socket;
+
+ this._firstFragment = true;
+ this._compress = false;
+
+ this._bufferedBytes = 0;
+ this._deflating = false;
+ this._queue = [];
+ }
+
+ /**
+ * Frames a piece of data according to the HyBi WebSocket protocol.
+ *
+ * @param {(Buffer|String)} data The data to frame
+ * @param {Object} options Options object
+ * @param {Boolean} [options.fin=false] Specifies whether or not to set the
+ * FIN bit
+ * @param {Function} [options.generateMask] The function used to generate the
+ * masking key
+ * @param {Boolean} [options.mask=false] Specifies whether or not to mask
+ * `data`
+ * @param {Buffer} [options.maskBuffer] The buffer used to store the masking
+ * key
+ * @param {Number} options.opcode The opcode
+ * @param {Boolean} [options.readOnly=false] Specifies whether `data` can be
+ * modified
+ * @param {Boolean} [options.rsv1=false] Specifies whether or not to set the
+ * RSV1 bit
+ * @return {(Buffer|String)[]} The framed data
+ * @public
+ */
+ static frame(data, options) {
+ let mask;
+ let merge = false;
+ let offset = 2;
+ let skipMasking = false;
+
+ if (options.mask) {
+ mask = options.maskBuffer || maskBuffer;
+
+ if (options.generateMask) {
+ options.generateMask(mask);
+ } else {
+ randomFillSync(mask, 0, 4);
+ }
+
+ skipMasking = (mask[0] | mask[1] | mask[2] | mask[3]) === 0;
+ offset = 6;
+ }
+
+ let dataLength;
+
+ if (typeof data === 'string') {
+ if (
+ (!options.mask || skipMasking) &&
+ options[kByteLength] !== undefined
+ ) {
+ dataLength = options[kByteLength];
+ } else {
+ data = Buffer.from(data);
+ dataLength = data.length;
+ }
+ } else {
+ dataLength = data.length;
+ merge = options.mask && options.readOnly && !skipMasking;
+ }
+
+ let payloadLength = dataLength;
+
+ if (dataLength >= 65536) {
+ offset += 8;
+ payloadLength = 127;
+ } else if (dataLength > 125) {
+ offset += 2;
+ payloadLength = 126;
+ }
+
+ const target = Buffer.allocUnsafe(merge ? dataLength + offset : offset);
+
+ target[0] = options.fin ? options.opcode | 0x80 : options.opcode;
+ if (options.rsv1) target[0] |= 0x40;
+
+ target[1] = payloadLength;
+
+ if (payloadLength === 126) {
+ target.writeUInt16BE(dataLength, 2);
+ } else if (payloadLength === 127) {
+ target[2] = target[3] = 0;
+ target.writeUIntBE(dataLength, 4, 6);
+ }
+
+ if (!options.mask) return [target, data];
+
+ target[1] |= 0x80;
+ target[offset - 4] = mask[0];
+ target[offset - 3] = mask[1];
+ target[offset - 2] = mask[2];
+ target[offset - 1] = mask[3];
+
+ if (skipMasking) return [target, data];
+
+ if (merge) {
+ applyMask(data, mask, target, offset, dataLength);
+ return [target];
+ }
+
+ applyMask(data, mask, data, 0, dataLength);
+ return [target, data];
+ }
+
+ /**
+ * Sends a close message to the other peer.
+ *
+ * @param {Number} [code] The status code component of the body
+ * @param {(String|Buffer)} [data] The message component of the body
+ * @param {Boolean} [mask=false] Specifies whether or not to mask the message
+ * @param {Function} [cb] Callback
+ * @public
+ */
+ close(code, data, mask, cb) {
+ let buf;
+
+ if (code === undefined) {
+ buf = EMPTY_BUFFER;
+ } else if (typeof code !== 'number' || !isValidStatusCode(code)) {
+ throw new TypeError('First argument must be a valid error code number');
+ } else if (data === undefined || !data.length) {
+ buf = Buffer.allocUnsafe(2);
+ buf.writeUInt16BE(code, 0);
+ } else {
+ const length = Buffer.byteLength(data);
+
+ if (length > 123) {
+ throw new RangeError('The message must not be greater than 123 bytes');
+ }
+
+ buf = Buffer.allocUnsafe(2 + length);
+ buf.writeUInt16BE(code, 0);
+
+ if (typeof data === 'string') {
+ buf.write(data, 2);
+ } else {
+ buf.set(data, 2);
+ }
+ }
+
+ const options = {
+ [kByteLength]: buf.length,
+ fin: true,
+ generateMask: this._generateMask,
+ mask,
+ maskBuffer: this._maskBuffer,
+ opcode: 0x08,
+ readOnly: false,
+ rsv1: false
+ };
+
+ if (this._deflating) {
+ this.enqueue([this.dispatch, buf, false, options, cb]);
+ } else {
+ this.sendFrame(Sender.frame(buf, options), cb);
+ }
+ }
+
+ /**
+ * Sends a ping message to the other peer.
+ *
+ * @param {*} data The message to send
+ * @param {Boolean} [mask=false] Specifies whether or not to mask `data`
+ * @param {Function} [cb] Callback
+ * @public
+ */
+ ping(data, mask, cb) {
+ let byteLength;
+ let readOnly;
+
+ if (typeof data === 'string') {
+ byteLength = Buffer.byteLength(data);
+ readOnly = false;
+ } else {
+ data = toBuffer(data);
+ byteLength = data.length;
+ readOnly = toBuffer.readOnly;
+ }
+
+ if (byteLength > 125) {
+ throw new RangeError('The data size must not be greater than 125 bytes');
+ }
+
+ const options = {
+ [kByteLength]: byteLength,
+ fin: true,
+ generateMask: this._generateMask,
+ mask,
+ maskBuffer: this._maskBuffer,
+ opcode: 0x09,
+ readOnly,
+ rsv1: false
+ };
+
+ if (this._deflating) {
+ this.enqueue([this.dispatch, data, false, options, cb]);
+ } else {
+ this.sendFrame(Sender.frame(data, options), cb);
+ }
+ }
+
+ /**
+ * Sends a pong message to the other peer.
+ *
+ * @param {*} data The message to send
+ * @param {Boolean} [mask=false] Specifies whether or not to mask `data`
+ * @param {Function} [cb] Callback
+ * @public
+ */
+ pong(data, mask, cb) {
+ let byteLength;
+ let readOnly;
+
+ if (typeof data === 'string') {
+ byteLength = Buffer.byteLength(data);
+ readOnly = false;
+ } else {
+ data = toBuffer(data);
+ byteLength = data.length;
+ readOnly = toBuffer.readOnly;
+ }
+
+ if (byteLength > 125) {
+ throw new RangeError('The data size must not be greater than 125 bytes');
+ }
+
+ const options = {
+ [kByteLength]: byteLength,
+ fin: true,
+ generateMask: this._generateMask,
+ mask,
+ maskBuffer: this._maskBuffer,
+ opcode: 0x0a,
+ readOnly,
+ rsv1: false
+ };
+
+ if (this._deflating) {
+ this.enqueue([this.dispatch, data, false, options, cb]);
+ } else {
+ this.sendFrame(Sender.frame(data, options), cb);
+ }
+ }
+
+ /**
+ * Sends a data message to the other peer.
+ *
+ * @param {*} data The message to send
+ * @param {Object} options Options object
+ * @param {Boolean} [options.binary=false] Specifies whether `data` is binary
+ * or text
+ * @param {Boolean} [options.compress=false] Specifies whether or not to
+ * compress `data`
+ * @param {Boolean} [options.fin=false] Specifies whether the fragment is the
+ * last one
+ * @param {Boolean} [options.mask=false] Specifies whether or not to mask
+ * `data`
+ * @param {Function} [cb] Callback
+ * @public
+ */
+ send(data, options, cb) {
+ const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName];
+ let opcode = options.binary ? 2 : 1;
+ let rsv1 = options.compress;
+
+ let byteLength;
+ let readOnly;
+
+ if (typeof data === 'string') {
+ byteLength = Buffer.byteLength(data);
+ readOnly = false;
+ } else {
+ data = toBuffer(data);
+ byteLength = data.length;
+ readOnly = toBuffer.readOnly;
+ }
+
+ if (this._firstFragment) {
+ this._firstFragment = false;
+ if (
+ rsv1 &&
+ perMessageDeflate &&
+ perMessageDeflate.params[
+ perMessageDeflate._isServer
+ ? 'server_no_context_takeover'
+ : 'client_no_context_takeover'
+ ]
+ ) {
+ rsv1 = byteLength >= perMessageDeflate._threshold;
+ }
+ this._compress = rsv1;
+ } else {
+ rsv1 = false;
+ opcode = 0;
+ }
+
+ if (options.fin) this._firstFragment = true;
+
+ if (perMessageDeflate) {
+ const opts = {
+ [kByteLength]: byteLength,
+ fin: options.fin,
+ generateMask: this._generateMask,
+ mask: options.mask,
+ maskBuffer: this._maskBuffer,
+ opcode,
+ readOnly,
+ rsv1
+ };
+
+ if (this._deflating) {
+ this.enqueue([this.dispatch, data, this._compress, opts, cb]);
+ } else {
+ this.dispatch(data, this._compress, opts, cb);
+ }
+ } else {
+ this.sendFrame(
+ Sender.frame(data, {
+ [kByteLength]: byteLength,
+ fin: options.fin,
+ generateMask: this._generateMask,
+ mask: options.mask,
+ maskBuffer: this._maskBuffer,
+ opcode,
+ readOnly,
+ rsv1: false
+ }),
+ cb
+ );
+ }
+ }
+
+ /**
+ * Dispatches a message.
+ *
+ * @param {(Buffer|String)} data The message to send
+ * @param {Boolean} [compress=false] Specifies whether or not to compress
+ * `data`
+ * @param {Object} options Options object
+ * @param {Boolean} [options.fin=false] Specifies whether or not to set the
+ * FIN bit
+ * @param {Function} [options.generateMask] The function used to generate the
+ * masking key
+ * @param {Boolean} [options.mask=false] Specifies whether or not to mask
+ * `data`
+ * @param {Buffer} [options.maskBuffer] The buffer used to store the masking
+ * key
+ * @param {Number} options.opcode The opcode
+ * @param {Boolean} [options.readOnly=false] Specifies whether `data` can be
+ * modified
+ * @param {Boolean} [options.rsv1=false] Specifies whether or not to set the
+ * RSV1 bit
+ * @param {Function} [cb] Callback
+ * @private
+ */
+ dispatch(data, compress, options, cb) {
+ if (!compress) {
+ this.sendFrame(Sender.frame(data, options), cb);
+ return;
+ }
+
+ const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName];
+
+ this._bufferedBytes += options[kByteLength];
+ this._deflating = true;
+ perMessageDeflate.compress(data, options.fin, (_, buf) => {
+ if (this._socket.destroyed) {
+ const err = new Error(
+ 'The socket was closed while data was being compressed'
+ );
+
+ if (typeof cb === 'function') cb(err);
+
+ for (let i = 0; i < this._queue.length; i++) {
+ const params = this._queue[i];
+ const callback = params[params.length - 1];
+
+ if (typeof callback === 'function') callback(err);
+ }
+
+ return;
+ }
+
+ this._bufferedBytes -= options[kByteLength];
+ this._deflating = false;
+ options.readOnly = false;
+ this.sendFrame(Sender.frame(buf, options), cb);
+ this.dequeue();
+ });
+ }
+
+ /**
+ * Executes queued send operations.
+ *
+ * @private
+ */
+ dequeue() {
+ while (!this._deflating && this._queue.length) {
+ const params = this._queue.shift();
+
+ this._bufferedBytes -= params[3][kByteLength];
+ Reflect.apply(params[0], this, params.slice(1));
+ }
+ }
+
+ /**
+ * Enqueues a send operation.
+ *
+ * @param {Array} params Send operation parameters.
+ * @private
+ */
+ enqueue(params) {
+ this._bufferedBytes += params[3][kByteLength];
+ this._queue.push(params);
+ }
+
+ /**
+ * Sends a frame.
+ *
+ * @param {Buffer[]} list The frame to send
+ * @param {Function} [cb] Callback
+ * @private
+ */
+ sendFrame(list, cb) {
+ if (list.length === 2) {
+ this._socket.cork();
+ this._socket.write(list[0]);
+ this._socket.write(list[1], cb);
+ this._socket.uncork();
+ } else {
+ this._socket.write(list[0], cb);
+ }
+ }
+}
+
+module.exports = Sender;
diff --git a/node_modules/ws/lib/stream.js b/node_modules/ws/lib/stream.js
new file mode 100644
index 0000000..230734b
--- /dev/null
+++ b/node_modules/ws/lib/stream.js
@@ -0,0 +1,159 @@
+'use strict';
+
+const { Duplex } = require('stream');
+
+/**
+ * Emits the `'close'` event on a stream.
+ *
+ * @param {Duplex} stream The stream.
+ * @private
+ */
+function emitClose(stream) {
+ stream.emit('close');
+}
+
+/**
+ * The listener of the `'end'` event.
+ *
+ * @private
+ */
+function duplexOnEnd() {
+ if (!this.destroyed && this._writableState.finished) {
+ this.destroy();
+ }
+}
+
+/**
+ * The listener of the `'error'` event.
+ *
+ * @param {Error} err The error
+ * @private
+ */
+function duplexOnError(err) {
+ this.removeListener('error', duplexOnError);
+ this.destroy();
+ if (this.listenerCount('error') === 0) {
+ // Do not suppress the throwing behavior.
+ this.emit('error', err);
+ }
+}
+
+/**
+ * Wraps a `WebSocket` in a duplex stream.
+ *
+ * @param {WebSocket} ws The `WebSocket` to wrap
+ * @param {Object} [options] The options for the `Duplex` constructor
+ * @return {Duplex} The duplex stream
+ * @public
+ */
+function createWebSocketStream(ws, options) {
+ let terminateOnDestroy = true;
+
+ const duplex = new Duplex({
+ ...options,
+ autoDestroy: false,
+ emitClose: false,
+ objectMode: false,
+ writableObjectMode: false
+ });
+
+ ws.on('message', function message(msg, isBinary) {
+ const data =
+ !isBinary && duplex._readableState.objectMode ? msg.toString() : msg;
+
+ if (!duplex.push(data)) ws.pause();
+ });
+
+ ws.once('error', function error(err) {
+ if (duplex.destroyed) return;
+
+ // Prevent `ws.terminate()` from being called by `duplex._destroy()`.
+ //
+ // - If the `'error'` event is emitted before the `'open'` event, then
+ // `ws.terminate()` is a noop as no socket is assigned.
+ // - Otherwise, the error is re-emitted by the listener of the `'error'`
+ // event of the `Receiver` object. The listener already closes the
+ // connection by calling `ws.close()`. This allows a close frame to be
+ // sent to the other peer. If `ws.terminate()` is called right after this,
+ // then the close frame might not be sent.
+ terminateOnDestroy = false;
+ duplex.destroy(err);
+ });
+
+ ws.once('close', function close() {
+ if (duplex.destroyed) return;
+
+ duplex.push(null);
+ });
+
+ duplex._destroy = function (err, callback) {
+ if (ws.readyState === ws.CLOSED) {
+ callback(err);
+ process.nextTick(emitClose, duplex);
+ return;
+ }
+
+ let called = false;
+
+ ws.once('error', function error(err) {
+ called = true;
+ callback(err);
+ });
+
+ ws.once('close', function close() {
+ if (!called) callback(err);
+ process.nextTick(emitClose, duplex);
+ });
+
+ if (terminateOnDestroy) ws.terminate();
+ };
+
+ duplex._final = function (callback) {
+ if (ws.readyState === ws.CONNECTING) {
+ ws.once('open', function open() {
+ duplex._final(callback);
+ });
+ return;
+ }
+
+ // If the value of the `_socket` property is `null` it means that `ws` is a
+ // client websocket and the handshake failed. In fact, when this happens, a
+ // socket is never assigned to the websocket. Wait for the `'error'` event
+ // that will be emitted by the websocket.
+ if (ws._socket === null) return;
+
+ if (ws._socket._writableState.finished) {
+ callback();
+ if (duplex._readableState.endEmitted) duplex.destroy();
+ } else {
+ ws._socket.once('finish', function finish() {
+ // `duplex` is not destroyed here because the `'end'` event will be
+ // emitted on `duplex` after this `'finish'` event. The EOF signaling
+ // `null` chunk is, in fact, pushed when the websocket emits `'close'`.
+ callback();
+ });
+ ws.close();
+ }
+ };
+
+ duplex._read = function () {
+ if (ws.isPaused) ws.resume();
+ };
+
+ duplex._write = function (chunk, encoding, callback) {
+ if (ws.readyState === ws.CONNECTING) {
+ ws.once('open', function open() {
+ duplex._write(chunk, encoding, callback);
+ });
+ return;
+ }
+
+ ws.send(chunk, callback);
+ };
+
+ duplex.on('end', duplexOnEnd);
+ duplex.on('error', duplexOnError);
+ return duplex;
+}
+
+module.exports = createWebSocketStream;
diff --git a/node_modules/ws/lib/subprotocol.js b/node_modules/ws/lib/subprotocol.js
new file mode 100644
index 0000000..d4381e8
--- /dev/null
+++ b/node_modules/ws/lib/subprotocol.js
@@ -0,0 +1,62 @@
+'use strict';
+
+const { tokenChars } = require('./validation');
+
+/**
+ * Parses the `Sec-WebSocket-Protocol` header into a set of subprotocol names.
+ *
+ * @param {String} header The field value of the header
+ * @return {Set} The subprotocol names
+ * @public
+ */
+function parse(header) {
+ const protocols = new Set();
+ let start = -1;
+ let end = -1;
+ let i = 0;
+
+ for (i; i < header.length; i++) {
+ const code = header.charCodeAt(i);
+
+ if (end === -1 && tokenChars[code] === 1) {
+ if (start === -1) start = i;
+ } else if (
+ i !== 0 &&
+ (code === 0x20 /* ' ' */ || code === 0x09) /* '\t' */
+ ) {
+ if (end === -1 && start !== -1) end = i;
+ } else if (code === 0x2c /* ',' */) {
+ if (start === -1) {
+ throw new SyntaxError(`Unexpected character at index ${i}`);
+ }
+
+ if (end === -1) end = i;
+
+ const protocol = header.slice(start, end);
+
+ if (protocols.has(protocol)) {
+ throw new SyntaxError(`The "${protocol}" subprotocol is duplicated`);
+ }
+
+ protocols.add(protocol);
+ start = end = -1;
+ } else {
+ throw new SyntaxError(`Unexpected character at index ${i}`);
+ }
+ }
+
+ if (start === -1 || end !== -1) {
+ throw new SyntaxError('Unexpected end of input');
+ }
+
+ const protocol = header.slice(start, i);
+
+ if (protocols.has(protocol)) {
+ throw new SyntaxError(`The "${protocol}" subprotocol is duplicated`);
+ }
+
+ protocols.add(protocol);
+ return protocols;
+}
+
+module.exports = { parse };
diff --git a/node_modules/ws/lib/validation.js b/node_modules/ws/lib/validation.js
new file mode 100644
index 0000000..c352e6e
--- /dev/null
+++ b/node_modules/ws/lib/validation.js
@@ -0,0 +1,130 @@
+'use strict';
+
+const { isUtf8 } = require('buffer');
+
+//
+// Allowed token characters:
+//
+// '!', '#', '$', '%', '&', ''', '*', '+', '-',
+// '.', 0-9, A-Z, '^', '_', '`', a-z, '|', '~'
+//
+// tokenChars[32] === 0 // ' '
+// tokenChars[33] === 1 // '!'
+// tokenChars[34] === 0 // '"'
+// ...
+//
+// prettier-ignore
+const tokenChars = [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0 - 15
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 16 - 31
+ 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, // 32 - 47
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, // 48 - 63
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 64 - 79
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, // 80 - 95
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 96 - 111
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0 // 112 - 127
+];
+
+/**
+ * Checks if a status code is allowed in a close frame.
+ *
+ * @param {Number} code The status code
+ * @return {Boolean} `true` if the status code is valid, else `false`
+ * @public
+ */
+function isValidStatusCode(code) {
+ return (
+ (code >= 1000 &&
+ code <= 1014 &&
+ code !== 1004 &&
+ code !== 1005 &&
+ code !== 1006) ||
+ (code >= 3000 && code <= 4999)
+ );
+}
+
+/**
+ * Checks if a given buffer contains only correct UTF-8.
+ * Ported from https://www.cl.cam.ac.uk/%7Emgk25/ucs/utf8_check.c by
+ * Markus Kuhn.
+ *
+ * @param {Buffer} buf The buffer to check
+ * @return {Boolean} `true` if `buf` contains only correct UTF-8, else `false`
+ * @public
+ */
+function _isValidUTF8(buf) {
+ const len = buf.length;
+ let i = 0;
+
+ while (i < len) {
+ if ((buf[i] & 0x80) === 0) {
+ // 0xxxxxxx
+ i++;
+ } else if ((buf[i] & 0xe0) === 0xc0) {
+ // 110xxxxx 10xxxxxx
+ if (
+ i + 1 === len ||
+ (buf[i + 1] & 0xc0) !== 0x80 ||
+ (buf[i] & 0xfe) === 0xc0 // Overlong
+ ) {
+ return false;
+ }
+
+ i += 2;
+ } else if ((buf[i] & 0xf0) === 0xe0) {
+ // 1110xxxx 10xxxxxx 10xxxxxx
+ if (
+ i + 2 >= len ||
+ (buf[i + 1] & 0xc0) !== 0x80 ||
+ (buf[i + 2] & 0xc0) !== 0x80 ||
+ (buf[i] === 0xe0 && (buf[i + 1] & 0xe0) === 0x80) || // Overlong
+ (buf[i] === 0xed && (buf[i + 1] & 0xe0) === 0xa0) // Surrogate (U+D800 - U+DFFF)
+ ) {
+ return false;
+ }
+
+ i += 3;
+ } else if ((buf[i] & 0xf8) === 0xf0) {
+ // 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
+ if (
+ i + 3 >= len ||
+ (buf[i + 1] & 0xc0) !== 0x80 ||
+ (buf[i + 2] & 0xc0) !== 0x80 ||
+ (buf[i + 3] & 0xc0) !== 0x80 ||
+ (buf[i] === 0xf0 && (buf[i + 1] & 0xf0) === 0x80) || // Overlong
+ (buf[i] === 0xf4 && buf[i + 1] > 0x8f) ||
+ buf[i] > 0xf4 // > U+10FFFF
+ ) {
+ return false;
+ }
+
+ i += 4;
+ } else {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+module.exports = {
+ isValidStatusCode,
+ isValidUTF8: _isValidUTF8,
+ tokenChars
+};
+
+if (isUtf8) {
+ module.exports.isValidUTF8 = function (buf) {
+ return buf.length < 24 ? _isValidUTF8(buf) : isUtf8(buf);
+ };
+} /* istanbul ignore else */ else if (!process.env.WS_NO_UTF_8_VALIDATE) {
+ try {
+ const isValidUTF8 = require('utf-8-validate');
+
+ module.exports.isValidUTF8 = function (buf) {
+ return buf.length < 32 ? _isValidUTF8(buf) : isValidUTF8(buf);
+ };
+ } catch (e) {
+ // Continue regardless of the error.
+ }
+}
diff --git a/node_modules/ws/lib/websocket-server.js b/node_modules/ws/lib/websocket-server.js
new file mode 100644
index 0000000..377c45a
--- /dev/null
+++ b/node_modules/ws/lib/websocket-server.js
@@ -0,0 +1,539 @@
+/* eslint no-unused-vars: ["error", { "varsIgnorePattern": "^Duplex$" }] */
+
+'use strict';
+
+const EventEmitter = require('events');
+const http = require('http');
+const { Duplex } = require('stream');
+const { createHash } = require('crypto');
+
+const extension = require('./extension');
+const PerMessageDeflate = require('./permessage-deflate');
+const subprotocol = require('./subprotocol');
+const WebSocket = require('./websocket');
+const { GUID, kWebSocket } = require('./constants');
+
+const keyRegex = /^[+/0-9A-Za-z]{22}==$/;
+
+const RUNNING = 0;
+const CLOSING = 1;
+const CLOSED = 2;
+
+/**
+ * Class representing a WebSocket server.
+ *
+ * @extends EventEmitter
+ */
+class WebSocketServer extends EventEmitter {
+ /**
+ * Create a `WebSocketServer` instance.
+ *
+ * @param {Object} options Configuration options
+ * @param {Boolean} [options.allowSynchronousEvents=false] Specifies whether
+ * any of the `'message'`, `'ping'`, and `'pong'` events can be emitted
+ * multiple times in the same tick
+ * @param {Boolean} [options.autoPong=true] Specifies whether or not to
+ * automatically send a pong in response to a ping
+ * @param {Number} [options.backlog=511] The maximum length of the queue of
+ * pending connections
+ * @param {Boolean} [options.clientTracking=true] Specifies whether or not to
+ * track clients
+ * @param {Function} [options.handleProtocols] A hook to handle protocols
+ * @param {String} [options.host] The hostname where to bind the server
+ * @param {Number} [options.maxPayload=104857600] The maximum allowed message
+ * size
+ * @param {Boolean} [options.noServer=false] Enable no server mode
+ * @param {String} [options.path] Accept only connections matching this path
+ * @param {(Boolean|Object)} [options.perMessageDeflate=false] Enable/disable
+ * permessage-deflate
+ * @param {Number} [options.port] The port where to bind the server
+ * @param {(http.Server|https.Server)} [options.server] A pre-created HTTP/S
+ * server to use
+ * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or
+ * not to skip UTF-8 validation for text and close messages
+ * @param {Function} [options.verifyClient] A hook to reject connections
+ * @param {Function} [options.WebSocket=WebSocket] Specifies the `WebSocket`
+ * class to use. It must be the `WebSocket` class or class that extends it
+ * @param {Function} [callback] A listener for the `listening` event
+ */
+ constructor(options, callback) {
+ super();
+
+ options = {
+ allowSynchronousEvents: false,
+ autoPong: true,
+ maxPayload: 100 * 1024 * 1024,
+ skipUTF8Validation: false,
+ perMessageDeflate: false,
+ handleProtocols: null,
+ clientTracking: true,
+ verifyClient: null,
+ noServer: false,
+ backlog: null, // use default (511 as implemented in net.js)
+ server: null,
+ host: null,
+ path: null,
+ port: null,
+ WebSocket,
+ ...options
+ };
+
+ if (
+ (options.port == null && !options.server && !options.noServer) ||
+ (options.port != null && (options.server || options.noServer)) ||
+ (options.server && options.noServer)
+ ) {
+ throw new TypeError(
+ 'One and only one of the "port", "server", or "noServer" options ' +
+ 'must be specified'
+ );
+ }
+
+ if (options.port != null) {
+ this._server = http.createServer((req, res) => {
+ const body = http.STATUS_CODES[426];
+
+ res.writeHead(426, {
+ 'Content-Length': body.length,
+ 'Content-Type': 'text/plain'
+ });
+ res.end(body);
+ });
+ this._server.listen(
+ options.port,
+ options.host,
+ options.backlog,
+ callback
+ );
+ } else if (options.server) {
+ this._server = options.server;
+ }
+
+ if (this._server) {
+ const emitConnection = this.emit.bind(this, 'connection');
+
+ this._removeListeners = addListeners(this._server, {
+ listening: this.emit.bind(this, 'listening'),
+ error: this.emit.bind(this, 'error'),
+ upgrade: (req, socket, head) => {
+ this.handleUpgrade(req, socket, head, emitConnection);
+ }
+ });
+ }
+
+ if (options.perMessageDeflate === true) options.perMessageDeflate = {};
+ if (options.clientTracking) {
+ this.clients = new Set();
+ this._shouldEmitClose = false;
+ }
+
+ this.options = options;
+ this._state = RUNNING;
+ }
+
+ /**
+ * Returns the bound address, the address family name, and port of the server
+ * as reported by the operating system if listening on an IP socket.
+ * If the server is listening on a pipe or UNIX domain socket, the name is
+ * returned as a string.
+ *
+ * @return {(Object|String|null)} The address of the server
+ * @public
+ */
+ address() {
+ if (this.options.noServer) {
+ throw new Error('The server is operating in "noServer" mode');
+ }
+
+ if (!this._server) return null;
+ return this._server.address();
+ }
+
+ /**
+ * Stop the server from accepting new connections and emit the `'close'` event
+ * when all existing connections are closed.
+ *
+ * @param {Function} [cb] A one-time listener for the `'close'` event
+ * @public
+ */
+ close(cb) {
+ if (this._state === CLOSED) {
+ if (cb) {
+ this.once('close', () => {
+ cb(new Error('The server is not running'));
+ });
+ }
+
+ process.nextTick(emitClose, this);
+ return;
+ }
+
+ if (cb) this.once('close', cb);
+
+ if (this._state === CLOSING) return;
+ this._state = CLOSING;
+
+ if (this.options.noServer || this.options.server) {
+ if (this._server) {
+ this._removeListeners();
+ this._removeListeners = this._server = null;
+ }
+
+ if (this.clients) {
+ if (!this.clients.size) {
+ process.nextTick(emitClose, this);
+ } else {
+ this._shouldEmitClose = true;
+ }
+ } else {
+ process.nextTick(emitClose, this);
+ }
+ } else {
+ const server = this._server;
+
+ this._removeListeners();
+ this._removeListeners = this._server = null;
+
+ //
+ // The HTTP/S server was created internally. Close it, and rely on its
+ // `'close'` event.
+ //
+ server.close(() => {
+ emitClose(this);
+ });
+ }
+ }
+
+ /**
+ * See if a given request should be handled by this server instance.
+ *
+ * @param {http.IncomingMessage} req Request object to inspect
+ * @return {Boolean} `true` if the request is valid, else `false`
+ * @public
+ */
+ shouldHandle(req) {
+ if (this.options.path) {
+ const index = req.url.indexOf('?');
+ const pathname = index !== -1 ? req.url.slice(0, index) : req.url;
+
+ if (pathname !== this.options.path) return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Handle a HTTP Upgrade request.
+ *
+ * @param {http.IncomingMessage} req The request object
+ * @param {Duplex} socket The network socket between the server and client
+ * @param {Buffer} head The first packet of the upgraded stream
+ * @param {Function} cb Callback
+ * @public
+ */
+ handleUpgrade(req, socket, head, cb) {
+ socket.on('error', socketOnError);
+
+ const key = req.headers['sec-websocket-key'];
+ const version = +req.headers['sec-websocket-version'];
+
+ if (req.method !== 'GET') {
+ const message = 'Invalid HTTP method';
+ abortHandshakeOrEmitwsClientError(this, req, socket, 405, message);
+ return;
+ }
+
+ if (req.headers.upgrade.toLowerCase() !== 'websocket') {
+ const message = 'Invalid Upgrade header';
+ abortHandshakeOrEmitwsClientError(this, req, socket, 400, message);
+ return;
+ }
+
+ if (!key || !keyRegex.test(key)) {
+ const message = 'Missing or invalid Sec-WebSocket-Key header';
+ abortHandshakeOrEmitwsClientError(this, req, socket, 400, message);
+ return;
+ }
+
+ if (version !== 8 && version !== 13) {
+ const message = 'Missing or invalid Sec-WebSocket-Version header';
+ abortHandshakeOrEmitwsClientError(this, req, socket, 400, message);
+ return;
+ }
+
+ if (!this.shouldHandle(req)) {
+ abortHandshake(socket, 400);
+ return;
+ }
+
+ const secWebSocketProtocol = req.headers['sec-websocket-protocol'];
+ let protocols = new Set();
+
+ if (secWebSocketProtocol !== undefined) {
+ try {
+ protocols = subprotocol.parse(secWebSocketProtocol);
+ } catch (err) {
+ const message = 'Invalid Sec-WebSocket-Protocol header';
+ abortHandshakeOrEmitwsClientError(this, req, socket, 400, message);
+ return;
+ }
+ }
+
+ const secWebSocketExtensions = req.headers['sec-websocket-extensions'];
+ const extensions = {};
+
+ if (
+ this.options.perMessageDeflate &&
+ secWebSocketExtensions !== undefined
+ ) {
+ const perMessageDeflate = new PerMessageDeflate(
+ this.options.perMessageDeflate,
+ true,
+ this.options.maxPayload
+ );
+
+ try {
+ const offers = extension.parse(secWebSocketExtensions);
+
+ if (offers[PerMessageDeflate.extensionName]) {
+ perMessageDeflate.accept(offers[PerMessageDeflate.extensionName]);
+ extensions[PerMessageDeflate.extensionName] = perMessageDeflate;
+ }
+ } catch (err) {
+ const message =
+ 'Invalid or unacceptable Sec-WebSocket-Extensions header';
+ abortHandshakeOrEmitwsClientError(this, req, socket, 400, message);
+ return;
+ }
+ }
+
+ //
+ // Optionally call external client verification handler.
+ //
+ if (this.options.verifyClient) {
+ const info = {
+ origin:
+ req.headers[`${version === 8 ? 'sec-websocket-origin' : 'origin'}`],
+ secure: !!(req.socket.authorized || req.socket.encrypted),
+ req
+ };
+
+ if (this.options.verifyClient.length === 2) {
+ this.options.verifyClient(info, (verified, code, message, headers) => {
+ if (!verified) {
+ return abortHandshake(socket, code || 401, message, headers);
+ }
+
+ this.completeUpgrade(
+ extensions,
+ key,
+ protocols,
+ req,
+ socket,
+ head,
+ cb
+ );
+ });
+ return;
+ }
+
+ if (!this.options.verifyClient(info)) return abortHandshake(socket, 401);
+ }
+
+ this.completeUpgrade(extensions, key, protocols, req, socket, head, cb);
+ }
+
+ /**
+ * Upgrade the connection to WebSocket.
+ *
+ * @param {Object} extensions The accepted extensions
+ * @param {String} key The value of the `Sec-WebSocket-Key` header
+ * @param {Set} protocols The subprotocols
+ * @param {http.IncomingMessage} req The request object
+ * @param {Duplex} socket The network socket between the server and client
+ * @param {Buffer} head The first packet of the upgraded stream
+ * @param {Function} cb Callback
+ * @throws {Error} If called more than once with the same socket
+ * @private
+ */
+ completeUpgrade(extensions, key, protocols, req, socket, head, cb) {
+ //
+ // Destroy the socket if the client has already sent a FIN packet.
+ //
+ if (!socket.readable || !socket.writable) return socket.destroy();
+
+ if (socket[kWebSocket]) {
+ throw new Error(
+ 'server.handleUpgrade() was called more than once with the same ' +
+ 'socket, possibly due to a misconfiguration'
+ );
+ }
+
+ if (this._state > RUNNING) return abortHandshake(socket, 503);
+
+ const digest = createHash('sha1')
+ .update(key + GUID)
+ .digest('base64');
+
+ const headers = [
+ 'HTTP/1.1 101 Switching Protocols',
+ 'Upgrade: websocket',
+ 'Connection: Upgrade',
+ `Sec-WebSocket-Accept: ${digest}`
+ ];
+
+ const ws = new this.options.WebSocket(null, undefined, this.options);
+
+ if (protocols.size) {
+ //
+ // Optionally call external protocol selection handler.
+ //
+ const protocol = this.options.handleProtocols
+ ? this.options.handleProtocols(protocols, req)
+ : protocols.values().next().value;
+
+ if (protocol) {
+ headers.push(`Sec-WebSocket-Protocol: ${protocol}`);
+ ws._protocol = protocol;
+ }
+ }
+
+ if (extensions[PerMessageDeflate.extensionName]) {
+ const params = extensions[PerMessageDeflate.extensionName].params;
+ const value = extension.format({
+ [PerMessageDeflate.extensionName]: [params]
+ });
+ headers.push(`Sec-WebSocket-Extensions: ${value}`);
+ ws._extensions = extensions;
+ }
+
+ //
+ // Allow external modification/inspection of handshake headers.
+ //
+ this.emit('headers', headers, req);
+
+ socket.write(headers.concat('\r\n').join('\r\n'));
+ socket.removeListener('error', socketOnError);
+
+ ws.setSocket(socket, head, {
+ allowSynchronousEvents: this.options.allowSynchronousEvents,
+ maxPayload: this.options.maxPayload,
+ skipUTF8Validation: this.options.skipUTF8Validation
+ });
+
+ if (this.clients) {
+ this.clients.add(ws);
+ ws.on('close', () => {
+ this.clients.delete(ws);
+
+ if (this._shouldEmitClose && !this.clients.size) {
+ process.nextTick(emitClose, this);
+ }
+ });
+ }
+
+ cb(ws, req);
+ }
+}
+
+module.exports = WebSocketServer;
+
+/**
+ * Add event listeners on an `EventEmitter` using a map of <event, listener>
+ * pairs.
+ *
+ * @param {EventEmitter} server The event emitter
+ * @param {Object.<String, Function>} map The listeners to add
+ * @return {Function} A function that will remove the added listeners when
+ * called
+ * @private
+ */
+function addListeners(server, map) {
+ for (const event of Object.keys(map)) server.on(event, map[event]);
+
+ return function removeListeners() {
+ for (const event of Object.keys(map)) {
+ server.removeListener(event, map[event]);
+ }
+ };
+}
+
+/**
+ * Emit a `'close'` event on an `EventEmitter`.
+ *
+ * @param {EventEmitter} server The event emitter
+ * @private
+ */
+function emitClose(server) {
+ server._state = CLOSED;
+ server.emit('close');
+}
+
+/**
+ * Handle socket errors.
+ *
+ * @private
+ */
+function socketOnError() {
+ this.destroy();
+}
+
+/**
+ * Close the connection when preconditions are not fulfilled.
+ *
+ * @param {Duplex} socket The socket of the upgrade request
+ * @param {Number} code The HTTP response status code
+ * @param {String} [message] The HTTP response body
+ * @param {Object} [headers] Additional HTTP response headers
+ * @private
+ */
+function abortHandshake(socket, code, message, headers) {
+ //
+ // The socket is writable unless the user destroyed or ended it before calling
+ // `server.handleUpgrade()` or in the `verifyClient` function, which is a user
+ // error. Handling this does not make much sense as the worst that can happen
+ // is that some of the data written by the user might be discarded due to the
+ // call to `socket.end()` below, which triggers an `'error'` event that in
+ // turn causes the socket to be destroyed.
+ //
+ message = message || http.STATUS_CODES[code];
+ headers = {
+ Connection: 'close',
+ 'Content-Type': 'text/html',
+ 'Content-Length': Buffer.byteLength(message),
+ ...headers
+ };
+
+ socket.once('finish', socket.destroy);
+
+ socket.end(
+ `HTTP/1.1 ${code} ${http.STATUS_CODES[code]}\r\n` +
+ Object.keys(headers)
+ .map((h) => `${h}: ${headers[h]}`)
+ .join('\r\n') +
+ '\r\n\r\n' +
+ message
+ );
+}
+
+/**
+ * Emit a `'wsClientError'` event on a `WebSocketServer` if there is at least
+ * one listener for it, otherwise call `abortHandshake()`.
+ *
+ * @param {WebSocketServer} server The WebSocket server
+ * @param {http.IncomingMessage} req The request object
+ * @param {Duplex} socket The socket of the upgrade request
+ * @param {Number} code The HTTP response status code
+ * @param {String} message The HTTP response body
+ * @private
+ */
+function abortHandshakeOrEmitwsClientError(server, req, socket, code, message) {
+ if (server.listenerCount('wsClientError')) {
+ const err = new Error(message);
+ Error.captureStackTrace(err, abortHandshakeOrEmitwsClientError);
+
+ server.emit('wsClientError', err, socket, req);
+ } else {
+ abortHandshake(socket, code, message);
+ }
+}
diff --git a/node_modules/ws/lib/websocket.js b/node_modules/ws/lib/websocket.js
new file mode 100644
index 0000000..df5034c
--- /dev/null
+++ b/node_modules/ws/lib/websocket.js
@@ -0,0 +1,1336 @@
+/* eslint no-unused-vars: ["error", { "varsIgnorePattern": "^Duplex|Readable$" }] */
+
+'use strict';
+
+const EventEmitter = require('events');
+const https = require('https');
+const http = require('http');
+const net = require('net');
+const tls = require('tls');
+const { randomBytes, createHash } = require('crypto');
+const { Duplex, Readable } = require('stream');
+const { URL } = require('url');
+
+const PerMessageDeflate = require('./permessage-deflate');
+const Receiver = require('./receiver');
+const Sender = require('./sender');
+const {
+ BINARY_TYPES,
+ EMPTY_BUFFER,
+ GUID,
+ kForOnEventAttribute,
+ kListener,
+ kStatusCode,
+ kWebSocket,
+ NOOP
+} = require('./constants');
+const {
+ EventTarget: { addEventListener, removeEventListener }
+} = require('./event-target');
+const { format, parse } = require('./extension');
+const { toBuffer } = require('./buffer-util');
+
+const closeTimeout = 30 * 1000;
+const kAborted = Symbol('kAborted');
+const protocolVersions = [8, 13];
+const readyStates = ['CONNECTING', 'OPEN', 'CLOSING', 'CLOSED'];
+const subprotocolRegex = /^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/;
+
+/**
+ * Class representing a WebSocket.
+ *
+ * @extends EventEmitter
+ */
+class WebSocket extends EventEmitter {
+ /**
+ * Create a new `WebSocket`.
+ *
+ * @param {(String|URL)} address The URL to which to connect
+ * @param {(String|String[])} [protocols] The subprotocols
+ * @param {Object} [options] Connection options
+ */
+ constructor(address, protocols, options) {
+ super();
+
+ this._binaryType = BINARY_TYPES[0];
+ this._closeCode = 1006;
+ this._closeFrameReceived = false;
+ this._closeFrameSent = false;
+ this._closeMessage = EMPTY_BUFFER;
+ this._closeTimer = null;
+ this._extensions = {};
+ this._paused = false;
+ this._protocol = '';
+ this._readyState = WebSocket.CONNECTING;
+ this._receiver = null;
+ this._sender = null;
+ this._socket = null;
+
+ if (address !== null) {
+ this._bufferedAmount = 0;
+ this._isServer = false;
+ this._redirects = 0;
+
+ if (protocols === undefined) {
+ protocols = [];
+ } else if (!Array.isArray(protocols)) {
+ if (typeof protocols === 'object' && protocols !== null) {
+ options = protocols;
+ protocols = [];
+ } else {
+ protocols = [protocols];
+ }
+ }
+
+ initAsClient(this, address, protocols, options);
+ } else {
+ this._autoPong = options.autoPong;
+ this._isServer = true;
+ }
+ }
+
+ /**
+ * This deviates from the WHATWG interface since ws doesn't support the
+ * required default "blob" type (instead we define a custom "nodebuffer"
+ * type).
+ *
+ * @type {String}
+ */
+ get binaryType() {
+ return this._binaryType;
+ }
+
+ set binaryType(type) {
+ if (!BINARY_TYPES.includes(type)) return;
+
+ this._binaryType = type;
+
+ //
+ // Allow to change `binaryType` on the fly.
+ //
+ if (this._receiver) this._receiver._binaryType = type;
+ }
+
+ /**
+ * @type {Number}
+ */
+ get bufferedAmount() {
+ if (!this._socket) return this._bufferedAmount;
+
+ return this._socket._writableState.length + this._sender._bufferedBytes;
+ }
+
+ /**
+ * @type {String}
+ */
+ get extensions() {
+ return Object.keys(this._extensions).join();
+ }
+
+ /**
+ * @type {Boolean}
+ */
+ get isPaused() {
+ return this._paused;
+ }
+
+ /**
+ * @type {Function}
+ */
+ /* istanbul ignore next */
+ get onclose() {
+ return null;
+ }
+
+ /**
+ * @type {Function}
+ */
+ /* istanbul ignore next */
+ get onerror() {
+ return null;
+ }
+
+ /**
+ * @type {Function}
+ */
+ /* istanbul ignore next */
+ get onopen() {
+ return null;
+ }
+
+ /**
+ * @type {Function}
+ */
+ /* istanbul ignore next */
+ get onmessage() {
+ return null;
+ }
+
+ /**
+ * @type {String}
+ */
+ get protocol() {
+ return this._protocol;
+ }
+
+ /**
+ * @type {Number}
+ */
+ get readyState() {
+ return this._readyState;
+ }
+
+ /**
+ * @type {String}
+ */
+ get url() {
+ return this._url;
+ }
+
+ /**
+ * Set up the socket and the internal resources.
+ *
+ * @param {Duplex} socket The network socket between the server and client
+ * @param {Buffer} head The first packet of the upgraded stream
+ * @param {Object} options Options object
+ * @param {Boolean} [options.allowSynchronousEvents=false] Specifies whether
+ * any of the `'message'`, `'ping'`, and `'pong'` events can be emitted
+ * multiple times in the same tick
+ * @param {Function} [options.generateMask] The function used to generate the
+ * masking key
+ * @param {Number} [options.maxPayload=0] The maximum allowed message size
+ * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or
+ * not to skip UTF-8 validation for text and close messages
+ * @private
+ */
+ setSocket(socket, head, options) {
+ const receiver = new Receiver({
+ allowSynchronousEvents: options.allowSynchronousEvents,
+ binaryType: this.binaryType,
+ extensions: this._extensions,
+ isServer: this._isServer,
+ maxPayload: options.maxPayload,
+ skipUTF8Validation: options.skipUTF8Validation
+ });
+
+ this._sender = new Sender(socket, this._extensions, options.generateMask);
+ this._receiver = receiver;
+ this._socket = socket;
+
+ receiver[kWebSocket] = this;
+ socket[kWebSocket] = this;
+
+ receiver.on('conclude', receiverOnConclude);
+ receiver.on('drain', receiverOnDrain);
+ receiver.on('error', receiverOnError);
+ receiver.on('message', receiverOnMessage);
+ receiver.on('ping', receiverOnPing);
+ receiver.on('pong', receiverOnPong);
+
+ //
+ // These methods may not be available if `socket` is just a `Duplex`.
+ //
+ if (socket.setTimeout) socket.setTimeout(0);
+ if (socket.setNoDelay) socket.setNoDelay();
+
+ if (head.length > 0) socket.unshift(head);
+
+ socket.on('close', socketOnClose);
+ socket.on('data', socketOnData);
+ socket.on('end', socketOnEnd);
+ socket.on('error', socketOnError);
+
+ this._readyState = WebSocket.OPEN;
+ this.emit('open');
+ }
+
+ /**
+ * Emit the `'close'` event.
+ *
+ * @private
+ */
+ emitClose() {
+ if (!this._socket) {
+ this._readyState = WebSocket.CLOSED;
+ this.emit('close', this._closeCode, this._closeMessage);
+ return;
+ }
+
+ if (this._extensions[PerMessageDeflate.extensionName]) {
+ this._extensions[PerMessageDeflate.extensionName].cleanup();
+ }
+
+ this._receiver.removeAllListeners();
+ this._readyState = WebSocket.CLOSED;
+ this.emit('close', this._closeCode, this._closeMessage);
+ }
+
+ /**
+ * Start a closing handshake.
+ *
+ * +----------+ +-----------+ +----------+
+ * - - -|ws.close()|-->|close frame|-->|ws.close()|- - -
+ * | +----------+ +-----------+ +----------+ |
+ * +----------+ +-----------+ |
+ * CLOSING |ws.close()|<--|close frame|<--+-----+ CLOSING
+ * +----------+ +-----------+ |
+ * | | | +---+ |
+ * +------------------------+-->|fin| - - - -
+ * | +---+ | +---+
+ * - - - - -|fin|<---------------------+
+ * +---+
+ *
+ * @param {Number} [code] Status code explaining why the connection is closing
+ * @param {(String|Buffer)} [data] The reason why the connection is
+ * closing
+ * @public
+ */
+ close(code, data) {
+ if (this.readyState === WebSocket.CLOSED) return;
+ if (this.readyState === WebSocket.CONNECTING) {
+ const msg = 'WebSocket was closed before the connection was established';
+ abortHandshake(this, this._req, msg);
+ return;
+ }
+
+ if (this.readyState === WebSocket.CLOSING) {
+ if (
+ this._closeFrameSent &&
+ (this._closeFrameReceived || this._receiver._writableState.errorEmitted)
+ ) {
+ this._socket.end();
+ }
+
+ return;
+ }
+
+ this._readyState = WebSocket.CLOSING;
+ this._sender.close(code, data, !this._isServer, (err) => {
+ //
+ // This error is handled by the `'error'` listener on the socket. We only
+ // want to know if the close frame has been sent here.
+ //
+ if (err) return;
+
+ this._closeFrameSent = true;
+
+ if (
+ this._closeFrameReceived ||
+ this._receiver._writableState.errorEmitted
+ ) {
+ this._socket.end();
+ }
+ });
+
+ //
+ // Specify a timeout for the closing handshake to complete.
+ //
+ this._closeTimer = setTimeout(
+ this._socket.destroy.bind(this._socket),
+ closeTimeout
+ );
+ }
+
+ /**
+ * Pause the socket.
+ *
+ * @public
+ */
+ pause() {
+ if (
+ this.readyState === WebSocket.CONNECTING ||
+ this.readyState === WebSocket.CLOSED
+ ) {
+ return;
+ }
+
+ this._paused = true;
+ this._socket.pause();
+ }
+
+ /**
+ * Send a ping.
+ *
+ * @param {*} [data] The data to send
+ * @param {Boolean} [mask] Indicates whether or not to mask `data`
+ * @param {Function} [cb] Callback which is executed when the ping is sent
+ * @public
+ */
+ ping(data, mask, cb) {
+ if (this.readyState === WebSocket.CONNECTING) {
+ throw new Error('WebSocket is not open: readyState 0 (CONNECTING)');
+ }
+
+ if (typeof data === 'function') {
+ cb = data;
+ data = mask = undefined;
+ } else if (typeof mask === 'function') {
+ cb = mask;
+ mask = undefined;
+ }
+
+ if (typeof data === 'number') data = data.toString();
+
+ if (this.readyState !== WebSocket.OPEN) {
+ sendAfterClose(this, data, cb);
+ return;
+ }
+
+ if (mask === undefined) mask = !this._isServer;
+ this._sender.ping(data || EMPTY_BUFFER, mask, cb);
+ }
+
+ /**
+ * Send a pong.
+ *
+ * @param {*} [data] The data to send
+ * @param {Boolean} [mask] Indicates whether or not to mask `data`
+ * @param {Function} [cb] Callback which is executed when the pong is sent
+ * @public
+ */
+ pong(data, mask, cb) {
+ if (this.readyState === WebSocket.CONNECTING) {
+ throw new Error('WebSocket is not open: readyState 0 (CONNECTING)');
+ }
+
+ if (typeof data === 'function') {
+ cb = data;
+ data = mask = undefined;
+ } else if (typeof mask === 'function') {
+ cb = mask;
+ mask = undefined;
+ }
+
+ if (typeof data === 'number') data = data.toString();
+
+ if (this.readyState !== WebSocket.OPEN) {
+ sendAfterClose(this, data, cb);
+ return;
+ }
+
+ if (mask === undefined) mask = !this._isServer;
+ this._sender.pong(data || EMPTY_BUFFER, mask, cb);
+ }
+
+ /**
+ * Resume the socket.
+ *
+ * @public
+ */
+ resume() {
+ if (
+ this.readyState === WebSocket.CONNECTING ||
+ this.readyState === WebSocket.CLOSED
+ ) {
+ return;
+ }
+
+ this._paused = false;
+ if (!this._receiver._writableState.needDrain) this._socket.resume();
+ }
+
+ /**
+ * Send a data message.
+ *
+ * @param {*} data The message to send
+ * @param {Object} [options] Options object
+ * @param {Boolean} [options.binary] Specifies whether `data` is binary or
+ * text
+ * @param {Boolean} [options.compress] Specifies whether or not to compress
+ * `data`
+ * @param {Boolean} [options.fin=true] Specifies whether the fragment is the
+ * last one
+ * @param {Boolean} [options.mask] Specifies whether or not to mask `data`
+ * @param {Function} [cb] Callback which is executed when data is written out
+ * @public
+ */
+ send(data, options, cb) {
+ if (this.readyState === WebSocket.CONNECTING) {
+ throw new Error('WebSocket is not open: readyState 0 (CONNECTING)');
+ }
+
+ if (typeof options === 'function') {
+ cb = options;
+ options = {};
+ }
+
+ if (typeof data === 'number') data = data.toString();
+
+ if (this.readyState !== WebSocket.OPEN) {
+ sendAfterClose(this, data, cb);
+ return;
+ }
+
+ const opts = {
+ binary: typeof data !== 'string',
+ mask: !this._isServer,
+ compress: true,
+ fin: true,
+ ...options
+ };
+
+ if (!this._extensions[PerMessageDeflate.extensionName]) {
+ opts.compress = false;
+ }
+
+ this._sender.send(data || EMPTY_BUFFER, opts, cb);
+ }
+
+ /**
+ * Forcibly close the connection.
+ *
+ * @public
+ */
+ terminate() {
+ if (this.readyState === WebSocket.CLOSED) return;
+ if (this.readyState === WebSocket.CONNECTING) {
+ const msg = 'WebSocket was closed before the connection was established';
+ abortHandshake(this, this._req, msg);
+ return;
+ }
+
+ if (this._socket) {
+ this._readyState = WebSocket.CLOSING;
+ this._socket.destroy();
+ }
+ }
+}
+
+/**
+ * @constant {Number} CONNECTING
+ * @memberof WebSocket
+ */
+Object.defineProperty(WebSocket, 'CONNECTING', {
+ enumerable: true,
+ value: readyStates.indexOf('CONNECTING')
+});
+
+/**
+ * @constant {Number} CONNECTING
+ * @memberof WebSocket.prototype
+ */
+Object.defineProperty(WebSocket.prototype, 'CONNECTING', {
+ enumerable: true,
+ value: readyStates.indexOf('CONNECTING')
+});
+
+/**
+ * @constant {Number} OPEN
+ * @memberof WebSocket
+ */
+Object.defineProperty(WebSocket, 'OPEN', {
+ enumerable: true,
+ value: readyStates.indexOf('OPEN')
+});
+
+/**
+ * @constant {Number} OPEN
+ * @memberof WebSocket.prototype
+ */
+Object.defineProperty(WebSocket.prototype, 'OPEN', {
+ enumerable: true,
+ value: readyStates.indexOf('OPEN')
+});
+
+/**
+ * @constant {Number} CLOSING
+ * @memberof WebSocket
+ */
+Object.defineProperty(WebSocket, 'CLOSING', {
+ enumerable: true,
+ value: readyStates.indexOf('CLOSING')
+});
+
+/**
+ * @constant {Number} CLOSING
+ * @memberof WebSocket.prototype
+ */
+Object.defineProperty(WebSocket.prototype, 'CLOSING', {
+ enumerable: true,
+ value: readyStates.indexOf('CLOSING')
+});
+
+/**
+ * @constant {Number} CLOSED
+ * @memberof WebSocket
+ */
+Object.defineProperty(WebSocket, 'CLOSED', {
+ enumerable: true,
+ value: readyStates.indexOf('CLOSED')
+});
+
+/**
+ * @constant {Number} CLOSED
+ * @memberof WebSocket.prototype
+ */
+Object.defineProperty(WebSocket.prototype, 'CLOSED', {
+ enumerable: true,
+ value: readyStates.indexOf('CLOSED')
+});
+
+[
+ 'binaryType',
+ 'bufferedAmount',
+ 'extensions',
+ 'isPaused',
+ 'protocol',
+ 'readyState',
+ 'url'
+].forEach((property) => {
+ Object.defineProperty(WebSocket.prototype, property, { enumerable: true });
+});
+
+//
+// Add the `onopen`, `onerror`, `onclose`, and `onmessage` attributes.
+// See https://html.spec.whatwg.org/multipage/comms.html#the-websocket-interface
+//
+['open', 'error', 'close', 'message'].forEach((method) => {
+ Object.defineProperty(WebSocket.prototype, `on${method}`, {
+ enumerable: true,
+ get() {
+ for (const listener of this.listeners(method)) {
+ if (listener[kForOnEventAttribute]) return listener[kListener];
+ }
+
+ return null;
+ },
+ set(handler) {
+ for (const listener of this.listeners(method)) {
+ if (listener[kForOnEventAttribute]) {
+ this.removeListener(method, listener);
+ break;
+ }
+ }
+
+ if (typeof handler !== 'function') return;
+
+ this.addEventListener(method, handler, {
+ [kForOnEventAttribute]: true
+ });
+ }
+ });
+});
+
+WebSocket.prototype.addEventListener = addEventListener;
+WebSocket.prototype.removeEventListener = removeEventListener;
+
+module.exports = WebSocket;
+
+/**
+ * Initialize a WebSocket client.
+ *
+ * @param {WebSocket} websocket The client to initialize
+ * @param {(String|URL)} address The URL to which to connect
+ * @param {Array} protocols The subprotocols
+ * @param {Object} [options] Connection options
+ * @param {Boolean} [options.allowSynchronousEvents=false] Specifies whether any
+ * of the `'message'`, `'ping'`, and `'pong'` events can be emitted multiple
+ * times in the same tick
+ * @param {Boolean} [options.autoPong=true] Specifies whether or not to
+ * automatically send a pong in response to a ping
+ * @param {Function} [options.finishRequest] A function which can be used to
+ * customize the headers of each http request before it is sent
+ * @param {Boolean} [options.followRedirects=false] Whether or not to follow
+ * redirects
+ * @param {Function} [options.generateMask] The function used to generate the
+ * masking key
+ * @param {Number} [options.handshakeTimeout] Timeout in milliseconds for the
+ * handshake request
+ * @param {Number} [options.maxPayload=104857600] The maximum allowed message
+ * size
+ * @param {Number} [options.maxRedirects=10] The maximum number of redirects
+ * allowed
+ * @param {String} [options.origin] Value of the `Origin` or
+ * `Sec-WebSocket-Origin` header
+ * @param {(Boolean|Object)} [options.perMessageDeflate=true] Enable/disable
+ * permessage-deflate
+ * @param {Number} [options.protocolVersion=13] Value of the
+ * `Sec-WebSocket-Version` header
+ * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or
+ * not to skip UTF-8 validation for text and close messages
+ * @private
+ */
+function initAsClient(websocket, address, protocols, options) {
+ const opts = {
+ allowSynchronousEvents: false,
+ autoPong: true,
+ protocolVersion: protocolVersions[1],
+ maxPayload: 100 * 1024 * 1024,
+ skipUTF8Validation: false,
+ perMessageDeflate: true,
+ followRedirects: false,
+ maxRedirects: 10,
+ ...options,
+ createConnection: undefined,
+ socketPath: undefined,
+ hostname: undefined,
+ protocol: undefined,
+ timeout: undefined,
+ method: 'GET',
+ host: undefined,
+ path: undefined,
+ port: undefined
+ };
+
+ websocket._autoPong = opts.autoPong;
+
+ if (!protocolVersions.includes(opts.protocolVersion)) {
+ throw new RangeError(
+ `Unsupported protocol version: ${opts.protocolVersion} ` +
+ `(supported versions: ${protocolVersions.join(', ')})`
+ );
+ }
+
+ let parsedUrl;
+
+ if (address instanceof URL) {
+ parsedUrl = address;
+ } else {
+ try {
+ parsedUrl = new URL(address);
+ } catch (e) {
+ throw new SyntaxError(`Invalid URL: ${address}`);
+ }
+ }
+
+ if (parsedUrl.protocol === 'http:') {
+ parsedUrl.protocol = 'ws:';
+ } else if (parsedUrl.protocol === 'https:') {
+ parsedUrl.protocol = 'wss:';
+ }
+
+ websocket._url = parsedUrl.href;
+
+ const isSecure = parsedUrl.protocol === 'wss:';
+ const isIpcUrl = parsedUrl.protocol === 'ws+unix:';
+ let invalidUrlMessage;
+
+ if (parsedUrl.protocol !== 'ws:' && !isSecure && !isIpcUrl) {
+ invalidUrlMessage =
+ 'The URL\'s protocol must be one of "ws:", "wss:", ' +
+ '"http:", "https", or "ws+unix:"';
+ } else if (isIpcUrl && !parsedUrl.pathname) {
+ invalidUrlMessage = "The URL's pathname is empty";
+ } else if (parsedUrl.hash) {
+ invalidUrlMessage = 'The URL contains a fragment identifier';
+ }
+
+ if (invalidUrlMessage) {
+ const err = new SyntaxError(invalidUrlMessage);
+
+ if (websocket._redirects === 0) {
+ throw err;
+ } else {
+ emitErrorAndClose(websocket, err);
+ return;
+ }
+ }
+
+ const defaultPort = isSecure ? 443 : 80;
+ const key = randomBytes(16).toString('base64');
+ const request = isSecure ? https.request : http.request;
+ const protocolSet = new Set();
+ let perMessageDeflate;
+
+ opts.createConnection = isSecure ? tlsConnect : netConnect;
+ opts.defaultPort = opts.defaultPort || defaultPort;
+ opts.port = parsedUrl.port || defaultPort;
+ opts.host = parsedUrl.hostname.startsWith('[')
+ ? parsedUrl.hostname.slice(1, -1)
+ : parsedUrl.hostname;
+ opts.headers = {
+ ...opts.headers,
+ 'Sec-WebSocket-Version': opts.protocolVersion,
+ 'Sec-WebSocket-Key': key,
+ Connection: 'Upgrade',
+ Upgrade: 'websocket'
+ };
+ opts.path = parsedUrl.pathname + parsedUrl.search;
+ opts.timeout = opts.handshakeTimeout;
+
+ if (opts.perMessageDeflate) {
+ perMessageDeflate = new PerMessageDeflate(
+ opts.perMessageDeflate !== true ? opts.perMessageDeflate : {},
+ false,
+ opts.maxPayload
+ );
+ opts.headers['Sec-WebSocket-Extensions'] = format({
+ [PerMessageDeflate.extensionName]: perMessageDeflate.offer()
+ });
+ }
+ if (protocols.length) {
+ for (const protocol of protocols) {
+ if (
+ typeof protocol !== 'string' ||
+ !subprotocolRegex.test(protocol) ||
+ protocolSet.has(protocol)
+ ) {
+ throw new SyntaxError(
+ 'An invalid or duplicated subprotocol was specified'
+ );
+ }
+
+ protocolSet.add(protocol);
+ }
+
+ opts.headers['Sec-WebSocket-Protocol'] = protocols.join(',');
+ }
+ if (opts.origin) {
+ if (opts.protocolVersion < 13) {
+ opts.headers['Sec-WebSocket-Origin'] = opts.origin;
+ } else {
+ opts.headers.Origin = opts.origin;
+ }
+ }
+ if (parsedUrl.username || parsedUrl.password) {
+ opts.auth = `${parsedUrl.username}:${parsedUrl.password}`;
+ }
+
+ if (isIpcUrl) {
+ const parts = opts.path.split(':');
+
+ opts.socketPath = parts[0];
+ opts.path = parts[1];
+ }
+
+ let req;
+
+ if (opts.followRedirects) {
+ if (websocket._redirects === 0) {
+ websocket._originalIpc = isIpcUrl;
+ websocket._originalSecure = isSecure;
+ websocket._originalHostOrSocketPath = isIpcUrl
+ ? opts.socketPath
+ : parsedUrl.host;
+
+ const headers = options && options.headers;
+
+ //
+ // Shallow copy the user provided options so that headers can be changed
+ // without mutating the original object.
+ //
+ options = { ...options, headers: {} };
+
+ if (headers) {
+ for (const [key, value] of Object.entries(headers)) {
+ options.headers[key.toLowerCase()] = value;
+ }
+ }
+ } else if (websocket.listenerCount('redirect') === 0) {
+ const isSameHost = isIpcUrl
+ ? websocket._originalIpc
+ ? opts.socketPath === websocket._originalHostOrSocketPath
+ : false
+ : websocket._originalIpc
+ ? false
+ : parsedUrl.host === websocket._originalHostOrSocketPath;
+
+ if (!isSameHost || (websocket._originalSecure && !isSecure)) {
+ //
+ // Match curl 7.77.0 behavior and drop the following headers. These
+ // headers are also dropped when following a redirect to a subdomain.
+ //
+ delete opts.headers.authorization;
+ delete opts.headers.cookie;
+
+ if (!isSameHost) delete opts.headers.host;
+
+ opts.auth = undefined;
+ }
+ }
+
+ //
+ // Match curl 7.77.0 behavior and make the first `Authorization` header win.
+ // If the `Authorization` header is set, then there is nothing to do as it
+ // will take precedence.
+ //
+ if (opts.auth && !options.headers.authorization) {
+ options.headers.authorization =
+ 'Basic ' + Buffer.from(opts.auth).toString('base64');
+ }
+
+ req = websocket._req = request(opts);
+
+ if (websocket._redirects) {
+ //
+ // Unlike what is done for the `'upgrade'` event, no early exit is
+ // triggered here if the user calls `websocket.close()` or
+ // `websocket.terminate()` from a listener of the `'redirect'` event. This
+ // is because the user can also call `request.destroy()` with an error
+ // before calling `websocket.close()` or `websocket.terminate()` and this
+ // would result in an error being emitted on the `request` object with no
+ // `'error'` event listeners attached.
+ //
+ websocket.emit('redirect', websocket.url, req);
+ }
+ } else {
+ req = websocket._req = request(opts);
+ }
+
+ if (opts.timeout) {
+ req.on('timeout', () => {
+ abortHandshake(websocket, req, 'Opening handshake has timed out');
+ });
+ }
+
+ req.on('error', (err) => {
+ if (req === null || req[kAborted]) return;
+
+ req = websocket._req = null;
+ emitErrorAndClose(websocket, err);
+ });
+
+ req.on('response', (res) => {
+ const location = res.headers.location;
+ const statusCode = res.statusCode;
+
+ if (
+ location &&
+ opts.followRedirects &&
+ statusCode >= 300 &&
+ statusCode < 400
+ ) {
+ if (++websocket._redirects > opts.maxRedirects) {
+ abortHandshake(websocket, req, 'Maximum redirects exceeded');
+ return;
+ }
+
+ req.abort();
+
+ let addr;
+
+ try {
+ addr = new URL(location, address);
+ } catch (e) {
+ const err = new SyntaxError(`Invalid URL: ${location}`);
+ emitErrorAndClose(websocket, err);
+ return;
+ }
+
+ initAsClient(websocket, addr, protocols, options);
+ } else if (!websocket.emit('unexpected-response', req, res)) {
+ abortHandshake(
+ websocket,
+ req,
+ `Unexpected server response: ${res.statusCode}`
+ );
+ }
+ });
+
+ req.on('upgrade', (res, socket, head) => {
+ websocket.emit('upgrade', res);
+
+ //
+ // The user may have closed the connection from a listener of the
+ // `'upgrade'` event.
+ //
+ if (websocket.readyState !== WebSocket.CONNECTING) return;
+
+ req = websocket._req = null;
+
+ if (res.headers.upgrade.toLowerCase() !== 'websocket') {
+ abortHandshake(websocket, socket, 'Invalid Upgrade header');
+ return;
+ }
+
+ const digest = createHash('sha1')
+ .update(key + GUID)
+ .digest('base64');
+
+ if (res.headers['sec-websocket-accept'] !== digest) {
+ abortHandshake(websocket, socket, 'Invalid Sec-WebSocket-Accept header');
+ return;
+ }
+
+ const serverProt = res.headers['sec-websocket-protocol'];
+ let protError;
+
+ if (serverProt !== undefined) {
+ if (!protocolSet.size) {
+ protError = 'Server sent a subprotocol but none was requested';
+ } else if (!protocolSet.has(serverProt)) {
+ protError = 'Server sent an invalid subprotocol';
+ }
+ } else if (protocolSet.size) {
+ protError = 'Server sent no subprotocol';
+ }
+
+ if (protError) {
+ abortHandshake(websocket, socket, protError);
+ return;
+ }
+
+ if (serverProt) websocket._protocol = serverProt;
+
+ const secWebSocketExtensions = res.headers['sec-websocket-extensions'];
+
+ if (secWebSocketExtensions !== undefined) {
+ if (!perMessageDeflate) {
+ const message =
+ 'Server sent a Sec-WebSocket-Extensions header but no extension ' +
+ 'was requested';
+ abortHandshake(websocket, socket, message);
+ return;
+ }
+
+ let extensions;
+
+ try {
+ extensions = parse(secWebSocketExtensions);
+ } catch (err) {
+ const message = 'Invalid Sec-WebSocket-Extensions header';
+ abortHandshake(websocket, socket, message);
+ return;
+ }
+
+ const extensionNames = Object.keys(extensions);
+
+ if (
+ extensionNames.length !== 1 ||
+ extensionNames[0] !== PerMessageDeflate.extensionName
+ ) {
+ const message = 'Server indicated an extension that was not requested';
+ abortHandshake(websocket, socket, message);
+ return;
+ }
+
+ try {
+ perMessageDeflate.accept(extensions[PerMessageDeflate.extensionName]);
+ } catch (err) {
+ const message = 'Invalid Sec-WebSocket-Extensions header';
+ abortHandshake(websocket, socket, message);
+ return;
+ }
+
+ websocket._extensions[PerMessageDeflate.extensionName] =
+ perMessageDeflate;
+ }
+
+ websocket.setSocket(socket, head, {
+ allowSynchronousEvents: opts.allowSynchronousEvents,
+ generateMask: opts.generateMask,
+ maxPayload: opts.maxPayload,
+ skipUTF8Validation: opts.skipUTF8Validation
+ });
+ });
+
+ if (opts.finishRequest) {
+ opts.finishRequest(req, websocket);
+ } else {
+ req.end();
+ }
+}
+
+/**
+ * Emit the `'error'` and `'close'` events.
+ *
+ * @param {WebSocket} websocket The WebSocket instance
+ * @param {Error} The error to emit
+ * @private
+ */
+function emitErrorAndClose(websocket, err) {
+ websocket._readyState = WebSocket.CLOSING;
+ websocket.emit('error', err);
+ websocket.emitClose();
+}
+
+/**
+ * Create a `net.Socket` and initiate a connection.
+ *
+ * @param {Object} options Connection options
+ * @return {net.Socket} The newly created socket used to start the connection
+ * @private
+ */
+function netConnect(options) {
+ options.path = options.socketPath;
+ return net.connect(options);
+}
+
+/**
+ * Create a `tls.TLSSocket` and initiate a connection.
+ *
+ * @param {Object} options Connection options
+ * @return {tls.TLSSocket} The newly created socket used to start the connection
+ * @private
+ */
+function tlsConnect(options) {
+ options.path = undefined;
+
+ if (!options.servername && options.servername !== '') {
+ options.servername = net.isIP(options.host) ? '' : options.host;
+ }
+
+ return tls.connect(options);
+}
+
+/**
+ * Abort the handshake and emit an error.
+ *
+ * @param {WebSocket} websocket The WebSocket instance
+ * @param {(http.ClientRequest|net.Socket|tls.Socket)} stream The request to
+ * abort or the socket to destroy
+ * @param {String} message The error message
+ * @private
+ */
+function abortHandshake(websocket, stream, message) {
+ websocket._readyState = WebSocket.CLOSING;
+
+ const err = new Error(message);
+ Error.captureStackTrace(err, abortHandshake);
+
+ if (stream.setHeader) {
+ stream[kAborted] = true;
+ stream.abort();
+
+ if (stream.socket && !stream.socket.destroyed) {
+ //
+ // On Node.js >= 14.3.0 `request.abort()` does not destroy the socket if
+ // called after the request completed. See
+ // https://github.com/websockets/ws/issues/1869.
+ //
+ stream.socket.destroy();
+ }
+
+ process.nextTick(emitErrorAndClose, websocket, err);
+ } else {
+ stream.destroy(err);
+ stream.once('error', websocket.emit.bind(websocket, 'error'));
+ stream.once('close', websocket.emitClose.bind(websocket));
+ }
+}
+
+/**
+ * Handle cases where the `ping()`, `pong()`, or `send()` methods are called
+ * when the `readyState` attribute is `CLOSING` or `CLOSED`.
+ *
+ * @param {WebSocket} websocket The WebSocket instance
+ * @param {*} [data] The data to send
+ * @param {Function} [cb] Callback
+ * @private
+ */
+function sendAfterClose(websocket, data, cb) {
+ if (data) {
+ const length = toBuffer(data).length;
+
+ //
+ // The `_bufferedAmount` property is used only when the peer is a client and
+ // the opening handshake fails. Under these circumstances, in fact, the
+ // `setSocket()` method is not called, so the `_socket` and `_sender`
+ // properties are set to `null`.
+ //
+ if (websocket._socket) websocket._sender._bufferedBytes += length;
+ else websocket._bufferedAmount += length;
+ }
+
+ if (cb) {
+ const err = new Error(
+ `WebSocket is not open: readyState ${websocket.readyState} ` +
+ `(${readyStates[websocket.readyState]})`
+ );
+ process.nextTick(cb, err);
+ }
+}
+
+/**
+ * The listener of the `Receiver` `'conclude'` event.
+ *
+ * @param {Number} code The status code
+ * @param {Buffer} reason The reason for closing
+ * @private
+ */
+function receiverOnConclude(code, reason) {
+ const websocket = this[kWebSocket];
+
+ websocket._closeFrameReceived = true;
+ websocket._closeMessage = reason;
+ websocket._closeCode = code;
+
+ if (websocket._socket[kWebSocket] === undefined) return;
+
+ websocket._socket.removeListener('data', socketOnData);
+ process.nextTick(resume, websocket._socket);
+
+ if (code === 1005) websocket.close();
+ else websocket.close(code, reason);
+}
+
+/**
+ * The listener of the `Receiver` `'drain'` event.
+ *
+ * @private
+ */
+function receiverOnDrain() {
+ const websocket = this[kWebSocket];
+
+ if (!websocket.isPaused) websocket._socket.resume();
+}
+
+/**
+ * The listener of the `Receiver` `'error'` event.
+ *
+ * @param {(RangeError|Error)} err The emitted error
+ * @private
+ */
+function receiverOnError(err) {
+ const websocket = this[kWebSocket];
+
+ if (websocket._socket[kWebSocket] !== undefined) {
+ websocket._socket.removeListener('data', socketOnData);
+
+ //
+ // On Node.js < 14.0.0 the `'error'` event is emitted synchronously. See
+ // https://github.com/websockets/ws/issues/1940.
+ //
+ process.nextTick(resume, websocket._socket);
+
+ websocket.close(err[kStatusCode]);
+ }
+
+ websocket.emit('error', err);
+}
+
+/**
+ * The listener of the `Receiver` `'finish'` event.
+ *
+ * @private
+ */
+function receiverOnFinish() {
+ this[kWebSocket].emitClose();
+}
+
+/**
+ * The listener of the `Receiver` `'message'` event.
+ *
+ * @param {Buffer|ArrayBuffer|Buffer[])} data The message
+ * @param {Boolean} isBinary Specifies whether the message is binary or not
+ * @private
+ */
+function receiverOnMessage(data, isBinary) {
+ this[kWebSocket].emit('message', data, isBinary);
+}
+
+/**
+ * The listener of the `Receiver` `'ping'` event.
+ *
+ * @param {Buffer} data The data included in the ping frame
+ * @private
+ */
+function receiverOnPing(data) {
+ const websocket = this[kWebSocket];
+
+ if (websocket._autoPong) websocket.pong(data, !this._isServer, NOOP);
+ websocket.emit('ping', data);
+}
+
+/**
+ * The listener of the `Receiver` `'pong'` event.
+ *
+ * @param {Buffer} data The data included in the pong frame
+ * @private
+ */
+function receiverOnPong(data) {
+ this[kWebSocket].emit('pong', data);
+}
+
+/**
+ * Resume a readable stream
+ *
+ * @param {Readable} stream The readable stream
+ * @private
+ */
+function resume(stream) {
+ stream.resume();
+}
+
+/**
+ * The listener of the socket `'close'` event.
+ *
+ * @private
+ */
+function socketOnClose() {
+ const websocket = this[kWebSocket];
+
+ this.removeListener('close', socketOnClose);
+ this.removeListener('data', socketOnData);
+ this.removeListener('end', socketOnEnd);
+
+ websocket._readyState = WebSocket.CLOSING;
+
+ let chunk;
+
+ //
+ // The close frame might not have been received or the `'end'` event emitted,
+ // for example, if the socket was destroyed due to an error. Ensure that the
+ // `receiver` stream is closed after writing any remaining buffered data to
+ // it. If the readable side of the socket is in flowing mode then there is no
+ // buffered data as everything has been already written and `readable.read()`
+ // will return `null`. If instead, the socket is paused, any possible buffered
+ // data will be read as a single chunk.
+ //
+ if (
+ !this._readableState.endEmitted &&
+ !websocket._closeFrameReceived &&
+ !websocket._receiver._writableState.errorEmitted &&
+ (chunk = websocket._socket.read()) !== null
+ ) {
+ websocket._receiver.write(chunk);
+ }
+
+ websocket._receiver.end();
+
+ this[kWebSocket] = undefined;
+
+ clearTimeout(websocket._closeTimer);
+
+ if (
+ websocket._receiver._writableState.finished ||
+ websocket._receiver._writableState.errorEmitted
+ ) {
+ websocket.emitClose();
+ } else {
+ websocket._receiver.on('error', receiverOnFinish);
+ websocket._receiver.on('finish', receiverOnFinish);
+ }
+}
+
+/**
+ * The listener of the socket `'data'` event.
+ *
+ * @param {Buffer} chunk A chunk of data
+ * @private
+ */
+function socketOnData(chunk) {
+ if (!this[kWebSocket]._receiver.write(chunk)) {
+ this.pause();
+ }
+}
+
+/**
+ * The listener of the socket `'end'` event.
+ *
+ * @private
+ */
+function socketOnEnd() {
+ const websocket = this[kWebSocket];
+
+ websocket._readyState = WebSocket.CLOSING;
+ websocket._receiver.end();
+ this.end();
+}
+
+/**
+ * The listener of the socket `'error'` event.
+ *
+ * @private
+ */
+function socketOnError() {
+ const websocket = this[kWebSocket];
+
+ this.removeListener('error', socketOnError);
+ this.on('error', NOOP);
+
+ if (websocket) {
+ websocket._readyState = WebSocket.CLOSING;
+ this.destroy();
+ }
+}
diff --git a/node_modules/ws/package.json b/node_modules/ws/package.json
new file mode 100644
index 0000000..a244320
--- /dev/null
+++ b/node_modules/ws/package.json
@@ -0,0 +1,68 @@
+{
+ "name": "ws",
+ "version": "8.16.0",
+ "description": "Simple to use, blazing fast and thoroughly tested websocket client and server for Node.js",
+ "keywords": [
+ "HyBi",
+ "Push",
+ "RFC-6455",
+ "WebSocket",
+ "WebSockets",
+ "real-time"
+ ],
+ "homepage": "https://github.com/websockets/ws",
+ "bugs": "https://github.com/websockets/ws/issues",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/websockets/ws.git"
+ },
+ "author": "Einar Otto Stangvik <einaros@gmail.com> (http://2x.io)",
+ "license": "MIT",
+ "main": "index.js",
+ "exports": {
+ ".": {
+ "browser": "./browser.js",
+ "import": "./wrapper.mjs",
+ "require": "./index.js"
+ },
+ "./package.json": "./package.json"
+ },
+ "browser": "browser.js",
+ "engines": {
+ "node": ">=10.0.0"
+ },
+ "files": [
+ "browser.js",
+ "index.js",
+ "lib/*.js",
+ "wrapper.mjs"
+ ],
+ "scripts": {
+ "test": "nyc --reporter=lcov --reporter=text mocha --throw-deprecation test/*.test.js",
+ "integration": "mocha --throw-deprecation test/*.integration.js",
+ "lint": "eslint --ignore-path .gitignore . && prettier --check --ignore-path .gitignore \"**/*.{json,md,yaml,yml}\""
+ },
+ "peerDependencies": {
+ "bufferutil": "^4.0.1",
+ "utf-8-validate": ">=5.0.2"
+ },
+ "peerDependenciesMeta": {
+ "bufferutil": {
+ "optional": true
+ },
+ "utf-8-validate": {
+ "optional": true
+ }
+ },
+ "devDependencies": {
+ "benchmark": "^2.1.4",
+ "bufferutil": "^4.0.1",
+ "eslint": "^8.0.0",
+ "eslint-config-prettier": "^9.0.0",
+ "eslint-plugin-prettier": "^5.0.0",
+ "mocha": "^8.4.0",
+ "nyc": "^15.0.0",
+ "prettier": "^3.0.0",
+ "utf-8-validate": "^6.0.0"
+ }
+}
diff --git a/node_modules/ws/wrapper.mjs b/node_modules/ws/wrapper.mjs
new file mode 100644
index 0000000..7245ad1
--- /dev/null
+++ b/node_modules/ws/wrapper.mjs
@@ -0,0 +1,8 @@
+import createWebSocketStream from './lib/stream.js';
+import Receiver from './lib/receiver.js';
+import Sender from './lib/sender.js';
+import WebSocket from './lib/websocket.js';
+import WebSocketServer from './lib/websocket-server.js';
+
+export { createWebSocketStream, Receiver, Sender, WebSocket, WebSocketServer };
+export default WebSocket;
diff --git a/package-lock.json b/package-lock.json
index 85650d7..cabba72 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,11 +1,13 @@
{
- "name": "localchat",
+ "name": "chatroom",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"dependencies": {
- "pkg": "^5.8.1"
+ "axios": "^1.6.7",
+ "pkg": "^5.8.1",
+ "ws": "^8.16.0"
}
},
"node_modules/@babel/generator": {
@@ -182,6 +184,11 @@
"node": ">=8"
}
},
+ "node_modules/asynckit": {
+ "version": "0.4.0",
+ "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
+ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="
+ },
"node_modules/at-least-node": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz",
@@ -190,6 +197,16 @@
"node": ">= 4.0.0"
}
},
+ "node_modules/axios": {
+ "version": "1.6.7",
+ "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.7.tgz",
+ "integrity": "sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA==",
+ "dependencies": {
+ "follow-redirects": "^1.15.4",
+ "form-data": "^4.0.0",
+ "proxy-from-env": "^1.1.0"
+ }
+ },
"node_modules/base64-js": {
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
@@ -312,6 +329,17 @@
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
},
+ "node_modules/combined-stream": {
+ "version": "1.0.8",
+ "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
+ "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
+ "dependencies": {
+ "delayed-stream": "~1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
"node_modules/core-util-is": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
@@ -355,6 +383,14 @@
"node": ">=4.0.0"
}
},
+ "node_modules/delayed-stream": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
+ "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==",
+ "engines": {
+ "node": ">=0.4.0"
+ }
+ },
"node_modules/detect-libc": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.1.tgz",
@@ -437,6 +473,38 @@
"node": ">=8"
}
},
+ "node_modules/follow-redirects": {
+ "version": "1.15.5",
+ "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.5.tgz",
+ "integrity": "sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==",
+ "funding": [
+ {
+ "type": "individual",
+ "url": "https://github.com/sponsors/RubenVerborgh"
+ }
+ ],
+ "engines": {
+ "node": ">=4.0"
+ },
+ "peerDependenciesMeta": {
+ "debug": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/form-data": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz",
+ "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==",
+ "dependencies": {
+ "asynckit": "^0.4.0",
+ "combined-stream": "^1.0.8",
+ "mime-types": "^2.1.12"
+ },
+ "engines": {
+ "node": ">= 6"
+ }
+ },
"node_modules/from2": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz",
@@ -705,6 +773,25 @@
"node": ">=8.6"
}
},
+ "node_modules/mime-db": {
+ "version": "1.52.0",
+ "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
+ "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/mime-types": {
+ "version": "2.1.35",
+ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
+ "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
+ "dependencies": {
+ "mime-db": "1.52.0"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
"node_modules/mimic-response": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz",
@@ -933,6 +1020,11 @@
"node": ">=0.4.0"
}
},
+ "node_modules/proxy-from-env": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
+ "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="
+ },
"node_modules/pump": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz",
@@ -1317,6 +1409,26 @@
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="
},
+ "node_modules/ws": {
+ "version": "8.16.0",
+ "resolved": "https://registry.npmjs.org/ws/-/ws-8.16.0.tgz",
+ "integrity": "sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ==",
+ "engines": {
+ "node": ">=10.0.0"
+ },
+ "peerDependencies": {
+ "bufferutil": "^4.0.1",
+ "utf-8-validate": ">=5.0.2"
+ },
+ "peerDependenciesMeta": {
+ "bufferutil": {
+ "optional": true
+ },
+ "utf-8-validate": {
+ "optional": true
+ }
+ }
+ },
"node_modules/y18n": {
"version": "5.0.8",
"resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",
@@ -1482,11 +1594,26 @@
"resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz",
"integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw=="
},
+ "asynckit": {
+ "version": "0.4.0",
+ "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
+ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="
+ },
"at-least-node": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz",
"integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg=="
},
+ "axios": {
+ "version": "1.6.7",
+ "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.7.tgz",
+ "integrity": "sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA==",
+ "requires": {
+ "follow-redirects": "^1.15.4",
+ "form-data": "^4.0.0",
+ "proxy-from-env": "^1.1.0"
+ }
+ },
"base64-js": {
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
@@ -1568,6 +1695,14 @@
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
},
+ "combined-stream": {
+ "version": "1.0.8",
+ "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
+ "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
+ "requires": {
+ "delayed-stream": "~1.0.0"
+ }
+ },
"core-util-is": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
@@ -1594,6 +1729,11 @@
"resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz",
"integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA=="
},
+ "delayed-stream": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
+ "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ=="
+ },
"detect-libc": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.1.tgz",
@@ -1658,6 +1798,21 @@
"to-regex-range": "^5.0.1"
}
},
+ "follow-redirects": {
+ "version": "1.15.5",
+ "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.5.tgz",
+ "integrity": "sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw=="
+ },
+ "form-data": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz",
+ "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==",
+ "requires": {
+ "asynckit": "^0.4.0",
+ "combined-stream": "^1.0.8",
+ "mime-types": "^2.1.12"
+ }
+ },
"from2": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz",
@@ -1847,6 +2002,19 @@
"picomatch": "^2.3.1"
}
},
+ "mime-db": {
+ "version": "1.52.0",
+ "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
+ "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg=="
+ },
+ "mime-types": {
+ "version": "2.1.35",
+ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
+ "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
+ "requires": {
+ "mime-db": "1.52.0"
+ }
+ },
"mimic-response": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz",
@@ -2002,6 +2170,11 @@
"resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz",
"integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA=="
},
+ "proxy-from-env": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
+ "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="
+ },
"pump": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz",
@@ -2264,6 +2437,12 @@
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="
},
+ "ws": {
+ "version": "8.16.0",
+ "resolved": "https://registry.npmjs.org/ws/-/ws-8.16.0.tgz",
+ "integrity": "sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ==",
+ "requires": {}
+ },
"y18n": {
"version": "5.0.8",
"resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",
diff --git a/package.json b/package.json
index 543e180..4668c3e 100644
--- a/package.json
+++ b/package.json
@@ -1,5 +1,7 @@
{
"dependencies": {
- "pkg": "^5.8.1"
+ "axios": "^1.6.7",
+ "pkg": "^5.8.1",
+ "ws": "^8.16.0"
}
}
diff --git a/vpn/index.js b/vpn/index.js
new file mode 100644
index 0000000..1511130
--- /dev/null
+++ b/vpn/index.js
@@ -0,0 +1,66 @@
+const { WebSocketServer } = require('ws');
+const axios = require('axios');
+
+const wss = new WebSocketServer({ host: "0.0.0.0", port: 18080 });
+global.keys = require('./keys.json');
+
+wss.on('connection', (ws) => {
+ ws.on('error', console.error);
+
+ ws.on('message', (_data) => {
+ try {
+ let data = JSON.parse(_data);
+
+ if (data['key']) {
+ global.keys = JSON.parse(require('fs').readFileSync("./keys.json").toString());
+ ws.key = data['key'];
+ } else {
+ console.log(data);
+
+ try {
+ if (!global.keys.includes(ws.key)) throw new Error("User did not authenticate");
+
+ let options = {
+ url: data['url'],
+ headers: data['headers'],
+ method: data['method'],
+ timeout: 30000,
+ data: ["POST", "PUT"].includes(data['method'].toUpperCase()) && data.uploadData[0] && data.uploadData[0].bytes ? Buffer.from(data.uploadData[0].bytes, "base64") : null,
+ validateStatus: () => true,
+ responseType: 'arraybuffer'
+ };
+
+ if (["POST", "PUT"].includes(data['method'].toUpperCase())) console.log(options);
+
+ axios(options).then((res) => {
+ ws.send(JSON.stringify({
+ _id: data['_id'],
+ statusCode: res.status,
+ mimeType: res.headers['content-type'] ?? 'application/octet-stream',
+ headers: res.headers,
+ data: Buffer.from(res.data).toString("base64"),
+ referrer: data['referrer'],
+ method: data['method']
+ }));
+ }).catch((e) => {
+ console.error(e);
+
+ ws.send(JSON.stringify({
+ _id: data._id ?? null,
+ error: e.errno
+ }));
+ });
+ } catch (e) {
+ console.error(e);
+
+ ws.send(JSON.stringify({
+ _id: data._id ?? null,
+ error: 0
+ }));
+ }
+ }
+ } catch (e) {
+ console.error(e);
+ }
+ });
+}); \ No newline at end of file