renovate 40.0.0-next.9 → 40.0.1

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.
Files changed (816) hide show
  1. package/dist/config/decrypt/legacy.js +0 -1
  2. package/dist/config/decrypt/legacy.js.map +1 -1
  3. package/dist/config/decrypt.d.ts +3 -1
  4. package/dist/config/decrypt.js +56 -13
  5. package/dist/config/decrypt.js.map +1 -1
  6. package/dist/config/global.js +0 -1
  7. package/dist/config/global.js.map +1 -1
  8. package/dist/config/migrate-validate.js +3 -2
  9. package/dist/config/migrate-validate.js.map +1 -1
  10. package/dist/config/migration.js +2 -1
  11. package/dist/config/migration.js.map +1 -1
  12. package/dist/config/migrations/custom/rebase-stale-prs-migration.js +1 -1
  13. package/dist/config/migrations/custom/rebase-stale-prs-migration.js.map +1 -1
  14. package/dist/config/migrations/migrations-service.js +3 -2
  15. package/dist/config/migrations/migrations-service.js.map +1 -1
  16. package/dist/config/options/index.js +18 -11
  17. package/dist/config/options/index.js.map +1 -1
  18. package/dist/config/parse.js +2 -2
  19. package/dist/config/parse.js.map +1 -1
  20. package/dist/config/presets/common.js +1 -0
  21. package/dist/config/presets/common.js.map +1 -1
  22. package/dist/config/presets/gitea/index.js +0 -1
  23. package/dist/config/presets/gitea/index.js.map +1 -1
  24. package/dist/config/presets/github/index.js +4 -2
  25. package/dist/config/presets/github/index.js.map +1 -1
  26. package/dist/config/presets/gitlab/index.js +1 -1
  27. package/dist/config/presets/gitlab/index.js.map +1 -1
  28. package/dist/config/presets/http/index.js +2 -2
  29. package/dist/config/presets/http/index.js.map +1 -1
  30. package/dist/config/presets/index.js +0 -7
  31. package/dist/config/presets/index.js.map +1 -1
  32. package/dist/config/presets/internal/custom-managers.js +18 -4
  33. package/dist/config/presets/internal/custom-managers.js.map +1 -1
  34. package/dist/config/presets/internal/group.js +30 -1
  35. package/dist/config/presets/internal/group.js.map +1 -1
  36. package/dist/config/presets/internal/index.js +1 -3
  37. package/dist/config/presets/internal/index.js.map +1 -1
  38. package/dist/config/presets/internal/workarounds.js +1 -0
  39. package/dist/config/presets/internal/workarounds.js.map +1 -1
  40. package/dist/config/presets/npm/index.js +4 -1
  41. package/dist/config/presets/npm/index.js.map +1 -1
  42. package/dist/config/presets/parse.js +2 -1
  43. package/dist/config/presets/parse.js.map +1 -1
  44. package/dist/config/schema.d.ts +2 -2
  45. package/dist/config/types.d.ts +4 -2
  46. package/dist/config/types.js.map +1 -1
  47. package/dist/config/validation.js +3 -5
  48. package/dist/config/validation.js.map +1 -1
  49. package/dist/config-validator.js +0 -1
  50. package/dist/config-validator.js.map +1 -1
  51. package/dist/constants/category.js +0 -1
  52. package/dist/constants/category.js.map +1 -1
  53. package/dist/constants/platforms.js +5 -1
  54. package/dist/constants/platforms.js.map +1 -1
  55. package/dist/data/monorepo.json +9 -2
  56. package/dist/data/replacements.json +13 -0
  57. package/dist/data/source-urls.json +1 -0
  58. package/dist/data-files.generated.js +2 -2
  59. package/dist/data-files.generated.js.map +1 -1
  60. package/dist/instrumentation/index.js +39 -15
  61. package/dist/instrumentation/index.js.map +1 -1
  62. package/dist/instrumentation/utils.js +1 -1
  63. package/dist/instrumentation/utils.js.map +1 -1
  64. package/dist/logger/cmd-serializer.js +0 -1
  65. package/dist/logger/cmd-serializer.js.map +1 -1
  66. package/dist/logger/config-serializer.js +0 -1
  67. package/dist/logger/config-serializer.js.map +1 -1
  68. package/dist/logger/index.js +1 -4
  69. package/dist/logger/index.js.map +1 -1
  70. package/dist/logger/once.js +4 -2
  71. package/dist/logger/once.js.map +1 -1
  72. package/dist/logger/pretty-stdout.js +0 -1
  73. package/dist/logger/pretty-stdout.js.map +1 -1
  74. package/dist/logger/renovate-logger.js +1 -1
  75. package/dist/logger/renovate-logger.js.map +1 -1
  76. package/dist/logger/utils.js +5 -10
  77. package/dist/logger/utils.js.map +1 -1
  78. package/dist/modules/datasource/api.js +4 -0
  79. package/dist/modules/datasource/api.js.map +1 -1
  80. package/dist/modules/datasource/artifactory/index.js +1 -2
  81. package/dist/modules/datasource/artifactory/index.js.map +1 -1
  82. package/dist/modules/datasource/aws-eks-addon/index.d.ts +11 -0
  83. package/dist/modules/datasource/aws-eks-addon/index.js +75 -0
  84. package/dist/modules/datasource/aws-eks-addon/index.js.map +1 -0
  85. package/dist/modules/datasource/aws-eks-addon/schema.d.ts +40 -0
  86. package/dist/modules/datasource/aws-eks-addon/schema.js +31 -0
  87. package/dist/modules/datasource/aws-eks-addon/schema.js.map +1 -0
  88. package/dist/modules/datasource/aws-machine-image/index.js +6 -5
  89. package/dist/modules/datasource/aws-machine-image/index.js.map +1 -1
  90. package/dist/modules/datasource/azure-pipelines-tasks/index.js +15 -1
  91. package/dist/modules/datasource/azure-pipelines-tasks/index.js.map +1 -1
  92. package/dist/modules/datasource/azure-pipelines-tasks/schema.d.ts +24 -0
  93. package/dist/modules/datasource/azure-pipelines-tasks/schema.js +3 -0
  94. package/dist/modules/datasource/azure-pipelines-tasks/schema.js.map +1 -1
  95. package/dist/modules/datasource/bazel/index.js +18 -2
  96. package/dist/modules/datasource/bazel/index.js.map +1 -1
  97. package/dist/modules/datasource/bazel/schema.d.ts +1 -0
  98. package/dist/modules/datasource/bazel/schema.js.map +1 -1
  99. package/dist/modules/datasource/bitbucket-server-tags/index.d.ts +19 -0
  100. package/dist/modules/datasource/bitbucket-server-tags/index.js +133 -0
  101. package/dist/modules/datasource/bitbucket-server-tags/index.js.map +1 -0
  102. package/dist/modules/datasource/bitbucket-server-tags/schema.d.ts +28 -0
  103. package/dist/modules/datasource/bitbucket-server-tags/schema.js +13 -0
  104. package/dist/modules/datasource/bitbucket-server-tags/schema.js.map +1 -0
  105. package/dist/modules/datasource/bitrise/index.js +1 -1
  106. package/dist/modules/datasource/bitrise/index.js.map +1 -1
  107. package/dist/modules/datasource/cdnjs/schema.d.ts +2 -2
  108. package/dist/modules/datasource/conda/index.js +18 -1
  109. package/dist/modules/datasource/conda/index.js.map +1 -1
  110. package/dist/modules/datasource/conda/prefix-dev.d.ts +3 -0
  111. package/dist/modules/datasource/conda/prefix-dev.js +81 -0
  112. package/dist/modules/datasource/conda/prefix-dev.js.map +1 -0
  113. package/dist/modules/datasource/conda/schema/prefix-dev.d.ts +189 -0
  114. package/dist/modules/datasource/conda/schema/prefix-dev.js +31 -0
  115. package/dist/modules/datasource/conda/schema/prefix-dev.js.map +1 -0
  116. package/dist/modules/datasource/conda/types.d.ts +1 -20
  117. package/dist/modules/datasource/conda/types.js.map +1 -1
  118. package/dist/modules/datasource/cpan/index.js +2 -4
  119. package/dist/modules/datasource/cpan/index.js.map +1 -1
  120. package/dist/modules/datasource/crate/index.js +3 -3
  121. package/dist/modules/datasource/crate/index.js.map +1 -1
  122. package/dist/modules/datasource/custom/formats/html.js +1 -1
  123. package/dist/modules/datasource/custom/formats/html.js.map +1 -1
  124. package/dist/modules/datasource/custom/formats/yaml.js +1 -1
  125. package/dist/modules/datasource/custom/formats/yaml.js.map +1 -1
  126. package/dist/modules/datasource/custom/index.js +4 -2
  127. package/dist/modules/datasource/custom/index.js.map +1 -1
  128. package/dist/modules/datasource/custom/schema.d.ts +22 -22
  129. package/dist/modules/datasource/custom/utils.js +1 -0
  130. package/dist/modules/datasource/custom/utils.js.map +1 -1
  131. package/dist/modules/datasource/dart/index.js +1 -1
  132. package/dist/modules/datasource/dart/index.js.map +1 -1
  133. package/dist/modules/datasource/dart-version/index.js +1 -1
  134. package/dist/modules/datasource/dart-version/index.js.map +1 -1
  135. package/dist/modules/datasource/datasource.js +0 -1
  136. package/dist/modules/datasource/datasource.js.map +1 -1
  137. package/dist/modules/datasource/deb/index.d.ts +4 -5
  138. package/dist/modules/datasource/deb/index.js +10 -11
  139. package/dist/modules/datasource/deb/index.js.map +1 -1
  140. package/dist/modules/datasource/deb/url.d.ts +3 -3
  141. package/dist/modules/datasource/deb/url.js +17 -13
  142. package/dist/modules/datasource/deb/url.js.map +1 -1
  143. package/dist/modules/datasource/deno/index.js +1 -1
  144. package/dist/modules/datasource/deno/index.js.map +1 -1
  145. package/dist/modules/datasource/deno/schema.d.ts +1 -1
  146. package/dist/modules/datasource/devbox/index.js +0 -1
  147. package/dist/modules/datasource/devbox/index.js.map +1 -1
  148. package/dist/modules/datasource/docker/common.js +5 -2
  149. package/dist/modules/datasource/docker/common.js.map +1 -1
  150. package/dist/modules/datasource/docker/index.js +8 -6
  151. package/dist/modules/datasource/docker/index.js.map +1 -1
  152. package/dist/modules/datasource/docker/schema.d.ts +77 -101
  153. package/dist/modules/datasource/docker/schema.js +2 -1
  154. package/dist/modules/datasource/docker/schema.js.map +1 -1
  155. package/dist/modules/datasource/flutter-version/index.js +1 -1
  156. package/dist/modules/datasource/flutter-version/index.js.map +1 -1
  157. package/dist/modules/datasource/galaxy/schema.d.ts +1 -1
  158. package/dist/modules/datasource/galaxy-collection/schema.d.ts +8 -8
  159. package/dist/modules/datasource/git-refs/index.js +1 -1
  160. package/dist/modules/datasource/git-refs/index.js.map +1 -1
  161. package/dist/modules/datasource/gitea-releases/schema.d.ts +6 -6
  162. package/dist/modules/datasource/gitea-tags/schema.d.ts +4 -4
  163. package/dist/modules/datasource/github-release-attachments/index.js +2 -2
  164. package/dist/modules/datasource/github-release-attachments/index.js.map +1 -1
  165. package/dist/modules/datasource/github-runners/index.js +2 -2
  166. package/dist/modules/datasource/github-runners/index.js.map +1 -1
  167. package/dist/modules/datasource/github-tags/index.js +4 -1
  168. package/dist/modules/datasource/github-tags/index.js.map +1 -1
  169. package/dist/modules/datasource/gitlab-packages/index.js +1 -1
  170. package/dist/modules/datasource/gitlab-packages/index.js.map +1 -1
  171. package/dist/modules/datasource/gitlab-releases/index.js +1 -3
  172. package/dist/modules/datasource/gitlab-releases/index.js.map +1 -1
  173. package/dist/modules/datasource/go/base.js +1 -1
  174. package/dist/modules/datasource/go/base.js.map +1 -1
  175. package/dist/modules/datasource/go/index.js +1 -1
  176. package/dist/modules/datasource/go/index.js.map +1 -1
  177. package/dist/modules/datasource/go/releases-direct.js +7 -4
  178. package/dist/modules/datasource/go/releases-direct.js.map +1 -1
  179. package/dist/modules/datasource/go/releases-goproxy.js +1 -1
  180. package/dist/modules/datasource/go/releases-goproxy.js.map +1 -1
  181. package/dist/modules/datasource/golang-version/index.js +2 -2
  182. package/dist/modules/datasource/golang-version/index.js.map +1 -1
  183. package/dist/modules/datasource/gradle-version/index.js +1 -1
  184. package/dist/modules/datasource/gradle-version/index.js.map +1 -1
  185. package/dist/modules/datasource/helm/index.js +1 -1
  186. package/dist/modules/datasource/helm/index.js.map +1 -1
  187. package/dist/modules/datasource/hex/index.js +1 -1
  188. package/dist/modules/datasource/hex/index.js.map +1 -1
  189. package/dist/modules/datasource/hex/schema.d.ts +11 -11
  190. package/dist/modules/datasource/hexpm-bob/index.js +1 -1
  191. package/dist/modules/datasource/hexpm-bob/index.js.map +1 -1
  192. package/dist/modules/datasource/index.js +46 -5
  193. package/dist/modules/datasource/index.js.map +1 -1
  194. package/dist/modules/datasource/java-version/index.js +0 -1
  195. package/dist/modules/datasource/java-version/index.js.map +1 -1
  196. package/dist/modules/datasource/jenkins-plugins/index.js +1 -1
  197. package/dist/modules/datasource/jenkins-plugins/index.js.map +1 -1
  198. package/dist/modules/datasource/maven/index.d.ts +2 -2
  199. package/dist/modules/datasource/maven/index.js +56 -33
  200. package/dist/modules/datasource/maven/index.js.map +1 -1
  201. package/dist/modules/datasource/maven/types.d.ts +7 -6
  202. package/dist/modules/datasource/maven/types.js.map +1 -1
  203. package/dist/modules/datasource/maven/util.d.ts +4 -5
  204. package/dist/modules/datasource/maven/util.js +94 -157
  205. package/dist/modules/datasource/maven/util.js.map +1 -1
  206. package/dist/modules/datasource/metadata.js +9 -1
  207. package/dist/modules/datasource/metadata.js.map +1 -1
  208. package/dist/modules/datasource/node-version/index.js +1 -1
  209. package/dist/modules/datasource/node-version/index.js.map +1 -1
  210. package/dist/modules/datasource/npm/get.d.ts +0 -1
  211. package/dist/modules/datasource/npm/get.js +14 -68
  212. package/dist/modules/datasource/npm/get.js.map +1 -1
  213. package/dist/modules/datasource/npm/index.js +1 -1
  214. package/dist/modules/datasource/npm/index.js.map +1 -1
  215. package/dist/modules/datasource/npm/npmrc.js +1 -1
  216. package/dist/modules/datasource/npm/npmrc.js.map +1 -1
  217. package/dist/modules/datasource/npm/types.d.ts +0 -8
  218. package/dist/modules/datasource/npm/types.js.map +1 -1
  219. package/dist/modules/datasource/nuget/index.js +1 -1
  220. package/dist/modules/datasource/nuget/index.js.map +1 -1
  221. package/dist/modules/datasource/nuget/v2.js +1 -1
  222. package/dist/modules/datasource/nuget/v2.js.map +1 -1
  223. package/dist/modules/datasource/nuget/v3.js +8 -6
  224. package/dist/modules/datasource/nuget/v3.js.map +1 -1
  225. package/dist/modules/datasource/orb/index.js +1 -1
  226. package/dist/modules/datasource/orb/index.js.map +1 -1
  227. package/dist/modules/datasource/packagist/index.js +2 -2
  228. package/dist/modules/datasource/packagist/index.js.map +1 -1
  229. package/dist/modules/datasource/packagist/schema.d.ts +32 -32
  230. package/dist/modules/datasource/pod/index.js +2 -2
  231. package/dist/modules/datasource/pod/index.js.map +1 -1
  232. package/dist/modules/datasource/postprocess-release.js +1 -1
  233. package/dist/modules/datasource/postprocess-release.js.map +1 -1
  234. package/dist/modules/datasource/pypi/index.js +1 -1
  235. package/dist/modules/datasource/pypi/index.js.map +1 -1
  236. package/dist/modules/datasource/python-version/index.js +1 -1
  237. package/dist/modules/datasource/python-version/index.js.map +1 -1
  238. package/dist/modules/datasource/repology/index.js +1 -1
  239. package/dist/modules/datasource/repology/index.js.map +1 -1
  240. package/dist/modules/datasource/ruby-version/index.js +1 -1
  241. package/dist/modules/datasource/ruby-version/index.js.map +1 -1
  242. package/dist/modules/datasource/rubygems/index.js +2 -2
  243. package/dist/modules/datasource/rubygems/index.js.map +1 -1
  244. package/dist/modules/datasource/rubygems/versions-endpoint-cache.js +2 -2
  245. package/dist/modules/datasource/rubygems/versions-endpoint-cache.js.map +1 -1
  246. package/dist/modules/datasource/sbt-package/index.js +1 -1
  247. package/dist/modules/datasource/sbt-package/index.js.map +1 -1
  248. package/dist/modules/datasource/sbt-plugin/index.js +1 -1
  249. package/dist/modules/datasource/sbt-plugin/index.js.map +1 -1
  250. package/dist/modules/datasource/schema.d.ts +4 -4
  251. package/dist/modules/datasource/terraform-module/index.js +1 -1
  252. package/dist/modules/datasource/terraform-module/index.js.map +1 -1
  253. package/dist/modules/datasource/terraform-provider/index.js +2 -3
  254. package/dist/modules/datasource/terraform-provider/index.js.map +1 -1
  255. package/dist/modules/datasource/types.d.ts +2 -0
  256. package/dist/modules/datasource/types.js.map +1 -1
  257. package/dist/modules/manager/api.js +2 -0
  258. package/dist/modules/manager/api.js.map +1 -1
  259. package/dist/modules/manager/argocd/extract.js +1 -1
  260. package/dist/modules/manager/argocd/extract.js.map +1 -1
  261. package/dist/modules/manager/argocd/schema.d.ts +22 -22
  262. package/dist/modules/manager/asdf/upgradeable-tooling.js +94 -0
  263. package/dist/modules/manager/asdf/upgradeable-tooling.js.map +1 -1
  264. package/dist/modules/manager/azure-pipelines/schema.d.ts +32 -32
  265. package/dist/modules/manager/batect/schema.d.ts +4 -4
  266. package/dist/modules/manager/batect-wrapper/artifacts.js +1 -1
  267. package/dist/modules/manager/batect-wrapper/artifacts.js.map +1 -1
  268. package/dist/modules/manager/bazel/rules/docker.d.ts +6 -6
  269. package/dist/modules/manager/bazel/rules/git.d.ts +10 -10
  270. package/dist/modules/manager/bazel/rules/git.js +9 -2
  271. package/dist/modules/manager/bazel/rules/git.js.map +1 -1
  272. package/dist/modules/manager/bazel/rules/go.d.ts +5 -5
  273. package/dist/modules/manager/bazel/rules/maven.d.ts +7 -7
  274. package/dist/modules/manager/bazel/rules/oci.d.ts +6 -6
  275. package/dist/modules/manager/bazel-module/parser/fragments.d.ts +40 -40
  276. package/dist/modules/manager/bazel-module/parser/maven.d.ts +44 -90
  277. package/dist/modules/manager/bazel-module/parser/oci.d.ts +19 -42
  278. package/dist/modules/manager/bazel-module/rules.d.ts +50 -160
  279. package/dist/modules/manager/buildpacks/extract.d.ts +6 -1
  280. package/dist/modules/manager/buildpacks/extract.js +24 -14
  281. package/dist/modules/manager/buildpacks/extract.js.map +1 -1
  282. package/dist/modules/manager/bun/artifacts.js +0 -1
  283. package/dist/modules/manager/bun/artifacts.js.map +1 -1
  284. package/dist/modules/manager/bun/extract.d.ts +1 -0
  285. package/dist/modules/manager/bun/extract.js +53 -27
  286. package/dist/modules/manager/bun/extract.js.map +1 -1
  287. package/dist/modules/manager/bun/index.js +1 -1
  288. package/dist/modules/manager/bun/index.js.map +1 -1
  289. package/dist/modules/manager/bun/utils.d.ts +2 -0
  290. package/dist/modules/manager/bun/utils.js +22 -0
  291. package/dist/modules/manager/bun/utils.js.map +1 -0
  292. package/dist/modules/manager/bundler/artifacts.js +0 -1
  293. package/dist/modules/manager/bundler/artifacts.js.map +1 -1
  294. package/dist/modules/manager/bundler/extract.js +2 -1
  295. package/dist/modules/manager/bundler/extract.js.map +1 -1
  296. package/dist/modules/manager/cake/index.js +4 -2
  297. package/dist/modules/manager/cake/index.js.map +1 -1
  298. package/dist/modules/manager/cargo/artifacts.js +5 -7
  299. package/dist/modules/manager/cargo/artifacts.js.map +1 -1
  300. package/dist/modules/manager/cargo/schema.d.ts +166 -166
  301. package/dist/modules/manager/circleci/extract.js +21 -30
  302. package/dist/modules/manager/circleci/extract.js.map +1 -1
  303. package/dist/modules/manager/circleci/schema.d.ts +33 -144
  304. package/dist/modules/manager/circleci/schema.js +21 -17
  305. package/dist/modules/manager/circleci/schema.js.map +1 -1
  306. package/dist/modules/manager/cocoapods/artifacts.js +1 -2
  307. package/dist/modules/manager/cocoapods/artifacts.js.map +1 -1
  308. package/dist/modules/manager/composer/artifacts.js +1 -2
  309. package/dist/modules/manager/composer/artifacts.js.map +1 -1
  310. package/dist/modules/manager/composer/schema.d.ts +32 -34
  311. package/dist/modules/manager/composer/schema.js +1 -1
  312. package/dist/modules/manager/composer/schema.js.map +1 -1
  313. package/dist/modules/manager/composer/utils.d.ts +1 -0
  314. package/dist/modules/manager/composer/utils.js +18 -6
  315. package/dist/modules/manager/composer/utils.js.map +1 -1
  316. package/dist/modules/manager/conan/artifacts.d.ts +2 -0
  317. package/dist/modules/manager/conan/artifacts.js +76 -0
  318. package/dist/modules/manager/conan/artifacts.js.map +1 -0
  319. package/dist/modules/manager/conan/index.d.ts +2 -0
  320. package/dist/modules/manager/conan/index.js +4 -1
  321. package/dist/modules/manager/conan/index.js.map +1 -1
  322. package/dist/modules/manager/copier/artifacts.js +0 -1
  323. package/dist/modules/manager/copier/artifacts.js.map +1 -1
  324. package/dist/modules/manager/crossplane/schema.d.ts +2 -2
  325. package/dist/modules/manager/custom/jsonata/schema.d.ts +21 -21
  326. package/dist/modules/manager/custom/regex/index.js +2 -0
  327. package/dist/modules/manager/custom/regex/index.js.map +1 -1
  328. package/dist/modules/manager/deps-edn/extract.js +2 -1
  329. package/dist/modules/manager/deps-edn/extract.js.map +1 -1
  330. package/dist/modules/manager/devbox/artifacts.d.ts +1 -1
  331. package/dist/modules/manager/devbox/artifacts.js +35 -11
  332. package/dist/modules/manager/devbox/artifacts.js.map +1 -1
  333. package/dist/modules/manager/devbox/schema.js +1 -1
  334. package/dist/modules/manager/devbox/schema.js.map +1 -1
  335. package/dist/modules/manager/devcontainer/extract.js +43 -1
  336. package/dist/modules/manager/devcontainer/extract.js.map +1 -1
  337. package/dist/modules/manager/devcontainer/index.js +11 -1
  338. package/dist/modules/manager/devcontainer/index.js.map +1 -1
  339. package/dist/modules/manager/devcontainer/schema.d.ts +7 -3
  340. package/dist/modules/manager/devcontainer/schema.js +3 -1
  341. package/dist/modules/manager/devcontainer/schema.js.map +1 -1
  342. package/dist/modules/manager/docker-compose/schema.d.ts +6 -6
  343. package/dist/modules/manager/dockerfile/extract.js +2 -6
  344. package/dist/modules/manager/dockerfile/extract.js.map +1 -1
  345. package/dist/modules/manager/fingerprint.generated.js +86 -85
  346. package/dist/modules/manager/fingerprint.generated.js.map +1 -1
  347. package/dist/modules/manager/fleet/schema.d.ts +4 -4
  348. package/dist/modules/manager/flux/artifacts.js +0 -1
  349. package/dist/modules/manager/flux/artifacts.js.map +1 -1
  350. package/dist/modules/manager/flux/extract.js +27 -24
  351. package/dist/modules/manager/flux/extract.js.map +1 -1
  352. package/dist/modules/manager/flux/schema.d.ts +130 -154
  353. package/dist/modules/manager/github-actions/extract.js +60 -39
  354. package/dist/modules/manager/github-actions/extract.js.map +1 -1
  355. package/dist/modules/manager/github-actions/schema.d.ts +66 -0
  356. package/dist/modules/manager/github-actions/schema.js +38 -0
  357. package/dist/modules/manager/github-actions/schema.js.map +1 -0
  358. package/dist/modules/manager/gitlabci/extract.d.ts +1 -5
  359. package/dist/modules/manager/gitlabci/extract.js +27 -126
  360. package/dist/modules/manager/gitlabci/extract.js.map +1 -1
  361. package/dist/modules/manager/gitlabci/schema.d.ts +55 -0
  362. package/dist/modules/manager/gitlabci/schema.js +63 -0
  363. package/dist/modules/manager/gitlabci/schema.js.map +1 -0
  364. package/dist/modules/manager/gitlabci-include/extract.js +6 -54
  365. package/dist/modules/manager/gitlabci-include/extract.js.map +1 -1
  366. package/dist/modules/manager/gitlabci-include/schema.d.ts +13 -0
  367. package/dist/modules/manager/gitlabci-include/schema.js +46 -0
  368. package/dist/modules/manager/gitlabci-include/schema.js.map +1 -0
  369. package/dist/modules/manager/glasskube/schema.d.ts +8 -8
  370. package/dist/modules/manager/gomod/artifacts-extra.js +12 -4
  371. package/dist/modules/manager/gomod/artifacts-extra.js.map +1 -1
  372. package/dist/modules/manager/gomod/artifacts.js +24 -10
  373. package/dist/modules/manager/gomod/artifacts.js.map +1 -1
  374. package/dist/modules/manager/gomod/extract.js +23 -0
  375. package/dist/modules/manager/gomod/extract.js.map +1 -1
  376. package/dist/modules/manager/gomod/line-parser.js +16 -0
  377. package/dist/modules/manager/gomod/line-parser.js.map +1 -1
  378. package/dist/modules/manager/gomod/update.js +5 -3
  379. package/dist/modules/manager/gomod/update.js.map +1 -1
  380. package/dist/modules/manager/gradle/artifacts.js +0 -1
  381. package/dist/modules/manager/gradle/artifacts.js.map +1 -1
  382. package/dist/modules/manager/gradle/extract/catalog.js +1 -1
  383. package/dist/modules/manager/gradle/extract/catalog.js.map +1 -1
  384. package/dist/modules/manager/gradle/extract.js +8 -13
  385. package/dist/modules/manager/gradle/extract.js.map +1 -1
  386. package/dist/modules/manager/gradle/parser/assignments.js +2 -2
  387. package/dist/modules/manager/gradle/parser/assignments.js.map +1 -1
  388. package/dist/modules/manager/gradle/parser/handlers.d.ts +1 -2
  389. package/dist/modules/manager/gradle/parser/handlers.js +17 -24
  390. package/dist/modules/manager/gradle/parser/handlers.js.map +1 -1
  391. package/dist/modules/manager/gradle/parser/registry-urls.js +46 -12
  392. package/dist/modules/manager/gradle/parser/registry-urls.js.map +1 -1
  393. package/dist/modules/manager/gradle/types.d.ts +1 -0
  394. package/dist/modules/manager/gradle/types.js.map +1 -1
  395. package/dist/modules/manager/gradle-wrapper/artifacts.js +1 -2
  396. package/dist/modules/manager/gradle-wrapper/artifacts.js.map +1 -1
  397. package/dist/modules/manager/helmfile/artifacts.js +0 -1
  398. package/dist/modules/manager/helmfile/artifacts.js.map +1 -1
  399. package/dist/modules/manager/helmfile/extract.js +4 -0
  400. package/dist/modules/manager/helmfile/extract.js.map +1 -1
  401. package/dist/modules/manager/helmfile/schema.d.ts +9 -9
  402. package/dist/modules/manager/helmv3/artifacts.js +0 -1
  403. package/dist/modules/manager/helmv3/artifacts.js.map +1 -1
  404. package/dist/modules/manager/helmv3/utils.js +3 -1
  405. package/dist/modules/manager/helmv3/utils.js.map +1 -1
  406. package/dist/modules/manager/hermit/artifacts.js +0 -1
  407. package/dist/modules/manager/hermit/artifacts.js.map +1 -1
  408. package/dist/modules/manager/homebrew/extract.js +0 -1
  409. package/dist/modules/manager/homebrew/extract.js.map +1 -1
  410. package/dist/modules/manager/jsonnet-bundler/artifacts.js +0 -1
  411. package/dist/modules/manager/jsonnet-bundler/artifacts.js.map +1 -1
  412. package/dist/modules/manager/kustomize/artifacts.d.ts +2 -0
  413. package/dist/modules/manager/kustomize/artifacts.js +154 -0
  414. package/dist/modules/manager/kustomize/artifacts.js.map +1 -0
  415. package/dist/modules/manager/kustomize/common.d.ts +3 -0
  416. package/dist/modules/manager/kustomize/common.js +22 -0
  417. package/dist/modules/manager/kustomize/common.js.map +1 -0
  418. package/dist/modules/manager/kustomize/index.d.ts +1 -0
  419. package/dist/modules/manager/kustomize/index.js +3 -1
  420. package/dist/modules/manager/kustomize/index.js.map +1 -1
  421. package/dist/modules/manager/kustomize/types.d.ts +4 -0
  422. package/dist/modules/manager/kustomize/types.js.map +1 -1
  423. package/dist/modules/manager/maven/extract.d.ts +2 -2
  424. package/dist/modules/manager/maven/extract.js +14 -9
  425. package/dist/modules/manager/maven/extract.js.map +1 -1
  426. package/dist/modules/manager/maven-wrapper/artifacts.js +0 -1
  427. package/dist/modules/manager/maven-wrapper/artifacts.js.map +1 -1
  428. package/dist/modules/manager/mise/extract.js +1 -1
  429. package/dist/modules/manager/mise/extract.js.map +1 -1
  430. package/dist/modules/manager/mix/artifacts.js +64 -14
  431. package/dist/modules/manager/mix/artifacts.js.map +1 -1
  432. package/dist/modules/manager/mix/index.d.ts +1 -0
  433. package/dist/modules/manager/mix/index.js +2 -1
  434. package/dist/modules/manager/mix/index.js.map +1 -1
  435. package/dist/modules/manager/nix/artifacts.js +0 -1
  436. package/dist/modules/manager/nix/artifacts.js.map +1 -1
  437. package/dist/modules/manager/nix/extract.js +1 -1
  438. package/dist/modules/manager/nix/extract.js.map +1 -1
  439. package/dist/modules/manager/nix/schema.d.ts +20 -20
  440. package/dist/modules/manager/nix/schema.js +1 -0
  441. package/dist/modules/manager/nix/schema.js.map +1 -1
  442. package/dist/modules/manager/npm/artifacts.js +0 -1
  443. package/dist/modules/manager/npm/artifacts.js.map +1 -1
  444. package/dist/modules/manager/npm/extract/common/package-file.js +1 -0
  445. package/dist/modules/manager/npm/extract/common/package-file.js.map +1 -1
  446. package/dist/modules/manager/npm/extract/yarn.js +2 -2
  447. package/dist/modules/manager/npm/extract/yarn.js.map +1 -1
  448. package/dist/modules/manager/npm/post-update/npm.js +0 -1
  449. package/dist/modules/manager/npm/post-update/npm.js.map +1 -1
  450. package/dist/modules/manager/npm/post-update/pnpm.js +13 -2
  451. package/dist/modules/manager/npm/post-update/pnpm.js.map +1 -1
  452. package/dist/modules/manager/npm/post-update/rules.js +11 -1
  453. package/dist/modules/manager/npm/post-update/rules.js.map +1 -1
  454. package/dist/modules/manager/npm/post-update/yarn.js +0 -1
  455. package/dist/modules/manager/npm/post-update/yarn.js.map +1 -1
  456. package/dist/modules/manager/npm/schema.d.ts +13 -13
  457. package/dist/modules/manager/npm/update/dependency/index.js +1 -1
  458. package/dist/modules/manager/npm/update/dependency/index.js.map +1 -1
  459. package/dist/modules/manager/nuget/artifacts.js +1 -2
  460. package/dist/modules/manager/nuget/artifacts.js.map +1 -1
  461. package/dist/modules/manager/nuget/extract.js +21 -18
  462. package/dist/modules/manager/nuget/extract.js.map +1 -1
  463. package/dist/modules/manager/nuget/package-tree.js +4 -0
  464. package/dist/modules/manager/nuget/package-tree.js.map +1 -1
  465. package/dist/modules/manager/nuget/schema.d.ts +8 -8
  466. package/dist/modules/manager/nuget/util.js +4 -1
  467. package/dist/modules/manager/nuget/util.js.map +1 -1
  468. package/dist/modules/manager/ocb/schema.d.ts +6 -6
  469. package/dist/modules/manager/pep621/extract.js +19 -3
  470. package/dist/modules/manager/pep621/extract.js.map +1 -1
  471. package/dist/modules/manager/pep621/processors/pdm.js +3 -2
  472. package/dist/modules/manager/pep621/processors/pdm.js.map +1 -1
  473. package/dist/modules/manager/pep621/processors/uv.js +4 -1
  474. package/dist/modules/manager/pep621/processors/uv.js.map +1 -1
  475. package/dist/modules/manager/pep621/schema.d.ts +341 -49
  476. package/dist/modules/manager/pep621/schema.js +3 -1
  477. package/dist/modules/manager/pep621/schema.js.map +1 -1
  478. package/dist/modules/manager/pep621/utils.js +1 -1
  479. package/dist/modules/manager/pep621/utils.js.map +1 -1
  480. package/dist/modules/manager/pip-compile/common.js +0 -1
  481. package/dist/modules/manager/pip-compile/common.js.map +1 -1
  482. package/dist/modules/manager/pip_requirements/artifacts.js +0 -1
  483. package/dist/modules/manager/pip_requirements/artifacts.js.map +1 -1
  484. package/dist/modules/manager/pip_requirements/common.js +2 -6
  485. package/dist/modules/manager/pip_requirements/common.js.map +1 -1
  486. package/dist/modules/manager/pipenv/artifacts.js +0 -1
  487. package/dist/modules/manager/pipenv/artifacts.js.map +1 -1
  488. package/dist/modules/manager/pixi/artifacts.d.ts +3 -0
  489. package/dist/modules/manager/pixi/artifacts.js +78 -0
  490. package/dist/modules/manager/pixi/artifacts.js.map +1 -0
  491. package/dist/modules/manager/pixi/extract.d.ts +4 -0
  492. package/dist/modules/manager/pixi/extract.js +131 -0
  493. package/dist/modules/manager/pixi/extract.js.map +1 -0
  494. package/dist/modules/manager/pixi/index.d.ts +10 -0
  495. package/dist/modules/manager/pixi/index.js +20 -0
  496. package/dist/modules/manager/pixi/index.js.map +1 -0
  497. package/dist/modules/manager/pixi/schema.d.ts +405 -0
  498. package/dist/modules/manager/pixi/schema.js +147 -0
  499. package/dist/modules/manager/pixi/schema.js.map +1 -0
  500. package/dist/modules/manager/poetry/artifacts.js +3 -4
  501. package/dist/modules/manager/poetry/artifacts.js.map +1 -1
  502. package/dist/modules/manager/poetry/extract.js +2 -1
  503. package/dist/modules/manager/poetry/extract.js.map +1 -1
  504. package/dist/modules/manager/poetry/schema.d.ts +44 -44
  505. package/dist/modules/manager/pub/artifacts.js +0 -1
  506. package/dist/modules/manager/pub/artifacts.js.map +1 -1
  507. package/dist/modules/manager/pub/schema.d.ts +8 -8
  508. package/dist/modules/manager/scalafmt/extract.js +1 -1
  509. package/dist/modules/manager/scalafmt/extract.js.map +1 -1
  510. package/dist/modules/manager/sveltos/schema.d.ts +30 -42
  511. package/dist/modules/manager/terraform/lockfile/hash.d.ts +1 -1
  512. package/dist/modules/manager/terraform/util.js +1 -3
  513. package/dist/modules/manager/terraform/util.js.map +1 -1
  514. package/dist/modules/manager/types.d.ts +6 -2
  515. package/dist/modules/manager/types.js.map +1 -1
  516. package/dist/modules/manager/vendir/schema.d.ts +7 -7
  517. package/dist/modules/platform/api.d.ts +1 -1
  518. package/dist/modules/platform/azure/azure-helper.js +2 -2
  519. package/dist/modules/platform/azure/azure-helper.js.map +1 -1
  520. package/dist/modules/platform/azure/index.js +14 -14
  521. package/dist/modules/platform/azure/index.js.map +1 -1
  522. package/dist/modules/platform/bitbucket/comments.js +4 -4
  523. package/dist/modules/platform/bitbucket/comments.js.map +1 -1
  524. package/dist/modules/platform/bitbucket/index.js +49 -44
  525. package/dist/modules/platform/bitbucket/index.js.map +1 -1
  526. package/dist/modules/platform/bitbucket/schema.d.ts +14 -14
  527. package/dist/modules/platform/bitbucket/utils.js +3 -3
  528. package/dist/modules/platform/bitbucket/utils.js.map +1 -1
  529. package/dist/modules/platform/bitbucket-server/index.d.ts +2 -2
  530. package/dist/modules/platform/bitbucket-server/index.js +81 -81
  531. package/dist/modules/platform/bitbucket-server/index.js.map +1 -1
  532. package/dist/modules/platform/bitbucket-server/pr-cache.d.ts +23 -0
  533. package/dist/modules/platform/bitbucket-server/pr-cache.js +125 -0
  534. package/dist/modules/platform/bitbucket-server/pr-cache.js.map +1 -0
  535. package/dist/modules/platform/bitbucket-server/schema.d.ts +76 -0
  536. package/dist/modules/platform/bitbucket-server/schema.js +15 -1
  537. package/dist/modules/platform/bitbucket-server/schema.js.map +1 -1
  538. package/dist/modules/platform/bitbucket-server/types.d.ts +8 -2
  539. package/dist/modules/platform/bitbucket-server/types.js.map +1 -1
  540. package/dist/modules/platform/bitbucket-server/utils.d.ts +0 -2
  541. package/dist/modules/platform/bitbucket-server/utils.js +6 -52
  542. package/dist/modules/platform/bitbucket-server/utils.js.map +1 -1
  543. package/dist/modules/platform/codecommit/codecommit-client.js +6 -6
  544. package/dist/modules/platform/codecommit/codecommit-client.js.map +1 -1
  545. package/dist/modules/platform/codecommit/index.js +24 -24
  546. package/dist/modules/platform/codecommit/index.js.map +1 -1
  547. package/dist/modules/platform/gerrit/client.d.ts +0 -3
  548. package/dist/modules/platform/gerrit/client.js +20 -29
  549. package/dist/modules/platform/gerrit/client.js.map +1 -1
  550. package/dist/modules/platform/gerrit/index.js +0 -6
  551. package/dist/modules/platform/gerrit/index.js.map +1 -1
  552. package/dist/modules/platform/gerrit/scm.js +5 -6
  553. package/dist/modules/platform/gerrit/scm.js.map +1 -1
  554. package/dist/modules/platform/gerrit/types.d.ts +1 -4
  555. package/dist/modules/platform/gerrit/types.js.map +1 -1
  556. package/dist/modules/platform/gerrit/utils.d.ts +3 -2
  557. package/dist/modules/platform/gerrit/utils.js +4 -8
  558. package/dist/modules/platform/gerrit/utils.js.map +1 -1
  559. package/dist/modules/platform/gitea/gitea-helper.d.ts +1 -0
  560. package/dist/modules/platform/gitea/gitea-helper.js +16 -0
  561. package/dist/modules/platform/gitea/gitea-helper.js.map +1 -1
  562. package/dist/modules/platform/gitea/index.js +22 -16
  563. package/dist/modules/platform/gitea/index.js.map +1 -1
  564. package/dist/modules/platform/gitea/schema.d.ts +8 -8
  565. package/dist/modules/platform/gitea/types.d.ts +1 -1
  566. package/dist/modules/platform/gitea/types.js.map +1 -1
  567. package/dist/modules/platform/github/common.d.ts +2 -0
  568. package/dist/modules/platform/github/common.js +16 -0
  569. package/dist/modules/platform/github/common.js.map +1 -1
  570. package/dist/modules/platform/github/index.d.ts +1 -1
  571. package/dist/modules/platform/github/index.js +87 -82
  572. package/dist/modules/platform/github/index.js.map +1 -1
  573. package/dist/modules/platform/github/issue.d.ts +18 -18
  574. package/dist/modules/platform/github/massage-markdown-links.js +2 -2
  575. package/dist/modules/platform/github/massage-markdown-links.js.map +1 -1
  576. package/dist/modules/platform/github/pr.js +3 -3
  577. package/dist/modules/platform/github/pr.js.map +1 -1
  578. package/dist/modules/platform/github/schema.d.ts +128 -128
  579. package/dist/modules/platform/github/schema.js +3 -1
  580. package/dist/modules/platform/github/schema.js.map +1 -1
  581. package/dist/modules/platform/gitlab/index.js +63 -49
  582. package/dist/modules/platform/gitlab/index.js.map +1 -1
  583. package/dist/modules/platform/index.js +0 -1
  584. package/dist/modules/platform/index.js.map +1 -1
  585. package/dist/modules/platform/scm.d.ts +1 -1
  586. package/dist/modules/versioning/api.js +2 -0
  587. package/dist/modules/versioning/api.js.map +1 -1
  588. package/dist/modules/versioning/composer/index.js +10 -0
  589. package/dist/modules/versioning/composer/index.js.map +1 -1
  590. package/dist/modules/versioning/conda/index.d.ts +41 -0
  591. package/dist/modules/versioning/conda/index.js +178 -0
  592. package/dist/modules/versioning/conda/index.js.map +1 -0
  593. package/dist/modules/versioning/distro.js +1 -3
  594. package/dist/modules/versioning/distro.js.map +1 -1
  595. package/dist/modules/versioning/hashicorp/convertor.d.ts +2 -1
  596. package/dist/modules/versioning/hashicorp/convertor.js +13 -8
  597. package/dist/modules/versioning/hashicorp/convertor.js.map +1 -1
  598. package/dist/modules/versioning/hex/index.js +3 -3
  599. package/dist/modules/versioning/hex/index.js.map +1 -1
  600. package/dist/modules/versioning/npm/index.js +2 -1
  601. package/dist/modules/versioning/npm/index.js.map +1 -1
  602. package/dist/modules/versioning/types.d.ts +4 -0
  603. package/dist/modules/versioning/types.js.map +1 -1
  604. package/dist/proxy.js +2 -1
  605. package/dist/proxy.js.map +1 -1
  606. package/dist/renovate.js +2 -2
  607. package/dist/renovate.js.map +1 -1
  608. package/dist/util/cache/package/redis.js +0 -1
  609. package/dist/util/cache/package/redis.js.map +1 -1
  610. package/dist/util/cache/package/types.d.ts +1 -1
  611. package/dist/util/cache/package/types.js.map +1 -1
  612. package/dist/util/cache/repository/impl/base.d.ts +1 -1
  613. package/dist/util/cache/repository/impl/base.js +4 -0
  614. package/dist/util/cache/repository/impl/base.js.map +1 -1
  615. package/dist/util/cache/repository/schema.d.ts +4 -4
  616. package/dist/util/cache/repository/types.d.ts +3 -0
  617. package/dist/util/cache/repository/types.js.map +1 -1
  618. package/dist/util/common.d.ts +4 -2
  619. package/dist/util/common.js +17 -3
  620. package/dist/util/common.js.map +1 -1
  621. package/dist/util/env.d.ts +4 -0
  622. package/dist/util/env.js +22 -0
  623. package/dist/util/env.js.map +1 -0
  624. package/dist/util/exec/containerbase.js +19 -14
  625. package/dist/util/exec/containerbase.js.map +1 -1
  626. package/dist/util/exec/index.js +5 -2
  627. package/dist/util/exec/index.js.map +1 -1
  628. package/dist/util/exec/types.d.ts +0 -2
  629. package/dist/util/exec/types.js.map +1 -1
  630. package/dist/util/exec/utils.d.ts +1 -1
  631. package/dist/util/exec/utils.js +6 -5
  632. package/dist/util/exec/utils.js.map +1 -1
  633. package/dist/util/git/auth.js +8 -5
  634. package/dist/util/git/auth.js.map +1 -1
  635. package/dist/util/git/author.js +1 -1
  636. package/dist/util/git/author.js.map +1 -1
  637. package/dist/util/git/config.js +0 -1
  638. package/dist/util/git/config.js.map +1 -1
  639. package/dist/util/git/error.js +4 -2
  640. package/dist/util/git/error.js.map +1 -1
  641. package/dist/util/git/index.js +75 -52
  642. package/dist/util/git/index.js.map +1 -1
  643. package/dist/util/git/private-key.js +2 -4
  644. package/dist/util/git/private-key.js.map +1 -1
  645. package/dist/util/git/types.d.ts +2 -0
  646. package/dist/util/git/types.js.map +1 -1
  647. package/dist/util/git/url.js +1 -1
  648. package/dist/util/git/url.js.map +1 -1
  649. package/dist/util/github/graphql/datasource-fetcher.js +3 -5
  650. package/dist/util/github/graphql/datasource-fetcher.js.map +1 -1
  651. package/dist/util/github/graphql/query-adapters/releases-query-adapter.d.ts +2 -2
  652. package/dist/util/github/graphql/query-adapters/tags-query-adapter.d.ts +2 -2
  653. package/dist/util/http/auth.js +0 -1
  654. package/dist/util/http/auth.js.map +1 -1
  655. package/dist/util/http/bitbucket-server.d.ts +7 -5
  656. package/dist/util/http/bitbucket-server.js +26 -23
  657. package/dist/util/http/bitbucket-server.js.map +1 -1
  658. package/dist/util/http/bitbucket.d.ts +6 -5
  659. package/dist/util/http/bitbucket.js +34 -31
  660. package/dist/util/http/bitbucket.js.map +1 -1
  661. package/dist/util/http/cache/abstract-http-cache-provider.js +2 -2
  662. package/dist/util/http/cache/abstract-http-cache-provider.js.map +1 -1
  663. package/dist/util/http/cache/memory-http-cache-provider.d.ts +10 -0
  664. package/dist/util/http/cache/memory-http-cache-provider.js +29 -0
  665. package/dist/util/http/cache/memory-http-cache-provider.js.map +1 -0
  666. package/dist/util/http/cache/package-http-cache-provider.d.ts +23 -0
  667. package/dist/util/http/cache/package-http-cache-provider.js +80 -0
  668. package/dist/util/http/cache/package-http-cache-provider.js.map +1 -0
  669. package/dist/util/http/cache/schema.d.ts +2 -2
  670. package/dist/util/http/errors.d.ts +2 -0
  671. package/dist/util/http/errors.js +8 -0
  672. package/dist/util/http/errors.js.map +1 -0
  673. package/dist/util/http/gerrit.d.ts +6 -4
  674. package/dist/util/http/gerrit.js +11 -12
  675. package/dist/util/http/gerrit.js.map +1 -1
  676. package/dist/util/http/gitea.d.ts +5 -4
  677. package/dist/util/http/gitea.js +14 -13
  678. package/dist/util/http/gitea.js.map +1 -1
  679. package/dist/util/http/github.d.ts +14 -8
  680. package/dist/util/http/github.js +65 -60
  681. package/dist/util/http/github.js.map +1 -1
  682. package/dist/util/http/gitlab.d.ts +7 -5
  683. package/dist/util/http/gitlab.js +58 -46
  684. package/dist/util/http/gitlab.js.map +1 -1
  685. package/dist/util/http/got.d.ts +9 -0
  686. package/dist/util/http/got.js +54 -0
  687. package/dist/util/http/got.js.map +1 -0
  688. package/dist/util/http/host-rules.d.ts +2 -1
  689. package/dist/util/http/host-rules.js +17 -4
  690. package/dist/util/http/host-rules.js.map +1 -1
  691. package/dist/util/http/http.d.ts +93 -0
  692. package/dist/util/http/http.js +346 -0
  693. package/dist/util/http/http.js.map +1 -0
  694. package/dist/util/http/index.d.ts +6 -74
  695. package/dist/util/http/index.js +5 -359
  696. package/dist/util/http/index.js.map +1 -1
  697. package/dist/util/http/legacy.js +4 -1
  698. package/dist/util/http/legacy.js.map +1 -1
  699. package/dist/util/http/types.d.ts +9 -16
  700. package/dist/util/http/types.js.map +1 -1
  701. package/dist/util/schema-utils.d.ts +1 -0
  702. package/dist/util/schema-utils.js +43 -8
  703. package/dist/util/schema-utils.js.map +1 -1
  704. package/dist/util/stats.d.ts +10 -0
  705. package/dist/util/stats.js +45 -1
  706. package/dist/util/stats.js.map +1 -1
  707. package/dist/util/string.d.ts +16 -0
  708. package/dist/util/string.js +79 -0
  709. package/dist/util/string.js.map +1 -1
  710. package/dist/util/toml.d.ts +1 -0
  711. package/dist/util/toml.js +6 -0
  712. package/dist/util/toml.js.map +1 -1
  713. package/dist/util/url.js +3 -8
  714. package/dist/util/url.js.map +1 -1
  715. package/dist/util/yaml.js +3 -8
  716. package/dist/util/yaml.js.map +1 -1
  717. package/dist/workers/global/autodiscover.js +1 -19
  718. package/dist/workers/global/autodiscover.js.map +1 -1
  719. package/dist/workers/global/config/parse/env.js +3 -3
  720. package/dist/workers/global/config/parse/env.js.map +1 -1
  721. package/dist/workers/global/config/parse/file.js +18 -8
  722. package/dist/workers/global/config/parse/file.js.map +1 -1
  723. package/dist/workers/global/config/parse/host-rules-from-env.js +6 -2
  724. package/dist/workers/global/config/parse/host-rules-from-env.js.map +1 -1
  725. package/dist/workers/global/config/parse/index.js +15 -0
  726. package/dist/workers/global/config/parse/index.js.map +1 -1
  727. package/dist/workers/global/index.js +4 -2
  728. package/dist/workers/global/index.js.map +1 -1
  729. package/dist/workers/repository/cache.js +1 -2
  730. package/dist/workers/repository/cache.js.map +1 -1
  731. package/dist/workers/repository/config-migration/branch/migrated-data.js +2 -0
  732. package/dist/workers/repository/config-migration/branch/migrated-data.js.map +1 -1
  733. package/dist/workers/repository/index.js +1 -0
  734. package/dist/workers/repository/index.js.map +1 -1
  735. package/dist/workers/repository/init/merge.js +6 -3
  736. package/dist/workers/repository/init/merge.js.map +1 -1
  737. package/dist/workers/repository/onboarding/pr/config-description.js +3 -1
  738. package/dist/workers/repository/onboarding/pr/config-description.js.map +1 -1
  739. package/dist/workers/repository/onboarding/pr/index.js +4 -0
  740. package/dist/workers/repository/onboarding/pr/index.js.map +1 -1
  741. package/dist/workers/repository/process/extract-update.js +0 -1
  742. package/dist/workers/repository/process/extract-update.js.map +1 -1
  743. package/dist/workers/repository/process/fingerprint-fields.js +0 -1
  744. package/dist/workers/repository/process/fingerprint-fields.js.map +1 -1
  745. package/dist/workers/repository/process/libyear.js +2 -2
  746. package/dist/workers/repository/process/libyear.js.map +1 -1
  747. package/dist/workers/repository/process/lookup/index.js +15 -4
  748. package/dist/workers/repository/process/lookup/index.js.map +1 -1
  749. package/dist/workers/repository/process/lookup/timestamps.d.ts +18 -0
  750. package/dist/workers/repository/process/lookup/timestamps.js +69 -0
  751. package/dist/workers/repository/process/lookup/timestamps.js.map +1 -0
  752. package/dist/workers/repository/process/lookup/types.d.ts +1 -0
  753. package/dist/workers/repository/process/lookup/types.js.map +1 -1
  754. package/dist/workers/repository/process/lookup/utils.js +20 -9
  755. package/dist/workers/repository/process/lookup/utils.js.map +1 -1
  756. package/dist/workers/repository/process/sort.js +1 -1
  757. package/dist/workers/repository/process/sort.js.map +1 -1
  758. package/dist/workers/repository/process/vulnerabilities.js +1 -1
  759. package/dist/workers/repository/process/vulnerabilities.js.map +1 -1
  760. package/dist/workers/repository/process/write.js +1 -8
  761. package/dist/workers/repository/process/write.js.map +1 -1
  762. package/dist/workers/repository/reconfigure/utils.d.ts +2 -0
  763. package/dist/workers/repository/reconfigure/utils.js +16 -0
  764. package/dist/workers/repository/reconfigure/utils.js.map +1 -1
  765. package/dist/workers/repository/reconfigure/validate.js +6 -17
  766. package/dist/workers/repository/reconfigure/validate.js.map +1 -1
  767. package/dist/workers/repository/update/branch/auto-replace.js +25 -5
  768. package/dist/workers/repository/update/branch/auto-replace.js.map +1 -1
  769. package/dist/workers/repository/update/branch/commit.js +2 -0
  770. package/dist/workers/repository/update/branch/commit.js.map +1 -1
  771. package/dist/workers/repository/update/branch/execute-post-upgrade-commands.js +17 -8
  772. package/dist/workers/repository/update/branch/execute-post-upgrade-commands.js.map +1 -1
  773. package/dist/workers/repository/update/pr/body/config-description.js +26 -1
  774. package/dist/workers/repository/update/pr/body/config-description.js.map +1 -1
  775. package/dist/workers/repository/update/pr/body/index.js +21 -14
  776. package/dist/workers/repository/update/pr/body/index.js.map +1 -1
  777. package/dist/workers/repository/update/pr/changelog/api.js +8 -6
  778. package/dist/workers/repository/update/pr/changelog/api.js.map +1 -1
  779. package/dist/workers/repository/update/pr/changelog/bitbucket/index.js +1 -1
  780. package/dist/workers/repository/update/pr/changelog/bitbucket/index.js.map +1 -1
  781. package/dist/workers/repository/update/pr/changelog/bitbucket-server/index.d.ts +3 -0
  782. package/dist/workers/repository/update/pr/changelog/bitbucket-server/index.js +39 -0
  783. package/dist/workers/repository/update/pr/changelog/bitbucket-server/index.js.map +1 -0
  784. package/dist/workers/repository/update/pr/changelog/bitbucket-server/source.d.ts +8 -0
  785. package/dist/workers/repository/update/pr/changelog/bitbucket-server/source.js +31 -0
  786. package/dist/workers/repository/update/pr/changelog/bitbucket-server/source.js.map +1 -0
  787. package/dist/workers/repository/update/pr/changelog/github/index.js +6 -3
  788. package/dist/workers/repository/update/pr/changelog/github/index.js.map +1 -1
  789. package/dist/workers/repository/update/pr/changelog/gitlab/index.js +1 -1
  790. package/dist/workers/repository/update/pr/changelog/gitlab/index.js.map +1 -1
  791. package/dist/workers/repository/update/pr/changelog/release-notes.js +12 -8
  792. package/dist/workers/repository/update/pr/changelog/release-notes.js.map +1 -1
  793. package/dist/workers/repository/update/pr/changelog/source.d.ts +1 -1
  794. package/dist/workers/repository/update/pr/changelog/source.js +1 -0
  795. package/dist/workers/repository/update/pr/changelog/source.js.map +1 -1
  796. package/dist/workers/repository/update/pr/changelog/types.d.ts +1 -1
  797. package/dist/workers/repository/update/pr/changelog/types.js.map +1 -1
  798. package/dist/workers/repository/update/pr/index.js +2 -4
  799. package/dist/workers/repository/update/pr/index.js.map +1 -1
  800. package/dist/workers/repository/updates/flatten.js +8 -4
  801. package/dist/workers/repository/updates/flatten.js.map +1 -1
  802. package/dist/workers/repository/updates/generate.js +3 -2
  803. package/dist/workers/repository/updates/generate.js.map +1 -1
  804. package/dist/workers/types.d.ts +1 -4
  805. package/dist/workers/types.js.map +1 -1
  806. package/package.json +86 -83
  807. package/renovate-schema.json +25 -10
  808. package/dist/modules/manager/github-actions/types.d.ts +0 -30
  809. package/dist/modules/manager/github-actions/types.js +0 -3
  810. package/dist/modules/manager/github-actions/types.js.map +0 -1
  811. package/dist/modules/manager/gitlabci/common.d.ts +0 -6
  812. package/dist/modules/manager/gitlabci/common.js +0 -30
  813. package/dist/modules/manager/gitlabci/common.js.map +0 -1
  814. package/dist/modules/manager/gitlabci/types.d.ts +0 -35
  815. package/dist/modules/manager/gitlabci/types.js +0 -3
  816. package/dist/modules/manager/gitlabci/types.js.map +0 -1
