@socketsecurity/cli-with-sentry 1.1.51 → 1.1.52
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/CHANGELOG.md +8 -0
- package/dist/cli.js +118 -46
- package/dist/cli.js.map +1 -1
- package/dist/constants.js +4 -4
- package/dist/constants.js.map +1 -1
- package/dist/tsconfig.dts.tsbuildinfo +1 -1
- package/dist/types/commands/ci/fetch-default-org-slug.d.mts +1 -1
- package/dist/types/commands/ci/fetch-default-org-slug.d.mts.map +1 -1
- package/dist/types/commands/fix/cmd-fix.d.mts.map +1 -1
- package/dist/types/commands/fix/coana-fix.d.mts.map +1 -1
- package/dist/types/commands/fix/handle-fix.d.mts +6 -2
- package/dist/types/commands/fix/handle-fix.d.mts.map +1 -1
- package/dist/types/commands/fix/types.d.mts +1 -0
- package/dist/types/commands/fix/types.d.mts.map +1 -1
- package/dist/types/commands/organization/fetch-organization-list.d.mts +1 -0
- package/dist/types/commands/organization/fetch-organization-list.d.mts.map +1 -1
- package/dist/types/commands/scan/fetch-supported-scan-file-names.d.mts +1 -0
- package/dist/types/commands/scan/fetch-supported-scan-file-names.d.mts.map +1 -1
- package/dist/types/utils/api.d.mts +1 -0
- package/dist/types/utils/api.d.mts.map +1 -1
- package/dist/types/utils/meow-with-subcommands.d.mts.map +1 -1
- package/dist/types/utils/package-environment.d.mts.map +1 -1
- package/dist/utils.js +31 -18
- package/dist/utils.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
6
6
|
|
|
7
|
+
## [1.1.52](https://github.com/SocketDev/socket-cli/releases/tag/v1.1.52) - 2026-01-02
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
- Added `--silence` flag to `socket fix` to suppress intermediate output and show only the final result.
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
- Updated the Coana CLI to v `14.12.139`.
|
|
14
|
+
|
|
7
15
|
## [1.1.51](https://github.com/SocketDev/socket-cli/releases/tag/v1.1.51) - 2025-12-23
|
|
8
16
|
|
|
9
17
|
### Added
|
package/dist/cli.js
CHANGED
|
@@ -945,7 +945,8 @@ async function fetchCreateOrgFullScan(packagePaths, orgSlug, config, options) {
|
|
|
945
945
|
async function fetchSupportedScanFileNames(options) {
|
|
946
946
|
const {
|
|
947
947
|
sdkOpts,
|
|
948
|
-
spinner
|
|
948
|
+
spinner,
|
|
949
|
+
silence = false
|
|
949
950
|
} = {
|
|
950
951
|
__proto__: null,
|
|
951
952
|
...options
|
|
@@ -957,7 +958,8 @@ async function fetchSupportedScanFileNames(options) {
|
|
|
957
958
|
const sockSdk = sockSdkCResult.data;
|
|
958
959
|
return await utils.handleApiCall(sockSdk.getSupportedScanFiles(), {
|
|
959
960
|
description: 'supported scan file types',
|
|
960
|
-
spinner
|
|
961
|
+
spinner,
|
|
962
|
+
silence
|
|
961
963
|
});
|
|
962
964
|
}
|
|
963
965
|
|
|
@@ -3730,6 +3732,7 @@ async function discoverGhsaIds(orgSlug, tarHash, options) {
|
|
|
3730
3732
|
const {
|
|
3731
3733
|
cwd = process.cwd(),
|
|
3732
3734
|
ecosystems,
|
|
3735
|
+
silence = false,
|
|
3733
3736
|
spinner
|
|
3734
3737
|
} = {
|
|
3735
3738
|
__proto__: null,
|
|
@@ -3737,7 +3740,7 @@ async function discoverGhsaIds(orgSlug, tarHash, options) {
|
|
|
3737
3740
|
};
|
|
3738
3741
|
const foundCResult = await utils.spawnCoanaDlx(['find-vulnerabilities', cwd, '--manifests-tar-hash', tarHash, ...(ecosystems?.length ? ['--purl-types', ...ecosystems] : [])], orgSlug, {
|
|
3739
3742
|
cwd,
|
|
3740
|
-
spinner,
|
|
3743
|
+
spinner: silence ? undefined : spinner,
|
|
3741
3744
|
coanaVersion: options?.coanaVersion
|
|
3742
3745
|
}, {
|
|
3743
3746
|
stdio: 'pipe'
|
|
@@ -3771,20 +3774,24 @@ async function coanaFix(fixConfig) {
|
|
|
3771
3774
|
outputFile,
|
|
3772
3775
|
prLimit,
|
|
3773
3776
|
showAffectedDirectDependencies,
|
|
3777
|
+
silence,
|
|
3774
3778
|
spinner
|
|
3775
3779
|
} = fixConfig;
|
|
3776
3780
|
const fixEnv = await getFixEnv();
|
|
3777
3781
|
require$$9.debugDir('inspect', {
|
|
3778
3782
|
fixEnv
|
|
3779
3783
|
});
|
|
3780
|
-
|
|
3784
|
+
if (!silence) {
|
|
3785
|
+
spinner?.start();
|
|
3786
|
+
}
|
|
3781
3787
|
const sockSdkCResult = await utils.setupSdk();
|
|
3782
3788
|
if (!sockSdkCResult.ok) {
|
|
3783
3789
|
return sockSdkCResult;
|
|
3784
3790
|
}
|
|
3785
3791
|
const sockSdk = sockSdkCResult.data;
|
|
3786
3792
|
const supportedFilesCResult = await fetchSupportedScanFileNames({
|
|
3787
|
-
spinner
|
|
3793
|
+
spinner: silence ? undefined : spinner,
|
|
3794
|
+
silence
|
|
3788
3795
|
});
|
|
3789
3796
|
if (!supportedFilesCResult.ok) {
|
|
3790
3797
|
return supportedFilesCResult;
|
|
@@ -3798,14 +3805,17 @@ async function coanaFix(fixConfig) {
|
|
|
3798
3805
|
const filepathsToUpload = scanFilepaths.filter(p => path.basename(p).toLowerCase() !== constants.DOT_SOCKET_DOT_FACTS_JSON);
|
|
3799
3806
|
const uploadCResult = await utils.handleApiCall(sockSdk.uploadManifestFiles(orgSlug, filepathsToUpload, cwd), {
|
|
3800
3807
|
description: 'upload manifests',
|
|
3801
|
-
spinner
|
|
3808
|
+
spinner,
|
|
3809
|
+
silence
|
|
3802
3810
|
});
|
|
3803
3811
|
if (!uploadCResult.ok) {
|
|
3804
3812
|
return uploadCResult;
|
|
3805
3813
|
}
|
|
3806
3814
|
const tarHash = uploadCResult.data.tarHash;
|
|
3807
3815
|
if (!tarHash) {
|
|
3808
|
-
|
|
3816
|
+
if (!silence) {
|
|
3817
|
+
spinner?.stop();
|
|
3818
|
+
}
|
|
3809
3819
|
return {
|
|
3810
3820
|
ok: false,
|
|
3811
3821
|
message: 'No tar hash returned from Socket API upload-manifest-files endpoint',
|
|
@@ -3816,12 +3826,12 @@ async function coanaFix(fixConfig) {
|
|
|
3816
3826
|
const shouldOpenPrs = fixEnv.isCi && fixEnv.repoInfo;
|
|
3817
3827
|
if (!shouldOpenPrs) {
|
|
3818
3828
|
// In local mode, if neither --all nor --id is provided, show deprecation warning.
|
|
3819
|
-
if (shouldDiscoverGhsaIds && !all) {
|
|
3829
|
+
if (!silence && shouldDiscoverGhsaIds && !all) {
|
|
3820
3830
|
logger.logger.warn('Implicit --all is deprecated in local mode and will be removed in a future release. Please use --all explicitly.');
|
|
3821
3831
|
}
|
|
3822
3832
|
|
|
3823
3833
|
// Inform user about local mode when fixes will be applied.
|
|
3824
|
-
if (applyFixes && ghsas.length) {
|
|
3834
|
+
if (!silence && applyFixes && ghsas.length) {
|
|
3825
3835
|
const envCheck = checkCiEnvVars();
|
|
3826
3836
|
if (envCheck.present.length) {
|
|
3827
3837
|
// Some CI vars are set but not all - show what's missing.
|
|
@@ -3839,10 +3849,13 @@ async function coanaFix(fixConfig) {
|
|
|
3839
3849
|
coanaVersion,
|
|
3840
3850
|
cwd,
|
|
3841
3851
|
ecosystems,
|
|
3852
|
+
silence,
|
|
3842
3853
|
spinner
|
|
3843
3854
|
}) : ghsas;
|
|
3844
3855
|
if (ids.length === 0) {
|
|
3845
|
-
|
|
3856
|
+
if (!silence) {
|
|
3857
|
+
spinner?.stop();
|
|
3858
|
+
}
|
|
3846
3859
|
return {
|
|
3847
3860
|
ok: true,
|
|
3848
3861
|
data: {
|
|
@@ -3858,10 +3871,12 @@ async function coanaFix(fixConfig) {
|
|
|
3858
3871
|
const fixCResult = await utils.spawnCoanaDlx(['compute-fixes-and-upgrade-purls', cwd, '--manifests-tar-hash', tarHash, '--apply-fixes-to', ...ids, ...(fixConfig.rangeStyle ? ['--range-style', fixConfig.rangeStyle] : []), ...(minimumReleaseAge ? ['--minimum-release-age', minimumReleaseAge] : []), ...(include.length ? ['--include', ...include] : []), ...(exclude.length ? ['--exclude', ...exclude] : []), ...(ecosystems.length ? ['--purl-types', ...ecosystems] : []), ...(!applyFixes ? [constants.FLAG_DRY_RUN] : []), '--output-file', tmpFile, ...(debug ? ['--debug'] : []), ...(disableMajorUpdates ? ['--disable-major-updates'] : []), ...(showAffectedDirectDependencies ? ['--show-affected-direct-dependencies'] : []), ...fixConfig.unknownFlags], fixConfig.orgSlug, {
|
|
3859
3872
|
coanaVersion,
|
|
3860
3873
|
cwd,
|
|
3861
|
-
spinner,
|
|
3862
|
-
stdio: 'inherit'
|
|
3874
|
+
spinner: silence ? undefined : spinner,
|
|
3875
|
+
stdio: silence ? 'pipe' : 'inherit'
|
|
3863
3876
|
});
|
|
3864
|
-
|
|
3877
|
+
if (!silence) {
|
|
3878
|
+
spinner?.stop();
|
|
3879
|
+
}
|
|
3865
3880
|
if (!fixCResult.ok) {
|
|
3866
3881
|
return fixCResult;
|
|
3867
3882
|
}
|
|
@@ -3873,7 +3888,9 @@ async function coanaFix(fixConfig) {
|
|
|
3873
3888
|
|
|
3874
3889
|
// Copy to outputFile if provided.
|
|
3875
3890
|
if (outputFile) {
|
|
3876
|
-
|
|
3891
|
+
if (!silence) {
|
|
3892
|
+
logger.logger.info(`Copying fixes result to ${outputFile}`);
|
|
3893
|
+
}
|
|
3877
3894
|
const tmpContent = await fs$1.promises.readFile(tmpFile, 'utf8');
|
|
3878
3895
|
await fs$1.promises.writeFile(outputFile, tmpContent, 'utf8');
|
|
3879
3896
|
}
|
|
@@ -3919,6 +3936,7 @@ async function coanaFix(fixConfig) {
|
|
|
3919
3936
|
coanaVersion,
|
|
3920
3937
|
cwd,
|
|
3921
3938
|
ecosystems,
|
|
3939
|
+
silence,
|
|
3922
3940
|
spinner
|
|
3923
3941
|
}) : ghsas).slice(0, adjustedPrLimit);
|
|
3924
3942
|
}
|
|
@@ -3929,7 +3947,9 @@ async function coanaFix(fixConfig) {
|
|
|
3929
3947
|
require$$9.debugFn('notice', 'miss: no repo info detected');
|
|
3930
3948
|
}
|
|
3931
3949
|
if (!ids?.length || !fixEnv.repoInfo) {
|
|
3932
|
-
|
|
3950
|
+
if (!silence) {
|
|
3951
|
+
spinner?.stop();
|
|
3952
|
+
}
|
|
3933
3953
|
return {
|
|
3934
3954
|
ok: true,
|
|
3935
3955
|
data: {
|
|
@@ -3956,11 +3976,13 @@ async function coanaFix(fixConfig) {
|
|
|
3956
3976
|
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] : []), ...(include.length ? ['--include', ...include] : []), ...(exclude.length ? ['--exclude', ...exclude] : []), ...(ecosystems.length ? ['--purl-types', ...ecosystems] : []), ...(debug ? ['--debug'] : []), ...(disableMajorUpdates ? ['--disable-major-updates'] : []), ...(showAffectedDirectDependencies ? ['--show-affected-direct-dependencies'] : []), ...fixConfig.unknownFlags], fixConfig.orgSlug, {
|
|
3957
3977
|
coanaVersion,
|
|
3958
3978
|
cwd,
|
|
3959
|
-
spinner,
|
|
3960
|
-
stdio: 'inherit'
|
|
3979
|
+
spinner: silence ? undefined : spinner,
|
|
3980
|
+
stdio: silence ? 'pipe' : 'inherit'
|
|
3961
3981
|
});
|
|
3962
3982
|
if (!fixCResult.ok) {
|
|
3963
|
-
|
|
3983
|
+
if (!silence) {
|
|
3984
|
+
logger.logger.error(`Update failed for ${ghsaId}: ${utils.getErrorCause(fixCResult)}`);
|
|
3985
|
+
}
|
|
3964
3986
|
continue ghsaLoop;
|
|
3965
3987
|
}
|
|
3966
3988
|
|
|
@@ -3983,7 +4005,9 @@ async function coanaFix(fixConfig) {
|
|
|
3983
4005
|
});
|
|
3984
4006
|
if (existingOpenPrs.length > 0) {
|
|
3985
4007
|
const prNum = existingOpenPrs[0].number;
|
|
3986
|
-
|
|
4008
|
+
if (!silence) {
|
|
4009
|
+
logger.logger.info(`PR #${prNum} already exists for ${ghsaId}, skipping.`);
|
|
4010
|
+
}
|
|
3987
4011
|
require$$9.debugFn('notice', `skip: open PR #${prNum} exists for ${ghsaId}`);
|
|
3988
4012
|
continue ghsaLoop;
|
|
3989
4013
|
}
|
|
@@ -4001,7 +4025,9 @@ async function coanaFix(fixConfig) {
|
|
|
4001
4025
|
|
|
4002
4026
|
// Check for GitHub token before doing any git operations.
|
|
4003
4027
|
if (!fixEnv.githubToken) {
|
|
4004
|
-
|
|
4028
|
+
if (!silence) {
|
|
4029
|
+
logger.logger.error('Cannot create pull request: SOCKET_CLI_GITHUB_TOKEN environment variable is not set.\n' + 'Set SOCKET_CLI_GITHUB_TOKEN or GITHUB_TOKEN to enable PR creation.');
|
|
4030
|
+
}
|
|
4005
4031
|
require$$9.debugFn('error', `skip: missing GitHub token for ${ghsaId}`);
|
|
4006
4032
|
continue ghsaLoop;
|
|
4007
4033
|
}
|
|
@@ -4022,7 +4048,9 @@ async function coanaFix(fixConfig) {
|
|
|
4022
4048
|
// eslint-disable-next-line no-await-in-loop
|
|
4023
4049
|
await utils.gitPushBranch(branch, cwd));
|
|
4024
4050
|
if (!pushed) {
|
|
4025
|
-
|
|
4051
|
+
if (!silence) {
|
|
4052
|
+
logger.logger.warn(`Push failed for ${ghsaId}, skipping PR creation.`);
|
|
4053
|
+
}
|
|
4026
4054
|
// eslint-disable-next-line no-await-in-loop
|
|
4027
4055
|
await utils.gitResetAndClean(fixEnv.baseBranch, cwd);
|
|
4028
4056
|
// eslint-disable-next-line no-await-in-loop
|
|
@@ -4049,23 +4077,29 @@ async function coanaFix(fixConfig) {
|
|
|
4049
4077
|
data
|
|
4050
4078
|
} = prResult.pr;
|
|
4051
4079
|
const prRef = `PR #${data.number}`;
|
|
4052
|
-
|
|
4080
|
+
if (!silence) {
|
|
4081
|
+
logger.logger.success(`Opened ${prRef} for ${ghsaId}.`);
|
|
4082
|
+
}
|
|
4053
4083
|
if (autopilot) {
|
|
4054
|
-
|
|
4055
|
-
|
|
4084
|
+
if (!silence) {
|
|
4085
|
+
logger.logger.indent();
|
|
4086
|
+
spinner?.indent();
|
|
4087
|
+
}
|
|
4056
4088
|
// eslint-disable-next-line no-await-in-loop
|
|
4057
4089
|
const {
|
|
4058
4090
|
details,
|
|
4059
4091
|
enabled
|
|
4060
4092
|
} = await utils.enablePrAutoMerge(data);
|
|
4061
|
-
if (
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
|
|
4065
|
-
|
|
4093
|
+
if (!silence) {
|
|
4094
|
+
if (enabled) {
|
|
4095
|
+
logger.logger.info(`Auto-merge enabled for ${prRef}.`);
|
|
4096
|
+
} else {
|
|
4097
|
+
const message = `Failed to enable auto-merge for ${prRef}${details ? `:\n${details.map(d => ` - ${d}`).join('\n')}` : '.'}`;
|
|
4098
|
+
logger.logger.error(message);
|
|
4099
|
+
}
|
|
4100
|
+
logger.logger.dedent();
|
|
4101
|
+
spinner?.dedent();
|
|
4066
4102
|
}
|
|
4067
|
-
logger.logger.dedent();
|
|
4068
|
-
spinner?.dedent();
|
|
4069
4103
|
}
|
|
4070
4104
|
|
|
4071
4105
|
// Clean up local branch only - keep remote branch for PR merge.
|
|
@@ -4074,22 +4108,32 @@ async function coanaFix(fixConfig) {
|
|
|
4074
4108
|
} else {
|
|
4075
4109
|
// Handle PR creation failures.
|
|
4076
4110
|
if (prResult.reason === 'already_exists') {
|
|
4077
|
-
|
|
4111
|
+
if (!silence) {
|
|
4112
|
+
logger.logger.info(`PR already exists for ${ghsaId} (this should not happen due to earlier check).`);
|
|
4113
|
+
}
|
|
4078
4114
|
// Don't delete branch - PR exists and needs it.
|
|
4079
4115
|
} else if (prResult.reason === 'validation_error') {
|
|
4080
|
-
|
|
4116
|
+
if (!silence) {
|
|
4117
|
+
logger.logger.error(`Failed to create PR for ${ghsaId}:\n${prResult.details}`);
|
|
4118
|
+
}
|
|
4081
4119
|
// eslint-disable-next-line no-await-in-loop
|
|
4082
4120
|
await cleanupFailedPrBranches(branch, cwd);
|
|
4083
4121
|
} else if (prResult.reason === 'permission_denied') {
|
|
4084
|
-
|
|
4122
|
+
if (!silence) {
|
|
4123
|
+
logger.logger.error(`Failed to create PR for ${ghsaId}: Permission denied. Check SOCKET_CLI_GITHUB_TOKEN permissions.`);
|
|
4124
|
+
}
|
|
4085
4125
|
// eslint-disable-next-line no-await-in-loop
|
|
4086
4126
|
await cleanupFailedPrBranches(branch, cwd);
|
|
4087
4127
|
} else if (prResult.reason === 'network_error') {
|
|
4088
|
-
|
|
4128
|
+
if (!silence) {
|
|
4129
|
+
logger.logger.error(`Failed to create PR for ${ghsaId}: Network error. Please try again.`);
|
|
4130
|
+
}
|
|
4089
4131
|
// eslint-disable-next-line no-await-in-loop
|
|
4090
4132
|
await cleanupFailedPrBranches(branch, cwd);
|
|
4091
4133
|
} else {
|
|
4092
|
-
|
|
4134
|
+
if (!silence) {
|
|
4135
|
+
logger.logger.error(`Failed to create PR for ${ghsaId}: ${prResult.error.message}`);
|
|
4136
|
+
}
|
|
4093
4137
|
// eslint-disable-next-line no-await-in-loop
|
|
4094
4138
|
await cleanupFailedPrBranches(branch, cwd);
|
|
4095
4139
|
}
|
|
@@ -4101,7 +4145,9 @@ async function coanaFix(fixConfig) {
|
|
|
4101
4145
|
// eslint-disable-next-line no-await-in-loop
|
|
4102
4146
|
await utils.gitCheckoutBranch(fixEnv.baseBranch, cwd);
|
|
4103
4147
|
} catch (e) {
|
|
4104
|
-
|
|
4148
|
+
if (!silence) {
|
|
4149
|
+
logger.logger.warn(`Unexpected condition: Push failed for ${ghsaId}, skipping PR creation.`);
|
|
4150
|
+
}
|
|
4105
4151
|
require$$9.debugDir('error', e);
|
|
4106
4152
|
// Clean up branches (push may have succeeded before error).
|
|
4107
4153
|
// eslint-disable-next-line no-await-in-loop
|
|
@@ -4119,7 +4165,9 @@ async function coanaFix(fixConfig) {
|
|
|
4119
4165
|
break ghsaLoop;
|
|
4120
4166
|
}
|
|
4121
4167
|
}
|
|
4122
|
-
|
|
4168
|
+
if (!silence) {
|
|
4169
|
+
spinner?.stop();
|
|
4170
|
+
}
|
|
4123
4171
|
return {
|
|
4124
4172
|
ok: true,
|
|
4125
4173
|
data: {
|
|
@@ -4150,7 +4198,13 @@ const CVE_FORMAT_REGEXP = /^CVE-\d{4}-\d{4,}$/;
|
|
|
4150
4198
|
* Converts mixed CVE/GHSA/PURL IDs to GHSA IDs only.
|
|
4151
4199
|
* Filters out invalid IDs and logs conversion results.
|
|
4152
4200
|
*/
|
|
4153
|
-
async function convertIdsToGhsas(ids) {
|
|
4201
|
+
async function convertIdsToGhsas(ids, options) {
|
|
4202
|
+
const {
|
|
4203
|
+
silence = false
|
|
4204
|
+
} = {
|
|
4205
|
+
__proto__: null,
|
|
4206
|
+
...options
|
|
4207
|
+
};
|
|
4154
4208
|
require$$9.debugFn('notice', `Converting ${ids.length} IDs to GHSA format`);
|
|
4155
4209
|
require$$9.debugDir('inspect', {
|
|
4156
4210
|
ids
|
|
@@ -4177,17 +4231,21 @@ async function convertIdsToGhsas(ids) {
|
|
|
4177
4231
|
const conversionResult = await utils.convertCveToGhsa(trimmedId);
|
|
4178
4232
|
if (conversionResult.ok) {
|
|
4179
4233
|
validGhsas.push(conversionResult.data);
|
|
4180
|
-
|
|
4234
|
+
if (!silence) {
|
|
4235
|
+
logger.logger.info(`Converted ${trimmedId} to ${conversionResult.data}`);
|
|
4236
|
+
}
|
|
4181
4237
|
} else {
|
|
4182
4238
|
errors.push(`${trimmedId}: ${conversionResult.message}`);
|
|
4183
4239
|
}
|
|
4184
4240
|
} else if (trimmedId.startsWith('pkg:')) {
|
|
4185
|
-
// Convert PURL to GHSAs
|
|
4241
|
+
// Convert PURL to GHSAs.
|
|
4186
4242
|
// eslint-disable-next-line no-await-in-loop
|
|
4187
4243
|
const conversionResult = await utils.convertPurlToGhsas(trimmedId);
|
|
4188
4244
|
if (conversionResult.ok && conversionResult.data.length) {
|
|
4189
4245
|
validGhsas.push(...conversionResult.data);
|
|
4190
|
-
|
|
4246
|
+
if (!silence) {
|
|
4247
|
+
logger.logger.info(`Converted ${trimmedId} to ${conversionResult.data.length} GHSA(s): ${arrays.joinAnd(conversionResult.data)}`);
|
|
4248
|
+
}
|
|
4191
4249
|
} else {
|
|
4192
4250
|
errors.push(`${trimmedId}: ${conversionResult.message || 'No GHSAs found'}`);
|
|
4193
4251
|
}
|
|
@@ -4197,7 +4255,9 @@ async function convertIdsToGhsas(ids) {
|
|
|
4197
4255
|
}
|
|
4198
4256
|
}
|
|
4199
4257
|
if (errors.length) {
|
|
4200
|
-
|
|
4258
|
+
if (!silence) {
|
|
4259
|
+
logger.logger.warn(`Skipped ${errors.length} invalid IDs:\n${errors.map(e => ` - ${e}`).join('\n')}`);
|
|
4260
|
+
}
|
|
4201
4261
|
require$$9.debugDir('inspect', {
|
|
4202
4262
|
errors
|
|
4203
4263
|
});
|
|
@@ -4229,6 +4289,7 @@ async function handleFix({
|
|
|
4229
4289
|
prLimit,
|
|
4230
4290
|
rangeStyle,
|
|
4231
4291
|
showAffectedDirectDependencies,
|
|
4292
|
+
silence,
|
|
4232
4293
|
spinner,
|
|
4233
4294
|
unknownFlags
|
|
4234
4295
|
}) {
|
|
@@ -4253,6 +4314,7 @@ async function handleFix({
|
|
|
4253
4314
|
prLimit,
|
|
4254
4315
|
rangeStyle,
|
|
4255
4316
|
showAffectedDirectDependencies,
|
|
4317
|
+
silence,
|
|
4256
4318
|
unknownFlags
|
|
4257
4319
|
});
|
|
4258
4320
|
await outputFixResult(await coanaFix({
|
|
@@ -4266,7 +4328,9 @@ async function handleFix({
|
|
|
4266
4328
|
ecosystems,
|
|
4267
4329
|
exclude,
|
|
4268
4330
|
// Convert mixed CVE/GHSA/PURL inputs to GHSA IDs only.
|
|
4269
|
-
ghsas: await convertIdsToGhsas(ghsas
|
|
4331
|
+
ghsas: await convertIdsToGhsas(ghsas, {
|
|
4332
|
+
silence
|
|
4333
|
+
}),
|
|
4270
4334
|
include,
|
|
4271
4335
|
minimumReleaseAge,
|
|
4272
4336
|
minSatisfying,
|
|
@@ -4276,6 +4340,7 @@ async function handleFix({
|
|
|
4276
4340
|
prLimit,
|
|
4277
4341
|
rangeStyle,
|
|
4278
4342
|
showAffectedDirectDependencies,
|
|
4343
|
+
silence,
|
|
4279
4344
|
spinner,
|
|
4280
4345
|
unknownFlags
|
|
4281
4346
|
}), outputKind);
|
|
@@ -4386,6 +4451,11 @@ Available styles:
|
|
|
4386
4451
|
type: 'boolean',
|
|
4387
4452
|
default: false,
|
|
4388
4453
|
description: 'List the direct dependencies responsible for introducing transitive vulnerabilities and list the updates required to resolve the vulnerabilities'
|
|
4454
|
+
},
|
|
4455
|
+
silence: {
|
|
4456
|
+
type: 'boolean',
|
|
4457
|
+
default: false,
|
|
4458
|
+
description: 'Silence all output except the final result'
|
|
4389
4459
|
}
|
|
4390
4460
|
};
|
|
4391
4461
|
const hiddenFlags = {
|
|
@@ -4511,6 +4581,7 @@ async function run$K(argv, importMeta, {
|
|
|
4511
4581
|
prLimit,
|
|
4512
4582
|
rangeStyle,
|
|
4513
4583
|
showAffectedDirectDependencies,
|
|
4584
|
+
silence,
|
|
4514
4585
|
// We patched in this feature with `npx custompatch meow` at
|
|
4515
4586
|
// socket-cli/patches/meow#13.2.0.patch.
|
|
4516
4587
|
unknownFlags = []
|
|
@@ -4559,7 +4630,7 @@ async function run$K(argv, importMeta, {
|
|
|
4559
4630
|
logger.logger.log(constants.default.DRY_RUN_NOT_SAVING);
|
|
4560
4631
|
return;
|
|
4561
4632
|
}
|
|
4562
|
-
const orgSlugCResult = await utils.getDefaultOrgSlug();
|
|
4633
|
+
const orgSlugCResult = await utils.getDefaultOrgSlug(silence);
|
|
4563
4634
|
if (!orgSlugCResult.ok) {
|
|
4564
4635
|
process.exitCode = orgSlugCResult.code ?? 1;
|
|
4565
4636
|
logger.logger.fail(`${constants.ERROR_UNABLE_RESOLVE_ORG}.\nEnsure a Socket API token is specified for the organization using the SOCKET_CLI_API_TOKEN environment variable.`);
|
|
@@ -4596,6 +4667,7 @@ async function run$K(argv, importMeta, {
|
|
|
4596
4667
|
prLimit,
|
|
4597
4668
|
rangeStyle,
|
|
4598
4669
|
showAffectedDirectDependencies,
|
|
4670
|
+
silence,
|
|
4599
4671
|
spinner,
|
|
4600
4672
|
unknownFlags
|
|
4601
4673
|
});
|
|
@@ -15267,5 +15339,5 @@ process.on('unhandledRejection', async (reason, promise) => {
|
|
|
15267
15339
|
// eslint-disable-next-line n/no-process-exit
|
|
15268
15340
|
process.exit(1);
|
|
15269
15341
|
});
|
|
15270
|
-
//# debugId=
|
|
15342
|
+
//# debugId=5b7cab4d-0164-4136-aa68-598e06dbdd58
|
|
15271
15343
|
//# sourceMappingURL=cli.js.map
|