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,670 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
const EventEmitter = require('events');
|
|
3
|
-
const tls = require('tls');
|
|
4
|
-
const http2 = require('http2');
|
|
5
|
-
const QuickLRU = require('quick-lru');
|
|
6
|
-
|
|
7
|
-
const kCurrentStreamsCount = Symbol('currentStreamsCount');
|
|
8
|
-
const kRequest = Symbol('request');
|
|
9
|
-
const kOriginSet = Symbol('cachedOriginSet');
|
|
10
|
-
const kGracefullyClosing = Symbol('gracefullyClosing');
|
|
11
|
-
|
|
12
|
-
const nameKeys = [
|
|
13
|
-
// `http2.connect()` options
|
|
14
|
-
'maxDeflateDynamicTableSize',
|
|
15
|
-
'maxSessionMemory',
|
|
16
|
-
'maxHeaderListPairs',
|
|
17
|
-
'maxOutstandingPings',
|
|
18
|
-
'maxReservedRemoteStreams',
|
|
19
|
-
'maxSendHeaderBlockLength',
|
|
20
|
-
'paddingStrategy',
|
|
21
|
-
|
|
22
|
-
// `tls.connect()` options
|
|
23
|
-
'localAddress',
|
|
24
|
-
'path',
|
|
25
|
-
'rejectUnauthorized',
|
|
26
|
-
'minDHSize',
|
|
27
|
-
|
|
28
|
-
// `tls.createSecureContext()` options
|
|
29
|
-
'ca',
|
|
30
|
-
'cert',
|
|
31
|
-
'clientCertEngine',
|
|
32
|
-
'ciphers',
|
|
33
|
-
'key',
|
|
34
|
-
'pfx',
|
|
35
|
-
'servername',
|
|
36
|
-
'minVersion',
|
|
37
|
-
'maxVersion',
|
|
38
|
-
'secureProtocol',
|
|
39
|
-
'crl',
|
|
40
|
-
'honorCipherOrder',
|
|
41
|
-
'ecdhCurve',
|
|
42
|
-
'dhparam',
|
|
43
|
-
'secureOptions',
|
|
44
|
-
'sessionIdContext'
|
|
45
|
-
];
|
|
46
|
-
|
|
47
|
-
const getSortedIndex = (array, value, compare) => {
|
|
48
|
-
let low = 0;
|
|
49
|
-
let high = array.length;
|
|
50
|
-
|
|
51
|
-
while (low < high) {
|
|
52
|
-
const mid = (low + high) >>> 1;
|
|
53
|
-
|
|
54
|
-
/* istanbul ignore next */
|
|
55
|
-
if (compare(array[mid], value)) {
|
|
56
|
-
// This never gets called because we use descending sort. Better to have this anyway.
|
|
57
|
-
low = mid + 1;
|
|
58
|
-
} else {
|
|
59
|
-
high = mid;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
return low;
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
const compareSessions = (a, b) => {
|
|
67
|
-
return a.remoteSettings.maxConcurrentStreams > b.remoteSettings.maxConcurrentStreams;
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
// See https://tools.ietf.org/html/rfc8336
|
|
71
|
-
const closeCoveredSessions = (where, session) => {
|
|
72
|
-
// Clients SHOULD NOT emit new requests on any connection whose Origin
|
|
73
|
-
// Set is a proper subset of another connection's Origin Set, and they
|
|
74
|
-
// SHOULD close it once all outstanding requests are satisfied.
|
|
75
|
-
for (const coveredSession of where) {
|
|
76
|
-
if (
|
|
77
|
-
// The set is a proper subset when its length is less than the other set.
|
|
78
|
-
coveredSession[kOriginSet].length < session[kOriginSet].length &&
|
|
79
|
-
|
|
80
|
-
// And the other set includes all elements of the subset.
|
|
81
|
-
coveredSession[kOriginSet].every(origin => session[kOriginSet].includes(origin)) &&
|
|
82
|
-
|
|
83
|
-
// Makes sure that the session can handle all requests from the covered session.
|
|
84
|
-
coveredSession[kCurrentStreamsCount] + session[kCurrentStreamsCount] <= session.remoteSettings.maxConcurrentStreams
|
|
85
|
-
) {
|
|
86
|
-
// This allows pending requests to finish and prevents making new requests.
|
|
87
|
-
gracefullyClose(coveredSession);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
// This is basically inverted `closeCoveredSessions(...)`.
|
|
93
|
-
const closeSessionIfCovered = (where, coveredSession) => {
|
|
94
|
-
for (const session of where) {
|
|
95
|
-
if (
|
|
96
|
-
coveredSession[kOriginSet].length < session[kOriginSet].length &&
|
|
97
|
-
coveredSession[kOriginSet].every(origin => session[kOriginSet].includes(origin)) &&
|
|
98
|
-
coveredSession[kCurrentStreamsCount] + session[kCurrentStreamsCount] <= session.remoteSettings.maxConcurrentStreams
|
|
99
|
-
) {
|
|
100
|
-
gracefullyClose(coveredSession);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
const getSessions = ({agent, isFree}) => {
|
|
106
|
-
const result = {};
|
|
107
|
-
|
|
108
|
-
// eslint-disable-next-line guard-for-in
|
|
109
|
-
for (const normalizedOptions in agent.sessions) {
|
|
110
|
-
const sessions = agent.sessions[normalizedOptions];
|
|
111
|
-
|
|
112
|
-
const filtered = sessions.filter(session => {
|
|
113
|
-
const result = session[Agent.kCurrentStreamsCount] < session.remoteSettings.maxConcurrentStreams;
|
|
114
|
-
|
|
115
|
-
return isFree ? result : !result;
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
if (filtered.length !== 0) {
|
|
119
|
-
result[normalizedOptions] = filtered;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
return result;
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
const gracefullyClose = session => {
|
|
127
|
-
session[kGracefullyClosing] = true;
|
|
128
|
-
|
|
129
|
-
if (session[kCurrentStreamsCount] === 0) {
|
|
130
|
-
session.close();
|
|
131
|
-
}
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
class Agent extends EventEmitter {
|
|
135
|
-
constructor({timeout = 60000, maxSessions = Infinity, maxFreeSessions = 10, maxCachedTlsSessions = 100} = {}) {
|
|
136
|
-
super();
|
|
137
|
-
|
|
138
|
-
// A session is considered busy when its current streams count
|
|
139
|
-
// is equal to or greater than the `maxConcurrentStreams` value.
|
|
140
|
-
|
|
141
|
-
// A session is considered free when its current streams count
|
|
142
|
-
// is less than the `maxConcurrentStreams` value.
|
|
143
|
-
|
|
144
|
-
// SESSIONS[NORMALIZED_OPTIONS] = [];
|
|
145
|
-
this.sessions = {};
|
|
146
|
-
|
|
147
|
-
// The queue for creating new sessions. It looks like this:
|
|
148
|
-
// QUEUE[NORMALIZED_OPTIONS][NORMALIZED_ORIGIN] = ENTRY_FUNCTION
|
|
149
|
-
//
|
|
150
|
-
// The entry function has `listeners`, `completed` and `destroyed` properties.
|
|
151
|
-
// `listeners` is an array of objects containing `resolve` and `reject` functions.
|
|
152
|
-
// `completed` is a boolean. It's set to true after ENTRY_FUNCTION is executed.
|
|
153
|
-
// `destroyed` is a boolean. If it's set to true, the session will be destroyed if hasn't connected yet.
|
|
154
|
-
this.queue = {};
|
|
155
|
-
|
|
156
|
-
// Each session will use this timeout value.
|
|
157
|
-
this.timeout = timeout;
|
|
158
|
-
|
|
159
|
-
// Max sessions in total
|
|
160
|
-
this.maxSessions = maxSessions;
|
|
161
|
-
|
|
162
|
-
// Max free sessions in total
|
|
163
|
-
// TODO: decreasing `maxFreeSessions` should close some sessions
|
|
164
|
-
this.maxFreeSessions = maxFreeSessions;
|
|
165
|
-
|
|
166
|
-
this._freeSessionsCount = 0;
|
|
167
|
-
this._sessionsCount = 0;
|
|
168
|
-
|
|
169
|
-
// We don't support push streams by default.
|
|
170
|
-
this.settings = {
|
|
171
|
-
enablePush: false
|
|
172
|
-
};
|
|
173
|
-
|
|
174
|
-
// Reusing TLS sessions increases performance.
|
|
175
|
-
this.tlsSessionCache = new QuickLRU({maxSize: maxCachedTlsSessions});
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
static normalizeOrigin(url, servername) {
|
|
179
|
-
if (typeof url === 'string') {
|
|
180
|
-
url = new URL(url);
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
if (servername && url.hostname !== servername) {
|
|
184
|
-
url.hostname = servername;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
return url.origin;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
normalizeOptions(options) {
|
|
191
|
-
let normalized = '';
|
|
192
|
-
|
|
193
|
-
if (options) {
|
|
194
|
-
for (const key of nameKeys) {
|
|
195
|
-
if (options[key]) {
|
|
196
|
-
normalized += `:${options[key]}`;
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
return normalized;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
_tryToCreateNewSession(normalizedOptions, normalizedOrigin) {
|
|
205
|
-
if (!(normalizedOptions in this.queue) || !(normalizedOrigin in this.queue[normalizedOptions])) {
|
|
206
|
-
return;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
const item = this.queue[normalizedOptions][normalizedOrigin];
|
|
210
|
-
|
|
211
|
-
// The entry function can be run only once.
|
|
212
|
-
// BUG: The session may be never created when:
|
|
213
|
-
// - the first condition is false AND
|
|
214
|
-
// - this function is never called with the same arguments in the future.
|
|
215
|
-
if (this._sessionsCount < this.maxSessions && !item.completed) {
|
|
216
|
-
item.completed = true;
|
|
217
|
-
|
|
218
|
-
item();
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
getSession(origin, options, listeners) {
|
|
223
|
-
return new Promise((resolve, reject) => {
|
|
224
|
-
if (Array.isArray(listeners)) {
|
|
225
|
-
listeners = [...listeners];
|
|
226
|
-
|
|
227
|
-
// Resolve the current promise ASAP, we're just moving the listeners.
|
|
228
|
-
// They will be executed at a different time.
|
|
229
|
-
resolve();
|
|
230
|
-
} else {
|
|
231
|
-
listeners = [{resolve, reject}];
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
const normalizedOptions = this.normalizeOptions(options);
|
|
235
|
-
const normalizedOrigin = Agent.normalizeOrigin(origin, options && options.servername);
|
|
236
|
-
|
|
237
|
-
if (normalizedOrigin === undefined) {
|
|
238
|
-
for (const {reject} of listeners) {
|
|
239
|
-
reject(new TypeError('The `origin` argument needs to be a string or an URL object'));
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
return;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
if (normalizedOptions in this.sessions) {
|
|
246
|
-
const sessions = this.sessions[normalizedOptions];
|
|
247
|
-
|
|
248
|
-
let maxConcurrentStreams = -1;
|
|
249
|
-
let currentStreamsCount = -1;
|
|
250
|
-
let optimalSession;
|
|
251
|
-
|
|
252
|
-
// We could just do this.sessions[normalizedOptions].find(...) but that isn't optimal.
|
|
253
|
-
// Additionally, we are looking for session which has biggest current pending streams count.
|
|
254
|
-
for (const session of sessions) {
|
|
255
|
-
const sessionMaxConcurrentStreams = session.remoteSettings.maxConcurrentStreams;
|
|
256
|
-
|
|
257
|
-
if (sessionMaxConcurrentStreams < maxConcurrentStreams) {
|
|
258
|
-
break;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
if (session[kOriginSet].includes(normalizedOrigin)) {
|
|
262
|
-
const sessionCurrentStreamsCount = session[kCurrentStreamsCount];
|
|
263
|
-
|
|
264
|
-
if (
|
|
265
|
-
sessionCurrentStreamsCount >= sessionMaxConcurrentStreams ||
|
|
266
|
-
session[kGracefullyClosing] ||
|
|
267
|
-
// Unfortunately the `close` event isn't called immediately,
|
|
268
|
-
// so `session.destroyed` is `true`, but `session.closed` is `false`.
|
|
269
|
-
session.destroyed
|
|
270
|
-
) {
|
|
271
|
-
continue;
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
// We only need set this once.
|
|
275
|
-
if (!optimalSession) {
|
|
276
|
-
maxConcurrentStreams = sessionMaxConcurrentStreams;
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
// We're looking for the session which has biggest current pending stream count,
|
|
280
|
-
// in order to minimalize the amount of active sessions.
|
|
281
|
-
if (sessionCurrentStreamsCount > currentStreamsCount) {
|
|
282
|
-
optimalSession = session;
|
|
283
|
-
currentStreamsCount = sessionCurrentStreamsCount;
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
if (optimalSession) {
|
|
289
|
-
/* istanbul ignore next: safety check */
|
|
290
|
-
if (listeners.length !== 1) {
|
|
291
|
-
for (const {reject} of listeners) {
|
|
292
|
-
const error = new Error(
|
|
293
|
-
`Expected the length of listeners to be 1, got ${listeners.length}.\n` +
|
|
294
|
-
'Please report this to https://github.com/szmarczak/http2-wrapper/'
|
|
295
|
-
);
|
|
296
|
-
|
|
297
|
-
reject(error);
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
return;
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
listeners[0].resolve(optimalSession);
|
|
304
|
-
return;
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
if (normalizedOptions in this.queue) {
|
|
309
|
-
if (normalizedOrigin in this.queue[normalizedOptions]) {
|
|
310
|
-
// There's already an item in the queue, just attach ourselves to it.
|
|
311
|
-
this.queue[normalizedOptions][normalizedOrigin].listeners.push(...listeners);
|
|
312
|
-
|
|
313
|
-
// This shouldn't be executed here.
|
|
314
|
-
// See the comment inside _tryToCreateNewSession.
|
|
315
|
-
this._tryToCreateNewSession(normalizedOptions, normalizedOrigin);
|
|
316
|
-
return;
|
|
317
|
-
}
|
|
318
|
-
} else {
|
|
319
|
-
this.queue[normalizedOptions] = {};
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
// The entry must be removed from the queue IMMEDIATELY when:
|
|
323
|
-
// 1. the session connects successfully,
|
|
324
|
-
// 2. an error occurs.
|
|
325
|
-
const removeFromQueue = () => {
|
|
326
|
-
// Our entry can be replaced. We cannot remove the new one.
|
|
327
|
-
if (normalizedOptions in this.queue && this.queue[normalizedOptions][normalizedOrigin] === entry) {
|
|
328
|
-
delete this.queue[normalizedOptions][normalizedOrigin];
|
|
329
|
-
|
|
330
|
-
if (Object.keys(this.queue[normalizedOptions]).length === 0) {
|
|
331
|
-
delete this.queue[normalizedOptions];
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
};
|
|
335
|
-
|
|
336
|
-
// The main logic is here
|
|
337
|
-
const entry = () => {
|
|
338
|
-
const name = `${normalizedOrigin}:${normalizedOptions}`;
|
|
339
|
-
let receivedSettings = false;
|
|
340
|
-
|
|
341
|
-
try {
|
|
342
|
-
const session = http2.connect(origin, {
|
|
343
|
-
createConnection: this.createConnection,
|
|
344
|
-
settings: this.settings,
|
|
345
|
-
session: this.tlsSessionCache.get(name),
|
|
346
|
-
...options
|
|
347
|
-
});
|
|
348
|
-
session[kCurrentStreamsCount] = 0;
|
|
349
|
-
session[kGracefullyClosing] = false;
|
|
350
|
-
|
|
351
|
-
const isFree = () => session[kCurrentStreamsCount] < session.remoteSettings.maxConcurrentStreams;
|
|
352
|
-
let wasFree = true;
|
|
353
|
-
|
|
354
|
-
session.socket.once('session', tlsSession => {
|
|
355
|
-
this.tlsSessionCache.set(name, tlsSession);
|
|
356
|
-
});
|
|
357
|
-
|
|
358
|
-
session.once('error', error => {
|
|
359
|
-
// Listeners are empty when the session successfully connected.
|
|
360
|
-
for (const {reject} of listeners) {
|
|
361
|
-
reject(error);
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
// The connection got broken, purge the cache.
|
|
365
|
-
this.tlsSessionCache.delete(name);
|
|
366
|
-
});
|
|
367
|
-
|
|
368
|
-
session.setTimeout(this.timeout, () => {
|
|
369
|
-
// Terminates all streams owned by this session.
|
|
370
|
-
// TODO: Maybe the streams should have a "Session timed out" error?
|
|
371
|
-
session.destroy();
|
|
372
|
-
});
|
|
373
|
-
|
|
374
|
-
session.once('close', () => {
|
|
375
|
-
if (receivedSettings) {
|
|
376
|
-
// 1. If it wasn't free then no need to decrease because
|
|
377
|
-
// it has been decreased already in session.request().
|
|
378
|
-
// 2. `stream.once('close')` won't increment the count
|
|
379
|
-
// because the session is already closed.
|
|
380
|
-
if (wasFree) {
|
|
381
|
-
this._freeSessionsCount--;
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
this._sessionsCount--;
|
|
385
|
-
|
|
386
|
-
// This cannot be moved to the stream logic,
|
|
387
|
-
// because there may be a session that hadn't made a single request.
|
|
388
|
-
const where = this.sessions[normalizedOptions];
|
|
389
|
-
where.splice(where.indexOf(session), 1);
|
|
390
|
-
|
|
391
|
-
if (where.length === 0) {
|
|
392
|
-
delete this.sessions[normalizedOptions];
|
|
393
|
-
}
|
|
394
|
-
} else {
|
|
395
|
-
// Broken connection
|
|
396
|
-
const error = new Error('Session closed without receiving a SETTINGS frame');
|
|
397
|
-
error.code = 'HTTP2WRAPPER_NOSETTINGS';
|
|
398
|
-
|
|
399
|
-
for (const {reject} of listeners) {
|
|
400
|
-
reject(error);
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
removeFromQueue();
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
// There may be another session awaiting.
|
|
407
|
-
this._tryToCreateNewSession(normalizedOptions, normalizedOrigin);
|
|
408
|
-
});
|
|
409
|
-
|
|
410
|
-
// Iterates over the queue and processes listeners.
|
|
411
|
-
const processListeners = () => {
|
|
412
|
-
if (!(normalizedOptions in this.queue) || !isFree()) {
|
|
413
|
-
return;
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
for (const origin of session[kOriginSet]) {
|
|
417
|
-
if (origin in this.queue[normalizedOptions]) {
|
|
418
|
-
const {listeners} = this.queue[normalizedOptions][origin];
|
|
419
|
-
|
|
420
|
-
// Prevents session overloading.
|
|
421
|
-
while (listeners.length !== 0 && isFree()) {
|
|
422
|
-
// We assume `resolve(...)` calls `request(...)` *directly*,
|
|
423
|
-
// otherwise the session will get overloaded.
|
|
424
|
-
listeners.shift().resolve(session);
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
const where = this.queue[normalizedOptions];
|
|
428
|
-
if (where[origin].listeners.length === 0) {
|
|
429
|
-
delete where[origin];
|
|
430
|
-
|
|
431
|
-
if (Object.keys(where).length === 0) {
|
|
432
|
-
delete this.queue[normalizedOptions];
|
|
433
|
-
break;
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
|
|
437
|
-
// We're no longer free, no point in continuing.
|
|
438
|
-
if (!isFree()) {
|
|
439
|
-
break;
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
}
|
|
443
|
-
};
|
|
444
|
-
|
|
445
|
-
// The Origin Set cannot shrink. No need to check if it suddenly became covered by another one.
|
|
446
|
-
session.on('origin', () => {
|
|
447
|
-
session[kOriginSet] = session.originSet;
|
|
448
|
-
|
|
449
|
-
if (!isFree()) {
|
|
450
|
-
// The session is full.
|
|
451
|
-
return;
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
processListeners();
|
|
455
|
-
|
|
456
|
-
// Close covered sessions (if possible).
|
|
457
|
-
closeCoveredSessions(this.sessions[normalizedOptions], session);
|
|
458
|
-
});
|
|
459
|
-
|
|
460
|
-
session.once('remoteSettings', () => {
|
|
461
|
-
// Fix Node.js bug preventing the process from exiting
|
|
462
|
-
session.ref();
|
|
463
|
-
session.unref();
|
|
464
|
-
|
|
465
|
-
this._sessionsCount++;
|
|
466
|
-
|
|
467
|
-
// The Agent could have been destroyed already.
|
|
468
|
-
if (entry.destroyed) {
|
|
469
|
-
const error = new Error('Agent has been destroyed');
|
|
470
|
-
|
|
471
|
-
for (const listener of listeners) {
|
|
472
|
-
listener.reject(error);
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
session.destroy();
|
|
476
|
-
return;
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
session[kOriginSet] = session.originSet;
|
|
480
|
-
|
|
481
|
-
{
|
|
482
|
-
const where = this.sessions;
|
|
483
|
-
|
|
484
|
-
if (normalizedOptions in where) {
|
|
485
|
-
const sessions = where[normalizedOptions];
|
|
486
|
-
sessions.splice(getSortedIndex(sessions, session, compareSessions), 0, session);
|
|
487
|
-
} else {
|
|
488
|
-
where[normalizedOptions] = [session];
|
|
489
|
-
}
|
|
490
|
-
}
|
|
491
|
-
|
|
492
|
-
this._freeSessionsCount += 1;
|
|
493
|
-
receivedSettings = true;
|
|
494
|
-
|
|
495
|
-
this.emit('session', session);
|
|
496
|
-
|
|
497
|
-
processListeners();
|
|
498
|
-
removeFromQueue();
|
|
499
|
-
|
|
500
|
-
// TODO: Close last recently used (or least used?) session
|
|
501
|
-
if (session[kCurrentStreamsCount] === 0 && this._freeSessionsCount > this.maxFreeSessions) {
|
|
502
|
-
session.close();
|
|
503
|
-
}
|
|
504
|
-
|
|
505
|
-
// Check if we haven't managed to execute all listeners.
|
|
506
|
-
if (listeners.length !== 0) {
|
|
507
|
-
// Request for a new session with predefined listeners.
|
|
508
|
-
this.getSession(normalizedOrigin, options, listeners);
|
|
509
|
-
listeners.length = 0;
|
|
510
|
-
}
|
|
511
|
-
|
|
512
|
-
// `session.remoteSettings.maxConcurrentStreams` might get increased
|
|
513
|
-
session.on('remoteSettings', () => {
|
|
514
|
-
processListeners();
|
|
515
|
-
|
|
516
|
-
// In case the Origin Set changes
|
|
517
|
-
closeCoveredSessions(this.sessions[normalizedOptions], session);
|
|
518
|
-
});
|
|
519
|
-
});
|
|
520
|
-
|
|
521
|
-
// Shim `session.request()` in order to catch all streams
|
|
522
|
-
session[kRequest] = session.request;
|
|
523
|
-
session.request = (headers, streamOptions) => {
|
|
524
|
-
if (session[kGracefullyClosing]) {
|
|
525
|
-
throw new Error('The session is gracefully closing. No new streams are allowed.');
|
|
526
|
-
}
|
|
527
|
-
|
|
528
|
-
const stream = session[kRequest](headers, streamOptions);
|
|
529
|
-
|
|
530
|
-
// The process won't exit until the session is closed or all requests are gone.
|
|
531
|
-
session.ref();
|
|
532
|
-
|
|
533
|
-
++session[kCurrentStreamsCount];
|
|
534
|
-
|
|
535
|
-
if (session[kCurrentStreamsCount] === session.remoteSettings.maxConcurrentStreams) {
|
|
536
|
-
this._freeSessionsCount--;
|
|
537
|
-
}
|
|
538
|
-
|
|
539
|
-
stream.once('close', () => {
|
|
540
|
-
wasFree = isFree();
|
|
541
|
-
|
|
542
|
-
--session[kCurrentStreamsCount];
|
|
543
|
-
|
|
544
|
-
if (!session.destroyed && !session.closed) {
|
|
545
|
-
closeSessionIfCovered(this.sessions[normalizedOptions], session);
|
|
546
|
-
|
|
547
|
-
if (isFree() && !session.closed) {
|
|
548
|
-
if (!wasFree) {
|
|
549
|
-
this._freeSessionsCount++;
|
|
550
|
-
|
|
551
|
-
wasFree = true;
|
|
552
|
-
}
|
|
553
|
-
|
|
554
|
-
const isEmpty = session[kCurrentStreamsCount] === 0;
|
|
555
|
-
|
|
556
|
-
if (isEmpty) {
|
|
557
|
-
session.unref();
|
|
558
|
-
}
|
|
559
|
-
|
|
560
|
-
if (
|
|
561
|
-
isEmpty &&
|
|
562
|
-
(
|
|
563
|
-
this._freeSessionsCount > this.maxFreeSessions ||
|
|
564
|
-
session[kGracefullyClosing]
|
|
565
|
-
)
|
|
566
|
-
) {
|
|
567
|
-
session.close();
|
|
568
|
-
} else {
|
|
569
|
-
closeCoveredSessions(this.sessions[normalizedOptions], session);
|
|
570
|
-
processListeners();
|
|
571
|
-
}
|
|
572
|
-
}
|
|
573
|
-
}
|
|
574
|
-
});
|
|
575
|
-
|
|
576
|
-
return stream;
|
|
577
|
-
};
|
|
578
|
-
} catch (error) {
|
|
579
|
-
for (const listener of listeners) {
|
|
580
|
-
listener.reject(error);
|
|
581
|
-
}
|
|
582
|
-
|
|
583
|
-
removeFromQueue();
|
|
584
|
-
}
|
|
585
|
-
};
|
|
586
|
-
|
|
587
|
-
entry.listeners = listeners;
|
|
588
|
-
entry.completed = false;
|
|
589
|
-
entry.destroyed = false;
|
|
590
|
-
|
|
591
|
-
this.queue[normalizedOptions][normalizedOrigin] = entry;
|
|
592
|
-
this._tryToCreateNewSession(normalizedOptions, normalizedOrigin);
|
|
593
|
-
});
|
|
594
|
-
}
|
|
595
|
-
|
|
596
|
-
request(origin, options, headers, streamOptions) {
|
|
597
|
-
return new Promise((resolve, reject) => {
|
|
598
|
-
this.getSession(origin, options, [{
|
|
599
|
-
reject,
|
|
600
|
-
resolve: session => {
|
|
601
|
-
try {
|
|
602
|
-
resolve(session.request(headers, streamOptions));
|
|
603
|
-
} catch (error) {
|
|
604
|
-
reject(error);
|
|
605
|
-
}
|
|
606
|
-
}
|
|
607
|
-
}]);
|
|
608
|
-
});
|
|
609
|
-
}
|
|
610
|
-
|
|
611
|
-
createConnection(origin, options) {
|
|
612
|
-
return Agent.connect(origin, options);
|
|
613
|
-
}
|
|
614
|
-
|
|
615
|
-
static connect(origin, options) {
|
|
616
|
-
options.ALPNProtocols = ['h2'];
|
|
617
|
-
|
|
618
|
-
const port = origin.port || 443;
|
|
619
|
-
const host = origin.hostname || origin.host;
|
|
620
|
-
|
|
621
|
-
if (typeof options.servername === 'undefined') {
|
|
622
|
-
options.servername = host;
|
|
623
|
-
}
|
|
624
|
-
|
|
625
|
-
return tls.connect(port, host, options);
|
|
626
|
-
}
|
|
627
|
-
|
|
628
|
-
closeFreeSessions() {
|
|
629
|
-
for (const sessions of Object.values(this.sessions)) {
|
|
630
|
-
for (const session of sessions) {
|
|
631
|
-
if (session[kCurrentStreamsCount] === 0) {
|
|
632
|
-
session.close();
|
|
633
|
-
}
|
|
634
|
-
}
|
|
635
|
-
}
|
|
636
|
-
}
|
|
637
|
-
|
|
638
|
-
destroy(reason) {
|
|
639
|
-
for (const sessions of Object.values(this.sessions)) {
|
|
640
|
-
for (const session of sessions) {
|
|
641
|
-
session.destroy(reason);
|
|
642
|
-
}
|
|
643
|
-
}
|
|
644
|
-
|
|
645
|
-
for (const entriesOfAuthority of Object.values(this.queue)) {
|
|
646
|
-
for (const entry of Object.values(entriesOfAuthority)) {
|
|
647
|
-
entry.destroyed = true;
|
|
648
|
-
}
|
|
649
|
-
}
|
|
650
|
-
|
|
651
|
-
// New requests should NOT attach to destroyed sessions
|
|
652
|
-
this.queue = {};
|
|
653
|
-
}
|
|
654
|
-
|
|
655
|
-
get freeSessions() {
|
|
656
|
-
return getSessions({agent: this, isFree: true});
|
|
657
|
-
}
|
|
658
|
-
|
|
659
|
-
get busySessions() {
|
|
660
|
-
return getSessions({agent: this, isFree: false});
|
|
661
|
-
}
|
|
662
|
-
}
|
|
663
|
-
|
|
664
|
-
Agent.kCurrentStreamsCount = kCurrentStreamsCount;
|
|
665
|
-
Agent.kGracefullyClosing = kGracefullyClosing;
|
|
666
|
-
|
|
667
|
-
module.exports = {
|
|
668
|
-
Agent,
|
|
669
|
-
globalAgent: new Agent()
|
|
670
|
-
};
|