@@ -4,16 +4,14 @@ exports.downloadHttpProtocol = downloadHttpProtocol;
4
4
  exports.downloadHttpContent = downloadHttpContent;
5
5
  exports.downloadS3Protocol = downloadS3Protocol;
6
6
  exports.downloadArtifactRegistryProtocol = downloadArtifactRegistryProtocol;
7
- exports.checkS3Resource = checkS3Resource;
8
- exports.checkResource = checkResource;
9
7
  exports.getMavenUrl = getMavenUrl;
8
+ exports.downloadMaven = downloadMaven;
10
9
  exports.downloadMavenXml = downloadMavenXml;
11
10
  exports.getDependencyParts = getDependencyParts;
12
11
  exports.createUrlForDependencyPom = createUrlForDependencyPom;
13
12
  exports.getDependencyInfo = getDependencyInfo;
14
13
  const node_stream_1 = require("node:stream");
15
14
  const client_s3_1 = require("@aws-sdk/client-s3");
16
- const luxon_1 = require("luxon");
17
15
  const xmldoc_1 = require("xmldoc");
18
16
  const error_messages_1 = require("../../../constants/error-messages");
19
17
  const logger_1 = require("../../../logger");
@@ -28,7 +26,7 @@ const url_1 = require("../../../util/url");
28
26
  const util_1 = require("../util");
