@socketsecurity/cli-with-sentry 1.1.23 → 1.1.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -3547,11 +3547,14 @@ async function coanaFix(fixConfig) {
3547
3547
  applyFixes,
3548
3548
  autopilot,
3549
3549
  cwd,
3550
+ disableMajorUpdates,
3550
3551
  ghsas,
3551
3552
  glob,
3552
3553
  limit,
3554
+ minimumReleaseAge,
3553
3555
  orgSlug,
3554
3556
  outputFile,
3557
+ showAffectedDirectDependencies,
3555
3558
  spinner
3556
3559
  } = fixConfig;
3557
3560
  const fixEnv = await getFixEnv();
@@ -3616,7 +3619,7 @@ async function coanaFix(fixConfig) {
3616
3619
  }
3617
3620
  };
3618
3621
  }
3619
- const fixCResult = await utils.spawnCoanaDlx(['compute-fixes-and-upgrade-purls', cwd, '--manifests-tar-hash', tarHash, '--apply-fixes-to', ...(isAll ? ['all'] : ghsas), ...(fixConfig.rangeStyle ? ['--range-style', fixConfig.rangeStyle] : []), ...(glob ? ['--glob', glob] : []), ...(!applyFixes ? [constants.FLAG_DRY_RUN] : []), ...(outputFile ? ['--output-file', outputFile] : []), ...fixConfig.unknownFlags], fixConfig.orgSlug, {
3622
+ const fixCResult = await utils.spawnCoanaDlx(['compute-fixes-and-upgrade-purls', cwd, '--manifests-tar-hash', tarHash, '--apply-fixes-to', ...(isAll ? ['all'] : ghsas), ...(fixConfig.rangeStyle ? ['--range-style', fixConfig.rangeStyle] : []), ...(minimumReleaseAge ? ['--minimum-release-age', minimumReleaseAge] : []), ...(glob ? ['--glob', glob] : []), ...(!applyFixes ? [constants.FLAG_DRY_RUN] : []), ...(outputFile ? ['--output-file', outputFile] : []), ...(disableMajorUpdates ? ['--disable-major-updates'] : []), ...(showAffectedDirectDependencies ? ['--show-affected-direct-dependencies'] : []), ...fixConfig.unknownFlags], fixConfig.orgSlug, {
3620
3623
  cwd,
3621
3624
  spinner,
3622
3625
  stdio: 'inherit'
@@ -3651,7 +3654,7 @@ async function coanaFix(fixConfig) {
3651
3654
  const shouldSpawnCoana = adjustedLimit > 0;
3652
3655
  let ids;
3653
3656
  if (shouldSpawnCoana && isAll) {
3654
- const foundCResult = await utils.spawnCoanaDlx(['compute-fixes-and-upgrade-purls', cwd, '--manifests-tar-hash', tarHash, ...(fixConfig.rangeStyle ? ['--range-style', fixConfig.rangeStyle] : []), ...(glob ? ['--glob', glob] : []), ...fixConfig.unknownFlags], fixConfig.orgSlug, {
3657
+ const foundCResult = await utils.spawnCoanaDlx(['compute-fixes-and-upgrade-purls', cwd, '--manifests-tar-hash', tarHash, ...(fixConfig.rangeStyle ? ['--range-style', fixConfig.rangeStyle] : []), ...(minimumReleaseAge ? ['--minimum-release-age', minimumReleaseAge] : []), ...(glob ? ['--glob', glob] : []), ...(disableMajorUpdates ? ['--disable-major-updates'] : []), ...(showAffectedDirectDependencies ? ['--show-affected-direct-dependencies'] : []), ...fixConfig.unknownFlags], fixConfig.orgSlug, {
3655
3658
  cwd,
3656
3659
  spinner
3657
3660
  });
@@ -3693,7 +3696,7 @@ async function coanaFix(fixConfig) {
3693
3696
 
3694
3697
  // Apply fix for single GHSA ID.
3695
3698
  // eslint-disable-next-line no-await-in-loop
3696
- const fixCResult = await utils.spawnCoanaDlx(['compute-fixes-and-upgrade-purls', cwd, '--manifests-tar-hash', tarHash, '--apply-fixes-to', ghsaId, ...(fixConfig.rangeStyle ? ['--range-style', fixConfig.rangeStyle] : []), ...(glob ? ['--glob', glob] : []), ...fixConfig.unknownFlags], fixConfig.orgSlug, {
3699
+ const fixCResult = await utils.spawnCoanaDlx(['compute-fixes-and-upgrade-purls', cwd, '--manifests-tar-hash', tarHash, '--apply-fixes-to', ghsaId, ...(fixConfig.rangeStyle ? ['--range-style', fixConfig.rangeStyle] : []), ...(minimumReleaseAge ? ['--minimum-release-age', minimumReleaseAge] : []), ...(glob ? ['--glob', glob] : []), ...(disableMajorUpdates ? ['--disable-major-updates'] : []), ...(showAffectedDirectDependencies ? ['--show-affected-direct-dependencies'] : []), ...fixConfig.unknownFlags], fixConfig.orgSlug, {
3697
3700
  cwd,
3698
3701
  spinner,
3699
3702
  stdio: 'inherit'
@@ -3906,15 +3909,18 @@ async function handleFix({
3906
3909
  applyFixes,
3907
3910
  autopilot,
3908
3911
  cwd,
3912
+ disableMajorUpdates,
3909
3913
  ghsas,
3910
3914
  glob,
3911
3915
  limit,
3912
3916
  minSatisfying,
3917
+ minimumReleaseAge,
3913
3918
  orgSlug,
3914
3919
  outputFile,
3915
3920
  outputKind,
3916
3921
  prCheck,
3917
3922
  rangeStyle,
3923
+ showAffectedDirectDependencies,
3918
3924
  spinner,
3919
3925
  unknownFlags
3920
3926
  }) {
@@ -3922,6 +3928,7 @@ async function handleFix({
3922
3928
  require$$9.debugDir('inspect', {
3923
3929
  autopilot,
3924
3930
  cwd,
3931
+ disableMajorUpdates,
3925
3932
  ghsas,
3926
3933
  glob,
3927
3934
  limit,
@@ -3931,18 +3938,22 @@ async function handleFix({
3931
3938
  outputKind,
3932
3939
  prCheck,
3933
3940
  rangeStyle,
3941
+ showAffectedDirectDependencies,
3934
3942
  unknownFlags
3935
3943
  });
3936
3944
  await outputFixResult(await coanaFix({
3937
3945
  autopilot,
3938
3946
  applyFixes,
3939
3947
  cwd,
3948
+ disableMajorUpdates,
3940
3949
  // Convert mixed CVE/GHSA/PURL inputs to GHSA IDs only
3941
3950
  ghsas: await convertIdsToGhsas(ghsas),
3942
3951
  glob,
3943
3952
  limit,
3953
+ minimumReleaseAge,
3944
3954
  orgSlug,
3945
3955
  rangeStyle,
3956
+ showAffectedDirectDependencies,
3946
3957
  spinner,
3947
3958
  unknownFlags,
3948
3959
  outputFile
@@ -3972,6 +3983,13 @@ const generalFlags$2 = {
3972
3983
  // Hidden to allow custom documenting of the negated `--no-apply-fixes` variant.
3973
3984
  hidden: true
3974
3985
  },
3986
+ majorUpdates: {
3987
+ type: 'boolean',
3988
+ default: true,
3989
+ description: 'Allow major version updates. Use --no-major-updates to disable.',
3990
+ // Hidden to allow custom documenting of the negated `--no-major-updates` variant.
3991
+ hidden: true
3992
+ },
3975
3993
  id: {
3976
3994
  type: 'string',
3977
3995
  default: [],
@@ -4001,6 +4019,16 @@ Available styles:
4001
4019
  type: 'string',
4002
4020
  default: '',
4003
4021
  description: 'Path to store upgrades as a JSON file at this path.'
4022
+ },
4023
+ minimumReleaseAge: {
4024
+ type: 'string',
4025
+ default: '',
4026
+ description: 'Set a minimum age requirement for suggested upgrade versions (e.g., 1h, 2d, 3w). A higher age requirement reduces the risk of upgrading to malicious versions. For example, setting the value to 1 week (1w) gives ecosystem maintainers one week to remove potentially malicious versions.'
4027
+ },
4028
+ showAffectedDirectDependencies: {
4029
+ type: 'boolean',
4030
+ default: false,
4031
+ description: 'List the direct dependencies responsible for introducing transitive vulnerabilities and list the updates required to resolve the vulnerabilities'
4004
4032
  }
4005
4033
  };
4006
4034
  const hiddenFlags = {
@@ -4084,6 +4112,12 @@ async function run$K(argv, importMeta, {
4084
4112
  noApplyFixes: {
4085
4113
  ...config.flags['applyFixes'],
4086
4114
  hidden: false
4115
+ },
4116
+ // Explicitly document the negated --no-major-updates variant.
4117
+ noMajorUpdates: {
4118
+ ...config.flags['majorUpdates'],
4119
+ description: 'Do not suggest or apply fixes that require major version updates of direct or transitive dependencies',
4120
+ hidden: false
4087
4121
  }
4088
4122
  })}
4089
4123
 
@@ -4113,17 +4147,21 @@ async function run$K(argv, importMeta, {
4113
4147
  glob,
4114
4148
  json,
4115
4149
  limit,
4150
+ majorUpdates,
4116
4151
  markdown,
4117
4152
  maxSatisfying,
4153
+ minimumReleaseAge,
4118
4154
  outputFile,
4119
4155
  prCheck,
4120
4156
  rangeStyle,
4157
+ showAffectedDirectDependencies,
4121
4158
  // We patched in this feature with `npx custompatch meow` at
4122
4159
  // socket-cli/patches/meow#13.2.0.patch.
4123
4160
  unknownFlags = []
4124
4161
  } = cli.flags;
4125
4162
  const dryRun = !!cli.flags['dryRun'];
4126
4163
  const minSatisfying = cli.flags['minSatisfying'] || !maxSatisfying;
4164
+ const disableMajorUpdates = !majorUpdates;
4127
4165
  const outputKind = utils.getOutputKind(json, markdown);
4128
4166
  const wasValidInput = utils.checkCommandInput(outputKind, {
4129
4167
  test: utils.RangeStyles.includes(rangeStyle),
@@ -4161,14 +4199,17 @@ async function run$K(argv, importMeta, {
4161
4199
  autopilot,
4162
4200
  applyFixes,
4163
4201
  cwd,
4202
+ disableMajorUpdates,
4164
4203
  ghsas,
4165
4204
  glob,
4166
4205
  limit,
4206
+ minimumReleaseAge,
4167
4207
  minSatisfying,
4168
4208
  prCheck,
4169
4209
  orgSlug,
4170
4210
  outputKind,
4171
4211
  rangeStyle,
4212
+ showAffectedDirectDependencies,
4172
4213
  spinner,
4173
4214
  unknownFlags,
4174
4215
  outputFile
@@ -14954,5 +14995,5 @@ void (async () => {
14954
14995
  await utils.captureException(e);
14955
14996
  }
14956
14997
  })();
14957
- //# debugId=7d7feb5c-caaa-4477-9563-76861e408418
14998
+ //# debugId=3a127de6-5ee9-48f9-aded-7e7e7e868c6a
14958
14999
  //# sourceMappingURL=cli.js.map