renovate 42.4.0 → 42.4.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 (702) hide show
  1. package/dist/config/decrypt.js +13 -14
  2. package/dist/config/decrypt.js.map +1 -1
  3. package/dist/config/massage.js +6 -7
  4. package/dist/config/massage.js.map +1 -1
  5. package/dist/config/migrate-validate.js +3 -3
  6. package/dist/config/migrate-validate.js.map +1 -1
  7. package/dist/config/migration.js +19 -20
  8. package/dist/config/migration.js.map +1 -1
  9. package/dist/config/migrations/base/abstract-migration.js +5 -6
  10. package/dist/config/migrations/base/abstract-migration.js.map +1 -1
  11. package/dist/config/migrations/custom/automerge-major-migration.js +2 -3
  12. package/dist/config/migrations/custom/automerge-major-migration.js.map +1 -1
  13. package/dist/config/migrations/custom/automerge-migration.js +4 -5
  14. package/dist/config/migrations/custom/automerge-migration.js.map +1 -1
  15. package/dist/config/migrations/custom/automerge-minor-migration.js +2 -3
  16. package/dist/config/migrations/custom/automerge-minor-migration.js.map +1 -1
  17. package/dist/config/migrations/custom/automerge-patch-migration.js +2 -3
  18. package/dist/config/migrations/custom/automerge-patch-migration.js.map +1 -1
  19. package/dist/config/migrations/custom/automerge-type-migration.js +2 -3
  20. package/dist/config/migrations/custom/automerge-type-migration.js.map +1 -1
  21. package/dist/config/migrations/custom/base-branch-migration.js +3 -4
  22. package/dist/config/migrations/custom/base-branch-migration.js.map +1 -1
  23. package/dist/config/migrations/custom/branch-name-migration.js +2 -3
  24. package/dist/config/migrations/custom/branch-name-migration.js.map +1 -1
  25. package/dist/config/migrations/custom/branch-prefix-migration.js +2 -3
  26. package/dist/config/migrations/custom/branch-prefix-migration.js.map +1 -1
  27. package/dist/config/migrations/custom/compatibility-migration.js +2 -3
  28. package/dist/config/migrations/custom/compatibility-migration.js.map +1 -1
  29. package/dist/config/migrations/custom/composer-ignore-platform-reqs-migration.js +2 -3
  30. package/dist/config/migrations/custom/composer-ignore-platform-reqs-migration.js.map +1 -1
  31. package/dist/config/migrations/custom/custom-managers-migration.js +2 -3
  32. package/dist/config/migrations/custom/custom-managers-migration.js.map +1 -1
  33. package/dist/config/migrations/custom/datasource-migration.js +2 -3
  34. package/dist/config/migrations/custom/datasource-migration.js.map +1 -1
  35. package/dist/config/migrations/custom/dep-types-migration.js +4 -5
  36. package/dist/config/migrations/custom/dep-types-migration.js.map +1 -1
  37. package/dist/config/migrations/custom/enabled-managers-migration.js +2 -3
  38. package/dist/config/migrations/custom/enabled-managers-migration.js.map +1 -1
  39. package/dist/config/migrations/custom/extends-migration.js +4 -5
  40. package/dist/config/migrations/custom/extends-migration.js.map +1 -1
  41. package/dist/config/migrations/custom/fetch-release-notes-migration.js +2 -3
  42. package/dist/config/migrations/custom/fetch-release-notes-migration.js.map +1 -1
  43. package/dist/config/migrations/custom/file-match-migration.js +3 -4
  44. package/dist/config/migrations/custom/file-match-migration.js.map +1 -1
  45. package/dist/config/migrations/custom/host-rules-migration.js +6 -7
  46. package/dist/config/migrations/custom/host-rules-migration.js.map +1 -1
  47. package/dist/config/migrations/custom/ignore-npmrc-file-migration.js +2 -3
  48. package/dist/config/migrations/custom/ignore-npmrc-file-migration.js.map +1 -1
  49. package/dist/config/migrations/custom/include-forks-migration.js +2 -3
  50. package/dist/config/migrations/custom/include-forks-migration.js.map +1 -1
  51. package/dist/config/migrations/custom/match-datasources-migration.js +2 -3
  52. package/dist/config/migrations/custom/match-datasources-migration.js.map +1 -1
  53. package/dist/config/migrations/custom/match-managers-migration.js +2 -3
  54. package/dist/config/migrations/custom/match-managers-migration.js.map +1 -1
  55. package/dist/config/migrations/custom/match-strings-migration.js +2 -3
  56. package/dist/config/migrations/custom/match-strings-migration.js.map +1 -1
  57. package/dist/config/migrations/custom/package-files-migration.js +6 -7
  58. package/dist/config/migrations/custom/package-files-migration.js.map +1 -1
  59. package/dist/config/migrations/custom/package-rules-migration.js +15 -16
  60. package/dist/config/migrations/custom/package-rules-migration.js.map +1 -1
  61. package/dist/config/migrations/custom/packages-migration.js +3 -4
  62. package/dist/config/migrations/custom/packages-migration.js.map +1 -1
  63. package/dist/config/migrations/custom/path-rules-migration.js +3 -4
  64. package/dist/config/migrations/custom/path-rules-migration.js.map +1 -1
  65. package/dist/config/migrations/custom/pin-versions-migration.js +2 -3
  66. package/dist/config/migrations/custom/pin-versions-migration.js.map +1 -1
  67. package/dist/config/migrations/custom/platform-commit-migration.js +2 -3
  68. package/dist/config/migrations/custom/platform-commit-migration.js.map +1 -1
  69. package/dist/config/migrations/custom/post-update-options-migration.js +2 -3
  70. package/dist/config/migrations/custom/post-update-options-migration.js.map +1 -1
  71. package/dist/config/migrations/custom/rebase-stale-prs-migration.js +2 -3
  72. package/dist/config/migrations/custom/rebase-stale-prs-migration.js.map +1 -1
  73. package/dist/config/migrations/custom/recreate-closed-migration.js +2 -3
  74. package/dist/config/migrations/custom/recreate-closed-migration.js.map +1 -1
  75. package/dist/config/migrations/custom/renovate-fork-migration.js +2 -3
  76. package/dist/config/migrations/custom/renovate-fork-migration.js.map +1 -1
  77. package/dist/config/migrations/custom/schedule-migration.js +4 -4
  78. package/dist/config/migrations/custom/schedule-migration.js.map +1 -1
  79. package/dist/config/migrations/custom/semantic-commits-migration.js +2 -3
  80. package/dist/config/migrations/custom/semantic-commits-migration.js.map +1 -1
  81. package/dist/config/migrations/custom/semantic-prefix-migration.js +2 -3
  82. package/dist/config/migrations/custom/semantic-prefix-migration.js.map +1 -1
  83. package/dist/config/migrations/custom/stability-days-migration.js +2 -3
  84. package/dist/config/migrations/custom/stability-days-migration.js.map +1 -1
  85. package/dist/config/migrations/custom/suppress-notifications-migration.js +2 -3
  86. package/dist/config/migrations/custom/suppress-notifications-migration.js.map +1 -1
  87. package/dist/config/migrations/custom/unpublish-safe-migration.js +2 -3
  88. package/dist/config/migrations/custom/unpublish-safe-migration.js.map +1 -1
  89. package/dist/config/migrations/migrations-service.js +2 -3
  90. package/dist/config/migrations/migrations-service.js.map +1 -1
  91. package/dist/config/presets/github/index.js +2 -3
  92. package/dist/config/presets/github/index.js.map +1 -1
  93. package/dist/config/presets/gitlab/index.js +2 -3
  94. package/dist/config/presets/gitlab/index.js.map +1 -1
  95. package/dist/config/presets/index.js +8 -8
  96. package/dist/config/presets/index.js.map +1 -1
  97. package/dist/config/presets/parse.js +2 -3
  98. package/dist/config/presets/parse.js.map +1 -1
  99. package/dist/config/secrets.js +3 -4
  100. package/dist/config/secrets.js.map +1 -1
  101. package/dist/config/validation-helpers/match-base-branches.js +2 -3
  102. package/dist/config/validation-helpers/match-base-branches.js.map +1 -1
  103. package/dist/config/validation-helpers/regex-glob-matchers.js +2 -3
  104. package/dist/config/validation-helpers/regex-glob-matchers.js.map +1 -1
  105. package/dist/config/validation-helpers/utils.js +6 -6
  106. package/dist/config/validation-helpers/utils.js.map +1 -1
  107. package/dist/config/validation.js +29 -29
  108. package/dist/config/validation.js.map +1 -1
  109. package/dist/instrumentation/reporting.js +7 -8
  110. package/dist/instrumentation/reporting.js.map +1 -1
  111. package/dist/instrumentation/utils.js +2 -3
  112. package/dist/instrumentation/utils.js.map +1 -1
  113. package/dist/logger/err-serializer.js +2 -2
  114. package/dist/logger/err-serializer.js.map +1 -1
  115. package/dist/logger/index.js +3 -3
  116. package/dist/logger/index.js.map +1 -1
  117. package/dist/logger/renovate-logger.js +4 -5
  118. package/dist/logger/renovate-logger.js.map +1 -1
  119. package/dist/logger/utils.js +19 -19
  120. package/dist/logger/utils.js.map +1 -1
  121. package/dist/modules/datasource/aws-eks-addon/index.js +2 -2
  122. package/dist/modules/datasource/aws-eks-addon/index.js.map +1 -1
  123. package/dist/modules/datasource/bazel/index.js +2 -2
  124. package/dist/modules/datasource/bazel/index.js.map +1 -1
  125. package/dist/modules/datasource/bitrise/index.js +2 -2
  126. package/dist/modules/datasource/bitrise/index.js.map +1 -1
  127. package/dist/modules/datasource/common.js +4 -4
  128. package/dist/modules/datasource/common.js.map +1 -1
  129. package/dist/modules/datasource/conan/index.js +3 -3
  130. package/dist/modules/datasource/conan/index.js.map +1 -1
  131. package/dist/modules/datasource/custom/formats/html.js +2 -5
  132. package/dist/modules/datasource/custom/formats/html.js.map +1 -1
  133. package/dist/modules/datasource/custom/index.js +2 -3
  134. package/dist/modules/datasource/custom/index.js.map +1 -1
  135. package/dist/modules/datasource/custom/utils.js +4 -4
  136. package/dist/modules/datasource/custom/utils.js.map +1 -1
  137. package/dist/modules/datasource/dart-version/index.js +2 -3
  138. package/dist/modules/datasource/dart-version/index.js.map +1 -1
  139. package/dist/modules/datasource/deno/index.js +2 -2
  140. package/dist/modules/datasource/deno/index.js.map +1 -1
  141. package/dist/modules/datasource/docker/common.js +5 -5
  142. package/dist/modules/datasource/docker/common.js.map +1 -1
  143. package/dist/modules/datasource/docker/index.js +6 -6
  144. package/dist/modules/datasource/docker/index.js.map +1 -1
  145. package/dist/modules/datasource/endoflife-date/index.js +2 -2
  146. package/dist/modules/datasource/endoflife-date/index.js.map +1 -1
  147. package/dist/modules/datasource/galaxy/index.js +2 -2
  148. package/dist/modules/datasource/galaxy/index.js.map +1 -1
  149. package/dist/modules/datasource/galaxy-collection/index.js +2 -2
  150. package/dist/modules/datasource/galaxy-collection/index.js.map +1 -1
  151. package/dist/modules/datasource/git-refs/base.js +2 -2
  152. package/dist/modules/datasource/git-refs/base.js.map +1 -1
  153. package/dist/modules/datasource/github-release-attachments/index.js +2 -2
  154. package/dist/modules/datasource/github-release-attachments/index.js.map +1 -1
  155. package/dist/modules/datasource/github-releases/index.js +2 -3
  156. package/dist/modules/datasource/github-releases/index.js.map +1 -1
  157. package/dist/modules/datasource/github-tags/index.js +2 -3
  158. package/dist/modules/datasource/github-tags/index.js.map +1 -1
  159. package/dist/modules/datasource/go/goproxy-parser.js +3 -3
  160. package/dist/modules/datasource/go/goproxy-parser.js.map +1 -1
  161. package/dist/modules/datasource/go/index.js +2 -2
  162. package/dist/modules/datasource/go/index.js.map +1 -1
  163. package/dist/modules/datasource/go/releases-goproxy.js +3 -3
  164. package/dist/modules/datasource/go/releases-goproxy.js.map +1 -1
  165. package/dist/modules/datasource/hackage/index.js +2 -2
  166. package/dist/modules/datasource/hackage/index.js.map +1 -1
  167. package/dist/modules/datasource/hex/schema.js +2 -3
  168. package/dist/modules/datasource/hex/schema.js.map +1 -1
  169. package/dist/modules/datasource/hexpm-bob/index.js +2 -2
  170. package/dist/modules/datasource/hexpm-bob/index.js.map +1 -1
  171. package/dist/modules/datasource/index.js +14 -14
  172. package/dist/modules/datasource/index.js.map +1 -1
  173. package/dist/modules/datasource/jsr/index.js +2 -2
  174. package/dist/modules/datasource/jsr/index.js.map +1 -1
  175. package/dist/modules/datasource/jsr/util.js +3 -4
  176. package/dist/modules/datasource/jsr/util.js.map +1 -1
  177. package/dist/modules/datasource/metadata.js +5 -5
  178. package/dist/modules/datasource/metadata.js.map +1 -1
  179. package/dist/modules/datasource/npm/get.js +2 -2
  180. package/dist/modules/datasource/npm/get.js.map +1 -1
  181. package/dist/modules/datasource/npm/npmrc.js +7 -7
  182. package/dist/modules/datasource/npm/npmrc.js.map +1 -1
  183. package/dist/modules/datasource/nuget/v3.js +2 -2
  184. package/dist/modules/datasource/nuget/v3.js.map +1 -1
  185. package/dist/modules/datasource/packagist/index.js +2 -2
  186. package/dist/modules/datasource/packagist/index.js.map +1 -1
  187. package/dist/modules/datasource/packagist/schema.js +3 -4
  188. package/dist/modules/datasource/packagist/schema.js.map +1 -1
  189. package/dist/modules/datasource/pypi/index.js +2 -2
  190. package/dist/modules/datasource/pypi/index.js.map +1 -1
  191. package/dist/modules/datasource/repology/index.js +3 -3
  192. package/dist/modules/datasource/repology/index.js.map +1 -1
  193. package/dist/modules/datasource/rubygems/schema.js +5 -6
  194. package/dist/modules/datasource/rubygems/schema.js.map +1 -1
  195. package/dist/modules/datasource/util.js +2 -3
  196. package/dist/modules/datasource/util.js.map +1 -1
  197. package/dist/modules/manager/argocd/extract.js +3 -4
  198. package/dist/modules/manager/argocd/extract.js.map +1 -1
  199. package/dist/modules/manager/asdf/extract.js +2 -3
  200. package/dist/modules/manager/asdf/extract.js.map +1 -1
  201. package/dist/modules/manager/bazel/artifacts.js +2 -2
  202. package/dist/modules/manager/bazel/artifacts.js.map +1 -1
  203. package/dist/modules/manager/bazel/common.js +4 -5
  204. package/dist/modules/manager/bazel/common.js.map +1 -1
  205. package/dist/modules/manager/bazel/rules/http.js +3 -4
  206. package/dist/modules/manager/bazel/rules/http.js.map +1 -1
  207. package/dist/modules/manager/bazel/rules/maven.js +2 -3
  208. package/dist/modules/manager/bazel/rules/maven.js.map +1 -1
  209. package/dist/modules/manager/bazel-module/parser/starlark.js +2 -3
  210. package/dist/modules/manager/bazel-module/parser/starlark.js.map +1 -1
  211. package/dist/modules/manager/bazel-module/rules.js +3 -3
  212. package/dist/modules/manager/bazel-module/rules.js.map +1 -1
  213. package/dist/modules/manager/bitrise/utils.js +3 -4
  214. package/dist/modules/manager/bitrise/utils.js.map +1 -1
  215. package/dist/modules/manager/buildpacks/extract.js +2 -3
  216. package/dist/modules/manager/buildpacks/extract.js.map +1 -1
  217. package/dist/modules/manager/bun/artifacts.js +2 -2
  218. package/dist/modules/manager/bun/artifacts.js.map +1 -1
  219. package/dist/modules/manager/bun/extract.js +2 -3
  220. package/dist/modules/manager/bun/extract.js.map +1 -1
  221. package/dist/modules/manager/bundler/artifacts.js +3 -3
  222. package/dist/modules/manager/bundler/artifacts.js.map +1 -1
  223. package/dist/modules/manager/bundler/extract.js +5 -6
  224. package/dist/modules/manager/bundler/extract.js.map +1 -1
  225. package/dist/modules/manager/cargo/extract.js +3 -4
  226. package/dist/modules/manager/cargo/extract.js.map +1 -1
  227. package/dist/modules/manager/composer/artifacts.js +3 -3
  228. package/dist/modules/manager/composer/artifacts.js.map +1 -1
  229. package/dist/modules/manager/composer/utils.js +3 -4
  230. package/dist/modules/manager/composer/utils.js.map +1 -1
  231. package/dist/modules/manager/conan/extract.js +2 -3
  232. package/dist/modules/manager/conan/extract.js.map +1 -1
  233. package/dist/modules/manager/copier/utils.js +3 -4
  234. package/dist/modules/manager/copier/utils.js.map +1 -1
  235. package/dist/modules/manager/crow/extract.js +2 -3
  236. package/dist/modules/manager/crow/extract.js.map +1 -1
  237. package/dist/modules/manager/custom/jsonata/index.js +2 -3
  238. package/dist/modules/manager/custom/jsonata/index.js.map +1 -1
  239. package/dist/modules/manager/custom/jsonata/utils.js +3 -3
  240. package/dist/modules/manager/custom/jsonata/utils.js.map +1 -1
  241. package/dist/modules/manager/custom/regex/index.js +2 -3
  242. package/dist/modules/manager/custom/regex/index.js.map +1 -1
  243. package/dist/modules/manager/custom/regex/strategies.js +4 -5
  244. package/dist/modules/manager/custom/regex/strategies.js.map +1 -1
  245. package/dist/modules/manager/custom/regex/utils.js +2 -2
  246. package/dist/modules/manager/custom/regex/utils.js.map +1 -1
  247. package/dist/modules/manager/custom/utils.js +6 -7
  248. package/dist/modules/manager/custom/utils.js.map +1 -1
  249. package/dist/modules/manager/deps-edn/extract.js +13 -14
  250. package/dist/modules/manager/deps-edn/extract.js.map +1 -1
  251. package/dist/modules/manager/deps-edn/parser.js +2 -2
  252. package/dist/modules/manager/deps-edn/parser.js.map +1 -1
  253. package/dist/modules/manager/devbox/artifacts.js +2 -2
  254. package/dist/modules/manager/devbox/artifacts.js.map +1 -1
  255. package/dist/modules/manager/docker-compose/extract.js +3 -4
  256. package/dist/modules/manager/docker-compose/extract.js.map +1 -1
  257. package/dist/modules/manager/docker-compose/schema.js +2 -3
  258. package/dist/modules/manager/docker-compose/schema.js.map +1 -1
  259. package/dist/modules/manager/dockerfile/extract.js +5 -5
  260. package/dist/modules/manager/dockerfile/extract.js.map +1 -1
  261. package/dist/modules/manager/fingerprint.generated.js +5 -5
  262. package/dist/modules/manager/fingerprint.generated.js.map +1 -1
  263. package/dist/modules/manager/fleet/extract.js +2 -3
  264. package/dist/modules/manager/fleet/extract.js.map +1 -1
  265. package/dist/modules/manager/flux/extract.js +2 -3
  266. package/dist/modules/manager/flux/extract.js.map +1 -1
  267. package/dist/modules/manager/glasskube/extract.js +2 -3
  268. package/dist/modules/manager/glasskube/extract.js.map +1 -1
  269. package/dist/modules/manager/gleam/artifacts.js +3 -4
  270. package/dist/modules/manager/gleam/artifacts.js.map +1 -1
  271. package/dist/modules/manager/gomod/artifacts.js +2 -2
  272. package/dist/modules/manager/gomod/artifacts.js.map +1 -1
  273. package/dist/modules/manager/gradle/artifacts.js +2 -2
  274. package/dist/modules/manager/gradle/artifacts.js.map +1 -1
  275. package/dist/modules/manager/gradle/extract/catalog.js +5 -5
  276. package/dist/modules/manager/gradle/extract/catalog.js.map +1 -1
  277. package/dist/modules/manager/gradle-wrapper/artifacts.js +2 -2
  278. package/dist/modules/manager/gradle-wrapper/artifacts.js.map +1 -1
  279. package/dist/modules/manager/helm-requirements/extract.js +2 -3
  280. package/dist/modules/manager/helm-requirements/extract.js.map +1 -1
  281. package/dist/modules/manager/helmfile/artifacts.js +2 -3
  282. package/dist/modules/manager/helmfile/artifacts.js.map +1 -1
  283. package/dist/modules/manager/helmfile/extract.js +4 -5
  284. package/dist/modules/manager/helmfile/extract.js.map +1 -1
  285. package/dist/modules/manager/helmsman/extract.js +4 -5
  286. package/dist/modules/manager/helmsman/extract.js.map +1 -1
  287. package/dist/modules/manager/helmv3/artifacts.js +4 -4
  288. package/dist/modules/manager/helmv3/artifacts.js.map +1 -1
  289. package/dist/modules/manager/helmv3/extract.js +4 -5
  290. package/dist/modules/manager/helmv3/extract.js.map +1 -1
  291. package/dist/modules/manager/helmv3/oci.js +3 -4
  292. package/dist/modules/manager/helmv3/oci.js.map +1 -1
  293. package/dist/modules/manager/jenkins/extract.js +3 -3
  294. package/dist/modules/manager/jenkins/extract.js.map +1 -1
  295. package/dist/modules/manager/kotlin-script/extract.js +3 -4
  296. package/dist/modules/manager/kotlin-script/extract.js.map +1 -1
  297. package/dist/modules/manager/kubernetes/extract.js +4 -4
  298. package/dist/modules/manager/kubernetes/extract.js.map +1 -1
  299. package/dist/modules/manager/kustomize/artifacts.js +8 -8
  300. package/dist/modules/manager/kustomize/artifacts.js.map +1 -1
  301. package/dist/modules/manager/kustomize/extract.js +8 -8
  302. package/dist/modules/manager/kustomize/extract.js.map +1 -1
  303. package/dist/modules/manager/maven/extract.js +4 -4
  304. package/dist/modules/manager/maven/extract.js.map +1 -1
  305. package/dist/modules/manager/maven/update.js +2 -2
  306. package/dist/modules/manager/maven/update.js.map +1 -1
  307. package/dist/modules/manager/maven-wrapper/artifacts.js +2 -2
  308. package/dist/modules/manager/maven-wrapper/artifacts.js.map +1 -1
  309. package/dist/modules/manager/mise/backends.js +9 -10
  310. package/dist/modules/manager/mise/backends.js.map +1 -1
  311. package/dist/modules/manager/mise/extract.js +7 -8
  312. package/dist/modules/manager/mise/extract.js.map +1 -1
  313. package/dist/modules/manager/mix/artifacts.js +3 -3
  314. package/dist/modules/manager/mix/artifacts.js.map +1 -1
  315. package/dist/modules/manager/nix/artifacts.js +2 -2
  316. package/dist/modules/manager/nix/artifacts.js.map +1 -1
  317. package/dist/modules/manager/npm/detect.js +2 -2
  318. package/dist/modules/manager/npm/detect.js.map +1 -1
  319. package/dist/modules/manager/npm/extract/common/dependency.js +2 -2
  320. package/dist/modules/manager/npm/extract/common/dependency.js.map +1 -1
  321. package/dist/modules/manager/npm/extract/common/overrides.js +3 -4
  322. package/dist/modules/manager/npm/extract/common/overrides.js.map +1 -1
  323. package/dist/modules/manager/npm/extract/common/package-file.js +8 -9
  324. package/dist/modules/manager/npm/extract/common/package-file.js.map +1 -1
  325. package/dist/modules/manager/npm/extract/index.js +10 -10
  326. package/dist/modules/manager/npm/extract/index.js.map +1 -1
  327. package/dist/modules/manager/npm/extract/pnpm.js +7 -7
  328. package/dist/modules/manager/npm/extract/pnpm.js.map +1 -1
  329. package/dist/modules/manager/npm/extract/post/locked-versions.js +3 -3
  330. package/dist/modules/manager/npm/extract/post/locked-versions.js.map +1 -1
  331. package/dist/modules/manager/npm/extract/post/monorepo.js +3 -4
  332. package/dist/modules/manager/npm/extract/post/monorepo.js.map +1 -1
  333. package/dist/modules/manager/npm/extract/yarn.js +2 -3
  334. package/dist/modules/manager/npm/extract/yarn.js.map +1 -1
  335. package/dist/modules/manager/npm/extract/yarnrc.js +2 -3
  336. package/dist/modules/manager/npm/extract/yarnrc.js.map +1 -1
  337. package/dist/modules/manager/npm/post-update/index.js +6 -6
  338. package/dist/modules/manager/npm/post-update/index.js.map +1 -1
  339. package/dist/modules/manager/npm/post-update/npm.js +4 -4
  340. package/dist/modules/manager/npm/post-update/npm.js.map +1 -1
  341. package/dist/modules/manager/npm/post-update/pnpm.js +3 -3
  342. package/dist/modules/manager/npm/post-update/pnpm.js.map +1 -1
  343. package/dist/modules/manager/npm/post-update/rules.js +2 -2
  344. package/dist/modules/manager/npm/post-update/rules.js.map +1 -1
  345. package/dist/modules/manager/npm/post-update/utils.js +2 -2
  346. package/dist/modules/manager/npm/post-update/utils.js.map +1 -1
  347. package/dist/modules/manager/npm/post-update/yarn.js +3 -3
  348. package/dist/modules/manager/npm/post-update/yarn.js.map +1 -1
  349. package/dist/modules/manager/npm/update/dependency/index.js +2 -3
  350. package/dist/modules/manager/npm/update/dependency/index.js.map +1 -1
  351. package/dist/modules/manager/npm/update/dependency/pnpm.js +2 -3
  352. package/dist/modules/manager/npm/update/dependency/pnpm.js.map +1 -1
  353. package/dist/modules/manager/npm/update/dependency/yarn.js +3 -4
  354. package/dist/modules/manager/npm/update/dependency/yarn.js.map +1 -1
  355. package/dist/modules/manager/nuget/config-formatter.js +2 -2
  356. package/dist/modules/manager/nuget/config-formatter.js.map +1 -1
  357. package/dist/modules/manager/nuget/extract.js +4 -4
  358. package/dist/modules/manager/nuget/extract.js.map +1 -1
  359. package/dist/modules/manager/nuget/package-tree.js +2 -2
  360. package/dist/modules/manager/nuget/package-tree.js.map +1 -1
  361. package/dist/modules/manager/ocb/extract.js +2 -3
  362. package/dist/modules/manager/ocb/extract.js.map +1 -1
  363. package/dist/modules/manager/osgi/extract.js +4 -4
  364. package/dist/modules/manager/osgi/extract.js.map +1 -1
  365. package/dist/modules/manager/pep621/artifacts.js +3 -4
  366. package/dist/modules/manager/pep621/artifacts.js.map +1 -1
  367. package/dist/modules/manager/pep621/processors/uv.js +2 -3
  368. package/dist/modules/manager/pep621/processors/uv.js.map +1 -1
  369. package/dist/modules/manager/pep621/utils.js +8 -10
  370. package/dist/modules/manager/pep621/utils.js.map +1 -1
  371. package/dist/modules/manager/pep723/schema.js +2 -3
  372. package/dist/modules/manager/pep723/schema.js.map +1 -1
  373. package/dist/modules/manager/pip-compile/common.js +3 -3
  374. package/dist/modules/manager/pip-compile/common.js.map +1 -1
  375. package/dist/modules/manager/pip_requirements/artifacts.js +2 -3
  376. package/dist/modules/manager/pip_requirements/artifacts.js.map +1 -1
  377. package/dist/modules/manager/pip_requirements/extract.js +2 -3
  378. package/dist/modules/manager/pip_requirements/extract.js.map +1 -1
  379. package/dist/modules/manager/pipenv/artifacts.js +3 -4
  380. package/dist/modules/manager/pipenv/artifacts.js.map +1 -1
  381. package/dist/modules/manager/pipenv/extract.js +6 -7
  382. package/dist/modules/manager/pipenv/extract.js.map +1 -1
  383. package/dist/modules/manager/pixi/artifacts.js +2 -3
  384. package/dist/modules/manager/pixi/artifacts.js.map +1 -1
  385. package/dist/modules/manager/pixi/extract.js +2 -3
  386. package/dist/modules/manager/pixi/extract.js.map +1 -1
  387. package/dist/modules/manager/poetry/artifacts.js +4 -5
  388. package/dist/modules/manager/poetry/artifacts.js.map +1 -1
  389. package/dist/modules/manager/poetry/extract.js +2 -3
  390. package/dist/modules/manager/poetry/extract.js.map +1 -1
  391. package/dist/modules/manager/pre-commit/extract.js +4 -5
  392. package/dist/modules/manager/pre-commit/extract.js.map +1 -1
  393. package/dist/modules/manager/pub/artifacts.js +3 -4
  394. package/dist/modules/manager/pub/artifacts.js.map +1 -1
  395. package/dist/modules/manager/pub/extract.js +8 -11
  396. package/dist/modules/manager/pub/extract.js.map +1 -1
  397. package/dist/modules/manager/renovate-config-presets/extract.js +4 -5
  398. package/dist/modules/manager/renovate-config-presets/extract.js.map +1 -1
  399. package/dist/modules/manager/tekton/extract.js +9 -10
  400. package/dist/modules/manager/tekton/extract.js.map +1 -1
  401. package/dist/modules/manager/terraform/base.js +2 -3
  402. package/dist/modules/manager/terraform/base.js.map +1 -1
  403. package/dist/modules/manager/terraform/extract.js +2 -2
  404. package/dist/modules/manager/terraform/extract.js.map +1 -1
  405. package/dist/modules/manager/terraform/extractors/others/modules.js +3 -4
  406. package/dist/modules/manager/terraform/extractors/others/modules.js.map +1 -1
  407. package/dist/modules/manager/terraform/extractors/others/providers.js +3 -4
  408. package/dist/modules/manager/terraform/extractors/others/providers.js.map +1 -1
  409. package/dist/modules/manager/terraform/extractors/resources/generic-docker-image-ref.js +7 -8
  410. package/dist/modules/manager/terraform/extractors/resources/generic-docker-image-ref.js.map +1 -1
  411. package/dist/modules/manager/terraform/extractors/resources/helm-release.js +5 -6
  412. package/dist/modules/manager/terraform/extractors/resources/helm-release.js.map +1 -1
  413. package/dist/modules/manager/terraform/extractors/resources/terraform-workspace.js +3 -4
  414. package/dist/modules/manager/terraform/extractors/resources/terraform-workspace.js.map +1 -1
  415. package/dist/modules/manager/terraform/extractors/terraform-block/required-provider.js +4 -5
  416. package/dist/modules/manager/terraform/extractors/terraform-block/required-provider.js.map +1 -1
  417. package/dist/modules/manager/terraform/extractors/terraform-block/terraform-version.js +3 -3
  418. package/dist/modules/manager/terraform/extractors/terraform-block/terraform-version.js.map +1 -1
  419. package/dist/modules/manager/terraform/lockfile/index.js +2 -2
  420. package/dist/modules/manager/terraform/lockfile/index.js.map +1 -1
  421. package/dist/modules/manager/terraform/lockfile/util.js +2 -3
  422. package/dist/modules/manager/terraform/lockfile/util.js.map +1 -1
  423. package/dist/modules/manager/terraform/util.js +2 -3
  424. package/dist/modules/manager/terraform/util.js.map +1 -1
  425. package/dist/modules/manager/tflint-plugin/plugins.js +2 -3
  426. package/dist/modules/manager/tflint-plugin/plugins.js.map +1 -1
  427. package/dist/modules/manager/travis/extract.js +5 -6
  428. package/dist/modules/manager/travis/extract.js.map +1 -1
  429. package/dist/modules/manager/woodpecker/extract.js +2 -3
  430. package/dist/modules/manager/woodpecker/extract.js.map +1 -1
  431. package/dist/modules/platform/azure/index.js +2 -2
  432. package/dist/modules/platform/azure/index.js.map +1 -1
  433. package/dist/modules/platform/bitbucket/index.js +5 -5
  434. package/dist/modules/platform/bitbucket/index.js.map +1 -1
  435. package/dist/modules/platform/bitbucket-server/pr-cache.js +2 -2
  436. package/dist/modules/platform/bitbucket-server/pr-cache.js.map +1 -1
  437. package/dist/modules/platform/bitbucket-server/utils.js +2 -2
  438. package/dist/modules/platform/bitbucket-server/utils.js.map +1 -1
  439. package/dist/modules/platform/codecommit/codecommit-client.js +2 -2
  440. package/dist/modules/platform/codecommit/codecommit-client.js.map +1 -1
  441. package/dist/modules/platform/forgejo/index.js +5 -5
  442. package/dist/modules/platform/forgejo/index.js.map +1 -1
  443. package/dist/modules/platform/forgejo/utils.js +2 -2
  444. package/dist/modules/platform/forgejo/utils.js.map +1 -1
  445. package/dist/modules/platform/gitea/index.js +5 -5
  446. package/dist/modules/platform/gitea/index.js.map +1 -1
  447. package/dist/modules/platform/gitea/utils.js +2 -2
  448. package/dist/modules/platform/gitea/utils.js.map +1 -1
  449. package/dist/modules/platform/github/common.js +4 -5
  450. package/dist/modules/platform/github/common.js.map +1 -1
  451. package/dist/modules/platform/github/index.js +5 -5
  452. package/dist/modules/platform/github/index.js.map +1 -1
  453. package/dist/modules/platform/github/pr.js +2 -3
  454. package/dist/modules/platform/github/pr.js.map +1 -1
  455. package/dist/modules/platform/gitlab/http.js +2 -3
  456. package/dist/modules/platform/gitlab/http.js.map +1 -1
  457. package/dist/modules/platform/gitlab/index.js +3 -3
  458. package/dist/modules/platform/gitlab/index.js.map +1 -1
  459. package/dist/modules/platform/gitlab/utils.js +3 -3
  460. package/dist/modules/platform/gitlab/utils.js.map +1 -1
  461. package/dist/modules/platform/pr-body.js +2 -3
  462. package/dist/modules/platform/pr-body.js.map +1 -1
  463. package/dist/modules/versioning/composer/index.js +2 -3
  464. package/dist/modules/versioning/composer/index.js.map +1 -1
  465. package/dist/modules/versioning/generic.js +5 -6
  466. package/dist/modules/versioning/generic.js.map +1 -1
  467. package/dist/modules/versioning/gradle/compare.js +3 -4
  468. package/dist/modules/versioning/gradle/compare.js.map +1 -1
  469. package/dist/modules/versioning/nixpkgs/index.js +6 -7
  470. package/dist/modules/versioning/nixpkgs/index.js.map +1 -1
  471. package/dist/modules/versioning/npm/range.js +2 -2
  472. package/dist/modules/versioning/npm/range.js.map +1 -1
  473. package/dist/modules/versioning/rpm/index.js +4 -5
  474. package/dist/modules/versioning/rpm/index.js.map +1 -1
  475. package/dist/modules/versioning/schema.js +2 -2
  476. package/dist/modules/versioning/schema.js.map +1 -1
  477. package/dist/modules/versioning/semver-coerced/index.js +3 -3
  478. package/dist/modules/versioning/semver-coerced/index.js.map +1 -1
  479. package/dist/modules/versioning/semver-partial/index.js +4 -4
  480. package/dist/modules/versioning/semver-partial/index.js.map +1 -1
  481. package/dist/proxy.js +3 -4
  482. package/dist/proxy.js.map +1 -1
  483. package/dist/util/array.js +4 -5
  484. package/dist/util/array.js.map +1 -1
  485. package/dist/util/assign-keys.js +2 -3
  486. package/dist/util/assign-keys.js.map +1 -1
  487. package/dist/util/cache/package/decorator.js +6 -6
  488. package/dist/util/cache/package/decorator.js.map +1 -1
  489. package/dist/util/cache/package/ttl.js +4 -5
  490. package/dist/util/cache/package/ttl.js.map +1 -1
  491. package/dist/util/cache/repository/impl/base.js +3 -4
  492. package/dist/util/cache/repository/impl/base.js.map +1 -1
  493. package/dist/util/cache/repository/impl/s3.js +2 -3
  494. package/dist/util/cache/repository/impl/s3.js.map +1 -1
  495. package/dist/util/exec/common.js +2 -3
  496. package/dist/util/exec/common.js.map +1 -1
  497. package/dist/util/exec/containerbase.js +2 -2
  498. package/dist/util/exec/containerbase.js.map +1 -1
  499. package/dist/util/exec/docker/index.js +5 -5
  500. package/dist/util/exec/docker/index.js.map +1 -1
  501. package/dist/util/exec/index.js +2 -2
  502. package/dist/util/exec/index.js.map +1 -1
  503. package/dist/util/exec/utils.js +3 -4
  504. package/dist/util/exec/utils.js.map +1 -1
  505. package/dist/util/filter-map.js +2 -3
  506. package/dist/util/filter-map.js.map +1 -1
  507. package/dist/util/fs/index.js +3 -3
  508. package/dist/util/fs/index.js.map +1 -1
  509. package/dist/util/git/auth.js +2 -3
  510. package/dist/util/git/auth.js.map +1 -1
  511. package/dist/util/git/config.js +3 -4
  512. package/dist/util/git/config.js.map +1 -1
  513. package/dist/util/git/index.js +4 -4
  514. package/dist/util/git/index.js.map +1 -1
  515. package/dist/util/git/private-key.js +2 -2
  516. package/dist/util/git/private-key.js.map +1 -1
  517. package/dist/util/host-rules.js +6 -6
  518. package/dist/util/host-rules.js.map +1 -1
  519. package/dist/util/http/auth.js +3 -4
  520. package/dist/util/http/auth.js.map +1 -1
  521. package/dist/util/http/bitbucket-server.js +2 -3
  522. package/dist/util/http/bitbucket-server.js.map +1 -1
  523. package/dist/util/http/bitbucket.js +3 -4
  524. package/dist/util/http/bitbucket.js.map +1 -1
  525. package/dist/util/http/cache/package-http-cache-provider.js +2 -2
  526. package/dist/util/http/cache/package-http-cache-provider.js.map +1 -1
  527. package/dist/util/http/forgejo.js +3 -4
  528. package/dist/util/http/forgejo.js.map +1 -1
  529. package/dist/util/http/gitea.js +3 -4
  530. package/dist/util/http/gitea.js.map +1 -1
  531. package/dist/util/http/github.js +10 -10
  532. package/dist/util/http/github.js.map +1 -1
  533. package/dist/util/http/gitlab.js +4 -5
  534. package/dist/util/http/gitlab.js.map +1 -1
  535. package/dist/util/http/host-rules.js +10 -10
  536. package/dist/util/http/host-rules.js.map +1 -1
  537. package/dist/util/http/http.js +5 -5
  538. package/dist/util/http/http.js.map +1 -1
  539. package/dist/util/http/rate-limits.js +3 -3
  540. package/dist/util/http/rate-limits.js.map +1 -1
  541. package/dist/util/interpolator.js +8 -9
  542. package/dist/util/interpolator.js.map +1 -1
  543. package/dist/util/merge-confidence/index.js +5 -5
  544. package/dist/util/merge-confidence/index.js.map +1 -1
  545. package/dist/util/number.js +2 -3
  546. package/dist/util/number.js.map +1 -1
  547. package/dist/util/package-rules/base-branches.js +3 -4
  548. package/dist/util/package-rules/base-branches.js.map +1 -1
  549. package/dist/util/package-rules/categories.js +3 -4
  550. package/dist/util/package-rules/categories.js.map +1 -1
  551. package/dist/util/package-rules/current-age.js +3 -4
  552. package/dist/util/package-rules/current-age.js.map +1 -1
  553. package/dist/util/package-rules/current-value.js +2 -3
  554. package/dist/util/package-rules/current-value.js.map +1 -1
  555. package/dist/util/package-rules/current-version.js +5 -5
  556. package/dist/util/package-rules/current-version.js.map +1 -1
  557. package/dist/util/package-rules/datasources.js +3 -4
  558. package/dist/util/package-rules/datasources.js.map +1 -1
  559. package/dist/util/package-rules/dep-names.js +3 -4
  560. package/dist/util/package-rules/dep-names.js.map +1 -1
  561. package/dist/util/package-rules/dep-types.js +2 -3
  562. package/dist/util/package-rules/dep-types.js.map +1 -1
  563. package/dist/util/package-rules/files.js +4 -5
  564. package/dist/util/package-rules/files.js.map +1 -1
  565. package/dist/util/package-rules/index.js +6 -6
  566. package/dist/util/package-rules/index.js.map +1 -1
  567. package/dist/util/package-rules/managers.js +3 -4
  568. package/dist/util/package-rules/managers.js.map +1 -1
  569. package/dist/util/package-rules/merge-confidence.js +5 -6
  570. package/dist/util/package-rules/merge-confidence.js.map +1 -1
  571. package/dist/util/package-rules/new-value.js +2 -3
  572. package/dist/util/package-rules/new-value.js.map +1 -1
  573. package/dist/util/package-rules/package-names.js +2 -3
  574. package/dist/util/package-rules/package-names.js.map +1 -1
  575. package/dist/util/package-rules/repositories.js +3 -4
  576. package/dist/util/package-rules/repositories.js.map +1 -1
  577. package/dist/util/package-rules/sourceurls.js +2 -3
  578. package/dist/util/package-rules/sourceurls.js.map +1 -1
  579. package/dist/util/package-rules/update-types.js +2 -3
  580. package/dist/util/package-rules/update-types.js.map +1 -1
  581. package/dist/util/pretty-time.js +4 -4
  582. package/dist/util/pretty-time.js.map +1 -1
  583. package/dist/util/regex.js +2 -3
  584. package/dist/util/regex.js.map +1 -1
  585. package/dist/util/s3.js +2 -3
  586. package/dist/util/s3.js.map +1 -1
  587. package/dist/util/sanitize.js +2 -3
  588. package/dist/util/sanitize.js.map +1 -1
  589. package/dist/util/string-match.js +2 -3
  590. package/dist/util/string-match.js.map +1 -1
  591. package/dist/util/template/index.js +6 -6
  592. package/dist/util/template/index.js.map +1 -1
  593. package/dist/util/url.js +5 -5
  594. package/dist/util/url.js.map +1 -1
  595. package/dist/workers/global/autodiscover.js +3 -4
  596. package/dist/workers/global/autodiscover.js.map +1 -1
  597. package/dist/workers/global/config/parse/additional-config-file.js +4 -4
  598. package/dist/workers/global/config/parse/additional-config-file.js.map +1 -1
  599. package/dist/workers/global/config/parse/coersions.js +2 -2
  600. package/dist/workers/global/config/parse/coersions.js.map +1 -1
  601. package/dist/workers/global/config/parse/env.js +2 -2
  602. package/dist/workers/global/config/parse/env.js.map +1 -1
  603. package/dist/workers/global/config/parse/file.js +5 -5
  604. package/dist/workers/global/config/parse/file.js.map +1 -1
  605. package/dist/workers/global/config/parse/index.js +6 -7
  606. package/dist/workers/global/config/parse/index.js.map +1 -1
  607. package/dist/workers/global/config/parse/util.js +2 -2
  608. package/dist/workers/global/config/parse/util.js.map +1 -1
  609. package/dist/workers/global/index.js +5 -5
  610. package/dist/workers/global/index.js.map +1 -1
  611. package/dist/workers/global/limits.js +6 -7
  612. package/dist/workers/global/limits.js.map +1 -1
  613. package/dist/workers/repository/config-migration/branch/index.js +2 -3
  614. package/dist/workers/repository/config-migration/branch/index.js.map +1 -1
  615. package/dist/workers/repository/config-migration/branch/migrated-data.js +2 -2
  616. package/dist/workers/repository/config-migration/branch/migrated-data.js.map +1 -1
  617. package/dist/workers/repository/config-migration/pr/index.js +3 -3
  618. package/dist/workers/repository/config-migration/pr/index.js.map +1 -1
  619. package/dist/workers/repository/dependency-dashboard.js +10 -10
  620. package/dist/workers/repository/dependency-dashboard.js.map +1 -1
  621. package/dist/workers/repository/extract/index.js +2 -3
  622. package/dist/workers/repository/extract/index.js.map +1 -1
  623. package/dist/workers/repository/extract/manager-files.js +2 -3
  624. package/dist/workers/repository/extract/manager-files.js.map +1 -1
  625. package/dist/workers/repository/extract/supersedes.js +4 -5
  626. package/dist/workers/repository/extract/supersedes.js.map +1 -1
  627. package/dist/workers/repository/finalize/prune.js +2 -3
  628. package/dist/workers/repository/finalize/prune.js.map +1 -1
  629. package/dist/workers/repository/init/inherited.js +5 -5
  630. package/dist/workers/repository/init/inherited.js.map +1 -1
  631. package/dist/workers/repository/init/merge.js +13 -13
  632. package/dist/workers/repository/init/merge.js.map +1 -1
  633. package/dist/workers/repository/model/commit-message.js +2 -3
  634. package/dist/workers/repository/model/commit-message.js.map +1 -1
  635. package/dist/workers/repository/onboarding/branch/index.js +2 -3
  636. package/dist/workers/repository/onboarding/branch/index.js.map +1 -1
  637. package/dist/workers/repository/onboarding/branch/onboarding-branch-cache.js +5 -6
  638. package/dist/workers/repository/onboarding/branch/onboarding-branch-cache.js.map +1 -1
  639. package/dist/workers/repository/onboarding/pr/config-description.js +2 -5
  640. package/dist/workers/repository/onboarding/pr/config-description.js.map +1 -1
  641. package/dist/workers/repository/onboarding/pr/index.js +3 -3
  642. package/dist/workers/repository/onboarding/pr/index.js.map +1 -1
  643. package/dist/workers/repository/package-files.js +8 -9
  644. package/dist/workers/repository/package-files.js.map +1 -1
  645. package/dist/workers/repository/process/extract-update.js +2 -2
  646. package/dist/workers/repository/process/extract-update.js.map +1 -1
  647. package/dist/workers/repository/process/fetch.js +3 -3
  648. package/dist/workers/repository/process/fetch.js.map +1 -1
  649. package/dist/workers/repository/process/lookup/current.js +2 -3
  650. package/dist/workers/repository/process/lookup/current.js.map +1 -1
  651. package/dist/workers/repository/process/lookup/filter-checks.js +4 -5
  652. package/dist/workers/repository/process/lookup/filter-checks.js.map +1 -1
  653. package/dist/workers/repository/process/lookup/generate.js +2 -3
  654. package/dist/workers/repository/process/lookup/generate.js.map +1 -1
  655. package/dist/workers/repository/process/lookup/index.js +15 -16
  656. package/dist/workers/repository/process/lookup/index.js.map +1 -1
  657. package/dist/workers/repository/process/lookup/utils.js +7 -7
  658. package/dist/workers/repository/process/lookup/utils.js.map +1 -1
  659. package/dist/workers/repository/process/vulnerabilities.js +11 -11
  660. package/dist/workers/repository/process/vulnerabilities.js.map +1 -1
  661. package/dist/workers/repository/process/write.js +2 -3
  662. package/dist/workers/repository/process/write.js.map +1 -1
  663. package/dist/workers/repository/reconfigure/comment.js +2 -5
  664. package/dist/workers/repository/reconfigure/comment.js.map +1 -1
  665. package/dist/workers/repository/reconfigure/utils.js +2 -3
  666. package/dist/workers/repository/reconfigure/utils.js.map +1 -1
  667. package/dist/workers/repository/reconfigure/validate.js +2 -3
  668. package/dist/workers/repository/reconfigure/validate.js.map +1 -1
  669. package/dist/workers/repository/update/branch/auto-replace.js +4 -5
  670. package/dist/workers/repository/update/branch/auto-replace.js.map +1 -1
  671. package/dist/workers/repository/update/branch/commit.js +3 -4
  672. package/dist/workers/repository/update/branch/commit.js.map +1 -1
  673. package/dist/workers/repository/update/branch/execute-post-upgrade-commands.js +12 -5
  674. package/dist/workers/repository/update/branch/execute-post-upgrade-commands.js.map +1 -1
  675. package/dist/workers/repository/update/branch/get-updated.js +8 -9
  676. package/dist/workers/repository/update/branch/get-updated.js.map +1 -1
  677. package/dist/workers/repository/update/branch/index.js +3 -3
  678. package/dist/workers/repository/update/branch/index.js.map +1 -1
  679. package/dist/workers/repository/update/branch/schedule.js +2 -2
  680. package/dist/workers/repository/update/branch/schedule.js.map +1 -1
  681. package/dist/workers/repository/update/pr/body/notes.js +2 -2
  682. package/dist/workers/repository/update/pr/body/notes.js.map +1 -1
  683. package/dist/workers/repository/update/pr/changelog/bitbucket/index.js +2 -2
  684. package/dist/workers/repository/update/pr/changelog/bitbucket/index.js.map +1 -1
  685. package/dist/workers/repository/update/pr/changelog/index.js +3 -3
  686. package/dist/workers/repository/update/pr/changelog/index.js.map +1 -1
  687. package/dist/workers/repository/update/pr/changelog/release-notes.js +4 -4
  688. package/dist/workers/repository/update/pr/changelog/release-notes.js.map +1 -1
  689. package/dist/workers/repository/update/pr/changelog/source.js +8 -8
  690. package/dist/workers/repository/update/pr/changelog/source.js.map +1 -1
  691. package/dist/workers/repository/update/pr/code-owners.js +2 -2
  692. package/dist/workers/repository/update/pr/code-owners.js.map +1 -1
  693. package/dist/workers/repository/update/pr/index.js +7 -8
  694. package/dist/workers/repository/update/pr/index.js.map +1 -1
  695. package/dist/workers/repository/update/pr/labels.js +4 -4
  696. package/dist/workers/repository/update/pr/labels.js.map +1 -1
  697. package/dist/workers/repository/update/pr/participants.js +4 -5
  698. package/dist/workers/repository/update/pr/participants.js.map +1 -1
  699. package/dist/workers/repository/updates/generate.js +4 -4
  700. package/dist/workers/repository/updates/generate.js.map +1 -1
  701. package/package.json +1 -1
  702. package/renovate-schema.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"providers.js","sourceRoot":"","sources":["../../../../../../lib/modules/manager/terraform/extractors/others/providers.ts"],"names":[],"mappings":";;;;AAAA,kEAAkC;AAClC,kDAA+C;AAE/C,qCAAwD;AAIxD,MAAa,kBAAmB,SAAQ,iCAA0B;IAChE,YAAY;QACV,OAAO,CAAC,UAAU,CAAC,CAAC;IACtB,CAAC;IAED,OAAO,CACL,OAAgC,EAChC,KAAqB;QAErB,MAAM,aAAa,GAAG,OAAO,EAAE,QAAQ,CAAC;QACxC,IAAI,YAAE,CAAC,eAAe,CAAC,aAAa,CAAC,EAAE,CAAC;YACtC,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,oCAAoC;QACpC,IAAI,CAAC,YAAE,CAAC,WAAW,CAAC,aAAa,CAAC,EAAE,CAAC;YACnC,eAAM,CAAC,KAAK,CACV,EAAE,aAAa,EAAE,EACjB,6CAA6C,CAC9C,CAAC;YACF,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,MAAM,YAAY,GAAG,EAAE,CAAC;QACxB,KAAK,MAAM,gBAAgB,IAAI,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC;YAC1D,KAAK,MAAM,mBAAmB,IAAI,aAAa,CAAC,gBAAgB,CAAC,EAAE,CAAC;gBAClE,MAAM,GAAG,GAAG,IAAI,CAAC,wBAAwB,CACvC;oBACE,YAAY,EAAE,mBAAmB,CAAC,OAAO;oBACzC,WAAW,EAAE;wBACX,UAAU,EAAE,gBAAgB;qBAC7B;iBACF,EACD,KAAK,EACL,UAAU,CACX,CAAC;gBACF,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACzB,CAAC;QACH,CAAC;QACD,OAAO,YAAY,CAAC;IACtB,CAAC;CACF;AAzCD,gDAyCC","sourcesContent":["import is from '@sindresorhus/is';\nimport { logger } from '../../../../../logger';\nimport type { PackageDependency } from '../../../types';\nimport { TerraformProviderExtractor } from '../../base';\nimport type { TerraformDefinitionFile } from '../../hcl/types';\nimport type { ProviderLock } from '../../lockfile/types';\n\nexport class ProvidersExtractor extends TerraformProviderExtractor {\n getCheckList(): string[] {\n return ['provider'];\n }\n\n extract(\n hclRoot: TerraformDefinitionFile,\n locks: ProviderLock[],\n ): PackageDependency[] {\n const providerTypes = hclRoot?.provider;\n if (is.nullOrUndefined(providerTypes)) {\n return [];\n }\n\n /* v8 ignore next 7 -- needs test */\n if (!is.plainObject(providerTypes)) {\n logger.debug(\n { providerTypes },\n 'Terraform: unexpected `providerTypes` value',\n );\n return [];\n }\n\n const dependencies = [];\n for (const providerTypeName of Object.keys(providerTypes)) {\n for (const providerTypeElement of providerTypes[providerTypeName]) {\n const dep = this.analyzeTerraformProvider(\n {\n currentValue: providerTypeElement.version,\n managerData: {\n moduleName: providerTypeName,\n },\n },\n locks,\n 'provider',\n );\n dependencies.push(dep);\n }\n }\n return dependencies;\n }\n}\n"]}
