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,37 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "end-of-stream",
|
|
3
|
-
"version": "1.4.4",
|
|
4
|
-
"description": "Call a callback when a readable/writable/duplex stream has completed or failed.",
|
|
5
|
-
"repository": {
|
|
6
|
-
"type": "git",
|
|
7
|
-
"url": "git://github.com/mafintosh/end-of-stream.git"
|
|
8
|
-
},
|
|
9
|
-
"dependencies": {
|
|
10
|
-
"once": "^1.4.0"
|
|
11
|
-
},
|
|
12
|
-
"scripts": {
|
|
13
|
-
"test": "node test.js"
|
|
14
|
-
},
|
|
15
|
-
"files": [
|
|
16
|
-
"index.js"
|
|
17
|
-
],
|
|
18
|
-
"keywords": [
|
|
19
|
-
"stream",
|
|
20
|
-
"streams",
|
|
21
|
-
"callback",
|
|
22
|
-
"finish",
|
|
23
|
-
"close",
|
|
24
|
-
"end",
|
|
25
|
-
"wait"
|
|
26
|
-
],
|
|
27
|
-
"bugs": {
|
|
28
|
-
"url": "https://github.com/mafintosh/end-of-stream/issues"
|
|
29
|
-
},
|
|
30
|
-
"homepage": "https://github.com/mafintosh/end-of-stream",
|
|
31
|
-
"main": "index.js",
|
|
32
|
-
"author": "Mathias Buus <mathiasbuus@gmail.com>",
|
|
33
|
-
"license": "MIT",
|
|
34
|
-
"devDependencies": {
|
|
35
|
-
"tape": "^4.11.0"
|
|
36
|
-
}
|
|
37
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
const {PassThrough: PassThroughStream} = require('stream');
|
|
3
|
-
|
|
4
|
-
module.exports = options => {
|
|
5
|
-
options = {...options};
|
|
6
|
-
|
|
7
|
-
const {array} = options;
|
|
8
|
-
let {encoding} = options;
|
|
9
|
-
const isBuffer = encoding === 'buffer';
|
|
10
|
-
let objectMode = false;
|
|
11
|
-
|
|
12
|
-
if (array) {
|
|
13
|
-
objectMode = !(encoding || isBuffer);
|
|
14
|
-
} else {
|
|
15
|
-
encoding = encoding || 'utf8';
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
if (isBuffer) {
|
|
19
|
-
encoding = null;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const stream = new PassThroughStream({objectMode});
|
|
23
|
-
|
|
24
|
-
if (encoding) {
|
|
25
|
-
stream.setEncoding(encoding);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
let length = 0;
|
|
29
|
-
const chunks = [];
|
|
30
|
-
|
|
31
|
-
stream.on('data', chunk => {
|
|
32
|
-
chunks.push(chunk);
|
|
33
|
-
|
|
34
|
-
if (objectMode) {
|
|
35
|
-
length = chunks.length;
|
|
36
|
-
} else {
|
|
37
|
-
length += chunk.length;
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
stream.getBufferedValue = () => {
|
|
42
|
-
if (array) {
|
|
43
|
-
return chunks;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
return isBuffer ? Buffer.concat(chunks, length) : chunks.join('');
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
stream.getBufferedLength = () => length;
|
|
50
|
-
|
|
51
|
-
return stream;
|
|
52
|
-
};
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
/// <reference types="node"/>
|
|
2
|
-
import {Stream} from 'stream';
|
|
3
|
-
|
|
4
|
-
declare class MaxBufferErrorClass extends Error {
|
|
5
|
-
readonly name: 'MaxBufferError';
|
|
6
|
-
constructor();
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
declare namespace getStream {
|
|
10
|
-
interface Options {
|
|
11
|
-
/**
|
|
12
|
-
Maximum length of the returned string. If it exceeds this value before the stream ends, the promise will be rejected with a `MaxBufferError` error.
|
|
13
|
-
|
|
14
|
-
@default Infinity
|
|
15
|
-
*/
|
|
16
|
-
readonly maxBuffer?: number;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
interface OptionsWithEncoding<EncodingType = BufferEncoding> extends Options {
|
|
20
|
-
/**
|
|
21
|
-
[Encoding](https://nodejs.org/api/buffer.html#buffer_buffer) of the incoming stream.
|
|
22
|
-
|
|
23
|
-
@default 'utf8'
|
|
24
|
-
*/
|
|
25
|
-
readonly encoding?: EncodingType;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
type MaxBufferError = MaxBufferErrorClass;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
declare const getStream: {
|
|
32
|
-
/**
|
|
33
|
-
Get the `stream` as a string.
|
|
34
|
-
|
|
35
|
-
@returns A promise that resolves when the end event fires on the stream, indicating that there is no more data to be read. The stream is switched to flowing mode.
|
|
36
|
-
|
|
37
|
-
@example
|
|
38
|
-
```
|
|
39
|
-
import * as fs from 'fs';
|
|
40
|
-
import getStream = require('get-stream');
|
|
41
|
-
|
|
42
|
-
(async () => {
|
|
43
|
-
const stream = fs.createReadStream('unicorn.txt');
|
|
44
|
-
|
|
45
|
-
console.log(await getStream(stream));
|
|
46
|
-
// ,,))))))));,
|
|
47
|
-
// __)))))))))))))),
|
|
48
|
-
// \|/ -\(((((''''((((((((.
|
|
49
|
-
// -*-==//////(('' . `)))))),
|
|
50
|
-
// /|\ ))| o ;-. '((((( ,(,
|
|
51
|
-
// ( `| / ) ;))))' ,_))^;(~
|
|
52
|
-
// | | | ,))((((_ _____------~~~-. %,;(;(>';'~
|
|
53
|
-
// o_); ; )))(((` ~---~ `:: \ %%~~)(v;(`('~
|
|
54
|
-
// ; ''''```` `: `:::|\,__,%% );`'; ~
|
|
55
|
-
// | _ ) / `:|`----' `-'
|
|
56
|
-
// ______/\/~ | / /
|
|
57
|
-
// /~;;.____/;;' / ___--,-( `;;;/
|
|
58
|
-
// / // _;______;'------~~~~~ /;;/\ /
|
|
59
|
-
// // | | / ; \;;,\
|
|
60
|
-
// (<_ | ; /',/-----' _>
|
|
61
|
-
// \_| ||_ //~;~~~~~~~~~
|
|
62
|
-
// `\_| (,~~
|
|
63
|
-
// \~\
|
|
64
|
-
// ~~
|
|
65
|
-
})();
|
|
66
|
-
```
|
|
67
|
-
*/
|
|
68
|
-
(stream: Stream, options?: getStream.OptionsWithEncoding): Promise<string>;
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
Get the `stream` as a buffer.
|
|
72
|
-
|
|
73
|
-
It honors the `maxBuffer` option as above, but it refers to byte length rather than string length.
|
|
74
|
-
*/
|
|
75
|
-
buffer(
|
|
76
|
-
stream: Stream,
|
|
77
|
-
options?: getStream.OptionsWithEncoding
|
|
78
|
-
): Promise<Buffer>;
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
Get the `stream` as an array of values.
|
|
82
|
-
|
|
83
|
-
It honors both the `maxBuffer` and `encoding` options. The behavior changes slightly based on the encoding chosen:
|
|
84
|
-
|
|
85
|
-
- When `encoding` is unset, it assumes an [object mode stream](https://nodesource.com/blog/understanding-object-streams/) and collects values emitted from `stream` unmodified. In this case `maxBuffer` refers to the number of items in the array (not the sum of their sizes).
|
|
86
|
-
- When `encoding` is set to `buffer`, it collects an array of buffers. `maxBuffer` refers to the summed byte lengths of every buffer in the array.
|
|
87
|
-
- When `encoding` is set to anything else, it collects an array of strings. `maxBuffer` refers to the summed character lengths of every string in the array.
|
|
88
|
-
*/
|
|
89
|
-
array<StreamObjectModeType>(
|
|
90
|
-
stream: Stream,
|
|
91
|
-
options?: getStream.Options
|
|
92
|
-
): Promise<StreamObjectModeType[]>;
|
|
93
|
-
array(
|
|
94
|
-
stream: Stream,
|
|
95
|
-
options: getStream.OptionsWithEncoding<'buffer'>
|
|
96
|
-
): Promise<Buffer[]>;
|
|
97
|
-
array(
|
|
98
|
-
stream: Stream,
|
|
99
|
-
options: getStream.OptionsWithEncoding<BufferEncoding>
|
|
100
|
-
): Promise<string[]>;
|
|
101
|
-
|
|
102
|
-
MaxBufferError: typeof MaxBufferErrorClass;
|
|
103
|
-
|
|
104
|
-
// TODO: Remove this for the next major release
|
|
105
|
-
default: typeof getStream;
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
export = getStream;
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
const {constants: BufferConstants} = require('buffer');
|
|
3
|
-
const pump = require('pump');
|
|
4
|
-
const bufferStream = require('./buffer-stream');
|
|
5
|
-
|
|
6
|
-
class MaxBufferError extends Error {
|
|
7
|
-
constructor() {
|
|
8
|
-
super('maxBuffer exceeded');
|
|
9
|
-
this.name = 'MaxBufferError';
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
async function getStream(inputStream, options) {
|
|
14
|
-
if (!inputStream) {
|
|
15
|
-
return Promise.reject(new Error('Expected a stream'));
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
options = {
|
|
19
|
-
maxBuffer: Infinity,
|
|
20
|
-
...options
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
const {maxBuffer} = options;
|
|
24
|
-
|
|
25
|
-
let stream;
|
|
26
|
-
await new Promise((resolve, reject) => {
|
|
27
|
-
const rejectPromise = error => {
|
|
28
|
-
// Don't retrieve an oversized buffer.
|
|
29
|
-
if (error && stream.getBufferedLength() <= BufferConstants.MAX_LENGTH) {
|
|
30
|
-
error.bufferedData = stream.getBufferedValue();
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
reject(error);
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
stream = pump(inputStream, bufferStream(options), error => {
|
|
37
|
-
if (error) {
|
|
38
|
-
rejectPromise(error);
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
resolve();
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
stream.on('data', () => {
|
|
46
|
-
if (stream.getBufferedLength() > maxBuffer) {
|
|
47
|
-
rejectPromise(new MaxBufferError());
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
return stream.getBufferedValue();
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
module.exports = getStream;
|
|
56
|
-
// TODO: Remove this for the next major release
|
|
57
|
-
module.exports.default = getStream;
|
|
58
|
-
module.exports.buffer = (stream, options) => getStream(stream, {...options, encoding: 'buffer'});
|
|
59
|
-
module.exports.array = (stream, options) => getStream(stream, {...options, array: true});
|
|
60
|
-
module.exports.MaxBufferError = MaxBufferError;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
-
|
|
7
|
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
-
|
|
9
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "get-stream",
|
|
3
|
-
"version": "5.2.0",
|
|
4
|
-
"description": "Get a stream as a string, buffer, or array",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"repository": "sindresorhus/get-stream",
|
|
7
|
-
"funding": "https://github.com/sponsors/sindresorhus",
|
|
8
|
-
"author": {
|
|
9
|
-
"name": "Sindre Sorhus",
|
|
10
|
-
"email": "sindresorhus@gmail.com",
|
|
11
|
-
"url": "https://sindresorhus.com"
|
|
12
|
-
},
|
|
13
|
-
"engines": {
|
|
14
|
-
"node": ">=8"
|
|
15
|
-
},
|
|
16
|
-
"scripts": {
|
|
17
|
-
"test": "xo && ava && tsd"
|
|
18
|
-
},
|
|
19
|
-
"files": [
|
|
20
|
-
"index.js",
|
|
21
|
-
"index.d.ts",
|
|
22
|
-
"buffer-stream.js"
|
|
23
|
-
],
|
|
24
|
-
"keywords": [
|
|
25
|
-
"get",
|
|
26
|
-
"stream",
|
|
27
|
-
"promise",
|
|
28
|
-
"concat",
|
|
29
|
-
"string",
|
|
30
|
-
"text",
|
|
31
|
-
"buffer",
|
|
32
|
-
"read",
|
|
33
|
-
"data",
|
|
34
|
-
"consume",
|
|
35
|
-
"readable",
|
|
36
|
-
"readablestream",
|
|
37
|
-
"array",
|
|
38
|
-
"object"
|
|
39
|
-
],
|
|
40
|
-
"dependencies": {
|
|
41
|
-
"pump": "^3.0.0"
|
|
42
|
-
},
|
|
43
|
-
"devDependencies": {
|
|
44
|
-
"@types/node": "^12.0.7",
|
|
45
|
-
"ava": "^2.0.0",
|
|
46
|
-
"into-stream": "^5.0.0",
|
|
47
|
-
"tsd": "^0.7.2",
|
|
48
|
-
"xo": "^0.24.0"
|
|
49
|
-
}
|
|
50
|
-
}
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
# get-stream [](https://travis-ci.com/github/sindresorhus/get-stream)
|
|
2
|
-
|
|
3
|
-
> Get a stream as a string, buffer, or array
|
|
4
|
-
|
|
5
|
-
## Install
|
|
6
|
-
|
|
7
|
-
```
|
|
8
|
-
$ npm install get-stream
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Usage
|
|
12
|
-
|
|
13
|
-
```js
|
|
14
|
-
const fs = require('fs');
|
|
15
|
-
const getStream = require('get-stream');
|
|
16
|
-
|
|
17
|
-
(async () => {
|
|
18
|
-
const stream = fs.createReadStream('unicorn.txt');
|
|
19
|
-
|
|
20
|
-
console.log(await getStream(stream));
|
|
21
|
-
/*
|
|
22
|
-
,,))))))));,
|
|
23
|
-
__)))))))))))))),
|
|
24
|
-
\|/ -\(((((''''((((((((.
|
|
25
|
-
-*-==//////(('' . `)))))),
|
|
26
|
-
/|\ ))| o ;-. '((((( ,(,
|
|
27
|
-
( `| / ) ;))))' ,_))^;(~
|
|
28
|
-
| | | ,))((((_ _____------~~~-. %,;(;(>';'~
|
|
29
|
-
o_); ; )))(((` ~---~ `:: \ %%~~)(v;(`('~
|
|
30
|
-
; ''''```` `: `:::|\,__,%% );`'; ~
|
|
31
|
-
| _ ) / `:|`----' `-'
|
|
32
|
-
______/\/~ | / /
|
|
33
|
-
/~;;.____/;;' / ___--,-( `;;;/
|
|
34
|
-
/ // _;______;'------~~~~~ /;;/\ /
|
|
35
|
-
// | | / ; \;;,\
|
|
36
|
-
(<_ | ; /',/-----' _>
|
|
37
|
-
\_| ||_ //~;~~~~~~~~~
|
|
38
|
-
`\_| (,~~
|
|
39
|
-
\~\
|
|
40
|
-
~~
|
|
41
|
-
*/
|
|
42
|
-
})();
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
## API
|
|
46
|
-
|
|
47
|
-
The methods returns a promise that resolves when the `end` event fires on the stream, indicating that there is no more data to be read. The stream is switched to flowing mode.
|
|
48
|
-
|
|
49
|
-
### getStream(stream, options?)
|
|
50
|
-
|
|
51
|
-
Get the `stream` as a string.
|
|
52
|
-
|
|
53
|
-
#### options
|
|
54
|
-
|
|
55
|
-
Type: `object`
|
|
56
|
-
|
|
57
|
-
##### encoding
|
|
58
|
-
|
|
59
|
-
Type: `string`\
|
|
60
|
-
Default: `'utf8'`
|
|
61
|
-
|
|
62
|
-
[Encoding](https://nodejs.org/api/buffer.html#buffer_buffer) of the incoming stream.
|
|
63
|
-
|
|
64
|
-
##### maxBuffer
|
|
65
|
-
|
|
66
|
-
Type: `number`\
|
|
67
|
-
Default: `Infinity`
|
|
68
|
-
|
|
69
|
-
Maximum length of the returned string. If it exceeds this value before the stream ends, the promise will be rejected with a `getStream.MaxBufferError` error.
|
|
70
|
-
|
|
71
|
-
### getStream.buffer(stream, options?)
|
|
72
|
-
|
|
73
|
-
Get the `stream` as a buffer.
|
|
74
|
-
|
|
75
|
-
It honors the `maxBuffer` option as above, but it refers to byte length rather than string length.
|
|
76
|
-
|
|
77
|
-
### getStream.array(stream, options?)
|
|
78
|
-
|
|
79
|
-
Get the `stream` as an array of values.
|
|
80
|
-
|
|
81
|
-
It honors both the `maxBuffer` and `encoding` options. The behavior changes slightly based on the encoding chosen:
|
|
82
|
-
|
|
83
|
-
- When `encoding` is unset, it assumes an [object mode stream](https://nodesource.com/blog/understanding-object-streams/) and collects values emitted from `stream` unmodified. In this case `maxBuffer` refers to the number of items in the array (not the sum of their sizes).
|
|
84
|
-
|
|
85
|
-
- When `encoding` is set to `buffer`, it collects an array of buffers. `maxBuffer` refers to the summed byte lengths of every buffer in the array.
|
|
86
|
-
|
|
87
|
-
- When `encoding` is set to anything else, it collects an array of strings. `maxBuffer` refers to the summed character lengths of every string in the array.
|
|
88
|
-
|
|
89
|
-
## Errors
|
|
90
|
-
|
|
91
|
-
If the input stream emits an `error` event, the promise will be rejected with the error. The buffered data will be attached to the `bufferedData` property of the error.
|
|
92
|
-
|
|
93
|
-
```js
|
|
94
|
-
(async () => {
|
|
95
|
-
try {
|
|
96
|
-
await getStream(streamThatErrorsAtTheEnd('unicorn'));
|
|
97
|
-
} catch (error) {
|
|
98
|
-
console.log(error.bufferedData);
|
|
99
|
-
//=> 'unicorn'
|
|
100
|
-
}
|
|
101
|
-
})()
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
## FAQ
|
|
105
|
-
|
|
106
|
-
### How is this different from [`concat-stream`](https://github.com/maxogden/concat-stream)?
|
|
107
|
-
|
|
108
|
-
This module accepts a stream instead of being one and returns a promise instead of using a callback. The API is simpler and it only supports returning a string, buffer, or array. It doesn't have a fragile type inference. You explicitly choose what you want. And it doesn't depend on the huge `readable-stream` package.
|
|
109
|
-
|
|
110
|
-
## Related
|
|
111
|
-
|
|
112
|
-
- [get-stdin](https://github.com/sindresorhus/get-stdin) - Get stdin as a string or buffer
|
|
113
|
-
|
|
114
|
-
---
|
|
115
|
-
|
|
116
|
-
<div align="center">
|
|
117
|
-
<b>
|
|
118
|
-
<a href="https://tidelift.com/subscription/pkg/npm-get-stream?utm_source=npm-get-stream&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
|
|
119
|
-
</b>
|
|
120
|
-
<br>
|
|
121
|
-
<sub>
|
|
122
|
-
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
|
|
123
|
-
</sub>
|
|
124
|
-
</div>
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const types_1 = require("./types");
|
|
4
|
-
function createRejection(error, ...beforeErrorGroups) {
|
|
5
|
-
const promise = (async () => {
|
|
6
|
-
if (error instanceof types_1.RequestError) {
|
|
7
|
-
try {
|
|
8
|
-
for (const hooks of beforeErrorGroups) {
|
|
9
|
-
if (hooks) {
|
|
10
|
-
for (const hook of hooks) {
|
|
11
|
-
// eslint-disable-next-line no-await-in-loop
|
|
12
|
-
error = await hook(error);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
catch (error_) {
|
|
18
|
-
error = error_;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
throw error;
|
|
22
|
-
})();
|
|
23
|
-
const returnPromise = () => promise;
|
|
24
|
-
promise.json = returnPromise;
|
|
25
|
-
promise.text = returnPromise;
|
|
26
|
-
promise.buffer = returnPromise;
|
|
27
|
-
promise.on = returnPromise;
|
|
28
|
-
return promise;
|
|
29
|
-
}
|
|
30
|
-
exports.default = createRejection;
|
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
-
};
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
const events_1 = require("events");
|
|
14
|
-
const is_1 = require("@sindresorhus/is");
|
|
15
|
-
const PCancelable = require("p-cancelable");
|
|
16
|
-
const types_1 = require("./types");
|
|
17
|
-
const parse_body_1 = require("./parse-body");
|
|
18
|
-
const core_1 = require("../core");
|
|
19
|
-
const proxy_events_1 = require("../core/utils/proxy-events");
|
|
20
|
-
const get_buffer_1 = require("../core/utils/get-buffer");
|
|
21
|
-
const is_response_ok_1 = require("../core/utils/is-response-ok");
|
|
22
|
-
const proxiedRequestEvents = [
|
|
23
|
-
'request',
|
|
24
|
-
'response',
|
|
25
|
-
'redirect',
|
|
26
|
-
'uploadProgress',
|
|
27
|
-
'downloadProgress'
|
|
28
|
-
];
|
|
29
|
-
function asPromise(normalizedOptions) {
|
|
30
|
-
let globalRequest;
|
|
31
|
-
let globalResponse;
|
|
32
|
-
const emitter = new events_1.EventEmitter();
|
|
33
|
-
const promise = new PCancelable((resolve, reject, onCancel) => {
|
|
34
|
-
const makeRequest = (retryCount) => {
|
|
35
|
-
const request = new core_1.default(undefined, normalizedOptions);
|
|
36
|
-
request.retryCount = retryCount;
|
|
37
|
-
request._noPipe = true;
|
|
38
|
-
onCancel(() => request.destroy());
|
|
39
|
-
onCancel.shouldReject = false;
|
|
40
|
-
onCancel(() => reject(new types_1.CancelError(request)));
|
|
41
|
-
globalRequest = request;
|
|
42
|
-
request.once('response', async (response) => {
|
|
43
|
-
var _a;
|
|
44
|
-
response.retryCount = retryCount;
|
|
45
|
-
if (response.request.aborted) {
|
|
46
|
-
// Canceled while downloading - will throw a `CancelError` or `TimeoutError` error
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
// Download body
|
|
50
|
-
let rawBody;
|
|
51
|
-
try {
|
|
52
|
-
rawBody = await get_buffer_1.default(request);
|
|
53
|
-
response.rawBody = rawBody;
|
|
54
|
-
}
|
|
55
|
-
catch (_b) {
|
|
56
|
-
// The same error is caught below.
|
|
57
|
-
// See request.once('error')
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
if (request._isAboutToError) {
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
// Parse body
|
|
64
|
-
const contentEncoding = ((_a = response.headers['content-encoding']) !== null && _a !== void 0 ? _a : '').toLowerCase();
|
|
65
|
-
const isCompressed = ['gzip', 'deflate', 'br'].includes(contentEncoding);
|
|
66
|
-
const { options } = request;
|
|
67
|
-
if (isCompressed && !options.decompress) {
|
|
68
|
-
response.body = rawBody;
|
|
69
|
-
}
|
|
70
|
-
else {
|
|
71
|
-
try {
|
|
72
|
-
response.body = parse_body_1.default(response, options.responseType, options.parseJson, options.encoding);
|
|
73
|
-
}
|
|
74
|
-
catch (error) {
|
|
75
|
-
// Fallback to `utf8`
|
|
76
|
-
response.body = rawBody.toString();
|
|
77
|
-
if (is_response_ok_1.isResponseOk(response)) {
|
|
78
|
-
request._beforeError(error);
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
try {
|
|
84
|
-
for (const [index, hook] of options.hooks.afterResponse.entries()) {
|
|
85
|
-
// @ts-expect-error TS doesn't notice that CancelableRequest is a Promise
|
|
86
|
-
// eslint-disable-next-line no-await-in-loop
|
|
87
|
-
response = await hook(response, async (updatedOptions) => {
|
|
88
|
-
const typedOptions = core_1.default.normalizeArguments(undefined, {
|
|
89
|
-
...updatedOptions,
|
|
90
|
-
retry: {
|
|
91
|
-
calculateDelay: () => 0
|
|
92
|
-
},
|
|
93
|
-
throwHttpErrors: false,
|
|
94
|
-
resolveBodyOnly: false
|
|
95
|
-
}, options);
|
|
96
|
-
// Remove any further hooks for that request, because we'll call them anyway.
|
|
97
|
-
// The loop continues. We don't want duplicates (asPromise recursion).
|
|
98
|
-
typedOptions.hooks.afterResponse = typedOptions.hooks.afterResponse.slice(0, index);
|
|
99
|
-
for (const hook of typedOptions.hooks.beforeRetry) {
|
|
100
|
-
// eslint-disable-next-line no-await-in-loop
|
|
101
|
-
await hook(typedOptions);
|
|
102
|
-
}
|
|
103
|
-
const promise = asPromise(typedOptions);
|
|
104
|
-
onCancel(() => {
|
|
105
|
-
promise.catch(() => { });
|
|
106
|
-
promise.cancel();
|
|
107
|
-
});
|
|
108
|
-
return promise;
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
catch (error) {
|
|
113
|
-
request._beforeError(new types_1.RequestError(error.message, error, request));
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
116
|
-
globalResponse = response;
|
|
117
|
-
if (!is_response_ok_1.isResponseOk(response)) {
|
|
118
|
-
request._beforeError(new types_1.HTTPError(response));
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
|
-
request.destroy();
|
|
122
|
-
resolve(request.options.resolveBodyOnly ? response.body : response);
|
|
123
|
-
});
|
|
124
|
-
const onError = (error) => {
|
|
125
|
-
if (promise.isCanceled) {
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
|
-
const { options } = request;
|
|
129
|
-
if (error instanceof types_1.HTTPError && !options.throwHttpErrors) {
|
|
130
|
-
const { response } = error;
|
|
131
|
-
resolve(request.options.resolveBodyOnly ? response.body : response);
|
|
132
|
-
return;
|
|
133
|
-
}
|
|
134
|
-
reject(error);
|
|
135
|
-
};
|
|
136
|
-
request.once('error', onError);
|
|
137
|
-
const previousBody = request.options.body;
|
|
138
|
-
request.once('retry', (newRetryCount, error) => {
|
|
139
|
-
var _a, _b;
|
|
140
|
-
if (previousBody === ((_a = error.request) === null || _a === void 0 ? void 0 : _a.options.body) && is_1.default.nodeStream((_b = error.request) === null || _b === void 0 ? void 0 : _b.options.body)) {
|
|
141
|
-
onError(error);
|
|
142
|
-
return;
|
|
143
|
-
}
|
|
144
|
-
makeRequest(newRetryCount);
|
|
145
|
-
});
|
|
146
|
-
proxy_events_1.default(request, emitter, proxiedRequestEvents);
|
|
147
|
-
};
|
|
148
|
-
makeRequest(0);
|
|
149
|
-
});
|
|
150
|
-
promise.on = (event, fn) => {
|
|
151
|
-
emitter.on(event, fn);
|
|
152
|
-
return promise;
|
|
153
|
-
};
|
|
154
|
-
const shortcut = (responseType) => {
|
|
155
|
-
const newPromise = (async () => {
|
|
156
|
-
// Wait until downloading has ended
|
|
157
|
-
await promise;
|
|
158
|
-
const { options } = globalResponse.request;
|
|
159
|
-
return parse_body_1.default(globalResponse, responseType, options.parseJson, options.encoding);
|
|
160
|
-
})();
|
|
161
|
-
Object.defineProperties(newPromise, Object.getOwnPropertyDescriptors(promise));
|
|
162
|
-
return newPromise;
|
|
163
|
-
};
|
|
164
|
-
promise.json = () => {
|
|
165
|
-
const { headers } = globalRequest.options;
|
|
166
|
-
if (!globalRequest.writableFinished && headers.accept === undefined) {
|
|
167
|
-
headers.accept = 'application/json';
|
|
168
|
-
}
|
|
169
|
-
return shortcut('json');
|
|
170
|
-
};
|
|
171
|
-
promise.buffer = () => shortcut('buffer');
|
|
172
|
-
promise.text = () => shortcut('text');
|
|
173
|
-
return promise;
|
|
174
|
-
}
|
|
175
|
-
exports.default = asPromise;
|
|
176
|
-
__exportStar(require("./types"), exports);
|