socket 1.1.11 ā 1.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/bin/cli.js +2 -1
- package/bin/npm-cli.js +2 -1
- package/bin/npx-cli.js +2 -1
- package/bin/pnpm-cli.js +29 -0
- package/bin/yarn-cli.js +29 -0
- package/dist/cli.js +702 -526
- package/dist/cli.js.map +1 -1
- package/dist/constants.js +27 -5
- package/dist/constants.js.map +1 -1
- package/dist/npm-cli.js +26 -0
- package/dist/npm-cli.js.map +1 -0
- package/dist/npx-cli.js +26 -0
- package/dist/npx-cli.js.map +1 -0
- package/dist/pnpm-cli.js +26 -0
- package/dist/pnpm-cli.js.map +1 -0
- package/dist/shadow-npm-inject.js +2 -2
- package/dist/shadow-npm-inject.js.map +1 -1
- package/dist/shadow-pnpm-bin.js +235 -0
- package/dist/shadow-pnpm-bin.js.map +1 -0
- package/dist/shadow-yarn-bin.js +200 -0
- package/dist/shadow-yarn-bin.js.map +1 -0
- package/dist/tsconfig.dts.tsbuildinfo +1 -1
- package/dist/types/commands/fix/pull-request.d.mts.map +1 -1
- package/dist/types/commands/json/cmd-json.d.mts.map +1 -1
- package/dist/types/commands/manifest/cmd-manifest-conda.d.mts.map +1 -1
- package/dist/types/commands/manifest/cmd-manifest-gradle.d.mts.map +1 -1
- package/dist/types/commands/manifest/cmd-manifest-kotlin.d.mts.map +1 -1
- package/dist/types/commands/manifest/cmd-manifest-setup.d.mts.map +1 -1
- package/dist/types/commands/manifest/cmd-manifest.d.mts.map +1 -1
- package/dist/types/commands/manifest/detect-manifest-actions.d.mts.map +1 -1
- package/dist/types/commands/manifest/generate_auto_manifest.d.mts.map +1 -1
- package/dist/types/commands/manifest/output-requirements.d.mts.map +1 -1
- package/dist/types/commands/manifest/run-cdxgen.d.mts.map +1 -1
- package/dist/types/commands/manifest/setup-manifest-config.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/pnpm/cmd-pnpm.d.mts +10 -0
- package/dist/types/commands/pnpm/cmd-pnpm.d.mts.map +1 -0
- package/dist/types/commands/scan/cmd-scan-setup.d.mts.map +1 -1
- package/dist/types/commands/yarn/cmd-yarn.d.mts +10 -0
- package/dist/types/commands/yarn/cmd-yarn.d.mts.map +1 -0
- package/dist/types/commands.d.mts +10 -0
- package/dist/types/commands.d.mts.map +1 -1
- package/dist/types/constants.d.mts +15 -1
- package/dist/types/constants.d.mts.map +1 -1
- package/dist/types/npm-cli.d.mts +3 -0
- package/dist/types/npm-cli.d.mts.map +1 -0
- package/dist/types/npx-cli.d.mts +3 -0
- package/dist/types/npx-cli.d.mts.map +1 -0
- package/dist/types/pnpm-cli.d.mts +3 -0
- package/dist/types/pnpm-cli.d.mts.map +1 -0
- package/dist/types/shadow/pnpm/bin.d.mts +10 -0
- package/dist/types/shadow/pnpm/bin.d.mts.map +1 -0
- package/dist/types/shadow/pnpm/link.d.mts +2 -0
- package/dist/types/shadow/pnpm/link.d.mts.map +1 -0
- package/dist/types/shadow/yarn/bin.d.mts +10 -0
- package/dist/types/shadow/yarn/bin.d.mts.map +1 -0
- package/dist/types/shadow/yarn/link.d.mts +2 -0
- package/dist/types/shadow/yarn/link.d.mts.map +1 -0
- package/dist/types/utils/alerts-map.d.mts.map +1 -1
- package/dist/types/utils/coana.d.mts.map +1 -1
- package/dist/types/utils/github.d.mts.map +1 -1
- package/dist/types/utils/meow-with-subcommands.d.mts.map +1 -1
- package/dist/types/utils/package-environment.d.mts.map +1 -1
- package/dist/types/utils/pnpm-paths.d.mts +5 -0
- package/dist/types/utils/pnpm-paths.d.mts.map +1 -0
- package/dist/types/utils/socket-json.d.mts +3 -0
- package/dist/types/utils/socket-json.d.mts.map +1 -1
- package/dist/types/utils/yarn-paths.d.mts +5 -0
- package/dist/types/utils/yarn-paths.d.mts.map +1 -0
- package/dist/types/utils/yarn-version.d.mts +2 -0
- package/dist/types/utils/yarn-version.d.mts.map +1 -0
- package/dist/types/yarn-cli.d.mts +3 -0
- package/dist/types/yarn-cli.d.mts.map +1 -0
- package/dist/utils.js +242 -63
- package/dist/utils.js.map +1 -1
- package/dist/vendor.js +3622 -1386
- package/dist/yarn-cli.js +26 -0
- package/dist/yarn-cli.js.map +1 -0
- package/package.json +6 -2
- package/shadow-bin/npm +1 -1
- package/shadow-bin/npx +1 -1
- package/shadow-bin/pnpm +27 -0
- package/shadow-bin/yarn +27 -0
package/dist/cli.js
CHANGED
|
@@ -68,7 +68,7 @@ async function fetchRepoAnalyticsData(repo, time, options) {
|
|
|
68
68
|
|
|
69
69
|
// Note: Widgets does not seem to actually work as code :'(
|
|
70
70
|
|
|
71
|
-
const require$
|
|
71
|
+
const require$8 = require$$5.createRequire((typeof document === 'undefined' ? require$$0.pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli.js', document.baseURI).href)));
|
|
72
72
|
const METRICS = ['total_critical_alerts', 'total_high_alerts', 'total_medium_alerts', 'total_low_alerts', 'total_critical_added', 'total_medium_added', 'total_low_added', 'total_high_added', 'total_critical_prevented', 'total_high_prevented', 'total_medium_prevented', 'total_low_prevented'];
|
|
73
73
|
|
|
74
74
|
// Note: This maps `new Date(date).getMonth()` to English three letters
|
|
@@ -147,11 +147,11 @@ ${utils.mdTableStringNumber('Name', 'Counts', data['top_five_alert_types'])}
|
|
|
147
147
|
`.trim() + '\n';
|
|
148
148
|
}
|
|
149
149
|
function displayAnalyticsScreen(data) {
|
|
150
|
-
const ScreenWidget = /*@__PURE__*/require$
|
|
150
|
+
const ScreenWidget = /*@__PURE__*/require$8('../external/blessed/lib/widgets/screen.js');
|
|
151
151
|
const screen = new ScreenWidget({
|
|
152
152
|
...constants.default.blessedOptions
|
|
153
153
|
});
|
|
154
|
-
const GridLayout = /*@__PURE__*/require$
|
|
154
|
+
const GridLayout = /*@__PURE__*/require$8('../external/blessed-contrib/lib/layout/grid.js');
|
|
155
155
|
const grid = new GridLayout({
|
|
156
156
|
rows: 5,
|
|
157
157
|
cols: 4,
|
|
@@ -165,7 +165,7 @@ function displayAnalyticsScreen(data) {
|
|
|
165
165
|
renderLineCharts(grid, screen, 'Total high alerts prevented from the main branch', [2, 2, 1, 2], data['total_high_prevented']);
|
|
166
166
|
renderLineCharts(grid, screen, 'Total medium alerts prevented from the main branch', [3, 0, 1, 2], data['total_medium_prevented']);
|
|
167
167
|
renderLineCharts(grid, screen, 'Total low alerts prevented from the main branch', [3, 2, 1, 2], data['total_low_prevented']);
|
|
168
|
-
const BarChart = /*@__PURE__*/require$
|
|
168
|
+
const BarChart = /*@__PURE__*/require$8('../external/blessed-contrib/lib/widget/charts/bar.js');
|
|
169
169
|
const bar = grid.set(4, 0, 1, 2, BarChart, {
|
|
170
170
|
label: 'Top 5 alert types',
|
|
171
171
|
barWidth: 10,
|
|
@@ -265,7 +265,7 @@ function formatDate(date) {
|
|
|
265
265
|
return `${Months[new Date(date).getMonth()]} ${new Date(date).getDate()}`;
|
|
266
266
|
}
|
|
267
267
|
function renderLineCharts(grid, screen, title, coords, data) {
|
|
268
|
-
const LineChart = /*@__PURE__*/require$
|
|
268
|
+
const LineChart = /*@__PURE__*/require$8('../external/blessed-contrib/lib/widget/charts/line.js');
|
|
269
269
|
const line = grid.set(...coords, LineChart, {
|
|
270
270
|
style: {
|
|
271
271
|
line: 'cyan',
|
|
@@ -323,21 +323,21 @@ async function handleAnalytics({
|
|
|
323
323
|
});
|
|
324
324
|
}
|
|
325
325
|
|
|
326
|
-
const CMD_NAME$
|
|
327
|
-
const description$
|
|
328
|
-
const hidden$
|
|
326
|
+
const CMD_NAME$y = 'analytics';
|
|
327
|
+
const description$F = 'Look up analytics data';
|
|
328
|
+
const hidden$x = false;
|
|
329
329
|
const cmdAnalytics = {
|
|
330
|
-
description: description$
|
|
331
|
-
hidden: hidden$
|
|
332
|
-
run: run$
|
|
330
|
+
description: description$F,
|
|
331
|
+
hidden: hidden$x,
|
|
332
|
+
run: run$S
|
|
333
333
|
};
|
|
334
|
-
async function run$
|
|
334
|
+
async function run$S(argv, importMeta, {
|
|
335
335
|
parentName
|
|
336
336
|
}) {
|
|
337
337
|
const config = {
|
|
338
|
-
commandName: CMD_NAME$
|
|
339
|
-
description: description$
|
|
340
|
-
hidden: hidden$
|
|
338
|
+
commandName: CMD_NAME$y,
|
|
339
|
+
description: description$F,
|
|
340
|
+
hidden: hidden$x,
|
|
341
341
|
flags: {
|
|
342
342
|
...flags.commonFlags,
|
|
343
343
|
...flags.outputFlags,
|
|
@@ -354,7 +354,7 @@ async function run$Q(argv, importMeta, {
|
|
|
354
354
|
$ ${command} [options] [ "org" | "repo" <reponame>] [TIME]
|
|
355
355
|
|
|
356
356
|
API Token Requirements
|
|
357
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
357
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$y}`)}
|
|
358
358
|
|
|
359
359
|
The scope is either org or repo level, defaults to org.
|
|
360
360
|
|
|
@@ -500,7 +500,7 @@ async function fetchAuditLog(config, options) {
|
|
|
500
500
|
});
|
|
501
501
|
}
|
|
502
502
|
|
|
503
|
-
const require$
|
|
503
|
+
const require$7 = require$$5.createRequire((typeof document === 'undefined' ? require$$0.pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli.js', document.baseURI).href)));
|
|
504
504
|
async function outputAuditLog(result, {
|
|
505
505
|
logType,
|
|
506
506
|
orgSlug,
|
|
@@ -628,7 +628,7 @@ async function outputWithBlessed(data, orgSlug) {
|
|
|
628
628
|
const headers = [' Event id', ' Created at', ' Event type', ' User email', ' IP address', ' User agent'];
|
|
629
629
|
|
|
630
630
|
// Note: this temporarily takes over the terminal (just like `man` does).
|
|
631
|
-
const ScreenWidget = /*@__PURE__*/require$
|
|
631
|
+
const ScreenWidget = /*@__PURE__*/require$7('../external/blessed/lib/widgets/screen.js');
|
|
632
632
|
const screen = new ScreenWidget({
|
|
633
633
|
...constants.default.blessedOptions
|
|
634
634
|
});
|
|
@@ -637,7 +637,7 @@ async function outputWithBlessed(data, orgSlug) {
|
|
|
637
637
|
// node process just to exit it. That's very bad UX.
|
|
638
638
|
// eslint-disable-next-line n/no-process-exit
|
|
639
639
|
screen.key(['escape', 'q', 'C-c'], () => process.exit(0));
|
|
640
|
-
const TableWidget = /*@__PURE__*/require$
|
|
640
|
+
const TableWidget = /*@__PURE__*/require$7('../external/blessed-contrib/lib/widget/table.js');
|
|
641
641
|
const tipsBoxHeight = 1; // 1 row for tips box
|
|
642
642
|
const detailsBoxHeight = 20; // bottom N rows for details box. 20 gives 4 lines for condensed payload before it scrolls out of view
|
|
643
643
|
|
|
@@ -667,7 +667,7 @@ async function outputWithBlessed(data, orgSlug) {
|
|
|
667
667
|
columnSpacing: 4,
|
|
668
668
|
truncate: '_'
|
|
669
669
|
});
|
|
670
|
-
const BoxWidget = /*@__PURE__*/require$
|
|
670
|
+
const BoxWidget = /*@__PURE__*/require$7('../external/blessed/lib/widgets/box.js');
|
|
671
671
|
const tipsBox = new BoxWidget({
|
|
672
672
|
bottom: detailsBoxHeight,
|
|
673
673
|
// sits just above the details box
|
|
@@ -748,21 +748,21 @@ async function handleAuditLog({
|
|
|
748
748
|
});
|
|
749
749
|
}
|
|
750
750
|
|
|
751
|
-
const CMD_NAME$
|
|
752
|
-
const description$
|
|
753
|
-
const hidden$
|
|
751
|
+
const CMD_NAME$x = 'audit-log';
|
|
752
|
+
const description$E = 'Look up the audit log for an organization';
|
|
753
|
+
const hidden$w = false;
|
|
754
754
|
const cmdAuditLog = {
|
|
755
|
-
description: description$
|
|
756
|
-
hidden: hidden$
|
|
757
|
-
run: run$
|
|
755
|
+
description: description$E,
|
|
756
|
+
hidden: hidden$w,
|
|
757
|
+
run: run$R
|
|
758
758
|
};
|
|
759
|
-
async function run$
|
|
759
|
+
async function run$R(argv, importMeta, {
|
|
760
760
|
parentName
|
|
761
761
|
}) {
|
|
762
762
|
const config = {
|
|
763
|
-
commandName: CMD_NAME$
|
|
764
|
-
description: description$
|
|
765
|
-
hidden: hidden$
|
|
763
|
+
commandName: CMD_NAME$x,
|
|
764
|
+
description: description$E,
|
|
765
|
+
hidden: hidden$w,
|
|
766
766
|
flags: {
|
|
767
767
|
...flags.commonFlags,
|
|
768
768
|
...flags.outputFlags,
|
|
@@ -790,7 +790,7 @@ async function run$P(argv, importMeta, {
|
|
|
790
790
|
$ ${command} [options] [FILTER]
|
|
791
791
|
|
|
792
792
|
API Token Requirements
|
|
793
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
793
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$x}`)}
|
|
794
794
|
|
|
795
795
|
This feature requires an Enterprise Plan. To learn more about getting access
|
|
796
796
|
to this feature and many more, please visit ${constants.default.SOCKET_WEBSITE_URL}/pricing
|
|
@@ -1574,7 +1574,7 @@ async function performReachabilityAnalysis(options) {
|
|
|
1574
1574
|
return {
|
|
1575
1575
|
ok: false,
|
|
1576
1576
|
message: 'Tier 1 Reachability analysis requires an enterprise plan',
|
|
1577
|
-
cause: `Please ${vendor.terminalLinkExports('upgrade your plan',
|
|
1577
|
+
cause: `Please ${vendor.terminalLinkExports('upgrade your plan', `${constants.SOCKET_WEBSITE_URL}/pricing`)}. This feature is only available for organizations with an enterprise plan.`
|
|
1578
1578
|
};
|
|
1579
1579
|
}
|
|
1580
1580
|
const wasSpinning = !!spinner?.isSpinning;
|
|
@@ -1671,25 +1671,25 @@ sockJson, cwd = process.cwd()) {
|
|
|
1671
1671
|
sbt: false
|
|
1672
1672
|
};
|
|
1673
1673
|
if (sockJson?.defaults?.manifest?.sbt?.disabled) {
|
|
1674
|
-
require$$9.debugLog('notice',
|
|
1674
|
+
require$$9.debugLog('notice', `[DEBUG] - sbt auto-detection is disabled in ${constants.SOCKET_JSON}`);
|
|
1675
1675
|
} else if (fs$1.existsSync(path.join(cwd, 'build.sbt'))) {
|
|
1676
1676
|
require$$9.debugLog('notice', '[DEBUG] - Detected a Scala sbt build file');
|
|
1677
1677
|
output.sbt = true;
|
|
1678
1678
|
output.count += 1;
|
|
1679
1679
|
}
|
|
1680
1680
|
if (sockJson?.defaults?.manifest?.gradle?.disabled) {
|
|
1681
|
-
require$$9.debugLog('notice',
|
|
1681
|
+
require$$9.debugLog('notice', `[DEBUG] - gradle auto-detection is disabled in ${constants.SOCKET_JSON}`);
|
|
1682
1682
|
} else if (fs$1.existsSync(path.join(cwd, 'gradlew'))) {
|
|
1683
1683
|
require$$9.debugLog('notice', '[DEBUG] - Detected a gradle build file');
|
|
1684
1684
|
output.gradle = true;
|
|
1685
1685
|
output.count += 1;
|
|
1686
1686
|
}
|
|
1687
1687
|
if (sockJson?.defaults?.manifest?.conda?.disabled) {
|
|
1688
|
-
require$$9.debugLog('notice',
|
|
1688
|
+
require$$9.debugLog('notice', `[DEBUG] - conda auto-detection is disabled in ${constants.SOCKET_JSON}`);
|
|
1689
1689
|
} else {
|
|
1690
|
-
const envyml = path.join(cwd,
|
|
1690
|
+
const envyml = path.join(cwd, constants.ENVIRONMENT_YML);
|
|
1691
1691
|
const hasEnvyml = fs$1.existsSync(envyml);
|
|
1692
|
-
const envyaml = path.join(cwd,
|
|
1692
|
+
const envyaml = path.join(cwd, constants.ENVIRONMENT_YAML);
|
|
1693
1693
|
const hasEnvyaml = !hasEnvyml && fs$1.existsSync(envyaml);
|
|
1694
1694
|
if (hasEnvyml || hasEnvyaml) {
|
|
1695
1695
|
require$$9.debugLog('notice', '[DEBUG] - Detected an environment.yml Conda file');
|
|
@@ -2057,9 +2057,9 @@ async function outputRequirements(result, outputKind, out) {
|
|
|
2057
2057
|
const arr = [];
|
|
2058
2058
|
arr.push('# Converted Conda file');
|
|
2059
2059
|
arr.push('');
|
|
2060
|
-
arr.push(
|
|
2060
|
+
arr.push(`This is the Conda \`environment.yml\` file converted to python \`${constants.REQUIREMENTS_TXT}\`:`);
|
|
2061
2061
|
arr.push('');
|
|
2062
|
-
arr.push(
|
|
2062
|
+
arr.push(`\`\`\`file=${constants.REQUIREMENTS_TXT}`);
|
|
2063
2063
|
arr.push(result.data.pip);
|
|
2064
2064
|
arr.push('```');
|
|
2065
2065
|
arr.push('');
|
|
@@ -2098,7 +2098,7 @@ async function generateAutoManifest({
|
|
|
2098
2098
|
}) {
|
|
2099
2099
|
const sockJson = utils.readOrDefaultSocketJson(cwd);
|
|
2100
2100
|
if (verbose) {
|
|
2101
|
-
logger.logger.info(
|
|
2101
|
+
logger.logger.info(`Using this ${constants.SOCKET_JSON} for defaults:`, sockJson);
|
|
2102
2102
|
}
|
|
2103
2103
|
if (!sockJson?.defaults?.manifest?.sbt?.disabled && detected.sbt) {
|
|
2104
2104
|
logger.logger.log('Detected a Scala sbt build, generating pom files with sbt...');
|
|
@@ -2129,7 +2129,7 @@ async function generateAutoManifest({
|
|
|
2129
2129
|
cwd,
|
|
2130
2130
|
filename: sockJson.defaults?.manifest?.conda?.infile ?? 'environment.yml',
|
|
2131
2131
|
outputKind,
|
|
2132
|
-
out: sockJson.defaults?.manifest?.conda?.outfile ??
|
|
2132
|
+
out: sockJson.defaults?.manifest?.conda?.outfile ?? constants.REQUIREMENTS_TXT,
|
|
2133
2133
|
verbose: Boolean(sockJson.defaults?.manifest?.conda?.verbose)
|
|
2134
2134
|
});
|
|
2135
2135
|
}
|
|
@@ -2369,9 +2369,9 @@ const config$k = {
|
|
|
2369
2369
|
const cmdCI = {
|
|
2370
2370
|
description: config$k.description,
|
|
2371
2371
|
hidden: config$k.hidden,
|
|
2372
|
-
run: run$
|
|
2372
|
+
run: run$Q
|
|
2373
2373
|
};
|
|
2374
|
-
async function run$
|
|
2374
|
+
async function run$Q(argv, importMeta, {
|
|
2375
2375
|
parentName
|
|
2376
2376
|
}) {
|
|
2377
2377
|
const cli = utils.meowOrExit({
|
|
@@ -2613,21 +2613,21 @@ async function handleConfigAuto({
|
|
|
2613
2613
|
await outputConfigAuto(key, result, outputKind);
|
|
2614
2614
|
}
|
|
2615
2615
|
|
|
2616
|
-
const CMD_NAME$
|
|
2617
|
-
const description$
|
|
2618
|
-
const hidden$
|
|
2616
|
+
const CMD_NAME$w = 'auto';
|
|
2617
|
+
const description$D = 'Automatically discover and set the correct value config item';
|
|
2618
|
+
const hidden$v = false;
|
|
2619
2619
|
const cmdConfigAuto = {
|
|
2620
|
-
description: description$
|
|
2621
|
-
hidden: hidden$
|
|
2622
|
-
run: run$
|
|
2620
|
+
description: description$D,
|
|
2621
|
+
hidden: hidden$v,
|
|
2622
|
+
run: run$P
|
|
2623
2623
|
};
|
|
2624
|
-
async function run$
|
|
2624
|
+
async function run$P(argv, importMeta, {
|
|
2625
2625
|
parentName
|
|
2626
2626
|
}) {
|
|
2627
2627
|
const config = {
|
|
2628
|
-
commandName: CMD_NAME$
|
|
2629
|
-
description: description$
|
|
2630
|
-
hidden: hidden$
|
|
2628
|
+
commandName: CMD_NAME$w,
|
|
2629
|
+
description: description$D,
|
|
2630
|
+
hidden: hidden$v,
|
|
2631
2631
|
flags: {
|
|
2632
2632
|
...flags.commonFlags,
|
|
2633
2633
|
...flags.outputFlags
|
|
@@ -2757,9 +2757,9 @@ ${utils.getSupportedConfigEntries().map(({
|
|
|
2757
2757
|
const cmdConfigGet = {
|
|
2758
2758
|
description: config$j.description,
|
|
2759
2759
|
hidden: config$j.hidden,
|
|
2760
|
-
run: run$
|
|
2760
|
+
run: run$O
|
|
2761
2761
|
};
|
|
2762
|
-
async function run$
|
|
2762
|
+
async function run$O(argv, importMeta, {
|
|
2763
2763
|
parentName
|
|
2764
2764
|
}) {
|
|
2765
2765
|
const cli = utils.meowOrExit({
|
|
@@ -2893,9 +2893,9 @@ const config$i = {
|
|
|
2893
2893
|
const cmdConfigList = {
|
|
2894
2894
|
description: config$i.description,
|
|
2895
2895
|
hidden: config$i.hidden,
|
|
2896
|
-
run: run$
|
|
2896
|
+
run: run$N
|
|
2897
2897
|
};
|
|
2898
|
-
async function run$
|
|
2898
|
+
async function run$N(argv, importMeta, {
|
|
2899
2899
|
parentName
|
|
2900
2900
|
}) {
|
|
2901
2901
|
const cli = utils.meowOrExit({
|
|
@@ -2969,21 +2969,21 @@ async function handleConfigSet({
|
|
|
2969
2969
|
await outputConfigSet(result, outputKind);
|
|
2970
2970
|
}
|
|
2971
2971
|
|
|
2972
|
-
const CMD_NAME$
|
|
2973
|
-
const description$
|
|
2974
|
-
const hidden$
|
|
2972
|
+
const CMD_NAME$v = 'set';
|
|
2973
|
+
const description$C = 'Update the value of a local CLI config item';
|
|
2974
|
+
const hidden$u = false;
|
|
2975
2975
|
const cmdConfigSet = {
|
|
2976
|
-
description: description$
|
|
2977
|
-
hidden: hidden$
|
|
2978
|
-
run: run$
|
|
2976
|
+
description: description$C,
|
|
2977
|
+
hidden: hidden$u,
|
|
2978
|
+
run: run$M
|
|
2979
2979
|
};
|
|
2980
|
-
async function run$
|
|
2980
|
+
async function run$M(argv, importMeta, {
|
|
2981
2981
|
parentName
|
|
2982
2982
|
}) {
|
|
2983
2983
|
const config = {
|
|
2984
|
-
commandName: CMD_NAME$
|
|
2985
|
-
description: description$
|
|
2986
|
-
hidden: hidden$
|
|
2984
|
+
commandName: CMD_NAME$v,
|
|
2985
|
+
description: description$C,
|
|
2986
|
+
hidden: hidden$u,
|
|
2987
2987
|
flags: {
|
|
2988
2988
|
...flags.commonFlags,
|
|
2989
2989
|
...flags.outputFlags
|
|
@@ -3096,21 +3096,21 @@ async function handleConfigUnset({
|
|
|
3096
3096
|
await outputConfigUnset(updateResult, outputKind);
|
|
3097
3097
|
}
|
|
3098
3098
|
|
|
3099
|
-
const CMD_NAME$
|
|
3100
|
-
const description$
|
|
3101
|
-
const hidden$
|
|
3099
|
+
const CMD_NAME$u = 'unset';
|
|
3100
|
+
const description$B = 'Clear the value of a local CLI config item';
|
|
3101
|
+
const hidden$t = false;
|
|
3102
3102
|
const cmdConfigUnset = {
|
|
3103
|
-
description: description$
|
|
3104
|
-
hidden: hidden$
|
|
3105
|
-
run: run$
|
|
3103
|
+
description: description$B,
|
|
3104
|
+
hidden: hidden$t,
|
|
3105
|
+
run: run$L
|
|
3106
3106
|
};
|
|
3107
|
-
async function run$
|
|
3107
|
+
async function run$L(argv, importMeta, {
|
|
3108
3108
|
parentName
|
|
3109
3109
|
}) {
|
|
3110
3110
|
const config = {
|
|
3111
|
-
commandName: CMD_NAME$
|
|
3112
|
-
description: description$
|
|
3113
|
-
hidden: hidden$
|
|
3111
|
+
commandName: CMD_NAME$u,
|
|
3112
|
+
description: description$B,
|
|
3113
|
+
hidden: hidden$t,
|
|
3114
3114
|
flags: {
|
|
3115
3115
|
...flags.commonFlags,
|
|
3116
3116
|
...flags.outputFlags
|
|
@@ -3172,9 +3172,9 @@ ${utils.getSupportedConfigEntries().map(({
|
|
|
3172
3172
|
});
|
|
3173
3173
|
}
|
|
3174
3174
|
|
|
3175
|
-
const description$
|
|
3175
|
+
const description$A = 'Manage Socket CLI configuration';
|
|
3176
3176
|
const cmdConfig = {
|
|
3177
|
-
description: description$
|
|
3177
|
+
description: description$A,
|
|
3178
3178
|
hidden: false,
|
|
3179
3179
|
async run(argv, importMeta, {
|
|
3180
3180
|
parentName
|
|
@@ -3187,7 +3187,7 @@ const cmdConfig = {
|
|
|
3187
3187
|
unset: cmdConfigUnset
|
|
3188
3188
|
}, {
|
|
3189
3189
|
argv,
|
|
3190
|
-
description: description$
|
|
3190
|
+
description: description$A,
|
|
3191
3191
|
importMeta,
|
|
3192
3192
|
name: `${parentName} config`
|
|
3193
3193
|
});
|
|
@@ -3789,14 +3789,14 @@ async function handleFix({
|
|
|
3789
3789
|
}), outputKind);
|
|
3790
3790
|
}
|
|
3791
3791
|
|
|
3792
|
-
const CMD_NAME$
|
|
3792
|
+
const CMD_NAME$t = 'fix';
|
|
3793
3793
|
const DEFAULT_LIMIT = 10;
|
|
3794
|
-
const description$
|
|
3795
|
-
const hidden$
|
|
3794
|
+
const description$z = 'Update dependencies with "fixable" Socket alerts';
|
|
3795
|
+
const hidden$s = false;
|
|
3796
3796
|
const cmdFix = {
|
|
3797
|
-
description: description$
|
|
3798
|
-
hidden: hidden$
|
|
3799
|
-
run: run$
|
|
3797
|
+
description: description$z,
|
|
3798
|
+
hidden: hidden$s,
|
|
3799
|
+
run: run$K
|
|
3800
3800
|
};
|
|
3801
3801
|
const generalFlags$2 = {
|
|
3802
3802
|
autopilot: {
|
|
@@ -3878,13 +3878,13 @@ const hiddenFlags = {
|
|
|
3878
3878
|
hidden: true
|
|
3879
3879
|
}
|
|
3880
3880
|
};
|
|
3881
|
-
async function run$
|
|
3881
|
+
async function run$K(argv, importMeta, {
|
|
3882
3882
|
parentName
|
|
3883
3883
|
}) {
|
|
3884
3884
|
const config = {
|
|
3885
|
-
commandName: CMD_NAME$
|
|
3886
|
-
description: description$
|
|
3887
|
-
hidden: hidden$
|
|
3885
|
+
commandName: CMD_NAME$t,
|
|
3886
|
+
description: description$z,
|
|
3887
|
+
hidden: hidden$s,
|
|
3888
3888
|
flags: {
|
|
3889
3889
|
...flags.commonFlags,
|
|
3890
3890
|
...flags.outputFlags,
|
|
@@ -3896,7 +3896,7 @@ async function run$I(argv, importMeta, {
|
|
|
3896
3896
|
$ ${command} [options] [CWD=.]
|
|
3897
3897
|
|
|
3898
3898
|
API Token Requirements
|
|
3899
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
3899
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$t}`)}
|
|
3900
3900
|
|
|
3901
3901
|
Options
|
|
3902
3902
|
${utils.getFlagListOutput(config.flags)}
|
|
@@ -4128,9 +4128,9 @@ const config$h = {
|
|
|
4128
4128
|
const cmdInstallCompletion = {
|
|
4129
4129
|
description: config$h.description,
|
|
4130
4130
|
hidden: config$h.hidden,
|
|
4131
|
-
run: run$
|
|
4131
|
+
run: run$J
|
|
4132
4132
|
};
|
|
4133
|
-
async function run$
|
|
4133
|
+
async function run$J(argv, importMeta, {
|
|
4134
4134
|
parentName
|
|
4135
4135
|
}) {
|
|
4136
4136
|
const cli = utils.meowOrExit({
|
|
@@ -4148,9 +4148,9 @@ async function run$H(argv, importMeta, {
|
|
|
4148
4148
|
await handleInstallCompletion(String(targetName));
|
|
4149
4149
|
}
|
|
4150
4150
|
|
|
4151
|
-
const description$
|
|
4151
|
+
const description$y = 'Install Socket CLI tab completion';
|
|
4152
4152
|
const cmdInstall = {
|
|
4153
|
-
description: description$
|
|
4153
|
+
description: description$y,
|
|
4154
4154
|
hidden: false,
|
|
4155
4155
|
async run(argv, importMeta, {
|
|
4156
4156
|
parentName
|
|
@@ -4159,7 +4159,7 @@ const cmdInstall = {
|
|
|
4159
4159
|
completion: cmdInstallCompletion
|
|
4160
4160
|
}, {
|
|
4161
4161
|
argv,
|
|
4162
|
-
description: description$
|
|
4162
|
+
description: description$y,
|
|
4163
4163
|
importMeta,
|
|
4164
4164
|
name: `${parentName} install`
|
|
4165
4165
|
});
|
|
@@ -4168,7 +4168,7 @@ const cmdInstall = {
|
|
|
4168
4168
|
|
|
4169
4169
|
async function outputCmdJson(cwd) {
|
|
4170
4170
|
logger.logger.info('Target cwd:', constants.default.ENV.VITEST ? '<redacted>' : utils.tildify(cwd));
|
|
4171
|
-
const sockJsonPath = path.join(cwd,
|
|
4171
|
+
const sockJsonPath = path.join(cwd, constants.SOCKET_JSON);
|
|
4172
4172
|
const tildeSockJsonPath = constants.default.ENV.VITEST ? '<redacted>' : utils.tildify(sockJsonPath);
|
|
4173
4173
|
if (!fs$1.existsSync(sockJsonPath)) {
|
|
4174
4174
|
logger.logger.fail(`Not found: ${tildeSockJsonPath}`);
|
|
@@ -4192,7 +4192,7 @@ async function handleCmdJson(cwd) {
|
|
|
4192
4192
|
|
|
4193
4193
|
const config$g = {
|
|
4194
4194
|
commandName: 'json',
|
|
4195
|
-
description:
|
|
4195
|
+
description: `Display the \`${constants.SOCKET_JSON}\` that would be applied for target folder`,
|
|
4196
4196
|
hidden: true,
|
|
4197
4197
|
flags: {
|
|
4198
4198
|
...flags.commonFlags
|
|
@@ -4201,7 +4201,7 @@ const config$g = {
|
|
|
4201
4201
|
Usage
|
|
4202
4202
|
$ ${command} [options] [CWD=.]
|
|
4203
4203
|
|
|
4204
|
-
Display the
|
|
4204
|
+
Display the \`${constants.SOCKET_JSON}\` file that would apply when running relevant commands
|
|
4205
4205
|
in the target directory.
|
|
4206
4206
|
|
|
4207
4207
|
Examples
|
|
@@ -4211,9 +4211,9 @@ const config$g = {
|
|
|
4211
4211
|
const cmdJson = {
|
|
4212
4212
|
description: config$g.description,
|
|
4213
4213
|
hidden: config$g.hidden,
|
|
4214
|
-
run: run$
|
|
4214
|
+
run: run$I
|
|
4215
4215
|
};
|
|
4216
|
-
async function run$
|
|
4216
|
+
async function run$I(argv, importMeta, {
|
|
4217
4217
|
parentName
|
|
4218
4218
|
}) {
|
|
4219
4219
|
const cli = utils.meowOrExit({
|
|
@@ -4367,21 +4367,21 @@ async function attemptLogin(apiBaseUrl, apiProxy) {
|
|
|
4367
4367
|
}
|
|
4368
4368
|
}
|
|
4369
4369
|
|
|
4370
|
-
const CMD_NAME$
|
|
4371
|
-
const description$
|
|
4372
|
-
const hidden$
|
|
4370
|
+
const CMD_NAME$s = 'login';
|
|
4371
|
+
const description$x = 'Setup Socket CLI with an API token and defaults';
|
|
4372
|
+
const hidden$r = false;
|
|
4373
4373
|
const cmdLogin = {
|
|
4374
|
-
description: description$
|
|
4375
|
-
hidden: hidden$
|
|
4376
|
-
run: run$
|
|
4374
|
+
description: description$x,
|
|
4375
|
+
hidden: hidden$r,
|
|
4376
|
+
run: run$H
|
|
4377
4377
|
};
|
|
4378
|
-
async function run$
|
|
4378
|
+
async function run$H(argv, importMeta, {
|
|
4379
4379
|
parentName
|
|
4380
4380
|
}) {
|
|
4381
4381
|
const config = {
|
|
4382
|
-
commandName: CMD_NAME$
|
|
4383
|
-
description: description$
|
|
4384
|
-
hidden: hidden$
|
|
4382
|
+
commandName: CMD_NAME$s,
|
|
4383
|
+
description: description$x,
|
|
4384
|
+
hidden: hidden$r,
|
|
4385
4385
|
flags: {
|
|
4386
4386
|
...flags.commonFlags,
|
|
4387
4387
|
apiBaseUrl: {
|
|
@@ -4400,7 +4400,7 @@ async function run$F(argv, importMeta, {
|
|
|
4400
4400
|
$ ${command} [options]
|
|
4401
4401
|
|
|
4402
4402
|
API Token Requirements
|
|
4403
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
4403
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$s}`)}
|
|
4404
4404
|
|
|
4405
4405
|
Logs into the Socket API by prompting for an API token
|
|
4406
4406
|
|
|
@@ -4473,9 +4473,9 @@ const config$f = {
|
|
|
4473
4473
|
const cmdLogout = {
|
|
4474
4474
|
description: config$f.description,
|
|
4475
4475
|
hidden: config$f.hidden,
|
|
4476
|
-
run: run$
|
|
4476
|
+
run: run$G
|
|
4477
4477
|
};
|
|
4478
|
-
async function run$
|
|
4478
|
+
async function run$G(argv, importMeta, {
|
|
4479
4479
|
parentName
|
|
4480
4480
|
}) {
|
|
4481
4481
|
const cli = utils.meowOrExit({
|
|
@@ -4492,8 +4492,10 @@ async function run$E(argv, importMeta, {
|
|
|
4492
4492
|
attemptLogout();
|
|
4493
4493
|
}
|
|
4494
4494
|
|
|
4495
|
+
const require$6 = require$$5.createRequire((typeof document === 'undefined' ? require$$0.pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli.js', document.baseURI).href)));
|
|
4495
4496
|
const {
|
|
4496
4497
|
PACKAGE_LOCK_JSON,
|
|
4498
|
+
PNPM_LOCK_YAML,
|
|
4497
4499
|
YARN,
|
|
4498
4500
|
YARN_LOCK
|
|
4499
4501
|
} = constants.default;
|
|
@@ -4545,24 +4547,58 @@ async function runCdxgen(argvObj) {
|
|
|
4545
4547
|
},
|
|
4546
4548
|
stdio: 'inherit'
|
|
4547
4549
|
};
|
|
4550
|
+
|
|
4551
|
+
// Detect package manager based on lockfiles
|
|
4552
|
+
const pnpmLockPath = await utils.findUp(PNPM_LOCK_YAML, {
|
|
4553
|
+
onlyFiles: true
|
|
4554
|
+
});
|
|
4555
|
+
const npmLockPath = pnpmLockPath ? undefined : await utils.findUp(PACKAGE_LOCK_JSON, {
|
|
4556
|
+
onlyFiles: true
|
|
4557
|
+
});
|
|
4558
|
+
const yarnLockPath = pnpmLockPath || npmLockPath ? undefined : await utils.findUp(YARN_LOCK, {
|
|
4559
|
+
onlyFiles: true
|
|
4560
|
+
});
|
|
4548
4561
|
let cleanupPackageLock = false;
|
|
4549
|
-
if (argvMutable['type'] !== YARN && nodejsPlatformTypes.has(argvMutable['type']) &&
|
|
4550
|
-
if (
|
|
4562
|
+
if (argvMutable['type'] !== YARN && nodejsPlatformTypes.has(argvMutable['type']) && yarnLockPath) {
|
|
4563
|
+
if (npmLockPath) {
|
|
4551
4564
|
argvMutable['type'] = constants.NPM;
|
|
4552
4565
|
} else {
|
|
4553
4566
|
// Use synp to create a package-lock.json from the yarn.lock,
|
|
4554
4567
|
// based on the node_modules folder, for a more accurate SBOM.
|
|
4555
4568
|
try {
|
|
4556
|
-
const
|
|
4557
|
-
|
|
4558
|
-
|
|
4569
|
+
const useYarnBerry = utils.isYarnBerry();
|
|
4570
|
+
let args;
|
|
4571
|
+
let synpPromise;
|
|
4572
|
+
if (pnpmLockPath) {
|
|
4573
|
+
args = ['dlx', `synp@${constants.default.ENV.INLINED_SOCKET_CLI_SYNP_VERSION}`, '--source-file', `./${YARN_LOCK}`];
|
|
4574
|
+
const shadowPnpmBin = /*@__PURE__*/require$6(constants.default.shadowPnpmBinPath);
|
|
4575
|
+
synpPromise = (await shadowPnpmBin(args, shadowOpts)).spawnPromise;
|
|
4576
|
+
} else if (useYarnBerry) {
|
|
4577
|
+
args = ['dlx', `synp@${constants.default.ENV.INLINED_SOCKET_CLI_SYNP_VERSION}`, '--source-file', `./${YARN_LOCK}`];
|
|
4578
|
+
const shadowYarnBin = /*@__PURE__*/require$6(constants.default.shadowYarnBinPath);
|
|
4579
|
+
synpPromise = (await shadowYarnBin(args, shadowOpts)).spawnPromise;
|
|
4580
|
+
} else {
|
|
4581
|
+
args = ['exec', '--yes', `synp@${constants.default.ENV.INLINED_SOCKET_CLI_SYNP_VERSION}`, '--source-file', `./${YARN_LOCK}`];
|
|
4582
|
+
synpPromise = (await shadowNpmBin('npm', args, shadowOpts)).spawnPromise;
|
|
4583
|
+
}
|
|
4559
4584
|
await synpPromise;
|
|
4560
4585
|
argvMutable['type'] = constants.NPM;
|
|
4561
4586
|
cleanupPackageLock = true;
|
|
4562
4587
|
} catch {}
|
|
4563
4588
|
}
|
|
4564
4589
|
}
|
|
4565
|
-
|
|
4590
|
+
|
|
4591
|
+
// Use appropriate package manager for cdxgen
|
|
4592
|
+
let shadowResult;
|
|
4593
|
+
if (pnpmLockPath) {
|
|
4594
|
+
const shadowPnpmBin = /*@__PURE__*/require$6(constants.default.shadowPnpmBinPath);
|
|
4595
|
+
shadowResult = await shadowPnpmBin(['dlx', '--silent', `@cyclonedx/cdxgen@${constants.default.ENV.INLINED_SOCKET_CLI_CYCLONEDX_CDXGEN_VERSION}`, ...argvToArray(argvMutable)], shadowOpts);
|
|
4596
|
+
} else if (yarnLockPath && utils.isYarnBerry()) {
|
|
4597
|
+
const shadowYarnBin = /*@__PURE__*/require$6(constants.default.shadowYarnBinPath);
|
|
4598
|
+
shadowResult = await shadowYarnBin(['dlx', '--quiet', `@cyclonedx/cdxgen@${constants.default.ENV.INLINED_SOCKET_CLI_CYCLONEDX_CDXGEN_VERSION}`, ...argvToArray(argvMutable)], shadowOpts);
|
|
4599
|
+
} else {
|
|
4600
|
+
shadowResult = await shadowNpmBin('npm', ['exec', '--silent', '--yes', `@cyclonedx/cdxgen@${constants.default.ENV.INLINED_SOCKET_CLI_CYCLONEDX_CDXGEN_VERSION}`, '--', ...argvToArray(argvMutable)], shadowOpts);
|
|
4601
|
+
}
|
|
4566
4602
|
shadowResult.spawnPromise.process.on('exit', () => {
|
|
4567
4603
|
if (cleanupPackageLock) {
|
|
4568
4604
|
try {
|
|
@@ -4785,9 +4821,9 @@ const config$e = {
|
|
|
4785
4821
|
const cmdManifestCdxgen = {
|
|
4786
4822
|
description: config$e.description,
|
|
4787
4823
|
hidden: config$e.hidden,
|
|
4788
|
-
run: run$
|
|
4824
|
+
run: run$F
|
|
4789
4825
|
};
|
|
4790
|
-
async function run$
|
|
4826
|
+
async function run$F(argv, importMeta, context) {
|
|
4791
4827
|
const {
|
|
4792
4828
|
parentName
|
|
4793
4829
|
} = {
|
|
@@ -4805,7 +4841,7 @@ async function run$D(argv, importMeta, context) {
|
|
|
4805
4841
|
dryRun
|
|
4806
4842
|
} = cli.flags;
|
|
4807
4843
|
|
|
4808
|
-
// Filter Socket flags from argv but keep --no-banner and --help for cdxgen
|
|
4844
|
+
// Filter Socket flags from argv but keep --no-banner and --help for cdxgen.
|
|
4809
4845
|
const argsToProcess = utils.filterFlags(argv, {
|
|
4810
4846
|
...flags.commonFlags,
|
|
4811
4847
|
...flags.outputFlags
|
|
@@ -4905,9 +4941,9 @@ const config$d = {
|
|
|
4905
4941
|
const cmdManifestAuto = {
|
|
4906
4942
|
description: config$d.description,
|
|
4907
4943
|
hidden: config$d.hidden,
|
|
4908
|
-
run: run$
|
|
4944
|
+
run: run$E
|
|
4909
4945
|
};
|
|
4910
|
-
async function run$
|
|
4946
|
+
async function run$E(argv, importMeta, {
|
|
4911
4947
|
parentName
|
|
4912
4948
|
}) {
|
|
4913
4949
|
const cli = utils.meowOrExit({
|
|
@@ -4966,14 +5002,15 @@ async function run$C(argv, importMeta, {
|
|
|
4966
5002
|
|
|
4967
5003
|
const config$c = {
|
|
4968
5004
|
commandName: 'conda',
|
|
4969
|
-
description:
|
|
5005
|
+
description: `[beta] Convert a Conda ${constants.ENVIRONMENT_YML} file to a python ${constants.REQUIREMENTS_TXT}`,
|
|
4970
5006
|
hidden: false,
|
|
4971
5007
|
flags: {
|
|
4972
5008
|
...flags.commonFlags,
|
|
4973
5009
|
...flags.outputFlags,
|
|
4974
5010
|
file: {
|
|
4975
5011
|
type: 'string',
|
|
4976
|
-
|
|
5012
|
+
default: '',
|
|
5013
|
+
description: `Input file name (by default for Conda this is "${constants.ENVIRONMENT_YML}"), relative to cwd`
|
|
4977
5014
|
},
|
|
4978
5015
|
stdin: {
|
|
4979
5016
|
type: 'boolean',
|
|
@@ -4981,11 +5018,12 @@ const config$c = {
|
|
|
4981
5018
|
},
|
|
4982
5019
|
out: {
|
|
4983
5020
|
type: 'string',
|
|
5021
|
+
default: '',
|
|
4984
5022
|
description: 'Output path (relative to cwd)'
|
|
4985
5023
|
},
|
|
4986
5024
|
stdout: {
|
|
4987
5025
|
type: 'boolean',
|
|
4988
|
-
description:
|
|
5026
|
+
description: `Print resulting ${constants.REQUIREMENTS_TXT} to stdout (supersedes --out)`
|
|
4989
5027
|
},
|
|
4990
5028
|
verbose: {
|
|
4991
5029
|
type: 'boolean',
|
|
@@ -4997,8 +5035,8 @@ const config$c = {
|
|
|
4997
5035
|
$ ${command} [options] [CWD=.]
|
|
4998
5036
|
|
|
4999
5037
|
Warning: While we don't support Conda necessarily, this tool extracts the pip
|
|
5000
|
-
block from an
|
|
5001
|
-
which you can scan as if it were a
|
|
5038
|
+
block from an ${constants.ENVIRONMENT_YML} and outputs it as a ${constants.REQUIREMENTS_TXT}
|
|
5039
|
+
which you can scan as if it were a PyPI package.
|
|
5002
5040
|
|
|
5003
5041
|
USE AT YOUR OWN RISK
|
|
5004
5042
|
|
|
@@ -5011,15 +5049,15 @@ const config$c = {
|
|
|
5011
5049
|
Examples
|
|
5012
5050
|
|
|
5013
5051
|
$ ${command}
|
|
5014
|
-
$ ${command} ./project/foo --file
|
|
5052
|
+
$ ${command} ./project/foo --file ${constants.ENVIRONMENT_YAML}
|
|
5015
5053
|
`
|
|
5016
5054
|
};
|
|
5017
5055
|
const cmdManifestConda = {
|
|
5018
5056
|
description: config$c.description,
|
|
5019
5057
|
hidden: config$c.hidden,
|
|
5020
|
-
run: run$
|
|
5058
|
+
run: run$D
|
|
5021
5059
|
};
|
|
5022
|
-
async function run$
|
|
5060
|
+
async function run$D(argv, importMeta, {
|
|
5023
5061
|
parentName
|
|
5024
5062
|
}) {
|
|
5025
5063
|
const cli = utils.meowOrExit({
|
|
@@ -5029,10 +5067,10 @@ async function run$B(argv, importMeta, {
|
|
|
5029
5067
|
parentName
|
|
5030
5068
|
});
|
|
5031
5069
|
const {
|
|
5032
|
-
|
|
5033
|
-
|
|
5070
|
+
dryRun,
|
|
5071
|
+
json,
|
|
5072
|
+
markdown
|
|
5034
5073
|
} = cli.flags;
|
|
5035
|
-
const dryRun = !!cli.flags['dryRun'];
|
|
5036
5074
|
let [cwd = '.'] = cli.input;
|
|
5037
5075
|
// Note: path.resolve vs .join:
|
|
5038
5076
|
// If given path is absolute then cwd should not affect it.
|
|
@@ -5049,35 +5087,35 @@ async function run$B(argv, importMeta, {
|
|
|
5049
5087
|
// Set defaults for any flag/arg that is not given. Check socket.json first.
|
|
5050
5088
|
if (stdin === undefined && sockJson.defaults?.manifest?.conda?.stdin !== undefined) {
|
|
5051
5089
|
stdin = sockJson.defaults?.manifest?.conda?.stdin;
|
|
5052
|
-
logger.logger.info(
|
|
5090
|
+
logger.logger.info(`Using default --stdin from ${constants.SOCKET_JSON}:`, stdin);
|
|
5053
5091
|
}
|
|
5054
5092
|
if (stdin) {
|
|
5055
5093
|
filename = '-';
|
|
5056
5094
|
} else if (!filename) {
|
|
5057
5095
|
if (sockJson.defaults?.manifest?.conda?.infile) {
|
|
5058
5096
|
filename = sockJson.defaults?.manifest?.conda?.infile;
|
|
5059
|
-
logger.logger.info(
|
|
5097
|
+
logger.logger.info(`Using default --file from ${constants.SOCKET_JSON}:`, filename);
|
|
5060
5098
|
} else {
|
|
5061
|
-
filename =
|
|
5099
|
+
filename = constants.ENVIRONMENT_YML;
|
|
5062
5100
|
}
|
|
5063
5101
|
}
|
|
5064
5102
|
if (stdout === undefined && sockJson.defaults?.manifest?.conda?.stdout !== undefined) {
|
|
5065
5103
|
stdout = sockJson.defaults?.manifest?.conda?.stdout;
|
|
5066
|
-
logger.logger.info(
|
|
5104
|
+
logger.logger.info(`Using default --stdout from ${constants.SOCKET_JSON}:`, stdout);
|
|
5067
5105
|
}
|
|
5068
5106
|
if (stdout) {
|
|
5069
5107
|
out = '-';
|
|
5070
5108
|
} else if (!out) {
|
|
5071
5109
|
if (sockJson.defaults?.manifest?.conda?.outfile) {
|
|
5072
5110
|
out = sockJson.defaults?.manifest?.conda?.outfile;
|
|
5073
|
-
logger.logger.info(
|
|
5111
|
+
logger.logger.info(`Using default --out from ${constants.SOCKET_JSON}:`, out);
|
|
5074
5112
|
} else {
|
|
5075
|
-
out =
|
|
5113
|
+
out = constants.REQUIREMENTS_TXT;
|
|
5076
5114
|
}
|
|
5077
5115
|
}
|
|
5078
5116
|
if (verbose === undefined && sockJson.defaults?.manifest?.conda?.verbose !== undefined) {
|
|
5079
5117
|
verbose = sockJson.defaults?.manifest?.conda?.verbose;
|
|
5080
|
-
logger.logger.info(
|
|
5118
|
+
logger.logger.info(`Using default --verbose from ${constants.SOCKET_JSON}:`, verbose);
|
|
5081
5119
|
} else if (verbose === undefined) {
|
|
5082
5120
|
verbose = false;
|
|
5083
5121
|
}
|
|
@@ -5111,10 +5149,10 @@ async function run$B(argv, importMeta, {
|
|
|
5111
5149
|
}
|
|
5112
5150
|
await handleManifestConda({
|
|
5113
5151
|
cwd,
|
|
5114
|
-
filename
|
|
5115
|
-
out
|
|
5152
|
+
filename,
|
|
5153
|
+
out,
|
|
5116
5154
|
outputKind,
|
|
5117
|
-
verbose
|
|
5155
|
+
verbose
|
|
5118
5156
|
});
|
|
5119
5157
|
}
|
|
5120
5158
|
|
|
@@ -5149,7 +5187,7 @@ const config$b = {
|
|
|
5149
5187
|
global \`gradle\` binary but that may not work (hard to predict).
|
|
5150
5188
|
|
|
5151
5189
|
The \`pom.xml\` is a manifest file similar to \`package.json\` for npm or
|
|
5152
|
-
or
|
|
5190
|
+
or ${constants.REQUIREMENTS_TXT} for PyPi), but specifically for Maven, which is Java's
|
|
5153
5191
|
dependency repository. Languages like Kotlin and Scala piggy back on it too.
|
|
5154
5192
|
|
|
5155
5193
|
There are some caveats with the gradle to \`pom.xml\` conversion:
|
|
@@ -5173,9 +5211,9 @@ const config$b = {
|
|
|
5173
5211
|
const cmdManifestGradle = {
|
|
5174
5212
|
description: config$b.description,
|
|
5175
5213
|
hidden: config$b.hidden,
|
|
5176
|
-
run: run$
|
|
5214
|
+
run: run$C
|
|
5177
5215
|
};
|
|
5178
|
-
async function run$
|
|
5216
|
+
async function run$C(argv, importMeta, {
|
|
5179
5217
|
parentName
|
|
5180
5218
|
}) {
|
|
5181
5219
|
const cli = utils.meowOrExit({
|
|
@@ -5197,7 +5235,7 @@ async function run$A(argv, importMeta, {
|
|
|
5197
5235
|
// If given path is absolute then cwd should not affect it.
|
|
5198
5236
|
cwd = path.resolve(process.cwd(), cwd);
|
|
5199
5237
|
const sockJson = utils.readOrDefaultSocketJson(cwd);
|
|
5200
|
-
require$$9.debugFn('inspect',
|
|
5238
|
+
require$$9.debugFn('inspect', `override: ${constants.SOCKET_JSON} gradle`, sockJson?.defaults?.manifest?.gradle);
|
|
5201
5239
|
let {
|
|
5202
5240
|
bin,
|
|
5203
5241
|
gradleOpts,
|
|
@@ -5208,7 +5246,7 @@ async function run$A(argv, importMeta, {
|
|
|
5208
5246
|
if (!bin) {
|
|
5209
5247
|
if (sockJson.defaults?.manifest?.gradle?.bin) {
|
|
5210
5248
|
bin = sockJson.defaults?.manifest?.gradle?.bin;
|
|
5211
|
-
logger.logger.info(
|
|
5249
|
+
logger.logger.info(`Using default --bin from ${constants.SOCKET_JSON}:`, bin);
|
|
5212
5250
|
} else {
|
|
5213
5251
|
bin = path.join(cwd, 'gradlew');
|
|
5214
5252
|
}
|
|
@@ -5216,7 +5254,7 @@ async function run$A(argv, importMeta, {
|
|
|
5216
5254
|
if (!gradleOpts) {
|
|
5217
5255
|
if (sockJson.defaults?.manifest?.gradle?.gradleOpts) {
|
|
5218
5256
|
gradleOpts = sockJson.defaults?.manifest?.gradle?.gradleOpts;
|
|
5219
|
-
logger.logger.info(
|
|
5257
|
+
logger.logger.info(`Using default --gradle-opts from ${constants.SOCKET_JSON}:`, gradleOpts);
|
|
5220
5258
|
} else {
|
|
5221
5259
|
gradleOpts = '';
|
|
5222
5260
|
}
|
|
@@ -5224,7 +5262,7 @@ async function run$A(argv, importMeta, {
|
|
|
5224
5262
|
if (verbose === undefined) {
|
|
5225
5263
|
if (sockJson.defaults?.manifest?.gradle?.verbose !== undefined) {
|
|
5226
5264
|
verbose = sockJson.defaults?.manifest?.gradle?.verbose;
|
|
5227
|
-
logger.logger.info(
|
|
5265
|
+
logger.logger.info(`Using default --verbose from ${constants.SOCKET_JSON}:`, verbose);
|
|
5228
5266
|
} else {
|
|
5229
5267
|
verbose = false;
|
|
5230
5268
|
}
|
|
@@ -5304,7 +5342,7 @@ const config$a = {
|
|
|
5304
5342
|
global \`gradle\` binary but that may not work (hard to predict).
|
|
5305
5343
|
|
|
5306
5344
|
The \`pom.xml\` is a manifest file similar to \`package.json\` for npm or
|
|
5307
|
-
or
|
|
5345
|
+
or ${constants.REQUIREMENTS_TXT} for PyPi), but specifically for Maven, which is Java's
|
|
5308
5346
|
dependency repository. Languages like Kotlin and Scala piggy back on it too.
|
|
5309
5347
|
|
|
5310
5348
|
There are some caveats with the gradle to \`pom.xml\` conversion:
|
|
@@ -5328,9 +5366,9 @@ const config$a = {
|
|
|
5328
5366
|
const cmdManifestKotlin = {
|
|
5329
5367
|
description: config$a.description,
|
|
5330
5368
|
hidden: config$a.hidden,
|
|
5331
|
-
run: run$
|
|
5369
|
+
run: run$B
|
|
5332
5370
|
};
|
|
5333
|
-
async function run$
|
|
5371
|
+
async function run$B(argv, importMeta, {
|
|
5334
5372
|
parentName
|
|
5335
5373
|
}) {
|
|
5336
5374
|
const cli = utils.meowOrExit({
|
|
@@ -5352,7 +5390,7 @@ async function run$z(argv, importMeta, {
|
|
|
5352
5390
|
// If given path is absolute then cwd should not affect it.
|
|
5353
5391
|
cwd = path.resolve(process.cwd(), cwd);
|
|
5354
5392
|
const sockJson = utils.readOrDefaultSocketJson(cwd);
|
|
5355
|
-
require$$9.debugFn('inspect',
|
|
5393
|
+
require$$9.debugFn('inspect', `override: ${constants.SOCKET_JSON} gradle`, sockJson?.defaults?.manifest?.gradle);
|
|
5356
5394
|
let {
|
|
5357
5395
|
bin,
|
|
5358
5396
|
gradleOpts,
|
|
@@ -5363,7 +5401,7 @@ async function run$z(argv, importMeta, {
|
|
|
5363
5401
|
if (!bin) {
|
|
5364
5402
|
if (sockJson.defaults?.manifest?.gradle?.bin) {
|
|
5365
5403
|
bin = sockJson.defaults?.manifest?.gradle?.bin;
|
|
5366
|
-
logger.logger.info(
|
|
5404
|
+
logger.logger.info(`Using default --bin from ${constants.SOCKET_JSON}:`, bin);
|
|
5367
5405
|
} else {
|
|
5368
5406
|
bin = path.join(cwd, 'gradlew');
|
|
5369
5407
|
}
|
|
@@ -5371,7 +5409,7 @@ async function run$z(argv, importMeta, {
|
|
|
5371
5409
|
if (!gradleOpts) {
|
|
5372
5410
|
if (sockJson.defaults?.manifest?.gradle?.gradleOpts) {
|
|
5373
5411
|
gradleOpts = sockJson.defaults?.manifest?.gradle?.gradleOpts;
|
|
5374
|
-
logger.logger.info(
|
|
5412
|
+
logger.logger.info(`Using default --gradle-opts from ${constants.SOCKET_JSON}:`, gradleOpts);
|
|
5375
5413
|
} else {
|
|
5376
5414
|
gradleOpts = '';
|
|
5377
5415
|
}
|
|
@@ -5379,7 +5417,7 @@ async function run$z(argv, importMeta, {
|
|
|
5379
5417
|
if (verbose === undefined) {
|
|
5380
5418
|
if (sockJson.defaults?.manifest?.gradle?.verbose !== undefined) {
|
|
5381
5419
|
verbose = sockJson.defaults?.manifest?.gradle?.verbose;
|
|
5382
|
-
logger.logger.info(
|
|
5420
|
+
logger.logger.info(`Using default --verbose from ${constants.SOCKET_JSON}:`, verbose);
|
|
5383
5421
|
} else {
|
|
5384
5422
|
verbose = false;
|
|
5385
5423
|
}
|
|
@@ -5459,7 +5497,7 @@ const config$9 = {
|
|
|
5459
5497
|
|
|
5460
5498
|
Uses \`sbt makePom\` to generate a \`pom.xml\` from your \`build.sbt\` file.
|
|
5461
5499
|
This xml file is the dependency manifest (like a package.json
|
|
5462
|
-
for Node.js or
|
|
5500
|
+
for Node.js or ${constants.REQUIREMENTS_TXT} for PyPi), but specifically for Scala.
|
|
5463
5501
|
|
|
5464
5502
|
There are some caveats with \`build.sbt\` to \`pom.xml\` conversion:
|
|
5465
5503
|
|
|
@@ -5491,9 +5529,9 @@ const config$9 = {
|
|
|
5491
5529
|
const cmdManifestScala = {
|
|
5492
5530
|
description: config$9.description,
|
|
5493
5531
|
hidden: config$9.hidden,
|
|
5494
|
-
run: run$
|
|
5532
|
+
run: run$A
|
|
5495
5533
|
};
|
|
5496
|
-
async function run$
|
|
5534
|
+
async function run$A(argv, importMeta, {
|
|
5497
5535
|
parentName
|
|
5498
5536
|
}) {
|
|
5499
5537
|
const cli = utils.meowOrExit({
|
|
@@ -5515,7 +5553,7 @@ async function run$y(argv, importMeta, {
|
|
|
5515
5553
|
// TODO: Implement json/md further.
|
|
5516
5554
|
const outputKind = utils.getOutputKind(json, markdown);
|
|
5517
5555
|
const sockJson = utils.readOrDefaultSocketJson(cwd);
|
|
5518
|
-
require$$9.debugFn('inspect',
|
|
5556
|
+
require$$9.debugFn('inspect', `override: ${constants.SOCKET_JSON} sbt`, sockJson?.defaults?.manifest?.sbt);
|
|
5519
5557
|
let {
|
|
5520
5558
|
bin,
|
|
5521
5559
|
out,
|
|
@@ -5528,21 +5566,21 @@ async function run$y(argv, importMeta, {
|
|
|
5528
5566
|
if (!bin) {
|
|
5529
5567
|
if (sockJson.defaults?.manifest?.sbt?.bin) {
|
|
5530
5568
|
bin = sockJson.defaults?.manifest?.sbt?.bin;
|
|
5531
|
-
logger.logger.info(
|
|
5569
|
+
logger.logger.info(`Using default --bin from ${constants.SOCKET_JSON}:`, bin);
|
|
5532
5570
|
} else {
|
|
5533
5571
|
bin = 'sbt';
|
|
5534
5572
|
}
|
|
5535
5573
|
}
|
|
5536
5574
|
if (stdout === undefined && sockJson.defaults?.manifest?.sbt?.stdout !== undefined) {
|
|
5537
5575
|
stdout = sockJson.defaults?.manifest?.sbt?.stdout;
|
|
5538
|
-
logger.logger.info(
|
|
5576
|
+
logger.logger.info(`Using default --stdout from ${constants.SOCKET_JSON}:`, stdout);
|
|
5539
5577
|
}
|
|
5540
5578
|
if (stdout) {
|
|
5541
5579
|
out = '-';
|
|
5542
5580
|
} else if (!out) {
|
|
5543
5581
|
if (sockJson.defaults?.manifest?.sbt?.outfile) {
|
|
5544
5582
|
out = sockJson.defaults?.manifest?.sbt?.outfile;
|
|
5545
|
-
logger.logger.info(
|
|
5583
|
+
logger.logger.info(`Using default --out from ${constants.SOCKET_JSON}:`, out);
|
|
5546
5584
|
} else {
|
|
5547
5585
|
out = './socket.pom.xml';
|
|
5548
5586
|
}
|
|
@@ -5550,14 +5588,14 @@ async function run$y(argv, importMeta, {
|
|
|
5550
5588
|
if (!sbtOpts) {
|
|
5551
5589
|
if (sockJson.defaults?.manifest?.sbt?.sbtOpts) {
|
|
5552
5590
|
sbtOpts = sockJson.defaults?.manifest?.sbt?.sbtOpts;
|
|
5553
|
-
logger.logger.info(
|
|
5591
|
+
logger.logger.info(`Using default --sbt-opts from ${constants.SOCKET_JSON}:`, sbtOpts);
|
|
5554
5592
|
} else {
|
|
5555
5593
|
sbtOpts = '';
|
|
5556
5594
|
}
|
|
5557
5595
|
}
|
|
5558
5596
|
if (verbose === undefined && sockJson.defaults?.manifest?.sbt?.verbose !== undefined) {
|
|
5559
5597
|
verbose = sockJson.defaults?.manifest?.sbt?.verbose;
|
|
5560
|
-
logger.logger.info(
|
|
5598
|
+
logger.logger.info(`Using default --verbose from ${constants.SOCKET_JSON}:`, verbose);
|
|
5561
5599
|
} else if (verbose === undefined) {
|
|
5562
5600
|
verbose = false;
|
|
5563
5601
|
}
|
|
@@ -5625,18 +5663,18 @@ async function setupManifestConfig(cwd, defaultOnReadError = false) {
|
|
|
5625
5663
|
// - each target will have its own specific options
|
|
5626
5664
|
// - record them to the socket.yml (or socket-cli.yml ? or just socket.json ?)
|
|
5627
5665
|
|
|
5628
|
-
const jsonPath = path.join(cwd,
|
|
5666
|
+
const jsonPath = path.join(cwd, constants.SOCKET_JSON);
|
|
5629
5667
|
if (fs$1.existsSync(jsonPath)) {
|
|
5630
|
-
logger.logger.info(`Found
|
|
5668
|
+
logger.logger.info(`Found ${constants.SOCKET_JSON} at ${jsonPath}`);
|
|
5631
5669
|
} else {
|
|
5632
|
-
logger.logger.info(`No
|
|
5670
|
+
logger.logger.info(`No ${constants.SOCKET_JSON} found at ${cwd}, will generate a new one`);
|
|
5633
5671
|
}
|
|
5634
5672
|
logger.logger.log('');
|
|
5635
5673
|
logger.logger.log('Note: This tool will set up flag and argument defaults for certain');
|
|
5636
5674
|
logger.logger.log(' CLI commands. You can still override them by explicitly');
|
|
5637
5675
|
logger.logger.log(' setting the flag. It is meant to be a convenience tool.');
|
|
5638
5676
|
logger.logger.log('');
|
|
5639
|
-
logger.logger.log(
|
|
5677
|
+
logger.logger.log(`This command will generate a ${constants.SOCKET_JSON} file in the target cwd.`);
|
|
5640
5678
|
logger.logger.log('You can choose to add this file to your repo (handy for collaboration)');
|
|
5641
5679
|
logger.logger.log('or to add it to the ignored files, or neither. This file is only');
|
|
5642
5680
|
logger.logger.log('used in CLI workflows.');
|
|
@@ -5644,7 +5682,7 @@ async function setupManifestConfig(cwd, defaultOnReadError = false) {
|
|
|
5644
5682
|
const choices = [{
|
|
5645
5683
|
name: 'Conda'.padEnd(30, ' '),
|
|
5646
5684
|
value: 'conda',
|
|
5647
|
-
description:
|
|
5685
|
+
description: `Generate ${constants.REQUIREMENTS_TXT} from a Conda environment.yml`
|
|
5648
5686
|
}, {
|
|
5649
5687
|
name: 'Gradle'.padEnd(30, ' '),
|
|
5650
5688
|
value: 'gradle',
|
|
@@ -5737,7 +5775,7 @@ async function setupManifestConfig(cwd, defaultOnReadError = false) {
|
|
|
5737
5775
|
return result;
|
|
5738
5776
|
}
|
|
5739
5777
|
logger.logger.log('');
|
|
5740
|
-
logger.logger.log(
|
|
5778
|
+
logger.logger.log(`Setup complete. Writing ${constants.SOCKET_JSON}`);
|
|
5741
5779
|
logger.logger.log('');
|
|
5742
5780
|
if (await prompts.select({
|
|
5743
5781
|
message: `Do you want to write the new config to ${jsonPath} ?`,
|
|
@@ -5788,7 +5826,7 @@ async function setupConda(config) {
|
|
|
5788
5826
|
delete config.stdout;
|
|
5789
5827
|
}
|
|
5790
5828
|
if (!config.stdout) {
|
|
5791
|
-
const out = await askForOutputFile(config.outfile ||
|
|
5829
|
+
const out = await askForOutputFile(config.outfile || constants.REQUIREMENTS_TXT);
|
|
5792
5830
|
if (out === undefined) {
|
|
5793
5831
|
return canceledByUser$1();
|
|
5794
5832
|
} else if (out === '-') {
|
|
@@ -6015,7 +6053,7 @@ const config$8 = {
|
|
|
6015
6053
|
...flags.commonFlags,
|
|
6016
6054
|
defaultOnReadError: {
|
|
6017
6055
|
type: 'boolean',
|
|
6018
|
-
description:
|
|
6056
|
+
description: `If reading the ${constants.SOCKET_JSON} fails, just use a default config? Warning: This might override the existing json file!`
|
|
6019
6057
|
}
|
|
6020
6058
|
},
|
|
6021
6059
|
help: (command, config) => `
|
|
@@ -6028,7 +6066,7 @@ const config$8 = {
|
|
|
6028
6066
|
This command will try to detect all supported ecosystems in given CWD. Then
|
|
6029
6067
|
it starts a configurator where you can setup default values for certain flags
|
|
6030
6068
|
when creating manifest files in that dir. These configuration details are
|
|
6031
|
-
then stored in a local
|
|
6069
|
+
then stored in a local \`${constants.SOCKET_JSON}\` file (which you may or may not commit
|
|
6032
6070
|
to the repo). Next time you run \`socket manifest ...\` it will load this
|
|
6033
6071
|
json file and any flags which are not explicitly set in the command but which
|
|
6034
6072
|
have been registered in the json file will get the default value set to that
|
|
@@ -6052,9 +6090,9 @@ const config$8 = {
|
|
|
6052
6090
|
const cmdManifestSetup = {
|
|
6053
6091
|
description: config$8.description,
|
|
6054
6092
|
hidden: config$8.hidden,
|
|
6055
|
-
run: run$
|
|
6093
|
+
run: run$z
|
|
6056
6094
|
};
|
|
6057
|
-
async function run$
|
|
6095
|
+
async function run$z(argv, importMeta, {
|
|
6058
6096
|
parentName
|
|
6059
6097
|
}) {
|
|
6060
6098
|
const cli = utils.meowOrExit({
|
|
@@ -6088,9 +6126,9 @@ const config$7 = {
|
|
|
6088
6126
|
const cmdManifest = {
|
|
6089
6127
|
description: config$7.description,
|
|
6090
6128
|
hidden: config$7.hidden,
|
|
6091
|
-
run: run$
|
|
6129
|
+
run: run$y
|
|
6092
6130
|
};
|
|
6093
|
-
async function run$
|
|
6131
|
+
async function run$y(argv, importMeta, {
|
|
6094
6132
|
parentName
|
|
6095
6133
|
}) {
|
|
6096
6134
|
await utils.meowWithSubcommands({
|
|
@@ -6117,16 +6155,16 @@ async function run$w(argv, importMeta, {
|
|
|
6117
6155
|
});
|
|
6118
6156
|
}
|
|
6119
6157
|
|
|
6120
|
-
const require$
|
|
6121
|
-
const CMD_NAME$
|
|
6122
|
-
const description$
|
|
6123
|
-
const hidden$
|
|
6158
|
+
const require$5 = require$$5.createRequire((typeof document === 'undefined' ? require$$0.pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli.js', document.baseURI).href)));
|
|
6159
|
+
const CMD_NAME$r = constants.NPM;
|
|
6160
|
+
const description$w = 'Run npm with the Socket wrapper';
|
|
6161
|
+
const hidden$q = false;
|
|
6124
6162
|
const cmdNpm = {
|
|
6125
|
-
description: description$
|
|
6126
|
-
hidden: hidden$
|
|
6127
|
-
run: run$
|
|
6163
|
+
description: description$w,
|
|
6164
|
+
hidden: hidden$q,
|
|
6165
|
+
run: run$x
|
|
6128
6166
|
};
|
|
6129
|
-
async function run$
|
|
6167
|
+
async function run$x(argv, importMeta, context) {
|
|
6130
6168
|
const {
|
|
6131
6169
|
parentName
|
|
6132
6170
|
} = {
|
|
@@ -6134,9 +6172,9 @@ async function run$v(argv, importMeta, context) {
|
|
|
6134
6172
|
...context
|
|
6135
6173
|
};
|
|
6136
6174
|
const config = {
|
|
6137
|
-
commandName: CMD_NAME$
|
|
6138
|
-
description: description$
|
|
6139
|
-
hidden: hidden$
|
|
6175
|
+
commandName: CMD_NAME$r,
|
|
6176
|
+
description: description$w,
|
|
6177
|
+
hidden: hidden$q,
|
|
6140
6178
|
flags: {
|
|
6141
6179
|
...flags.commonFlags
|
|
6142
6180
|
},
|
|
@@ -6145,7 +6183,7 @@ async function run$v(argv, importMeta, context) {
|
|
|
6145
6183
|
$ ${command} ...
|
|
6146
6184
|
|
|
6147
6185
|
API Token Requirements
|
|
6148
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
6186
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$r}`)}
|
|
6149
6187
|
|
|
6150
6188
|
Note: Everything after "npm" is passed to the npm command.
|
|
6151
6189
|
Only the \`--dry-run\` and \`--help\` flags are caught here.
|
|
@@ -6155,6 +6193,7 @@ async function run$v(argv, importMeta, context) {
|
|
|
6155
6193
|
Examples
|
|
6156
6194
|
$ ${command}
|
|
6157
6195
|
$ ${command} install -g cowsay
|
|
6196
|
+
$ ${command} exec cowsay
|
|
6158
6197
|
`
|
|
6159
6198
|
};
|
|
6160
6199
|
const cli = utils.meowOrExit({
|
|
@@ -6168,10 +6207,10 @@ async function run$v(argv, importMeta, context) {
|
|
|
6168
6207
|
logger.logger.log(constants.default.DRY_RUN_BAILING_NOW);
|
|
6169
6208
|
return;
|
|
6170
6209
|
}
|
|
6171
|
-
const shadowBin = /*@__PURE__*/require$
|
|
6210
|
+
const shadowBin = /*@__PURE__*/require$5(constants.default.shadowNpmBinPath);
|
|
6172
6211
|
process.exitCode = 1;
|
|
6173
6212
|
|
|
6174
|
-
// Filter Socket flags from argv but keep --json for npm
|
|
6213
|
+
// Filter Socket flags from argv but keep --json for npm.
|
|
6175
6214
|
const argsToForward = utils.filterFlags(argv, {
|
|
6176
6215
|
...flags.commonFlags,
|
|
6177
6216
|
...flags.outputFlags
|
|
@@ -6194,22 +6233,22 @@ async function run$v(argv, importMeta, context) {
|
|
|
6194
6233
|
await spawnPromise;
|
|
6195
6234
|
}
|
|
6196
6235
|
|
|
6197
|
-
const require$
|
|
6198
|
-
const CMD_NAME$
|
|
6199
|
-
const description$
|
|
6200
|
-
const hidden$
|
|
6236
|
+
const require$4 = require$$5.createRequire((typeof document === 'undefined' ? require$$0.pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli.js', document.baseURI).href)));
|
|
6237
|
+
const CMD_NAME$q = constants.NPX;
|
|
6238
|
+
const description$v = 'Run npx with the Socket wrapper';
|
|
6239
|
+
const hidden$p = false;
|
|
6201
6240
|
const cmdNpx = {
|
|
6202
|
-
description: description$
|
|
6203
|
-
hidden: hidden$
|
|
6204
|
-
run: run$
|
|
6241
|
+
description: description$v,
|
|
6242
|
+
hidden: hidden$p,
|
|
6243
|
+
run: run$w
|
|
6205
6244
|
};
|
|
6206
|
-
async function run$
|
|
6245
|
+
async function run$w(argv, importMeta, {
|
|
6207
6246
|
parentName
|
|
6208
6247
|
}) {
|
|
6209
6248
|
const config = {
|
|
6210
|
-
commandName: CMD_NAME$
|
|
6211
|
-
description: description$
|
|
6212
|
-
hidden: hidden$
|
|
6249
|
+
commandName: CMD_NAME$q,
|
|
6250
|
+
description: description$v,
|
|
6251
|
+
hidden: hidden$p,
|
|
6213
6252
|
flags: {
|
|
6214
6253
|
...flags.commonFlags
|
|
6215
6254
|
},
|
|
@@ -6218,7 +6257,7 @@ async function run$u(argv, importMeta, {
|
|
|
6218
6257
|
$ ${command} ...
|
|
6219
6258
|
|
|
6220
6259
|
API Token Requirements
|
|
6221
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
6260
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$q}`)}
|
|
6222
6261
|
|
|
6223
6262
|
Note: Everything after "npx" is passed to the npx command.
|
|
6224
6263
|
Only the \`--dry-run\` and \`--help\` flags are caught here.
|
|
@@ -6227,6 +6266,7 @@ async function run$u(argv, importMeta, {
|
|
|
6227
6266
|
|
|
6228
6267
|
Examples
|
|
6229
6268
|
$ ${command} cowsay
|
|
6269
|
+
$ ${command} cowsay@1.6.0 hello
|
|
6230
6270
|
`
|
|
6231
6271
|
};
|
|
6232
6272
|
const cli = utils.meowOrExit({
|
|
@@ -6240,7 +6280,7 @@ async function run$u(argv, importMeta, {
|
|
|
6240
6280
|
logger.logger.log(constants.default.DRY_RUN_BAILING_NOW);
|
|
6241
6281
|
return;
|
|
6242
6282
|
}
|
|
6243
|
-
const shadowBin = /*@__PURE__*/require$
|
|
6283
|
+
const shadowBin = /*@__PURE__*/require$4(constants.default.shadowNpmBinPath);
|
|
6244
6284
|
process.exitCode = 1;
|
|
6245
6285
|
const {
|
|
6246
6286
|
spawnPromise
|
|
@@ -6283,9 +6323,9 @@ const config$6 = {
|
|
|
6283
6323
|
const cmdOops = {
|
|
6284
6324
|
description: config$6.description,
|
|
6285
6325
|
hidden: config$6.hidden,
|
|
6286
|
-
run: run$
|
|
6326
|
+
run: run$v
|
|
6287
6327
|
};
|
|
6288
|
-
async function run$
|
|
6328
|
+
async function run$v(argv, importMeta, {
|
|
6289
6329
|
parentName
|
|
6290
6330
|
}) {
|
|
6291
6331
|
const cli = utils.meowOrExit({
|
|
@@ -6317,7 +6357,7 @@ async function run$t(argv, importMeta, {
|
|
|
6317
6357
|
logger.logger.fail(utils.failMsgWithBadge('Oops', 'This error was intentionally left blank'));
|
|
6318
6358
|
return;
|
|
6319
6359
|
}
|
|
6320
|
-
throw new Error('This error was intentionally left blank');
|
|
6360
|
+
throw new Error('This error was intentionally left blank.');
|
|
6321
6361
|
}
|
|
6322
6362
|
|
|
6323
6363
|
const {
|
|
@@ -6702,7 +6742,7 @@ async function listPackages(pkgEnvDetails, options) {
|
|
|
6702
6742
|
}
|
|
6703
6743
|
}
|
|
6704
6744
|
|
|
6705
|
-
const CMD_NAME$
|
|
6745
|
+
const CMD_NAME$p = 'socket optimize';
|
|
6706
6746
|
|
|
6707
6747
|
const {
|
|
6708
6748
|
BUN,
|
|
@@ -6874,7 +6914,7 @@ async function addOverrides(pkgEnvDetails, pkgPath, options) {
|
|
|
6874
6914
|
npmExecPath === constants.NPM && !state.warnedPnpmWorkspaceRequiresNpm) {
|
|
6875
6915
|
state.warnedPnpmWorkspaceRequiresNpm = true;
|
|
6876
6916
|
spinner?.stop();
|
|
6877
|
-
logger?.warn(utils.cmdPrefixMessage(CMD_NAME$
|
|
6917
|
+
logger?.warn(utils.cmdPrefixMessage(CMD_NAME$p, `${agent} workspace support requires \`npm ls\`, falling back to \`${agent} list\``));
|
|
6878
6918
|
spinner?.start();
|
|
6879
6919
|
}
|
|
6880
6920
|
const overridesDataObjects = [];
|
|
@@ -7104,7 +7144,7 @@ async function applyOptimization(pkgEnvDetails, {
|
|
|
7104
7144
|
const pkgJsonChanged = addedCount > 0 || updatedCount > 0;
|
|
7105
7145
|
if (pkgJsonChanged || pkgEnvDetails.features.npmBuggyOverrides) {
|
|
7106
7146
|
const result = await updateLockfile(pkgEnvDetails, {
|
|
7107
|
-
cmdName: CMD_NAME$
|
|
7147
|
+
cmdName: CMD_NAME$p,
|
|
7108
7148
|
logger: logger.logger,
|
|
7109
7149
|
spinner
|
|
7110
7150
|
});
|
|
@@ -7166,7 +7206,7 @@ async function handleOptimize({
|
|
|
7166
7206
|
prod
|
|
7167
7207
|
}) {
|
|
7168
7208
|
const pkgEnvCResult = await utils.detectAndValidatePackageEnvironment(cwd, {
|
|
7169
|
-
cmdName: CMD_NAME$
|
|
7209
|
+
cmdName: CMD_NAME$p,
|
|
7170
7210
|
logger: logger.logger,
|
|
7171
7211
|
prod
|
|
7172
7212
|
});
|
|
@@ -7191,7 +7231,7 @@ async function handleOptimize({
|
|
|
7191
7231
|
await outputOptimizeResult({
|
|
7192
7232
|
ok: false,
|
|
7193
7233
|
message: 'Unsupported',
|
|
7194
|
-
cause: utils.cmdPrefixMessage(CMD_NAME$
|
|
7234
|
+
cause: utils.cmdPrefixMessage(CMD_NAME$p, `${agent} v${agentVersion} does not support overrides.`)
|
|
7195
7235
|
}, outputKind);
|
|
7196
7236
|
return;
|
|
7197
7237
|
}
|
|
@@ -7202,21 +7242,21 @@ async function handleOptimize({
|
|
|
7202
7242
|
}), outputKind);
|
|
7203
7243
|
}
|
|
7204
7244
|
|
|
7205
|
-
const CMD_NAME$
|
|
7206
|
-
const description$
|
|
7207
|
-
const hidden$
|
|
7245
|
+
const CMD_NAME$o = 'optimize';
|
|
7246
|
+
const description$u = 'Optimize dependencies with @socketregistry overrides';
|
|
7247
|
+
const hidden$o = false;
|
|
7208
7248
|
const cmdOptimize = {
|
|
7209
|
-
description: description$
|
|
7210
|
-
hidden: hidden$
|
|
7211
|
-
run: run$
|
|
7249
|
+
description: description$u,
|
|
7250
|
+
hidden: hidden$o,
|
|
7251
|
+
run: run$u
|
|
7212
7252
|
};
|
|
7213
|
-
async function run$
|
|
7253
|
+
async function run$u(argv, importMeta, {
|
|
7214
7254
|
parentName
|
|
7215
7255
|
}) {
|
|
7216
7256
|
const config = {
|
|
7217
|
-
commandName: CMD_NAME$
|
|
7218
|
-
description: description$
|
|
7219
|
-
hidden: hidden$
|
|
7257
|
+
commandName: CMD_NAME$o,
|
|
7258
|
+
description: description$u,
|
|
7259
|
+
hidden: hidden$o,
|
|
7220
7260
|
flags: {
|
|
7221
7261
|
...flags.commonFlags,
|
|
7222
7262
|
pin: {
|
|
@@ -7235,7 +7275,7 @@ async function run$s(argv, importMeta, {
|
|
|
7235
7275
|
$ ${command} [options] [CWD=.]
|
|
7236
7276
|
|
|
7237
7277
|
API Token Requirements
|
|
7238
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
7278
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$o}`)}
|
|
7239
7279
|
|
|
7240
7280
|
Options
|
|
7241
7281
|
${utils.getFlagListOutput(config.flags)}
|
|
@@ -7378,21 +7418,21 @@ async function handleDependencies({
|
|
|
7378
7418
|
});
|
|
7379
7419
|
}
|
|
7380
7420
|
|
|
7381
|
-
const CMD_NAME$
|
|
7382
|
-
const description$
|
|
7383
|
-
const hidden$
|
|
7421
|
+
const CMD_NAME$n = 'dependencies';
|
|
7422
|
+
const description$t = 'Search for any dependency that is being used in your organization';
|
|
7423
|
+
const hidden$n = false;
|
|
7384
7424
|
const cmdOrganizationDependencies = {
|
|
7385
|
-
description: description$
|
|
7386
|
-
hidden: hidden$
|
|
7387
|
-
run: run$
|
|
7425
|
+
description: description$t,
|
|
7426
|
+
hidden: hidden$n,
|
|
7427
|
+
run: run$t
|
|
7388
7428
|
};
|
|
7389
|
-
async function run$
|
|
7429
|
+
async function run$t(argv, importMeta, {
|
|
7390
7430
|
parentName
|
|
7391
7431
|
}) {
|
|
7392
7432
|
const config = {
|
|
7393
|
-
commandName: CMD_NAME$
|
|
7394
|
-
description: description$
|
|
7395
|
-
hidden: hidden$
|
|
7433
|
+
commandName: CMD_NAME$n,
|
|
7434
|
+
description: description$t,
|
|
7435
|
+
hidden: hidden$n,
|
|
7396
7436
|
flags: {
|
|
7397
7437
|
...flags.commonFlags,
|
|
7398
7438
|
limit: {
|
|
@@ -7412,7 +7452,7 @@ async function run$r(argv, importMeta, {
|
|
|
7412
7452
|
${command} [options]
|
|
7413
7453
|
|
|
7414
7454
|
API Token Requirements
|
|
7415
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
7455
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$n}`)}
|
|
7416
7456
|
|
|
7417
7457
|
Options
|
|
7418
7458
|
${utils.getFlagListOutput(config.flags)}
|
|
@@ -7512,21 +7552,21 @@ async function handleLicensePolicy(orgSlug, outputKind) {
|
|
|
7512
7552
|
await outputLicensePolicy(data, outputKind);
|
|
7513
7553
|
}
|
|
7514
7554
|
|
|
7515
|
-
const CMD_NAME$
|
|
7516
|
-
const description$
|
|
7517
|
-
const hidden$
|
|
7555
|
+
const CMD_NAME$m = 'license';
|
|
7556
|
+
const description$s = 'Retrieve the license policy of an organization';
|
|
7557
|
+
const hidden$m = false;
|
|
7518
7558
|
const cmdOrganizationPolicyLicense = {
|
|
7519
|
-
description: description$
|
|
7520
|
-
hidden: hidden$
|
|
7521
|
-
run: run$
|
|
7559
|
+
description: description$s,
|
|
7560
|
+
hidden: hidden$m,
|
|
7561
|
+
run: run$s
|
|
7522
7562
|
};
|
|
7523
|
-
async function run$
|
|
7563
|
+
async function run$s(argv, importMeta, {
|
|
7524
7564
|
parentName
|
|
7525
7565
|
}) {
|
|
7526
7566
|
const config = {
|
|
7527
|
-
commandName: CMD_NAME$
|
|
7528
|
-
description: description$
|
|
7529
|
-
hidden: hidden$
|
|
7567
|
+
commandName: CMD_NAME$m,
|
|
7568
|
+
description: description$s,
|
|
7569
|
+
hidden: hidden$m,
|
|
7530
7570
|
flags: {
|
|
7531
7571
|
...flags.commonFlags,
|
|
7532
7572
|
...flags.outputFlags,
|
|
@@ -7545,7 +7585,7 @@ async function run$q(argv, importMeta, {
|
|
|
7545
7585
|
$ ${command} [options]
|
|
7546
7586
|
|
|
7547
7587
|
API Token Requirements
|
|
7548
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
7588
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$m}`)}
|
|
7549
7589
|
|
|
7550
7590
|
Options
|
|
7551
7591
|
${utils.getFlagListOutput(config.flags)}
|
|
@@ -7648,21 +7688,21 @@ async function handleSecurityPolicy(orgSlug, outputKind) {
|
|
|
7648
7688
|
await outputSecurityPolicy(data, outputKind);
|
|
7649
7689
|
}
|
|
7650
7690
|
|
|
7651
|
-
const CMD_NAME$
|
|
7652
|
-
const description$
|
|
7653
|
-
const hidden$
|
|
7691
|
+
const CMD_NAME$l = 'security';
|
|
7692
|
+
const description$r = 'Retrieve the security policy of an organization';
|
|
7693
|
+
const hidden$l = true;
|
|
7654
7694
|
const cmdOrganizationPolicySecurity = {
|
|
7655
|
-
description: description$
|
|
7656
|
-
hidden: hidden$
|
|
7657
|
-
run: run$
|
|
7695
|
+
description: description$r,
|
|
7696
|
+
hidden: hidden$l,
|
|
7697
|
+
run: run$r
|
|
7658
7698
|
};
|
|
7659
|
-
async function run$
|
|
7699
|
+
async function run$r(argv, importMeta, {
|
|
7660
7700
|
parentName
|
|
7661
7701
|
}) {
|
|
7662
7702
|
const config = {
|
|
7663
|
-
commandName: CMD_NAME$
|
|
7664
|
-
description: description$
|
|
7665
|
-
hidden: hidden$
|
|
7703
|
+
commandName: CMD_NAME$l,
|
|
7704
|
+
description: description$r,
|
|
7705
|
+
hidden: hidden$l,
|
|
7666
7706
|
flags: {
|
|
7667
7707
|
...flags.commonFlags,
|
|
7668
7708
|
...flags.outputFlags,
|
|
@@ -7681,7 +7721,7 @@ async function run$p(argv, importMeta, {
|
|
|
7681
7721
|
$ ${command} [options]
|
|
7682
7722
|
|
|
7683
7723
|
API Token Requirements
|
|
7684
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
7724
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$l}`)}
|
|
7685
7725
|
|
|
7686
7726
|
Options
|
|
7687
7727
|
${utils.getFlagListOutput(config.flags)}
|
|
@@ -7785,21 +7825,21 @@ async function handleOrganizationList(outputKind = 'text') {
|
|
|
7785
7825
|
await outputOrganizationList(data, outputKind);
|
|
7786
7826
|
}
|
|
7787
7827
|
|
|
7788
|
-
const CMD_NAME$
|
|
7789
|
-
const description$
|
|
7790
|
-
const hidden$
|
|
7828
|
+
const CMD_NAME$k = 'list';
|
|
7829
|
+
const description$q = 'List organizations associated with the Socket API token';
|
|
7830
|
+
const hidden$k = false;
|
|
7791
7831
|
const cmdOrganizationList = {
|
|
7792
|
-
description: description$
|
|
7793
|
-
hidden: hidden$
|
|
7794
|
-
run: run$
|
|
7832
|
+
description: description$q,
|
|
7833
|
+
hidden: hidden$k,
|
|
7834
|
+
run: run$q
|
|
7795
7835
|
};
|
|
7796
|
-
async function run$
|
|
7836
|
+
async function run$q(argv, importMeta, {
|
|
7797
7837
|
parentName
|
|
7798
7838
|
}) {
|
|
7799
7839
|
const config = {
|
|
7800
|
-
commandName: CMD_NAME$
|
|
7801
|
-
description: description$
|
|
7802
|
-
hidden: hidden$
|
|
7840
|
+
commandName: CMD_NAME$k,
|
|
7841
|
+
description: description$q,
|
|
7842
|
+
hidden: hidden$k,
|
|
7803
7843
|
flags: {
|
|
7804
7844
|
...flags.commonFlags,
|
|
7805
7845
|
...flags.outputFlags
|
|
@@ -7809,7 +7849,7 @@ async function run$o(argv, importMeta, {
|
|
|
7809
7849
|
$ ${command} [options]
|
|
7810
7850
|
|
|
7811
7851
|
API Token Requirements
|
|
7812
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
7852
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$k}`)}
|
|
7813
7853
|
|
|
7814
7854
|
Options
|
|
7815
7855
|
${utils.getFlagListOutput(config.flags)}
|
|
@@ -7853,9 +7893,9 @@ async function run$o(argv, importMeta, {
|
|
|
7853
7893
|
await handleOrganizationList(outputKind);
|
|
7854
7894
|
}
|
|
7855
7895
|
|
|
7856
|
-
const description$
|
|
7896
|
+
const description$p = 'Organization policy details';
|
|
7857
7897
|
const cmdOrganizationPolicy = {
|
|
7858
|
-
description: description$
|
|
7898
|
+
description: description$p,
|
|
7859
7899
|
// Hidden because it was broken all this time (nobody could be using it)
|
|
7860
7900
|
// and we're not sure if it's useful to anyone in its current state.
|
|
7861
7901
|
// Until we do, we'll hide this to keep the help tidier.
|
|
@@ -7869,7 +7909,7 @@ const cmdOrganizationPolicy = {
|
|
|
7869
7909
|
license: cmdOrganizationPolicyLicense
|
|
7870
7910
|
}, {
|
|
7871
7911
|
argv,
|
|
7872
|
-
description: description$
|
|
7912
|
+
description: description$p,
|
|
7873
7913
|
defaultSub: 'list',
|
|
7874
7914
|
// Backwards compat
|
|
7875
7915
|
importMeta,
|
|
@@ -7946,9 +7986,9 @@ const config$5 = {
|
|
|
7946
7986
|
const cmdOrganizationQuota = {
|
|
7947
7987
|
description: config$5.description,
|
|
7948
7988
|
hidden: config$5.hidden,
|
|
7949
|
-
run: run$
|
|
7989
|
+
run: run$p
|
|
7950
7990
|
};
|
|
7951
|
-
async function run$
|
|
7991
|
+
async function run$p(argv, importMeta, {
|
|
7952
7992
|
parentName
|
|
7953
7993
|
}) {
|
|
7954
7994
|
const cli = utils.meowOrExit({
|
|
@@ -7983,9 +8023,9 @@ async function run$n(argv, importMeta, {
|
|
|
7983
8023
|
await handleQuota(outputKind);
|
|
7984
8024
|
}
|
|
7985
8025
|
|
|
7986
|
-
const description$
|
|
8026
|
+
const description$o = 'Manage Socket organization account details';
|
|
7987
8027
|
const cmdOrganization = {
|
|
7988
|
-
description: description$
|
|
8028
|
+
description: description$o,
|
|
7989
8029
|
hidden: false,
|
|
7990
8030
|
async run(argv, importMeta, {
|
|
7991
8031
|
parentName
|
|
@@ -8014,7 +8054,7 @@ const cmdOrganization = {
|
|
|
8014
8054
|
}
|
|
8015
8055
|
},
|
|
8016
8056
|
argv,
|
|
8017
|
-
description: description$
|
|
8057
|
+
description: description$o,
|
|
8018
8058
|
importMeta,
|
|
8019
8059
|
name: `${parentName} organization`
|
|
8020
8060
|
});
|
|
@@ -8239,21 +8279,21 @@ function parsePackageSpecifiers(ecosystem, pkgs) {
|
|
|
8239
8279
|
};
|
|
8240
8280
|
}
|
|
8241
8281
|
|
|
8242
|
-
const CMD_NAME$
|
|
8243
|
-
const description$
|
|
8244
|
-
const hidden$
|
|
8282
|
+
const CMD_NAME$j = 'score';
|
|
8283
|
+
const description$n = 'Look up score for one package which reflects all of its transitive dependencies as well';
|
|
8284
|
+
const hidden$j = false;
|
|
8245
8285
|
const cmdPackageScore = {
|
|
8246
|
-
description: description$
|
|
8247
|
-
hidden: hidden$
|
|
8248
|
-
run: run$
|
|
8286
|
+
description: description$n,
|
|
8287
|
+
hidden: hidden$j,
|
|
8288
|
+
run: run$o
|
|
8249
8289
|
};
|
|
8250
|
-
async function run$
|
|
8290
|
+
async function run$o(argv, importMeta, {
|
|
8251
8291
|
parentName
|
|
8252
8292
|
}) {
|
|
8253
8293
|
const config = {
|
|
8254
|
-
commandName: CMD_NAME$
|
|
8255
|
-
description: description$
|
|
8256
|
-
hidden: hidden$
|
|
8294
|
+
commandName: CMD_NAME$j,
|
|
8295
|
+
description: description$n,
|
|
8296
|
+
hidden: hidden$j,
|
|
8257
8297
|
flags: {
|
|
8258
8298
|
...flags.commonFlags,
|
|
8259
8299
|
...flags.outputFlags
|
|
@@ -8263,7 +8303,7 @@ async function run$m(argv, importMeta, {
|
|
|
8263
8303
|
$ ${command} [options] <<ECOSYSTEM> <NAME> | <PURL>>
|
|
8264
8304
|
|
|
8265
8305
|
API Token Requirements
|
|
8266
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
8306
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$j}`)}
|
|
8267
8307
|
|
|
8268
8308
|
Options
|
|
8269
8309
|
${utils.getFlagListOutput(config.flags)}
|
|
@@ -8470,7 +8510,7 @@ function getAlertString(alerts, options) {
|
|
|
8470
8510
|
return `${colorless}${padding}${arrays.joinAnd([...bad.map(a => `[${a.severity}] ${a.type}`), ...mid.map(a => `[${a.severity}] ${a.type}`), ...low.map(a => `[${a.severity}] ${a.type}`)])}`;
|
|
8471
8511
|
}
|
|
8472
8512
|
function preProcess(artifacts, requestedPurls) {
|
|
8473
|
-
// Dedupe results (for example,
|
|
8513
|
+
// Dedupe results (for example, PyPI will emit one package for each system release (win/mac/cpu) even if it's
|
|
8474
8514
|
// the same package version with same results. The duplication is irrelevant and annoying to the user.
|
|
8475
8515
|
|
|
8476
8516
|
// Make some effort to match the requested data with the response
|
|
@@ -8621,28 +8661,28 @@ async function handlePurlsShallowScore({
|
|
|
8621
8661
|
outputPurlsShallowScore(purls, packageData, outputKind);
|
|
8622
8662
|
}
|
|
8623
8663
|
|
|
8624
|
-
const CMD_NAME$
|
|
8625
|
-
const description$
|
|
8626
|
-
const hidden$
|
|
8664
|
+
const CMD_NAME$i = 'shallow';
|
|
8665
|
+
const description$m = 'Look up info regarding one or more packages but not their transitives';
|
|
8666
|
+
const hidden$i = false;
|
|
8627
8667
|
const cmdPackageShallow = {
|
|
8628
|
-
description: description$
|
|
8629
|
-
hidden: hidden$
|
|
8668
|
+
description: description$m,
|
|
8669
|
+
hidden: hidden$i,
|
|
8630
8670
|
alias: {
|
|
8631
8671
|
shallowScore: {
|
|
8632
|
-
description: description$
|
|
8672
|
+
description: description$m,
|
|
8633
8673
|
hidden: true,
|
|
8634
8674
|
argv: []
|
|
8635
8675
|
}
|
|
8636
8676
|
},
|
|
8637
|
-
run: run$
|
|
8677
|
+
run: run$n
|
|
8638
8678
|
};
|
|
8639
|
-
async function run$
|
|
8679
|
+
async function run$n(argv, importMeta, {
|
|
8640
8680
|
parentName
|
|
8641
8681
|
}) {
|
|
8642
8682
|
const config = {
|
|
8643
|
-
commandName: CMD_NAME$
|
|
8644
|
-
description: description$
|
|
8645
|
-
hidden: hidden$
|
|
8683
|
+
commandName: CMD_NAME$i,
|
|
8684
|
+
description: description$m,
|
|
8685
|
+
hidden: hidden$i,
|
|
8646
8686
|
flags: {
|
|
8647
8687
|
...flags.commonFlags,
|
|
8648
8688
|
...flags.outputFlags
|
|
@@ -8652,7 +8692,7 @@ async function run$l(argv, importMeta, {
|
|
|
8652
8692
|
$ ${command} [options] <<ECOSYSTEM> <PKGNAME> [<PKGNAME> ...] | <PURL> [<PURL> ...]>
|
|
8653
8693
|
|
|
8654
8694
|
API Token Requirements
|
|
8655
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
8695
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$i}`)}
|
|
8656
8696
|
|
|
8657
8697
|
Options
|
|
8658
8698
|
${utils.getFlagListOutput(config.flags)}
|
|
@@ -8726,9 +8766,9 @@ async function run$l(argv, importMeta, {
|
|
|
8726
8766
|
});
|
|
8727
8767
|
}
|
|
8728
8768
|
|
|
8729
|
-
const description$
|
|
8769
|
+
const description$l = 'Look up published package details';
|
|
8730
8770
|
const cmdPackage = {
|
|
8731
|
-
description: description$
|
|
8771
|
+
description: description$l,
|
|
8732
8772
|
hidden: false,
|
|
8733
8773
|
async run(argv, importMeta, {
|
|
8734
8774
|
parentName
|
|
@@ -8739,13 +8779,13 @@ const cmdPackage = {
|
|
|
8739
8779
|
}, {
|
|
8740
8780
|
aliases: {
|
|
8741
8781
|
deep: {
|
|
8742
|
-
description: description$
|
|
8782
|
+
description: description$l,
|
|
8743
8783
|
hidden: true,
|
|
8744
8784
|
argv: ['score']
|
|
8745
8785
|
}
|
|
8746
8786
|
},
|
|
8747
8787
|
argv,
|
|
8748
|
-
description: description$
|
|
8788
|
+
description: description$l,
|
|
8749
8789
|
importMeta,
|
|
8750
8790
|
name: `${parentName} package`
|
|
8751
8791
|
});
|
|
@@ -8799,7 +8839,7 @@ async function outputPatchResult(result, outputKind) {
|
|
|
8799
8839
|
}
|
|
8800
8840
|
logger.logger.groupEnd();
|
|
8801
8841
|
} else {
|
|
8802
|
-
logger.logger.warn('No packages found requiring patches');
|
|
8842
|
+
logger.logger.warn('No packages found requiring patches.');
|
|
8803
8843
|
}
|
|
8804
8844
|
logger.logger.log('');
|
|
8805
8845
|
logger.logger.success('Patch command completed!');
|
|
@@ -9115,21 +9155,21 @@ async function handlePatch({
|
|
|
9115
9155
|
}
|
|
9116
9156
|
}
|
|
9117
9157
|
|
|
9118
|
-
const CMD_NAME$
|
|
9119
|
-
const description$
|
|
9120
|
-
const hidden$
|
|
9158
|
+
const CMD_NAME$h = 'patch';
|
|
9159
|
+
const description$k = 'Apply CVE patches to dependencies';
|
|
9160
|
+
const hidden$h = true;
|
|
9121
9161
|
const cmdPatch = {
|
|
9122
|
-
description: description$
|
|
9123
|
-
hidden: hidden$
|
|
9124
|
-
run: run$
|
|
9162
|
+
description: description$k,
|
|
9163
|
+
hidden: hidden$h,
|
|
9164
|
+
run: run$m
|
|
9125
9165
|
};
|
|
9126
|
-
async function run$
|
|
9166
|
+
async function run$m(argv, importMeta, {
|
|
9127
9167
|
parentName
|
|
9128
9168
|
}) {
|
|
9129
9169
|
const config = {
|
|
9130
|
-
commandName: CMD_NAME$
|
|
9131
|
-
description: description$
|
|
9132
|
-
hidden: hidden$
|
|
9170
|
+
commandName: CMD_NAME$h,
|
|
9171
|
+
description: description$k,
|
|
9172
|
+
hidden: hidden$h,
|
|
9133
9173
|
flags: {
|
|
9134
9174
|
...flags.commonFlags,
|
|
9135
9175
|
...flags.outputFlags,
|
|
@@ -9146,7 +9186,7 @@ async function run$k(argv, importMeta, {
|
|
|
9146
9186
|
$ ${command} [options] [CWD=.]
|
|
9147
9187
|
|
|
9148
9188
|
API Token Requirements
|
|
9149
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
9189
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$h}`)}
|
|
9150
9190
|
|
|
9151
9191
|
Options
|
|
9152
9192
|
${utils.getFlagListOutput(config.flags)}
|
|
@@ -9206,6 +9246,71 @@ async function run$k(argv, importMeta, {
|
|
|
9206
9246
|
});
|
|
9207
9247
|
}
|
|
9208
9248
|
|
|
9249
|
+
const require$3 = require$$5.createRequire((typeof document === 'undefined' ? require$$0.pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli.js', document.baseURI).href)));
|
|
9250
|
+
const CMD_NAME$g = constants.PNPM;
|
|
9251
|
+
const description$j = 'Run pnpm with the Socket wrapper';
|
|
9252
|
+
const hidden$g = true;
|
|
9253
|
+
const cmdPnpm = {
|
|
9254
|
+
description: description$j,
|
|
9255
|
+
hidden: hidden$g,
|
|
9256
|
+
run: run$l
|
|
9257
|
+
};
|
|
9258
|
+
async function run$l(argv, importMeta, context) {
|
|
9259
|
+
const {
|
|
9260
|
+
parentName
|
|
9261
|
+
} = {
|
|
9262
|
+
__proto__: null,
|
|
9263
|
+
...context
|
|
9264
|
+
};
|
|
9265
|
+
const config = {
|
|
9266
|
+
commandName: CMD_NAME$g,
|
|
9267
|
+
description: description$j,
|
|
9268
|
+
hidden: hidden$g,
|
|
9269
|
+
flags: {
|
|
9270
|
+
...flags.commonFlags
|
|
9271
|
+
},
|
|
9272
|
+
help: command => `
|
|
9273
|
+
Usage
|
|
9274
|
+
$ ${command} ...
|
|
9275
|
+
|
|
9276
|
+
API Token Requirements
|
|
9277
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$g}`)}
|
|
9278
|
+
|
|
9279
|
+
Note: Everything after "pnpm" is passed to the pnpm command.
|
|
9280
|
+
Only the \`--dry-run\` and \`--help\` flags are caught here.
|
|
9281
|
+
|
|
9282
|
+
Use \`socket wrapper on\` to alias this command as \`pnpm\`.
|
|
9283
|
+
|
|
9284
|
+
Examples
|
|
9285
|
+
$ ${command}
|
|
9286
|
+
$ ${command} install
|
|
9287
|
+
$ ${command} add package-name
|
|
9288
|
+
$ ${command} dlx package-name
|
|
9289
|
+
`
|
|
9290
|
+
};
|
|
9291
|
+
const cli = utils.meowOrExit({
|
|
9292
|
+
argv,
|
|
9293
|
+
config,
|
|
9294
|
+
importMeta,
|
|
9295
|
+
parentName
|
|
9296
|
+
});
|
|
9297
|
+
const dryRun = !!cli.flags['dryRun'];
|
|
9298
|
+
if (dryRun) {
|
|
9299
|
+
logger.logger.log(constants.default.DRY_RUN_BAILING_NOW);
|
|
9300
|
+
return;
|
|
9301
|
+
}
|
|
9302
|
+
const shadowBin = /*@__PURE__*/require$3(constants.default.shadowPnpmBinPath);
|
|
9303
|
+
process.exitCode = 1;
|
|
9304
|
+
|
|
9305
|
+
// Filter Socket flags from argv.
|
|
9306
|
+
const filteredArgv = utils.filterFlags(argv, config.flags);
|
|
9307
|
+
const {
|
|
9308
|
+
spawnPromise
|
|
9309
|
+
} = await shadowBin(filteredArgv);
|
|
9310
|
+
await spawnPromise;
|
|
9311
|
+
process.exitCode = 0;
|
|
9312
|
+
}
|
|
9313
|
+
|
|
9209
9314
|
async function runRawNpm(argv) {
|
|
9210
9315
|
process.exitCode = 1;
|
|
9211
9316
|
const spawnPromise = spawn.spawn(utils.getNpmBinPath(), argv, {
|
|
@@ -9250,9 +9355,9 @@ const config$4 = {
|
|
|
9250
9355
|
const cmdRawNpm = {
|
|
9251
9356
|
description: config$4.description,
|
|
9252
9357
|
hidden: config$4.hidden,
|
|
9253
|
-
run: run$
|
|
9358
|
+
run: run$k
|
|
9254
9359
|
};
|
|
9255
|
-
async function run$
|
|
9360
|
+
async function run$k(argv, importMeta, {
|
|
9256
9361
|
parentName
|
|
9257
9362
|
}) {
|
|
9258
9363
|
const cli = utils.meowOrExit({
|
|
@@ -9313,9 +9418,9 @@ const config$3 = {
|
|
|
9313
9418
|
const cmdRawNpx = {
|
|
9314
9419
|
description: config$3.description,
|
|
9315
9420
|
hidden: config$3.hidden,
|
|
9316
|
-
run: run$
|
|
9421
|
+
run: run$j
|
|
9317
9422
|
};
|
|
9318
|
-
async function run$
|
|
9423
|
+
async function run$j(argv, importMeta, {
|
|
9319
9424
|
parentName
|
|
9320
9425
|
}) {
|
|
9321
9426
|
const cli = utils.meowOrExit({
|
|
@@ -9400,21 +9505,21 @@ async function handleCreateRepo({
|
|
|
9400
9505
|
outputCreateRepo(data, repoName, outputKind);
|
|
9401
9506
|
}
|
|
9402
9507
|
|
|
9403
|
-
const CMD_NAME$
|
|
9404
|
-
const description$
|
|
9405
|
-
const hidden$
|
|
9508
|
+
const CMD_NAME$f = 'create';
|
|
9509
|
+
const description$i = 'Create a repository in an organization';
|
|
9510
|
+
const hidden$f = false;
|
|
9406
9511
|
const cmdRepositoryCreate = {
|
|
9407
|
-
description: description$
|
|
9408
|
-
hidden: hidden$
|
|
9409
|
-
run: run$
|
|
9512
|
+
description: description$i,
|
|
9513
|
+
hidden: hidden$f,
|
|
9514
|
+
run: run$i
|
|
9410
9515
|
};
|
|
9411
|
-
async function run$
|
|
9516
|
+
async function run$i(argv, importMeta, {
|
|
9412
9517
|
parentName
|
|
9413
9518
|
}) {
|
|
9414
9519
|
const config = {
|
|
9415
|
-
commandName: CMD_NAME$
|
|
9416
|
-
description: description$
|
|
9417
|
-
hidden: hidden$
|
|
9520
|
+
commandName: CMD_NAME$f,
|
|
9521
|
+
description: description$i,
|
|
9522
|
+
hidden: hidden$f,
|
|
9418
9523
|
flags: {
|
|
9419
9524
|
...flags.commonFlags,
|
|
9420
9525
|
...flags.outputFlags,
|
|
@@ -9453,7 +9558,7 @@ async function run$h(argv, importMeta, {
|
|
|
9453
9558
|
$ ${command} [options] <REPO>
|
|
9454
9559
|
|
|
9455
9560
|
API Token Requirements
|
|
9456
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
9561
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$f}`)}
|
|
9457
9562
|
|
|
9458
9563
|
The REPO name should be a "slug". Follows the same naming convention as GitHub.
|
|
9459
9564
|
|
|
@@ -9559,21 +9664,21 @@ async function handleDeleteRepo(orgSlug, repoName, outputKind) {
|
|
|
9559
9664
|
await outputDeleteRepo(data, repoName, outputKind);
|
|
9560
9665
|
}
|
|
9561
9666
|
|
|
9562
|
-
const CMD_NAME$
|
|
9563
|
-
const description$
|
|
9564
|
-
const hidden$
|
|
9667
|
+
const CMD_NAME$e = 'del';
|
|
9668
|
+
const description$h = 'Delete a repository in an organization';
|
|
9669
|
+
const hidden$e = false;
|
|
9565
9670
|
const cmdRepositoryDel = {
|
|
9566
|
-
description: description$
|
|
9567
|
-
hidden: hidden$
|
|
9568
|
-
run: run$
|
|
9671
|
+
description: description$h,
|
|
9672
|
+
hidden: hidden$e,
|
|
9673
|
+
run: run$h
|
|
9569
9674
|
};
|
|
9570
|
-
async function run$
|
|
9675
|
+
async function run$h(argv, importMeta, {
|
|
9571
9676
|
parentName
|
|
9572
9677
|
}) {
|
|
9573
9678
|
const config = {
|
|
9574
|
-
commandName: CMD_NAME$
|
|
9575
|
-
description: description$
|
|
9576
|
-
hidden: hidden$
|
|
9679
|
+
commandName: CMD_NAME$e,
|
|
9680
|
+
description: description$h,
|
|
9681
|
+
hidden: hidden$e,
|
|
9577
9682
|
flags: {
|
|
9578
9683
|
...flags.commonFlags,
|
|
9579
9684
|
...flags.outputFlags,
|
|
@@ -9592,7 +9697,7 @@ async function run$g(argv, importMeta, {
|
|
|
9592
9697
|
$ ${command} [options] <REPO>
|
|
9593
9698
|
|
|
9594
9699
|
API Token Requirements
|
|
9595
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
9700
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$e}`)}
|
|
9596
9701
|
|
|
9597
9702
|
Options
|
|
9598
9703
|
${utils.getFlagListOutput(config.flags)}
|
|
@@ -9822,21 +9927,21 @@ async function handleListRepos({
|
|
|
9822
9927
|
}
|
|
9823
9928
|
}
|
|
9824
9929
|
|
|
9825
|
-
const CMD_NAME$
|
|
9826
|
-
const description$
|
|
9827
|
-
const hidden$
|
|
9930
|
+
const CMD_NAME$d = 'list';
|
|
9931
|
+
const description$g = 'List repositories in an organization';
|
|
9932
|
+
const hidden$d = false;
|
|
9828
9933
|
const cmdRepositoryList = {
|
|
9829
|
-
description: description$
|
|
9830
|
-
hidden: hidden$
|
|
9831
|
-
run: run$
|
|
9934
|
+
description: description$g,
|
|
9935
|
+
hidden: hidden$d,
|
|
9936
|
+
run: run$g
|
|
9832
9937
|
};
|
|
9833
|
-
async function run$
|
|
9938
|
+
async function run$g(argv, importMeta, {
|
|
9834
9939
|
parentName
|
|
9835
9940
|
}) {
|
|
9836
9941
|
const config = {
|
|
9837
|
-
commandName: CMD_NAME$
|
|
9838
|
-
description: description$
|
|
9839
|
-
hidden: hidden$
|
|
9942
|
+
commandName: CMD_NAME$d,
|
|
9943
|
+
description: description$g,
|
|
9944
|
+
hidden: hidden$d,
|
|
9840
9945
|
flags: {
|
|
9841
9946
|
...flags.commonFlags,
|
|
9842
9947
|
...flags.outputFlags,
|
|
@@ -9884,7 +9989,7 @@ async function run$f(argv, importMeta, {
|
|
|
9884
9989
|
$ ${command} [options]
|
|
9885
9990
|
|
|
9886
9991
|
API Token Requirements
|
|
9887
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
9992
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$d}`)}
|
|
9888
9993
|
|
|
9889
9994
|
Options
|
|
9890
9995
|
${utils.getFlagListOutput(config.flags)}
|
|
@@ -10025,21 +10130,21 @@ async function handleUpdateRepo({
|
|
|
10025
10130
|
await outputUpdateRepo(data, repoName, outputKind);
|
|
10026
10131
|
}
|
|
10027
10132
|
|
|
10028
|
-
const CMD_NAME$
|
|
10029
|
-
const description$
|
|
10030
|
-
const hidden$
|
|
10133
|
+
const CMD_NAME$c = 'update';
|
|
10134
|
+
const description$f = 'Update a repository in an organization';
|
|
10135
|
+
const hidden$c = false;
|
|
10031
10136
|
const cmdRepositoryUpdate = {
|
|
10032
|
-
description: description$
|
|
10033
|
-
hidden: hidden$
|
|
10034
|
-
run: run$
|
|
10137
|
+
description: description$f,
|
|
10138
|
+
hidden: hidden$c,
|
|
10139
|
+
run: run$f
|
|
10035
10140
|
};
|
|
10036
|
-
async function run$
|
|
10141
|
+
async function run$f(argv, importMeta, {
|
|
10037
10142
|
parentName
|
|
10038
10143
|
}) {
|
|
10039
10144
|
const config = {
|
|
10040
|
-
commandName: CMD_NAME$
|
|
10041
|
-
description: description$
|
|
10042
|
-
hidden: hidden$
|
|
10145
|
+
commandName: CMD_NAME$c,
|
|
10146
|
+
description: description$f,
|
|
10147
|
+
hidden: hidden$c,
|
|
10043
10148
|
flags: {
|
|
10044
10149
|
...flags.commonFlags,
|
|
10045
10150
|
...flags.outputFlags,
|
|
@@ -10082,7 +10187,7 @@ async function run$e(argv, importMeta, {
|
|
|
10082
10187
|
$ ${command} [options] <REPO>
|
|
10083
10188
|
|
|
10084
10189
|
API Token Requirements
|
|
10085
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
10190
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$c}`)}
|
|
10086
10191
|
|
|
10087
10192
|
Options
|
|
10088
10193
|
${utils.getFlagListOutput(config.flags)}
|
|
@@ -10211,21 +10316,21 @@ async function handleViewRepo(orgSlug, repoName, outputKind) {
|
|
|
10211
10316
|
await outputViewRepo(data, outputKind);
|
|
10212
10317
|
}
|
|
10213
10318
|
|
|
10214
|
-
const CMD_NAME$
|
|
10215
|
-
const description$
|
|
10216
|
-
const hidden$
|
|
10319
|
+
const CMD_NAME$b = 'view';
|
|
10320
|
+
const description$e = 'View repositories in an organization';
|
|
10321
|
+
const hidden$b = false;
|
|
10217
10322
|
const cmdRepositoryView = {
|
|
10218
|
-
description: description$
|
|
10219
|
-
hidden: hidden$
|
|
10220
|
-
run: run$
|
|
10323
|
+
description: description$e,
|
|
10324
|
+
hidden: hidden$b,
|
|
10325
|
+
run: run$e
|
|
10221
10326
|
};
|
|
10222
|
-
async function run$
|
|
10327
|
+
async function run$e(argv, importMeta, {
|
|
10223
10328
|
parentName
|
|
10224
10329
|
}) {
|
|
10225
10330
|
const config = {
|
|
10226
|
-
commandName: CMD_NAME$
|
|
10227
|
-
description: description$
|
|
10228
|
-
hidden: hidden$
|
|
10331
|
+
commandName: CMD_NAME$b,
|
|
10332
|
+
description: description$e,
|
|
10333
|
+
hidden: hidden$b,
|
|
10229
10334
|
flags: {
|
|
10230
10335
|
...flags.commonFlags,
|
|
10231
10336
|
...flags.outputFlags,
|
|
@@ -10244,7 +10349,7 @@ async function run$d(argv, importMeta, {
|
|
|
10244
10349
|
$ ${command} [options] <REPO>
|
|
10245
10350
|
|
|
10246
10351
|
API Token Requirements
|
|
10247
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
10352
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$b}`)}
|
|
10248
10353
|
|
|
10249
10354
|
Options
|
|
10250
10355
|
${utils.getFlagListOutput(config.flags)}
|
|
@@ -10309,9 +10414,9 @@ async function run$d(argv, importMeta, {
|
|
|
10309
10414
|
await handleViewRepo(orgSlug, String(repoName), outputKind);
|
|
10310
10415
|
}
|
|
10311
10416
|
|
|
10312
|
-
const description$
|
|
10417
|
+
const description$d = 'Manage registered repositories';
|
|
10313
10418
|
const cmdRepository = {
|
|
10314
|
-
description: description$
|
|
10419
|
+
description: description$d,
|
|
10315
10420
|
async run(argv, importMeta, {
|
|
10316
10421
|
parentName
|
|
10317
10422
|
}) {
|
|
@@ -10323,7 +10428,7 @@ const cmdRepository = {
|
|
|
10323
10428
|
update: cmdRepositoryUpdate
|
|
10324
10429
|
}, {
|
|
10325
10430
|
argv,
|
|
10326
|
-
description: description$
|
|
10431
|
+
description: description$d,
|
|
10327
10432
|
importMeta,
|
|
10328
10433
|
name: `${parentName} repository`
|
|
10329
10434
|
});
|
|
@@ -10381,9 +10486,9 @@ async function suggestTarget() {
|
|
|
10381
10486
|
return proceed ? ['.'] : [];
|
|
10382
10487
|
}
|
|
10383
10488
|
|
|
10384
|
-
const CMD_NAME$
|
|
10385
|
-
const description$
|
|
10386
|
-
const hidden$
|
|
10489
|
+
const CMD_NAME$a = 'create';
|
|
10490
|
+
const description$c = 'Create a new Socket scan and report';
|
|
10491
|
+
const hidden$a = false;
|
|
10387
10492
|
const generalFlags$1 = {
|
|
10388
10493
|
...flags.commonFlags,
|
|
10389
10494
|
...flags.outputFlags,
|
|
@@ -10479,17 +10584,17 @@ const generalFlags$1 = {
|
|
|
10479
10584
|
}
|
|
10480
10585
|
};
|
|
10481
10586
|
const cmdScanCreate = {
|
|
10482
|
-
description: description$
|
|
10483
|
-
hidden: hidden$
|
|
10484
|
-
run: run$
|
|
10587
|
+
description: description$c,
|
|
10588
|
+
hidden: hidden$a,
|
|
10589
|
+
run: run$d
|
|
10485
10590
|
};
|
|
10486
|
-
async function run$
|
|
10591
|
+
async function run$d(argv, importMeta, {
|
|
10487
10592
|
parentName
|
|
10488
10593
|
}) {
|
|
10489
10594
|
const config = {
|
|
10490
|
-
commandName: CMD_NAME$
|
|
10491
|
-
description: description$
|
|
10492
|
-
hidden: hidden$
|
|
10595
|
+
commandName: CMD_NAME$a,
|
|
10596
|
+
description: description$c,
|
|
10597
|
+
hidden: hidden$a,
|
|
10493
10598
|
flags: {
|
|
10494
10599
|
...generalFlags$1,
|
|
10495
10600
|
...reachabilityFlags
|
|
@@ -10500,7 +10605,7 @@ async function run$c(argv, importMeta, {
|
|
|
10500
10605
|
$ ${command} [options] [TARGET...]
|
|
10501
10606
|
|
|
10502
10607
|
API Token Requirements
|
|
10503
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
10608
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$a}`)}
|
|
10504
10609
|
|
|
10505
10610
|
Options
|
|
10506
10611
|
${utils.getFlagListOutput(generalFlags$1)}
|
|
@@ -10509,7 +10614,7 @@ async function run$c(argv, importMeta, {
|
|
|
10509
10614
|
${utils.getFlagListOutput(reachabilityFlags)}
|
|
10510
10615
|
|
|
10511
10616
|
Uploads the specified dependency manifest files for Go, Gradle, JavaScript,
|
|
10512
|
-
Kotlin, Python, and Scala. Files like "package.json" and "
|
|
10617
|
+
Kotlin, Python, and Scala. Files like "package.json" and "${constants.REQUIREMENTS_TXT}".
|
|
10513
10618
|
If any folder is specified, the ones found in there recursively are uploaded.
|
|
10514
10619
|
|
|
10515
10620
|
Details on TARGET:
|
|
@@ -10519,7 +10624,7 @@ async function run$c(argv, importMeta, {
|
|
|
10519
10624
|
- If a target is a file, only that file is checked
|
|
10520
10625
|
- If it is a dir, the dir is scanned for any supported manifest files
|
|
10521
10626
|
- Dirs MUST be within the current dir (cwd), you can use --cwd to change it
|
|
10522
|
-
- Supports globbing such as "**/package.json", "
|
|
10627
|
+
- Supports globbing such as "**/package.json", "**/${constants.REQUIREMENTS_TXT}", etc.
|
|
10523
10628
|
- Ignores any file specified in your project's ".gitignore"
|
|
10524
10629
|
- Also a sensible set of default ignores from the "ignore-by-default" module
|
|
10525
10630
|
|
|
@@ -10594,13 +10699,13 @@ async function run$c(argv, importMeta, {
|
|
|
10594
10699
|
} = await utils.determineOrgSlug(String(orgFlag || ''), interactive, dryRun);
|
|
10595
10700
|
const processCwd = process.cwd();
|
|
10596
10701
|
const cwd = cwdOverride && cwdOverride !== '.' && cwdOverride !== processCwd ? path.resolve(processCwd, cwdOverride) : processCwd;
|
|
10597
|
-
const sockJson = utils.
|
|
10702
|
+
const sockJson = await utils.readOrDefaultSocketJsonUp(cwd);
|
|
10598
10703
|
|
|
10599
10704
|
// Note: This needs meow booleanDefault=undefined.
|
|
10600
10705
|
if (typeof autoManifest !== 'boolean') {
|
|
10601
10706
|
if (sockJson.defaults?.scan?.create?.autoManifest !== undefined) {
|
|
10602
10707
|
autoManifest = sockJson.defaults.scan.create.autoManifest;
|
|
10603
|
-
logger.logger.info(
|
|
10708
|
+
logger.logger.info(`Using default --auto-manifest from ${constants.SOCKET_JSON}:`, autoManifest);
|
|
10604
10709
|
} else {
|
|
10605
10710
|
autoManifest = false;
|
|
10606
10711
|
}
|
|
@@ -10608,7 +10713,7 @@ async function run$c(argv, importMeta, {
|
|
|
10608
10713
|
if (!branchName) {
|
|
10609
10714
|
if (sockJson.defaults?.scan?.create?.branch) {
|
|
10610
10715
|
branchName = sockJson.defaults.scan.create.branch;
|
|
10611
|
-
logger.logger.info(
|
|
10716
|
+
logger.logger.info(`Using default --branch from ${constants.SOCKET_JSON}:`, branchName);
|
|
10612
10717
|
} else {
|
|
10613
10718
|
branchName = (await utils.gitBranch(cwd)) || (await utils.detectDefaultBranch(cwd));
|
|
10614
10719
|
}
|
|
@@ -10616,7 +10721,7 @@ async function run$c(argv, importMeta, {
|
|
|
10616
10721
|
if (!repoName) {
|
|
10617
10722
|
if (sockJson.defaults?.scan?.create?.repo) {
|
|
10618
10723
|
repoName = sockJson.defaults.scan.create.repo;
|
|
10619
|
-
logger.logger.info(
|
|
10724
|
+
logger.logger.info(`Using default --repo from ${constants.SOCKET_JSON}:`, repoName);
|
|
10620
10725
|
} else {
|
|
10621
10726
|
repoName = await utils.getRepoName(cwd);
|
|
10622
10727
|
}
|
|
@@ -10624,7 +10729,7 @@ async function run$c(argv, importMeta, {
|
|
|
10624
10729
|
if (typeof report !== 'boolean') {
|
|
10625
10730
|
if (sockJson.defaults?.scan?.create?.report !== undefined) {
|
|
10626
10731
|
report = sockJson.defaults.scan.create.report;
|
|
10627
|
-
logger.logger.info(
|
|
10732
|
+
logger.logger.info(`Using default --report from ${constants.SOCKET_JSON}:`, report);
|
|
10628
10733
|
} else {
|
|
10629
10734
|
report = false;
|
|
10630
10735
|
}
|
|
@@ -10681,7 +10786,7 @@ async function run$c(argv, importMeta, {
|
|
|
10681
10786
|
logger.logger.error(` socket scan create [other flags...] ${orgSlug} ${targets.join(' ')}`);
|
|
10682
10787
|
logger.logger.error('```');
|
|
10683
10788
|
logger.logger.error('');
|
|
10684
|
-
logger.logger.info(
|
|
10789
|
+
logger.logger.info(`You can also run \`socket scan setup\` to persist these flag defaults to a ${constants.SOCKET_JSON} file.`);
|
|
10685
10790
|
logger.logger.error('');
|
|
10686
10791
|
}
|
|
10687
10792
|
const reachExcludePaths = utils.cmdFlagValueToArray(cli.flags['reachExcludePaths']);
|
|
@@ -10803,21 +10908,21 @@ async function handleDeleteScan(orgSlug, scanId, outputKind) {
|
|
|
10803
10908
|
await outputDeleteScan(data, outputKind);
|
|
10804
10909
|
}
|
|
10805
10910
|
|
|
10806
|
-
const CMD_NAME$
|
|
10807
|
-
const description$
|
|
10808
|
-
const hidden$
|
|
10911
|
+
const CMD_NAME$9 = 'del';
|
|
10912
|
+
const description$b = 'Delete a scan';
|
|
10913
|
+
const hidden$9 = false;
|
|
10809
10914
|
const cmdScanDel = {
|
|
10810
|
-
description: description$
|
|
10811
|
-
hidden: hidden$
|
|
10812
|
-
run: run$
|
|
10915
|
+
description: description$b,
|
|
10916
|
+
hidden: hidden$9,
|
|
10917
|
+
run: run$c
|
|
10813
10918
|
};
|
|
10814
|
-
async function run$
|
|
10919
|
+
async function run$c(argv, importMeta, {
|
|
10815
10920
|
parentName
|
|
10816
10921
|
}) {
|
|
10817
10922
|
const config = {
|
|
10818
|
-
commandName: CMD_NAME$
|
|
10819
|
-
description: description$
|
|
10820
|
-
hidden: hidden$
|
|
10923
|
+
commandName: CMD_NAME$9,
|
|
10924
|
+
description: description$b,
|
|
10925
|
+
hidden: hidden$9,
|
|
10821
10926
|
flags: {
|
|
10822
10927
|
...flags.commonFlags,
|
|
10823
10928
|
...flags.outputFlags,
|
|
@@ -10836,7 +10941,7 @@ async function run$b(argv, importMeta, {
|
|
|
10836
10941
|
$ ${command} [options] <SCAN_ID>
|
|
10837
10942
|
|
|
10838
10943
|
API Token Requirements
|
|
10839
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
10944
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$9}`)}
|
|
10840
10945
|
|
|
10841
10946
|
Options
|
|
10842
10947
|
${utils.getFlagListOutput(config.flags)}
|
|
@@ -11080,21 +11185,21 @@ async function handleDiffScan({
|
|
|
11080
11185
|
});
|
|
11081
11186
|
}
|
|
11082
11187
|
|
|
11083
|
-
const CMD_NAME$
|
|
11084
|
-
const description$
|
|
11085
|
-
const hidden$
|
|
11188
|
+
const CMD_NAME$8 = 'diff';
|
|
11189
|
+
const description$a = 'See what changed between two Scans';
|
|
11190
|
+
const hidden$8 = false;
|
|
11086
11191
|
const cmdScanDiff = {
|
|
11087
|
-
description: description$
|
|
11088
|
-
hidden: hidden$
|
|
11089
|
-
run: run$
|
|
11192
|
+
description: description$a,
|
|
11193
|
+
hidden: hidden$8,
|
|
11194
|
+
run: run$b
|
|
11090
11195
|
};
|
|
11091
|
-
async function run$
|
|
11196
|
+
async function run$b(argv, importMeta, {
|
|
11092
11197
|
parentName
|
|
11093
11198
|
}) {
|
|
11094
11199
|
const config = {
|
|
11095
|
-
commandName: CMD_NAME$
|
|
11096
|
-
description: description$
|
|
11097
|
-
hidden: hidden$
|
|
11200
|
+
commandName: CMD_NAME$8,
|
|
11201
|
+
description: description$a,
|
|
11202
|
+
hidden: hidden$8,
|
|
11098
11203
|
flags: {
|
|
11099
11204
|
...flags.commonFlags,
|
|
11100
11205
|
...flags.outputFlags,
|
|
@@ -11124,7 +11229,7 @@ async function run$a(argv, importMeta, {
|
|
|
11124
11229
|
$ ${command} [options] <SCAN_ID1> <SCAN_ID2>
|
|
11125
11230
|
|
|
11126
11231
|
API Token Requirements
|
|
11127
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
11232
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$8}`)}
|
|
11128
11233
|
|
|
11129
11234
|
This command displays the package changes between two scans. The full output
|
|
11130
11235
|
can be pretty large depending on the size of your repo and time range. It is
|
|
@@ -11868,22 +11973,22 @@ async function handleCreateGithubScan({
|
|
|
11868
11973
|
await outputScanGithub(ghScanCResult, outputKind);
|
|
11869
11974
|
}
|
|
11870
11975
|
|
|
11871
|
-
const CMD_NAME$
|
|
11976
|
+
const CMD_NAME$7 = 'github';
|
|
11872
11977
|
const DEFAULT_GITHUB_URL = 'https://api.github.com';
|
|
11873
|
-
const description$
|
|
11874
|
-
const hidden$
|
|
11978
|
+
const description$9 = 'Create a scan for given GitHub repo';
|
|
11979
|
+
const hidden$7 = true;
|
|
11875
11980
|
const cmdScanGithub = {
|
|
11876
|
-
description: description$
|
|
11877
|
-
hidden: hidden$
|
|
11878
|
-
run: run$
|
|
11981
|
+
description: description$9,
|
|
11982
|
+
hidden: hidden$7,
|
|
11983
|
+
run: run$a
|
|
11879
11984
|
};
|
|
11880
|
-
async function run$
|
|
11985
|
+
async function run$a(argv, importMeta, {
|
|
11881
11986
|
parentName
|
|
11882
11987
|
}) {
|
|
11883
11988
|
const config = {
|
|
11884
|
-
commandName: CMD_NAME$
|
|
11885
|
-
description: description$
|
|
11886
|
-
hidden: hidden$
|
|
11989
|
+
commandName: CMD_NAME$7,
|
|
11990
|
+
description: description$9,
|
|
11991
|
+
hidden: hidden$7,
|
|
11887
11992
|
flags: {
|
|
11888
11993
|
...flags.commonFlags,
|
|
11889
11994
|
...flags.outputFlags,
|
|
@@ -11927,7 +12032,7 @@ async function run$9(argv, importMeta, {
|
|
|
11927
12032
|
$ ${command} [options] [CWD=.]
|
|
11928
12033
|
|
|
11929
12034
|
API Token Requirements
|
|
11930
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
12035
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$7}`)}
|
|
11931
12036
|
|
|
11932
12037
|
This is similar to the \`socket scan create\` command except it pulls the files
|
|
11933
12038
|
from GitHub. See the help for that command for more details.
|
|
@@ -12184,21 +12289,21 @@ async function handleListScans({
|
|
|
12184
12289
|
await outputListScans(data, outputKind);
|
|
12185
12290
|
}
|
|
12186
12291
|
|
|
12187
|
-
const CMD_NAME$
|
|
12188
|
-
const description$
|
|
12189
|
-
const hidden$
|
|
12292
|
+
const CMD_NAME$6 = 'list';
|
|
12293
|
+
const description$8 = 'List the scans for an organization';
|
|
12294
|
+
const hidden$6 = false;
|
|
12190
12295
|
const cmdScanList = {
|
|
12191
|
-
description: description$
|
|
12192
|
-
hidden: hidden$
|
|
12193
|
-
run: run$
|
|
12296
|
+
description: description$8,
|
|
12297
|
+
hidden: hidden$6,
|
|
12298
|
+
run: run$9
|
|
12194
12299
|
};
|
|
12195
|
-
async function run$
|
|
12300
|
+
async function run$9(argv, importMeta, {
|
|
12196
12301
|
parentName
|
|
12197
12302
|
}) {
|
|
12198
12303
|
const config = {
|
|
12199
|
-
commandName: CMD_NAME$
|
|
12200
|
-
description: description$
|
|
12201
|
-
hidden: hidden$
|
|
12304
|
+
commandName: CMD_NAME$6,
|
|
12305
|
+
description: description$8,
|
|
12306
|
+
hidden: hidden$6,
|
|
12202
12307
|
flags: {
|
|
12203
12308
|
...flags.commonFlags,
|
|
12204
12309
|
...flags.outputFlags,
|
|
@@ -12257,7 +12362,7 @@ async function run$8(argv, importMeta, {
|
|
|
12257
12362
|
$ ${command} [options] [REPO [BRANCH]]
|
|
12258
12363
|
|
|
12259
12364
|
API Token Requirements
|
|
12260
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
12365
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$6}`)}
|
|
12261
12366
|
|
|
12262
12367
|
Optionally filter by REPO. If you specify a repo, you can also specify a
|
|
12263
12368
|
branch to filter by. (Note: If you don't specify a repo then you must use
|
|
@@ -12393,21 +12498,21 @@ async function handleOrgScanMetadata(orgSlug, scanId, outputKind) {
|
|
|
12393
12498
|
await outputScanMetadata(data, scanId, outputKind);
|
|
12394
12499
|
}
|
|
12395
12500
|
|
|
12396
|
-
const CMD_NAME$
|
|
12397
|
-
const description$
|
|
12398
|
-
const hidden$
|
|
12501
|
+
const CMD_NAME$5 = 'metadata';
|
|
12502
|
+
const description$7 = "Get a scan's metadata";
|
|
12503
|
+
const hidden$5 = false;
|
|
12399
12504
|
const cmdScanMetadata = {
|
|
12400
|
-
description: description$
|
|
12401
|
-
hidden: hidden$
|
|
12402
|
-
run: run$
|
|
12505
|
+
description: description$7,
|
|
12506
|
+
hidden: hidden$5,
|
|
12507
|
+
run: run$8
|
|
12403
12508
|
};
|
|
12404
|
-
async function run$
|
|
12509
|
+
async function run$8(argv, importMeta, {
|
|
12405
12510
|
parentName
|
|
12406
12511
|
}) {
|
|
12407
12512
|
const config = {
|
|
12408
|
-
commandName: CMD_NAME$
|
|
12409
|
-
description: description$
|
|
12410
|
-
hidden: hidden$
|
|
12513
|
+
commandName: CMD_NAME$5,
|
|
12514
|
+
description: description$7,
|
|
12515
|
+
hidden: hidden$5,
|
|
12411
12516
|
flags: {
|
|
12412
12517
|
...flags.commonFlags,
|
|
12413
12518
|
...flags.outputFlags,
|
|
@@ -12426,7 +12531,7 @@ async function run$7(argv, importMeta, {
|
|
|
12426
12531
|
$ ${command} [options] <SCAN_ID>
|
|
12427
12532
|
|
|
12428
12533
|
API Token Requirements
|
|
12429
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
12534
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$5}`)}
|
|
12430
12535
|
|
|
12431
12536
|
Options
|
|
12432
12537
|
${utils.getFlagListOutput(config.flags)}
|
|
@@ -12560,9 +12665,9 @@ async function handleScanReach({
|
|
|
12560
12665
|
});
|
|
12561
12666
|
}
|
|
12562
12667
|
|
|
12563
|
-
const CMD_NAME$
|
|
12564
|
-
const description$
|
|
12565
|
-
const hidden$
|
|
12668
|
+
const CMD_NAME$4 = 'reach';
|
|
12669
|
+
const description$6 = 'Compute tier 1 reachability';
|
|
12670
|
+
const hidden$4 = true;
|
|
12566
12671
|
const generalFlags = {
|
|
12567
12672
|
...flags.commonFlags,
|
|
12568
12673
|
...flags.outputFlags,
|
|
@@ -12578,17 +12683,17 @@ const generalFlags = {
|
|
|
12578
12683
|
}
|
|
12579
12684
|
};
|
|
12580
12685
|
const cmdScanReach = {
|
|
12581
|
-
description: description$
|
|
12582
|
-
hidden: hidden$
|
|
12583
|
-
run: run$
|
|
12686
|
+
description: description$6,
|
|
12687
|
+
hidden: hidden$4,
|
|
12688
|
+
run: run$7
|
|
12584
12689
|
};
|
|
12585
|
-
async function run$
|
|
12690
|
+
async function run$7(argv, importMeta, {
|
|
12586
12691
|
parentName
|
|
12587
12692
|
}) {
|
|
12588
12693
|
const config = {
|
|
12589
|
-
commandName: CMD_NAME$
|
|
12590
|
-
description: description$
|
|
12591
|
-
hidden: hidden$
|
|
12694
|
+
commandName: CMD_NAME$4,
|
|
12695
|
+
description: description$6,
|
|
12696
|
+
hidden: hidden$4,
|
|
12592
12697
|
flags: {
|
|
12593
12698
|
...generalFlags,
|
|
12594
12699
|
...reachabilityFlags
|
|
@@ -12598,7 +12703,7 @@ async function run$6(argv, importMeta, {
|
|
|
12598
12703
|
$ ${command} [options] [CWD=.]
|
|
12599
12704
|
|
|
12600
12705
|
API Token Requirements
|
|
12601
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
12706
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$4}`)}
|
|
12602
12707
|
|
|
12603
12708
|
Options
|
|
12604
12709
|
${utils.getFlagListOutput(generalFlags)}
|
|
@@ -12706,21 +12811,21 @@ async function run$6(argv, importMeta, {
|
|
|
12706
12811
|
});
|
|
12707
12812
|
}
|
|
12708
12813
|
|
|
12709
|
-
const CMD_NAME$
|
|
12710
|
-
const description$
|
|
12711
|
-
const hidden$
|
|
12814
|
+
const CMD_NAME$3 = 'report';
|
|
12815
|
+
const description$5 = 'Check whether a scan result passes the organizational policies (security, license)';
|
|
12816
|
+
const hidden$3 = false;
|
|
12712
12817
|
const cmdScanReport = {
|
|
12713
|
-
description: description$
|
|
12714
|
-
hidden: hidden$
|
|
12715
|
-
run: run$
|
|
12818
|
+
description: description$5,
|
|
12819
|
+
hidden: hidden$3,
|
|
12820
|
+
run: run$6
|
|
12716
12821
|
};
|
|
12717
|
-
async function run$
|
|
12822
|
+
async function run$6(argv, importMeta, {
|
|
12718
12823
|
parentName
|
|
12719
12824
|
}) {
|
|
12720
12825
|
const config = {
|
|
12721
|
-
commandName: CMD_NAME$
|
|
12722
|
-
description: description$
|
|
12723
|
-
hidden: hidden$
|
|
12826
|
+
commandName: CMD_NAME$3,
|
|
12827
|
+
description: description$5,
|
|
12828
|
+
hidden: hidden$3,
|
|
12724
12829
|
flags: {
|
|
12725
12830
|
...flags.commonFlags,
|
|
12726
12831
|
...flags.outputFlags,
|
|
@@ -12759,7 +12864,7 @@ async function run$5(argv, importMeta, {
|
|
|
12759
12864
|
$ ${command} [options] <SCAN_ID> [OUTPUT_PATH]
|
|
12760
12865
|
|
|
12761
12866
|
API Token Requirements
|
|
12762
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
12867
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$3}`)}
|
|
12763
12868
|
|
|
12764
12869
|
Options
|
|
12765
12870
|
${utils.getFlagListOutput(config.flags)}
|
|
@@ -12870,18 +12975,18 @@ async function outputScanConfigResult(result) {
|
|
|
12870
12975
|
}
|
|
12871
12976
|
|
|
12872
12977
|
async function setupScanConfig(cwd, defaultOnReadError = false) {
|
|
12873
|
-
const jsonPath = path.join(cwd,
|
|
12978
|
+
const jsonPath = path.join(cwd, constants.SOCKET_JSON);
|
|
12874
12979
|
if (fs$1.existsSync(jsonPath)) {
|
|
12875
|
-
logger.logger.info(`Found
|
|
12980
|
+
logger.logger.info(`Found ${constants.SOCKET_JSON} at ${jsonPath}`);
|
|
12876
12981
|
} else {
|
|
12877
|
-
logger.logger.info(`No
|
|
12982
|
+
logger.logger.info(`No ${constants.SOCKET_JSON} found at ${cwd}, will generate a new one`);
|
|
12878
12983
|
}
|
|
12879
12984
|
logger.logger.log('');
|
|
12880
12985
|
logger.logger.log('Note: This tool will set up flag and argument defaults for certain');
|
|
12881
12986
|
logger.logger.log(' CLI commands. You can still override them by explicitly');
|
|
12882
12987
|
logger.logger.log(' setting the flag. It is meant to be a convenience tool.');
|
|
12883
12988
|
logger.logger.log('');
|
|
12884
|
-
logger.logger.log(
|
|
12989
|
+
logger.logger.log(`This command will generate a \`${constants.SOCKET_JSON}\` file in the target cwd.`);
|
|
12885
12990
|
logger.logger.log('You can choose to add this file to your repo (handy for collab)');
|
|
12886
12991
|
logger.logger.log('or to add it to the ignored files, or neither. This file is only');
|
|
12887
12992
|
logger.logger.log('used in CLI workflows.');
|
|
@@ -12942,7 +13047,7 @@ async function setupScanConfig(cwd, defaultOnReadError = false) {
|
|
|
12942
13047
|
}
|
|
12943
13048
|
}
|
|
12944
13049
|
logger.logger.log('');
|
|
12945
|
-
logger.logger.log(
|
|
13050
|
+
logger.logger.log(`Setup complete. Writing ${constants.SOCKET_JSON}`);
|
|
12946
13051
|
logger.logger.log('');
|
|
12947
13052
|
if (await prompts.select({
|
|
12948
13053
|
message: `Do you want to write the new config to ${jsonPath} ?`,
|
|
@@ -13158,7 +13263,7 @@ const config$2 = {
|
|
|
13158
13263
|
...flags.commonFlags,
|
|
13159
13264
|
defaultOnReadError: {
|
|
13160
13265
|
type: 'boolean',
|
|
13161
|
-
description:
|
|
13266
|
+
description: `If reading the ${constants.SOCKET_JSON} fails, just use a default config? Warning: This might override the existing json file!`
|
|
13162
13267
|
}
|
|
13163
13268
|
},
|
|
13164
13269
|
help: (command, config) => `
|
|
@@ -13188,9 +13293,9 @@ const config$2 = {
|
|
|
13188
13293
|
const cmdScanSetup = {
|
|
13189
13294
|
description: config$2.description,
|
|
13190
13295
|
hidden: config$2.hidden,
|
|
13191
|
-
run: run$
|
|
13296
|
+
run: run$5
|
|
13192
13297
|
};
|
|
13193
|
-
async function run$
|
|
13298
|
+
async function run$5(argv, importMeta, {
|
|
13194
13299
|
parentName
|
|
13195
13300
|
}) {
|
|
13196
13301
|
const cli = utils.meowOrExit({
|
|
@@ -13346,21 +13451,21 @@ async function streamScan(orgSlug, scanId, options) {
|
|
|
13346
13451
|
});
|
|
13347
13452
|
}
|
|
13348
13453
|
|
|
13349
|
-
const CMD_NAME$
|
|
13350
|
-
const description$
|
|
13351
|
-
const hidden$
|
|
13454
|
+
const CMD_NAME$2 = 'view';
|
|
13455
|
+
const description$4 = 'View the raw results of a scan';
|
|
13456
|
+
const hidden$2 = false;
|
|
13352
13457
|
const cmdScanView = {
|
|
13353
|
-
description: description$
|
|
13354
|
-
hidden: hidden$
|
|
13355
|
-
run: run$
|
|
13458
|
+
description: description$4,
|
|
13459
|
+
hidden: hidden$2,
|
|
13460
|
+
run: run$4
|
|
13356
13461
|
};
|
|
13357
|
-
async function run$
|
|
13462
|
+
async function run$4(argv, importMeta, {
|
|
13358
13463
|
parentName
|
|
13359
13464
|
}) {
|
|
13360
13465
|
const config = {
|
|
13361
|
-
commandName: CMD_NAME$
|
|
13362
|
-
description: description$
|
|
13363
|
-
hidden: hidden$
|
|
13466
|
+
commandName: CMD_NAME$2,
|
|
13467
|
+
description: description$4,
|
|
13468
|
+
hidden: hidden$2,
|
|
13364
13469
|
flags: {
|
|
13365
13470
|
...flags.commonFlags,
|
|
13366
13471
|
...flags.outputFlags,
|
|
@@ -13384,7 +13489,7 @@ async function run$3(argv, importMeta, {
|
|
|
13384
13489
|
$ ${command} [options] <SCAN_ID> [OUTPUT_FILE]
|
|
13385
13490
|
|
|
13386
13491
|
API Token Requirements
|
|
13387
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
13492
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$2}`)}
|
|
13388
13493
|
|
|
13389
13494
|
When no output path is given the contents is sent to stdout.
|
|
13390
13495
|
|
|
@@ -13457,9 +13562,9 @@ async function run$3(argv, importMeta, {
|
|
|
13457
13562
|
}
|
|
13458
13563
|
}
|
|
13459
13564
|
|
|
13460
|
-
const description$
|
|
13565
|
+
const description$3 = 'Manage Socket scans';
|
|
13461
13566
|
const cmdScan = {
|
|
13462
|
-
description: description$
|
|
13567
|
+
description: description$3,
|
|
13463
13568
|
async run(argv, importMeta, {
|
|
13464
13569
|
parentName
|
|
13465
13570
|
}) {
|
|
@@ -13488,7 +13593,7 @@ const cmdScan = {
|
|
|
13488
13593
|
}
|
|
13489
13594
|
},
|
|
13490
13595
|
argv,
|
|
13491
|
-
description: description$
|
|
13596
|
+
description: description$3,
|
|
13492
13597
|
importMeta,
|
|
13493
13598
|
name: `${parentName} scan`
|
|
13494
13599
|
});
|
|
@@ -13509,7 +13614,7 @@ async function fetchThreatFeed({
|
|
|
13509
13614
|
return await utils.queryApiSafeJson(`orgs/${orgSlug}/threat-feed?${queryParams}`, 'the Threat Feed data');
|
|
13510
13615
|
}
|
|
13511
13616
|
|
|
13512
|
-
const require$
|
|
13617
|
+
const require$2 = require$$5.createRequire((typeof document === 'undefined' ? require$$0.pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli.js', document.baseURI).href)));
|
|
13513
13618
|
async function outputThreatFeed(result, outputKind) {
|
|
13514
13619
|
if (!result.ok) {
|
|
13515
13620
|
process.exitCode = result.code ?? 1;
|
|
@@ -13523,14 +13628,14 @@ async function outputThreatFeed(result, outputKind) {
|
|
|
13523
13628
|
return;
|
|
13524
13629
|
}
|
|
13525
13630
|
if (!result.data?.results?.length) {
|
|
13526
|
-
logger.logger.warn('Did not receive any data to display
|
|
13631
|
+
logger.logger.warn('Did not receive any data to display.');
|
|
13527
13632
|
return;
|
|
13528
13633
|
}
|
|
13529
13634
|
const formattedOutput = formatResults(result.data.results);
|
|
13530
13635
|
const descriptions = result.data.results.map(d => d.description);
|
|
13531
13636
|
|
|
13532
13637
|
// Note: this temporarily takes over the terminal (just like `man` does).
|
|
13533
|
-
const ScreenWidget = /*@__PURE__*/require$
|
|
13638
|
+
const ScreenWidget = /*@__PURE__*/require$2('../external/blessed/lib/widgets/screen.js');
|
|
13534
13639
|
const screen = new ScreenWidget({
|
|
13535
13640
|
...constants.default.blessedOptions
|
|
13536
13641
|
});
|
|
@@ -13539,7 +13644,7 @@ async function outputThreatFeed(result, outputKind) {
|
|
|
13539
13644
|
// node process just to exit it. That's very bad UX.
|
|
13540
13645
|
// eslint-disable-next-line n/no-process-exit
|
|
13541
13646
|
screen.key(['escape', 'q', 'C-c'], () => process.exit(0));
|
|
13542
|
-
const TableWidget = /*@__PURE__*/require$
|
|
13647
|
+
const TableWidget = /*@__PURE__*/require$2('../external/blessed-contrib/lib/widget/table.js');
|
|
13543
13648
|
const detailsBoxHeight = 20; // bottom N rows for details box
|
|
13544
13649
|
const tipsBoxHeight = 1; // 1 row for tips box
|
|
13545
13650
|
|
|
@@ -13563,7 +13668,7 @@ async function outputThreatFeed(result, outputKind) {
|
|
|
13563
13668
|
columnSpacing: 1,
|
|
13564
13669
|
truncate: '_'
|
|
13565
13670
|
});
|
|
13566
|
-
const BoxWidget = /*@__PURE__*/require$
|
|
13671
|
+
const BoxWidget = /*@__PURE__*/require$2('../external/blessed/lib/widgets/box.js');
|
|
13567
13672
|
const tipsBox = new BoxWidget({
|
|
13568
13673
|
bottom: detailsBoxHeight,
|
|
13569
13674
|
// sits just above the details box
|
|
@@ -13670,23 +13775,23 @@ async function handleThreatFeed({
|
|
|
13670
13775
|
await outputThreatFeed(data, outputKind);
|
|
13671
13776
|
}
|
|
13672
13777
|
|
|
13673
|
-
const CMD_NAME = 'threat-feed';
|
|
13778
|
+
const CMD_NAME$1 = 'threat-feed';
|
|
13674
13779
|
const ECOSYSTEMS = new Set(['gem', 'golang', 'maven', constants.NPM, 'nuget', 'pypi']);
|
|
13675
13780
|
const TYPE_FILTERS = new Set(['anom', 'c', 'fp', 'joke', 'mal', 'secret', 'spy', 'tp', 'typo', 'u', 'vuln']);
|
|
13676
|
-
const description$
|
|
13677
|
-
const hidden = false;
|
|
13781
|
+
const description$2 = '[Beta] View the threat-feed';
|
|
13782
|
+
const hidden$1 = false;
|
|
13678
13783
|
const cmdThreatFeed = {
|
|
13679
|
-
description: description$
|
|
13680
|
-
hidden,
|
|
13681
|
-
run: run$
|
|
13784
|
+
description: description$2,
|
|
13785
|
+
hidden: hidden$1,
|
|
13786
|
+
run: run$3
|
|
13682
13787
|
};
|
|
13683
|
-
async function run$
|
|
13788
|
+
async function run$3(argv, importMeta, {
|
|
13684
13789
|
parentName
|
|
13685
13790
|
}) {
|
|
13686
13791
|
const config = {
|
|
13687
|
-
commandName: CMD_NAME,
|
|
13688
|
-
description: description$
|
|
13689
|
-
hidden,
|
|
13792
|
+
commandName: CMD_NAME$1,
|
|
13793
|
+
description: description$2,
|
|
13794
|
+
hidden: hidden$1,
|
|
13690
13795
|
flags: {
|
|
13691
13796
|
...flags.commonFlags,
|
|
13692
13797
|
...flags.outputFlags,
|
|
@@ -13741,7 +13846,7 @@ async function run$2(argv, importMeta, {
|
|
|
13741
13846
|
$ ${command} [options] [ECOSYSTEM] [TYPE_FILTER]
|
|
13742
13847
|
|
|
13743
13848
|
API Token Requirements
|
|
13744
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME}`)}
|
|
13849
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$1}`)}
|
|
13745
13850
|
- Special access
|
|
13746
13851
|
|
|
13747
13852
|
This feature requires a Threat Feed license. Please contact
|
|
@@ -14007,9 +14112,9 @@ const config$1 = {
|
|
|
14007
14112
|
const cmdUninstallCompletion = {
|
|
14008
14113
|
description: config$1.description,
|
|
14009
14114
|
hidden: config$1.hidden,
|
|
14010
|
-
run: run$
|
|
14115
|
+
run: run$2
|
|
14011
14116
|
};
|
|
14012
|
-
async function run$
|
|
14117
|
+
async function run$2(argv, importMeta, {
|
|
14013
14118
|
parentName
|
|
14014
14119
|
}) {
|
|
14015
14120
|
const cli = utils.meowOrExit({
|
|
@@ -14027,9 +14132,9 @@ async function run$1(argv, importMeta, {
|
|
|
14027
14132
|
await handleUninstallCompletion(String(targetName));
|
|
14028
14133
|
}
|
|
14029
14134
|
|
|
14030
|
-
const description = 'Uninstall Socket CLI tab completion';
|
|
14135
|
+
const description$1 = 'Uninstall Socket CLI tab completion';
|
|
14031
14136
|
const cmdUninstall = {
|
|
14032
|
-
description,
|
|
14137
|
+
description: description$1,
|
|
14033
14138
|
hidden: false,
|
|
14034
14139
|
async run(argv, importMeta, {
|
|
14035
14140
|
parentName
|
|
@@ -14038,7 +14143,7 @@ const cmdUninstall = {
|
|
|
14038
14143
|
completion: cmdUninstallCompletion
|
|
14039
14144
|
}, {
|
|
14040
14145
|
argv,
|
|
14041
|
-
description,
|
|
14146
|
+
description: description$1,
|
|
14042
14147
|
importMeta,
|
|
14043
14148
|
name: `${parentName} uninstall`
|
|
14044
14149
|
});
|
|
@@ -14203,9 +14308,9 @@ const config = {
|
|
|
14203
14308
|
const cmdWrapper = {
|
|
14204
14309
|
description: config.description,
|
|
14205
14310
|
hidden: config.hidden,
|
|
14206
|
-
run
|
|
14311
|
+
run: run$1
|
|
14207
14312
|
};
|
|
14208
|
-
async function run(argv, importMeta, {
|
|
14313
|
+
async function run$1(argv, importMeta, {
|
|
14209
14314
|
parentName
|
|
14210
14315
|
}) {
|
|
14211
14316
|
// I don't think meow would mess with this but ...
|
|
@@ -14278,6 +14383,71 @@ async function run(argv, importMeta, {
|
|
|
14278
14383
|
}
|
|
14279
14384
|
}
|
|
14280
14385
|
|
|
14386
|
+
const require$1 = require$$5.createRequire((typeof document === 'undefined' ? require$$0.pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli.js', document.baseURI).href)));
|
|
14387
|
+
const CMD_NAME = constants.YARN;
|
|
14388
|
+
const description = 'Run yarn with the Socket wrapper';
|
|
14389
|
+
const hidden = true;
|
|
14390
|
+
const cmdYarn = {
|
|
14391
|
+
description,
|
|
14392
|
+
hidden,
|
|
14393
|
+
run
|
|
14394
|
+
};
|
|
14395
|
+
async function run(argv, importMeta, context) {
|
|
14396
|
+
const {
|
|
14397
|
+
parentName
|
|
14398
|
+
} = {
|
|
14399
|
+
__proto__: null,
|
|
14400
|
+
...context
|
|
14401
|
+
};
|
|
14402
|
+
const config = {
|
|
14403
|
+
commandName: CMD_NAME,
|
|
14404
|
+
description,
|
|
14405
|
+
hidden,
|
|
14406
|
+
flags: {
|
|
14407
|
+
...flags.commonFlags
|
|
14408
|
+
},
|
|
14409
|
+
help: command => `
|
|
14410
|
+
Usage
|
|
14411
|
+
$ ${command} ...
|
|
14412
|
+
|
|
14413
|
+
API Token Requirements
|
|
14414
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME}`)}
|
|
14415
|
+
|
|
14416
|
+
Note: Everything after "yarn" is passed to the yarn command.
|
|
14417
|
+
Only the \`--dry-run\` and \`--help\` flags are caught here.
|
|
14418
|
+
|
|
14419
|
+
Use \`socket wrapper on\` to alias this command as \`yarn\`.
|
|
14420
|
+
|
|
14421
|
+
Examples
|
|
14422
|
+
$ ${command}
|
|
14423
|
+
$ ${command} install
|
|
14424
|
+
$ ${command} add package-name
|
|
14425
|
+
$ ${command} dlx package-name
|
|
14426
|
+
`
|
|
14427
|
+
};
|
|
14428
|
+
const cli = utils.meowOrExit({
|
|
14429
|
+
argv,
|
|
14430
|
+
config,
|
|
14431
|
+
importMeta,
|
|
14432
|
+
parentName
|
|
14433
|
+
});
|
|
14434
|
+
const dryRun = !!cli.flags['dryRun'];
|
|
14435
|
+
if (dryRun) {
|
|
14436
|
+
logger.logger.log(constants.default.DRY_RUN_BAILING_NOW);
|
|
14437
|
+
return;
|
|
14438
|
+
}
|
|
14439
|
+
const shadowBin = /*@__PURE__*/require$1(constants.default.shadowYarnBinPath);
|
|
14440
|
+
process.exitCode = 1;
|
|
14441
|
+
|
|
14442
|
+
// Filter Socket flags from argv.
|
|
14443
|
+
const filteredArgv = utils.filterFlags(argv, config.flags);
|
|
14444
|
+
const {
|
|
14445
|
+
spawnPromise
|
|
14446
|
+
} = await shadowBin(filteredArgv);
|
|
14447
|
+
await spawnPromise;
|
|
14448
|
+
process.exitCode = 0;
|
|
14449
|
+
}
|
|
14450
|
+
|
|
14281
14451
|
const rootCommands = {
|
|
14282
14452
|
analytics: cmdAnalytics,
|
|
14283
14453
|
'audit-log': cmdAuditLog,
|
|
@@ -14294,6 +14464,7 @@ const rootCommands = {
|
|
|
14294
14464
|
manifest: cmdManifest,
|
|
14295
14465
|
npm: cmdNpm,
|
|
14296
14466
|
npx: cmdNpx,
|
|
14467
|
+
pnpm: cmdPnpm,
|
|
14297
14468
|
oops: cmdOops,
|
|
14298
14469
|
optimize: cmdOptimize,
|
|
14299
14470
|
organization: cmdOrganization,
|
|
@@ -14306,7 +14477,8 @@ const rootCommands = {
|
|
|
14306
14477
|
security: cmdOrganizationPolicySecurity,
|
|
14307
14478
|
'threat-feed': cmdThreatFeed,
|
|
14308
14479
|
uninstall: cmdUninstall,
|
|
14309
|
-
wrapper: cmdWrapper
|
|
14480
|
+
wrapper: cmdWrapper,
|
|
14481
|
+
yarn: cmdYarn
|
|
14310
14482
|
};
|
|
14311
14483
|
const rootAliases = {
|
|
14312
14484
|
audit: {
|
|
@@ -14396,7 +14568,11 @@ void (async () => {
|
|
|
14396
14568
|
name: constants.default.SOCKET_CLI_BIN_NAME,
|
|
14397
14569
|
registryUrl,
|
|
14398
14570
|
ttl: 86_400_000 /* 24 hours in milliseconds */,
|
|
14399
|
-
version: constants.default.ENV.INLINED_SOCKET_CLI_VERSION
|
|
14571
|
+
version: constants.default.ENV.INLINED_SOCKET_CLI_VERSION,
|
|
14572
|
+
logCallback: (name, version, latest) => {
|
|
14573
|
+
logger.logger.log(`\n\nš¦ Update available for ${vendor.yoctocolorsCjsExports.cyan(name)}: ${vendor.yoctocolorsCjsExports.gray(version)} ā ${vendor.yoctocolorsCjsExports.green(latest)}`);
|
|
14574
|
+
logger.logger.log(`š ${vendor.terminalLinkExports('View changelog', `https://socket.dev/npm/package/${name}/files/${latest}/CHANGELOG.md`)}`);
|
|
14575
|
+
}
|
|
14400
14576
|
});
|
|
14401
14577
|
try {
|
|
14402
14578
|
await utils.meowWithSubcommands(rootCommands, {
|
|
@@ -14464,5 +14640,5 @@ void (async () => {
|
|
|
14464
14640
|
await utils.captureException(e);
|
|
14465
14641
|
}
|
|
14466
14642
|
})();
|
|
14467
|
-
//# debugId=
|
|
14643
|
+
//# debugId=daab38d0-ec51-45c9-a27a-928a16433b42
|
|
14468
14644
|
//# sourceMappingURL=cli.js.map
|