renovate 40.0.0-next.4 → 40.0.0-next.41
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/dist/config/decrypt/legacy.js +0 -1
- package/dist/config/decrypt/legacy.js.map +1 -1
- package/dist/config/decrypt.d.ts +3 -1
- package/dist/config/decrypt.js +56 -13
- package/dist/config/decrypt.js.map +1 -1
- package/dist/config/migrate-validate.js +3 -2
- package/dist/config/migrate-validate.js.map +1 -1
- package/dist/config/migration.js +2 -1
- package/dist/config/migration.js.map +1 -1
- package/dist/config/migrations/custom/rebase-stale-prs-migration.js +1 -1
- package/dist/config/migrations/custom/rebase-stale-prs-migration.js.map +1 -1
- package/dist/config/options/index.js +17 -3
- package/dist/config/options/index.js.map +1 -1
- package/dist/config/parse.js +2 -2
- package/dist/config/parse.js.map +1 -1
- package/dist/config/presets/common.js +1 -0
- package/dist/config/presets/common.js.map +1 -1
- package/dist/config/presets/gitea/index.js +0 -1
- package/dist/config/presets/gitea/index.js.map +1 -1
- package/dist/config/presets/github/index.js +0 -1
- package/dist/config/presets/github/index.js.map +1 -1
- package/dist/config/presets/gitlab/index.js +1 -1
- package/dist/config/presets/gitlab/index.js.map +1 -1
- package/dist/config/presets/http/index.js +1 -2
- package/dist/config/presets/http/index.js.map +1 -1
- package/dist/config/presets/index.js +0 -7
- package/dist/config/presets/index.js.map +1 -1
- package/dist/config/presets/internal/custom-managers.js +18 -4
- package/dist/config/presets/internal/custom-managers.js.map +1 -1
- package/dist/config/presets/internal/group.js +30 -1
- package/dist/config/presets/internal/group.js.map +1 -1
- package/dist/config/presets/internal/index.js +1 -3
- package/dist/config/presets/internal/index.js.map +1 -1
- package/dist/config/presets/internal/workarounds.js +1 -0
- package/dist/config/presets/internal/workarounds.js.map +1 -1
- package/dist/config/presets/parse.js +2 -1
- package/dist/config/presets/parse.js.map +1 -1
- package/dist/config/schema.d.ts +2 -2
- package/dist/config/types.d.ts +4 -1
- package/dist/config/types.js.map +1 -1
- package/dist/config/validation.js +3 -5
- package/dist/config/validation.js.map +1 -1
- package/dist/config-validator.js +0 -1
- package/dist/config-validator.js.map +1 -1
- package/dist/constants/category.js +0 -1
- package/dist/constants/category.js.map +1 -1
- package/dist/constants/platforms.js +5 -1
- package/dist/constants/platforms.js.map +1 -1
- package/dist/data/monorepo.json +8 -2
- package/dist/data/source-urls.json +1 -0
- package/dist/data-files.generated.js +2 -2
- package/dist/data-files.generated.js.map +1 -1
- package/dist/instrumentation/index.js +39 -15
- package/dist/instrumentation/index.js.map +1 -1
- package/dist/instrumentation/utils.js +1 -1
- package/dist/instrumentation/utils.js.map +1 -1
- package/dist/logger/cmd-serializer.js +0 -1
- package/dist/logger/cmd-serializer.js.map +1 -1
- package/dist/logger/config-serializer.js +0 -1
- package/dist/logger/config-serializer.js.map +1 -1
- package/dist/logger/index.js +1 -4
- package/dist/logger/index.js.map +1 -1
- package/dist/logger/once.js +4 -2
- package/dist/logger/once.js.map +1 -1
- package/dist/logger/pretty-stdout.js +0 -1
- package/dist/logger/pretty-stdout.js.map +1 -1
- package/dist/logger/renovate-logger.js +1 -1
- package/dist/logger/renovate-logger.js.map +1 -1
- package/dist/logger/utils.js +6 -11
- package/dist/logger/utils.js.map +1 -1
- package/dist/modules/datasource/api.js +4 -0
- package/dist/modules/datasource/api.js.map +1 -1
- package/dist/modules/datasource/artifactory/index.js +1 -2
- package/dist/modules/datasource/artifactory/index.js.map +1 -1
- package/dist/modules/datasource/aws-eks-addon/index.d.ts +11 -0
- package/dist/modules/datasource/aws-eks-addon/index.js +75 -0
- package/dist/modules/datasource/aws-eks-addon/index.js.map +1 -0
- package/dist/modules/datasource/aws-eks-addon/schema.d.ts +40 -0
- package/dist/modules/datasource/aws-eks-addon/schema.js +31 -0
- package/dist/modules/datasource/aws-eks-addon/schema.js.map +1 -0
- package/dist/modules/datasource/aws-machine-image/index.js +6 -5
- package/dist/modules/datasource/aws-machine-image/index.js.map +1 -1
- package/dist/modules/datasource/azure-pipelines-tasks/index.js +15 -1
- package/dist/modules/datasource/azure-pipelines-tasks/index.js.map +1 -1
- package/dist/modules/datasource/azure-pipelines-tasks/schema.d.ts +24 -0
- package/dist/modules/datasource/azure-pipelines-tasks/schema.js +3 -0
- package/dist/modules/datasource/azure-pipelines-tasks/schema.js.map +1 -1
- package/dist/modules/datasource/bazel/index.js +18 -2
- package/dist/modules/datasource/bazel/index.js.map +1 -1
- package/dist/modules/datasource/bazel/schema.d.ts +1 -0
- package/dist/modules/datasource/bazel/schema.js.map +1 -1
- package/dist/modules/datasource/bitbucket-server-tags/index.d.ts +19 -0
- package/dist/modules/datasource/bitbucket-server-tags/index.js +133 -0
- package/dist/modules/datasource/bitbucket-server-tags/index.js.map +1 -0
- package/dist/modules/datasource/bitbucket-server-tags/schema.d.ts +28 -0
- package/dist/modules/datasource/bitbucket-server-tags/schema.js +13 -0
- package/dist/modules/datasource/bitbucket-server-tags/schema.js.map +1 -0
- package/dist/modules/datasource/bitrise/index.js +1 -1
- package/dist/modules/datasource/bitrise/index.js.map +1 -1
- package/dist/modules/datasource/cdnjs/schema.d.ts +2 -2
- package/dist/modules/datasource/conda/index.js +18 -1
- package/dist/modules/datasource/conda/index.js.map +1 -1
- package/dist/modules/datasource/conda/prefix-dev.d.ts +3 -0
- package/dist/modules/datasource/conda/prefix-dev.js +81 -0
- package/dist/modules/datasource/conda/prefix-dev.js.map +1 -0
- package/dist/modules/datasource/conda/schema/prefix-dev.d.ts +189 -0
- package/dist/modules/datasource/conda/schema/prefix-dev.js +31 -0
- package/dist/modules/datasource/conda/schema/prefix-dev.js.map +1 -0
- package/dist/modules/datasource/conda/types.d.ts +1 -20
- package/dist/modules/datasource/conda/types.js.map +1 -1
- package/dist/modules/datasource/cpan/index.js +2 -4
- package/dist/modules/datasource/cpan/index.js.map +1 -1
- package/dist/modules/datasource/crate/index.js +3 -3
- package/dist/modules/datasource/crate/index.js.map +1 -1
- package/dist/modules/datasource/custom/formats/html.js +1 -1
- package/dist/modules/datasource/custom/formats/html.js.map +1 -1
- package/dist/modules/datasource/custom/formats/yaml.js +1 -1
- package/dist/modules/datasource/custom/formats/yaml.js.map +1 -1
- package/dist/modules/datasource/custom/index.js +4 -2
- package/dist/modules/datasource/custom/index.js.map +1 -1
- package/dist/modules/datasource/custom/schema.d.ts +22 -22
- package/dist/modules/datasource/custom/utils.js +1 -0
- package/dist/modules/datasource/custom/utils.js.map +1 -1
- package/dist/modules/datasource/dart/index.js +1 -1
- package/dist/modules/datasource/dart/index.js.map +1 -1
- package/dist/modules/datasource/dart-version/index.js +1 -1
- package/dist/modules/datasource/dart-version/index.js.map +1 -1
- package/dist/modules/datasource/datasource.js +0 -1
- package/dist/modules/datasource/datasource.js.map +1 -1
- package/dist/modules/datasource/deb/index.d.ts +4 -5
- package/dist/modules/datasource/deb/index.js +10 -11
- package/dist/modules/datasource/deb/index.js.map +1 -1
- package/dist/modules/datasource/deb/url.d.ts +3 -3
- package/dist/modules/datasource/deb/url.js +17 -13
- package/dist/modules/datasource/deb/url.js.map +1 -1
- package/dist/modules/datasource/deno/index.js +1 -1
- package/dist/modules/datasource/deno/index.js.map +1 -1
- package/dist/modules/datasource/deno/schema.d.ts +1 -1
- package/dist/modules/datasource/devbox/index.js +0 -1
- package/dist/modules/datasource/devbox/index.js.map +1 -1
- package/dist/modules/datasource/docker/common.js +5 -2
- package/dist/modules/datasource/docker/common.js.map +1 -1
- package/dist/modules/datasource/docker/index.js +10 -8
- package/dist/modules/datasource/docker/index.js.map +1 -1
- package/dist/modules/datasource/docker/schema.d.ts +77 -101
- package/dist/modules/datasource/docker/schema.js +2 -1
- package/dist/modules/datasource/docker/schema.js.map +1 -1
- package/dist/modules/datasource/flutter-version/index.js +1 -1
- package/dist/modules/datasource/flutter-version/index.js.map +1 -1
- package/dist/modules/datasource/galaxy/schema.d.ts +1 -1
- package/dist/modules/datasource/galaxy-collection/schema.d.ts +8 -8
- package/dist/modules/datasource/git-refs/index.js +1 -1
- package/dist/modules/datasource/git-refs/index.js.map +1 -1
- package/dist/modules/datasource/gitea-releases/schema.d.ts +2 -2
- package/dist/modules/datasource/gitea-tags/schema.d.ts +4 -4
- package/dist/modules/datasource/github-release-attachments/index.js +2 -2
- package/dist/modules/datasource/github-release-attachments/index.js.map +1 -1
- package/dist/modules/datasource/github-runners/index.js +2 -2
- package/dist/modules/datasource/github-runners/index.js.map +1 -1
- package/dist/modules/datasource/gitlab-packages/index.js +1 -1
- package/dist/modules/datasource/gitlab-packages/index.js.map +1 -1
- package/dist/modules/datasource/gitlab-releases/index.js +1 -3
- package/dist/modules/datasource/gitlab-releases/index.js.map +1 -1
- package/dist/modules/datasource/go/base.js +1 -1
- package/dist/modules/datasource/go/base.js.map +1 -1
- package/dist/modules/datasource/go/index.js +1 -1
- package/dist/modules/datasource/go/index.js.map +1 -1
- package/dist/modules/datasource/go/releases-direct.js +7 -4
- package/dist/modules/datasource/go/releases-direct.js.map +1 -1
- package/dist/modules/datasource/go/releases-goproxy.js +1 -1
- package/dist/modules/datasource/go/releases-goproxy.js.map +1 -1
- package/dist/modules/datasource/golang-version/index.js +2 -2
- package/dist/modules/datasource/golang-version/index.js.map +1 -1
- package/dist/modules/datasource/gradle-version/index.js +1 -1
- package/dist/modules/datasource/gradle-version/index.js.map +1 -1
- package/dist/modules/datasource/helm/index.js +1 -1
- package/dist/modules/datasource/helm/index.js.map +1 -1
- package/dist/modules/datasource/hex/index.js +1 -1
- package/dist/modules/datasource/hex/index.js.map +1 -1
- package/dist/modules/datasource/hex/schema.d.ts +11 -11
- package/dist/modules/datasource/hexpm-bob/index.js +1 -1
- package/dist/modules/datasource/hexpm-bob/index.js.map +1 -1
- package/dist/modules/datasource/index.js +4 -4
- package/dist/modules/datasource/index.js.map +1 -1
- package/dist/modules/datasource/java-version/index.js +0 -1
- package/dist/modules/datasource/java-version/index.js.map +1 -1
- package/dist/modules/datasource/jenkins-plugins/index.js +1 -1
- package/dist/modules/datasource/jenkins-plugins/index.js.map +1 -1
- package/dist/modules/datasource/maven/index.js +35 -27
- package/dist/modules/datasource/maven/index.js.map +1 -1
- package/dist/modules/datasource/maven/types.d.ts +3 -6
- package/dist/modules/datasource/maven/types.js.map +1 -1
- package/dist/modules/datasource/maven/util.d.ts +4 -5
- package/dist/modules/datasource/maven/util.js +94 -157
- package/dist/modules/datasource/maven/util.js.map +1 -1
- package/dist/modules/datasource/metadata.js +9 -1
- package/dist/modules/datasource/metadata.js.map +1 -1
- package/dist/modules/datasource/node-version/index.js +1 -1
- package/dist/modules/datasource/node-version/index.js.map +1 -1
- package/dist/modules/datasource/npm/get.d.ts +0 -1
- package/dist/modules/datasource/npm/get.js +14 -68
- package/dist/modules/datasource/npm/get.js.map +1 -1
- package/dist/modules/datasource/npm/index.js +1 -1
- package/dist/modules/datasource/npm/index.js.map +1 -1
- package/dist/modules/datasource/npm/npmrc.js +1 -1
- package/dist/modules/datasource/npm/npmrc.js.map +1 -1
- package/dist/modules/datasource/npm/types.d.ts +0 -8
- package/dist/modules/datasource/npm/types.js.map +1 -1
- package/dist/modules/datasource/nuget/index.js +1 -1
- package/dist/modules/datasource/nuget/index.js.map +1 -1
- package/dist/modules/datasource/nuget/v2.js +1 -1
- package/dist/modules/datasource/nuget/v2.js.map +1 -1
- package/dist/modules/datasource/nuget/v3.js +6 -6
- package/dist/modules/datasource/nuget/v3.js.map +1 -1
- package/dist/modules/datasource/orb/index.js +1 -1
- package/dist/modules/datasource/orb/index.js.map +1 -1
- package/dist/modules/datasource/packagist/index.js +2 -2
- package/dist/modules/datasource/packagist/index.js.map +1 -1
- package/dist/modules/datasource/packagist/schema.d.ts +32 -32
- package/dist/modules/datasource/pod/index.js +2 -2
- package/dist/modules/datasource/pod/index.js.map +1 -1
- package/dist/modules/datasource/postprocess-release.js +1 -1
- package/dist/modules/datasource/postprocess-release.js.map +1 -1
- package/dist/modules/datasource/pypi/index.js +1 -1
- package/dist/modules/datasource/pypi/index.js.map +1 -1
- package/dist/modules/datasource/python-version/index.js +1 -1
- package/dist/modules/datasource/python-version/index.js.map +1 -1
- package/dist/modules/datasource/repology/index.js +1 -1
- package/dist/modules/datasource/repology/index.js.map +1 -1
- package/dist/modules/datasource/ruby-version/index.js +1 -1
- package/dist/modules/datasource/ruby-version/index.js.map +1 -1
- package/dist/modules/datasource/rubygems/index.js +2 -2
- package/dist/modules/datasource/rubygems/index.js.map +1 -1
- package/dist/modules/datasource/rubygems/versions-endpoint-cache.js +2 -2
- package/dist/modules/datasource/rubygems/versions-endpoint-cache.js.map +1 -1
- package/dist/modules/datasource/sbt-package/index.js +1 -1
- package/dist/modules/datasource/sbt-package/index.js.map +1 -1
- package/dist/modules/datasource/sbt-plugin/index.js +1 -1
- package/dist/modules/datasource/sbt-plugin/index.js.map +1 -1
- package/dist/modules/datasource/schema.d.ts +4 -4
- package/dist/modules/datasource/terraform-module/index.js +1 -1
- package/dist/modules/datasource/terraform-module/index.js.map +1 -1
- package/dist/modules/datasource/terraform-provider/index.js +2 -3
- package/dist/modules/datasource/terraform-provider/index.js.map +1 -1
- package/dist/modules/datasource/types.d.ts +2 -0
- package/dist/modules/datasource/types.js.map +1 -1
- package/dist/modules/datasource/unity3d/index.d.ts +4 -1
- package/dist/modules/datasource/unity3d/index.js +36 -42
- package/dist/modules/datasource/unity3d/index.js.map +1 -1
- package/dist/modules/datasource/unity3d/schema.d.ts +47 -0
- package/dist/modules/datasource/unity3d/schema.js +17 -0
- package/dist/modules/datasource/unity3d/schema.js.map +1 -0
- package/dist/modules/manager/api.js +2 -0
- package/dist/modules/manager/api.js.map +1 -1
- package/dist/modules/manager/argocd/extract.js +1 -1
- package/dist/modules/manager/argocd/extract.js.map +1 -1
- package/dist/modules/manager/argocd/schema.d.ts +22 -22
- package/dist/modules/manager/asdf/upgradeable-tooling.js +94 -0
- package/dist/modules/manager/asdf/upgradeable-tooling.js.map +1 -1
- package/dist/modules/manager/azure-pipelines/schema.d.ts +32 -32
- package/dist/modules/manager/batect/schema.d.ts +4 -4
- package/dist/modules/manager/batect-wrapper/artifacts.js +1 -1
- package/dist/modules/manager/batect-wrapper/artifacts.js.map +1 -1
- package/dist/modules/manager/bazel/rules/docker.d.ts +6 -6
- package/dist/modules/manager/bazel/rules/git.d.ts +10 -10
- package/dist/modules/manager/bazel/rules/git.js +9 -2
- package/dist/modules/manager/bazel/rules/git.js.map +1 -1
- package/dist/modules/manager/bazel/rules/go.d.ts +5 -5
- package/dist/modules/manager/bazel/rules/maven.d.ts +7 -7
- package/dist/modules/manager/bazel/rules/oci.d.ts +6 -6
- package/dist/modules/manager/bazel-module/parser/fragments.d.ts +40 -40
- package/dist/modules/manager/bazel-module/parser/maven.d.ts +44 -90
- package/dist/modules/manager/bazel-module/parser/oci.d.ts +19 -42
- package/dist/modules/manager/bazel-module/rules.d.ts +50 -160
- package/dist/modules/manager/bun/artifacts.js +0 -1
- package/dist/modules/manager/bun/artifacts.js.map +1 -1
- package/dist/modules/manager/bun/extract.d.ts +1 -0
- package/dist/modules/manager/bun/extract.js +53 -27
- package/dist/modules/manager/bun/extract.js.map +1 -1
- package/dist/modules/manager/bun/index.js +1 -1
- package/dist/modules/manager/bun/index.js.map +1 -1
- package/dist/modules/manager/bun/utils.d.ts +2 -0
- package/dist/modules/manager/bun/utils.js +22 -0
- package/dist/modules/manager/bun/utils.js.map +1 -0
- package/dist/modules/manager/bundler/artifacts.js +0 -1
- package/dist/modules/manager/bundler/artifacts.js.map +1 -1
- package/dist/modules/manager/bundler/extract.js +2 -1
- package/dist/modules/manager/bundler/extract.js.map +1 -1
- package/dist/modules/manager/cake/index.js +4 -2
- package/dist/modules/manager/cake/index.js.map +1 -1
- package/dist/modules/manager/cargo/artifacts.js +5 -7
- package/dist/modules/manager/cargo/artifacts.js.map +1 -1
- package/dist/modules/manager/cargo/schema.d.ts +117 -117
- package/dist/modules/manager/circleci/extract.js +21 -30
- package/dist/modules/manager/circleci/extract.js.map +1 -1
- package/dist/modules/manager/circleci/schema.d.ts +33 -144
- package/dist/modules/manager/circleci/schema.js +21 -17
- package/dist/modules/manager/circleci/schema.js.map +1 -1
- package/dist/modules/manager/cocoapods/artifacts.js +1 -2
- package/dist/modules/manager/cocoapods/artifacts.js.map +1 -1
- package/dist/modules/manager/composer/artifacts.js +1 -2
- package/dist/modules/manager/composer/artifacts.js.map +1 -1
- package/dist/modules/manager/composer/schema.d.ts +32 -34
- package/dist/modules/manager/composer/schema.js +1 -1
- package/dist/modules/manager/composer/schema.js.map +1 -1
- package/dist/modules/manager/composer/utils.d.ts +1 -0
- package/dist/modules/manager/composer/utils.js +18 -6
- package/dist/modules/manager/composer/utils.js.map +1 -1
- package/dist/modules/manager/conan/artifacts.d.ts +2 -0
- package/dist/modules/manager/conan/artifacts.js +76 -0
- package/dist/modules/manager/conan/artifacts.js.map +1 -0
- package/dist/modules/manager/conan/index.d.ts +2 -0
- package/dist/modules/manager/conan/index.js +4 -1
- package/dist/modules/manager/conan/index.js.map +1 -1
- package/dist/modules/manager/copier/artifacts.js +0 -1
- package/dist/modules/manager/copier/artifacts.js.map +1 -1
- package/dist/modules/manager/crossplane/schema.d.ts +2 -2
- package/dist/modules/manager/custom/jsonata/index.js +4 -0
- package/dist/modules/manager/custom/jsonata/index.js.map +1 -1
- package/dist/modules/manager/custom/jsonata/schema.d.ts +21 -21
- package/dist/modules/manager/custom/regex/index.js +2 -0
- package/dist/modules/manager/custom/regex/index.js.map +1 -1
- package/dist/modules/manager/deps-edn/extract.js +2 -1
- package/dist/modules/manager/deps-edn/extract.js.map +1 -1
- package/dist/modules/manager/devbox/artifacts.d.ts +1 -1
- package/dist/modules/manager/devbox/artifacts.js +35 -11
- package/dist/modules/manager/devbox/artifacts.js.map +1 -1
- package/dist/modules/manager/devbox/schema.js +1 -1
- package/dist/modules/manager/devbox/schema.js.map +1 -1
- package/dist/modules/manager/devcontainer/extract.js +43 -1
- package/dist/modules/manager/devcontainer/extract.js.map +1 -1
- package/dist/modules/manager/devcontainer/index.js +11 -1
- package/dist/modules/manager/devcontainer/index.js.map +1 -1
- package/dist/modules/manager/devcontainer/schema.d.ts +7 -3
- package/dist/modules/manager/devcontainer/schema.js +3 -1
- package/dist/modules/manager/devcontainer/schema.js.map +1 -1
- package/dist/modules/manager/docker-compose/schema.d.ts +6 -6
- package/dist/modules/manager/dockerfile/extract.js +2 -6
- package/dist/modules/manager/dockerfile/extract.js.map +1 -1
- package/dist/modules/manager/fingerprint.generated.js +86 -85
- package/dist/modules/manager/fingerprint.generated.js.map +1 -1
- package/dist/modules/manager/flux/artifacts.js +0 -1
- package/dist/modules/manager/flux/artifacts.js.map +1 -1
- package/dist/modules/manager/flux/extract.js +27 -24
- package/dist/modules/manager/flux/extract.js.map +1 -1
- package/dist/modules/manager/flux/schema.d.ts +130 -154
- package/dist/modules/manager/github-actions/extract.js +60 -39
- package/dist/modules/manager/github-actions/extract.js.map +1 -1
- package/dist/modules/manager/github-actions/schema.d.ts +66 -0
- package/dist/modules/manager/github-actions/schema.js +38 -0
- package/dist/modules/manager/github-actions/schema.js.map +1 -0
- package/dist/modules/manager/gitlabci/extract.d.ts +1 -5
- package/dist/modules/manager/gitlabci/extract.js +27 -126
- package/dist/modules/manager/gitlabci/extract.js.map +1 -1
- package/dist/modules/manager/gitlabci/schema.d.ts +55 -0
- package/dist/modules/manager/gitlabci/schema.js +63 -0
- package/dist/modules/manager/gitlabci/schema.js.map +1 -0
- package/dist/modules/manager/gitlabci-include/extract.js +6 -54
- package/dist/modules/manager/gitlabci-include/extract.js.map +1 -1
- package/dist/modules/manager/gitlabci-include/schema.d.ts +13 -0
- package/dist/modules/manager/gitlabci-include/schema.js +46 -0
- package/dist/modules/manager/gitlabci-include/schema.js.map +1 -0
- package/dist/modules/manager/glasskube/schema.d.ts +8 -8
- package/dist/modules/manager/gomod/artifacts-extra.js +12 -4
- package/dist/modules/manager/gomod/artifacts-extra.js.map +1 -1
- package/dist/modules/manager/gomod/artifacts.js +24 -10
- package/dist/modules/manager/gomod/artifacts.js.map +1 -1
- package/dist/modules/manager/gomod/extract.js +23 -0
- package/dist/modules/manager/gomod/extract.js.map +1 -1
- package/dist/modules/manager/gomod/line-parser.js +16 -0
- package/dist/modules/manager/gomod/line-parser.js.map +1 -1
- package/dist/modules/manager/gomod/update.js +5 -3
- package/dist/modules/manager/gomod/update.js.map +1 -1
- package/dist/modules/manager/gradle/artifacts.js +0 -1
- package/dist/modules/manager/gradle/artifacts.js.map +1 -1
- package/dist/modules/manager/gradle/extract/catalog.js +1 -1
- package/dist/modules/manager/gradle/extract/catalog.js.map +1 -1
- package/dist/modules/manager/gradle/extract.js +8 -13
- package/dist/modules/manager/gradle/extract.js.map +1 -1
- package/dist/modules/manager/gradle/parser/assignments.js +2 -2
- package/dist/modules/manager/gradle/parser/assignments.js.map +1 -1
- package/dist/modules/manager/gradle/parser/handlers.d.ts +1 -2
- package/dist/modules/manager/gradle/parser/handlers.js +17 -24
- package/dist/modules/manager/gradle/parser/handlers.js.map +1 -1
- package/dist/modules/manager/gradle/parser/registry-urls.js +46 -12
- package/dist/modules/manager/gradle/parser/registry-urls.js.map +1 -1
- package/dist/modules/manager/gradle/types.d.ts +1 -0
- package/dist/modules/manager/gradle/types.js.map +1 -1
- package/dist/modules/manager/gradle-wrapper/artifacts.js +1 -2
- package/dist/modules/manager/gradle-wrapper/artifacts.js.map +1 -1
- package/dist/modules/manager/helmfile/artifacts.js +0 -1
- package/dist/modules/manager/helmfile/artifacts.js.map +1 -1
- package/dist/modules/manager/helmfile/extract.js +4 -0
- package/dist/modules/manager/helmfile/extract.js.map +1 -1
- package/dist/modules/manager/helmfile/schema.d.ts +9 -9
- package/dist/modules/manager/helmv3/artifacts.js +0 -1
- package/dist/modules/manager/helmv3/artifacts.js.map +1 -1
- package/dist/modules/manager/helmv3/utils.js +3 -1
- package/dist/modules/manager/helmv3/utils.js.map +1 -1
- package/dist/modules/manager/hermit/artifacts.js +0 -1
- package/dist/modules/manager/hermit/artifacts.js.map +1 -1
- package/dist/modules/manager/homebrew/extract.js +0 -1
- package/dist/modules/manager/homebrew/extract.js.map +1 -1
- package/dist/modules/manager/jsonnet-bundler/artifacts.js +0 -1
- package/dist/modules/manager/jsonnet-bundler/artifacts.js.map +1 -1
- package/dist/modules/manager/kustomize/artifacts.d.ts +2 -0
- package/dist/modules/manager/kustomize/artifacts.js +154 -0
- package/dist/modules/manager/kustomize/artifacts.js.map +1 -0
- package/dist/modules/manager/kustomize/common.d.ts +3 -0
- package/dist/modules/manager/kustomize/common.js +22 -0
- package/dist/modules/manager/kustomize/common.js.map +1 -0
- package/dist/modules/manager/kustomize/index.d.ts +1 -0
- package/dist/modules/manager/kustomize/index.js +3 -1
- package/dist/modules/manager/kustomize/index.js.map +1 -1
- package/dist/modules/manager/kustomize/types.d.ts +4 -0
- package/dist/modules/manager/kustomize/types.js.map +1 -1
- package/dist/modules/manager/maven/extract.js +4 -4
- package/dist/modules/manager/maven/extract.js.map +1 -1
- package/dist/modules/manager/maven-wrapper/artifacts.js +0 -1
- package/dist/modules/manager/maven-wrapper/artifacts.js.map +1 -1
- package/dist/modules/manager/mise/extract.js +1 -1
- package/dist/modules/manager/mise/extract.js.map +1 -1
- package/dist/modules/manager/mix/artifacts.js +64 -14
- package/dist/modules/manager/mix/artifacts.js.map +1 -1
- package/dist/modules/manager/mix/index.d.ts +1 -0
- package/dist/modules/manager/mix/index.js +2 -1
- package/dist/modules/manager/mix/index.js.map +1 -1
- package/dist/modules/manager/nix/artifacts.js +0 -1
- package/dist/modules/manager/nix/artifacts.js.map +1 -1
- package/dist/modules/manager/nix/extract.js +1 -1
- package/dist/modules/manager/nix/extract.js.map +1 -1
- package/dist/modules/manager/nix/schema.d.ts +20 -20
- package/dist/modules/manager/nix/schema.js +1 -0
- package/dist/modules/manager/nix/schema.js.map +1 -1
- package/dist/modules/manager/npm/artifacts.js +0 -1
- package/dist/modules/manager/npm/artifacts.js.map +1 -1
- package/dist/modules/manager/npm/extract/common/package-file.js +1 -0
- package/dist/modules/manager/npm/extract/common/package-file.js.map +1 -1
- package/dist/modules/manager/npm/extract/yarn.js +2 -2
- package/dist/modules/manager/npm/extract/yarn.js.map +1 -1
- package/dist/modules/manager/npm/post-update/npm.js +0 -1
- package/dist/modules/manager/npm/post-update/npm.js.map +1 -1
- package/dist/modules/manager/npm/post-update/pnpm.js +13 -2
- package/dist/modules/manager/npm/post-update/pnpm.js.map +1 -1
- package/dist/modules/manager/npm/post-update/rules.js +11 -1
- package/dist/modules/manager/npm/post-update/rules.js.map +1 -1
- package/dist/modules/manager/npm/post-update/yarn.js +0 -1
- package/dist/modules/manager/npm/post-update/yarn.js.map +1 -1
- package/dist/modules/manager/npm/schema.d.ts +13 -13
- package/dist/modules/manager/npm/update/dependency/index.js +1 -1
- package/dist/modules/manager/npm/update/dependency/index.js.map +1 -1
- package/dist/modules/manager/nuget/artifacts.js +1 -2
- package/dist/modules/manager/nuget/artifacts.js.map +1 -1
- package/dist/modules/manager/nuget/extract.js +21 -18
- package/dist/modules/manager/nuget/extract.js.map +1 -1
- package/dist/modules/manager/nuget/package-tree.js +4 -0
- package/dist/modules/manager/nuget/package-tree.js.map +1 -1
- package/dist/modules/manager/nuget/schema.d.ts +8 -8
- package/dist/modules/manager/nuget/util.js +4 -1
- package/dist/modules/manager/nuget/util.js.map +1 -1
- package/dist/modules/manager/ocb/schema.d.ts +6 -6
- package/dist/modules/manager/pep621/processors/pdm.js +0 -1
- package/dist/modules/manager/pep621/processors/pdm.js.map +1 -1
- package/dist/modules/manager/pep621/processors/uv.js +0 -1
- package/dist/modules/manager/pep621/processors/uv.js.map +1 -1
- package/dist/modules/manager/pep621/schema.d.ts +346 -54
- package/dist/modules/manager/pep621/schema.js +2 -0
- package/dist/modules/manager/pep621/schema.js.map +1 -1
- package/dist/modules/manager/pep621/utils.js +1 -1
- package/dist/modules/manager/pep621/utils.js.map +1 -1
- package/dist/modules/manager/pip-compile/common.js +0 -1
- package/dist/modules/manager/pip-compile/common.js.map +1 -1
- package/dist/modules/manager/pip_requirements/artifacts.js +0 -1
- package/dist/modules/manager/pip_requirements/artifacts.js.map +1 -1
- package/dist/modules/manager/pip_requirements/common.js +2 -6
- package/dist/modules/manager/pip_requirements/common.js.map +1 -1
- package/dist/modules/manager/pipenv/artifacts.js +0 -1
- package/dist/modules/manager/pipenv/artifacts.js.map +1 -1
- package/dist/modules/manager/pixi/artifacts.d.ts +3 -0
- package/dist/modules/manager/pixi/artifacts.js +78 -0
- package/dist/modules/manager/pixi/artifacts.js.map +1 -0
- package/dist/modules/manager/pixi/extract.d.ts +4 -0
- package/dist/modules/manager/pixi/extract.js +131 -0
- package/dist/modules/manager/pixi/extract.js.map +1 -0
- package/dist/modules/manager/pixi/index.d.ts +10 -0
- package/dist/modules/manager/pixi/index.js +20 -0
- package/dist/modules/manager/pixi/index.js.map +1 -0
- package/dist/modules/manager/pixi/schema.d.ts +405 -0
- package/dist/modules/manager/pixi/schema.js +147 -0
- package/dist/modules/manager/pixi/schema.js.map +1 -0
- package/dist/modules/manager/poetry/artifacts.js +3 -4
- package/dist/modules/manager/poetry/artifacts.js.map +1 -1
- package/dist/modules/manager/poetry/extract.js +2 -1
- package/dist/modules/manager/poetry/extract.js.map +1 -1
- package/dist/modules/manager/poetry/schema.d.ts +48 -48
- package/dist/modules/manager/pub/artifacts.js +0 -1
- package/dist/modules/manager/pub/artifacts.js.map +1 -1
- package/dist/modules/manager/pub/schema.d.ts +8 -8
- package/dist/modules/manager/scalafmt/extract.js +1 -1
- package/dist/modules/manager/scalafmt/extract.js.map +1 -1
- package/dist/modules/manager/sveltos/schema.d.ts +30 -42
- package/dist/modules/manager/terraform/lockfile/hash.d.ts +1 -1
- package/dist/modules/manager/terraform/util.js +1 -3
- package/dist/modules/manager/terraform/util.js.map +1 -1
- package/dist/modules/manager/types.d.ts +6 -2
- package/dist/modules/manager/types.js.map +1 -1
- package/dist/modules/manager/vendir/schema.d.ts +7 -7
- package/dist/modules/platform/api.d.ts +1 -1
- package/dist/modules/platform/azure/azure-helper.js +2 -2
- package/dist/modules/platform/azure/azure-helper.js.map +1 -1
- package/dist/modules/platform/azure/index.js +14 -14
- package/dist/modules/platform/azure/index.js.map +1 -1
- package/dist/modules/platform/bitbucket/comments.js +4 -4
- package/dist/modules/platform/bitbucket/comments.js.map +1 -1
- package/dist/modules/platform/bitbucket/index.d.ts +1 -0
- package/dist/modules/platform/bitbucket/index.js +54 -44
- package/dist/modules/platform/bitbucket/index.js.map +1 -1
- package/dist/modules/platform/bitbucket/schema.d.ts +14 -14
- package/dist/modules/platform/bitbucket/utils.js +3 -3
- package/dist/modules/platform/bitbucket/utils.js.map +1 -1
- package/dist/modules/platform/bitbucket-server/index.d.ts +3 -3
- package/dist/modules/platform/bitbucket-server/index.js +81 -81
- package/dist/modules/platform/bitbucket-server/index.js.map +1 -1
- package/dist/modules/platform/bitbucket-server/pr-cache.d.ts +23 -0
- package/dist/modules/platform/bitbucket-server/pr-cache.js +125 -0
- package/dist/modules/platform/bitbucket-server/pr-cache.js.map +1 -0
- package/dist/modules/platform/bitbucket-server/schema.d.ts +76 -0
- package/dist/modules/platform/bitbucket-server/schema.js +15 -1
- package/dist/modules/platform/bitbucket-server/schema.js.map +1 -1
- package/dist/modules/platform/bitbucket-server/types.d.ts +8 -2
- package/dist/modules/platform/bitbucket-server/types.js.map +1 -1
- package/dist/modules/platform/bitbucket-server/utils.d.ts +0 -2
- package/dist/modules/platform/bitbucket-server/utils.js +6 -52
- package/dist/modules/platform/bitbucket-server/utils.js.map +1 -1
- package/dist/modules/platform/codecommit/codecommit-client.js +6 -6
- package/dist/modules/platform/codecommit/codecommit-client.js.map +1 -1
- package/dist/modules/platform/codecommit/index.js +24 -24
- package/dist/modules/platform/codecommit/index.js.map +1 -1
- package/dist/modules/platform/gerrit/client.d.ts +0 -3
- package/dist/modules/platform/gerrit/client.js +20 -29
- package/dist/modules/platform/gerrit/client.js.map +1 -1
- package/dist/modules/platform/gerrit/index.js +0 -6
- package/dist/modules/platform/gerrit/index.js.map +1 -1
- package/dist/modules/platform/gerrit/scm.js +5 -6
- package/dist/modules/platform/gerrit/scm.js.map +1 -1
- package/dist/modules/platform/gerrit/types.d.ts +1 -4
- package/dist/modules/platform/gerrit/types.js.map +1 -1
- package/dist/modules/platform/gerrit/utils.d.ts +3 -2
- package/dist/modules/platform/gerrit/utils.js +4 -8
- package/dist/modules/platform/gerrit/utils.js.map +1 -1
- package/dist/modules/platform/gitea/gitea-helper.d.ts +1 -0
- package/dist/modules/platform/gitea/gitea-helper.js +16 -0
- package/dist/modules/platform/gitea/gitea-helper.js.map +1 -1
- package/dist/modules/platform/gitea/index.d.ts +1 -0
- package/dist/modules/platform/gitea/index.js +33 -16
- package/dist/modules/platform/gitea/index.js.map +1 -1
- package/dist/modules/platform/gitea/schema.d.ts +8 -8
- package/dist/modules/platform/gitea/types.d.ts +1 -1
- package/dist/modules/platform/gitea/types.js.map +1 -1
- package/dist/modules/platform/github/common.d.ts +2 -0
- package/dist/modules/platform/github/common.js +16 -0
- package/dist/modules/platform/github/common.js.map +1 -1
- package/dist/modules/platform/github/index.d.ts +1 -1
- package/dist/modules/platform/github/index.js +87 -82
- package/dist/modules/platform/github/index.js.map +1 -1
- package/dist/modules/platform/github/issue.d.ts +18 -18
- package/dist/modules/platform/github/massage-markdown-links.js +2 -2
- package/dist/modules/platform/github/massage-markdown-links.js.map +1 -1
- package/dist/modules/platform/github/pr.js +3 -3
- package/dist/modules/platform/github/pr.js.map +1 -1
- package/dist/modules/platform/github/schema.d.ts +128 -128
- package/dist/modules/platform/github/schema.js +3 -1
- package/dist/modules/platform/github/schema.js.map +1 -1
- package/dist/modules/platform/gitlab/index.d.ts +1 -0
- package/dist/modules/platform/gitlab/index.js +72 -49
- package/dist/modules/platform/gitlab/index.js.map +1 -1
- package/dist/modules/platform/index.js +0 -1
- package/dist/modules/platform/index.js.map +1 -1
- package/dist/modules/platform/scm.d.ts +1 -1
- package/dist/modules/versioning/api.js +2 -0
- package/dist/modules/versioning/api.js.map +1 -1
- package/dist/modules/versioning/composer/index.js +10 -0
- package/dist/modules/versioning/composer/index.js.map +1 -1
- package/dist/modules/versioning/conda/index.d.ts +41 -0
- package/dist/modules/versioning/conda/index.js +178 -0
- package/dist/modules/versioning/conda/index.js.map +1 -0
- package/dist/modules/versioning/distro.js +1 -3
- package/dist/modules/versioning/distro.js.map +1 -1
- package/dist/modules/versioning/hashicorp/convertor.d.ts +2 -1
- package/dist/modules/versioning/hashicorp/convertor.js +13 -8
- package/dist/modules/versioning/hashicorp/convertor.js.map +1 -1
- package/dist/modules/versioning/hex/index.js +3 -3
- package/dist/modules/versioning/hex/index.js.map +1 -1
- package/dist/modules/versioning/npm/index.js +2 -1
- package/dist/modules/versioning/npm/index.js.map +1 -1
- package/dist/modules/versioning/schema.js +1 -1
- package/dist/modules/versioning/schema.js.map +1 -1
- package/dist/modules/versioning/types.d.ts +4 -0
- package/dist/modules/versioning/types.js.map +1 -1
- package/dist/proxy.js +2 -1
- package/dist/proxy.js.map +1 -1
- package/dist/renovate.js +2 -2
- package/dist/renovate.js.map +1 -1
- package/dist/util/cache/package/decorator.js +2 -2
- package/dist/util/cache/package/decorator.js.map +1 -1
- package/dist/util/cache/package/redis.js +0 -1
- package/dist/util/cache/package/redis.js.map +1 -1
- package/dist/util/cache/package/types.d.ts +1 -1
- package/dist/util/cache/package/types.js.map +1 -1
- package/dist/util/cache/repository/impl/base.d.ts +1 -1
- package/dist/util/cache/repository/impl/base.js +4 -0
- package/dist/util/cache/repository/impl/base.js.map +1 -1
- package/dist/util/cache/repository/schema.d.ts +4 -4
- package/dist/util/cache/repository/types.d.ts +3 -0
- package/dist/util/cache/repository/types.js.map +1 -1
- package/dist/util/common.d.ts +4 -2
- package/dist/util/common.js +17 -3
- package/dist/util/common.js.map +1 -1
- package/dist/util/env.d.ts +4 -0
- package/dist/util/env.js +22 -0
- package/dist/util/env.js.map +1 -0
- package/dist/util/exec/containerbase.js +19 -14
- package/dist/util/exec/containerbase.js.map +1 -1
- package/dist/util/exec/index.js +5 -2
- package/dist/util/exec/index.js.map +1 -1
- package/dist/util/exec/types.d.ts +0 -2
- package/dist/util/exec/types.js.map +1 -1
- package/dist/util/exec/utils.d.ts +1 -1
- package/dist/util/exec/utils.js +6 -5
- package/dist/util/exec/utils.js.map +1 -1
- package/dist/util/git/auth.js +8 -5
- package/dist/util/git/auth.js.map +1 -1
- package/dist/util/git/author.js +1 -1
- package/dist/util/git/author.js.map +1 -1
- package/dist/util/git/config.js +0 -1
- package/dist/util/git/config.js.map +1 -1
- package/dist/util/git/error.js +4 -2
- package/dist/util/git/error.js.map +1 -1
- package/dist/util/git/index.js +75 -52
- package/dist/util/git/index.js.map +1 -1
- package/dist/util/git/private-key.js +2 -4
- package/dist/util/git/private-key.js.map +1 -1
- package/dist/util/git/types.d.ts +2 -0
- package/dist/util/git/types.js.map +1 -1
- package/dist/util/git/url.js +1 -1
- package/dist/util/git/url.js.map +1 -1
- package/dist/util/github/graphql/datasource-fetcher.js +3 -5
- package/dist/util/github/graphql/datasource-fetcher.js.map +1 -1
- package/dist/util/github/graphql/query-adapters/releases-query-adapter.d.ts +2 -2
- package/dist/util/github/graphql/query-adapters/tags-query-adapter.d.ts +2 -2
- package/dist/util/http/auth.js +0 -1
- package/dist/util/http/auth.js.map +1 -1
- package/dist/util/http/bitbucket-server.d.ts +7 -5
- package/dist/util/http/bitbucket-server.js +26 -23
- package/dist/util/http/bitbucket-server.js.map +1 -1
- package/dist/util/http/bitbucket.d.ts +6 -5
- package/dist/util/http/bitbucket.js +34 -31
- package/dist/util/http/bitbucket.js.map +1 -1
- package/dist/util/http/cache/abstract-http-cache-provider.js +2 -2
- package/dist/util/http/cache/abstract-http-cache-provider.js.map +1 -1
- package/dist/util/http/cache/memory-http-cache-provider.d.ts +10 -0
- package/dist/util/http/cache/memory-http-cache-provider.js +29 -0
- package/dist/util/http/cache/memory-http-cache-provider.js.map +1 -0
- package/dist/util/http/cache/package-http-cache-provider.d.ts +23 -0
- package/dist/util/http/cache/package-http-cache-provider.js +80 -0
- package/dist/util/http/cache/package-http-cache-provider.js.map +1 -0
- package/dist/util/http/cache/schema.d.ts +2 -2
- package/dist/util/http/errors.d.ts +2 -0
- package/dist/util/http/errors.js +8 -0
- package/dist/util/http/errors.js.map +1 -0
- package/dist/util/http/gerrit.d.ts +6 -4
- package/dist/util/http/gerrit.js +11 -12
- package/dist/util/http/gerrit.js.map +1 -1
- package/dist/util/http/gitea.d.ts +5 -4
- package/dist/util/http/gitea.js +14 -13
- package/dist/util/http/gitea.js.map +1 -1
- package/dist/util/http/github.d.ts +14 -8
- package/dist/util/http/github.js +65 -60
- package/dist/util/http/github.js.map +1 -1
- package/dist/util/http/gitlab.d.ts +7 -5
- package/dist/util/http/gitlab.js +58 -46
- package/dist/util/http/gitlab.js.map +1 -1
- package/dist/util/http/got.d.ts +9 -0
- package/dist/util/http/got.js +54 -0
- package/dist/util/http/got.js.map +1 -0
- package/dist/util/http/host-rules.d.ts +2 -1
- package/dist/util/http/host-rules.js +17 -4
- package/dist/util/http/host-rules.js.map +1 -1
- package/dist/util/http/http.d.ts +93 -0
- package/dist/util/http/http.js +346 -0
- package/dist/util/http/http.js.map +1 -0
- package/dist/util/http/index.d.ts +6 -74
- package/dist/util/http/index.js +5 -359
- package/dist/util/http/index.js.map +1 -1
- package/dist/util/http/legacy.js +4 -1
- package/dist/util/http/legacy.js.map +1 -1
- package/dist/util/http/types.d.ts +9 -16
- package/dist/util/http/types.js.map +1 -1
- package/dist/util/schema-utils.d.ts +1 -0
- package/dist/util/schema-utils.js +43 -8
- package/dist/util/schema-utils.js.map +1 -1
- package/dist/util/stats.d.ts +10 -0
- package/dist/util/stats.js +45 -1
- package/dist/util/stats.js.map +1 -1
- package/dist/util/string.d.ts +16 -0
- package/dist/util/string.js +79 -0
- package/dist/util/string.js.map +1 -1
- package/dist/util/toml.d.ts +1 -0
- package/dist/util/toml.js +6 -0
- package/dist/util/toml.js.map +1 -1
- package/dist/util/url.js +3 -8
- package/dist/util/url.js.map +1 -1
- package/dist/util/yaml.js +3 -8
- package/dist/util/yaml.js.map +1 -1
- package/dist/workers/global/config/parse/env.js +3 -2
- package/dist/workers/global/config/parse/env.js.map +1 -1
- package/dist/workers/global/config/parse/file.js +19 -9
- package/dist/workers/global/config/parse/file.js.map +1 -1
- package/dist/workers/global/config/parse/host-rules-from-env.js +6 -2
- package/dist/workers/global/config/parse/host-rules-from-env.js.map +1 -1
- package/dist/workers/global/config/parse/index.js +15 -0
- package/dist/workers/global/config/parse/index.js.map +1 -1
- package/dist/workers/global/index.js +4 -2
- package/dist/workers/global/index.js.map +1 -1
- package/dist/workers/repository/cache.js +1 -2
- package/dist/workers/repository/cache.js.map +1 -1
- package/dist/workers/repository/config-migration/branch/migrated-data.js +2 -0
- package/dist/workers/repository/config-migration/branch/migrated-data.js.map +1 -1
- package/dist/workers/repository/index.js +1 -0
- package/dist/workers/repository/index.js.map +1 -1
- package/dist/workers/repository/init/merge.js +6 -3
- package/dist/workers/repository/init/merge.js.map +1 -1
- package/dist/workers/repository/onboarding/pr/config-description.js +3 -1
- package/dist/workers/repository/onboarding/pr/config-description.js.map +1 -1
- package/dist/workers/repository/process/extract-update.js +0 -1
- package/dist/workers/repository/process/extract-update.js.map +1 -1
- package/dist/workers/repository/process/fingerprint-fields.js +0 -1
- package/dist/workers/repository/process/fingerprint-fields.js.map +1 -1
- package/dist/workers/repository/process/libyear.js +2 -2
- package/dist/workers/repository/process/libyear.js.map +1 -1
- package/dist/workers/repository/process/lookup/index.js +15 -4
- package/dist/workers/repository/process/lookup/index.js.map +1 -1
- package/dist/workers/repository/process/lookup/timestamps.d.ts +18 -0
- package/dist/workers/repository/process/lookup/timestamps.js +69 -0
- package/dist/workers/repository/process/lookup/timestamps.js.map +1 -0
- package/dist/workers/repository/process/lookup/types.d.ts +1 -0
- package/dist/workers/repository/process/lookup/types.js.map +1 -1
- package/dist/workers/repository/process/lookup/utils.js +20 -9
- package/dist/workers/repository/process/lookup/utils.js.map +1 -1
- package/dist/workers/repository/process/sort.js +1 -1
- package/dist/workers/repository/process/sort.js.map +1 -1
- package/dist/workers/repository/process/vulnerabilities.js +1 -1
- package/dist/workers/repository/process/vulnerabilities.js.map +1 -1
- package/dist/workers/repository/process/write.js +1 -8
- package/dist/workers/repository/process/write.js.map +1 -1
- package/dist/workers/repository/reconfigure/utils.d.ts +2 -0
- package/dist/workers/repository/reconfigure/utils.js +16 -0
- package/dist/workers/repository/reconfigure/utils.js.map +1 -1
- package/dist/workers/repository/reconfigure/validate.js +6 -17
- package/dist/workers/repository/reconfigure/validate.js.map +1 -1
- package/dist/workers/repository/update/branch/auto-replace.js +25 -5
- package/dist/workers/repository/update/branch/auto-replace.js.map +1 -1
- package/dist/workers/repository/update/branch/commit.js +2 -0
- package/dist/workers/repository/update/branch/commit.js.map +1 -1
- package/dist/workers/repository/update/branch/execute-post-upgrade-commands.js +10 -1
- package/dist/workers/repository/update/branch/execute-post-upgrade-commands.js.map +1 -1
- package/dist/workers/repository/update/pr/body/config-description.js +26 -1
- package/dist/workers/repository/update/pr/body/config-description.js.map +1 -1
- package/dist/workers/repository/update/pr/body/index.js +21 -14
- package/dist/workers/repository/update/pr/body/index.js.map +1 -1
- package/dist/workers/repository/update/pr/changelog/api.js +8 -6
- package/dist/workers/repository/update/pr/changelog/api.js.map +1 -1
- package/dist/workers/repository/update/pr/changelog/bitbucket/index.js +1 -1
- package/dist/workers/repository/update/pr/changelog/bitbucket/index.js.map +1 -1
- package/dist/workers/repository/update/pr/changelog/bitbucket-server/index.d.ts +3 -0
- package/dist/workers/repository/update/pr/changelog/bitbucket-server/index.js +39 -0
- package/dist/workers/repository/update/pr/changelog/bitbucket-server/index.js.map +1 -0
- package/dist/workers/repository/update/pr/changelog/bitbucket-server/source.d.ts +8 -0
- package/dist/workers/repository/update/pr/changelog/bitbucket-server/source.js +31 -0
- package/dist/workers/repository/update/pr/changelog/bitbucket-server/source.js.map +1 -0
- package/dist/workers/repository/update/pr/changelog/github/index.js +6 -3
- package/dist/workers/repository/update/pr/changelog/github/index.js.map +1 -1
- package/dist/workers/repository/update/pr/changelog/gitlab/index.js +1 -1
- package/dist/workers/repository/update/pr/changelog/gitlab/index.js.map +1 -1
- package/dist/workers/repository/update/pr/changelog/release-notes.js +12 -8
- package/dist/workers/repository/update/pr/changelog/release-notes.js.map +1 -1
- package/dist/workers/repository/update/pr/changelog/source.d.ts +1 -1
- package/dist/workers/repository/update/pr/changelog/source.js +1 -0
- package/dist/workers/repository/update/pr/changelog/source.js.map +1 -1
- package/dist/workers/repository/update/pr/changelog/types.d.ts +1 -1
- package/dist/workers/repository/update/pr/changelog/types.js.map +1 -1
- package/dist/workers/repository/update/pr/index.js +2 -4
- package/dist/workers/repository/update/pr/index.js.map +1 -1
- package/dist/workers/repository/updates/flatten.js +8 -4
- package/dist/workers/repository/updates/flatten.js.map +1 -1
- package/dist/workers/repository/updates/generate.js +3 -2
- package/dist/workers/repository/updates/generate.js.map +1 -1
- package/dist/workers/types.d.ts +1 -4
- package/dist/workers/types.js.map +1 -1
- package/package.json +85 -85
- package/renovate-schema.json +24 -3
- package/dist/modules/manager/github-actions/types.d.ts +0 -30
- package/dist/modules/manager/github-actions/types.js +0 -3
- package/dist/modules/manager/github-actions/types.js.map +0 -1
- package/dist/modules/manager/gitlabci/common.d.ts +0 -6
- package/dist/modules/manager/gitlabci/common.js +0 -30
- package/dist/modules/manager/gitlabci/common.js.map +0 -1
- package/dist/modules/manager/gitlabci/types.d.ts +0 -35
- package/dist/modules/manager/gitlabci/types.js +0 -3
- package/dist/modules/manager/gitlabci/types.js.map +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"datasource-fetcher.js","sourceRoot":"","sources":["../../../../lib/util/github/graphql/datasource-fetcher.ts"],"names":[],"mappings":";;;;AAAA,8EAA6C;AAC7C,mDAAsD;AACtD,4CAAyC;AACzC,mFAA8E;AAC9E,qEAA+C;AAC/C,0EAAoD;AAQpD,gCAAuC;AACvC,oFAA4F;AAC5F,sFAA8F;AAY9F;;;;;GAKG;AACH,SAAS,qBAAqB,CAAC,GAAU;IAC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,OAAO,IAAI,CAAC,aAAa,EAAE,CAAC,iBAAiB,EAAE,CAAC;IAClD,CAAC;IAED,KAAK,CAAC,mBAAmB;QACvB,MAAM,EAAE,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;QAC7B,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,WAAW,EAAE,gBAAgB,CAAC;QAClD,IAAI,CAAC,YAAY,GAAG,MAAM,YAAY,CAAC,GAAG,CAAO,EAAE,EAAE,GAAG,CAAC,CAAC;IAC5D,CAAC;IAED,KAAK,CAAC,oBAAoB,CAAC,OAAe;QACxC,MAAM,EAAE,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;QAC7B,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,WAAW,EAAE,gBAAgB,CAAC;QAClD,MAAM,YAAY,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IACjD,CAAC;IAED;;;OAGG;IACK,aAAa;QACnB,MAAM,QAAQ,GAAG,kBAAkB,IAAI,CAAC,UAAU,EAAE,IAAI,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;QAC7E,MAAM,aAAa,GACjB,QAAQ,CAAC,GAAG,CAAwB,QAAQ,CAAC,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;QACxE,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;QACtC,OAAO,aAAa,CAAC;IACvB,CAAC;IAED,KAAK,CAAC,QAAQ;QACZ,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC;QACvC,OAAO,GAAG,CAAC;IACb,CAAC;CACF;AA7RD,wEA6RC","sourcesContent":["import AggregateError from 'aggregate-error';\nimport { GlobalConfig } from '../../../config/global';\nimport { logger } from '../../../logger';\nimport { ExternalHostError } from '../../../types/errors/external-host-error';\nimport * as memCache from '../../cache/memory';\nimport * as packageCache from '../../cache/package';\nimport type { PackageCacheNamespace } from '../../cache/package/types';\nimport type {\n GithubGraphqlResponse,\n GithubHttp,\n GithubHttpOptions,\n} from '../../http/github';\nimport type { HttpResponse } from '../../http/types';\nimport { getApiBaseUrl } from '../url';\nimport { GithubGraphqlMemoryCacheStrategy } from './cache-strategies/memory-cache-strategy';\nimport { GithubGraphqlPackageCacheStrategy } from './cache-strategies/package-cache-strategy';\nimport type {\n GithubDatasourceItem,\n GithubGraphqlCacheStrategy,\n GithubGraphqlDatasourceAdapter,\n GithubGraphqlPayload,\n GithubGraphqlRepoParams,\n GithubGraphqlRepoResponse,\n GithubPackageConfig,\n RawQueryResponse,\n} from './types';\n\n/**\n * We know empirically that certain type of GraphQL errors\n * can be fixed by shrinking page size.\n *\n * @see https://github.com/renovatebot/renovate/issues/16343\n */\nfunction isUnknownGraphqlError(err: Error): boolean {\n const { message } = err;\n return message.startsWith('Something went wrong while executing your query.');\n}\n\nfunction canBeSolvedByShrinking(err: Error): boolean {\n const errors: Error[] = err instanceof AggregateError ? [...err] : [err];\n return errors.some(\n (e) => err instanceof ExternalHostError || isUnknownGraphqlError(e),\n );\n}\n\nexport class GithubGraphqlDatasourceFetcher<\n GraphqlItem,\n ResultItem extends GithubDatasourceItem,\n> {\n static async query<T, U extends GithubDatasourceItem>(\n config: GithubPackageConfig,\n http: GithubHttp,\n adapter: GithubGraphqlDatasourceAdapter<T, U>,\n ): Promise<U[]> {\n const instance = new GithubGraphqlDatasourceFetcher<T, U>(\n config,\n http,\n adapter,\n );\n const items = await instance.getItems();\n return items;\n }\n\n private readonly baseUrl: string;\n private readonly repoOwner: string;\n private readonly repoName: string;\n\n private itemsPerQuery: 100 | 50 | 25 = 100;\n\n private queryCount = 0;\n\n private cursor: string | null = null;\n\n private isPersistent: boolean | undefined;\n\n constructor(\n packageConfig: GithubPackageConfig,\n private http: GithubHttp,\n private datasourceAdapter: GithubGraphqlDatasourceAdapter<\n GraphqlItem,\n ResultItem\n >,\n ) {\n const { packageName, registryUrl } = packageConfig;\n [this.repoOwner, this.repoName] = packageName.split('/');\n this.baseUrl = getApiBaseUrl(registryUrl).replace(/\\/v3\\/$/, '/'); // Replace for GHE\n }\n\n private getCacheNs(): PackageCacheNamespace {\n return this.datasourceAdapter.key;\n }\n\n private getCacheKey(): string {\n return [this.baseUrl, this.repoOwner, this.repoName].join(':');\n }\n\n private getRawQueryOptions(): GithubHttpOptions {\n const baseUrl = this.baseUrl;\n const repository = `${this.repoOwner}/${this.repoName}`;\n const query = this.datasourceAdapter.query;\n const variables: GithubGraphqlRepoParams = {\n owner: this.repoOwner,\n name: this.repoName,\n count: this.itemsPerQuery,\n cursor: this.cursor,\n };\n\n return {\n baseUrl,\n repository,\n readOnly: true,\n body: { query, variables },\n };\n }\n\n private async doRawQuery(): Promise<\n RawQueryResponse<GithubGraphqlPayload<GraphqlItem>>\n > {\n const requestOptions = this.getRawQueryOptions();\n\n type GraphqlData = GithubGraphqlRepoResponse<GraphqlItem>;\n type HttpBody = GithubGraphqlResponse<GraphqlData>;\n let httpRes: HttpResponse<HttpBody>;\n try {\n httpRes = await this.http.postJson<HttpBody>('/graphql', requestOptions);\n } catch (err) {\n return [null, err];\n }\n\n const { body } = httpRes;\n const { data, errors } = body;\n\n if (errors?.length) {\n if (errors.length === 1) {\n const { message } = errors[0];\n const err = new Error(message);\n return [null, err];\n } else {\n const errorInstances = errors.map(({ message }) => new Error(message));\n const err = new AggregateError(errorInstances);\n return [null, err];\n }\n }\n\n if (!data) {\n const msg = 'GitHub GraphQL datasource: failed to obtain data';\n const err = new Error(msg);\n return [null, err];\n }\n\n if (!data.repository) {\n const msg = 'GitHub GraphQL datasource: failed to obtain repository data';\n const err = new Error(msg);\n return [null, err];\n }\n\n if (!data.repository.payload) {\n const msg =\n 'GitHub GraphQL datasource: failed to obtain repository payload data';\n const err = new Error(msg);\n return [null, err];\n }\n\n this.queryCount += 1;\n\n if (this.isPersistent === undefined) {\n // For values other than explicit `false`,\n // we assume that items can not be cached.\n this.isPersistent = data.repository.isRepoPrivate === false;\n }\n\n const res = data.repository.payload;\n return [res, null];\n }\n\n private shrinkPageSize(): boolean {\n if (this.itemsPerQuery === 100) {\n this.itemsPerQuery = 50;\n return true;\n }\n\n if (this.itemsPerQuery === 50) {\n this.itemsPerQuery = 25;\n return true;\n }\n\n return false;\n }\n\n private hasReachedQueryLimit(): boolean {\n return this.queryCount >= 100;\n }\n\n private async doShrinkableQuery(): Promise<\n GithubGraphqlPayload<GraphqlItem>\n > {\n let res: GithubGraphqlPayload<GraphqlItem> | null = null;\n let err: Error | null = null;\n\n while (!res) {\n [res, err] = await this.doRawQuery();\n if (err) {\n if (!canBeSolvedByShrinking(err)) {\n throw err;\n }\n\n const shrinkResult = this.shrinkPageSize();\n if (!shrinkResult) {\n throw err;\n }\n const { body, ...options } = this.getRawQueryOptions();\n logger.debug(\n { options, newSize: this.itemsPerQuery },\n 'Shrinking GitHub GraphQL page size after error',\n );\n }\n }\n\n return res;\n }\n\n private _cacheStrategy: GithubGraphqlCacheStrategy<ResultItem> | undefined;\n\n private cacheStrategy(): GithubGraphqlCacheStrategy<ResultItem> {\n if (this._cacheStrategy) {\n return this._cacheStrategy;\n }\n const cacheNs = this.getCacheNs();\n const cacheKey = this.getCacheKey();\n const cachePrivatePackages = GlobalConfig.get(\n 'cachePrivatePackages',\n false,\n );\n this._cacheStrategy =\n cachePrivatePackages || this.isPersistent\n ? new GithubGraphqlPackageCacheStrategy<ResultItem>(cacheNs, cacheKey)\n : new GithubGraphqlMemoryCacheStrategy<ResultItem>(cacheNs, cacheKey);\n return this._cacheStrategy;\n }\n\n /**\n * This method is responsible for data synchronization.\n * It also detects persistence of the package, based on the first page result.\n */\n private async doPaginatedFetch(): Promise<void> {\n let hasNextPage = true;\n let isPaginationDone = false;\n let nextCursor: string | undefined;\n while (hasNextPage && !isPaginationDone && !this.hasReachedQueryLimit()) {\n const queryResult = await this.doShrinkableQuery();\n\n const resultItems: ResultItem[] = [];\n for (const node of queryResult.nodes) {\n const item = this.datasourceAdapter.transform(node);\n if (!item) {\n logger.once.info(\n {\n packageName: `${this.repoOwner}/${this.repoName}`,\n baseUrl: this.baseUrl,\n },\n `GitHub GraphQL datasource: skipping empty item`,\n );\n continue;\n }\n resultItems.push(item);\n }\n\n // It's important to call `getCacheStrategy()` after `doShrinkableQuery()`\n // because `doShrinkableQuery()` may change `this.isCacheable`.\n //\n // Otherwise, cache items for public packages will never be persisted\n // in long-term cache.\n isPaginationDone = await this.cacheStrategy().reconcile(resultItems);\n\n hasNextPage = !!queryResult?.pageInfo?.hasNextPage;\n nextCursor = queryResult?.pageInfo?.endCursor;\n if (hasNextPage && nextCursor) {\n this.cursor = nextCursor;\n }\n }\n\n if (this.isPersistent) {\n await this.storePersistenceFlag(30);\n }\n }\n\n private async doCachedQuery(): Promise<ResultItem[]> {\n await this.loadPersistenceFlag();\n if (!this.isPersistent) {\n await this.doPaginatedFetch();\n }\n\n const res = await this.cacheStrategy().finalizeAndReturn();\n if (res.length) {\n return res;\n }\n\n delete this.isPersistent;\n await this.doPaginatedFetch();\n return this.cacheStrategy().finalizeAndReturn();\n }\n\n async loadPersistenceFlag(): Promise<void> {\n const ns = this.getCacheNs();\n const key = `${this.getCacheKey()}:is-persistent`;\n this.isPersistent = await packageCache.get<true>(ns, key);\n }\n\n async storePersistenceFlag(minutes: number): Promise<void> {\n const ns = this.getCacheNs();\n const key = `${this.getCacheKey()}:is-persistent`;\n await packageCache.set(ns, key, true, minutes);\n }\n\n /**\n * This method ensures the only one query is executed\n * to a particular package during single run.\n */\n private doUniqueQuery(): Promise<ResultItem[]> {\n const cacheKey = `github-pending:${this.getCacheNs()}:${this.getCacheKey()}`;\n const resultPromise =\n memCache.get<Promise<ResultItem[]>>(cacheKey) ?? this.doCachedQuery();\n memCache.set(cacheKey, resultPromise);\n return resultPromise;\n }\n\n async getItems(): Promise<ResultItem[]> {\n const res = await this.doUniqueQuery();\n return res;\n }\n}\n"]}
|
1
|
+
{"version":3,"file":"datasource-fetcher.js","sourceRoot":"","sources":["../../../../lib/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 'aggregate-error';\nimport { GlobalConfig } from '../../../config/global';\nimport { logger } from '../../../logger';\nimport { ExternalHostError } from '../../../types/errors/external-host-error';\nimport * as memCache from '../../cache/memory';\nimport * as packageCache from '../../cache/package';\nimport type { PackageCacheNamespace } from '../../cache/package/types';\nimport type {\n GithubGraphqlResponse,\n GithubHttp,\n GithubHttpOptions,\n} from '../../http/github';\nimport type { HttpResponse } from '../../http/types';\nimport { getApiBaseUrl } from '../url';\nimport { GithubGraphqlMemoryCacheStrategy } from './cache-strategies/memory-cache-strategy';\nimport { GithubGraphqlPackageCacheStrategy } from './cache-strategies/package-cache-strategy';\nimport type {\n GithubDatasourceItem,\n GithubGraphqlCacheStrategy,\n GithubGraphqlDatasourceAdapter,\n GithubGraphqlPayload,\n GithubGraphqlRepoParams,\n GithubGraphqlRepoResponse,\n GithubPackageConfig,\n RawQueryResponse,\n} from './types';\n\n/**\n * We know empirically that certain type of GraphQL errors\n * can be fixed by shrinking page size.\n *\n * @see https://github.com/renovatebot/renovate/issues/16343\n */\nfunction isUnknownGraphqlError(err: Error): boolean {\n const { message } = err;\n return message.startsWith('Something went wrong while executing your query.');\n}\n\nfunction canBeSolvedByShrinking(err: Error): boolean {\n const errors: Error[] = err instanceof AggregateError ? [...err] : [err];\n return errors.some(\n (e) => err instanceof ExternalHostError || isUnknownGraphqlError(e),\n );\n}\n\nexport class GithubGraphqlDatasourceFetcher<\n GraphqlItem,\n ResultItem extends GithubDatasourceItem,\n> {\n static async query<T, U extends GithubDatasourceItem>(\n config: GithubPackageConfig,\n http: GithubHttp,\n adapter: GithubGraphqlDatasourceAdapter<T, U>,\n ): Promise<U[]> {\n const instance = new GithubGraphqlDatasourceFetcher<T, U>(\n config,\n http,\n adapter,\n );\n const items = await instance.getItems();\n return items;\n }\n\n private readonly baseUrl: string;\n private readonly repoOwner: string;\n private readonly repoName: string;\n\n private itemsPerQuery: 100 | 50 | 25 = 100;\n\n private queryCount = 0;\n\n private cursor: string | null = null;\n\n private isPersistent: boolean | undefined;\n\n constructor(\n packageConfig: GithubPackageConfig,\n private http: GithubHttp,\n private datasourceAdapter: GithubGraphqlDatasourceAdapter<\n GraphqlItem,\n ResultItem\n >,\n ) {\n const { packageName, registryUrl } = packageConfig;\n [this.repoOwner, this.repoName] = packageName.split('/');\n this.baseUrl = getApiBaseUrl(registryUrl).replace(/\\/v3\\/$/, '/'); // Replace for GHE\n }\n\n private getCacheNs(): PackageCacheNamespace {\n return this.datasourceAdapter.key;\n }\n\n private getCacheKey(): string {\n return [this.baseUrl, this.repoOwner, this.repoName].join(':');\n }\n\n private getRawQueryOptions(): GithubHttpOptions {\n const baseUrl = this.baseUrl;\n const repository = `${this.repoOwner}/${this.repoName}`;\n const query = this.datasourceAdapter.query;\n const variables: GithubGraphqlRepoParams = {\n owner: this.repoOwner,\n name: this.repoName,\n count: this.itemsPerQuery,\n cursor: this.cursor,\n };\n\n return {\n baseUrl,\n repository,\n readOnly: true,\n body: { query, variables },\n };\n }\n\n private async doRawQuery(): Promise<\n RawQueryResponse<GithubGraphqlPayload<GraphqlItem>>\n > {\n const requestOptions = this.getRawQueryOptions();\n\n type GraphqlData = GithubGraphqlRepoResponse<GraphqlItem>;\n type HttpBody = GithubGraphqlResponse<GraphqlData>;\n let httpRes: HttpResponse<HttpBody>;\n try {\n httpRes = await this.http.postJson<HttpBody>('/graphql', requestOptions);\n } catch (err) {\n return [null, err];\n }\n\n const { body } = httpRes;\n const { data, errors } = body;\n\n if (errors?.length) {\n if (errors.length === 1) {\n const { message } = errors[0];\n const err = new Error(message);\n return [null, err];\n } else {\n const errorInstances = errors.map(({ message }) => new Error(message));\n const err = new AggregateError(errorInstances);\n return [null, err];\n }\n }\n\n if (!data) {\n const msg = 'GitHub GraphQL datasource: failed to obtain data';\n const err = new Error(msg);\n return [null, err];\n }\n\n if (!data.repository) {\n const msg = 'GitHub GraphQL datasource: failed to obtain repository data';\n const err = new Error(msg);\n return [null, err];\n }\n\n if (!data.repository.payload) {\n const msg =\n 'GitHub GraphQL datasource: failed to obtain repository payload data';\n const err = new Error(msg);\n return [null, err];\n }\n\n this.queryCount += 1;\n\n // For values other than explicit `false`,\n // we assume that items can not be cached.\n this.isPersistent ??= data.repository.isRepoPrivate === false;\n\n const res = data.repository.payload;\n return [res, null];\n }\n\n private shrinkPageSize(): boolean {\n if (this.itemsPerQuery === 100) {\n this.itemsPerQuery = 50;\n return true;\n }\n\n if (this.itemsPerQuery === 50) {\n this.itemsPerQuery = 25;\n return true;\n }\n\n return false;\n }\n\n private hasReachedQueryLimit(): boolean {\n return this.queryCount >= 100;\n }\n\n private async doShrinkableQuery(): Promise<\n GithubGraphqlPayload<GraphqlItem>\n > {\n let res: GithubGraphqlPayload<GraphqlItem> | null = null;\n let err: Error | null = null;\n\n while (!res) {\n [res, err] = await this.doRawQuery();\n if (err) {\n if (!canBeSolvedByShrinking(err)) {\n throw err;\n }\n\n const shrinkResult = this.shrinkPageSize();\n if (!shrinkResult) {\n throw err;\n }\n const { body, ...options } = this.getRawQueryOptions();\n logger.debug(\n { options, newSize: this.itemsPerQuery },\n 'Shrinking GitHub GraphQL page size after error',\n );\n }\n }\n\n return res;\n }\n\n private _cacheStrategy: GithubGraphqlCacheStrategy<ResultItem> | undefined;\n\n private cacheStrategy(): GithubGraphqlCacheStrategy<ResultItem> {\n if (this._cacheStrategy) {\n return this._cacheStrategy;\n }\n const cacheNs = this.getCacheNs();\n const cacheKey = this.getCacheKey();\n const cachePrivatePackages = GlobalConfig.get(\n 'cachePrivatePackages',\n false,\n );\n this._cacheStrategy =\n cachePrivatePackages || this.isPersistent\n ? new GithubGraphqlPackageCacheStrategy<ResultItem>(cacheNs, cacheKey)\n : new GithubGraphqlMemoryCacheStrategy<ResultItem>(cacheNs, cacheKey);\n return this._cacheStrategy;\n }\n\n /**\n * This method is responsible for data synchronization.\n * It also detects persistence of the package, based on the first page result.\n */\n private async doPaginatedFetch(): Promise<void> {\n let hasNextPage = true;\n let isPaginationDone = false;\n let nextCursor: string | undefined;\n while (hasNextPage && !isPaginationDone && !this.hasReachedQueryLimit()) {\n const queryResult = await this.doShrinkableQuery();\n\n const resultItems: ResultItem[] = [];\n for (const node of queryResult.nodes) {\n const item = this.datasourceAdapter.transform(node);\n if (!item) {\n logger.once.info(\n {\n packageName: `${this.repoOwner}/${this.repoName}`,\n baseUrl: this.baseUrl,\n },\n `GitHub GraphQL datasource: skipping empty item`,\n );\n continue;\n }\n resultItems.push(item);\n }\n\n // It's important to call `getCacheStrategy()` after `doShrinkableQuery()`\n // because `doShrinkableQuery()` may change `this.isCacheable`.\n //\n // Otherwise, cache items for public packages will never be persisted\n // in long-term cache.\n isPaginationDone = await this.cacheStrategy().reconcile(resultItems);\n\n hasNextPage = !!queryResult?.pageInfo?.hasNextPage;\n nextCursor = queryResult?.pageInfo?.endCursor;\n if (hasNextPage && nextCursor) {\n this.cursor = nextCursor;\n }\n }\n\n if (this.isPersistent) {\n await this.storePersistenceFlag(30);\n }\n }\n\n private async doCachedQuery(): Promise<ResultItem[]> {\n await this.loadPersistenceFlag();\n if (!this.isPersistent) {\n await this.doPaginatedFetch();\n }\n\n const res = await this.cacheStrategy().finalizeAndReturn();\n if (res.length) {\n return res;\n }\n\n delete this.isPersistent;\n await this.doPaginatedFetch();\n return this.cacheStrategy().finalizeAndReturn();\n }\n\n async loadPersistenceFlag(): Promise<void> {\n const ns = this.getCacheNs();\n const key = `${this.getCacheKey()}:is-persistent`;\n this.isPersistent = await packageCache.get<true>(ns, key);\n }\n\n async storePersistenceFlag(minutes: number): Promise<void> {\n const ns = this.getCacheNs();\n const key = `${this.getCacheKey()}:is-persistent`;\n await packageCache.set(ns, key, true, minutes);\n }\n\n /**\n * This method ensures the only one query is executed\n * to a particular package during single run.\n */\n private doUniqueQuery(): Promise<ResultItem[]> {\n const cacheKey = `github-pending:${this.getCacheNs()}:${this.getCacheKey()}`;\n const resultPromise =\n memCache.get<Promise<ResultItem[]>>(cacheKey) ?? this.doCachedQuery();\n memCache.set(cacheKey, resultPromise);\n return resultPromise;\n }\n\n async getItems(): Promise<ResultItem[]> {\n const res = await this.doUniqueQuery();\n return res;\n }\n}\n"]}
|
@@ -11,9 +11,9 @@ declare const GithubGraphqlRelease: z.ZodObject<{
|
|
11
11
|
name: z.ZodNullable<z.ZodString>;
|
12
12
|
description: z.ZodNullable<z.ZodString>;
|
13
13
|
}, "strip", z.ZodTypeAny, {
|
14
|
-
name: string | null;
|
15
14
|
id: number | null;
|
16
15
|
url: string;
|
16
|
+
name: string | null;
|
17
17
|
description: string | null;
|
18
18
|
version: string;
|
19
19
|
releaseTimestamp: string & {
|
@@ -22,9 +22,9 @@ declare const GithubGraphqlRelease: z.ZodObject<{
|
|
22
22
|
isDraft: boolean;
|
23
23
|
isPrerelease: boolean;
|
24
24
|
}, {
|
25
|
-
name: string | null;
|
26
25
|
id: number | null;
|
27
26
|
url: string;
|
27
|
+
name: string | null;
|
28
28
|
description: string | null;
|
29
29
|
version: string;
|
30
30
|
isDraft: boolean;
|
@@ -55,6 +55,7 @@ declare const GithubGraphqlTag: z.ZodObject<{
|
|
55
55
|
};
|
56
56
|
}>]>;
|
57
57
|
}, "strip", z.ZodTypeAny, {
|
58
|
+
version: string;
|
58
59
|
target: {
|
59
60
|
type: "Commit";
|
60
61
|
releaseTimestamp: string & {
|
@@ -72,8 +73,8 @@ declare const GithubGraphqlTag: z.ZodObject<{
|
|
72
73
|
};
|
73
74
|
};
|
74
75
|
};
|
75
|
-
version: string;
|
76
76
|
}, {
|
77
|
+
version: string;
|
77
78
|
target: {
|
78
79
|
type: "Commit";
|
79
80
|
oid: string;
|
@@ -87,7 +88,6 @@ declare const GithubGraphqlTag: z.ZodObject<{
|
|
87
88
|
releaseTimestamp?: unknown;
|
88
89
|
};
|
89
90
|
};
|
90
|
-
version: string;
|
91
91
|
}>;
|
92
92
|
export type GithubGraphqlTag = z.infer<typeof GithubGraphqlTag>;
|
93
93
|
export declare const adapter: GithubGraphqlDatasourceAdapter<GithubGraphqlTag, GithubTagItem>;
|
package/dist/util/http/auth.js
CHANGED
@@ -82,7 +82,6 @@ function removeAuthorization(options) {
|
|
82
82
|
// if there is no port in the redirect URL string, then delete it from the redirect options.
|
83
83
|
// This can be evaluated for removal after upgrading to Got v10
|
84
84
|
const portInUrl = options.href?.split?.('/')?.[2]?.split(':')?.[1];
|
85
|
-
// istanbul ignore next
|
86
85
|
if (!portInUrl) {
|
87
86
|
delete options.port; // Redirect will instead use 80 or 443 for HTTP or HTTPS respectively
|
88
87
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../lib/util/http/auth.ts"],"names":[],"mappings":";;AAoBA,gDAiEC;AAgBD,
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../lib/util/http/auth.ts"],"names":[],"mappings":";;AAoBA,gDAiEC;AAgBD,kDAsBC;;AA3HD,kEAAkC;AAElC,+CAIyB;AAczB,SAAgB,kBAAkB,CAChC,SAAqB;IAErB,MAAM,OAAO,GAAe,EAAE,GAAG,SAAS,EAAE,CAAC;IAE7C,IAAI,YAAE,CAAC,cAAc,CAAC,OAAO,CAAC,OAAO,EAAE,aAAa,CAAC,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;QACxE,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,OAAO,CAAC,OAAO,KAAK,EAAE,CAAC;IACvB,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;QAClB,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC;QAC3C,IAAI,QAAQ,EAAE,CAAC;YACb,IAAI,QAAQ,KAAK,YAAY,EAAE,CAAC;gBAC9B,OAAO,CAAC,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,KAAK,CAAC;YAChD,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,OAAO,CAAC,aAAa,GAAG,GAAG,QAAQ,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;YACjE,CAAC;QACH,CAAC;aA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,CAAC;QAC9C,4FAA4F;QAC5F,+DAA+D;QAC/D,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACnE,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,qEAAqE;QAC5F,CAAC;QAED,oEAAoE;QACpE,6DAA6D;QAC7D,IAAI,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC;YACpC,OAAO,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC;QACvC,CAAC;QACD,OAAO,OAAO,CAAC,QAAQ,CAAC;QACxB,OAAO,OAAO,CAAC,QAAQ,CAAC;IAC1B,CAAC;AACH,CAAC","sourcesContent":["import is from '@sindresorhus/is';\nimport type { Options } from 'got';\nimport {\n GITEA_API_USING_HOST_TYPES,\n GITHUB_API_USING_HOST_TYPES,\n GITLAB_API_USING_HOST_TYPES,\n} from '../../constants';\nimport type { GotOptions } from './types';\n\nexport type AuthGotOptions = Pick<\n GotOptions,\n | 'hostType'\n | 'headers'\n | 'noAuth'\n | 'context'\n | 'token'\n | 'username'\n | 'password'\n>;\n\nexport function applyAuthorization<GotOptions extends AuthGotOptions>(\n inOptions: GotOptions,\n): GotOptions {\n const options: GotOptions = { ...inOptions };\n\n if (is.nonEmptyString(options.headers?.authorization) || options.noAuth) {\n return options;\n }\n\n options.headers ??= {};\n if (options.token) {\n const authType = options.context?.authType;\n if (authType) {\n if (authType === 'Token-Only') {\n options.headers.authorization = options.token;\n } else {\n options.headers.authorization = `${authType} ${options.token}`;\n }\n } else if (\n options.hostType &&\n GITEA_API_USING_HOST_TYPES.includes(options.hostType)\n ) {\n // Gitea v1.8.0 and later support `Bearer` as alternate to `token`\n // https://github.com/go-gitea/gitea/pull/5378\n options.headers.authorization = `Bearer ${options.token}`;\n } else if (\n options.hostType &&\n GITHUB_API_USING_HOST_TYPES.includes(options.hostType)\n ) {\n options.headers.authorization = `token ${options.token}`;\n if (options.token.startsWith('x-access-token:')) {\n const appToken = options.token.replace('x-access-token:', '');\n options.headers.authorization = `token ${appToken}`;\n if (is.string(options.headers.accept)) {\n options.headers.accept = options.headers.accept.replace(\n 'application/vnd.github.v3+json',\n 'application/vnd.github.machine-man-preview+json',\n );\n }\n }\n } else if (\n options.hostType &&\n GITLAB_API_USING_HOST_TYPES.includes(options.hostType)\n ) {\n // GitLab versions earlier than 12.2 only support authentication with\n // a personal access token, which is 20 characters long.\n if (options.token.length === 20) {\n options.headers['Private-token'] = options.token;\n } else {\n options.headers.authorization = `Bearer ${options.token}`;\n }\n } else {\n options.headers.authorization = `Bearer ${options.token}`;\n }\n delete options.token;\n } else if (options.password !== undefined) {\n // Otherwise got will add username and password to url and header\n const auth = Buffer.from(\n `${options.username ?? ''}:${options.password}`,\n ).toString('base64');\n options.headers.authorization = `Basic ${auth}`;\n delete options.username;\n delete options.password;\n }\n return options;\n}\n\n// isAmazon return true if request options contains Amazon related headers\nfunction isAmazon(options: Options): boolean {\n return !!options.search?.includes('X-Amz-Algorithm');\n}\n\n// isAzureBlob return true if request options contains Azure container registry related data\nfunction isAzureBlob(options: Options): boolean {\n return !!(\n options.hostname?.endsWith('.blob.core.windows.net') && // lgtm [js/incomplete-url-substring-sanitization]\n options.href?.includes('/docker/registry')\n );\n}\n\n// removeAuthorization from the redirect options\nexport function removeAuthorization(options: Options): void {\n if (!options.password && !options.headers?.authorization) {\n return;\n }\n\n // Check if request has been redirected to Amazon or an Azure blob (ACR)\n if (isAmazon(options) || isAzureBlob(options)) {\n // if there is no port in the redirect URL string, then delete it from the redirect options.\n // This can be evaluated for removal after upgrading to Got v10\n const portInUrl = options.href?.split?.('/')?.[2]?.split(':')?.[1];\n if (!portInUrl) {\n delete options.port; // Redirect will instead use 80 or 443 for HTTP or HTTPS respectively\n }\n\n // registry is hosted on Amazon or Azure blob, redirect url includes\n // authentication which is not required and should be removed\n if (options?.headers?.authorization) {\n delete options.headers.authorization;\n }\n delete options.username;\n delete options.password;\n }\n}\n"]}
|
@@ -1,11 +1,13 @@
|
|
1
|
-
import
|
2
|
-
import {
|
1
|
+
import { HttpBase, type InternalJsonUnsafeOptions } from './http';
|
2
|
+
import type { HttpMethod, HttpOptions, HttpResponse } from './types';
|
3
3
|
export declare const setBaseUrl: (url: string) => void;
|
4
4
|
export interface BitbucketServerHttpOptions extends HttpOptions {
|
5
5
|
paginate?: boolean;
|
6
6
|
limit?: number;
|
7
|
+
maxPages?: number;
|
7
8
|
}
|
8
|
-
export declare class BitbucketServerHttp extends
|
9
|
-
|
10
|
-
|
9
|
+
export declare class BitbucketServerHttp extends HttpBase<BitbucketServerHttpOptions> {
|
10
|
+
protected get baseUrl(): string | undefined;
|
11
|
+
constructor(type?: string, options?: BitbucketServerHttpOptions);
|
12
|
+
protected requestJsonUnsafe<T>(method: HttpMethod, options: InternalJsonUnsafeOptions<BitbucketServerHttpOptions>): Promise<HttpResponse<T>>;
|
11
13
|
}
|
@@ -3,41 +3,44 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BitbucketServerHttp = exports.setBaseUrl = void 0;
|
4
4
|
const tslib_1 = require("tslib");
|
5
5
|
const is_1 = tslib_1.__importDefault(require("@sindresorhus/is"));
|
6
|
-
const
|
7
|
-
const url_1 = require("../url");
|
8
|
-
const _1 = require(".");
|
6
|
+
const http_1 = require("./http");
|
9
7
|
const MAX_LIMIT = 100;
|
8
|
+
const MAX_PAGES = 100;
|
10
9
|
let baseUrl;
|
11
10
|
const setBaseUrl = (url) => {
|
12
11
|
baseUrl = url;
|
13
12
|
};
|
14
13
|
exports.setBaseUrl = setBaseUrl;
|
15
|
-
class BitbucketServerHttp extends
|
16
|
-
|
17
|
-
|
14
|
+
class BitbucketServerHttp extends http_1.HttpBase {
|
15
|
+
get baseUrl() {
|
16
|
+
return baseUrl;
|
18
17
|
}
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
};
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
const limit = opts.limit ?? MAX_LIMIT;
|
18
|
+
constructor(type = 'bitbucket-server', options) {
|
19
|
+
super(type, options);
|
20
|
+
}
|
21
|
+
async requestJsonUnsafe(method, options) {
|
22
|
+
const resolvedUrl = this.resolveUrl(options.url, options.httpOptions);
|
23
|
+
const opts = { ...options, url: resolvedUrl };
|
24
|
+
opts.httpOptions ??= {};
|
25
|
+
opts.httpOptions.headers ??= {};
|
26
|
+
opts.httpOptions.headers['X-Atlassian-Token'] = 'no-check';
|
27
|
+
const paginate = opts.httpOptions.paginate;
|
28
|
+
if (paginate) {
|
29
|
+
const limit = opts.httpOptions.limit ?? MAX_LIMIT;
|
32
30
|
resolvedUrl.searchParams.set('limit', limit.toString());
|
33
31
|
}
|
34
|
-
const result = await super.
|
35
|
-
if (
|
32
|
+
const result = await super.requestJsonUnsafe(method, opts);
|
33
|
+
if (paginate && isPagedResult(result.body)) {
|
34
|
+
if (opts.httpOptions) {
|
35
|
+
delete opts.httpOptions.cacheProvider;
|
36
|
+
opts.httpOptions.memCache = false;
|
37
|
+
}
|
36
38
|
const collectedValues = [...result.body.values];
|
37
39
|
let nextPageStart = result.body.nextPageStart;
|
38
|
-
|
40
|
+
let maxPages = opts.httpOptions.maxPages ?? MAX_PAGES;
|
41
|
+
while (nextPageStart && --maxPages > 0) {
|
39
42
|
resolvedUrl.searchParams.set('start', nextPageStart.toString());
|
40
|
-
const nextResult = await super.
|
43
|
+
const nextResult = await super.requestJsonUnsafe(method, opts);
|
41
44
|
collectedValues.push(...nextResult.body.values);
|
42
45
|
nextPageStart = nextResult.body.nextPageStart;
|
43
46
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"bitbucket-server.js","sourceRoot":"","sources":["../../../lib/util/http/bitbucket-server.ts"],"names":[],"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is from '@sindresorhus/is';\nimport { HttpBase, type InternalJsonUnsafeOptions } from './http';\nimport type { HttpMethod, HttpOptions, HttpResponse } from './types';\n\nconst MAX_LIMIT = 100;\nconst MAX_PAGES = 100;\n\nlet baseUrl: string;\nexport const setBaseUrl = (url: string): void => {\n baseUrl = url;\n};\n\nexport interface BitbucketServerHttpOptions extends HttpOptions {\n paginate?: boolean;\n limit?: number;\n maxPages?: number;\n}\n\ninterface PagedResult<T = unknown> {\n nextPageStart?: number;\n values: T[];\n}\n\nexport class BitbucketServerHttp extends HttpBase<BitbucketServerHttpOptions> {\n protected override get baseUrl(): string | undefined {\n return baseUrl;\n }\n\n constructor(type = 'bitbucket-server', options?: BitbucketServerHttpOptions) {\n super(type, options);\n }\n\n protected override async requestJsonUnsafe<T>(\n method: HttpMethod,\n options: InternalJsonUnsafeOptions<BitbucketServerHttpOptions>,\n ): Promise<HttpResponse<T>> {\n const resolvedUrl = this.resolveUrl(options.url, options.httpOptions);\n const opts = { ...options, url: resolvedUrl };\n opts.httpOptions ??= {};\n opts.httpOptions.headers ??= {};\n opts.httpOptions.headers['X-Atlassian-Token'] = 'no-check';\n\n const paginate = opts.httpOptions.paginate;\n if (paginate) {\n const limit = opts.httpOptions.limit ?? MAX_LIMIT;\n resolvedUrl.searchParams.set('limit', limit.toString());\n }\n\n const result = await super.requestJsonUnsafe<T | PagedResult<T>>(\n method,\n opts,\n );\n\n if (paginate && isPagedResult(result.body)) {\n if (opts.httpOptions) {\n delete opts.httpOptions.cacheProvider;\n opts.httpOptions.memCache = false;\n }\n\n const collectedValues = [...result.body.values];\n let nextPageStart = result.body.nextPageStart;\n\n let maxPages = opts.httpOptions.maxPages ?? MAX_PAGES;\n while (nextPageStart && --maxPages > 0) {\n resolvedUrl.searchParams.set('start', nextPageStart.toString());\n\n const nextResult = await super.requestJsonUnsafe<PagedResult<T>>(\n method,\n opts,\n );\n collectedValues.push(...nextResult.body.values);\n nextPageStart = nextResult.body.nextPageStart;\n }\n\n return { ...result, body: collectedValues as T };\n }\n\n return result as HttpResponse<T>;\n }\n}\n\nfunction isPagedResult(obj: unknown): obj is PagedResult {\n return is.nonEmptyObject(obj) && is.array(obj.values);\n}\n"]}
|
@@ -1,11 +1,12 @@
|
|
1
|
-
import
|
2
|
-
import {
|
3
|
-
export declare
|
1
|
+
import { HttpBase, type InternalJsonUnsafeOptions } from './http';
|
2
|
+
import type { HttpMethod, HttpOptions, HttpResponse } from './types';
|
3
|
+
export declare function setBaseUrl(url: string): void;
|
4
4
|
export interface BitbucketHttpOptions extends HttpOptions {
|
5
5
|
paginate?: boolean;
|
6
6
|
pagelen?: number;
|
7
7
|
}
|
8
|
-
export declare class BitbucketHttp extends
|
8
|
+
export declare class BitbucketHttp extends HttpBase<BitbucketHttpOptions> {
|
9
|
+
protected get baseUrl(): string | undefined;
|
9
10
|
constructor(type?: string, options?: BitbucketHttpOptions);
|
10
|
-
protected
|
11
|
+
protected requestJsonUnsafe<T>(method: HttpMethod, options: InternalJsonUnsafeOptions<BitbucketHttpOptions>): Promise<HttpResponse<T>>;
|
11
12
|
}
|
@@ -1,53 +1,56 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.BitbucketHttp =
|
3
|
+
exports.BitbucketHttp = void 0;
|
4
|
+
exports.setBaseUrl = setBaseUrl;
|
4
5
|
const tslib_1 = require("tslib");
|
5
6
|
const is_1 = tslib_1.__importDefault(require("@sindresorhus/is"));
|
6
|
-
const
|
7
|
-
const url_1 = require("../url");
|
8
|
-
const _1 = require(".");
|
7
|
+
const http_1 = require("./http");
|
9
8
|
const MAX_PAGES = 100;
|
10
9
|
const MAX_PAGELEN = 100;
|
11
10
|
let baseUrl = 'https://api.bitbucket.org/';
|
12
|
-
|
11
|
+
function setBaseUrl(url) {
|
13
12
|
baseUrl = url;
|
14
|
-
}
|
15
|
-
|
16
|
-
|
13
|
+
}
|
14
|
+
class BitbucketHttp extends http_1.HttpBase {
|
15
|
+
get baseUrl() {
|
16
|
+
return baseUrl;
|
17
|
+
}
|
17
18
|
constructor(type = 'bitbucket', options) {
|
18
19
|
super(type, options);
|
19
20
|
}
|
20
|
-
async
|
21
|
-
const
|
22
|
-
const
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
resolvedURL.searchParams.set('pagelen', pagelen.toString());
|
21
|
+
async requestJsonUnsafe(method, options) {
|
22
|
+
const resolvedUrl = this.resolveUrl(options.url, options.httpOptions);
|
23
|
+
const opts = {
|
24
|
+
...options,
|
25
|
+
url: resolvedUrl,
|
26
|
+
};
|
27
|
+
const paginate = opts.httpOptions?.paginate;
|
28
|
+
if (paginate && !hasPagelen(resolvedUrl)) {
|
29
|
+
const pagelen = opts.httpOptions.pagelen ?? MAX_PAGELEN;
|
30
|
+
resolvedUrl.searchParams.set('pagelen', pagelen.toString());
|
31
31
|
}
|
32
|
-
const result = await super.
|
33
|
-
if (
|
32
|
+
const result = await super.requestJsonUnsafe(method, opts);
|
33
|
+
if (paginate && isPagedResult(result.body)) {
|
34
|
+
if (opts.httpOptions) {
|
35
|
+
delete opts.httpOptions.cacheProvider;
|
36
|
+
opts.httpOptions.memCache = false;
|
37
|
+
}
|
34
38
|
const resultBody = result.body;
|
39
|
+
let nextURL = result.body.next;
|
35
40
|
let page = 1;
|
36
|
-
|
37
|
-
|
38
|
-
const nextResult = await super.
|
41
|
+
for (; nextURL && page <= MAX_PAGES; page++) {
|
42
|
+
opts.url = nextURL;
|
43
|
+
const nextResult = await super.requestJsonUnsafe(method, opts);
|
39
44
|
resultBody.values.push(...nextResult.body.values);
|
40
|
-
nextURL = nextResult.body
|
41
|
-
page += 1;
|
45
|
+
nextURL = nextResult.body.next;
|
42
46
|
}
|
43
47
|
// Override other page-related attributes
|
44
48
|
resultBody.pagelen = resultBody.values.length;
|
49
|
+
/* v8 ignore start -- hard to test all branches */
|
45
50
|
resultBody.size =
|
46
|
-
page <= MAX_PAGES
|
47
|
-
|
48
|
-
|
49
|
-
resultBody.next =
|
50
|
-
page <= MAX_PAGES ? nextURL : /* istanbul ignore next */ undefined;
|
51
|
+
page <= MAX_PAGES ? resultBody.values.length : undefined;
|
52
|
+
resultBody.next = page <= MAX_PAGES ? nextURL : undefined;
|
53
|
+
/* v8 ignore stop */
|
51
54
|
}
|
52
55
|
return result;
|
53
56
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"bitbucket.js","sourceRoot":"","sources":["../../../lib/util/http/bitbucket.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"bitbucket.js","sourceRoot":"","sources":["../../../lib/util/http/bitbucket.ts"],"names":[],"mappings":";;;AAUA,gCAEC;;AAZD,kEAAkC;AAElC,iCAAkE;AAGlE,MAAM,SAAS,GAAG,GAAG,CAAC;AACtB,MAAM,WAAW,GAAG,GAAG,CAAC;AAExB,IAAI,OAAO,GAAG,4BAA4B,CAAC;AAE3C,SAAgB,UAAU,CAAC,GAAW;IACpC,OAAO,GAAG,GAAG,CAAC;AAChB,CAAC;AAOD,MAAa,aAAc,SAAQ,eAA8B;IAC/D,IAAuB,OAAO;QAC5B,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,YAAY,IAAI,GAAG,WAAW,EAAE,OAA8B;QAC5D,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACvB,CAAC;IAEkB,KAAK,CAAC,iBAAiB,CACxC,MAAkB,EAClB,OAAwD;QAExD,MAAM,WAAW,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;QACtE,MAAM,IAAI,GAAoD;YAC5D,GAAG,OAAO;YACV,GAAG,EAAE,WAAW;SACjB,CAAC;QACF,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC;QAE5C,IAAI,QAAQ,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;YACzC,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CAAC,IAAI,GAAG,IAAI,IAAI,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;YAC1D,oBAAoB;QACtB,CAAC;QAED,OAAO,MAAyB,CAAC;IACnC,CAAC;CACF;AA7DD,sCA6DC;AAED,SAAS,UAAU,CAAC,GAAQ;IAC1B,OAAO,CAAC,YAAE,CAAC,eAAe,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC;AAC9D,CAAC;AAED,SAAS,aAAa,CAAI,GAAQ;IAChC,OAAO,YAAE,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAC7D,CAAC","sourcesContent":["import is from '@sindresorhus/is';\nimport type { PagedResult } from '../../modules/platform/bitbucket/types';\nimport { HttpBase, type InternalJsonUnsafeOptions } from './http';\nimport type { HttpMethod, HttpOptions, HttpResponse } from './types';\n\nconst MAX_PAGES = 100;\nconst MAX_PAGELEN = 100;\n\nlet baseUrl = 'https://api.bitbucket.org/';\n\nexport function setBaseUrl(url: string): void {\n baseUrl = url;\n}\n\nexport interface BitbucketHttpOptions extends HttpOptions {\n paginate?: boolean;\n pagelen?: number;\n}\n\nexport class BitbucketHttp extends HttpBase<BitbucketHttpOptions> {\n protected override get baseUrl(): string | undefined {\n return baseUrl;\n }\n\n constructor(type = 'bitbucket', options?: BitbucketHttpOptions) {\n super(type, options);\n }\n\n protected override async requestJsonUnsafe<T>(\n method: HttpMethod,\n options: InternalJsonUnsafeOptions<BitbucketHttpOptions>,\n ): Promise<HttpResponse<T>> {\n const resolvedUrl = this.resolveUrl(options.url, options.httpOptions);\n const opts: InternalJsonUnsafeOptions<BitbucketHttpOptions> = {\n ...options,\n url: resolvedUrl,\n };\n const paginate = opts.httpOptions?.paginate;\n\n if (paginate && !hasPagelen(resolvedUrl)) {\n const pagelen = opts.httpOptions!.pagelen ?? MAX_PAGELEN;\n resolvedUrl.searchParams.set('pagelen', pagelen.toString());\n }\n\n const result = await super.requestJsonUnsafe<T | PagedResult<T>>(\n method,\n opts,\n );\n\n if (paginate && isPagedResult(result.body)) {\n if (opts.httpOptions) {\n delete opts.httpOptions.cacheProvider;\n opts.httpOptions.memCache = false;\n }\n const resultBody = result.body;\n let nextURL = result.body.next;\n let page = 1;\n\n for (; nextURL && page <= MAX_PAGES; page++) {\n opts.url = nextURL;\n const nextResult = await super.requestJsonUnsafe<PagedResult<T>>(\n method,\n opts,\n );\n\n resultBody.values.push(...nextResult.body.values);\n nextURL = nextResult.body.next;\n }\n\n // Override other page-related attributes\n resultBody.pagelen = resultBody.values.length;\n /* v8 ignore start -- hard to test all branches */\n resultBody.size =\n page <= MAX_PAGES ? resultBody.values.length : undefined;\n resultBody.next = page <= MAX_PAGES ? nextURL : undefined;\n /* v8 ignore stop */\n }\n\n return result as HttpResponse<T>;\n }\n}\n\nfunction hasPagelen(url: URL): boolean {\n return !is.nullOrUndefined(url.searchParams.get('pagelen'));\n}\n\nfunction isPagedResult<T>(obj: any): obj is PagedResult<T> {\n return is.nonEmptyObject(obj) && Array.isArray(obj.values);\n}\n"]}
|
@@ -43,11 +43,11 @@ class AbstractHttpCacheProvider {
|
|
43
43
|
httpResponse,
|
44
44
|
timestamp,
|
45
45
|
});
|
46
|
-
|
46
|
+
/* v8 ignore start: should never happen */
|
47
47
|
if (!newHttpCache) {
|
48
48
|
logger_1.logger.debug(`http cache: failed to persist cache for ${url}`);
|
49
49
|
return resp;
|
50
|
-
}
|
50
|
+
} /* v8 ignore stop */
|
51
51
|
logger_1.logger.debug(`http cache: saving ${url} (etag=${etag}, lastModified=${lastModified})`);
|
52
52
|
await this.persist(url, newHttpCache);
|
53
53
|
return resp;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"abstract-http-cache-provider.js","sourceRoot":"","sources":["../../../../lib/util/http/cache/abstract-http-cache-provider.ts"],"names":[],"mappings":";;;AAAA,4CAAyC;AACzC,uCAA6C;AAE7C,kCAAuC;AACvC,qCAA2D;AAG3D,MAAsB,yBAAyB;IAI7C,KAAK,CAAC,GAAG,CAAC,GAAW;QACnB,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACnC,MAAM,SAAS,GAAG,wBAAe,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAC/C,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,OAAO,IAAI,CAAC;QACd,CAAC;QAED,OAAO,
|
1
|
+
{"version":3,"file":"abstract-http-cache-provider.js","sourceRoot":"","sources":["../../../../lib/util/http/cache/abstract-http-cache-provider.ts"],"names":[],"mappings":";;;AAAA,4CAAyC;AACzC,uCAA6C;AAE7C,kCAAuC;AACvC,qCAA2D;AAG3D,MAAsB,yBAAyB;IAI7C,KAAK,CAAC,GAAG,CAAC,GAAW;QACnB,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACnC,MAAM,SAAS,GAAG,wBAAe,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAC/C,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,OAAO,IAAI,CAAC;QACd,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,KAAK,CAAC,eAAe,CACnB,GAAW,EACX,IAAO;QAEP,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACtC,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,OAAO;QACT,CAAC;QAED,IAAI,CAAC,OAAO,KAAK,EAAE,CAAC;QAEpB,IAAI,SAAS,CAAC,IAAI,EAAE,CAAC;YACnB,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,GAAG,SAAS,CAAC,IAAI,CAAC;QACjD,CAAC;QAED,IAAI,SAAS,CAAC,YAAY,EAAE,CAAC;YAC3B,IAAI,CAAC,OAAO,CAAC,mBAAmB,CAAC,GAA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O,IAAI,CAAC;YACd,CAAC;YAED,MAAM,SAAS,GAAG,SAAS,CAAC,SAAS,CAAC;YACtC,eAAM,CAAC,KAAK,CACV,sCAAsC,GAAG,SAAS,SAAS,EAAE,CAC9D,CAAC;YACF,sBAAc,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;YAClC,MAAM,UAAU,GAAG,IAAA,mBAAY,EAC7B,SAAS,CAAC,YAA+B,EACzC,IAAI,CACL,CAAC;YACF,UAAU,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC;YAC9C,OAAO,UAAU,CAAC;QACpB,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AA/FD,8DA+FC","sourcesContent":["import { logger } from '../../../logger';\nimport { HttpCacheStats } from '../../stats';\nimport type { GotOptions, HttpResponse } from '../types';\nimport { copyResponse } from '../util';\nimport { type HttpCache, HttpCacheSchema } from './schema';\nimport type { HttpCacheProvider } from './types';\n\nexport abstract class AbstractHttpCacheProvider implements HttpCacheProvider {\n protected abstract load(url: string): Promise<unknown>;\n protected abstract persist(url: string, data: HttpCache): Promise<void>;\n\n async get(url: string): Promise<HttpCache | null> {\n const cache = await this.load(url);\n const httpCache = HttpCacheSchema.parse(cache);\n if (!httpCache) {\n return null;\n }\n\n return httpCache;\n }\n\n async setCacheHeaders<T extends Pick<GotOptions, 'headers'>>(\n url: string,\n opts: T,\n ): Promise<void> {\n const httpCache = await this.get(url);\n if (!httpCache) {\n return;\n }\n\n opts.headers ??= {};\n\n if (httpCache.etag) {\n opts.headers['If-None-Match'] = httpCache.etag;\n }\n\n if (httpCache.lastModified) {\n opts.headers['If-Modified-Since'] = httpCache.lastModified;\n }\n }\n\n bypassServer<T>(\n _url: string,\n _ignoreSoftTtl: boolean,\n ): Promise<HttpResponse<T> | null> {\n return Promise.resolve(null);\n }\n\n async wrapServerResponse<T>(\n url: string,\n resp: HttpResponse<T>,\n ): Promise<HttpResponse<T>> {\n if (resp.statusCode === 200) {\n const etag = resp.headers?.etag;\n const lastModified = resp.headers?.['last-modified'];\n\n HttpCacheStats.incRemoteMisses(url);\n\n const httpResponse = copyResponse(resp, true);\n const timestamp = new Date().toISOString();\n\n const newHttpCache = HttpCacheSchema.parse({\n etag,\n lastModified,\n httpResponse,\n timestamp,\n });\n\n /* v8 ignore start: should never happen */\n if (!newHttpCache) {\n logger.debug(`http cache: failed to persist cache for ${url}`);\n return resp;\n } /* v8 ignore stop */\n\n logger.debug(\n `http cache: saving ${url} (etag=${etag}, lastModified=${lastModified})`,\n );\n await this.persist(url, newHttpCache as HttpCache);\n return resp;\n }\n\n if (resp.statusCode === 304) {\n const httpCache = await this.get(url);\n if (!httpCache) {\n return resp;\n }\n\n const timestamp = httpCache.timestamp;\n logger.debug(\n `http cache: Using cached response: ${url} from ${timestamp}`,\n );\n HttpCacheStats.incRemoteHits(url);\n const cachedResp = copyResponse(\n httpCache.httpResponse as HttpResponse<T>,\n true,\n );\n cachedResp.authorization = resp.authorization;\n return cachedResp;\n }\n\n return resp;\n }\n}\n"]}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import type { HttpResponse } from '../types';
|
2
|
+
import { AbstractHttpCacheProvider } from './abstract-http-cache-provider';
|
3
|
+
import type { HttpCache } from './schema';
|
4
|
+
export declare class MemoryHttpCacheProvider extends AbstractHttpCacheProvider {
|
5
|
+
private cacheKey;
|
6
|
+
protected load(url: string): Promise<unknown>;
|
7
|
+
protected persist(url: string, data: HttpCache): Promise<void>;
|
8
|
+
bypassServer<T>(url: string): Promise<HttpResponse<T> | null>;
|
9
|
+
}
|
10
|
+
export declare const memCacheProvider: MemoryHttpCacheProvider;
|
@@ -0,0 +1,29 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.memCacheProvider = exports.MemoryHttpCacheProvider = void 0;
|
4
|
+
const tslib_1 = require("tslib");
|
5
|
+
const memCache = tslib_1.__importStar(require("../../cache/memory"));
|
6
|
+
const abstract_http_cache_provider_1 = require("./abstract-http-cache-provider");
|
7
|
+
class MemoryHttpCacheProvider extends abstract_http_cache_provider_1.AbstractHttpCacheProvider {
|
8
|
+
cacheKey(url) {
|
9
|
+
return `memory-cache-http-provider:${url}`;
|
10
|
+
}
|
11
|
+
load(url) {
|
12
|
+
const data = memCache.get(this.cacheKey(url));
|
13
|
+
return Promise.resolve(data);
|
14
|
+
}
|
15
|
+
persist(url, data) {
|
16
|
+
memCache.set(this.cacheKey(url), data);
|
17
|
+
return Promise.resolve();
|
18
|
+
}
|
19
|
+
async bypassServer(url) {
|
20
|
+
const cached = await this.get(url);
|
21
|
+
if (!cached) {
|
22
|
+
return null;
|
23
|
+
}
|
24
|
+
return cached.httpResponse;
|
25
|
+
}
|
26
|
+
}
|
27
|
+
exports.MemoryHttpCacheProvider = MemoryHttpCacheProvider;
|
28
|
+
exports.memCacheProvider = new MemoryHttpCacheProvider();
|
29
|
+
//# sourceMappingURL=memory-http-cache-provider.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"memory-http-cache-provider.js","sourceRoot":"","sources":["../../../../lib/util/http/cache/memory-http-cache-provider.ts"],"names":[],"mappings":";;;;AAAA,qEAA+C;AAE/C,iFAA2E;AAG3E,MAAa,uBAAwB,SAAQ,wDAAyB;IAC5D,QAAQ,CAAC,GAAW;QAC1B,OAAO,8BAA8B,GAAG,EAAE,CAAC;IAC7C,CAAC;IAEkB,IAAI,CAAC,GAAW;QACjC,MAAM,IAAI,GAAG,QAAQ,CAAC,GAAG,CAAY,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;QACzD,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;IAEkB,OAAO,CAAC,GAAW,EAAE,IAAe;QACrD,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC;QACvC,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAEQ,KAAK,CAAC,YAAY,CAAI,GAAW;QACxC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACnC,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,OAAO,IAAI,CAAC;QACd,CAAC;QAED,OAAO,MAAM,CAAC,YAA+B,CAAC;IAChD,CAAC;CACF;AAvBD,0DAuBC;AAEY,QAAA,gBAAgB,GAAG,IAAI,uBAAuB,EAAE,CAAC","sourcesContent":["import * as memCache from '../../cache/memory';\nimport type { HttpResponse } from '../types';\nimport { AbstractHttpCacheProvider } from './abstract-http-cache-provider';\nimport type { HttpCache } from './schema';\n\nexport class MemoryHttpCacheProvider extends AbstractHttpCacheProvider {\n private cacheKey(url: string): string {\n return `memory-cache-http-provider:${url}`;\n }\n\n protected override load(url: string): Promise<unknown> {\n const data = memCache.get<HttpCache>(this.cacheKey(url));\n return Promise.resolve(data);\n }\n\n protected override persist(url: string, data: HttpCache): Promise<void> {\n memCache.set(this.cacheKey(url), data);\n return Promise.resolve();\n }\n\n override async bypassServer<T>(url: string): Promise<HttpResponse<T> | null> {\n const cached = await this.get(url);\n if (!cached) {\n return null;\n }\n\n return cached.httpResponse as HttpResponse<T>;\n }\n}\n\nexport const memCacheProvider = new MemoryHttpCacheProvider();\n"]}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import type { PackageCacheNamespace } from '../../cache/package/types';
|
2
|
+
import type { HttpResponse } from '../types';
|
3
|
+
import { AbstractHttpCacheProvider } from './abstract-http-cache-provider';
|
4
|
+
import type { HttpCache } from './schema';
|
5
|
+
export interface PackageHttpCacheProviderOptions {
|
6
|
+
namespace: PackageCacheNamespace;
|
7
|
+
ttlMinutes?: number;
|
8
|
+
checkCacheControlHeader?: boolean;
|
9
|
+
checkAuthorizationHeader?: boolean;
|
10
|
+
}
|
11
|
+
export declare class PackageHttpCacheProvider extends AbstractHttpCacheProvider {
|
12
|
+
private namespace;
|
13
|
+
private softTtlMinutes;
|
14
|
+
private hardTtlMinutes;
|
15
|
+
checkCacheControlHeader: boolean;
|
16
|
+
checkAuthorizationHeader: boolean;
|
17
|
+
constructor({ namespace, ttlMinutes, checkCacheControlHeader, checkAuthorizationHeader, }: PackageHttpCacheProviderOptions);
|
18
|
+
load(url: string): Promise<unknown>;
|
19
|
+
persist(url: string, data: HttpCache): Promise<void>;
|
20
|
+
bypassServer<T>(url: string, ignoreSoftTtl?: boolean): Promise<HttpResponse<T> | null>;
|
21
|
+
cacheAllowed<T>(resp: HttpResponse<T>): boolean;
|
22
|
+
wrapServerResponse<T>(url: string, resp: HttpResponse<T>): Promise<HttpResponse<T>>;
|
23
|
+
}
|