1
+ {"version":3,"file":"providers.js","sourceRoot":"","sources":["../../../../../../lib/modules/manager/terraform/extractors/others/providers.ts"],"names":[],"mappings":";;;AAAA,yCAAoE;AACpE,kDAA+C;AAE/C,qCAAwD;AAIxD,MAAa,kBAAmB,SAAQ,iCAA0B;IAChE,YAAY;QACV,OAAO,CAAC,UAAU,CAAC,CAAC;IACtB,CAAC;IAED,OAAO,CACL,OAAgC,EAChC,KAAqB;QAErB,MAAM,aAAa,GAAG,OAAO,EAAE,QAAQ,CAAC;QACxC,IAAI,IAAA,sBAAiB,EAAC,aAAa,CAAC,EAAE,CAAC;YACrC,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,oCAAoC;QACpC,IAAI,CAAC,IAAA,kBAAa,EAAC,aAAa,CAAC,EAAE,CAAC;YAClC,eAAM,CAAC,KAAK,CACV,EAAE,aAAa,EAAE,EACjB,6CAA6C,CAC9C,CAAC;YACF,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,MAAM,YAAY,GAAG,EAAE,CAAC;QACxB,KAAK,MAAM,gBAAgB,IAAI,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC;YAC1D,KAAK,MAAM,mBAAmB,IAAI,aAAa,CAAC,gBAAgB,CAAC,EAAE,CAAC;gBAClE,MAAM,GAAG,GAAG,IAAI,CAAC,wBAAwB,CACvC;oBACE,YAAY,EAAE,mBAAmB,CAAC,OAAO;oBACzC,WAAW,EAAE;wBACX,UAAU,EAAE,gBAAgB;qBAC7B;iBACF,EACD,KAAK,EACL,UAAU,CACX,CAAC;gBACF,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACzB,CAAC;QACH,CAAC;QACD,OAAO,YAAY,CAAC;IACtB,CAAC;CACF;AAzCD,gDAyCC","sourcesContent":["import { isNullOrUndefined, isPlainObject } from '@sindresorhus/is';\nimport { logger } from '../../../../../logger';\nimport type { PackageDependency } from '../../../types';\nimport { TerraformProviderExtractor } from '../../base';\nimport type { TerraformDefinitionFile } from '../../hcl/types';\nimport type { ProviderLock } from '../../lockfile/types';\n\nexport class ProvidersExtractor extends TerraformProviderExtractor {\n getCheckList(): string[] {\n return ['provider'];\n }\n\n extract(\n hclRoot: TerraformDefinitionFile,\n locks: ProviderLock[],\n ): PackageDependency[] {\n const providerTypes = hclRoot?.provider;\n if (isNullOrUndefined(providerTypes)) {\n return [];\n }\n\n /* v8 ignore next 7 -- needs test */\n if (!isPlainObject(providerTypes)) {\n logger.debug(\n { providerTypes },\n 'Terraform: unexpected `providerTypes` value',\n );\n return [];\n }\n\n const dependencies = [];\n for (const providerTypeName of Object.keys(providerTypes)) {\n for (const providerTypeElement of providerTypes[providerTypeName]) {\n const dep = this.analyzeTerraformProvider(\n {\n currentValue: providerTypeElement.version,\n managerData: {\n moduleName: providerTypeName,\n },\n },\n locks,\n 'provider',\n );\n dependencies.push(dep);\n }\n }\n return dependencies;\n }\n}\n"]}
@@ -1,8 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.GenericDockerImageRefExtractor = void 0;
4
- const tslib_1 = require("tslib");
5
- const is_1 = tslib_1.__importDefault(require("@sindresorhus/is"));
4
+ const is_1 = require("@sindresorhus/is");
6
5
  const extract_1 = require("../../../dockerfile/extract");
