renovate 40.0.0-next.3 → 40.0.0-next.30
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 +4 -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/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 +3 -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/data/monorepo.json +5 -1
- package/dist/data/source-urls.json +1 -0
- package/dist/instrumentation/index.js +17 -13
- 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 +2 -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 +11 -1
- package/dist/modules/datasource/azure-pipelines-tasks/index.js.map +1 -1
- package/dist/modules/datasource/azure-pipelines-tasks/schema.d.ts +16 -0
- package/dist/modules/datasource/azure-pipelines-tasks/schema.js +2 -0
- package/dist/modules/datasource/azure-pipelines-tasks/schema.js.map +1 -1
- package/dist/modules/datasource/bazel/index.js +0 -1
- package/dist/modules/datasource/bazel/index.js.map +1 -1
- 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 +83 -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 +1 -1
- 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.js +2 -2
- package/dist/modules/datasource/deb/index.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 +5 -5
- 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/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/node-version/index.js +1 -1
- package/dist/modules/datasource/node-version/index.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/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 +25 -25
- 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 +1 -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 +10 -10
- 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 +40 -40
- package/dist/modules/manager/bazel-module/parser/oci.d.ts +17 -17
- package/dist/modules/manager/bazel-module/rules.d.ts +40 -40
- package/dist/modules/manager/bun/artifacts.js +0 -1
- package/dist/modules/manager/bun/artifacts.js.map +1 -1
- 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 +114 -114
- 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 +26 -26
- 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/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 +28 -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/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 +94 -94
- 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.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 +2 -2
- 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/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 +10 -25
- package/dist/modules/manager/gradle/parser/handlers.js.map +1 -1
- package/dist/modules/manager/gradle/parser/registry-urls.js +11 -3
- package/dist/modules/manager/gradle/parser/registry-urls.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 +3 -1
- 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 +18 -18
- 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/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/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 +59 -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/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 +84 -0
- package/dist/modules/manager/pixi/artifacts.js.map +1 -0
- package/dist/modules/manager/pixi/extract.d.ts +2 -0
- package/dist/modules/manager/pixi/extract.js +53 -0
- package/dist/modules/manager/pixi/extract.js.map +1 -0
- package/dist/modules/manager/pixi/index.d.ts +11 -0
- package/dist/modules/manager/pixi/index.js +22 -0
- package/dist/modules/manager/pixi/index.js.map +1 -0
- package/dist/modules/manager/pixi/lockfile.d.ts +6 -0
- package/dist/modules/manager/pixi/lockfile.js +25 -0
- package/dist/modules/manager/pixi/lockfile.js.map +1 -0
- package/dist/modules/manager/pixi/schema.d.ts +14 -0
- package/dist/modules/manager/pixi/schema.js +14 -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 +12 -12
- package/dist/modules/manager/terraform/lockfile/hash.d.ts +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 +4 -4
- 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 +11 -11
- 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 +75 -0
- package/dist/modules/platform/bitbucket-server/schema.js +14 -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.js +13 -2
- package/dist/modules/platform/gerrit/client.js.map +1 -1
- package/dist/modules/platform/gerrit/utils.js +1 -1
- 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 +26 -7
- 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 +12 -12
- 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 +76 -76
- 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 +70 -43
- 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/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/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/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 +18 -12
- 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/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 +73 -46
- package/dist/util/git/index.js.map +1 -1
- package/dist/util/git/private-key.js +1 -1
- package/dist/util/git/private-key.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 +5 -4
- package/dist/util/http/bitbucket-server.js +21 -20
- 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/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 +5 -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/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 +15 -0
- package/dist/util/string.js +75 -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 +2 -6
- 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 +5 -0
- package/dist/workers/global/config/parse/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 +13 -4
- package/dist/workers/repository/process/lookup/index.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/validate.js +1 -0
- package/dist/workers/repository/reconfigure/validate.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/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/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/source.js +1 -0
- package/dist/workers/repository/update/pr/changelog/source.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 +1 -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 +69 -72
- package/renovate-schema.json +15 -1
- 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
@@ -13,39 +13,39 @@ export declare const ReleaseResultZodSchema: z.ZodObject<{
|
|
13
13
|
version: string;
|
14
14
|
releaseTimestamp: import("../../../util/timestamp").Timestamp | null;
|
15
15
|
digest?: string | undefined;
|
16
|
-
sourceUrl?: string | undefined;
|
17
16
|
changelogUrl?: string | undefined;
|
18
|
-
|
19
|
-
isStable?: boolean | undefined;
|
17
|
+
sourceUrl?: string | undefined;
|
20
18
|
sourceDirectory?: string | undefined;
|
19
|
+
isStable?: boolean | undefined;
|
20
|
+
isDeprecated?: boolean | undefined;
|
21
21
|
}, {
|
22
22
|
version: string;
|
23
23
|
digest?: string | undefined;
|
24
|
-
sourceUrl?: string | undefined;
|
25
24
|
changelogUrl?: string | undefined;
|
25
|
+
sourceUrl?: string | undefined;
|
26
26
|
releaseTimestamp?: unknown;
|
27
|
-
isDeprecated?: boolean | undefined;
|
28
|
-
isStable?: boolean | undefined;
|
29
27
|
sourceDirectory?: string | undefined;
|
28
|
+
isStable?: boolean | undefined;
|
29
|
+
isDeprecated?: boolean | undefined;
|
30
30
|
}>, {
|
31
31
|
newDigest: string | undefined;
|
32
32
|
digest: undefined;
|
33
33
|
version: string;
|
34
34
|
releaseTimestamp: import("../../../util/timestamp").Timestamp | null;
|
35
|
-
sourceUrl?: string | undefined;
|
36
35
|
changelogUrl?: string | undefined;
|
37
|
-
|
38
|
-
isStable?: boolean | undefined;
|
36
|
+
sourceUrl?: string | undefined;
|
39
37
|
sourceDirectory?: string | undefined;
|
38
|
+
isStable?: boolean | undefined;
|
39
|
+
isDeprecated?: boolean | undefined;
|
40
40
|
}, {
|
41
41
|
version: string;
|
42
42
|
digest?: string | undefined;
|
43
|
-
sourceUrl?: string | undefined;
|
44
43
|
changelogUrl?: string | undefined;
|
44
|
+
sourceUrl?: string | undefined;
|
45
45
|
releaseTimestamp?: unknown;
|
46
|
-
isDeprecated?: boolean | undefined;
|
47
|
-
isStable?: boolean | undefined;
|
48
46
|
sourceDirectory?: string | undefined;
|
47
|
+
isStable?: boolean | undefined;
|
48
|
+
isDeprecated?: boolean | undefined;
|
49
49
|
}>, "many">;
|
50
50
|
tags: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
51
51
|
sourceUrl: z.ZodOptional<z.ZodString>;
|
@@ -58,31 +58,31 @@ export declare const ReleaseResultZodSchema: z.ZodObject<{
|
|
58
58
|
digest: undefined;
|
59
59
|
version: string;
|
60
60
|
releaseTimestamp: import("../../../util/timestamp").Timestamp | null;
|
61
|
-
sourceUrl?: string | undefined;
|
62
61
|
changelogUrl?: string | undefined;
|
63
|
-
|
64
|
-
isStable?: boolean | undefined;
|
62
|
+
sourceUrl?: string | undefined;
|
65
63
|
sourceDirectory?: string | undefined;
|
64
|
+
isStable?: boolean | undefined;
|
65
|
+
isDeprecated?: boolean | undefined;
|
66
66
|
}[];
|
67
67
|
tags?: Record<string, string> | undefined;
|
68
|
-
sourceUrl?: string | undefined;
|
69
|
-
changelogUrl?: string | undefined;
|
70
68
|
homepage?: string | undefined;
|
69
|
+
changelogUrl?: string | undefined;
|
70
|
+
sourceUrl?: string | undefined;
|
71
71
|
sourceDirectory?: string | undefined;
|
72
72
|
}, {
|
73
73
|
releases: {
|
74
74
|
version: string;
|
75
75
|
digest?: string | undefined;
|
76
|
-
sourceUrl?: string | undefined;
|
77
76
|
changelogUrl?: string | undefined;
|
77
|
+
sourceUrl?: string | undefined;
|
78
78
|
releaseTimestamp?: unknown;
|
79
|
-
isDeprecated?: boolean | undefined;
|
80
|
-
isStable?: boolean | undefined;
|
81
79
|
sourceDirectory?: string | undefined;
|
80
|
+
isStable?: boolean | undefined;
|
81
|
+
isDeprecated?: boolean | undefined;
|
82
82
|
}[];
|
83
83
|
tags?: Record<string, string> | undefined;
|
84
|
-
sourceUrl?: string | undefined;
|
85
|
-
changelogUrl?: string | undefined;
|
86
84
|
homepage?: string | undefined;
|
85
|
+
changelogUrl?: string | undefined;
|
86
|
+
sourceUrl?: string | undefined;
|
87
87
|
sourceDirectory?: string | undefined;
|
88
88
|
}>;
|
@@ -25,6 +25,7 @@ function massageCustomDatasourceConfig(customDatasourceName, { customDatasources
|
|
25
25
|
const templated = template.compile(transformTemplate, templateInput);
|
26
26
|
transform.push(templated);
|
27
27
|
}
|
28
|
+
logger_1.logger.trace({ transform }, `Custom datasource compiled data.`);
|
28
29
|
return {
|
29
30
|
format: customDatasource.format ?? 'json',
|
30
31
|
defaultRegistryUrlTemplate: registryUrl,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../lib/modules/datasource/custom/utils.ts"],"names":[],"mappings":";;AAMA,
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../lib/modules/datasource/custom/utils.ts"],"names":[],"mappings":";;AAMA,sEA0CC;AAED,0CAgBC;;AAlED,kEAAkC;AAElC,4CAAyC;AACzC,yEAAmD;AAGnD,SAAgB,6BAA6B,CAC3C,oBAA4B,EAC5B,EACE,iBAAiB,EACjB,WAAW,EACX,YAAY,EACZ,WAAW,EAAE,kBAAkB,GACb;IAEpB,MAAM,gBAAgB,GAAG,iBAAiB,EAAE,CAAC,oBAAoB,CAAC,CAAC;IACnE,IAAI,YAAE,CAAC,eAAe,CAAC,gBAAgB,CAAC,EAAE,CAAC;QACzC,eAAM,CAAC,KAAK,CACV,8CAA8C,WAAW,qBAAqB,CAC/E,CAAC;QACF,OAAO,IAAI,CAAC;IACd,CAAC;IAC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CAAC;AAChF,CAAC","sourcesContent":["import is from '@sindresorhus/is';\nimport type { CustomDatasourceConfig } from '../../../config/types';\nimport { logger } from '../../../logger';\nimport * as template from '../../../util/template';\nimport type { GetReleasesConfig } from '../types';\n\nexport function massageCustomDatasourceConfig(\n customDatasourceName: string,\n {\n customDatasources,\n packageName,\n currentValue,\n registryUrl: defaultRegistryUrl,\n }: GetReleasesConfig,\n): Required<CustomDatasourceConfig> | null {\n const customDatasource = customDatasources?.[customDatasourceName];\n if (is.nullOrUndefined(customDatasource)) {\n logger.debug(\n `No custom datasource config provided while ${packageName} has been requested`,\n );\n return null;\n }\n const templateInput = { packageName, currentValue };\n\n const registryUrlTemplate =\n defaultRegistryUrl ?? customDatasource.defaultRegistryUrlTemplate;\n if (is.nullOrUndefined(registryUrlTemplate)) {\n logger.debug(\n 'No registry url provided by extraction nor datasource configuration',\n );\n return null;\n }\n const registryUrl = template.compile(registryUrlTemplate, templateInput);\n\n const transformTemplates = customDatasource.transformTemplates ?? [];\n const transform: string[] = [];\n for (const transformTemplate of transformTemplates) {\n const templated = template.compile(transformTemplate, templateInput);\n transform.push(templated);\n }\n\n logger.trace({ transform }, `Custom datasource compiled data.`);\n\n return {\n format: customDatasource.format ?? 'json',\n defaultRegistryUrlTemplate: registryUrl,\n transformTemplates: transform,\n };\n}\n\nexport function getCustomConfig(\n getReleasesConfig: GetReleasesConfig,\n): Required<CustomDatasourceConfig> | null {\n const customDatasourceName = getReleasesConfig.datasource?.replace(\n 'custom.',\n '',\n );\n\n if (!is.nonEmptyString(customDatasourceName)) {\n logger.debug(\n `No datasource has been supplied while looking up ${getReleasesConfig.packageName}`,\n );\n return null;\n }\n\n return massageCustomDatasourceConfig(customDatasourceName, getReleasesConfig);\n}\n"]}
|
@@ -16,7 +16,7 @@ class DartDatasource extends datasource_1.Datasource {
|
|
16
16
|
sourceUrlSupport = 'package';
|
17
17
|
sourceUrlNote = 'The source URL is determined from the `repository` field of the latest release object in the results.';
|
18
18
|
async getReleases({ packageName, registryUrl, }) {
|
19
|
-
|
19
|
+
/* v8 ignore next 3 -- should never happen */
|
20
20
|
if (!registryUrl) {
|
21
21
|
return null;
|
22
22
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../lib/modules/datasource/dart/index.ts"],"names":[],"mappings":";;;AACA,uDAAsD;AACtD,2CAAwD;AACxD,8CAA2C;AAI3C,MAAa,cAAe,SAAQ,uBAAU;IAC5C,MAAM,CAAU,EAAE,GAAG,MAAM,CAAC;IAE5B;QACE,KAAK,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC;IAC3B,CAAC;IAEiB,qBAAqB,GAAG,IAAI,CAAC;IAE7B,mBAAmB,GAAG,CAAC,2BAA2B,CAAC,CAAC;IAEpD,uBAAuB,GAAG,IAAI,CAAC;IAC/B,oBAAoB,GACpC,gFAAgF,CAAC;IACjE,gBAAgB,GAAG,SAAS,CAAC;IAC7B,aAAa,GAC7B,uGAAuG,CAAC;IAE1G,KAAK,CAAC,WAAW,CAAC,EAChB,WAAW,EACX,WAAW,GACO;QAClB,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../lib/modules/datasource/dart/index.ts"],"names":[],"mappings":";;;AACA,uDAAsD;AACtD,2CAAwD;AACxD,8CAA2C;AAI3C,MAAa,cAAe,SAAQ,uBAAU;IAC5C,MAAM,CAAU,EAAE,GAAG,MAAM,CAAC;IAE5B;QACE,KAAK,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC;IAC3B,CAAC;IAEiB,qBAAqB,GAAG,IAAI,CAAC;IAE7B,mBAAmB,GAAG,CAAC,2BAA2B,CAAC,CAAC;IAEpD,uBAAuB,GAAG,IAAI,CAAC;IAC/B,oBAAoB,GACpC,gFAAgF,CAAC;IACjE,gBAAgB,GAAG,SAAS,CAAC;IAC7B,aAAa,GAC7B,uGAAuG,CAAC;IAE1G,KAAK,CAAC,WAAW,CAAC,EAChB,WAAW,EACX,WAAW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C,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC;oBACxC,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;;AA/DH,wCAgEC","sourcesContent":["import type { HttpResponse } from '../../../util/http/types';\nimport { asTimestamp } from '../../../util/timestamp';\nimport { ensureTrailingSlash } from '../../../util/url';\nimport { Datasource } from '../datasource';\nimport type { GetReleasesConfig, ReleaseResult } from '../types';\nimport type { DartResult } from './types';\n\nexport class DartDatasource extends Datasource {\n static readonly id = 'dart';\n\n constructor() {\n super(DartDatasource.id);\n }\n\n override readonly customRegistrySupport = true;\n\n override readonly defaultRegistryUrls = ['https://pub.dartlang.org/'];\n\n override readonly releaseTimestampSupport = true;\n override readonly releaseTimestampNote =\n 'The release timestamp is determined from the `published` field in the results.';\n override readonly sourceUrlSupport = 'package';\n override readonly sourceUrlNote =\n 'The source URL is determined from the `repository` field of the latest release object in the results.';\n\n async getReleases({\n packageName,\n registryUrl,\n }: GetReleasesConfig): Promise<ReleaseResult | null> {\n /* v8 ignore next 3 -- should never happen */\n if (!registryUrl) {\n return null;\n }\n let result: ReleaseResult | null = null;\n const pkgUrl = `${ensureTrailingSlash(\n registryUrl,\n )}api/packages/${packageName}`;\n\n let raw: HttpResponse<DartResult> | null = null;\n try {\n raw = await this.http.getJsonUnchecked<DartResult>(pkgUrl);\n } catch (err) {\n this.handleGenericErrors(err);\n }\n\n const body = raw?.body;\n if (body) {\n const { versions, latest } = body;\n const releases = versions\n ?.filter(({ retracted }) => !retracted)\n ?.map(({ version, published }) => ({\n version,\n releaseTimestamp: asTimestamp(published),\n }));\n if (releases && latest) {\n result = { releases };\n\n const pubspec = latest.pubspec;\n if (pubspec) {\n if (pubspec.homepage) {\n result.homepage = pubspec.homepage;\n }\n\n if (pubspec.repository) {\n result.sourceUrl = pubspec.repository;\n }\n }\n }\n }\n return result;\n }\n}\n"]}
|
@@ -24,7 +24,7 @@ class DartVersionDatasource extends datasource_1.Datasource {
|
|
24
24
|
sourceUrlSupport = 'package';
|
25
25
|
sourceUrlNote = 'We use the URL: https://github.com/dart-lang/sdk.';
|
26
26
|
async getReleases({ registryUrl, }) {
|
27
|
-
|
27
|
+
/* v8 ignore next 3 -- should never happen */
|
28
28
|
if (!registryUrl) {
|
29
29
|
return null;
|
30
30
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../lib/modules/datasource/dart-version/index.ts"],"names":[],"mappings":";;;;AAAA,kEAAkC;AAClC,+CAA4C;AAC5C,8CAA2C;AAI9B,QAAA,kBAAkB,GAAG,IAAA,aAAK,EAAC,iBAAiB,CAAC,CAAC;AAC3D;;;;GAIG;AACU,QAAA,eAAe,GAAG,IAAA,aAAK,EAAC,OAAO,CAAC,CAAC;AAE9C,MAAa,qBAAsB,SAAQ,uBAAU;IACnD,MAAM,CAAU,EAAE,GAAG,cAAc,CAAC;IAEpC;QACE,KAAK,CAAC,qBAAqB,CAAC,EAAE,CAAC,CAAC;IAClC,CAAC;IAEiB,qBAAqB,GAAG,KAAK,CAAC;IAE9B,mBAAmB,GAAG,CAAC,gCAAgC,CAAC,CAAC;IAEzD,OAAO,GAAG,IAAI,CAAC;IAEhB,QAAQ,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IAEpC,gBAAgB,GAAG,SAAS,CAAC;IAC7B,aAAa,GAC7B,mDAAmD,CAAC;IAEtD,KAAK,CAAC,WAAW,CAAC,EAChB,WAAW,GACO;QAClB,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../lib/modules/datasource/dart-version/index.ts"],"names":[],"mappings":";;;;AAAA,kEAAkC;AAClC,+CAA4C;AAC5C,8CAA2C;AAI9B,QAAA,kBAAkB,GAAG,IAAA,aAAK,EAAC,iBAAiB,CAAC,CAAC;AAC3D;;;;GAIG;AACU,QAAA,eAAe,GAAG,IAAA,aAAK,EAAC,OAAO,CAAC,CA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C,CAAC,CAAC,IAAI,CAAC;IAChD,CAAC;IAEO,uBAAuB,CAC7B,OAAe,EACf,QAAkB;QAElB,OAAO,QAAQ;aACZ,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC;aAClD,MAAM,CAAC,YAAE,CAAC,MAAM,CAAC;aACjB,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE;YAClB,IACE,OAAO,KAAK,QAAQ;gBACpB,wBAAwB;gBACxB,uBAAe,CAAC,IAAI,CAAC,OAAO,CAAC;gBAC7B,4EAA4E;gBAC5E,iDAAiD;gBACjD,CAAC,OAAO,KAAK,QAAQ,IAAI,0BAAkB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,EAC1D,CAAC;gBACD,OAAO,KAAK,CAAC;YACf,CAAC;YACD,OAAO,IAAI,CAAC;QACd,CAAC,CAAC;aACD,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,KAAK,QAAQ,EAAE,CAAC,CAAC,CAAC;IACrE,CAAC;IAED,kEAAkE;IAC1D,oBAAoB,CAAC,MAAc;QACzC,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAChC,OAAO,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACjC,CAAC;;AA5EH,sDA6EC","sourcesContent":["import is from '@sindresorhus/is';\nimport { regEx } from '../../../util/regex';\nimport { Datasource } from '../datasource';\nimport type { GetReleasesConfig, Release, ReleaseResult } from '../types';\nimport type { DartResponse } from './types';\n\nexport const stableVersionRegex = regEx(/^\\d+\\.\\d+\\.\\d+$/);\n/**\n * The server returns old svn versions which would need mapping to a version.\n * They are very old, so we skip them instead.\n * https://github.com/dart-lang/site-www/blob/7d4409c87bb6570b2d8870b20283f81f2b7e08fc/tool/get-dart/dart_sdk_archive/lib/src/svn_versions.dart#L2\n */\nexport const svnVersionRegex = regEx(/^\\d+$/);\n\nexport class DartVersionDatasource extends Datasource {\n static readonly id = 'dart-version';\n\n constructor() {\n super(DartVersionDatasource.id);\n }\n\n override readonly customRegistrySupport = false;\n\n override readonly defaultRegistryUrls = ['https://storage.googleapis.com'];\n\n override readonly caching = true;\n\n private readonly channels = ['stable', 'beta', 'dev'];\n\n override readonly sourceUrlSupport = 'package';\n override readonly sourceUrlNote =\n 'We use the URL: https://github.com/dart-lang/sdk.';\n\n async getReleases({\n registryUrl,\n }: GetReleasesConfig): Promise<ReleaseResult | null> {\n /* v8 ignore next 3 -- should never happen */\n if (!registryUrl) {\n return null;\n }\n const result: ReleaseResult = {\n homepage: 'https://dart.dev/',\n sourceUrl: 'https://github.com/dart-lang/sdk',\n registryUrl,\n releases: [],\n };\n try {\n for (const channel of this.channels) {\n const resp = (\n await this.http.getJsonUnchecked<DartResponse>(\n `${registryUrl}/storage/v1/b/dart-archive/o?delimiter=%2F&prefix=channels%2F${channel}%2Frelease%2F&alt=json`,\n )\n ).body;\n const releases = this.getReleasesFromResponse(channel, resp.prefixes);\n result.releases.push(...releases);\n }\n } catch (err) {\n this.handleGenericErrors(err);\n }\n\n return result.releases.length ? result : null;\n }\n\n private getReleasesFromResponse(\n channel: string,\n prefixes: string[],\n ): Release[] {\n return prefixes\n .map((prefix) => this.getVersionFromPrefix(prefix))\n .filter(is.string)\n .filter((version) => {\n if (\n version === 'latest' ||\n // skip old svn versions\n svnVersionRegex.test(version) ||\n // The API response contains a stable version being released as a non-stable\n // release. So we filter out these releases here.\n (channel !== 'stable' && stableVersionRegex.test(version))\n ) {\n return false;\n }\n return true;\n })\n .map((version) => ({ version, isStable: channel === 'stable' }));\n }\n\n // Prefix should have a format of \"channels/stable/release/2.9.3/\"\n private getVersionFromPrefix(prefix: string): string | undefined {\n const parts = prefix.split('/');\n return parts[parts.length - 2];\n }\n}\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"datasource.js","sourceRoot":"","sources":["../../../lib/modules/datasource/datasource.ts"],"names":[],"mappings":";;;AAAA,gFAA2E;AAC3E,0CAAkD;AAalD,MAAsB,UAAU;IACQ;IAAtC,YAAsC,EAAU;QAAV,OAAE,GAAF,EAAE,CAAQ;QAC9C,IAAI,CAAC,IAAI,GAAG,IAAI,WAAI,CAAC,EAAE,CAAC,CAAC;IAC3B,CAAC;IAED,OAAO,CAAsB;IAE7B,qBAAqB,GAAG,IAAI,CAAC;IAE7B,aAAa,CAAsC;IAEnD,mBAAmB,CAA+B;IAElD,iBAAiB,CAAsB;IAEvC,gBAAgB,GAAiC,OAAO,CAAC;IAEzD,uBAAuB,GAAG,KAAK,CAAC;IAChC,oBAAoB,CAAsB;IAE1C,gBAAgB,GAAqB,MAAM,CAAC;IAC5C,aAAa,CAAsB;IAEzB,IAAI,CAAO;IAQrB,gBAAgB,CAAC,IAAe;QAC9B,sBAAsB;IACxB,CAAC;IAES,mBAAmB,CAAC,GAAU;QACtC,
|
1
|
+
{"version":3,"file":"datasource.js","sourceRoot":"","sources":["../../../lib/modules/datasource/datasource.ts"],"names":[],"mappings":";;;AAAA,gFAA2E;AAC3E,0CAAkD;AAalD,MAAsB,UAAU;IACQ;IAAtC,YAAsC,EAAU;QAAV,OAAE,GAAF,EAAE,CAAQ;QAC9C,IAAI,CAAC,IAAI,GAAG,IAAI,WAAI,CAAC,EAAE,CAAC,CAAC;IAC3B,CAAC;IAED,OAAO,CAAsB;IAE7B,qBAAqB,GAAG,IAAI,CAAC;IAE7B,aAAa,CAAsC;IAEnD,mBAAmB,CAA+B;IAElD,iBAAiB,CAAsB;IAEvC,gBAAgB,GAAiC,OAAO,CAAC;IAEzD,uBAAuB,GAAG,KAAK,CAAC;IAChC,oBAAoB,CAAsB;IAE1C,gBAAgB,GAAqB,MAAM,CAAC;IAC5C,aAAa,CAAsB;IAEzB,IAAI,CAAO;IAQrB,gBAAgB,CAAC,IAAe;QAC9B,sBAAsB;IACxB,CAAC;IAES,mBAAmB,CAAC,GAAU;QACtC,IAAI,GAAG,YAAY,uCAAiB,EAAE,CAAC;YACrC,MAAM,GAAG,CAAC;QACZ,CAAC;QAED,IAAI,GAAG,YAAY,gBAAS,EAAE,CAAC;YAC7B,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;YAE3B,MAAM,UAAU,GAAG,GAAG,CAAC,QAAQ,EAAE,UAAU,CAAC;YAC5C,IAAI,UAAU,EAAE,CAAC;gBACf,IAAI,UAAU,KAAK,GAAG,IAAI,CAAC,UAAU,IAAI,GAAG,IAAI,UAAU,GAAG,GAAG,CAAC,EAAE,CAAC;oBAClE,MAAM,IAAI,uCAAiB,CAAC,GAAG,CAAC,CAAC;gBACnC,CAAC;YACH,CAAC;QACH,CAAC;QAED,MAAM,GAAG,CAAC;IACZ,CAAC;IAED,2DAA2D;IAC3D,kBAAkB,CAChB,OAAiC,EACjC,OAAgB;QAEhB,OAAO,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAClC,CAAC;CACF;AA7DD,gCA6DC","sourcesContent":["import { ExternalHostError } from '../../types/errors/external-host-error';\nimport { Http, HttpError } from '../../util/http';\nimport type {\n DatasourceApi,\n DigestConfig,\n GetReleasesConfig,\n PostprocessReleaseConfig,\n PostprocessReleaseResult,\n RegistryStrategy,\n Release,\n ReleaseResult,\n SourceUrlSupport,\n} from './types';\n\nexport abstract class Datasource implements DatasourceApi {\n protected constructor(public readonly id: string) {\n this.http = new Http(id);\n }\n\n caching: boolean | undefined;\n\n customRegistrySupport = true;\n\n defaultConfig: Record<string, unknown> | undefined;\n\n defaultRegistryUrls?: string[] | (() => string[]);\n\n defaultVersioning?: string | undefined;\n\n registryStrategy: RegistryStrategy | undefined = 'first';\n\n releaseTimestampSupport = false;\n releaseTimestampNote?: string | undefined;\n\n sourceUrlSupport: SourceUrlSupport = 'none';\n sourceUrlNote?: string | undefined;\n\n protected http: Http;\n\n abstract getReleases(\n getReleasesConfig: GetReleasesConfig,\n ): Promise<ReleaseResult | null>;\n\n getDigest?(config: DigestConfig, newValue?: string): Promise<string | null>;\n\n handleHttpErrors(_err: HttpError): void {\n // intentionally empty\n }\n\n protected handleGenericErrors(err: Error): never {\n if (err instanceof ExternalHostError) {\n throw err;\n }\n\n if (err instanceof HttpError) {\n this.handleHttpErrors(err);\n\n const statusCode = err.response?.statusCode;\n if (statusCode) {\n if (statusCode === 429 || (statusCode >= 500 && statusCode < 600)) {\n throw new ExternalHostError(err);\n }\n }\n }\n\n throw err;\n }\n\n // istanbul ignore next: no-op implementation, never called\n postprocessRelease(\n _config: PostprocessReleaseConfig,\n release: Release,\n ): Promise<PostprocessReleaseResult> {\n return Promise.resolve(release);\n }\n}\n"]}
|
@@ -142,7 +142,7 @@ class DebDatasource extends datasource_1.Datasource {
|
|
142
142
|
*/
|
143
143
|
async fetchInReleaseFile(baseReleaseUrl) {
|
144
144
|
const inReleaseUrl = (0, url_1.joinUrlParts)(baseReleaseUrl, 'InRelease');
|
145
|
-
const response = await this.http.
|
145
|
+
const response = await this.http.getText(inReleaseUrl);
|
146
146
|
return response.body;
|
147
147
|
}
|
148
148
|
/**
|
@@ -225,7 +225,7 @@ class DebDatasource extends datasource_1.Datasource {
|
|
225
225
|
* @returns The release result if the package is found, otherwise null.
|
226
226
|
*/
|
227
227
|
async getReleases({ registryUrl, packageName, }) {
|
228
|
-
|
228
|
+
/* v8 ignore next 3 -- should never happen */
|
229
229
|
if (!registryUrl) {
|
230
230
|
return null;
|
231
231
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../lib/modules/datasource/deb/index.ts"],"names":[],"mappings":";;;;AAAA,gEAAgC;AAChC,mCAAgC;AAChC,0DAA0B;AAC1B,4CAAyC;AACzC,qEAA8D;AAC9D,6DAAuC;AACvC,6CAA8C;AAE9C,2CAAiD;AACjD,8CAA2C;AAE3C,yCAA8E;AAC9E,qCAAyE;AACzE,iCAAsD;AACtD,uCAA+E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;QAC3C,GAAG,EAAE,CAAC,YAAoB,EAAE,EAAE,CAAC,YAAY;KAC5C,CAAC;oDAOD;AAaK;IALL,IAAA,iBAAK,EAAC;QACL,SAAS,EAAE,cAAc,aAAa,CAAC,EAAE,EAAE;QAC3C,GAAG,EAAE,CAAC,EAAE,WAAW,EAAE,WAAW,EAAqB,EAAE,EAAE,CACvD,GAAG,WAAW,IAAI,WAAW,EAAE;KAClC,CAAC;gDAyCD","sourcesContent":["import readline from 'readline';\nimport { nanoid } from 'nanoid';\nimport upath from 'upath';\nimport { logger } from '../../../logger';\nimport { cache } from '../../../util/cache/package/decorator';\nimport * as fs from '../../../util/fs';\nimport { toSha256 } from '../../../util/hash';\nimport type { HttpOptions } from '../../../util/http/types';\nimport { joinUrlParts } from '../../../util/url';\nimport { Datasource } from '../datasource';\nimport type { GetReleasesConfig, ReleaseResult } from '../types';\nimport { computeFileChecksum, parseChecksumsFromInRelease } from './checksum';\nimport { cacheSubDir, packageKeys, requiredPackageKeys } from './common';\nimport { extract, getFileCreationTime } from './file';\nimport { formatReleaseResult, releaseMetaInformationMatches } from './release';\nimport type { PackageDescription } from './types';\nimport { constructComponentUrls, getBaseReleaseUrl } from './url';\n\nexport class DebDatasource extends Datasource {\n static readonly id = 'deb';\n\n constructor() {\n super(DebDatasource.id);\n }\n\n /**\n * Users are able to specify custom Debian repositories as long as they follow\n * the Debian package repository format as specified here\n * @see{https://wiki.debian.org/DebianRepository/Format}\n */\n override readonly customRegistrySupport = true;\n\n /**\n * Users can specify multiple upstream repositories and the datasource will aggregate the release\n * @example\n * When specifying multiple dependencies both internal and external dependencies from internal/external artifactory\n */\n override readonly registryStrategy = 'merge';\n\n /**\n * The original apt source list file format is\n * deb uri distribution [component1] [component2] [...]\n * @see{https://wiki.debian.org/DebianRepository/Format}\n *\n * However, for Renovate, we require the registry URLs to be\n * valid URLs which is why the parameters are encoded in the URL.\n *\n * The following query parameters are required:\n * - components: comma separated list of components\n * - suite: stable, oldstable or other alias for a release, either this or release must be given\n * - release: buster, etc.\n * - binaryArch: e.g. amd64 resolves to http://deb.debian.org/debian/dists/stable/non-free/binary-amd64/\n */\n override readonly defaultRegistryUrls = [\n 'https://deb.debian.org/debian?suite=stable&components=main,contrib,non-free&binaryArch=amd64',\n ];\n\n override readonly defaultVersioning = 'deb';\n\n /**\n * Downloads and extracts a package file from a component URL.\n *\n * @param componentUrl - The URL of the component.\n * @returns The path to the extracted file and the last modification timestamp.\n * @throws Will throw an error if no valid compression method is found.\n */\n private async downloadAndExtractPackage(\n componentUrl: string,\n ): Promise<{ extractedFile: string; lastTimestamp: Date }> {\n const packageUrlHash = toSha256(componentUrl);\n const fullCacheDir = await fs.ensureCacheDir(cacheSubDir);\n const extractedFile = upath.join(fullCacheDir, `${packageUrlHash}.txt`);\n let lastTimestamp = await getFileCreationTime(extractedFile);\n\n const compression = 'gz';\n const compressedFile = upath.join(\n fullCacheDir,\n `${nanoid()}_${packageUrlHash}.${compression}`,\n );\n\n const wasUpdated = await this.downloadPackageFile(\n componentUrl,\n compression,\n compressedFile,\n lastTimestamp,\n );\n\n if (wasUpdated || !lastTimestamp) {\n try {\n await extract(compressedFile, compression, extractedFile);\n lastTimestamp = await getFileCreationTime(extractedFile);\n } catch (error) {\n logger.warn(\n {\n compressedFile,\n componentUrl,\n compression,\n error: error.message,\n },\n 'Failed to extract package file from compressed file',\n );\n } finally {\n await fs.rmCache(compressedFile);\n }\n }\n\n if (!lastTimestamp) {\n //extracting went wrong\n throw new Error('Missing metadata in extracted package index file!');\n }\n\n return { extractedFile, lastTimestamp };\n }\n\n /**\n * Downloads a package file if it has been modified since the last download timestamp.\n *\n * @param basePackageUrl - The base URL of the package.\n * @param compression - The compression method used (e.g., 'gz').\n * @param compressedFile - The path where the compressed file will be saved.\n * @param lastDownloadTimestamp - The timestamp of the last download.\n * @returns True if the file was downloaded, otherwise false.\n */\n private async downloadPackageFile(\n basePackageUrl: string,\n compression: string,\n compressedFile: string,\n lastDownloadTimestamp?: Date,\n ): Promise<boolean> {\n const baseReleaseUrl = getBaseReleaseUrl(basePackageUrl);\n const packageUrl = joinUrlParts(basePackageUrl, `Packages.${compression}`);\n let needsToDownload = true;\n\n if (lastDownloadTimestamp) {\n needsToDownload = await this.checkIfModified(\n packageUrl,\n lastDownloadTimestamp,\n );\n }\n\n if (!needsToDownload) {\n logger.debug(`No need to download ${packageUrl}, file is up to date.`);\n return false;\n }\n const readStream = this.http.stream(packageUrl);\n const writeStream = fs.createCacheWriteStream(compressedFile);\n await fs.pipeline(readStream, writeStream);\n logger.debug(\n { url: packageUrl, targetFile: compressedFile },\n 'Downloading Debian package file',\n );\n\n let inReleaseContent = '';\n\n try {\n inReleaseContent = await this.fetchInReleaseFile(baseReleaseUrl);\n } catch (error) {\n // This is expected to fail for Artifactory if GPG verification is not enabled\n logger.debug(\n { url: baseReleaseUrl, err: error },\n 'Could not fetch InRelease file',\n );\n }\n\n if (inReleaseContent) {\n const actualChecksum = await computeFileChecksum(compressedFile);\n const expectedChecksum = parseChecksumsFromInRelease(\n inReleaseContent,\n // path to the Package.gz file\n packageUrl.replace(`${baseReleaseUrl}/`, ''),\n );\n if (actualChecksum !== expectedChecksum) {\n await fs.rmCache(compressedFile);\n throw new Error('SHA256 checksum validation failed');\n }\n }\n\n return needsToDownload;\n }\n\n /**\n * Fetches the content of the InRelease file from the given base release URL.\n *\n * @param baseReleaseUrl - The base URL of the release (e.g., 'https://deb.debian.org/debian/dists/bullseye').\n * @returns resolves to the content of the InRelease file.\n * @throws An error if the InRelease file could not be downloaded.\n */\n private async fetchInReleaseFile(baseReleaseUrl: string): Promise<string> {\n const inReleaseUrl = joinUrlParts(baseReleaseUrl, 'InRelease');\n const response = await this.http.get(inReleaseUrl);\n return response.body;\n }\n\n /**\n * Checks if a packageUrl content has been modified since the specified timestamp.\n *\n * @param packageUrl - The URL to check.\n * @param lastDownloadTimestamp - The timestamp of the last download.\n * @returns True if the content has been modified, otherwise false.\n * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Modified-Since\n */\n private async checkIfModified(\n packageUrl: string,\n lastDownloadTimestamp: Date,\n ): Promise<boolean> {\n const options: HttpOptions = {\n headers: {\n 'If-Modified-Since': lastDownloadTimestamp.toUTCString(),\n },\n };\n\n try {\n const response = await this.http.head(packageUrl, options);\n return response.statusCode !== 304;\n } catch (error) {\n logger.warn(\n { packageUrl, lastDownloadTimestamp, errorMessage: error.message },\n 'Could not determine if package file is modified since last download',\n );\n return true; // Assume it needs to be downloaded if check fails\n }\n }\n\n /**\n * Parses the extracted package index file.\n *\n * @param extractedFile - The path to the extracted package file.\n * @param lastTimestamp - The timestamp of the last modification.\n * @returns a list of packages with minimal Metadata.\n */\n @cache({\n namespace: `datasource-${DebDatasource.id}`,\n key: (extractedFile: string, lastTimestamp: Date) =>\n `${extractedFile}:${lastTimestamp.getTime()}`,\n ttlMinutes: 24 * 60,\n })\n async parseExtractedPackageIndex(\n extractedFile: string,\n lastTimestamp: Date,\n ): Promise<Record<string, PackageDescription[]>> {\n // read line by line to avoid high memory consumption as the extracted Packages\n // files can be multiple MBs in size\n const rl = readline.createInterface({\n input: fs.createCacheReadStream(extractedFile),\n terminal: false,\n });\n\n let currentPackage: PackageDescription = {};\n // A Package Index can contain multiple Versions of the package on private Artifactory (e.g. Jfrog)\n const allPackages: Record<string, PackageDescription[]> = {};\n\n for await (const line of rl) {\n if (line === '') {\n // All information of the package are available, add to the list of packages\n if (requiredPackageKeys.every((key) => key in currentPackage)) {\n if (!allPackages[currentPackage.Package!]) {\n allPackages[currentPackage.Package!] = [];\n }\n allPackages[currentPackage.Package!].push(currentPackage);\n currentPackage = {};\n }\n } else {\n for (const key of packageKeys) {\n if (line.startsWith(`${key}:`)) {\n currentPackage[key] = line.substring(key.length + 1).trim();\n break;\n }\n }\n }\n }\n\n // Check the last package after file reading is complete\n if (requiredPackageKeys.every((key) => key in currentPackage)) {\n if (!allPackages[currentPackage.Package!]) {\n allPackages[currentPackage.Package!] = [];\n }\n allPackages[currentPackage.Package!].push(currentPackage);\n }\n\n return allPackages;\n }\n\n @cache({\n namespace: `datasource-${DebDatasource.id}`,\n key: (componentUrl: string) => componentUrl,\n })\n async getPackageIndex(\n componentUrl: string,\n ): Promise<Record<string, PackageDescription[]>> {\n const { extractedFile, lastTimestamp } =\n await this.downloadAndExtractPackage(componentUrl);\n return await this.parseExtractedPackageIndex(extractedFile, lastTimestamp);\n }\n\n /**\n * Fetches the release information for a given package from the registry URL.\n *\n * @param config - Configuration for fetching releases.\n * @returns The release result if the package is found, otherwise null.\n */\n @cache({\n namespace: `datasource-${DebDatasource.id}`,\n key: ({ registryUrl, packageName }: GetReleasesConfig) =>\n `${registryUrl}:${packageName}`,\n })\n async getReleases({\n registryUrl,\n packageName,\n }: GetReleasesConfig): Promise<ReleaseResult | null> {\n // istanbul ignore if\n if (!registryUrl) {\n return null;\n }\n\n const componentUrls = constructComponentUrls(registryUrl);\n let aggregatedRelease: ReleaseResult | null = null;\n\n for (const componentUrl of componentUrls) {\n try {\n const packageIndex = await this.getPackageIndex(componentUrl);\n const parsedPackages = packageIndex[packageName];\n\n if (parsedPackages) {\n const newRelease = formatReleaseResult(parsedPackages);\n if (aggregatedRelease === null) {\n aggregatedRelease = newRelease;\n } else {\n if (!releaseMetaInformationMatches(aggregatedRelease, newRelease)) {\n logger.warn(\n { packageName },\n 'Package occurred in more than one repository with different meta information. Aggregating releases anyway.',\n );\n }\n aggregatedRelease.releases.push(...newRelease.releases);\n }\n }\n } catch (error) {\n logger.debug(\n { componentUrl, error },\n 'Skipping component due to an error',\n );\n }\n }\n\n return aggregatedRelease;\n }\n}\n"]}
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../lib/modules/datasource/deb/index.ts"],"names":[],"mappings":";;;;AAAA,gEAAgC;AAChC,mCAAgC;AAChC,0DAA0B;AAC1B,4CAAyC;AACzC,qEAA8D;AAC9D,6DAAuC;AACvC,6CAA8C;AAE9C,2CAAiD;AACjD,8CAA2C;AAE3C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K,EAAC;QACL,SAAS,EAAE,cAAc,aAAa,CAAC,EAAE,EAAE;QAC3C,GAAG,EAAE,CAAC,YAAoB,EAAE,EAAE,CAAC,YAAY;KAC5C,CAAC;oDAOD;AAaK;IALL,IAAA,iBAAK,EAAC;QACL,SAAS,EAAE,cAAc,aAAa,CAAC,EAAE,EAAE;QAC3C,GAAG,EAAE,CAAC,EAAE,WAAW,EAAE,WAAW,EAAqB,EAAE,EAAE,CACvD,GAAG,WAAW,IAAI,WAAW,EAAE;KAClC,CAAC;gDAyCD","sourcesContent":["import readline from 'readline';\nimport { nanoid } from 'nanoid';\nimport upath from 'upath';\nimport { logger } from '../../../logger';\nimport { cache } from '../../../util/cache/package/decorator';\nimport * as fs from '../../../util/fs';\nimport { toSha256 } from '../../../util/hash';\nimport type { HttpOptions } from '../../../util/http/types';\nimport { joinUrlParts } from '../../../util/url';\nimport { Datasource } from '../datasource';\nimport type { GetReleasesConfig, ReleaseResult } from '../types';\nimport { computeFileChecksum, parseChecksumsFromInRelease } from './checksum';\nimport { cacheSubDir, packageKeys, requiredPackageKeys } from './common';\nimport { extract, getFileCreationTime } from './file';\nimport { formatReleaseResult, releaseMetaInformationMatches } from './release';\nimport type { PackageDescription } from './types';\nimport { constructComponentUrls, getBaseReleaseUrl } from './url';\n\nexport class DebDatasource extends Datasource {\n static readonly id = 'deb';\n\n constructor() {\n super(DebDatasource.id);\n }\n\n /**\n * Users are able to specify custom Debian repositories as long as they follow\n * the Debian package repository format as specified here\n * @see{https://wiki.debian.org/DebianRepository/Format}\n */\n override readonly customRegistrySupport = true;\n\n /**\n * Users can specify multiple upstream repositories and the datasource will aggregate the release\n * @example\n * When specifying multiple dependencies both internal and external dependencies from internal/external artifactory\n */\n override readonly registryStrategy = 'merge';\n\n /**\n * The original apt source list file format is\n * deb uri distribution [component1] [component2] [...]\n * @see{https://wiki.debian.org/DebianRepository/Format}\n *\n * However, for Renovate, we require the registry URLs to be\n * valid URLs which is why the parameters are encoded in the URL.\n *\n * The following query parameters are required:\n * - components: comma separated list of components\n * - suite: stable, oldstable or other alias for a release, either this or release must be given\n * - release: buster, etc.\n * - binaryArch: e.g. amd64 resolves to http://deb.debian.org/debian/dists/stable/non-free/binary-amd64/\n */\n override readonly defaultRegistryUrls = [\n 'https://deb.debian.org/debian?suite=stable&components=main,contrib,non-free&binaryArch=amd64',\n ];\n\n override readonly defaultVersioning = 'deb';\n\n /**\n * Downloads and extracts a package file from a component URL.\n *\n * @param componentUrl - The URL of the component.\n * @returns The path to the extracted file and the last modification timestamp.\n * @throws Will throw an error if no valid compression method is found.\n */\n private async downloadAndExtractPackage(\n componentUrl: string,\n ): Promise<{ extractedFile: string; lastTimestamp: Date }> {\n const packageUrlHash = toSha256(componentUrl);\n const fullCacheDir = await fs.ensureCacheDir(cacheSubDir);\n const extractedFile = upath.join(fullCacheDir, `${packageUrlHash}.txt`);\n let lastTimestamp = await getFileCreationTime(extractedFile);\n\n const compression = 'gz';\n const compressedFile = upath.join(\n fullCacheDir,\n `${nanoid()}_${packageUrlHash}.${compression}`,\n );\n\n const wasUpdated = await this.downloadPackageFile(\n componentUrl,\n compression,\n compressedFile,\n lastTimestamp,\n );\n\n if (wasUpdated || !lastTimestamp) {\n try {\n await extract(compressedFile, compression, extractedFile);\n lastTimestamp = await getFileCreationTime(extractedFile);\n } catch (error) {\n logger.warn(\n {\n compressedFile,\n componentUrl,\n compression,\n error: error.message,\n },\n 'Failed to extract package file from compressed file',\n );\n } finally {\n await fs.rmCache(compressedFile);\n }\n }\n\n if (!lastTimestamp) {\n //extracting went wrong\n throw new Error('Missing metadata in extracted package index file!');\n }\n\n return { extractedFile, lastTimestamp };\n }\n\n /**\n * Downloads a package file if it has been modified since the last download timestamp.\n *\n * @param basePackageUrl - The base URL of the package.\n * @param compression - The compression method used (e.g., 'gz').\n * @param compressedFile - The path where the compressed file will be saved.\n * @param lastDownloadTimestamp - The timestamp of the last download.\n * @returns True if the file was downloaded, otherwise false.\n */\n private async downloadPackageFile(\n basePackageUrl: string,\n compression: string,\n compressedFile: string,\n lastDownloadTimestamp?: Date,\n ): Promise<boolean> {\n const baseReleaseUrl = getBaseReleaseUrl(basePackageUrl);\n const packageUrl = joinUrlParts(basePackageUrl, `Packages.${compression}`);\n let needsToDownload = true;\n\n if (lastDownloadTimestamp) {\n needsToDownload = await this.checkIfModified(\n packageUrl,\n lastDownloadTimestamp,\n );\n }\n\n if (!needsToDownload) {\n logger.debug(`No need to download ${packageUrl}, file is up to date.`);\n return false;\n }\n const readStream = this.http.stream(packageUrl);\n const writeStream = fs.createCacheWriteStream(compressedFile);\n await fs.pipeline(readStream, writeStream);\n logger.debug(\n { url: packageUrl, targetFile: compressedFile },\n 'Downloading Debian package file',\n );\n\n let inReleaseContent = '';\n\n try {\n inReleaseContent = await this.fetchInReleaseFile(baseReleaseUrl);\n } catch (error) {\n // This is expected to fail for Artifactory if GPG verification is not enabled\n logger.debug(\n { url: baseReleaseUrl, err: error },\n 'Could not fetch InRelease file',\n );\n }\n\n if (inReleaseContent) {\n const actualChecksum = await computeFileChecksum(compressedFile);\n const expectedChecksum = parseChecksumsFromInRelease(\n inReleaseContent,\n // path to the Package.gz file\n packageUrl.replace(`${baseReleaseUrl}/`, ''),\n );\n if (actualChecksum !== expectedChecksum) {\n await fs.rmCache(compressedFile);\n throw new Error('SHA256 checksum validation failed');\n }\n }\n\n return needsToDownload;\n }\n\n /**\n * Fetches the content of the InRelease file from the given base release URL.\n *\n * @param baseReleaseUrl - The base URL of the release (e.g., 'https://deb.debian.org/debian/dists/bullseye').\n * @returns resolves to the content of the InRelease file.\n * @throws An error if the InRelease file could not be downloaded.\n */\n private async fetchInReleaseFile(baseReleaseUrl: string): Promise<string> {\n const inReleaseUrl = joinUrlParts(baseReleaseUrl, 'InRelease');\n const response = await this.http.getText(inReleaseUrl);\n return response.body;\n }\n\n /**\n * Checks if a packageUrl content has been modified since the specified timestamp.\n *\n * @param packageUrl - The URL to check.\n * @param lastDownloadTimestamp - The timestamp of the last download.\n * @returns True if the content has been modified, otherwise false.\n * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Modified-Since\n */\n private async checkIfModified(\n packageUrl: string,\n lastDownloadTimestamp: Date,\n ): Promise<boolean> {\n const options: HttpOptions = {\n headers: {\n 'If-Modified-Since': lastDownloadTimestamp.toUTCString(),\n },\n };\n\n try {\n const response = await this.http.head(packageUrl, options);\n return response.statusCode !== 304;\n } catch (error) {\n logger.warn(\n { packageUrl, lastDownloadTimestamp, errorMessage: error.message },\n 'Could not determine if package file is modified since last download',\n );\n return true; // Assume it needs to be downloaded if check fails\n }\n }\n\n /**\n * Parses the extracted package index file.\n *\n * @param extractedFile - The path to the extracted package file.\n * @param lastTimestamp - The timestamp of the last modification.\n * @returns a list of packages with minimal Metadata.\n */\n @cache({\n namespace: `datasource-${DebDatasource.id}`,\n key: (extractedFile: string, lastTimestamp: Date) =>\n `${extractedFile}:${lastTimestamp.getTime()}`,\n ttlMinutes: 24 * 60,\n })\n async parseExtractedPackageIndex(\n extractedFile: string,\n lastTimestamp: Date,\n ): Promise<Record<string, PackageDescription[]>> {\n // read line by line to avoid high memory consumption as the extracted Packages\n // files can be multiple MBs in size\n const rl = readline.createInterface({\n input: fs.createCacheReadStream(extractedFile),\n terminal: false,\n });\n\n let currentPackage: PackageDescription = {};\n // A Package Index can contain multiple Versions of the package on private Artifactory (e.g. Jfrog)\n const allPackages: Record<string, PackageDescription[]> = {};\n\n for await (const line of rl) {\n if (line === '') {\n // All information of the package are available, add to the list of packages\n if (requiredPackageKeys.every((key) => key in currentPackage)) {\n if (!allPackages[currentPackage.Package!]) {\n allPackages[currentPackage.Package!] = [];\n }\n allPackages[currentPackage.Package!].push(currentPackage);\n currentPackage = {};\n }\n } else {\n for (const key of packageKeys) {\n if (line.startsWith(`${key}:`)) {\n currentPackage[key] = line.substring(key.length + 1).trim();\n break;\n }\n }\n }\n }\n\n // Check the last package after file reading is complete\n if (requiredPackageKeys.every((key) => key in currentPackage)) {\n if (!allPackages[currentPackage.Package!]) {\n allPackages[currentPackage.Package!] = [];\n }\n allPackages[currentPackage.Package!].push(currentPackage);\n }\n\n return allPackages;\n }\n\n @cache({\n namespace: `datasource-${DebDatasource.id}`,\n key: (componentUrl: string) => componentUrl,\n })\n async getPackageIndex(\n componentUrl: string,\n ): Promise<Record<string, PackageDescription[]>> {\n const { extractedFile, lastTimestamp } =\n await this.downloadAndExtractPackage(componentUrl);\n return await this.parseExtractedPackageIndex(extractedFile, lastTimestamp);\n }\n\n /**\n * Fetches the release information for a given package from the registry URL.\n *\n * @param config - Configuration for fetching releases.\n * @returns The release result if the package is found, otherwise null.\n */\n @cache({\n namespace: `datasource-${DebDatasource.id}`,\n key: ({ registryUrl, packageName }: GetReleasesConfig) =>\n `${registryUrl}:${packageName}`,\n })\n async getReleases({\n registryUrl,\n packageName,\n }: GetReleasesConfig): Promise<ReleaseResult | null> {\n /* v8 ignore next 3 -- should never happen */\n if (!registryUrl) {\n return null;\n }\n\n const componentUrls = constructComponentUrls(registryUrl);\n let aggregatedRelease: ReleaseResult | null = null;\n\n for (const componentUrl of componentUrls) {\n try {\n const packageIndex = await this.getPackageIndex(componentUrl);\n const parsedPackages = packageIndex[packageName];\n\n if (parsedPackages) {\n const newRelease = formatReleaseResult(parsedPackages);\n if (aggregatedRelease === null) {\n aggregatedRelease = newRelease;\n } else {\n if (!releaseMetaInformationMatches(aggregatedRelease, newRelease)) {\n logger.warn(\n { packageName },\n 'Package occurred in more than one repository with different meta information. Aggregating releases anyway.',\n );\n }\n aggregatedRelease.releases.push(...newRelease.releases);\n }\n }\n } catch (error) {\n logger.debug(\n { componentUrl, error },\n 'Skipping component due to an error',\n );\n }\n }\n\n return aggregatedRelease;\n }\n}\n"]}
|
@@ -47,7 +47,7 @@ class DenoDatasource extends datasource_1.Datasource {
|
|
47
47
|
// get details for the versions
|
48
48
|
const releases = await (0, p_map_1.default)(versions, async (version) => {
|
49
49
|
const cacheRelease = releasesCache[version];
|
50
|
-
|
50
|
+
/* v8 ignore next 3: hard to test */
|
51
51
|
if (cacheRelease) {
|
52
52
|
return cacheRelease;
|
53
53
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../lib/modules/datasource/deno/index.ts"],"names":[],"mappings":";;;;AAAA,kEAAkC;AAClC,0DAAyB;AACzB,4CAAyC;AACzC,kFAA4D;AAC5D,qEAA8D;AAC9D,+CAA4C;AAC5C,2CAAiD;AACjD,oFAA8D;AAC9D,8CAA2C;AAG3C,qCAA+E;AAE/E,MAAa,cAAe,SAAQ,uBAAU;IAC5C,MAAM,CAAU,EAAE,GAAG,MAAM,CAAC;IAEV,qBAAqB,GAAG,IAAI,CAAC;IAE7B,gBAAgB,GAAG,OAAO,CAAC;IAE3B,iBAAiB,GAAG,kBAAkB,CAAC,EAAE,CAAC;IAE1C,mBAAmB,GAAG,CAAC,0BAA0B,CAAC,CAAC;IAEnD,uBAAuB,GAAG,IAAI,CAAC;IAC/B,oBAAoB,GACpC,kFAAkF,CAAC;IACnE,gBAAgB,GAAG,SAAS,CAAC;IAC7B,aAAa,GAC7B,0EAA0E,CAAC;IAE7E;QACE,KAAK,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC;IAC3B,CAAC;IAQK,AAAN,KAAK,CAAC,WAAW,CAAC,EAChB,WAAW,EACX,WAAW,GACO;QAClB,MAAM,mBAAmB,GAAG,WAAY,CAAC;QAEzC,MAAM,aAAa,GAAG,IAAA,aAAK,EACzB,oDAAoD,CACrD,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACpB,MAAM,cAAc,GAAG,aAAa,EAAE,MAAM,EAAE,cAAc,CAAC;QAC7D,IAAI,YAAE,CAAC,eAAe,CAAC,cAAc,CAAC,EAAE,CAAC;YACvC,eAAM,CAAC,KAAK,CACV,uDAAuD,WAAW,GAAG,CACtE,CAAC;YACF,OAAO,IAAI,CAAC;QACd,CAAC;QAED,+GAA+G;QAC/G,MAAM,mBAAmB,GAAG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,iBAAK,EAAC;QACL,SAAS,EAAE,cAAc,cAAc,CAAC,EAAE,EAAE;QAC5C,GAAG,EAAE,CAAC,EAAE,WAAW,EAAE,WAAW,EAAqB,EAAE,EAAE;QACvD,uBAAuB;QACvB,eAAe,WAAW,IAAI,WAAW,EAAE;KAC9C,CAAC;iDA6BD;AAMK;IAJL,IAAA,iBAAK,EAAC;QACL,SAAS,EAAE,cAAc,cAAc,CAAC,EAAE,EAAE;QAC5C,GAAG,EAAE,CAAC,YAAY,EAAE,EAAE,CAAC,oBAAoB,YAAY,EAAE;KAC1D,CAAC;sDAwDD","sourcesContent":["import is from '@sindresorhus/is';\nimport pMap from 'p-map';\nimport { logger } from '../../../logger';\nimport * as packageCache from '../../../util/cache/package';\nimport { cache } from '../../../util/cache/package/decorator';\nimport { regEx } from '../../../util/regex';\nimport { joinUrlParts } from '../../../util/url';\nimport * as semanticVersioning from '../../versioning/semver';\nimport { Datasource } from '../datasource';\nimport type { Release } from '../index';\nimport type { GetReleasesConfig, ReleaseResult } from '../types';\nimport { DenoAPIModuleResponse, DenoAPIModuleVersionResponse } from './schema';\n\nexport class DenoDatasource extends Datasource {\n static readonly id = 'deno';\n\n override readonly customRegistrySupport = true;\n\n override readonly registryStrategy = 'first';\n\n override readonly defaultVersioning = semanticVersioning.id;\n\n override readonly defaultRegistryUrls = ['https://apiland.deno.dev'];\n\n override readonly releaseTimestampSupport = true;\n override readonly releaseTimestampNote =\n 'The release timestamp is determined from the `uploaded_at` field in the results.';\n override readonly sourceUrlSupport = 'release';\n override readonly sourceUrlNote =\n 'The source URL is determined from the `repository` field in the results.';\n\n constructor() {\n super(DenoDatasource.id);\n }\n\n @cache({\n namespace: `datasource-${DenoDatasource.id}`,\n key: ({ packageName, registryUrl }: GetReleasesConfig) =>\n // TODO: types (#22198)\n `getReleases:${registryUrl}:${packageName}`,\n })\n async getReleases({\n packageName,\n registryUrl,\n }: GetReleasesConfig): Promise<ReleaseResult | null> {\n const massagedRegistryUrl = registryUrl!;\n\n const extractResult = regEx(\n /^(https:\\/\\/deno.land\\/)(?<rawPackageName>[^@\\s]+)/,\n ).exec(packageName);\n const rawPackageName = extractResult?.groups?.rawPackageName;\n if (is.nullOrUndefined(rawPackageName)) {\n logger.debug(\n `Could not extract rawPackageName from packageName: \"${packageName}\"`,\n );\n return null;\n }\n\n // remove third-party prefix if defined. The only internal library is `std` and is available under the same API\n const massagedPackageName = rawPackageName.replace('x/', '');\n\n // https://apiland.deno.dev/v2/modules/postgres\n const moduleAPIURL = joinUrlParts(\n massagedRegistryUrl,\n 'v2/modules',\n massagedPackageName,\n );\n\n return await this.getReleaseResult(moduleAPIURL);\n }\n\n @cache({\n namespace: `datasource-${DenoDatasource.id}`,\n key: (moduleAPIURL) => `getReleaseResult:${moduleAPIURL}`,\n })\n async getReleaseResult(moduleAPIURL: string): Promise<ReleaseResult> {\n const detailsCacheKey = `details:${moduleAPIURL}`;\n const releasesCache: Record<string, Release> =\n (await packageCache.get(\n `datasource-${DenoDatasource.id}`,\n detailsCacheKey,\n )) ?? {};\n let cacheModified = false;\n\n const {\n body: { versions, tags },\n } = await this.http.getJson(moduleAPIURL, DenoAPIModuleResponse);\n\n // get details for the versions\n const releases = await pMap(\n versions,\n async (version) => {\n const cacheRelease = releasesCache[version];\n /* v8 ignore next 3: hard to test */\n if (cacheRelease) {\n return cacheRelease;\n }\n\n // https://apiland.deno.dev/v2/modules/postgres/v0.17.0\n const url = joinUrlParts(moduleAPIURL, version);\n const { body: release } = await this.http.getJson(\n url,\n DenoAPIModuleVersionResponse.catch(({ error: err }) => {\n logger.warn(\n { err, version },\n 'Deno: failed to get version details',\n );\n return { version };\n }),\n );\n\n releasesCache[release.version] = release;\n cacheModified = true;\n\n return release;\n },\n { concurrency: 5 },\n );\n\n if (cacheModified) {\n // 1 week. Releases at Deno are immutable, therefore we can use a long term cache here.\n await packageCache.set(\n `datasource-${DenoDatasource.id}`,\n detailsCacheKey,\n releasesCache,\n 10080,\n );\n }\n\n return { releases, tags };\n }\n}\n"]}
|
@@ -17,8 +17,8 @@ export declare const DenoAPIModuleResponse: z.ZodObject<{
|
|
17
17
|
}[], any[]>, Record<string, string>, any[]>>;
|
18
18
|
versions: z.ZodArray<z.ZodString, "many">;
|
19
19
|
}, "strip", z.ZodTypeAny, {
|
20
|
-
tags: Record<string, string>;
|
21
20
|
versions: string[];
|
21
|
+
tags: Record<string, string>;
|
22
22
|
}, {
|
23
23
|
versions: string[];
|
24
24
|
tags?: unknown;
|
@@ -32,7 +32,6 @@ class DevboxDatasource extends datasource_1.Datasource {
|
|
32
32
|
res.homepage = response.body.homepage;
|
33
33
|
}
|
34
34
|
catch (err) {
|
35
|
-
// istanbul ignore else: not testable with nock
|
36
35
|
if (err instanceof http_1.HttpError) {
|
37
36
|
if (err.response?.statusCode !== 404) {
|
38
37
|
throw new external_host_error_1.ExternalHostError(err);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../lib/modules/datasource/devbox/index.ts"],"names":[],"mappings":";;;;AAAA,4CAAyC;AACzC,mFAA8E;AAC9E,6CAA+C;AAC/C,2CAAiD;AACjD,kFAA4D;AAC5D,8CAA2C;AAE3C,qCAA0D;AAC1D,qCAA0C;AAE1C,MAAa,gBAAiB,SAAQ,uBAAU;IAC9C,MAAM,CAAU,EAAE,GAAG,mBAAU,CAAC;IAEhC;QACE,KAAK,CAAC,mBAAU,CAAC,CAAC;IACpB,CAAC;IAEiB,qBAAqB,GAAG,IAAI,CAAC;IAC7B,uBAAuB,GAAG,IAAI,CAAC;IAE/B,gBAAgB,GAAG,OAAO,CAAC;IAE3B,iBAAiB,GAAG,gBAAgB,CAAC,EAAE,CAAC;IAExC,mBAAmB,GAAG,CAAC,2BAAkB,CAAC,CAAC;IAE7D,KAAK,CAAC,WAAW,CAAC,EAChB,WAAW,EACX,WAAW,GACO;QAClB,MAAM,GAAG,GAAkB;YACzB,QAAQ,EAAE,EAAE;SACb,CAAC;QAEF,eAAM,C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;QAEtE,MAAM,YAAY,GAAG,IAAA,kBAAY,EAC/B,WAAY,EACZ,aAAa,kBAAkB,CAAC,WAAW,CAAC,EAAE,CAC/C,CAAC;QAEF,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,uBAAc,CAAC,CAAC;YACvE,GAAG,CAAC,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC;YACtC,GAAG,CAAC,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC;QACxC,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAI,GAAG,YAAY,gBAAS,EAAE,CAAC;gBAC7B,IAAI,GAAG,CAAC,QAAQ,EAAE,UAAU,KAAK,GAAG,EAAE,CAAC;oBACrC,MAAM,IAAI,uCAAiB,CAAC,GAAG,CAAC,CAAC;gBACnC,CAAC;YACH,CAAC;YACD,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC;QAChC,CAAC;QACD,OAAO,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;IAC1C,CAAC;;AA5CH,4CA6CC","sourcesContent":["import { logger } from '../../../logger';\nimport { ExternalHostError } from '../../../types/errors/external-host-error';\nimport { HttpError } from '../../../util/http';\nimport { joinUrlParts } from '../../../util/url';\nimport * as devboxVersioning from '../../versioning/devbox';\nimport { Datasource } from '../datasource';\nimport type { GetReleasesConfig, ReleaseResult } from '../types';\nimport { datasource, defaultRegistryUrl } from './common';\nimport { DevboxResponse } from './schema';\n\nexport class DevboxDatasource extends Datasource {\n static readonly id = datasource;\n\n constructor() {\n super(datasource);\n }\n\n override readonly customRegistrySupport = true;\n override readonly releaseTimestampSupport = true;\n\n override readonly registryStrategy = 'first';\n\n override readonly defaultVersioning = devboxVersioning.id;\n\n override readonly defaultRegistryUrls = [defaultRegistryUrl];\n\n async getReleases({\n registryUrl,\n packageName,\n }: GetReleasesConfig): Promise<ReleaseResult | null> {\n const res: ReleaseResult = {\n releases: [],\n };\n\n logger.trace({ registryUrl, packageName }, 'fetching devbox release');\n\n const devboxPkgUrl = joinUrlParts(\n registryUrl!,\n `/pkg?name=${encodeURIComponent(packageName)}`,\n );\n\n try {\n const response = await this.http.getJson(devboxPkgUrl, DevboxResponse);\n res.releases = response.body.releases;\n res.homepage = response.body.homepage;\n } catch (err) {\n if (err instanceof HttpError) {\n if (err.response?.statusCode !== 404) {\n throw new ExternalHostError(err);\n }\n }\n this.handleGenericErrors(err);\n }\n return res.releases.length ? res : null;\n }\n}\n"]}
|
@@ -18,6 +18,7 @@ const common_1 = require("../../../util/common");
|
|
18
18
|
const url_1 = require("../../../util/git/url");
|
19
19
|
const hash_1 = require("../../../util/hash");
|
20
20
|
const hostRules = tslib_1.__importStar(require("../../../util/host-rules"));
|
21
|
+
const memory_http_cache_provider_1 = require("../../../util/http/cache/memory-http-cache-provider");
|
21
22
|
const regex_1 = require("../../../util/regex");
|
22
23
|
const sanitize_1 = require("../../../util/sanitize");
|
23
24
|
const url_2 = require("../../../util/url");
|
@@ -40,6 +41,7 @@ async function getAuthHeaders(http, registryHost, dockerRepository, apiCheckUrl
|
|
40
41
|
const options = {
|
41
42
|
throwHttpErrors: false,
|
42
43
|
noAuth: true,
|
44
|
+
cacheProvider: memory_http_cache_provider_1.memCacheProvider,
|
43
45
|
};
|
44
46
|
const apiCheckResponse = apiCheckUrl.endsWith('/v2/')
|
45
47
|
? await http.get(apiCheckUrl, options)
|
@@ -130,9 +132,10 @@ async function getAuthHeaders(http, registryHost, dockerRepository, apiCheckUrl
|
|
130
132
|
}
|
131
133
|
logger_1.logger.trace({ registryHost, dockerRepository, authUrl: authUrl.href }, `Obtaining docker registry token`);
|
132
134
|
opts.noAuth = true;
|
135
|
+
opts.cacheProvider = memory_http_cache_provider_1.memCacheProvider;
|
133
136
|
const authResponse = (await http.getJsonUnchecked(authUrl.href, opts)).body;
|
134
137
|
const token = authResponse.token ?? authResponse.access_token;
|
135
|
-
|
138
|
+
/* v8 ignore next 4 -- TODO: add test */
|
136
139
|
if (!token) {
|
137
140
|
logger_1.logger.warn('Failed to obtain docker registry token');
|
138
141
|
return null;
|
@@ -246,7 +249,7 @@ function findLatestStable(tags) {
|
|
246
249
|
}
|
247
250
|
return stable;
|
248
251
|
}
|
249
|
-
const chartRepo = (0, regex_1.regEx)(/charts?|helm|helm-charts
|
252
|
+
const chartRepo = (0, regex_1.regEx)(/charts?|helm|helm-charts?/i);
|
250
253
|
function isPossibleChartRepo(url) {
|
251
254
|
if ((0, common_1.detectPlatform)(url) === null) {
|
252
255
|
return false;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../lib/modules/datasource/docker/common.ts"],"names":[],"mappings":";;;AA6CA,oCAGC;AAED,wCA6MC;AAED,sDA8DC;AAED,sEAIC;AAED,4CAcC;AAaD,8CAiBC;;AAnXD,kEAAkC;AAClC,6CAAoC;AACpC,sEAG2C;AAC3C,4CAAyC;AAEzC,mFAA8E;AAC9E,+CAAkD;AAClD,iDAAsD;AACtD,+CAAoD;AACpD,6CAA8C;AAC9C,4EAAsD;AAOtD,+CAA4C;AAC5C,qDAAgE;AAChE,2CAI2B;AAC3B,oDAAkE;AAClE,kCAA6C;AAC7C,+BAAkD;AAClD,qCAAuC;AAI1B,QAAA,kBAAkB,GAAG,QAAQ,CAAC;AAE9B,QAAA,aAAa,GAAG,8BAA8B,CAAC;AAE/C,QAAA,WAAW,GAAG,iCAAiC,CAAC;AAChD,QAAA,YAAY,GAAG,CAAC,mBAAW,EAAE,0BAA0B,CAAU,CAAC;AAElE,QAAA,WAAW,GAAG,mCAAmC,CAAC;AAElD,QAAA,UAAU,GAAG,yBAAyB,CAAC;AAEpD,SAAgB,YAAY,CAAC,IAAY;IACvC,MAAM,KAAK,GAAG,IAAA,aAAK,EAAC,qBAAqB,CAAC,C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;AAChB,CAAC;AAED,MAAM,SAAS,GAAG,IAAA,aAAK,EAAC,2BAA2B,CAAC,CAAC;AAErD,SAAS,mBAAmB,CAAC,GAAW;IACtC,IAAI,IAAA,uBAAc,EAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;QACjC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,MAAM,GAAG,IAAA,iBAAW,EAAC,GAAG,CAAC,CAAC;IAChC,OAAO,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AACrC,CAAC;AAED,SAAgB,iBAAiB,CAAC,OAAsB;IACtD,IAAI,OAAO,CAAC,IAAI,IAAI,mBAAmB,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QACtD,OAAO,OAAO,CAAC,IAAI,CAAC;IACtB,CAAC;IAED,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC;QAC7B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,MAAM,GAAG,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;QAClC,IAAI,mBAAmB,CAAC,GAAG,CAAC,EAAE,CAAC;YAC7B,OAAO,GAAG,CAAC;QACb,CAAC;IACH,CAAC;IAED,WAAW;IACX,OAAO,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AAC5B,CAAC","sourcesContent":["import is from '@sindresorhus/is';\nimport { parse } from 'auth-header';\nimport {\n HOST_DISABLED,\n PAGE_NOT_FOUND_ERROR,\n} from '../../../constants/error-messages';\nimport { logger } from '../../../logger';\nimport type { HostRule } from '../../../types';\nimport { ExternalHostError } from '../../../types/errors/external-host-error';\nimport { coerceArray } from '../../../util/array';\nimport { detectPlatform } from '../../../util/common';\nimport { parseGitUrl } from '../../../util/git/url';\nimport { toSha256 } from '../../../util/hash';\nimport * as hostRules from '../../../util/host-rules';\nimport type { Http } from '../../../util/http';\nimport type {\n HttpOptions,\n HttpResponse,\n OutgoingHttpHeaders,\n} from '../../../util/http/types';\nimport { regEx } from '../../../util/regex';\nimport { addSecretForSanitizing } from '../../../util/sanitize';\nimport {\n ensureTrailingSlash,\n parseUrl,\n trimTrailingSlash,\n} from '../../../util/url';\nimport { api as dockerVersioning } from '../../versioning/docker';\nimport { getGoogleAuthToken } from '../util';\nimport { ecrRegex, getECRAuthToken } from './ecr';\nimport { googleRegex } from './google';\nimport type { OciHelmConfig } from './schema';\nimport type { RegistryRepository } from './types';\n\nexport const dockerDatasourceId = 'docker';\n\nexport const imageUrlLabel = 'org.opencontainers.image.url';\n\nexport const sourceLabel = 'org.opencontainers.image.source';\nexport const sourceLabels = [sourceLabel, 'org.label-schema.vcs-url'] as const;\n\nexport const gitRefLabel = 'org.opencontainers.image.revision';\n\nexport const DOCKER_HUB = 'https://index.docker.io';\n\nexport function isDockerHost(host: string): boolean {\n const regex = regEx(/(?:^|\\.)docker\\.io$/);\n return regex.test(host);\n}\n\nexport async function getAuthHeaders(\n http: Http,\n registryHost: string,\n dockerRepository: string,\n apiCheckUrl = `${registryHost}/v2/`,\n): Promise<OutgoingHttpHeaders | null> {\n try {\n const options = {\n throwHttpErrors: false,\n noAuth: true,\n };\n const apiCheckResponse = apiCheckUrl.endsWith('/v2/')\n ? await http.get(apiCheckUrl, options)\n : // use json request, as this will be cached for tags, so it returns json\n // TODO: add cache test\n await http.getJsonUnchecked(apiCheckUrl, options);\n\n if (apiCheckResponse.statusCode === 200) {\n logger.debug(`No registry auth required for ${apiCheckUrl}`);\n return {};\n }\n if (apiCheckResponse.statusCode === 404) {\n logger.debug(`Page Not Found ${apiCheckUrl}`);\n // throw error up to be caught and potentially retried with library/ prefix\n throw new Error(PAGE_NOT_FOUND_ERROR);\n }\n if (\n apiCheckResponse.statusCode !== 401 ||\n !is.nonEmptyString(apiCheckResponse.headers['www-authenticate'])\n ) {\n logger.warn(\n { apiCheckUrl, res: apiCheckResponse },\n 'Invalid registry response',\n );\n return null;\n }\n\n const authenticateHeader = parse(\n apiCheckResponse.headers['www-authenticate'],\n );\n\n const opts: HostRule & HttpOptions = hostRules.find({\n hostType: dockerDatasourceId,\n url: apiCheckUrl,\n });\n if (ecrRegex.test(registryHost)) {\n logger.once.debug(`hostRules: ecr auth for ${registryHost}`);\n logger.trace(\n { registryHost, dockerRepository },\n `Using ecr auth for Docker registry`,\n );\n const [, region] = coerceArray(ecrRegex.exec(registryHost));\n const auth = await getECRAuthToken(region, opts);\n if (auth) {\n opts.headers = { authorization: `Basic ${auth}` };\n }\n } else if (\n googleRegex.test(registryHost) &&\n typeof opts.username === 'undefined' &&\n typeof opts.password === 'undefined' &&\n typeof opts.token === 'undefined'\n ) {\n logger.once.debug(`hostRules: google auth for ${registryHost}`);\n logger.trace(\n { registryHost, dockerRepository },\n `Using google auth for Docker registry`,\n );\n const auth = await getGoogleAuthToken();\n if (auth) {\n opts.headers = { authorization: `Basic ${auth}` };\n } else {\n logger.once.debug(\n { registryHost, dockerRepository },\n 'Could not get Google access token, using no auth',\n );\n }\n } else if (opts.username && opts.password) {\n logger.once.debug(`hostRules: basic auth for ${registryHost}`);\n logger.trace(\n { registryHost, dockerRepository },\n `Using basic auth for Docker registry`,\n );\n const auth = Buffer.from(`${opts.username}:${opts.password}`).toString(\n 'base64',\n );\n opts.headers = { authorization: `Basic ${auth}` };\n } else if (opts.token) {\n const authType = opts.authType ?? 'Bearer';\n logger.once.debug(\n `hostRules: ${authType} token auth for ${registryHost}`,\n );\n logger.trace(\n { registryHost, dockerRepository },\n `Using ${authType} token for Docker registry`,\n );\n opts.headers = { authorization: `${authType} ${opts.token}` };\n }\n delete opts.username;\n delete opts.password;\n delete opts.token;\n\n // If realm isn't an url, we should directly use auth header\n // Can happen when we get a Basic auth or some other auth type\n // * WWW-Authenticate: Basic realm=\"Artifactory Realm\"\n // * Www-Authenticate: Basic realm=\"https://123456789.dkr.ecr.eu-central-1.amazonaws.com/\",service=\"ecr.amazonaws.com\"\n // * www-authenticate: Bearer realm=\"https://ghcr.io/token\",service=\"ghcr.io\",scope=\"repository:user/image:pull\"\n // * www-authenticate: Bearer realm=\"https://auth.docker.io/token\",service=\"registry.docker.io\"\n if (\n authenticateHeader.scheme.toUpperCase() !== 'BEARER' ||\n !is.string(authenticateHeader.params.realm) ||\n parseUrl(authenticateHeader.params.realm) === null\n ) {\n logger.once.debug(`hostRules: testing direct auth for ${registryHost}`);\n logger.trace(\n { registryHost, dockerRepository, authenticateHeader },\n `Invalid realm, testing direct auth`,\n );\n return opts.headers ?? null;\n }\n\n const authUrl = new URL(`${authenticateHeader.params.realm}`);\n\n // repo isn't known to server yet, so causing wrong scope `repository:user/image:pull`\n if (\n is.string(authenticateHeader.params.scope) &&\n !apiCheckUrl.endsWith('/v2/')\n ) {\n authUrl.searchParams.append('scope', authenticateHeader.params.scope);\n } else {\n authUrl.searchParams.append(\n 'scope',\n `repository:${dockerRepository}:pull`,\n );\n }\n\n if (is.string(authenticateHeader.params.service)) {\n authUrl.searchParams.append('service', authenticateHeader.params.service);\n }\n\n logger.trace(\n { registryHost, dockerRepository, authUrl: authUrl.href },\n `Obtaining docker registry token`,\n );\n opts.noAuth = true;\n const authResponse = (\n await http.getJsonUnchecked<{ token?: string; access_token?: string }>(\n authUrl.href,\n opts,\n )\n ).body;\n\n const token = authResponse.token ?? authResponse.access_token;\n // istanbul ignore if\n if (!token) {\n logger.warn('Failed to obtain docker registry token');\n return null;\n }\n // sanitize token\n addSecretForSanitizing(token);\n return {\n authorization: `Bearer ${token}`,\n };\n } catch (err) /* istanbul ignore next */ {\n if (err.host === 'quay.io') {\n // TODO: debug why quay throws errors (#9604)\n return null;\n }\n if (err.statusCode === 401) {\n logger.debug(\n { registryHost, dockerRepository },\n 'Unauthorized docker lookup',\n );\n logger.debug({ err });\n return null;\n }\n if (err.statusCode === 403) {\n logger.debug(\n { registryHost, dockerRepository },\n 'Not allowed to access docker registry',\n );\n logger.debug({ err });\n return null;\n }\n if (err.name === 'RequestError' && isDockerHost(registryHost)) {\n throw new ExternalHostError(err);\n }\n if (err.statusCode === 429 && isDockerHost(registryHost)) {\n throw new ExternalHostError(err);\n }\n if (err.statusCode >= 500 && err.statusCode < 600) {\n throw new ExternalHostError(err);\n }\n if (err.message === PAGE_NOT_FOUND_ERROR) {\n throw err;\n }\n if (err.message === HOST_DISABLED) {\n logger.trace({ registryHost, dockerRepository, err }, 'Host disabled');\n return null;\n }\n logger.warn(\n { registryHost, dockerRepository, err },\n 'Error obtaining docker token',\n );\n return null;\n }\n}\n\nexport function getRegistryRepository(\n packageName: string,\n registryUrl: string,\n): RegistryRepository {\n if (registryUrl !== DOCKER_HUB) {\n const registryEndingWithSlash = ensureTrailingSlash(\n registryUrl.replace(regEx(/^https?:\\/\\//), ''),\n );\n if (packageName.startsWith(registryEndingWithSlash)) {\n let registryHost = trimTrailingSlash(registryUrl);\n if (!regEx(/^https?:\\/\\//).test(registryHost)) {\n registryHost = `https://${registryHost}`;\n }\n let dockerRepository = packageName.replace(registryEndingWithSlash, '');\n const fullUrl = `${registryHost}/${dockerRepository}`;\n const { origin, pathname } = parseUrl(fullUrl)!;\n registryHost = origin;\n dockerRepository = pathname.substring(1);\n return {\n registryHost,\n dockerRepository,\n };\n }\n }\n let registryHost = registryUrl;\n const split = packageName.split('/');\n if (split.length > 1 && (split[0].includes('.') || split[0].includes(':'))) {\n [registryHost] = split;\n split.shift();\n }\n let dockerRepository = split.join('/');\n\n if (!regEx(/^https?:\\/\\//).test(registryHost)) {\n registryHost = `https://${registryHost}`;\n }\n\n const { path, base } =\n regEx(/^(?<base>https:\\/\\/[^/]+)\\/(?<path>.+)$/).exec(registryHost)\n ?.groups ?? {};\n if (base && path) {\n registryHost = base;\n dockerRepository = `${trimTrailingSlash(path)}/${dockerRepository}`;\n }\n\n registryHost = registryHost\n .replace('https://docker.io', 'https://index.docker.io')\n .replace('https://registry-1.docker.io', 'https://index.docker.io');\n\n const opts = hostRules.find({\n hostType: dockerDatasourceId,\n url: registryHost,\n });\n if (opts?.insecureRegistry) {\n registryHost = registryHost.replace('https', 'http');\n }\n if (registryHost.endsWith('.docker.io') && !dockerRepository.includes('/')) {\n dockerRepository = 'library/' + dockerRepository;\n }\n return {\n registryHost,\n dockerRepository,\n };\n}\n\nexport function extractDigestFromResponseBody(\n manifestResponse: HttpResponse,\n): string {\n return 'sha256:' + toSha256(manifestResponse.body);\n}\n\nexport function findLatestStable(tags: string[]): string | null {\n let stable: string | null = null;\n\n for (const tag of tags) {\n if (!dockerVersioning.isValid(tag) || !dockerVersioning.isStable(tag)) {\n continue;\n }\n\n if (!stable || dockerVersioning.isGreaterThan(tag, stable)) {\n stable = tag;\n }\n }\n\n return stable;\n}\n\nconst chartRepo = regEx(/charts?|helm|helm-charts/i);\n\nfunction isPossibleChartRepo(url: string): boolean {\n if (detectPlatform(url) === null) {\n return false;\n }\n\n const parsed = parseGitUrl(url);\n return chartRepo.test(parsed.name);\n}\n\nexport function findHelmSourceUrl(release: OciHelmConfig): string | null {\n if (release.home && isPossibleChartRepo(release.home)) {\n return release.home;\n }\n\n if (!release.sources?.length) {\n return null;\n }\n\n for (const url of release.sources) {\n if (isPossibleChartRepo(url)) {\n return url;\n }\n }\n\n // fallback\n return release.sources[0];\n}\n"]}
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../lib/modules/datasource/docker/common.ts"],"names":[],"mappings":";;;AA8CA,oCAGC;AAED,wCA+MC;AAED,sDA8DC;AAED,sEAIC;AAED,4CAcC;AAaD,8CAiBC;;AAtXD,kEAAkC;AAClC,6CAAoC;AACpC,sEAG2C;AAC3C,4CAAyC;AAEzC,mFAA8E;AAC9E,+CAAkD;AAClD,iDAAsD;AACtD,+CAAoD;AACpD,6CAA8C;AAC9C,4EAAsD;AAEtD,oGAAuF;AAMvF,+CAA4C;AAC5C,qDAAgE;AAChE,2CAI2B;AAC3B,oDAAkE;AAClE,kCAA6C;AAC7C,+BAAkD;AAClD,qCAAuC;AAI1B,QAAA,kBAAkB,GAAG,QAAQ,CAAC;AAE9B,QAAA,aAAa,G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is';\nimport { parse } from 'auth-header';\nimport {\n HOST_DISABLED,\n PAGE_NOT_FOUND_ERROR,\n} from '../../../constants/error-messages';\nimport { logger } from '../../../logger';\nimport type { HostRule } from '../../../types';\nimport { ExternalHostError } from '../../../types/errors/external-host-error';\nimport { coerceArray } from '../../../util/array';\nimport { detectPlatform } from '../../../util/common';\nimport { parseGitUrl } from '../../../util/git/url';\nimport { toSha256 } from '../../../util/hash';\nimport * as hostRules from '../../../util/host-rules';\nimport type { Http } from '../../../util/http';\nimport { memCacheProvider } from '../../../util/http/cache/memory-http-cache-provider';\nimport type {\n HttpOptions,\n HttpResponse,\n OutgoingHttpHeaders,\n} from '../../../util/http/types';\nimport { regEx } from '../../../util/regex';\nimport { addSecretForSanitizing } from '../../../util/sanitize';\nimport {\n ensureTrailingSlash,\n parseUrl,\n trimTrailingSlash,\n} from '../../../util/url';\nimport { api as dockerVersioning } from '../../versioning/docker';\nimport { getGoogleAuthToken } from '../util';\nimport { ecrRegex, getECRAuthToken } from './ecr';\nimport { googleRegex } from './google';\nimport type { OciHelmConfig } from './schema';\nimport type { RegistryRepository } from './types';\n\nexport const dockerDatasourceId = 'docker';\n\nexport const imageUrlLabel = 'org.opencontainers.image.url';\n\nexport const sourceLabel = 'org.opencontainers.image.source';\nexport const sourceLabels = [sourceLabel, 'org.label-schema.vcs-url'] as const;\n\nexport const gitRefLabel = 'org.opencontainers.image.revision';\n\nexport const DOCKER_HUB = 'https://index.docker.io';\n\nexport function isDockerHost(host: string): boolean {\n const regex = regEx(/(?:^|\\.)docker\\.io$/);\n return regex.test(host);\n}\n\nexport async function getAuthHeaders(\n http: Http,\n registryHost: string,\n dockerRepository: string,\n apiCheckUrl = `${registryHost}/v2/`,\n): Promise<OutgoingHttpHeaders | null> {\n try {\n const options = {\n throwHttpErrors: false,\n noAuth: true,\n cacheProvider: memCacheProvider,\n };\n const apiCheckResponse = apiCheckUrl.endsWith('/v2/')\n ? await http.get(apiCheckUrl, options)\n : // use json request, as this will be cached for tags, so it returns json\n // TODO: add cache test\n await http.getJsonUnchecked(apiCheckUrl, options);\n\n if (apiCheckResponse.statusCode === 200) {\n logger.debug(`No registry auth required for ${apiCheckUrl}`);\n return {};\n }\n if (apiCheckResponse.statusCode === 404) {\n logger.debug(`Page Not Found ${apiCheckUrl}`);\n // throw error up to be caught and potentially retried with library/ prefix\n throw new Error(PAGE_NOT_FOUND_ERROR);\n }\n if (\n apiCheckResponse.statusCode !== 401 ||\n !is.nonEmptyString(apiCheckResponse.headers['www-authenticate'])\n ) {\n logger.warn(\n { apiCheckUrl, res: apiCheckResponse },\n 'Invalid registry response',\n );\n return null;\n }\n\n const authenticateHeader = parse(\n apiCheckResponse.headers['www-authenticate'],\n );\n\n const opts: HostRule & HttpOptions = hostRules.find({\n hostType: dockerDatasourceId,\n url: apiCheckUrl,\n });\n if (ecrRegex.test(registryHost)) {\n logger.once.debug(`hostRules: ecr auth for ${registryHost}`);\n logger.trace(\n { registryHost, dockerRepository },\n `Using ecr auth for Docker registry`,\n );\n const [, region] = coerceArray(ecrRegex.exec(registryHost));\n const auth = await getECRAuthToken(region, opts);\n if (auth) {\n opts.headers = { authorization: `Basic ${auth}` };\n }\n } else if (\n googleRegex.test(registryHost) &&\n typeof opts.username === 'undefined' &&\n typeof opts.password === 'undefined' &&\n typeof opts.token === 'undefined'\n ) {\n logger.once.debug(`hostRules: google auth for ${registryHost}`);\n logger.trace(\n { registryHost, dockerRepository },\n `Using google auth for Docker registry`,\n );\n const auth = await getGoogleAuthToken();\n if (auth) {\n opts.headers = { authorization: `Basic ${auth}` };\n } else {\n logger.once.debug(\n { registryHost, dockerRepository },\n 'Could not get Google access token, using no auth',\n );\n }\n } else if (opts.username && opts.password) {\n logger.once.debug(`hostRules: basic auth for ${registryHost}`);\n logger.trace(\n { registryHost, dockerRepository },\n `Using basic auth for Docker registry`,\n );\n const auth = Buffer.from(`${opts.username}:${opts.password}`).toString(\n 'base64',\n );\n opts.headers = { authorization: `Basic ${auth}` };\n } else if (opts.token) {\n const authType = opts.authType ?? 'Bearer';\n logger.once.debug(\n `hostRules: ${authType} token auth for ${registryHost}`,\n );\n logger.trace(\n { registryHost, dockerRepository },\n `Using ${authType} token for Docker registry`,\n );\n opts.headers = { authorization: `${authType} ${opts.token}` };\n }\n delete opts.username;\n delete opts.password;\n delete opts.token;\n\n // If realm isn't an url, we should directly use auth header\n // Can happen when we get a Basic auth or some other auth type\n // * WWW-Authenticate: Basic realm=\"Artifactory Realm\"\n // * Www-Authenticate: Basic realm=\"https://123456789.dkr.ecr.eu-central-1.amazonaws.com/\",service=\"ecr.amazonaws.com\"\n // * www-authenticate: Bearer realm=\"https://ghcr.io/token\",service=\"ghcr.io\",scope=\"repository:user/image:pull\"\n // * www-authenticate: Bearer realm=\"https://auth.docker.io/token\",service=\"registry.docker.io\"\n if (\n authenticateHeader.scheme.toUpperCase() !== 'BEARER' ||\n !is.string(authenticateHeader.params.realm) ||\n parseUrl(authenticateHeader.params.realm) === null\n ) {\n logger.once.debug(`hostRules: testing direct auth for ${registryHost}`);\n logger.trace(\n { registryHost, dockerRepository, authenticateHeader },\n `Invalid realm, testing direct auth`,\n );\n return opts.headers ?? null;\n }\n\n const authUrl = new URL(`${authenticateHeader.params.realm}`);\n\n // repo isn't known to server yet, so causing wrong scope `repository:user/image:pull`\n if (\n is.string(authenticateHeader.params.scope) &&\n !apiCheckUrl.endsWith('/v2/')\n ) {\n authUrl.searchParams.append('scope', authenticateHeader.params.scope);\n } else {\n authUrl.searchParams.append(\n 'scope',\n `repository:${dockerRepository}:pull`,\n );\n }\n\n if (is.string(authenticateHeader.params.service)) {\n authUrl.searchParams.append('service', authenticateHeader.params.service);\n }\n\n logger.trace(\n { registryHost, dockerRepository, authUrl: authUrl.href },\n `Obtaining docker registry token`,\n );\n opts.noAuth = true;\n opts.cacheProvider = memCacheProvider;\n const authResponse = (\n await http.getJsonUnchecked<{ token?: string; access_token?: string }>(\n authUrl.href,\n opts,\n )\n ).body;\n\n const token = authResponse.token ?? authResponse.access_token;\n /* v8 ignore next 4 -- TODO: add test */\n if (!token) {\n logger.warn('Failed to obtain docker registry token');\n return null;\n }\n // sanitize token\n addSecretForSanitizing(token);\n return {\n authorization: `Bearer ${token}`,\n };\n } catch (err) /* istanbul ignore next */ {\n if (err.host === 'quay.io') {\n // TODO: debug why quay throws errors (#9604)\n return null;\n }\n if (err.statusCode === 401) {\n logger.debug(\n { registryHost, dockerRepository },\n 'Unauthorized docker lookup',\n );\n logger.debug({ err });\n return null;\n }\n if (err.statusCode === 403) {\n logger.debug(\n { registryHost, dockerRepository },\n 'Not allowed to access docker registry',\n );\n logger.debug({ err });\n return null;\n }\n if (err.name === 'RequestError' && isDockerHost(registryHost)) {\n throw new ExternalHostError(err);\n }\n if (err.statusCode === 429 && isDockerHost(registryHost)) {\n throw new ExternalHostError(err);\n }\n if (err.statusCode >= 500 && err.statusCode < 600) {\n throw new ExternalHostError(err);\n }\n if (err.message === PAGE_NOT_FOUND_ERROR) {\n throw err;\n }\n if (err.message === HOST_DISABLED) {\n logger.trace({ registryHost, dockerRepository, err }, 'Host disabled');\n return null;\n }\n logger.warn(\n { registryHost, dockerRepository, err },\n 'Error obtaining docker token',\n );\n return null;\n }\n}\n\nexport function getRegistryRepository(\n packageName: string,\n registryUrl: string,\n): RegistryRepository {\n if (registryUrl !== DOCKER_HUB) {\n const registryEndingWithSlash = ensureTrailingSlash(\n registryUrl.replace(regEx(/^https?:\\/\\//), ''),\n );\n if (packageName.startsWith(registryEndingWithSlash)) {\n let registryHost = trimTrailingSlash(registryUrl);\n if (!regEx(/^https?:\\/\\//).test(registryHost)) {\n registryHost = `https://${registryHost}`;\n }\n let dockerRepository = packageName.replace(registryEndingWithSlash, '');\n const fullUrl = `${registryHost}/${dockerRepository}`;\n const { origin, pathname } = parseUrl(fullUrl)!;\n registryHost = origin;\n dockerRepository = pathname.substring(1);\n return {\n registryHost,\n dockerRepository,\n };\n }\n }\n let registryHost = registryUrl;\n const split = packageName.split('/');\n if (split.length > 1 && (split[0].includes('.') || split[0].includes(':'))) {\n [registryHost] = split;\n split.shift();\n }\n let dockerRepository = split.join('/');\n\n if (!regEx(/^https?:\\/\\//).test(registryHost)) {\n registryHost = `https://${registryHost}`;\n }\n\n const { path, base } =\n regEx(/^(?<base>https:\\/\\/[^/]+)\\/(?<path>.+)$/).exec(registryHost)\n ?.groups ?? {};\n if (base && path) {\n registryHost = base;\n dockerRepository = `${trimTrailingSlash(path)}/${dockerRepository}`;\n }\n\n registryHost = registryHost\n .replace('https://docker.io', 'https://index.docker.io')\n .replace('https://registry-1.docker.io', 'https://index.docker.io');\n\n const opts = hostRules.find({\n hostType: dockerDatasourceId,\n url: registryHost,\n });\n if (opts?.insecureRegistry) {\n registryHost = registryHost.replace('https', 'http');\n }\n if (registryHost.endsWith('.docker.io') && !dockerRepository.includes('/')) {\n dockerRepository = 'library/' + dockerRepository;\n }\n return {\n registryHost,\n dockerRepository,\n };\n}\n\nexport function extractDigestFromResponseBody(\n manifestResponse: HttpResponse,\n): string {\n return 'sha256:' + toSha256(manifestResponse.body);\n}\n\nexport function findLatestStable(tags: string[]): string | null {\n let stable: string | null = null;\n\n for (const tag of tags) {\n if (!dockerVersioning.isValid(tag) || !dockerVersioning.isStable(tag)) {\n continue;\n }\n\n if (!stable || dockerVersioning.isGreaterThan(tag, stable)) {\n stable = tag;\n }\n }\n\n return stable;\n}\n\nconst chartRepo = regEx(/charts?|helm|helm-charts?/i);\n\nfunction isPossibleChartRepo(url: string): boolean {\n if (detectPlatform(url) === null) {\n return false;\n }\n\n const parsed = parseGitUrl(url);\n return chartRepo.test(parsed.name);\n}\n\nexport function findHelmSourceUrl(release: OciHelmConfig): string | null {\n if (release.home && isPossibleChartRepo(release.home)) {\n return release.home;\n }\n\n if (!release.sources?.length) {\n return null;\n }\n\n for (const url of release.sources) {\n if (isPossibleChartRepo(url)) {\n return url;\n }\n }\n\n // fallback\n return release.sources[0];\n}\n"]}
|