@socketsecurity/cli-with-sentry 1.0.7 → 1.0.9
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 +135 -109
- package/dist/cli.js.map +1 -1
- package/dist/constants.js +8 -3
- package/dist/constants.js.map +1 -1
- package/dist/shadow-npm-bin.js +5 -5
- package/dist/shadow-npm-bin.js.map +1 -1
- package/dist/socket-completion.bash +23 -7
- package/dist/types/commands/analytics/cmd-analytics.d.mts.map +1 -1
- package/dist/types/commands/audit-log/cmd-audit-log.d.mts.map +1 -1
- package/dist/types/commands/config/cmd-config-auto.d.mts.map +1 -1
- package/dist/types/commands/config/cmd-config-get.d.mts.map +1 -1
- package/dist/types/commands/config/cmd-config-list.d.mts.map +1 -1
- package/dist/types/commands/config/cmd-config-set.d.mts.map +1 -1
- package/dist/types/commands/config/cmd-config-unset.d.mts.map +1 -1
- package/dist/types/commands/fix/agent-fix.d.mts +4 -4
- package/dist/types/commands/fix/agent-fix.d.mts.map +1 -1
- package/dist/types/commands/fix/cmd-fix.d.mts.map +1 -1
- package/dist/types/commands/fix/handle-fix.d.mts +4 -3
- package/dist/types/commands/fix/handle-fix.d.mts.map +1 -1
- package/dist/types/commands/fix/npm-fix.d.mts +2 -2
- package/dist/types/commands/fix/npm-fix.d.mts.map +1 -1
- package/dist/types/commands/fix/pnpm-fix.d.mts +2 -2
- package/dist/types/commands/fix/pnpm-fix.d.mts.map +1 -1
- package/dist/types/commands/install/setup-tab-completion.d.mts.map +1 -1
- package/dist/types/commands/manifest/cmd-manifest-cdxgen.d.mts.map +1 -1
- package/dist/types/commands/npm/cmd-npm.d.mts.map +1 -1
- package/dist/types/commands/npx/cmd-npx.d.mts.map +1 -1
- package/dist/types/commands/organization/cmd-organization-dependencies.d.mts.map +1 -1
- package/dist/types/commands/organization/cmd-organization-list.d.mts.map +1 -1
- package/dist/types/commands/organization/cmd-organization-policy-license.d.mts.map +1 -1
- package/dist/types/commands/organization/cmd-organization-policy-security.d.mts.map +1 -1
- package/dist/types/commands/organization/cmd-organization-quota.d.mts.map +1 -1
- package/dist/types/commands/package/cmd-package-score.d.mts.map +1 -1
- package/dist/types/commands/raw-npm/cmd-raw-npm.d.mts.map +1 -1
- package/dist/types/commands/raw-npx/cmd-raw-npx.d.mts.map +1 -1
- package/dist/types/commands/repository/cmd-repository-create.d.mts.map +1 -1
- package/dist/types/commands/repository/cmd-repository-list.d.mts.map +1 -1
- package/dist/types/commands/repository/cmd-repository-update.d.mts.map +1 -1
- package/dist/types/commands/repository/cmd-repository-view.d.mts.map +1 -1
- package/dist/types/commands/scan/cmd-scan-del.d.mts.map +1 -1
- package/dist/types/commands/scan/cmd-scan-diff.d.mts.map +1 -1
- package/dist/types/commands/scan/cmd-scan-reach.d.mts.map +1 -1
- package/dist/types/commands/scan/handle-scan-reach.d.mts +8 -0
- package/dist/types/commands/scan/handle-scan-reach.d.mts.map +1 -0
- package/dist/types/commands/threat-feed/cmd-threat-feed.d.mts.map +1 -1
- package/dist/types/constants.d.mts.map +1 -1
- package/dist/types/utils/alerts-map.d.mts.map +1 -1
- package/dist/types/utils/api.d.mts.map +1 -1
- package/dist/types/utils/meow-with-subcommands.d.mts +1 -3
- package/dist/types/utils/meow-with-subcommands.d.mts.map +1 -1
- package/dist/utils.js +33 -45
- package/dist/utils.js.map +1 -1
- package/dist/vendor.js +3008 -583
- package/external/@coana-tech/cli/cli.mjs +1 -1
- package/external/@socketsecurity/registry/lib/constants/npm-real-exec-path.js +2 -40
- package/external/@socketsecurity/registry/lib/npm.js +102 -71
- package/external/@socketsecurity/registry/lib/spinner.js +6 -0
- package/external/blessed-contrib/lib/widget/charts/bar.js +4 -3
- package/external/blessed-contrib/lib/widget/charts/line.js +4 -3
- package/external/blessed-contrib/lib/widget/table.js +3 -3
- package/package.json +17 -16
- package/dist/types/commands/scan/handle-reach-scan.d.mts +0 -3
- package/dist/types/commands/scan/handle-reach-scan.d.mts.map +0 -1
- package/external/node-gyp/.release-please-manifest.json +0 -3
- package/external/node-gyp/CHANGELOG.md +0 -1053
- package/external/node-gyp/CODE_OF_CONDUCT.md +0 -4
- package/external/node-gyp/CONTRIBUTING.md +0 -34
- package/external/node-gyp/LICENSE +0 -24
- package/external/node-gyp/README.md +0 -273
- package/external/node-gyp/SECURITY.md +0 -2
- package/external/node-gyp/addon.gypi +0 -204
- package/external/node-gyp/bin/node-gyp.js +0 -137
- package/external/node-gyp/eslint.config.js +0 -3
- package/external/node-gyp/gyp/.release-please-manifest.json +0 -3
- package/external/node-gyp/gyp/LICENSE +0 -28
- package/external/node-gyp/gyp/data/ninja/build.ninja +0 -4
- package/external/node-gyp/gyp/data/win/large-pdb-shim.cc +0 -12
- package/external/node-gyp/gyp/docs/GypVsCMake.md +0 -116
- package/external/node-gyp/gyp/docs/Hacking.md +0 -46
- package/external/node-gyp/gyp/docs/InputFormatReference.md +0 -1083
- package/external/node-gyp/gyp/docs/LanguageSpecification.md +0 -430
- package/external/node-gyp/gyp/docs/README.md +0 -27
- package/external/node-gyp/gyp/docs/Testing.md +0 -450
- package/external/node-gyp/gyp/docs/UserDocumentation.md +0 -965
- package/external/node-gyp/gyp/gyp +0 -8
- package/external/node-gyp/gyp/gyp.bat +0 -5
- package/external/node-gyp/gyp/gyp_main.py +0 -45
- package/external/node-gyp/gyp/pylib/gyp/MSVSNew.py +0 -365
- package/external/node-gyp/gyp/pylib/gyp/MSVSProject.py +0 -206
- package/external/node-gyp/gyp/pylib/gyp/MSVSSettings.py +0 -1272
- package/external/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py +0 -1547
- package/external/node-gyp/gyp/pylib/gyp/MSVSToolFile.py +0 -59
- package/external/node-gyp/gyp/pylib/gyp/MSVSUserFile.py +0 -152
- package/external/node-gyp/gyp/pylib/gyp/MSVSUtil.py +0 -270
- package/external/node-gyp/gyp/pylib/gyp/MSVSVersion.py +0 -574
- package/external/node-gyp/gyp/pylib/gyp/__init__.py +0 -704
- package/external/node-gyp/gyp/pylib/gyp/common.py +0 -709
- package/external/node-gyp/gyp/pylib/gyp/common_test.py +0 -173
- package/external/node-gyp/gyp/pylib/gyp/easy_xml.py +0 -169
- package/external/node-gyp/gyp/pylib/gyp/easy_xml_test.py +0 -113
- package/external/node-gyp/gyp/pylib/gyp/flock_tool.py +0 -55
- package/external/node-gyp/gyp/pylib/gyp/generator/__init__.py +0 -0
- package/external/node-gyp/gyp/pylib/gyp/generator/analyzer.py +0 -805
- package/external/node-gyp/gyp/pylib/gyp/generator/android.py +0 -1172
- package/external/node-gyp/gyp/pylib/gyp/generator/cmake.py +0 -1319
- package/external/node-gyp/gyp/pylib/gyp/generator/compile_commands_json.py +0 -128
- package/external/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py +0 -104
- package/external/node-gyp/gyp/pylib/gyp/generator/eclipse.py +0 -462
- package/external/node-gyp/gyp/pylib/gyp/generator/gypd.py +0 -89
- package/external/node-gyp/gyp/pylib/gyp/generator/gypsh.py +0 -56
- package/external/node-gyp/gyp/pylib/gyp/generator/make.py +0 -2745
- package/external/node-gyp/gyp/pylib/gyp/generator/msvs.py +0 -3976
- package/external/node-gyp/gyp/pylib/gyp/generator/msvs_test.py +0 -44
- package/external/node-gyp/gyp/pylib/gyp/generator/ninja.py +0 -2965
- package/external/node-gyp/gyp/pylib/gyp/generator/ninja_test.py +0 -67
- package/external/node-gyp/gyp/pylib/gyp/generator/xcode.py +0 -1391
- package/external/node-gyp/gyp/pylib/gyp/generator/xcode_test.py +0 -26
- package/external/node-gyp/gyp/pylib/gyp/input.py +0 -3112
- package/external/node-gyp/gyp/pylib/gyp/input_test.py +0 -99
- package/external/node-gyp/gyp/pylib/gyp/mac_tool.py +0 -767
- package/external/node-gyp/gyp/pylib/gyp/msvs_emulation.py +0 -1260
- package/external/node-gyp/gyp/pylib/gyp/ninja_syntax.py +0 -174
- package/external/node-gyp/gyp/pylib/gyp/simple_copy.py +0 -61
- package/external/node-gyp/gyp/pylib/gyp/win_tool.py +0 -373
- package/external/node-gyp/gyp/pylib/gyp/xcode_emulation.py +0 -1939
- package/external/node-gyp/gyp/pylib/gyp/xcode_emulation_test.py +0 -54
- package/external/node-gyp/gyp/pylib/gyp/xcode_ninja.py +0 -303
- package/external/node-gyp/gyp/pylib/gyp/xcodeproj_file.py +0 -3196
- package/external/node-gyp/gyp/pylib/gyp/xml_fix.py +0 -65
- package/external/node-gyp/gyp/pylib/packaging/LICENSE +0 -3
- package/external/node-gyp/gyp/pylib/packaging/LICENSE.APACHE +0 -177
- package/external/node-gyp/gyp/pylib/packaging/LICENSE.BSD +0 -23
- package/external/node-gyp/gyp/pylib/packaging/__init__.py +0 -15
- package/external/node-gyp/gyp/pylib/packaging/_elffile.py +0 -108
- package/external/node-gyp/gyp/pylib/packaging/_manylinux.py +0 -252
- package/external/node-gyp/gyp/pylib/packaging/_musllinux.py +0 -83
- package/external/node-gyp/gyp/pylib/packaging/_parser.py +0 -359
- package/external/node-gyp/gyp/pylib/packaging/_structures.py +0 -61
- package/external/node-gyp/gyp/pylib/packaging/_tokenizer.py +0 -192
- package/external/node-gyp/gyp/pylib/packaging/markers.py +0 -252
- package/external/node-gyp/gyp/pylib/packaging/metadata.py +0 -825
- package/external/node-gyp/gyp/pylib/packaging/py.typed +0 -0
- package/external/node-gyp/gyp/pylib/packaging/requirements.py +0 -90
- package/external/node-gyp/gyp/pylib/packaging/specifiers.py +0 -1030
- package/external/node-gyp/gyp/pylib/packaging/tags.py +0 -553
- package/external/node-gyp/gyp/pylib/packaging/utils.py +0 -172
- package/external/node-gyp/gyp/pylib/packaging/version.py +0 -563
- package/external/node-gyp/gyp/pyproject.toml +0 -115
- package/external/node-gyp/gyp/release-please-config.json +0 -11
- package/external/node-gyp/gyp/test_gyp.py +0 -261
- package/external/node-gyp/lib/Find-VisualStudio.cs +0 -250
- package/external/node-gyp/lib/build.js +0 -230
- package/external/node-gyp/lib/clean.js +0 -15
- package/external/node-gyp/lib/configure.js +0 -328
- package/external/node-gyp/lib/create-config-gypi.js +0 -153
- package/external/node-gyp/lib/download.js +0 -41
- package/external/node-gyp/lib/find-node-directory.js +0 -63
- package/external/node-gyp/lib/find-python.js +0 -310
- package/external/node-gyp/lib/find-visualstudio.js +0 -600
- package/external/node-gyp/lib/install.js +0 -415
- package/external/node-gyp/lib/list.js +0 -26
- package/external/node-gyp/lib/log.js +0 -168
- package/external/node-gyp/lib/node-gyp.js +0 -188
- package/external/node-gyp/lib/process-release.js +0 -148
- package/external/node-gyp/lib/rebuild.js +0 -12
- package/external/node-gyp/lib/remove.js +0 -43
- package/external/node-gyp/lib/util.js +0 -81
- package/external/node-gyp/macOS_Catalina_acid_test.sh +0 -21
- package/external/node-gyp/package.json +0 -52
- package/external/node-gyp/release-please-config.json +0 -40
- package/external/node-gyp/src/win_delay_load_hook.cc +0 -41
package/dist/cli.js
CHANGED
|
@@ -355,12 +355,6 @@ async function run$P(argv, importMeta, {
|
|
|
355
355
|
importMeta,
|
|
356
356
|
parentName
|
|
357
357
|
});
|
|
358
|
-
const {
|
|
359
|
-
file,
|
|
360
|
-
json,
|
|
361
|
-
markdown
|
|
362
|
-
} = cli.flags;
|
|
363
|
-
const outputKind = utils.getOutputKind(json, markdown);
|
|
364
358
|
|
|
365
359
|
// Supported inputs:
|
|
366
360
|
// - [] (no args)
|
|
@@ -388,8 +382,14 @@ async function run$P(argv, importMeta, {
|
|
|
388
382
|
} else if (cli.input[0]) {
|
|
389
383
|
time = cli.input[0];
|
|
390
384
|
}
|
|
385
|
+
const {
|
|
386
|
+
file,
|
|
387
|
+
json,
|
|
388
|
+
markdown
|
|
389
|
+
} = cli.flags;
|
|
391
390
|
const hasApiToken = utils.hasDefaultToken();
|
|
392
391
|
const noLegacy = !cli.flags['scope'] && !cli.flags['repo'] && !cli.flags['time'];
|
|
392
|
+
const outputKind = utils.getOutputKind(json, markdown);
|
|
393
393
|
const wasValidInput = utils.checkCommandInput(outputKind, {
|
|
394
394
|
nook: true,
|
|
395
395
|
test: noLegacy,
|
|
@@ -806,12 +806,12 @@ async function run$O(argv, importMeta, {
|
|
|
806
806
|
page,
|
|
807
807
|
perPage
|
|
808
808
|
} = cli.flags;
|
|
809
|
-
const outputKind = utils.getOutputKind(json, markdown);
|
|
810
809
|
let [typeFilter = ''] = cli.input;
|
|
811
810
|
typeFilter = String(typeFilter);
|
|
812
|
-
const [orgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), !!interactive, !!dryRun);
|
|
813
811
|
const hasApiToken = utils.hasDefaultToken();
|
|
814
812
|
const noLegacy = !cli.flags['type'];
|
|
813
|
+
const [orgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), !!interactive, !!dryRun);
|
|
814
|
+
const outputKind = utils.getOutputKind(json, markdown);
|
|
815
815
|
const wasValidInput = utils.checkCommandInput(outputKind, {
|
|
816
816
|
nook: true,
|
|
817
817
|
test: noLegacy,
|
|
@@ -1606,7 +1606,7 @@ async function execGradleWithSpinner(bin, commandArgs, cwd) {
|
|
|
1606
1606
|
try {
|
|
1607
1607
|
logger.logger.info('(Running gradle can take a while, it depends on how long gradlew has to run)');
|
|
1608
1608
|
logger.logger.info('(It will show no output, you can use --verbose to see its output)');
|
|
1609
|
-
spinner.start(`Running gradlew
|
|
1609
|
+
spinner.start(`Running gradlew...`);
|
|
1610
1610
|
const output = await spawn.spawn(bin, commandArgs, {
|
|
1611
1611
|
// We can pipe the output through to have the user see the result
|
|
1612
1612
|
// of running gradlew, but then we can't (easily) gather the output
|
|
@@ -2432,8 +2432,8 @@ async function run$M(argv, importMeta, {
|
|
|
2432
2432
|
json,
|
|
2433
2433
|
markdown
|
|
2434
2434
|
} = cli.flags;
|
|
2435
|
-
const outputKind = utils.getOutputKind(json, markdown);
|
|
2436
2435
|
const [key = ''] = cli.input;
|
|
2436
|
+
const outputKind = utils.getOutputKind(json, markdown);
|
|
2437
2437
|
const wasValidInput = utils.checkCommandInput(outputKind, {
|
|
2438
2438
|
test: utils.supportedConfigKeys.has(key) && key !== 'test',
|
|
2439
2439
|
message: 'Config key should be the first arg',
|
|
@@ -2544,8 +2544,8 @@ async function run$L(argv, importMeta, {
|
|
|
2544
2544
|
json,
|
|
2545
2545
|
markdown
|
|
2546
2546
|
} = cli.flags;
|
|
2547
|
-
const outputKind = utils.getOutputKind(json, markdown);
|
|
2548
2547
|
const [key = ''] = cli.input;
|
|
2548
|
+
const outputKind = utils.getOutputKind(json, markdown);
|
|
2549
2549
|
const wasValidInput = utils.checkCommandInput(outputKind, {
|
|
2550
2550
|
test: utils.supportedConfigKeys.has(key) || key === 'test',
|
|
2551
2551
|
message: 'Config key should be the first arg',
|
|
@@ -2797,9 +2797,9 @@ async function run$J(argv, importMeta, {
|
|
|
2797
2797
|
json,
|
|
2798
2798
|
markdown
|
|
2799
2799
|
} = cli.flags;
|
|
2800
|
-
const outputKind = utils.getOutputKind(json, markdown);
|
|
2801
2800
|
const [key = '', ...rest] = cli.input;
|
|
2802
2801
|
const value = rest.join(' ');
|
|
2802
|
+
const outputKind = utils.getOutputKind(json, markdown);
|
|
2803
2803
|
const wasValidInput = utils.checkCommandInput(outputKind, {
|
|
2804
2804
|
test: key === 'test' || utils.supportedConfigKeys.has(key),
|
|
2805
2805
|
message: 'Config key should be the first arg',
|
|
@@ -2917,8 +2917,8 @@ async function run$I(argv, importMeta, {
|
|
|
2917
2917
|
json,
|
|
2918
2918
|
markdown
|
|
2919
2919
|
} = cli.flags;
|
|
2920
|
-
const outputKind = utils.getOutputKind(json, markdown);
|
|
2921
2920
|
const [key = ''] = cli.input;
|
|
2921
|
+
const outputKind = utils.getOutputKind(json, markdown);
|
|
2922
2922
|
const wasValidInput = utils.checkCommandInput(outputKind, {
|
|
2923
2923
|
test: key === 'test' || utils.supportedConfigKeys.has(key),
|
|
2924
2924
|
message: 'Config key should be the first arg',
|
|
@@ -3718,21 +3718,19 @@ async function agentFix(pkgEnvDetails, actualTree, alertsMap, installer, {
|
|
|
3718
3718
|
// eslint-disable-next-line sort-destructure-keys/sort-destructure-keys
|
|
3719
3719
|
afterInstall = noopHandler,
|
|
3720
3720
|
revertInstall = noopHandler
|
|
3721
|
-
}, ciEnv, openPrs,
|
|
3721
|
+
}, ciEnv, openPrs, fixConfig) {
|
|
3722
|
+
const {
|
|
3723
|
+
pkgPath: rootPath
|
|
3724
|
+
} = pkgEnvDetails;
|
|
3722
3725
|
const {
|
|
3723
3726
|
autoMerge,
|
|
3724
3727
|
cwd,
|
|
3725
3728
|
limit,
|
|
3726
3729
|
rangeStyle,
|
|
3730
|
+
spinner,
|
|
3727
3731
|
test,
|
|
3728
3732
|
testScript
|
|
3729
|
-
} =
|
|
3730
|
-
const {
|
|
3731
|
-
spinner
|
|
3732
|
-
} = constants;
|
|
3733
|
-
const {
|
|
3734
|
-
pkgPath: rootPath
|
|
3735
|
-
} = pkgEnvDetails;
|
|
3733
|
+
} = fixConfig;
|
|
3736
3734
|
let count = 0;
|
|
3737
3735
|
const infoByPartialPurl = utils.getCveInfoFromAlertsMap(alertsMap, {
|
|
3738
3736
|
limit: Math.max(limit, openPrs.length)
|
|
@@ -3905,7 +3903,7 @@ async function agentFix(pkgEnvDetails, actualTree, alertsMap, installer, {
|
|
|
3905
3903
|
}
|
|
3906
3904
|
|
|
3907
3905
|
// eslint-disable-next-line no-await-in-loop
|
|
3908
|
-
await beforeInstall(editablePkgJson, name, oldVersion, newVersion, vulnerableVersionRange,
|
|
3906
|
+
await beforeInstall(editablePkgJson, name, oldVersion, newVersion, vulnerableVersionRange, fixConfig);
|
|
3909
3907
|
shadowNpmInject.updatePackageJsonFromNode(editablePkgJson, actualTree, node, newVersion, rangeStyle);
|
|
3910
3908
|
// eslint-disable-next-line no-await-in-loop
|
|
3911
3909
|
if (!(await editablePkgJson.save({
|
|
@@ -3940,11 +3938,11 @@ async function agentFix(pkgEnvDetails, actualTree, alertsMap, installer, {
|
|
|
3940
3938
|
if (maybeActualTree && maybeLockSrc) {
|
|
3941
3939
|
actualTree = maybeActualTree;
|
|
3942
3940
|
// eslint-disable-next-line no-await-in-loop
|
|
3943
|
-
await afterInstall(editablePkgJson, name, oldVersion, newVersion, vulnerableVersionRange,
|
|
3941
|
+
await afterInstall(editablePkgJson, name, oldVersion, newVersion, vulnerableVersionRange, fixConfig);
|
|
3944
3942
|
if (test) {
|
|
3945
3943
|
spinner?.info(`Testing ${newId} in ${workspace}.`);
|
|
3946
3944
|
// eslint-disable-next-line no-await-in-loop
|
|
3947
|
-
await npm.
|
|
3945
|
+
await npm.runNpmScript(testScript, [], {
|
|
3948
3946
|
spinner,
|
|
3949
3947
|
stdio: 'ignore'
|
|
3950
3948
|
});
|
|
@@ -4079,7 +4077,7 @@ async function agentFix(pkgEnvDetails, actualTree, alertsMap, installer, {
|
|
|
4079
4077
|
if (!ciEnv) {
|
|
4080
4078
|
spinner?.start();
|
|
4081
4079
|
// eslint-disable-next-line no-await-in-loop
|
|
4082
|
-
await revertInstall(editablePkgJson, name, oldVersion, newVersion, vulnerableVersionRange,
|
|
4080
|
+
await revertInstall(editablePkgJson, name, oldVersion, newVersion, vulnerableVersionRange, fixConfig);
|
|
4083
4081
|
// eslint-disable-next-line no-await-in-loop
|
|
4084
4082
|
await Promise.all([utils.removeNodeModules(cwd), editablePkgJson.save({
|
|
4085
4083
|
ignoreWhitespace: true
|
|
@@ -4219,12 +4217,12 @@ async function install$1(pkgEnvDetails, options) {
|
|
|
4219
4217
|
} catch {}
|
|
4220
4218
|
return null;
|
|
4221
4219
|
}
|
|
4222
|
-
async function npmFix(pkgEnvDetails,
|
|
4220
|
+
async function npmFix(pkgEnvDetails, fixConfig) {
|
|
4223
4221
|
const {
|
|
4224
4222
|
limit,
|
|
4225
4223
|
purls,
|
|
4226
4224
|
spinner
|
|
4227
|
-
} =
|
|
4225
|
+
} = fixConfig;
|
|
4228
4226
|
spinner?.start();
|
|
4229
4227
|
const ciEnv = await getCiEnv();
|
|
4230
4228
|
const openPrs = ciEnv ? await getOpenPrsForEnvironment(ciEnv) : [];
|
|
@@ -4305,7 +4303,7 @@ async function npmFix(pkgEnvDetails, options) {
|
|
|
4305
4303
|
editablePkgJson.update(revertData);
|
|
4306
4304
|
}
|
|
4307
4305
|
}
|
|
4308
|
-
}, ciEnv, openPrs,
|
|
4306
|
+
}, ciEnv, openPrs, fixConfig);
|
|
4309
4307
|
}
|
|
4310
4308
|
|
|
4311
4309
|
async function outputFixResult(result, outputKind) {
|
|
@@ -4353,13 +4351,13 @@ async function install(pkgEnvDetails, options) {
|
|
|
4353
4351
|
} catch {}
|
|
4354
4352
|
return null;
|
|
4355
4353
|
}
|
|
4356
|
-
async function pnpmFix(pkgEnvDetails,
|
|
4354
|
+
async function pnpmFix(pkgEnvDetails, fixConfig) {
|
|
4357
4355
|
const {
|
|
4358
4356
|
cwd,
|
|
4359
4357
|
limit,
|
|
4360
4358
|
purls,
|
|
4361
4359
|
spinner
|
|
4362
|
-
} =
|
|
4360
|
+
} = fixConfig;
|
|
4363
4361
|
spinner?.start();
|
|
4364
4362
|
let actualTree;
|
|
4365
4363
|
let {
|
|
@@ -4487,14 +4485,14 @@ async function pnpmFix(pkgEnvDetails, options) {
|
|
|
4487
4485
|
editablePkgJson.update(revertData);
|
|
4488
4486
|
}
|
|
4489
4487
|
}
|
|
4490
|
-
}, ciEnv, openPrs,
|
|
4488
|
+
}, ciEnv, openPrs, fixConfig);
|
|
4491
4489
|
}
|
|
4492
4490
|
|
|
4493
4491
|
const {
|
|
4494
4492
|
NPM: NPM$7,
|
|
4495
4493
|
PNPM: PNPM$6
|
|
4496
4494
|
} = constants;
|
|
4497
|
-
async function handleFix(
|
|
4495
|
+
async function handleFix({
|
|
4498
4496
|
autoMerge,
|
|
4499
4497
|
cwd,
|
|
4500
4498
|
ghsas,
|
|
@@ -4502,23 +4500,22 @@ async function handleFix(argv, {
|
|
|
4502
4500
|
outputKind,
|
|
4503
4501
|
purls,
|
|
4504
4502
|
rangeStyle,
|
|
4503
|
+
spinner,
|
|
4505
4504
|
test,
|
|
4506
|
-
testScript
|
|
4505
|
+
testScript,
|
|
4506
|
+
unknownFlags
|
|
4507
4507
|
}) {
|
|
4508
4508
|
let {
|
|
4509
4509
|
length: ghsasCount
|
|
4510
4510
|
} = ghsas;
|
|
4511
4511
|
if (ghsasCount) {
|
|
4512
|
-
|
|
4513
|
-
const {
|
|
4514
|
-
spinner
|
|
4515
|
-
} = constants;
|
|
4516
|
-
spinner.start('Fetching GHSA IDs...');
|
|
4512
|
+
spinner?.start('Fetching GHSA IDs...');
|
|
4517
4513
|
if (ghsasCount === 1 && ghsas[0] === 'auto') {
|
|
4518
4514
|
const autoCResult = await utils.spawnCoana(['compute-fixes-and-upgrade-purls', cwd], {
|
|
4519
4515
|
cwd,
|
|
4520
4516
|
spinner
|
|
4521
4517
|
});
|
|
4518
|
+
spinner?.stop();
|
|
4522
4519
|
if (autoCResult.ok) {
|
|
4523
4520
|
ghsas = utils.cmdFlagValueToArray(/(?<=Vulnerabilities found: )[^\n]+/.exec(autoCResult.data)?.[0]);
|
|
4524
4521
|
ghsasCount = ghsas.length;
|
|
@@ -4530,17 +4527,25 @@ async function handleFix(argv, {
|
|
|
4530
4527
|
ghsas = [];
|
|
4531
4528
|
ghsasCount = 0;
|
|
4532
4529
|
}
|
|
4530
|
+
spinner?.start();
|
|
4533
4531
|
}
|
|
4534
4532
|
if (ghsasCount) {
|
|
4535
|
-
spinner
|
|
4536
|
-
|
|
4533
|
+
spinner?.info(`Found ${ghsasCount} GHSA ${words.pluralize('ID', ghsasCount)}.`);
|
|
4534
|
+
const applyFixesCResult = await utils.spawnCoana(['compute-fixes-and-upgrade-purls', cwd, '--apply-fixes-to', ...ghsas, ...unknownFlags], {
|
|
4537
4535
|
cwd,
|
|
4538
4536
|
spinner
|
|
4539
|
-
})
|
|
4540
|
-
spinner
|
|
4537
|
+
});
|
|
4538
|
+
spinner?.stop();
|
|
4539
|
+
if (!applyFixesCResult.ok) {
|
|
4540
|
+
debug.debugFn('coana fail:', {
|
|
4541
|
+
message: applyFixesCResult.message,
|
|
4542
|
+
cause: applyFixesCResult.cause
|
|
4543
|
+
});
|
|
4544
|
+
}
|
|
4545
|
+
await outputFixResult(applyFixesCResult, outputKind);
|
|
4541
4546
|
return;
|
|
4542
4547
|
}
|
|
4543
|
-
spinner
|
|
4548
|
+
spinner?.infoAndStop('No GHSA IDs found.');
|
|
4544
4549
|
await outputFixResult({
|
|
4545
4550
|
ok: true,
|
|
4546
4551
|
data: ''
|
|
@@ -4578,11 +4583,6 @@ async function handleFix(argv, {
|
|
|
4578
4583
|
}, outputKind);
|
|
4579
4584
|
return;
|
|
4580
4585
|
}
|
|
4581
|
-
|
|
4582
|
-
// Lazily access spinner.
|
|
4583
|
-
const {
|
|
4584
|
-
spinner
|
|
4585
|
-
} = constants;
|
|
4586
4586
|
const fixer = agent === NPM$7 ? npmFix : pnpmFix;
|
|
4587
4587
|
await outputFixResult(await fixer(pkgEnvDetails, {
|
|
4588
4588
|
autoMerge,
|
|
@@ -4709,6 +4709,14 @@ async function run$H(argv, importMeta, {
|
|
|
4709
4709
|
logger.logger.log(DRY_RUN_NOT_SAVING);
|
|
4710
4710
|
return;
|
|
4711
4711
|
}
|
|
4712
|
+
|
|
4713
|
+
// Lazily access constants.spinner.
|
|
4714
|
+
const {
|
|
4715
|
+
spinner
|
|
4716
|
+
} = constants;
|
|
4717
|
+
const {
|
|
4718
|
+
unknownFlags
|
|
4719
|
+
} = cli;
|
|
4712
4720
|
let [cwd = '.'] = cli.input;
|
|
4713
4721
|
// Note: path.resolve vs .join:
|
|
4714
4722
|
// If given path is absolute then cwd should not affect it.
|
|
@@ -4723,7 +4731,7 @@ async function run$H(argv, importMeta, {
|
|
|
4723
4731
|
const limit = (cli.flags['limit'] ? parseInt(String(cli.flags['limit'] || ''), 10) : Infinity) || Infinity;
|
|
4724
4732
|
const purls = utils.cmdFlagValueToArray(cli.flags['purl']);
|
|
4725
4733
|
const testScript = String(cli.flags['testScript'] || 'test');
|
|
4726
|
-
await handleFix(
|
|
4734
|
+
await handleFix({
|
|
4727
4735
|
autoMerge,
|
|
4728
4736
|
cwd,
|
|
4729
4737
|
ghsas,
|
|
@@ -4731,8 +4739,10 @@ async function run$H(argv, importMeta, {
|
|
|
4731
4739
|
outputKind,
|
|
4732
4740
|
purls,
|
|
4733
4741
|
rangeStyle,
|
|
4742
|
+
spinner,
|
|
4734
4743
|
test,
|
|
4735
|
-
testScript
|
|
4744
|
+
testScript,
|
|
4745
|
+
unknownFlags
|
|
4736
4746
|
});
|
|
4737
4747
|
}
|
|
4738
4748
|
|
|
@@ -4822,7 +4832,7 @@ function getTabCompletionScriptRaw() {
|
|
|
4822
4832
|
if (!fs$1.existsSync(sourcePath)) {
|
|
4823
4833
|
return {
|
|
4824
4834
|
ok: false,
|
|
4825
|
-
message: 'Source not found',
|
|
4835
|
+
message: 'Source not found.',
|
|
4826
4836
|
cause: `Unable to find the source tab completion bash script that Socket should ship. Expected to find it in \`${sourcePath}\` but it was not there.`
|
|
4827
4837
|
};
|
|
4828
4838
|
}
|
|
@@ -4837,12 +4847,11 @@ function updateInstalledTabCompletionScript(targetPath) {
|
|
|
4837
4847
|
return content;
|
|
4838
4848
|
}
|
|
4839
4849
|
|
|
4840
|
-
// Lazily access constants.ENV.INLINED_SOCKET_CLI_VERSION_HASH.
|
|
4841
|
-
const CLI_VERSION = constants.ENV.INLINED_SOCKET_CLI_VERSION_HASH;
|
|
4842
|
-
|
|
4843
4850
|
// When installing set the current package.json version.
|
|
4844
4851
|
// Later, we can call _socket_completion_version to get the installed version.
|
|
4845
|
-
fs$1.writeFileSync(targetPath, content.data.replaceAll('SOCKET_VERSION_TOKEN',
|
|
4852
|
+
fs$1.writeFileSync(targetPath, content.data.replaceAll('%SOCKET_VERSION_TOKEN%',
|
|
4853
|
+
// Lazily access constants.ENV.INLINED_SOCKET_CLI_VERSION_HASH.
|
|
4854
|
+
constants.ENV.INLINED_SOCKET_CLI_VERSION_HASH), 'utf8');
|
|
4846
4855
|
return {
|
|
4847
4856
|
ok: true,
|
|
4848
4857
|
data: undefined
|
|
@@ -7902,8 +7911,8 @@ async function run$q(argv, importMeta, {
|
|
|
7902
7911
|
markdown,
|
|
7903
7912
|
offset
|
|
7904
7913
|
} = cli.flags;
|
|
7905
|
-
const outputKind = utils.getOutputKind(json, markdown);
|
|
7906
7914
|
const hasApiToken = utils.hasDefaultToken();
|
|
7915
|
+
const outputKind = utils.getOutputKind(json, markdown);
|
|
7907
7916
|
const wasValidInput = utils.checkCommandInput(outputKind, {
|
|
7908
7917
|
nook: true,
|
|
7909
7918
|
test: !json || !markdown,
|
|
@@ -8030,9 +8039,9 @@ async function run$p(argv, importMeta, {
|
|
|
8030
8039
|
markdown,
|
|
8031
8040
|
org: orgFlag
|
|
8032
8041
|
} = cli.flags;
|
|
8033
|
-
const outputKind = utils.getOutputKind(json, markdown);
|
|
8034
|
-
const [orgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), !!interactive, !!dryRun);
|
|
8035
8042
|
const hasApiToken = utils.hasDefaultToken();
|
|
8043
|
+
const [orgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), !!interactive, !!dryRun);
|
|
8044
|
+
const outputKind = utils.getOutputKind(json, markdown);
|
|
8036
8045
|
const wasValidInput = utils.checkCommandInput(outputKind, {
|
|
8037
8046
|
nook: true,
|
|
8038
8047
|
test: !json || !markdown,
|
|
@@ -8158,9 +8167,9 @@ async function run$o(argv, importMeta, {
|
|
|
8158
8167
|
markdown,
|
|
8159
8168
|
org: orgFlag
|
|
8160
8169
|
} = cli.flags;
|
|
8161
|
-
const outputKind = utils.getOutputKind(json, markdown);
|
|
8162
|
-
const [orgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), !!interactive, !!dryRun);
|
|
8163
8170
|
const hasApiToken = utils.hasDefaultToken();
|
|
8171
|
+
const [orgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), !!interactive, !!dryRun);
|
|
8172
|
+
const outputKind = utils.getOutputKind(json, markdown);
|
|
8164
8173
|
const wasValidInput = utils.checkCommandInput(outputKind, {
|
|
8165
8174
|
nook: true,
|
|
8166
8175
|
test: !json || !markdown,
|
|
@@ -8293,8 +8302,8 @@ async function run$n(argv, importMeta, {
|
|
|
8293
8302
|
json,
|
|
8294
8303
|
markdown
|
|
8295
8304
|
} = cli.flags;
|
|
8296
|
-
const outputKind = utils.getOutputKind(json, markdown);
|
|
8297
8305
|
const hasApiToken = utils.hasDefaultToken();
|
|
8306
|
+
const outputKind = utils.getOutputKind(json, markdown);
|
|
8298
8307
|
const wasValidInput = utils.checkCommandInput(outputKind, {
|
|
8299
8308
|
nook: true,
|
|
8300
8309
|
test: !json || !markdown,
|
|
@@ -8417,10 +8426,10 @@ async function run$m(argv, importMeta, {
|
|
|
8417
8426
|
importMeta,
|
|
8418
8427
|
parentName
|
|
8419
8428
|
});
|
|
8429
|
+
const hasApiToken = utils.hasDefaultToken();
|
|
8420
8430
|
const json = Boolean(cli.flags['json']);
|
|
8421
8431
|
const markdown = Boolean(cli.flags['markdown']);
|
|
8422
8432
|
const outputKind = utils.getOutputKind(json, markdown);
|
|
8423
|
-
const hasApiToken = utils.hasDefaultToken();
|
|
8424
8433
|
const wasValidInput = utils.checkCommandInput(outputKind, {
|
|
8425
8434
|
nook: true,
|
|
8426
8435
|
test: !json || !markdown,
|
|
@@ -8768,9 +8777,9 @@ async function run$l(argv, importMeta, {
|
|
|
8768
8777
|
json,
|
|
8769
8778
|
markdown
|
|
8770
8779
|
} = cli.flags;
|
|
8771
|
-
const outputKind = utils.getOutputKind(json, markdown);
|
|
8772
8780
|
const [ecosystem = '', purl] = cli.input;
|
|
8773
8781
|
const hasApiToken = utils.hasDefaultToken();
|
|
8782
|
+
const outputKind = utils.getOutputKind(json, markdown);
|
|
8774
8783
|
const {
|
|
8775
8784
|
purls,
|
|
8776
8785
|
valid
|
|
@@ -9213,7 +9222,9 @@ const config$j = {
|
|
|
9213
9222
|
commandName: 'raw-npm',
|
|
9214
9223
|
description: `Temporarily disable the Socket ${NPM} wrapper`,
|
|
9215
9224
|
hidden: false,
|
|
9216
|
-
flags: {
|
|
9225
|
+
flags: {
|
|
9226
|
+
...utils.commonFlags
|
|
9227
|
+
},
|
|
9217
9228
|
help: command => `
|
|
9218
9229
|
Usage
|
|
9219
9230
|
$ ${command} ...
|
|
@@ -9276,7 +9287,9 @@ const config$i = {
|
|
|
9276
9287
|
commandName: 'raw-npx',
|
|
9277
9288
|
description: `Temporarily disable the Socket ${NPX} wrapper`,
|
|
9278
9289
|
hidden: false,
|
|
9279
|
-
flags: {
|
|
9290
|
+
flags: {
|
|
9291
|
+
...utils.commonFlags
|
|
9292
|
+
},
|
|
9280
9293
|
help: command => `
|
|
9281
9294
|
Usage
|
|
9282
9295
|
$ ${command} ...
|
|
@@ -9451,11 +9464,11 @@ async function run$h(argv, importMeta, {
|
|
|
9451
9464
|
markdown,
|
|
9452
9465
|
org: orgFlag
|
|
9453
9466
|
} = cli.flags;
|
|
9454
|
-
const outputKind = utils.getOutputKind(json, markdown);
|
|
9455
9467
|
const [repoName = ''] = cli.input;
|
|
9456
|
-
const [orgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), !!interactive, !!dryRun);
|
|
9457
9468
|
const hasApiToken = utils.hasDefaultToken();
|
|
9458
9469
|
const noLegacy = !cli.flags['repoName'];
|
|
9470
|
+
const [orgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), !!interactive, !!dryRun);
|
|
9471
|
+
const outputKind = utils.getOutputKind(json, markdown);
|
|
9459
9472
|
const wasValidInput = utils.checkCommandInput(outputKind, {
|
|
9460
9473
|
nook: true,
|
|
9461
9474
|
test: !!orgSlug,
|
|
@@ -9863,9 +9876,9 @@ async function run$f(argv, importMeta, {
|
|
|
9863
9876
|
markdown,
|
|
9864
9877
|
org: orgFlag
|
|
9865
9878
|
} = cli.flags;
|
|
9866
|
-
const outputKind = utils.getOutputKind(json, markdown);
|
|
9867
|
-
const [orgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), !!interactive, !!dryRun);
|
|
9868
9879
|
const hasApiToken = utils.hasDefaultToken();
|
|
9880
|
+
const [orgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), !!interactive, !!dryRun);
|
|
9881
|
+
const outputKind = utils.getOutputKind(json, markdown);
|
|
9869
9882
|
const wasValidInput = utils.checkCommandInput(outputKind, {
|
|
9870
9883
|
nook: true,
|
|
9871
9884
|
test: !!orgSlug,
|
|
@@ -10047,11 +10060,11 @@ async function run$e(argv, importMeta, {
|
|
|
10047
10060
|
markdown,
|
|
10048
10061
|
org: orgFlag
|
|
10049
10062
|
} = cli.flags;
|
|
10050
|
-
const outputKind = utils.getOutputKind(json, markdown);
|
|
10051
10063
|
const [repoName = ''] = cli.input;
|
|
10052
|
-
const [orgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), !!interactive, !!dryRun);
|
|
10053
10064
|
const hasApiToken = utils.hasDefaultToken();
|
|
10054
10065
|
const noLegacy = !cli.flags['repoName'];
|
|
10066
|
+
const [orgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), !!interactive, !!dryRun);
|
|
10067
|
+
const outputKind = utils.getOutputKind(json, markdown);
|
|
10055
10068
|
const wasValidInput = utils.checkCommandInput(outputKind, {
|
|
10056
10069
|
nook: true,
|
|
10057
10070
|
test: noLegacy,
|
|
@@ -10204,11 +10217,11 @@ async function run$d(argv, importMeta, {
|
|
|
10204
10217
|
markdown,
|
|
10205
10218
|
org: orgFlag
|
|
10206
10219
|
} = cli.flags;
|
|
10207
|
-
const outputKind = utils.getOutputKind(json, markdown);
|
|
10208
10220
|
const [repoName = ''] = cli.input;
|
|
10209
|
-
const [orgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), !!interactive, !!dryRun);
|
|
10210
10221
|
const hasApiToken = utils.hasDefaultToken();
|
|
10211
10222
|
const noLegacy = !cli.flags['repoName'];
|
|
10223
|
+
const [orgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), !!interactive, !!dryRun);
|
|
10224
|
+
const outputKind = utils.getOutputKind(json, markdown);
|
|
10212
10225
|
const wasValidInput = utils.checkCommandInput(outputKind, {
|
|
10213
10226
|
nook: true,
|
|
10214
10227
|
test: noLegacy,
|
|
@@ -10461,8 +10474,6 @@ async function run$c(argv, importMeta, {
|
|
|
10461
10474
|
repo: repoName,
|
|
10462
10475
|
report
|
|
10463
10476
|
} = cli.flags;
|
|
10464
|
-
const outputKind = utils.getOutputKind(json, markdown);
|
|
10465
|
-
const pendingHead = tmp ? false : pendingHeadFlag;
|
|
10466
10477
|
let [orgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), interactive, dryRun);
|
|
10467
10478
|
|
|
10468
10479
|
// Accept zero or more paths. Default to cwd() if none given.
|
|
@@ -10508,6 +10519,8 @@ async function run$c(argv, importMeta, {
|
|
|
10508
10519
|
// must come from data we already know. Don't error on missing api token yet.
|
|
10509
10520
|
// If the api-token is not set, ignore it for the sake of suggestions.
|
|
10510
10521
|
const hasApiToken = utils.hasDefaultToken();
|
|
10522
|
+
const outputKind = utils.getOutputKind(json, markdown);
|
|
10523
|
+
const pendingHead = tmp ? false : pendingHeadFlag;
|
|
10511
10524
|
|
|
10512
10525
|
// If we updated any inputs then we should print the command line to repeat
|
|
10513
10526
|
// the command without requiring user input, as a suggestion.
|
|
@@ -10703,10 +10716,10 @@ async function run$b(argv, importMeta, {
|
|
|
10703
10716
|
markdown,
|
|
10704
10717
|
org: orgFlag
|
|
10705
10718
|
} = cli.flags;
|
|
10706
|
-
const outputKind = utils.getOutputKind(json, markdown);
|
|
10707
10719
|
const [scanId = ''] = cli.input;
|
|
10708
|
-
const [orgSlug, defaultOrgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), !!interactive, !!dryRun);
|
|
10709
10720
|
const hasApiToken = utils.hasDefaultToken();
|
|
10721
|
+
const [orgSlug, defaultOrgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), !!interactive, !!dryRun);
|
|
10722
|
+
const outputKind = utils.getOutputKind(json, markdown);
|
|
10710
10723
|
const wasValidInput = utils.checkCommandInput(outputKind, {
|
|
10711
10724
|
nook: !!defaultOrgSlug,
|
|
10712
10725
|
test: !!orgSlug,
|
|
@@ -11005,9 +11018,9 @@ async function run$a(argv, importMeta, {
|
|
|
11005
11018
|
markdown,
|
|
11006
11019
|
org: orgFlag
|
|
11007
11020
|
} = cli.flags;
|
|
11008
|
-
const
|
|
11021
|
+
const hasApiToken = utils.hasDefaultToken();
|
|
11009
11022
|
let [id1 = '', id2 = ''] = cli.input;
|
|
11010
|
-
// Support dropping in full socket urls to an sbom
|
|
11023
|
+
// Support dropping in full socket urls to an sbom.
|
|
11011
11024
|
if (id1.startsWith(SOCKET_SBOM_URL_PREFIX)) {
|
|
11012
11025
|
id1 = id1.slice(SOCKET_SBOM_URL_PREFIX_LENGTH);
|
|
11013
11026
|
}
|
|
@@ -11015,7 +11028,7 @@ async function run$a(argv, importMeta, {
|
|
|
11015
11028
|
id2 = id2.slice(SOCKET_SBOM_URL_PREFIX_LENGTH);
|
|
11016
11029
|
}
|
|
11017
11030
|
const [orgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), !!interactive, !!dryRun);
|
|
11018
|
-
const
|
|
11031
|
+
const outputKind = utils.getOutputKind(json, markdown);
|
|
11019
11032
|
const wasValidInput = utils.checkCommandInput(outputKind, {
|
|
11020
11033
|
test: !!(id1 && id2),
|
|
11021
11034
|
message: 'Specify two Scan IDs.\nA Scan ID looks like `aaa0aa0a-aaaa-0000-0a0a-0000000a00a0`.',
|
|
@@ -12102,12 +12115,12 @@ async function run$8(argv, importMeta, {
|
|
|
12102
12115
|
markdown,
|
|
12103
12116
|
org: orgFlag
|
|
12104
12117
|
} = cli.flags;
|
|
12105
|
-
const outputKind = utils.getOutputKind(json, markdown);
|
|
12106
12118
|
const [repo = '', branchArg = ''] = cli.input;
|
|
12107
12119
|
const branch = String(branchFlag || branchArg || '');
|
|
12108
|
-
const [orgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), !!interactive, !!dryRun);
|
|
12109
12120
|
const hasApiToken = utils.hasDefaultToken();
|
|
12110
12121
|
const noLegacy = !cli.flags['repo'];
|
|
12122
|
+
const [orgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), !!interactive, !!dryRun);
|
|
12123
|
+
const outputKind = utils.getOutputKind(json, markdown);
|
|
12111
12124
|
const wasValidInput = utils.checkCommandInput(outputKind, {
|
|
12112
12125
|
nook: true,
|
|
12113
12126
|
test: noLegacy,
|
|
@@ -12259,10 +12272,10 @@ async function run$7(argv, importMeta, {
|
|
|
12259
12272
|
markdown,
|
|
12260
12273
|
org: orgFlag
|
|
12261
12274
|
} = cli.flags;
|
|
12262
|
-
const outputKind = utils.getOutputKind(json, markdown);
|
|
12263
12275
|
const [scanId = ''] = cli.input;
|
|
12264
|
-
const [orgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), !!interactive, !!dryRun);
|
|
12265
12276
|
const hasApiToken = utils.hasDefaultToken();
|
|
12277
|
+
const [orgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), !!interactive, !!dryRun);
|
|
12278
|
+
const outputKind = utils.getOutputKind(json, markdown);
|
|
12266
12279
|
const wasValidInput = utils.checkCommandInput(outputKind, {
|
|
12267
12280
|
nook: true,
|
|
12268
12281
|
test: !!orgSlug,
|
|
@@ -12316,13 +12329,17 @@ async function outputScanReach(result, outputKind) {
|
|
|
12316
12329
|
const {
|
|
12317
12330
|
DOT_SOCKET_DOT_FACTS_JSON
|
|
12318
12331
|
} = constants;
|
|
12319
|
-
async function handleScanReach(
|
|
12332
|
+
async function handleScanReach({
|
|
12333
|
+
cwd,
|
|
12334
|
+
outputKind,
|
|
12335
|
+
unknownFlags
|
|
12336
|
+
}) {
|
|
12320
12337
|
// Lazily access constants.spinner.
|
|
12321
12338
|
const {
|
|
12322
12339
|
spinner
|
|
12323
12340
|
} = constants;
|
|
12324
12341
|
spinner.start('Running reachability scan...');
|
|
12325
|
-
const result = await utils.spawnCoana(['run', cwd, '--output-dir', cwd, '--socket-mode', DOT_SOCKET_DOT_FACTS_JSON, '--disable-report-submission', ...
|
|
12342
|
+
const result = await utils.spawnCoana(['run', cwd, '--output-dir', cwd, '--socket-mode', DOT_SOCKET_DOT_FACTS_JSON, '--disable-report-submission', ...unknownFlags], {
|
|
12326
12343
|
cwd,
|
|
12327
12344
|
spinner
|
|
12328
12345
|
});
|
|
@@ -12373,10 +12390,6 @@ async function run$6(argv, importMeta, {
|
|
|
12373
12390
|
markdown
|
|
12374
12391
|
} = cli.flags;
|
|
12375
12392
|
const outputKind = utils.getOutputKind(json, markdown);
|
|
12376
|
-
let [cwd = '.'] = cli.input;
|
|
12377
|
-
// Note: path.resolve vs .join:
|
|
12378
|
-
// If given path is absolute then cwd should not affect it.
|
|
12379
|
-
cwd = path.resolve(process.cwd(), cwd);
|
|
12380
12393
|
const wasValidInput = utils.checkCommandInput(outputKind);
|
|
12381
12394
|
if (!wasValidInput) {
|
|
12382
12395
|
return;
|
|
@@ -12385,7 +12398,18 @@ async function run$6(argv, importMeta, {
|
|
|
12385
12398
|
logger.logger.log(DRY_RUN_BAILING_NOW$6);
|
|
12386
12399
|
return;
|
|
12387
12400
|
}
|
|
12388
|
-
|
|
12401
|
+
const {
|
|
12402
|
+
unknownFlags
|
|
12403
|
+
} = cli;
|
|
12404
|
+
let [cwd = '.'] = cli.input;
|
|
12405
|
+
// Note: path.resolve vs .join:
|
|
12406
|
+
// If given path is absolute then cwd should not affect it.
|
|
12407
|
+
cwd = path.resolve(process.cwd(), cwd);
|
|
12408
|
+
await handleScanReach({
|
|
12409
|
+
cwd,
|
|
12410
|
+
outputKind,
|
|
12411
|
+
unknownFlags
|
|
12412
|
+
});
|
|
12389
12413
|
}
|
|
12390
12414
|
|
|
12391
12415
|
const {
|
|
@@ -12493,10 +12517,10 @@ async function run$5(argv, importMeta, {
|
|
|
12493
12517
|
org: orgFlag,
|
|
12494
12518
|
reportLevel = 'warn'
|
|
12495
12519
|
} = cli.flags;
|
|
12496
|
-
const outputKind = utils.getOutputKind(json, markdown);
|
|
12497
12520
|
const [scanId = '', file = ''] = cli.input;
|
|
12498
|
-
const [orgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), !!interactive, !!dryRun);
|
|
12499
12521
|
const hasApiToken = utils.hasDefaultToken();
|
|
12522
|
+
const [orgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), !!interactive, !!dryRun);
|
|
12523
|
+
const outputKind = utils.getOutputKind(json, markdown);
|
|
12500
12524
|
const wasValidInput = utils.checkCommandInput(outputKind, {
|
|
12501
12525
|
nook: true,
|
|
12502
12526
|
test: !!orgSlug,
|
|
@@ -13087,10 +13111,10 @@ async function run$3(argv, importMeta, {
|
|
|
13087
13111
|
org: orgFlag,
|
|
13088
13112
|
stream
|
|
13089
13113
|
} = cli.flags;
|
|
13090
|
-
const outputKind = utils.getOutputKind(json, markdown);
|
|
13091
13114
|
const [scanId = '', file = ''] = cli.input;
|
|
13092
|
-
const [orgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), !!interactive, !!dryRun);
|
|
13093
13115
|
const hasApiToken = utils.hasDefaultToken();
|
|
13116
|
+
const [orgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), !!interactive, !!dryRun);
|
|
13117
|
+
const outputKind = utils.getOutputKind(json, markdown);
|
|
13094
13118
|
const wasValidInput = utils.checkCommandInput(outputKind, {
|
|
13095
13119
|
nook: true,
|
|
13096
13120
|
test: !!orgSlug,
|
|
@@ -13491,12 +13515,11 @@ async function run$2(argv, importMeta, {
|
|
|
13491
13515
|
type: typef,
|
|
13492
13516
|
version
|
|
13493
13517
|
} = cli.flags;
|
|
13494
|
-
const outputKind = utils.getOutputKind(json, markdown);
|
|
13495
|
-
const argSet = new Set(cli.input);
|
|
13496
13518
|
let ecoFilter = String(eco || '');
|
|
13497
13519
|
let versionFilter = String(version || '');
|
|
13498
13520
|
let typeFilter = String(typef || '');
|
|
13499
13521
|
let nameFilter = String(pkg || '');
|
|
13522
|
+
const argSet = new Set(cli.input);
|
|
13500
13523
|
cli.input.some(str => {
|
|
13501
13524
|
if (ECOSYSTEMS.has(str)) {
|
|
13502
13525
|
ecoFilter = str;
|
|
@@ -13529,8 +13552,9 @@ async function run$2(argv, importMeta, {
|
|
|
13529
13552
|
if (argSet.size) {
|
|
13530
13553
|
logger.logger.info(`Warning: ignoring these excessive args: ${Array.from(argSet).join(', ')}`);
|
|
13531
13554
|
}
|
|
13532
|
-
const [orgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), !!interactive, !!dryRun);
|
|
13533
13555
|
const hasApiToken = utils.hasDefaultToken();
|
|
13556
|
+
const [orgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), !!interactive, !!dryRun);
|
|
13557
|
+
const outputKind = utils.getOutputKind(json, markdown);
|
|
13534
13558
|
const wasValidInput = utils.checkCommandInput(outputKind, {
|
|
13535
13559
|
nook: true,
|
|
13536
13560
|
test: !!orgSlug,
|
|
@@ -13965,14 +13989,18 @@ const __filename$1 = require$$0.fileURLToPath((typeof document === 'undefined' ?
|
|
|
13965
13989
|
const {
|
|
13966
13990
|
SOCKET_CLI_BIN_NAME
|
|
13967
13991
|
} = constants;
|
|
13968
|
-
|
|
13969
|
-
// TODO: Add autocompletion using https://socket.dev/npm/package/omelette
|
|
13970
13992
|
void (async () => {
|
|
13993
|
+
const registryUrl = vendor.registryUrl();
|
|
13971
13994
|
await vendor.updater({
|
|
13995
|
+
authInfo: vendor.registryAuthTokenExports(registryUrl, {
|
|
13996
|
+
recursive: true
|
|
13997
|
+
}),
|
|
13972
13998
|
name: SOCKET_CLI_BIN_NAME,
|
|
13999
|
+
registryUrl,
|
|
14000
|
+
ttl: 86_400_000 /* 24 hours in milliseconds */,
|
|
14001
|
+
|
|
13973
14002
|
// Lazily access constants.ENV.INLINED_SOCKET_CLI_VERSION.
|
|
13974
|
-
version: constants.ENV.INLINED_SOCKET_CLI_VERSION
|
|
13975
|
-
ttl: 86_400_000 /* 24 hours in milliseconds */
|
|
14003
|
+
version: constants.ENV.INLINED_SOCKET_CLI_VERSION
|
|
13976
14004
|
});
|
|
13977
14005
|
try {
|
|
13978
14006
|
await utils.meowWithSubcommands({
|
|
@@ -14103,18 +14131,16 @@ void (async () => {
|
|
|
14103
14131
|
debug.debugFn('Uncaught error (BAD!):');
|
|
14104
14132
|
debug.debugFn(e);
|
|
14105
14133
|
|
|
14106
|
-
// Try to parse the flags, find out if --json or --markdown is set
|
|
14134
|
+
// Try to parse the flags, find out if --json or --markdown is set.
|
|
14107
14135
|
let isJson = false;
|
|
14108
14136
|
try {
|
|
14109
14137
|
const cli = vendor.meow(``, {
|
|
14110
14138
|
argv: process.argv.slice(2),
|
|
14139
|
+
autoHelp: false,
|
|
14140
|
+
flags: {},
|
|
14111
14141
|
importMeta: {
|
|
14112
14142
|
url: `${require$$0.pathToFileURL(__filename$1)}`
|
|
14113
|
-
}
|
|
14114
|
-
flags: {},
|
|
14115
|
-
// Do not strictly check for flags here.
|
|
14116
|
-
allowUnknownFlags: true,
|
|
14117
|
-
autoHelp: false
|
|
14143
|
+
}
|
|
14118
14144
|
});
|
|
14119
14145
|
isJson = !!cli.flags['json'];
|
|
14120
14146
|
} catch {}
|
|
@@ -14152,5 +14178,5 @@ void (async () => {
|
|
|
14152
14178
|
await utils.captureException(e);
|
|
14153
14179
|
}
|
|
14154
14180
|
})();
|
|
14155
|
-
//# debugId=
|
|
14181
|
+
//# debugId=3540e251-1510-40db-8d43-e0489ddabe14
|
|
14156
14182
|
//# sourceMappingURL=cli.js.map
|