cdk-ecr-deployment 3.3.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.jsii +26 -107
- package/.jsii.tabl.json +1 -1
- package/API.md +0 -59
- package/README.md +7 -17
- package/lib/index.d.ts +1 -29
- package/lib/index.js +8 -26
- package/package.json +1 -13
- package/build-lambda.sh +0 -12
- package/lambda-src/.dockerignore +0 -9
- package/lambda-src/Dockerfile +0 -26
- package/lambda-src/Makefile +0 -33
- package/lambda-src/go.mod +0 -136
- package/lambda-src/go.sum +0 -499
- package/lambda-src/internal/iolimits/iolimits.go +0 -68
- package/lambda-src/internal/iolimits/iolimits_test.go +0 -39
- package/lambda-src/internal/tarfile/reader.go +0 -179
- package/lambda-src/internal/tarfile/reader_test.go +0 -31
- package/lambda-src/internal/tarfile/s3file.go +0 -363
- package/lambda-src/internal/tarfile/s3file_test.go +0 -135
- package/lambda-src/internal/tarfile/src.go +0 -328
- package/lambda-src/internal/tarfile/types.go +0 -31
- package/lambda-src/main.go +0 -176
- package/lambda-src/main_test.go +0 -64
- package/lambda-src/s3/src.go +0 -40
- package/lambda-src/s3/transport.go +0 -149
- package/lambda-src/s3/transport_test.go +0 -96
- package/lambda-src/utils.go +0 -206
- package/lambda-src/utils_test.go +0 -63
- package/lib/config.d.ts +0 -1
- package/lib/config.js +0 -12
- package/node_modules/@sindresorhus/is/dist/index.d.ts +0 -232
- package/node_modules/@sindresorhus/is/dist/index.js +0 -434
- package/node_modules/@sindresorhus/is/dist/types.d.ts +0 -25
- package/node_modules/@sindresorhus/is/dist/types.js +0 -3
- package/node_modules/@sindresorhus/is/license +0 -9
- package/node_modules/@sindresorhus/is/package.json +0 -96
- package/node_modules/@sindresorhus/is/readme.md +0 -669
- package/node_modules/@szmarczak/http-timer/LICENSE +0 -21
- package/node_modules/@szmarczak/http-timer/README.md +0 -93
- package/node_modules/@szmarczak/http-timer/dist/source/index.d.ts +0 -32
- package/node_modules/@szmarczak/http-timer/dist/source/index.js +0 -126
- package/node_modules/@szmarczak/http-timer/package.json +0 -72
- package/node_modules/@types/cacheable-request/LICENSE +0 -21
- package/node_modules/@types/cacheable-request/README.md +0 -16
- package/node_modules/@types/cacheable-request/index.d.ts +0 -137
- package/node_modules/@types/cacheable-request/node_modules/@types/node/LICENSE +0 -21
- package/node_modules/@types/cacheable-request/node_modules/@types/node/README.md +0 -15
- package/node_modules/@types/cacheable-request/node_modules/@types/node/assert/strict.d.ts +0 -8
- package/node_modules/@types/cacheable-request/node_modules/@types/node/assert.d.ts +0 -1095
- package/node_modules/@types/cacheable-request/node_modules/@types/node/async_hooks.d.ts +0 -541
- package/node_modules/@types/cacheable-request/node_modules/@types/node/buffer.buffer.d.ts +0 -460
- package/node_modules/@types/cacheable-request/node_modules/@types/node/buffer.d.ts +0 -1926
- package/node_modules/@types/cacheable-request/node_modules/@types/node/child_process.d.ts +0 -1549
- package/node_modules/@types/cacheable-request/node_modules/@types/node/cluster.d.ts +0 -579
- package/node_modules/@types/cacheable-request/node_modules/@types/node/compatibility/disposable.d.ts +0 -16
- package/node_modules/@types/cacheable-request/node_modules/@types/node/compatibility/index.d.ts +0 -9
- package/node_modules/@types/cacheable-request/node_modules/@types/node/compatibility/indexable.d.ts +0 -23
- package/node_modules/@types/cacheable-request/node_modules/@types/node/compatibility/iterators.d.ts +0 -21
- package/node_modules/@types/cacheable-request/node_modules/@types/node/console.d.ts +0 -452
- package/node_modules/@types/cacheable-request/node_modules/@types/node/constants.d.ts +0 -21
- package/node_modules/@types/cacheable-request/node_modules/@types/node/crypto.d.ts +0 -4510
- package/node_modules/@types/cacheable-request/node_modules/@types/node/dgram.d.ts +0 -599
- package/node_modules/@types/cacheable-request/node_modules/@types/node/diagnostics_channel.d.ts +0 -554
- package/node_modules/@types/cacheable-request/node_modules/@types/node/dns/promises.d.ts +0 -476
- package/node_modules/@types/cacheable-request/node_modules/@types/node/dns.d.ts +0 -865
- package/node_modules/@types/cacheable-request/node_modules/@types/node/dom-events.d.ts +0 -124
- package/node_modules/@types/cacheable-request/node_modules/@types/node/domain.d.ts +0 -170
- package/node_modules/@types/cacheable-request/node_modules/@types/node/events.d.ts +0 -931
- package/node_modules/@types/cacheable-request/node_modules/@types/node/fs/promises.d.ts +0 -1275
- package/node_modules/@types/cacheable-request/node_modules/@types/node/fs.d.ts +0 -4343
- package/node_modules/@types/cacheable-request/node_modules/@types/node/globals.d.ts +0 -511
- package/node_modules/@types/cacheable-request/node_modules/@types/node/globals.typedarray.d.ts +0 -21
- package/node_modules/@types/cacheable-request/node_modules/@types/node/http.d.ts +0 -1959
- package/node_modules/@types/cacheable-request/node_modules/@types/node/http2.d.ts +0 -2558
- package/node_modules/@types/cacheable-request/node_modules/@types/node/https.d.ts +0 -543
- package/node_modules/@types/cacheable-request/node_modules/@types/node/index.d.ts +0 -92
- package/node_modules/@types/cacheable-request/node_modules/@types/node/inspector.d.ts +0 -3966
- package/node_modules/@types/cacheable-request/node_modules/@types/node/module.d.ts +0 -702
- package/node_modules/@types/cacheable-request/node_modules/@types/node/net.d.ts +0 -1029
- package/node_modules/@types/cacheable-request/node_modules/@types/node/os.d.ts +0 -495
- package/node_modules/@types/cacheable-request/node_modules/@types/node/package.json +0 -220
- package/node_modules/@types/cacheable-request/node_modules/@types/node/path.d.ts +0 -200
- package/node_modules/@types/cacheable-request/node_modules/@types/node/perf_hooks.d.ts +0 -970
- package/node_modules/@types/cacheable-request/node_modules/@types/node/process.d.ts +0 -2013
- package/node_modules/@types/cacheable-request/node_modules/@types/node/punycode.d.ts +0 -117
- package/node_modules/@types/cacheable-request/node_modules/@types/node/querystring.d.ts +0 -153
- package/node_modules/@types/cacheable-request/node_modules/@types/node/readline/promises.d.ts +0 -162
- package/node_modules/@types/cacheable-request/node_modules/@types/node/readline.d.ts +0 -589
- package/node_modules/@types/cacheable-request/node_modules/@types/node/repl.d.ts +0 -430
- package/node_modules/@types/cacheable-request/node_modules/@types/node/sea.d.ts +0 -153
- package/node_modules/@types/cacheable-request/node_modules/@types/node/sqlite.d.ts +0 -439
- package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/consumers.d.ts +0 -12
- package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/promises.d.ts +0 -90
- package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/web.d.ts +0 -614
- package/node_modules/@types/cacheable-request/node_modules/@types/node/stream.d.ts +0 -1662
- package/node_modules/@types/cacheable-request/node_modules/@types/node/string_decoder.d.ts +0 -67
- package/node_modules/@types/cacheable-request/node_modules/@types/node/test.d.ts +0 -2150
- package/node_modules/@types/cacheable-request/node_modules/@types/node/timers/promises.d.ts +0 -97
- package/node_modules/@types/cacheable-request/node_modules/@types/node/timers.d.ts +0 -240
- package/node_modules/@types/cacheable-request/node_modules/@types/node/tls.d.ts +0 -1226
- package/node_modules/@types/cacheable-request/node_modules/@types/node/trace_events.d.ts +0 -197
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +0 -457
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +0 -19
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts5.6/index.d.ts +0 -92
- package/node_modules/@types/cacheable-request/node_modules/@types/node/tty.d.ts +0 -208
- package/node_modules/@types/cacheable-request/node_modules/@types/node/url.d.ts +0 -972
- package/node_modules/@types/cacheable-request/node_modules/@types/node/util.d.ts +0 -2439
- package/node_modules/@types/cacheable-request/node_modules/@types/node/v8.d.ts +0 -808
- package/node_modules/@types/cacheable-request/node_modules/@types/node/vm.d.ts +0 -976
- package/node_modules/@types/cacheable-request/node_modules/@types/node/wasi.d.ts +0 -181
- package/node_modules/@types/cacheable-request/node_modules/@types/node/worker_threads.d.ts +0 -745
- package/node_modules/@types/cacheable-request/node_modules/@types/node/zlib.d.ts +0 -539
- package/node_modules/@types/cacheable-request/node_modules/undici-types/LICENSE +0 -21
- package/node_modules/@types/cacheable-request/node_modules/undici-types/README.md +0 -6
- package/node_modules/@types/cacheable-request/node_modules/undici-types/agent.d.ts +0 -31
- package/node_modules/@types/cacheable-request/node_modules/undici-types/api.d.ts +0 -43
- package/node_modules/@types/cacheable-request/node_modules/undici-types/balanced-pool.d.ts +0 -29
- package/node_modules/@types/cacheable-request/node_modules/undici-types/cache.d.ts +0 -36
- package/node_modules/@types/cacheable-request/node_modules/undici-types/client.d.ts +0 -108
- package/node_modules/@types/cacheable-request/node_modules/undici-types/connector.d.ts +0 -34
- package/node_modules/@types/cacheable-request/node_modules/undici-types/content-type.d.ts +0 -21
- package/node_modules/@types/cacheable-request/node_modules/undici-types/cookies.d.ts +0 -28
- package/node_modules/@types/cacheable-request/node_modules/undici-types/diagnostics-channel.d.ts +0 -66
- package/node_modules/@types/cacheable-request/node_modules/undici-types/dispatcher.d.ts +0 -255
- package/node_modules/@types/cacheable-request/node_modules/undici-types/env-http-proxy-agent.d.ts +0 -21
- package/node_modules/@types/cacheable-request/node_modules/undici-types/errors.d.ts +0 -149
- package/node_modules/@types/cacheable-request/node_modules/undici-types/eventsource.d.ts +0 -61
- package/node_modules/@types/cacheable-request/node_modules/undici-types/fetch.d.ts +0 -209
- package/node_modules/@types/cacheable-request/node_modules/undici-types/file.d.ts +0 -39
- package/node_modules/@types/cacheable-request/node_modules/undici-types/filereader.d.ts +0 -54
- package/node_modules/@types/cacheable-request/node_modules/undici-types/formdata.d.ts +0 -108
- package/node_modules/@types/cacheable-request/node_modules/undici-types/global-dispatcher.d.ts +0 -9
- package/node_modules/@types/cacheable-request/node_modules/undici-types/global-origin.d.ts +0 -7
- package/node_modules/@types/cacheable-request/node_modules/undici-types/handlers.d.ts +0 -15
- package/node_modules/@types/cacheable-request/node_modules/undici-types/header.d.ts +0 -4
- package/node_modules/@types/cacheable-request/node_modules/undici-types/index.d.ts +0 -71
- package/node_modules/@types/cacheable-request/node_modules/undici-types/interceptors.d.ts +0 -17
- package/node_modules/@types/cacheable-request/node_modules/undici-types/mock-agent.d.ts +0 -50
- package/node_modules/@types/cacheable-request/node_modules/undici-types/mock-client.d.ts +0 -25
- package/node_modules/@types/cacheable-request/node_modules/undici-types/mock-errors.d.ts +0 -12
- package/node_modules/@types/cacheable-request/node_modules/undici-types/mock-interceptor.d.ts +0 -93
- package/node_modules/@types/cacheable-request/node_modules/undici-types/mock-pool.d.ts +0 -25
- package/node_modules/@types/cacheable-request/node_modules/undici-types/package.json +0 -55
- package/node_modules/@types/cacheable-request/node_modules/undici-types/patch.d.ts +0 -33
- package/node_modules/@types/cacheable-request/node_modules/undici-types/pool-stats.d.ts +0 -19
- package/node_modules/@types/cacheable-request/node_modules/undici-types/pool.d.ts +0 -39
- package/node_modules/@types/cacheable-request/node_modules/undici-types/proxy-agent.d.ts +0 -28
- package/node_modules/@types/cacheable-request/node_modules/undici-types/readable.d.ts +0 -60
- package/node_modules/@types/cacheable-request/node_modules/undici-types/retry-agent.d.ts +0 -8
- package/node_modules/@types/cacheable-request/node_modules/undici-types/retry-handler.d.ts +0 -116
- package/node_modules/@types/cacheable-request/node_modules/undici-types/util.d.ts +0 -18
- package/node_modules/@types/cacheable-request/node_modules/undici-types/webidl.d.ts +0 -222
- package/node_modules/@types/cacheable-request/node_modules/undici-types/websocket.d.ts +0 -150
- package/node_modules/@types/cacheable-request/package.json +0 -35
- package/node_modules/@types/http-cache-semantics/LICENSE +0 -21
- package/node_modules/@types/http-cache-semantics/README.md +0 -15
- package/node_modules/@types/http-cache-semantics/index.d.ts +0 -165
- package/node_modules/@types/http-cache-semantics/package.json +0 -25
- package/node_modules/@types/keyv/LICENSE +0 -21
- package/node_modules/@types/keyv/README.md +0 -16
- package/node_modules/@types/keyv/index.d.ts +0 -90
- package/node_modules/@types/keyv/node_modules/@types/node/LICENSE +0 -21
- package/node_modules/@types/keyv/node_modules/@types/node/README.md +0 -15
- package/node_modules/@types/keyv/node_modules/@types/node/assert/strict.d.ts +0 -8
- package/node_modules/@types/keyv/node_modules/@types/node/assert.d.ts +0 -1095
- package/node_modules/@types/keyv/node_modules/@types/node/async_hooks.d.ts +0 -541
- package/node_modules/@types/keyv/node_modules/@types/node/buffer.buffer.d.ts +0 -460
- package/node_modules/@types/keyv/node_modules/@types/node/buffer.d.ts +0 -1926
- package/node_modules/@types/keyv/node_modules/@types/node/child_process.d.ts +0 -1549
- package/node_modules/@types/keyv/node_modules/@types/node/cluster.d.ts +0 -579
- package/node_modules/@types/keyv/node_modules/@types/node/compatibility/disposable.d.ts +0 -16
- package/node_modules/@types/keyv/node_modules/@types/node/compatibility/index.d.ts +0 -9
- package/node_modules/@types/keyv/node_modules/@types/node/compatibility/indexable.d.ts +0 -23
- package/node_modules/@types/keyv/node_modules/@types/node/compatibility/iterators.d.ts +0 -21
- package/node_modules/@types/keyv/node_modules/@types/node/console.d.ts +0 -452
- package/node_modules/@types/keyv/node_modules/@types/node/constants.d.ts +0 -21
- package/node_modules/@types/keyv/node_modules/@types/node/crypto.d.ts +0 -4510
- package/node_modules/@types/keyv/node_modules/@types/node/dgram.d.ts +0 -599
- package/node_modules/@types/keyv/node_modules/@types/node/diagnostics_channel.d.ts +0 -554
- package/node_modules/@types/keyv/node_modules/@types/node/dns/promises.d.ts +0 -476
- package/node_modules/@types/keyv/node_modules/@types/node/dns.d.ts +0 -865
- package/node_modules/@types/keyv/node_modules/@types/node/dom-events.d.ts +0 -124
- package/node_modules/@types/keyv/node_modules/@types/node/domain.d.ts +0 -170
- package/node_modules/@types/keyv/node_modules/@types/node/events.d.ts +0 -931
- package/node_modules/@types/keyv/node_modules/@types/node/fs/promises.d.ts +0 -1275
- package/node_modules/@types/keyv/node_modules/@types/node/fs.d.ts +0 -4343
- package/node_modules/@types/keyv/node_modules/@types/node/globals.d.ts +0 -511
- package/node_modules/@types/keyv/node_modules/@types/node/globals.typedarray.d.ts +0 -21
- package/node_modules/@types/keyv/node_modules/@types/node/http.d.ts +0 -1959
- package/node_modules/@types/keyv/node_modules/@types/node/http2.d.ts +0 -2558
- package/node_modules/@types/keyv/node_modules/@types/node/https.d.ts +0 -543
- package/node_modules/@types/keyv/node_modules/@types/node/index.d.ts +0 -92
- package/node_modules/@types/keyv/node_modules/@types/node/inspector.d.ts +0 -3966
- package/node_modules/@types/keyv/node_modules/@types/node/module.d.ts +0 -702
- package/node_modules/@types/keyv/node_modules/@types/node/net.d.ts +0 -1029
- package/node_modules/@types/keyv/node_modules/@types/node/os.d.ts +0 -495
- package/node_modules/@types/keyv/node_modules/@types/node/package.json +0 -220
- package/node_modules/@types/keyv/node_modules/@types/node/path.d.ts +0 -200
- package/node_modules/@types/keyv/node_modules/@types/node/perf_hooks.d.ts +0 -970
- package/node_modules/@types/keyv/node_modules/@types/node/process.d.ts +0 -2013
- package/node_modules/@types/keyv/node_modules/@types/node/punycode.d.ts +0 -117
- package/node_modules/@types/keyv/node_modules/@types/node/querystring.d.ts +0 -153
- package/node_modules/@types/keyv/node_modules/@types/node/readline/promises.d.ts +0 -162
- package/node_modules/@types/keyv/node_modules/@types/node/readline.d.ts +0 -589
- package/node_modules/@types/keyv/node_modules/@types/node/repl.d.ts +0 -430
- package/node_modules/@types/keyv/node_modules/@types/node/sea.d.ts +0 -153
- package/node_modules/@types/keyv/node_modules/@types/node/sqlite.d.ts +0 -439
- package/node_modules/@types/keyv/node_modules/@types/node/stream/consumers.d.ts +0 -12
- package/node_modules/@types/keyv/node_modules/@types/node/stream/promises.d.ts +0 -90
- package/node_modules/@types/keyv/node_modules/@types/node/stream/web.d.ts +0 -614
- package/node_modules/@types/keyv/node_modules/@types/node/stream.d.ts +0 -1662
- package/node_modules/@types/keyv/node_modules/@types/node/string_decoder.d.ts +0 -67
- package/node_modules/@types/keyv/node_modules/@types/node/test.d.ts +0 -2150
- package/node_modules/@types/keyv/node_modules/@types/node/timers/promises.d.ts +0 -97
- package/node_modules/@types/keyv/node_modules/@types/node/timers.d.ts +0 -240
- package/node_modules/@types/keyv/node_modules/@types/node/tls.d.ts +0 -1226
- package/node_modules/@types/keyv/node_modules/@types/node/trace_events.d.ts +0 -197
- package/node_modules/@types/keyv/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +0 -457
- package/node_modules/@types/keyv/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +0 -19
- package/node_modules/@types/keyv/node_modules/@types/node/ts5.6/index.d.ts +0 -92
- package/node_modules/@types/keyv/node_modules/@types/node/tty.d.ts +0 -208
- package/node_modules/@types/keyv/node_modules/@types/node/url.d.ts +0 -972
- package/node_modules/@types/keyv/node_modules/@types/node/util.d.ts +0 -2439
- package/node_modules/@types/keyv/node_modules/@types/node/v8.d.ts +0 -808
- package/node_modules/@types/keyv/node_modules/@types/node/vm.d.ts +0 -976
- package/node_modules/@types/keyv/node_modules/@types/node/wasi.d.ts +0 -181
- package/node_modules/@types/keyv/node_modules/@types/node/worker_threads.d.ts +0 -745
- package/node_modules/@types/keyv/node_modules/@types/node/zlib.d.ts +0 -539
- package/node_modules/@types/keyv/node_modules/undici-types/LICENSE +0 -21
- package/node_modules/@types/keyv/node_modules/undici-types/README.md +0 -6
- package/node_modules/@types/keyv/node_modules/undici-types/agent.d.ts +0 -31
- package/node_modules/@types/keyv/node_modules/undici-types/api.d.ts +0 -43
- package/node_modules/@types/keyv/node_modules/undici-types/balanced-pool.d.ts +0 -29
- package/node_modules/@types/keyv/node_modules/undici-types/cache.d.ts +0 -36
- package/node_modules/@types/keyv/node_modules/undici-types/client.d.ts +0 -108
- package/node_modules/@types/keyv/node_modules/undici-types/connector.d.ts +0 -34
- package/node_modules/@types/keyv/node_modules/undici-types/content-type.d.ts +0 -21
- package/node_modules/@types/keyv/node_modules/undici-types/cookies.d.ts +0 -28
- package/node_modules/@types/keyv/node_modules/undici-types/diagnostics-channel.d.ts +0 -66
- package/node_modules/@types/keyv/node_modules/undici-types/dispatcher.d.ts +0 -255
- package/node_modules/@types/keyv/node_modules/undici-types/env-http-proxy-agent.d.ts +0 -21
- package/node_modules/@types/keyv/node_modules/undici-types/errors.d.ts +0 -149
- package/node_modules/@types/keyv/node_modules/undici-types/eventsource.d.ts +0 -61
- package/node_modules/@types/keyv/node_modules/undici-types/fetch.d.ts +0 -209
- package/node_modules/@types/keyv/node_modules/undici-types/file.d.ts +0 -39
- package/node_modules/@types/keyv/node_modules/undici-types/filereader.d.ts +0 -54
- package/node_modules/@types/keyv/node_modules/undici-types/formdata.d.ts +0 -108
- package/node_modules/@types/keyv/node_modules/undici-types/global-dispatcher.d.ts +0 -9
- package/node_modules/@types/keyv/node_modules/undici-types/global-origin.d.ts +0 -7
- package/node_modules/@types/keyv/node_modules/undici-types/handlers.d.ts +0 -15
- package/node_modules/@types/keyv/node_modules/undici-types/header.d.ts +0 -4
- package/node_modules/@types/keyv/node_modules/undici-types/index.d.ts +0 -71
- package/node_modules/@types/keyv/node_modules/undici-types/interceptors.d.ts +0 -17
- package/node_modules/@types/keyv/node_modules/undici-types/mock-agent.d.ts +0 -50
- package/node_modules/@types/keyv/node_modules/undici-types/mock-client.d.ts +0 -25
- package/node_modules/@types/keyv/node_modules/undici-types/mock-errors.d.ts +0 -12
- package/node_modules/@types/keyv/node_modules/undici-types/mock-interceptor.d.ts +0 -93
- package/node_modules/@types/keyv/node_modules/undici-types/mock-pool.d.ts +0 -25
- package/node_modules/@types/keyv/node_modules/undici-types/package.json +0 -55
- package/node_modules/@types/keyv/node_modules/undici-types/patch.d.ts +0 -33
- package/node_modules/@types/keyv/node_modules/undici-types/pool-stats.d.ts +0 -19
- package/node_modules/@types/keyv/node_modules/undici-types/pool.d.ts +0 -39
- package/node_modules/@types/keyv/node_modules/undici-types/proxy-agent.d.ts +0 -28
- package/node_modules/@types/keyv/node_modules/undici-types/readable.d.ts +0 -60
- package/node_modules/@types/keyv/node_modules/undici-types/retry-agent.d.ts +0 -8
- package/node_modules/@types/keyv/node_modules/undici-types/retry-handler.d.ts +0 -116
- package/node_modules/@types/keyv/node_modules/undici-types/util.d.ts +0 -18
- package/node_modules/@types/keyv/node_modules/undici-types/webidl.d.ts +0 -222
- package/node_modules/@types/keyv/node_modules/undici-types/websocket.d.ts +0 -150
- package/node_modules/@types/keyv/package.json +0 -32
- package/node_modules/@types/responselike/LICENSE +0 -21
- package/node_modules/@types/responselike/README.md +0 -48
- package/node_modules/@types/responselike/index.d.ts +0 -29
- package/node_modules/@types/responselike/node_modules/@types/node/LICENSE +0 -21
- package/node_modules/@types/responselike/node_modules/@types/node/README.md +0 -15
- package/node_modules/@types/responselike/node_modules/@types/node/assert/strict.d.ts +0 -8
- package/node_modules/@types/responselike/node_modules/@types/node/assert.d.ts +0 -1095
- package/node_modules/@types/responselike/node_modules/@types/node/async_hooks.d.ts +0 -541
- package/node_modules/@types/responselike/node_modules/@types/node/buffer.buffer.d.ts +0 -460
- package/node_modules/@types/responselike/node_modules/@types/node/buffer.d.ts +0 -1926
- package/node_modules/@types/responselike/node_modules/@types/node/child_process.d.ts +0 -1549
- package/node_modules/@types/responselike/node_modules/@types/node/cluster.d.ts +0 -579
- package/node_modules/@types/responselike/node_modules/@types/node/compatibility/disposable.d.ts +0 -16
- package/node_modules/@types/responselike/node_modules/@types/node/compatibility/index.d.ts +0 -9
- package/node_modules/@types/responselike/node_modules/@types/node/compatibility/indexable.d.ts +0 -23
- package/node_modules/@types/responselike/node_modules/@types/node/compatibility/iterators.d.ts +0 -21
- package/node_modules/@types/responselike/node_modules/@types/node/console.d.ts +0 -452
- package/node_modules/@types/responselike/node_modules/@types/node/constants.d.ts +0 -21
- package/node_modules/@types/responselike/node_modules/@types/node/crypto.d.ts +0 -4510
- package/node_modules/@types/responselike/node_modules/@types/node/dgram.d.ts +0 -599
- package/node_modules/@types/responselike/node_modules/@types/node/diagnostics_channel.d.ts +0 -554
- package/node_modules/@types/responselike/node_modules/@types/node/dns/promises.d.ts +0 -476
- package/node_modules/@types/responselike/node_modules/@types/node/dns.d.ts +0 -865
- package/node_modules/@types/responselike/node_modules/@types/node/dom-events.d.ts +0 -124
- package/node_modules/@types/responselike/node_modules/@types/node/domain.d.ts +0 -170
- package/node_modules/@types/responselike/node_modules/@types/node/events.d.ts +0 -931
- package/node_modules/@types/responselike/node_modules/@types/node/fs/promises.d.ts +0 -1275
- package/node_modules/@types/responselike/node_modules/@types/node/fs.d.ts +0 -4343
- package/node_modules/@types/responselike/node_modules/@types/node/globals.d.ts +0 -511
- package/node_modules/@types/responselike/node_modules/@types/node/globals.typedarray.d.ts +0 -21
- package/node_modules/@types/responselike/node_modules/@types/node/http.d.ts +0 -1959
- package/node_modules/@types/responselike/node_modules/@types/node/http2.d.ts +0 -2558
- package/node_modules/@types/responselike/node_modules/@types/node/https.d.ts +0 -543
- package/node_modules/@types/responselike/node_modules/@types/node/index.d.ts +0 -92
- package/node_modules/@types/responselike/node_modules/@types/node/inspector.d.ts +0 -3966
- package/node_modules/@types/responselike/node_modules/@types/node/module.d.ts +0 -702
- package/node_modules/@types/responselike/node_modules/@types/node/net.d.ts +0 -1029
- package/node_modules/@types/responselike/node_modules/@types/node/os.d.ts +0 -495
- package/node_modules/@types/responselike/node_modules/@types/node/package.json +0 -220
- package/node_modules/@types/responselike/node_modules/@types/node/path.d.ts +0 -200
- package/node_modules/@types/responselike/node_modules/@types/node/perf_hooks.d.ts +0 -970
- package/node_modules/@types/responselike/node_modules/@types/node/process.d.ts +0 -2013
- package/node_modules/@types/responselike/node_modules/@types/node/punycode.d.ts +0 -117
- package/node_modules/@types/responselike/node_modules/@types/node/querystring.d.ts +0 -153
- package/node_modules/@types/responselike/node_modules/@types/node/readline/promises.d.ts +0 -162
- package/node_modules/@types/responselike/node_modules/@types/node/readline.d.ts +0 -589
- package/node_modules/@types/responselike/node_modules/@types/node/repl.d.ts +0 -430
- package/node_modules/@types/responselike/node_modules/@types/node/sea.d.ts +0 -153
- package/node_modules/@types/responselike/node_modules/@types/node/sqlite.d.ts +0 -439
- package/node_modules/@types/responselike/node_modules/@types/node/stream/consumers.d.ts +0 -12
- package/node_modules/@types/responselike/node_modules/@types/node/stream/promises.d.ts +0 -90
- package/node_modules/@types/responselike/node_modules/@types/node/stream/web.d.ts +0 -614
- package/node_modules/@types/responselike/node_modules/@types/node/stream.d.ts +0 -1662
- package/node_modules/@types/responselike/node_modules/@types/node/string_decoder.d.ts +0 -67
- package/node_modules/@types/responselike/node_modules/@types/node/test.d.ts +0 -2150
- package/node_modules/@types/responselike/node_modules/@types/node/timers/promises.d.ts +0 -97
- package/node_modules/@types/responselike/node_modules/@types/node/timers.d.ts +0 -240
- package/node_modules/@types/responselike/node_modules/@types/node/tls.d.ts +0 -1226
- package/node_modules/@types/responselike/node_modules/@types/node/trace_events.d.ts +0 -197
- package/node_modules/@types/responselike/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +0 -457
- package/node_modules/@types/responselike/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +0 -19
- package/node_modules/@types/responselike/node_modules/@types/node/ts5.6/index.d.ts +0 -92
- package/node_modules/@types/responselike/node_modules/@types/node/tty.d.ts +0 -208
- package/node_modules/@types/responselike/node_modules/@types/node/url.d.ts +0 -972
- package/node_modules/@types/responselike/node_modules/@types/node/util.d.ts +0 -2439
- package/node_modules/@types/responselike/node_modules/@types/node/v8.d.ts +0 -808
- package/node_modules/@types/responselike/node_modules/@types/node/vm.d.ts +0 -976
- package/node_modules/@types/responselike/node_modules/@types/node/wasi.d.ts +0 -181
- package/node_modules/@types/responselike/node_modules/@types/node/worker_threads.d.ts +0 -745
- package/node_modules/@types/responselike/node_modules/@types/node/zlib.d.ts +0 -539
- package/node_modules/@types/responselike/node_modules/undici-types/LICENSE +0 -21
- package/node_modules/@types/responselike/node_modules/undici-types/README.md +0 -6
- package/node_modules/@types/responselike/node_modules/undici-types/agent.d.ts +0 -31
- package/node_modules/@types/responselike/node_modules/undici-types/api.d.ts +0 -43
- package/node_modules/@types/responselike/node_modules/undici-types/balanced-pool.d.ts +0 -29
- package/node_modules/@types/responselike/node_modules/undici-types/cache.d.ts +0 -36
- package/node_modules/@types/responselike/node_modules/undici-types/client.d.ts +0 -108
- package/node_modules/@types/responselike/node_modules/undici-types/connector.d.ts +0 -34
- package/node_modules/@types/responselike/node_modules/undici-types/content-type.d.ts +0 -21
- package/node_modules/@types/responselike/node_modules/undici-types/cookies.d.ts +0 -28
- package/node_modules/@types/responselike/node_modules/undici-types/diagnostics-channel.d.ts +0 -66
- package/node_modules/@types/responselike/node_modules/undici-types/dispatcher.d.ts +0 -255
- package/node_modules/@types/responselike/node_modules/undici-types/env-http-proxy-agent.d.ts +0 -21
- package/node_modules/@types/responselike/node_modules/undici-types/errors.d.ts +0 -149
- package/node_modules/@types/responselike/node_modules/undici-types/eventsource.d.ts +0 -61
- package/node_modules/@types/responselike/node_modules/undici-types/fetch.d.ts +0 -209
- package/node_modules/@types/responselike/node_modules/undici-types/file.d.ts +0 -39
- package/node_modules/@types/responselike/node_modules/undici-types/filereader.d.ts +0 -54
- package/node_modules/@types/responselike/node_modules/undici-types/formdata.d.ts +0 -108
- package/node_modules/@types/responselike/node_modules/undici-types/global-dispatcher.d.ts +0 -9
- package/node_modules/@types/responselike/node_modules/undici-types/global-origin.d.ts +0 -7
- package/node_modules/@types/responselike/node_modules/undici-types/handlers.d.ts +0 -15
- package/node_modules/@types/responselike/node_modules/undici-types/header.d.ts +0 -4
- package/node_modules/@types/responselike/node_modules/undici-types/index.d.ts +0 -71
- package/node_modules/@types/responselike/node_modules/undici-types/interceptors.d.ts +0 -17
- package/node_modules/@types/responselike/node_modules/undici-types/mock-agent.d.ts +0 -50
- package/node_modules/@types/responselike/node_modules/undici-types/mock-client.d.ts +0 -25
- package/node_modules/@types/responselike/node_modules/undici-types/mock-errors.d.ts +0 -12
- package/node_modules/@types/responselike/node_modules/undici-types/mock-interceptor.d.ts +0 -93
- package/node_modules/@types/responselike/node_modules/undici-types/mock-pool.d.ts +0 -25
- package/node_modules/@types/responselike/node_modules/undici-types/package.json +0 -55
- package/node_modules/@types/responselike/node_modules/undici-types/patch.d.ts +0 -33
- package/node_modules/@types/responselike/node_modules/undici-types/pool-stats.d.ts +0 -19
- package/node_modules/@types/responselike/node_modules/undici-types/pool.d.ts +0 -39
- package/node_modules/@types/responselike/node_modules/undici-types/proxy-agent.d.ts +0 -28
- package/node_modules/@types/responselike/node_modules/undici-types/readable.d.ts +0 -60
- package/node_modules/@types/responselike/node_modules/undici-types/retry-agent.d.ts +0 -8
- package/node_modules/@types/responselike/node_modules/undici-types/retry-handler.d.ts +0 -116
- package/node_modules/@types/responselike/node_modules/undici-types/util.d.ts +0 -18
- package/node_modules/@types/responselike/node_modules/undici-types/webidl.d.ts +0 -222
- package/node_modules/@types/responselike/node_modules/undici-types/websocket.d.ts +0 -150
- package/node_modules/@types/responselike/package.json +0 -27
- package/node_modules/cacheable-lookup/LICENSE +0 -21
- package/node_modules/cacheable-lookup/README.md +0 -240
- package/node_modules/cacheable-lookup/index.d.ts +0 -139
- package/node_modules/cacheable-lookup/package.json +0 -45
- package/node_modules/cacheable-lookup/source/index.js +0 -436
- package/node_modules/cacheable-request/LICENSE +0 -21
- package/node_modules/cacheable-request/README.md +0 -206
- package/node_modules/cacheable-request/package.json +0 -56
- package/node_modules/cacheable-request/src/index.js +0 -251
- package/node_modules/clone-response/LICENSE +0 -21
- package/node_modules/clone-response/README.md +0 -62
- package/node_modules/clone-response/node_modules/mimic-response/index.js +0 -32
- package/node_modules/clone-response/node_modules/mimic-response/license +0 -9
- package/node_modules/clone-response/node_modules/mimic-response/package.json +0 -37
- package/node_modules/clone-response/node_modules/mimic-response/readme.md +0 -54
- package/node_modules/clone-response/package.json +0 -41
- package/node_modules/clone-response/src/index.js +0 -17
- package/node_modules/decompress-response/index.d.ts +0 -22
- package/node_modules/decompress-response/index.js +0 -58
- package/node_modules/decompress-response/license +0 -9
- package/node_modules/decompress-response/package.json +0 -56
- package/node_modules/decompress-response/readme.md +0 -48
- package/node_modules/defer-to-connect/LICENSE +0 -21
- package/node_modules/defer-to-connect/README.md +0 -38
- package/node_modules/defer-to-connect/dist/source/index.d.ts +0 -10
- package/node_modules/defer-to-connect/dist/source/index.js +0 -47
- package/node_modules/defer-to-connect/package.json +0 -71
- package/node_modules/end-of-stream/LICENSE +0 -21
- package/node_modules/end-of-stream/README.md +0 -54
- package/node_modules/end-of-stream/index.js +0 -94
- package/node_modules/end-of-stream/package.json +0 -37
- package/node_modules/get-stream/buffer-stream.js +0 -52
- package/node_modules/get-stream/index.d.ts +0 -108
- package/node_modules/get-stream/index.js +0 -60
- package/node_modules/get-stream/license +0 -9
- package/node_modules/get-stream/package.json +0 -50
- package/node_modules/get-stream/readme.md +0 -124
- package/node_modules/got/dist/source/as-promise/create-rejection.d.ts +0 -2
- package/node_modules/got/dist/source/as-promise/create-rejection.js +0 -30
- package/node_modules/got/dist/source/as-promise/index.d.ts +0 -3
- package/node_modules/got/dist/source/as-promise/index.js +0 -176
- package/node_modules/got/dist/source/as-promise/normalize-arguments.d.ts +0 -3
- package/node_modules/got/dist/source/as-promise/normalize-arguments.js +0 -78
- package/node_modules/got/dist/source/as-promise/parse-body.d.ts +0 -3
- package/node_modules/got/dist/source/as-promise/parse-body.js +0 -25
- package/node_modules/got/dist/source/as-promise/types.d.ts +0 -256
- package/node_modules/got/dist/source/as-promise/types.js +0 -42
- package/node_modules/got/dist/source/core/calculate-retry-delay.d.ts +0 -5
- package/node_modules/got/dist/source/core/calculate-retry-delay.js +0 -29
- package/node_modules/got/dist/source/core/index.d.ts +0 -1124
- package/node_modules/got/dist/source/core/index.js +0 -1505
- package/node_modules/got/dist/source/core/utils/dns-ip-version.d.ts +0 -5
- package/node_modules/got/dist/source/core/utils/dns-ip-version.js +0 -17
- package/node_modules/got/dist/source/core/utils/get-body-size.d.ts +0 -3
- package/node_modules/got/dist/source/core/utils/get-body-size.js +0 -32
- package/node_modules/got/dist/source/core/utils/get-buffer.d.ts +0 -4
- package/node_modules/got/dist/source/core/utils/get-buffer.js +0 -16
- package/node_modules/got/dist/source/core/utils/is-form-data.d.ts +0 -8
- package/node_modules/got/dist/source/core/utils/is-form-data.js +0 -4
- package/node_modules/got/dist/source/core/utils/is-response-ok.d.ts +0 -2
- package/node_modules/got/dist/source/core/utils/is-response-ok.js +0 -8
- package/node_modules/got/dist/source/core/utils/options-to-url.d.ts +0 -14
- package/node_modules/got/dist/source/core/utils/options-to-url.js +0 -53
- package/node_modules/got/dist/source/core/utils/proxy-events.d.ts +0 -3
- package/node_modules/got/dist/source/core/utils/proxy-events.js +0 -17
- package/node_modules/got/dist/source/core/utils/timed-out.d.ts +0 -29
- package/node_modules/got/dist/source/core/utils/timed-out.js +0 -121
- package/node_modules/got/dist/source/core/utils/unhandle.d.ts +0 -11
- package/node_modules/got/dist/source/core/utils/unhandle.js +0 -22
- package/node_modules/got/dist/source/core/utils/url-to-options.d.ts +0 -15
- package/node_modules/got/dist/source/core/utils/url-to-options.js +0 -24
- package/node_modules/got/dist/source/core/utils/weakable-map.d.ts +0 -8
- package/node_modules/got/dist/source/core/utils/weakable-map.js +0 -29
- package/node_modules/got/dist/source/create.d.ts +0 -5
- package/node_modules/got/dist/source/create.js +0 -240
- package/node_modules/got/dist/source/index.d.ts +0 -4
- package/node_modules/got/dist/source/index.js +0 -132
- package/node_modules/got/dist/source/types.d.ts +0 -344
- package/node_modules/got/dist/source/types.js +0 -2
- package/node_modules/got/dist/source/utils/deep-freeze.d.ts +0 -1
- package/node_modules/got/dist/source/utils/deep-freeze.js +0 -12
- package/node_modules/got/dist/source/utils/deprecation-warning.d.ts +0 -2
- package/node_modules/got/dist/source/utils/deprecation-warning.js +0 -13
- package/node_modules/got/license +0 -9
- package/node_modules/got/package.json +0 -131
- package/node_modules/got/readme.md +0 -2477
- package/node_modules/hpagent/.github/dependabot.yml +0 -8
- package/node_modules/hpagent/.github/workflows/build.yml +0 -29
- package/node_modules/hpagent/LICENSE +0 -21
- package/node_modules/hpagent/README.md +0 -138
- package/node_modules/hpagent/index.d.ts +0 -26
- package/node_modules/hpagent/index.js +0 -101
- package/node_modules/hpagent/index.mjs +0 -5
- package/node_modules/hpagent/package.json +0 -49
- package/node_modules/hpagent/test/got.test.js +0 -111
- package/node_modules/hpagent/test/http-http.test.js +0 -351
- package/node_modules/hpagent/test/http-https.test.js +0 -313
- package/node_modules/hpagent/test/https-http.test.js +0 -313
- package/node_modules/hpagent/test/https-https.test.js +0 -313
- package/node_modules/hpagent/test/index.test-d.ts +0 -45
- package/node_modules/hpagent/test/needle.test.js +0 -103
- package/node_modules/hpagent/test/node-fetch.test.js +0 -103
- package/node_modules/hpagent/test/simple-get.test.js +0 -139
- package/node_modules/hpagent/test/ssl.cert +0 -19
- package/node_modules/hpagent/test/ssl.key +0 -27
- package/node_modules/hpagent/test/utils.js +0 -59
- package/node_modules/http-cache-semantics/LICENSE +0 -9
- package/node_modules/http-cache-semantics/README.md +0 -203
- package/node_modules/http-cache-semantics/index.js +0 -674
- package/node_modules/http-cache-semantics/package.json +0 -18
- package/node_modules/http2-wrapper/LICENSE +0 -21
- package/node_modules/http2-wrapper/README.md +0 -470
- package/node_modules/http2-wrapper/package.json +0 -54
- package/node_modules/http2-wrapper/source/agent.js +0 -670
- package/node_modules/http2-wrapper/source/auto.js +0 -149
- package/node_modules/http2-wrapper/source/client-request.js +0 -445
- package/node_modules/http2-wrapper/source/incoming-message.js +0 -58
- package/node_modules/http2-wrapper/source/index.js +0 -28
- package/node_modules/http2-wrapper/source/utils/calculate-server-name.js +0 -27
- package/node_modules/http2-wrapper/source/utils/errors.js +0 -45
- package/node_modules/http2-wrapper/source/utils/is-request-pseudo-header.js +0 -13
- package/node_modules/http2-wrapper/source/utils/proxy-events.js +0 -7
- package/node_modules/http2-wrapper/source/utils/url-to-options.js +0 -25
- package/node_modules/json-buffer/.travis.yml +0 -3
- package/node_modules/json-buffer/LICENSE +0 -22
- package/node_modules/json-buffer/README.md +0 -24
- package/node_modules/json-buffer/index.js +0 -58
- package/node_modules/json-buffer/package.json +0 -34
- package/node_modules/json-buffer/test/index.js +0 -63
- package/node_modules/keyv/README.md +0 -429
- package/node_modules/keyv/package.json +0 -57
- package/node_modules/keyv/src/index.d.ts +0 -112
- package/node_modules/keyv/src/index.js +0 -259
- package/node_modules/lowercase-keys/index.d.ts +0 -16
- package/node_modules/lowercase-keys/index.js +0 -10
- package/node_modules/lowercase-keys/license +0 -9
- package/node_modules/lowercase-keys/package.json +0 -38
- package/node_modules/lowercase-keys/readme.md +0 -32
- package/node_modules/mimic-response/index.d.ts +0 -17
- package/node_modules/mimic-response/index.js +0 -77
- package/node_modules/mimic-response/license +0 -9
- package/node_modules/mimic-response/package.json +0 -42
- package/node_modules/mimic-response/readme.md +0 -78
- package/node_modules/normalize-url/index.d.ts +0 -267
- package/node_modules/normalize-url/index.js +0 -216
- package/node_modules/normalize-url/license +0 -9
- package/node_modules/normalize-url/package.json +0 -50
- package/node_modules/normalize-url/readme.md +0 -286
- package/node_modules/once/LICENSE +0 -15
- package/node_modules/once/README.md +0 -79
- package/node_modules/once/once.js +0 -42
- package/node_modules/once/package.json +0 -33
- package/node_modules/p-cancelable/index.d.ts +0 -176
- package/node_modules/p-cancelable/index.js +0 -111
- package/node_modules/p-cancelable/license +0 -9
- package/node_modules/p-cancelable/package.json +0 -49
- package/node_modules/p-cancelable/readme.md +0 -153
- package/node_modules/pump/.github/FUNDING.yml +0 -2
- package/node_modules/pump/.travis.yml +0 -5
- package/node_modules/pump/LICENSE +0 -21
- package/node_modules/pump/README.md +0 -74
- package/node_modules/pump/SECURITY.md +0 -5
- package/node_modules/pump/index.js +0 -86
- package/node_modules/pump/package.json +0 -24
- package/node_modules/pump/test-browser.js +0 -66
- package/node_modules/pump/test-node.js +0 -53
- package/node_modules/quick-lru/index.d.ts +0 -97
- package/node_modules/quick-lru/index.js +0 -123
- package/node_modules/quick-lru/license +0 -9
- package/node_modules/quick-lru/package.json +0 -43
- package/node_modules/quick-lru/readme.md +0 -111
- package/node_modules/resolve-alpn/LICENSE +0 -22
- package/node_modules/resolve-alpn/README.md +0 -60
- package/node_modules/resolve-alpn/index.js +0 -43
- package/node_modules/resolve-alpn/package.json +0 -34
- package/node_modules/responselike/LICENSE +0 -19
- package/node_modules/responselike/README.md +0 -77
- package/node_modules/responselike/package.json +0 -39
- package/node_modules/responselike/src/index.js +0 -34
- package/node_modules/wrappy/LICENSE +0 -15
- package/node_modules/wrappy/README.md +0 -36
- package/node_modules/wrappy/package.json +0 -29
- package/node_modules/wrappy/wrappy.js +0 -33
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
import {Resolver, promises as dnsPromises, lookup} from 'dns';
|
|
2
|
-
import {Agent} from 'http';
|
|
3
|
-
|
|
4
|
-
type AsyncResolver = dnsPromises.Resolver;
|
|
5
|
-
|
|
6
|
-
export type IPFamily = 4 | 6;
|
|
7
|
-
|
|
8
|
-
type TPromise<T> = T | Promise<T>;
|
|
9
|
-
|
|
10
|
-
export interface CacheInstance {
|
|
11
|
-
set(hostname: string, entries: EntryObject[], ttl: number): TPromise<void | boolean | this>;
|
|
12
|
-
get(hostname: string): TPromise<EntryObject[] | undefined>;
|
|
13
|
-
delete(hostname: string): TPromise<boolean>;
|
|
14
|
-
clear(): TPromise<void>;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export interface Options {
|
|
18
|
-
/**
|
|
19
|
-
* Custom cache instance. If `undefined`, it will create a new one.
|
|
20
|
-
* @default undefined
|
|
21
|
-
*/
|
|
22
|
-
cache?: CacheInstance;
|
|
23
|
-
/**
|
|
24
|
-
* Limits the cache time (TTL). If set to `0`, it will make a new DNS query each time.
|
|
25
|
-
* @default Infinity
|
|
26
|
-
*/
|
|
27
|
-
maxTtl?: number;
|
|
28
|
-
/**
|
|
29
|
-
* DNS Resolver used to make DNS queries.
|
|
30
|
-
* @default new dns.promises.Resolver()
|
|
31
|
-
*/
|
|
32
|
-
resolver?: Resolver | AsyncResolver;
|
|
33
|
-
/**
|
|
34
|
-
* When the DNS server responds with `ENOTFOUND` or `ENODATA` and the OS reports that the entry is available,
|
|
35
|
-
* it will use `dns.lookup(...)` directly for the requested hostnames for the specified amount of time (in seconds).
|
|
36
|
-
*
|
|
37
|
-
* If you don't query internal hostnames (such as `localhost`, `database.local` etc.),
|
|
38
|
-
* it is strongly recommended to set this value to `0`.
|
|
39
|
-
* @default 3600
|
|
40
|
-
*/
|
|
41
|
-
fallbackDuration?: number;
|
|
42
|
-
/**
|
|
43
|
-
* The time how long it needs to remember failed queries (TTL in seconds).
|
|
44
|
-
*
|
|
45
|
-
* **Note**: This option is independent, `options.maxTtl` does not affect this.
|
|
46
|
-
* @default 0.15
|
|
47
|
-
*/
|
|
48
|
-
errorTtl?: number;
|
|
49
|
-
/**
|
|
50
|
-
* The fallback function to use when the DNS server responds with `ENOTFOUND` or `ENODATA`.
|
|
51
|
-
*
|
|
52
|
-
* **Note**: This has no effect if the `fallbackDuration` option is less than `1`.
|
|
53
|
-
* @default dns.lookup
|
|
54
|
-
*/
|
|
55
|
-
lookup?: typeof lookup;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export interface EntryObject {
|
|
59
|
-
/**
|
|
60
|
-
* The IP address (can be an IPv4 or IPv5 address).
|
|
61
|
-
*/
|
|
62
|
-
readonly address: string;
|
|
63
|
-
/**
|
|
64
|
-
* The IP family.
|
|
65
|
-
*/
|
|
66
|
-
readonly family: IPFamily;
|
|
67
|
-
/**
|
|
68
|
-
* The original TTL.
|
|
69
|
-
*/
|
|
70
|
-
readonly ttl?: number;
|
|
71
|
-
/**
|
|
72
|
-
* The expiration timestamp.
|
|
73
|
-
*/
|
|
74
|
-
readonly expires?: number;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export interface LookupOptions {
|
|
78
|
-
/**
|
|
79
|
-
* One or more supported getaddrinfo flags. Multiple flags may be passed by bitwise ORing their values.
|
|
80
|
-
*/
|
|
81
|
-
hints?: number;
|
|
82
|
-
/**
|
|
83
|
-
* The record family. Must be `4` or `6`. IPv4 and IPv6 addresses are both returned by default.
|
|
84
|
-
*/
|
|
85
|
-
family?: IPFamily;
|
|
86
|
-
/**
|
|
87
|
-
* When `true`, the callback returns all resolved addresses in an array. Otherwise, returns a single address.
|
|
88
|
-
* @default false
|
|
89
|
-
*/
|
|
90
|
-
all?: boolean;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export default class CacheableLookup {
|
|
94
|
-
constructor(options?: Options);
|
|
95
|
-
/**
|
|
96
|
-
* The DNS servers used to make queries. Can be overridden - doing so will clear the cache.
|
|
97
|
-
*/
|
|
98
|
-
servers: string[];
|
|
99
|
-
/**
|
|
100
|
-
* @see https://nodejs.org/api/dns.html#dns_dns_lookup_hostname_options_callback
|
|
101
|
-
*/
|
|
102
|
-
lookup(hostname: string, family: IPFamily, callback: (error: NodeJS.ErrnoException, address: string, family: IPFamily) => void): void;
|
|
103
|
-
lookup(hostname: string, callback: (error: NodeJS.ErrnoException, address: string, family: IPFamily) => void): void;
|
|
104
|
-
lookup(hostname: string, options: LookupOptions & {all: true}, callback: (error: NodeJS.ErrnoException, result: ReadonlyArray<EntryObject>) => void): void;
|
|
105
|
-
lookup(hostname: string, options: LookupOptions, callback: (error: NodeJS.ErrnoException, address: string, family: IPFamily) => void): void;
|
|
106
|
-
/**
|
|
107
|
-
* The asynchronous version of `dns.lookup(…)`.
|
|
108
|
-
*/
|
|
109
|
-
lookupAsync(hostname: string, options: LookupOptions & {all: true}): Promise<ReadonlyArray<EntryObject>>;
|
|
110
|
-
lookupAsync(hostname: string, options: LookupOptions): Promise<EntryObject>;
|
|
111
|
-
lookupAsync(hostname: string): Promise<EntryObject>;
|
|
112
|
-
lookupAsync(hostname: string, family: IPFamily): Promise<EntryObject>;
|
|
113
|
-
/**
|
|
114
|
-
* An asynchronous function which returns cached DNS lookup entries. This is the base for `lookupAsync(hostname, options)` and `lookup(hostname, options, callback)`.
|
|
115
|
-
*/
|
|
116
|
-
query(hostname: string): Promise<ReadonlyArray<EntryObject>>;
|
|
117
|
-
/**
|
|
118
|
-
* An asynchronous function which makes a new DNS lookup query and updates the database. This is used by `query(hostname, family)` if no entry in the database is present. Returns an array of objects with `address`, `family`, `ttl` and `expires` properties.
|
|
119
|
-
*/
|
|
120
|
-
queryAndCache(hostname: string): Promise<ReadonlyArray<EntryObject>>;
|
|
121
|
-
/**
|
|
122
|
-
* Attaches itself to an Agent instance.
|
|
123
|
-
*/
|
|
124
|
-
install(agent: Agent): void;
|
|
125
|
-
/**
|
|
126
|
-
* Removes itself from an Agent instance.
|
|
127
|
-
*/
|
|
128
|
-
uninstall(agent: Agent): void;
|
|
129
|
-
/**
|
|
130
|
-
* Updates interface info. For example, you need to run this when you plug or unplug your WiFi driver.
|
|
131
|
-
*
|
|
132
|
-
* **Note:** Running `updateInterfaceInfo()` will trigger `clear()` only on network interface removal.
|
|
133
|
-
*/
|
|
134
|
-
updateInterfaceInfo(): void;
|
|
135
|
-
/**
|
|
136
|
-
* Clears the cache for the given hostname. If the hostname argument is not present, the entire cache will be emptied.
|
|
137
|
-
*/
|
|
138
|
-
clear(hostname?: string): void;
|
|
139
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "cacheable-lookup",
|
|
3
|
-
"version": "5.0.4",
|
|
4
|
-
"description": "A cacheable dns.lookup(…) that respects the TTL",
|
|
5
|
-
"engines": {
|
|
6
|
-
"node": ">=10.6.0"
|
|
7
|
-
},
|
|
8
|
-
"files": [
|
|
9
|
-
"source",
|
|
10
|
-
"index.d.ts"
|
|
11
|
-
],
|
|
12
|
-
"main": "source/index.js",
|
|
13
|
-
"types": "index.d.ts",
|
|
14
|
-
"scripts": {
|
|
15
|
-
"test": "xo && nyc --reporter=lcovonly --reporter=text ava && tsd"
|
|
16
|
-
},
|
|
17
|
-
"repository": {
|
|
18
|
-
"type": "git",
|
|
19
|
-
"url": "git+https://github.com/szmarczak/cacheable-lookup.git"
|
|
20
|
-
},
|
|
21
|
-
"keywords": [
|
|
22
|
-
"dns",
|
|
23
|
-
"lookup",
|
|
24
|
-
"cacheable",
|
|
25
|
-
"ttl"
|
|
26
|
-
],
|
|
27
|
-
"author": "Szymon Marczak",
|
|
28
|
-
"license": "MIT",
|
|
29
|
-
"bugs": {
|
|
30
|
-
"url": "https://github.com/szmarczak/cacheable-lookup/issues"
|
|
31
|
-
},
|
|
32
|
-
"homepage": "https://github.com/szmarczak/cacheable-lookup#readme",
|
|
33
|
-
"devDependencies": {
|
|
34
|
-
"@types/keyv": "^3.1.1",
|
|
35
|
-
"ava": "^3.8.2",
|
|
36
|
-
"benchmark": "^2.1.4",
|
|
37
|
-
"coveralls": "^3.0.9",
|
|
38
|
-
"keyv": "^4.0.0",
|
|
39
|
-
"nyc": "^15.0.0",
|
|
40
|
-
"proxyquire": "^2.1.3",
|
|
41
|
-
"tsd": "^0.11.0",
|
|
42
|
-
"quick-lru": "^5.1.0",
|
|
43
|
-
"xo": "^0.25.3"
|
|
44
|
-
}
|
|
45
|
-
}
|
|
@@ -1,436 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
const {
|
|
3
|
-
V4MAPPED,
|
|
4
|
-
ADDRCONFIG,
|
|
5
|
-
ALL,
|
|
6
|
-
promises: {
|
|
7
|
-
Resolver: AsyncResolver
|
|
8
|
-
},
|
|
9
|
-
lookup: dnsLookup
|
|
10
|
-
} = require('dns');
|
|
11
|
-
const {promisify} = require('util');
|
|
12
|
-
const os = require('os');
|
|
13
|
-
|
|
14
|
-
const kCacheableLookupCreateConnection = Symbol('cacheableLookupCreateConnection');
|
|
15
|
-
const kCacheableLookupInstance = Symbol('cacheableLookupInstance');
|
|
16
|
-
const kExpires = Symbol('expires');
|
|
17
|
-
|
|
18
|
-
const supportsALL = typeof ALL === 'number';
|
|
19
|
-
|
|
20
|
-
const verifyAgent = agent => {
|
|
21
|
-
if (!(agent && typeof agent.createConnection === 'function')) {
|
|
22
|
-
throw new Error('Expected an Agent instance as the first argument');
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
const map4to6 = entries => {
|
|
27
|
-
for (const entry of entries) {
|
|
28
|
-
if (entry.family === 6) {
|
|
29
|
-
continue;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
entry.address = `::ffff:${entry.address}`;
|
|
33
|
-
entry.family = 6;
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
const getIfaceInfo = () => {
|
|
38
|
-
let has4 = false;
|
|
39
|
-
let has6 = false;
|
|
40
|
-
|
|
41
|
-
for (const device of Object.values(os.networkInterfaces())) {
|
|
42
|
-
for (const iface of device) {
|
|
43
|
-
if (iface.internal) {
|
|
44
|
-
continue;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
if (iface.family === 'IPv6') {
|
|
48
|
-
has6 = true;
|
|
49
|
-
} else {
|
|
50
|
-
has4 = true;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
if (has4 && has6) {
|
|
54
|
-
return {has4, has6};
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
return {has4, has6};
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
const isIterable = map => {
|
|
63
|
-
return Symbol.iterator in map;
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
const ttl = {ttl: true};
|
|
67
|
-
const all = {all: true};
|
|
68
|
-
|
|
69
|
-
class CacheableLookup {
|
|
70
|
-
constructor({
|
|
71
|
-
cache = new Map(),
|
|
72
|
-
maxTtl = Infinity,
|
|
73
|
-
fallbackDuration = 3600,
|
|
74
|
-
errorTtl = 0.15,
|
|
75
|
-
resolver = new AsyncResolver(),
|
|
76
|
-
lookup = dnsLookup
|
|
77
|
-
} = {}) {
|
|
78
|
-
this.maxTtl = maxTtl;
|
|
79
|
-
this.errorTtl = errorTtl;
|
|
80
|
-
|
|
81
|
-
this._cache = cache;
|
|
82
|
-
this._resolver = resolver;
|
|
83
|
-
this._dnsLookup = promisify(lookup);
|
|
84
|
-
|
|
85
|
-
if (this._resolver instanceof AsyncResolver) {
|
|
86
|
-
this._resolve4 = this._resolver.resolve4.bind(this._resolver);
|
|
87
|
-
this._resolve6 = this._resolver.resolve6.bind(this._resolver);
|
|
88
|
-
} else {
|
|
89
|
-
this._resolve4 = promisify(this._resolver.resolve4.bind(this._resolver));
|
|
90
|
-
this._resolve6 = promisify(this._resolver.resolve6.bind(this._resolver));
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
this._iface = getIfaceInfo();
|
|
94
|
-
|
|
95
|
-
this._pending = {};
|
|
96
|
-
this._nextRemovalTime = false;
|
|
97
|
-
this._hostnamesToFallback = new Set();
|
|
98
|
-
|
|
99
|
-
if (fallbackDuration < 1) {
|
|
100
|
-
this._fallback = false;
|
|
101
|
-
} else {
|
|
102
|
-
this._fallback = true;
|
|
103
|
-
|
|
104
|
-
const interval = setInterval(() => {
|
|
105
|
-
this._hostnamesToFallback.clear();
|
|
106
|
-
}, fallbackDuration * 1000);
|
|
107
|
-
|
|
108
|
-
/* istanbul ignore next: There is no `interval.unref()` when running inside an Electron renderer */
|
|
109
|
-
if (interval.unref) {
|
|
110
|
-
interval.unref();
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
this.lookup = this.lookup.bind(this);
|
|
115
|
-
this.lookupAsync = this.lookupAsync.bind(this);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
set servers(servers) {
|
|
119
|
-
this.clear();
|
|
120
|
-
|
|
121
|
-
this._resolver.setServers(servers);
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
get servers() {
|
|
125
|
-
return this._resolver.getServers();
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
lookup(hostname, options, callback) {
|
|
129
|
-
if (typeof options === 'function') {
|
|
130
|
-
callback = options;
|
|
131
|
-
options = {};
|
|
132
|
-
} else if (typeof options === 'number') {
|
|
133
|
-
options = {
|
|
134
|
-
family: options
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
if (!callback) {
|
|
139
|
-
throw new Error('Callback must be a function.');
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
// eslint-disable-next-line promise/prefer-await-to-then
|
|
143
|
-
this.lookupAsync(hostname, options).then(result => {
|
|
144
|
-
if (options.all) {
|
|
145
|
-
callback(null, result);
|
|
146
|
-
} else {
|
|
147
|
-
callback(null, result.address, result.family, result.expires, result.ttl);
|
|
148
|
-
}
|
|
149
|
-
}, callback);
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
async lookupAsync(hostname, options = {}) {
|
|
153
|
-
if (typeof options === 'number') {
|
|
154
|
-
options = {
|
|
155
|
-
family: options
|
|
156
|
-
};
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
let cached = await this.query(hostname);
|
|
160
|
-
|
|
161
|
-
if (options.family === 6) {
|
|
162
|
-
const filtered = cached.filter(entry => entry.family === 6);
|
|
163
|
-
|
|
164
|
-
if (options.hints & V4MAPPED) {
|
|
165
|
-
if ((supportsALL && options.hints & ALL) || filtered.length === 0) {
|
|
166
|
-
map4to6(cached);
|
|
167
|
-
} else {
|
|
168
|
-
cached = filtered;
|
|
169
|
-
}
|
|
170
|
-
} else {
|
|
171
|
-
cached = filtered;
|
|
172
|
-
}
|
|
173
|
-
} else if (options.family === 4) {
|
|
174
|
-
cached = cached.filter(entry => entry.family === 4);
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
if (options.hints & ADDRCONFIG) {
|
|
178
|
-
const {_iface} = this;
|
|
179
|
-
cached = cached.filter(entry => entry.family === 6 ? _iface.has6 : _iface.has4);
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
if (cached.length === 0) {
|
|
183
|
-
const error = new Error(`cacheableLookup ENOTFOUND ${hostname}`);
|
|
184
|
-
error.code = 'ENOTFOUND';
|
|
185
|
-
error.hostname = hostname;
|
|
186
|
-
|
|
187
|
-
throw error;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
if (options.all) {
|
|
191
|
-
return cached;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
return cached[0];
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
async query(hostname) {
|
|
198
|
-
let cached = await this._cache.get(hostname);
|
|
199
|
-
|
|
200
|
-
if (!cached) {
|
|
201
|
-
const pending = this._pending[hostname];
|
|
202
|
-
|
|
203
|
-
if (pending) {
|
|
204
|
-
cached = await pending;
|
|
205
|
-
} else {
|
|
206
|
-
const newPromise = this.queryAndCache(hostname);
|
|
207
|
-
this._pending[hostname] = newPromise;
|
|
208
|
-
|
|
209
|
-
try {
|
|
210
|
-
cached = await newPromise;
|
|
211
|
-
} finally {
|
|
212
|
-
delete this._pending[hostname];
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
cached = cached.map(entry => {
|
|
218
|
-
return {...entry};
|
|
219
|
-
});
|
|
220
|
-
|
|
221
|
-
return cached;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
async _resolve(hostname) {
|
|
225
|
-
const wrap = async promise => {
|
|
226
|
-
try {
|
|
227
|
-
return await promise;
|
|
228
|
-
} catch (error) {
|
|
229
|
-
if (error.code === 'ENODATA' || error.code === 'ENOTFOUND') {
|
|
230
|
-
return [];
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
throw error;
|
|
234
|
-
}
|
|
235
|
-
};
|
|
236
|
-
|
|
237
|
-
// ANY is unsafe as it doesn't trigger new queries in the underlying server.
|
|
238
|
-
const [A, AAAA] = await Promise.all([
|
|
239
|
-
this._resolve4(hostname, ttl),
|
|
240
|
-
this._resolve6(hostname, ttl)
|
|
241
|
-
].map(promise => wrap(promise)));
|
|
242
|
-
|
|
243
|
-
let aTtl = 0;
|
|
244
|
-
let aaaaTtl = 0;
|
|
245
|
-
let cacheTtl = 0;
|
|
246
|
-
|
|
247
|
-
const now = Date.now();
|
|
248
|
-
|
|
249
|
-
for (const entry of A) {
|
|
250
|
-
entry.family = 4;
|
|
251
|
-
entry.expires = now + (entry.ttl * 1000);
|
|
252
|
-
|
|
253
|
-
aTtl = Math.max(aTtl, entry.ttl);
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
for (const entry of AAAA) {
|
|
257
|
-
entry.family = 6;
|
|
258
|
-
entry.expires = now + (entry.ttl * 1000);
|
|
259
|
-
|
|
260
|
-
aaaaTtl = Math.max(aaaaTtl, entry.ttl);
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
if (A.length > 0) {
|
|
264
|
-
if (AAAA.length > 0) {
|
|
265
|
-
cacheTtl = Math.min(aTtl, aaaaTtl);
|
|
266
|
-
} else {
|
|
267
|
-
cacheTtl = aTtl;
|
|
268
|
-
}
|
|
269
|
-
} else {
|
|
270
|
-
cacheTtl = aaaaTtl;
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
return {
|
|
274
|
-
entries: [
|
|
275
|
-
...A,
|
|
276
|
-
...AAAA
|
|
277
|
-
],
|
|
278
|
-
cacheTtl
|
|
279
|
-
};
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
async _lookup(hostname) {
|
|
283
|
-
try {
|
|
284
|
-
const entries = await this._dnsLookup(hostname, {
|
|
285
|
-
all: true
|
|
286
|
-
});
|
|
287
|
-
|
|
288
|
-
return {
|
|
289
|
-
entries,
|
|
290
|
-
cacheTtl: 0
|
|
291
|
-
};
|
|
292
|
-
} catch (_) {
|
|
293
|
-
return {
|
|
294
|
-
entries: [],
|
|
295
|
-
cacheTtl: 0
|
|
296
|
-
};
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
async _set(hostname, data, cacheTtl) {
|
|
301
|
-
if (this.maxTtl > 0 && cacheTtl > 0) {
|
|
302
|
-
cacheTtl = Math.min(cacheTtl, this.maxTtl) * 1000;
|
|
303
|
-
data[kExpires] = Date.now() + cacheTtl;
|
|
304
|
-
|
|
305
|
-
try {
|
|
306
|
-
await this._cache.set(hostname, data, cacheTtl);
|
|
307
|
-
} catch (error) {
|
|
308
|
-
this.lookupAsync = async () => {
|
|
309
|
-
const cacheError = new Error('Cache Error. Please recreate the CacheableLookup instance.');
|
|
310
|
-
cacheError.cause = error;
|
|
311
|
-
|
|
312
|
-
throw cacheError;
|
|
313
|
-
};
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
if (isIterable(this._cache)) {
|
|
317
|
-
this._tick(cacheTtl);
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
async queryAndCache(hostname) {
|
|
323
|
-
if (this._hostnamesToFallback.has(hostname)) {
|
|
324
|
-
return this._dnsLookup(hostname, all);
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
let query = await this._resolve(hostname);
|
|
328
|
-
|
|
329
|
-
if (query.entries.length === 0 && this._fallback) {
|
|
330
|
-
query = await this._lookup(hostname);
|
|
331
|
-
|
|
332
|
-
if (query.entries.length !== 0) {
|
|
333
|
-
// Use `dns.lookup(...)` for that particular hostname
|
|
334
|
-
this._hostnamesToFallback.add(hostname);
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
const cacheTtl = query.entries.length === 0 ? this.errorTtl : query.cacheTtl;
|
|
339
|
-
await this._set(hostname, query.entries, cacheTtl);
|
|
340
|
-
|
|
341
|
-
return query.entries;
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
_tick(ms) {
|
|
345
|
-
const nextRemovalTime = this._nextRemovalTime;
|
|
346
|
-
|
|
347
|
-
if (!nextRemovalTime || ms < nextRemovalTime) {
|
|
348
|
-
clearTimeout(this._removalTimeout);
|
|
349
|
-
|
|
350
|
-
this._nextRemovalTime = ms;
|
|
351
|
-
|
|
352
|
-
this._removalTimeout = setTimeout(() => {
|
|
353
|
-
this._nextRemovalTime = false;
|
|
354
|
-
|
|
355
|
-
let nextExpiry = Infinity;
|
|
356
|
-
|
|
357
|
-
const now = Date.now();
|
|
358
|
-
|
|
359
|
-
for (const [hostname, entries] of this._cache) {
|
|
360
|
-
const expires = entries[kExpires];
|
|
361
|
-
|
|
362
|
-
if (now >= expires) {
|
|
363
|
-
this._cache.delete(hostname);
|
|
364
|
-
} else if (expires < nextExpiry) {
|
|
365
|
-
nextExpiry = expires;
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
if (nextExpiry !== Infinity) {
|
|
370
|
-
this._tick(nextExpiry - now);
|
|
371
|
-
}
|
|
372
|
-
}, ms);
|
|
373
|
-
|
|
374
|
-
/* istanbul ignore next: There is no `timeout.unref()` when running inside an Electron renderer */
|
|
375
|
-
if (this._removalTimeout.unref) {
|
|
376
|
-
this._removalTimeout.unref();
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
install(agent) {
|
|
382
|
-
verifyAgent(agent);
|
|
383
|
-
|
|
384
|
-
if (kCacheableLookupCreateConnection in agent) {
|
|
385
|
-
throw new Error('CacheableLookup has been already installed');
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
agent[kCacheableLookupCreateConnection] = agent.createConnection;
|
|
389
|
-
agent[kCacheableLookupInstance] = this;
|
|
390
|
-
|
|
391
|
-
agent.createConnection = (options, callback) => {
|
|
392
|
-
if (!('lookup' in options)) {
|
|
393
|
-
options.lookup = this.lookup;
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
return agent[kCacheableLookupCreateConnection](options, callback);
|
|
397
|
-
};
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
uninstall(agent) {
|
|
401
|
-
verifyAgent(agent);
|
|
402
|
-
|
|
403
|
-
if (agent[kCacheableLookupCreateConnection]) {
|
|
404
|
-
if (agent[kCacheableLookupInstance] !== this) {
|
|
405
|
-
throw new Error('The agent is not owned by this CacheableLookup instance');
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
agent.createConnection = agent[kCacheableLookupCreateConnection];
|
|
409
|
-
|
|
410
|
-
delete agent[kCacheableLookupCreateConnection];
|
|
411
|
-
delete agent[kCacheableLookupInstance];
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
updateInterfaceInfo() {
|
|
416
|
-
const {_iface} = this;
|
|
417
|
-
|
|
418
|
-
this._iface = getIfaceInfo();
|
|
419
|
-
|
|
420
|
-
if ((_iface.has4 && !this._iface.has4) || (_iface.has6 && !this._iface.has6)) {
|
|
421
|
-
this._cache.clear();
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
clear(hostname) {
|
|
426
|
-
if (hostname) {
|
|
427
|
-
this._cache.delete(hostname);
|
|
428
|
-
return;
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
this._cache.clear();
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
module.exports = CacheableLookup;
|
|
436
|
-
module.exports.default = CacheableLookup;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2017 Luke Childs
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|