29
27
  const common_1 = require("./common");
30
28
  function getHost(url) {
31
- return (0, url_1.parseUrl)(url)?.host ?? /* istanbul ignore next: not possible */ null;
29
+ return (0, url_1.parseUrl)(url)?.host;
32
30
  }
33
31
  function isTemporaryError(err) {
34
32
  if (err.code === 'ECONNRESET') {
@@ -60,7 +58,7 @@ function isUnsupportedHostError(err) {
60
58
  }
61
59
  async function downloadHttpProtocol(http, pkgUrl, opts = {}) {
62
60
  const url = pkgUrl.toString();
63
- const fetchResult = await result_1.Result.wrap(http.get(url, opts))
61
+ const fetchResult = await result_1.Result.wrap(http.getText(url, opts))
64
62
  .transform((res) => {
65
63
  const result = { data: res.body };
66
64
  if (!res.authorization) {
@@ -73,10 +71,10 @@ async function downloadHttpProtocol(http, pkgUrl, opts = {}) {
73
71
  return result;
74
72
  })
75
73
  .catch((err) => {
76
- // istanbul ignore next: never happens, needs for type narrowing
74
+ /* v8 ignore start: never happens, needs for type narrowing */
77
75
  if (!(err instanceof http_1.HttpError)) {
78
76
  return result_1.Result.err({ type: 'unknown', err });
79
- }
77
+ } /* v8 ignore stop */
80
78
  const failedUrl = url;
81
79
  if (err.message === error_messages_1.HOST_DISABLED) {
82
80
  logger_1.logger.trace({ failedUrl }, 'Host disabled');
@@ -191,105 +189,43 @@ async function downloadArtifactRegistryProtocol(http, pkgUrl) {
191
189
  const url = pkgUrl.toString().replace('artifactregistry:', 'https:');
192
190
  return downloadHttpProtocol(http, url, opts);
193
191
  }
194
- async function checkHttpResource(http, pkgUrl) {
195
- try {
196
- const res = await http.head(pkgUrl.toString());
197
- const timestamp = res?.headers?.['last-modified'];
198
- if (timestamp) {
199
- const isoTimestamp = (0, timestamp_1.asTimestamp)(timestamp);
200
- if (isoTimestamp) {
201
- const releaseDate = luxon_1.DateTime.fromISO(isoTimestamp, {
202
- zone: 'UTC',
203
- }).toJSDate();
204
- return releaseDate;
205
- }
206
- }
207
- return 'found';
208
- }
209
- catch (err) {
210
- if (isNotFoundError(err)) {
211
- return 'not-found';
212
- }
213
- const failedUrl = pkgUrl.toString();
214
- logger_1.logger.debug({ failedUrl, statusCode: err.statusCode }, `Can't check HTTP resource existence`);
215
- return 'error';
216
- }
217
- }
218
- async function checkS3Resource(s3Url) {
219
- try {
220
- const response = await (0, s3_1.getS3Client)().send(new client_s3_1.HeadObjectCommand(s3Url));
221
- if (response.DeleteMarker) {
222
- return 'not-found';
223
- }
224
- if (response.LastModified) {
225
- return response.LastModified;
226
- }
227
- return 'found';
228
- }
229
- catch (err) {
230
- if (isS3NotFound(err)) {
231
- return 'not-found';
232
- }
233
- else {
234
- logger_1.logger.debug({
235
- bucket: s3Url.Bucket,
236
- key: s3Url.Key,
237
- name: err.name,
238
- message: err.message,
239
- }, `Can't check S3 resource existence`);
240
- }
241
- return 'error';
242
- }
243
- }
244
- async function checkResource(http, pkgUrl) {
245
- const parsedUrl = typeof pkgUrl === 'string' ? (0, url_1.parseUrl)(pkgUrl) : pkgUrl;
246
- if (parsedUrl === null) {
247
- return 'error';
248
- }
249
- const s3Url = (0, s3_1.parseS3Url)(parsedUrl);
250
- if (s3Url) {
251
- return await checkS3Resource(s3Url);
252
- }
253
- if (parsedUrl.protocol === 'http:' || parsedUrl.protocol === 'https:') {
254
- return await checkHttpResource(http, parsedUrl);
255
- }
256
- logger_1.logger.debug({ url: pkgUrl.toString() }, `Unsupported Maven protocol in check resource`);
257
- return 'not-found';
258
- }
259
192
  function containsPlaceholder(str) {
260
193
  return (0, regex_1.regEx)(/\${.*?}/g).test(str);
261
194
  }
262
195
  function getMavenUrl(dependency, repoUrl, path) {
263
196
  return new URL(`${dependency.dependencyUrl}/${path}`, (0, url_1.ensureTrailingSlash)(repoUrl));
264
197
  }
265
- async function downloadMavenXml(http, pkgUrl) {
266
- const protocol = pkgUrl.protocol;
267
- if (protocol === 'http:' || protocol === 'https:') {
268
- const rawResult = await downloadHttpProtocol(http, pkgUrl);
269
- const xmlResult = rawResult.transform(({ isCacheable, data }) => {
270
- const xml = new xmldoc_1.XmlDocument(data);
271
- return { isCacheable, xml };
272
- });
273
- return xmlResult.unwrapOr({});
198
+ async function downloadMaven(http, url) {
199
+ const protocol = url.protocol;
200
+ let result = result_1.Result.err({ type: 'unsupported-protocol' });
201
+ if ((0, url_1.isHttpUrl)(url)) {
202
+ result = await downloadHttpProtocol(http, url);
274
203
  }
275
204
  if (protocol === 'artifactregistry:') {
276
- const rawResult = await downloadArtifactRegistryProtocol(http, pkgUrl);
277
- const xmlResult = rawResult.transform(({ isCacheable, data }) => {
278
- const xml = new xmldoc_1.XmlDocument(data);
279
- return { isCacheable, xml };
280
- });
281
- return xmlResult.unwrapOr({});
205
+ result = await downloadArtifactRegistryProtocol(http, url);
282
206
  }
283
207
  if (protocol === 's3:') {
284
- const rawResult = await downloadS3Protocol(pkgUrl);
285
- const xmlResult = rawResult.transform(({ isCacheable, data }) => {
286
- const xml = new xmldoc_1.XmlDocument(data);
287
- return { xml };
288
- });
289
- return xmlResult.unwrapOr({});
208
+ result = await downloadS3Protocol(url);
290
209
  }
291
- logger_1.logger.debug({ url: pkgUrl.toString() }, `Content is not found for Maven url`);
292
- return {};
210
+ return result.onError((err) => {
211
+ if (err.type === 'unsupported-protocol') {
212
+ logger_1.logger.debug({ url: url.toString() }, `Maven lookup error: unsupported protocol (${protocol})`);
213
+ }
214
+ });
215
+ }
216
+ async function downloadMavenXml(http, url) {
217
+ const rawResult = await downloadMaven(http, url);
218
+ return rawResult.transform((result) => {
219
+ try {
220
+ return result_1.Result.ok({
221
+ ...result,
222
+ data: new xmldoc_1.XmlDocument(result.data),
223
+ });
224
+ }
225
+ catch (err) {
226
+ return result_1.Result.err({ type: 'xml-parse-error', err });
227
+ }
228
+ });
293
229
  }
294
230
  function getDependencyParts(packageName) {
295
231
  const [group, name] = packageName.split(':');
@@ -326,12 +262,12 @@ async function getSnapshotFullVersion(http, version, dependency, repoUrl) {
326
262
  // To determine what actual files are available for the snapshot, first we have to fetch and parse
327
263
  // the metadata located at http://<repo>/<group>/<artifact>/<version-SNAPSHOT>/maven-metadata.xml
328
264
  const metadataUrl = getMavenUrl(dependency, repoUrl, `${version}/maven-metadata.xml`);
329
- const { xml: mavenMetadata } = await downloadMavenXml(http, metadataUrl);
330
- // istanbul ignore if: hard to test
331
- if (!mavenMetadata) {
332
- return null;
333
- }
334
- return extractSnapshotVersion(mavenMetadata);
265
+ const metadataXmlResult = await downloadMavenXml(http, metadataUrl);
266
+ return metadataXmlResult
267
+ .transform(({ data }) => result_1.Result.wrapNullable(extractSnapshotVersion(data), {
268
+ type: 'snapshot-extract-error',
269
+ }))
270
+ .unwrapOrNull();
335
271
  }
336
272
  function isSnapshotVersion(version) {
337
273
  if (version.endsWith('-SNAPSHOT')) {
@@ -354,68 +290,69 @@ async function createUrlForDependencyPom(http, version, dependency, repoUrl) {
354
290
  return `${version}/${dependency.name}-${version}.pom`;
355
291
  }
356
292
  async function getDependencyInfo(http, dependency, repoUrl, version, recursionLimit = 5) {
357
- const result = {};
358
293
  const path = await createUrlForDependencyPom(http, version, dependency, repoUrl);
359
294
  const pomUrl = getMavenUrl(dependency, repoUrl, path);
360
- const { xml: pomContent } = await downloadMavenXml(http, pomUrl);
361
- // istanbul ignore if
362
- if (!pomContent) {
363
- return result;
364
- }
365
- const homepage = pomContent.valueWithPath('url');
366
- if (homepage && !containsPlaceholder(homepage)) {
367
- result.homepage = homepage;
368
- }
369
- const sourceUrl = pomContent.valueWithPath('scm.url');
370
- if (sourceUrl && !containsPlaceholder(sourceUrl)) {
371
- result.sourceUrl = sourceUrl
372
- .replace((0, regex_1.regEx)(/^scm:/), '')
373
- .replace((0, regex_1.regEx)(/^git:/), '')
374
- .replace((0, regex_1.regEx)(/^git@github.com:/), 'https://github.com/')
375
- .replace((0, regex_1.regEx)(/^git@github.com\//), 'https://github.com/');
376
- if (result.sourceUrl.startsWith('//')) {
377
- // most likely the result of us stripping scm:, git: etc
378
- // going with prepending https: here which should result in potential information retrival
379
- result.sourceUrl = `https:${result.sourceUrl}`;
295
+ const pomXmlResult = await downloadMavenXml(http, pomUrl);
296
+ const dependencyInfoResult = await pomXmlResult.transform(async ({ data: pomContent }) => {
297
+ const result = {};
298
+ const homepage = pomContent.valueWithPath('url');
299
+ if (homepage && !containsPlaceholder(homepage)) {
300
+ result.homepage = homepage;
380
301
  }
381
- }
382
- const relocation = pomContent.descendantWithPath('distributionManagement.relocation');
383
- if (relocation) {
384
- const relocationGroup = relocation.valueWithPath('groupId') ?? dependency.group;
385
- const relocationName = relocation.valueWithPath('artifactId') ?? dependency.name;
386
- result.replacementName = `${relocationGroup}:${relocationName}`;
387
- const relocationVersion = relocation.valueWithPath('version');
388
- result.replacementVersion = relocationVersion ?? version;
389
- const relocationMessage = relocation.valueWithPath('message');
390
- if (relocationMessage) {
391
- result.deprecationMessage = relocationMessage;
302
+ const sourceUrl = pomContent.valueWithPath('scm.url');
303
+ if (sourceUrl && !containsPlaceholder(sourceUrl)) {
304
+ result.sourceUrl = sourceUrl
305
+ .replace((0, regex_1.regEx)(/^scm:/), '')
306
+ .replace((0, regex_1.regEx)(/^git:/), '')
307
+ .replace((0, regex_1.regEx)(/^git@github.com:/), 'https://github.com/')
308
+ .replace((0, regex_1.regEx)(/^git@github.com\//), 'https://github.com/');
309
+ if (result.sourceUrl.startsWith('//')) {
310
+ // most likely the result of us stripping scm:, git: etc
311
+ // going with prepending https: here which should result in potential information retrival
312
+ result.sourceUrl = `https:${result.sourceUrl}`;
313
+ }
392
314
  }
393
- }
394
- const groupId = pomContent.valueWithPath('groupId');
395
- if (groupId) {
396
- result.packageScope = groupId;
397
- }
398
- const parent = pomContent.childNamed('parent');
399
- if (recursionLimit > 0 && parent && (!result.sourceUrl || !result.homepage)) {
400
- // if we found a parent and are missing some information
401
- // trying to get the scm/homepage information from it
402
- const [parentGroupId, parentArtifactId, parentVersion] = [
403
- 'groupId',
404
- 'artifactId',
405
- 'version',
406
- ].map((k) => parent.valueWithPath(k)?.replace(/\s+/g, ''));
407
- if (parentGroupId && parentArtifactId && parentVersion) {
408
- const parentDisplayId = `${parentGroupId}:${parentArtifactId}`;
409
- const parentDependency = getDependencyParts(parentDisplayId);
410
- const parentInformation = await getDependencyInfo(http, parentDependency, repoUrl, parentVersion, recursionLimit - 1);
411
- if (!result.sourceUrl && parentInformation.sourceUrl) {
412
- result.sourceUrl = parentInformation.sourceUrl;
315
+ const relocation = pomContent.descendantWithPath('distributionManagement.relocation');
316
+ if (relocation) {
317
+ const relocationGroup = relocation.valueWithPath('groupId') ?? dependency.group;
318
+ const relocationName = relocation.valueWithPath('artifactId') ?? dependency.name;
319
+ result.replacementName = `${relocationGroup}:${relocationName}`;
320
+ const relocationVersion = relocation.valueWithPath('version');
321
+ result.replacementVersion = relocationVersion ?? version;
322
+ const relocationMessage = relocation.valueWithPath('message');
323
+ if (relocationMessage) {
324
+ result.deprecationMessage = relocationMessage;
413
325
  }
414
- if (!result.homepage && parentInformation.homepage) {
415
- result.homepage = parentInformation.homepage;
326
+ }
327
+ const groupId = pomContent.valueWithPath('groupId');
328
+ if (groupId) {
329
+ result.packageScope = groupId;
330
+ }
331
+ const parent = pomContent.childNamed('parent');
332
+ if (recursionLimit > 0 &&
333
+ parent &&
334
+ (!result.sourceUrl || !result.homepage)) {
335
+ // if we found a parent and are missing some information
336
+ // trying to get the scm/homepage information from it
337
+ const [parentGroupId, parentArtifactId, parentVersion] = [
338
+ 'groupId',
339
+ 'artifactId',
340
+ 'version',
341
+ ].map((k) => parent.valueWithPath(k)?.replace(/\s+/g, ''));
342
+ if (parentGroupId && parentArtifactId && parentVersion) {
343
+ const parentDisplayId = `${parentGroupId}:${parentArtifactId}`;
344
+ const parentDependency = getDependencyParts(parentDisplayId);
345
+ const parentInformation = await getDependencyInfo(http, parentDependency, repoUrl, parentVersion, recursionLimit - 1);
346
+ if (!result.sourceUrl && parentInformation.sourceUrl) {
347
+ result.sourceUrl = parentInformation.sourceUrl;
348
+ }
349
+ if (!result.homepage && parentInformation.homepage) {
350
+ result.homepage = parentInformation.homepage;
351
+ }
416
352
  }
417
353
  }
418
- }
419
- return result;
354
+ return result;
355
+ });
356
+ return dependencyInfoResult.unwrapOr({});
420
357
  }
421
358
  //# sourceMappingURL=util.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"util.js","sourceRoot":"","sources":["../../../../lib/modules/datasource/maven/util.ts"],"names":[],"mappings":";;AAqEA,oDAiFC;AAED,kDAOC;AAMD,gDA+EC;AAED,4EAsBC;AAiCD,0CA4BC;AAED,sCAuBC;AAMD,kCASC;AAED,4CAsCC;AAED,gDASC;AAwDD,8DAyBC;AAED,8CA6FC;AAplBD,6CAAuC;AACvC,kDAAyE;AACzE,iCAAiC;AACjC,mCAAqC;AACrC,sEAAkE;AAClE,4CAAyC;AACzC,mFAA8E;AAC9E,6CAA0D;AAE1D,+CAA4C;AAC5C,iDAA8C;AAE9C,yCAA2D;AAC3D,mDAAuD;AACvD,uDAAsD;AACtD,2CAAkE;AAClE,kCAA6C;AAC7C,qCAAsC;AAUtC,SAAS,OAAO,CAAC,GAAW;IAC1B,OAAO,IAAA,cAAQ,EAAC,GAAG,CAAC,EAAE,IAAI,IAAI,wCAAwC,CAAC,IAAI,CAAC;AAC9E,CAAC;AAED,SAAS,gBAAgB,CAAC,GAAc;IACtC,IAAI,GAAG,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;QAC9B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,GAAG,CAAC,QAAQ,EAAE,CAAC;QACjB,MAAM,MAAM,GAAG,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC;QACvC,OAAO,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,IAAI,GAAG,IAAI,MAAM,GAAG,GAAG,CAAC,CAAC;IAC3D,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,WAAW,CAAC,GAAc;IACjC,OAAO,GAAG,CAAC,IAAI,KAAK,WAAW,CAAC;AAClC,CAAC;AAED,SAAS,eAAe,CAAC,GAAc;IACrC,OAAO,GAAG,CAAC,IAA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AE,gBAAgB,EAAE,aAAa,CAAC,GAAG;YACvD,SAAS;YACT,YAAY;YACZ,SAAS;SACV,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC;QAC3D,IAAI,aAAa,IAAI,gBAAgB,IAAI,aAAa,EAAE,CAAC;YACvD,MAAM,eAAe,GAAG,GAAG,aAAa,IAAI,gBAAgB,EAAE,CAAC;YAC/D,MAAM,gBAAgB,GAAG,kBAAkB,CAAC,eAAe,CAAC,CAAC;YAC7D,MAAM,iBAAiB,GAAG,MAAM,iBAAiB,CAC/C,IAAI,EACJ,gBAAgB,EAChB,OAAO,EACP,aAAa,EACb,cAAc,GAAG,CAAC,CACnB,CAAC;YACF,IAAI,CAAC,MAAM,CAAC,SAAS,IAAI,iBAAiB,CAAC,SAAS,EAAE,CAAC;gBACrD,MAAM,CAAC,SAAS,GAAG,iBAAiB,CAAC,SAAS,CAAC;YACjD,CAAC;YACD,IAAI,CAAC,MAAM,CAAC,QAAQ,IAAI,iBAAiB,CAAC,QAAQ,EAAE,CAAC;gBACnD,MAAM,CAAC,QAAQ,GAAG,iBAAiB,CAAC,QAAQ,CAAC;YAC/C,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import { Readable } from 'node:stream';\nimport { GetObjectCommand, HeadObjectCommand } from '@aws-sdk/client-s3';\nimport { DateTime } from 'luxon';\nimport { XmlDocument } from 'xmldoc';\nimport { HOST_DISABLED } from '../../../constants/error-messages';\nimport { logger } from '../../../logger';\nimport { ExternalHostError } from '../../../types/errors/external-host-error';\nimport { type Http, HttpError } from '../../../util/http';\nimport type { HttpOptions, HttpResponse } from '../../../util/http/types';\nimport { regEx } from '../../../util/regex';\nimport { Result } from '../../../util/result';\nimport type { S3UrlParts } from '../../../util/s3';\nimport { getS3Client, parseS3Url } from '../../../util/s3';\nimport { streamToString } from '../../../util/streams';\nimport { asTimestamp } from '../../../util/timestamp';\nimport { ensureTrailingSlash, parseUrl } from '../../../util/url';\nimport { getGoogleAuthToken } from '../util';\nimport { MAVEN_REPO } from './common';\nimport type {\n DependencyInfo,\n HttpResourceCheckResult,\n MavenDependency,\n MavenFetchResult,\n MavenFetchSuccess,\n MavenXml,\n} from './types';\n\nfunction getHost(url: string): string | null {\n return parseUrl(url)?.host ?? /* istanbul ignore next: not possible */ null;\n}\n\nfunction isTemporaryError(err: HttpError): boolean {\n if (err.code === 'ECONNRESET') {\n return true;\n }\n\n if (err.response) {\n const status = err.response.statusCode;\n return status === 429 || (status >= 500 && status < 600);\n }\n\n return false;\n}\n\nfunction isHostError(err: HttpError): boolean {\n return err.code === 'ETIMEDOUT';\n}\n\nfunction isNotFoundError(err: HttpError): boolean {\n return err.code === 'ENOTFOUND' || err.response?.statusCode === 404;\n}\n\nfunction isPermissionsIssue(err: HttpError): boolean {\n const status = err.response?.statusCode;\n return status === 401 || status === 403;\n}\n\nfunction isConnectionError(err: HttpError): boolean {\n return (\n err.code === 'EAI_AGAIN' ||\n err.code === 'ERR_TLS_CERT_ALTNAME_INVALID' ||\n err.code === 'ECONNREFUSED'\n );\n}\n\nfunction isUnsupportedHostError(err: HttpError): boolean {\n return err.name === 'UnsupportedProtocolError';\n}\n\nexport async function downloadHttpProtocol(\n http: Http,\n pkgUrl: URL | string,\n opts: HttpOptions = {},\n): Promise<MavenFetchResult> {\n const url = pkgUrl.toString();\n const fetchResult = await Result.wrap<HttpResponse, Error>(\n http.get(url, opts),\n )\n .transform((res): MavenFetchSuccess => {\n const result: MavenFetchSuccess = { data: res.body };\n\n if (!res.authorization) {\n result.isCacheable = true;\n }\n\n const lastModified = asTimestamp(res?.headers?.['last-modified']);\n if (lastModified) {\n result.lastModified = lastModified;\n }\n\n return result;\n })\n .catch((err): MavenFetchResult => {\n // istanbul ignore next: never happens, needs for type narrowing\n if (!(err instanceof HttpError)) {\n return Result.err({ type: 'unknown', err });\n }\n\n const failedUrl = url;\n if (err.message === HOST_DISABLED) {\n logger.trace({ failedUrl }, 'Host disabled');\n return Result.err({ type: 'host-disabled' });\n }\n\n if (isNotFoundError(err)) {\n logger.trace({ failedUrl }, `Url not found`);\n return Result.err({ type: 'not-found' });\n }\n\n if (isHostError(err)) {\n logger.debug(`Cannot connect to host ${failedUrl}`);\n return Result.err({ type: 'host-error' });\n }\n\n if (isPermissionsIssue(err)) {\n logger.debug(\n `Dependency lookup unauthorized. Please add authentication with a hostRule for ${failedUrl}`,\n );\n return Result.err({ type: 'permission-issue' });\n }\n\n if (isTemporaryError(err)) {\n logger.debug({ failedUrl, err }, 'Temporary error');\n if (getHost(url) === getHost(MAVEN_REPO)) {\n return Result.err({ type: 'maven-central-temporary-error', err });\n } else {\n return Result.err({ type: 'temporary-error' });\n }\n }\n\n if (isConnectionError(err)) {\n logger.debug(`Connection refused to maven registry ${failedUrl}`);\n return Result.err({ type: 'connection-error' });\n }\n\n if (isUnsupportedHostError(err)) {\n logger.debug(`Unsupported host ${failedUrl}`);\n return Result.err({ type: 'unsupported-host' });\n }\n\n logger.info({ failedUrl, err }, 'Unknown HTTP download error');\n return Result.err({ type: 'unknown', err });\n });\n\n const { err } = fetchResult.unwrap();\n if (err?.type === 'maven-central-temporary-error') {\n throw new ExternalHostError(err.err);\n }\n\n return fetchResult;\n}\n\nexport async function downloadHttpContent(\n http: Http,\n pkgUrl: URL | string,\n opts: HttpOptions = {},\n): Promise<string | null> {\n const fetchResult = await downloadHttpProtocol(http, pkgUrl, opts);\n return fetchResult.transform(({ data }) => data).unwrapOrNull();\n}\n\nfunction isS3NotFound(err: Error): boolean {\n return err.message === 'NotFound' || err.message === 'NoSuchKey';\n}\n\nexport async function downloadS3Protocol(\n pkgUrl: URL,\n): Promise<MavenFetchResult> {\n logger.trace({ url: pkgUrl.toString() }, `Attempting to load S3 dependency`);\n\n const s3Url = parseS3Url(pkgUrl);\n if (!s3Url) {\n return Result.err({ type: 'invalid-url' });\n }\n\n return await Result.wrap(() => {\n const command = new GetObjectCommand(s3Url);\n const client = getS3Client();\n return client.send(command);\n })\n .transform(\n async ({\n Body,\n LastModified,\n DeleteMarker,\n }): Promise<MavenFetchResult> => {\n if (DeleteMarker) {\n logger.trace(\n { failedUrl: pkgUrl.toString() },\n 'Maven S3 lookup error: DeleteMarker encountered',\n );\n return Result.err({ type: 'not-found' });\n }\n\n if (!(Body instanceof Readable)) {\n logger.debug(\n { failedUrl: pkgUrl.toString() },\n 'Maven S3 lookup error: unsupported Body type',\n );\n return Result.err({ type: 'unsupported-format' });\n }\n\n const data = await streamToString(Body);\n const result: MavenFetchSuccess = { data };\n\n const lastModified = asTimestamp(LastModified);\n if (lastModified) {\n result.lastModified = lastModified;\n }\n\n return Result.ok(result);\n },\n )\n .catch((err): MavenFetchResult => {\n if (!(err instanceof Error)) {\n return Result.err(err);\n }\n\n const failedUrl = pkgUrl.toString();\n\n if (err.name === 'CredentialsProviderError') {\n logger.debug(\n { failedUrl },\n 'Maven S3 lookup error: credentials provider error, check \"AWS_ACCESS_KEY_ID\" and \"AWS_SECRET_ACCESS_KEY\" variables',\n );\n return Result.err({ type: 'credentials-error' });\n }\n\n if (err.message === 'Region is missing') {\n logger.debug(\n { failedUrl },\n 'Maven S3 lookup error: missing region, check \"AWS_REGION\" variable',\n );\n return Result.err({ type: 'missing-aws-region' });\n }\n\n if (isS3NotFound(err)) {\n logger.trace({ failedUrl }, 'Maven S3 lookup error: object not found');\n return Result.err({ type: 'not-found' });\n }\n\n logger.debug({ failedUrl, err }, 'Maven S3 lookup error: unknown error');\n return Result.err({ type: 'unknown', err });\n });\n}\n\nexport async function downloadArtifactRegistryProtocol(\n http: Http,\n pkgUrl: URL,\n): Promise<MavenFetchResult> {\n const opts: HttpOptions = {};\n const host = pkgUrl.host;\n const path = pkgUrl.pathname;\n\n logger.trace({ host, path }, `Using google auth for Maven repository`);\n const auth = await getGoogleAuthToken();\n if (auth) {\n opts.headers = { authorization: `Basic ${auth}` };\n } else {\n logger.once.debug(\n { host, path },\n 'Could not get Google access token, using no auth',\n );\n }\n\n const url = pkgUrl.toString().replace('artifactregistry:', 'https:');\n\n return downloadHttpProtocol(http, url, opts);\n}\n\nasync function checkHttpResource(\n http: Http,\n pkgUrl: URL,\n): Promise<HttpResourceCheckResult> {\n try {\n const res = await http.head(pkgUrl.toString());\n const timestamp = res?.headers?.['last-modified'];\n if (timestamp) {\n const isoTimestamp = asTimestamp(timestamp);\n if (isoTimestamp) {\n const releaseDate = DateTime.fromISO(isoTimestamp, {\n zone: 'UTC',\n }).toJSDate();\n return releaseDate;\n }\n }\n return 'found';\n } catch (err) {\n if (isNotFoundError(err)) {\n return 'not-found';\n }\n\n const failedUrl = pkgUrl.toString();\n logger.debug(\n { failedUrl, statusCode: err.statusCode },\n `Can't check HTTP resource existence`,\n );\n return 'error';\n }\n}\n\nexport async function checkS3Resource(\n s3Url: S3UrlParts,\n): Promise<HttpResourceCheckResult> {\n try {\n const response = await getS3Client().send(new HeadObjectCommand(s3Url));\n if (response.DeleteMarker) {\n return 'not-found';\n }\n if (response.LastModified) {\n return response.LastModified;\n }\n return 'found';\n } catch (err) {\n if (isS3NotFound(err)) {\n return 'not-found';\n } else {\n logger.debug(\n {\n bucket: s3Url.Bucket,\n key: s3Url.Key,\n name: err.name,\n message: err.message,\n },\n `Can't check S3 resource existence`,\n );\n }\n return 'error';\n }\n}\n\nexport async function checkResource(\n http: Http,\n pkgUrl: URL | string,\n): Promise<HttpResourceCheckResult> {\n const parsedUrl = typeof pkgUrl === 'string' ? parseUrl(pkgUrl) : pkgUrl;\n if (parsedUrl === null) {\n return 'error';\n }\n\n const s3Url = parseS3Url(parsedUrl);\n if (s3Url) {\n return await checkS3Resource(s3Url);\n }\n\n if (parsedUrl.protocol === 'http:' || parsedUrl.protocol === 'https:') {\n return await checkHttpResource(http, parsedUrl);\n }\n\n logger.debug(\n { url: pkgUrl.toString() },\n `Unsupported Maven protocol in check resource`,\n );\n return 'not-found';\n}\n\nfunction containsPlaceholder(str: string): boolean {\n return regEx(/\\${.*?}/g).test(str);\n}\n\nexport function getMavenUrl(\n dependency: MavenDependency,\n repoUrl: string,\n path: string,\n): URL {\n return new URL(\n `${dependency.dependencyUrl}/${path}`,\n ensureTrailingSlash(repoUrl),\n );\n}\n\nexport async function downloadMavenXml(\n http: Http,\n pkgUrl: URL,\n): Promise<MavenXml> {\n const protocol = pkgUrl.protocol;\n\n if (protocol === 'http:' || protocol === 'https:') {\n const rawResult = await downloadHttpProtocol(http, pkgUrl);\n const xmlResult = rawResult.transform(({ isCacheable, data }): MavenXml => {\n const xml = new XmlDocument(data);\n return { isCacheable, xml };\n });\n return xmlResult.unwrapOr({});\n }\n\n if (protocol === 'artifactregistry:') {\n const rawResult = await downloadArtifactRegistryProtocol(http, pkgUrl);\n const xmlResult = rawResult.transform(({ isCacheable, data }): MavenXml => {\n const xml = new XmlDocument(data);\n return { isCacheable, xml };\n });\n return xmlResult.unwrapOr({});\n }\n\n if (protocol === 's3:') {\n const rawResult = await downloadS3Protocol(pkgUrl);\n const xmlResult = rawResult.transform(({ isCacheable, data }): MavenXml => {\n const xml = new XmlDocument(data);\n return { xml };\n });\n return xmlResult.unwrapOr({});\n }\n\n logger.debug(\n { url: pkgUrl.toString() },\n `Content is not found for Maven url`,\n );\n return {};\n}\n\nexport function getDependencyParts(packageName: string): MavenDependency {\n const [group, name] = packageName.split(':');\n const dependencyUrl = `${group.replace(regEx(/\\./g), '/')}/${name}`;\n return {\n display: packageName,\n group,\n name,\n dependencyUrl,\n };\n}\n\nfunction extractSnapshotVersion(metadata: XmlDocument): string | null {\n // Parse the maven-metadata.xml for the snapshot version and determine\n // the fixed version of the latest deployed snapshot.\n // The metadata descriptor can be found at\n // https://maven.apache.org/ref/3.3.3/maven-repository-metadata/repository-metadata.html\n //\n // Basically, we need to replace -SNAPSHOT with the artifact timestanp & build number,\n // so for example 1.0.0-SNAPSHOT will become 1.0.0-<timestamp>-<buildNumber>\n const version = metadata\n .descendantWithPath('version')\n ?.val?.replace('-SNAPSHOT', '');\n\n const snapshot = metadata.descendantWithPath('versioning.snapshot');\n const timestamp = snapshot?.childNamed('timestamp')?.val;\n const build = snapshot?.childNamed('buildNumber')?.val;\n\n // If we weren't able to parse out the required 3 version elements,\n // return null because we can't determine the fixed version of the latest snapshot.\n if (!version || !timestamp || !build) {\n return null;\n }\n return `${version}-${timestamp}-${build}`;\n}\n\nasync function getSnapshotFullVersion(\n http: Http,\n version: string,\n dependency: MavenDependency,\n repoUrl: string,\n): Promise<string | null> {\n // To determine what actual files are available for the snapshot, first we have to fetch and parse\n // the metadata located at http://<repo>/<group>/<artifact>/<version-SNAPSHOT>/maven-metadata.xml\n const metadataUrl = getMavenUrl(\n dependency,\n repoUrl,\n `${version}/maven-metadata.xml`,\n );\n\n const { xml: mavenMetadata } = await downloadMavenXml(http, metadataUrl);\n // istanbul ignore if: hard to test\n if (!mavenMetadata) {\n return null;\n }\n\n return extractSnapshotVersion(mavenMetadata);\n}\n\nfunction isSnapshotVersion(version: string): boolean {\n if (version.endsWith('-SNAPSHOT')) {\n return true;\n }\n return false;\n}\n\nexport async function createUrlForDependencyPom(\n http: Http,\n version: string,\n dependency: MavenDependency,\n repoUrl: string,\n): Promise<string> {\n if (isSnapshotVersion(version)) {\n // By default, Maven snapshots are deployed to the repository with fixed file names.\n // Resolve the full, actual pom file name for the version.\n const fullVersion = await getSnapshotFullVersion(\n http,\n version,\n dependency,\n repoUrl,\n );\n\n // If we were able to resolve the version, use that, otherwise fall back to using -SNAPSHOT\n if (fullVersion !== null) {\n // TODO: types (#22198)\n return `${version}/${dependency.name}-${fullVersion}.pom`;\n }\n }\n\n // TODO: types (#22198)\n return `${version}/${dependency.name}-${version}.pom`;\n}\n\nexport async function getDependencyInfo(\n http: Http,\n dependency: MavenDependency,\n repoUrl: string,\n version: string,\n recursionLimit = 5,\n): Promise<DependencyInfo> {\n const result: DependencyInfo = {};\n const path = await createUrlForDependencyPom(\n http,\n version,\n dependency,\n repoUrl,\n );\n\n const pomUrl = getMavenUrl(dependency, repoUrl, path);\n const { xml: pomContent } = await downloadMavenXml(http, pomUrl);\n // istanbul ignore if\n if (!pomContent) {\n return result;\n }\n\n const homepage = pomContent.valueWithPath('url');\n if (homepage && !containsPlaceholder(homepage)) {\n result.homepage = homepage;\n }\n\n const sourceUrl = pomContent.valueWithPath('scm.url');\n if (sourceUrl && !containsPlaceholder(sourceUrl)) {\n result.sourceUrl = sourceUrl\n .replace(regEx(/^scm:/), '')\n .replace(regEx(/^git:/), '')\n .replace(regEx(/^git@github.com:/), 'https://github.com/')\n .replace(regEx(/^git@github.com\\//), 'https://github.com/');\n\n if (result.sourceUrl.startsWith('//')) {\n // most likely the result of us stripping scm:, git: etc\n // going with prepending https: here which should result in potential information retrival\n result.sourceUrl = `https:${result.sourceUrl}`;\n }\n }\n\n const relocation = pomContent.descendantWithPath(\n 'distributionManagement.relocation',\n );\n if (relocation) {\n const relocationGroup =\n relocation.valueWithPath('groupId') ?? dependency.group;\n const relocationName =\n relocation.valueWithPath('artifactId') ?? dependency.name;\n result.replacementName = `${relocationGroup}:${relocationName}`;\n const relocationVersion = relocation.valueWithPath('version');\n result.replacementVersion = relocationVersion ?? version;\n const relocationMessage = relocation.valueWithPath('message');\n if (relocationMessage) {\n result.deprecationMessage = relocationMessage;\n }\n }\n\n const groupId = pomContent.valueWithPath('groupId');\n if (groupId) {\n result.packageScope = groupId;\n }\n\n const parent = pomContent.childNamed('parent');\n if (recursionLimit > 0 && parent && (!result.sourceUrl || !result.homepage)) {\n // if we found a parent and are missing some information\n // trying to get the scm/homepage information from it\n const [parentGroupId, parentArtifactId, parentVersion] = [\n 'groupId',\n 'artifactId',\n 'version',\n ].map((k) => parent.valueWithPath(k)?.replace(/\\s+/g, ''));\n if (parentGroupId && parentArtifactId && parentVersion) {\n const parentDisplayId = `${parentGroupId}:${parentArtifactId}`;\n const parentDependency = getDependencyParts(parentDisplayId);\n const parentInformation = await getDependencyInfo(\n http,\n parentDependency,\n repoUrl,\n parentVersion,\n recursionLimit - 1,\n );\n if (!result.sourceUrl && parentInformation.sourceUrl) {\n result.sourceUrl = parentInformation.sourceUrl;\n }\n if (!result.homepage && parentInformation.homepage) {\n result.homepage = parentInformation.homepage;\n }\n }\n }\n\n return result;\n}\n"]}
1
+ {"version":3,"file":"util.js","sourceRoot":"","sources":["../../../../lib/modules/datasource/maven/util.ts"],"names":[],"mappings":";;AAiEA,oDAiFC;AAED,kDAOC;AAMD,gDA+EC;AAED,4EAsBC;AAMD,kCASC;AAED,sCA4BC;AAED,4CAeC;AAED,gDASC;AA0DD,8DAyBC;AAED,8CAmGC;AAzgBD,6CAAuC;AACvC,kDAAsD;AACtD,mCAAqC;AACrC,sEAAkE;AAClE,4CAAyC;AACzC,mFAA8E;AAC9E,6CAA0D;AAE1D,+CAA4C;AAC5C,iDAA8C;AAC9C,yCAA2D;AAC3D,mDAAuD;AACvD,uDAAsD;AACtD,2CAA6E;AAC7E,kCAA6C;AAC7C,qCAAsC;AAQtC,SAAS,OAAO,CAAC,GAAW;IAC1B,OAAO,IAAA,cAAQ,EAAC,GAAG,CAAC,EAAE,IAAI,CAAC;AAC7B,CAAC;AAED,SAAS,gBAAgB,CAAC,GAAc;IACtC,IAAI,GAAG,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;QAC9B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,GAAG,CAAC,QAAQ,EAAE,CAAC;QACjB,MAAM,MAAM,GAAG,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC;QACvC,OAAO,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,IAAI,GAAG,IAAI,MAAM,GAAG,GAAG,CAAC,CAAC;IAC3D,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,WAAW,CAAC,GAAc;IACjC,OAAO,GAAG,CAAC,IAAI,KAAK,WAAW,CAAC;AAClC,CAAC;AAED,SAA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I,CAAC,MAAM,CAAC,QAAQ,CAAC,EACvC,CAAC;YACD,wDAAwD;YACxD,qDAAqD;YACrD,MAAM,CAAC,aAAa,EAAE,gBAAgB,EAAE,aAAa,CAAC,GAAG;gBACvD,SAAS;gBACT,YAAY;gBACZ,SAAS;aACV,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC;YAC3D,IAAI,aAAa,IAAI,gBAAgB,IAAI,aAAa,EAAE,CAAC;gBACvD,MAAM,eAAe,GAAG,GAAG,aAAa,IAAI,gBAAgB,EAAE,CAAC;gBAC/D,MAAM,gBAAgB,GAAG,kBAAkB,CAAC,eAAe,CAAC,CAAC;gBAC7D,MAAM,iBAAiB,GAAG,MAAM,iBAAiB,CAC/C,IAAI,EACJ,gBAAgB,EAChB,OAAO,EACP,aAAa,EACb,cAAc,GAAG,CAAC,CACnB,CAAC;gBACF,IAAI,CAAC,MAAM,CAAC,SAAS,IAAI,iBAAiB,CAAC,SAAS,EAAE,CAAC;oBACrD,MAAM,CAAC,SAAS,GAAG,iBAAiB,CAAC,SAAS,CAAC;gBACjD,CAAC;gBACD,IAAI,CAAC,MAAM,CAAC,QAAQ,IAAI,iBAAiB,CAAC,QAAQ,EAAE,CAAC;oBACnD,MAAM,CAAC,QAAQ,GAAG,iBAAiB,CAAC,QAAQ,CAAC;gBAC/C,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC,CACF,CAAC;IAEF,OAAO,oBAAoB,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AAC3C,CAAC","sourcesContent":["import { Readable } from 'node:stream';\nimport { GetObjectCommand } from '@aws-sdk/client-s3';\nimport { XmlDocument } from 'xmldoc';\nimport { HOST_DISABLED } from '../../../constants/error-messages';\nimport { logger } from '../../../logger';\nimport { ExternalHostError } from '../../../types/errors/external-host-error';\nimport { type Http, HttpError } from '../../../util/http';\nimport type { HttpOptions, HttpResponse } from '../../../util/http/types';\nimport { regEx } from '../../../util/regex';\nimport { Result } from '../../../util/result';\nimport { getS3Client, parseS3Url } from '../../../util/s3';\nimport { streamToString } from '../../../util/streams';\nimport { asTimestamp } from '../../../util/timestamp';\nimport { ensureTrailingSlash, isHttpUrl, parseUrl } from '../../../util/url';\nimport { getGoogleAuthToken } from '../util';\nimport { MAVEN_REPO } from './common';\nimport type {\n DependencyInfo,\n MavenDependency,\n MavenFetchResult,\n MavenFetchSuccess,\n} from './types';\n\nfunction getHost(url: string): string | undefined {\n return parseUrl(url)?.host;\n}\n\nfunction isTemporaryError(err: HttpError): boolean {\n if (err.code === 'ECONNRESET') {\n return true;\n }\n\n if (err.response) {\n const status = err.response.statusCode;\n return status === 429 || (status >= 500 && status < 600);\n }\n\n return false;\n}\n\nfunction isHostError(err: HttpError): boolean {\n return err.code === 'ETIMEDOUT';\n}\n\nfunction isNotFoundError(err: HttpError): boolean {\n return err.code === 'ENOTFOUND' || err.response?.statusCode === 404;\n}\n\nfunction isPermissionsIssue(err: HttpError): boolean {\n const status = err.response?.statusCode;\n return status === 401 || status === 403;\n}\n\nfunction isConnectionError(err: HttpError): boolean {\n return (\n err.code === 'EAI_AGAIN' ||\n err.code === 'ERR_TLS_CERT_ALTNAME_INVALID' ||\n err.code === 'ECONNREFUSED'\n );\n}\n\nfunction isUnsupportedHostError(err: HttpError): boolean {\n return err.name === 'UnsupportedProtocolError';\n}\n\nexport async function downloadHttpProtocol(\n http: Http,\n pkgUrl: URL | string,\n opts: HttpOptions = {},\n): Promise<MavenFetchResult> {\n const url = pkgUrl.toString();\n const fetchResult = await Result.wrap<HttpResponse, Error>(\n http.getText(url, opts),\n )\n .transform((res): MavenFetchSuccess => {\n const result: MavenFetchSuccess = { data: res.body };\n\n if (!res.authorization) {\n result.isCacheable = true;\n }\n\n const lastModified = asTimestamp(res?.headers?.['last-modified']);\n if (lastModified) {\n result.lastModified = lastModified;\n }\n\n return result;\n })\n .catch((err): MavenFetchResult => {\n /* v8 ignore start: never happens, needs for type narrowing */\n if (!(err instanceof HttpError)) {\n return Result.err({ type: 'unknown', err });\n } /* v8 ignore stop */\n\n const failedUrl = url;\n if (err.message === HOST_DISABLED) {\n logger.trace({ failedUrl }, 'Host disabled');\n return Result.err({ type: 'host-disabled' });\n }\n\n if (isNotFoundError(err)) {\n logger.trace({ failedUrl }, `Url not found`);\n return Result.err({ type: 'not-found' });\n }\n\n if (isHostError(err)) {\n logger.debug(`Cannot connect to host ${failedUrl}`);\n return Result.err({ type: 'host-error' });\n }\n\n if (isPermissionsIssue(err)) {\n logger.debug(\n `Dependency lookup unauthorized. Please add authentication with a hostRule for ${failedUrl}`,\n );\n return Result.err({ type: 'permission-issue' });\n }\n\n if (isTemporaryError(err)) {\n logger.debug({ failedUrl, err }, 'Temporary error');\n if (getHost(url) === getHost(MAVEN_REPO)) {\n return Result.err({ type: 'maven-central-temporary-error', err });\n } else {\n return Result.err({ type: 'temporary-error' });\n }\n }\n\n if (isConnectionError(err)) {\n logger.debug(`Connection refused to maven registry ${failedUrl}`);\n return Result.err({ type: 'connection-error' });\n }\n\n if (isUnsupportedHostError(err)) {\n logger.debug(`Unsupported host ${failedUrl}`);\n return Result.err({ type: 'unsupported-host' });\n }\n\n logger.info({ failedUrl, err }, 'Unknown HTTP download error');\n return Result.err({ type: 'unknown', err });\n });\n\n const { err } = fetchResult.unwrap();\n if (err?.type === 'maven-central-temporary-error') {\n throw new ExternalHostError(err.err);\n }\n\n return fetchResult;\n}\n\nexport async function downloadHttpContent(\n http: Http,\n pkgUrl: URL | string,\n opts: HttpOptions = {},\n): Promise<string | null> {\n const fetchResult = await downloadHttpProtocol(http, pkgUrl, opts);\n return fetchResult.transform(({ data }) => data).unwrapOrNull();\n}\n\nfunction isS3NotFound(err: Error): boolean {\n return err.message === 'NotFound' || err.message === 'NoSuchKey';\n}\n\nexport async function downloadS3Protocol(\n pkgUrl: URL,\n): Promise<MavenFetchResult> {\n logger.trace({ url: pkgUrl.toString() }, `Attempting to load S3 dependency`);\n\n const s3Url = parseS3Url(pkgUrl);\n if (!s3Url) {\n return Result.err({ type: 'invalid-url' });\n }\n\n return await Result.wrap(() => {\n const command = new GetObjectCommand(s3Url);\n const client = getS3Client();\n return client.send(command);\n })\n .transform(\n async ({\n Body,\n LastModified,\n DeleteMarker,\n }): Promise<MavenFetchResult> => {\n if (DeleteMarker) {\n logger.trace(\n { failedUrl: pkgUrl.toString() },\n 'Maven S3 lookup error: DeleteMarker encountered',\n );\n return Result.err({ type: 'not-found' });\n }\n\n if (!(Body instanceof Readable)) {\n logger.debug(\n { failedUrl: pkgUrl.toString() },\n 'Maven S3 lookup error: unsupported Body type',\n );\n return Result.err({ type: 'unsupported-format' });\n }\n\n const data = await streamToString(Body);\n const result: MavenFetchSuccess = { data };\n\n const lastModified = asTimestamp(LastModified);\n if (lastModified) {\n result.lastModified = lastModified;\n }\n\n return Result.ok(result);\n },\n )\n .catch((err): MavenFetchResult => {\n if (!(err instanceof Error)) {\n return Result.err(err);\n }\n\n const failedUrl = pkgUrl.toString();\n\n if (err.name === 'CredentialsProviderError') {\n logger.debug(\n { failedUrl },\n 'Maven S3 lookup error: credentials provider error, check \"AWS_ACCESS_KEY_ID\" and \"AWS_SECRET_ACCESS_KEY\" variables',\n );\n return Result.err({ type: 'credentials-error' });\n }\n\n if (err.message === 'Region is missing') {\n logger.debug(\n { failedUrl },\n 'Maven S3 lookup error: missing region, check \"AWS_REGION\" variable',\n );\n return Result.err({ type: 'missing-aws-region' });\n }\n\n if (isS3NotFound(err)) {\n logger.trace({ failedUrl }, 'Maven S3 lookup error: object not found');\n return Result.err({ type: 'not-found' });\n }\n\n logger.debug({ failedUrl, err }, 'Maven S3 lookup error: unknown error');\n return Result.err({ type: 'unknown', err });\n });\n}\n\nexport async function downloadArtifactRegistryProtocol(\n http: Http,\n pkgUrl: URL,\n): Promise<MavenFetchResult> {\n const opts: HttpOptions = {};\n const host = pkgUrl.host;\n const path = pkgUrl.pathname;\n\n logger.trace({ host, path }, `Using google auth for Maven repository`);\n const auth = await getGoogleAuthToken();\n if (auth) {\n opts.headers = { authorization: `Basic ${auth}` };\n } else {\n logger.once.debug(\n { host, path },\n 'Could not get Google access token, using no auth',\n );\n }\n\n const url = pkgUrl.toString().replace('artifactregistry:', 'https:');\n\n return downloadHttpProtocol(http, url, opts);\n}\n\nfunction containsPlaceholder(str: string): boolean {\n return regEx(/\\${.*?}/g).test(str);\n}\n\nexport function getMavenUrl(\n dependency: MavenDependency,\n repoUrl: string,\n path: string,\n): URL {\n return new URL(\n `${dependency.dependencyUrl}/${path}`,\n ensureTrailingSlash(repoUrl),\n );\n}\n\nexport async function downloadMaven(\n http: Http,\n url: URL,\n): Promise<MavenFetchResult> {\n const protocol = url.protocol;\n\n let result: MavenFetchResult = Result.err({ type: 'unsupported-protocol' });\n\n if (isHttpUrl(url)) {\n result = await downloadHttpProtocol(http, url);\n }\n\n if (protocol === 'artifactregistry:') {\n result = await downloadArtifactRegistryProtocol(http, url);\n }\n\n if (protocol === 's3:') {\n result = await downloadS3Protocol(url);\n }\n\n return result.onError((err) => {\n if (err.type === 'unsupported-protocol') {\n logger.debug(\n { url: url.toString() },\n `Maven lookup error: unsupported protocol (${protocol})`,\n );\n }\n });\n}\n\nexport async function downloadMavenXml(\n http: Http,\n url: URL,\n): Promise<MavenFetchResult<XmlDocument>> {\n const rawResult = await downloadMaven(http, url);\n return rawResult.transform((result): MavenFetchResult<XmlDocument> => {\n try {\n return Result.ok({\n ...result,\n data: new XmlDocument(result.data),\n });\n } catch (err) {\n return Result.err({ type: 'xml-parse-error', err });\n }\n });\n}\n\nexport function getDependencyParts(packageName: string): MavenDependency {\n const [group, name] = packageName.split(':');\n const dependencyUrl = `${group.replace(regEx(/\\./g), '/')}/${name}`;\n return {\n display: packageName,\n group,\n name,\n dependencyUrl,\n };\n}\n\nfunction extractSnapshotVersion(metadata: XmlDocument): string | null {\n // Parse the maven-metadata.xml for the snapshot version and determine\n // the fixed version of the latest deployed snapshot.\n // The metadata descriptor can be found at\n // https://maven.apache.org/ref/3.3.3/maven-repository-metadata/repository-metadata.html\n //\n // Basically, we need to replace -SNAPSHOT with the artifact timestanp & build number,\n // so for example 1.0.0-SNAPSHOT will become 1.0.0-<timestamp>-<buildNumber>\n const version = metadata\n .descendantWithPath('version')\n ?.val?.replace('-SNAPSHOT', '');\n\n const snapshot = metadata.descendantWithPath('versioning.snapshot');\n const timestamp = snapshot?.childNamed('timestamp')?.val;\n const build = snapshot?.childNamed('buildNumber')?.val;\n\n // If we weren't able to parse out the required 3 version elements,\n // return null because we can't determine the fixed version of the latest snapshot.\n if (!version || !timestamp || !build) {\n return null;\n }\n return `${version}-${timestamp}-${build}`;\n}\n\nasync function getSnapshotFullVersion(\n http: Http,\n version: string,\n dependency: MavenDependency,\n repoUrl: string,\n): Promise<string | null> {\n // To determine what actual files are available for the snapshot, first we have to fetch and parse\n // the metadata located at http://<repo>/<group>/<artifact>/<version-SNAPSHOT>/maven-metadata.xml\n const metadataUrl = getMavenUrl(\n dependency,\n repoUrl,\n `${version}/maven-metadata.xml`,\n );\n\n const metadataXmlResult = await downloadMavenXml(http, metadataUrl);\n\n return metadataXmlResult\n .transform(({ data }) =>\n Result.wrapNullable(extractSnapshotVersion(data), {\n type: 'snapshot-extract-error',\n }),\n )\n .unwrapOrNull();\n}\n\nfunction isSnapshotVersion(version: string): boolean {\n if (version.endsWith('-SNAPSHOT')) {\n return true;\n }\n return false;\n}\n\nexport async function createUrlForDependencyPom(\n http: Http,\n version: string,\n dependency: MavenDependency,\n repoUrl: string,\n): Promise<string> {\n if (isSnapshotVersion(version)) {\n // By default, Maven snapshots are deployed to the repository with fixed file names.\n // Resolve the full, actual pom file name for the version.\n const fullVersion = await getSnapshotFullVersion(\n http,\n version,\n dependency,\n repoUrl,\n );\n\n // If we were able to resolve the version, use that, otherwise fall back to using -SNAPSHOT\n if (fullVersion !== null) {\n // TODO: types (#22198)\n return `${version}/${dependency.name}-${fullVersion}.pom`;\n }\n }\n\n // TODO: types (#22198)\n return `${version}/${dependency.name}-${version}.pom`;\n}\n\nexport async function getDependencyInfo(\n http: Http,\n dependency: MavenDependency,\n repoUrl: string,\n version: string,\n recursionLimit = 5,\n): Promise<DependencyInfo> {\n const path = await createUrlForDependencyPom(\n http,\n version,\n dependency,\n repoUrl,\n );\n\n const pomUrl = getMavenUrl(dependency, repoUrl, path);\n const pomXmlResult = await downloadMavenXml(http, pomUrl);\n const dependencyInfoResult = await pomXmlResult.transform(\n async ({ data: pomContent }) => {\n const result: DependencyInfo = {};\n\n const homepage = pomContent.valueWithPath('url');\n if (homepage && !containsPlaceholder(homepage)) {\n result.homepage = homepage;\n }\n\n const sourceUrl = pomContent.valueWithPath('scm.url');\n if (sourceUrl && !containsPlaceholder(sourceUrl)) {\n result.sourceUrl = sourceUrl\n .replace(regEx(/^scm:/), '')\n .replace(regEx(/^git:/), '')\n .replace(regEx(/^git@github.com:/), 'https://github.com/')\n .replace(regEx(/^git@github.com\\//), 'https://github.com/');\n\n if (result.sourceUrl.startsWith('//')) {\n // most likely the result of us stripping scm:, git: etc\n // going with prepending https: here which should result in potential information retrival\n result.sourceUrl = `https:${result.sourceUrl}`;\n }\n }\n\n const relocation = pomContent.descendantWithPath(\n 'distributionManagement.relocation',\n );\n if (relocation) {\n const relocationGroup =\n relocation.valueWithPath('groupId') ?? dependency.group;\n const relocationName =\n relocation.valueWithPath('artifactId') ?? dependency.name;\n result.replacementName = `${relocationGroup}:${relocationName}`;\n const relocationVersion = relocation.valueWithPath('version');\n result.replacementVersion = relocationVersion ?? version;\n const relocationMessage = relocation.valueWithPath('message');\n if (relocationMessage) {\n result.deprecationMessage = relocationMessage;\n }\n }\n\n const groupId = pomContent.valueWithPath('groupId');\n if (groupId) {\n result.packageScope = groupId;\n }\n\n const parent = pomContent.childNamed('parent');\n if (\n recursionLimit > 0 &&\n parent &&\n (!result.sourceUrl || !result.homepage)\n ) {\n // if we found a parent and are missing some information\n // trying to get the scm/homepage information from it\n const [parentGroupId, parentArtifactId, parentVersion] = [\n 'groupId',\n 'artifactId',\n 'version',\n ].map((k) => parent.valueWithPath(k)?.replace(/\\s+/g, ''));\n if (parentGroupId && parentArtifactId && parentVersion) {\n const parentDisplayId = `${parentGroupId}:${parentArtifactId}`;\n const parentDependency = getDependencyParts(parentDisplayId);\n const parentInformation = await getDependencyInfo(\n http,\n parentDependency,\n repoUrl,\n parentVersion,\n recursionLimit - 1,\n );\n if (!result.sourceUrl && parentInformation.sourceUrl) {\n result.sourceUrl = parentInformation.sourceUrl;\n }\n if (!result.homepage && parentInformation.homepage) {\n result.homepage = parentInformation.homepage;\n }\n }\n }\n\n return result;\n },\n );\n\n return dependencyInfoResult.unwrapOr({});\n}\n"]}
@@ -110,16 +110,24 @@ function addMetaData(dep, datasource, packageName) {
110
110
  });
111
111
  extraBaseUrls.push('gitlab.com');
112
112
  if (dep.sourceUrl) {
113
+ // try massaging it
113
114
  const massagedUrl = massageUrl(dep.sourceUrl);
114
115
  if (is_1.default.emptyString(massagedUrl)) {
115
116
  delete dep.sourceUrl;
116
117
  }
117
118
  else {
118
- // try massaging it
119
+ // parse from github-url-from-git only supports Github URLs as its name implies
119
120
  dep.sourceUrl =
120
121
  (0, github_url_from_git_1.default)(massagedUrl, {
121
122
  extraBaseUrls,
122
123
  }) || dep.sourceUrl;
124
+ // prefer massaged URL to source URL if the latter does not start with http:// or https://
125
+ // (e.g. git@somehost.com) and the detected platform is gitlab.
126
+ // this allows to retrieve changelogs from git hosts other than Github
127
+ if (!(0, url_2.isHttpUrl)(dep.sourceUrl) &&
128
+ (0, common_1.detectPlatform)(massagedUrl) === 'gitlab') {
129
+ dep.sourceUrl = massagedUrl;
130
+ }
123
131
  }
124
132
  }
125
133
  if (shouldDeleteHomepage(dep.sourceUrl, dep.homepage)) {
@@ -1 +1 @@
1
- {"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../../lib/modules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AAC;YAClD,GAAG,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,IAAI,EAAW,CAAC;QACvC,CAAC;aAAM,CAAC;YACN,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC;QACrB,CAAC;IACH,CAAC;AACH,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,oBAAoB,CAClC,SAAoC,EACpC,QAA4B;IAE5B,IAAI,YAAE,CAAC,eAAe,CAAC,SAAS,CAAC,IAAI,YAAE,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC5D,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,iBAAiB,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC;IAChD,MAAM,QAAQ,GAAG,IAAA,uBAAc,EAAC,QAAQ,CAAC,CAAC;IAC1C,IAAI,QAAQ,KAAK,QAAQ,IAAI,QAAQ,KAAK,QAAQ,EAAE,CAAC;QACnD,MAAM,eAAe,GAAG,IAAA,cAAQ,EAAC,iBAAiB,CAAC,CAAC;QACpD,IAAI,YAAE,CAAC,eAAe,CAAC,eAAe,CAAC,EAAE,CAAC;YACxC,OAAO,KAAK,CAAC;QACf,CAAC;QACD,MAAM,cAAc,GAAG,IAAA,cAAQ,EAAC,QAAQ,CAAC,CAAC;QAC1C,OAAO,CACL,cAAc,KAAK,IAAI;YACvB,IAAA,uBAAiB,EAAC,cAAc,CAAC,QAAQ,CAAC;gBACxC,IAAA,uBAAiB,EAAC,eAAe,CAAC,QAAQ,CAAC,CAC9C,CAAC;IACJ,CAAC;IACD,OAAO,iBAAiB,KAAK,QAAQ,CAAC;AACxC,CAAC","sourcesContent":["import is from '@sindresorhus/is';\nimport parse from 'github-url-from-git';\nimport { detectPlatform } from '../../util/common';\nimport { parseGitUrl } from '../../util/git/url';\nimport * as hostRules from '../../util/host-rules';\nimport { regEx } from '../../util/regex';\nimport { asTimestamp } from '../../util/timestamp';\nimport { isHttpUrl, parseUrl, trimTrailingSlash } from '../../util/url';\nimport { manualChangelogUrls, manualSourceUrls } from './metadata-manual';\nimport type { ReleaseResult } from './types';\n\nconst githubPages = regEx('^https://([^.]+).github.com/([^/]+)$');\nconst gitPrefix = regEx('^git:/?/?');\n\nexport function massageUrl(sourceUrl: string): string {\n // Replace git@ sourceUrl with https so hostname can be parsed\n const massagedUrl = massageGitAtUrl(sourceUrl);\n\n // Check if URL is valid\n const parsedUrl = parseUrl(massagedUrl);\n if (!parsedUrl) {\n return '';\n }\n\n if (detectPlatform(massagedUrl) === 'gitlab') {\n return massageGitlabUrl(sourceUrl);\n }\n return massageGithubUrl(sourceUrl);\n}\n\nexport function massageGithubUrl(url: string): string {\n const massagedUrl = massageGitAtUrl(url);\n\n return massagedUrl\n .replace('http:', 'https:')\n .replace('http+git:', 'https:')\n .replace('https+git:', 'https:')\n .replace('ssh://git@', 'https://')\n .replace(gitPrefix, 'https://')\n .replace(githubPages, 'https://github.com/$1/$2')\n .replace('www.github.com', 'github.com')\n .split('/')\n .slice(0, 5)\n .join('/');\n}\n\nfunction massageGitlabUrl(url: string): string {\n const massagedUrl = massageGitAtUrl(url);\n\n return massagedUrl\n .replace('http:', 'https:')\n .replace(gitPrefix, 'https://')\n .replace(regEx(/\\/tree\\/.*$/i), '')\n .replace(regEx(/\\/$/i), '')\n .replace('.git', '');\n}\n\nfunction massageGitAtUrl(url: string): string {\n let massagedUrl = url;\n\n if (url.startsWith('git@')) {\n massagedUrl = url.replace(':', '/').replace('git@', 'https://');\n }\n return massagedUrl;\n}\n\nfunction massageTimestamps(dep: ReleaseResult): void {\n for (const release of dep.releases || []) {\n let { releaseTimestamp } = release;\n delete release.releaseTimestamp;\n releaseTimestamp = asTimestamp(releaseTimestamp);\n if (releaseTimestamp) {\n release.releaseTimestamp = releaseTimestamp;\n }\n }\n}\n\nexport function addMetaData(\n dep: ReleaseResult,\n datasource: string,\n packageName: string,\n): void {\n massageTimestamps(dep);\n\n const packageNameLowercase = packageName.toLowerCase();\n const manualChangelogUrl =\n manualChangelogUrls[datasource]?.[packageNameLowercase];\n if (manualChangelogUrl) {\n dep.changelogUrl = manualChangelogUrl;\n }\n\n const manualSourceUrl = manualSourceUrls[datasource]?.[packageNameLowercase];\n if (manualSourceUrl) {\n dep.sourceUrl = manualSourceUrl;\n }\n\n if (dep.sourceUrl && !dep.sourceDirectory) {\n try {\n const parsed = parseGitUrl(dep.sourceUrl);\n if (parsed.filepathtype === 'tree' && parsed.filepath !== '') {\n dep.sourceUrl = parsed.toString();\n dep.sourceDirectory = parsed.filepath;\n }\n } catch {\n // ignore invalid urls\n }\n }\n\n if (\n !dep.sourceUrl &&\n dep.changelogUrl &&\n detectPlatform(dep.changelogUrl) === 'github'\n ) {\n dep.sourceUrl = dep.changelogUrl;\n }\n\n if (!dep.sourceUrl && dep.homepage) {\n const platform = detectPlatform(dep.homepage);\n if (platform === 'github' || platform === 'gitlab') {\n dep.sourceUrl = dep.homepage;\n }\n }\n const extraBaseUrls = [];\n // istanbul ignore next\n hostRules.hosts({ hostType: 'github' }).forEach((host) => {\n extraBaseUrls.push(host, `gist.${host}`);\n });\n extraBaseUrls.push('gitlab.com');\n if (dep.sourceUrl) {\n const massagedUrl = massageUrl(dep.sourceUrl);\n if (is.emptyString(massagedUrl)) {\n delete dep.sourceUrl;\n } else {\n // try massaging it\n dep.sourceUrl =\n parse(massagedUrl, {\n extraBaseUrls,\n }) || dep.sourceUrl;\n }\n }\n if (shouldDeleteHomepage(dep.sourceUrl, dep.homepage)) {\n delete dep.homepage;\n }\n // Clean up any empty urls\n const urlKeys: (keyof ReleaseResult)[] = [\n 'homepage',\n 'sourceUrl',\n 'changelogUrl',\n 'dependencyUrl',\n ];\n for (const urlKey of urlKeys) {\n const urlVal = dep[urlKey];\n if (is.string(urlVal) && isHttpUrl(urlVal.trim())) {\n dep[urlKey] = urlVal.trim() as never;\n } else {\n delete dep[urlKey];\n }\n }\n}\n\n/**\n * Returns true if\n * 1. it's a github or gitlab url and not a path within the repo.\n * 2. it's equal to sourceURl\n * @param sourceUrl\n * @param homepage\n */\nexport function shouldDeleteHomepage(\n sourceUrl: string | null | undefined,\n homepage: string | undefined,\n): boolean {\n if (is.nullOrUndefined(sourceUrl) || is.undefined(homepage)) {\n return false;\n }\n const massagedSourceUrl = massageUrl(sourceUrl);\n const platform = detectPlatform(homepage);\n if (platform === 'github' || platform === 'gitlab') {\n const sourceUrlParsed = parseUrl(massagedSourceUrl);\n if (is.nullOrUndefined(sourceUrlParsed)) {\n return false;\n }\n const homepageParsed = parseUrl(homepage);\n return (\n homepageParsed !== null &&\n trimTrailingSlash(homepageParsed.pathname) ===\n trimTrailingSlash(sourceUrlParsed.pathname)\n );\n }\n return massagedSourceUrl === homepage;\n}\n"]}
1
+ {"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../../lib/modules/datasource/metadata.ts"],"names":[],"mappings":";;AAcA,gCAcC;AAED,4CAcC;AAiCD,kCA2FC;AASD,oDAsBC;;AAvMD,kEAAkC;AAClC,sFAAwC;AACxC,8CAAmD;AACnD,4CAAiD;AACjD,yEAAmD;AACnD,4CAAyC;AACzC,oDAAmD;AACnD,wCAAwE;AACxE,uDAA0E;AAG1E,MAAM,WAAW,GAAG,IAAA,aAAK,EAAC,sCAAsC,CAAC,CAAC;AAClE,MAAM,SAAS,GAAG,IAAA,aAAK,EAAC,WAAW,CAAC,CAAC;AAErC,SAAgB,UAAU,CAAC,SAAiB;IAC1C,8DAA8D;IAC9D,MAAM,WAAW,GAAG,eAAe,CAAC,SAAS,CAAC,CAAC;IAE/C,wBAAwB;IACxB,MAAM,SAAS,GAAG,IAAA,cAAQ,EAAC,WAAW,CAAC,CAAC;IACxC,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,IAAI,IAAA,uBAAc,EAAC,WAAW,CAAC,KAAK,QAAQ,EAAE,CAAC;QAC7C,OAAO,gBAAgB,CAAC,SAAS,CAAC,CAAC;IACrC,CAAC;IACD,OAAO,gBAAgB,CAAC,SAAS,CAAC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AAK,QAAQ,IAAI,QAAQ,KAAK,QAAQ,EAAE,CAAC;QACnD,MAAM,eAAe,GAAG,IAAA,cAAQ,EAAC,iBAAiB,CAAC,CAAC;QACpD,IAAI,YAAE,CAAC,eAAe,CAAC,eAAe,CAAC,EAAE,CAAC;YACxC,OAAO,KAAK,CAAC;QACf,CAAC;QACD,MAAM,cAAc,GAAG,IAAA,cAAQ,EAAC,QAAQ,CAAC,CAAC;QAC1C,OAAO,CACL,cAAc,KAAK,IAAI;YACvB,IAAA,uBAAiB,EAAC,cAAc,CAAC,QAAQ,CAAC;gBACxC,IAAA,uBAAiB,EAAC,eAAe,CAAC,QAAQ,CAAC,CAC9C,CAAC;IACJ,CAAC;IACD,OAAO,iBAAiB,KAAK,QAAQ,CAAC;AACxC,CAAC","sourcesContent":["import is from '@sindresorhus/is';\nimport parse from 'github-url-from-git';\nimport { detectPlatform } from '../../util/common';\nimport { parseGitUrl } from '../../util/git/url';\nimport * as hostRules from '../../util/host-rules';\nimport { regEx } from '../../util/regex';\nimport { asTimestamp } from '../../util/timestamp';\nimport { isHttpUrl, parseUrl, trimTrailingSlash } from '../../util/url';\nimport { manualChangelogUrls, manualSourceUrls } from './metadata-manual';\nimport type { ReleaseResult } from './types';\n\nconst githubPages = regEx('^https://([^.]+).github.com/([^/]+)$');\nconst gitPrefix = regEx('^git:/?/?');\n\nexport function massageUrl(sourceUrl: string): string {\n // Replace git@ sourceUrl with https so hostname can be parsed\n const massagedUrl = massageGitAtUrl(sourceUrl);\n\n // Check if URL is valid\n const parsedUrl = parseUrl(massagedUrl);\n if (!parsedUrl) {\n return '';\n }\n\n if (detectPlatform(massagedUrl) === 'gitlab') {\n return massageGitlabUrl(sourceUrl);\n }\n return massageGithubUrl(sourceUrl);\n}\n\nexport function massageGithubUrl(url: string): string {\n const massagedUrl = massageGitAtUrl(url);\n\n return massagedUrl\n .replace('http:', 'https:')\n .replace('http+git:', 'https:')\n .replace('https+git:', 'https:')\n .replace('ssh://git@', 'https://')\n .replace(gitPrefix, 'https://')\n .replace(githubPages, 'https://github.com/$1/$2')\n .replace('www.github.com', 'github.com')\n .split('/')\n .slice(0, 5)\n .join('/');\n}\n\nfunction massageGitlabUrl(url: string): string {\n const massagedUrl = massageGitAtUrl(url);\n\n return massagedUrl\n .replace('http:', 'https:')\n .replace(gitPrefix, 'https://')\n .replace(regEx(/\\/tree\\/.*$/i), '')\n .replace(regEx(/\\/$/i), '')\n .replace('.git', '');\n}\n\nfunction massageGitAtUrl(url: string): string {\n let massagedUrl = url;\n\n if (url.startsWith('git@')) {\n massagedUrl = url.replace(':', '/').replace('git@', 'https://');\n }\n return massagedUrl;\n}\n\nfunction massageTimestamps(dep: ReleaseResult): void {\n for (const release of dep.releases || []) {\n let { releaseTimestamp } = release;\n delete release.releaseTimestamp;\n releaseTimestamp = asTimestamp(releaseTimestamp);\n if (releaseTimestamp) {\n release.releaseTimestamp = releaseTimestamp;\n }\n }\n}\n\nexport function addMetaData(\n dep: ReleaseResult,\n datasource: string,\n packageName: string,\n): void {\n massageTimestamps(dep);\n\n const packageNameLowercase = packageName.toLowerCase();\n const manualChangelogUrl =\n manualChangelogUrls[datasource]?.[packageNameLowercase];\n if (manualChangelogUrl) {\n dep.changelogUrl = manualChangelogUrl;\n }\n\n const manualSourceUrl = manualSourceUrls[datasource]?.[packageNameLowercase];\n if (manualSourceUrl) {\n dep.sourceUrl = manualSourceUrl;\n }\n\n if (dep.sourceUrl && !dep.sourceDirectory) {\n try {\n const parsed = parseGitUrl(dep.sourceUrl);\n if (parsed.filepathtype === 'tree' && parsed.filepath !== '') {\n dep.sourceUrl = parsed.toString();\n dep.sourceDirectory = parsed.filepath;\n }\n } catch {\n // ignore invalid urls\n }\n }\n\n if (\n !dep.sourceUrl &&\n dep.changelogUrl &&\n detectPlatform(dep.changelogUrl) === 'github'\n ) {\n dep.sourceUrl = dep.changelogUrl;\n }\n\n if (!dep.sourceUrl && dep.homepage) {\n const platform = detectPlatform(dep.homepage);\n if (platform === 'github' || platform === 'gitlab') {\n dep.sourceUrl = dep.homepage;\n }\n }\n const extraBaseUrls = [];\n // istanbul ignore next\n hostRules.hosts({ hostType: 'github' }).forEach((host) => {\n extraBaseUrls.push(host, `gist.${host}`);\n });\n extraBaseUrls.push('gitlab.com');\n if (dep.sourceUrl) {\n // try massaging it\n const massagedUrl = massageUrl(dep.sourceUrl);\n if (is.emptyString(massagedUrl)) {\n delete dep.sourceUrl;\n } else {\n // parse from github-url-from-git only supports Github URLs as its name implies\n dep.sourceUrl =\n parse(massagedUrl, {\n extraBaseUrls,\n }) || dep.sourceUrl;\n // prefer massaged URL to source URL if the latter does not start with http:// or https://\n // (e.g. git@somehost.com) and the detected platform is gitlab.\n // this allows to retrieve changelogs from git hosts other than Github\n if (\n !isHttpUrl(dep.sourceUrl) &&\n detectPlatform(massagedUrl) === 'gitlab'\n ) {\n dep.sourceUrl = massagedUrl;\n }\n }\n }\n if (shouldDeleteHomepage(dep.sourceUrl, dep.homepage)) {\n delete dep.homepage;\n }\n // Clean up any empty urls\n const urlKeys: (keyof ReleaseResult)[] = [\n 'homepage',\n 'sourceUrl',\n 'changelogUrl',\n 'dependencyUrl',\n ];\n for (const urlKey of urlKeys) {\n const urlVal = dep[urlKey];\n if (is.string(urlVal) && isHttpUrl(urlVal.trim())) {\n dep[urlKey] = urlVal.trim() as never;\n } else {\n delete dep[urlKey];\n }\n }\n}\n\n/**\n * Returns true if\n * 1. it's a github or gitlab url and not a path within the repo.\n * 2. it's equal to sourceURl\n * @param sourceUrl\n * @param homepage\n */\nexport function shouldDeleteHomepage(\n sourceUrl: string | null | undefined,\n homepage: string | undefined,\n): boolean {\n if (is.nullOrUndefined(sourceUrl) || is.undefined(homepage)) {\n return false;\n }\n const massagedSourceUrl = massageUrl(sourceUrl);\n const platform = detectPlatform(homepage);\n if (platform === 'github' || platform === 'gitlab') {\n const sourceUrlParsed = parseUrl(massagedSourceUrl);\n if (is.nullOrUndefined(sourceUrlParsed)) {\n return false;\n }\n const homepageParsed = parseUrl(homepage);\n return (\n homepageParsed !== null &&\n trimTrailingSlash(homepageParsed.pathname) ===\n trimTrailingSlash(sourceUrlParsed.pathname)\n );\n }\n return massagedSourceUrl === homepage;\n}\n"]}
@@ -21,7 +21,7 @@ class NodeVersionDatasource extends datasource_1.Datasource {
21
21
  sourceUrlSupport = 'package';
22
22
  sourceUrlNote = 'We use the URL: https://github.com/nodejs/node';
23
23
  async getReleases({ registryUrl, }) {
24
- // istanbul ignore if
24
+ /* v8 ignore next 3 -- should never happen */
25
25
  if (!registryUrl) {
26
26
  return null;
27
27
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../lib/modules/datasource/node-version/index.ts"],"names":[],"mappings":";;;;AAAA,qEAA8D;AAC9D,uDAAsD;AACtD,2CAAiD;AACjD,gDAAyD;AACzD,8CAA2C;AAE3C,qCAA0D;AAG1D,MAAa,qBAAsB,SAAQ,uBAAU;IACnD,MAAM,CAAU,EAAE,GAAG,mBAAU,CAAC;IAEhC;QACE,KAAK,CAAC,mBAAU,CAAC,CAAC;IACpB,CAAC;IAEiB,mBAAmB,GAAG,CAAC,2BAAkB,CAAC,CAAC;IAE3C,iBAAiB,GAAG,SAAU,CAAC;IAE/B,OAAO,GAAG,IAAI,CAAC;IAEf,uBAAuB,GAAG,IAAI,CAAC;IAC/B,oBAAoB,GACpC,4DAA4D,CAAC;IAC7C,gBAAgB,GAAG,SAAS,CAAC;IAC7B,aAAa,GAC7B,gDAAgD,CAAC;IAO7C,AAAN,KAAK,CAAC,WAAW,CAAC,EAChB,WAAW,GACO;QAClB,qBAAqB;QACrB,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,OAAO,IAAI,CAAC;QACd,CAAC;QACD,MAAM,MAAM,GAAkB;YAC5B,QAAQ,EAAE,oBAAoB;YAC9B,SAAS,EAAE,gCAAgC;YAC3C,WAAW;YACX,QAAQ,EAAE,EAAE;SACb,CAAC;QACF,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,CACX,MAAM,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAC9B,IAAA,kBAAY,EAAC,WAAW,EAAE,YAAY,CAAC,CACxC,CACF,CAAC,IAAI,CAAC;YACP,MAAM,CAAC,QAAQ,CAAC,IAAI,CAClB,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC;gBACvC,OAAO;gBACP,gBAAgB,EAAE,IAAA,uBAAW,EAAC,IAAI,CAAC;gBACnC,QAAQ,EAAE,GAAG,KAAK,KAAK;aACxB,CAAC,CAAC,CACJ,CAAC;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC;QAChC,CAAC;QAED,OAAO,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;IAChD,CAAC;;AAxDH,sDAyDC;AAhCO;IALL,IAAA,iBAAK,EAAC;QACL,SAAS,EAAE,cAAc,mBAAU,EAAE;QACrC,uBAAuB;QACvB,GAAG,EAAE,CAAC,EAAE,WAAW,EAAqB,EAAE,EAAE,CAAC,GAAG,WAAW,EAAE;KAC9D,CAAC;wDAgCD","sourcesContent":["import { cache } from '../../../util/cache/package/decorator';\nimport { asTimestamp } from '../../../util/timestamp';\nimport { joinUrlParts } from '../../../util/url';\nimport { id as versioning } from '../../versioning/node';\nimport { Datasource } from '../datasource';\nimport type { GetReleasesConfig, ReleaseResult } from '../types';\nimport { datasource, defaultRegistryUrl } from './common';\nimport type { NodeRelease } from './types';\n\nexport class NodeVersionDatasource extends Datasource {\n static readonly id = datasource;\n\n constructor() {\n super(datasource);\n }\n\n override readonly defaultRegistryUrls = [defaultRegistryUrl];\n\n override readonly defaultVersioning = versioning;\n\n override readonly caching = true;\n\n override readonly releaseTimestampSupport = true;\n override readonly releaseTimestampNote =\n 'The release timestamp is determined from the `date` field.';\n override readonly sourceUrlSupport = 'package';\n override readonly sourceUrlNote =\n 'We use the URL: https://github.com/nodejs/node';\n\n @cache({\n namespace: `datasource-${datasource}`,\n // TODO: types (#22198)\n key: ({ registryUrl }: GetReleasesConfig) => `${registryUrl}`,\n })\n async getReleases({\n registryUrl,\n }: GetReleasesConfig): Promise<ReleaseResult | null> {\n // istanbul ignore if\n if (!registryUrl) {\n return null;\n }\n const result: ReleaseResult = {\n homepage: 'https://nodejs.org',\n sourceUrl: 'https://github.com/nodejs/node',\n registryUrl,\n releases: [],\n };\n try {\n const resp = (\n await this.http.getJsonUnchecked<NodeRelease[]>(\n joinUrlParts(registryUrl, 'index.json'),\n )\n ).body;\n result.releases.push(\n ...resp.map(({ version, date, lts }) => ({\n version,\n releaseTimestamp: asTimestamp(date),\n isStable: lts !== false,\n })),\n );\n } catch (err) {\n this.handleGenericErrors(err);\n }\n\n return result.releases.length ? result : null;\n }\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../lib/modules/datasource/node-version/index.ts"],"names":[],"mappings":";;;;AAAA,qEAA8D;AAC9D,uDAAsD;AACtD,2CAAiD;AACjD,gDAAyD;AACzD,8CAA2C;AAE3C,qCAA0D;AAG1D,MAAa,qBAAsB,SAAQ,uBAAU;IACnD,MAAM,CAAU,EAAE,GAAG,mBAAU,CAAC;IAEhC;QACE,KAAK,CAAC,mBAAU,CAAC,CAAC;IACpB,CAAC;IAEiB,mBAAmB,GAAG,CAAC,2BAAkB,CAAC,CAAC;IAE3C,iBAAiB,GAAG,SAAU,CAAC;IAE/B,OAAO,GAAG,IAAI,CAAC;IAEf,uBAAuB,GAAG,IAAI,CAAC;IAC/B,oBAAoB,GACpC,4DAA4D,CAAC;IAC7C,gBAAgB,GAAG,SAAS,CAAC;IAC7B,aAAa,GAC7B,gDAAgD,CAAC;IAO7C,AAAN,KAAK,CAAC,WAAW,CAAC,EAChB,WAAW,GACO;QAClB,6CAA6C;QAC7C,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,OAAO,IAAI,CAAC;QACd,CAAC;QACD,MAAM,MAAM,GAAkB;YAC5B,QAAQ,EAAE,oBAAoB;YAC9B,SAAS,EAAE,gCAAgC;YAC3C,WAAW;YACX,QAAQ,EAAE,EAAE;SACb,CAAC;QACF,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,CACX,MAAM,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAC9B,IAAA,kBAAY,EAAC,WAAW,EAAE,YAAY,CAAC,CACxC,CACF,CAAC,IAAI,CAAC;YACP,MAAM,CAAC,QAAQ,CAAC,IAAI,CAClB,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC;gBACvC,OAAO;gBACP,gBAAgB,EAAE,IAAA,uBAAW,EAAC,IAAI,CAAC;gBACnC,QAAQ,EAAE,GAAG,KAAK,KAAK;aACxB,CAAC,CAAC,CACJ,CAAC;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC;QAChC,CAAC;QAED,OAAO,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;IAChD,CAAC;;AAxDH,sDAyDC;AAhCO;IALL,IAAA,iBAAK,EAAC;QACL,SAAS,EAAE,cAAc,mBAAU,EAAE;QACrC,uBAAuB;QACvB,GAAG,EAAE,CAAC,EAAE,WAAW,EAAqB,EAAE,EAAE,CAAC,GAAG,WAAW,EAAE;KAC9D,CAAC;wDAgCD","sourcesContent":["import { cache } from '../../../util/cache/package/decorator';\nimport { asTimestamp } from '../../../util/timestamp';\nimport { joinUrlParts } from '../../../util/url';\nimport { id as versioning } from '../../versioning/node';\nimport { Datasource } from '../datasource';\nimport type { GetReleasesConfig, ReleaseResult } from '../types';\nimport { datasource, defaultRegistryUrl } from './common';\nimport type { NodeRelease } from './types';\n\nexport class NodeVersionDatasource extends Datasource {\n static readonly id = datasource;\n\n constructor() {\n super(datasource);\n }\n\n override readonly defaultRegistryUrls = [defaultRegistryUrl];\n\n override readonly defaultVersioning = versioning;\n\n override readonly caching = true;\n\n override readonly releaseTimestampSupport = true;\n override readonly releaseTimestampNote =\n 'The release timestamp is determined from the `date` field.';\n override readonly sourceUrlSupport = 'package';\n override readonly sourceUrlNote =\n 'We use the URL: https://github.com/nodejs/node';\n\n @cache({\n namespace: `datasource-${datasource}`,\n // TODO: types (#22198)\n key: ({ registryUrl }: GetReleasesConfig) => `${registryUrl}`,\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://nodejs.org',\n sourceUrl: 'https://github.com/nodejs/node',\n registryUrl,\n releases: [],\n };\n try {\n const resp = (\n await this.http.getJsonUnchecked<NodeRelease[]>(\n joinUrlParts(registryUrl, 'index.json'),\n )\n ).body;\n result.releases.push(\n ...resp.map(({ version, date, lts }) => ({\n version,\n releaseTimestamp: asTimestamp(date),\n isStable: lts !== false,\n })),\n );\n } catch (err) {\n this.handleGenericErrors(err);\n }\n\n return result.releases.length ? result : null;\n }\n}\n"]}
@@ -1,4 +1,3 @@
1
1
  import type { Http } from '../../../util/http';
2
2
  import type { ReleaseResult } from '../types';
3
- export declare const CACHE_REVISION = 1;
4
3
  export declare function getDependency(http: Http, registryUrl: string, packageName: string): Promise<ReleaseResult | null>;