socket 0.15.55 → 0.15.57
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/bin/cli.js +2 -2
- package/dist/cli.js +82 -55
- package/dist/cli.js.map +1 -1
- package/dist/constants.js +49 -29
- package/dist/constants.js.map +1 -1
- package/dist/{shadow-bin.js → shadow-npm-bin.js} +6 -6
- package/dist/shadow-npm-bin.js.map +1 -0
- package/dist/{shadow-inject.js → shadow-npm-inject.js} +1 -1
- package/dist/shadow-npm-inject.js.map +1 -0
- package/dist/types/commands/scan/handle-reach-scan.d.mts +1 -1
- package/dist/types/commands/scan/handle-reach-scan.d.mts.map +1 -1
- package/dist/types/commands/scan/scan-reachability.d.mts +1 -1
- package/dist/types/commands/scan/scan-reachability.d.mts.map +1 -1
- package/dist/types/commands/threat-feed/cmd-threat-feed.d.mts.map +1 -1
- package/dist/types/commands/threat-feed/fetch-threat-feed.d.mts +4 -1
- package/dist/types/commands/threat-feed/fetch-threat-feed.d.mts.map +1 -1
- package/dist/types/commands/threat-feed/handle-threat-feed.d.mts +4 -1
- package/dist/types/commands/threat-feed/handle-threat-feed.d.mts.map +1 -1
- package/dist/types/constants.d.mts +9 -5
- package/dist/types/constants.d.mts.map +1 -1
- package/dist/utils.js +5 -5
- package/dist/utils.js.map +1 -1
- package/dist/vendor.js +21 -21
- package/external/@coana-tech/cli/cli.mjs +123 -8
- package/external/@socketsecurity/registry/external/@npmcli/package-json/index.js +9 -4
- package/external/@socketsecurity/registry/external/@socketregistry/yocto-spinner.js +115 -132
- package/external/@socketsecurity/registry/external/@yarnpkg/extensions.js +18 -0
- package/external/@socketsecurity/registry/external/browserslist.js +662 -658
- package/external/@socketsecurity/registry/external/cacache.js +5 -3
- package/external/@socketsecurity/registry/external/libnpmpack.js +9 -4
- package/external/@socketsecurity/registry/external/make-fetch-happen.js +5 -3
- package/external/@socketsecurity/registry/external/npm-package-arg.js +4 -1
- package/external/@socketsecurity/registry/external/pacote.js +9 -4
- package/external/@socketsecurity/registry/external/validate-npm-package-name.js +4 -1
- package/external/@socketsecurity/registry/manifest.json +4 -4
- package/external/blessed-contrib/lib/layout/grid.js +400 -32
- package/external/blessed-contrib/lib/widget/charts/bar.js +8338 -67
- package/external/blessed-contrib/lib/widget/charts/line.js +17861 -196
- package/external/blessed-contrib/lib/widget/table.js +140 -121
- package/package.json +16 -15
- package/dist/shadow-bin.js.map +0 -1
- package/dist/shadow-inject.js.map +0 -1
- package/external/blessed-contrib/index.js +0 -28
- package/external/blessed-contrib/lib/layout/carousel.js +0 -74
- package/external/blessed-contrib/lib/server-utils.js +0 -73
- package/external/blessed-contrib/lib/utils.js +0 -73
- package/external/blessed-contrib/lib/widget/canvas.js +0 -51
- package/external/blessed-contrib/lib/widget/charts/stacked-bar.js +0 -218
- package/external/blessed-contrib/lib/widget/donut.js +0 -149
- package/external/blessed-contrib/lib/widget/gauge-list.js +0 -106
- package/external/blessed-contrib/lib/widget/gauge.js +0 -125
- package/external/blessed-contrib/lib/widget/lcd.js +0 -451
- package/external/blessed-contrib/lib/widget/log.js +0 -33
- package/external/blessed-contrib/lib/widget/map.js +0 -86
- package/external/blessed-contrib/lib/widget/markdown.js +0 -64
- package/external/blessed-contrib/lib/widget/picture.js +0 -66
- package/external/blessed-contrib/lib/widget/sparkline.js +0 -58
- package/external/blessed-contrib/lib/widget/tree.js +0 -167
package/bin/cli.js
CHANGED
|
@@ -28,8 +28,8 @@ spawn(
|
|
|
28
28
|
...(constants.ENV.INLINED_SOCKET_CLI_SENTRY_BUILD
|
|
29
29
|
? [
|
|
30
30
|
'--require',
|
|
31
|
-
// Lazily access constants.
|
|
32
|
-
constants.
|
|
31
|
+
// Lazily access constants.instrumentWithSentryPath.
|
|
32
|
+
constants.instrumentWithSentryPath,
|
|
33
33
|
]
|
|
34
34
|
: []),
|
|
35
35
|
// Lazily access constants.distCliPath.
|
package/dist/cli.js
CHANGED
|
@@ -12,7 +12,7 @@ var constants = require('./constants.js');
|
|
|
12
12
|
var words = require('../external/@socketsecurity/registry/lib/words');
|
|
13
13
|
var fs$1 = require('node:fs');
|
|
14
14
|
var path = require('node:path');
|
|
15
|
-
var
|
|
15
|
+
var shadowNpmBin = require('./shadow-npm-bin.js');
|
|
16
16
|
var prompts = require('../external/@socketsecurity/registry/lib/prompts');
|
|
17
17
|
var spawn = require('../external/@socketsecurity/registry/lib/spawn');
|
|
18
18
|
var util = require('node:util');
|
|
@@ -25,7 +25,7 @@ var path$1 = require('../external/@socketsecurity/registry/lib/path');
|
|
|
25
25
|
var regexps = require('../external/@socketsecurity/registry/lib/regexps');
|
|
26
26
|
var fs$2 = require('../external/@socketsecurity/registry/lib/fs');
|
|
27
27
|
var strings = require('../external/@socketsecurity/registry/lib/strings');
|
|
28
|
-
var
|
|
28
|
+
var shadowNpmInject = require('./shadow-npm-inject.js');
|
|
29
29
|
var objects = require('../external/@socketsecurity/registry/lib/objects');
|
|
30
30
|
var registryConstants = require('../external/@socketsecurity/registry/lib/constants');
|
|
31
31
|
var require$$7 = require('../external/@socketsecurity/registry/lib/promises');
|
|
@@ -834,7 +834,7 @@ async function runCdxgen(yargvWithYes) {
|
|
|
834
834
|
// Use synp to create a package-lock.json from the yarn.lock,
|
|
835
835
|
// based on the node_modules folder, for a more accurate SBOM.
|
|
836
836
|
try {
|
|
837
|
-
await
|
|
837
|
+
await shadowNpmBin(NPX$1, [...yesArgs,
|
|
838
838
|
// Lazily access constants.ENV.INLINED_SYNP_VERSION.
|
|
839
839
|
`synp@${constants.ENV.INLINED_SYNP_VERSION}`, '--source-file', `./${YARN_LOCK}`]);
|
|
840
840
|
yargv.type = NPM$9;
|
|
@@ -842,7 +842,7 @@ async function runCdxgen(yargvWithYes) {
|
|
|
842
842
|
} catch {}
|
|
843
843
|
}
|
|
844
844
|
}
|
|
845
|
-
await
|
|
845
|
+
await shadowNpmBin(NPX$1, [...yesArgs,
|
|
846
846
|
// Lazily access constants.ENV.INLINED_CYCLONEDX_CDXGEN_VERSION.
|
|
847
847
|
`@cyclonedx/cdxgen@${constants.ENV.INLINED_CYCLONEDX_CDXGEN_VERSION}`, ...argvToArray(yargv)]);
|
|
848
848
|
if (cleanupPackageLock) {
|
|
@@ -4277,7 +4277,7 @@ async function install$1(arb, options) {
|
|
|
4277
4277
|
...options
|
|
4278
4278
|
};
|
|
4279
4279
|
try {
|
|
4280
|
-
const newArb = new
|
|
4280
|
+
const newArb = new shadowNpmInject.Arborist({
|
|
4281
4281
|
path: cwd
|
|
4282
4282
|
});
|
|
4283
4283
|
newArb.idealTree = await arb.buildIdealTree();
|
|
@@ -4317,9 +4317,9 @@ async function npmFix(pkgEnvDetails, {
|
|
|
4317
4317
|
author: gitUser
|
|
4318
4318
|
}) : [];
|
|
4319
4319
|
let count = 0;
|
|
4320
|
-
const arb = new
|
|
4320
|
+
const arb = new shadowNpmInject.Arborist({
|
|
4321
4321
|
path: rootPath,
|
|
4322
|
-
...
|
|
4322
|
+
...shadowNpmInject.SAFE_ARBORIST_REIFY_OPTIONS_OVERRIDES
|
|
4323
4323
|
});
|
|
4324
4324
|
// Calling arb.reify() creates the arb.diff object, nulls-out arb.idealTree,
|
|
4325
4325
|
// and populates arb.actualTree.
|
|
@@ -4328,7 +4328,7 @@ async function npmFix(pkgEnvDetails, {
|
|
|
4328
4328
|
try {
|
|
4329
4329
|
alertsMap = purls.length ? await utils.getAlertsMapFromPurls(purls, getAlertsMapOptions({
|
|
4330
4330
|
limit: Math.max(limit, openPrs.length)
|
|
4331
|
-
})) : await
|
|
4331
|
+
})) : await shadowNpmInject.getAlertsMapFromArborist(arb, getAlertsMapOptions({
|
|
4332
4332
|
limit: Math.max(limit, openPrs.length)
|
|
4333
4333
|
}));
|
|
4334
4334
|
} catch (e) {
|
|
@@ -4425,7 +4425,7 @@ async function npmFix(pkgEnvDetails, {
|
|
|
4425
4425
|
const isWorkspaceRoot = pkgJsonPath === pkgEnvDetails.editablePkgJson.filename;
|
|
4426
4426
|
const workspace = isWorkspaceRoot ? 'root' : path.relative(rootPath, pkgPath);
|
|
4427
4427
|
const branchWorkspace = isCi ? getSocketBranchWorkspaceComponent(workspace) : '';
|
|
4428
|
-
const oldVersions = arrays.arrayUnique(
|
|
4428
|
+
const oldVersions = arrays.arrayUnique(shadowNpmInject.findPackageNodes(actualTree, name).map(n => n.target?.version ?? n.version).filter(Boolean));
|
|
4429
4429
|
if (!oldVersions.length) {
|
|
4430
4430
|
debug.debugFn(`skip: ${name} not found\n`);
|
|
4431
4431
|
// Skip to next package.
|
|
@@ -4450,7 +4450,7 @@ async function npmFix(pkgEnvDetails, {
|
|
|
4450
4450
|
oldVersionsLoop: for (const oldVersion of oldVersions) {
|
|
4451
4451
|
const oldId = `${name}@${oldVersion}`;
|
|
4452
4452
|
const oldPurl = utils.idToPurl(oldId, partialPurlObj.type);
|
|
4453
|
-
const node =
|
|
4453
|
+
const node = shadowNpmInject.findPackageNode(actualTree, name, oldVersion);
|
|
4454
4454
|
if (!node) {
|
|
4455
4455
|
debug.debugFn(`skip: ${oldId} not found`);
|
|
4456
4456
|
continue oldVersionsLoop;
|
|
@@ -4463,7 +4463,7 @@ async function npmFix(pkgEnvDetails, {
|
|
|
4463
4463
|
debug.debugFn(`skip: ${oldId} is >= ${firstPatchedVersionIdentifier}`);
|
|
4464
4464
|
continue infosLoop;
|
|
4465
4465
|
}
|
|
4466
|
-
const newVersion =
|
|
4466
|
+
const newVersion = shadowNpmInject.findBestPatchVersion(node, availableVersions, vulnerableVersionRange);
|
|
4467
4467
|
if (activeBranches.find(b => b.workspace === branchWorkspace && b.newVersion === newVersion)) {
|
|
4468
4468
|
debug.debugFn(`skip: open PR found for ${name}@${newVersion}`);
|
|
4469
4469
|
if (++count >= limit) {
|
|
@@ -4497,8 +4497,8 @@ async function npmFix(pkgEnvDetails, {
|
|
|
4497
4497
|
}
|
|
4498
4498
|
})
|
|
4499
4499
|
};
|
|
4500
|
-
|
|
4501
|
-
|
|
4500
|
+
shadowNpmInject.updateNode(node, newVersion, newVersionPackument);
|
|
4501
|
+
shadowNpmInject.updatePackageJsonFromNode(editablePkgJson,
|
|
4502
4502
|
// eslint-disable-next-line no-await-in-loop
|
|
4503
4503
|
await arb.buildIdealTree(), node, newVersion, rangeStyle);
|
|
4504
4504
|
// eslint-disable-next-line no-await-in-loop
|
|
@@ -4717,9 +4717,9 @@ async function getActualTree(cwd = process.cwd()) {
|
|
|
4717
4717
|
// folders. However, support is iffy resulting in unhappy path errors and hangs.
|
|
4718
4718
|
// So, to avoid the unhappy path, we restrict our usage to --dry-run loading
|
|
4719
4719
|
// of the node_modules folder.
|
|
4720
|
-
const arb = new
|
|
4720
|
+
const arb = new shadowNpmInject.Arborist({
|
|
4721
4721
|
path: cwd,
|
|
4722
|
-
...
|
|
4722
|
+
...shadowNpmInject.SAFE_ARBORIST_REIFY_OPTIONS_OVERRIDES
|
|
4723
4723
|
});
|
|
4724
4724
|
return await arb.loadActual();
|
|
4725
4725
|
}
|
|
@@ -4950,7 +4950,7 @@ async function pnpmFix(pkgEnvDetails, {
|
|
|
4950
4950
|
// Exit early if install fails.
|
|
4951
4951
|
return handleInstallFail();
|
|
4952
4952
|
}
|
|
4953
|
-
const oldVersions = arrays.arrayUnique(
|
|
4953
|
+
const oldVersions = arrays.arrayUnique(shadowNpmInject.findPackageNodes(actualTree, name).map(n => n.version).filter(Boolean));
|
|
4954
4954
|
if (!oldVersions.length) {
|
|
4955
4955
|
debug.debugFn(`skip: ${name} not found\n`);
|
|
4956
4956
|
// Skip to next package.
|
|
@@ -4978,7 +4978,7 @@ async function pnpmFix(pkgEnvDetails, {
|
|
|
4978
4978
|
oldVersionsLoop: for (const oldVersion of oldVersions) {
|
|
4979
4979
|
const oldId = `${name}@${oldVersion}`;
|
|
4980
4980
|
const oldPurl = utils.idToPurl(oldId, partialPurlObj.type);
|
|
4981
|
-
const node =
|
|
4981
|
+
const node = shadowNpmInject.findPackageNode(actualTree, name, oldVersion);
|
|
4982
4982
|
if (!node) {
|
|
4983
4983
|
debug.debugFn(`skip: ${oldId} not found`);
|
|
4984
4984
|
continue oldVersionsLoop;
|
|
@@ -4991,7 +4991,7 @@ async function pnpmFix(pkgEnvDetails, {
|
|
|
4991
4991
|
debug.debugFn(`skip: ${oldId} is >= ${firstPatchedVersionIdentifier}`);
|
|
4992
4992
|
continue infosLoop;
|
|
4993
4993
|
}
|
|
4994
|
-
const newVersion =
|
|
4994
|
+
const newVersion = shadowNpmInject.findBestPatchVersion(node, availableVersions, vulnerableVersionRange);
|
|
4995
4995
|
if (activeBranches.find(b => b.workspace === branchWorkspace && b.newVersion === newVersion)) {
|
|
4996
4996
|
debug.debugFn(`skip: open PR found for ${name}@${newVersion}`);
|
|
4997
4997
|
if (++count >= limit) {
|
|
@@ -5050,7 +5050,7 @@ async function pnpmFix(pkgEnvDetails, {
|
|
|
5050
5050
|
// generates pnpm-lock.yaml it updates transitive dependencies too.
|
|
5051
5051
|
editablePkgJson.update(updateOverrides);
|
|
5052
5052
|
}
|
|
5053
|
-
|
|
5053
|
+
shadowNpmInject.updatePackageJsonFromNode(editablePkgJson, actualTree, node, newVersion, rangeStyle);
|
|
5054
5054
|
// eslint-disable-next-line no-await-in-loop
|
|
5055
5055
|
if (!(await editablePkgJson.save({
|
|
5056
5056
|
ignoreWhitespace: true
|
|
@@ -7511,8 +7511,8 @@ async function run$v(argv, importMeta, {
|
|
|
7511
7511
|
return;
|
|
7512
7512
|
}
|
|
7513
7513
|
|
|
7514
|
-
// Lazily access constants.
|
|
7515
|
-
const shadowBin = require$3(constants.
|
|
7514
|
+
// Lazily access constants.shadowNpmBinPath.
|
|
7515
|
+
const shadowBin = require$3(constants.shadowNpmBinPath);
|
|
7516
7516
|
await shadowBin('npm', argv);
|
|
7517
7517
|
}
|
|
7518
7518
|
|
|
@@ -7551,8 +7551,8 @@ async function run$u(argv, importMeta, {
|
|
|
7551
7551
|
return;
|
|
7552
7552
|
}
|
|
7553
7553
|
|
|
7554
|
-
// Lazily access constants.
|
|
7555
|
-
const shadowBin = require$2(constants.
|
|
7554
|
+
// Lazily access constants.shadowNpmBinPath.
|
|
7555
|
+
const shadowBin = require$2(constants.shadowNpmBinPath);
|
|
7556
7556
|
await shadowBin('npx', argv);
|
|
7557
7557
|
}
|
|
7558
7558
|
|
|
@@ -12852,13 +12852,13 @@ async function outputScanReach(result, cwd, outputKind) {
|
|
|
12852
12852
|
const {
|
|
12853
12853
|
DOT_SOCKET_DOT_FACTS_JSON
|
|
12854
12854
|
} = constants;
|
|
12855
|
-
async function scanReachability(cwd) {
|
|
12855
|
+
async function scanReachability(argv, cwd) {
|
|
12856
12856
|
try {
|
|
12857
12857
|
const result = await spawn.spawn(constants.execPath, [
|
|
12858
12858
|
// Lazily access constants.nodeNoWarningsFlags.
|
|
12859
12859
|
...constants.nodeNoWarningsFlags,
|
|
12860
12860
|
// Lazily access constants.coanaBinPath.
|
|
12861
|
-
constants.coanaBinPath, 'run', cwd, '--output-dir', cwd, '--
|
|
12861
|
+
constants.coanaBinPath, 'run', cwd, '--output-dir', cwd, '--socket-mode', DOT_SOCKET_DOT_FACTS_JSON, '--disable-report-submission', ...argv], {
|
|
12862
12862
|
cwd,
|
|
12863
12863
|
env: {
|
|
12864
12864
|
...process.env,
|
|
@@ -12880,8 +12880,8 @@ async function scanReachability(cwd) {
|
|
|
12880
12880
|
}
|
|
12881
12881
|
}
|
|
12882
12882
|
|
|
12883
|
-
async function handleScanReach(cwd, outputKind) {
|
|
12884
|
-
const result = await scanReachability(cwd);
|
|
12883
|
+
async function handleScanReach(argv, cwd, outputKind) {
|
|
12884
|
+
const result = await scanReachability(argv, cwd);
|
|
12885
12885
|
await outputScanReach(result, cwd, outputKind);
|
|
12886
12886
|
}
|
|
12887
12887
|
|
|
@@ -12940,7 +12940,7 @@ async function run$6(argv, importMeta, {
|
|
|
12940
12940
|
logger.logger.log(DRY_RUN_BAILING_NOW$6);
|
|
12941
12941
|
return;
|
|
12942
12942
|
}
|
|
12943
|
-
await handleScanReach(cwd, outputKind);
|
|
12943
|
+
await handleScanReach(argv, cwd, outputKind);
|
|
12944
12944
|
}
|
|
12945
12945
|
|
|
12946
12946
|
const {
|
|
@@ -13725,11 +13725,14 @@ async function fetchThreatFeed({
|
|
|
13725
13725
|
direction,
|
|
13726
13726
|
ecosystem,
|
|
13727
13727
|
filter,
|
|
13728
|
+
orgSlug,
|
|
13728
13729
|
page,
|
|
13729
|
-
perPage
|
|
13730
|
+
perPage,
|
|
13731
|
+
pkg,
|
|
13732
|
+
version
|
|
13730
13733
|
}) {
|
|
13731
|
-
const queryParams = new URLSearchParams([['direction', direction], ['ecosystem', ecosystem], ['filter', filter], ['
|
|
13732
|
-
return await utils.queryApiSafeJson(`threat-feed?${queryParams}`, 'the Threat Feed data');
|
|
13734
|
+
const queryParams = new URLSearchParams([['direction', direction], ['ecosystem', ecosystem], filter ? ['filter', filter] : ['', ''], ['page_cursor', page], ['per_page', String(perPage)], pkg ? ['name', pkg] : ['', ''], version ? ['version', version] : ['', '']]);
|
|
13735
|
+
return await utils.queryApiSafeJson(`orgs/${orgSlug}/threat-feed?${queryParams}`, 'the Threat Feed data');
|
|
13733
13736
|
}
|
|
13734
13737
|
|
|
13735
13738
|
const require$1 =Module.createRequire(require$$0.pathToFileURL(__filename).href)
|
|
@@ -13868,16 +13871,22 @@ async function handleThreatFeed({
|
|
|
13868
13871
|
direction,
|
|
13869
13872
|
ecosystem,
|
|
13870
13873
|
filter,
|
|
13874
|
+
orgSlug,
|
|
13871
13875
|
outputKind,
|
|
13872
13876
|
page,
|
|
13873
|
-
perPage
|
|
13877
|
+
perPage,
|
|
13878
|
+
pkg,
|
|
13879
|
+
version
|
|
13874
13880
|
}) {
|
|
13875
13881
|
const data = await fetchThreatFeed({
|
|
13876
13882
|
direction,
|
|
13877
13883
|
ecosystem,
|
|
13878
13884
|
filter,
|
|
13885
|
+
orgSlug,
|
|
13879
13886
|
page,
|
|
13880
|
-
perPage
|
|
13887
|
+
perPage,
|
|
13888
|
+
pkg,
|
|
13889
|
+
version
|
|
13881
13890
|
});
|
|
13882
13891
|
await outputThreatFeed(data, outputKind);
|
|
13883
13892
|
}
|
|
@@ -13892,6 +13901,24 @@ const config$2 = {
|
|
|
13892
13901
|
flags: {
|
|
13893
13902
|
...utils.commonFlags,
|
|
13894
13903
|
...utils.outputFlags,
|
|
13904
|
+
direction: {
|
|
13905
|
+
type: 'string',
|
|
13906
|
+
shortFlag: 'd',
|
|
13907
|
+
default: 'desc',
|
|
13908
|
+
description: 'Order asc or desc by the createdAt attribute'
|
|
13909
|
+
},
|
|
13910
|
+
eco: {
|
|
13911
|
+
type: 'string',
|
|
13912
|
+
shortFlag: 'e',
|
|
13913
|
+
default: '',
|
|
13914
|
+
description: 'Only show threats for a particular ecosystem'
|
|
13915
|
+
},
|
|
13916
|
+
filter: {
|
|
13917
|
+
type: 'string',
|
|
13918
|
+
shortFlag: 'f',
|
|
13919
|
+
default: 'mal',
|
|
13920
|
+
description: 'Filter what type of threats to return'
|
|
13921
|
+
},
|
|
13895
13922
|
interactive: {
|
|
13896
13923
|
type: 'boolean',
|
|
13897
13924
|
default: true,
|
|
@@ -13901,35 +13928,25 @@ const config$2 = {
|
|
|
13901
13928
|
type: 'string',
|
|
13902
13929
|
description: 'Force override the organization slug, overrides the default org from config'
|
|
13903
13930
|
},
|
|
13904
|
-
perPage: {
|
|
13905
|
-
type: 'number',
|
|
13906
|
-
shortFlag: 'pp',
|
|
13907
|
-
default: 30,
|
|
13908
|
-
description: 'Number of items per page'
|
|
13909
|
-
},
|
|
13910
13931
|
page: {
|
|
13911
13932
|
type: 'string',
|
|
13912
13933
|
shortFlag: 'p',
|
|
13913
13934
|
default: '1',
|
|
13914
13935
|
description: 'Page token'
|
|
13915
13936
|
},
|
|
13916
|
-
|
|
13917
|
-
type: '
|
|
13918
|
-
shortFlag: '
|
|
13919
|
-
default:
|
|
13920
|
-
description: '
|
|
13937
|
+
perPage: {
|
|
13938
|
+
type: 'number',
|
|
13939
|
+
shortFlag: 'pp',
|
|
13940
|
+
default: 30,
|
|
13941
|
+
description: 'Number of items per page'
|
|
13921
13942
|
},
|
|
13922
|
-
|
|
13943
|
+
pkg: {
|
|
13923
13944
|
type: 'string',
|
|
13924
|
-
|
|
13925
|
-
default: '',
|
|
13926
|
-
description: 'Only show threats for a particular ecosystem'
|
|
13945
|
+
description: 'Filter by this package name'
|
|
13927
13946
|
},
|
|
13928
|
-
|
|
13947
|
+
version: {
|
|
13929
13948
|
type: 'string',
|
|
13930
|
-
|
|
13931
|
-
default: 'mal',
|
|
13932
|
-
description: 'Filter what type of threats to return'
|
|
13949
|
+
description: 'Filter by this package version'
|
|
13933
13950
|
}
|
|
13934
13951
|
},
|
|
13935
13952
|
help: (command, config) => `
|
|
@@ -13970,6 +13987,11 @@ const config$2 = {
|
|
|
13970
13987
|
- nuget
|
|
13971
13988
|
- pypi
|
|
13972
13989
|
|
|
13990
|
+
Note: if you filter by package name or version, it will do so for anything
|
|
13991
|
+
unless you also filter by that ecosystem and/or package name. When in
|
|
13992
|
+
doubt, look at the threat-feed and see the names in the name/version
|
|
13993
|
+
column. That's what you want to search for.
|
|
13994
|
+
|
|
13973
13995
|
Examples
|
|
13974
13996
|
$ ${command}${utils.isTestingV1() ? '' : ' FakeOrg'}
|
|
13975
13997
|
$ ${command}${utils.isTestingV1() ? '' : ' FakeOrg'} --perPage=5 --page=2 --direction=asc --filter=joke
|
|
@@ -13994,7 +14016,9 @@ async function run$2(argv, importMeta, {
|
|
|
13994
14016
|
interactive,
|
|
13995
14017
|
json,
|
|
13996
14018
|
markdown,
|
|
13997
|
-
org: orgFlag
|
|
14019
|
+
org: orgFlag,
|
|
14020
|
+
pkg,
|
|
14021
|
+
version
|
|
13998
14022
|
} = cli.flags;
|
|
13999
14023
|
const outputKind = utils.getOutputKind(json, markdown);
|
|
14000
14024
|
const [orgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), cli.input[0] || '', !!interactive, !!dryRun);
|
|
@@ -14030,8 +14054,11 @@ async function run$2(argv, importMeta, {
|
|
|
14030
14054
|
ecosystem: String(cli.flags['eco'] || ''),
|
|
14031
14055
|
filter: String(cli.flags['filter'] || 'mal'),
|
|
14032
14056
|
outputKind,
|
|
14057
|
+
orgSlug,
|
|
14033
14058
|
page: String(cli.flags['page'] || '1'),
|
|
14034
|
-
perPage: Number(cli.flags['perPage']) || 30
|
|
14059
|
+
perPage: Number(cli.flags['perPage']) || 30,
|
|
14060
|
+
pkg: String(pkg || ''),
|
|
14061
|
+
version: String(version || '')
|
|
14035
14062
|
});
|
|
14036
14063
|
}
|
|
14037
14064
|
|
|
@@ -14619,5 +14646,5 @@ void (async () => {
|
|
|
14619
14646
|
await utils.captureException(e);
|
|
14620
14647
|
}
|
|
14621
14648
|
})();
|
|
14622
|
-
//# debugId=
|
|
14649
|
+
//# debugId=a6016faa-33fb-4a2d-9347-cd24206bcb99
|
|
14623
14650
|
//# sourceMappingURL=cli.js.map
|