renovate 42.94.1 → 42.94.3

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 (164) hide show
  1. package/dist/config/validation.js +7 -2
  2. package/dist/config/validation.js.map +1 -1
  3. package/dist/instrumentation/types.js.map +1 -1
  4. package/dist/instrumentation/with-instrumenting.js +24 -0
  5. package/dist/instrumentation/with-instrumenting.js.map +1 -0
  6. package/dist/modules/datasource/artifactory/index.js +9 -7
  7. package/dist/modules/datasource/artifactory/index.js.map +1 -1
  8. package/dist/modules/datasource/aws-eks-addon/index.js +9 -7
  9. package/dist/modules/datasource/aws-eks-addon/index.js.map +1 -1
  10. package/dist/modules/datasource/aws-machine-image/index.js +24 -17
  11. package/dist/modules/datasource/aws-machine-image/index.js.map +1 -1
  12. package/dist/modules/datasource/aws-rds/index.js +9 -7
  13. package/dist/modules/datasource/aws-rds/index.js.map +1 -1
  14. package/dist/modules/datasource/azure-bicep-resource/index.js +17 -13
  15. package/dist/modules/datasource/azure-bicep-resource/index.js.map +1 -1
  16. package/dist/modules/datasource/azure-pipelines-tasks/index.js +9 -8
  17. package/dist/modules/datasource/azure-pipelines-tasks/index.js.map +1 -1
  18. package/dist/modules/datasource/azure-tags/index.js +9 -7
  19. package/dist/modules/datasource/azure-tags/index.js.map +1 -1
  20. package/dist/modules/datasource/bazel/index.js +9 -7
  21. package/dist/modules/datasource/bazel/index.js.map +1 -1
  22. package/dist/modules/datasource/bitbucket-server-tags/index.js +25 -18
  23. package/dist/modules/datasource/bitbucket-server-tags/index.js.map +1 -1
  24. package/dist/modules/datasource/bitbucket-tags/index.js +32 -23
  25. package/dist/modules/datasource/bitbucket-tags/index.js.map +1 -1
  26. package/dist/modules/datasource/bitrise/index.js +9 -7
  27. package/dist/modules/datasource/bitrise/index.js.map +1 -1
  28. package/dist/modules/datasource/buildpacks-registry/index.js +9 -7
  29. package/dist/modules/datasource/buildpacks-registry/index.js.map +1 -1
  30. package/dist/modules/datasource/cdnjs/index.js +18 -14
  31. package/dist/modules/datasource/cdnjs/index.js.map +1 -1
  32. package/dist/modules/datasource/conan/index.js +17 -12
  33. package/dist/modules/datasource/conan/index.js.map +1 -1
  34. package/dist/modules/datasource/conda/index.js +9 -7
  35. package/dist/modules/datasource/conda/index.js.map +1 -1
  36. package/dist/modules/datasource/cpan/index.js +9 -7
  37. package/dist/modules/datasource/cpan/index.js.map +1 -1
  38. package/dist/modules/datasource/crate/index.js +29 -24
  39. package/dist/modules/datasource/crate/index.js.map +1 -1
  40. package/dist/modules/datasource/deb/index.js +24 -18
  41. package/dist/modules/datasource/deb/index.js.map +1 -1
  42. package/dist/modules/datasource/deno/index.js +16 -12
  43. package/dist/modules/datasource/deno/index.js.map +1 -1
  44. package/dist/modules/datasource/docker/index.js +67 -57
  45. package/dist/modules/datasource/docker/index.js.map +1 -1
  46. package/dist/modules/datasource/dotnet-version/index.js +18 -14
  47. package/dist/modules/datasource/dotnet-version/index.js.map +1 -1
  48. package/dist/modules/datasource/endoflife-date/index.js +9 -7
  49. package/dist/modules/datasource/endoflife-date/index.js.map +1 -1
  50. package/dist/modules/datasource/forgejo-releases/index.js +24 -17
  51. package/dist/modules/datasource/forgejo-releases/index.js.map +1 -1
  52. package/dist/modules/datasource/forgejo-tags/index.js +24 -17
  53. package/dist/modules/datasource/forgejo-tags/index.js.map +1 -1
  54. package/dist/modules/datasource/galaxy/index.js +9 -7
  55. package/dist/modules/datasource/galaxy/index.js.map +1 -1
  56. package/dist/modules/datasource/galaxy-collection/index.js +17 -13
  57. package/dist/modules/datasource/galaxy-collection/index.js.map +1 -1
  58. package/dist/modules/datasource/git-refs/base.js +8 -7
  59. package/dist/modules/datasource/git-refs/base.js.map +1 -1
  60. package/dist/modules/datasource/git-refs/index.js +9 -7
  61. package/dist/modules/datasource/git-refs/index.js.map +1 -1
  62. package/dist/modules/datasource/git-tags/index.js +9 -7
  63. package/dist/modules/datasource/git-tags/index.js.map +1 -1
  64. package/dist/modules/datasource/gitea-releases/index.js +24 -17
  65. package/dist/modules/datasource/gitea-releases/index.js.map +1 -1
  66. package/dist/modules/datasource/gitea-tags/index.js +24 -17
  67. package/dist/modules/datasource/gitea-tags/index.js.map +1 -1
  68. package/dist/modules/datasource/github-release-attachments/index.js +17 -14
  69. package/dist/modules/datasource/github-release-attachments/index.js.map +1 -1
  70. package/dist/modules/datasource/gitlab-packages/index.js +9 -7
  71. package/dist/modules/datasource/gitlab-packages/index.js.map +1 -1
  72. package/dist/modules/datasource/gitlab-releases/index.js +9 -7
  73. package/dist/modules/datasource/gitlab-releases/index.js.map +1 -1
  74. package/dist/modules/datasource/gitlab-tags/index.js +17 -12
  75. package/dist/modules/datasource/gitlab-tags/index.js.map +1 -1
  76. package/dist/modules/datasource/glasskube-packages/index.js +9 -7
  77. package/dist/modules/datasource/glasskube-packages/index.js.map +1 -1
  78. package/dist/modules/datasource/go/index.js +17 -12
  79. package/dist/modules/datasource/go/index.js.map +1 -1
  80. package/dist/modules/datasource/go/releases-direct.js +9 -7
  81. package/dist/modules/datasource/go/releases-direct.js.map +1 -1
  82. package/dist/modules/datasource/go/releases-goproxy.js +9 -7
  83. package/dist/modules/datasource/go/releases-goproxy.js.map +1 -1
  84. package/dist/modules/datasource/golang-version/index.js +9 -7
  85. package/dist/modules/datasource/golang-version/index.js.map +1 -1
  86. package/dist/modules/datasource/gradle-version/index.js +9 -7
  87. package/dist/modules/datasource/gradle-version/index.js.map +1 -1
  88. package/dist/modules/datasource/helm/index.js +8 -7
  89. package/dist/modules/datasource/helm/index.js.map +1 -1
  90. package/dist/modules/datasource/hermit/index.js +16 -12
  91. package/dist/modules/datasource/hermit/index.js.map +1 -1
  92. package/dist/modules/datasource/hex/index.js +9 -7
  93. package/dist/modules/datasource/hex/index.js.map +1 -1
  94. package/dist/modules/datasource/hexpm-bob/index.js +9 -7
  95. package/dist/modules/datasource/hexpm-bob/index.js.map +1 -1
  96. package/dist/modules/datasource/java-version/index.js +9 -7
  97. package/dist/modules/datasource/java-version/index.js.map +1 -1
  98. package/dist/modules/datasource/jenkins-plugins/index.js +16 -13
  99. package/dist/modules/datasource/jenkins-plugins/index.js.map +1 -1
  100. package/dist/modules/datasource/jsr/index.js +9 -7
  101. package/dist/modules/datasource/jsr/index.js.map +1 -1
  102. package/dist/modules/datasource/nextcloud/index.js +9 -7
  103. package/dist/modules/datasource/nextcloud/index.js.map +1 -1
  104. package/dist/modules/datasource/node-version/index.js +9 -7
  105. package/dist/modules/datasource/node-version/index.js.map +1 -1
  106. package/dist/modules/datasource/nuget/v3.js +9 -8
  107. package/dist/modules/datasource/nuget/v3.js.map +1 -1
  108. package/dist/modules/datasource/orb/index.js +9 -7
  109. package/dist/modules/datasource/orb/index.js.map +1 -1
  110. package/dist/modules/datasource/packagist/index.js +25 -20
  111. package/dist/modules/datasource/packagist/index.js.map +1 -1
  112. package/dist/modules/datasource/pod/index.js +10 -8
  113. package/dist/modules/datasource/pod/index.js.map +1 -1
  114. package/dist/modules/datasource/python-version/index.js +9 -7
  115. package/dist/modules/datasource/python-version/index.js.map +1 -1
  116. package/dist/modules/datasource/repology/index.js +9 -8
  117. package/dist/modules/datasource/repology/index.js.map +1 -1
  118. package/dist/modules/datasource/rpm/index.js +18 -14
  119. package/dist/modules/datasource/rpm/index.js.map +1 -1
  120. package/dist/modules/datasource/ruby-version/index.js +9 -7
  121. package/dist/modules/datasource/ruby-version/index.js.map +1 -1
  122. package/dist/modules/datasource/rubygems/index.js +11 -10
  123. package/dist/modules/datasource/rubygems/index.js.map +1 -1
  124. package/dist/modules/datasource/sbt-package/index.js +9 -8
  125. package/dist/modules/datasource/sbt-package/index.js.map +1 -1
  126. package/dist/modules/datasource/terraform-module/base.js +9 -8
  127. package/dist/modules/datasource/terraform-module/base.js.map +1 -1
  128. package/dist/modules/datasource/terraform-module/index.js +9 -7
  129. package/dist/modules/datasource/terraform-module/index.js.map +1 -1
  130. package/dist/modules/datasource/terraform-provider/index.js +32 -24
  131. package/dist/modules/datasource/terraform-provider/index.js.map +1 -1
  132. package/dist/modules/datasource/typst/index.js +9 -7
  133. package/dist/modules/datasource/typst/index.js.map +1 -1
  134. package/dist/modules/datasource/unity3d/index.js +9 -7
  135. package/dist/modules/datasource/unity3d/index.js.map +1 -1
  136. package/dist/modules/datasource/unity3d-packages/index.js +9 -7
  137. package/dist/modules/datasource/unity3d-packages/index.js.map +1 -1
  138. package/dist/modules/manager/bazel-module/parser/index.js.map +1 -1
  139. package/dist/modules/manager/fingerprint.generated.js +1 -1
  140. package/dist/modules/manager/fingerprint.generated.js.map +1 -1
  141. package/dist/modules/manager/git-submodules/extract.js +3 -4
  142. package/dist/modules/manager/git-submodules/extract.js.map +1 -1
  143. package/dist/modules/manager/git-submodules/update.js +2 -3
  144. package/dist/modules/manager/git-submodules/update.js.map +1 -1
  145. package/dist/modules/manager/terraform/lockfile/hash.js +9 -8
  146. package/dist/modules/manager/terraform/lockfile/hash.js.map +1 -1
  147. package/dist/modules/platform/azure/azure-got-wrapper.js.map +1 -1
  148. package/dist/modules/platform/azure/schema.js.map +1 -1
  149. package/dist/util/cache/package/{cached.js → with-cache.js} +4 -4
  150. package/dist/util/cache/package/with-cache.js.map +1 -0
  151. package/dist/util/git/index.js +2 -2
  152. package/dist/util/git/index.js.map +1 -1
  153. package/package.json +2 -2
  154. package/renovate-schema.json +2 -2
  155. package/dist/_virtual/_@oxc-project_runtime@0.110.0/helpers/decorate.js +0 -11
  156. package/dist/instrumentation/decorator.js +0 -19
  157. package/dist/instrumentation/decorator.js.map +0 -1
  158. package/dist/instrumentation/instrumented.js +0 -22
  159. package/dist/instrumentation/instrumented.js.map +0 -1
  160. package/dist/util/cache/package/cached.js.map +0 -1
  161. package/dist/util/cache/package/decorator.js +0 -28
  162. package/dist/util/cache/package/decorator.js.map +0 -1
  163. package/dist/util/decorator/index.js +0 -29
  164. package/dist/util/decorator/index.js.map +0 -1
@@ -58,11 +58,16 @@ function getUnsupportedEnabledManagers(enabledManagers) {
58
58
  return enabledManagers.filter((manager) => !require_index$2.allManagersList.includes(manager.replace("custom.", "")));
59
59
  }
60
60
  function getDeprecationMessage(option) {
61
- return {
61
+ const deprecatedOptions = {
62
62
  branchName: `Direct editing of branchName is now deprecated. Please edit branchPrefix, additionalBranchPrefix, or branchTopic instead`,
63
63
  commitMessage: `Direct editing of commitMessage is now deprecated. Please edit commitMessage's subcomponents instead.`,
64
64
  prTitle: `Direct editing of prTitle is now deprecated. Please edit commitMessage subcomponents instead as they will be passed through to prTitle.`
65
- }[option];
65
+ };
66
+ if (deprecatedOptions[option]) return deprecatedOptions[option];
67
+ const found = options.find((o) => o.name === option);
68
+ if (!found) return;
69
+ if (!found.deprecationMsg) return;
70
+ return `The '${option}' option is deprecated: ${found.deprecationMsg}`;
66
71
  }
