@socketsecurity/cli-with-sentry 1.0.8 → 1.0.10
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 +130 -115
- package/dist/cli.js.map +1 -1
- package/dist/constants.js +3 -3
- package/dist/constants.js.map +1 -1
- package/dist/shadow-npm-bin.js +4 -3
- package/dist/shadow-npm-bin.js.map +1 -1
- 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/git.d.mts.map +1 -1
- package/dist/types/commands/fix/handle-fix.d.mts +3 -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/optimize/ls-by-agent.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/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/shadow/npm/bin.d.mts.map +1 -1
- package/dist/types/utils/coana.d.mts.map +1 -1
- package/dist/types/utils/meow-with-subcommands.d.mts +1 -2
- 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 +9 -9
- package/dist/utils.js.map +1 -1
- package/dist/vendor.js +3329 -906
- package/external/@socketsecurity/registry/external/@inquirer/confirm.js +60 -21
- package/external/@socketsecurity/registry/external/@inquirer/input.js +60 -21
- package/external/@socketsecurity/registry/external/@inquirer/password.js +60 -21
- package/external/@socketsecurity/registry/external/@inquirer/search.js +61 -22
- package/external/@socketsecurity/registry/external/@inquirer/select.js +61 -22
- package/external/@socketsecurity/registry/external/ansi-regex.js +13 -0
- package/external/@socketsecurity/registry/external/libnpmpack.js +137 -146
- package/external/@socketsecurity/registry/external/make-fetch-happen.js +85 -94
- package/external/@socketsecurity/registry/external/normalize-package-data.js +17 -404
- package/external/@socketsecurity/registry/external/pacote.js +124 -133
- package/external/@socketsecurity/registry/lib/strings.js +16 -0
- package/external/blessed-contrib/lib/widget/table.js +47 -12
- package/package.json +10 -7
- 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/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,
|
|
@@ -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',
|
|
@@ -3010,9 +3010,9 @@ async function getBaseGitBranch(cwd = process.cwd()) {
|
|
|
3010
3010
|
// 3. Try to resolve the default remote branch using 'git remote show origin'.
|
|
3011
3011
|
// This handles detached HEADs or workflows triggered by tags/releases.
|
|
3012
3012
|
try {
|
|
3013
|
-
const stdout = (await spawn.spawn('git', ['remote', 'show', 'origin'], {
|
|
3013
|
+
const stdout = strings.stripAnsi((await spawn.spawn('git', ['remote', 'show', 'origin'], {
|
|
3014
3014
|
cwd
|
|
3015
|
-
})).stdout.trim();
|
|
3015
|
+
})).stdout.trim());
|
|
3016
3016
|
const match = /(?<=HEAD branch: ).+/.exec(stdout);
|
|
3017
3017
|
if (match?.[0]) {
|
|
3018
3018
|
return match[0].trim();
|
|
@@ -3122,9 +3122,9 @@ async function gitCreateAndPushBranch(branch, commitMsg, filepaths, options) {
|
|
|
3122
3122
|
}
|
|
3123
3123
|
async function gitRepoInfo(cwd = process.cwd()) {
|
|
3124
3124
|
try {
|
|
3125
|
-
const remoteUrl = (await spawn.spawn('git', ['remote', 'get-url', 'origin'], {
|
|
3125
|
+
const remoteUrl = strings.stripAnsi((await spawn.spawn('git', ['remote', 'get-url', 'origin'], {
|
|
3126
3126
|
cwd
|
|
3127
|
-
})).stdout.trim();
|
|
3127
|
+
})).stdout.trim());
|
|
3128
3128
|
// 1. Handle SSH-style, e.g. git@github.com:owner/repo.git
|
|
3129
3129
|
const sshMatch = /^git@[^:]+:([^/]+)\/(.+?)(?:\.git)?$/.exec(remoteUrl);
|
|
3130
3130
|
if (sshMatch) {
|
|
@@ -3168,7 +3168,7 @@ async function gitEnsureIdentity(name, email, cwd = process.cwd()) {
|
|
|
3168
3168
|
let configValue;
|
|
3169
3169
|
try {
|
|
3170
3170
|
// Will throw with exit code 1 if the config property is not set.
|
|
3171
|
-
configValue = (await spawn.spawn('git', ['config', '--get', prop], stdioPipeOptions)).stdout.trim();
|
|
3171
|
+
configValue = strings.stripAnsi((await spawn.spawn('git', ['config', '--get', prop], stdioPipeOptions)).stdout.trim());
|
|
3172
3172
|
} catch {}
|
|
3173
3173
|
if (configValue !== value) {
|
|
3174
3174
|
try {
|
|
@@ -3184,7 +3184,7 @@ async function gitRemoteBranchExists(branch, cwd = process.cwd()) {
|
|
|
3184
3184
|
cwd
|
|
3185
3185
|
};
|
|
3186
3186
|
try {
|
|
3187
|
-
return (await spawn.spawn('git', ['ls-remote', '--heads', 'origin', branch], stdioPipeOptions)).stdout.trim().length > 0;
|
|
3187
|
+
return strings.stripAnsi((await spawn.spawn('git', ['ls-remote', '--heads', 'origin', branch], stdioPipeOptions)).stdout.trim()).length > 0;
|
|
3188
3188
|
} catch {
|
|
3189
3189
|
return false;
|
|
3190
3190
|
}
|
|
@@ -3207,7 +3207,7 @@ async function gitUnstagedModifiedFiles(cwd = process.cwd()) {
|
|
|
3207
3207
|
const stdioPipeOptions = {
|
|
3208
3208
|
cwd
|
|
3209
3209
|
};
|
|
3210
|
-
const stdout = (await spawn.spawn('git', ['diff', '--name-only'], stdioPipeOptions)).stdout.trim();
|
|
3210
|
+
const stdout = strings.stripAnsi((await spawn.spawn('git', ['diff', '--name-only'], stdioPipeOptions)).stdout.trim());
|
|
3211
3211
|
const rawFiles = stdout.split('\n') ?? [];
|
|
3212
3212
|
return {
|
|
3213
3213
|
ok: true,
|
|
@@ -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,7 +3938,7 @@ 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
|
|
@@ -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,7 +4485,7 @@ 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 {
|
|
@@ -4502,25 +4500,22 @@ async function handleFix({
|
|
|
4502
4500
|
outputKind,
|
|
4503
4501
|
purls,
|
|
4504
4502
|
rangeStyle,
|
|
4503
|
+
spinner,
|
|
4505
4504
|
test,
|
|
4506
4505
|
testScript,
|
|
4507
4506
|
unknownFlags
|
|
4508
4507
|
}) {
|
|
4509
|
-
// Lazily access constants.spinner.
|
|
4510
|
-
const {
|
|
4511
|
-
spinner
|
|
4512
|
-
} = constants;
|
|
4513
4508
|
let {
|
|
4514
4509
|
length: ghsasCount
|
|
4515
4510
|
} = ghsas;
|
|
4516
4511
|
if (ghsasCount) {
|
|
4517
|
-
spinner
|
|
4512
|
+
spinner?.start('Fetching GHSA IDs...');
|
|
4518
4513
|
if (ghsasCount === 1 && ghsas[0] === 'auto') {
|
|
4519
4514
|
const autoCResult = await utils.spawnCoana(['compute-fixes-and-upgrade-purls', cwd], {
|
|
4520
4515
|
cwd,
|
|
4521
4516
|
spinner
|
|
4522
4517
|
});
|
|
4523
|
-
spinner
|
|
4518
|
+
spinner?.stop();
|
|
4524
4519
|
if (autoCResult.ok) {
|
|
4525
4520
|
ghsas = utils.cmdFlagValueToArray(/(?<=Vulnerabilities found: )[^\n]+/.exec(autoCResult.data)?.[0]);
|
|
4526
4521
|
ghsasCount = ghsas.length;
|
|
@@ -4532,15 +4527,15 @@ async function handleFix({
|
|
|
4532
4527
|
ghsas = [];
|
|
4533
4528
|
ghsasCount = 0;
|
|
4534
4529
|
}
|
|
4535
|
-
spinner
|
|
4530
|
+
spinner?.start();
|
|
4536
4531
|
}
|
|
4537
4532
|
if (ghsasCount) {
|
|
4538
|
-
spinner
|
|
4533
|
+
spinner?.info(`Found ${ghsasCount} GHSA ${words.pluralize('ID', ghsasCount)}.`);
|
|
4539
4534
|
const applyFixesCResult = await utils.spawnCoana(['compute-fixes-and-upgrade-purls', cwd, '--apply-fixes-to', ...ghsas, ...unknownFlags], {
|
|
4540
4535
|
cwd,
|
|
4541
4536
|
spinner
|
|
4542
4537
|
});
|
|
4543
|
-
spinner
|
|
4538
|
+
spinner?.stop();
|
|
4544
4539
|
if (!applyFixesCResult.ok) {
|
|
4545
4540
|
debug.debugFn('coana fail:', {
|
|
4546
4541
|
message: applyFixesCResult.message,
|
|
@@ -4550,7 +4545,7 @@ async function handleFix({
|
|
|
4550
4545
|
await outputFixResult(applyFixesCResult, outputKind);
|
|
4551
4546
|
return;
|
|
4552
4547
|
}
|
|
4553
|
-
spinner
|
|
4548
|
+
spinner?.infoAndStop('No GHSA IDs found.');
|
|
4554
4549
|
await outputFixResult({
|
|
4555
4550
|
ok: true,
|
|
4556
4551
|
data: ''
|
|
@@ -4584,7 +4579,7 @@ async function handleFix({
|
|
|
4584
4579
|
await outputFixResult({
|
|
4585
4580
|
ok: false,
|
|
4586
4581
|
message: 'Not supported.',
|
|
4587
|
-
cause: `${agent} is not supported by this command
|
|
4582
|
+
cause: `${agent} is not supported by this command.`
|
|
4588
4583
|
}, outputKind);
|
|
4589
4584
|
return;
|
|
4590
4585
|
}
|
|
@@ -4714,6 +4709,14 @@ async function run$H(argv, importMeta, {
|
|
|
4714
4709
|
logger.logger.log(DRY_RUN_NOT_SAVING);
|
|
4715
4710
|
return;
|
|
4716
4711
|
}
|
|
4712
|
+
|
|
4713
|
+
// Lazily access constants.spinner.
|
|
4714
|
+
const {
|
|
4715
|
+
spinner
|
|
4716
|
+
} = constants;
|
|
4717
|
+
const {
|
|
4718
|
+
unknownFlags
|
|
4719
|
+
} = cli;
|
|
4717
4720
|
let [cwd = '.'] = cli.input;
|
|
4718
4721
|
// Note: path.resolve vs .join:
|
|
4719
4722
|
// If given path is absolute then cwd should not affect it.
|
|
@@ -4728,9 +4731,6 @@ async function run$H(argv, importMeta, {
|
|
|
4728
4731
|
const limit = (cli.flags['limit'] ? parseInt(String(cli.flags['limit'] || ''), 10) : Infinity) || Infinity;
|
|
4729
4732
|
const purls = utils.cmdFlagValueToArray(cli.flags['purl']);
|
|
4730
4733
|
const testScript = String(cli.flags['testScript'] || 'test');
|
|
4731
|
-
const {
|
|
4732
|
-
unknownFlags
|
|
4733
|
-
} = cli;
|
|
4734
4734
|
await handleFix({
|
|
4735
4735
|
autoMerge,
|
|
4736
4736
|
cwd,
|
|
@@ -4739,6 +4739,7 @@ async function run$H(argv, importMeta, {
|
|
|
4739
4739
|
outputKind,
|
|
4740
4740
|
purls,
|
|
4741
4741
|
rangeStyle,
|
|
4742
|
+
spinner,
|
|
4742
4743
|
test,
|
|
4743
4744
|
testScript,
|
|
4744
4745
|
unknownFlags
|
|
@@ -7162,11 +7163,11 @@ function parsableToQueryStdout(stdout) {
|
|
|
7162
7163
|
async function npmQuery(npmExecPath, cwd) {
|
|
7163
7164
|
let stdout = '';
|
|
7164
7165
|
try {
|
|
7165
|
-
stdout = (await spawn.spawn(npmExecPath, ['query', ':not(.dev)'], {
|
|
7166
|
+
stdout = strings.stripAnsi((await spawn.spawn(npmExecPath, ['query', ':not(.dev)'], {
|
|
7166
7167
|
cwd,
|
|
7167
7168
|
// Lazily access constants.WIN32.
|
|
7168
7169
|
shell: constants.WIN32
|
|
7169
|
-
})).stdout.trim();
|
|
7170
|
+
})).stdout.trim());
|
|
7170
7171
|
} catch {}
|
|
7171
7172
|
return cleanupQueryStdout(stdout);
|
|
7172
7173
|
}
|
|
@@ -7174,11 +7175,11 @@ async function lsBun(pkgEnvDetails, cwd) {
|
|
|
7174
7175
|
try {
|
|
7175
7176
|
// Bun does not support filtering by production packages yet.
|
|
7176
7177
|
// https://github.com/oven-sh/bun/issues/8283
|
|
7177
|
-
return (await spawn.spawn(pkgEnvDetails.agentExecPath, ['pm', 'ls', '--all'], {
|
|
7178
|
+
return strings.stripAnsi((await spawn.spawn(pkgEnvDetails.agentExecPath, ['pm', 'ls', '--all'], {
|
|
7178
7179
|
cwd,
|
|
7179
7180
|
// Lazily access constants.WIN32.
|
|
7180
7181
|
shell: constants.WIN32
|
|
7181
|
-
})).stdout.trim();
|
|
7182
|
+
})).stdout.trim());
|
|
7182
7183
|
} catch {}
|
|
7183
7184
|
return '';
|
|
7184
7185
|
}
|
|
@@ -7195,14 +7196,14 @@ async function lsPnpm(pkgEnvDetails, cwd, options) {
|
|
|
7195
7196
|
}
|
|
7196
7197
|
let stdout = '';
|
|
7197
7198
|
try {
|
|
7198
|
-
stdout = (await spawn.spawn(pkgEnvDetails.agentExecPath,
|
|
7199
|
+
stdout = strings.stripAnsi((await spawn.spawn(pkgEnvDetails.agentExecPath,
|
|
7199
7200
|
// Pnpm uses the alternative spelling of parsable.
|
|
7200
7201
|
// https://en.wiktionary.org/wiki/parsable
|
|
7201
7202
|
['ls', '--parseable', '--prod', '--depth', 'Infinity'], {
|
|
7202
7203
|
cwd,
|
|
7203
7204
|
// Lazily access constants.WIN32.
|
|
7204
7205
|
shell: constants.WIN32
|
|
7205
|
-
})).stdout.trim();
|
|
7206
|
+
})).stdout.trim());
|
|
7206
7207
|
} catch {}
|
|
7207
7208
|
return parsableToQueryStdout(stdout);
|
|
7208
7209
|
}
|
|
@@ -7210,25 +7211,24 @@ async function lsVlt(pkgEnvDetails, cwd) {
|
|
|
7210
7211
|
let stdout = '';
|
|
7211
7212
|
try {
|
|
7212
7213
|
// See https://docs.vlt.sh/cli/commands/list#options.
|
|
7213
|
-
stdout = (await spawn.spawn(pkgEnvDetails.agentExecPath, ['ls', '--view', 'human', ':not(.dev)'], {
|
|
7214
|
+
stdout = strings.stripAnsi((await spawn.spawn(pkgEnvDetails.agentExecPath, ['ls', '--view', 'human', ':not(.dev)'], {
|
|
7214
7215
|
cwd,
|
|
7215
7216
|
// Lazily access constants.WIN32.
|
|
7216
7217
|
shell: constants.WIN32
|
|
7217
|
-
})).stdout.trim();
|
|
7218
|
+
})).stdout.trim());
|
|
7218
7219
|
} catch {}
|
|
7219
7220
|
return cleanupQueryStdout(stdout);
|
|
7220
7221
|
}
|
|
7221
7222
|
async function lsYarnBerry(pkgEnvDetails, cwd) {
|
|
7222
7223
|
try {
|
|
7223
|
-
return (
|
|
7224
|
-
|
|
7225
|
-
|
|
7226
|
-
|
|
7227
|
-
|
|
7228
|
-
|
|
7229
|
-
|
|
7230
|
-
|
|
7231
|
-
);
|
|
7224
|
+
return strings.stripAnsi(
|
|
7225
|
+
// Yarn Berry does not support filtering by production packages yet.
|
|
7226
|
+
// https://github.com/yarnpkg/berry/issues/5117
|
|
7227
|
+
(await spawn.spawn(pkgEnvDetails.agentExecPath, ['info', '--recursive', '--name-only'], {
|
|
7228
|
+
cwd,
|
|
7229
|
+
// Lazily access constants.WIN32.
|
|
7230
|
+
shell: constants.WIN32
|
|
7231
|
+
})).stdout.trim());
|
|
7232
7232
|
} catch {}
|
|
7233
7233
|
return '';
|
|
7234
7234
|
}
|
|
@@ -7238,11 +7238,11 @@ async function lsYarnClassic(pkgEnvDetails, cwd) {
|
|
|
7238
7238
|
// https://github.com/yarnpkg/yarn/releases/tag/v1.0.0
|
|
7239
7239
|
// > Fix: Excludes dev dependencies from the yarn list output when the
|
|
7240
7240
|
// environment is production
|
|
7241
|
-
return (await spawn.spawn(pkgEnvDetails.agentExecPath, ['list', '--prod'], {
|
|
7241
|
+
return strings.stripAnsi((await spawn.spawn(pkgEnvDetails.agentExecPath, ['list', '--prod'], {
|
|
7242
7242
|
cwd,
|
|
7243
7243
|
// Lazily access constants.WIN32.
|
|
7244
7244
|
shell: constants.WIN32
|
|
7245
|
-
})).stdout.trim();
|
|
7245
|
+
})).stdout.trim());
|
|
7246
7246
|
} catch {}
|
|
7247
7247
|
return '';
|
|
7248
7248
|
}
|
|
@@ -7910,8 +7910,8 @@ async function run$q(argv, importMeta, {
|
|
|
7910
7910
|
markdown,
|
|
7911
7911
|
offset
|
|
7912
7912
|
} = cli.flags;
|
|
7913
|
-
const outputKind = utils.getOutputKind(json, markdown);
|
|
7914
7913
|
const hasApiToken = utils.hasDefaultToken();
|
|
7914
|
+
const outputKind = utils.getOutputKind(json, markdown);
|
|
7915
7915
|
const wasValidInput = utils.checkCommandInput(outputKind, {
|
|
7916
7916
|
nook: true,
|
|
7917
7917
|
test: !json || !markdown,
|
|
@@ -8038,9 +8038,9 @@ async function run$p(argv, importMeta, {
|
|
|
8038
8038
|
markdown,
|
|
8039
8039
|
org: orgFlag
|
|
8040
8040
|
} = cli.flags;
|
|
8041
|
-
const outputKind = utils.getOutputKind(json, markdown);
|
|
8042
|
-
const [orgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), !!interactive, !!dryRun);
|
|
8043
8041
|
const hasApiToken = utils.hasDefaultToken();
|
|
8042
|
+
const [orgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), !!interactive, !!dryRun);
|
|
8043
|
+
const outputKind = utils.getOutputKind(json, markdown);
|
|
8044
8044
|
const wasValidInput = utils.checkCommandInput(outputKind, {
|
|
8045
8045
|
nook: true,
|
|
8046
8046
|
test: !json || !markdown,
|
|
@@ -8166,9 +8166,9 @@ async function run$o(argv, importMeta, {
|
|
|
8166
8166
|
markdown,
|
|
8167
8167
|
org: orgFlag
|
|
8168
8168
|
} = cli.flags;
|
|
8169
|
-
const outputKind = utils.getOutputKind(json, markdown);
|
|
8170
|
-
const [orgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), !!interactive, !!dryRun);
|
|
8171
8169
|
const hasApiToken = utils.hasDefaultToken();
|
|
8170
|
+
const [orgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), !!interactive, !!dryRun);
|
|
8171
|
+
const outputKind = utils.getOutputKind(json, markdown);
|
|
8172
8172
|
const wasValidInput = utils.checkCommandInput(outputKind, {
|
|
8173
8173
|
nook: true,
|
|
8174
8174
|
test: !json || !markdown,
|
|
@@ -8301,8 +8301,8 @@ async function run$n(argv, importMeta, {
|
|
|
8301
8301
|
json,
|
|
8302
8302
|
markdown
|
|
8303
8303
|
} = cli.flags;
|
|
8304
|
-
const outputKind = utils.getOutputKind(json, markdown);
|
|
8305
8304
|
const hasApiToken = utils.hasDefaultToken();
|
|
8305
|
+
const outputKind = utils.getOutputKind(json, markdown);
|
|
8306
8306
|
const wasValidInput = utils.checkCommandInput(outputKind, {
|
|
8307
8307
|
nook: true,
|
|
8308
8308
|
test: !json || !markdown,
|
|
@@ -8425,10 +8425,10 @@ async function run$m(argv, importMeta, {
|
|
|
8425
8425
|
importMeta,
|
|
8426
8426
|
parentName
|
|
8427
8427
|
});
|
|
8428
|
+
const hasApiToken = utils.hasDefaultToken();
|
|
8428
8429
|
const json = Boolean(cli.flags['json']);
|
|
8429
8430
|
const markdown = Boolean(cli.flags['markdown']);
|
|
8430
8431
|
const outputKind = utils.getOutputKind(json, markdown);
|
|
8431
|
-
const hasApiToken = utils.hasDefaultToken();
|
|
8432
8432
|
const wasValidInput = utils.checkCommandInput(outputKind, {
|
|
8433
8433
|
nook: true,
|
|
8434
8434
|
test: !json || !markdown,
|
|
@@ -8776,9 +8776,9 @@ async function run$l(argv, importMeta, {
|
|
|
8776
8776
|
json,
|
|
8777
8777
|
markdown
|
|
8778
8778
|
} = cli.flags;
|
|
8779
|
-
const outputKind = utils.getOutputKind(json, markdown);
|
|
8780
8779
|
const [ecosystem = '', purl] = cli.input;
|
|
8781
8780
|
const hasApiToken = utils.hasDefaultToken();
|
|
8781
|
+
const outputKind = utils.getOutputKind(json, markdown);
|
|
8782
8782
|
const {
|
|
8783
8783
|
purls,
|
|
8784
8784
|
valid
|
|
@@ -9463,11 +9463,11 @@ async function run$h(argv, importMeta, {
|
|
|
9463
9463
|
markdown,
|
|
9464
9464
|
org: orgFlag
|
|
9465
9465
|
} = cli.flags;
|
|
9466
|
-
const outputKind = utils.getOutputKind(json, markdown);
|
|
9467
9466
|
const [repoName = ''] = cli.input;
|
|
9468
|
-
const [orgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), !!interactive, !!dryRun);
|
|
9469
9467
|
const hasApiToken = utils.hasDefaultToken();
|
|
9470
9468
|
const noLegacy = !cli.flags['repoName'];
|
|
9469
|
+
const [orgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), !!interactive, !!dryRun);
|
|
9470
|
+
const outputKind = utils.getOutputKind(json, markdown);
|
|
9471
9471
|
const wasValidInput = utils.checkCommandInput(outputKind, {
|
|
9472
9472
|
nook: true,
|
|
9473
9473
|
test: !!orgSlug,
|
|
@@ -9875,9 +9875,9 @@ async function run$f(argv, importMeta, {
|
|
|
9875
9875
|
markdown,
|
|
9876
9876
|
org: orgFlag
|
|
9877
9877
|
} = cli.flags;
|
|
9878
|
-
const outputKind = utils.getOutputKind(json, markdown);
|
|
9879
|
-
const [orgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), !!interactive, !!dryRun);
|
|
9880
9878
|
const hasApiToken = utils.hasDefaultToken();
|
|
9879
|
+
const [orgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), !!interactive, !!dryRun);
|
|
9880
|
+
const outputKind = utils.getOutputKind(json, markdown);
|
|
9881
9881
|
const wasValidInput = utils.checkCommandInput(outputKind, {
|
|
9882
9882
|
nook: true,
|
|
9883
9883
|
test: !!orgSlug,
|
|
@@ -10059,11 +10059,11 @@ async function run$e(argv, importMeta, {
|
|
|
10059
10059
|
markdown,
|
|
10060
10060
|
org: orgFlag
|
|
10061
10061
|
} = cli.flags;
|
|
10062
|
-
const outputKind = utils.getOutputKind(json, markdown);
|
|
10063
10062
|
const [repoName = ''] = cli.input;
|
|
10064
|
-
const [orgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), !!interactive, !!dryRun);
|
|
10065
10063
|
const hasApiToken = utils.hasDefaultToken();
|
|
10066
10064
|
const noLegacy = !cli.flags['repoName'];
|
|
10065
|
+
const [orgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), !!interactive, !!dryRun);
|
|
10066
|
+
const outputKind = utils.getOutputKind(json, markdown);
|
|
10067
10067
|
const wasValidInput = utils.checkCommandInput(outputKind, {
|
|
10068
10068
|
nook: true,
|
|
10069
10069
|
test: noLegacy,
|
|
@@ -10216,11 +10216,11 @@ async function run$d(argv, importMeta, {
|
|
|
10216
10216
|
markdown,
|
|
10217
10217
|
org: orgFlag
|
|
10218
10218
|
} = cli.flags;
|
|
10219
|
-
const outputKind = utils.getOutputKind(json, markdown);
|
|
10220
10219
|
const [repoName = ''] = cli.input;
|
|
10221
|
-
const [orgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), !!interactive, !!dryRun);
|
|
10222
10220
|
const hasApiToken = utils.hasDefaultToken();
|
|
10223
10221
|
const noLegacy = !cli.flags['repoName'];
|
|
10222
|
+
const [orgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), !!interactive, !!dryRun);
|
|
10223
|
+
const outputKind = utils.getOutputKind(json, markdown);
|
|
10224
10224
|
const wasValidInput = utils.checkCommandInput(outputKind, {
|
|
10225
10225
|
nook: true,
|
|
10226
10226
|
test: noLegacy,
|
|
@@ -10473,8 +10473,6 @@ async function run$c(argv, importMeta, {
|
|
|
10473
10473
|
repo: repoName,
|
|
10474
10474
|
report
|
|
10475
10475
|
} = cli.flags;
|
|
10476
|
-
const outputKind = utils.getOutputKind(json, markdown);
|
|
10477
|
-
const pendingHead = tmp ? false : pendingHeadFlag;
|
|
10478
10476
|
let [orgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), interactive, dryRun);
|
|
10479
10477
|
|
|
10480
10478
|
// Accept zero or more paths. Default to cwd() if none given.
|
|
@@ -10520,6 +10518,8 @@ async function run$c(argv, importMeta, {
|
|
|
10520
10518
|
// must come from data we already know. Don't error on missing api token yet.
|
|
10521
10519
|
// If the api-token is not set, ignore it for the sake of suggestions.
|
|
10522
10520
|
const hasApiToken = utils.hasDefaultToken();
|
|
10521
|
+
const outputKind = utils.getOutputKind(json, markdown);
|
|
10522
|
+
const pendingHead = tmp ? false : pendingHeadFlag;
|
|
10523
10523
|
|
|
10524
10524
|
// If we updated any inputs then we should print the command line to repeat
|
|
10525
10525
|
// the command without requiring user input, as a suggestion.
|
|
@@ -10715,10 +10715,10 @@ async function run$b(argv, importMeta, {
|
|
|
10715
10715
|
markdown,
|
|
10716
10716
|
org: orgFlag
|
|
10717
10717
|
} = cli.flags;
|
|
10718
|
-
const outputKind = utils.getOutputKind(json, markdown);
|
|
10719
10718
|
const [scanId = ''] = cli.input;
|
|
10720
|
-
const [orgSlug, defaultOrgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), !!interactive, !!dryRun);
|
|
10721
10719
|
const hasApiToken = utils.hasDefaultToken();
|
|
10720
|
+
const [orgSlug, defaultOrgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), !!interactive, !!dryRun);
|
|
10721
|
+
const outputKind = utils.getOutputKind(json, markdown);
|
|
10722
10722
|
const wasValidInput = utils.checkCommandInput(outputKind, {
|
|
10723
10723
|
nook: !!defaultOrgSlug,
|
|
10724
10724
|
test: !!orgSlug,
|
|
@@ -11017,9 +11017,9 @@ async function run$a(argv, importMeta, {
|
|
|
11017
11017
|
markdown,
|
|
11018
11018
|
org: orgFlag
|
|
11019
11019
|
} = cli.flags;
|
|
11020
|
-
const
|
|
11020
|
+
const hasApiToken = utils.hasDefaultToken();
|
|
11021
11021
|
let [id1 = '', id2 = ''] = cli.input;
|
|
11022
|
-
// Support dropping in full socket urls to an sbom
|
|
11022
|
+
// Support dropping in full socket urls to an sbom.
|
|
11023
11023
|
if (id1.startsWith(SOCKET_SBOM_URL_PREFIX)) {
|
|
11024
11024
|
id1 = id1.slice(SOCKET_SBOM_URL_PREFIX_LENGTH);
|
|
11025
11025
|
}
|
|
@@ -11027,7 +11027,7 @@ async function run$a(argv, importMeta, {
|
|
|
11027
11027
|
id2 = id2.slice(SOCKET_SBOM_URL_PREFIX_LENGTH);
|
|
11028
11028
|
}
|
|
11029
11029
|
const [orgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), !!interactive, !!dryRun);
|
|
11030
|
-
const
|
|
11030
|
+
const outputKind = utils.getOutputKind(json, markdown);
|
|
11031
11031
|
const wasValidInput = utils.checkCommandInput(outputKind, {
|
|
11032
11032
|
test: !!(id1 && id2),
|
|
11033
11033
|
message: 'Specify two Scan IDs.\nA Scan ID looks like `aaa0aa0a-aaaa-0000-0a0a-0000000a00a0`.',
|
|
@@ -12114,12 +12114,12 @@ async function run$8(argv, importMeta, {
|
|
|
12114
12114
|
markdown,
|
|
12115
12115
|
org: orgFlag
|
|
12116
12116
|
} = cli.flags;
|
|
12117
|
-
const outputKind = utils.getOutputKind(json, markdown);
|
|
12118
12117
|
const [repo = '', branchArg = ''] = cli.input;
|
|
12119
12118
|
const branch = String(branchFlag || branchArg || '');
|
|
12120
|
-
const [orgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), !!interactive, !!dryRun);
|
|
12121
12119
|
const hasApiToken = utils.hasDefaultToken();
|
|
12122
12120
|
const noLegacy = !cli.flags['repo'];
|
|
12121
|
+
const [orgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), !!interactive, !!dryRun);
|
|
12122
|
+
const outputKind = utils.getOutputKind(json, markdown);
|
|
12123
12123
|
const wasValidInput = utils.checkCommandInput(outputKind, {
|
|
12124
12124
|
nook: true,
|
|
12125
12125
|
test: noLegacy,
|
|
@@ -12271,10 +12271,10 @@ async function run$7(argv, importMeta, {
|
|
|
12271
12271
|
markdown,
|
|
12272
12272
|
org: orgFlag
|
|
12273
12273
|
} = cli.flags;
|
|
12274
|
-
const outputKind = utils.getOutputKind(json, markdown);
|
|
12275
12274
|
const [scanId = ''] = cli.input;
|
|
12276
|
-
const [orgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), !!interactive, !!dryRun);
|
|
12277
12275
|
const hasApiToken = utils.hasDefaultToken();
|
|
12276
|
+
const [orgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), !!interactive, !!dryRun);
|
|
12277
|
+
const outputKind = utils.getOutputKind(json, markdown);
|
|
12278
12278
|
const wasValidInput = utils.checkCommandInput(outputKind, {
|
|
12279
12279
|
nook: true,
|
|
12280
12280
|
test: !!orgSlug,
|
|
@@ -12328,13 +12328,17 @@ async function outputScanReach(result, outputKind) {
|
|
|
12328
12328
|
const {
|
|
12329
12329
|
DOT_SOCKET_DOT_FACTS_JSON
|
|
12330
12330
|
} = constants;
|
|
12331
|
-
async function handleScanReach(
|
|
12331
|
+
async function handleScanReach({
|
|
12332
|
+
cwd,
|
|
12333
|
+
outputKind,
|
|
12334
|
+
unknownFlags
|
|
12335
|
+
}) {
|
|
12332
12336
|
// Lazily access constants.spinner.
|
|
12333
12337
|
const {
|
|
12334
12338
|
spinner
|
|
12335
12339
|
} = constants;
|
|
12336
12340
|
spinner.start('Running reachability scan...');
|
|
12337
|
-
const result = await utils.spawnCoana(['run', cwd, '--output-dir', cwd, '--socket-mode', DOT_SOCKET_DOT_FACTS_JSON, '--disable-report-submission', ...
|
|
12341
|
+
const result = await utils.spawnCoana(['run', cwd, '--output-dir', cwd, '--socket-mode', DOT_SOCKET_DOT_FACTS_JSON, '--disable-report-submission', ...unknownFlags], {
|
|
12338
12342
|
cwd,
|
|
12339
12343
|
spinner
|
|
12340
12344
|
});
|
|
@@ -12385,10 +12389,6 @@ async function run$6(argv, importMeta, {
|
|
|
12385
12389
|
markdown
|
|
12386
12390
|
} = cli.flags;
|
|
12387
12391
|
const outputKind = utils.getOutputKind(json, markdown);
|
|
12388
|
-
let [cwd = '.'] = cli.input;
|
|
12389
|
-
// Note: path.resolve vs .join:
|
|
12390
|
-
// If given path is absolute then cwd should not affect it.
|
|
12391
|
-
cwd = path.resolve(process.cwd(), cwd);
|
|
12392
12392
|
const wasValidInput = utils.checkCommandInput(outputKind);
|
|
12393
12393
|
if (!wasValidInput) {
|
|
12394
12394
|
return;
|
|
@@ -12397,7 +12397,18 @@ async function run$6(argv, importMeta, {
|
|
|
12397
12397
|
logger.logger.log(DRY_RUN_BAILING_NOW$6);
|
|
12398
12398
|
return;
|
|
12399
12399
|
}
|
|
12400
|
-
|
|
12400
|
+
const {
|
|
12401
|
+
unknownFlags
|
|
12402
|
+
} = cli;
|
|
12403
|
+
let [cwd = '.'] = cli.input;
|
|
12404
|
+
// Note: path.resolve vs .join:
|
|
12405
|
+
// If given path is absolute then cwd should not affect it.
|
|
12406
|
+
cwd = path.resolve(process.cwd(), cwd);
|
|
12407
|
+
await handleScanReach({
|
|
12408
|
+
cwd,
|
|
12409
|
+
outputKind,
|
|
12410
|
+
unknownFlags
|
|
12411
|
+
});
|
|
12401
12412
|
}
|
|
12402
12413
|
|
|
12403
12414
|
const {
|
|
@@ -12505,10 +12516,10 @@ async function run$5(argv, importMeta, {
|
|
|
12505
12516
|
org: orgFlag,
|
|
12506
12517
|
reportLevel = 'warn'
|
|
12507
12518
|
} = cli.flags;
|
|
12508
|
-
const outputKind = utils.getOutputKind(json, markdown);
|
|
12509
12519
|
const [scanId = '', file = ''] = cli.input;
|
|
12510
|
-
const [orgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), !!interactive, !!dryRun);
|
|
12511
12520
|
const hasApiToken = utils.hasDefaultToken();
|
|
12521
|
+
const [orgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), !!interactive, !!dryRun);
|
|
12522
|
+
const outputKind = utils.getOutputKind(json, markdown);
|
|
12512
12523
|
const wasValidInput = utils.checkCommandInput(outputKind, {
|
|
12513
12524
|
nook: true,
|
|
12514
12525
|
test: !!orgSlug,
|
|
@@ -13099,10 +13110,10 @@ async function run$3(argv, importMeta, {
|
|
|
13099
13110
|
org: orgFlag,
|
|
13100
13111
|
stream
|
|
13101
13112
|
} = cli.flags;
|
|
13102
|
-
const outputKind = utils.getOutputKind(json, markdown);
|
|
13103
13113
|
const [scanId = '', file = ''] = cli.input;
|
|
13104
|
-
const [orgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), !!interactive, !!dryRun);
|
|
13105
13114
|
const hasApiToken = utils.hasDefaultToken();
|
|
13115
|
+
const [orgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), !!interactive, !!dryRun);
|
|
13116
|
+
const outputKind = utils.getOutputKind(json, markdown);
|
|
13106
13117
|
const wasValidInput = utils.checkCommandInput(outputKind, {
|
|
13107
13118
|
nook: true,
|
|
13108
13119
|
test: !!orgSlug,
|
|
@@ -13503,12 +13514,11 @@ async function run$2(argv, importMeta, {
|
|
|
13503
13514
|
type: typef,
|
|
13504
13515
|
version
|
|
13505
13516
|
} = cli.flags;
|
|
13506
|
-
const outputKind = utils.getOutputKind(json, markdown);
|
|
13507
|
-
const argSet = new Set(cli.input);
|
|
13508
13517
|
let ecoFilter = String(eco || '');
|
|
13509
13518
|
let versionFilter = String(version || '');
|
|
13510
13519
|
let typeFilter = String(typef || '');
|
|
13511
13520
|
let nameFilter = String(pkg || '');
|
|
13521
|
+
const argSet = new Set(cli.input);
|
|
13512
13522
|
cli.input.some(str => {
|
|
13513
13523
|
if (ECOSYSTEMS.has(str)) {
|
|
13514
13524
|
ecoFilter = str;
|
|
@@ -13541,8 +13551,9 @@ async function run$2(argv, importMeta, {
|
|
|
13541
13551
|
if (argSet.size) {
|
|
13542
13552
|
logger.logger.info(`Warning: ignoring these excessive args: ${Array.from(argSet).join(', ')}`);
|
|
13543
13553
|
}
|
|
13544
|
-
const [orgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), !!interactive, !!dryRun);
|
|
13545
13554
|
const hasApiToken = utils.hasDefaultToken();
|
|
13555
|
+
const [orgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), !!interactive, !!dryRun);
|
|
13556
|
+
const outputKind = utils.getOutputKind(json, markdown);
|
|
13546
13557
|
const wasValidInput = utils.checkCommandInput(outputKind, {
|
|
13547
13558
|
nook: true,
|
|
13548
13559
|
test: !!orgSlug,
|
|
@@ -13977,14 +13988,18 @@ const __filename$1 = require$$0.fileURLToPath((typeof document === 'undefined' ?
|
|
|
13977
13988
|
const {
|
|
13978
13989
|
SOCKET_CLI_BIN_NAME
|
|
13979
13990
|
} = constants;
|
|
13980
|
-
|
|
13981
|
-
// TODO: Add autocompletion using https://socket.dev/npm/package/omelette
|
|
13982
13991
|
void (async () => {
|
|
13992
|
+
const registryUrl = vendor.registryUrl();
|
|
13983
13993
|
await vendor.updater({
|
|
13994
|
+
authInfo: vendor.registryAuthTokenExports(registryUrl, {
|
|
13995
|
+
recursive: true
|
|
13996
|
+
}),
|
|
13984
13997
|
name: SOCKET_CLI_BIN_NAME,
|
|
13998
|
+
registryUrl,
|
|
13999
|
+
ttl: 86_400_000 /* 24 hours in milliseconds */,
|
|
14000
|
+
|
|
13985
14001
|
// Lazily access constants.ENV.INLINED_SOCKET_CLI_VERSION.
|
|
13986
|
-
version: constants.ENV.INLINED_SOCKET_CLI_VERSION
|
|
13987
|
-
ttl: 86_400_000 /* 24 hours in milliseconds */
|
|
14002
|
+
version: constants.ENV.INLINED_SOCKET_CLI_VERSION
|
|
13988
14003
|
});
|
|
13989
14004
|
try {
|
|
13990
14005
|
await utils.meowWithSubcommands({
|
|
@@ -14162,5 +14177,5 @@ void (async () => {
|
|
|
14162
14177
|
await utils.captureException(e);
|
|
14163
14178
|
}
|
|
14164
14179
|
})();
|
|
14165
|
-
//# debugId=
|
|
14180
|
+
//# debugId=4d7d8bf0-8e58-40ba-ab95-da5d3fbe5cdd
|
|
14166
14181
|
//# sourceMappingURL=cli.js.map
|