7
6
  const base_1 = require("../../base");
8
7
  const utils_1 = require("./utils");
@@ -17,7 +16,7 @@ class GenericDockerImageRefExtractor extends base_1.DependencyExtractor {
17
16
  return dependencies;
18
17
  }
19
18
  extractResources(typeMap, image_definitions, config) {
20
- if (is_1.default.nullOrUndefined(typeMap)) {
19
+ if ((0, is_1.isNullOrUndefined)(typeMap)) {
21
20
  return [];
22
21
  }
23
22
  const dependencies = [];
@@ -25,7 +24,7 @@ class GenericDockerImageRefExtractor extends base_1.DependencyExtractor {
25
24
  const { type, path } = image_resource_def;
26
25
  const resourceInstancesMap = typeMap[type];
27
26
  // is there a resource with current looked at type ( `image_resource_def` )
28
- if (!is_1.default.nonEmptyObject(resourceInstancesMap)) {
27
+ if (!(0, is_1.isNonEmptyObject)(resourceInstancesMap)) {
29
28
  continue;
30
29
  }
31
30
  // loop over instances of a resource type
@@ -48,7 +47,7 @@ class GenericDockerImageRefExtractor extends base_1.DependencyExtractor {
48
47
  // if there are no path elements left, we have reached the end of the path
49
48
  if (leftPath.length === 0) {
50
49
  /* v8 ignore next 8 -- needs test */
51
- if (!is_1.default.nonEmptyString(parentElement)) {
50
+ if (!(0, is_1.isNonEmptyString)(parentElement)) {
52
51
  return [
53
52
  {
54
53
  ...abstractDep,
@@ -66,10 +65,10 @@ class GenericDockerImageRefExtractor extends base_1.DependencyExtractor {
66
65
  // is this a list iterator
67
66
  const pathElement = leftPath[0];
68
67
  // get sub element
69
- const element = is_1.default.nonEmptyObject(parentElement)
68
+ const element = (0, is_1.isNonEmptyObject)(parentElement)
70
69
  ? parentElement[pathElement]
71
70
  : null;
72
- if (is_1.default.nullOrUndefined(element)) {
71
+ if ((0, is_1.isNullOrUndefined)(element)) {
73
72
  return leftPath.length === 1 // if this is the last element assume a false defined dependency
74
73
  ? [
75
74
  {
@@ -79,7 +78,7 @@ class GenericDockerImageRefExtractor extends base_1.DependencyExtractor {
79
78
  ]
80
79
  : [];
81
80
  }
82
- if (is_1.default.array(element)) {
81
+ if ((0, is_1.isArray)(element)) {
83
82
  for (const arrayElement of element) {
84
83
  dependencies.push(...this.walkPath(abstractDep, arrayElement, leftPath.slice(1), config));
85
84
  }
@@ -1 +1 @@
1
- {"version":3,"file":"generic-docker-image-ref.js","sourceRoot":"","sources":["../../../../../../lib/modules/manager/terraform/extractors/resources/generic-docker-image-ref.ts"],"names":[],"mappings":";;;;AAAA,kEAAkC;AAClC,yDAAqD;AAErD,qCAAiD;AAIjD,mCAA2E;AAE3E,MAAa,8BAA+B,SAAQ,0BAAmB;IACrE,YAAY;QACV,OAAO,CAAC,GAAG,8BAAsB,EAAE,GAAG,gCAAwB,CAAC,CAAC,GAAG,CACjE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,KAAK,CAAC,IAAI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AAC,CAAC,EACjB,MAAM,CACP,CACF,CAAC;YACJ,CAAC;YACD,OAAO,YAAY,CAAC;QACtB,CAAC;QACD,OAAO,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IACxE,CAAC;CACF;AAzHD,wEAyHC","sourcesContent":["import is from '@sindresorhus/is';\nimport { getDep } from '../../../dockerfile/extract';\nimport type { ExtractConfig, PackageDependency } from '../../../types';\nimport { DependencyExtractor } from '../../base';\nimport type { TerraformDefinitionFile } from '../../hcl/types';\nimport type { ProviderLock } from '../../lockfile/types';\nimport type { GenericImageResourceDef } from '../../types';\nimport { generic_image_datasource, generic_image_resource } from './utils';\n\nexport class GenericDockerImageRefExtractor extends DependencyExtractor {\n getCheckList(): string[] {\n return [...generic_image_resource, ...generic_image_datasource].map(\n (value) => `\"${value.type}\"`,\n );\n }\n\n extract(\n hclMap: TerraformDefinitionFile,\n _locks: ProviderLock[],\n config: ExtractConfig,\n ): PackageDependency[] {\n const dependencies = [];\n\n dependencies.push(\n ...this.extractResources(hclMap.resource, generic_image_resource, config),\n );\n\n dependencies.push(\n ...this.extractResources(hclMap.data, generic_image_datasource, config),\n );\n\n return dependencies;\n }\n\n private extractResources(\n typeMap: Record<string, unknown> | undefined,\n image_definitions: GenericImageResourceDef[],\n config: ExtractConfig,\n ): PackageDependency[] {\n if (is.nullOrUndefined(typeMap)) {\n return [];\n }\n\n const dependencies = [];\n\n for (const image_resource_def of image_definitions) {\n const { type, path } = image_resource_def;\n const resourceInstancesMap = typeMap[type];\n // is there a resource with current looked at type ( `image_resource_def` )\n if (!is.nonEmptyObject(resourceInstancesMap)) {\n continue;\n }\n\n // loop over instances of a resource type\n for (const instance of Object.values(resourceInstancesMap).flat()) {\n dependencies.push(\n ...this.walkPath({ depType: type }, instance, path, config),\n );\n }\n }\n\n return dependencies;\n }\n\n /**\n * Recursively follow the path to find elements on the path.\n * If a path element is '*' the parentElement will be interpreted as a list\n * and each element will be followed\n * @param abstractDep dependency which will used as basis for adding attributes\n * @param parentElement element from which the next element will be extracted\n * @param leftPath path elements left to walk down\n */\n private walkPath(\n abstractDep: PackageDependency,\n parentElement: unknown,\n leftPath: string[],\n config: ExtractConfig,\n ): PackageDependency[] {\n const dependencies: PackageDependency[] = [];\n // if there are no path elements left, we have reached the end of the path\n if (leftPath.length === 0) {\n /* v8 ignore next 8 -- needs test */\n if (!is.nonEmptyString(parentElement)) {\n return [\n {\n ...abstractDep,\n skipReason: 'invalid-dependency-specification',\n },\n ];\n }\n const test = getDep(parentElement, true, config.registryAliases);\n const dep: PackageDependency = {\n ...abstractDep,\n ...test,\n };\n return [dep];\n }\n\n // is this a list iterator\n const pathElement = leftPath[0];\n\n // get sub element\n const element = is.nonEmptyObject(parentElement)\n ? parentElement[pathElement]\n : null;\n if (is.nullOrUndefined(element)) {\n return leftPath.length === 1 // if this is the last element assume a false defined dependency\n ? [\n {\n ...abstractDep,\n skipReason: 'invalid-dependency-specification',\n },\n ]\n : [];\n }\n if (is.array(element)) {\n for (const arrayElement of element) {\n dependencies.push(\n ...this.walkPath(\n abstractDep,\n arrayElement,\n leftPath.slice(1),\n config,\n ),\n );\n }\n return dependencies;\n }\n return this.walkPath(abstractDep, element, leftPath.slice(1), config);\n }\n}\n"]}
1
+ {"version":3,"file":"generic-docker-image-ref.js","sourceRoot":"","sources":["../../../../../../lib/modules/manager/terraform/extractors/resources/generic-docker-image-ref.ts"],"names":[],"mappings":";;;AAAA,yCAK0B;AAC1B,yDAAqD;AAErD,qCAAiD;AAIjD,mCAA2E;AAE3E,MAAa,8BAA+B,SAAQ,0BAAmB;IACrE,YAAY;QACV,OAAO,CAAC,GAAG,8BAAsB,EAAE,GAAG,gCAAwB,CAAC,CAAC,GAAG,CACjE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,KAAK,CAAC,IAAI,GAAG,CAC7B,CAAC;IACJ,CAAC;IAED,OAAO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AY,CAAC;QACtB,CAAC;QACD,OAAO,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IACxE,CAAC;CACF;AAzHD,wEAyHC","sourcesContent":["import {\n isArray,\n isNonEmptyObject,\n isNonEmptyString,\n isNullOrUndefined,\n} from '@sindresorhus/is';\nimport { getDep } from '../../../dockerfile/extract';\nimport type { ExtractConfig, PackageDependency } from '../../../types';\nimport { DependencyExtractor } from '../../base';\nimport type { TerraformDefinitionFile } from '../../hcl/types';\nimport type { ProviderLock } from '../../lockfile/types';\nimport type { GenericImageResourceDef } from '../../types';\nimport { generic_image_datasource, generic_image_resource } from './utils';\n\nexport class GenericDockerImageRefExtractor extends DependencyExtractor {\n getCheckList(): string[] {\n return [...generic_image_resource, ...generic_image_datasource].map(\n (value) => `\"${value.type}\"`,\n );\n }\n\n extract(\n hclMap: TerraformDefinitionFile,\n _locks: ProviderLock[],\n config: ExtractConfig,\n ): PackageDependency[] {\n const dependencies = [];\n\n dependencies.push(\n ...this.extractResources(hclMap.resource, generic_image_resource, config),\n );\n\n dependencies.push(\n ...this.extractResources(hclMap.data, generic_image_datasource, config),\n );\n\n return dependencies;\n }\n\n private extractResources(\n typeMap: Record<string, unknown> | undefined,\n image_definitions: GenericImageResourceDef[],\n config: ExtractConfig,\n ): PackageDependency[] {\n if (isNullOrUndefined(typeMap)) {\n return [];\n }\n\n const dependencies = [];\n\n for (const image_resource_def of image_definitions) {\n const { type, path } = image_resource_def;\n const resourceInstancesMap = typeMap[type];\n // is there a resource with current looked at type ( `image_resource_def` )\n if (!isNonEmptyObject(resourceInstancesMap)) {\n continue;\n }\n\n // loop over instances of a resource type\n for (const instance of Object.values(resourceInstancesMap).flat()) {\n dependencies.push(\n ...this.walkPath({ depType: type }, instance, path, config),\n );\n }\n }\n\n return dependencies;\n }\n\n /**\n * Recursively follow the path to find elements on the path.\n * If a path element is '*' the parentElement will be interpreted as a list\n * and each element will be followed\n * @param abstractDep dependency which will used as basis for adding attributes\n * @param parentElement element from which the next element will be extracted\n * @param leftPath path elements left to walk down\n */\n private walkPath(\n abstractDep: PackageDependency,\n parentElement: unknown,\n leftPath: string[],\n config: ExtractConfig,\n ): PackageDependency[] {\n const dependencies: PackageDependency[] = [];\n // if there are no path elements left, we have reached the end of the path\n if (leftPath.length === 0) {\n /* v8 ignore next 8 -- needs test */\n if (!isNonEmptyString(parentElement)) {\n return [\n {\n ...abstractDep,\n skipReason: 'invalid-dependency-specification',\n },\n ];\n }\n const test = getDep(parentElement, true, config.registryAliases);\n const dep: PackageDependency = {\n ...abstractDep,\n ...test,\n };\n return [dep];\n }\n\n // is this a list iterator\n const pathElement = leftPath[0];\n\n // get sub element\n const element = isNonEmptyObject(parentElement)\n ? parentElement[pathElement]\n : null;\n if (isNullOrUndefined(element)) {\n return leftPath.length === 1 // if this is the last element assume a false defined dependency\n ? [\n {\n ...abstractDep,\n skipReason: 'invalid-dependency-specification',\n },\n ]\n : [];\n }\n if (isArray(element)) {\n for (const arrayElement of element) {\n dependencies.push(\n ...this.walkPath(\n abstractDep,\n arrayElement,\n leftPath.slice(1),\n config,\n ),\n );\n }\n return dependencies;\n }\n return this.walkPath(abstractDep, element, leftPath.slice(1), config);\n }\n}\n"]}
@@ -1,8 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.HelmReleaseExtractor = void 0;
4
- const tslib_1 = require("tslib");
5
- const is_1 = tslib_1.__importDefault(require("@sindresorhus/is"));
4
+ const is_1 = require("@sindresorhus/is");
6
5
  const logger_1 = require("../../../../../logger");
7
6
  const url_1 = require("../../../../../util/url");
8
7
  const helm_1 = require("../../../../datasource/helm");
@@ -17,11 +16,11 @@ class HelmReleaseExtractor extends base_1.DependencyExtractor {
17
16
  extract(hclMap, _locks, config) {
18
17
  const dependencies = [];
19
18
  const helmReleases = hclMap?.resource?.helm_release;
20
- if (is_1.default.nullOrUndefined(helmReleases)) {
19
+ if ((0, is_1.isNullOrUndefined)(helmReleases)) {
21
20
  return [];
22
21
  }
23
22
  /* v8 ignore next 7 -- needs test */
24
- if (!is_1.default.plainObject(helmReleases)) {
23
+ if (!(0, is_1.isPlainObject)(helmReleases)) {
25
24
  logger_1.logger.debug({ helmReleases }, 'Terraform: unexpected `helmReleases` value');
26
25
  return [];
27
26
  }
@@ -33,7 +32,7 @@ class HelmReleaseExtractor extends base_1.DependencyExtractor {
33
32
  datasource: helm_1.HelmDatasource.id,
34
33
  };
35
34
  dependencies.push(dep);
36
- if (!is_1.default.nonEmptyString(helmRelease.chart)) {
35
+ if (!(0, is_1.isNonEmptyString)(helmRelease.chart)) {
37
36
  dep.skipReason = 'invalid-name';
38
37
  }
39
38
  else if ((0, oci_1.isOCIRegistry)(helmRelease.chart)) {
@@ -44,7 +43,7 @@ class HelmReleaseExtractor extends base_1.DependencyExtractor {
44
43
  else if ((0, util_1.checkIfStringIsPath)(helmRelease.chart)) {
45
44
  dep.skipReason = 'local-chart';
46
45
  }
47
- else if (is_1.default.nonEmptyString(helmRelease.repository)) {
46
+ else if ((0, is_1.isNonEmptyString)(helmRelease.repository)) {
48
47
  if ((0, oci_1.isOCIRegistry)(helmRelease.repository)) {
49
48
  // For oci charts, we remove the oci:// and use the docker datasource
50
49
  this.processOCI((0, url_1.joinUrlParts)((0, oci_1.removeOCIPrefix)(helmRelease.repository), helmRelease.chart), config, dep);
@@ -1 +1 @@
1
- {"version":3,"file":"helm-release.js","sourceRoot":"","sources":["../../../../../../lib/modules/manager/terraform/extractors/resources/helm-release.ts"],"names":[],"mappings":";;;;AAAA,kEAAkC;AAClC,kDAA+C;AAC/C,iDAAuD;AACvD,sDAA6D;AAC7D,yDAAqD;AACrD,6CAAqE;AAErE,qCAAiD;AAGjD,qCAAiD;AAEjD,MAAa,oBAAqB,SAAQ,0BAAmB;IAC3D,YAAY;QACV,OAAO,CAAC,gBAAgB,CAAC,CAAC;IA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E,CAAC;gBAClD,GAAG,CAAC,UAAU,GAAG,aAAa,CAAC;YACjC,CAAC;iBAAM,IAAI,YAAE,CAAC,cAAc,CAAC,WAAW,CAAC,UAAU,CAAC,EAAE,CAAC;gBACrD,IAAI,IAAA,mBAAa,EAAC,WAAW,CAAC,UAAU,CAAC,EAAE,CAAC;oBAC1C,qEAAqE;oBACrE,IAAI,CAAC,UAAU,CACb,IAAA,kBAAY,EACV,IAAA,qBAAe,EAAC,WAAW,CAAC,UAAU,CAAC,EACvC,WAAW,CAAC,KAAK,CAClB,EACD,MAAM,EACN,GAAG,CACJ,CAAC;gBACJ,CAAC;qBAAM,CAAC;oBACN,GAAG,CAAC,YAAY,GAAG,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;gBAC9C,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,YAAY,CAAC;IACtB,CAAC;IAEO,UAAU,CAChB,OAAe,EACf,MAAqB,EACrB,GAAsB;QAEtB,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,IAAA,gBAAM,EACxC,OAAO,EACP,KAAK,EACL,MAAM,CAAC,eAAe,CACvB,CAAC;QACF,GAAG,CAAC,WAAW,GAAG,WAAW,CAAC;QAC9B,GAAG,CAAC,UAAU,GAAG,UAAU,CAAC;IAC9B,CAAC;CACF;AA7ED,oDA6EC","sourcesContent":["import is from '@sindresorhus/is';\nimport { logger } from '../../../../../logger';\nimport { joinUrlParts } from '../../../../../util/url';\nimport { HelmDatasource } from '../../../../datasource/helm';\nimport { getDep } from '../../../dockerfile/extract';\nimport { isOCIRegistry, removeOCIPrefix } from '../../../helmv3/oci';\nimport type { ExtractConfig, PackageDependency } from '../../../types';\nimport { DependencyExtractor } from '../../base';\nimport type { TerraformDefinitionFile } from '../../hcl/types';\nimport type { ProviderLock } from '../../lockfile/types';\nimport { checkIfStringIsPath } from '../../util';\n\nexport class HelmReleaseExtractor extends DependencyExtractor {\n getCheckList(): string[] {\n return [`\"helm_release\"`];\n }\n\n override extract(\n hclMap: TerraformDefinitionFile,\n _locks: ProviderLock[],\n config: ExtractConfig,\n ): PackageDependency[] {\n const dependencies = [];\n\n const helmReleases = hclMap?.resource?.helm_release;\n if (is.nullOrUndefined(helmReleases)) {\n return [];\n }\n\n /* v8 ignore next 7 -- needs test */\n if (!is.plainObject(helmReleases)) {\n logger.debug(\n { helmReleases },\n 'Terraform: unexpected `helmReleases` value',\n );\n return [];\n }\n\n for (const helmRelease of Object.values(helmReleases).flat()) {\n const dep: PackageDependency = {\n currentValue: helmRelease.version,\n depType: 'helm_release',\n depName: helmRelease.chart,\n datasource: HelmDatasource.id,\n };\n\n dependencies.push(dep);\n\n if (!is.nonEmptyString(helmRelease.chart)) {\n dep.skipReason = 'invalid-name';\n } else if (isOCIRegistry(helmRelease.chart)) {\n // For oci charts, we remove the oci:// and use the docker datasource\n dep.depName = removeOCIPrefix(helmRelease.chart);\n this.processOCI(dep.depName, config, dep);\n } else if (checkIfStringIsPath(helmRelease.chart)) {\n dep.skipReason = 'local-chart';\n } else if (is.nonEmptyString(helmRelease.repository)) {\n if (isOCIRegistry(helmRelease.repository)) {\n // For oci charts, we remove the oci:// and use the docker datasource\n this.processOCI(\n joinUrlParts(\n removeOCIPrefix(helmRelease.repository),\n helmRelease.chart,\n ),\n config,\n dep,\n );\n } else {\n dep.registryUrls = [helmRelease.repository];\n }\n }\n }\n\n return dependencies;\n }\n\n private processOCI(\n depName: string,\n config: ExtractConfig,\n dep: PackageDependency,\n ): void {\n const { packageName, datasource } = getDep(\n depName,\n false,\n config.registryAliases,\n );\n dep.packageName = packageName;\n dep.datasource = datasource;\n }\n}\n"]}
1
+ {"version":3,"file":"helm-release.js","sourceRoot":"","sources":["../../../../../../lib/modules/manager/terraform/extractors/resources/helm-release.ts"],"names":[],"mappings":";;;AAAA,yCAI0B;AAC1B,kDAA+C;AAC/C,iDAAuD;AACvD,sDAA6D;AAC7D,yDAAqD;AACrD,6CAAqE;AAErE,qCAAiD;AAGjD,qCAAiD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AC;YAC5C,CAAC;iBAAM,IAAI,IAAA,0BAAmB,EAAC,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;gBAClD,GAAG,CAAC,UAAU,GAAG,aAAa,CAAC;YACjC,CAAC;iBAAM,IAAI,IAAA,qBAAgB,EAAC,WAAW,CAAC,UAAU,CAAC,EAAE,CAAC;gBACpD,IAAI,IAAA,mBAAa,EAAC,WAAW,CAAC,UAAU,CAAC,EAAE,CAAC;oBAC1C,qEAAqE;oBACrE,IAAI,CAAC,UAAU,CACb,IAAA,kBAAY,EACV,IAAA,qBAAe,EAAC,WAAW,CAAC,UAAU,CAAC,EACvC,WAAW,CAAC,KAAK,CAClB,EACD,MAAM,EACN,GAAG,CACJ,CAAC;gBACJ,CAAC;qBAAM,CAAC;oBACN,GAAG,CAAC,YAAY,GAAG,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;gBAC9C,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,YAAY,CAAC;IACtB,CAAC;IAEO,UAAU,CAChB,OAAe,EACf,MAAqB,EACrB,GAAsB;QAEtB,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,IAAA,gBAAM,EACxC,OAAO,EACP,KAAK,EACL,MAAM,CAAC,eAAe,CACvB,CAAC;QACF,GAAG,CAAC,WAAW,GAAG,WAAW,CAAC;QAC9B,GAAG,CAAC,UAAU,GAAG,UAAU,CAAC;IAC9B,CAAC;CACF;AA7ED,oDA6EC","sourcesContent":["import {\n isNonEmptyString,\n isNullOrUndefined,\n isPlainObject,\n} from '@sindresorhus/is';\nimport { logger } from '../../../../../logger';\nimport { joinUrlParts } from '../../../../../util/url';\nimport { HelmDatasource } from '../../../../datasource/helm';\nimport { getDep } from '../../../dockerfile/extract';\nimport { isOCIRegistry, removeOCIPrefix } from '../../../helmv3/oci';\nimport type { ExtractConfig, PackageDependency } from '../../../types';\nimport { DependencyExtractor } from '../../base';\nimport type { TerraformDefinitionFile } from '../../hcl/types';\nimport type { ProviderLock } from '../../lockfile/types';\nimport { checkIfStringIsPath } from '../../util';\n\nexport class HelmReleaseExtractor extends DependencyExtractor {\n getCheckList(): string[] {\n return [`\"helm_release\"`];\n }\n\n override extract(\n hclMap: TerraformDefinitionFile,\n _locks: ProviderLock[],\n config: ExtractConfig,\n ): PackageDependency[] {\n const dependencies = [];\n\n const helmReleases = hclMap?.resource?.helm_release;\n if (isNullOrUndefined(helmReleases)) {\n return [];\n }\n\n /* v8 ignore next 7 -- needs test */\n if (!isPlainObject(helmReleases)) {\n logger.debug(\n { helmReleases },\n 'Terraform: unexpected `helmReleases` value',\n );\n return [];\n }\n\n for (const helmRelease of Object.values(helmReleases).flat()) {\n const dep: PackageDependency = {\n currentValue: helmRelease.version,\n depType: 'helm_release',\n depName: helmRelease.chart,\n datasource: HelmDatasource.id,\n };\n\n dependencies.push(dep);\n\n if (!isNonEmptyString(helmRelease.chart)) {\n dep.skipReason = 'invalid-name';\n } else if (isOCIRegistry(helmRelease.chart)) {\n // For oci charts, we remove the oci:// and use the docker datasource\n dep.depName = removeOCIPrefix(helmRelease.chart);\n this.processOCI(dep.depName, config, dep);\n } else if (checkIfStringIsPath(helmRelease.chart)) {\n dep.skipReason = 'local-chart';\n } else if (isNonEmptyString(helmRelease.repository)) {\n if (isOCIRegistry(helmRelease.repository)) {\n // For oci charts, we remove the oci:// and use the docker datasource\n this.processOCI(\n joinUrlParts(\n removeOCIPrefix(helmRelease.repository),\n helmRelease.chart,\n ),\n config,\n dep,\n );\n } else {\n dep.registryUrls = [helmRelease.repository];\n }\n }\n }\n\n return dependencies;\n }\n\n private processOCI(\n depName: string,\n config: ExtractConfig,\n dep: PackageDependency,\n ): void {\n const { packageName, datasource } = getDep(\n depName,\n false,\n config.registryAliases,\n );\n dep.packageName = packageName;\n dep.datasource = datasource;\n }\n}\n"]}
@@ -1,8 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TerraformWorkspaceExtractor = void 0;
4
- const tslib_1 = require("tslib");
5
- const is_1 = tslib_1.__importDefault(require("@sindresorhus/is"));
4
+ const is_1 = require("@sindresorhus/is");
6
5
  const terraform_version_1 = require("../terraform-block/terraform-version");
7
6
  class TerraformWorkspaceExtractor extends terraform_version_1.TerraformVersionExtractor {
8
7
  getCheckList() {
@@ -11,14 +10,14 @@ class TerraformWorkspaceExtractor extends terraform_version_1.TerraformVersionEx
11
10
  extract(hclMap) {
12
11
  const dependencies = [];
13
12
  const workspaces = hclMap?.resource?.tfe_workspace;
14
- if (is_1.default.nullOrUndefined(workspaces)) {
13
+ if ((0, is_1.isNullOrUndefined)(workspaces)) {
15
14
  return [];
16
15
  }
17
16
  for (const workspace of Object.values(workspaces).flat()) {
18
17
  const dep = this.analyseTerraformVersion({
19
18
  currentValue: workspace.terraform_version,
20
19
  });
21
- if (is_1.default.nullOrUndefined(workspace.terraform_version)) {
20
+ if ((0, is_1.isNullOrUndefined)(workspace.terraform_version)) {
22
21
  dep.skipReason = 'unspecified-version';
23
22
  }
24
23
  dependencies.push({
@@ -1 +1 @@
1
- {"version":3,"file":"terraform-workspace.js","sourceRoot":"","sources":["../../../../../../lib/modules/manager/terraform/extractors/resources/terraform-workspace.ts"],"names":[],"mappings":";;;;AAAA,kEAAkC;AAGlC,4EAAiF;AAEjF,MAAa,2BAA4B,SAAQ,6CAAyB;IAC/D,YAAY;QACnB,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAC7B,CAAC;IAEQ,OAAO,CAAC,MAA+B;QAC9C,MAAM,YAAY,GAAG,EAAE,CAAC;QAExB,MAAM,UAAU,GAAG,MAAM,EAAE,QAAQ,EAAE,aAAa,CAAC;QACnD,IAAI,YAAE,CAAC,eAAe,CAAC,UAAU,CAAC,EAAE,CAAC;YACnC,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,KAAK,MAAM,SAAS,IAAI,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;YACzD,MAAM,GAAG,GAAsB,IAAI,CAAC,uBAAuB,CAAC;gBAC1D,YAAY,EAAE,SAAS,CAAC,iBAAiB;aAC1C,CAAC,CAAC;YAEH,IAAI,YAAE,CAAC,eAAe,CAAC,SAAS,CAAC,iBAAiB,CAAC,EAAE,CAAC;gBACpD,GAAG,CAAC,UAAU,GAAG,qBAAqB,CAAC;YACzC,CAAC;YACD,YAAY,CAAC,IAAI,CAAC;gBAChB,GAAG,GAAG;gBACN,OAAO,EAAE,eAAe;aACzB,CAAC,CAAC;QACL,CAAC;QACD,OAAO,YAAY,CAAC;IACtB,CAAC;CACF;AA5BD,kEA4BC","sourcesContent":["import is from '@sindresorhus/is';\nimport type { PackageDependency } from '../../../types';\nimport type { TerraformDefinitionFile } from '../../hcl/types';\nimport { TerraformVersionExtractor } from '../terraform-block/terraform-version';\n\nexport class TerraformWorkspaceExtractor extends TerraformVersionExtractor {\n override getCheckList(): string[] {\n return [`\"tfe_workspace\"`];\n }\n\n override extract(hclMap: TerraformDefinitionFile): PackageDependency[] {\n const dependencies = [];\n\n const workspaces = hclMap?.resource?.tfe_workspace;\n if (is.nullOrUndefined(workspaces)) {\n return [];\n }\n\n for (const workspace of Object.values(workspaces).flat()) {\n const dep: PackageDependency = this.analyseTerraformVersion({\n currentValue: workspace.terraform_version,\n });\n\n if (is.nullOrUndefined(workspace.terraform_version)) {\n dep.skipReason = 'unspecified-version';\n }\n dependencies.push({\n ...dep,\n depType: 'tfe_workspace',\n });\n }\n return dependencies;\n }\n}\n"]}
1
+ {"version":3,"file":"terraform-workspace.js","sourceRoot":"","sources":["../../../../../../lib/modules/manager/terraform/extractors/resources/terraform-workspace.ts"],"names":[],"mappings":";;;AAAA,yCAAqD;AAGrD,4EAAiF;AAEjF,MAAa,2BAA4B,SAAQ,6CAAyB;IAC/D,YAAY;QACnB,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAC7B,CAAC;IAEQ,OAAO,CAAC,MAA+B;QAC9C,MAAM,YAAY,GAAG,EAAE,CAAC;QAExB,MAAM,UAAU,GAAG,MAAM,EAAE,QAAQ,EAAE,aAAa,CAAC;QACnD,IAAI,IAAA,sBAAiB,EAAC,UAAU,CAAC,EAAE,CAAC;YAClC,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,KAAK,MAAM,SAAS,IAAI,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;YACzD,MAAM,GAAG,GAAsB,IAAI,CAAC,uBAAuB,CAAC;gBAC1D,YAAY,EAAE,SAAS,CAAC,iBAAiB;aAC1C,CAAC,CAAC;YAEH,IAAI,IAAA,sBAAiB,EAAC,SAAS,CAAC,iBAAiB,CAAC,EAAE,CAAC;gBACnD,GAAG,CAAC,UAAU,GAAG,qBAAqB,CAAC;YACzC,CAAC;YACD,YAAY,CAAC,IAAI,CAAC;gBAChB,GAAG,GAAG;gBACN,OAAO,EAAE,eAAe;aACzB,CAAC,CAAC;QACL,CAAC;QACD,OAAO,YAAY,CAAC;IACtB,CAAC;CACF;AA5BD,kEA4BC","sourcesContent":["import { isNullOrUndefined } from '@sindresorhus/is';\nimport type { PackageDependency } from '../../../types';\nimport type { TerraformDefinitionFile } from '../../hcl/types';\nimport { TerraformVersionExtractor } from '../terraform-block/terraform-version';\n\nexport class TerraformWorkspaceExtractor extends TerraformVersionExtractor {\n override getCheckList(): string[] {\n return [`\"tfe_workspace\"`];\n }\n\n override extract(hclMap: TerraformDefinitionFile): PackageDependency[] {\n const dependencies = [];\n\n const workspaces = hclMap?.resource?.tfe_workspace;\n if (isNullOrUndefined(workspaces)) {\n return [];\n }\n\n for (const workspace of Object.values(workspaces).flat()) {\n const dep: PackageDependency = this.analyseTerraformVersion({\n currentValue: workspace.terraform_version,\n });\n\n if (isNullOrUndefined(workspace.terraform_version)) {\n dep.skipReason = 'unspecified-version';\n }\n dependencies.push({\n ...dep,\n depType: 'tfe_workspace',\n });\n }\n return dependencies;\n }\n}\n"]}
@@ -1,8 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RequiredProviderExtractor = void 0;
4
- const tslib_1 = require("tslib");
5
- const is_1 = tslib_1.__importDefault(require("@sindresorhus/is"));
4
+ const is_1 = require("@sindresorhus/is");
6
5
  const base_1 = require("../../base");
7
6
  class RequiredProviderExtractor extends base_1.TerraformProviderExtractor {
8
7
  getCheckList() {
@@ -10,20 +9,20 @@ class RequiredProviderExtractor extends base_1.TerraformProviderExtractor {
10
9
  }
11
10
  extract(hclRoot, locks) {
12
11
  const terraformBlocks = hclRoot?.terraform;
13
- if (is_1.default.nullOrUndefined(terraformBlocks)) {
12
+ if ((0, is_1.isNullOrUndefined)(terraformBlocks)) {
14
13
  return [];
15
14
  }
16
15
  const dependencies = [];
17
16
  for (const terraformBlock of terraformBlocks) {
18
17
  const requiredProviders = terraformBlock.required_providers;
19
- if (is_1.default.nullOrUndefined(requiredProviders)) {
18
+ if ((0, is_1.isNullOrUndefined)(requiredProviders)) {
20
19
  continue;
21
20
  }
22
21
  const entries = requiredProviders.flatMap(Object.entries);
23
22
  for (const [requiredProviderName, value] of entries) {
24
23
  // name = version declaration method
25
24
  let dep;
26
- if (is_1.default.string(value)) {
25
+ if ((0, is_1.isString)(value)) {
27
26
  dep = {
28
27
  currentValue: value,
29
28
  managerData: {
@@ -1 +1 @@
1
- {"version":3,"file":"required-provider.js","sourceRoot":"","sources":["../../../../../../lib/modules/manager/terraform/extractors/terraform-block/required-provider.ts"],"names":[],"mappings":";;;;AAAA,kEAAkC;AAElC,qCAAwD;AAOxD,MAAa,yBAA0B,SAAQ,iCAA0B;IACvE,YAAY;QACV,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAChC,CAAC;IAED,OAAO,CACL,OAAgC,EAChC,KAAqB;QAErB,MAAM,eAAe,GAAG,OAAO,EAAE,SAAS,CAAC;QAC3C,IAAI,YAAE,CAAC,eAAe,CAAC,eAAe,CAAC,EAAE,CAAC;YACxC,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,MAAM,YAAY,GAAwB,EAAE,CAAC;QAC7C,KAAK,MAAM,cAAc,IAAI,eAAe,EAAE,CAAC;YAC7C,MAAM,iBAAiB,GAAG,cAAc,CAAC,kBAAkB,CAAC;YAC5D,IAAI,YAAE,CAAC,eAAe,CAAC,iBAAiB,CAAC,EAAE,CAAC;gBAC1C,SAAS;YACX,CAAC;YAED,MAAM,OAAO,GACX,iBAAiB,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YAC5C,KAAK,MAAM,CAAC,oBAAoB,EAAE,KAAK,CAAC,IAAI,OAAO,EAAE,CAAC;gBACpD,oCAAoC;gBACpC,IAAI,GAAsB,CAAC;gBAC3B,IAAI,YAAE,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;oBACrB,GAAG,GAAG;wBACJ,YAAY,EAAE,KAAK;wBACnB,WAAW,EAAE;4BACX,UAAU,EAAE,oBAAoB;yBACjC;qBACF,CAAC;gBACJ,CAAC;qBAAM,CAAC;oBACN,gEAAgE;oBAChE,GAAG,GAAG;wBACJ,YAAY,EAAE,KAAK,CAAC,OAAO;wBAC3B,WAAW,EAAE;4BACX,UAAU,EAAE,oBAAoB;4BAChC,MAAM,EAAE,KAAK,CAAC,MAAM;yBACrB;qBACF,CAAC;gBACJ,CAAC;gBACD,YAAY,CAAC,IAAI,CACf,IAAI,CAAC,wBAAwB,CAAC,GAAG,EAAE,KAAK,EAAE,mBAAmB,CAAC,CAC/D,CAAC;YACJ,CAAC;QACH,CAAC;QACD,OAAO,YAAY,CAAC;IACtB,CAAC;CACF;AAlDD,8DAkDC","sourcesContent":["import is from '@sindresorhus/is';\nimport type { PackageDependency } from '../../../types';\nimport { TerraformProviderExtractor } from '../../base';\nimport type {\n TerraformDefinitionFile,\n TerraformRequiredProvider,\n} from '../../hcl/types';\nimport type { ProviderLock } from '../../lockfile/types';\n\nexport class RequiredProviderExtractor extends TerraformProviderExtractor {\n getCheckList(): string[] {\n return ['required_providers'];\n }\n\n extract(\n hclRoot: TerraformDefinitionFile,\n locks: ProviderLock[],\n ): PackageDependency[] {\n const terraformBlocks = hclRoot?.terraform;\n if (is.nullOrUndefined(terraformBlocks)) {\n return [];\n }\n\n const dependencies: PackageDependency[] = [];\n for (const terraformBlock of terraformBlocks) {\n const requiredProviders = terraformBlock.required_providers;\n if (is.nullOrUndefined(requiredProviders)) {\n continue;\n }\n\n const entries: [string, TerraformRequiredProvider | string][] =\n requiredProviders.flatMap(Object.entries);\n for (const [requiredProviderName, value] of entries) {\n // name = version declaration method\n let dep: PackageDependency;\n if (is.string(value)) {\n dep = {\n currentValue: value,\n managerData: {\n moduleName: requiredProviderName,\n },\n };\n } else {\n // block declaration aws = { source = 'aws', version = '2.0.0' }\n dep = {\n currentValue: value.version,\n managerData: {\n moduleName: requiredProviderName,\n source: value.source,\n },\n };\n }\n dependencies.push(\n this.analyzeTerraformProvider(dep, locks, 'required_provider'),\n );\n }\n }\n return dependencies;\n }\n}\n"]}
1
+ {"version":3,"file":"required-provider.js","sourceRoot":"","sources":["../../../../../../lib/modules/manager/terraform/extractors/terraform-block/required-provider.ts"],"names":[],"mappings":";;;AAAA,yCAA+D;AAE/D,qCAAwD;AAOxD,MAAa,yBAA0B,SAAQ,iCAA0B;IACvE,YAAY;QACV,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAChC,CAAC;IAED,OAAO,CACL,OAAgC,EAChC,KAAqB;QAErB,MAAM,eAAe,GAAG,OAAO,EAAE,SAAS,CAAC;QAC3C,IAAI,IAAA,sBAAiB,EAAC,eAAe,CAAC,EAAE,CAAC;YACvC,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,MAAM,YAAY,GAAwB,EAAE,CAAC;QAC7C,KAAK,MAAM,cAAc,IAAI,eAAe,EAAE,CAAC;YAC7C,MAAM,iBAAiB,GAAG,cAAc,CAAC,kBAAkB,CAAC;YAC5D,IAAI,IAAA,sBAAiB,EAAC,iBAAiB,CAAC,EAAE,CAAC;gBACzC,SAAS;YACX,CAAC;YAED,MAAM,OAAO,GACX,iBAAiB,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YAC5C,KAAK,MAAM,CAAC,oBAAoB,EAAE,KAAK,CAAC,IAAI,OAAO,EAAE,CAAC;gBACpD,oCAAoC;gBACpC,IAAI,GAAsB,CAAC;gBAC3B,IAAI,IAAA,aAAQ,EAAC,KAAK,CAAC,EAAE,CAAC;oBACpB,GAAG,GAAG;wBACJ,YAAY,EAAE,KAAK;wBACnB,WAAW,EAAE;4BACX,UAAU,EAAE,oBAAoB;yBACjC;qBACF,CAAC;gBACJ,CAAC;qBAAM,CAAC;oBACN,gEAAgE;oBAChE,GAAG,GAAG;wBACJ,YAAY,EAAE,KAAK,CAAC,OAAO;wBAC3B,WAAW,EAAE;4BACX,UAAU,EAAE,oBAAoB;4BAChC,MAAM,EAAE,KAAK,CAAC,MAAM;yBACrB;qBACF,CAAC;gBACJ,CAAC;gBACD,YAAY,CAAC,IAAI,CACf,IAAI,CAAC,wBAAwB,CAAC,GAAG,EAAE,KAAK,EAAE,mBAAmB,CAAC,CAC/D,CAAC;YACJ,CAAC;QACH,CAAC;QACD,OAAO,YAAY,CAAC;IACtB,CAAC;CACF;AAlDD,8DAkDC","sourcesContent":["import { isNullOrUndefined, isString } from '@sindresorhus/is';\nimport type { PackageDependency } from '../../../types';\nimport { TerraformProviderExtractor } from '../../base';\nimport type {\n TerraformDefinitionFile,\n TerraformRequiredProvider,\n} from '../../hcl/types';\nimport type { ProviderLock } from '../../lockfile/types';\n\nexport class RequiredProviderExtractor extends TerraformProviderExtractor {\n getCheckList(): string[] {\n return ['required_providers'];\n }\n\n extract(\n hclRoot: TerraformDefinitionFile,\n locks: ProviderLock[],\n ): PackageDependency[] {\n const terraformBlocks = hclRoot?.terraform;\n if (isNullOrUndefined(terraformBlocks)) {\n return [];\n }\n\n const dependencies: PackageDependency[] = [];\n for (const terraformBlock of terraformBlocks) {\n const requiredProviders = terraformBlock.required_providers;\n if (isNullOrUndefined(requiredProviders)) {\n continue;\n }\n\n const entries: [string, TerraformRequiredProvider | string][] =\n requiredProviders.flatMap(Object.entries);\n for (const [requiredProviderName, value] of entries) {\n // name = version declaration method\n let dep: PackageDependency;\n if (isString(value)) {\n dep = {\n currentValue: value,\n managerData: {\n moduleName: requiredProviderName,\n },\n };\n } else {\n // block declaration aws = { source = 'aws', version = '2.0.0' }\n dep = {\n currentValue: value.version,\n managerData: {\n moduleName: requiredProviderName,\n source: value.source,\n },\n };\n }\n dependencies.push(\n this.analyzeTerraformProvider(dep, locks, 'required_provider'),\n );\n }\n }\n return dependencies;\n }\n}\n"]}
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TerraformVersionExtractor = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const is_1 = tslib_1.__importDefault(require("@sindresorhus/is"));
5
+ const is_1 = require("@sindresorhus/is");
6
6
  const github_releases_1 = require("../../../../datasource/github-releases");
7
7
  const hashicorp = tslib_1.__importStar(require("../../../../versioning/hashicorp"));
8
8
  const base_1 = require("../../base");
@@ -12,13 +12,13 @@ class TerraformVersionExtractor extends base_1.DependencyExtractor {
12
12
  }
13
13
  extract(hclRoot) {
14
14
  const terraformBlocks = hclRoot?.terraform;
15
- if (is_1.default.nullOrUndefined(terraformBlocks)) {
15
+ if ((0, is_1.isNullOrUndefined)(terraformBlocks)) {
16
16
  return [];
17
17
  }
18
18
  const dependencies = [];
19
19
  for (const terraformBlock of terraformBlocks) {
20
20
  const requiredVersion = terraformBlock.required_version;
21
- if (is_1.default.nullOrUndefined(requiredVersion)) {
21
+ if ((0, is_1.isNullOrUndefined)(requiredVersion)) {
22
22
  continue;
23
23
  }
24
24
  dependencies.push(this.analyseTerraformVersion({
@@ -1 +1 @@
1
- {"version":3,"file":"terraform-version.js","sourceRoot":"","sources":["../../../../../../lib/modules/manager/terraform/extractors/terraform-block/terraform-version.ts"],"names":[],"mappings":";;;;AAAA,kEAAkC;AAClC,4EAAkF;AAClF,oFAA8D;AAE9D,qCAAiD;AAGjD,MAAa,yBAA0B,SAAQ,0BAAmB;IAChE,YAAY;QACV,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAC9B,CAAC;IAED,OAAO,CAAC,OAAgC;QACtC,MAAM,eAAe,GAAG,OAAO,EAAE,SAAS,CAAC;QAC3C,IAAI,YAAE,CAAC,eAAe,CAAC,eAAe,CAAC,EAAE,CAAC;YACxC,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,MAAM,YAAY,GAAG,EAAE,CAAC;QACxB,KAAK,MAAM,cAAc,IAAI,eAAe,EAAE,CAAC;YAC7C,MAAM,eAAe,GAAG,cAAc,CAAC,gBAAgB,CAAC;YACxD,IAAI,YAAE,CAAC,eAAe,CAAC,eAAe,CAAC,EAAE,CAAC;gBACxC,SAAS;YACX,CAAC;YAED,YAAY,CAAC,IAAI,CACf,IAAI,CAAC,uBAAuB,CAAC;gBAC3B,YAAY,EAAE,eAAe;aAC9B,CAAC,CACH,CAAC;QACJ,CAAC;QACD,OAAO,YAAY,CAAC;IACtB,CAAC;IAES,uBAAuB,CAAC,GAAsB;QACtD,GAAG,CAAC,OAAO,GAAG,kBAAkB,CAAC;QACjC,GAAG,CAAC,UAAU,GAAG,0CAAwB,CAAC,EAAE,CAAC;QAC7C,GAAG,CAAC,OAAO,GAAG,qBAAqB,CAAC;QACpC,GAAG,CAAC,cAAc,GAAG,kBAAkB,CAAC;QACxC,GAAG,CAAC,UAAU,GAAG,SAAS,CAAC,EAAE,CAAC;QAC9B,OAAO,GAAG,CAAC;IACb,CAAC;CACF;AAnCD,8DAmCC","sourcesContent":["import is from '@sindresorhus/is';\nimport { GithubReleasesDatasource } from '../../../../datasource/github-releases';\nimport * as hashicorp from '../../../../versioning/hashicorp';\nimport type { PackageDependency } from '../../../types';\nimport { DependencyExtractor } from '../../base';\nimport type { TerraformDefinitionFile } from '../../hcl/types';\n\nexport class TerraformVersionExtractor extends DependencyExtractor {\n getCheckList(): string[] {\n return ['required_version'];\n }\n\n extract(hclRoot: TerraformDefinitionFile): PackageDependency[] {\n const terraformBlocks = hclRoot?.terraform;\n if (is.nullOrUndefined(terraformBlocks)) {\n return [];\n }\n\n const dependencies = [];\n for (const terraformBlock of terraformBlocks) {\n const requiredVersion = terraformBlock.required_version;\n if (is.nullOrUndefined(requiredVersion)) {\n continue;\n }\n\n dependencies.push(\n this.analyseTerraformVersion({\n currentValue: requiredVersion,\n }),\n );\n }\n return dependencies;\n }\n\n protected analyseTerraformVersion(dep: PackageDependency): PackageDependency {\n dep.depType = 'required_version';\n dep.datasource = GithubReleasesDatasource.id;\n dep.depName = 'hashicorp/terraform';\n dep.extractVersion = 'v(?<version>.*)$';\n dep.versioning = hashicorp.id;\n return dep;\n }\n}\n"]}
1
+ {"version":3,"file":"terraform-version.js","sourceRoot":"","sources":["../../../../../../lib/modules/manager/terraform/extractors/terraform-block/terraform-version.ts"],"names":[],"mappings":";;;;AAAA,yCAAqD;AACrD,4EAAkF;AAClF,oFAA8D;AAE9D,qCAAiD;AAGjD,MAAa,yBAA0B,SAAQ,0BAAmB;IAChE,YAAY;QACV,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAC9B,CAAC;IAED,OAAO,CAAC,OAAgC;QACtC,MAAM,eAAe,GAAG,OAAO,EAAE,SAAS,CAAC;QAC3C,IAAI,IAAA,sBAAiB,EAAC,eAAe,CAAC,EAAE,CAAC;YACvC,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,MAAM,YAAY,GAAG,EAAE,CAAC;QACxB,KAAK,MAAM,cAAc,IAAI,eAAe,EAAE,CAAC;YAC7C,MAAM,eAAe,GAAG,cAAc,CAAC,gBAAgB,CAAC;YACxD,IAAI,IAAA,sBAAiB,EAAC,eAAe,CAAC,EAAE,CAAC;gBACvC,SAAS;YACX,CAAC;YAED,YAAY,CAAC,IAAI,CACf,IAAI,CAAC,uBAAuB,CAAC;gBAC3B,YAAY,EAAE,eAAe;aAC9B,CAAC,CACH,CAAC;QACJ,CAAC;QACD,OAAO,YAAY,CAAC;IACtB,CAAC;IAES,uBAAuB,CAAC,GAAsB;QACtD,GAAG,CAAC,OAAO,GAAG,kBAAkB,CAAC;QACjC,GAAG,CAAC,UAAU,GAAG,0CAAwB,CAAC,EAAE,CAAC;QAC7C,GAAG,CAAC,OAAO,GAAG,qBAAqB,CAAC;QACpC,GAAG,CAAC,cAAc,GAAG,kBAAkB,CAAC;QACxC,GAAG,CAAC,UAAU,GAAG,SAAS,CAAC,EAAE,CAAC;QAC9B,OAAO,GAAG,CAAC;IACb,CAAC;CACF;AAnCD,8DAmCC","sourcesContent":["import { isNullOrUndefined } from '@sindresorhus/is';\nimport { GithubReleasesDatasource } from '../../../../datasource/github-releases';\nimport * as hashicorp from '../../../../versioning/hashicorp';\nimport type { PackageDependency } from '../../../types';\nimport { DependencyExtractor } from '../../base';\nimport type { TerraformDefinitionFile } from '../../hcl/types';\n\nexport class TerraformVersionExtractor extends DependencyExtractor {\n getCheckList(): string[] {\n return ['required_version'];\n }\n\n extract(hclRoot: TerraformDefinitionFile): PackageDependency[] {\n const terraformBlocks = hclRoot?.terraform;\n if (isNullOrUndefined(terraformBlocks)) {\n return [];\n }\n\n const dependencies = [];\n for (const terraformBlock of terraformBlocks) {\n const requiredVersion = terraformBlock.required_version;\n if (isNullOrUndefined(requiredVersion)) {\n continue;\n }\n\n dependencies.push(\n this.analyseTerraformVersion({\n currentValue: requiredVersion,\n }),\n );\n }\n return dependencies;\n }\n\n protected analyseTerraformVersion(dep: PackageDependency): PackageDependency {\n dep.depType = 'required_version';\n dep.datasource = GithubReleasesDatasource.id;\n dep.depName = 'hashicorp/terraform';\n dep.extractVersion = 'v(?<version>.*)$';\n dep.versioning = hashicorp.id;\n return dep;\n }\n}\n"]}
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getNewConstraint = getNewConstraint;
4
4
  exports.updateArtifacts = updateArtifacts;
5
5
  const tslib_1 = require("tslib");
6
- const is_1 = tslib_1.__importDefault(require("@sindresorhus/is"));
6
+ const is_1 = require("@sindresorhus/is");
7
7
  const logger_1 = require("../../../../logger");
8
8
  const p = tslib_1.__importStar(require("../../../../util/promises"));
9
9
  const regex_1 = require("../../../../util/regex");
@@ -38,7 +38,7 @@ async function updateAllLocks(locks) {
38
38
  };
39
39
  return update;
40
40
  }, { concurrency: 4 });
41
- return updates.filter(is_1.default.truthy);
41
+ return updates.filter(is_1.isTruthy);
42
42
  }
43
43
  function getNewConstraint(dep, oldConstraint) {
44
44
  const { currentValue, currentVersion, newValue: rawNewValue, newVersion, packageName, } = dep;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../lib/modules/manager/terraform/lockfile/index.ts"],"names":[],"mappings":";;AAqEA,4CA0DC;AAED,0CAwGC;;AAzOD,kEAAkC;AAClC,+CAA4C;AAC5C,qEAA+C;AAC/C,kDAA6D;AAE7D,oDAAqD;AACrD,oDAA2D;AAM3D,kCAAoD;AACpD,iCAA+C;AAE/C,iCAOgB;AAEhB,KAAK,UAAU,cAAc,CAC3B,KAAqB;IAErB,MAAM,OAAO,GAAG,MAAM,CAAC,CAAC,GAAG,CACzB,KAAK,EACL,KAAK,EAAE,IAAI,EAAE,EAAE;QACb,MAAM,YAAY,GAAyB;YACzC,UAAU,EAAE,WAAW;YACvB,UAAU,EAAE,oBAAoB;YAChC,WAAW,EAAE,IAAI,CAAC,WAAW;SAC9B,CAAC;QACF,MAAM,EAAE,QAAQ,EAAE,GAAG,CAAC,MAAM,IAAA,2BAAc,EAAC,YAAY,CAAC,CAAC,IAAI,EAAE,CAAC;QAChE,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,OAAO,IAAI,CAAC;QACd,CAAC;QACD,MAAM,UAAU,GAAG,IAAA,gBAAa,EAAC,YAAY,CAAC,UAAU,CAAC,CAAC;QAC1D,MAAM,YAAY,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO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EAAE,eAAe,CAAC,CAAC;QACrE,OAAO,CAAC,GAAG,CAAC,CAAC;IACf,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO;YACL;gBACE,aAAa,EAAE;oBACb,QAAQ,EAAE,YAAY;oBACtB,MAAM,EAAE,GAAG,CAAC,OAAO;iBACpB;aACF;SACF,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["import is from '@sindresorhus/is';\nimport { logger } from '../../../../logger';\nimport * as p from '../../../../util/promises';\nimport { escapeRegExp, regEx } from '../../../../util/regex';\nimport type { GetPkgReleasesConfig } from '../../../datasource';\nimport { getPkgReleases } from '../../../datasource';\nimport { get as getVersioning } from '../../../versioning';\nimport type {\n UpdateArtifact,\n UpdateArtifactsResult,\n Upgrade,\n} from '../../types';\nimport { massageProviderLookupName } from '../util';\nimport { TerraformProviderHash } from './hash';\nimport type { ProviderLock, ProviderLockUpdate } from './types';\nimport {\n extractLocks,\n findLockFile,\n isPinnedVersion,\n massageNewValue,\n readLockFile,\n writeLockUpdates,\n} from './util';\n\nasync function updateAllLocks(\n locks: ProviderLock[],\n): Promise<ProviderLockUpdate[]> {\n const updates = await p.map(\n locks,\n async (lock) => {\n const updateConfig: GetPkgReleasesConfig = {\n versioning: 'hashicorp',\n datasource: 'terraform-provider',\n packageName: lock.packageName,\n };\n const { releases } = (await getPkgReleases(updateConfig)) ?? {};\n if (!releases) {\n return null;\n }\n const versioning = getVersioning(updateConfig.versioning);\n const versionsList = releases.map((release) => release.version);\n const newVersion = versioning.getSatisfyingVersion(\n versionsList,\n lock.constraints,\n );\n\n // if the new version is the same as the last, signal that no update is needed\n if (!newVersion || newVersion === lock.version) {\n return null;\n }\n const update: ProviderLockUpdate = {\n newVersion,\n newConstraint: lock.constraints,\n newHashes:\n (await TerraformProviderHash.createHashes(\n lock.registryUrl,\n lock.packageName,\n newVersion,\n )) ?? [],\n ...lock,\n };\n return update;\n },\n { concurrency: 4 },\n );\n\n return updates.filter(is.truthy);\n}\n\nexport function getNewConstraint(\n dep: Upgrade<Record<string, unknown>>,\n oldConstraint: string | undefined,\n): string | undefined {\n const {\n currentValue,\n currentVersion,\n newValue: rawNewValue,\n newVersion,\n packageName,\n } = dep;\n\n const newValue = massageNewValue(rawNewValue);\n\n if (oldConstraint && currentValue && newValue && currentValue === newValue) {\n logger.debug(\n `Leaving constraints \"${oldConstraint}\" unchanged for \"${packageName}\" as current and new values are the same`,\n );\n return oldConstraint;\n }\n\n if (\n oldConstraint &&\n currentValue &&\n newValue &&\n oldConstraint.includes(currentValue)\n ) {\n logger.debug(\n `Updating constraint \"${oldConstraint}\" to replace \"${currentValue}\" with \"${newValue}\" for \"${packageName}\"`,\n );\n //remove surplus .0 version\n return oldConstraint.replace(\n regEx(`(,\\\\s|^)${escapeRegExp(currentValue)}(\\\\.0)*`),\n `$1${newValue}`,\n );\n }\n\n if (\n oldConstraint &&\n currentVersion &&\n newVersion &&\n oldConstraint.includes(currentVersion)\n ) {\n logger.debug(\n `Updating constraint \"${oldConstraint}\" to replace \"${currentVersion}\" with \"${newVersion}\" for \"${packageName}\"`,\n );\n return oldConstraint.replace(currentVersion, newVersion);\n }\n\n if (isPinnedVersion(newValue)) {\n logger.debug(`Pinning constraint for \"${packageName}\" to \"${newVersion}\"`);\n return newVersion;\n }\n\n logger.debug(\n `Could not detect constraint to update for \"${packageName}\" so setting to newValue \"${newValue}\"`,\n );\n return newValue;\n}\n\nexport async function updateArtifacts({\n packageFileName,\n updatedDeps,\n config,\n}: UpdateArtifact): Promise<UpdateArtifactsResult[] | null> {\n logger.debug(`terraform.updateArtifacts(${packageFileName})`);\n\n const lockFilePath = await findLockFile(packageFileName);\n\n if (!lockFilePath) {\n logger.debug('No .terraform.lock.hcl found');\n return null;\n }\n\n try {\n const lockFileContent = await readLockFile(lockFilePath);\n if (!lockFileContent) {\n logger.debug('No .terraform.lock.hcl found');\n return null;\n }\n const locks = extractLocks(lockFileContent);\n if (!locks) {\n logger.debug('No Locks in .terraform.lock.hcl found');\n return null;\n }\n\n const updates: ProviderLockUpdate[] = [];\n if (config.isLockFileMaintenance) {\n // update all locks in the file during maintenance --> only update version in constraints\n const maintenanceUpdates = await updateAllLocks(locks);\n updates.push(...maintenanceUpdates);\n } else {\n const providerDeps = updatedDeps.filter((dep) =>\n // TODO #22198\n ['provider', 'required_provider'].includes(dep.depType!),\n );\n logger.debug(`Found ${providerDeps.length} provider deps`);\n for (const dep of providerDeps) {\n massageProviderLookupName(dep);\n const { registryUrls, newVersion, packageName } = dep;\n\n const updateLock = locks.find(\n (value) => value.packageName === packageName,\n );\n /* v8 ignore next 4 -- needs test */\n if (!updateLock) {\n logger.debug(`Skipping. No lock found for \"${packageName}\"`);\n continue;\n }\n if (dep.isLockfileUpdate) {\n const versioning = getVersioning(dep.versioning);\n const satisfyingVersion = versioning.getSatisfyingVersion(\n [dep.newVersion!],\n updateLock.constraints,\n );\n\n if (!satisfyingVersion) {\n logger.debug(\n `Skipping. Lockfile update with \"${newVersion}\" does not statisfy constraints \"${updateLock.constraints}\" for \"${packageName}\"`,\n );\n continue;\n }\n }\n\n // use registryURL defined in the update and fall back to the one defined in the lockfile\n const registryUrl = registryUrls?.[0] ?? updateLock.registryUrl;\n\n const newConstraint = getNewConstraint(dep, updateLock.constraints);\n const update: ProviderLockUpdate = {\n // TODO #22198\n newVersion: newVersion!,\n newConstraint: newConstraint!,\n newHashes:\n (await TerraformProviderHash.createHashes(\n registryUrl,\n updateLock.packageName,\n newVersion!,\n )) ?? /* v8 ignore next: needs test */ [],\n ...updateLock,\n };\n updates.push(update);\n }\n }\n // if no updates have been found or there are failed hashes abort\n if (\n updates.length === 0 ||\n updates.some((value) => !value.newHashes?.length)\n ) {\n logger.debug('No updates found or hash creation failed');\n return null;\n }\n logger.debug(`Writing updates to ${lockFilePath}`);\n const res = writeLockUpdates(updates, lockFilePath, lockFileContent);\n return [res];\n } catch (err) {\n return [\n {\n artifactError: {\n lockFile: lockFilePath,\n stderr: err.message,\n },\n },\n ];\n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AC,IAAI,UAAU,CAAC,WAAW,CAAC;gBAEhE,MAAM,aAAa,GAAG,gBAAgB,CAAC,GAAG,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC;gBACpE,MAAM,MAAM,GAAuB;oBACjC,cAAc;oBACd,UAAU,EAAE,UAAW;oBACvB,aAAa,EAAE,aAAc;oBAC7B,SAAS,EACP,CAAC,MAAM,4BAAqB,CAAC,YAAY,CACvC,WAAW,EACX,UAAU,CAAC,WAAW,EACtB,UAAW,CACZ,CAAC,IAAI,gCAAgC,CAAC,EAAE;oBAC3C,GAAG,UAAU;iBACd,CAAC;gBACF,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACvB,CAAC;QACH,CAAC;QACD,iEAAiE;QACjE,IACE,OAAO,CAAC,MAAM,KAAK,CAAC;YACpB,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,SAAS,EAAE,MAAM,CAAC,EACjD,CAAC;YACD,eAAM,CAAC,KAAK,CAAC,0CAA0C,CAAC,CAAC;YACzD,OAAO,IAAI,CAAC;QACd,CAAC;QACD,eAAM,CAAC,KAAK,CAAC,sBAAsB,YAAY,EAAE,CAAC,CAAC;QACnD,MAAM,GAAG,GAAG,IAAA,uBAAgB,EAAC,OAAO,EAAE,YAAY,EAAE,eAAe,CAAC,CAAC;QACrE,OAAO,CAAC,GAAG,CAAC,CAAC;IACf,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO;YACL;gBACE,aAAa,EAAE;oBACb,QAAQ,EAAE,YAAY;oBACtB,MAAM,EAAE,GAAG,CAAC,OAAO;iBACpB;aACF;SACF,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["import { isTruthy } from '@sindresorhus/is';\nimport { logger } from '../../../../logger';\nimport * as p from '../../../../util/promises';\nimport { escapeRegExp, regEx } from '../../../../util/regex';\nimport type { GetPkgReleasesConfig } from '../../../datasource';\nimport { getPkgReleases } from '../../../datasource';\nimport { get as getVersioning } from '../../../versioning';\nimport type {\n UpdateArtifact,\n UpdateArtifactsResult,\n Upgrade,\n} from '../../types';\nimport { massageProviderLookupName } from '../util';\nimport { TerraformProviderHash } from './hash';\nimport type { ProviderLock, ProviderLockUpdate } from './types';\nimport {\n extractLocks,\n findLockFile,\n isPinnedVersion,\n massageNewValue,\n readLockFile,\n writeLockUpdates,\n} from './util';\n\nasync function updateAllLocks(\n locks: ProviderLock[],\n): Promise<ProviderLockUpdate[]> {\n const updates = await p.map(\n locks,\n async (lock) => {\n const updateConfig: GetPkgReleasesConfig = {\n versioning: 'hashicorp',\n datasource: 'terraform-provider',\n packageName: lock.packageName,\n };\n const { releases } = (await getPkgReleases(updateConfig)) ?? {};\n if (!releases) {\n return null;\n }\n const versioning = getVersioning(updateConfig.versioning);\n const versionsList = releases.map((release) => release.version);\n const newVersion = versioning.getSatisfyingVersion(\n versionsList,\n lock.constraints,\n );\n\n // if the new version is the same as the last, signal that no update is needed\n if (!newVersion || newVersion === lock.version) {\n return null;\n }\n const update: ProviderLockUpdate = {\n newVersion,\n newConstraint: lock.constraints,\n newHashes:\n (await TerraformProviderHash.createHashes(\n lock.registryUrl,\n lock.packageName,\n newVersion,\n )) ?? [],\n ...lock,\n };\n return update;\n },\n { concurrency: 4 },\n );\n\n return updates.filter(isTruthy);\n}\n\nexport function getNewConstraint(\n dep: Upgrade<Record<string, unknown>>,\n oldConstraint: string | undefined,\n): string | undefined {\n const {\n currentValue,\n currentVersion,\n newValue: rawNewValue,\n newVersion,\n packageName,\n } = dep;\n\n const newValue = massageNewValue(rawNewValue);\n\n if (oldConstraint && currentValue && newValue && currentValue === newValue) {\n logger.debug(\n `Leaving constraints \"${oldConstraint}\" unchanged for \"${packageName}\" as current and new values are the same`,\n );\n return oldConstraint;\n }\n\n if (\n oldConstraint &&\n currentValue &&\n newValue &&\n oldConstraint.includes(currentValue)\n ) {\n logger.debug(\n `Updating constraint \"${oldConstraint}\" to replace \"${currentValue}\" with \"${newValue}\" for \"${packageName}\"`,\n );\n //remove surplus .0 version\n return oldConstraint.replace(\n regEx(`(,\\\\s|^)${escapeRegExp(currentValue)}(\\\\.0)*`),\n `$1${newValue}`,\n );\n }\n\n if (\n oldConstraint &&\n currentVersion &&\n newVersion &&\n oldConstraint.includes(currentVersion)\n ) {\n logger.debug(\n `Updating constraint \"${oldConstraint}\" to replace \"${currentVersion}\" with \"${newVersion}\" for \"${packageName}\"`,\n );\n return oldConstraint.replace(currentVersion, newVersion);\n }\n\n if (isPinnedVersion(newValue)) {\n logger.debug(`Pinning constraint for \"${packageName}\" to \"${newVersion}\"`);\n return newVersion;\n }\n\n logger.debug(\n `Could not detect constraint to update for \"${packageName}\" so setting to newValue \"${newValue}\"`,\n );\n return newValue;\n}\n\nexport async function updateArtifacts({\n packageFileName,\n updatedDeps,\n config,\n}: UpdateArtifact): Promise<UpdateArtifactsResult[] | null> {\n logger.debug(`terraform.updateArtifacts(${packageFileName})`);\n\n const lockFilePath = await findLockFile(packageFileName);\n\n if (!lockFilePath) {\n logger.debug('No .terraform.lock.hcl found');\n return null;\n }\n\n try {\n const lockFileContent = await readLockFile(lockFilePath);\n if (!lockFileContent) {\n logger.debug('No .terraform.lock.hcl found');\n return null;\n }\n const locks = extractLocks(lockFileContent);\n if (!locks) {\n logger.debug('No Locks in .terraform.lock.hcl found');\n return null;\n }\n\n const updates: ProviderLockUpdate[] = [];\n if (config.isLockFileMaintenance) {\n // update all locks in the file during maintenance --> only update version in constraints\n const maintenanceUpdates = await updateAllLocks(locks);\n updates.push(...maintenanceUpdates);\n } else {\n const providerDeps = updatedDeps.filter((dep) =>\n // TODO #22198\n ['provider', 'required_provider'].includes(dep.depType!),\n );\n logger.debug(`Found ${providerDeps.length} provider deps`);\n for (const dep of providerDeps) {\n massageProviderLookupName(dep);\n const { registryUrls, newVersion, packageName } = dep;\n\n const updateLock = locks.find(\n (value) => value.packageName === packageName,\n );\n /* v8 ignore next 4 -- needs test */\n if (!updateLock) {\n logger.debug(`Skipping. No lock found for \"${packageName}\"`);\n continue;\n }\n if (dep.isLockfileUpdate) {\n const versioning = getVersioning(dep.versioning);\n const satisfyingVersion = versioning.getSatisfyingVersion(\n [dep.newVersion!],\n updateLock.constraints,\n );\n\n if (!satisfyingVersion) {\n logger.debug(\n `Skipping. Lockfile update with \"${newVersion}\" does not statisfy constraints \"${updateLock.constraints}\" for \"${packageName}\"`,\n );\n continue;\n }\n }\n\n // use registryURL defined in the update and fall back to the one defined in the lockfile\n const registryUrl = registryUrls?.[0] ?? updateLock.registryUrl;\n\n const newConstraint = getNewConstraint(dep, updateLock.constraints);\n const update: ProviderLockUpdate = {\n // TODO #22198\n newVersion: newVersion!,\n newConstraint: newConstraint!,\n newHashes:\n (await TerraformProviderHash.createHashes(\n registryUrl,\n updateLock.packageName,\n newVersion!,\n )) ?? /* v8 ignore next: needs test */ [],\n ...updateLock,\n };\n updates.push(update);\n }\n }\n // if no updates have been found or there are failed hashes abort\n if (\n updates.length === 0 ||\n updates.some((value) => !value.newHashes?.length)\n ) {\n logger.debug('No updates found or hash creation failed');\n return null;\n }\n logger.debug(`Writing updates to ${lockFilePath}`);\n const res = writeLockUpdates(updates, lockFilePath, lockFileContent);\n return [res];\n } catch (err) {\n return [\n {\n artifactError: {\n lockFile: lockFilePath,\n stderr: err.message,\n },\n },\n ];\n }\n}\n"]}
@@ -6,8 +6,7 @@ exports.extractLocks = extractLocks;
6
6
  exports.isPinnedVersion = isPinnedVersion;
7
7
  exports.writeLockUpdates = writeLockUpdates;
8
8
  exports.massageNewValue = massageNewValue;
9
- const tslib_1 = require("tslib");
10
- const is_1 = tslib_1.__importDefault(require("@sindresorhus/is"));
9
+ const is_1 = require("@sindresorhus/is");
11
10
  const fs_1 = require("../../../../util/fs");
12
11
  const regex_1 = require("../../../../util/regex");
13
12
  const versioning_1 = require("../../../versioning");
@@ -175,7 +174,7 @@ function writeLockUpdates(updates, lockFilePath, oldLockFileContent) {
175
174
  };
176
175
  }
177
176
  function massageNewValue(value) {
178
- if (is_1.default.nullOrUndefined(value)) {
177
+ if ((0, is_1.isNullOrUndefined)(value)) {
179
178
  return value;
180
179
  }
181
180
  const elements = value.split(',');
@@ -1 +1 @@
1
- {"version":3,"file":"util.js","sourceRoot":"","sources":["../../../../../lib/modules/manager/terraform/lockfile/util.ts"],"names":[],"mappings":";;AAyBA,oCAEC;AAED,oCAEC;AAED,oCA4FC;AAED,0CAGC;AAED,4CA+FC;AAED,0CAyBC;;AA9PD,kEAAkC;AAClC,4CAA8E;AAC9E,kDAA6D;AAC7D,oDAA2D;AAS3D,MAAM,sBAAsB,GAAG,IAAA,aAAK,EAClC,yEAAyE,CAC1E,CAAC;AACF,MAAM,gBAAgB,GAAG,IAAA,aAAK,EAC5B,0EAA0E,CAC3E,CAAC;AACF,MAAM,mBAAmB,GAAG,IAAA,aAAK,EAC/B,iFAAiF,CAClF,CAAC;AACF,MAAM,aAAa,GAAG,IAAA,aAAK,EAAC,iDAAiD,CAAC,CAAC;AAE/E,MAAM,QAAQ,GAAG,qBAAqB,CAAC;AAEvC,SAAgB,YAAY,CAAC,eAAuB;IAClD,OAAO,IAAA,6BAAwB,EAAC,eAAe,EAAE,QAAQ,CAAC,CAAC;AAC7D,CAAC;AAED,SAAgB,YAAY,CAAC,YAAoB;IAC/C,OAAO,IAAA,kBAAa,EAAC,YAAY,EAAE,MAAM,CAAC,CAAC;AAC7C,CAAC;AAED,SAAgB,YAAY,CAAC,eAAuB;IAClD,MAAM,KAAK,GAAG,eAAe,CAAC,KAAK,CAAC,oBAAY,CAAC,CAAC;IAClD,MAAM,WAAW,GAAa,EAAE,CAAC;IACjC,4BAA4B;IAC5B,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;QAC5B,IAAI,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;YAClC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC1B,CAAC;IACH,CAAC,CAAC,C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AC,EAAE,CAAC;YAC3B,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAC/B,SAAS;QACX,CAAC;QAED,MAAM,SAAS,GAAG,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC;QAEhD,IAAI,eAAe,GAAG,OAAO,CAAC;QAE9B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,EAAE,CAAC,EAAE,EAAE,CAAC;YACnC,eAAe,GAAG,GAAG,eAAe,IAAI,CAAC;QAC3C,CAAC;QACD,gBAAgB,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IACzC,CAAC;IAED,OAAO,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACpC,CAAC","sourcesContent":["import is from '@sindresorhus/is';\nimport { findLocalSiblingOrParent, readLocalFile } from '../../../../util/fs';\nimport { newlineRegex, regEx } from '../../../../util/regex';\nimport { get as getVersioning } from '../../../versioning';\nimport type { UpdateArtifactsResult } from '../../types';\nimport type {\n LineNumbers,\n ProviderLock,\n ProviderLockUpdate,\n ProviderSlice,\n} from './types';\n\nconst providerStartLineRegex = regEx(\n `^provider \"(?<registryUrl>[^/]*)/(?<namespace>[^/]*)/(?<depName>[^/]*)\"`,\n);\nconst versionLineRegex = regEx(\n `^(?<prefix>[\\\\s]*version[\\\\s]*=[\\\\s]*\")(?<version>[^\"']+)(?<suffix>\".*)$`,\n);\nconst constraintLineRegex = regEx(\n `^(?<prefix>[\\\\s]*constraints[\\\\s]*=[\\\\s]*\")(?<constraint>[^\"']+)(?<suffix>\".*)$`,\n);\nconst hashLineRegex = regEx(`^(?<prefix>\\\\s*\")(?<hash>[^\"]+)(?<suffix>\",.*)$`);\n\nconst lockFile = '.terraform.lock.hcl';\n\nexport function findLockFile(packageFilePath: string): Promise<string | null> {\n return findLocalSiblingOrParent(packageFilePath, lockFile);\n}\n\nexport function readLockFile(lockFilePath: string): Promise<string | null> {\n return readLocalFile(lockFilePath, 'utf8');\n}\n\nexport function extractLocks(lockFileContent: string): ProviderLock[] | null {\n const lines = lockFileContent.split(newlineRegex);\n const blockStarts: number[] = [];\n // get first lines of blocks\n lines.forEach((line, index) => {\n if (line.startsWith('provider \"')) {\n blockStarts.push(index);\n }\n });\n\n // sort ascending\n const sortedStarts = blockStarts.sort((a, b) => a - b);\n const contentSlices = sortedStarts.map((start, index, array) => {\n let end: number;\n if (index < array.length - 1) {\n end = array[index + 1];\n } else {\n end = lines.length - 1;\n }\n const slice: ProviderSlice = {\n lines: lines.slice(start, end),\n block: {\n start,\n end,\n },\n };\n return slice;\n });\n\n // generate Lock objects from slices\n const locks = contentSlices.map((slice) => {\n let packageName = '';\n let registryUrl = '';\n let version = '';\n let constraints = '';\n const relativeLineNumbers: LineNumbers = {\n block: slice.block,\n hashes: {\n start: -1,\n end: -1,\n },\n };\n const hashes: string[] = [];\n\n slice.lines.forEach((line, index) => {\n const hashLineResult = hashLineRegex.exec(line);\n if (hashLineResult?.groups) {\n hashes.push(hashLineResult.groups.hash);\n relativeLineNumbers.hashes.start =\n relativeLineNumbers.hashes.start === -1\n ? index\n : relativeLineNumbers.hashes.start;\n relativeLineNumbers.hashes.end = index;\n return;\n }\n\n const providerStartLineResult = providerStartLineRegex.exec(line);\n if (providerStartLineResult?.groups) {\n packageName = `${providerStartLineResult.groups.namespace}/${providerStartLineResult.groups.depName}`;\n registryUrl = providerStartLineResult.groups.registryUrl;\n return;\n }\n\n const versionLineResult = versionLineRegex.exec(line);\n if (versionLineResult?.groups) {\n version = versionLineResult.groups.version;\n relativeLineNumbers.version = index;\n return;\n }\n\n const constraintLineResult = constraintLineRegex.exec(line);\n if (constraintLineResult?.groups) {\n constraints = constraintLineResult.groups.constraint;\n relativeLineNumbers.constraint = index;\n }\n });\n\n const lock: ProviderLock = {\n packageName,\n registryUrl: `https://${registryUrl}`,\n version,\n constraints,\n hashes,\n lineNumbers: relativeLineNumbers,\n };\n return lock;\n });\n\n if (locks.length === 0) {\n return null;\n }\n return locks;\n}\n\nexport function isPinnedVersion(value: string | undefined): boolean {\n const versioning = getVersioning('hashicorp');\n return !!value && !!versioning.isSingleVersion(value);\n}\n\nexport function writeLockUpdates(\n updates: ProviderLockUpdate[],\n lockFilePath: string,\n oldLockFileContent: string,\n): UpdateArtifactsResult {\n const lines = oldLockFileContent.split(newlineRegex);\n\n const sections: string[][] = [];\n\n // sort updates in order of appearance in the lockfile\n // TODO #22198\n updates.sort(\n (a, b) => a.lineNumbers.block!.start - b.lineNumbers.block!.start,\n );\n updates.forEach((update, index, array) => {\n // re add leading whitespace\n let startWhitespace: number | undefined;\n if (index > 0) {\n // get end of the\n // TODO #22198\n startWhitespace = array[index - 1].lineNumbers.block!.end;\n }\n const leadingNonRelevantLines = lines.slice(\n startWhitespace,\n // TODO #22198\n update.lineNumbers.block!.start,\n );\n sections.push(leadingNonRelevantLines);\n\n const providerBlockLines = lines.slice(\n // TODO #22198\n update.lineNumbers.block!.start,\n update.lineNumbers.block!.end,\n );\n const newProviderBlockLines: string[] = [];\n let hashLinePrefix = '';\n let hashLineSuffix = '';\n providerBlockLines.forEach((providerBlockLine, providerBlockIndex) => {\n const versionLine = providerBlockLine.replace(\n versionLineRegex,\n `$<prefix>${update.newVersion}$<suffix>`,\n );\n if (versionLine !== providerBlockLine) {\n newProviderBlockLines.push(versionLine);\n return;\n }\n\n const constraintLine = providerBlockLine.replace(\n constraintLineRegex,\n `$<prefix>${update.newConstraint}$<suffix>`,\n );\n if (constraintLine !== providerBlockLine) {\n newProviderBlockLines.push(constraintLine);\n return;\n }\n\n const hashLineRegexResult = hashLineRegex.exec(providerBlockLine);\n if (hashLineRegexResult?.groups) {\n // skip hash line but safe the whitespace\n hashLinePrefix = hashLineRegexResult.groups.prefix;\n hashLineSuffix = hashLineRegexResult.groups.suffix;\n return;\n }\n newProviderBlockLines.push(providerBlockLine);\n });\n\n const hashesWithWhitespace = update.newHashes.map(\n (value) => `${hashLinePrefix}${value}${hashLineSuffix}`,\n );\n newProviderBlockLines.splice(\n // TODO #22198\n update.lineNumbers.hashes.start!,\n 0,\n ...hashesWithWhitespace,\n );\n sections.push(newProviderBlockLines);\n });\n\n const trailingNotUpdatedLines = lines.slice(\n updates[updates.length - 1].lineNumbers.block?.end,\n );\n sections.push(trailingNotUpdatedLines);\n\n const newLines = sections.reduce((previousValue, currentValue) =>\n previousValue.concat(currentValue),\n );\n const newContent = newLines.join('\\n');\n\n return {\n file: {\n type: 'addition',\n path: lockFilePath,\n contents: newContent,\n },\n };\n}\n\nexport function massageNewValue(value: string | undefined): string | undefined {\n if (is.nullOrUndefined(value)) {\n return value;\n }\n\n const elements = value.split(',');\n const massagedElements: string[] = [];\n for (const element of elements) {\n // these constraints are allowed to miss precision\n if (element.includes('~>')) {\n massagedElements.push(element);\n continue;\n }\n\n const missing0s = 3 - element.split('.').length;\n\n let massagedElement = element;\n\n for (let i = 0; i < missing0s; i++) {\n massagedElement = `${massagedElement}.0`;\n }\n massagedElements.push(massagedElement);\n }\n\n return massagedElements.join(',');\n}\n"]}
1
+ {"version":3,"file":"util.js","sourceRoot":"","sources":["../../../../../lib/modules/manager/terraform/lockfile/util.ts"],"names":[],"mappings":";;AAyBA,oCAEC;AAED,oCAEC;AAED,oCA4FC;AAED,0CAGC;AAED,4CA+FC;AAED,0CAyBC;AA9PD,yCAAqD;AACrD,4CAA8E;AAC9E,kDAA6D;AAC7D,oDAA2D;AAS3D,MAAM,sBAAsB,GAAG,IAAA,aAAK,EAClC,yEAAyE,CAC1E,CAAC;AACF,MAAM,gBAAgB,GAAG,IAAA,aAAK,EAC5B,0EAA0E,CAC3E,CAAC;AACF,MAAM,mBAAmB,GAAG,IAAA,aAAK,EAC/B,iFAAiF,CAClF,CAAC;AACF,MAAM,aAAa,GAAG,IAAA,aAAK,EAAC,iDAAiD,CAAC,CAAC;AAE/E,MAAM,QAAQ,GAAG,qBAAqB,CAAC;AAEvC,SAAgB,YAAY,CAAC,eAAuB;IAClD,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AAM,UAAU,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEvC,OAAO;QACL,IAAI,EAAE;YACJ,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,YAAY;YAClB,QAAQ,EAAE,UAAU;SACrB;KACF,CAAC;AACJ,CAAC;AAED,SAAgB,eAAe,CAAC,KAAyB;IACvD,IAAI,IAAA,sBAAiB,EAAC,KAAK,CAAC,EAAE,CAAC;QAC7B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAClC,MAAM,gBAAgB,GAAa,EAAE,CAAC;IACtC,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,kDAAkD;QAClD,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YAC3B,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAC/B,SAAS;QACX,CAAC;QAED,MAAM,SAAS,GAAG,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC;QAEhD,IAAI,eAAe,GAAG,OAAO,CAAC;QAE9B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,EAAE,CAAC,EAAE,EAAE,CAAC;YACnC,eAAe,GAAG,GAAG,eAAe,IAAI,CAAC;QAC3C,CAAC;QACD,gBAAgB,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IACzC,CAAC;IAED,OAAO,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACpC,CAAC","sourcesContent":["import { isNullOrUndefined } from '@sindresorhus/is';\nimport { findLocalSiblingOrParent, readLocalFile } from '../../../../util/fs';\nimport { newlineRegex, regEx } from '../../../../util/regex';\nimport { get as getVersioning } from '../../../versioning';\nimport type { UpdateArtifactsResult } from '../../types';\nimport type {\n LineNumbers,\n ProviderLock,\n ProviderLockUpdate,\n ProviderSlice,\n} from './types';\n\nconst providerStartLineRegex = regEx(\n `^provider \"(?<registryUrl>[^/]*)/(?<namespace>[^/]*)/(?<depName>[^/]*)\"`,\n);\nconst versionLineRegex = regEx(\n `^(?<prefix>[\\\\s]*version[\\\\s]*=[\\\\s]*\")(?<version>[^\"']+)(?<suffix>\".*)$`,\n);\nconst constraintLineRegex = regEx(\n `^(?<prefix>[\\\\s]*constraints[\\\\s]*=[\\\\s]*\")(?<constraint>[^\"']+)(?<suffix>\".*)$`,\n);\nconst hashLineRegex = regEx(`^(?<prefix>\\\\s*\")(?<hash>[^\"]+)(?<suffix>\",.*)$`);\n\nconst lockFile = '.terraform.lock.hcl';\n\nexport function findLockFile(packageFilePath: string): Promise<string | null> {\n return findLocalSiblingOrParent(packageFilePath, lockFile);\n}\n\nexport function readLockFile(lockFilePath: string): Promise<string | null> {\n return readLocalFile(lockFilePath, 'utf8');\n}\n\nexport function extractLocks(lockFileContent: string): ProviderLock[] | null {\n const lines = lockFileContent.split(newlineRegex);\n const blockStarts: number[] = [];\n // get first lines of blocks\n lines.forEach((line, index) => {\n if (line.startsWith('provider \"')) {\n blockStarts.push(index);\n }\n });\n\n // sort ascending\n const sortedStarts = blockStarts.sort((a, b) => a - b);\n const contentSlices = sortedStarts.map((start, index, array) => {\n let end: number;\n if (index < array.length - 1) {\n end = array[index + 1];\n } else {\n end = lines.length - 1;\n }\n const slice: ProviderSlice = {\n lines: lines.slice(start, end),\n block: {\n start,\n end,\n },\n };\n return slice;\n });\n\n // generate Lock objects from slices\n const locks = contentSlices.map((slice) => {\n let packageName = '';\n let registryUrl = '';\n let version = '';\n let constraints = '';\n const relativeLineNumbers: LineNumbers = {\n block: slice.block,\n hashes: {\n start: -1,\n end: -1,\n },\n };\n const hashes: string[] = [];\n\n slice.lines.forEach((line, index) => {\n const hashLineResult = hashLineRegex.exec(line);\n if (hashLineResult?.groups) {\n hashes.push(hashLineResult.groups.hash);\n relativeLineNumbers.hashes.start =\n relativeLineNumbers.hashes.start === -1\n ? index\n : relativeLineNumbers.hashes.start;\n relativeLineNumbers.hashes.end = index;\n return;\n }\n\n const providerStartLineResult = providerStartLineRegex.exec(line);\n if (providerStartLineResult?.groups) {\n packageName = `${providerStartLineResult.groups.namespace}/${providerStartLineResult.groups.depName}`;\n registryUrl = providerStartLineResult.groups.registryUrl;\n return;\n }\n\n const versionLineResult = versionLineRegex.exec(line);\n if (versionLineResult?.groups) {\n version = versionLineResult.groups.version;\n relativeLineNumbers.version = index;\n return;\n }\n\n const constraintLineResult = constraintLineRegex.exec(line);\n if (constraintLineResult?.groups) {\n constraints = constraintLineResult.groups.constraint;\n relativeLineNumbers.constraint = index;\n }\n });\n\n const lock: ProviderLock = {\n packageName,\n registryUrl: `https://${registryUrl}`,\n version,\n constraints,\n hashes,\n lineNumbers: relativeLineNumbers,\n };\n return lock;\n });\n\n if (locks.length === 0) {\n return null;\n }\n return locks;\n}\n\nexport function isPinnedVersion(value: string | undefined): boolean {\n const versioning = getVersioning('hashicorp');\n return !!value && !!versioning.isSingleVersion(value);\n}\n\nexport function writeLockUpdates(\n updates: ProviderLockUpdate[],\n lockFilePath: string,\n oldLockFileContent: string,\n): UpdateArtifactsResult {\n const lines = oldLockFileContent.split(newlineRegex);\n\n const sections: string[][] = [];\n\n // sort updates in order of appearance in the lockfile\n // TODO #22198\n updates.sort(\n (a, b) => a.lineNumbers.block!.start - b.lineNumbers.block!.start,\n );\n updates.forEach((update, index, array) => {\n // re add leading whitespace\n let startWhitespace: number | undefined;\n if (index > 0) {\n // get end of the\n // TODO #22198\n startWhitespace = array[index - 1].lineNumbers.block!.end;\n }\n const leadingNonRelevantLines = lines.slice(\n startWhitespace,\n // TODO #22198\n update.lineNumbers.block!.start,\n );\n sections.push(leadingNonRelevantLines);\n\n const providerBlockLines = lines.slice(\n // TODO #22198\n update.lineNumbers.block!.start,\n update.lineNumbers.block!.end,\n );\n const newProviderBlockLines: string[] = [];\n let hashLinePrefix = '';\n let hashLineSuffix = '';\n providerBlockLines.forEach((providerBlockLine, providerBlockIndex) => {\n const versionLine = providerBlockLine.replace(\n versionLineRegex,\n `$<prefix>${update.newVersion}$<suffix>`,\n );\n if (versionLine !== providerBlockLine) {\n newProviderBlockLines.push(versionLine);\n return;\n }\n\n const constraintLine = providerBlockLine.replace(\n constraintLineRegex,\n `$<prefix>${update.newConstraint}$<suffix>`,\n );\n if (constraintLine !== providerBlockLine) {\n newProviderBlockLines.push(constraintLine);\n return;\n }\n\n const hashLineRegexResult = hashLineRegex.exec(providerBlockLine);\n if (hashLineRegexResult?.groups) {\n // skip hash line but safe the whitespace\n hashLinePrefix = hashLineRegexResult.groups.prefix;\n hashLineSuffix = hashLineRegexResult.groups.suffix;\n return;\n }\n newProviderBlockLines.push(providerBlockLine);\n });\n\n const hashesWithWhitespace = update.newHashes.map(\n (value) => `${hashLinePrefix}${value}${hashLineSuffix}`,\n );\n newProviderBlockLines.splice(\n // TODO #22198\n update.lineNumbers.hashes.start!,\n 0,\n ...hashesWithWhitespace,\n );\n sections.push(newProviderBlockLines);\n });\n\n const trailingNotUpdatedLines = lines.slice(\n updates[updates.length - 1].lineNumbers.block?.end,\n );\n sections.push(trailingNotUpdatedLines);\n\n const newLines = sections.reduce((previousValue, currentValue) =>\n previousValue.concat(currentValue),\n );\n const newContent = newLines.join('\\n');\n\n return {\n file: {\n type: 'addition',\n path: lockFilePath,\n contents: newContent,\n },\n };\n}\n\nexport function massageNewValue(value: string | undefined): string | undefined {\n if (isNullOrUndefined(value)) {\n return value;\n }\n\n const elements = value.split(',');\n const massagedElements: string[] = [];\n for (const element of elements) {\n // these constraints are allowed to miss precision\n if (element.includes('~>')) {\n massagedElements.push(element);\n continue;\n }\n\n const missing0s = 3 - element.split('.').length;\n\n let massagedElement = element;\n\n for (let i = 0; i < missing0s; i++) {\n massagedElement = `${massagedElement}.0`;\n }\n massagedElements.push(massagedElement);\n }\n\n return massagedElements.join(',');\n}\n"]}
@@ -5,8 +5,7 @@ exports.checkIfStringIsPath = checkIfStringIsPath;
5
5
  exports.massageProviderLookupName = massageProviderLookupName;
6
6
  exports.getLockedVersion = getLockedVersion;
7
7
  exports.extractLocksForPackageFile = extractLocksForPackageFile;
8
- const tslib_1 = require("tslib");
9
- const is_1 = tslib_1.__importDefault(require("@sindresorhus/is"));
8
+ const is_1 = require("@sindresorhus/is");
10
9
  const regex_1 = require("../../../util/regex");
11
10
  const terraform_provider_1 = require("../../datasource/terraform-provider");
12
11
  const util_1 = require("./lockfile/util");
@@ -46,7 +45,7 @@ async function extractLocksForPackageFile(fileName) {
46
45
  const lockFileContent = await (0, util_1.readLockFile)(lockFilePath);
47
46
  if (lockFileContent) {
48
47
  const extractedLocks = (0, util_1.extractLocks)(lockFileContent);
49
- if (is_1.default.nonEmptyArray(extractedLocks)) {
48
+ if ((0, is_1.isNonEmptyArray)(extractedLocks)) {
50
49
  locks.push(...extractedLocks);
51
50
  }
52
51
  }
@@ -1 +1 @@
1
- {"version":3,"file":"util.js","sourceRoot":"","sources":["../../../../lib/modules/manager/terraform/util.ts"],"names":[],"mappings":";;AAOA,kEAKC;AAGD,kDAGC;AAED,8DAWC;AAED,4CAgBC;AAED,gEAeC;;AAlED,kEAAkC;AAClC,+CAA4C;AAC5C,4EAAkF;AAGlF,0CAA2E;AAE3E,SAAgB,2BAA2B,CACzC,OAAe,EACf,SAAmB;IAEnB,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;AAC5D,CAAC;AAED,MAAM,eAAe,GAAG,IAAA,aAAK,EAAC,kBAAkB,CAAC,CAAC;AAClD,SAAgB,mBAAmB,CAAC,IAAY;IAC9C,MAAM,KAAK,GAAG,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzC,OAAO,CAAC,CAAC,KAAK,CAAC;AACjB,CAAC;AAED,SAAgB,yBAAyB,CAAC,GAAsB;IAC9D,GAAG,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CAAC,GAAG,cAAc,CAAC,CAAC;YAChC,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import is from '@sindresorhus/is';\nimport { regEx } from '../../../util/regex';\nimport { TerraformProviderDatasource } from '../../datasource/terraform-provider';\nimport type { PackageDependency } from '../types';\nimport type { ProviderLock } from './lockfile/types';\nimport { extractLocks, findLockFile, readLockFile } from './lockfile/util';\n\nexport function checkFileContainsDependency(\n content: string,\n checkList: string[],\n): boolean {\n return checkList.some((check) => content.includes(check));\n}\n\nconst pathStringRegex = regEx(/(.|..)?(\\/[^/])+/);\nexport function checkIfStringIsPath(path: string): boolean {\n const match = pathStringRegex.exec(path);\n return !!match;\n}\n\nexport function massageProviderLookupName(dep: PackageDependency): void {\n dep.packageName ??= dep.depName;\n\n // TODO #22198\n if (!dep.packageName!.includes('/')) {\n dep.packageName = `hashicorp/${dep.packageName!}`;\n }\n\n // handle cases like `Telmate/proxmox`\n // TODO #22198\n dep.packageName = dep.packageName!.toLowerCase();\n}\n\nexport function getLockedVersion(\n dep: PackageDependency,\n locks: ProviderLock[],\n): string | undefined {\n const depRegistryUrl = dep.registryUrls\n ? dep.registryUrls[0]\n : TerraformProviderDatasource.defaultRegistryUrls[0];\n const foundLock = locks.find(\n (lock) =>\n lock.packageName === dep.packageName &&\n lock.registryUrl === depRegistryUrl,\n );\n if (foundLock) {\n return foundLock.version;\n }\n return undefined;\n}\n\nexport async function extractLocksForPackageFile(\n fileName: string,\n): Promise<ProviderLock[]> {\n const locks: ProviderLock[] = [];\n const lockFilePath = await findLockFile(fileName);\n if (lockFilePath) {\n const lockFileContent = await readLockFile(lockFilePath);\n if (lockFileContent) {\n const extractedLocks = extractLocks(lockFileContent);\n if (is.nonEmptyArray(extractedLocks)) {\n locks.push(...extractedLocks);\n }\n }\n }\n return locks;\n}\n"]}
1
+ {"version":3,"file":"util.js","sourceRoot":"","sources":["../../../../lib/modules/manager/terraform/util.ts"],"names":[],"m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WAAW,KAAK,cAAc,CACtC,CAAC;IACF,IAAI,SAAS,EAAE,CAAC;QACd,OAAO,SAAS,CAAC,OAAO,CAAC;IAC3B,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAEM,KAAK,UAAU,0BAA0B,CAC9C,QAAgB;IAEhB,MAAM,KAAK,GAAmB,EAAE,CAAC;IACjC,MAAM,YAAY,GAAG,MAAM,IAAA,mBAAY,EAAC,QAAQ,CAAC,CAAC;IAClD,IAAI,YAAY,EAAE,CAAC;QACjB,MAAM,eAAe,GAAG,MAAM,IAAA,mBAAY,EAAC,YAAY,CAAC,CAAC;QACzD,IAAI,eAAe,EAAE,CAAC;YACpB,MAAM,cAAc,GAAG,IAAA,mBAAY,EAAC,eAAe,CAAC,CAAC;YACrD,IAAI,IAAA,oBAAe,EAAC,cAAc,CAAC,EAAE,CAAC;gBACpC,KAAK,CAAC,IAAI,CAAC,GAAG,cAAc,CAAC,CAAC;YAChC,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import { isNonEmptyArray } from '@sindresorhus/is';\nimport { regEx } from '../../../util/regex';\nimport { TerraformProviderDatasource } from '../../datasource/terraform-provider';\nimport type { PackageDependency } from '../types';\nimport type { ProviderLock } from './lockfile/types';\nimport { extractLocks, findLockFile, readLockFile } from './lockfile/util';\n\nexport function checkFileContainsDependency(\n content: string,\n checkList: string[],\n): boolean {\n return checkList.some((check) => content.includes(check));\n}\n\nconst pathStringRegex = regEx(/(.|..)?(\\/[^/])+/);\nexport function checkIfStringIsPath(path: string): boolean {\n const match = pathStringRegex.exec(path);\n return !!match;\n}\n\nexport function massageProviderLookupName(dep: PackageDependency): void {\n dep.packageName ??= dep.depName;\n\n // TODO #22198\n if (!dep.packageName!.includes('/')) {\n dep.packageName = `hashicorp/${dep.packageName!}`;\n }\n\n // handle cases like `Telmate/proxmox`\n // TODO #22198\n dep.packageName = dep.packageName!.toLowerCase();\n}\n\nexport function getLockedVersion(\n dep: PackageDependency,\n locks: ProviderLock[],\n): string | undefined {\n const depRegistryUrl = dep.registryUrls\n ? dep.registryUrls[0]\n : TerraformProviderDatasource.defaultRegistryUrls[0];\n const foundLock = locks.find(\n (lock) =>\n lock.packageName === dep.packageName &&\n lock.registryUrl === depRegistryUrl,\n );\n if (foundLock) {\n return foundLock.version;\n }\n return undefined;\n}\n\nexport async function extractLocksForPackageFile(\n fileName: string,\n): Promise<ProviderLock[]> {\n const locks: ProviderLock[] = [];\n const lockFilePath = await findLockFile(fileName);\n if (lockFilePath) {\n const lockFileContent = await readLockFile(lockFilePath);\n if (lockFileContent) {\n const extractedLocks = extractLocks(lockFileContent);\n if (isNonEmptyArray(extractedLocks)) {\n locks.push(...extractedLocks);\n }\n }\n }\n return locks;\n}\n"]}
@@ -1,8 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.extractTFLintPlugin = extractTFLintPlugin;
4
- const tslib_1 = require("tslib");
5
- const is_1 = tslib_1.__importDefault(require("@sindresorhus/is"));
4
+ const is_1 = require("@sindresorhus/is");
6
5
  const logger_1 = require("../../../logger");
7
6
  const regex_1 = require("../../../util/regex");
8
7
  const github_releases_1 = require("../../datasource/github-releases");
@@ -20,7 +19,7 @@ function extractTFLintPlugin(startingLine, lines, pluginName) {
20
19
  }
21
20
  const line = lines[lineNumber];
22
21
  // istanbul ignore else
23
- if (is_1.default.string(line)) {
22
+ if ((0, is_1.isString)(line)) {
24
23
  // `{` will be counted with +1 and `}` with -1.
25
24
  // Therefore if we reach braceCounter == 0 then we found the end of the tflint configuration block.
26
25
  const openBrackets = (line.match((0, regex_1.regEx)(/\{/g)) ?? []).length;
@@ -1 +1 @@
1
- {"version":3,"file":"plugins.js","sourceRoot":"","sources":["../../../../lib/modules/manager/tflint-plugin/plugins.ts"],"names":[],"mappings":";;AAQA,kDAoDC;;AA5DD,kEAAkC;AAClC,4CAAyC;AACzC,+CAA4C;AAC5C,sEA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ACrD,GAAG,CAAC,UAAU,GAAG,WAAW,CAAC;IAC/B,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["import is from '@sindresorhus/is';\nimport { logger } from '../../../logger';\nimport { regEx } from '../../../util/regex';\nimport { GithubReleasesDatasource } from '../../datasource/github-releases';\nimport type { PackageDependency } from '../types';\nimport type { ExtractionResult } from './types';\nimport { keyValueExtractionRegex } from './util';\n\nexport function extractTFLintPlugin(\n startingLine: number,\n lines: string[],\n pluginName: string,\n): ExtractionResult {\n let lineNumber = startingLine;\n const deps: PackageDependency[] = [];\n\n let pluginSource: string | null = null;\n let currentVersion: string | null = null;\n\n let braceCounter = 0;\n do {\n // istanbul ignore if\n if (lineNumber > lines.length - 1) {\n logger.debug(`Malformed TFLint configuration file detected.`);\n }\n\n const line = lines[lineNumber];\n\n // istanbul ignore else\n if (is.string(line)) {\n // `{` will be counted with +1 and `}` with -1.\n // Therefore if we reach braceCounter == 0 then we found the end of the tflint configuration block.\n const openBrackets = (line.match(regEx(/\\{/g)) ?? []).length;\n const closedBrackets = (line.match(regEx(/\\}/g)) ?? []).length;\n braceCounter = braceCounter + openBrackets - closedBrackets;\n\n // only update fields inside the root block\n if (braceCounter === 1) {\n const kvMatch = keyValueExtractionRegex.exec(line);\n if (kvMatch?.groups) {\n if (kvMatch.groups.key === 'version') {\n currentVersion = kvMatch.groups.value;\n } else if (kvMatch.groups.key === 'source') {\n pluginSource = kvMatch.groups.value;\n }\n }\n }\n } else {\n // stop - something went wrong\n braceCounter = 0;\n }\n lineNumber += 1;\n } while (braceCounter !== 0);\n\n const dep = analyseTFLintPlugin(pluginSource, currentVersion);\n deps.push(dep);\n\n // remove last lineNumber addition to not skip a line after the last bracket\n lineNumber -= 1;\n return { lineNumber, dependencies: deps };\n}\n\nfunction analyseTFLintPlugin(\n source: string | null,\n version: string | null,\n): PackageDependency {\n const dep: PackageDependency = {};\n\n if (source) {\n dep.depType = 'plugin';\n\n const sourceParts = source.split('/');\n if (sourceParts[0] === 'github.com') {\n dep.currentValue = version;\n dep.datasource = GithubReleasesDatasource.id;\n dep.depName = sourceParts.slice(1).join('/');\n } else {\n dep.skipReason = 'unsupported-datasource';\n dep.depName = source;\n }\n } else {\n logger.debug({ dep }, 'tflint plugin has no source');\n dep.skipReason = 'no-source';\n }\n\n return dep;\n}\n"]}
1
+ {"version":3,"file":"plugins.js","sourceRoot":"","sources":["../../../../lib/modules/manager/tflint-plugin/plugins.ts"],"names":[],"mappings":";;AAQA,kDAoDC;AA5DD,yCAA4C;AAC5C,4CAAyC;AACzC,+CAA4C;AAC5C,sEAA4E;AAG5E,iCAAiD;AAEjD,SAAgB,mBAAmB,CACjC,YAAoB,EACpB,KAAe,EACf,UAAkB;IAElB,IAAI,UAAU,GAAG,YAAY,CAAC;IAC9B,MAAM,IAAI,GAAwB,EAAE,CAAC;IAErC,IAAI,YAAY,GAAkB,IAAI,CAAC;IACvC,IAAI,cAAc,GAAkB,IAAI,CAAC;IAEzC,IAAI,YAAY,GAAG,CAAC,CAAC;IACrB,GAAG,CAAC;QACF,qBAAqB;QACrB,IAAI,UAAU,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAClC,eAAM,CAAC,KAAK,CAAC,+CAA+C,CAAC,CAAC;QAChE,CAAC;QAED,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC;QAE/B,uBAAuB;QACvB,IAAI,IAAA,aAAQ,EAAC,IAAI,CAAC,EAAE,CAAC;YACnB,+CAA+C;YAC/C,mGAAmG;YACnG,MAAM,YAAY,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,IAAA,aAAK,EAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC;YAC7D,MAAM,cAAc,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,IAAA,aAAK,EAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC;YAC/D,YAAY,GAAG,YA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,CAAC,UAAU,GAAG,0CAAwB,CAAC,EAAE,CAAC;YAC7C,GAAG,CAAC,OAAO,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC/C,CAAC;aAAM,CAAC;YACN,GAAG,CAAC,UAAU,GAAG,wBAAwB,CAAC;YAC1C,GAAG,CAAC,OAAO,GAAG,MAAM,CAAC;QACvB,CAAC;IACH,CAAC;SAAM,CAAC;QACN,eAAM,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,EAAE,6BAA6B,CAAC,CAAC;QACrD,GAAG,CAAC,UAAU,GAAG,WAAW,CAAC;IAC/B,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["import { isString } from '@sindresorhus/is';\nimport { logger } from '../../../logger';\nimport { regEx } from '../../../util/regex';\nimport { GithubReleasesDatasource } from '../../datasource/github-releases';\nimport type { PackageDependency } from '../types';\nimport type { ExtractionResult } from './types';\nimport { keyValueExtractionRegex } from './util';\n\nexport function extractTFLintPlugin(\n startingLine: number,\n lines: string[],\n pluginName: string,\n): ExtractionResult {\n let lineNumber = startingLine;\n const deps: PackageDependency[] = [];\n\n let pluginSource: string | null = null;\n let currentVersion: string | null = null;\n\n let braceCounter = 0;\n do {\n // istanbul ignore if\n if (lineNumber > lines.length - 1) {\n logger.debug(`Malformed TFLint configuration file detected.`);\n }\n\n const line = lines[lineNumber];\n\n // istanbul ignore else\n if (isString(line)) {\n // `{` will be counted with +1 and `}` with -1.\n // Therefore if we reach braceCounter == 0 then we found the end of the tflint configuration block.\n const openBrackets = (line.match(regEx(/\\{/g)) ?? []).length;\n const closedBrackets = (line.match(regEx(/\\}/g)) ?? []).length;\n braceCounter = braceCounter + openBrackets - closedBrackets;\n\n // only update fields inside the root block\n if (braceCounter === 1) {\n const kvMatch = keyValueExtractionRegex.exec(line);\n if (kvMatch?.groups) {\n if (kvMatch.groups.key === 'version') {\n currentVersion = kvMatch.groups.value;\n } else if (kvMatch.groups.key === 'source') {\n pluginSource = kvMatch.groups.value;\n }\n }\n }\n } else {\n // stop - something went wrong\n braceCounter = 0;\n }\n lineNumber += 1;\n } while (braceCounter !== 0);\n\n const dep = analyseTFLintPlugin(pluginSource, currentVersion);\n deps.push(dep);\n\n // remove last lineNumber addition to not skip a line after the last bracket\n lineNumber -= 1;\n return { lineNumber, dependencies: deps };\n}\n\nfunction analyseTFLintPlugin(\n source: string | null,\n version: string | null,\n): PackageDependency {\n const dep: PackageDependency = {};\n\n if (source) {\n dep.depType = 'plugin';\n\n const sourceParts = source.split('/');\n if (sourceParts[0] === 'github.com') {\n dep.currentValue = version;\n dep.datasource = GithubReleasesDatasource.id;\n dep.depName = sourceParts.slice(1).join('/');\n } else {\n dep.skipReason = 'unsupported-datasource';\n dep.depName = source;\n }\n } else {\n logger.debug({ dep }, 'tflint plugin has no source');\n dep.skipReason = 'no-source';\n }\n\n return dep;\n}\n"]}