socket 1.1.24 → 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,12 +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,
3553
3554
  minimumReleaseAge,
3554
3555
  orgSlug,
3555
3556
  outputFile,
3557
+ showAffectedDirectDependencies,
3556
3558
  spinner
3557
3559
  } = fixConfig;
3558
3560
  const fixEnv = await getFixEnv();
@@ -3617,7 +3619,7 @@ async function coanaFix(fixConfig) {
3617
3619
  }
3618
3620
  };
3619
3621
  }
3620
- 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] : []), ...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, {
3621
3623
  cwd,
3622
3624
  spinner,
3623
3625
  stdio: 'inherit'
@@ -3652,7 +3654,7 @@ async function coanaFix(fixConfig) {
3652
3654
  const shouldSpawnCoana = adjustedLimit > 0;
3653
3655
  let ids;
3654
3656
  if (shouldSpawnCoana && isAll) {
3655
- 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] : []), ...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, {
3656
3658
  cwd,
3657
3659
  spinner
3658
3660
  });
@@ -3694,7 +3696,7 @@ async function coanaFix(fixConfig) {
3694
3696
 
3695
3697
  // Apply fix for single GHSA ID.
3696
3698
  // eslint-disable-next-line no-await-in-loop
3697
- 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] : []), ...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, {
3698
3700
  cwd,
3699
3701
  spinner,
3700
3702
  stdio: 'inherit'
@@ -3907,6 +3909,7 @@ async function handleFix({
3907
3909
  applyFixes,
3908
3910
  autopilot,
3909
3911
  cwd,
3912
+ disableMajorUpdates,
3910
3913
  ghsas,
3911
3914
  glob,
3912
3915
  limit,
@@ -3917,6 +3920,7 @@ async function handleFix({
3917
3920
  outputKind,
3918
3921
  prCheck,
3919
3922
  rangeStyle,
3923
+ showAffectedDirectDependencies,
3920
3924
  spinner,
3921
3925
  unknownFlags
3922
3926
  }) {
@@ -3924,6 +3928,7 @@ async function handleFix({
3924
3928
  require$$9.debugDir('inspect', {
3925
3929
  autopilot,
3926
3930
  cwd,
3931
+ disableMajorUpdates,
3927
3932
  ghsas,
3928
3933
  glob,
3929
3934
  limit,
@@ -3933,12 +3938,14 @@ async function handleFix({
3933
3938
  outputKind,
3934
3939
  prCheck,
3935
3940
  rangeStyle,
3941
+ showAffectedDirectDependencies,
3936
3942
  unknownFlags
3937
3943
  });
3938
3944
  await outputFixResult(await coanaFix({
3939
3945
  autopilot,
3940
3946
  applyFixes,
3941
3947
  cwd,
3948
+ disableMajorUpdates,
3942
3949
  // Convert mixed CVE/GHSA/PURL inputs to GHSA IDs only
3943
3950
  ghsas: await convertIdsToGhsas(ghsas),
3944
3951
  glob,
@@ -3946,6 +3953,7 @@ async function handleFix({
3946
3953
  minimumReleaseAge,
3947
3954
  orgSlug,
3948
3955
  rangeStyle,
3956
+ showAffectedDirectDependencies,
3949
3957
  spinner,
3950
3958
  unknownFlags,
3951
3959
  outputFile
@@ -3975,6 +3983,13 @@ const generalFlags$2 = {
3975
3983
  // Hidden to allow custom documenting of the negated `--no-apply-fixes` variant.
3976
3984
  hidden: true
3977
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
+ },
3978
3993
  id: {
3979
3994
  type: 'string',
3980
3995
  default: [],
@@ -4009,6 +4024,11 @@ Available styles:
4009
4024
  type: 'string',
4010
4025
  default: '',
4011
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'
4012
4032
  }
4013
4033
  };
4014
4034
  const hiddenFlags = {
@@ -4092,6 +4112,12 @@ async function run$K(argv, importMeta, {
4092
4112
  noApplyFixes: {
4093
4113
  ...config.flags['applyFixes'],
4094
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
4095
4121
  }
4096
4122
  })}
4097
4123
 
@@ -4121,18 +4147,21 @@ async function run$K(argv, importMeta, {
4121
4147
  glob,
4122
4148
  json,
4123
4149
  limit,
4150
+ majorUpdates,
4124
4151
  markdown,
4125
4152
  maxSatisfying,
4126
4153
  minimumReleaseAge,
4127
4154
  outputFile,
4128
4155
  prCheck,
4129
4156
  rangeStyle,
4157
+ showAffectedDirectDependencies,
4130
4158
  // We patched in this feature with `npx custompatch meow` at
4131
4159
  // socket-cli/patches/meow#13.2.0.patch.
4132
4160
  unknownFlags = []
4133
4161
  } = cli.flags;
4134
4162
  const dryRun = !!cli.flags['dryRun'];
4135
4163
  const minSatisfying = cli.flags['minSatisfying'] || !maxSatisfying;
4164
+ const disableMajorUpdates = !majorUpdates;
4136
4165
  const outputKind = utils.getOutputKind(json, markdown);
4137
4166
  const wasValidInput = utils.checkCommandInput(outputKind, {
4138
4167
  test: utils.RangeStyles.includes(rangeStyle),
@@ -4170,6 +4199,7 @@ async function run$K(argv, importMeta, {
4170
4199
  autopilot,
4171
4200
  applyFixes,
4172
4201
  cwd,
4202
+ disableMajorUpdates,
4173
4203
  ghsas,
4174
4204
  glob,
4175
4205
  limit,
@@ -4179,6 +4209,7 @@ async function run$K(argv, importMeta, {
4179
4209
  orgSlug,
4180
4210
  outputKind,
4181
4211
  rangeStyle,
4212
+ showAffectedDirectDependencies,
4182
4213
  spinner,
4183
4214
  unknownFlags,
4184
4215
  outputFile
@@ -14964,5 +14995,5 @@ void (async () => {
14964
14995
  await utils.captureException(e);
14965
14996
  }
14966
14997
  })();
14967
- //# debugId=a37ba0b8-5e27-487b-ba57-2d9a99bbccae
14998
+ //# debugId=3a127de6-5ee9-48f9-aded-7e7e7e868c6a
14968
14999
  //# sourceMappingURL=cli.js.map