@relative-ci/core 5.2.2 → 5.3.0-alpha.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/lib/cjs/__/@actions/github/__/@octokit/auth-token/dist-bundle/index.js +57 -0
- package/lib/cjs/__/@actions/github/__/@octokit/auth-token/dist-bundle/index.js.map +1 -0
- package/lib/cjs/__/@actions/github/__/@octokit/core/dist-src/index.js +144 -0
- package/lib/cjs/__/@actions/github/__/@octokit/core/dist-src/index.js.map +1 -0
- package/lib/cjs/__/@actions/github/__/@octokit/core/dist-src/version.js +6 -0
- package/lib/cjs/__/@actions/github/__/@octokit/core/dist-src/version.js.map +1 -0
- package/lib/cjs/__/@actions/github/__/@octokit/endpoint/dist-bundle/index.js +349 -0
- package/lib/cjs/__/@actions/github/__/@octokit/endpoint/dist-bundle/index.js.map +1 -0
- package/lib/cjs/__/@actions/github/__/@octokit/graphql/dist-bundle/index.js +125 -0
- package/lib/cjs/__/@actions/github/__/@octokit/graphql/dist-bundle/index.js.map +1 -0
- package/lib/cjs/__/@actions/github/__/@octokit/plugin-paginate-rest/dist-bundle/index.js +417 -0
- package/lib/cjs/__/@actions/github/__/@octokit/plugin-paginate-rest/dist-bundle/index.js.map +1 -0
- package/lib/cjs/__/@actions/github/__/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js +128 -0
- package/lib/cjs/__/@actions/github/__/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js.map +1 -0
- package/lib/cjs/__/@actions/github/__/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js +2295 -0
- package/lib/cjs/__/@actions/github/__/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js.map +1 -0
- package/lib/cjs/__/@actions/github/__/@octokit/plugin-rest-endpoint-methods/dist-src/index.js +24 -0
- package/lib/cjs/__/@actions/github/__/@octokit/plugin-rest-endpoint-methods/dist-src/index.js.map +1 -0
- package/lib/cjs/__/@actions/github/__/@octokit/plugin-rest-endpoint-methods/dist-src/version.js +6 -0
- package/lib/cjs/__/@actions/github/__/@octokit/plugin-rest-endpoint-methods/dist-src/version.js.map +1 -0
- package/lib/cjs/__/@actions/github/__/@octokit/request/dist-bundle/index.js +199 -0
- package/lib/cjs/__/@actions/github/__/@octokit/request/dist-bundle/index.js.map +1 -0
- package/lib/cjs/__/@actions/github/__/@octokit/request-error/dist-src/index.js +43 -0
- package/lib/cjs/__/@actions/github/__/@octokit/request-error/dist-src/index.js.map +1 -0
- package/lib/cjs/__/@actions/github/__/before-after-hook/index.js +41 -0
- package/lib/cjs/__/@actions/github/__/before-after-hook/index.js.map +1 -0
- package/lib/cjs/__/@actions/github/__/before-after-hook/lib/add.js +51 -0
- package/lib/cjs/__/@actions/github/__/before-after-hook/lib/add.js.map +1 -0
- package/lib/cjs/__/@actions/github/__/before-after-hook/lib/register.js +32 -0
- package/lib/cjs/__/@actions/github/__/before-after-hook/lib/register.js.map +1 -0
- package/lib/cjs/__/@actions/github/__/before-after-hook/lib/remove.js +24 -0
- package/lib/cjs/__/@actions/github/__/before-after-hook/lib/remove.js.map +1 -0
- package/lib/cjs/__/@actions/github/__/universal-user-agent/index.js +18 -0
- package/lib/cjs/__/@actions/github/__/universal-user-agent/index.js.map +1 -0
- package/lib/cjs/__/@actions/github/lib/context.js +76 -0
- package/lib/cjs/__/@actions/github/lib/context.js.map +1 -0
- package/lib/cjs/__/@actions/github/lib/github.js +66 -0
- package/lib/cjs/__/@actions/github/lib/github.js.map +1 -0
- package/lib/cjs/__/@actions/github/lib/internal/utils.js +94 -0
- package/lib/cjs/__/@actions/github/lib/internal/utils.js.map +1 -0
- package/lib/cjs/__/@actions/github/lib/utils.js +89 -0
- package/lib/cjs/__/@actions/github/lib/utils.js.map +1 -0
- package/lib/cjs/__/@actions/http-client/lib/index.js +760 -0
- package/lib/cjs/__/@actions/http-client/lib/index.js.map +1 -0
- package/lib/cjs/__/@actions/http-client/lib/proxy.js +107 -0
- package/lib/cjs/__/@actions/http-client/lib/proxy.js.map +1 -0
- package/lib/cjs/__/@fastify/busboy/deps/dicer/lib/Dicer.js +236 -0
- package/lib/cjs/__/@fastify/busboy/deps/dicer/lib/Dicer.js.map +1 -0
- package/lib/cjs/__/@fastify/busboy/deps/dicer/lib/HeaderParser.js +122 -0
- package/lib/cjs/__/@fastify/busboy/deps/dicer/lib/HeaderParser.js.map +1 -0
- package/lib/cjs/__/@fastify/busboy/deps/dicer/lib/PartStream.js +33 -0
- package/lib/cjs/__/@fastify/busboy/deps/dicer/lib/PartStream.js.map +1 -0
- package/lib/cjs/__/@fastify/busboy/deps/streamsearch/sbmh.js +248 -0
- package/lib/cjs/__/@fastify/busboy/deps/streamsearch/sbmh.js.map +1 -0
- package/lib/cjs/__/@fastify/busboy/lib/main.js +109 -0
- package/lib/cjs/__/@fastify/busboy/lib/main.js.map +1 -0
- package/lib/cjs/__/@fastify/busboy/lib/types/multipart.js +331 -0
- package/lib/cjs/__/@fastify/busboy/lib/types/multipart.js.map +1 -0
- package/lib/cjs/__/@fastify/busboy/lib/types/urlencoded.js +206 -0
- package/lib/cjs/__/@fastify/busboy/lib/types/urlencoded.js.map +1 -0
- package/lib/cjs/__/@fastify/busboy/lib/utils/Decoder.js +66 -0
- package/lib/cjs/__/@fastify/busboy/lib/utils/Decoder.js.map +1 -0
- package/lib/cjs/__/@fastify/busboy/lib/utils/basename.js +26 -0
- package/lib/cjs/__/@fastify/busboy/lib/utils/basename.js.map +1 -0
- package/lib/cjs/__/@fastify/busboy/lib/utils/decodeText.js +126 -0
- package/lib/cjs/__/@fastify/busboy/lib/utils/decodeText.js.map +1 -0
- package/lib/cjs/__/@fastify/busboy/lib/utils/getLimit.js +28 -0
- package/lib/cjs/__/@fastify/busboy/lib/utils/getLimit.js.map +1 -0
- package/lib/cjs/__/@fastify/busboy/lib/utils/parseParams.js +211 -0
- package/lib/cjs/__/@fastify/busboy/lib/utils/parseParams.js.map +1 -0
- package/lib/cjs/__/cross-spawn/index.js +1 -1
- package/lib/cjs/__/env-ci/__/execa/index.js +3 -3
- package/lib/cjs/__/env-ci/__/execa/index.js.map +1 -1
- package/lib/cjs/__/env-ci/__/execa/lib/stream.js +1 -1
- package/lib/cjs/__/env-ci/__/execa/lib/verbose.js +2 -2
- package/lib/cjs/__/env-ci/__/execa/lib/verbose.js.map +1 -1
- package/lib/cjs/__/env-ci/__/npm-run-path/index.js +3 -3
- package/lib/cjs/__/env-ci/__/npm-run-path/index.js.map +1 -1
- package/lib/cjs/__/fast-content-type-parse/index.js +182 -0
- package/lib/cjs/__/fast-content-type-parse/index.js.map +1 -0
- package/lib/cjs/__/java-properties/dist-node/index.js +1 -1
- package/lib/cjs/__/path-key/index.js +1 -1
- package/lib/cjs/__/tunnel/index.js +16 -0
- package/lib/cjs/__/tunnel/index.js.map +1 -0
- package/lib/cjs/__/tunnel/lib/tunnel.js +289 -0
- package/lib/cjs/__/tunnel/lib/tunnel.js.map +1 -0
- package/lib/cjs/__/undici/index.js +212 -0
- package/lib/cjs/__/undici/index.js.map +1 -0
- package/lib/cjs/__/undici/lib/agent.js +169 -0
- package/lib/cjs/__/undici/lib/agent.js.map +1 -0
- package/lib/cjs/__/undici/lib/api/abort-signal.js +70 -0
- package/lib/cjs/__/undici/lib/api/abort-signal.js.map +1 -0
- package/lib/cjs/__/undici/lib/api/api-connect.js +125 -0
- package/lib/cjs/__/undici/lib/api/api-connect.js.map +1 -0
- package/lib/cjs/__/undici/lib/api/api-pipeline.js +274 -0
- package/lib/cjs/__/undici/lib/api/api-pipeline.js.map +1 -0
- package/lib/cjs/__/undici/lib/api/api-request.js +203 -0
- package/lib/cjs/__/undici/lib/api/api-request.js.map +1 -0
- package/lib/cjs/__/undici/lib/api/api-stream.js +244 -0
- package/lib/cjs/__/undici/lib/api/api-stream.js.map +1 -0
- package/lib/cjs/__/undici/lib/api/api-upgrade.js +128 -0
- package/lib/cjs/__/undici/lib/api/api-upgrade.js.map +1 -0
- package/lib/cjs/__/undici/lib/api/index.js +25 -0
- package/lib/cjs/__/undici/lib/api/index.js.map +1 -0
- package/lib/cjs/__/undici/lib/api/readable.js +342 -0
- package/lib/cjs/__/undici/lib/api/readable.js.map +1 -0
- package/lib/cjs/__/undici/lib/api/util.js +67 -0
- package/lib/cjs/__/undici/lib/api/util.js.map +1 -0
- package/lib/cjs/__/undici/lib/balanced-pool.js +208 -0
- package/lib/cjs/__/undici/lib/balanced-pool.js.map +1 -0
- package/lib/cjs/__/undici/lib/cache/cache.js +867 -0
- package/lib/cjs/__/undici/lib/cache/cache.js.map +1 -0
- package/lib/cjs/__/undici/lib/cache/cachestorage.js +161 -0
- package/lib/cjs/__/undici/lib/cache/cachestorage.js.map +1 -0
- package/lib/cjs/__/undici/lib/cache/symbols.js +19 -0
- package/lib/cjs/__/undici/lib/cache/symbols.js.map +1 -0
- package/lib/cjs/__/undici/lib/cache/util.js +69 -0
- package/lib/cjs/__/undici/lib/cache/util.js.map +1 -0
- package/lib/cjs/__/undici/lib/client.js +2314 -0
- package/lib/cjs/__/undici/lib/client.js.map +1 -0
- package/lib/cjs/__/undici/lib/compat/dispatcher-weakref.js +63 -0
- package/lib/cjs/__/undici/lib/compat/dispatcher-weakref.js.map +1 -0
- package/lib/cjs/__/undici/lib/cookies/constants.js +24 -0
- package/lib/cjs/__/undici/lib/cookies/constants.js.map +1 -0
- package/lib/cjs/__/undici/lib/cookies/index.js +200 -0
- package/lib/cjs/__/undici/lib/cookies/index.js.map +1 -0
- package/lib/cjs/__/undici/lib/cookies/parse.js +338 -0
- package/lib/cjs/__/undici/lib/cookies/parse.js.map +1 -0
- package/lib/cjs/__/undici/lib/cookies/util.js +286 -0
- package/lib/cjs/__/undici/lib/cookies/util.js.map +1 -0
- package/lib/cjs/__/undici/lib/core/connect.js +214 -0
- package/lib/cjs/__/undici/lib/core/connect.js.map +1 -0
- package/lib/cjs/__/undici/lib/core/constants.js +130 -0
- package/lib/cjs/__/undici/lib/core/constants.js.map +1 -0
- package/lib/cjs/__/undici/lib/core/errors.js +242 -0
- package/lib/cjs/__/undici/lib/core/errors.js.map +1 -0
- package/lib/cjs/__/undici/lib/core/request.js +521 -0
- package/lib/cjs/__/undici/lib/core/request.js.map +1 -0
- package/lib/cjs/__/undici/lib/core/symbols.js +76 -0
- package/lib/cjs/__/undici/lib/core/symbols.js.map +1 -0
- package/lib/cjs/__/undici/lib/core/util.js +557 -0
- package/lib/cjs/__/undici/lib/core/util.js.map +1 -0
- package/lib/cjs/__/undici/lib/dispatcher-base.js +208 -0
- package/lib/cjs/__/undici/lib/dispatcher-base.js.map +1 -0
- package/lib/cjs/__/undici/lib/dispatcher.js +37 -0
- package/lib/cjs/__/undici/lib/dispatcher.js.map +1 -0
- package/lib/cjs/__/undici/lib/fetch/body.js +647 -0
- package/lib/cjs/__/undici/lib/fetch/body.js.map +1 -0
- package/lib/cjs/__/undici/lib/fetch/constants.js +169 -0
- package/lib/cjs/__/undici/lib/fetch/constants.js.map +1 -0
- package/lib/cjs/__/undici/lib/fetch/dataURL.js +649 -0
- package/lib/cjs/__/undici/lib/fetch/dataURL.js.map +1 -0
- package/lib/cjs/__/undici/lib/fetch/file.js +369 -0
- package/lib/cjs/__/undici/lib/fetch/file.js.map +1 -0
- package/lib/cjs/__/undici/lib/fetch/formdata.js +287 -0
- package/lib/cjs/__/undici/lib/fetch/formdata.js.map +1 -0
- package/lib/cjs/__/undici/lib/fetch/global.js +52 -0
- package/lib/cjs/__/undici/lib/fetch/global.js.map +1 -0
- package/lib/cjs/__/undici/lib/fetch/headers.js +609 -0
- package/lib/cjs/__/undici/lib/fetch/headers.js.map +1 -0
- package/lib/cjs/__/undici/lib/fetch/index.js +2114 -0
- package/lib/cjs/__/undici/lib/fetch/index.js.map +1 -0
- package/lib/cjs/__/undici/lib/fetch/request.js +979 -0
- package/lib/cjs/__/undici/lib/fetch/request.js.map +1 -0
- package/lib/cjs/__/undici/lib/fetch/response.js +604 -0
- package/lib/cjs/__/undici/lib/fetch/response.js.map +1 -0
- package/lib/cjs/__/undici/lib/fetch/symbols.js +22 -0
- package/lib/cjs/__/undici/lib/fetch/symbols.js.map +1 -0
- package/lib/cjs/__/undici/lib/fetch/util.js +1170 -0
- package/lib/cjs/__/undici/lib/fetch/util.js.map +1 -0
- package/lib/cjs/__/undici/lib/fetch/webidl.js +665 -0
- package/lib/cjs/__/undici/lib/fetch/webidl.js.map +1 -0
- package/lib/cjs/__/undici/lib/fileapi/encoding.js +302 -0
- package/lib/cjs/__/undici/lib/fileapi/encoding.js.map +1 -0
- package/lib/cjs/__/undici/lib/fileapi/filereader.js +361 -0
- package/lib/cjs/__/undici/lib/fileapi/filereader.js.map +1 -0
- package/lib/cjs/__/undici/lib/fileapi/progressevent.js +92 -0
- package/lib/cjs/__/undici/lib/fileapi/progressevent.js.map +1 -0
- package/lib/cjs/__/undici/lib/fileapi/symbols.js +22 -0
- package/lib/cjs/__/undici/lib/fileapi/symbols.js.map +1 -0
- package/lib/cjs/__/undici/lib/fileapi/util.js +419 -0
- package/lib/cjs/__/undici/lib/fileapi/util.js.map +1 -0
- package/lib/cjs/__/undici/lib/global.js +47 -0
- package/lib/cjs/__/undici/lib/global.js.map +1 -0
- package/lib/cjs/__/undici/lib/handler/DecoratorHandler.js +47 -0
- package/lib/cjs/__/undici/lib/handler/DecoratorHandler.js.map +1 -0
- package/lib/cjs/__/undici/lib/handler/RedirectHandler.js +226 -0
- package/lib/cjs/__/undici/lib/handler/RedirectHandler.js.map +1 -0
- package/lib/cjs/__/undici/lib/handler/RetryHandler.js +358 -0
- package/lib/cjs/__/undici/lib/handler/RetryHandler.js.map +1 -0
- package/lib/cjs/__/undici/lib/interceptor/redirectInterceptor.js +35 -0
- package/lib/cjs/__/undici/lib/interceptor/redirectInterceptor.js.map +1 -0
- package/lib/cjs/__/undici/lib/llhttp/constants.js +288 -0
- package/lib/cjs/__/undici/lib/llhttp/constants.js.map +1 -0
- package/lib/cjs/__/undici/lib/llhttp/llhttp-wasm.js +14 -0
- package/lib/cjs/__/undici/lib/llhttp/llhttp-wasm.js.map +1 -0
- package/lib/cjs/__/undici/lib/llhttp/llhttp_simd-wasm.js +14 -0
- package/lib/cjs/__/undici/lib/llhttp/llhttp_simd-wasm.js.map +1 -0
- package/lib/cjs/__/undici/lib/llhttp/utils.js +28 -0
- package/lib/cjs/__/undici/lib/llhttp/utils.js.map +1 -0
- package/lib/cjs/__/undici/lib/mock/mock-agent.js +194 -0
- package/lib/cjs/__/undici/lib/mock/mock-agent.js.map +1 -0
- package/lib/cjs/__/undici/lib/mock/mock-client.js +83 -0
- package/lib/cjs/__/undici/lib/mock/mock-client.js.map +1 -0
- package/lib/cjs/__/undici/lib/mock/mock-errors.js +31 -0
- package/lib/cjs/__/undici/lib/mock/mock-errors.js.map +1 -0
- package/lib/cjs/__/undici/lib/mock/mock-interceptor.js +223 -0
- package/lib/cjs/__/undici/lib/mock/mock-interceptor.js.map +1 -0
- package/lib/cjs/__/undici/lib/mock/mock-pool.js +83 -0
- package/lib/cjs/__/undici/lib/mock/mock-pool.js.map +1 -0
- package/lib/cjs/__/undici/lib/mock/mock-symbols.js +35 -0
- package/lib/cjs/__/undici/lib/mock/mock-symbols.js.map +1 -0
- package/lib/cjs/__/undici/lib/mock/mock-utils.js +374 -0
- package/lib/cjs/__/undici/lib/mock/mock-utils.js.map +1 -0
- package/lib/cjs/__/undici/lib/mock/pending-interceptors-formatter.js +60 -0
- package/lib/cjs/__/undici/lib/mock/pending-interceptors-formatter.js.map +1 -0
- package/lib/cjs/__/undici/lib/mock/pluralizer.js +41 -0
- package/lib/cjs/__/undici/lib/mock/pluralizer.js.map +1 -0
- package/lib/cjs/__/undici/lib/node/fixed-queue.js +129 -0
- package/lib/cjs/__/undici/lib/node/fixed-queue.js.map +1 -0
- package/lib/cjs/__/undici/lib/pool-base.js +211 -0
- package/lib/cjs/__/undici/lib/pool-base.js.map +1 -0
- package/lib/cjs/__/undici/lib/pool-stats.js +49 -0
- package/lib/cjs/__/undici/lib/pool-stats.js.map +1 -0
- package/lib/cjs/__/undici/lib/pool.js +127 -0
- package/lib/cjs/__/undici/lib/pool.js.map +1 -0
- package/lib/cjs/__/undici/lib/proxy-agent.js +213 -0
- package/lib/cjs/__/undici/lib/proxy-agent.js.map +1 -0
- package/lib/cjs/__/undici/lib/timers.js +109 -0
- package/lib/cjs/__/undici/lib/timers.js.map +1 -0
- package/lib/cjs/__/undici/lib/websocket/connection.js +318 -0
- package/lib/cjs/__/undici/lib/websocket/connection.js.map +1 -0
- package/lib/cjs/__/undici/lib/websocket/constants.js +63 -0
- package/lib/cjs/__/undici/lib/websocket/constants.js.map +1 -0
- package/lib/cjs/__/undici/lib/websocket/events.js +323 -0
- package/lib/cjs/__/undici/lib/websocket/events.js.map +1 -0
- package/lib/cjs/__/undici/lib/websocket/frame.js +87 -0
- package/lib/cjs/__/undici/lib/websocket/frame.js.map +1 -0
- package/lib/cjs/__/undici/lib/websocket/receiver.js +368 -0
- package/lib/cjs/__/undici/lib/websocket/receiver.js.map +1 -0
- package/lib/cjs/__/undici/lib/websocket/symbols.js +24 -0
- package/lib/cjs/__/undici/lib/websocket/symbols.js.map +1 -0
- package/lib/cjs/__/undici/lib/websocket/util.js +216 -0
- package/lib/cjs/__/undici/lib/websocket/util.js.map +1 -0
- package/lib/cjs/__/undici/lib/websocket/websocket.js +668 -0
- package/lib/cjs/__/undici/lib/websocket/websocket.js.map +1 -0
- package/lib/cjs/_virtual/_commonjsHelpers.js +30 -0
- package/lib/cjs/_virtual/_commonjsHelpers.js.map +1 -1
- package/lib/cjs/_virtual/api-request.js +6 -0
- package/lib/cjs/_virtual/api-request.js.map +1 -0
- package/lib/cjs/_virtual/constants.js +6 -0
- package/lib/cjs/_virtual/constants.js.map +1 -0
- package/lib/cjs/_virtual/context.js +6 -0
- package/lib/cjs/_virtual/context.js.map +1 -0
- package/lib/cjs/_virtual/github.js +8 -0
- package/lib/cjs/_virtual/github.js.map +1 -0
- package/lib/cjs/_virtual/github2.js +6 -0
- package/lib/cjs/_virtual/github2.js.map +1 -0
- package/lib/cjs/_virtual/index10.js +6 -0
- package/lib/cjs/_virtual/index10.js.map +1 -0
- package/lib/cjs/_virtual/index11.js +6 -0
- package/lib/cjs/_virtual/index11.js.map +1 -0
- package/lib/cjs/_virtual/index12.js +6 -0
- package/lib/cjs/_virtual/index12.js.map +1 -0
- package/lib/cjs/_virtual/index13.js +6 -0
- package/lib/cjs/_virtual/index13.js.map +1 -0
- package/lib/cjs/_virtual/index14.js +6 -0
- package/lib/cjs/_virtual/index14.js.map +1 -0
- package/lib/cjs/_virtual/index2.js +5 -2
- package/lib/cjs/_virtual/index2.js.map +1 -1
- package/lib/cjs/_virtual/index3.js +3 -4
- package/lib/cjs/_virtual/index3.js.map +1 -1
- package/lib/cjs/_virtual/index4.js +5 -2
- package/lib/cjs/_virtual/index4.js.map +1 -1
- package/lib/cjs/_virtual/index5.js +2 -2
- package/lib/cjs/_virtual/index6.js +6 -2
- package/lib/cjs/_virtual/index6.js.map +1 -1
- package/lib/cjs/_virtual/index7.js +6 -0
- package/lib/cjs/_virtual/index7.js.map +1 -0
- package/lib/cjs/_virtual/index8.js +6 -0
- package/lib/cjs/_virtual/index8.js.map +1 -0
- package/lib/cjs/_virtual/index9.js +8 -0
- package/lib/cjs/_virtual/index9.js.map +1 -0
- package/lib/cjs/_virtual/main.js +6 -0
- package/lib/cjs/_virtual/main.js.map +1 -0
- package/lib/cjs/_virtual/mock-interceptor.js +6 -0
- package/lib/cjs/_virtual/mock-interceptor.js.map +1 -0
- package/lib/cjs/_virtual/proxy.js +6 -0
- package/lib/cjs/_virtual/proxy.js.map +1 -0
- package/lib/cjs/_virtual/tunnel.js +6 -0
- package/lib/cjs/_virtual/tunnel.js.map +1 -0
- package/lib/cjs/_virtual/utils.js +6 -0
- package/lib/cjs/_virtual/utils.js.map +1 -0
- package/lib/cjs/_virtual/utils2.js +6 -0
- package/lib/cjs/_virtual/utils2.js.map +1 -0
- package/lib/cjs/_virtual/utils3.js +6 -0
- package/lib/cjs/_virtual/utils3.js.map +1 -0
- package/lib/cjs/artifacts/filter-artifacts.js.map +1 -1
- package/lib/cjs/env/ci-env.js +6 -1
- package/lib/cjs/env/ci-env.js.map +1 -1
- package/lib/cjs/env/load.js +1 -1
- package/lib/cjs/env/load.js.map +1 -1
- package/lib/cjs/env/service/github.js +3 -22
- package/lib/cjs/env/service/github.js.map +1 -1
- package/lib/cjs/ingest/ingest.js +4 -4
- package/lib/cjs/ingest/ingest.js.map +1 -1
- package/lib/cjs/locales/en.js.map +1 -1
- package/lib/esm/__/@actions/github/__/@octokit/auth-token/dist-bundle/index.js +55 -0
- package/lib/esm/__/@actions/github/__/@octokit/auth-token/dist-bundle/index.js.map +1 -0
- package/lib/esm/__/@actions/github/__/@octokit/core/dist-src/index.js +142 -0
- package/lib/esm/__/@actions/github/__/@octokit/core/dist-src/index.js.map +1 -0
- package/lib/esm/__/@actions/github/__/@octokit/core/dist-src/version.js +4 -0
- package/lib/esm/__/@actions/github/__/@octokit/core/dist-src/version.js.map +1 -0
- package/lib/esm/__/@actions/github/__/@octokit/endpoint/dist-bundle/index.js +347 -0
- package/lib/esm/__/@actions/github/__/@octokit/endpoint/dist-bundle/index.js.map +1 -0
- package/lib/esm/__/@actions/github/__/@octokit/graphql/dist-bundle/index.js +122 -0
- package/lib/esm/__/@actions/github/__/@octokit/graphql/dist-bundle/index.js.map +1 -0
- package/lib/esm/__/@actions/github/__/@octokit/plugin-paginate-rest/dist-bundle/index.js +412 -0
- package/lib/esm/__/@actions/github/__/@octokit/plugin-paginate-rest/dist-bundle/index.js.map +1 -0
- package/lib/esm/__/@actions/github/__/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js +126 -0
- package/lib/esm/__/@actions/github/__/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js.map +1 -0
- package/lib/esm/__/@actions/github/__/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js +2293 -0
- package/lib/esm/__/@actions/github/__/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js.map +1 -0
- package/lib/esm/__/@actions/github/__/@octokit/plugin-rest-endpoint-methods/dist-src/index.js +21 -0
- package/lib/esm/__/@actions/github/__/@octokit/plugin-rest-endpoint-methods/dist-src/index.js.map +1 -0
- package/lib/esm/__/@actions/github/__/@octokit/plugin-rest-endpoint-methods/dist-src/version.js +4 -0
- package/lib/esm/__/@actions/github/__/@octokit/plugin-rest-endpoint-methods/dist-src/version.js.map +1 -0
- package/lib/esm/__/@actions/github/__/@octokit/request/dist-bundle/index.js +197 -0
- package/lib/esm/__/@actions/github/__/@octokit/request/dist-bundle/index.js.map +1 -0
- package/lib/esm/__/@actions/github/__/@octokit/request-error/dist-src/index.js +41 -0
- package/lib/esm/__/@actions/github/__/@octokit/request-error/dist-src/index.js.map +1 -0
- package/lib/esm/__/@actions/github/__/before-after-hook/index.js +39 -0
- package/lib/esm/__/@actions/github/__/before-after-hook/index.js.map +1 -0
- package/lib/esm/__/@actions/github/__/before-after-hook/lib/add.js +49 -0
- package/lib/esm/__/@actions/github/__/before-after-hook/lib/add.js.map +1 -0
- package/lib/esm/__/@actions/github/__/before-after-hook/lib/register.js +30 -0
- package/lib/esm/__/@actions/github/__/before-after-hook/lib/register.js.map +1 -0
- package/lib/esm/__/@actions/github/__/before-after-hook/lib/remove.js +22 -0
- package/lib/esm/__/@actions/github/__/before-after-hook/lib/remove.js.map +1 -0
- package/lib/esm/__/@actions/github/__/universal-user-agent/index.js +16 -0
- package/lib/esm/__/@actions/github/__/universal-user-agent/index.js.map +1 -0
- package/lib/esm/__/@actions/github/lib/context.js +69 -0
- package/lib/esm/__/@actions/github/lib/context.js.map +1 -0
- package/lib/esm/__/@actions/github/lib/github.js +64 -0
- package/lib/esm/__/@actions/github/lib/github.js.map +1 -0
- package/lib/esm/__/@actions/github/lib/internal/utils.js +92 -0
- package/lib/esm/__/@actions/github/lib/internal/utils.js.map +1 -0
- package/lib/esm/__/@actions/github/lib/utils.js +87 -0
- package/lib/esm/__/@actions/github/lib/utils.js.map +1 -0
- package/lib/esm/__/@actions/http-client/lib/index.js +753 -0
- package/lib/esm/__/@actions/http-client/lib/index.js.map +1 -0
- package/lib/esm/__/@actions/http-client/lib/proxy.js +105 -0
- package/lib/esm/__/@actions/http-client/lib/proxy.js.map +1 -0
- package/lib/esm/__/@fastify/busboy/deps/dicer/lib/Dicer.js +229 -0
- package/lib/esm/__/@fastify/busboy/deps/dicer/lib/Dicer.js.map +1 -0
- package/lib/esm/__/@fastify/busboy/deps/dicer/lib/HeaderParser.js +115 -0
- package/lib/esm/__/@fastify/busboy/deps/dicer/lib/HeaderParser.js.map +1 -0
- package/lib/esm/__/@fastify/busboy/deps/dicer/lib/PartStream.js +26 -0
- package/lib/esm/__/@fastify/busboy/deps/dicer/lib/PartStream.js.map +1 -0
- package/lib/esm/__/@fastify/busboy/deps/streamsearch/sbmh.js +241 -0
- package/lib/esm/__/@fastify/busboy/deps/streamsearch/sbmh.js.map +1 -0
- package/lib/esm/__/@fastify/busboy/lib/main.js +102 -0
- package/lib/esm/__/@fastify/busboy/lib/main.js.map +1 -0
- package/lib/esm/__/@fastify/busboy/lib/types/multipart.js +324 -0
- package/lib/esm/__/@fastify/busboy/lib/types/multipart.js.map +1 -0
- package/lib/esm/__/@fastify/busboy/lib/types/urlencoded.js +204 -0
- package/lib/esm/__/@fastify/busboy/lib/types/urlencoded.js.map +1 -0
- package/lib/esm/__/@fastify/busboy/lib/utils/Decoder.js +64 -0
- package/lib/esm/__/@fastify/busboy/lib/utils/Decoder.js.map +1 -0
- package/lib/esm/__/@fastify/busboy/lib/utils/basename.js +24 -0
- package/lib/esm/__/@fastify/busboy/lib/utils/basename.js.map +1 -0
- package/lib/esm/__/@fastify/busboy/lib/utils/decodeText.js +124 -0
- package/lib/esm/__/@fastify/busboy/lib/utils/decodeText.js.map +1 -0
- package/lib/esm/__/@fastify/busboy/lib/utils/getLimit.js +26 -0
- package/lib/esm/__/@fastify/busboy/lib/utils/getLimit.js.map +1 -0
- package/lib/esm/__/@fastify/busboy/lib/utils/parseParams.js +209 -0
- package/lib/esm/__/@fastify/busboy/lib/utils/parseParams.js.map +1 -0
- package/lib/esm/__/cross-spawn/index.js +1 -1
- package/lib/esm/__/env-ci/__/execa/index.js +1 -1
- package/lib/esm/__/env-ci/__/execa/lib/stream.js +1 -1
- package/lib/esm/__/fast-content-type-parse/index.js +180 -0
- package/lib/esm/__/fast-content-type-parse/index.js.map +1 -0
- package/lib/esm/__/java-properties/dist-node/index.js +1 -1
- package/lib/esm/__/path-key/index.js +1 -1
- package/lib/esm/__/tunnel/index.js +14 -0
- package/lib/esm/__/tunnel/index.js.map +1 -0
- package/lib/esm/__/tunnel/lib/tunnel.js +279 -0
- package/lib/esm/__/tunnel/lib/tunnel.js.map +1 -0
- package/lib/esm/__/undici/index.js +210 -0
- package/lib/esm/__/undici/index.js.map +1 -0
- package/lib/esm/__/undici/lib/agent.js +167 -0
- package/lib/esm/__/undici/lib/agent.js.map +1 -0
- package/lib/esm/__/undici/lib/api/abort-signal.js +68 -0
- package/lib/esm/__/undici/lib/api/abort-signal.js.map +1 -0
- package/lib/esm/__/undici/lib/api/api-connect.js +119 -0
- package/lib/esm/__/undici/lib/api/api-connect.js.map +1 -0
- package/lib/esm/__/undici/lib/api/api-pipeline.js +266 -0
- package/lib/esm/__/undici/lib/api/api-pipeline.js.map +1 -0
- package/lib/esm/__/undici/lib/api/api-request.js +197 -0
- package/lib/esm/__/undici/lib/api/api-request.js.map +1 -0
- package/lib/esm/__/undici/lib/api/api-stream.js +237 -0
- package/lib/esm/__/undici/lib/api/api-stream.js.map +1 -0
- package/lib/esm/__/undici/lib/api/api-upgrade.js +121 -0
- package/lib/esm/__/undici/lib/api/api-upgrade.js.map +1 -0
- package/lib/esm/__/undici/lib/api/index.js +23 -0
- package/lib/esm/__/undici/lib/api/index.js.map +1 -0
- package/lib/esm/__/undici/lib/api/readable.js +335 -0
- package/lib/esm/__/undici/lib/api/readable.js.map +1 -0
- package/lib/esm/__/undici/lib/api/util.js +61 -0
- package/lib/esm/__/undici/lib/api/util.js.map +1 -0
- package/lib/esm/__/undici/lib/balanced-pool.js +206 -0
- package/lib/esm/__/undici/lib/balanced-pool.js.map +1 -0
- package/lib/esm/__/undici/lib/cache/cache.js +861 -0
- package/lib/esm/__/undici/lib/cache/cache.js.map +1 -0
- package/lib/esm/__/undici/lib/cache/cachestorage.js +159 -0
- package/lib/esm/__/undici/lib/cache/cachestorage.js.map +1 -0
- package/lib/esm/__/undici/lib/cache/symbols.js +17 -0
- package/lib/esm/__/undici/lib/cache/symbols.js.map +1 -0
- package/lib/esm/__/undici/lib/cache/util.js +63 -0
- package/lib/esm/__/undici/lib/cache/util.js.map +1 -0
- package/lib/esm/__/undici/lib/client.js +2305 -0
- package/lib/esm/__/undici/lib/client.js.map +1 -0
- package/lib/esm/__/undici/lib/compat/dispatcher-weakref.js +61 -0
- package/lib/esm/__/undici/lib/compat/dispatcher-weakref.js.map +1 -0
- package/lib/esm/__/undici/lib/cookies/constants.js +22 -0
- package/lib/esm/__/undici/lib/cookies/constants.js.map +1 -0
- package/lib/esm/__/undici/lib/cookies/index.js +198 -0
- package/lib/esm/__/undici/lib/cookies/index.js.map +1 -0
- package/lib/esm/__/undici/lib/cookies/parse.js +332 -0
- package/lib/esm/__/undici/lib/cookies/parse.js.map +1 -0
- package/lib/esm/__/undici/lib/cookies/util.js +284 -0
- package/lib/esm/__/undici/lib/cookies/util.js.map +1 -0
- package/lib/esm/__/undici/lib/core/connect.js +206 -0
- package/lib/esm/__/undici/lib/core/connect.js.map +1 -0
- package/lib/esm/__/undici/lib/core/constants.js +128 -0
- package/lib/esm/__/undici/lib/core/constants.js.map +1 -0
- package/lib/esm/__/undici/lib/core/errors.js +240 -0
- package/lib/esm/__/undici/lib/core/errors.js.map +1 -0
- package/lib/esm/__/undici/lib/core/request.js +515 -0
- package/lib/esm/__/undici/lib/core/request.js.map +1 -0
- package/lib/esm/__/undici/lib/core/symbols.js +74 -0
- package/lib/esm/__/undici/lib/core/symbols.js.map +1 -0
- package/lib/esm/__/undici/lib/core/util.js +544 -0
- package/lib/esm/__/undici/lib/core/util.js.map +1 -0
- package/lib/esm/__/undici/lib/dispatcher-base.js +206 -0
- package/lib/esm/__/undici/lib/dispatcher-base.js.map +1 -0
- package/lib/esm/__/undici/lib/dispatcher.js +31 -0
- package/lib/esm/__/undici/lib/dispatcher.js.map +1 -0
- package/lib/esm/__/undici/lib/fetch/body.js +638 -0
- package/lib/esm/__/undici/lib/fetch/body.js.map +1 -0
- package/lib/esm/__/undici/lib/fetch/constants.js +163 -0
- package/lib/esm/__/undici/lib/fetch/constants.js.map +1 -0
- package/lib/esm/__/undici/lib/fetch/dataURL.js +642 -0
- package/lib/esm/__/undici/lib/fetch/dataURL.js.map +1 -0
- package/lib/esm/__/undici/lib/fetch/file.js +362 -0
- package/lib/esm/__/undici/lib/fetch/file.js.map +1 -0
- package/lib/esm/__/undici/lib/fetch/formdata.js +281 -0
- package/lib/esm/__/undici/lib/fetch/formdata.js.map +1 -0
- package/lib/esm/__/undici/lib/fetch/global.js +50 -0
- package/lib/esm/__/undici/lib/fetch/global.js.map +1 -0
- package/lib/esm/__/undici/lib/fetch/headers.js +602 -0
- package/lib/esm/__/undici/lib/fetch/headers.js.map +1 -0
- package/lib/esm/__/undici/lib/fetch/index.js +2102 -0
- package/lib/esm/__/undici/lib/fetch/index.js.map +1 -0
- package/lib/esm/__/undici/lib/fetch/request.js +971 -0
- package/lib/esm/__/undici/lib/fetch/request.js.map +1 -0
- package/lib/esm/__/undici/lib/fetch/response.js +596 -0
- package/lib/esm/__/undici/lib/fetch/response.js.map +1 -0
- package/lib/esm/__/undici/lib/fetch/symbols.js +20 -0
- package/lib/esm/__/undici/lib/fetch/symbols.js.map +1 -0
- package/lib/esm/__/undici/lib/fetch/util.js +1161 -0
- package/lib/esm/__/undici/lib/fetch/util.js.map +1 -0
- package/lib/esm/__/undici/lib/fetch/webidl.js +659 -0
- package/lib/esm/__/undici/lib/fetch/webidl.js.map +1 -0
- package/lib/esm/__/undici/lib/fileapi/encoding.js +300 -0
- package/lib/esm/__/undici/lib/fileapi/encoding.js.map +1 -0
- package/lib/esm/__/undici/lib/fileapi/filereader.js +359 -0
- package/lib/esm/__/undici/lib/fileapi/filereader.js.map +1 -0
- package/lib/esm/__/undici/lib/fileapi/progressevent.js +90 -0
- package/lib/esm/__/undici/lib/fileapi/progressevent.js.map +1 -0
- package/lib/esm/__/undici/lib/fileapi/symbols.js +20 -0
- package/lib/esm/__/undici/lib/fileapi/symbols.js.map +1 -0
- package/lib/esm/__/undici/lib/fileapi/util.js +411 -0
- package/lib/esm/__/undici/lib/fileapi/util.js.map +1 -0
- package/lib/esm/__/undici/lib/global.js +45 -0
- package/lib/esm/__/undici/lib/global.js.map +1 -0
- package/lib/esm/__/undici/lib/handler/DecoratorHandler.js +45 -0
- package/lib/esm/__/undici/lib/handler/DecoratorHandler.js.map +1 -0
- package/lib/esm/__/undici/lib/handler/RedirectHandler.js +219 -0
- package/lib/esm/__/undici/lib/handler/RedirectHandler.js.map +1 -0
- package/lib/esm/__/undici/lib/handler/RetryHandler.js +352 -0
- package/lib/esm/__/undici/lib/handler/RetryHandler.js.map +1 -0
- package/lib/esm/__/undici/lib/interceptor/redirectInterceptor.js +33 -0
- package/lib/esm/__/undici/lib/interceptor/redirectInterceptor.js.map +1 -0
- package/lib/esm/__/undici/lib/llhttp/constants.js +286 -0
- package/lib/esm/__/undici/lib/llhttp/constants.js.map +1 -0
- package/lib/esm/__/undici/lib/llhttp/llhttp-wasm.js +12 -0
- package/lib/esm/__/undici/lib/llhttp/llhttp-wasm.js.map +1 -0
- package/lib/esm/__/undici/lib/llhttp/llhttp_simd-wasm.js +12 -0
- package/lib/esm/__/undici/lib/llhttp/llhttp_simd-wasm.js.map +1 -0
- package/lib/esm/__/undici/lib/llhttp/utils.js +26 -0
- package/lib/esm/__/undici/lib/llhttp/utils.js.map +1 -0
- package/lib/esm/__/undici/lib/mock/mock-agent.js +192 -0
- package/lib/esm/__/undici/lib/mock/mock-agent.js.map +1 -0
- package/lib/esm/__/undici/lib/mock/mock-client.js +77 -0
- package/lib/esm/__/undici/lib/mock/mock-client.js.map +1 -0
- package/lib/esm/__/undici/lib/mock/mock-errors.js +29 -0
- package/lib/esm/__/undici/lib/mock/mock-errors.js.map +1 -0
- package/lib/esm/__/undici/lib/mock/mock-interceptor.js +221 -0
- package/lib/esm/__/undici/lib/mock/mock-interceptor.js.map +1 -0
- package/lib/esm/__/undici/lib/mock/mock-pool.js +77 -0
- package/lib/esm/__/undici/lib/mock/mock-pool.js.map +1 -0
- package/lib/esm/__/undici/lib/mock/mock-symbols.js +33 -0
- package/lib/esm/__/undici/lib/mock/mock-symbols.js.map +1 -0
- package/lib/esm/__/undici/lib/mock/mock-utils.js +367 -0
- package/lib/esm/__/undici/lib/mock/mock-utils.js.map +1 -0
- package/lib/esm/__/undici/lib/mock/pending-interceptors-formatter.js +53 -0
- package/lib/esm/__/undici/lib/mock/pending-interceptors-formatter.js.map +1 -0
- package/lib/esm/__/undici/lib/mock/pluralizer.js +39 -0
- package/lib/esm/__/undici/lib/mock/pluralizer.js.map +1 -0
- package/lib/esm/__/undici/lib/node/fixed-queue.js +127 -0
- package/lib/esm/__/undici/lib/node/fixed-queue.js.map +1 -0
- package/lib/esm/__/undici/lib/pool-base.js +209 -0
- package/lib/esm/__/undici/lib/pool-base.js.map +1 -0
- package/lib/esm/__/undici/lib/pool-stats.js +47 -0
- package/lib/esm/__/undici/lib/pool-stats.js.map +1 -0
- package/lib/esm/__/undici/lib/pool.js +125 -0
- package/lib/esm/__/undici/lib/pool.js.map +1 -0
- package/lib/esm/__/undici/lib/proxy-agent.js +207 -0
- package/lib/esm/__/undici/lib/proxy-agent.js.map +1 -0
- package/lib/esm/__/undici/lib/timers.js +107 -0
- package/lib/esm/__/undici/lib/timers.js.map +1 -0
- package/lib/esm/__/undici/lib/websocket/connection.js +312 -0
- package/lib/esm/__/undici/lib/websocket/connection.js.map +1 -0
- package/lib/esm/__/undici/lib/websocket/constants.js +61 -0
- package/lib/esm/__/undici/lib/websocket/constants.js.map +1 -0
- package/lib/esm/__/undici/lib/websocket/events.js +317 -0
- package/lib/esm/__/undici/lib/websocket/events.js.map +1 -0
- package/lib/esm/__/undici/lib/websocket/frame.js +85 -0
- package/lib/esm/__/undici/lib/websocket/frame.js.map +1 -0
- package/lib/esm/__/undici/lib/websocket/receiver.js +361 -0
- package/lib/esm/__/undici/lib/websocket/receiver.js.map +1 -0
- package/lib/esm/__/undici/lib/websocket/symbols.js +22 -0
- package/lib/esm/__/undici/lib/websocket/symbols.js.map +1 -0
- package/lib/esm/__/undici/lib/websocket/util.js +214 -0
- package/lib/esm/__/undici/lib/websocket/util.js.map +1 -0
- package/lib/esm/__/undici/lib/websocket/websocket.js +662 -0
- package/lib/esm/__/undici/lib/websocket/websocket.js.map +1 -0
- package/lib/esm/_virtual/_commonjsHelpers.js +30 -1
- package/lib/esm/_virtual/_commonjsHelpers.js.map +1 -1
- package/lib/esm/_virtual/api-request.js +4 -0
- package/lib/esm/_virtual/api-request.js.map +1 -0
- package/lib/esm/_virtual/constants.js +4 -0
- package/lib/esm/_virtual/constants.js.map +1 -0
- package/lib/esm/_virtual/context.js +4 -0
- package/lib/esm/_virtual/context.js.map +1 -0
- package/lib/esm/_virtual/github.js +6 -0
- package/lib/esm/_virtual/github.js.map +1 -0
- package/lib/esm/_virtual/github2.js +4 -0
- package/lib/esm/_virtual/github2.js.map +1 -0
- package/lib/esm/_virtual/index10.js +4 -0
- package/lib/esm/_virtual/index10.js.map +1 -0
- package/lib/esm/_virtual/index11.js +4 -0
- package/lib/esm/_virtual/index11.js.map +1 -0
- package/lib/esm/_virtual/index12.js +4 -0
- package/lib/esm/_virtual/index12.js.map +1 -0
- package/lib/esm/_virtual/index13.js +4 -0
- package/lib/esm/_virtual/index13.js.map +1 -0
- package/lib/esm/_virtual/index14.js +4 -0
- package/lib/esm/_virtual/index14.js.map +1 -0
- package/lib/esm/_virtual/index2.js +4 -5
- package/lib/esm/_virtual/index2.js.map +1 -1
- package/lib/esm/_virtual/index3.js +5 -2
- package/lib/esm/_virtual/index3.js.map +1 -1
- package/lib/esm/_virtual/index4.js +5 -2
- package/lib/esm/_virtual/index4.js.map +1 -1
- package/lib/esm/_virtual/index5.js +2 -2
- package/lib/esm/_virtual/index6.js +6 -2
- package/lib/esm/_virtual/index6.js.map +1 -1
- package/lib/esm/_virtual/index7.js +4 -0
- package/lib/esm/_virtual/index7.js.map +1 -0
- package/lib/esm/_virtual/index8.js +6 -0
- package/lib/esm/_virtual/index8.js.map +1 -0
- package/lib/esm/_virtual/index9.js +4 -0
- package/lib/esm/_virtual/index9.js.map +1 -0
- package/lib/esm/_virtual/main.js +4 -0
- package/lib/esm/_virtual/main.js.map +1 -0
- package/lib/esm/_virtual/mock-interceptor.js +4 -0
- package/lib/esm/_virtual/mock-interceptor.js.map +1 -0
- package/lib/esm/_virtual/proxy.js +4 -0
- package/lib/esm/_virtual/proxy.js.map +1 -0
- package/lib/esm/_virtual/tunnel.js +4 -0
- package/lib/esm/_virtual/tunnel.js.map +1 -0
- package/lib/esm/_virtual/utils.js +4 -0
- package/lib/esm/_virtual/utils.js.map +1 -0
- package/lib/esm/_virtual/utils2.js +4 -0
- package/lib/esm/_virtual/utils2.js.map +1 -0
- package/lib/esm/_virtual/utils3.js +4 -0
- package/lib/esm/_virtual/utils3.js.map +1 -0
- package/lib/esm/artifacts/filter-artifacts.js.map +1 -1
- package/lib/esm/env/ci-env.js +6 -1
- package/lib/esm/env/ci-env.js.map +1 -1
- package/lib/esm/env/load.js +1 -1
- package/lib/esm/env/load.js.map +1 -1
- package/lib/esm/env/service/github.js +3 -3
- package/lib/esm/env/service/github.js.map +1 -1
- package/lib/esm/ingest/ingest.js +1 -1
- package/lib/esm/ingest/ingest.js.map +1 -1
- package/lib/esm/locales/en.js.map +1 -1
- package/package.json +11 -11
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var symbols = require('../core/symbols.js');
|
|
4
|
+
var agent = require('../agent.js');
|
|
5
|
+
var mockSymbols = require('./mock-symbols.js');
|
|
6
|
+
var mockClient = require('./mock-client.js');
|
|
7
|
+
var mockPool = require('./mock-pool.js');
|
|
8
|
+
var mockUtils = require('./mock-utils.js');
|
|
9
|
+
var errors = require('../core/errors.js');
|
|
10
|
+
var dispatcher = require('../dispatcher.js');
|
|
11
|
+
var pluralizer = require('./pluralizer.js');
|
|
12
|
+
var pendingInterceptorsFormatter = require('./pending-interceptors-formatter.js');
|
|
13
|
+
|
|
14
|
+
var mockAgent;
|
|
15
|
+
var hasRequiredMockAgent;
|
|
16
|
+
|
|
17
|
+
function requireMockAgent () {
|
|
18
|
+
if (hasRequiredMockAgent) return mockAgent;
|
|
19
|
+
hasRequiredMockAgent = 1;
|
|
20
|
+
|
|
21
|
+
const { kClients } = symbols.__require();
|
|
22
|
+
const Agent = agent.__require();
|
|
23
|
+
const {
|
|
24
|
+
kAgent,
|
|
25
|
+
kMockAgentSet,
|
|
26
|
+
kMockAgentGet,
|
|
27
|
+
kDispatches,
|
|
28
|
+
kIsMockActive,
|
|
29
|
+
kNetConnect,
|
|
30
|
+
kGetNetConnect,
|
|
31
|
+
kOptions,
|
|
32
|
+
kFactory
|
|
33
|
+
} = mockSymbols.__require();
|
|
34
|
+
const MockClient = mockClient.__require();
|
|
35
|
+
const MockPool = mockPool.__require();
|
|
36
|
+
const { matchValue, buildMockOptions } = mockUtils.__require();
|
|
37
|
+
const { InvalidArgumentError, UndiciError } = errors.__require();
|
|
38
|
+
const Dispatcher = dispatcher.__require();
|
|
39
|
+
const Pluralizer = pluralizer.__require();
|
|
40
|
+
const PendingInterceptorsFormatter = pendingInterceptorsFormatter.__require();
|
|
41
|
+
|
|
42
|
+
class FakeWeakRef {
|
|
43
|
+
constructor (value) {
|
|
44
|
+
this.value = value;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
deref () {
|
|
48
|
+
return this.value
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
class MockAgent extends Dispatcher {
|
|
53
|
+
constructor (opts) {
|
|
54
|
+
super(opts);
|
|
55
|
+
|
|
56
|
+
this[kNetConnect] = true;
|
|
57
|
+
this[kIsMockActive] = true;
|
|
58
|
+
|
|
59
|
+
// Instantiate Agent and encapsulate
|
|
60
|
+
if ((opts && opts.agent && typeof opts.agent.dispatch !== 'function')) {
|
|
61
|
+
throw new InvalidArgumentError('Argument opts.agent must implement Agent')
|
|
62
|
+
}
|
|
63
|
+
const agent = opts && opts.agent ? opts.agent : new Agent(opts);
|
|
64
|
+
this[kAgent] = agent;
|
|
65
|
+
|
|
66
|
+
this[kClients] = agent[kClients];
|
|
67
|
+
this[kOptions] = buildMockOptions(opts);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
get (origin) {
|
|
71
|
+
let dispatcher = this[kMockAgentGet](origin);
|
|
72
|
+
|
|
73
|
+
if (!dispatcher) {
|
|
74
|
+
dispatcher = this[kFactory](origin);
|
|
75
|
+
this[kMockAgentSet](origin, dispatcher);
|
|
76
|
+
}
|
|
77
|
+
return dispatcher
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
dispatch (opts, handler) {
|
|
81
|
+
// Call MockAgent.get to perform additional setup before dispatching as normal
|
|
82
|
+
this.get(opts.origin);
|
|
83
|
+
return this[kAgent].dispatch(opts, handler)
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
async close () {
|
|
87
|
+
await this[kAgent].close();
|
|
88
|
+
this[kClients].clear();
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
deactivate () {
|
|
92
|
+
this[kIsMockActive] = false;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
activate () {
|
|
96
|
+
this[kIsMockActive] = true;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
enableNetConnect (matcher) {
|
|
100
|
+
if (typeof matcher === 'string' || typeof matcher === 'function' || matcher instanceof RegExp) {
|
|
101
|
+
if (Array.isArray(this[kNetConnect])) {
|
|
102
|
+
this[kNetConnect].push(matcher);
|
|
103
|
+
} else {
|
|
104
|
+
this[kNetConnect] = [matcher];
|
|
105
|
+
}
|
|
106
|
+
} else if (typeof matcher === 'undefined') {
|
|
107
|
+
this[kNetConnect] = true;
|
|
108
|
+
} else {
|
|
109
|
+
throw new InvalidArgumentError('Unsupported matcher. Must be one of String|Function|RegExp.')
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
disableNetConnect () {
|
|
114
|
+
this[kNetConnect] = false;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// This is required to bypass issues caused by using global symbols - see:
|
|
118
|
+
// https://github.com/nodejs/undici/issues/1447
|
|
119
|
+
get isMockActive () {
|
|
120
|
+
return this[kIsMockActive]
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
[kMockAgentSet] (origin, dispatcher) {
|
|
124
|
+
this[kClients].set(origin, new FakeWeakRef(dispatcher));
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
[kFactory] (origin) {
|
|
128
|
+
const mockOptions = Object.assign({ agent: this }, this[kOptions]);
|
|
129
|
+
return this[kOptions] && this[kOptions].connections === 1
|
|
130
|
+
? new MockClient(origin, mockOptions)
|
|
131
|
+
: new MockPool(origin, mockOptions)
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
[kMockAgentGet] (origin) {
|
|
135
|
+
// First check if we can immediately find it
|
|
136
|
+
const ref = this[kClients].get(origin);
|
|
137
|
+
if (ref) {
|
|
138
|
+
return ref.deref()
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// If the origin is not a string create a dummy parent pool and return to user
|
|
142
|
+
if (typeof origin !== 'string') {
|
|
143
|
+
const dispatcher = this[kFactory]('http://localhost:9999');
|
|
144
|
+
this[kMockAgentSet](origin, dispatcher);
|
|
145
|
+
return dispatcher
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// If we match, create a pool and assign the same dispatches
|
|
149
|
+
for (const [keyMatcher, nonExplicitRef] of Array.from(this[kClients])) {
|
|
150
|
+
const nonExplicitDispatcher = nonExplicitRef.deref();
|
|
151
|
+
if (nonExplicitDispatcher && typeof keyMatcher !== 'string' && matchValue(keyMatcher, origin)) {
|
|
152
|
+
const dispatcher = this[kFactory](origin);
|
|
153
|
+
this[kMockAgentSet](origin, dispatcher);
|
|
154
|
+
dispatcher[kDispatches] = nonExplicitDispatcher[kDispatches];
|
|
155
|
+
return dispatcher
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
[kGetNetConnect] () {
|
|
161
|
+
return this[kNetConnect]
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
pendingInterceptors () {
|
|
165
|
+
const mockAgentClients = this[kClients];
|
|
166
|
+
|
|
167
|
+
return Array.from(mockAgentClients.entries())
|
|
168
|
+
.flatMap(([origin, scope]) => scope.deref()[kDispatches].map(dispatch => ({ ...dispatch, origin })))
|
|
169
|
+
.filter(({ pending }) => pending)
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
assertNoPendingInterceptors ({ pendingInterceptorsFormatter = new PendingInterceptorsFormatter() } = {}) {
|
|
173
|
+
const pending = this.pendingInterceptors();
|
|
174
|
+
|
|
175
|
+
if (pending.length === 0) {
|
|
176
|
+
return
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
const pluralizer = new Pluralizer('interceptor', 'interceptors').pluralize(pending.length);
|
|
180
|
+
|
|
181
|
+
throw new UndiciError(`
|
|
182
|
+
${pluralizer.count} ${pluralizer.noun} ${pluralizer.is} pending:
|
|
183
|
+
|
|
184
|
+
${pendingInterceptorsFormatter.format(pending)}
|
|
185
|
+
`.trim())
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
mockAgent = MockAgent;
|
|
190
|
+
return mockAgent;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
exports.__require = requireMockAgent;
|
|
194
|
+
//# sourceMappingURL=mock-agent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mock-agent.js","sources":["../../../../../../../../node_modules/undici/lib/mock/mock-agent.js"],"sourcesContent":["'use strict'\n\nconst { kClients } = require('../core/symbols')\nconst Agent = require('../agent')\nconst {\n kAgent,\n kMockAgentSet,\n kMockAgentGet,\n kDispatches,\n kIsMockActive,\n kNetConnect,\n kGetNetConnect,\n kOptions,\n kFactory\n} = require('./mock-symbols')\nconst MockClient = require('./mock-client')\nconst MockPool = require('./mock-pool')\nconst { matchValue, buildMockOptions } = require('./mock-utils')\nconst { InvalidArgumentError, UndiciError } = require('../core/errors')\nconst Dispatcher = require('../dispatcher')\nconst Pluralizer = require('./pluralizer')\nconst PendingInterceptorsFormatter = require('./pending-interceptors-formatter')\n\nclass FakeWeakRef {\n constructor (value) {\n this.value = value\n }\n\n deref () {\n return this.value\n }\n}\n\nclass MockAgent extends Dispatcher {\n constructor (opts) {\n super(opts)\n\n this[kNetConnect] = true\n this[kIsMockActive] = true\n\n // Instantiate Agent and encapsulate\n if ((opts && opts.agent && typeof opts.agent.dispatch !== 'function')) {\n throw new InvalidArgumentError('Argument opts.agent must implement Agent')\n }\n const agent = opts && opts.agent ? opts.agent : new Agent(opts)\n this[kAgent] = agent\n\n this[kClients] = agent[kClients]\n this[kOptions] = buildMockOptions(opts)\n }\n\n get (origin) {\n let dispatcher = this[kMockAgentGet](origin)\n\n if (!dispatcher) {\n dispatcher = this[kFactory](origin)\n this[kMockAgentSet](origin, dispatcher)\n }\n return dispatcher\n }\n\n dispatch (opts, handler) {\n // Call MockAgent.get to perform additional setup before dispatching as normal\n this.get(opts.origin)\n return this[kAgent].dispatch(opts, handler)\n }\n\n async close () {\n await this[kAgent].close()\n this[kClients].clear()\n }\n\n deactivate () {\n this[kIsMockActive] = false\n }\n\n activate () {\n this[kIsMockActive] = true\n }\n\n enableNetConnect (matcher) {\n if (typeof matcher === 'string' || typeof matcher === 'function' || matcher instanceof RegExp) {\n if (Array.isArray(this[kNetConnect])) {\n this[kNetConnect].push(matcher)\n } else {\n this[kNetConnect] = [matcher]\n }\n } else if (typeof matcher === 'undefined') {\n this[kNetConnect] = true\n } else {\n throw new InvalidArgumentError('Unsupported matcher. Must be one of String|Function|RegExp.')\n }\n }\n\n disableNetConnect () {\n this[kNetConnect] = false\n }\n\n // This is required to bypass issues caused by using global symbols - see:\n // https://github.com/nodejs/undici/issues/1447\n get isMockActive () {\n return this[kIsMockActive]\n }\n\n [kMockAgentSet] (origin, dispatcher) {\n this[kClients].set(origin, new FakeWeakRef(dispatcher))\n }\n\n [kFactory] (origin) {\n const mockOptions = Object.assign({ agent: this }, this[kOptions])\n return this[kOptions] && this[kOptions].connections === 1\n ? new MockClient(origin, mockOptions)\n : new MockPool(origin, mockOptions)\n }\n\n [kMockAgentGet] (origin) {\n // First check if we can immediately find it\n const ref = this[kClients].get(origin)\n if (ref) {\n return ref.deref()\n }\n\n // If the origin is not a string create a dummy parent pool and return to user\n if (typeof origin !== 'string') {\n const dispatcher = this[kFactory]('http://localhost:9999')\n this[kMockAgentSet](origin, dispatcher)\n return dispatcher\n }\n\n // If we match, create a pool and assign the same dispatches\n for (const [keyMatcher, nonExplicitRef] of Array.from(this[kClients])) {\n const nonExplicitDispatcher = nonExplicitRef.deref()\n if (nonExplicitDispatcher && typeof keyMatcher !== 'string' && matchValue(keyMatcher, origin)) {\n const dispatcher = this[kFactory](origin)\n this[kMockAgentSet](origin, dispatcher)\n dispatcher[kDispatches] = nonExplicitDispatcher[kDispatches]\n return dispatcher\n }\n }\n }\n\n [kGetNetConnect] () {\n return this[kNetConnect]\n }\n\n pendingInterceptors () {\n const mockAgentClients = this[kClients]\n\n return Array.from(mockAgentClients.entries())\n .flatMap(([origin, scope]) => scope.deref()[kDispatches].map(dispatch => ({ ...dispatch, origin })))\n .filter(({ pending }) => pending)\n }\n\n assertNoPendingInterceptors ({ pendingInterceptorsFormatter = new PendingInterceptorsFormatter() } = {}) {\n const pending = this.pendingInterceptors()\n\n if (pending.length === 0) {\n return\n }\n\n const pluralizer = new Pluralizer('interceptor', 'interceptors').pluralize(pending.length)\n\n throw new UndiciError(`\n${pluralizer.count} ${pluralizer.noun} ${pluralizer.is} pending:\n\n${pendingInterceptorsFormatter.format(pending)}\n`.trim())\n }\n}\n\nmodule.exports = MockAgent\n"],"names":["require$$0","require$$1","require$$2","require$$3","require$$4","require$$5","require$$6","require$$7","require$$8","require$$9"],"mappings":";;;;;;;;;;;;;;;;;;;;CAEA,MAAM,EAAE,QAAQ,EAAE,GAAGA,iBAAA;AACrB,CAAA,MAAM,KAAK,GAAGC,eAAA;CACd,MAAM;AACN,GAAE,MAAM;AACR,GAAE,aAAa;AACf,GAAE,aAAa;AACf,GAAE,WAAW;AACb,GAAE,aAAa;AACf,GAAE,WAAW;AACb,GAAE,cAAc;AAChB,GAAE,QAAQ;GACR;AACF,EAAC,GAAGC,qBAAA;AACJ,CAAA,MAAM,UAAU,GAAGC,oBAAA;AACnB,CAAA,MAAM,QAAQ,GAAGC,kBAAA;AACjB,CAAA,MAAM,EAAE,UAAU,EAAE,gBAAgB,EAAE,GAAGC,mBAAA;AACzC,CAAA,MAAM,EAAE,oBAAoB,EAAE,WAAW,EAAE,GAAGC,gBAAA;AAC9C,CAAA,MAAM,UAAU,GAAGC,oBAAA;AACnB,CAAA,MAAM,UAAU,GAAGC,oBAAA;AACnB,CAAA,MAAM,4BAA4B,GAAGC,sCAAA;;AAErC,CAAA,MAAM,WAAW,CAAC;AAClB,GAAE,WAAW,CAAC,CAAC,KAAK,EAAE;KAClB,IAAI,CAAC,KAAK,GAAG;AACjB,GAAA;;GAEE,KAAK,CAAC,GAAG;KACP,OAAO,IAAI,CAAC;AAChB,GAAA;AACA;;CAEA,MAAM,SAAS,SAAS,UAAU,CAAC;AACnC,GAAE,WAAW,CAAC,CAAC,IAAI,EAAE;KACjB,KAAK,CA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;AACzB,KAAI,MAAM,gBAAgB,GAAG,IAAI,CAAC,QAAQ;;KAEtC,OAAO,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE;AAChD,QAAO,OAAO,CAAC,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,KAAK,CAAC,KAAK,EAAE,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,QAAQ,KAAK,EAAE,GAAG,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;AACzG,QAAO,MAAM,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,OAAO;AACtC,GAAA;;AAEA,GAAE,2BAA2B,CAAC,CAAC,EAAE,4BAA4B,GAAG,IAAI,4BAA4B,EAAE,EAAE,GAAG,EAAE,EAAE;AAC3G,KAAI,MAAM,OAAO,GAAG,IAAI,CAAC,mBAAmB;;AAE5C,KAAI,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE;OACxB;AACN,KAAA;;AAEA,KAAI,MAAM,UAAU,GAAG,IAAI,UAAU,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM;;KAEzF,MAAM,IAAI,WAAW,CAAC;AAC1B,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC,EAAE,UAAU,CAAC,EAAE,CAAC;;AAEvD,EAAE,4BAA4B,CAAC,MAAM,CAAC,OAAO,CAAC;AAC9C,CAAC,CAAC,IAAI,EAAE;AACR,GAAA;AACA;;AAEA,CAAA,SAAc,GAAG;;;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var require$$1 = require('node:util');
|
|
4
|
+
var client = require('../client.js');
|
|
5
|
+
var mockUtils = require('./mock-utils.js');
|
|
6
|
+
var mockSymbols = require('./mock-symbols.js');
|
|
7
|
+
var mockInterceptor = require('./mock-interceptor.js');
|
|
8
|
+
var symbols = require('../core/symbols.js');
|
|
9
|
+
var errors = require('../core/errors.js');
|
|
10
|
+
|
|
11
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
|
|
13
|
+
var require$$1__default = /*#__PURE__*/_interopDefault(require$$1);
|
|
14
|
+
|
|
15
|
+
var mockClient;
|
|
16
|
+
var hasRequiredMockClient;
|
|
17
|
+
|
|
18
|
+
function requireMockClient () {
|
|
19
|
+
if (hasRequiredMockClient) return mockClient;
|
|
20
|
+
hasRequiredMockClient = 1;
|
|
21
|
+
|
|
22
|
+
const { promisify } = require$$1__default.default;
|
|
23
|
+
const Client = client.__require();
|
|
24
|
+
const { buildMockDispatch } = mockUtils.__require();
|
|
25
|
+
const {
|
|
26
|
+
kDispatches,
|
|
27
|
+
kMockAgent,
|
|
28
|
+
kClose,
|
|
29
|
+
kOriginalClose,
|
|
30
|
+
kOrigin,
|
|
31
|
+
kOriginalDispatch,
|
|
32
|
+
kConnected
|
|
33
|
+
} = mockSymbols.__require();
|
|
34
|
+
const { MockInterceptor } = mockInterceptor.__require();
|
|
35
|
+
const Symbols = symbols.__require();
|
|
36
|
+
const { InvalidArgumentError } = errors.__require();
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* MockClient provides an API that extends the Client to influence the mockDispatches.
|
|
40
|
+
*/
|
|
41
|
+
class MockClient extends Client {
|
|
42
|
+
constructor (origin, opts) {
|
|
43
|
+
super(origin, opts);
|
|
44
|
+
|
|
45
|
+
if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') {
|
|
46
|
+
throw new InvalidArgumentError('Argument opts.agent must implement Agent')
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
this[kMockAgent] = opts.agent;
|
|
50
|
+
this[kOrigin] = origin;
|
|
51
|
+
this[kDispatches] = [];
|
|
52
|
+
this[kConnected] = 1;
|
|
53
|
+
this[kOriginalDispatch] = this.dispatch;
|
|
54
|
+
this[kOriginalClose] = this.close.bind(this);
|
|
55
|
+
|
|
56
|
+
this.dispatch = buildMockDispatch.call(this);
|
|
57
|
+
this.close = this[kClose];
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
get [Symbols.kConnected] () {
|
|
61
|
+
return this[kConnected]
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Sets up the base interceptor for mocking replies from undici.
|
|
66
|
+
*/
|
|
67
|
+
intercept (opts) {
|
|
68
|
+
return new MockInterceptor(opts, this[kDispatches])
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
async [kClose] () {
|
|
72
|
+
await promisify(this[kOriginalClose])();
|
|
73
|
+
this[kConnected] = 0;
|
|
74
|
+
this[kMockAgent][Symbols.kClients].delete(this[kOrigin]);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
mockClient = MockClient;
|
|
79
|
+
return mockClient;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
exports.__require = requireMockClient;
|
|
83
|
+
//# sourceMappingURL=mock-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mock-client.js","sources":["../../../../../../../../node_modules/undici/lib/mock/mock-client.js"],"sourcesContent":["'use strict'\n\nconst { promisify } = require('util')\nconst Client = require('../client')\nconst { buildMockDispatch } = require('./mock-utils')\nconst {\n kDispatches,\n kMockAgent,\n kClose,\n kOriginalClose,\n kOrigin,\n kOriginalDispatch,\n kConnected\n} = require('./mock-symbols')\nconst { MockInterceptor } = require('./mock-interceptor')\nconst Symbols = require('../core/symbols')\nconst { InvalidArgumentError } = require('../core/errors')\n\n/**\n * MockClient provides an API that extends the Client to influence the mockDispatches.\n */\nclass MockClient extends Client {\n constructor (origin, opts) {\n super(origin, opts)\n\n if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') {\n throw new InvalidArgumentError('Argument opts.agent must implement Agent')\n }\n\n this[kMockAgent] = opts.agent\n this[kOrigin] = origin\n this[kDispatches] = []\n this[kConnected] = 1\n this[kOriginalDispatch] = this.dispatch\n this[kOriginalClose] = this.close.bind(this)\n\n this.dispatch = buildMockDispatch.call(this)\n this.close = this[kClose]\n }\n\n get [Symbols.kConnected] () {\n return this[kConnected]\n }\n\n /**\n * Sets up the base interceptor for mocking replies from undici.\n */\n intercept (opts) {\n return new MockInterceptor(opts, this[kDispatches])\n }\n\n async [kClose] () {\n await promisify(this[kOriginalClose])()\n this[kConnected] = 0\n this[kMockAgent][Symbols.kClients].delete(this[kOrigin])\n }\n}\n\nmodule.exports = MockClient\n"],"names":["require$$0","require$$1","require$$2","require$$3","require$$4","require$$5","require$$6"],"mappings":";;;;;;;;;;;;;;;;;;;;;CAEA,MAAM,EAAE,SAAS,EAAE,GAAGA;AACtB,CAAA,MAAM,MAAM,GAAGC,gBAAA;CACf,MAAM,EAAE,iBAAiB,EAAE,GAAGC,mBAAA;CAC9B,MAAM;AACN,GAAE,WAAW;AACb,GAAE,UAAU;AACZ,GAAE,MAAM;AACR,GAAE,cAAc;AAChB,GAAE,OAAO;AACT,GAAE,iBAAiB;GACjB;AACF,EAAC,GAAGC,qBAAA;CACJ,MAAM,EAAE,eAAe,EAAE,GAAGC,yBAAA;AAC5B,CAAA,MAAM,OAAO,GAAGC,iBAAA;CAChB,MAAM,EAAE,oBAAoB,EAAE,GAAGC,gBAAA;;AAEjC;AACA;AACA;CACA,MAAM,UAAU,SAAS,MAAM,CAAC;AAChC,GAAE,WAAW,CAAC,CAAC,MAAM,EAAE,IAAI,EAAE;AAC7B,KAAI,KAAK,CAAC,MAAM,EAAE,IAAI;;AAEtB,KAAI,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,KAAK,UAAU,EAAE;AAC3E,OAAM,MAAM,IAAI,oBAAoB,CAAC,0CAA0C;AAC/E,KAAA;;AAEA,KAAI,IAAI,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC;AAC5B,KAAI,IAAI,CAAC,OAAO,CAAC,GAAG;AACpB,KAAI,IAAI,CAAC,WAAW,CAAC,GAAG;AACxB,KAAI,IAAI,CAAC,UAAU,CAAC,GAAG;AACvB,KAAI,IAAI,CAAC,iBAAiB,CAAC,GAAG,IAAI,CAAC;KAC/B,IAAI,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI;;KAE3C,IAAI,CAAC,QAAQ,GAAG,iBAAiB,CAAC,IAAI,CAAC,IAAI;AAC/C,KAAI,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM;AAC5B,GAAA;;AAEA,GAAE,KAAK,OAAO,CAAC,UAAU,EAAE,GAAG;KAC1B,OAAO,IAAI,CAAC,UAAU;AAC1B,GAAA;;AAEA;AACA;AACA;AACA,GAAE,SAAS,CAAC,CAAC,IAAI,EAAE;KACf,OAAO,IAAI,eAAe,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC;AACtD,GAAA;;GAEE,OAAO,MAAM,EAAE,GAAG;AACpB,KAAI,MAAM,SAAS,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;AACzC,KAAI,IAAI,CAAC,UAAU,CAAC,GAAG;AACvB,KAAI,IAAI,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;AAC3D,GAAA;AACA;;AAEA,CAAA,UAAc,GAAG;;;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var errors = require('../core/errors.js');
|
|
4
|
+
|
|
5
|
+
var mockErrors;
|
|
6
|
+
var hasRequiredMockErrors;
|
|
7
|
+
|
|
8
|
+
function requireMockErrors () {
|
|
9
|
+
if (hasRequiredMockErrors) return mockErrors;
|
|
10
|
+
hasRequiredMockErrors = 1;
|
|
11
|
+
|
|
12
|
+
const { UndiciError } = errors.__require();
|
|
13
|
+
|
|
14
|
+
class MockNotMatchedError extends UndiciError {
|
|
15
|
+
constructor (message) {
|
|
16
|
+
super(message);
|
|
17
|
+
Error.captureStackTrace(this, MockNotMatchedError);
|
|
18
|
+
this.name = 'MockNotMatchedError';
|
|
19
|
+
this.message = message || 'The request does not match any registered mock dispatches';
|
|
20
|
+
this.code = 'UND_MOCK_ERR_MOCK_NOT_MATCHED';
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
mockErrors = {
|
|
25
|
+
MockNotMatchedError
|
|
26
|
+
};
|
|
27
|
+
return mockErrors;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
exports.__require = requireMockErrors;
|
|
31
|
+
//# sourceMappingURL=mock-errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mock-errors.js","sources":["../../../../../../../../node_modules/undici/lib/mock/mock-errors.js"],"sourcesContent":["'use strict'\n\nconst { UndiciError } = require('../core/errors')\n\nclass MockNotMatchedError extends UndiciError {\n constructor (message) {\n super(message)\n Error.captureStackTrace(this, MockNotMatchedError)\n this.name = 'MockNotMatchedError'\n this.message = message || 'The request does not match any registered mock dispatches'\n this.code = 'UND_MOCK_ERR_MOCK_NOT_MATCHED'\n }\n}\n\nmodule.exports = {\n MockNotMatchedError\n}\n"],"names":["require$$0"],"mappings":";;;;;;;;;;;CAEA,MAAM,EAAE,WAAW,EAAE,GAAGA,gBAAA;;CAExB,MAAM,mBAAmB,SAAS,WAAW,CAAC;AAC9C,GAAE,WAAW,CAAC,CAAC,OAAO,EAAE;KACpB,KAAK,CAAC,OAAO;AACjB,KAAI,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,mBAAmB;KACjD,IAAI,CAAC,IAAI,GAAG;AAChB,KAAI,IAAI,CAAC,OAAO,GAAG,OAAO,IAAI;KAC1B,IAAI,CAAC,IAAI,GAAG;AAChB,GAAA;AACA;;AAEA,CAAA,UAAc,GAAG;GACf;AACF;;;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var mockInterceptor = require('../../../../_virtual/mock-interceptor.js');
|
|
4
|
+
var mockUtils = require('./mock-utils.js');
|
|
5
|
+
var mockSymbols = require('./mock-symbols.js');
|
|
6
|
+
var errors = require('../core/errors.js');
|
|
7
|
+
var util = require('../core/util.js');
|
|
8
|
+
|
|
9
|
+
var hasRequiredMockInterceptor;
|
|
10
|
+
|
|
11
|
+
function requireMockInterceptor () {
|
|
12
|
+
if (hasRequiredMockInterceptor) return mockInterceptor.__exports;
|
|
13
|
+
hasRequiredMockInterceptor = 1;
|
|
14
|
+
|
|
15
|
+
const { getResponseData, buildKey, addMockDispatch } = mockUtils.__require();
|
|
16
|
+
const {
|
|
17
|
+
kDispatches,
|
|
18
|
+
kDispatchKey,
|
|
19
|
+
kDefaultHeaders,
|
|
20
|
+
kDefaultTrailers,
|
|
21
|
+
kContentLength,
|
|
22
|
+
kMockDispatch
|
|
23
|
+
} = mockSymbols.__require();
|
|
24
|
+
const { InvalidArgumentError } = errors.__require();
|
|
25
|
+
const { buildURL } = util.__require();
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Defines the scope API for an interceptor reply
|
|
29
|
+
*/
|
|
30
|
+
class MockScope {
|
|
31
|
+
constructor (mockDispatch) {
|
|
32
|
+
this[kMockDispatch] = mockDispatch;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Delay a reply by a set amount in ms.
|
|
37
|
+
*/
|
|
38
|
+
delay (waitInMs) {
|
|
39
|
+
if (typeof waitInMs !== 'number' || !Number.isInteger(waitInMs) || waitInMs <= 0) {
|
|
40
|
+
throw new InvalidArgumentError('waitInMs must be a valid integer > 0')
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
this[kMockDispatch].delay = waitInMs;
|
|
44
|
+
return this
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* For a defined reply, never mark as consumed.
|
|
49
|
+
*/
|
|
50
|
+
persist () {
|
|
51
|
+
this[kMockDispatch].persist = true;
|
|
52
|
+
return this
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Allow one to define a reply for a set amount of matching requests.
|
|
57
|
+
*/
|
|
58
|
+
times (repeatTimes) {
|
|
59
|
+
if (typeof repeatTimes !== 'number' || !Number.isInteger(repeatTimes) || repeatTimes <= 0) {
|
|
60
|
+
throw new InvalidArgumentError('repeatTimes must be a valid integer > 0')
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
this[kMockDispatch].times = repeatTimes;
|
|
64
|
+
return this
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Defines an interceptor for a Mock
|
|
70
|
+
*/
|
|
71
|
+
class MockInterceptor {
|
|
72
|
+
constructor (opts, mockDispatches) {
|
|
73
|
+
if (typeof opts !== 'object') {
|
|
74
|
+
throw new InvalidArgumentError('opts must be an object')
|
|
75
|
+
}
|
|
76
|
+
if (typeof opts.path === 'undefined') {
|
|
77
|
+
throw new InvalidArgumentError('opts.path must be defined')
|
|
78
|
+
}
|
|
79
|
+
if (typeof opts.method === 'undefined') {
|
|
80
|
+
opts.method = 'GET';
|
|
81
|
+
}
|
|
82
|
+
// See https://github.com/nodejs/undici/issues/1245
|
|
83
|
+
// As per RFC 3986, clients are not supposed to send URI
|
|
84
|
+
// fragments to servers when they retrieve a document,
|
|
85
|
+
if (typeof opts.path === 'string') {
|
|
86
|
+
if (opts.query) {
|
|
87
|
+
opts.path = buildURL(opts.path, opts.query);
|
|
88
|
+
} else {
|
|
89
|
+
// Matches https://github.com/nodejs/undici/blob/main/lib/fetch/index.js#L1811
|
|
90
|
+
const parsedURL = new URL(opts.path, 'data://');
|
|
91
|
+
opts.path = parsedURL.pathname + parsedURL.search;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
if (typeof opts.method === 'string') {
|
|
95
|
+
opts.method = opts.method.toUpperCase();
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
this[kDispatchKey] = buildKey(opts);
|
|
99
|
+
this[kDispatches] = mockDispatches;
|
|
100
|
+
this[kDefaultHeaders] = {};
|
|
101
|
+
this[kDefaultTrailers] = {};
|
|
102
|
+
this[kContentLength] = false;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
createMockScopeDispatchData (statusCode, data, responseOptions = {}) {
|
|
106
|
+
const responseData = getResponseData(data);
|
|
107
|
+
const contentLength = this[kContentLength] ? { 'content-length': responseData.length } : {};
|
|
108
|
+
const headers = { ...this[kDefaultHeaders], ...contentLength, ...responseOptions.headers };
|
|
109
|
+
const trailers = { ...this[kDefaultTrailers], ...responseOptions.trailers };
|
|
110
|
+
|
|
111
|
+
return { statusCode, data, headers, trailers }
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
validateReplyParameters (statusCode, data, responseOptions) {
|
|
115
|
+
if (typeof statusCode === 'undefined') {
|
|
116
|
+
throw new InvalidArgumentError('statusCode must be defined')
|
|
117
|
+
}
|
|
118
|
+
if (typeof data === 'undefined') {
|
|
119
|
+
throw new InvalidArgumentError('data must be defined')
|
|
120
|
+
}
|
|
121
|
+
if (typeof responseOptions !== 'object') {
|
|
122
|
+
throw new InvalidArgumentError('responseOptions must be an object')
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Mock an undici request with a defined reply.
|
|
128
|
+
*/
|
|
129
|
+
reply (replyData) {
|
|
130
|
+
// Values of reply aren't available right now as they
|
|
131
|
+
// can only be available when the reply callback is invoked.
|
|
132
|
+
if (typeof replyData === 'function') {
|
|
133
|
+
// We'll first wrap the provided callback in another function,
|
|
134
|
+
// this function will properly resolve the data from the callback
|
|
135
|
+
// when invoked.
|
|
136
|
+
const wrappedDefaultsCallback = (opts) => {
|
|
137
|
+
// Our reply options callback contains the parameter for statusCode, data and options.
|
|
138
|
+
const resolvedData = replyData(opts);
|
|
139
|
+
|
|
140
|
+
// Check if it is in the right format
|
|
141
|
+
if (typeof resolvedData !== 'object') {
|
|
142
|
+
throw new InvalidArgumentError('reply options callback must return an object')
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
const { statusCode, data = '', responseOptions = {} } = resolvedData;
|
|
146
|
+
this.validateReplyParameters(statusCode, data, responseOptions);
|
|
147
|
+
// Since the values can be obtained immediately we return them
|
|
148
|
+
// from this higher order function that will be resolved later.
|
|
149
|
+
return {
|
|
150
|
+
...this.createMockScopeDispatchData(statusCode, data, responseOptions)
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
// Add usual dispatch data, but this time set the data parameter to function that will eventually provide data.
|
|
155
|
+
const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], wrappedDefaultsCallback);
|
|
156
|
+
return new MockScope(newMockDispatch)
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// We can have either one or three parameters, if we get here,
|
|
160
|
+
// we should have 1-3 parameters. So we spread the arguments of
|
|
161
|
+
// this function to obtain the parameters, since replyData will always
|
|
162
|
+
// just be the statusCode.
|
|
163
|
+
const [statusCode, data = '', responseOptions = {}] = [...arguments];
|
|
164
|
+
this.validateReplyParameters(statusCode, data, responseOptions);
|
|
165
|
+
|
|
166
|
+
// Send in-already provided data like usual
|
|
167
|
+
const dispatchData = this.createMockScopeDispatchData(statusCode, data, responseOptions);
|
|
168
|
+
const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], dispatchData);
|
|
169
|
+
return new MockScope(newMockDispatch)
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Mock an undici request with a defined error.
|
|
174
|
+
*/
|
|
175
|
+
replyWithError (error) {
|
|
176
|
+
if (typeof error === 'undefined') {
|
|
177
|
+
throw new InvalidArgumentError('error must be defined')
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error });
|
|
181
|
+
return new MockScope(newMockDispatch)
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Set default reply headers on the interceptor for subsequent replies
|
|
186
|
+
*/
|
|
187
|
+
defaultReplyHeaders (headers) {
|
|
188
|
+
if (typeof headers === 'undefined') {
|
|
189
|
+
throw new InvalidArgumentError('headers must be defined')
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
this[kDefaultHeaders] = headers;
|
|
193
|
+
return this
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Set default reply trailers on the interceptor for subsequent replies
|
|
198
|
+
*/
|
|
199
|
+
defaultReplyTrailers (trailers) {
|
|
200
|
+
if (typeof trailers === 'undefined') {
|
|
201
|
+
throw new InvalidArgumentError('trailers must be defined')
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
this[kDefaultTrailers] = trailers;
|
|
205
|
+
return this
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Set reply content length header for replies on the interceptor
|
|
210
|
+
*/
|
|
211
|
+
replyContentLength () {
|
|
212
|
+
this[kContentLength] = true;
|
|
213
|
+
return this
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
mockInterceptor.__exports.MockInterceptor = MockInterceptor;
|
|
218
|
+
mockInterceptor.__exports.MockScope = MockScope;
|
|
219
|
+
return mockInterceptor.__exports;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
exports.__require = requireMockInterceptor;
|
|
223
|
+
//# sourceMappingURL=mock-interceptor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mock-interceptor.js","sources":["../../../../../../../../node_modules/undici/lib/mock/mock-interceptor.js"],"sourcesContent":["'use strict'\n\nconst { getResponseData, buildKey, addMockDispatch } = require('./mock-utils')\nconst {\n kDispatches,\n kDispatchKey,\n kDefaultHeaders,\n kDefaultTrailers,\n kContentLength,\n kMockDispatch\n} = require('./mock-symbols')\nconst { InvalidArgumentError } = require('../core/errors')\nconst { buildURL } = require('../core/util')\n\n/**\n * Defines the scope API for an interceptor reply\n */\nclass MockScope {\n constructor (mockDispatch) {\n this[kMockDispatch] = mockDispatch\n }\n\n /**\n * Delay a reply by a set amount in ms.\n */\n delay (waitInMs) {\n if (typeof waitInMs !== 'number' || !Number.isInteger(waitInMs) || waitInMs <= 0) {\n throw new InvalidArgumentError('waitInMs must be a valid integer > 0')\n }\n\n this[kMockDispatch].delay = waitInMs\n return this\n }\n\n /**\n * For a defined reply, never mark as consumed.\n */\n persist () {\n this[kMockDispatch].persist = true\n return this\n }\n\n /**\n * Allow one to define a reply for a set amount of matching requests.\n */\n times (repeatTimes) {\n if (typeof repeatTimes !== 'number' || !Number.isInteger(repeatTimes) || repeatTimes <= 0) {\n throw new InvalidArgumentError('repeatTimes must be a valid integer > 0')\n }\n\n this[kMockDispatch].times = repeatTimes\n return this\n }\n}\n\n/**\n * Defines an interceptor for a Mock\n */\nclass MockInterceptor {\n constructor (opts, mockDispatches) {\n if (typeof opts !== 'object') {\n throw new InvalidArgumentError('opts must be an object')\n }\n if (typeof opts.path === 'undefined') {\n throw new InvalidArgumentError('opts.path must be defined')\n }\n if (typeof opts.method === 'undefined') {\n opts.method = 'GET'\n }\n // See https://github.com/nodejs/undici/issues/1245\n // As per RFC 3986, clients are not supposed to send URI\n // fragments to servers when they retrieve a document,\n if (typeof opts.path === 'string') {\n if (opts.query) {\n opts.path = buildURL(opts.path, opts.query)\n } else {\n // Matches https://github.com/nodejs/undici/blob/main/lib/fetch/index.js#L1811\n const parsedURL = new URL(opts.path, 'data://')\n opts.path = parsedURL.pathname + parsedURL.search\n }\n }\n if (typeof opts.method === 'string') {\n opts.method = opts.method.toUpperCase()\n }\n\n this[kDispatchKey] = buildKey(opts)\n this[kDispatches] = mockDispatches\n this[kDefaultHeaders] = {}\n this[kDefaultTrailers] = {}\n this[kContentLength] = false\n }\n\n createMockScopeDispatchData (statusCode, data, responseOptions = {}) {\n const responseData = getResponseData(data)\n const contentLength = this[kContentLength] ? { 'content-length': responseData.length } : {}\n const headers = { ...this[kDefaultHeaders], ...contentLength, ...responseOptions.headers }\n const trailers = { ...this[kDefaultTrailers], ...responseOptions.trailers }\n\n return { statusCode, data, headers, trailers }\n }\n\n validateReplyParameters (statusCode, data, responseOptions) {\n if (typeof statusCode === 'undefined') {\n throw new InvalidArgumentError('statusCode must be defined')\n }\n if (typeof data === 'undefined') {\n throw new InvalidArgumentError('data must be defined')\n }\n if (typeof responseOptions !== 'object') {\n throw new InvalidArgumentError('responseOptions must be an object')\n }\n }\n\n /**\n * Mock an undici request with a defined reply.\n */\n reply (replyData) {\n // Values of reply aren't available right now as they\n // can only be available when the reply callback is invoked.\n if (typeof replyData === 'function') {\n // We'll first wrap the provided callback in another function,\n // this function will properly resolve the data from the callback\n // when invoked.\n const wrappedDefaultsCallback = (opts) => {\n // Our reply options callback contains the parameter for statusCode, data and options.\n const resolvedData = replyData(opts)\n\n // Check if it is in the right format\n if (typeof resolvedData !== 'object') {\n throw new InvalidArgumentError('reply options callback must return an object')\n }\n\n const { statusCode, data = '', responseOptions = {} } = resolvedData\n this.validateReplyParameters(statusCode, data, responseOptions)\n // Since the values can be obtained immediately we return them\n // from this higher order function that will be resolved later.\n return {\n ...this.createMockScopeDispatchData(statusCode, data, responseOptions)\n }\n }\n\n // Add usual dispatch data, but this time set the data parameter to function that will eventually provide data.\n const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], wrappedDefaultsCallback)\n return new MockScope(newMockDispatch)\n }\n\n // We can have either one or three parameters, if we get here,\n // we should have 1-3 parameters. So we spread the arguments of\n // this function to obtain the parameters, since replyData will always\n // just be the statusCode.\n const [statusCode, data = '', responseOptions = {}] = [...arguments]\n this.validateReplyParameters(statusCode, data, responseOptions)\n\n // Send in-already provided data like usual\n const dispatchData = this.createMockScopeDispatchData(statusCode, data, responseOptions)\n const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], dispatchData)\n return new MockScope(newMockDispatch)\n }\n\n /**\n * Mock an undici request with a defined error.\n */\n replyWithError (error) {\n if (typeof error === 'undefined') {\n throw new InvalidArgumentError('error must be defined')\n }\n\n const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error })\n return new MockScope(newMockDispatch)\n }\n\n /**\n * Set default reply headers on the interceptor for subsequent replies\n */\n defaultReplyHeaders (headers) {\n if (typeof headers === 'undefined') {\n throw new InvalidArgumentError('headers must be defined')\n }\n\n this[kDefaultHeaders] = headers\n return this\n }\n\n /**\n * Set default reply trailers on the interceptor for subsequent replies\n */\n defaultReplyTrailers (trailers) {\n if (typeof trailers === 'undefined') {\n throw new InvalidArgumentError('trailers must be defined')\n }\n\n this[kDefaultTrailers] = trailers\n return this\n }\n\n /**\n * Set reply content length header for replies on the interceptor\n */\n replyContentLength () {\n this[kContentLength] = true\n return this\n }\n}\n\nmodule.exports.MockInterceptor = MockInterceptor\nmodule.exports.MockScope = MockScope\n"],"names":["require$$0","require$$1","require$$2","require$$3","mockInterceptor"],"mappings":";;;;;;;;;;;;;;AAEA,CAAA,MAAM,EAAE,eAAe,EAAE,QAAQ,EAAE,eAAe,EAAE,GAAGA,mBAAA;CACvD,MAAM;AACN,GAAE,WAAW;AACb,GAAE,YAAY;AACd,GAAE,eAAe;AACjB,GAAE,gBAAgB;AAClB,GAAE,cAAc;GACd;AACF,EAAC,GAAGC,qBAAA;CACJ,MAAM,EAAE,oBAAoB,EAAE,GAAGC,gBAAA;CACjC,MAAM,EAAE,QAAQ,EAAE,GAAGC,cAAA;;AAErB;AACA;AACA;AACA,CAAA,MAAM,SAAS,CAAC;AAChB,GAAE,WAAW,CAAC,CAAC,YAAY,EAAE;AAC7B,KAAI,IAAI,CAAC,aAAa,CAAC,GAAG;AAC1B,GAAA;;AAEA;AACA;AACA;AACA,GAAE,KAAK,CAAC,CAAC,QAAQ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O;AACX,GAAA;;AAEA;AACA;AACA;GACE,kBAAkB,CAAC,GAAG;AACxB,KAAI,IAAI,CAAC,cAAc,CAAC,GAAG;AAC3B,KAAI,OAAO;AACX,GAAA;AACA;;AAEA,CAAAC,yBAAA,CAAA,eAA8B,GAAG;AACjC,CAAAA,yBAAA,CAAA,SAAwB,GAAG;;;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var require$$1 = require('node:util');
|
|
4
|
+
var pool = require('../pool.js');
|
|
5
|
+
var mockUtils = require('./mock-utils.js');
|
|
6
|
+
var mockSymbols = require('./mock-symbols.js');
|
|
7
|
+
var mockInterceptor = require('./mock-interceptor.js');
|
|
8
|
+
var symbols = require('../core/symbols.js');
|
|
9
|
+
var errors = require('../core/errors.js');
|
|
10
|
+
|
|
11
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
|
|
13
|
+
var require$$1__default = /*#__PURE__*/_interopDefault(require$$1);
|
|
14
|
+
|
|
15
|
+
var mockPool;
|
|
16
|
+
var hasRequiredMockPool;
|
|
17
|
+
|
|
18
|
+
function requireMockPool () {
|
|
19
|
+
if (hasRequiredMockPool) return mockPool;
|
|
20
|
+
hasRequiredMockPool = 1;
|
|
21
|
+
|
|
22
|
+
const { promisify } = require$$1__default.default;
|
|
23
|
+
const Pool = pool.__require();
|
|
24
|
+
const { buildMockDispatch } = mockUtils.__require();
|
|
25
|
+
const {
|
|
26
|
+
kDispatches,
|
|
27
|
+
kMockAgent,
|
|
28
|
+
kClose,
|
|
29
|
+
kOriginalClose,
|
|
30
|
+
kOrigin,
|
|
31
|
+
kOriginalDispatch,
|
|
32
|
+
kConnected
|
|
33
|
+
} = mockSymbols.__require();
|
|
34
|
+
const { MockInterceptor } = mockInterceptor.__require();
|
|
35
|
+
const Symbols = symbols.__require();
|
|
36
|
+
const { InvalidArgumentError } = errors.__require();
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* MockPool provides an API that extends the Pool to influence the mockDispatches.
|
|
40
|
+
*/
|
|
41
|
+
class MockPool extends Pool {
|
|
42
|
+
constructor (origin, opts) {
|
|
43
|
+
super(origin, opts);
|
|
44
|
+
|
|
45
|
+
if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') {
|
|
46
|
+
throw new InvalidArgumentError('Argument opts.agent must implement Agent')
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
this[kMockAgent] = opts.agent;
|
|
50
|
+
this[kOrigin] = origin;
|
|
51
|
+
this[kDispatches] = [];
|
|
52
|
+
this[kConnected] = 1;
|
|
53
|
+
this[kOriginalDispatch] = this.dispatch;
|
|
54
|
+
this[kOriginalClose] = this.close.bind(this);
|
|
55
|
+
|
|
56
|
+
this.dispatch = buildMockDispatch.call(this);
|
|
57
|
+
this.close = this[kClose];
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
get [Symbols.kConnected] () {
|
|
61
|
+
return this[kConnected]
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Sets up the base interceptor for mocking replies from undici.
|
|
66
|
+
*/
|
|
67
|
+
intercept (opts) {
|
|
68
|
+
return new MockInterceptor(opts, this[kDispatches])
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
async [kClose] () {
|
|
72
|
+
await promisify(this[kOriginalClose])();
|
|
73
|
+
this[kConnected] = 0;
|
|
74
|
+
this[kMockAgent][Symbols.kClients].delete(this[kOrigin]);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
mockPool = MockPool;
|
|
79
|
+
return mockPool;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
exports.__require = requireMockPool;
|
|
83
|
+
//# sourceMappingURL=mock-pool.js.map
|