67
72
  function isInhertConfigOption(key) {
68
73
  return optionInherits.has(key);
@@ -1 +1 @@
1
- {"version":3,"file":"validation.js","names":["getOptions","getManagerList","regEx","allManagersList","isFalseGlobal","is","getParentName","hasValidSchedule","isRegexMatch","getRegexPredicate","hasValidTimezone","validateNumber","resolveConfigPresets","migrateConfig","isCustomManager","validatePlainObject","GlobalConfig","matchRegexOrGlobList","allowedStatusCheckStrings","isString","parseUrl","getExpression","supportedDatasources","getConfigFileNames"],"sources":["../../lib/config/validation.ts"],"sourcesContent":["import is, {\n isArray,\n isEmptyString,\n isNonEmptyArray,\n isNonEmptyString,\n isObject,\n isPlainObject,\n isString,\n isUndefined,\n} from '@sindresorhus/is';\nimport type { PlatformId } from '../constants/index.ts';\nimport { isCustomManager } from '../modules/manager/custom/index.ts';\nimport type { CustomManager } from '../modules/manager/custom/types.ts';\nimport { allManagersList, getManagerList } from '../modules/manager/index.ts';\nimport type { HostRule } from '../types/index.ts';\nimport { getExpression } from '../util/jsonata.ts';\nimport { regEx } from '../util/regex.ts';\nimport {\n getRegexPredicate,\n isRegexMatch,\n matchRegexOrGlobList,\n} from '../util/string-match.ts';\nimport * as template from '../util/template/index.ts';\nimport { parseUrl } from '../util/url.ts';\nimport {\n hasValidSchedule,\n hasValidTimezone,\n} from '../workers/repository/update/branch/schedule.ts';\nimport { getConfigFileNames } from './app-strings.ts';\nimport { GlobalConfig } from './global.ts';\nimport { migrateConfig } from './migration.ts';\nimport { getOptions } from './options/index.ts';\nimport { resolveConfigPresets } from './presets/index.ts';\nimport { supportedDatasources } from './presets/internal/merge-confidence.ts';\nimport type {\n AllConfig,\n AllowedParents,\n RenovateConfig,\n RenovateOptions,\n StatusCheckKey,\n ValidationMessage,\n ValidationResult,\n} from './types.ts';\nimport { allowedStatusCheckStrings } from './types.ts';\nimport * as matchBaseBranchesValidator from './validation-helpers/match-base-branches.ts';\nimport * as regexOrGlobValidator from './validation-helpers/regex-glob-matchers.ts';\nimport {\n getParentName,\n isFalseGlobal,\n validateJSONataManagerFields,\n validateNumber,\n validatePlainObject,\n validateRegexManagerFields,\n} from './validation-helpers/utils.ts';\n\nconst options = getOptions();\n\nlet optionsInitialized = false;\nlet optionTypes: Record<string, RenovateOptions['type']>;\nlet optionParents: Record<string, AllowedParents[]>;\nlet optionGlobals: Set<string>;\nlet optionInherits: Set<string>;\nlet optionRegexOrGlob: Set<string>;\nlet optionAllowsNegativeIntegers: Set<string>;\n\nconst managerList = getManagerList();\n\nconst topLevelObjects = [...managerList, 'env'];\n\nconst ignoredNodes = [\n '$schema',\n 'headers',\n 'depType',\n 'npmToken',\n 'packageFile',\n 'forkToken',\n 'repository',\n 'vulnerabilityAlertsOnly',\n 'vulnerabilityAlert',\n 'isVulnerabilityAlert',\n 'vulnerabilityFixVersion', // not intended to be used by end users but may be by Mend apps\n 'copyLocalLibs', // deprecated - functionality is now enabled by default\n 'prBody', // deprecated\n 'minimumConfidence', // undocumented feature flag\n];\nconst tzRe = regEx(/^:timezone\\((.+)\\)$/);\nconst rulesRe = regEx(/p.*Rules\\[\\d+\\]$/);\n\nfunction isIgnored(key: string): boolean {\n return ignoredNodes.includes(key);\n}\n\nfunction getUnsupportedEnabledManagers(enabledManagers: string[]): string[] {\n return enabledManagers.filter(\n (manager) => !allManagersList.includes(manager.replace('custom.', '')),\n );\n}\n\nfunction getDeprecationMessage(option: string): string | undefined {\n const deprecatedOptions: Record<string, string | undefined> = {\n branchName: `Direct editing of branchName is now deprecated. Please edit branchPrefix, additionalBranchPrefix, or branchTopic instead`,\n commitMessage: `Direct editing of commitMessage is now deprecated. Please edit commitMessage's subcomponents instead.`,\n prTitle: `Direct editing of prTitle is now deprecated. Please edit commitMessage subcomponents instead as they will be passed through to prTitle.`,\n };\n return deprecatedOptions[option];\n}\n\nfunction isInhertConfigOption(key: string): boolean {\n return optionInherits.has(key);\n}\n\nfunction isRegexOrGlobOption(key: string): boolean {\n return optionRegexOrGlob.has(key);\n}\n\nfunction isGlobalOption(key: string): boolean {\n return optionGlobals.has(key);\n}\n\nfunction initOptions(): void {\n if (optionsInitialized) {\n return;\n }\n\n optionParents = {};\n optionInherits = new Set();\n optionTypes = {};\n optionRegexOrGlob = new Set();\n optionGlobals = new Set();\n optionAllowsNegativeIntegers = new Set();\n\n for (const option of options) {\n optionTypes[option.name] = option.type;\n\n if (option.parents) {\n optionParents[option.name] = option.parents;\n }\n\n if (option.inheritConfigSupport) {\n optionInherits.add(option.name);\n }\n\n if (option.patternMatch) {\n optionRegexOrGlob.add(option.name);\n }\n\n if (option.globalOnly) {\n optionGlobals.add(option.name);\n }\n\n if (option.allowNegative) {\n optionAllowsNegativeIntegers.add(option.name);\n }\n }\n\n optionsInitialized = true;\n}\n\nexport async function validateConfig(\n configType: 'global' | 'inherit' | 'repo',\n config: AllConfig,\n isPreset?: boolean,\n parentPath?: string,\n): Promise<ValidationResult> {\n initOptions();\n\n let errors: ValidationMessage[] = [];\n let warnings: ValidationMessage[] = [];\n\n for (const [key, val] of Object.entries(config)) {\n const currentPath = parentPath ? `${parentPath}.${key}` : key;\n /* v8 ignore next 7 -- TODO: add test */\n if (key === '__proto__') {\n errors.push({\n topic: 'Config security error',\n message: '__proto__',\n });\n continue;\n }\n if (\n parentPath &&\n parentPath !== 'onboardingConfig' &&\n topLevelObjects.includes(key)\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `The \"${key}\" object can only be configured at the top level of a config but was found inside \"${parentPath}\"`,\n });\n }\n\n if (isGlobalOption(key)) {\n if (configType === 'global') {\n await validateGlobalConfig(\n key,\n val,\n optionTypes[key],\n warnings,\n errors,\n currentPath,\n config,\n );\n continue;\n } else if (\n !isFalseGlobal(key, parentPath) &&\n !(configType === 'inherit' && isInhertConfigOption(key))\n ) {\n warnings.push({\n topic: 'Configuration Error',\n message: `The \"${key}\" option is a global option reserved only for Renovate's global configuration and cannot be configured within a repository's config file.`,\n });\n continue;\n }\n }\n if (key === 'enabledManagers' && val) {\n const unsupportedManagers = getUnsupportedEnabledManagers(\n val as string[],\n );\n if (isNonEmptyArray(unsupportedManagers)) {\n errors.push({\n topic: 'Configuration Error',\n message: `The following managers configured in enabledManagers are not supported: \"${unsupportedManagers.join(\n ', ',\n )}\"`,\n });\n }\n }\n if (\n !isIgnored(key) && // We need to ignore some reserved keys\n !(is as any).function(val) // Ignore all functions\n ) {\n if (getDeprecationMessage(key)) {\n warnings.push({\n topic: 'Deprecation Warning',\n message: getDeprecationMessage(key)!,\n });\n }\n const templateKeys = [\n 'branchName',\n 'commitBody',\n 'commitMessage',\n 'prTitle',\n 'semanticCommitScope',\n ];\n if ((key.endsWith('Template') || templateKeys.includes(key)) && val) {\n try {\n // TODO: validate string #22198\n let res = template.compile((val as string).toString(), config, false);\n res = template.compile(res, config, false);\n template.compile(res, config, false);\n } catch {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid template in config path: ${currentPath}`,\n });\n }\n }\n const parentName = getParentName(parentPath);\n if (\n !isPreset &&\n optionParents[key] &&\n !optionParents[key].includes(parentName as AllowedParents)\n ) {\n // TODO: types (#22198)\n const options = optionParents[key]?.toSorted().join(', ');\n const message = `\"${key}\" can't be used in \"${parentName}\". Allowed objects: ${options}.`;\n warnings.push({\n topic: `${parentPath ? `${parentPath}.` : ''}${key}`,\n message,\n });\n }\n if (!optionTypes[key]) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid configuration option: ${currentPath}`,\n });\n } else if (key === 'schedule') {\n const [validSchedule, errorMessage] = hasValidSchedule(val as string[]);\n if (!validSchedule) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid ${currentPath}: \\`${errorMessage}\\``,\n });\n }\n } else if (\n [\n 'allowedVersions',\n 'matchCurrentVersion',\n 'matchCurrentValue',\n 'matchNewValue',\n ].includes(key) &&\n isRegexMatch(val)\n ) {\n if (!getRegexPredicate(val)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid regExp for ${currentPath}: \\`${val}\\``,\n });\n }\n } else if (key === 'timezone' && val !== null) {\n const [validTimezone, errorMessage] = hasValidTimezone(val as string);\n if (!validTimezone) {\n errors.push({\n topic: 'Configuration Error',\n message: `${currentPath}: ${errorMessage}`,\n });\n }\n } else if (val !== null) {\n const type = optionTypes[key];\n if (type === 'boolean') {\n if (val !== true && val !== false) {\n errors.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}\\` should be boolean. Found: ${JSON.stringify(\n val,\n )} (${typeof val})`,\n });\n }\n } else if (type === 'integer') {\n const allowsNegative = optionAllowsNegativeIntegers.has(key);\n errors.push(...validateNumber(key, val, allowsNegative, currentPath));\n } else if (type === 'array' && val) {\n if (isArray(val)) {\n for (const [subIndex, subval] of val.entries()) {\n if (isObject(subval)) {\n const subValidation = await validateConfig(\n configType,\n subval as RenovateConfig,\n isPreset,\n `${currentPath}[${subIndex}]`,\n );\n warnings = warnings.concat(subValidation.warnings);\n errors = errors.concat(subValidation.errors);\n }\n }\n if (isRegexOrGlobOption(key)) {\n errors.push(\n ...regexOrGlobValidator.check({\n val,\n currentPath,\n }),\n );\n }\n if (key === 'extends') {\n for (const subval of val) {\n if (isString(subval)) {\n if (configType !== 'global' && subval.startsWith('global:')) {\n errors.push({\n topic: 'Configuration Error',\n message: `${currentPath}: you cannot extend from \"global:\" presets in a repository config's \"extends\"`,\n });\n }\n\n if (\n parentName === 'packageRules' &&\n subval.startsWith('group:')\n ) {\n warnings.push({\n topic: 'Configuration Warning',\n message: `${currentPath}: you should not extend \"group:\" presets`,\n });\n }\n if (tzRe.test(subval)) {\n const [, timezone] = tzRe.exec(subval)!;\n const [validTimezone, errorMessage] =\n hasValidTimezone(timezone);\n if (!validTimezone) {\n errors.push({\n topic: 'Configuration Error',\n message: `${currentPath}: ${errorMessage}`,\n });\n }\n }\n } else {\n errors.push({\n topic: 'Configuration Warning',\n message: `${currentPath}: preset value is not a string`,\n });\n }\n }\n }\n\n const selectors = [\n 'matchFileNames',\n 'matchLanguages',\n 'matchCategories',\n 'matchBaseBranches',\n 'matchManagers',\n 'matchDatasources',\n 'matchDepTypes',\n 'matchDepNames',\n 'matchPackageNames',\n 'matchCurrentValue',\n 'matchCurrentVersion',\n 'matchSourceUrls',\n 'matchUpdateTypes',\n 'matchConfidence',\n 'matchCurrentAge',\n 'matchRepositories',\n 'matchNewValue',\n 'matchJsonata',\n ];\n if (key === 'packageRules') {\n for (const [subIndex, packageRule] of val.entries()) {\n if (isObject(packageRule)) {\n const { config: resolved } = await resolveConfigPresets(\n packageRule as RenovateConfig,\n config,\n );\n const resolvedRule = migrateConfig({\n packageRules: [resolved],\n }).migratedConfig.packageRules![0];\n warnings.push(\n ...matchBaseBranchesValidator.check({\n resolvedRule,\n currentPath: `${currentPath}[${subIndex}]`,\n baseBranchPatterns: config.baseBranchPatterns!,\n }),\n );\n const selectorLength = Object.keys(resolvedRule).filter(\n (ruleKey) => selectors.includes(ruleKey),\n ).length;\n if (!selectorLength) {\n const message = `${currentPath}[${subIndex}]: Each packageRule must contain at least one match* or exclude* selector. Rule: ${JSON.stringify(\n packageRule,\n )}`;\n errors.push({\n topic: 'Configuration Error',\n message,\n });\n }\n if (selectorLength === Object.keys(resolvedRule).length) {\n const message = `${currentPath}[${subIndex}]: Each packageRule must contain at least one non-match* or non-exclude* field. Rule: ${JSON.stringify(\n packageRule,\n )}`;\n warnings.push({\n topic: 'Configuration Error',\n message,\n });\n }\n // It's too late to apply any of these options once you already have updates determined\n const preLookupOptions = [\n 'allowedVersions',\n 'extractVersion',\n 'followTag',\n 'ignoreDeps',\n 'ignoreUnstable',\n 'rangeStrategy',\n 'registryUrls',\n 'respectLatest',\n 'rollbackPrs',\n 'separateMajorMinor',\n 'separateMinorPatch',\n 'separateMultipleMajor',\n 'separateMultipleMinor',\n 'versioning',\n ] as const;\n if (isNonEmptyArray(resolvedRule.matchUpdateTypes)) {\n for (const option of preLookupOptions) {\n if (resolvedRule[option] !== undefined) {\n const message = `${currentPath}[${subIndex}]: packageRules cannot combine both matchUpdateTypes and ${option}. Rule: ${JSON.stringify(\n packageRule,\n )}`;\n errors.push({\n topic: 'Configuration Error',\n message,\n });\n }\n }\n }\n } else {\n errors.push({\n topic: 'Configuration Error',\n message: `${currentPath} must contain JSON objects`,\n });\n }\n }\n }\n if (key === 'customManagers') {\n const allowedKeys = [\n 'customType',\n 'description',\n 'fileFormat',\n 'managerFilePatterns',\n 'matchStrings',\n 'matchStringsStrategy',\n 'depNameTemplate',\n 'packageNameTemplate',\n 'datasourceTemplate',\n 'versioningTemplate',\n 'registryUrlTemplate',\n 'currentValueTemplate',\n 'extractVersionTemplate',\n 'autoReplaceStringTemplate',\n 'depTypeTemplate',\n ];\n for (const customManager of val as CustomManager[]) {\n if (\n Object.keys(customManager).some(\n (k) => !allowedKeys.includes(k),\n )\n ) {\n const disallowedKeys = Object.keys(customManager).filter(\n (k) => !allowedKeys.includes(k),\n );\n errors.push({\n topic: 'Configuration Error',\n message: `Custom Manager contains disallowed fields: ${disallowedKeys.join(\n ', ',\n )}`,\n });\n } else if (\n isNonEmptyString(customManager.customType) &&\n isCustomManager(customManager.customType)\n ) {\n if (isNonEmptyArray(customManager.managerFilePatterns)) {\n switch (customManager.customType) {\n case 'regex':\n validateRegexManagerFields(\n customManager,\n currentPath,\n errors,\n );\n break;\n case 'jsonata':\n validateJSONataManagerFields(\n customManager,\n currentPath,\n errors,\n );\n break;\n }\n } else {\n errors.push({\n topic: 'Configuration Error',\n message: `Each Custom Manager must contain a non-empty managerFilePatterns array`,\n });\n }\n } else {\n if (\n isEmptyString(customManager.customType) ||\n isUndefined(customManager.customType)\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `Each Custom Manager must contain a non-empty customType string`,\n });\n } else {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid customType: ${customManager.customType}. Key is not a custom manager`,\n });\n }\n }\n }\n }\n if (['matchPackageNames', 'matchDepNames'].includes(key)) {\n const startPattern = regEx(/!?\\//);\n const endPattern = regEx(/\\/g?i?$/);\n for (const pattern of val as string[]) {\n if (startPattern.test(pattern) && endPattern.test(pattern)) {\n try {\n // regEx isn't aware of our !/ prefix but can handle the suffix\n regEx(pattern.replace(startPattern, '/'));\n } catch {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid regExp for ${currentPath}: \\`${pattern}\\``,\n });\n }\n }\n }\n }\n if (key === 'baseBranchPatterns') {\n for (const baseBranchPattern of val as string[]) {\n if (\n isRegexMatch(baseBranchPattern) &&\n !getRegexPredicate(baseBranchPattern)\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid regExp for ${currentPath}: \\`${baseBranchPattern}\\``,\n });\n }\n }\n }\n if (\n (selectors.includes(key) ||\n key === 'matchCurrentVersion' ||\n key === 'matchCurrentValue') &&\n // TODO: can be undefined ? #22198\n !rulesRe.test(parentPath!) && // Inside a packageRule\n (isString(parentPath) || !isPreset) // top level in a preset\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `${currentPath}: ${key} should be inside a \\`packageRule\\` only`,\n });\n }\n } else {\n errors.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}\\` should be a list (Array)`,\n });\n }\n } else if (type === 'string') {\n if (!isString(val)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}\\` should be a string`,\n });\n }\n } else if (\n type === 'object' &&\n currentPath !== 'compatibility' &&\n key !== 'constraints'\n ) {\n if (isPlainObject(val)) {\n if (key === 'registryAliases') {\n const res = validatePlainObject(val);\n if (res !== true) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${key}.${res}\\` configuration: value is not a string`,\n });\n }\n } else if (key === 'env') {\n const allowedEnvVars =\n configType === 'global'\n ? (config.allowedEnv ?? [])\n : GlobalConfig.get('allowedEnv', []);\n for (const [envVarName, envVarValue] of Object.entries(val)) {\n if (!isString(envVarValue)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid env variable value: \\`${currentPath}.${envVarName}\\` must be a string.`,\n });\n }\n if (!matchRegexOrGlobList(envVarName, allowedEnvVars)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Env variable name \\`${envVarName}\\` is not allowed by this bot's \\`allowedEnv\\`.`,\n });\n }\n }\n } else if (key === 'statusCheckNames') {\n for (const [statusCheckKey, statusCheckValue] of Object.entries(\n val,\n )) {\n if (\n !allowedStatusCheckStrings.includes(\n statusCheckKey as StatusCheckKey,\n )\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${key}.${statusCheckKey}\\` configuration: key is not allowed.`,\n });\n }\n if (\n !(isString(statusCheckValue) || null === statusCheckValue)\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${statusCheckKey}\\` configuration: status check is not a string.`,\n });\n continue;\n }\n }\n } else if (key === 'customDatasources') {\n const allowedKeys = [\n 'description',\n 'defaultRegistryUrlTemplate',\n 'format',\n 'transformTemplates',\n ];\n for (const [\n customDatasourceName,\n customDatasourceValue,\n ] of Object.entries(val)) {\n if (!isPlainObject(customDatasourceValue)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${customDatasourceName}\\` configuration: customDatasource is not an object`,\n });\n continue;\n }\n for (const [subKey, subValue] of Object.entries(\n customDatasourceValue,\n )) {\n if (!allowedKeys.includes(subKey)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${subKey}\\` configuration: key is not allowed`,\n });\n } else if (subKey === 'transformTemplates') {\n if (!isArray(subValue, isString)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${subKey}\\` configuration: is not an array of string`,\n });\n }\n } else if (subKey === 'description') {\n if (!(isString(subValue) || isArray(subValue, isString))) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${subKey}\\` configuration: is not an array of strings`,\n });\n }\n } else if (!isString(subValue)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${subKey}\\` configuration: is a string`,\n });\n }\n }\n }\n } else {\n const ignoredObjects = options\n .filter((option) => option.freeChoice)\n .map((option) => option.name);\n if (!ignoredObjects.includes(key)) {\n const subValidation = await validateConfig(\n configType,\n val,\n isPreset,\n currentPath,\n );\n warnings = warnings.concat(subValidation.warnings);\n errors = errors.concat(subValidation.errors);\n }\n }\n } else {\n errors.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}\\` should be a json object`,\n });\n }\n }\n }\n }\n\n if (key === 'hostRules' && isArray(val)) {\n const allowedHeaders =\n configType === 'global'\n ? (config.allowedHeaders ?? [])\n : GlobalConfig.get('allowedHeaders', []);\n for (const rule of val as HostRule[]) {\n if (isNonEmptyString(rule.matchHost)) {\n if (rule.matchHost.includes('://')) {\n if (parseUrl(rule.matchHost) === null) {\n errors.push({\n topic: 'Configuration Error',\n message: `hostRules matchHost \\`${rule.matchHost}\\` is not a valid URL.`,\n });\n }\n }\n } else if (isEmptyString(rule.matchHost)) {\n errors.push({\n topic: 'Configuration Error',\n message:\n 'Invalid value for hostRules matchHost. It cannot be an empty string.',\n });\n }\n\n if (!rule.headers) {\n continue;\n }\n for (const [header, value] of Object.entries(rule.headers)) {\n if (!isString(value)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid hostRules headers value configuration: header must be a string.`,\n });\n }\n if (!matchRegexOrGlobList(header, allowedHeaders)) {\n errors.push({\n topic: 'Configuration Error',\n message: `hostRules header \\`${header}\\` is not allowed by this bot's \\`allowedHeaders\\`.`,\n });\n }\n }\n }\n }\n\n if (key === 'matchJsonata' && isArray(val, isString)) {\n for (const expression of val) {\n const res = getExpression(expression);\n if (res instanceof Error) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid JSONata expression for ${currentPath}: ${res.message}`,\n });\n }\n }\n }\n }\n\n function sortAll(a: ValidationMessage, b: ValidationMessage): number {\n if (a.topic === b.topic) {\n return a.message > b.message ? 1 : -1;\n }\n return a.topic > b.topic ? 1 : -1;\n }\n\n errors.sort(sortAll);\n warnings.sort(sortAll);\n return { errors, warnings };\n}\n\n/**\n * Basic validation for global config options\n */\nasync function validateGlobalConfig(\n key: string,\n val: unknown,\n type: string,\n warnings: ValidationMessage[],\n errors: ValidationMessage[],\n currentPath: string | undefined,\n config: AllConfig,\n): Promise<void> {\n /* v8 ignore next 5 -- not testable yet */\n if (getDeprecationMessage(key)) {\n warnings.push({\n topic: 'Deprecation Warning',\n message: getDeprecationMessage(key)!,\n });\n }\n if (val !== null) {\n // v8 ignore else -- TODO: add test #40625\n if (type === 'string') {\n if (isString(val)) {\n if (\n key === 'onboardingConfigFileName' &&\n !getPossibleConfigFileNames({\n configFileNames: config.configFileNames,\n platform: config.platform,\n }).includes(val)\n ) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid value \\`${val}\\` for \\`${currentPath}\\`. The allowed values are ${getPossibleConfigFileNames(\n {\n configFileNames: config.configFileNames,\n platform: config.platform,\n },\n ).join(', ')}.`,\n });\n } else if (\n key === 'repositoryCache' &&\n !['enabled', 'disabled', 'reset'].includes(val)\n ) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid value \\`${val}\\` for \\`${currentPath}\\`. The allowed values are ${['enabled', 'disabled', 'reset'].join(', ')}.`,\n });\n } else if (\n key === 'dryRun' &&\n !['extract', 'lookup', 'full'].includes(val)\n ) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid value \\`${val}\\` for \\`${currentPath}\\`. The allowed values are ${['extract', 'lookup', 'full'].join(', ')}.`,\n });\n } else if (\n key === 'binarySource' &&\n !['docker', 'global', 'install', 'hermit'].includes(val)\n ) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid value \\`${val}\\` for \\`${currentPath}\\`. The allowed values are ${['docker', 'global', 'install', 'hermit'].join(', ')}.`,\n });\n } else if (\n key === 'requireConfig' &&\n !['required', 'optional', 'ignored'].includes(val)\n ) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid value \\`${val}\\` for \\`${currentPath}\\`. The allowed values are ${['required', 'optional', 'ignored'].join(', ')}.`,\n });\n } else if (\n key === 'gitUrl' &&\n !['default', 'ssh', 'endpoint'].includes(val)\n ) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid value \\`${val}\\` for \\`${currentPath}\\`. The allowed values are ${['default', 'ssh', 'endpoint'].join(', ')}.`,\n });\n }\n\n if (\n key === 'reportType' &&\n ['s3', 'file'].includes(val) &&\n !isString(config.reportPath)\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `reportType '${val}' requires a configured reportPath`,\n });\n }\n } else {\n warnings.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}\\` should be a string.`,\n });\n }\n } else if (type === 'integer') {\n const allowsNegative = optionAllowsNegativeIntegers.has(key);\n warnings.push(...validateNumber(key, val, allowsNegative, currentPath));\n } else if (type === 'boolean') {\n if (val !== true && val !== false) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}\\` should be a boolean. Found: ${JSON.stringify(\n val,\n )} (${typeof val}).`,\n });\n }\n } else if (type === 'array') {\n if (isArray(val)) {\n if (isRegexOrGlobOption(key)) {\n warnings.push(\n ...regexOrGlobValidator.check({\n val,\n currentPath: currentPath!,\n }),\n );\n }\n if (key === 'gitNoVerify') {\n const allowedValues = ['commit', 'push'];\n for (const value of val as string[]) {\n // v8 ignore else -- TODO: add test #40625\n if (!allowedValues.includes(value)) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid value for \\`${currentPath}\\`. The allowed values are ${allowedValues.join(', ')}.`,\n });\n }\n }\n }\n if (key === 'mergeConfidenceDatasources') {\n const allowedValues = supportedDatasources;\n for (const value of val as string[]) {\n // v8 ignore else -- TODO: add test #40625\n if (!allowedValues.includes(value)) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid value \\`${value}\\` for \\`${currentPath}\\`. The allowed values are ${allowedValues.join(', ')}.`,\n });\n }\n }\n }\n } else {\n warnings.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}\\` should be a list (Array).`,\n });\n }\n } else if (type === 'object') {\n if (isPlainObject(val)) {\n if (key === 'onboardingConfig') {\n const subValidation = await validateConfig('repo', val);\n for (const warning of subValidation.warnings.concat(\n subValidation.errors,\n )) {\n warnings.push(warning);\n }\n } else if (key === 'force') {\n const subValidation = await validateConfig('global', val);\n for (const warning of subValidation.warnings.concat(\n subValidation.errors,\n )) {\n warnings.push(warning);\n }\n } else if (key === 'cacheTtlOverride') {\n for (const [subKey, subValue] of Object.entries(val)) {\n const allowsNegative = optionAllowsNegativeIntegers.has(key);\n warnings.push(\n ...validateNumber(\n key,\n subValue,\n allowsNegative,\n currentPath,\n subKey,\n ),\n );\n }\n } else {\n const res = validatePlainObject(val);\n if (res !== true) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${res}\\` configuration: value must be a string.`,\n });\n }\n }\n } else {\n warnings.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}\\` should be a JSON object.`,\n });\n }\n }\n }\n}\n\nfunction getPossibleConfigFileNames({\n configFileNames,\n platform,\n}: {\n configFileNames?: string[];\n platform?: PlatformId;\n}): string[] {\n const filenames = getConfigFileNames(platform);\n if (isNonEmptyArray(configFileNames)) {\n return filenames.concat(configFileNames);\n }\n\n return filenames;\n}\n"],"m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WAEK,SAAS,SAClB,yCAAkB,IAAI,CACpB,KAAI,QAAQ,oBAAoB;GAC9B,MAAM,gBAAgB,MAAM,eAAe,QAAQ,IAAI;AACvD,QAAK,MAAM,WAAW,cAAc,SAAS,OAC3C,cAAc,OACf,CACC,UAAS,KAAK,QAAQ;aAEf,QAAQ,SAAS;GAC1B,MAAM,gBAAgB,MAAM,eAAe,UAAU,IAAI;AACzD,QAAK,MAAM,WAAW,cAAc,SAAS,OAC3C,cAAc,OACf,CACC,UAAS,KAAK,QAAQ;aAEf,QAAQ,mBACjB,MAAK,MAAM,CAAC,QAAQ,aAAa,OAAO,QAAQ,IAAI,EAAE;GACpD,MAAM,iBAAiB,6BAA6B,IAAI,IAAI;AAC5D,YAAS,KACP,GAAGX,6BACD,KACA,UACA,gBACA,aACA,OACD,CACF;;OAEE;GACL,MAAM,MAAMI,kCAAoB,IAAI;AACpC,OAAI,QAAQ,KACV,UAAS,KAAK;IACZ,OAAO;IACP,SAAS,aAAa,YAAY,GAAG,IAAI;IAC1C,CAAC;;MAIN,UAAS,KAAK;GACZ,OAAO;GACP,SAAS,0BAA0B,YAAY;GAChD,CAAC;;;AAMV,SAAS,2BAA2B,EAClC,iBACA,YAIW;CACX,MAAM,YAAYQ,uCAAmB,SAAS;AAC9C,2CAAoB,gBAAgB,CAClC,QAAO,UAAU,OAAO,gBAAgB;AAG1C,QAAO"}
1
+ {"version":3,"file":"validation.js","names":["getOptions","getManagerList","regEx","allManagersList","isFalseGlobal","is","getParentName","hasValidSchedule","isRegexMatch","getRegexPredicate","hasValidTimezone","validateNumber","resolveConfigPresets","migrateConfig","isCustomManager","validatePlainObject","GlobalConfig","matchRegexOrGlobList","allowedStatusCheckStrings","isString","parseUrl","getExpression","supportedDatasources","getConfigFileNames"],"sources":["../../lib/config/validation.ts"],"sourcesContent":["import is, {\n isArray,\n isEmptyString,\n isNonEmptyArray,\n isNonEmptyString,\n isObject,\n isPlainObject,\n isString,\n isUndefined,\n} from '@sindresorhus/is';\nimport type { PlatformId } from '../constants/index.ts';\nimport { isCustomManager } from '../modules/manager/custom/index.ts';\nimport type { CustomManager } from '../modules/manager/custom/types.ts';\nimport { allManagersList, getManagerList } from '../modules/manager/index.ts';\nimport type { HostRule } from '../types/index.ts';\nimport { getExpression } from '../util/jsonata.ts';\nimport { regEx } from '../util/regex.ts';\nimport {\n getRegexPredicate,\n isRegexMatch,\n matchRegexOrGlobList,\n} from '../util/string-match.ts';\nimport * as template from '../util/template/index.ts';\nimport { parseUrl } from '../util/url.ts';\nimport {\n hasValidSchedule,\n hasValidTimezone,\n} from '../workers/repository/update/branch/schedule.ts';\nimport { getConfigFileNames } from './app-strings.ts';\nimport { GlobalConfig } from './global.ts';\nimport { migrateConfig } from './migration.ts';\nimport { getOptions } from './options/index.ts';\nimport { resolveConfigPresets } from './presets/index.ts';\nimport { supportedDatasources } from './presets/internal/merge-confidence.ts';\nimport type {\n AllConfig,\n AllowedParents,\n RenovateConfig,\n RenovateOptions,\n StatusCheckKey,\n ValidationMessage,\n ValidationResult,\n} from './types.ts';\nimport { allowedStatusCheckStrings } from './types.ts';\nimport * as matchBaseBranchesValidator from './validation-helpers/match-base-branches.ts';\nimport * as regexOrGlobValidator from './validation-helpers/regex-glob-matchers.ts';\nimport {\n getParentName,\n isFalseGlobal,\n validateJSONataManagerFields,\n validateNumber,\n validatePlainObject,\n validateRegexManagerFields,\n} from './validation-helpers/utils.ts';\n\nconst options = getOptions();\n\nlet optionsInitialized = false;\nlet optionTypes: Record<string, RenovateOptions['type']>;\nlet optionParents: Record<string, AllowedParents[]>;\nlet optionGlobals: Set<string>;\nlet optionInherits: Set<string>;\nlet optionRegexOrGlob: Set<string>;\nlet optionAllowsNegativeIntegers: Set<string>;\n\nconst managerList = getManagerList();\n\nconst topLevelObjects = [...managerList, 'env'];\n\nconst ignoredNodes = [\n '$schema',\n 'headers',\n 'depType',\n 'npmToken',\n 'packageFile',\n 'forkToken',\n 'repository',\n 'vulnerabilityAlertsOnly',\n 'vulnerabilityAlert',\n 'isVulnerabilityAlert',\n 'vulnerabilityFixVersion', // not intended to be used by end users but may be by Mend apps\n 'copyLocalLibs', // deprecated - functionality is now enabled by default\n 'prBody', // deprecated\n 'minimumConfidence', // undocumented feature flag\n];\nconst tzRe = regEx(/^:timezone\\((.+)\\)$/);\nconst rulesRe = regEx(/p.*Rules\\[\\d+\\]$/);\n\nfunction isIgnored(key: string): boolean {\n return ignoredNodes.includes(key);\n}\n\nfunction getUnsupportedEnabledManagers(enabledManagers: string[]): string[] {\n return enabledManagers.filter(\n (manager) => !allManagersList.includes(manager.replace('custom.', '')),\n );\n}\n\nfunction getDeprecationMessage(option: string): string | undefined {\n const deprecatedOptions: Record<string, string | undefined> = {\n branchName: `Direct editing of branchName is now deprecated. Please edit branchPrefix, additionalBranchPrefix, or branchTopic instead`,\n commitMessage: `Direct editing of commitMessage is now deprecated. Please edit commitMessage's subcomponents instead.`,\n prTitle: `Direct editing of prTitle is now deprecated. Please edit commitMessage subcomponents instead as they will be passed through to prTitle.`,\n };\n if (deprecatedOptions[option]) {\n return deprecatedOptions[option];\n }\n\n const found = options.find((o) => o.name === option);\n if (!found) {\n return undefined;\n }\n\n if (!found.deprecationMsg) {\n return undefined;\n }\n\n return `The '${option}' option is deprecated: ${found.deprecationMsg}`;\n}\n\nfunction isInhertConfigOption(key: string): boolean {\n return optionInherits.has(key);\n}\n\nfunction isRegexOrGlobOption(key: string): boolean {\n return optionRegexOrGlob.has(key);\n}\n\nfunction isGlobalOption(key: string): boolean {\n return optionGlobals.has(key);\n}\n\nfunction initOptions(): void {\n if (optionsInitialized) {\n return;\n }\n\n optionParents = {};\n optionInherits = new Set();\n optionTypes = {};\n optionRegexOrGlob = new Set();\n optionGlobals = new Set();\n optionAllowsNegativeIntegers = new Set();\n\n for (const option of options) {\n optionTypes[option.name] = option.type;\n\n if (option.parents) {\n optionParents[option.name] = option.parents;\n }\n\n if (option.inheritConfigSupport) {\n optionInherits.add(option.name);\n }\n\n if (option.patternMatch) {\n optionRegexOrGlob.add(option.name);\n }\n\n if (option.globalOnly) {\n optionGlobals.add(option.name);\n }\n\n if (option.allowNegative) {\n optionAllowsNegativeIntegers.add(option.name);\n }\n }\n\n optionsInitialized = true;\n}\n\nexport async function validateConfig(\n configType: 'global' | 'inherit' | 'repo',\n config: AllConfig,\n isPreset?: boolean,\n parentPath?: string,\n): Promise<ValidationResult> {\n initOptions();\n\n let errors: ValidationMessage[] = [];\n let warnings: ValidationMessage[] = [];\n\n for (const [key, val] of Object.entries(config)) {\n const currentPath = parentPath ? `${parentPath}.${key}` : key;\n /* v8 ignore next 7 -- TODO: add test */\n if (key === '__proto__') {\n errors.push({\n topic: 'Config security error',\n message: '__proto__',\n });\n continue;\n }\n if (\n parentPath &&\n parentPath !== 'onboardingConfig' &&\n topLevelObjects.includes(key)\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `The \"${key}\" object can only be configured at the top level of a config but was found inside \"${parentPath}\"`,\n });\n }\n\n if (isGlobalOption(key)) {\n if (configType === 'global') {\n await validateGlobalConfig(\n key,\n val,\n optionTypes[key],\n warnings,\n errors,\n currentPath,\n config,\n );\n continue;\n } else if (\n !isFalseGlobal(key, parentPath) &&\n !(configType === 'inherit' && isInhertConfigOption(key))\n ) {\n warnings.push({\n topic: 'Configuration Error',\n message: `The \"${key}\" option is a global option reserved only for Renovate's global configuration and cannot be configured within a repository's config file.`,\n });\n continue;\n }\n }\n if (key === 'enabledManagers' && val) {\n const unsupportedManagers = getUnsupportedEnabledManagers(\n val as string[],\n );\n if (isNonEmptyArray(unsupportedManagers)) {\n errors.push({\n topic: 'Configuration Error',\n message: `The following managers configured in enabledManagers are not supported: \"${unsupportedManagers.join(\n ', ',\n )}\"`,\n });\n }\n }\n if (\n !isIgnored(key) && // We need to ignore some reserved keys\n !(is as any).function(val) // Ignore all functions\n ) {\n if (getDeprecationMessage(key)) {\n warnings.push({\n topic: 'Deprecation Warning',\n message: getDeprecationMessage(key)!,\n });\n }\n const templateKeys = [\n 'branchName',\n 'commitBody',\n 'commitMessage',\n 'prTitle',\n 'semanticCommitScope',\n ];\n if ((key.endsWith('Template') || templateKeys.includes(key)) && val) {\n try {\n // TODO: validate string #22198\n let res = template.compile((val as string).toString(), config, false);\n res = template.compile(res, config, false);\n template.compile(res, config, false);\n } catch {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid template in config path: ${currentPath}`,\n });\n }\n }\n const parentName = getParentName(parentPath);\n if (\n !isPreset &&\n optionParents[key] &&\n !optionParents[key].includes(parentName as AllowedParents)\n ) {\n // TODO: types (#22198)\n const options = optionParents[key]?.toSorted().join(', ');\n const message = `\"${key}\" can't be used in \"${parentName}\". Allowed objects: ${options}.`;\n warnings.push({\n topic: `${parentPath ? `${parentPath}.` : ''}${key}`,\n message,\n });\n }\n if (!optionTypes[key]) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid configuration option: ${currentPath}`,\n });\n } else if (key === 'schedule') {\n const [validSchedule, errorMessage] = hasValidSchedule(val as string[]);\n if (!validSchedule) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid ${currentPath}: \\`${errorMessage}\\``,\n });\n }\n } else if (\n [\n 'allowedVersions',\n 'matchCurrentVersion',\n 'matchCurrentValue',\n 'matchNewValue',\n ].includes(key) &&\n isRegexMatch(val)\n ) {\n if (!getRegexPredicate(val)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid regExp for ${currentPath}: \\`${val}\\``,\n });\n }\n } else if (key === 'timezone' && val !== null) {\n const [validTimezone, errorMessage] = hasValidTimezone(val as string);\n if (!validTimezone) {\n errors.push({\n topic: 'Configuration Error',\n message: `${currentPath}: ${errorMessage}`,\n });\n }\n } else if (val !== null) {\n const type = optionTypes[key];\n if (type === 'boolean') {\n if (val !== true && val !== false) {\n errors.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}\\` should be boolean. Found: ${JSON.stringify(\n val,\n )} (${typeof val})`,\n });\n }\n } else if (type === 'integer') {\n const allowsNegative = optionAllowsNegativeIntegers.has(key);\n errors.push(...validateNumber(key, val, allowsNegative, currentPath));\n } else if (type === 'array' && val) {\n if (isArray(val)) {\n for (const [subIndex, subval] of val.entries()) {\n if (isObject(subval)) {\n const subValidation = await validateConfig(\n configType,\n subval as RenovateConfig,\n isPreset,\n `${currentPath}[${subIndex}]`,\n );\n warnings = warnings.concat(subValidation.warnings);\n errors = errors.concat(subValidation.errors);\n }\n }\n if (isRegexOrGlobOption(key)) {\n errors.push(\n ...regexOrGlobValidator.check({\n val,\n currentPath,\n }),\n );\n }\n if (key === 'extends') {\n for (const subval of val) {\n if (isString(subval)) {\n if (configType !== 'global' && subval.startsWith('global:')) {\n errors.push({\n topic: 'Configuration Error',\n message: `${currentPath}: you cannot extend from \"global:\" presets in a repository config's \"extends\"`,\n });\n }\n\n if (\n parentName === 'packageRules' &&\n subval.startsWith('group:')\n ) {\n warnings.push({\n topic: 'Configuration Warning',\n message: `${currentPath}: you should not extend \"group:\" presets`,\n });\n }\n if (tzRe.test(subval)) {\n const [, timezone] = tzRe.exec(subval)!;\n const [validTimezone, errorMessage] =\n hasValidTimezone(timezone);\n if (!validTimezone) {\n errors.push({\n topic: 'Configuration Error',\n message: `${currentPath}: ${errorMessage}`,\n });\n }\n }\n } else {\n errors.push({\n topic: 'Configuration Warning',\n message: `${currentPath}: preset value is not a string`,\n });\n }\n }\n }\n\n const selectors = [\n 'matchFileNames',\n 'matchLanguages',\n 'matchCategories',\n 'matchBaseBranches',\n 'matchManagers',\n 'matchDatasources',\n 'matchDepTypes',\n 'matchDepNames',\n 'matchPackageNames',\n 'matchCurrentValue',\n 'matchCurrentVersion',\n 'matchSourceUrls',\n 'matchUpdateTypes',\n 'matchConfidence',\n 'matchCurrentAge',\n 'matchRepositories',\n 'matchNewValue',\n 'matchJsonata',\n ];\n if (key === 'packageRules') {\n for (const [subIndex, packageRule] of val.entries()) {\n if (isObject(packageRule)) {\n const { config: resolved } = await resolveConfigPresets(\n packageRule as RenovateConfig,\n config,\n );\n const resolvedRule = migrateConfig({\n packageRules: [resolved],\n }).migratedConfig.packageRules![0];\n warnings.push(\n ...matchBaseBranchesValidator.check({\n resolvedRule,\n currentPath: `${currentPath}[${subIndex}]`,\n baseBranchPatterns: config.baseBranchPatterns!,\n }),\n );\n const selectorLength = Object.keys(resolvedRule).filter(\n (ruleKey) => selectors.includes(ruleKey),\n ).length;\n if (!selectorLength) {\n const message = `${currentPath}[${subIndex}]: Each packageRule must contain at least one match* or exclude* selector. Rule: ${JSON.stringify(\n packageRule,\n )}`;\n errors.push({\n topic: 'Configuration Error',\n message,\n });\n }\n if (selectorLength === Object.keys(resolvedRule).length) {\n const message = `${currentPath}[${subIndex}]: Each packageRule must contain at least one non-match* or non-exclude* field. Rule: ${JSON.stringify(\n packageRule,\n )}`;\n warnings.push({\n topic: 'Configuration Error',\n message,\n });\n }\n // It's too late to apply any of these options once you already have updates determined\n const preLookupOptions = [\n 'allowedVersions',\n 'extractVersion',\n 'followTag',\n 'ignoreDeps',\n 'ignoreUnstable',\n 'rangeStrategy',\n 'registryUrls',\n 'respectLatest',\n 'rollbackPrs',\n 'separateMajorMinor',\n 'separateMinorPatch',\n 'separateMultipleMajor',\n 'separateMultipleMinor',\n 'versioning',\n ] as const;\n if (isNonEmptyArray(resolvedRule.matchUpdateTypes)) {\n for (const option of preLookupOptions) {\n if (resolvedRule[option] !== undefined) {\n const message = `${currentPath}[${subIndex}]: packageRules cannot combine both matchUpdateTypes and ${option}. Rule: ${JSON.stringify(\n packageRule,\n )}`;\n errors.push({\n topic: 'Configuration Error',\n message,\n });\n }\n }\n }\n } else {\n errors.push({\n topic: 'Configuration Error',\n message: `${currentPath} must contain JSON objects`,\n });\n }\n }\n }\n if (key === 'customManagers') {\n const allowedKeys = [\n 'customType',\n 'description',\n 'fileFormat',\n 'managerFilePatterns',\n 'matchStrings',\n 'matchStringsStrategy',\n 'depNameTemplate',\n 'packageNameTemplate',\n 'datasourceTemplate',\n 'versioningTemplate',\n 'registryUrlTemplate',\n 'currentValueTemplate',\n 'extractVersionTemplate',\n 'autoReplaceStringTemplate',\n 'depTypeTemplate',\n ];\n for (const customManager of val as CustomManager[]) {\n if (\n Object.keys(customManager).some(\n (k) => !allowedKeys.includes(k),\n )\n ) {\n const disallowedKeys = Object.keys(customManager).filter(\n (k) => !allowedKeys.includes(k),\n );\n errors.push({\n topic: 'Configuration Error',\n message: `Custom Manager contains disallowed fields: ${disallowedKeys.join(\n ', ',\n )}`,\n });\n } else if (\n isNonEmptyString(customManager.customType) &&\n isCustomManager(customManager.customType)\n ) {\n if (isNonEmptyArray(customManager.managerFilePatterns)) {\n switch (customManager.customType) {\n case 'regex':\n validateRegexManagerFields(\n customManager,\n currentPath,\n errors,\n );\n break;\n case 'jsonata':\n validateJSONataManagerFields(\n customManager,\n currentPath,\n errors,\n );\n break;\n }\n } else {\n errors.push({\n topic: 'Configuration Error',\n message: `Each Custom Manager must contain a non-empty managerFilePatterns array`,\n });\n }\n } else {\n if (\n isEmptyString(customManager.customType) ||\n isUndefined(customManager.customType)\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `Each Custom Manager must contain a non-empty customType string`,\n });\n } else {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid customType: ${customManager.customType}. Key is not a custom manager`,\n });\n }\n }\n }\n }\n if (['matchPackageNames', 'matchDepNames'].includes(key)) {\n const startPattern = regEx(/!?\\//);\n const endPattern = regEx(/\\/g?i?$/);\n for (const pattern of val as string[]) {\n if (startPattern.test(pattern) && endPattern.test(pattern)) {\n try {\n // regEx isn't aware of our !/ prefix but can handle the suffix\n regEx(pattern.replace(startPattern, '/'));\n } catch {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid regExp for ${currentPath}: \\`${pattern}\\``,\n });\n }\n }\n }\n }\n if (key === 'baseBranchPatterns') {\n for (const baseBranchPattern of val as string[]) {\n if (\n isRegexMatch(baseBranchPattern) &&\n !getRegexPredicate(baseBranchPattern)\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid regExp for ${currentPath}: \\`${baseBranchPattern}\\``,\n });\n }\n }\n }\n if (\n (selectors.includes(key) ||\n key === 'matchCurrentVersion' ||\n key === 'matchCurrentValue') &&\n // TODO: can be undefined ? #22198\n !rulesRe.test(parentPath!) && // Inside a packageRule\n (isString(parentPath) || !isPreset) // top level in a preset\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `${currentPath}: ${key} should be inside a \\`packageRule\\` only`,\n });\n }\n } else {\n errors.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}\\` should be a list (Array)`,\n });\n }\n } else if (type === 'string') {\n if (!isString(val)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}\\` should be a string`,\n });\n }\n } else if (\n type === 'object' &&\n currentPath !== 'compatibility' &&\n key !== 'constraints'\n ) {\n if (isPlainObject(val)) {\n if (key === 'registryAliases') {\n const res = validatePlainObject(val);\n if (res !== true) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${key}.${res}\\` configuration: value is not a string`,\n });\n }\n } else if (key === 'env') {\n const allowedEnvVars =\n configType === 'global'\n ? (config.allowedEnv ?? [])\n : GlobalConfig.get('allowedEnv', []);\n for (const [envVarName, envVarValue] of Object.entries(val)) {\n if (!isString(envVarValue)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid env variable value: \\`${currentPath}.${envVarName}\\` must be a string.`,\n });\n }\n if (!matchRegexOrGlobList(envVarName, allowedEnvVars)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Env variable name \\`${envVarName}\\` is not allowed by this bot's \\`allowedEnv\\`.`,\n });\n }\n }\n } else if (key === 'statusCheckNames') {\n for (const [statusCheckKey, statusCheckValue] of Object.entries(\n val,\n )) {\n if (\n !allowedStatusCheckStrings.includes(\n statusCheckKey as StatusCheckKey,\n )\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${key}.${statusCheckKey}\\` configuration: key is not allowed.`,\n });\n }\n if (\n !(isString(statusCheckValue) || null === statusCheckValue)\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${statusCheckKey}\\` configuration: status check is not a string.`,\n });\n continue;\n }\n }\n } else if (key === 'customDatasources') {\n const allowedKeys = [\n 'description',\n 'defaultRegistryUrlTemplate',\n 'format',\n 'transformTemplates',\n ];\n for (const [\n customDatasourceName,\n customDatasourceValue,\n ] of Object.entries(val)) {\n if (!isPlainObject(customDatasourceValue)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${customDatasourceName}\\` configuration: customDatasource is not an object`,\n });\n continue;\n }\n for (const [subKey, subValue] of Object.entries(\n customDatasourceValue,\n )) {\n if (!allowedKeys.includes(subKey)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${subKey}\\` configuration: key is not allowed`,\n });\n } else if (subKey === 'transformTemplates') {\n if (!isArray(subValue, isString)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${subKey}\\` configuration: is not an array of string`,\n });\n }\n } else if (subKey === 'description') {\n if (!(isString(subValue) || isArray(subValue, isString))) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${subKey}\\` configuration: is not an array of strings`,\n });\n }\n } else if (!isString(subValue)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${subKey}\\` configuration: is a string`,\n });\n }\n }\n }\n } else {\n const ignoredObjects = options\n .filter((option) => option.freeChoice)\n .map((option) => option.name);\n if (!ignoredObjects.includes(key)) {\n const subValidation = await validateConfig(\n configType,\n val,\n isPreset,\n currentPath,\n );\n warnings = warnings.concat(subValidation.warnings);\n errors = errors.concat(subValidation.errors);\n }\n }\n } else {\n errors.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}\\` should be a json object`,\n });\n }\n }\n }\n }\n\n if (key === 'hostRules' && isArray(val)) {\n const allowedHeaders =\n configType === 'global'\n ? (config.allowedHeaders ?? [])\n : GlobalConfig.get('allowedHeaders', []);\n for (const rule of val as HostRule[]) {\n if (isNonEmptyString(rule.matchHost)) {\n if (rule.matchHost.includes('://')) {\n if (parseUrl(rule.matchHost) === null) {\n errors.push({\n topic: 'Configuration Error',\n message: `hostRules matchHost \\`${rule.matchHost}\\` is not a valid URL.`,\n });\n }\n }\n } else if (isEmptyString(rule.matchHost)) {\n errors.push({\n topic: 'Configuration Error',\n message:\n 'Invalid value for hostRules matchHost. It cannot be an empty string.',\n });\n }\n\n if (!rule.headers) {\n continue;\n }\n for (const [header, value] of Object.entries(rule.headers)) {\n if (!isString(value)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid hostRules headers value configuration: header must be a string.`,\n });\n }\n if (!matchRegexOrGlobList(header, allowedHeaders)) {\n errors.push({\n topic: 'Configuration Error',\n message: `hostRules header \\`${header}\\` is not allowed by this bot's \\`allowedHeaders\\`.`,\n });\n }\n }\n }\n }\n\n if (key === 'matchJsonata' && isArray(val, isString)) {\n for (const expression of val) {\n const res = getExpression(expression);\n if (res instanceof Error) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid JSONata expression for ${currentPath}: ${res.message}`,\n });\n }\n }\n }\n }\n\n function sortAll(a: ValidationMessage, b: ValidationMessage): number {\n if (a.topic === b.topic) {\n return a.message > b.message ? 1 : -1;\n }\n return a.topic > b.topic ? 1 : -1;\n }\n\n errors.sort(sortAll);\n warnings.sort(sortAll);\n return { errors, warnings };\n}\n\n/**\n * Basic validation for global config options\n */\nasync function validateGlobalConfig(\n key: string,\n val: unknown,\n type: string,\n warnings: ValidationMessage[],\n errors: ValidationMessage[],\n currentPath: string | undefined,\n config: AllConfig,\n): Promise<void> {\n /* v8 ignore next 5 -- not testable yet */\n if (getDeprecationMessage(key)) {\n warnings.push({\n topic: 'Deprecation Warning',\n message: getDeprecationMessage(key)!,\n });\n }\n if (val !== null) {\n // v8 ignore else -- TODO: add test #40625\n if (type === 'string') {\n if (isString(val)) {\n if (\n key === 'onboardingConfigFileName' &&\n !getPossibleConfigFileNames({\n configFileNames: config.configFileNames,\n platform: config.platform,\n }).includes(val)\n ) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid value \\`${val}\\` for \\`${currentPath}\\`. The allowed values are ${getPossibleConfigFileNames(\n {\n configFileNames: config.configFileNames,\n platform: config.platform,\n },\n ).join(', ')}.`,\n });\n } else if (\n key === 'repositoryCache' &&\n !['enabled', 'disabled', 'reset'].includes(val)\n ) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid value \\`${val}\\` for \\`${currentPath}\\`. The allowed values are ${['enabled', 'disabled', 'reset'].join(', ')}.`,\n });\n } else if (\n key === 'dryRun' &&\n !['extract', 'lookup', 'full'].includes(val)\n ) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid value \\`${val}\\` for \\`${currentPath}\\`. The allowed values are ${['extract', 'lookup', 'full'].join(', ')}.`,\n });\n } else if (\n key === 'binarySource' &&\n !['docker', 'global', 'install', 'hermit'].includes(val)\n ) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid value \\`${val}\\` for \\`${currentPath}\\`. The allowed values are ${['docker', 'global', 'install', 'hermit'].join(', ')}.`,\n });\n } else if (\n key === 'requireConfig' &&\n !['required', 'optional', 'ignored'].includes(val)\n ) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid value \\`${val}\\` for \\`${currentPath}\\`. The allowed values are ${['required', 'optional', 'ignored'].join(', ')}.`,\n });\n } else if (\n key === 'gitUrl' &&\n !['default', 'ssh', 'endpoint'].includes(val)\n ) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid value \\`${val}\\` for \\`${currentPath}\\`. The allowed values are ${['default', 'ssh', 'endpoint'].join(', ')}.`,\n });\n }\n\n if (\n key === 'reportType' &&\n ['s3', 'file'].includes(val) &&\n !isString(config.reportPath)\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `reportType '${val}' requires a configured reportPath`,\n });\n }\n } else {\n warnings.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}\\` should be a string.`,\n });\n }\n } else if (type === 'integer') {\n const allowsNegative = optionAllowsNegativeIntegers.has(key);\n warnings.push(...validateNumber(key, val, allowsNegative, currentPath));\n } else if (type === 'boolean') {\n if (val !== true && val !== false) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}\\` should be a boolean. Found: ${JSON.stringify(\n val,\n )} (${typeof val}).`,\n });\n }\n } else if (type === 'array') {\n if (isArray(val)) {\n if (isRegexOrGlobOption(key)) {\n warnings.push(\n ...regexOrGlobValidator.check({\n val,\n currentPath: currentPath!,\n }),\n );\n }\n if (key === 'gitNoVerify') {\n const allowedValues = ['commit', 'push'];\n for (const value of val as string[]) {\n // v8 ignore else -- TODO: add test #40625\n if (!allowedValues.includes(value)) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid value for \\`${currentPath}\\`. The allowed values are ${allowedValues.join(', ')}.`,\n });\n }\n }\n }\n if (key === 'mergeConfidenceDatasources') {\n const allowedValues = supportedDatasources;\n for (const value of val as string[]) {\n // v8 ignore else -- TODO: add test #40625\n if (!allowedValues.includes(value)) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid value \\`${value}\\` for \\`${currentPath}\\`. The allowed values are ${allowedValues.join(', ')}.`,\n });\n }\n }\n }\n } else {\n warnings.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}\\` should be a list (Array).`,\n });\n }\n } else if (type === 'object') {\n if (isPlainObject(val)) {\n if (key === 'onboardingConfig') {\n const subValidation = await validateConfig('repo', val);\n for (const warning of subValidation.warnings.concat(\n subValidation.errors,\n )) {\n warnings.push(warning);\n }\n } else if (key === 'force') {\n const subValidation = await validateConfig('global', val);\n for (const warning of subValidation.warnings.concat(\n subValidation.errors,\n )) {\n warnings.push(warning);\n }\n } else if (key === 'cacheTtlOverride') {\n for (const [subKey, subValue] of Object.entries(val)) {\n const allowsNegative = optionAllowsNegativeIntegers.has(key);\n warnings.push(\n ...validateNumber(\n key,\n subValue,\n allowsNegative,\n currentPath,\n subKey,\n ),\n );\n }\n } else {\n const res = validatePlainObject(val);\n if (res !== true) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${res}\\` configuration: value must be a string.`,\n });\n }\n }\n } else {\n warnings.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}\\` should be a JSON object.`,\n });\n }\n }\n }\n}\n\nfunction getPossibleConfigFileNames({\n configFileNames,\n platform,\n}: {\n configFileNames?: string[];\n platform?: PlatformId;\n}): string[] {\n const filenames = getConfigFileNames(platform);\n if (isNonEmptyArray(configFileNames)) {\n return filenames.concat(configFileNames);\n }\n\n return filenames;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;0BAgByC;6CAKR;sBAES;AAgC1C,MAAM,UAAUA,4BAAY;AAE5B,IAAI,qBAAqB;AACzB,IAAI;AACJ,IAAI;AACJ,IAAI;AACJ,IAAI;AACJ,IAAI;AACJ,IAAI;AAIJ,MAAM,kBAAkB,CAAC,GAFLC,gCAAgB,EAEK,MAAM;AAE/C,MAAM,eAAe;CACnB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AACD,MAAM,OAAOC,oBAAM,sBAAsB;AACzC,MAAM,UAAUA,oBAAM,mBAAmB;AAEzC,SAAS,UAAU,KAAsB;AACvC,QAAO,aAAa,SAAS,IAAI;;AAGnC,SAAS,8BAA8B,iBAAqC;AAC1E,QAAO,gBAAgB,QACpB,YAAY,CAACC,gCAAgB,SAAS,QAAQ,QAAQ,WAAW,GAAG,CAAC,CACvE;;AAGH,SAAS,sBAAsB,QAAoC;CACjE,MAAM,oBAAwD;EAC5D,YAAY;EACZ,eAAe;EACf,SAAS;EACV;AACD,KAAI,kBAAkB,QACpB,QAAO,kBAAkB;CAG3B,MAAM,QAAQ,QAAQ,MAAM,MAAM,EAAE,SAAS,OAAO;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UAAS,KAAK;IACZ,OAAO;IACP,SAAS,aAAa,YAAY,GAAG,IAAI;IAC1C,CAAC;;MAIN,UAAS,KAAK;GACZ,OAAO;GACP,SAAS,0BAA0B,YAAY;GAChD,CAAC;;;AAMV,SAAS,2BAA2B,EAClC,iBACA,YAIW;CACX,MAAM,YAAYQ,uCAAmB,SAAS;AAC9C,2CAAoB,gBAAgB,CAClC,QAAO,UAAU,OAAO,gBAAgB;AAG1C,QAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../lib/instrumentation/types.ts"],"sourcesContent":["import type { Attributes, SpanKind, SpanOptions } from '@opentelemetry/api';\nimport type { RenovateSplit } from '../config/types.ts';\nimport type { BunyanRecord } from '../logger/types.ts';\nimport type { PackageFile } from '../modules/manager/types.ts';\nimport type { BranchCache } from '../util/cache/repository/types.ts';\nimport type { GitOperationType } from '../util/git/types.ts';\n\nexport type RenovateSpanOptions = {\n attributes?: RenovateSpanAttributes;\n} & SpanOptions;\n\nexport type RenovateSpanAttributes = {\n [ATTR_RENOVATE_SPLIT]?: RenovateSplit;\n [ATTR_VCS_GIT_OPERATION_TYPE]?: GitOperationType;\n} & Attributes;\n\n/**\n * The instrumentation decorator parameters.\n */\nexport interface SpanParameters {\n /**\n * The name of the span\n */\n name: string;\n\n /**\n * Attributes which should be added to the span\n */\n attributes?: RenovateSpanAttributes | undefined;\n\n /**\n * Should this span be added to the root span or to the current active span\n */\n ignoreParentSpan?: boolean;\n\n /**\n * Type of span this represents. Default: SpanKind.Internal\n */\n kind?: SpanKind;\n}\n\nexport interface Report {\n problems: BunyanRecord[];\n repositories: Record<string, RepoReport>;\n}\n\ninterface RepoReport {\n problems: BunyanRecord[];\n branches: Partial<BranchCache>[];\n packageFiles: Record<string, PackageFile[]>;\n libYearsWithStatus?: LibYearsWithStatus;\n}\n\nexport interface LibYearsWithStatus {\n libYears: LibYears;\n dependencyStatus: DependencyStatus;\n}\n\nexport interface LibYears {\n total: number;\n managers: Record<string, number>;\n}\n\nexport interface DependencyStatus {\n outdated: number;\n total: number;\n}\n\nexport const ATTR_RENOVATE_SPLIT = 'renovate.split';\n\n/**\n * the Git Version Control System (VCS)'s Operation Type\n *\n * @see GitOperationType\n * @see https://opentelemetry.io/docs/specs/semconv/registry/attributes/vcs/\n *\n */\nexport const ATTR_VCS_GIT_OPERATION_TYPE = 'vcs.git.operation.type';\n\n/**\n * the Git Version Control System (VCS)'s subcommand\n *\n * @see https://opentelemetry.io/docs/specs/semconv/registry/attributes/vcs/\n * */\nexport const ATTR_VCS_GIT_SUBCOMMAND = 'vcs.git.subcommand';\n"],"mappings":";;AAoEA,MAAa,sBAAsB;;;;;;;;AASnC,MAAa,8BAA8B;;;;;;AAO3C,MAAa,0BAA0B"}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../lib/instrumentation/types.ts"],"sourcesContent":["import type { Attributes, SpanKind, SpanOptions } from '@opentelemetry/api';\nimport type { RenovateSplit } from '../config/types.ts';\nimport type { BunyanRecord } from '../logger/types.ts';\nimport type { PackageFile } from '../modules/manager/types.ts';\nimport type { BranchCache } from '../util/cache/repository/types.ts';\nimport type { GitOperationType } from '../util/git/types.ts';\n\nexport type RenovateSpanOptions = {\n attributes?: RenovateSpanAttributes;\n} & SpanOptions;\n\nexport type RenovateSpanAttributes = {\n [ATTR_RENOVATE_SPLIT]?: RenovateSplit;\n [ATTR_VCS_GIT_OPERATION_TYPE]?: GitOperationType;\n} & Attributes;\n\n/**\n * The instrumentation parameters.\n */\nexport interface SpanParameters {\n /**\n * The name of the span\n */\n name: string;\n\n /**\n * Attributes which should be added to the span\n */\n attributes?: RenovateSpanAttributes | undefined;\n\n /**\n * Should this span be added to the root span or to the current active span\n */\n ignoreParentSpan?: boolean;\n\n /**\n * Type of span this represents. Default: SpanKind.Internal\n */\n kind?: SpanKind;\n}\n\nexport interface Report {\n problems: BunyanRecord[];\n repositories: Record<string, RepoReport>;\n}\n\ninterface RepoReport {\n problems: BunyanRecord[];\n branches: Partial<BranchCache>[];\n packageFiles: Record<string, PackageFile[]>;\n libYearsWithStatus?: LibYearsWithStatus;\n}\n\nexport interface LibYearsWithStatus {\n libYears: LibYears;\n dependencyStatus: DependencyStatus;\n}\n\nexport interface LibYears {\n total: number;\n managers: Record<string, number>;\n}\n\nexport interface DependencyStatus {\n outdated: number;\n total: number;\n}\n\nexport const ATTR_RENOVATE_SPLIT = 'renovate.split';\n\n/**\n * the Git Version Control System (VCS)'s Operation Type\n *\n * @see GitOperationType\n * @see https://opentelemetry.io/docs/specs/semconv/registry/attributes/vcs/\n *\n */\nexport const ATTR_VCS_GIT_OPERATION_TYPE = 'vcs.git.operation.type';\n\n/**\n * the Git Version Control System (VCS)'s subcommand\n *\n * @see https://opentelemetry.io/docs/specs/semconv/registry/attributes/vcs/\n * */\nexport const ATTR_VCS_GIT_SUBCOMMAND = 'vcs.git.subcommand';\n"],"mappings":";;AAoEA,MAAa,sBAAsB;;;;;;;;AASnC,MAAa,8BAA8B;;;;;;AAO3C,MAAa,0BAA0B"}
@@ -0,0 +1,24 @@
1
+ const require_index = require('./index.js');
2
+
3
+ //#region lib/instrumentation/with-instrumenting.ts
4
+ /**
5
+ * Creates a wrapped version of an async function that instruments each call.
6
+ *
7
+ * @param options - Instrumentation options
8
+ * @param fn - The async function to wrap
9
+ * @returns A new function that instruments each call
10
+ */
11
+ function withInstrumenting(options, fn) {
12
+ const { name, attributes, ignoreParentSpan, kind } = options;
13
+ return (...args) => {
14
+ return require_index.instrument(name, () => fn(...args), {
15
+ attributes,
16
+ root: ignoreParentSpan,
17
+ kind
18
+ });
19
+ };
20
+ }
21
+
22
+ //#endregion
23
+ exports.withInstrumenting = withInstrumenting;
24
+ //# sourceMappingURL=with-instrumenting.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with-instrumenting.js","names":["instrument"],"sources":["../../lib/instrumentation/with-instrumenting.ts"],"sourcesContent":["import type { SpanKind } from '@opentelemetry/api';\nimport { instrument } from './index.ts';\nimport type { RenovateSpanAttributes } from './types.ts';\n\ninterface InstrumentedOptions {\n /**\n * The name of the span.\n */\n name: string;\n\n /**\n * Attributes to add to the span.\n */\n attributes?: RenovateSpanAttributes;\n\n /**\n * When true, creates a root span instead of a child of the current span.\n * @default false\n */\n ignoreParentSpan?: boolean;\n\n /**\n * Type of span. Default: SpanKind.INTERNAL\n */\n kind?: SpanKind;\n}\n\n/**\n * Creates a wrapped version of an async function that instruments each call.\n *\n * @param options - Instrumentation options\n * @param fn - The async function to wrap\n * @returns A new function that instruments each call\n */\nexport function withInstrumenting<T, Args extends unknown[]>(\n options: InstrumentedOptions,\n fn: (...args: Args) => Promise<T>,\n): (...args: Args) => Promise<T> {\n const { name, attributes, ignoreParentSpan, kind } = options;\n return (...args: Args): Promise<T> => {\n return instrument(name, () => fn(...args), {\n attributes,\n root: ignoreParentSpan,\n kind,\n });\n };\n}\n"],"mappings":";;;;;;;;;;AAkCA,SAAgB,kBACd,SACA,IAC+B;CAC/B,MAAM,EAAE,MAAM,YAAY,kBAAkB,SAAS;AACrD,SAAQ,GAAG,SAA2B;AACpC,SAAOA,yBAAW,YAAY,GAAG,GAAG,KAAK,EAAE;GACzC;GACA,MAAM;GACN;GACD,CAAC"}
@@ -2,11 +2,10 @@ const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.js'
2
2
  const require_regex = require('../../../util/regex.js');
3
3
  const require_index = require('../../../logger/index.js');
4
4
  const require_url = require('../../../util/url.js');
5
- const require_decorator = require('../../../util/cache/package/decorator.js');
5
+ const require_with_cache = require('../../../util/cache/package/with-cache.js');
6
6
  require('../../../util/http/index.js');
7
7
  const require_timestamp = require('../../../util/timestamp.js');
8
8
  const require_datasource = require('../datasource.js');
9
- const require_decorate = require('../../../_virtual/_@oxc-project_runtime@0.110.0/helpers/decorate.js');
10
9
  const require_html = require('../../../util/html.js');
11
10
  const require_common = require('./common.js');
12
11
  let got = require("got");
@@ -25,7 +24,7 @@ var ArtifactoryDatasource = class extends require_datasource.Datasource {
25
24
  registryStrategy = "merge";
26
25
  releaseTimestampSupport = true;
27
26
  releaseTimestampNote = "The release timestamp is determined from the date-like text, next to the version hyperlink tag in the results.";
28
- async getReleases({ packageName, registryUrl }) {
27
+ async _getReleases({ packageName, registryUrl }) {
29
28
  if (!registryUrl) {
30
29
  require_index.logger.warn({ packageName }, "artifactory datasource requires custom registryUrl. Skipping datasource");
31
30
  return null;
@@ -67,11 +66,14 @@ var ArtifactoryDatasource = class extends require_datasource.Datasource {
67
66
  }
68
67
  return result.releases.length ? result : null;
69
68
  }
69
+ getReleases(config) {
70
+ return require_with_cache.withCache({
71
+ namespace: `datasource-${require_common.datasource}`,
72
+ key: `${config.registryUrl}:${config.packageName}`,
73
+ fallback: true
74
+ }, () => this._getReleases(config));
75
+ }
70
76
  };
71
- require_decorate.__decorate([require_decorator.cache({
72
- namespace: `datasource-${require_common.datasource}`,
73
- key: ({ registryUrl, packageName }) => `${registryUrl}:${packageName}`
74
- })], ArtifactoryDatasource.prototype, "getReleases", null);
75
77
 
76
78
  //#endregion
77
79
  exports.ArtifactoryDatasource = ArtifactoryDatasource;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Datasource","datasource","joinUrlParts","parse","asTimestamp","regEx","HttpError","cache"],"sources":["../../../../lib/modules/datasource/artifactory/index.ts"],"sourcesContent":["import { logger } from '../../../logger/index.ts';\nimport { cache } from '../../../util/cache/package/decorator.ts';\nimport { parse } from '../../../util/html.ts';\nimport { HttpError } from '../../../util/http/index.ts';\nimport { regEx } from '../../../util/regex.ts';\nimport { asTimestamp } from '../../../util/timestamp.ts';\nimport { joinUrlParts } from '../../../util/url.ts';\nimport { Datasource } from '../datasource.ts';\nimport type { GetReleasesConfig, Release, ReleaseResult } from '../types.ts';\nimport { datasource } from './common.ts';\n\nexport class ArtifactoryDatasource extends Datasource {\n static readonly id = datasource;\n\n constructor() {\n super(datasource);\n }\n\n override readonly customRegistrySupport = true;\n\n override readonly caching = true;\n\n override readonly registryStrategy = 'merge';\n\n override readonly releaseTimestampSupport = true;\n override readonly releaseTimestampNote =\n 'The release timestamp is determined from the date-like text, next to the version hyperlink tag in the results.';\n\n @cache({\n namespace: `datasource-${datasource}`,\n key: ({ registryUrl, packageName }: GetReleasesConfig) =>\n // TODO: types (#22198)\n `${registryUrl}:${packageName}`,\n })\n async getReleases({\n packageName,\n registryUrl,\n }: GetReleasesConfig): Promise<ReleaseResult | null> {\n if (!registryUrl) {\n logger.warn(\n { packageName },\n 'artifactory datasource requires custom registryUrl. Skipping datasource',\n );\n return null;\n }\n\n const url = joinUrlParts(registryUrl, packageName);\n\n const result: ReleaseResult = {\n releases: [],\n };\n try {\n const response = await this.http.getText(url);\n const body = parse(response.body, {\n blockTextElements: {\n script: true,\n noscript: true,\n style: true,\n },\n });\n const nodes = body.querySelectorAll('a');\n\n nodes\n .filter(\n // filter out hyperlink to navigate to parent folder\n (node) => node.innerHTML !== '../' && node.innerHTML !== '..',\n )\n .forEach(\n // extract version and published time for each node\n (node) => {\n const version: string = node.innerHTML.endsWith('/')\n ? node.innerHTML.slice(0, -1)\n : node.innerHTML;\n\n const releaseTimestamp = asTimestamp(\n node.nextSibling?.text?.trimStart()?.split(regEx(/\\s{2,}/))?.[0],\n );\n\n const thisRelease: Release = {\n version,\n releaseTimestamp,\n };\n\n result.releases.push(thisRelease);\n },\n );\n\n if (result.releases.length) {\n logger.trace(\n { registryUrl, packageName, versions: result.releases.length },\n 'artifactory: Found versions',\n );\n } else {\n logger.trace(\n { registryUrl, packageName },\n 'artifactory: No versions found',\n );\n }\n } catch (err) {\n if (err instanceof HttpError) {\n if (err.response?.statusCode === 404) {\n logger.warn(\n { registryUrl, packageName },\n 'artifactory: `Not Found` error',\n );\n return null;\n }\n }\n this.handleGenericErrors(err);\n }\n\n return result.releases.length ? result : null;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;2BAAkD;0BAIH;sBAEK;AAKpD,IAAa,wBAAb,cAA2CA,8BAAW;CACpD,OAAgB,KAAKC;CAErB,cAA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B,CAAC"}
1
+ {"version":3,"file":"index.js","names":["Datasource","datasource","joinUrlParts","parse","asTimestamp","regEx","HttpError","withCache"],"sources":["../../../../lib/modules/datasource/artifactory/index.ts"],"sourcesContent":["import { logger } from '../../../logger/index.ts';\nimport { withCache } from '../../../util/cache/package/with-cache.ts';\nimport { parse } from '../../../util/html.ts';\nimport { HttpError } from '../../../util/http/index.ts';\nimport { regEx } from '../../../util/regex.ts';\nimport { asTimestamp } from '../../../util/timestamp.ts';\nimport { joinUrlParts } from '../../../util/url.ts';\nimport { Datasource } from '../datasource.ts';\nimport type { GetReleasesConfig, Release, ReleaseResult } from '../types.ts';\nimport { datasource } from './common.ts';\n\nexport class ArtifactoryDatasource extends Datasource {\n static readonly id = datasource;\n\n constructor() {\n super(datasource);\n }\n\n override readonly customRegistrySupport = true;\n\n override readonly caching = true;\n\n override readonly registryStrategy = 'merge';\n\n override readonly releaseTimestampSupport = true;\n override readonly releaseTimestampNote =\n 'The release timestamp is determined from the date-like text, next to the version hyperlink tag in the results.';\n\n private async _getReleases({\n packageName,\n registryUrl,\n }: GetReleasesConfig): Promise<ReleaseResult | null> {\n if (!registryUrl) {\n logger.warn(\n { packageName },\n 'artifactory datasource requires custom registryUrl. Skipping datasource',\n );\n return null;\n }\n\n const url = joinUrlParts(registryUrl, packageName);\n\n const result: ReleaseResult = {\n releases: [],\n };\n try {\n const response = await this.http.getText(url);\n const body = parse(response.body, {\n blockTextElements: {\n script: true,\n noscript: true,\n style: true,\n },\n });\n const nodes = body.querySelectorAll('a');\n\n nodes\n .filter(\n // filter out hyperlink to navigate to parent folder\n (node) => node.innerHTML !== '../' && node.innerHTML !== '..',\n )\n .forEach(\n // extract version and published time for each node\n (node) => {\n const version: string = node.innerHTML.endsWith('/')\n ? node.innerHTML.slice(0, -1)\n : node.innerHTML;\n\n const releaseTimestamp = asTimestamp(\n node.nextSibling?.text?.trimStart()?.split(regEx(/\\s{2,}/))?.[0],\n );\n\n const thisRelease: Release = {\n version,\n releaseTimestamp,\n };\n\n result.releases.push(thisRelease);\n },\n );\n\n if (result.releases.length) {\n logger.trace(\n { registryUrl, packageName, versions: result.releases.length },\n 'artifactory: Found versions',\n );\n } else {\n logger.trace(\n { registryUrl, packageName },\n 'artifactory: No versions found',\n );\n }\n } catch (err) {\n if (err instanceof HttpError) {\n if (err.response?.statusCode === 404) {\n logger.warn(\n { registryUrl, packageName },\n 'artifactory: `Not Found` error',\n );\n return null;\n }\n }\n this.handleGenericErrors(err);\n }\n\n return result.releases.length ? result : null;\n }\n\n getReleases(config: GetReleasesConfig): Promise<ReleaseResult | null> {\n return withCache(\n {\n namespace: `datasource-${datasource}`,\n key: `${config.registryUrl}:${config.packageName}`,\n fallback: true,\n },\n () => this._getReleases(config),\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;2BAAkD;0BAIH;sBAEK;AAKpD,IAAa,wBAAb,cAA2CA,8BAAW;CACpD,OAAgB,KAAKC;CAErB,cAAc;AACZ,QAAMA,0BAAW;;CAGnB,AAAkB,wBAAwB;CAE1C,AAAkB,UAAU;CAE5B,AAAkB,mBAAmB;CAErC,AAAkB,0BAA0B;CAC5C,AAAkB,uBAChB;CAEF,MAAc,aAAa,EACzB,aACA,eACmD;AACnD,MAAI,CAAC,aAAa;AAChB,wBAAO,KACL,EAAE,aAAa,EACf,0EACD;AACD,UAAO;;EAGT,MAAM,MAAMC,yBAAa,aAAa,YAAY;EAElD,MAAM,SAAwB,EAC5B,UAAU,EAAE,EACb;AACD,MAAI;AAWF,GATaC,oBADI,MAAM,KAAK,KAAK,QAAQ,IAAI,EACjB,MAAM,EAChC,mBAAmB;IACjB,QAAQ;IACR,UAAU;IACV,OAAO;IACR,EACF,CAAC,CACiB,iBAAiB,IAAI,CAGrC,QAEE,SAAS,KAAK,cAAc,SAAS,KAAK,cAAc,KAC1D,CACA,SAEE,SAAS;IASR,MAAM,cAAuB;KAC3B,SATsB,KAAK,UAAU,SAAS,IAAI,GAChD,KAAK,UAAU,MAAM,GAAG,GAAG,GAC3B,KAAK;KAQP,kBANuBC,8BACvB,KAAK,aAAa,MAAM,WAAW,EAAE,MAAMC,oBAAM,SAAS,CAAC,GAAG,GAC/D;KAKA;AAED,WAAO,SAAS,KAAK,YAAY;KAEpC;AAEH,OAAI,OAAO,SAAS,OAClB,sBAAO,MACL;IAAE;IAAa;IAAa,UAAU,OAAO,SAAS;IAAQ,EAC9D,8BACD;OAED,sBAAO,MACL;IAAE;IAAa;IAAa,EAC5B,iCACD;WAEI,KAAK;AACZ,OAAI,eAAeC,kBACjB;QAAI,IAAI,UAAU,eAAe,KAAK;AACpC,0BAAO,KACL;MAAE;MAAa;MAAa,EAC5B,iCACD;AACD,YAAO;;;AAGX,QAAK,oBAAoB,IAAI;;AAG/B,SAAO,OAAO,SAAS,SAAS,SAAS;;CAG3C,YAAY,QAA0D;AACpE,SAAOC,6BACL;GACE,WAAW,cAAcN;GACzB,KAAK,GAAG,OAAO,YAAY,GAAG,OAAO;GACrC,UAAU;GACX,QACK,KAAK,aAAa,OAAO,CAChC"}
@@ -1,9 +1,8 @@
1
1
  const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.js');
2
2
  const require_index = require('../../../logger/index.js');
3
- const require_decorator = require('../../../util/cache/package/decorator.js');
3
+ const require_with_cache = require('../../../util/cache/package/with-cache.js');
4
4
  const require_datasource = require('../datasource.js');
5
5
  const require_array = require('../../../util/array.js');
6
- const require_decorate = require('../../../_virtual/_@oxc-project_runtime@0.110.0/helpers/decorate.js');
7
6
  const require_index$1 = require('../../versioning/aws-eks-addon/index.js');
8
7
  const require_schema = require('./schema.js');
9
8
  let _sindresorhus_is = require("@sindresorhus/is");
@@ -20,7 +19,7 @@ var AwsEKSAddonDataSource = class AwsEKSAddonDataSource extends require_datasour
20
19
  constructor() {
21
20
  super(AwsEKSAddonDataSource.id);
22
21
  }
23
- async getReleases({ packageName: serializedFilter }) {
22
+ async _getReleases({ packageName: serializedFilter }) {
24
23
  const res = require_schema.EksAddonsFilter.safeParse(serializedFilter);
25
24
  if (!res.success) {
26
25
  require_index.logger.warn({
@@ -46,6 +45,13 @@ var AwsEKSAddonDataSource = class AwsEKSAddonDataSource extends require_datasour
46
45
  return true;
47
46
  }) };
48
47
  }
48
+ getReleases(config) {
49
+ return require_with_cache.withCache({
50
+ namespace: `datasource-${AwsEKSAddonDataSource.id}`,
51
+ key: `getReleases:${config.packageName}`,
52
+ fallback: true
53
+ }, () => this._getReleases(config));
54
+ }
49
55
  getClient({ region, profile }) {
50
56
  const cacheKey = `${region ?? "default"}#${profile ?? "default"}`;
51
57
  if (!(cacheKey in this.clients)) this.clients[cacheKey] = new _aws_sdk_client_eks.EKSClient({
@@ -55,10 +61,6 @@ var AwsEKSAddonDataSource = class AwsEKSAddonDataSource extends require_datasour
55
61
  return this.clients[cacheKey];
56
62
  }
57
63
  };
58
- require_decorate.__decorate([require_decorator.cache({
59
- namespace: `datasource-${AwsEKSAddonDataSource.id}`,
60
- key: ({ packageName }) => `getReleases:${packageName}`
61
- })], AwsEKSAddonDataSource.prototype, "getReleases", null);
62
64
 
63
65
  //#endregion
64
66
  exports.AwsEKSAddonDataSource = AwsEKSAddonDataSource;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Datasource","EksAddonsFilter","DescribeAddonVersionsCommand","coerceArray","isTruthy","EKSClient","cache"],"sources":["../../../../lib/modules/datasource/aws-eks-addon/index.ts"],"sourcesContent":["import { DescribeAddonVersionsCommand, EKSClient } from '@aws-sdk/client-eks';\nimport { fromNodeProviderChain } from '@aws-sdk/credential-providers';\nimport { isTruthy } from '@sindresorhus/is';\nimport { logger } from '../../../logger/index.ts';\nimport { coerceArray } from '../../../util/array.ts';\nimport { cache } from '../../../util/cache/package/decorator.ts';\nimport * as awsEksAddonVersioning from '../../versioning/aws-eks-addon/index.ts';\nimport { Datasource } from '../datasource.ts';\nimport type { GetReleasesConfig, ReleaseResult } from '../types.ts';\nimport { EksAddonsFilter } from './schema.ts';\n\nexport class AwsEKSAddonDataSource extends Datasource {\n static readonly id = 'aws-eks-addon';\n\n override readonly defaultVersioning = awsEksAddonVersioning.id;\n override readonly caching = true;\n private readonly clients: Record<string, EKSClient> = {};\n\n constructor() {\n super(AwsEKSAddonDataSource.id);\n }\n\n @cache({\n namespace: `datasource-${AwsEKSAddonDataSource.id}`,\n key: ({ packageName }: GetReleasesConfig) => `getReleases:${packageName}`,\n })\n async getReleases({\n packageName: serializedFilter,\n }: GetReleasesConfig): Promise<ReleaseResult | null> {\n const res = EksAddonsFilter.safeParse(serializedFilter);\n if (!res.success) {\n logger.warn(\n { err: res.error, serializedFilter },\n 'Error parsing eks-addons config.',\n );\n return null;\n }\n\n const filter = res.data;\n\n const cmd = new DescribeAddonVersionsCommand({\n kubernetesVersion: filter.kubernetesVersion,\n addonName: filter.addonName,\n maxResults: 1,\n });\n const response = await this.getClient(filter).send(cmd);\n const addons = coerceArray(response.addons);\n return {\n releases: addons\n .flatMap((addon) => {\n return addon.addonVersions;\n })\n .filter(isTruthy)\n .map((versionInfo) => ({\n version: versionInfo.addonVersion ?? '',\n default:\n versionInfo.compatibilities?.some((comp) => comp.defaultVersion) ??\n false,\n compatibleWith: versionInfo.compatibilities?.flatMap(\n (comp) => comp.clusterVersion,\n ),\n }))\n .filter((release) => release.version && release.version !== '')\n .filter((release) => {\n if (filter.default) {\n return release.default && release.default === filter.default;\n }\n return true;\n }),\n };\n }\n\n private getClient({ region, profile }: EksAddonsFilter): EKSClient {\n const cacheKey = `${region ?? 'default'}#${profile ?? 'default'}`;\n if (!(cacheKey in this.clients)) {\n this.clients[cacheKey] = new EKSClient({\n ...(region && { region }),\n credentials: fromNodeProviderChain(profile ? { profile } : undefined),\n });\n }\n return this.clients[cacheKey];\n }\n}\n"],"mappings":";;;;;;;;;;;;;2BAGkD;AAQlD,IAAa,wBAAb,MAAa,8BAA8BA,8BAAW;CACpD,OAAgB,KAAK;CAErB,AAAkB;CAClB,AAAkB,UAAU;CAC5B,AAAiB,UAAqC,EAAE;CAExD,cA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and","coerceArray","isTruthy","withCache","EKSClient"],"sources":["../../../../lib/modules/datasource/aws-eks-addon/index.ts"],"sourcesContent":["import { DescribeAddonVersionsCommand, EKSClient } from '@aws-sdk/client-eks';\nimport { fromNodeProviderChain } from '@aws-sdk/credential-providers';\nimport { isTruthy } from '@sindresorhus/is';\nimport { logger } from '../../../logger/index.ts';\nimport { coerceArray } from '../../../util/array.ts';\nimport { withCache } from '../../../util/cache/package/with-cache.ts';\nimport * as awsEksAddonVersioning from '../../versioning/aws-eks-addon/index.ts';\nimport { Datasource } from '../datasource.ts';\nimport type { GetReleasesConfig, ReleaseResult } from '../types.ts';\nimport { EksAddonsFilter } from './schema.ts';\n\nexport class AwsEKSAddonDataSource extends Datasource {\n static readonly id = 'aws-eks-addon';\n\n override readonly defaultVersioning = awsEksAddonVersioning.id;\n override readonly caching = true;\n private readonly clients: Record<string, EKSClient> = {};\n\n constructor() {\n super(AwsEKSAddonDataSource.id);\n }\n\n private async _getReleases({\n packageName: serializedFilter,\n }: GetReleasesConfig): Promise<ReleaseResult | null> {\n const res = EksAddonsFilter.safeParse(serializedFilter);\n if (!res.success) {\n logger.warn(\n { err: res.error, serializedFilter },\n 'Error parsing eks-addons config.',\n );\n return null;\n }\n\n const filter = res.data;\n\n const cmd = new DescribeAddonVersionsCommand({\n kubernetesVersion: filter.kubernetesVersion,\n addonName: filter.addonName,\n maxResults: 1,\n });\n const response = await this.getClient(filter).send(cmd);\n const addons = coerceArray(response.addons);\n return {\n releases: addons\n .flatMap((addon) => {\n return addon.addonVersions;\n })\n .filter(isTruthy)\n .map((versionInfo) => ({\n version: versionInfo.addonVersion ?? '',\n default:\n versionInfo.compatibilities?.some((comp) => comp.defaultVersion) ??\n false,\n compatibleWith: versionInfo.compatibilities?.flatMap(\n (comp) => comp.clusterVersion,\n ),\n }))\n .filter((release) => release.version && release.version !== '')\n .filter((release) => {\n if (filter.default) {\n return release.default && release.default === filter.default;\n }\n return true;\n }),\n };\n }\n\n getReleases(config: GetReleasesConfig): Promise<ReleaseResult | null> {\n return withCache(\n {\n namespace: `datasource-${AwsEKSAddonDataSource.id}`,\n key: `getReleases:${config.packageName}`,\n fallback: true,\n },\n () => this._getReleases(config),\n );\n }\n\n private getClient({ region, profile }: EksAddonsFilter): EKSClient {\n const cacheKey = `${region ?? 'default'}#${profile ?? 'default'}`;\n if (!(cacheKey in this.clients)) {\n this.clients[cacheKey] = new EKSClient({\n ...(region && { region }),\n credentials: fromNodeProviderChain(profile ? { profile } : undefined),\n });\n }\n return this.clients[cacheKey];\n }\n}\n"],"mappings":";;;;;;;;;;;;2BAGkD;AAQlD,IAAa,wBAAb,MAAa,8BAA8BA,8BAAW;CACpD,OAAgB,KAAK;CAErB,AAAkB;CAClB,AAAkB,UAAU;CAC5B,AAAiB,UAAqC,EAAE;CAExD,cAAc;AACZ,QAAM,sBAAsB,GAAG;;CAGjC,MAAc,aAAa,EACzB,aAAa,oBACsC;EACnD,MAAM,MAAMC,+BAAgB,UAAU,iBAAiB;AACvD,MAAI,CAAC,IAAI,SAAS;AAChB,wBAAO,KACL;IAAE,KAAK,IAAI;IAAO;IAAkB,EACpC,mCACD;AACD,UAAO;;EAGT,MAAM,SAAS,IAAI;EAEnB,MAAM,MAAM,IAAIC,iDAA6B;GAC3C,mBAAmB,OAAO;GAC1B,WAAW,OAAO;GAClB,YAAY;GACb,CAAC;AAGF,SAAO,EACL,UAFaC,2BADE,MAAM,KAAK,UAAU,OAAO,CAAC,KAAK,IAAI,EACnB,OAAO,CAGtC,SAAS,UAAU;AAClB,UAAO,MAAM;IACb,CACD,OAAOC,0BAAS,CAChB,KAAK,iBAAiB;GACrB,SAAS,YAAY,gBAAgB;GACrC,SACE,YAAY,iBAAiB,MAAM,SAAS,KAAK,eAAe,IAChE;GACF,gBAAgB,YAAY,iBAAiB,SAC1C,SAAS,KAAK,eAChB;GACF,EAAE,CACF,QAAQ,YAAY,QAAQ,WAAW,QAAQ,YAAY,GAAG,CAC9D,QAAQ,YAAY;AACnB,OAAI,OAAO,QACT,QAAO,QAAQ,WAAW,QAAQ,YAAY,OAAO;AAEvD,UAAO;IACP,EACL;;CAGH,YAAY,QAA0D;AACpE,SAAOC,6BACL;GACE,WAAW,cAAc,sBAAsB;GAC/C,KAAK,eAAe,OAAO;GAC3B,UAAU;GACX,QACK,KAAK,aAAa,OAAO,CAChC;;CAGH,AAAQ,UAAU,EAAE,QAAQ,WAAuC;EACjE,MAAM,WAAW,GAAG,UAAU,UAAU,GAAG,WAAW;AACtD,MAAI,EAAE,YAAY,KAAK,SACrB,MAAK,QAAQ,YAAY,IAAIC,8BAAU;GACrC,GAAI,UAAU,EAAE,QAAQ;GACxB,sEAAmC,UAAU,EAAE,SAAS,GAAG,OAAU;GACtE,CAAC;AAEJ,SAAO,KAAK,QAAQ"}
@@ -1,8 +1,7 @@
1
1
  const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.js');
2
- const require_decorator = require('../../../util/cache/package/decorator.js');
2
+ const require_with_cache = require('../../../util/cache/package/with-cache.js');
3
3
  const require_timestamp = require('../../../util/timestamp.js');
4
4
  const require_datasource = require('../datasource.js');
5
- const require_decorate = require('../../../_virtual/_@oxc-project_runtime@0.110.0/helpers/decorate.js');
6
5
  const require_index = require('../../versioning/aws-machine-image/index.js');
7
6
  let _aws_sdk_credential_providers = require("@aws-sdk/credential-providers");
8
7
  let _aws_sdk_client_ec2 = require("@aws-sdk/client-ec2");
@@ -50,7 +49,7 @@ var AwsMachineImageDatasource = class AwsMachineImageDatasource extends require_
50
49
  else config = Object.assign(config, elem);
51
50
  return [filters, config];
52
51
  }
53
- async getSortedAwsMachineImages(serializedAmiFilter) {
52
+ async _getSortedAwsMachineImages(serializedAmiFilter) {
54
53
  const [amiFilter, clientConfig] = this.loadConfig(serializedAmiFilter);
55
54
  const amiFilterCmd = this.getAmiFilterCommand(amiFilter);
56
55
  const matchingImages = await this.getEC2Client(clientConfig).send(amiFilterCmd);
@@ -59,7 +58,13 @@ var AwsMachineImageDatasource = class AwsMachineImageDatasource extends require_
59
58
  return (image1.CreationDate ? Date.parse(image1.CreationDate) : 0) - (image2.CreationDate ? Date.parse(image2.CreationDate) : 0);
60
59
  });
61
60
  }
62
- async getDigest({ packageName: serializedAmiFilter }, newValue) {
61
+ getSortedAwsMachineImages(serializedAmiFilter) {
62
+ return require_with_cache.withCache({
63
+ namespace: `datasource-${AwsMachineImageDatasource.id}`,
64
+ key: `getSortedAwsMachineImages:${serializedAmiFilter}`
65
+ }, () => this._getSortedAwsMachineImages(serializedAmiFilter));
66
+ }
67
+ async _getDigest({ packageName: serializedAmiFilter }, newValue) {
63
68
  const images = await this.getSortedAwsMachineImages(serializedAmiFilter);
64
69
  if (images.length < 1) return null;
65
70
  if (newValue) {
@@ -69,7 +74,14 @@ var AwsMachineImageDatasource = class AwsMachineImageDatasource extends require_
69
74
  }
70
75
  return (await this.getReleases({ packageName: serializedAmiFilter }))?.releases?.[0]?.newDigest ?? null;
71
76
  }
72
- async getReleases({ packageName: serializedAmiFilter }) {
77
+ getDigest(config, newValue) {
78
+ return require_with_cache.withCache({
79
+ namespace: `datasource-${AwsMachineImageDatasource.id}`,
80
+ key: `getDigest:${config.packageName}:${newValue ?? ""}`,
81
+ fallback: true
82
+ }, () => this._getDigest(config, newValue));
83
+ }
84
+ async _getReleases({ packageName: serializedAmiFilter }) {
73
85
  const images = await this.getSortedAwsMachineImages(serializedAmiFilter);
74
86
  const latestImage = images[images.length - 1];
75
87
  if (!latestImage?.ImageId) return null;
@@ -80,19 +92,14 @@ var AwsMachineImageDatasource = class AwsMachineImageDatasource extends require_
80
92
  newDigest: latestImage.Name
81
93
  }] };
82
94
  }
95
+ getReleases(config) {
96
+ return require_with_cache.withCache({
97
+ namespace: `datasource-${AwsMachineImageDatasource.id}`,
98
+ key: `getReleases:${config.packageName}`,
99
+ fallback: true
100
+ }, () => this._getReleases(config));
101
+ }
83
102
  };
84
- require_decorate.__decorate([require_decorator.cache({
85
- namespace: `datasource-${AwsMachineImageDatasource.id}`,
86
- key: (serializedAmiFilter) => `getSortedAwsMachineImages:${serializedAmiFilter}`
87
- })], AwsMachineImageDatasource.prototype, "getSortedAwsMachineImages", null);
88
- require_decorate.__decorate([require_decorator.cache({
89
- namespace: `datasource-${AwsMachineImageDatasource.id}`,
90
- key: ({ packageName }, newValue) => `getDigest:${packageName}:${newValue ?? ""}`
91
- })], AwsMachineImageDatasource.prototype, "getDigest", null);
92
- require_decorate.__decorate([require_decorator.cache({
93
- namespace: `datasource-${AwsMachineImageDatasource.id}`,
94
- key: ({ packageName }) => `getReleases:${packageName}`
95
- })], AwsMachineImageDatasource.prototype, "getReleases", null);
96
103
 
97
104
  //#endregion
98
105
  exports.AwsMachineImageDatasource = AwsMachineImageDatasource;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Datasource","EC2Client","DescribeImagesCommand","asTimestamp","cache"],"sources":["../../../../lib/modules/datasource/aws-machine-image/index.ts"],"sourcesContent":["import type { Filter, Image } from '@aws-sdk/client-ec2';\nimport { DescribeImagesCommand, EC2Client } from '@aws-sdk/client-ec2';\nimport { fromNodeProviderChain } from '@aws-sdk/credential-providers';\nimport { cache } from '../../../util/cache/package/decorator.ts';\nimport { asTimestamp } from '../../../util/timestamp.ts';\nimport * as amazonMachineImageVersioning from '../../versioning/aws-machine-image/index.ts';\nimport { Datasource } from '../datasource.ts';\nimport type { GetReleasesConfig, ReleaseResult } from '../types.ts';\nimport type { AwsClientConfig, ParsedConfig } from './types.ts';\n\nexport class AwsMachineImageDatasource extends Datasource {\n static readonly id = 'aws-machine-image';\n\n override readonly defaultVersioning = amazonMachineImageVersioning.id;\n\n override readonly caching = true;\n\n override readonly releaseTimestampSupport = true;\n override readonly releaseTimestampNote =\n 'The release timestamp is determined from the `CreationDate` field in the results.';\n\n override readonly defaultConfig = {\n // Because AMIs don't follow any versioning scheme, we override commitMessageExtra to remove the 'v'\n commitMessageExtra: 'to {{{newVersion}}}',\n prBodyColumns: ['Change', 'Image'],\n prBodyDefinitions: {\n Image: '```{{{newDigest}}}```',\n },\n digest: {\n // Because newDigestShort will allways be 'amazon-' we override to print the name of the AMI\n commitMessageExtra: 'to {{{newDigest}}}',\n prBodyColumns: ['Image'],\n prBodyDefinitions: {\n Image: '```{{{newDigest}}}```',\n },\n },\n };\n\n private readonly now: number;\n\n constructor() {\n super(AwsMachineImageDatasource.id);\n this.now = Date.now();\n }\n\n private isAmiFilter(config: Filter | AwsClientConfig): config is Filter {\n return 'Name' in config && 'Values' in config;\n }\n\n private getEC2Client(config: AwsClientConfig): EC2Client {\n const { profile, region } = config;\n return new EC2Client({\n region,\n credentials: fromNodeProviderChain({ profile }),\n });\n }\n\n private getAmiFilterCommand(filter: Filter[]): DescribeImagesCommand {\n return new DescribeImagesCommand({\n Filters: filter,\n });\n }\n\n loadConfig(serializedAmiFilter: string): [Filter[], AwsClientConfig] {\n const parsedConfig: ParsedConfig = JSON.parse(serializedAmiFilter);\n const filters = [];\n let config = {};\n for (const elem of parsedConfig) {\n if (this.isAmiFilter(elem)) {\n // Separate actual AMI filters from aws client config\n filters.push(elem);\n } else {\n // merge config objects if there are multiple\n config = Object.assign(config, elem);\n }\n }\n return [filters, config];\n }\n\n @cache({\n namespace: `datasource-${AwsMachineImageDatasource.id}`,\n key: (serializedAmiFilter: string) =>\n `getSortedAwsMachineImages:${serializedAmiFilter}`,\n })\n async getSortedAwsMachineImages(\n serializedAmiFilter: string,\n ): Promise<Image[]> {\n const [amiFilter, clientConfig] = this.loadConfig(serializedAmiFilter);\n const amiFilterCmd = this.getAmiFilterCommand(amiFilter);\n const ec2Client = this.getEC2Client(clientConfig);\n const matchingImages = await ec2Client.send(amiFilterCmd);\n matchingImages.Images = matchingImages.Images ?? [];\n return matchingImages.Images.sort((image1, image2) => {\n const ts1 = image1.CreationDate\n ? Date.parse(image1.CreationDate)\n : /* v8 ignore next */ 0; // TODO: add date coersion util\n\n const ts2 = image2.CreationDate\n ? Date.parse(image2.CreationDate)\n : /* v8 ignore next */ 0; // TODO: add date coersion util\n return ts1 - ts2;\n });\n }\n\n @cache({\n namespace: `datasource-${AwsMachineImageDatasource.id}`,\n key: ({ packageName }: GetReleasesConfig, newValue: string) =>\n `getDigest:${packageName}:${newValue ?? ''}`,\n })\n override async getDigest(\n { packageName: serializedAmiFilter }: GetReleasesConfig,\n newValue?: string,\n ): Promise<string | null> {\n const images = await this.getSortedAwsMachineImages(serializedAmiFilter);\n if (images.length < 1) {\n return null;\n }\n\n if (newValue) {\n const newValueMatchingImages = images.filter(\n (image) => image.ImageId === newValue,\n );\n if (\n newValueMatchingImages.length === 1 &&\n newValueMatchingImages[0].Name\n ) {\n return newValueMatchingImages[0].Name;\n }\n return null;\n }\n\n const res = await this.getReleases({ packageName: serializedAmiFilter });\n return res?.releases?.[0]?.newDigest ?? /* v8 ignore next */ null; // TODO: needs test\n }\n\n @cache({\n namespace: `datasource-${AwsMachineImageDatasource.id}`,\n key: ({ packageName }: GetReleasesConfig) => `getReleases:${packageName}`,\n })\n async getReleases({\n packageName: serializedAmiFilter,\n }: GetReleasesConfig): Promise<ReleaseResult | null> {\n const images = await this.getSortedAwsMachineImages(serializedAmiFilter);\n const latestImage = images[images.length - 1];\n if (!latestImage?.ImageId) {\n return null;\n }\n return {\n releases: [\n {\n version: latestImage.ImageId,\n releaseTimestamp: asTimestamp(latestImage.CreationDate),\n isDeprecated:\n Date.parse(latestImage.DeprecationTime ?? this.now.toString()) <\n this.now,\n newDigest: latestImage.Name,\n },\n ],\n };\n }\n}\n"],"mappings":";;;;;;;;;;AAUA,IAAa,4BAAb,MAAa,kCAAkCA,8BAAW;CACxD,OAAgB,KAAK;CAErB,AAAkB;CAElB,AAAkB,UAAU;CAE5B,AAAkB,0BAA0B;CAC5C,AAAkB,uBAChB;CAEF,AAAkB,gBAAgB;EAEhC,oBAAoB;EACpB,eAAe,CAAC,UAAU,QAAQ;EAClC,mBAAmB,EACjB,OAAO,yBACR;EACD,QAAQ;GAEN,oBAAoB;GACpB,eAAe,CAAC,QAAQ;G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D,OACE,uBAAuB,WAAW,KAClC,uBAAuB,GAAG,KAE1B,QAAO,uBAAuB,GAAG;AAEnC,UAAO;;AAIT,UADY,MAAM,KAAK,YAAY,EAAE,aAAa,qBAAqB,CAAC,GAC5D,WAAW,IAAI,aAAkC;;CAG/D,MAIM,YAAY,EAChB,aAAa,uBACsC;EACnD,MAAM,SAAS,MAAM,KAAK,0BAA0B,oBAAoB;EACxE,MAAM,cAAc,OAAO,OAAO,SAAS;AAC3C,MAAI,CAAC,aAAa,QAChB,QAAO;AAET,SAAO,EACL,UAAU,CACR;GACE,SAAS,YAAY;GACrB,kBAAkBC,8BAAY,YAAY,aAAa;GACvD,cACE,KAAK,MAAM,YAAY,mBAAmB,KAAK,IAAI,UAAU,CAAC,GAC9D,KAAK;GACP,WAAW,YAAY;GACxB,CACF,EACF;;;6BA/EFC,wBAAM;CACL,WAAW,cAAc,0BAA0B;CACnD,MAAM,wBACJ,6BAA6B;CAChC,CAAC;6BAqBDA,wBAAM;CACL,WAAW,cAAc,0BAA0B;CACnD,MAAM,EAAE,eAAkC,aACxC,aAAa,YAAY,GAAG,YAAY;CAC3C,CAAC;6BA2BDA,wBAAM;CACL,WAAW,cAAc,0BAA0B;CACnD,MAAM,EAAE,kBAAqC,eAAe;CAC7D,CAAC"}
1
+ {"version":3,"file":"index.js","names":["Datasource","EC2Client","DescribeImagesCommand","withCache","asTimestamp"],"sources":["../../../../lib/modules/datasource/aws-machine-image/index.ts"],"sourcesContent":["import type { Filter, Image } from '@aws-sdk/client-ec2';\nimport { DescribeImagesCommand, EC2Client } from '@aws-sdk/client-ec2';\nimport { fromNodeProviderChain } from '@aws-sdk/credential-providers';\nimport { withCache } from '../../../util/cache/package/with-cache.ts';\nimport { asTimestamp } from '../../../util/timestamp.ts';\nimport * as amazonMachineImageVersioning from '../../versioning/aws-machine-image/index.ts';\nimport { Datasource } from '../datasource.ts';\nimport type { GetReleasesConfig, ReleaseResult } from '../types.ts';\nimport type { AwsClientConfig, ParsedConfig } from './types.ts';\n\nexport class AwsMachineImageDatasource extends Datasource {\n static readonly id = 'aws-machine-image';\n\n override readonly defaultVersioning = amazonMachineImageVersioning.id;\n\n override readonly caching = true;\n\n override readonly releaseTimestampSupport = true;\n override readonly releaseTimestampNote =\n 'The release timestamp is determined from the `CreationDate` field in the results.';\n\n override readonly defaultConfig = {\n // Because AMIs don't follow any versioning scheme, we override commitMessageExtra to remove the 'v'\n commitMessageExtra: 'to {{{newVersion}}}',\n prBodyColumns: ['Change', 'Image'],\n prBodyDefinitions: {\n Image: '```{{{newDigest}}}```',\n },\n digest: {\n // Because newDigestShort will allways be 'amazon-' we override to print the name of the AMI\n commitMessageExtra: 'to {{{newDigest}}}',\n prBodyColumns: ['Image'],\n prBodyDefinitions: {\n Image: '```{{{newDigest}}}```',\n },\n },\n };\n\n private readonly now: number;\n\n constructor() {\n super(AwsMachineImageDatasource.id);\n this.now = Date.now();\n }\n\n private isAmiFilter(config: Filter | AwsClientConfig): config is Filter {\n return 'Name' in config && 'Values' in config;\n }\n\n private getEC2Client(config: AwsClientConfig): EC2Client {\n const { profile, region } = config;\n return new EC2Client({\n region,\n credentials: fromNodeProviderChain({ profile }),\n });\n }\n\n private getAmiFilterCommand(filter: Filter[]): DescribeImagesCommand {\n return new DescribeImagesCommand({\n Filters: filter,\n });\n }\n\n loadConfig(serializedAmiFilter: string): [Filter[], AwsClientConfig] {\n const parsedConfig: ParsedConfig = JSON.parse(serializedAmiFilter);\n const filters = [];\n let config = {};\n for (const elem of parsedConfig) {\n if (this.isAmiFilter(elem)) {\n // Separate actual AMI filters from aws client config\n filters.push(elem);\n } else {\n // merge config objects if there are multiple\n config = Object.assign(config, elem);\n }\n }\n return [filters, config];\n }\n\n private async _getSortedAwsMachineImages(\n serializedAmiFilter: string,\n ): Promise<Image[]> {\n const [amiFilter, clientConfig] = this.loadConfig(serializedAmiFilter);\n const amiFilterCmd = this.getAmiFilterCommand(amiFilter);\n const ec2Client = this.getEC2Client(clientConfig);\n const matchingImages = await ec2Client.send(amiFilterCmd);\n matchingImages.Images = matchingImages.Images ?? [];\n return matchingImages.Images.sort((image1, image2) => {\n const ts1 = image1.CreationDate\n ? Date.parse(image1.CreationDate)\n : /* v8 ignore next */ 0; // TODO: add date coersion util\n\n const ts2 = image2.CreationDate\n ? Date.parse(image2.CreationDate)\n : /* v8 ignore next */ 0; // TODO: add date coersion util\n return ts1 - ts2;\n });\n }\n\n getSortedAwsMachineImages(serializedAmiFilter: string): Promise<Image[]> {\n return withCache(\n {\n namespace: `datasource-${AwsMachineImageDatasource.id}`,\n key: `getSortedAwsMachineImages:${serializedAmiFilter}`,\n },\n () => this._getSortedAwsMachineImages(serializedAmiFilter),\n );\n }\n\n private async _getDigest(\n { packageName: serializedAmiFilter }: GetReleasesConfig,\n newValue?: string,\n ): Promise<string | null> {\n const images = await this.getSortedAwsMachineImages(serializedAmiFilter);\n if (images.length < 1) {\n return null;\n }\n\n if (newValue) {\n const newValueMatchingImages = images.filter(\n (image) => image.ImageId === newValue,\n );\n if (\n newValueMatchingImages.length === 1 &&\n newValueMatchingImages[0].Name\n ) {\n return newValueMatchingImages[0].Name;\n }\n return null;\n }\n\n const res = await this.getReleases({ packageName: serializedAmiFilter });\n return res?.releases?.[0]?.newDigest ?? /* v8 ignore next */ null; // TODO: needs test\n }\n\n override getDigest(\n config: GetReleasesConfig,\n newValue?: string,\n ): Promise<string | null> {\n return withCache(\n {\n namespace: `datasource-${AwsMachineImageDatasource.id}`,\n key: `getDigest:${config.packageName}:${newValue ?? ''}`,\n fallback: true,\n },\n () => this._getDigest(config, newValue),\n );\n }\n\n private async _getReleases({\n packageName: serializedAmiFilter,\n }: GetReleasesConfig): Promise<ReleaseResult | null> {\n const images = await this.getSortedAwsMachineImages(serializedAmiFilter);\n const latestImage = images[images.length - 1];\n if (!latestImage?.ImageId) {\n return null;\n }\n return {\n releases: [\n {\n version: latestImage.ImageId,\n releaseTimestamp: asTimestamp(latestImage.CreationDate),\n isDeprecated:\n Date.parse(latestImage.DeprecationTime ?? this.now.toString()) <\n this.now,\n newDigest: latestImage.Name,\n },\n ],\n };\n }\n\n getReleases(config: GetReleasesConfig): Promise<ReleaseResult | null> {\n return withCache(\n {\n namespace: `datasource-${AwsMachineImageDatasource.id}`,\n key: `getReleases:${config.packageName}`,\n fallback: true,\n },\n () => this._getReleases(config),\n );\n }\n}\n"],"mappings":";;;;;;;;;AAUA,IAAa,4BAAb,MAAa,kCAAkCA,8BAAW;CACxD,OAAgB,KAAK;CAErB,AAAkB;CAElB,AAAkB,UAAU;CAE5B,AAAkB,0BAA0B;CAC5C,AAAkB,uBAChB;CAEF,AAAkB,gBAAgB;EAEhC,oBAAoB;EACpB,eAAe,CAAC,UAAU,QAAQ;EAClC,mBAAmB,EACjB,OAAO,yBACR;EACD,QAAQ;GAEN,oBAAoB;GACpB,eAAe,CAAC,QAAQ;GACxB,mBAAmB,EACjB,OAAO,yBACR;GACF;EACF;CAED,AAAiB;CAEjB,cAAc;AACZ,QAAM,0BAA0B,GAAG;AACnC,OAAK,MAAM,KAAK,KAAK;;CAGvB,AAAQ,YAAY,QAAoD;AACtE,SAAO,UAAU,UAAU,YAAY;;CAGzC,AAAQ,aAAa,QAAoC;EACvD,MAAM,EAAE,SAAS,WAAW;AAC5B,SAAO,IAAIC,8BAAU;GACnB;GACA,sEAAmC,EAAE,SAAS,CAAC;GAChD,CAAC;;CAGJ,AAAQ,oBAAoB,QAAyC;AACnE,SAAO,IAAIC,0CAAsB,EAC/B,SAAS,QACV,CAAC;;CAGJ,WAAW,qBAA0D;EACnE,MAAM,eAA6B,KAAK,MAAM,oBAAoB;EAClE,MAAM,UAAU,EAAE;EAClB,IAAI,SAAS,EAAE;AACf,OAAK,MAAM,QAAQ,aACjB,KAAI,KAAK,YAAY,KAAK,CAExB,SAAQ,KAAK,KAAK;MAGlB,UAAS,OAAO,OAAO,QAAQ,KAAK;AAGxC,SAAO,CAAC,SAAS,OAAO;;CAG1B,MAAc,2BACZ,qBACkB;EAClB,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