@chainlink/external-adapter-framework 1.7.6 → 1.7.7
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/adapter-generator.js +2 -2
- package/generator-adapter/node_modules/.yarn-integrity +23 -47
- package/generator-adapter/node_modules/@octokit/auth-token/README.md +5 -10
- package/generator-adapter/node_modules/@octokit/auth-token/dist-node/index.js +44 -20
- package/generator-adapter/node_modules/@octokit/auth-token/dist-node/index.js.map +7 -1
- package/generator-adapter/node_modules/@octokit/auth-token/dist-src/auth.js +13 -17
- package/generator-adapter/node_modules/@octokit/auth-token/dist-src/hook.js +10 -4
- package/generator-adapter/node_modules/@octokit/auth-token/dist-src/index.js +16 -11
- package/generator-adapter/node_modules/@octokit/auth-token/dist-src/with-authorization-prefix.js +8 -10
- package/generator-adapter/node_modules/@octokit/auth-token/dist-types/auth.d.ts +1 -1
- package/generator-adapter/node_modules/@octokit/auth-token/dist-types/hook.d.ts +1 -1
- package/generator-adapter/node_modules/@octokit/auth-token/dist-types/index.d.ts +2 -2
- package/generator-adapter/node_modules/@octokit/auth-token/dist-types/types.d.ts +13 -13
- package/generator-adapter/node_modules/@octokit/auth-token/dist-web/index.js +42 -45
- package/generator-adapter/node_modules/@octokit/auth-token/dist-web/index.js.map +7 -1
- package/generator-adapter/node_modules/@octokit/auth-token/package.json +28 -29
- package/generator-adapter/node_modules/@octokit/core/README.md +6 -6
- package/generator-adapter/node_modules/@octokit/core/dist-node/index.js +117 -136
- package/generator-adapter/node_modules/@octokit/core/dist-node/index.js.map +7 -1
- package/generator-adapter/node_modules/@octokit/core/dist-src/index.js +115 -113
- package/generator-adapter/node_modules/@octokit/core/dist-src/version.js +4 -1
- package/generator-adapter/node_modules/@octokit/core/dist-types/index.d.ts +2 -2
- package/generator-adapter/node_modules/@octokit/core/dist-types/types.d.ts +7 -7
- package/generator-adapter/node_modules/@octokit/core/dist-types/version.d.ts +1 -1
- package/generator-adapter/node_modules/@octokit/core/dist-web/index.js +124 -122
- package/generator-adapter/node_modules/@octokit/core/dist-web/index.js.map +7 -1
- package/generator-adapter/node_modules/@octokit/core/package.json +34 -32
- package/generator-adapter/node_modules/@octokit/endpoint/README.md +3 -3
- package/generator-adapter/node_modules/@octokit/endpoint/dist-node/index.js +141 -176
- package/generator-adapter/node_modules/@octokit/endpoint/dist-node/index.js.map +7 -1
- package/generator-adapter/node_modules/@octokit/endpoint/dist-src/defaults.js +14 -13
- package/generator-adapter/node_modules/@octokit/endpoint/dist-src/endpoint-with-defaults.js +5 -2
- package/generator-adapter/node_modules/@octokit/endpoint/dist-src/index.js +4 -1
- package/generator-adapter/node_modules/@octokit/endpoint/dist-src/merge.js +21 -22
- package/generator-adapter/node_modules/@octokit/endpoint/dist-src/parse.js +60 -73
- package/generator-adapter/node_modules/@octokit/endpoint/dist-src/util/add-query-parameters.js +14 -15
- package/generator-adapter/node_modules/@octokit/endpoint/dist-src/util/extract-url-variable-names.js +10 -7
- package/generator-adapter/node_modules/@octokit/endpoint/dist-src/util/lowercase-keys.js +11 -8
- package/generator-adapter/node_modules/@octokit/endpoint/dist-src/util/merge-deep.js +16 -14
- package/generator-adapter/node_modules/@octokit/endpoint/dist-src/util/omit.js +8 -7
- package/generator-adapter/node_modules/@octokit/endpoint/dist-src/util/remove-undefined-properties.js +9 -6
- package/generator-adapter/node_modules/@octokit/endpoint/dist-src/util/url-template.js +105 -141
- package/generator-adapter/node_modules/@octokit/endpoint/dist-src/version.js +4 -1
- package/generator-adapter/node_modules/@octokit/endpoint/dist-src/with-defaults.js +12 -9
- package/generator-adapter/node_modules/@octokit/endpoint/dist-types/defaults.d.ts +1 -1
- package/generator-adapter/node_modules/@octokit/endpoint/dist-types/endpoint-with-defaults.d.ts +1 -1
- package/generator-adapter/node_modules/@octokit/endpoint/dist-types/merge.d.ts +1 -1
- package/generator-adapter/node_modules/@octokit/endpoint/dist-types/parse.d.ts +1 -1
- package/generator-adapter/node_modules/@octokit/endpoint/dist-types/version.d.ts +1 -1
- package/generator-adapter/node_modules/@octokit/endpoint/dist-types/with-defaults.d.ts +1 -1
- package/generator-adapter/node_modules/@octokit/endpoint/dist-web/index.js +263 -316
- package/generator-adapter/node_modules/@octokit/endpoint/dist-web/index.js.map +7 -1
- package/generator-adapter/node_modules/@octokit/endpoint/package.json +30 -28
- package/generator-adapter/node_modules/@octokit/graphql/README.md +4 -4
- package/generator-adapter/node_modules/@octokit/graphql/dist-node/index.js +87 -59
- package/generator-adapter/node_modules/@octokit/graphql/dist-node/index.js.map +7 -1
- package/generator-adapter/node_modules/@octokit/graphql/dist-src/error.js +17 -17
- package/generator-adapter/node_modules/@octokit/graphql/dist-src/graphql.js +55 -44
- package/generator-adapter/node_modules/@octokit/graphql/dist-src/index.js +17 -12
- package/generator-adapter/node_modules/@octokit/graphql/dist-src/version.js +4 -1
- package/generator-adapter/node_modules/@octokit/graphql/dist-src/with-defaults.js +12 -10
- package/generator-adapter/node_modules/@octokit/graphql/dist-types/error.d.ts +3 -3
- package/generator-adapter/node_modules/@octokit/graphql/dist-types/graphql.d.ts +1 -1
- package/generator-adapter/node_modules/@octokit/graphql/dist-types/index.d.ts +1 -1
- package/generator-adapter/node_modules/@octokit/graphql/dist-types/types.d.ts +7 -7
- package/generator-adapter/node_modules/@octokit/graphql/dist-types/version.d.ts +1 -1
- package/generator-adapter/node_modules/@octokit/graphql/dist-types/with-defaults.d.ts +1 -1
- package/generator-adapter/node_modules/@octokit/graphql/dist-web/index.js +103 -90
- package/generator-adapter/node_modules/@octokit/graphql/dist-web/index.js.map +7 -1
- package/generator-adapter/node_modules/@octokit/graphql/package.json +28 -27
- package/generator-adapter/node_modules/@octokit/openapi-types/package.json +2 -2
- package/generator-adapter/node_modules/@octokit/openapi-types/types.d.ts +78988 -14662
- package/generator-adapter/node_modules/@octokit/plugin-paginate-rest/dist-node/index.js +297 -116
- package/generator-adapter/node_modules/@octokit/plugin-paginate-rest/dist-node/index.js.map +7 -1
- package/generator-adapter/node_modules/@octokit/plugin-paginate-rest/dist-src/compose-paginate.js +5 -2
- package/generator-adapter/node_modules/@octokit/plugin-paginate-rest/dist-src/generated/paginating-endpoints.js +226 -215
- package/generator-adapter/node_modules/@octokit/plugin-paginate-rest/dist-src/index.js +17 -12
- package/generator-adapter/node_modules/@octokit/plugin-paginate-rest/dist-src/iterator.js +36 -37
- package/generator-adapter/node_modules/@octokit/plugin-paginate-rest/dist-src/normalize-paginated-list-response.js +29 -45
- package/generator-adapter/node_modules/@octokit/plugin-paginate-rest/dist-src/paginate.js +31 -21
- package/generator-adapter/node_modules/@octokit/plugin-paginate-rest/dist-src/paginating-endpoints.js +14 -9
- package/generator-adapter/node_modules/@octokit/plugin-paginate-rest/dist-src/version.js +4 -1
- package/generator-adapter/node_modules/@octokit/plugin-paginate-rest/dist-types/compose-paginate.d.ts +1 -1
- package/generator-adapter/node_modules/@octokit/plugin-paginate-rest/dist-types/generated/paginating-endpoints.d.ts +228 -170
- package/generator-adapter/node_modules/@octokit/plugin-paginate-rest/dist-types/index.d.ts +3 -4
- package/generator-adapter/node_modules/@octokit/plugin-paginate-rest/dist-types/iterator.d.ts +3 -3
- package/generator-adapter/node_modules/@octokit/plugin-paginate-rest/dist-types/normalize-paginated-list-response.d.ts +1 -1
- package/generator-adapter/node_modules/@octokit/plugin-paginate-rest/dist-types/paginate.d.ts +3 -3
- package/generator-adapter/node_modules/@octokit/plugin-paginate-rest/dist-types/types.d.ts +29 -29
- package/generator-adapter/node_modules/@octokit/plugin-paginate-rest/dist-types/version.d.ts +1 -1
- package/generator-adapter/node_modules/@octokit/plugin-paginate-rest/dist-web/index.js +334 -336
- package/generator-adapter/node_modules/@octokit/plugin-paginate-rest/dist-web/index.js.map +7 -1
- package/generator-adapter/node_modules/@octokit/plugin-paginate-rest/package.json +31 -30
- package/generator-adapter/node_modules/@octokit/plugin-rest-endpoint-methods/dist-node/index.js +1487 -581
- package/generator-adapter/node_modules/@octokit/plugin-rest-endpoint-methods/dist-node/index.js.map +7 -1
- package/generator-adapter/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js +89 -54
- package/generator-adapter/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js +1868 -1662
- package/generator-adapter/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/method-types.js +0 -1
- package/generator-adapter/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/parameters-and-response-types.js +0 -1
- package/generator-adapter/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js +15 -12
- package/generator-adapter/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js +4 -1
- package/generator-adapter/node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/endpoints-to-methods.d.ts +3 -4
- package/generator-adapter/node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/generated/endpoints.d.ts +1 -1
- package/generator-adapter/node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/generated/method-types.d.ts +2118 -658
- package/generator-adapter/node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/generated/parameters-and-response-types.d.ts +471 -83
- package/generator-adapter/node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/index.d.ts +3 -3
- package/generator-adapter/node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/types.d.ts +5 -5
- package/generator-adapter/node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/version.d.ts +1 -1
- package/generator-adapter/node_modules/@octokit/plugin-rest-endpoint-methods/dist-web/index.js +1970 -1730
- package/generator-adapter/node_modules/@octokit/plugin-rest-endpoint-methods/dist-web/index.js.map +7 -1
- package/generator-adapter/node_modules/{got/license → @octokit/plugin-rest-endpoint-methods/node_modules/@octokit/types/LICENSE} +2 -4
- package/generator-adapter/node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/types/README.md +65 -0
- package/generator-adapter/node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/types/dist-types/AuthInterface.d.ts +31 -0
- package/generator-adapter/node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/types/dist-types/EndpointDefaults.d.ts +21 -0
- package/generator-adapter/node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/types/dist-types/EndpointInterface.d.ts +65 -0
- package/generator-adapter/node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/types/dist-types/EndpointOptions.d.ts +7 -0
- package/generator-adapter/node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/types/dist-types/Fetch.d.ts +4 -0
- package/generator-adapter/node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/types/dist-types/GetResponseTypeFromEndpointMethod.d.ts +5 -0
- package/generator-adapter/node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/types/dist-types/OctokitResponse.d.ts +17 -0
- package/generator-adapter/node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/types/dist-types/RequestError.d.ts +11 -0
- package/generator-adapter/node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/types/dist-types/RequestHeaders.d.ts +15 -0
- package/generator-adapter/node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/types/dist-types/RequestInterface.d.ts +34 -0
- package/generator-adapter/node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/types/dist-types/RequestMethod.d.ts +4 -0
- package/generator-adapter/node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/types/dist-types/RequestOptions.d.ts +14 -0
- package/generator-adapter/node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/types/dist-types/RequestParameters.d.ts +45 -0
- package/generator-adapter/node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/types/dist-types/RequestRequestOptions.d.ts +26 -0
- package/generator-adapter/node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/types/dist-types/ResponseHeaders.d.ts +20 -0
- package/generator-adapter/node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/types/dist-types/Route.d.ts +4 -0
- package/generator-adapter/node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/types/dist-types/Signal.d.ts +6 -0
- package/generator-adapter/node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/types/dist-types/StrategyInterface.d.ts +4 -0
- package/generator-adapter/node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/types/dist-types/Url.d.ts +4 -0
- package/generator-adapter/node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/types/dist-types/VERSION.d.ts +1 -0
- package/generator-adapter/node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/types/dist-types/generated/Endpoints.d.ts +3634 -0
- package/generator-adapter/node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/types/package.json +46 -0
- package/generator-adapter/node_modules/@octokit/plugin-rest-endpoint-methods/package.json +31 -30
- package/generator-adapter/node_modules/@octokit/request/README.md +9 -7
- package/generator-adapter/node_modules/@octokit/request/dist-node/index.js +105 -75
- package/generator-adapter/node_modules/@octokit/request/dist-node/index.js.map +7 -1
- package/generator-adapter/node_modules/@octokit/request/dist-src/fetch-wrapper.js +112 -105
- package/generator-adapter/node_modules/@octokit/request/dist-src/get-buffer-response.js +5 -2
- package/generator-adapter/node_modules/@octokit/request/dist-src/index.js +7 -4
- package/generator-adapter/node_modules/@octokit/request/dist-src/version.js +4 -1
- package/generator-adapter/node_modules/@octokit/request/dist-src/with-defaults.js +23 -18
- package/generator-adapter/node_modules/@octokit/request/dist-types/fetch-wrapper.d.ts +1 -1
- package/generator-adapter/node_modules/@octokit/request/dist-types/get-buffer-response.d.ts +1 -1
- package/generator-adapter/node_modules/@octokit/request/dist-types/version.d.ts +1 -1
- package/generator-adapter/node_modules/@octokit/request/dist-types/with-defaults.d.ts +1 -1
- package/generator-adapter/node_modules/@octokit/request/dist-web/index.js +148 -134
- package/generator-adapter/node_modules/@octokit/request/dist-web/index.js.map +7 -1
- package/generator-adapter/node_modules/@octokit/request/package.json +30 -29
- package/generator-adapter/node_modules/@octokit/request-error/README.md +11 -7
- package/generator-adapter/node_modules/@octokit/request-error/dist-node/index.js +10 -19
- package/generator-adapter/node_modules/@octokit/request-error/dist-node/index.js.map +1 -1
- package/generator-adapter/node_modules/@octokit/request-error/dist-types/types.d.ts +1 -1
- package/generator-adapter/node_modules/@octokit/request-error/package.json +16 -14
- package/generator-adapter/node_modules/@octokit/rest/README.md +5 -5
- package/generator-adapter/node_modules/@octokit/rest/dist-node/index.js +40 -12
- package/generator-adapter/node_modules/@octokit/rest/dist-node/index.js.map +7 -1
- package/generator-adapter/node_modules/@octokit/rest/dist-src/index.js +9 -2
- package/generator-adapter/node_modules/@octokit/rest/dist-src/version.js +4 -1
- package/generator-adapter/node_modules/@octokit/rest/dist-types/index.d.ts +2 -2
- package/generator-adapter/node_modules/@octokit/rest/dist-types/version.d.ts +1 -1
- package/generator-adapter/node_modules/@octokit/rest/dist-web/index.js +17 -10
- package/generator-adapter/node_modules/@octokit/rest/dist-web/index.js.map +7 -1
- package/generator-adapter/node_modules/@octokit/rest/package.json +32 -29
- package/generator-adapter/node_modules/{quick-lru/license → @octokit/tsconfig/LICENSE} +2 -4
- package/generator-adapter/node_modules/@octokit/tsconfig/README.md +31 -0
- package/generator-adapter/node_modules/@octokit/tsconfig/package.json +28 -0
- package/generator-adapter/node_modules/@octokit/tsconfig/tsconfig.json +11 -0
- package/generator-adapter/node_modules/@octokit/types/dist-types/EndpointDefaults.d.ts +1 -1
- package/generator-adapter/node_modules/@octokit/types/dist-types/EndpointOptions.d.ts +1 -1
- package/generator-adapter/node_modules/@octokit/types/dist-types/Fetch.d.ts +1 -1
- package/generator-adapter/node_modules/@octokit/types/dist-types/GetResponseTypeFromEndpointMethod.d.ts +4 -4
- package/generator-adapter/node_modules/@octokit/types/dist-types/OctokitResponse.d.ts +1 -1
- package/generator-adapter/node_modules/@octokit/types/dist-types/RequestError.d.ts +1 -1
- package/generator-adapter/node_modules/@octokit/types/dist-types/RequestHeaders.d.ts +1 -1
- package/generator-adapter/node_modules/@octokit/types/dist-types/RequestMethod.d.ts +1 -1
- package/generator-adapter/node_modules/@octokit/types/dist-types/RequestOptions.d.ts +1 -1
- package/generator-adapter/node_modules/@octokit/types/dist-types/RequestParameters.d.ts +1 -1
- package/generator-adapter/node_modules/@octokit/types/dist-types/RequestRequestOptions.d.ts +1 -1
- package/generator-adapter/node_modules/@octokit/types/dist-types/ResponseHeaders.d.ts +1 -1
- package/generator-adapter/node_modules/@octokit/types/dist-types/Route.d.ts +1 -1
- package/generator-adapter/node_modules/@octokit/types/dist-types/Signal.d.ts +1 -1
- package/generator-adapter/node_modules/@octokit/types/dist-types/Url.d.ts +1 -1
- package/generator-adapter/node_modules/@octokit/types/dist-types/VERSION.d.ts +1 -1
- package/generator-adapter/node_modules/@octokit/types/dist-types/generated/Endpoints.d.ts +595 -527
- package/generator-adapter/node_modules/@octokit/types/package.json +23 -31
- package/generator-adapter/node_modules/get-stream/package.json +20 -14
- package/generator-adapter/node_modules/get-stream/readme.md +240 -73
- package/generator-adapter/node_modules/github-username/index.d.ts +2 -2
- package/generator-adapter/node_modules/github-username/package.json +10 -7
- package/generator-adapter/node_modules/ky/distribution/core/Ky.d.ts +16 -0
- package/generator-adapter/node_modules/ky/distribution/core/Ky.js +272 -0
- package/generator-adapter/node_modules/ky/distribution/core/Ky.js.map +1 -0
- package/generator-adapter/node_modules/ky/distribution/core/constants.d.ts +18 -0
- package/generator-adapter/node_modules/ky/distribution/core/constants.js +75 -0
- package/generator-adapter/node_modules/ky/distribution/core/constants.js.map +1 -0
- package/generator-adapter/node_modules/ky/distribution/errors/HTTPError.d.ts +9 -0
- package/generator-adapter/node_modules/ky/distribution/errors/HTTPError.js +17 -0
- package/generator-adapter/node_modules/ky/distribution/errors/HTTPError.js.map +1 -0
- package/generator-adapter/node_modules/ky/distribution/errors/TimeoutError.d.ts +5 -0
- package/generator-adapter/node_modules/ky/distribution/errors/TimeoutError.js +9 -0
- package/generator-adapter/node_modules/ky/distribution/errors/TimeoutError.js.map +1 -0
- package/generator-adapter/node_modules/ky/distribution/index.d.ts +12 -0
- package/generator-adapter/node_modules/ky/distribution/index.js +26 -0
- package/generator-adapter/node_modules/ky/distribution/index.js.map +1 -0
- package/generator-adapter/node_modules/ky/distribution/types/ResponsePromise.d.ts +34 -0
- package/generator-adapter/node_modules/ky/distribution/types/ResponsePromise.js +2 -0
- package/generator-adapter/node_modules/ky/distribution/types/ResponsePromise.js.map +1 -0
- package/generator-adapter/node_modules/ky/distribution/types/common.d.ts +7 -0
- package/generator-adapter/node_modules/ky/distribution/types/common.js +2 -0
- package/generator-adapter/node_modules/ky/distribution/types/common.js.map +1 -0
- package/generator-adapter/node_modules/ky/distribution/types/hooks.d.ts +114 -0
- package/generator-adapter/node_modules/ky/distribution/types/hooks.js +2 -0
- package/generator-adapter/node_modules/ky/distribution/types/hooks.js.map +1 -0
- package/generator-adapter/node_modules/ky/distribution/types/ky.d.ts +127 -0
- package/generator-adapter/node_modules/ky/distribution/types/ky.js +2 -0
- package/generator-adapter/node_modules/ky/distribution/types/ky.js.map +1 -0
- package/generator-adapter/node_modules/ky/distribution/types/options.d.ts +260 -0
- package/generator-adapter/node_modules/ky/distribution/types/options.js +2 -0
- package/generator-adapter/node_modules/ky/distribution/types/options.js.map +1 -0
- package/generator-adapter/node_modules/ky/distribution/types/request.d.ts +30 -0
- package/generator-adapter/node_modules/ky/distribution/types/request.js +8 -0
- package/generator-adapter/node_modules/ky/distribution/types/request.js.map +1 -0
- package/generator-adapter/node_modules/ky/distribution/types/response.d.ts +3 -0
- package/generator-adapter/node_modules/ky/distribution/types/response.js +2 -0
- package/generator-adapter/node_modules/ky/distribution/types/response.js.map +1 -0
- package/generator-adapter/node_modules/ky/distribution/types/retry.d.ts +53 -0
- package/generator-adapter/node_modules/ky/distribution/types/retry.js +2 -0
- package/generator-adapter/node_modules/ky/distribution/types/retry.js.map +1 -0
- package/generator-adapter/node_modules/ky/distribution/utils/delay.d.ts +5 -0
- package/generator-adapter/node_modules/ky/distribution/utils/delay.js +18 -0
- package/generator-adapter/node_modules/ky/distribution/utils/delay.js.map +1 -0
- package/generator-adapter/node_modules/ky/distribution/utils/is.d.ts +1 -0
- package/generator-adapter/node_modules/ky/distribution/utils/is.js +3 -0
- package/generator-adapter/node_modules/ky/distribution/utils/is.js.map +1 -0
- package/generator-adapter/node_modules/ky/distribution/utils/merge.d.ts +6 -0
- package/generator-adapter/node_modules/ky/distribution/utils/merge.js +66 -0
- package/generator-adapter/node_modules/ky/distribution/utils/merge.js.map +1 -0
- package/generator-adapter/node_modules/ky/distribution/utils/normalize.d.ts +3 -0
- package/generator-adapter/node_modules/ky/distribution/utils/normalize.js +33 -0
- package/generator-adapter/node_modules/ky/distribution/utils/normalize.js.map +1 -0
- package/generator-adapter/node_modules/ky/distribution/utils/options.d.ts +1 -0
- package/generator-adapter/node_modules/ky/distribution/utils/options.js +11 -0
- package/generator-adapter/node_modules/ky/distribution/utils/options.js.map +1 -0
- package/generator-adapter/node_modules/ky/distribution/utils/timeout.d.ts +5 -0
- package/generator-adapter/node_modules/ky/distribution/utils/timeout.js +20 -0
- package/generator-adapter/node_modules/ky/distribution/utils/timeout.js.map +1 -0
- package/generator-adapter/node_modules/ky/distribution/utils/types.d.ts +6 -0
- package/generator-adapter/node_modules/ky/distribution/utils/types.js +2 -0
- package/generator-adapter/node_modules/ky/distribution/utils/types.js.map +1 -0
- package/generator-adapter/node_modules/ky/package.json +114 -0
- package/generator-adapter/node_modules/ky/readme.md +771 -0
- package/generator-adapter/node_modules/latest-version/index.d.ts +8 -9
- package/generator-adapter/node_modules/latest-version/index.js +2 -0
- package/generator-adapter/node_modules/latest-version/package.json +12 -9
- package/generator-adapter/node_modules/latest-version/readme.md +5 -15
- package/generator-adapter/node_modules/package-json/index.d.ts +235 -104
- package/generator-adapter/node_modules/package-json/index.js +20 -37
- package/generator-adapter/node_modules/package-json/package.json +17 -15
- package/generator-adapter/node_modules/package-json/readme.md +13 -4
- package/generator-adapter/node_modules/yeoman-generator/dist/actions/fs.d.ts +1 -1
- package/generator-adapter/node_modules/yeoman-generator/dist/actions/fs.js +21 -12
- package/generator-adapter/node_modules/yeoman-generator/dist/actions/help.d.ts +1 -1
- package/generator-adapter/node_modules/yeoman-generator/dist/actions/lifecycle.js +8 -7
- package/generator-adapter/node_modules/yeoman-generator/dist/generator.js +3 -3
- package/generator-adapter/node_modules/yeoman-generator/dist/index.d.ts +1 -0
- package/generator-adapter/node_modules/yeoman-generator/dist/util/storage.js +2 -2
- package/generator-adapter/node_modules/yeoman-generator/package.json +9 -10
- package/generator-adapter/package.json +1 -1
- package/package.json +1 -1
- package/generator-adapter/node_modules/@octokit/auth-token/dist-src/types.js +0 -1
- package/generator-adapter/node_modules/@octokit/core/dist-src/types.js +0 -1
- package/generator-adapter/node_modules/@octokit/graphql/dist-src/types.js +0 -1
- package/generator-adapter/node_modules/@octokit/plugin-paginate-rest/dist-src/types.js +0 -1
- package/generator-adapter/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/types.js +0 -1
- package/generator-adapter/node_modules/@octokit/types/dist-node/index.js +0 -8
- package/generator-adapter/node_modules/@octokit/types/dist-node/index.js.map +0 -1
- package/generator-adapter/node_modules/@octokit/types/dist-src/AuthInterface.js +0 -1
- package/generator-adapter/node_modules/@octokit/types/dist-src/EndpointDefaults.js +0 -1
- package/generator-adapter/node_modules/@octokit/types/dist-src/EndpointInterface.js +0 -1
- package/generator-adapter/node_modules/@octokit/types/dist-src/EndpointOptions.js +0 -1
- package/generator-adapter/node_modules/@octokit/types/dist-src/Fetch.js +0 -1
- package/generator-adapter/node_modules/@octokit/types/dist-src/GetResponseTypeFromEndpointMethod.js +0 -1
- package/generator-adapter/node_modules/@octokit/types/dist-src/OctokitResponse.js +0 -1
- package/generator-adapter/node_modules/@octokit/types/dist-src/RequestError.js +0 -1
- package/generator-adapter/node_modules/@octokit/types/dist-src/RequestHeaders.js +0 -1
- package/generator-adapter/node_modules/@octokit/types/dist-src/RequestInterface.js +0 -1
- package/generator-adapter/node_modules/@octokit/types/dist-src/RequestMethod.js +0 -1
- package/generator-adapter/node_modules/@octokit/types/dist-src/RequestOptions.js +0 -1
- package/generator-adapter/node_modules/@octokit/types/dist-src/RequestParameters.js +0 -1
- package/generator-adapter/node_modules/@octokit/types/dist-src/RequestRequestOptions.js +0 -1
- package/generator-adapter/node_modules/@octokit/types/dist-src/ResponseHeaders.js +0 -1
- package/generator-adapter/node_modules/@octokit/types/dist-src/Route.js +0 -1
- package/generator-adapter/node_modules/@octokit/types/dist-src/Signal.js +0 -1
- package/generator-adapter/node_modules/@octokit/types/dist-src/StrategyInterface.js +0 -1
- package/generator-adapter/node_modules/@octokit/types/dist-src/Url.js +0 -1
- package/generator-adapter/node_modules/@octokit/types/dist-src/VERSION.js +0 -1
- package/generator-adapter/node_modules/@octokit/types/dist-src/generated/Endpoints.js +0 -1
- package/generator-adapter/node_modules/@octokit/types/dist-web/index.js +0 -4
- package/generator-adapter/node_modules/@octokit/types/dist-web/index.js.map +0 -1
- package/generator-adapter/node_modules/@sindresorhus/is/dist/index.d.ts +0 -246
- package/generator-adapter/node_modules/@sindresorhus/is/dist/index.js +0 -454
- package/generator-adapter/node_modules/@sindresorhus/is/dist/types.d.ts +0 -32
- package/generator-adapter/node_modules/@sindresorhus/is/dist/types.js +0 -2
- package/generator-adapter/node_modules/@sindresorhus/is/package.json +0 -76
- package/generator-adapter/node_modules/@sindresorhus/is/readme.md +0 -698
- package/generator-adapter/node_modules/@szmarczak/http-timer/LICENSE +0 -21
- package/generator-adapter/node_modules/@szmarczak/http-timer/README.md +0 -93
- package/generator-adapter/node_modules/@szmarczak/http-timer/dist/source/index.d.ts +0 -32
- package/generator-adapter/node_modules/@szmarczak/http-timer/dist/source/index.js +0 -106
- package/generator-adapter/node_modules/@szmarczak/http-timer/package.json +0 -89
- package/generator-adapter/node_modules/@types/http-cache-semantics/LICENSE +0 -21
- package/generator-adapter/node_modules/@types/http-cache-semantics/README.md +0 -15
- package/generator-adapter/node_modules/@types/http-cache-semantics/index.d.ts +0 -165
- package/generator-adapter/node_modules/@types/http-cache-semantics/package.json +0 -25
- package/generator-adapter/node_modules/cacheable-lookup/LICENSE +0 -21
- package/generator-adapter/node_modules/cacheable-lookup/README.md +0 -245
- package/generator-adapter/node_modules/cacheable-lookup/index.d.ts +0 -144
- package/generator-adapter/node_modules/cacheable-lookup/package.json +0 -61
- package/generator-adapter/node_modules/cacheable-lookup/source/index.js +0 -452
- package/generator-adapter/node_modules/cacheable-request/README.md +0 -335
- package/generator-adapter/node_modules/cacheable-request/dist/index.d.ts +0 -17
- package/generator-adapter/node_modules/cacheable-request/dist/index.d.ts.map +0 -1
- package/generator-adapter/node_modules/cacheable-request/dist/index.js +0 -275
- package/generator-adapter/node_modules/cacheable-request/dist/index.js.map +0 -1
- package/generator-adapter/node_modules/cacheable-request/dist/types.d.ts +0 -106
- package/generator-adapter/node_modules/cacheable-request/dist/types.d.ts.map +0 -1
- package/generator-adapter/node_modules/cacheable-request/dist/types.js +0 -19
- package/generator-adapter/node_modules/cacheable-request/dist/types.js.map +0 -1
- package/generator-adapter/node_modules/cacheable-request/node_modules/mimic-response/index.d.ts +0 -29
- package/generator-adapter/node_modules/cacheable-request/node_modules/mimic-response/index.js +0 -75
- package/generator-adapter/node_modules/cacheable-request/node_modules/mimic-response/license +0 -9
- package/generator-adapter/node_modules/cacheable-request/node_modules/mimic-response/package.json +0 -44
- package/generator-adapter/node_modules/cacheable-request/node_modules/mimic-response/readme.md +0 -78
- package/generator-adapter/node_modules/cacheable-request/package.json +0 -121
- package/generator-adapter/node_modules/decompress-response/index.d.ts +0 -22
- package/generator-adapter/node_modules/decompress-response/index.js +0 -58
- package/generator-adapter/node_modules/decompress-response/license +0 -9
- package/generator-adapter/node_modules/decompress-response/package.json +0 -56
- package/generator-adapter/node_modules/decompress-response/readme.md +0 -48
- package/generator-adapter/node_modules/defer-to-connect/LICENSE +0 -21
- package/generator-adapter/node_modules/defer-to-connect/README.md +0 -38
- package/generator-adapter/node_modules/defer-to-connect/dist/source/index.d.ts +0 -10
- package/generator-adapter/node_modules/defer-to-connect/dist/source/index.js +0 -47
- package/generator-adapter/node_modules/defer-to-connect/package.json +0 -71
- package/generator-adapter/node_modules/execa/node_modules/get-stream/license +0 -9
- package/generator-adapter/node_modules/execa/node_modules/get-stream/package.json +0 -53
- package/generator-adapter/node_modules/execa/node_modules/get-stream/readme.md +0 -291
- package/generator-adapter/node_modules/form-data-encoder/@type/FileLike.d.ts +0 -23
- package/generator-adapter/node_modules/form-data-encoder/@type/FormDataEncoder.d.ts +0 -169
- package/generator-adapter/node_modules/form-data-encoder/@type/FormDataLike.d.ts +0 -40
- package/generator-adapter/node_modules/form-data-encoder/@type/index.d.ts +0 -5
- package/generator-adapter/node_modules/form-data-encoder/@type/util/Headers.d.ts +0 -8
- package/generator-adapter/node_modules/form-data-encoder/@type/util/createBoundary.d.ts +0 -12
- package/generator-adapter/node_modules/form-data-encoder/@type/util/escapeName.d.ts +0 -10
- package/generator-adapter/node_modules/form-data-encoder/@type/util/getStreamIterator.d.ts +0 -6
- package/generator-adapter/node_modules/form-data-encoder/@type/util/isFile.d.ts +0 -34
- package/generator-adapter/node_modules/form-data-encoder/@type/util/isFormData.d.ts +0 -7
- package/generator-adapter/node_modules/form-data-encoder/@type/util/isFunction.d.ts +0 -6
- package/generator-adapter/node_modules/form-data-encoder/@type/util/isPlainObject.d.ts +0 -1
- package/generator-adapter/node_modules/form-data-encoder/@type/util/normalizeValue.d.ts +0 -10
- package/generator-adapter/node_modules/form-data-encoder/@type/util/proxyHeaders.d.ts +0 -2
- package/generator-adapter/node_modules/form-data-encoder/lib/FileLike.js +0 -1
- package/generator-adapter/node_modules/form-data-encoder/lib/FormDataEncoder.js +0 -134
- package/generator-adapter/node_modules/form-data-encoder/lib/FormDataLike.js +0 -1
- package/generator-adapter/node_modules/form-data-encoder/lib/index.js +0 -5
- package/generator-adapter/node_modules/form-data-encoder/lib/util/Headers.js +0 -1
- package/generator-adapter/node_modules/form-data-encoder/lib/util/createBoundary.js +0 -9
- package/generator-adapter/node_modules/form-data-encoder/lib/util/escapeName.js +0 -4
- package/generator-adapter/node_modules/form-data-encoder/lib/util/getStreamIterator.js +0 -21
- package/generator-adapter/node_modules/form-data-encoder/lib/util/isFile.js +0 -8
- package/generator-adapter/node_modules/form-data-encoder/lib/util/isFormData.js +0 -8
- package/generator-adapter/node_modules/form-data-encoder/lib/util/isFunction.js +0 -1
- package/generator-adapter/node_modules/form-data-encoder/lib/util/isPlainObject.js +0 -12
- package/generator-adapter/node_modules/form-data-encoder/lib/util/normalizeValue.js +0 -8
- package/generator-adapter/node_modules/form-data-encoder/lib/util/proxyHeaders.js +0 -14
- package/generator-adapter/node_modules/form-data-encoder/license +0 -21
- package/generator-adapter/node_modules/form-data-encoder/package.json +0 -70
- package/generator-adapter/node_modules/form-data-encoder/readme.md +0 -368
- package/generator-adapter/node_modules/get-stream/buffer-stream.js +0 -52
- package/generator-adapter/node_modules/get-stream/index.d.ts +0 -105
- package/generator-adapter/node_modules/get-stream/index.js +0 -61
- package/generator-adapter/node_modules/got/dist/source/as-promise/index.d.ts +0 -3
- package/generator-adapter/node_modules/got/dist/source/as-promise/index.js +0 -158
- package/generator-adapter/node_modules/got/dist/source/as-promise/types.d.ts +0 -38
- package/generator-adapter/node_modules/got/dist/source/as-promise/types.js +0 -17
- package/generator-adapter/node_modules/got/dist/source/core/calculate-retry-delay.d.ts +0 -4
- package/generator-adapter/node_modules/got/dist/source/core/calculate-retry-delay.js +0 -29
- package/generator-adapter/node_modules/got/dist/source/core/errors.d.ts +0 -90
- package/generator-adapter/node_modules/got/dist/source/core/errors.js +0 -178
- package/generator-adapter/node_modules/got/dist/source/core/index.d.ts +0 -191
- package/generator-adapter/node_modules/got/dist/source/core/index.js +0 -1125
- package/generator-adapter/node_modules/got/dist/source/core/options.d.ts +0 -1256
- package/generator-adapter/node_modules/got/dist/source/core/options.js +0 -1653
- package/generator-adapter/node_modules/got/dist/source/core/parse-link-header.d.ts +0 -4
- package/generator-adapter/node_modules/got/dist/source/core/parse-link-header.js +0 -33
- package/generator-adapter/node_modules/got/dist/source/core/response.d.ts +0 -110
- package/generator-adapter/node_modules/got/dist/source/core/response.js +0 -39
- package/generator-adapter/node_modules/got/dist/source/core/timed-out.d.ts +0 -30
- package/generator-adapter/node_modules/got/dist/source/core/timed-out.js +0 -138
- package/generator-adapter/node_modules/got/dist/source/core/utils/get-body-size.d.ts +0 -3
- package/generator-adapter/node_modules/got/dist/source/core/utils/get-body-size.js +0 -22
- package/generator-adapter/node_modules/got/dist/source/core/utils/is-client-request.d.ts +0 -5
- package/generator-adapter/node_modules/got/dist/source/core/utils/is-client-request.js +0 -4
- package/generator-adapter/node_modules/got/dist/source/core/utils/is-form-data.d.ts +0 -8
- package/generator-adapter/node_modules/got/dist/source/core/utils/is-form-data.js +0 -4
- package/generator-adapter/node_modules/got/dist/source/core/utils/is-unix-socket-url.d.ts +0 -3
- package/generator-adapter/node_modules/got/dist/source/core/utils/is-unix-socket-url.js +0 -4
- package/generator-adapter/node_modules/got/dist/source/core/utils/options-to-url.d.ts +0 -14
- package/generator-adapter/node_modules/got/dist/source/core/utils/options-to-url.js +0 -50
- package/generator-adapter/node_modules/got/dist/source/core/utils/proxy-events.d.ts +0 -3
- package/generator-adapter/node_modules/got/dist/source/core/utils/proxy-events.js +0 -15
- package/generator-adapter/node_modules/got/dist/source/core/utils/unhandle.d.ts +0 -11
- package/generator-adapter/node_modules/got/dist/source/core/utils/unhandle.js +0 -20
- package/generator-adapter/node_modules/got/dist/source/core/utils/url-to-options.d.ts +0 -15
- package/generator-adapter/node_modules/got/dist/source/core/utils/url-to-options.js +0 -22
- package/generator-adapter/node_modules/got/dist/source/core/utils/weakable-map.d.ts +0 -8
- package/generator-adapter/node_modules/got/dist/source/core/utils/weakable-map.js +0 -38
- package/generator-adapter/node_modules/got/dist/source/create.d.ts +0 -3
- package/generator-adapter/node_modules/got/dist/source/create.js +0 -187
- package/generator-adapter/node_modules/got/dist/source/index.d.ts +0 -15
- package/generator-adapter/node_modules/got/dist/source/index.js +0 -20
- package/generator-adapter/node_modules/got/dist/source/types.d.ts +0 -263
- package/generator-adapter/node_modules/got/dist/source/types.js +0 -1
- package/generator-adapter/node_modules/got/package.json +0 -154
- package/generator-adapter/node_modules/got/readme.md +0 -527
- package/generator-adapter/node_modules/http-cache-semantics/LICENSE +0 -9
- package/generator-adapter/node_modules/http-cache-semantics/README.md +0 -203
- package/generator-adapter/node_modules/http-cache-semantics/index.js +0 -674
- package/generator-adapter/node_modules/http-cache-semantics/package.json +0 -18
- package/generator-adapter/node_modules/http2-wrapper/LICENSE +0 -21
- package/generator-adapter/node_modules/http2-wrapper/README.md +0 -459
- package/generator-adapter/node_modules/http2-wrapper/index.d.ts +0 -141
- package/generator-adapter/node_modules/http2-wrapper/package.json +0 -81
- package/generator-adapter/node_modules/http2-wrapper/source/agent.js +0 -796
- package/generator-adapter/node_modules/http2-wrapper/source/auto.js +0 -225
- package/generator-adapter/node_modules/http2-wrapper/source/client-request.js +0 -563
- package/generator-adapter/node_modules/http2-wrapper/source/incoming-message.js +0 -73
- package/generator-adapter/node_modules/http2-wrapper/source/index.js +0 -50
- package/generator-adapter/node_modules/http2-wrapper/source/proxies/get-auth-headers.js +0 -17
- package/generator-adapter/node_modules/http2-wrapper/source/proxies/h1-over-h2.js +0 -90
- package/generator-adapter/node_modules/http2-wrapper/source/proxies/h2-over-h1.js +0 -48
- package/generator-adapter/node_modules/http2-wrapper/source/proxies/h2-over-h2.js +0 -32
- package/generator-adapter/node_modules/http2-wrapper/source/proxies/h2-over-hx.js +0 -40
- package/generator-adapter/node_modules/http2-wrapper/source/proxies/initialize.js +0 -21
- package/generator-adapter/node_modules/http2-wrapper/source/proxies/unexpected-status-code-error.js +0 -11
- package/generator-adapter/node_modules/http2-wrapper/source/utils/calculate-server-name.js +0 -29
- package/generator-adapter/node_modules/http2-wrapper/source/utils/check-type.js +0 -20
- package/generator-adapter/node_modules/http2-wrapper/source/utils/delay-async-destroy.js +0 -33
- package/generator-adapter/node_modules/http2-wrapper/source/utils/errors.js +0 -51
- package/generator-adapter/node_modules/http2-wrapper/source/utils/is-request-pseudo-header.js +0 -13
- package/generator-adapter/node_modules/http2-wrapper/source/utils/js-stream-socket.js +0 -8
- package/generator-adapter/node_modules/http2-wrapper/source/utils/proxy-events.js +0 -7
- package/generator-adapter/node_modules/http2-wrapper/source/utils/proxy-socket-handler.js +0 -102
- package/generator-adapter/node_modules/http2-wrapper/source/utils/validate-header-name.js +0 -11
- package/generator-adapter/node_modules/http2-wrapper/source/utils/validate-header-value.js +0 -17
- package/generator-adapter/node_modules/json-buffer/.travis.yml +0 -3
- package/generator-adapter/node_modules/json-buffer/LICENSE +0 -22
- package/generator-adapter/node_modules/json-buffer/README.md +0 -24
- package/generator-adapter/node_modules/json-buffer/index.js +0 -58
- package/generator-adapter/node_modules/json-buffer/package.json +0 -34
- package/generator-adapter/node_modules/json-buffer/test/index.js +0 -63
- package/generator-adapter/node_modules/keyv/README.md +0 -429
- package/generator-adapter/node_modules/keyv/package.json +0 -57
- package/generator-adapter/node_modules/keyv/src/index.d.ts +0 -112
- package/generator-adapter/node_modules/keyv/src/index.js +0 -259
- package/generator-adapter/node_modules/lowercase-keys/index.d.ts +0 -14
- package/generator-adapter/node_modules/lowercase-keys/index.js +0 -3
- package/generator-adapter/node_modules/lowercase-keys/license +0 -9
- package/generator-adapter/node_modules/lowercase-keys/package.json +0 -41
- package/generator-adapter/node_modules/lowercase-keys/readme.md +0 -32
- package/generator-adapter/node_modules/mimic-response/index.d.ts +0 -17
- package/generator-adapter/node_modules/mimic-response/index.js +0 -77
- package/generator-adapter/node_modules/mimic-response/license +0 -9
- package/generator-adapter/node_modules/mimic-response/package.json +0 -42
- package/generator-adapter/node_modules/mimic-response/readme.md +0 -78
- package/generator-adapter/node_modules/normalize-url/index.d.ts +0 -303
- package/generator-adapter/node_modules/normalize-url/index.js +0 -285
- package/generator-adapter/node_modules/normalize-url/license +0 -9
- package/generator-adapter/node_modules/normalize-url/package.json +0 -57
- package/generator-adapter/node_modules/normalize-url/readme.md +0 -312
- package/generator-adapter/node_modules/p-cancelable/index.d.ts +0 -168
- package/generator-adapter/node_modules/p-cancelable/index.js +0 -110
- package/generator-adapter/node_modules/p-cancelable/license +0 -9
- package/generator-adapter/node_modules/p-cancelable/package.json +0 -50
- package/generator-adapter/node_modules/p-cancelable/readme.md +0 -152
- package/generator-adapter/node_modules/quick-lru/index.d.ts +0 -97
- package/generator-adapter/node_modules/quick-lru/index.js +0 -123
- package/generator-adapter/node_modules/quick-lru/package.json +0 -43
- package/generator-adapter/node_modules/quick-lru/readme.md +0 -111
- package/generator-adapter/node_modules/resolve-alpn/LICENSE +0 -22
- package/generator-adapter/node_modules/resolve-alpn/README.md +0 -60
- package/generator-adapter/node_modules/resolve-alpn/index.js +0 -43
- package/generator-adapter/node_modules/resolve-alpn/package.json +0 -34
- package/generator-adapter/node_modules/responselike/index.d.ts +0 -86
- package/generator-adapter/node_modules/responselike/index.js +0 -39
- package/generator-adapter/node_modules/responselike/license +0 -10
- package/generator-adapter/node_modules/responselike/package.json +0 -39
- package/generator-adapter/node_modules/responselike/readme.md +0 -75
- /package/generator-adapter/node_modules/@octokit/{types/dist-src/index.js → plugin-rest-endpoint-methods/node_modules/@octokit/types/dist-types/index.d.ts} +0 -0
- /package/generator-adapter/node_modules/{execa/node_modules/get-stream → get-stream}/source/array-buffer.js +0 -0
- /package/generator-adapter/node_modules/{execa/node_modules/get-stream → get-stream}/source/array.js +0 -0
- /package/generator-adapter/node_modules/{execa/node_modules/get-stream → get-stream}/source/buffer.js +0 -0
- /package/generator-adapter/node_modules/{execa/node_modules/get-stream → get-stream}/source/contents.js +0 -0
- /package/generator-adapter/node_modules/{execa/node_modules/get-stream → get-stream}/source/index.d.ts +0 -0
- /package/generator-adapter/node_modules/{execa/node_modules/get-stream → get-stream}/source/index.js +0 -0
- /package/generator-adapter/node_modules/{execa/node_modules/get-stream → get-stream}/source/string.js +0 -0
- /package/generator-adapter/node_modules/{execa/node_modules/get-stream → get-stream}/source/utils.js +0 -0
- /package/generator-adapter/node_modules/{@sindresorhus/is → ky}/license +0 -0
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { type stop } from '../core/constants.js';
|
|
2
|
+
import type { KyRequest, KyResponse, HTTPError } from '../index.js';
|
|
3
|
+
import type { NormalizedOptions } from './options.js';
|
|
4
|
+
export type BeforeRequestHook = (request: KyRequest, options: NormalizedOptions) => Request | Response | void | Promise<Request | Response | void>;
|
|
5
|
+
export type BeforeRetryState = {
|
|
6
|
+
request: KyRequest;
|
|
7
|
+
options: NormalizedOptions;
|
|
8
|
+
error: Error;
|
|
9
|
+
retryCount: number;
|
|
10
|
+
};
|
|
11
|
+
export type BeforeRetryHook = (options: BeforeRetryState) => typeof stop | void | Promise<typeof stop | void>;
|
|
12
|
+
export type AfterResponseHook = (request: KyRequest, options: NormalizedOptions, response: KyResponse) => Response | void | Promise<Response | void>;
|
|
13
|
+
export type BeforeErrorHook = (error: HTTPError) => HTTPError | Promise<HTTPError>;
|
|
14
|
+
export type Hooks = {
|
|
15
|
+
/**
|
|
16
|
+
This hook enables you to modify the request right before it is sent. Ky will make no further changes to the request after this. The hook function receives normalized input and options as arguments. You could, for example, modify `options.headers` here.
|
|
17
|
+
|
|
18
|
+
A [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response) can be returned from this hook to completely avoid making a HTTP request. This can be used to mock a request, check an internal cache, etc. An **important** consideration when returning a `Response` from this hook is that all the following hooks will be skipped, so **ensure you only return a `Response` from the last hook**.
|
|
19
|
+
|
|
20
|
+
@default []
|
|
21
|
+
*/
|
|
22
|
+
beforeRequest?: BeforeRequestHook[];
|
|
23
|
+
/**
|
|
24
|
+
This hook enables you to modify the request right before retry. Ky will make no further changes to the request after this. The hook function receives an object with the normalized request and options, an error instance, and the retry count. You could, for example, modify `request.headers` here.
|
|
25
|
+
|
|
26
|
+
If the request received a response, the error will be of type `HTTPError` and the `Response` object will be available at `error.response`. Be aware that some types of errors, such as network errors, inherently mean that a response was not received. In that case, the error will not be an instance of `HTTPError`.
|
|
27
|
+
|
|
28
|
+
You can prevent Ky from retrying the request by throwing an error. Ky will not handle it in any way and the error will be propagated to the request initiator. The rest of the `beforeRetry` hooks will not be called in this case. Alternatively, you can return the [`ky.stop`](#ky.stop) symbol to do the same thing but without propagating an error (this has some limitations, see `ky.stop` docs for details).
|
|
29
|
+
|
|
30
|
+
@example
|
|
31
|
+
```
|
|
32
|
+
import ky from 'ky';
|
|
33
|
+
|
|
34
|
+
const response = await ky('https://example.com', {
|
|
35
|
+
hooks: {
|
|
36
|
+
beforeRetry: [
|
|
37
|
+
async ({request, options, error, retryCount}) => {
|
|
38
|
+
const token = await ky('https://example.com/refresh-token');
|
|
39
|
+
options.headers.set('Authorization', `token ${token}`);
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
@default []
|
|
47
|
+
*/
|
|
48
|
+
beforeRetry?: BeforeRetryHook[];
|
|
49
|
+
/**
|
|
50
|
+
This hook enables you to read and optionally modify the response. The hook function receives normalized input, options, and a clone of the response as arguments. The return value of the hook function will be used by Ky as the response object if it's an instance of [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response).
|
|
51
|
+
|
|
52
|
+
@default []
|
|
53
|
+
|
|
54
|
+
@example
|
|
55
|
+
```
|
|
56
|
+
import ky from 'ky';
|
|
57
|
+
|
|
58
|
+
const response = await ky('https://example.com', {
|
|
59
|
+
hooks: {
|
|
60
|
+
afterResponse: [
|
|
61
|
+
(_input, _options, response) => {
|
|
62
|
+
// You could do something with the response, for example, logging.
|
|
63
|
+
log(response);
|
|
64
|
+
|
|
65
|
+
// Or return a `Response` instance to overwrite the response.
|
|
66
|
+
return new Response('A different response', {status: 200});
|
|
67
|
+
},
|
|
68
|
+
|
|
69
|
+
// Or retry with a fresh token on a 403 error
|
|
70
|
+
async (input, options, response) => {
|
|
71
|
+
if (response.status === 403) {
|
|
72
|
+
// Get a fresh token
|
|
73
|
+
const token = await ky('https://example.com/token').text();
|
|
74
|
+
|
|
75
|
+
// Retry with the token
|
|
76
|
+
options.headers.set('Authorization', `token ${token}`);
|
|
77
|
+
|
|
78
|
+
return ky(input, options);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
```
|
|
85
|
+
*/
|
|
86
|
+
afterResponse?: AfterResponseHook[];
|
|
87
|
+
/**
|
|
88
|
+
This hook enables you to modify the `HTTPError` right before it is thrown. The hook function receives a `HTTPError` as an argument and should return an instance of `HTTPError`.
|
|
89
|
+
|
|
90
|
+
@default []
|
|
91
|
+
|
|
92
|
+
@example
|
|
93
|
+
```
|
|
94
|
+
import ky from 'ky';
|
|
95
|
+
|
|
96
|
+
await ky('https://example.com', {
|
|
97
|
+
hooks: {
|
|
98
|
+
beforeError: [
|
|
99
|
+
error => {
|
|
100
|
+
const {response} = error;
|
|
101
|
+
if (response && response.body) {
|
|
102
|
+
error.name = 'GitHubError';
|
|
103
|
+
error.message = `${response.body.message} (${response.status})`;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return error;
|
|
107
|
+
}
|
|
108
|
+
]
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
```
|
|
112
|
+
*/
|
|
113
|
+
beforeError?: BeforeErrorHook[];
|
|
114
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../source/types/hooks.ts"],"names":[],"mappings":"","sourcesContent":["import {type stop} from '../core/constants.js';\nimport type {KyRequest, KyResponse, HTTPError} from '../index.js';\nimport type {NormalizedOptions} from './options.js';\n\nexport type BeforeRequestHook = (\n\trequest: KyRequest,\n\toptions: NormalizedOptions\n) => Request | Response | void | Promise<Request | Response | void>;\n\nexport type BeforeRetryState = {\n\trequest: KyRequest;\n\toptions: NormalizedOptions;\n\terror: Error;\n\tretryCount: number;\n};\nexport type BeforeRetryHook = (options: BeforeRetryState) => typeof stop | void | Promise<typeof stop | void>;\n\nexport type AfterResponseHook = (\n\trequest: KyRequest,\n\toptions: NormalizedOptions,\n\tresponse: KyResponse\n) => Response | void | Promise<Response | void>;\n\nexport type BeforeErrorHook = (error: HTTPError) => HTTPError | Promise<HTTPError>;\n\nexport type Hooks = {\n\t/**\n\tThis hook enables you to modify the request right before it is sent. Ky will make no further changes to the request after this. The hook function receives normalized input and options as arguments. You could, for example, modify `options.headers` here.\n\n\tA [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response) can be returned from this hook to completely avoid making a HTTP request. This can be used to mock a request, check an internal cache, etc. An **important** consideration when returning a `Response` from this hook is that all the following hooks will be skipped, so **ensure you only return a `Response` from the last hook**.\n\n\t@default []\n\t*/\n\tbeforeRequest?: BeforeRequestHook[];\n\n\t/**\n\tThis hook enables you to modify the request right before retry. Ky will make no further changes to the request after this. The hook function receives an object with the normalized request and options, an error instance, and the retry count. You could, for example, modify `request.headers` here.\n\n\tIf the request received a response, the error will be of type `HTTPError` and the `Response` object will be available at `error.response`. Be aware that some types of errors, such as network errors, inherently mean that a response was not received. In that case, the error will not be an instance of `HTTPError`.\n\n\tYou can prevent Ky from retrying the request by throwing an error. Ky will not handle it in any way and the error will be propagated to the request initiator. The rest of the `beforeRetry` hooks will not be called in this case. Alternatively, you can return the [`ky.stop`](#ky.stop) symbol to do the same thing but without propagating an error (this has some limitations, see `ky.stop` docs for details).\n\n\t@example\n\t```\n\timport ky from 'ky';\n\n\tconst response = await ky('https://example.com', {\n\t\thooks: {\n\t\t\tbeforeRetry: [\n\t\t\t\tasync ({request, options, error, retryCount}) => {\n\t\t\t\t\tconst token = await ky('https://example.com/refresh-token');\n\t\t\t\t\toptions.headers.set('Authorization', `token ${token}`);\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t});\n\t```\n\n\t@default []\n\t*/\n\tbeforeRetry?: BeforeRetryHook[];\n\n\t/**\n\tThis hook enables you to read and optionally modify the response. The hook function receives normalized input, options, and a clone of the response as arguments. The return value of the hook function will be used by Ky as the response object if it's an instance of [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response).\n\n\t@default []\n\n\t@example\n\t```\n\timport ky from 'ky';\n\n\tconst response = await ky('https://example.com', {\n\t\thooks: {\n\t\t\tafterResponse: [\n\t\t\t\t(_input, _options, response) => {\n\t\t\t\t\t// You could do something with the response, for example, logging.\n\t\t\t\t\tlog(response);\n\n\t\t\t\t\t// Or return a `Response` instance to overwrite the response.\n\t\t\t\t\treturn new Response('A different response', {status: 200});\n\t\t\t\t},\n\n\t\t\t\t// Or retry with a fresh token on a 403 error\n\t\t\t\tasync (input, options, response) => {\n\t\t\t\t\tif (response.status === 403) {\n\t\t\t\t\t\t// Get a fresh token\n\t\t\t\t\t\tconst token = await ky('https://example.com/token').text();\n\n\t\t\t\t\t\t// Retry with the token\n\t\t\t\t\t\toptions.headers.set('Authorization', `token ${token}`);\n\n\t\t\t\t\t\treturn ky(input, options);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t});\n\t```\n\t*/\n\tafterResponse?: AfterResponseHook[];\n\n\t/**\n\tThis hook enables you to modify the `HTTPError` right before it is thrown. The hook function receives a `HTTPError` as an argument and should return an instance of `HTTPError`.\n\n\t@default []\n\n\t@example\n\t```\n\timport ky from 'ky';\n\n\tawait ky('https://example.com', {\n\t\thooks: {\n\t\t\tbeforeError: [\n\t\t\t\terror => {\n\t\t\t\t\tconst {response} = error;\n\t\t\t\t\tif (response && response.body) {\n\t\t\t\t\t\terror.name = 'GitHubError';\n\t\t\t\t\t\terror.message = `${response.body.message} (${response.status})`;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn error;\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t});\n\t```\n\t*/\n\tbeforeError?: BeforeErrorHook[];\n};\n"]}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { type stop } from '../core/constants.js';
|
|
2
|
+
import type { Input, Options } from './options.js';
|
|
3
|
+
import type { ResponsePromise } from './ResponsePromise.js';
|
|
4
|
+
export type KyInstance = {
|
|
5
|
+
/**
|
|
6
|
+
Fetch the given `url`.
|
|
7
|
+
|
|
8
|
+
@param url - `Request` object, `URL` object, or URL string.
|
|
9
|
+
@returns A promise with `Body` method added.
|
|
10
|
+
|
|
11
|
+
@example
|
|
12
|
+
```
|
|
13
|
+
import ky from 'ky';
|
|
14
|
+
|
|
15
|
+
const json = await ky('https://example.com', {json: {foo: true}}).json();
|
|
16
|
+
|
|
17
|
+
console.log(json);
|
|
18
|
+
//=> `{data: '🦄'}`
|
|
19
|
+
```
|
|
20
|
+
*/
|
|
21
|
+
<T>(url: Input, options?: Options): ResponsePromise<T>;
|
|
22
|
+
/**
|
|
23
|
+
Fetch the given `url` using the option `{method: 'get'}`.
|
|
24
|
+
|
|
25
|
+
@param url - `Request` object, `URL` object, or URL string.
|
|
26
|
+
@returns A promise with `Body` methods added.
|
|
27
|
+
*/
|
|
28
|
+
get: <T>(url: Input, options?: Options) => ResponsePromise<T>;
|
|
29
|
+
/**
|
|
30
|
+
Fetch the given `url` using the option `{method: 'post'}`.
|
|
31
|
+
|
|
32
|
+
@param url - `Request` object, `URL` object, or URL string.
|
|
33
|
+
@returns A promise with `Body` methods added.
|
|
34
|
+
*/
|
|
35
|
+
post: <T>(url: Input, options?: Options) => ResponsePromise<T>;
|
|
36
|
+
/**
|
|
37
|
+
Fetch the given `url` using the option `{method: 'put'}`.
|
|
38
|
+
|
|
39
|
+
@param url - `Request` object, `URL` object, or URL string.
|
|
40
|
+
@returns A promise with `Body` methods added.
|
|
41
|
+
*/
|
|
42
|
+
put: <T>(url: Input, options?: Options) => ResponsePromise<T>;
|
|
43
|
+
/**
|
|
44
|
+
Fetch the given `url` using the option `{method: 'delete'}`.
|
|
45
|
+
|
|
46
|
+
@param url - `Request` object, `URL` object, or URL string.
|
|
47
|
+
@returns A promise with `Body` methods added.
|
|
48
|
+
*/
|
|
49
|
+
delete: <T>(url: Input, options?: Options) => ResponsePromise<T>;
|
|
50
|
+
/**
|
|
51
|
+
Fetch the given `url` using the option `{method: 'patch'}`.
|
|
52
|
+
|
|
53
|
+
@param url - `Request` object, `URL` object, or URL string.
|
|
54
|
+
@returns A promise with `Body` methods added.
|
|
55
|
+
*/
|
|
56
|
+
patch: <T>(url: Input, options?: Options) => ResponsePromise<T>;
|
|
57
|
+
/**
|
|
58
|
+
Fetch the given `url` using the option `{method: 'head'}`.
|
|
59
|
+
|
|
60
|
+
@param url - `Request` object, `URL` object, or URL string.
|
|
61
|
+
@returns A promise with `Body` methods added.
|
|
62
|
+
*/
|
|
63
|
+
head: (url: Input, options?: Options) => ResponsePromise;
|
|
64
|
+
/**
|
|
65
|
+
Create a new Ky instance with complete new defaults.
|
|
66
|
+
|
|
67
|
+
@returns A new Ky instance.
|
|
68
|
+
*/
|
|
69
|
+
create: (defaultOptions?: Options) => KyInstance;
|
|
70
|
+
/**
|
|
71
|
+
Create a new Ky instance with some defaults overridden with your own.
|
|
72
|
+
|
|
73
|
+
In contrast to `ky.create()`, `ky.extend()` inherits defaults from its parent.
|
|
74
|
+
|
|
75
|
+
You can also refer to parent defaults by providing a function to `.extend()`.
|
|
76
|
+
|
|
77
|
+
@example
|
|
78
|
+
```
|
|
79
|
+
import ky from 'ky';
|
|
80
|
+
|
|
81
|
+
const api = ky.create({prefixUrl: 'https://example.com/api'});
|
|
82
|
+
|
|
83
|
+
const usersApi = api.extend((options) => ({prefixUrl: `${options.prefixUrl}/users`}));
|
|
84
|
+
|
|
85
|
+
const response = await usersApi.get('123');
|
|
86
|
+
//=> 'https://example.com/api/users/123'
|
|
87
|
+
|
|
88
|
+
const response = await api.get('version');
|
|
89
|
+
//=> 'https://example.com/api/version'
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
@returns A new Ky instance.
|
|
93
|
+
*/
|
|
94
|
+
extend: (defaultOptions: Options | ((parentOptions: Options) => Options)) => KyInstance;
|
|
95
|
+
/**
|
|
96
|
+
A `Symbol` that can be returned by a `beforeRetry` hook to stop the retry. This will also short circuit the remaining `beforeRetry` hooks.
|
|
97
|
+
|
|
98
|
+
Note: Returning this symbol makes Ky abort and return with an `undefined` response. Be sure to check for a response before accessing any properties on it or use [optional chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining). It is also incompatible with body methods, such as `.json()` or `.text()`, because there is no response to parse. In general, we recommend throwing an error instead of returning this symbol, as that will cause Ky to abort and then throw, which avoids these limitations.
|
|
99
|
+
|
|
100
|
+
A valid use-case for `ky.stop` is to prevent retries when making requests for side effects, where the returned data is not important. For example, logging client activity to the server.
|
|
101
|
+
|
|
102
|
+
@example
|
|
103
|
+
```
|
|
104
|
+
import ky from 'ky';
|
|
105
|
+
|
|
106
|
+
const options = {
|
|
107
|
+
hooks: {
|
|
108
|
+
beforeRetry: [
|
|
109
|
+
async ({request, options, error, retryCount}) => {
|
|
110
|
+
const shouldStopRetry = await ky('https://example.com/api');
|
|
111
|
+
if (shouldStopRetry) {
|
|
112
|
+
return ky.stop;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
]
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
// Note that response will be `undefined` in case `ky.stop` is returned.
|
|
120
|
+
const response = await ky.post('https://example.com', options);
|
|
121
|
+
|
|
122
|
+
// Using `.text()` or other body methods is not supported.
|
|
123
|
+
const text = await ky('https://example.com', options).text();
|
|
124
|
+
```
|
|
125
|
+
*/
|
|
126
|
+
readonly stop: typeof stop;
|
|
127
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ky.js","sourceRoot":"","sources":["../../source/types/ky.ts"],"names":[],"mappings":"","sourcesContent":["import {type stop} from '../core/constants.js';\nimport type {Input, Options} from './options.js';\nimport type {ResponsePromise} from './ResponsePromise.js';\n\nexport type KyInstance = {\n\t/**\n\tFetch the given `url`.\n\n\t@param url - `Request` object, `URL` object, or URL string.\n\t@returns A promise with `Body` method added.\n\n\t@example\n\t```\n\timport ky from 'ky';\n\n\tconst json = await ky('https://example.com', {json: {foo: true}}).json();\n\n\tconsole.log(json);\n\t//=> `{data: '🦄'}`\n\t```\n\t*/\n\t<T>(url: Input, options?: Options): ResponsePromise<T>;\n\n\t/**\n\tFetch the given `url` using the option `{method: 'get'}`.\n\n\t@param url - `Request` object, `URL` object, or URL string.\n\t@returns A promise with `Body` methods added.\n\t*/\n\tget: <T>(url: Input, options?: Options) => ResponsePromise<T>;\n\n\t/**\n\tFetch the given `url` using the option `{method: 'post'}`.\n\n\t@param url - `Request` object, `URL` object, or URL string.\n\t@returns A promise with `Body` methods added.\n\t*/\n\tpost: <T>(url: Input, options?: Options) => ResponsePromise<T>;\n\n\t/**\n\tFetch the given `url` using the option `{method: 'put'}`.\n\n\t@param url - `Request` object, `URL` object, or URL string.\n\t@returns A promise with `Body` methods added.\n\t*/\n\tput: <T>(url: Input, options?: Options) => ResponsePromise<T>;\n\n\t/**\n\tFetch the given `url` using the option `{method: 'delete'}`.\n\n\t@param url - `Request` object, `URL` object, or URL string.\n\t@returns A promise with `Body` methods added.\n\t*/\n\tdelete: <T>(url: Input, options?: Options) => ResponsePromise<T>;\n\n\t/**\n\tFetch the given `url` using the option `{method: 'patch'}`.\n\n\t@param url - `Request` object, `URL` object, or URL string.\n\t@returns A promise with `Body` methods added.\n\t*/\n\tpatch: <T>(url: Input, options?: Options) => ResponsePromise<T>;\n\n\t/**\n\tFetch the given `url` using the option `{method: 'head'}`.\n\n\t@param url - `Request` object, `URL` object, or URL string.\n\t@returns A promise with `Body` methods added.\n\t*/\n\thead: (url: Input, options?: Options) => ResponsePromise;\n\n\t/**\n\tCreate a new Ky instance with complete new defaults.\n\n\t@returns A new Ky instance.\n\t*/\n\tcreate: (defaultOptions?: Options) => KyInstance;\n\n\t/**\n\tCreate a new Ky instance with some defaults overridden with your own.\n\n\tIn contrast to `ky.create()`, `ky.extend()` inherits defaults from its parent.\n\n\tYou can also refer to parent defaults by providing a function to `.extend()`.\n\n\t@example\n\t```\n\timport ky from 'ky';\n\n\tconst api = ky.create({prefixUrl: 'https://example.com/api'});\n\n\tconst usersApi = api.extend((options) => ({prefixUrl: `${options.prefixUrl}/users`}));\n\n\tconst response = await usersApi.get('123');\n\t//=> 'https://example.com/api/users/123'\n\n\tconst response = await api.get('version');\n\t//=> 'https://example.com/api/version'\n\t```\n\n\t@returns A new Ky instance.\n\t*/\n\textend: (defaultOptions: Options | ((parentOptions: Options) => Options)) => KyInstance;\n\n\t/**\n\tA `Symbol` that can be returned by a `beforeRetry` hook to stop the retry. This will also short circuit the remaining `beforeRetry` hooks.\n\n\tNote: Returning this symbol makes Ky abort and return with an `undefined` response. Be sure to check for a response before accessing any properties on it or use [optional chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining). It is also incompatible with body methods, such as `.json()` or `.text()`, because there is no response to parse. In general, we recommend throwing an error instead of returning this symbol, as that will cause Ky to abort and then throw, which avoids these limitations.\n\n\tA valid use-case for `ky.stop` is to prevent retries when making requests for side effects, where the returned data is not important. For example, logging client activity to the server.\n\n\t@example\n\t```\n\timport ky from 'ky';\n\n\tconst options = {\n\t\thooks: {\n\t\t\tbeforeRetry: [\n\t\t\t\tasync ({request, options, error, retryCount}) => {\n\t\t\t\t\tconst shouldStopRetry = await ky('https://example.com/api');\n\t\t\t\t\tif (shouldStopRetry) {\n\t\t\t\t\t\treturn ky.stop;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t};\n\n\t// Note that response will be `undefined` in case `ky.stop` is returned.\n\tconst response = await ky.post('https://example.com', options);\n\n\t// Using `.text()` or other body methods is not supported.\n\tconst text = await ky('https://example.com', options).text();\n\t```\n\t*/\n\treadonly stop: typeof stop;\n};\n"]}
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
import type { LiteralUnion, Required } from './common.js';
|
|
2
|
+
import type { Hooks } from './hooks.js';
|
|
3
|
+
import type { RetryOptions } from './retry.js';
|
|
4
|
+
export type SearchParamsInit = string | string[][] | Record<string, string> | URLSearchParams | undefined;
|
|
5
|
+
export type SearchParamsOption = SearchParamsInit | Record<string, string | number | boolean> | Array<Array<string | number | boolean>>;
|
|
6
|
+
export type HttpMethod = 'get' | 'post' | 'put' | 'patch' | 'head' | 'delete';
|
|
7
|
+
export type Input = string | URL | Request;
|
|
8
|
+
export type DownloadProgress = {
|
|
9
|
+
percent: number;
|
|
10
|
+
transferredBytes: number;
|
|
11
|
+
/**
|
|
12
|
+
Note: If it's not possible to retrieve the body size, it will be `0`.
|
|
13
|
+
*/
|
|
14
|
+
totalBytes: number;
|
|
15
|
+
};
|
|
16
|
+
export type KyHeadersInit = NonNullable<RequestInit['headers']> | Record<string, string | undefined>;
|
|
17
|
+
/**
|
|
18
|
+
Custom Ky options
|
|
19
|
+
*/
|
|
20
|
+
export type KyOptions = {
|
|
21
|
+
/**
|
|
22
|
+
Shortcut for sending JSON. Use this instead of the `body` option.
|
|
23
|
+
|
|
24
|
+
Accepts any plain object or value, which will be `JSON.stringify()`'d and sent in the body with the correct header set.
|
|
25
|
+
*/
|
|
26
|
+
json?: unknown;
|
|
27
|
+
/**
|
|
28
|
+
User-defined JSON-parsing function.
|
|
29
|
+
|
|
30
|
+
Use-cases:
|
|
31
|
+
1. Parse JSON via the [`bourne` package](https://github.com/hapijs/bourne) to protect from prototype pollution.
|
|
32
|
+
2. Parse JSON with [`reviver` option of `JSON.parse()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse).
|
|
33
|
+
|
|
34
|
+
@default JSON.parse()
|
|
35
|
+
|
|
36
|
+
@example
|
|
37
|
+
```
|
|
38
|
+
import ky from 'ky';
|
|
39
|
+
import bourne from '@hapijs/bourne';
|
|
40
|
+
|
|
41
|
+
const json = await ky('https://example.com', {
|
|
42
|
+
parseJson: text => bourne(text)
|
|
43
|
+
}).json();
|
|
44
|
+
```
|
|
45
|
+
*/
|
|
46
|
+
parseJson?: (text: string) => unknown;
|
|
47
|
+
/**
|
|
48
|
+
User-defined JSON-stringifying function.
|
|
49
|
+
|
|
50
|
+
Use-cases:
|
|
51
|
+
1. Stringify JSON with a custom `replacer` function.
|
|
52
|
+
|
|
53
|
+
@default JSON.stringify()
|
|
54
|
+
|
|
55
|
+
@example
|
|
56
|
+
```
|
|
57
|
+
import ky from 'ky';
|
|
58
|
+
import {DateTime} from 'luxon';
|
|
59
|
+
|
|
60
|
+
const json = await ky('https://example.com', {
|
|
61
|
+
stringifyJson: data => JSON.stringify(data, (key, value) => {
|
|
62
|
+
if (key.endsWith('_at')) {
|
|
63
|
+
return DateTime.fromISO(value).toSeconds();
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return value;
|
|
67
|
+
})
|
|
68
|
+
}).json();
|
|
69
|
+
```
|
|
70
|
+
*/
|
|
71
|
+
stringifyJson?: (data: unknown) => string;
|
|
72
|
+
/**
|
|
73
|
+
Search parameters to include in the request URL. Setting this will override all existing search parameters in the input URL.
|
|
74
|
+
|
|
75
|
+
Accepts any value supported by [`URLSearchParams()`](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams/URLSearchParams).
|
|
76
|
+
*/
|
|
77
|
+
searchParams?: SearchParamsOption;
|
|
78
|
+
/**
|
|
79
|
+
A prefix to prepend to the `input` URL when making the request. It can be any valid URL, either relative or absolute. A trailing slash `/` is optional and will be added automatically, if needed, when it is joined with `input`. Only takes effect when `input` is a string. The `input` argument cannot start with a slash `/` when using this option.
|
|
80
|
+
|
|
81
|
+
Useful when used with [`ky.extend()`](#kyextenddefaultoptions) to create niche-specific Ky-instances.
|
|
82
|
+
|
|
83
|
+
Notes:
|
|
84
|
+
- After `prefixUrl` and `input` are joined, the result is resolved against the [base URL](https://developer.mozilla.org/en-US/docs/Web/API/Node/baseURI) of the page (if any).
|
|
85
|
+
- Leading slashes in `input` are disallowed when using this option to enforce consistency and avoid confusion about how the `input` URL is handled, given that `input` will not follow the normal URL resolution rules when `prefixUrl` is being used, which changes the meaning of a leading slash.
|
|
86
|
+
|
|
87
|
+
@example
|
|
88
|
+
```
|
|
89
|
+
import ky from 'ky';
|
|
90
|
+
|
|
91
|
+
// On https://example.com
|
|
92
|
+
|
|
93
|
+
const response = await ky('unicorn', {prefixUrl: '/api'});
|
|
94
|
+
//=> 'https://example.com/api/unicorn'
|
|
95
|
+
|
|
96
|
+
const response = await ky('unicorn', {prefixUrl: 'https://cats.com'});
|
|
97
|
+
//=> 'https://cats.com/unicorn'
|
|
98
|
+
```
|
|
99
|
+
*/
|
|
100
|
+
prefixUrl?: URL | string;
|
|
101
|
+
/**
|
|
102
|
+
An object representing `limit`, `methods`, `statusCodes`, `afterStatusCodes`, and `maxRetryAfter` fields for maximum retry count, allowed methods, allowed status codes, status codes allowed to use the [`Retry-After`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After) time, and maximum [`Retry-After`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After) time.
|
|
103
|
+
|
|
104
|
+
If `retry` is a number, it will be used as `limit` and other defaults will remain in place.
|
|
105
|
+
|
|
106
|
+
If the response provides an HTTP status contained in `afterStatusCodes`, Ky will wait until the date or timeout given in the [`Retry-After`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After) header has passed to retry the request. If `Retry-After` is missing, the non-standard [`RateLimit-Reset`](https://www.ietf.org/archive/id/draft-polli-ratelimit-headers-02.html#section-3.3) header is used in its place as a fallback. If the provided status code is not in the list, the [`Retry-After`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After) header will be ignored.
|
|
107
|
+
|
|
108
|
+
If `maxRetryAfter` is set to `undefined`, it will use `options.timeout`. If [`Retry-After`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After) header is greater than `maxRetryAfter`, it will cancel the request.
|
|
109
|
+
|
|
110
|
+
By default, delays between retries are calculated with the function `0.3 * (2 ** (attemptCount - 1)) * 1000`, where `attemptCount` is the attempt number (starts from 1), however this can be changed by passing a `delay` function.
|
|
111
|
+
|
|
112
|
+
Retries are not triggered following a timeout.
|
|
113
|
+
|
|
114
|
+
@example
|
|
115
|
+
```
|
|
116
|
+
import ky from 'ky';
|
|
117
|
+
|
|
118
|
+
const json = await ky('https://example.com', {
|
|
119
|
+
retry: {
|
|
120
|
+
limit: 10,
|
|
121
|
+
methods: ['get'],
|
|
122
|
+
statusCodes: [413]
|
|
123
|
+
}
|
|
124
|
+
}).json();
|
|
125
|
+
```
|
|
126
|
+
*/
|
|
127
|
+
retry?: RetryOptions | number;
|
|
128
|
+
/**
|
|
129
|
+
Timeout in milliseconds for getting a response, including any retries. Can not be greater than 2147483647.
|
|
130
|
+
If set to `false`, there will be no timeout.
|
|
131
|
+
|
|
132
|
+
@default 10000
|
|
133
|
+
*/
|
|
134
|
+
timeout?: number | false;
|
|
135
|
+
/**
|
|
136
|
+
Hooks allow modifications during the request lifecycle. Hook functions may be async and are run serially.
|
|
137
|
+
*/
|
|
138
|
+
hooks?: Hooks;
|
|
139
|
+
/**
|
|
140
|
+
Throw an `HTTPError` when, after following redirects, the response has a non-2xx status code. To also throw for redirects instead of following them, set the [`redirect`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters) option to `'manual'`.
|
|
141
|
+
|
|
142
|
+
Setting this to `false` may be useful if you are checking for resource availability and are expecting error responses.
|
|
143
|
+
|
|
144
|
+
Note: If `false`, error responses are considered successful and the request will not be retried.
|
|
145
|
+
|
|
146
|
+
@default true
|
|
147
|
+
*/
|
|
148
|
+
throwHttpErrors?: boolean;
|
|
149
|
+
/**
|
|
150
|
+
Download progress event handler.
|
|
151
|
+
|
|
152
|
+
@param chunk - Note: It's empty for the first call.
|
|
153
|
+
|
|
154
|
+
@example
|
|
155
|
+
```
|
|
156
|
+
import ky from 'ky';
|
|
157
|
+
|
|
158
|
+
const response = await ky('https://example.com', {
|
|
159
|
+
onDownloadProgress: (progress, chunk) => {
|
|
160
|
+
// Example output:
|
|
161
|
+
// `0% - 0 of 1271 bytes`
|
|
162
|
+
// `100% - 1271 of 1271 bytes`
|
|
163
|
+
console.log(`${progress.percent * 100}% - ${progress.transferredBytes} of ${progress.totalBytes} bytes`);
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
```
|
|
167
|
+
*/
|
|
168
|
+
onDownloadProgress?: (progress: DownloadProgress, chunk: Uint8Array) => void;
|
|
169
|
+
/**
|
|
170
|
+
User-defined `fetch` function.
|
|
171
|
+
Has to be fully compatible with the [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) standard.
|
|
172
|
+
|
|
173
|
+
Use-cases:
|
|
174
|
+
1. Use custom `fetch` implementations like [`isomorphic-unfetch`](https://www.npmjs.com/package/isomorphic-unfetch).
|
|
175
|
+
2. Use the `fetch` wrapper function provided by some frameworks that use server-side rendering (SSR).
|
|
176
|
+
|
|
177
|
+
@default fetch
|
|
178
|
+
|
|
179
|
+
@example
|
|
180
|
+
```
|
|
181
|
+
import ky from 'ky';
|
|
182
|
+
import fetch from 'isomorphic-unfetch';
|
|
183
|
+
|
|
184
|
+
const json = await ky('https://example.com', {fetch}).json();
|
|
185
|
+
```
|
|
186
|
+
*/
|
|
187
|
+
fetch?: (input: Input, init?: RequestInit) => Promise<Response>;
|
|
188
|
+
};
|
|
189
|
+
/**
|
|
190
|
+
Each key from KyOptions is present and set to `true`.
|
|
191
|
+
|
|
192
|
+
This type is used for identifying and working with the known keys in KyOptions.
|
|
193
|
+
*/
|
|
194
|
+
export type KyOptionsRegistry = {
|
|
195
|
+
[K in keyof KyOptions]-?: true;
|
|
196
|
+
};
|
|
197
|
+
/**
|
|
198
|
+
Options are the same as `window.fetch`, except for the KyOptions
|
|
199
|
+
*/
|
|
200
|
+
export interface Options extends KyOptions, Omit<RequestInit, 'headers'> {
|
|
201
|
+
/**
|
|
202
|
+
HTTP method used to make the request.
|
|
203
|
+
|
|
204
|
+
Internally, the standard methods (`GET`, `POST`, `PUT`, `PATCH`, `HEAD` and `DELETE`) are uppercased in order to avoid server errors due to case sensitivity.
|
|
205
|
+
*/
|
|
206
|
+
method?: LiteralUnion<HttpMethod, string>;
|
|
207
|
+
/**
|
|
208
|
+
HTTP headers used to make the request.
|
|
209
|
+
|
|
210
|
+
You can pass a `Headers` instance or a plain object.
|
|
211
|
+
|
|
212
|
+
You can remove a header with `.extend()` by passing the header with an `undefined` value.
|
|
213
|
+
|
|
214
|
+
@example
|
|
215
|
+
```
|
|
216
|
+
import ky from 'ky';
|
|
217
|
+
|
|
218
|
+
const url = 'https://sindresorhus.com';
|
|
219
|
+
|
|
220
|
+
const original = ky.create({
|
|
221
|
+
headers: {
|
|
222
|
+
rainbow: 'rainbow',
|
|
223
|
+
unicorn: 'unicorn'
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
const extended = original.extend({
|
|
228
|
+
headers: {
|
|
229
|
+
rainbow: undefined
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
const response = await extended(url).json();
|
|
234
|
+
|
|
235
|
+
console.log('rainbow' in response);
|
|
236
|
+
//=> false
|
|
237
|
+
|
|
238
|
+
console.log('unicorn' in response);
|
|
239
|
+
//=> true
|
|
240
|
+
```
|
|
241
|
+
*/
|
|
242
|
+
headers?: KyHeadersInit;
|
|
243
|
+
}
|
|
244
|
+
export type InternalOptions = Required<Omit<Options, 'hooks' | 'retry'>, 'fetch' | 'prefixUrl' | 'timeout'> & {
|
|
245
|
+
headers: Required<Headers>;
|
|
246
|
+
hooks: Required<Hooks>;
|
|
247
|
+
retry: Required<RetryOptions>;
|
|
248
|
+
prefixUrl: string;
|
|
249
|
+
};
|
|
250
|
+
/**
|
|
251
|
+
Normalized options passed to the `fetch` call and the `beforeRequest` hooks.
|
|
252
|
+
*/
|
|
253
|
+
export interface NormalizedOptions extends RequestInit {
|
|
254
|
+
method: NonNullable<RequestInit['method']>;
|
|
255
|
+
credentials?: NonNullable<RequestInit['credentials']>;
|
|
256
|
+
retry: RetryOptions;
|
|
257
|
+
prefixUrl: string;
|
|
258
|
+
onDownloadProgress: Options['onDownloadProgress'];
|
|
259
|
+
}
|
|
260
|
+
export type { RetryOptions } from './retry.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.js","sourceRoot":"","sources":["../../source/types/options.ts"],"names":[],"mappings":"","sourcesContent":["import type {LiteralUnion, Required} from './common.js';\nimport type {Hooks} from './hooks.js';\nimport type {RetryOptions} from './retry.js';\n\n// eslint-disable-next-line unicorn/prevent-abbreviations\nexport type SearchParamsInit = string | string[][] | Record<string, string> | URLSearchParams | undefined;\n\n// eslint-disable-next-line unicorn/prevent-abbreviations\nexport type SearchParamsOption = SearchParamsInit | Record<string, string | number | boolean> | Array<Array<string | number | boolean>>;\n\nexport type HttpMethod = 'get' | 'post' | 'put' | 'patch' | 'head' | 'delete';\n\nexport type Input = string | URL | Request;\n\nexport type DownloadProgress = {\n\tpercent: number;\n\ttransferredBytes: number;\n\n\t/**\n\tNote: If it's not possible to retrieve the body size, it will be `0`.\n\t*/\n\ttotalBytes: number;\n};\n\n// Not HeadersInit directly because @types/node doesn't export it\nexport type KyHeadersInit = NonNullable<RequestInit['headers']> | Record<string, string | undefined>;\n\n/**\nCustom Ky options\n*/\n\nexport type KyOptions = {\n\t/**\n\tShortcut for sending JSON. Use this instead of the `body` option.\n\n\tAccepts any plain object or value, which will be `JSON.stringify()`'d and sent in the body with the correct header set.\n\t*/\n\tjson?: unknown;\n\n\t/**\n\tUser-defined JSON-parsing function.\n\n\tUse-cases:\n\t1. Parse JSON via the [`bourne` package](https://github.com/hapijs/bourne) to protect from prototype pollution.\n\t2. Parse JSON with [`reviver` option of `JSON.parse()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse).\n\n\t@default JSON.parse()\n\n\t@example\n\t```\n\timport ky from 'ky';\n\timport bourne from '@hapijs/bourne';\n\n\tconst json = await ky('https://example.com', {\n\t\tparseJson: text => bourne(text)\n\t}).json();\n\t```\n\t*/\n\tparseJson?: (text: string) => unknown;\n\n\t/**\n\tUser-defined JSON-stringifying function.\n\n\tUse-cases:\n\t1. Stringify JSON with a custom `replacer` function.\n\n\t@default JSON.stringify()\n\n\t@example\n\t```\n\timport ky from 'ky';\n\timport {DateTime} from 'luxon';\n\n\tconst json = await ky('https://example.com', {\n\t\tstringifyJson: data => JSON.stringify(data, (key, value) => {\n\t\t\tif (key.endsWith('_at')) {\n\t\t\t\treturn DateTime.fromISO(value).toSeconds();\n\t\t\t}\n\n\t\t\treturn value;\n\t\t})\n\t}).json();\n\t```\n\t*/\n\tstringifyJson?: (data: unknown) => string;\n\n\t/**\n\tSearch parameters to include in the request URL. Setting this will override all existing search parameters in the input URL.\n\n\tAccepts any value supported by [`URLSearchParams()`](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams/URLSearchParams).\n\t*/\n\tsearchParams?: SearchParamsOption;\n\n\t/**\n\tA prefix to prepend to the `input` URL when making the request. It can be any valid URL, either relative or absolute. A trailing slash `/` is optional and will be added automatically, if needed, when it is joined with `input`. Only takes effect when `input` is a string. The `input` argument cannot start with a slash `/` when using this option.\n\n\tUseful when used with [`ky.extend()`](#kyextenddefaultoptions) to create niche-specific Ky-instances.\n\n\tNotes:\n\t - After `prefixUrl` and `input` are joined, the result is resolved against the [base URL](https://developer.mozilla.org/en-US/docs/Web/API/Node/baseURI) of the page (if any).\n\t - Leading slashes in `input` are disallowed when using this option to enforce consistency and avoid confusion about how the `input` URL is handled, given that `input` will not follow the normal URL resolution rules when `prefixUrl` is being used, which changes the meaning of a leading slash.\n\n\t@example\n\t```\n\timport ky from 'ky';\n\n\t// On https://example.com\n\n\tconst response = await ky('unicorn', {prefixUrl: '/api'});\n\t//=> 'https://example.com/api/unicorn'\n\n\tconst response = await ky('unicorn', {prefixUrl: 'https://cats.com'});\n\t//=> 'https://cats.com/unicorn'\n\t```\n\t*/\n\tprefixUrl?: URL | string;\n\n\t/**\n\tAn object representing `limit`, `methods`, `statusCodes`, `afterStatusCodes`, and `maxRetryAfter` fields for maximum retry count, allowed methods, allowed status codes, status codes allowed to use the [`Retry-After`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After) time, and maximum [`Retry-After`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After) time.\n\n\tIf `retry` is a number, it will be used as `limit` and other defaults will remain in place.\n\n\tIf the response provides an HTTP status contained in `afterStatusCodes`, Ky will wait until the date or timeout given in the [`Retry-After`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After) header has passed to retry the request. If `Retry-After` is missing, the non-standard [`RateLimit-Reset`](https://www.ietf.org/archive/id/draft-polli-ratelimit-headers-02.html#section-3.3) header is used in its place as a fallback. If the provided status code is not in the list, the [`Retry-After`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After) header will be ignored.\n\n\tIf `maxRetryAfter` is set to `undefined`, it will use `options.timeout`. If [`Retry-After`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After) header is greater than `maxRetryAfter`, it will cancel the request.\n\n\tBy default, delays between retries are calculated with the function `0.3 * (2 ** (attemptCount - 1)) * 1000`, where `attemptCount` is the attempt number (starts from 1), however this can be changed by passing a `delay` function.\n\n\tRetries are not triggered following a timeout.\n\n\t@example\n\t```\n\timport ky from 'ky';\n\n\tconst json = await ky('https://example.com', {\n\t\tretry: {\n\t\t\tlimit: 10,\n\t\t\tmethods: ['get'],\n\t\t\tstatusCodes: [413]\n\t\t}\n\t}).json();\n\t```\n\t*/\n\tretry?: RetryOptions | number;\n\n\t/**\n\tTimeout in milliseconds for getting a response, including any retries. Can not be greater than 2147483647.\n\tIf set to `false`, there will be no timeout.\n\n\t@default 10000\n\t*/\n\ttimeout?: number | false;\n\n\t/**\n\tHooks allow modifications during the request lifecycle. Hook functions may be async and are run serially.\n\t*/\n\thooks?: Hooks;\n\n\t/**\n\tThrow an `HTTPError` when, after following redirects, the response has a non-2xx status code. To also throw for redirects instead of following them, set the [`redirect`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters) option to `'manual'`.\n\n\tSetting this to `false` may be useful if you are checking for resource availability and are expecting error responses.\n\n\tNote: If `false`, error responses are considered successful and the request will not be retried.\n\n\t@default true\n\t*/\n\tthrowHttpErrors?: boolean;\n\n\t/**\n\tDownload progress event handler.\n\n\t@param chunk - Note: It's empty for the first call.\n\n\t@example\n\t```\n\timport ky from 'ky';\n\n\tconst response = await ky('https://example.com', {\n\t\tonDownloadProgress: (progress, chunk) => {\n\t\t\t// Example output:\n\t\t\t// `0% - 0 of 1271 bytes`\n\t\t\t// `100% - 1271 of 1271 bytes`\n\t\t\tconsole.log(`${progress.percent * 100}% - ${progress.transferredBytes} of ${progress.totalBytes} bytes`);\n\t\t}\n\t});\n\t```\n\t*/\n\tonDownloadProgress?: (progress: DownloadProgress, chunk: Uint8Array) => void;\n\n\t/**\n\tUser-defined `fetch` function.\n\tHas to be fully compatible with the [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) standard.\n\n\tUse-cases:\n\t1. Use custom `fetch` implementations like [`isomorphic-unfetch`](https://www.npmjs.com/package/isomorphic-unfetch).\n\t2. Use the `fetch` wrapper function provided by some frameworks that use server-side rendering (SSR).\n\n\t@default fetch\n\n\t@example\n\t```\n\timport ky from 'ky';\n\timport fetch from 'isomorphic-unfetch';\n\n\tconst json = await ky('https://example.com', {fetch}).json();\n\t```\n\t*/\n\tfetch?: (input: Input, init?: RequestInit) => Promise<Response>;\n};\n\n/**\nEach key from KyOptions is present and set to `true`.\n\nThis type is used for identifying and working with the known keys in KyOptions.\n*/\nexport type KyOptionsRegistry = {[K in keyof KyOptions]-?: true};\n\n/**\nOptions are the same as `window.fetch`, except for the KyOptions\n*/\nexport interface Options extends KyOptions, Omit<RequestInit, 'headers'> { // eslint-disable-line @typescript-eslint/consistent-type-definitions -- This must stay an interface so that it can be extended outside of Ky for use in `ky.create`.\n\t/**\n\tHTTP method used to make the request.\n\n\tInternally, the standard methods (`GET`, `POST`, `PUT`, `PATCH`, `HEAD` and `DELETE`) are uppercased in order to avoid server errors due to case sensitivity.\n\t*/\n\tmethod?: LiteralUnion<HttpMethod, string>;\n\n\t/**\n\tHTTP headers used to make the request.\n\n\tYou can pass a `Headers` instance or a plain object.\n\n\tYou can remove a header with `.extend()` by passing the header with an `undefined` value.\n\n\t@example\n\t```\n\timport ky from 'ky';\n\n\tconst url = 'https://sindresorhus.com';\n\n\tconst original = ky.create({\n\t\theaders: {\n\t\t\trainbow: 'rainbow',\n\t\t\tunicorn: 'unicorn'\n\t\t}\n\t});\n\n\tconst extended = original.extend({\n\t\theaders: {\n\t\t\trainbow: undefined\n\t\t}\n\t});\n\n\tconst response = await extended(url).json();\n\n\tconsole.log('rainbow' in response);\n\t//=> false\n\n\tconsole.log('unicorn' in response);\n\t//=> true\n\t```\n\t*/\n\theaders?: KyHeadersInit;\n}\n\nexport type InternalOptions = Required<\nOmit<Options, 'hooks' | 'retry'>,\n'fetch' | 'prefixUrl' | 'timeout'\n> & {\n\theaders: Required<Headers>;\n\thooks: Required<Hooks>;\n\tretry: Required<RetryOptions>;\n\tprefixUrl: string;\n};\n\n/**\nNormalized options passed to the `fetch` call and the `beforeRequest` hooks.\n*/\nexport interface NormalizedOptions extends RequestInit { // eslint-disable-line @typescript-eslint/consistent-type-definitions -- This must stay an interface so that it can be extended outside of Ky for use in `ky.create`.\n\t// Extended from `RequestInit`, but ensured to be set (not optional).\n\tmethod: NonNullable<RequestInit['method']>;\n\tcredentials?: NonNullable<RequestInit['credentials']>;\n\n\t// Extended from custom `KyOptions`, but ensured to be set (not optional).\n\tretry: RetryOptions;\n\tprefixUrl: string;\n\tonDownloadProgress: Options['onDownloadProgress'];\n}\n\nexport type {RetryOptions} from './retry.js';\n"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
type UndiciHeadersInit = string[][] | Record<string, string | readonly string[]> | Headers;
|
|
2
|
+
type UndiciBodyInit = ArrayBuffer | AsyncIterable<Uint8Array> | Blob | FormData | Iterable<Uint8Array> | ArrayBufferView | URLSearchParams | null | string;
|
|
3
|
+
type UndiciRequestRedirect = 'error' | 'follow' | 'manual';
|
|
4
|
+
type UndiciRequestCredentials = 'omit' | 'include' | 'same-origin';
|
|
5
|
+
type UndiciReferrerPolicy = '' | 'no-referrer' | 'no-referrer-when-downgrade' | 'origin' | 'origin-when-cross-origin' | 'same-origin' | 'strict-origin' | 'strict-origin-when-cross-origin' | 'unsafe-url';
|
|
6
|
+
type UndiciRequestMode = 'cors' | 'navigate' | 'no-cors' | 'same-origin';
|
|
7
|
+
type UndiciRequestInit = {
|
|
8
|
+
method?: string;
|
|
9
|
+
keepalive?: boolean;
|
|
10
|
+
headers?: UndiciHeadersInit;
|
|
11
|
+
body?: UndiciBodyInit;
|
|
12
|
+
redirect?: UndiciRequestRedirect;
|
|
13
|
+
integrity?: string;
|
|
14
|
+
signal?: AbortSignal | undefined;
|
|
15
|
+
credentials?: UndiciRequestCredentials;
|
|
16
|
+
mode?: UndiciRequestMode;
|
|
17
|
+
referrer?: string;
|
|
18
|
+
referrerPolicy?: UndiciReferrerPolicy;
|
|
19
|
+
window?: undefined;
|
|
20
|
+
dispatcher?: unknown;
|
|
21
|
+
duplex?: unknown;
|
|
22
|
+
};
|
|
23
|
+
type CombinedRequestInit = globalThis.RequestInit & UndiciRequestInit;
|
|
24
|
+
export type RequestInitRegistry = {
|
|
25
|
+
[K in keyof CombinedRequestInit]-?: true;
|
|
26
|
+
};
|
|
27
|
+
export type KyRequest<T = unknown> = {
|
|
28
|
+
json: <J = T>() => Promise<J>;
|
|
29
|
+
} & Request;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Undici types need to be here because they are not exported to globals by @types/node.
|
|
3
|
+
See https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/69408
|
|
4
|
+
|
|
5
|
+
After the types are exported to globals, the Undici types can be removed from here.
|
|
6
|
+
*/
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=request.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.js","sourceRoot":"","sources":["../../source/types/request.ts"],"names":[],"mappings":"AAAA;;;;;EAKE","sourcesContent":["/*\nUndici types need to be here because they are not exported to globals by @types/node.\nSee https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/69408\n\nAfter the types are exported to globals, the Undici types can be removed from here.\n*/\n\ntype UndiciHeadersInit =\n\t| string[][]\n\t| Record<string, string | readonly string[]>\n\t| Headers;\n\ntype UndiciBodyInit =\n\t| ArrayBuffer\n\t| AsyncIterable<Uint8Array>\n\t| Blob\n\t| FormData\n\t| Iterable<Uint8Array>\n\t| ArrayBufferView\n\t| URLSearchParams\n\t// eslint-disable-next-line @typescript-eslint/ban-types\n\t| null\n\t| string;\n\ntype UndiciRequestRedirect = 'error' | 'follow' | 'manual';\n\ntype UndiciRequestCredentials = 'omit' | 'include' | 'same-origin';\n\ntype UndiciReferrerPolicy =\n\t| ''\n\t| 'no-referrer'\n\t| 'no-referrer-when-downgrade'\n\t| 'origin'\n\t| 'origin-when-cross-origin'\n\t| 'same-origin'\n\t| 'strict-origin'\n\t| 'strict-origin-when-cross-origin'\n\t| 'unsafe-url';\n\ntype UndiciRequestMode = 'cors' | 'navigate' | 'no-cors' | 'same-origin';\n\ntype UndiciRequestInit = {\n\tmethod?: string;\n\tkeepalive?: boolean;\n\theaders?: UndiciHeadersInit;\n\tbody?: UndiciBodyInit;\n\tredirect?: UndiciRequestRedirect;\n\tintegrity?: string;\n\tsignal?: AbortSignal | undefined;\n\tcredentials?: UndiciRequestCredentials;\n\tmode?: UndiciRequestMode;\n\treferrer?: string;\n\treferrerPolicy?: UndiciReferrerPolicy;\n\twindow?: undefined;\n\tdispatcher?: unknown;\n\tduplex?: unknown;\n};\n\ntype CombinedRequestInit = globalThis.RequestInit & UndiciRequestInit;\n\nexport type RequestInitRegistry = {[K in keyof CombinedRequestInit]-?: true};\n\nexport type KyRequest<T = unknown> = {\n\tjson: <J = T>() => Promise<J>;\n} & Request;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response.js","sourceRoot":"","sources":["../../source/types/response.ts"],"names":[],"mappings":"","sourcesContent":["export type KyResponse<T = unknown> = {\n\tjson: <J = T >() => Promise<J>;\n} & Response;\n"]}
|